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§
Sourcefn emit(&self, event: &SessionEvent) -> Result<(), SessionChannelError>
fn emit(&self, event: &SessionEvent) -> Result<(), SessionChannelError>
Display agent output to the human (streaming).
Sourcefn receive(
&self,
timeout: Duration,
) -> Result<Option<HumanInput>, SessionChannelError>
fn receive( &self, timeout: Duration, ) -> Result<Option<HumanInput>, SessionChannelError>
Receive human input (blocks until available or timeout).
Returns None on timeout.
Sourcefn channel_id(&self) -> &str
fn channel_id(&self) -> &str
Channel identity (for audit trail). e.g., “cli:tty0”, “discord:thread:123”, “slack:C04:1234567890”