pub enum AgentEvent {
AssistantText {
delta: String,
},
ToolUse {
tool_use_id: String,
tool: String,
input: Value,
},
ToolResult {
tool_use_id: String,
output: Value,
is_error: bool,
},
Cost {
cost_usd: f64,
tokens: TokenCounts,
},
Done {
response: String,
transcript: Vec<AgentTurn>,
},
Error {
message: String,
},
}Expand description
Discriminated streaming event. Same union for both the agent
pane (renders into the UI) and the drone Agent block
(accumulates until Done, returns AgentRunResult).
Provider-specific extension goes through a Custom variant
reserved here but intentionally not shipped Phase 1.5 — leave
the enum open for it. See spec §8 risks.
Variants§
AssistantText
Streaming text chunk from the assistant. Agent pane appends
to the visible transcript; drone Agent block buffers
until Done.
ToolUse
Tool invocation about to run. input is the provider’s raw
tool input JSON; renderers may dispatch on tool name.
ToolResult
Tool execution result.
Cost
Final cost + token accounting. Emitted once per run, before
Done.
Done
Run completed successfully. response is the final assistant
message text (the drone Agent block’s primary output).
transcript is the full ordered turn list for audit / replay.
Error
Run failed. message is the user-facing error.
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.