pub struct Activity {
pub agent_id: String,
pub collective_id: CollectiveId,
pub current_task: Option<String>,
pub context_summary: Option<String>,
pub started_at: Timestamp,
pub last_heartbeat: Timestamp,
}Expand description
A stored agent activity — presence record within a collective.
Activities track which agents are currently operating in a collective, what they’re working on, and when they last checked in. This enables agent coordination and discovery.
§Key Design
Activities are uniquely identified by (collective_id, agent_id).
Re-registering with the same pair replaces the existing activity
(upsert semantics).
§Staleness
An activity is considered stale when last_heartbeat is older than
Config::activity::stale_threshold. Stale activities are excluded
from get_active_agents() results but remain in storage until
explicitly ended or the collective is deleted.
Fields§
§agent_id: StringThe agent’s identifier (e.g., “claude-opus”, “agent-47”).
collective_id: CollectiveIdThe collective this activity belongs to.
current_task: Option<String>What the agent is currently working on (max 1KB).
context_summary: Option<String>Summary of the agent’s current context (max 1KB).
started_at: TimestampWhen this activity was first registered.
last_heartbeat: TimestampWhen the agent last sent a heartbeat.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Activity
impl<'de> Deserialize<'de> for Activity
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more