packages/agent/src/protocol.ts. It’s how CLI, TUI, and web all attach to a running daemon.
Version numbers
DAEMON_PROTOCOL_VERSION— bumps only on incompatible changes.DAEMON_SCHEMA_REVISION— bumps on schema changes.
- Backward-compatible — old clients keep working with new daemons without a change.
- Capability-gated — the daemon only sends the new thing to clients that advertised support.
- Incompatible — old clients cannot talk to new daemons. Requires a
DAEMON_PROTOCOL_VERSIONbump.
Capability negotiation
Clients advertise capabilities on connect. The daemon checks capabilities before sending new commands or depending on events the client doesn’t understand. New daemon commands must not be part of startup without a protocol or capability gate — otherwise old clients would fail to connect.Compatibility tests
Every wire change updates:- The compatibility maps.
- The new-client / old-daemon test.
- The old-client / new-daemon test.
Related
- Daemon — how to run it.
- Streaming protocol — the event shape flowing over the daemon protocol.