Skip to main content

walrus_cli/runner/
mod.rs

1//! Runner trait abstracting the execution mode.
2//!
3//! Uses RPITIT — no dyn dispatch. The CLI connects to walrusd via
4//! Unix domain socket.
5
6use anyhow::Result;
7use futures_core::Stream;
8use std::future::Future;
9
10pub mod gateway;
11
12/// Unified interface for sending messages and streaming responses.
13pub trait Runner {
14    /// Send a one-shot message and return the response content.
15    fn send(&mut self, agent: &str, content: &str) -> impl Future<Output = Result<String>> + Send;
16
17    /// Stream a response, yielding content text chunks.
18    fn stream<'a>(
19        &'a mut self,
20        agent: &'a str,
21        content: &'a str,
22    ) -> impl Stream<Item = Result<String>> + Send + 'a;
23}