CliHarness

Trait CliHarness 

Source
pub trait CliHarness: Debug {
    // Required methods
    fn harness_name(&self) -> HarnessName;
    fn binary(&self) -> &str;
    fn build_args(&self, config: &HarnessRunConfig) -> Vec<String>;
}
Expand description

A CLI-based harness that spawns a binary with streaming I/O.

Implementors describe which binary to run and how to build its argument list. The blanket Harness impl handles spawning, streaming, inactivity monitoring, and result collection — so individual harnesses only need to provide a few declarative methods.

§Examples

use ito_core::harness::{Harness, HarnessName, HarnessRunConfig};
use ito_core::harness::streaming_cli::CliHarness;

#[derive(Debug)]
struct MyHarness;

impl CliHarness for MyHarness {
    fn harness_name(&self) -> HarnessName { HarnessName::Codex }
    fn binary(&self) -> &str { "codex" }
    fn build_args(&self, config: &HarnessRunConfig) -> Vec<String> {
        vec!["exec".into(), config.prompt.clone()]
    }
}

let h = MyHarness;
assert_eq!(h.harness_name(), HarnessName::Codex);

Required Methods§

Source

fn harness_name(&self) -> HarnessName

The harness identity (e.g. HarnessName::Claude).

Source

fn binary(&self) -> &str

The CLI binary to spawn (e.g. "claude", "codex").

Source

fn build_args(&self, config: &HarnessRunConfig) -> Vec<String>

Build the full argument list for a single invocation.

Called once per Harness::run. The returned args are passed directly to the binary — the trait handles spawning and streaming.

Implementors§