pub trait HeadlessRunner: Send + Sync {
// Required methods
fn start<'a>(
&'a self,
task_id: &'a str,
prompt: &'a str,
working_dir: &'a Path,
model: Option<&'a str>,
) -> BoxFuture<'a, Result<SessionHandle>>;
fn interactive_command(&self, session_id: &str) -> Vec<String>;
fn harness(&self) -> Harness;
}Expand description
Trait for headless agent execution
Implementations provide the ability to start agents in headless mode with streaming JSON output, and to generate commands for interactive session continuation.
This trait uses boxed futures to be dyn-compatible, allowing runtime
polymorphism via Box<dyn HeadlessRunner>.
Required Methods§
Sourcefn start<'a>(
&'a self,
task_id: &'a str,
prompt: &'a str,
working_dir: &'a Path,
model: Option<&'a str>,
) -> BoxFuture<'a, Result<SessionHandle>>
fn start<'a>( &'a self, task_id: &'a str, prompt: &'a str, working_dir: &'a Path, model: Option<&'a str>, ) -> BoxFuture<'a, Result<SessionHandle>>
Start an agent with a prompt
Returns a SessionHandle that can be used to receive events, wait for completion, or interrupt the session.
Sourcefn interactive_command(&self, session_id: &str) -> Vec<String>
fn interactive_command(&self, session_id: &str) -> Vec<String>
Get the command to launch interactive mode for session continuation
Returns the command and arguments needed to resume the session
interactively (e.g., claude --resume <session_id>).