pub struct AgentRegistry {
pub agents: Vec<AgentEntry>,
pub scratchpad: Vec<ScratchpadEntry>,
pub logical_sessions: Vec<LogicalSessionPresence>,
pub logical_session_telemetry_seen: bool,
pub updated_at: DateTime<Utc>,
}Fields§
§agents: Vec<AgentEntry>§scratchpad: Vec<ScratchpadEntry>§logical_sessions: Vec<LogicalSessionPresence>§logical_session_telemetry_seen: bool§updated_at: DateTime<Utc>Implementations§
Source§impl AgentRegistry
impl AgentRegistry
pub fn new() -> Self
pub fn register( &mut self, agent_type: &str, role: Option<&str>, project_root: &str, ) -> String
Sourcepub fn register_mcp_process(project_root: &str) -> Result<String, String>
pub fn register_mcp_process(project_root: &str) -> Result<String, String>
Atomically registers this MCP process in the shared on-disk registry.
Sourcepub fn heartbeat_persistent(agent_id: &str) -> Result<(), String>
pub fn heartbeat_persistent(agent_id: &str) -> Result<(), String>
Atomically refreshes a registered MCP process heartbeat.
Sourcepub fn finish_persistent(agent_id: &str) -> Result<(), String>
pub fn finish_persistent(agent_id: &str) -> Result<(), String>
Atomically marks a registered MCP process as finished.
pub fn update_heartbeat(&mut self, agent_id: &str)
pub fn set_status( &mut self, agent_id: &str, status: AgentStatus, message: Option<&str>, )
Sourcepub fn open_or_heartbeat_logical_session(
&mut self,
source: &str,
workspace: &str,
session_id: &str,
)
pub fn open_or_heartbeat_logical_session( &mut self, source: &str, workspace: &str, session_id: &str, )
Records explicit logical-session presence supplied by an owning editor integration. Tool activity is deliberately never treated as a session.
pub fn close_logical_session( &mut self, source: &str, workspace: &str, session_id: &str, ) -> bool
pub fn cleanup_stale_logical_sessions(&mut self, max_age_seconds: u64)
pub fn record_logical_session_presence( event: &str, source: &str, workspace: &str, session_id: &str, ) -> Result<(), String>
pub fn list_active(&self, project_root: Option<&str>) -> Vec<&AgentEntry>
pub fn list_all(&self) -> &[AgentEntry]
pub fn post_message( &mut self, from_agent: &str, to_agent: Option<&str>, category: &str, message: &str, ) -> String
pub fn post_message_full( &mut self, from_agent: &str, to_agent: Option<&str>, category: &str, message: &str, privacy: PrivacyLevel, priority: MessagePriority, ttl_hours: Option<u64>, ) -> String
pub fn read_messages(&mut self, agent_id: &str) -> Vec<&ScratchpadEntry>
pub fn read_unread(&mut self, agent_id: &str) -> Vec<&ScratchpadEntry>
pub fn cleanup_stale(&mut self, max_age_hours: u64)
pub fn save(&self) -> Result<(), String>
pub fn load() -> Option<Self>
pub fn load_or_create() -> Self
Sourcepub fn mutate_locked<T>(
f: impl FnOnce(&mut Self) -> T,
) -> Result<(Self, T), String>
pub fn mutate_locked<T>( f: impl FnOnce(&mut Self) -> T, ) -> Result<(Self, T), String>
Atomically load, mutate, and persist the registry under a single file
lock. load_or_create() + mutate + save() is a read-modify-write
race: save() only locks the final write, so two concurrent callers
(two MCP sessions registering, or the dashboard’s own poll-triggered
cleanup_stale + save) can each load a stale snapshot and the last
writer silently drops the other’s changes — e.g. a second session’s
registration vanishing from the dashboard. Holding the lock across
the re-read closes that window: the read inside always sees the
latest on-disk state.
Source§impl AgentRegistry
impl AgentRegistry
Trait Implementations§
Source§impl Clone for AgentRegistry
impl Clone for AgentRegistry
Source§fn clone(&self) -> AgentRegistry
fn clone(&self) -> AgentRegistry
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 AgentRegistry
impl Debug for AgentRegistry
Source§impl Default for AgentRegistry
impl Default for AgentRegistry
Source§impl<'de> Deserialize<'de> for AgentRegistry
impl<'de> Deserialize<'de> for AgentRegistry
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 AgentRegistry
impl RefUnwindSafe for AgentRegistry
impl Send for AgentRegistry
impl Sync for AgentRegistry
impl Unpin for AgentRegistry
impl UnsafeUnpin for AgentRegistry
impl UnwindSafe for AgentRegistry
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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