Every state change on a session is anDocumentation Index
Fetch the complete documentation index at: https://zpg6.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AgentEvent. Events stream over SSE and persist to history.
Lifecycle
| Type | Payload | When |
|---|---|---|
message.created | { message } | A user or assistant message is added. |
part.appended | { messageId, part } | A new part (text delta, tool call, file). |
part.updated | { messageId, partId, part } | A tool call transitioned (e.g. running → completed). |
permission.asked | { tool, reason, callId } | A tool is waiting for approval. |
json_reply.failed | { attempt, lastError } | Schema-enforced reply failed validation; retrying. |
Terminal
Every session ends in exactly one terminal event:| Type | Payload |
|---|---|
session.completed | { terminal: { kind: "reply" | "json_reply", text | value } } |
session.completed_degraded | same, plus degraded: true |
session.aborted | { reason?: string } |
Consuming
Guarantees
- Every session reaches a terminal event. Consumers never hang.
seqis strictly monotonic per session. Gaps indicate missed events; reconnect withsinceSeqto replay.- Recent events are kept available for replay — any practical reconnect window is covered. For older history, use
GET /session/<id>/history.