Skip to main content

RuntimeBridge

Trait RuntimeBridge 

Source
pub trait RuntimeBridge: Send + Sync {
    // Provided methods
    fn dispatch_ask_user(
        &self,
        args: &str,
        session_id: Option<u64>,
    ) -> impl Future<Output = String> + Send { ... }
    fn dispatch_delegate(
        &self,
        args: &str,
        agent: &str,
    ) -> impl Future<Output = String> + Send { ... }
    fn session_cwd(&self, _session_id: u64) -> Option<PathBuf> { ... }
    fn on_agent_event(
        &self,
        _agent: &str,
        _session_id: u64,
        _event: &AgentEvent,
    ) { ... }
}
Expand description

Trait for server-specific tool dispatch that the runtime cannot handle locally.

Provided Methods§

Source

fn dispatch_ask_user( &self, args: &str, session_id: Option<u64>, ) -> impl Future<Output = String> + Send

Handle ask_user — block until user replies.

Source

fn dispatch_delegate( &self, args: &str, agent: &str, ) -> impl Future<Output = String> + Send

Handle delegate — spawn sub-agent tasks.

Source

fn session_cwd(&self, _session_id: u64) -> Option<PathBuf>

Resolve the working directory for a session. Returns None to fall back to the runtime’s base cwd.

Source

fn on_agent_event(&self, _agent: &str, _session_id: u64, _event: &AgentEvent)

Called when an agent event occurs. The daemon uses this to broadcast protobuf events to console subscribers. Default: no-op.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§