pub trait AgentSession: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn send_input<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn output_receiver(&mut self) -> Option<Receiver<AgentOutput>>;
fn is_alive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn force_kill<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A running agent session that can receive input and emit output.
Required Methods§
Sourcefn send_input<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_input<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a follow-up user message to the agent (starts a new turn).
Sourcefn output_receiver(&mut self) -> Option<Receiver<AgentOutput>>
fn output_receiver(&mut self) -> Option<Receiver<AgentOutput>>
Take the output receiver.
Returns Some on the first call, None thereafter (the receiver is moved
out so that the caller owns it).
Sourcefn is_alive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_alive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check whether the underlying process / connection is still alive.
Performance contract: Implementations MUST return promptly with no I/O.
This method may be called while the orchestrator holds internal locks (e.g.,
inside TeamOrchestrator::are_alive).
A typical implementation is a single AtomicBool::load.