Skip to main content

SessionChannel

Trait SessionChannel 

Source
pub trait SessionChannel: Send + Sync {
    // Required methods
    fn emit(&self, event: &SessionEvent) -> Result<(), SessionChannelError>;
    fn receive(
        &self,
        timeout: Duration,
    ) -> Result<Option<HumanInput>, SessionChannelError>;
    fn channel_id(&self) -> &str;
}
Expand description

A bidirectional channel between a human and a TA-mediated agent session.

Every interaction between human and TA is a message on a channel. The CLI is one channel. A Discord thread is another. The protocol is the same.

Required Methods§

Source

fn emit(&self, event: &SessionEvent) -> Result<(), SessionChannelError>

Display agent output to the human (streaming).

Source

fn receive( &self, timeout: Duration, ) -> Result<Option<HumanInput>, SessionChannelError>

Receive human input (blocks until available or timeout). Returns None on timeout.

Source

fn channel_id(&self) -> &str

Channel identity (for audit trail). e.g., “cli:tty0”, “discord:thread:123”, “slack:C04:1234567890”

Implementors§