pub struct HarnessAdapter {
pub descriptor: WorkerDescriptor,
pub program: String,
pub build_args: ArgsBuilder,
pub plan_args: Option<ArgsBuilder>,
pub interactive_args: Option<ArgsBuilder>,
pub parse: OutputParser,
pub line_mapper: LineMapper,
pub prompt_via_stdin: bool,
pub default_timeout: Duration,
pub provisioner: Option<McpProvisioner>,
}Expand description
A generic harness worker driven over the subprocess-json transport. Each
concrete CLI supplies its program name, argv builder, output parser, and an
optional line mapper for richer streaming.
Fields§
§descriptor: WorkerDescriptor§program: String§build_args: ArgsBuilder§plan_args: Option<ArgsBuilder>Lean argv used when the harness runs as the planner (Role::Planner):
a plain-text completion, not the agentic/streaming work invocation. When
set, planning reads the full stdout as the answer (more robust across CLI
versions than parsing a streaming format). None → planning reuses
build_args and the normal parser unchanged.
interactive_args: Option<ArgsBuilder>Args for a real interactive harness TUI in an external Terminal window.
Must NOT use headless flags (-p, --output-format json, exec --json, …)
so the full product UI is visible. None → default: [prompt] (+ model if any).
parse: OutputParser§line_mapper: LineMapper§prompt_via_stdin: boolWhether the prompt is piped via stdin (vs. passed as an argument).
default_timeout: Duration§provisioner: Option<McpProvisioner>How this harness is told to use a node’s MCP servers (MCP_SKILLS.md §6).
None means the harness has no MCP provisioning wired: a node’s tools are
simply unavailable to it (the node still runs), so the conductor should
prefer an API worker for tool-heavy nodes on such a harness.
Implementations§
Source§impl HarnessAdapter
impl HarnessAdapter
Sourcepub fn with_models(self, models: Vec<String>) -> Self
pub fn with_models(self, models: Vec<String>) -> Self
Replace the static model ladder with a live (or config-merged) list.
Sourcepub fn ensure_model(self, model: &str) -> Self
pub fn ensure_model(self, model: &str) -> Self
Ensure model is on the ladder (appended as frontier if missing). Used
so a user pin / [models].by_worker entry is never dropped as “unknown”.
Trait Implementations§
Source§impl Worker for HarnessAdapter
impl Worker for HarnessAdapter
Source§fn serves_mcp_tools(&self) -> bool
fn serves_mcp_tools(&self) -> bool
A harness serves MCP tools when it has a provisioner wired (the provision
path, MCP_SKILLS.md §6).
Source§fn descriptor(&self) -> &WorkerDescriptor
fn descriptor(&self) -> &WorkerDescriptor
needs to a concrete worker.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecuteRequest,
events: EventSink,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecuteRequest,
events: EventSink,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
ExecStatus::Failed).Auto Trait Implementations§
impl Forget for HarnessAdapter
impl Freeze for HarnessAdapter
impl Move for HarnessAdapter
impl RefUnwindSafe for HarnessAdapter
impl Send for HarnessAdapter
impl Sync for HarnessAdapter
impl Unpin for HarnessAdapter
impl UnsafeUnpin for HarnessAdapter
impl UnwindSafe for HarnessAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.