Documentation
¶
Overview ¶
Package server wires the MCP server (stdio) to the browser manager, the tool handlers and the Cockpit.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Version string
BrowsersDir string
ProfilesDir string
ProfileDir string
// ProfileName is the profile's name (--profile; "default"), "" for a --profile-dir outside
// the profiles directory. Per-profile data keys on it.
ProfileName string
// Session is a saved login (--session): every launch uses a fresh ephemeral profile seeded
// with it, deleted on exit. SessionsDir is where the session tool saves (~/.daisybell/sessions).
Session *storagestate.State
SessionsDir string
// RetouchesDir holds the per-site CSS the human kept (~/.daisybell/retouches; "" leaves
// retouches off). The Cockpit injects them whether or not the retouch group is on.
RetouchesDir string
// MapsDir holds this profile's site maps (map group). "" is <home>/maps/<profile key>
// (paths.MapsKey: the profile name, or a hash of a --profile-dir outside the profiles).
MapsDir string
Headless bool
// DownloadsDir overrides ~/Downloads/daisybell.
DownloadsDir string
// Bus receives activity events and Hook runs before every input (both optional, in addition
// to the Cockpit's).
Bus activity.Bus
Hook activity.PreActionHook
Logger *slog.Logger
Progress io.Writer
// NoCockpit disables the side panel / overlay extension and its hub.
NoCockpit bool
// Speed is the cockpit speed mode: watch, brisk or turbo.
Speed string
// CockpitDir holds unpacked extension builds (default: <BrowsersDir>/../extension).
CockpitDir string
// CockpitFiles replaces the embedded extension build (tests: a stale or broken build).
CockpitFiles fs.FS
// Cockpit tunes the hub (tests: MaxBlock, Seed). Logger, Speed and ExtensionID are filled in.
Cockpit cockpit.Options
// Browser tunes the launch (tests: window size, extra args). The fields above win.
Browser browser.Options
// Approve is the approval policy: risky (default), all or none.
Approve guard.Policy
// AskWait bounds how long one tool call waits for the human (default 50 s).
AskWait time.Duration
// AllowedHosts restricts navigation, popups and form submissions (empty: everything).
AllowedHosts guard.Hosts
// Human is asked together with the Cockpit for approvals, handoffs and questions (tests: a
// scripted human).
Human guard.Asker
// Record is the recording mode: timeline (default: events + a picture per action), full
// (also a screencast while the AI acts) or off.
Record record.Mode
// RecordHuman keeps recording while the human drives (default: paused, for privacy).
RecordHuman bool
// RecordingsDir overrides ~/.daisybell/recordings; RecordKeep is how many sessions are kept.
RecordingsDir string
RecordKeep int
// RecordMaxTotal caps all recordings together (--record-max; default 1 GB): the oldest
// sessions go first.
RecordMaxTotal int64
// NoFlows leaves out flow_save / flow_list / flow_run. FlowsHome overrides ~/.daisybell (flows
// go to <FlowsHome>/flows) and WorkDir the project directory (<WorkDir>/.daisybell/flows).
NoFlows bool
FlowsHome string
WorkDir string
// Lang is the human-facing language (--lang: en or pt-BR) of the Cockpit and of elicitation
// forms; "" follows the browser (Cockpit) and the OS locale (forms).
Lang string
// PageLang is the language pages see (--page-lang; default en-US), independent of Lang.
PageLang string
// Permissions are site permissions granted to every site (--permissions); the rest are denied.
Permissions []string
// Tools are the tool groups clients see (--tools; nil: tools.DefaultGroups). Recording runs
// per Record whether or not the record tool is listed.
Tools tools.Groups
}
Options configures the server.
type ProbeResult ¶
type ProbeResult struct {
// Cockpit is false with NoCockpit or when the hub could not start.
Cockpit bool
// Connected: the Cockpit's service worker said hello.
Connected bool
// Reinstalled: the extension had to be installed a second time in this launch.
Reinstalled bool
// StaleWorker: because the profile held a worker speaking another protocol version (left by
// an older build), which the launch replaced: the next launches on that profile connect at once.
StaleWorker bool
}
ProbeResult is what a probe launch saw.
type Stack ¶
type Stack struct {
Server *mcp.Server
Browser *browser.Manager
// Cockpit is nil with NoCockpit or when the hub could not start.
Cockpit *cockpit.Hub
Catalog *tools.Catalog
// Recorder is nil with --record off.
Recorder *record.Recorder
}
Stack is a wired Daisybell: the MCP server, its browser and (unless disabled) the Cockpit hub.