AgentOutput

Trait AgentOutput 

Source
pub trait AgentOutput: Send + Sync {
    // Required method
    fn emit_event<'life0, 'async_trait>(
        &'life0 self,
        event: AgentEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn emit_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        level: MessageLevel,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn debug<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn emit_token_update<'life0, 'async_trait>(
        &'life0 self,
        token_usage: TokenUsage,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn info<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn warning<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn normal<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn emit_status_update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        status: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn request_confirmation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _request: &'life1 ConfirmationRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ConfirmationDecision, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn supports_realtime_updates(&self) -> bool { ... }
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Abstract output interface for agent execution

Required Methods§

Source

fn emit_event<'life0, 'async_trait>( &'life0 self, event: AgentEvent, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emit an agent event

Provided Methods§

Source

fn emit_message<'life0, 'life1, 'async_trait>( &'life0 self, level: MessageLevel, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit a message with specified level

Source

fn debug<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit debug message

Source

fn emit_token_update<'life0, 'async_trait>( &'life0 self, token_usage: TokenUsage, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emit token usage update

Source

fn info<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit info message

Source

fn warning<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit warning message

Source

fn error<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit error message

Source

fn normal<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit normal text message

Source

fn emit_status_update<'life0, 'life1, 'async_trait>( &'life0 self, status: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit status update (for interactive mode status reporting)

Source

fn request_confirmation<'life0, 'life1, 'async_trait>( &'life0 self, _request: &'life1 ConfirmationRequest, ) -> Pin<Box<dyn Future<Output = Result<ConfirmationDecision, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Request a confirmation decision from the output handler (UI/API) Default: deny (safe). Concrete outputs (CLI/UI) should override to prompt.

Source

fn supports_realtime_updates(&self) -> bool

Check if this output handler supports real-time updates

Source

fn flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Flush any buffered output (for implementations that buffer)

Implementors§