Documentation
¶
Overview ¶
Package web serves the single-file session viewer on loopback and bridges it to internal/sessions/live: the browser gets whole events over SSE and writes back through POST /send, while credentials and transport stay in this process.
web.go is the entry point (Serve), server.go the HTTP routes and their guards, and hub.go the fan-out of live updates to connected pages. viewer/README.md says where the bundle and its wire protocol come from.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// ConsoleURL is the session's page in the web Console, for the header link.
ConsoleURL string
// OpenURL is called with the page's address once the server is listening;
// nil just prints it via Logf.
OpenURL func(string) error
// Logf reports the viewer URL and browser-open failures to the user; required.
Logf func(format string, args ...any)
}
Options configures Serve.
type Session ¶
type Session interface {
Updates() <-chan live.ThreadUpdate
Snapshot() (threads []live.Thread, logs []live.ThreadLog)
Events(id live.ThreadID) []live.Event
Session() *anthropic.BetaManagedAgentsSession
SendMessage(ctx context.Context, text string) error
Interrupt(ctx context.Context) error
Confirm(ctx context.Context, toolUseID string, allow bool, denyMessage string) error
}
Session is what the server needs from an attached session; *live.Threads is one.
Click to show internal directories.
Click to hide internal directories.