pub struct AgentManager { /* private fields */ }Expand description
Core agent manager implementation
Manages agent lifecycles without GUI dependencies. GUI/Tauri-specific features are in the GUI crate’s wrapper.
Implementations§
Source§impl AgentManager
impl AgentManager
Sourcepub async fn spawn_agent(&self, id: String, name: String)
pub async fn spawn_agent(&self, id: String, name: String)
Spawn a lightweight agent task that listens for commands
This is a basic implementation. GUI can override spawn behavior by wrapping this manager.
Sourcepub async fn spawn_agent_with_request(&self, request: AgentSpawnRequest)
pub async fn spawn_agent_with_request(&self, request: AgentSpawnRequest)
Spawn a lightweight agent using an explicit configuration request.
Sourcepub async fn get_agent_status(&self, id: &str) -> Option<AgentInfo>
pub async fn get_agent_status(&self, id: &str) -> Option<AgentInfo>
Get status information for a specific agent
Sourcepub async fn list_agents(&self) -> Vec<AgentInfo>
pub async fn list_agents(&self) -> Vec<AgentInfo>
List all active agents
Sourcepub async fn update_activity(&self, id: &str)
pub async fn update_activity(&self, id: &str)
Update last activity timestamp for an agent
Sourcepub async fn send_event(&self, id: &str, payload: String)
pub async fn send_event(&self, id: &str, payload: String)
Publish an event to a specific agent if present
Sourcepub async fn shutdown_all(&self, grace_secs: u64)
pub async fn shutdown_all(&self, grace_secs: u64)
Gracefully shutdown all agents, waiting up to grace_secs for completion
Sourcepub fn default_db_path() -> PathBuf
pub fn default_db_path() -> PathBuf
Compute a default DB path under the user’s data dir
Trait Implementations§
Source§impl AgentSpawner for AgentManager
impl AgentSpawner for AgentManager
Source§fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn an agent and return its id
Source§fn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn an agent with an explicit request payload.
Source§fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send an event envelope to a running agent
Source§impl Clone for AgentManager
impl Clone for AgentManager
Source§fn clone(&self) -> AgentManager
fn clone(&self) -> AgentManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AgentManager
impl !RefUnwindSafe for AgentManager
impl Send for AgentManager
impl Sync for AgentManager
impl Unpin for AgentManager
impl !UnwindSafe for AgentManager
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