prime-agent package is the execution engine.
Process boundary
Layers
Two boundary rules keep the layers honest:
- Browser code (
web/app,web/design) never importsprime-agent. It consumesweb/protocolcontracts over HTTP (NDJSON and SSE) only. web/serverowns the daemon connection, event mapping, session attachment, pending dialogs, and replay buffers.
PrimeBridge
PrimeBridge in web/server is the daemon client and Fleet session registry. Per session it keeps a BridgeSession, a ring buffer of the last 500 stream frames for SSE replay, and a pending-dialog registry with a 60-second timeout. It binds an ExtensionUIContext per session so engine-side confirm/select/input dialogs become tool-Question frames that the browser answers through POST /api/chat/question, and notify/setStatus/setWidget become state frames.
event-mapper.ts is a pure function from engine AgentSessionEvents to browser-safe ChatStreamEvents. Unknown engine events are ignored with a compile-time exhaustiveness tripwire until Fleet defines a presentation for them.
The daemon
web/server connects to the engine through the upstream daemon rather than in-process calls. On startup it probes the default daemon socket and, if needed, spawns the pinned runtime with --mode daemon. If the socket is owned by a daemon that is not the pinned version, the server refuses to attach and reports the mismatch instead of silently using an incompatible engine.
The launcher
fleet-agent (alias fleet-prime) is a small Node wrapper:
fleet-agent [--host <host>] [--port <port>]serves the production web bundle on127.0.0.1:3000by default and setsPRIME_AGENT_WORKSPACE_ROOTto the directory you launched from.fleet-agent agent <args>runs the pinned engine CLI directly.- If the production bundle is missing but a source checkout with dependencies exists, it falls back to the Vite dev server with a warning.
Runtime pin
PRIME_AGENT_RUNTIME.json records the upstream package, version, tarball URL, and SHA-256. packages/fleet-prime and web/server consume the same pinned tarball. Upstream source is never vendored or patched inside this repository. See Runtime pin and releases.