pub trait AgentManager: Send + Sync {
// Required methods
fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
config: SpawnConfig,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_agents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn agent_status<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AgentInfo>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn stop_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn await_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
timeout_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<AgentResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn pool_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn file_locks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for agent lifecycle management
Implement this trait to expose agent spawning and control capabilities via an MCP server without coupling to CLI-specific internals.
Required Methods§
Sourcefn spawn_agent<'life0, 'async_trait>(
&'life0 self,
config: SpawnConfig,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
config: SpawnConfig,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn a new agent and return its ID
Sourcefn list_agents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_agents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all currently active agents
Sourcefn agent_status<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AgentInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn agent_status<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AgentInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the current status of a specific agent
Sourcefn stop_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop a running agent
Sourcefn await_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
timeout_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<AgentResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn await_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
timeout_secs: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<AgentResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Wait for an agent to complete and return its result
If timeout_secs is Some, returns an error if the agent has not
completed within the given number of seconds.