pub enum AgentEvent {
PermissionRequested {
proposal: Box<Proposal>,
raw: Value,
},
PermissionResponded {
request_id: String,
delivery: Delivery,
raw: Value,
},
Init {
session_id: String,
model: String,
raw: Value,
},
Text {
text: String,
raw: Value,
},
ToolUse {
tool: String,
summary: String,
raw: Value,
},
ToolResult {
tool: Option<String>,
denied: bool,
summary: String,
raw: Value,
},
Result {
text: String,
is_error: bool,
usage: TokenUsage,
cost_usd: Option<f64>,
num_turns: Option<u32>,
raw: Value,
},
Other {
raw: Value,
},
}Expand description
Normalized events surfaced from a session’s output stream.
raw always carries the full original stream-json line for transcript
fidelity; the variants extract only what the engine acts on.
Variants§
PermissionRequested
A live one-call request. It cannot be answered through a user message.
PermissionResponded
Transport receipt, distinct from the tool’s eventual effect.
Init
First message of a session (type: "system", subtype: "init").
Text
Assistant text output.
ToolUse
Assistant requested a tool.
Fields
ToolResult
Tool result returned to the model. denied is true when the call was
blocked by permission rules — surfaced so the dashboard shows
guardrails firing (§4.7).
Result
Terminal result (type: "result"). Exactly one per completed turn in
single-shot mode; in streaming mode one per injected turn.
Fields
usage: TokenUsageOther
Anything else (kept for transcripts; engine ignores).