Events

CLI-JAW uses an SSE-first event channel for the Web UI, with legacy WebSocket fallback and provider-specific stream parsers behind it.

SSE Event Channel

GET http://localhost:3457/api/events

The preferred browser event transport is GET /api/events. It is a data-only SSE stream: the server does not set an SSE event: field. Each message carries topic and event inside the JSON payload.

BehaviorContract
Replay cursorLast-Event-ID header or ?lastEventId= query
Replay buffer1000 events in src/core/event-bus.ts
Listener cap256 active SSE listeners; overflow returns 503 {error:"SSE_CAPACITY"}
Heartbeatcomment ping every 15 seconds
Replay gap{"topic":"system","event":"replay_gap"}
FallbackWebSocket is used only when SSE never opens, usually against an older server
Transient drop UXFast SSE reconnects stay silent; only a disconnect lasting longer than 8 seconds posts a disconnected message

WebSocket Compatibility

ws://localhost:3457/ws

The WebSocket path is a client/TUI fallback for pre-X-01 servers where /api/events never opens. Current servers deliver public browser events through SSE only. Internal-only events are not delivered to public SSE clients.

Common Event Names

EventDescription
agent_statusAgent lifecycle status such as running, done, error, evaluating.
agent_toolTool, thinking, search, command, or subagent progress step.
agent_outputLive assistant text preview chunk.
agent_doneAuthoritative final response, error, and bounded tool log.
agent_retry / agent_fallbackTransient retry and fallback-chain status.
queue_updatePending message queue length.
new_messageInbound or queued user message bubble.
orc_statePABCD/IPABCD state update.
orchestrate_done / orchestrate_warningWorkflow completion or non-blocking warning.
steer_startedAccepted steer prompt.
goal_done / goal_cancel / goal_pause_detected / goal_pause_gate_pendingPersistent goal lifecycle events.
session_switched / session_created / session_listMulti-session updates.
memory_statusMemory runtime/sidebar refresh signal.
worker_stalled / worker_disconnected / worker_timeoutDistributed worker progress failure signals.
schedule_wakeup / schedule_wakeup_failedScheduleWakeup lifecycle.

Provider Streams

Provider CLIs still use their own stdout protocols internally. Claude, Codex, Cursor, Grok, and Copilot are normalized through src/agent/events/*. AGY uses plain-text print mode. The normalized events pass through src/core/bus.ts, which publishes public events to the SSE event bus and still fans out to internal collectors/forwarders.

Manager Worker SSE

The jaw dashboard serve React manager app reads manager HTTP endpoints by polling. Worker instance live progress is bridged server-side: src/manager/worker-events.ts and src/manager/worker-sse-client.ts subscribe to each worker's GET /api/events stream and update the latest-message cache.

Detailed source-of-truth: structure/stream-events.md and structure/server_api.md.