Events
CLI-JAW uses WebSocket for real-time updates and NDJSON for streaming AI responses.
WebSocket Connection
ws://localhost:3457/ws
The WebSocket connection receives all server events in real-time.
Key Events
| Event | Payload | Description |
|---|---|---|
message | {role, content} | Chat message (user or assistant) |
tool_use | {name, input} | Tool call by AI |
thinking | {content} | Extended thinking block |
status | {state} | Agent state change |
error | {message} | Error notification |
steer_started | {prompt} | Steer prompt injection |
goal_done | {goalId} | Goal completed |
goal_cancel | {goalId} | Goal cancelled |
NDJSON Stream
Chat responses are streamed as newline-delimited JSON:
POST /api/chat
Content-Type: application/json
{"message": "Hello"}
Response (streaming):
{"type":"thinking","content":"..."}
{"type":"text","content":"Hello! "}
{"type":"text","content":"How can I help?"}
{"type":"done"}
Trace Files
Session traces are saved to ~/.cli-jaw/traces/ as NDJSON files. Each line is a timestamped event.