Part V · Contracts · Plate 04
Cortex client protocol
4. Cortex Supervisory Switchboard & Client Protocol
The daemon exposes HTTP and WebSocket interfaces for supervisory clients. The planned macOS and iOS apps (clients/macos, clients/ios) remain specified designs, not shipped applications. Client designs are not the authority for the daemon's implemented routes. Use the Cortex interface reference for the source-reviewed route, tool, configuration and error contracts.
- Owner-initiated device pairing (
CX-XXXXXX):- An authenticated owner sends
POST /api/v1/identity/pair/initiatewith the intended principal/surface and optional host URL and lifetime. The response is HTTP 201 withok, protocol/daemon versions andchallenge. Lifetime defaults to 60 seconds and is clamped to 5–600 seconds. - An unpaired client sends
POST /api/v1/identity/pair/exchangewithcode, optionaldeviceNameandsurface. Successful exchange returns HTTP 200 with the binding/token and versions; invalid, expired or reused codes return 400. Protect the code and issued token. These are not/api/v1/pairing/requestand/approveendpoints.
- An authenticated owner sends
- Bootstrap (
GET /api/v1/bootstrap):- Select
seatIdandconversationIdexplicitly. The bundle includesprotocolVersion: 1, daemon version, seats, active seat/conversation IDs, conversations, task graph, snapshot, entries,latestEntryId, switchboard state and identity data.lite=1omits the additional model catalog and ingress-status sections. afterEntryIdrequests durable entries after a saved cursor and setsentriesDelta.focus=1andstepUp=1can change supervisory focus; they are not read-only selectors. See the reference for aliases and role constraints.
- Select
- Cursor-aware WebSocket subscription (
/ws):- Authenticate the upgrade and select
seatId,conversationIdand optionalsinceEntryId. The first message isinitial_snapshot, with event/conversation snapshots and task graph; a cursor also addsdeltaEntries. Clients can later send asubscribemessage to select another conversation. - Replay applies to durable conversation entries, not every notification or external side effect. Retain cursors per seat/conversation, deduplicate by entry ID and recover current state on reconnect. Voice uses its own
/ws/voicesurface; this is not a replay log of all voice or model-server telemetry.
- Authenticate the upgrade and select
- Supervisory controls:
- Supported surfaces recognize
$focus/$tree,$focus <seatId>/$seat <seatId>, and$up/$back. Channel/switchboard controls accept atopdestination; the browser composer currently treats upward commands, includingtop, as one step. These change or inspect navigation. CLI operations such asabort,forkand model configuration are documented separately; a$prefix does not make every CLI verb a switchboard control.
- Supported surfaces recognize