Skip to main content
Fleet Prime Agent is an independent UI and product layer over the external, TUI-first Prime Agent runtime. The web stack is the interface; the stock upstream prime-agent package is the execution engine.

Process boundary

Layers

Two boundary rules keep the layers honest:
  • Browser code (web/app, web/design) never imports prime-agent. It consumes web/protocol contracts over HTTP (NDJSON and SSE) only.
  • web/server owns 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 on 127.0.0.1:3000 by default and sets PRIME_AGENT_WORKSPACE_ROOT to 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.
Last modified on August 30, 2026