web/app/src/routes/api/) are how the browser talks to the agent runtime. Only the web server adapter (web/server/src/event-mapper.ts) imports agent packages; browser code consumes the wire format.
Routes
Additional routes exist for session listing, provider metadata, and session actions — see
web/app/src/routes/api/ for the current surface.
Event shapes
- NDJSON
ChatStreamEventon chat responses. See Streaming protocol for the event catalogue. - SSE
AgentSessionEventon/api/attachfor out-of-turn state changes (compaction ran, another client sent a turn, etc.).
Contracts
Wire contracts live inweb/protocol:
chat-protocol.ts— event catalogue and payload shapes.fleet-contract.ts—ChatAttachment,ProjectId, and zod schemas for the OpenUI wire contract.openui-prompt.ts— UI wire contract.
Related
- Web app — how to run the server.
- Streaming protocol — the wire format explained.