pub enum AgentEvent {
Show 13 variants
Start {
thread_id: ThreadId,
turn: usize,
},
Thinking {
text: String,
},
TextDelta {
delta: String,
},
Text {
text: String,
},
ToolCallStart {
id: String,
name: String,
input: Value,
tier: ToolTier,
},
ToolCallEnd {
id: String,
name: String,
result: ToolResult,
},
ToolRequiresConfirmation {
id: String,
name: String,
input: Value,
description: String,
},
ToolRequiresPin {
id: String,
name: String,
input: Value,
description: String,
},
TurnComplete {
turn: usize,
usage: TokenUsage,
},
Done {
thread_id: ThreadId,
total_turns: usize,
total_usage: TokenUsage,
duration: Duration,
},
Error {
message: String,
recoverable: bool,
},
ContextCompacted {
original_count: usize,
new_count: usize,
original_tokens: usize,
new_tokens: usize,
},
SubagentProgress {
subagent_id: String,
subagent_name: String,
tool_name: String,
tool_context: String,
completed: bool,
success: bool,
tool_count: u32,
total_tokens: u64,
},
}Expand description
Events emitted by the agent loop during execution. These are streamed to the client for real-time UI updates.
Variants§
Start
Agent loop has started
Thinking
Agent is “thinking” - streaming text that may be shown as typing indicator
TextDelta
A text delta for streaming responses
Text
Complete text block from the agent
ToolCallStart
Agent is about to call a tool
ToolCallEnd
Tool execution completed
ToolRequiresConfirmation
Tool requires confirmation before execution
ToolRequiresPin
Tool requires PIN verification
TurnComplete
Agent turn completed (one LLM round-trip)
Done
Agent loop completed successfully
Error
An error occurred during execution
ContextCompacted
Context was compacted to reduce size
Fields
SubagentProgress
Progress update from a running subagent
Fields
Implementations§
Source§impl AgentEvent
impl AgentEvent
pub const fn start(thread_id: ThreadId, turn: usize) -> Self
pub fn thinking(text: impl Into<String>) -> Self
pub fn text_delta(delta: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
pub fn tool_call_start( id: impl Into<String>, name: impl Into<String>, input: Value, tier: ToolTier, ) -> Self
pub fn tool_call_end( id: impl Into<String>, name: impl Into<String>, result: ToolResult, ) -> Self
pub const fn done( thread_id: ThreadId, total_turns: usize, total_usage: TokenUsage, duration: Duration, ) -> Self
pub fn error(message: impl Into<String>, recoverable: bool) -> Self
pub const fn context_compacted( original_count: usize, new_count: usize, original_tokens: usize, new_tokens: usize, ) -> Self
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 · 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 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