pub struct Activity {
pub task: Option<String>,
pub ctx: Option<String>,
pub phase: Phase,
pub tool: Option<String>,
pub round: u32,
pub tokens_in: u64,
pub tokens_out: u64,
pub started_ms: u64,
pub updated_ms: u64,
}Expand description
One working unit’s live activity.
Fields§
§task: Option<String>The A2A task this unit answers (the client keys on it), when it has one.
ctx: Option<String>The conversation, when the unit is a turn.
phase: Phase§tool: Option<String>The tool executing right now (phase tool).
round: u32The model round this unit is on (1-based).
tokens_in: u64Tokens this unit has spent so far.
tokens_out: u64§started_ms: u64When the unit started (clients tick elapsed from this).
updated_ms: u64Implementations§
Source§impl Activity
impl Activity
Sourcepub fn apply(&mut self, event: &str, fields: &Value) -> bool
pub fn apply(&mut self, event: &str, fields: &Value) -> bool
Fold one progress frame in. Returns true when the change is worth
telling clients about (phase / tool / round moved) — token-only and
clock-only updates are silent.
Sourcepub fn park(&mut self, what: &str) -> bool
pub fn park(&mut self, what: &str) -> bool
Park the unit (a deferred tool: sleep, subagent, human gate).
pub fn to_value(&self) -> Value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Activity
impl RefUnwindSafe for Activity
impl Send for Activity
impl Sync for Activity
impl Unpin for Activity
impl UnsafeUnpin for Activity
impl UnwindSafe for Activity
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