Documentation
¶
Overview ¶
Package web serves the Overkill browser UI: an embedded SPA over HTTP plus a WebSocket event channel for live agent streams. Same agent backend as the TUI; reads from the same session store.
Index ¶
- Constants
- Variables
- type AgentSender
- type CanvasComponent
- type CanvasEvent
- type CanvasState
- type CanvasStore
- func (s *CanvasStore) Apply(ctx context.Context, sid, line string) (CanvasState, error)
- func (s *CanvasStore) Get(ctx context.Context, sid string) (CanvasState, error)
- func (s *CanvasStore) Migrate(ctx context.Context) error
- func (s *CanvasStore) Reset(ctx context.Context, sid string) (CanvasState, error)
- type CanvasSurface
- type Config
- type FlowStore
- type Server
Constants ¶
const ( CanvasMaxRevision int64 = 9007199254740991 CatalogCanvasV1 = "overkill.canvas.v1" CanvasMaxComponents = 128 CanvasMaxDepth = 16 CanvasMaxTextBytes = 16 * 1024 CanvasMaxDataBytes = 64 * 1024 CanvasMaxStateBytes = 256 * 1024 CanvasMaxSurfaces = 16 CanvasMaxRenderedNodes = 2048 )
Variables ¶
var Assets embed.FS
Assets is the SPA bundle compiled into the binary. Listed explicitly so the build fails loudly if a file goes missing instead of silently shipping an empty page.
var ErrCanvasInvalid = errors.New("invalid canvas update")
var ErrCanvasSessionNotFound = errors.New("canvas session not found")
Functions ¶
This section is empty.
Types ¶
type AgentSender ¶
type AgentSender interface {
Stream(ctx context.Context, userInput string) (<-chan agent.StreamEvent, error)
Model() string
SessionID() string
SetSessionID(id string)
}
AgentSender is the slice of agent.Agent the web server actually needs. Defining it locally keeps the package mockable in tests.
type CanvasComponent ¶
type CanvasEvent ¶
type CanvasEvent struct {
Type string `json:"type"` // always "a2ui"
SessionID string `json:"sessionId"`
SurfaceID string `json:"surfaceId,omitempty"`
Action string `json:"action"` // "surfaceUpdate", "beginRendering", etc.
JSONL string `json:"jsonl"` // One line of A2UI JSON
Timestamp time.Time `json:"timestamp"`
Revision int64 `json:"revision"`
}
CanvasEvent transports a committed custom-catalog update over the event bus. The action names are transport conventions, not full upstream A2UI support.
type CanvasState ¶
type CanvasState struct {
SessionID string `json:"sessionId"`
Revision int64 `json:"revision"`
Surfaces []CanvasSurface `json:"surfaces"`
}
CanvasState is the durable overkill.canvas.v1 document, not upstream A2UI.
type CanvasStore ¶
type CanvasStore struct {
// contains filtered or unexported fields
}
CanvasStore retains custom catalog documents. The caller owns the pool.
func NewCanvasStore ¶
func NewCanvasStore(db *sql.DB) *CanvasStore
func (*CanvasStore) Apply ¶
func (s *CanvasStore) Apply(ctx context.Context, sid, line string) (CanvasState, error)
func (*CanvasStore) Get ¶
func (s *CanvasStore) Get(ctx context.Context, sid string) (CanvasState, error)
func (*CanvasStore) Reset ¶
func (s *CanvasStore) Reset(ctx context.Context, sid string) (CanvasState, error)
type CanvasSurface ¶
type Config ¶
type Config struct {
Addr string
Token string
NoAuth bool
Agent AgentSender // required for /api/send to work
Store session.Store // optional; persistence
Flows *FlowStore // optional; durable managed workflow records
Canvas *CanvasStore // optional; durable canvas state
CanvasChromePath string // trusted administrator browser executable for snapshots
Catalog *providers.Catalog // optional; powers the model picker
PairingStore *security.PairingStore // optional; powers the /api/pairing/* endpoints
Provider string
Version string
}
Config drives Server construction. Token is required unless NoAuth is true (only meaningful with a localhost listen address).
type FlowStore ¶
type FlowStore struct {
// contains filtered or unexported fields
}
FlowStore persists managed workflow records, separately from suspended agent continuation snapshots. Updating a record does not execute an agent.
func NewFlowStore ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP front for the web UI.
func (*Server) Handler ¶
Handler returns the http.Handler so tests can drive it without a TCP socket.