#[non_exhaustive]pub enum WorldEvent {
Spawned {
run_id: String,
agent_id: String,
blueprint: String,
},
Status {
run_id: String,
agent_id: String,
status: String,
stage: String,
iteration: usize,
tool_calls: usize,
accepts_messages: bool,
},
Tokens {
run_id: String,
agent_id: String,
prompt_tokens: usize,
completion_tokens: usize,
cached_tokens: usize,
cache_write_tokens: usize,
},
Context {
run_id: String,
agent_id: String,
total_tokens: usize,
max_tokens: usize,
},
Interaction {
run_id: String,
agent_id: String,
request: InteractionRequest,
},
Completed {
run_id: String,
agent_id: String,
status: String,
},
StageTransition {
run_id: String,
agent_id: String,
from: String,
to: String,
iteration: usize,
},
ToolCallStarted {
run_id: String,
agent_id: String,
call_id: String,
tool: String,
},
ToolCallFinished {
run_id: String,
agent_id: String,
call_id: String,
tool: String,
ok: bool,
summary: String,
},
Log {
run_id: String,
agent_id: String,
line: String,
},
}Expand description
A change in the world, broadcast to subscribers (the HTTP/WS gateway and
in-process embedders) so they get pushed updates instead of polling. The
coarse per-run variants (Spawned/Status/Tokens/Context/Completed)
are emitted by the host’s change-detection pass as it drives the world;
StageTransition/ToolCallStarted/ToolCallFinished/Log are pushed at
the source by pipeline systems through WorldEventSink. Streamed over the
control transport via ControlRequest::Subscribe.
Marked non-exhaustive: new variants are additive, so consumers outside this crate must keep a catch-all arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Spawned
A run first appeared in the world.
Fields
Status
A run’s status, stage, iteration, or tool-call count changed.
Fields
Tokens
A run’s token totals changed.
Fields
Context
A run’s context-window token usage changed.
Fields
Interaction
A run raised a new interaction awaiting an answer.
Fields
request: InteractionRequestThe interaction request.
Completed
A run reached a terminal status.
Fields
StageTransition
A run moved from one stage to another. Emitted by the transition systems
at the moment the new stage is entered (the initial stage at spawn is
covered by WorldEvent::Spawned, not by this).
Fields
ToolCallStarted
A tool call was handed to the async tool lane for execution. Inline calls (context tools, refusals, gate blocks) resolve without touching the lane and don’t produce this event.
Fields
ToolCallFinished
A lane-executed tool call returned. Paired with
WorldEvent::ToolCallStarted by call_id.
Fields
Log
A run produced a per-agent log/output line (readable assistant output or
an operational [Tokens: …] / [tool] … / [error] … line).
Implementations§
Trait Implementations§
Source§impl Clone for WorldEvent
impl Clone for WorldEvent
Source§fn clone(&self) -> WorldEvent
fn clone(&self) -> WorldEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorldEvent
impl Debug for WorldEvent
Source§impl<'de> Deserialize<'de> for WorldEvent
impl<'de> Deserialize<'de> for WorldEvent
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>,
Source§impl PartialEq for WorldEvent
impl PartialEq for WorldEvent
Source§impl Serialize for WorldEvent
impl Serialize for WorldEvent
impl StructuralPartialEq for WorldEvent
Auto Trait Implementations§
impl Freeze for WorldEvent
impl RefUnwindSafe for WorldEvent
impl Send for WorldEvent
impl Sync for WorldEvent
impl Unpin for WorldEvent
impl UnsafeUnpin for WorldEvent
impl UnwindSafe for WorldEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.