Skip to main content

Events

Sessions expose two typed directions:

  • Session.Send(ClientEvent) sends commands to the runtime.
  • Session.Events yields runtime events until the Session ends.

Client events

TypeMeaning
user.messageStarts a Turn using the supplied content blocks.
interruptCancels the active Turn and ends the Session.
tool.tool_confirmationReserved for approval flow; not fully implemented.

Agent events

TypeMeaning
agent.messageFinal assistant content for a Turn.
agent.tool_useA tool is about to execute.
agent.tool_resultA tool completed successfully.
agent.statusSession/Turn progress such as running or completed.
agent.errorA runtime or model error visible to the caller.

The command serializes each Event as one JSON object per stdout line. This is NDJSON framing, not HTTP Server-Sent Events. A transport may translate these typed events into SSE or another protocol outside the kernel.

Event fields are not yet versioned. Consumers should reject unknown required semantics but tolerate additional JSON fields.