pub enum AgentEvent {
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§
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).
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentEvent
impl Debug for AgentEvent
Source§impl<'de> Deserialize<'de> for AgentEvent
impl<'de> Deserialize<'de> for AgentEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnsafeUnpin for AgentEvent
impl UnwindSafe for AgentEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more