pub struct AcpHarness { /* private fields */ }Expand description
An ACP agent driven as a Harness. The vendor is configuration (the
command to spawn), not a type — ::opencode() and ::custom(...) are
constructors over one adapter.
Implementations§
Source§impl AcpHarness
impl AcpHarness
Sourcepub fn opencode() -> Self
pub fn opencode() -> Self
OpenCode over ACP — spawns opencode acp. opencode reads a JSON config
file named by $OPENCODE_CONFIG; its model field (a provider/model
id) selects the model, and opencode models lists the available ids — so
this constructor wires launch-time model selection (list_models + the
per-run RunTuning model).
Sourcepub fn custom(config: AcpHarnessConfig) -> Self
pub fn custom(config: AcpHarnessConfig) -> Self
Any ACP agent, configured by an AcpHarnessConfig: command + args
that launch it as an ACP server over stdio, with named fields so the call
site reads clearly.
Trait Implementations§
Source§impl Harness for AcpHarness
impl Harness for AcpHarness
Source§fn readiness(&self) -> Readiness
fn readiness(&self) -> Readiness
Probe availability / version / auth. May shell out; callers
should treat it as blocking and run it off the UI thread.
Source§fn start(
&self,
request: RunRequest,
on_event: RunCallback,
) -> Result<RunHandle, Error>
fn start( &self, request: RunRequest, on_event: RunCallback, ) -> Result<RunHandle, Error>
Start a run, streaming events through
on_event. Returns a
handle immediately; work continues on background threads.Source§fn credential(&self) -> CredentialSpec
fn credential(&self) -> CredentialSpec
The credential this harness needs.
Source§fn list_models(&self) -> Result<Vec<ModelChoice>, Error>
fn list_models(&self) -> Result<Vec<ModelChoice>, Error>
Source§fn model_management(&self) -> Option<ModelManagement>
fn model_management(&self) -> Option<ModelManagement>
Whether this harness can install/list/delete its own models locally, and
if so the endpoint metadata a host UI can surface (see
ModelManagement). None (the default) means model management isn’t
supported — a host hides the “Manage models” surface. Only the
openai-compatible Ollama adapter returns Some today.Source§fn list_installed_models(&self) -> Result<Vec<InstalledModel>, Error>
fn list_installed_models(&self) -> Result<Vec<InstalledModel>, Error>
Installed local models with their on-disk size + details, for a manager
UI (distinct from
list_models, the picker’s
name-only set). Default: unsupported — override alongside
model_management. Blocking (hits the local
server); run it off the UI thread.Source§fn pull_model(
&self,
_model: &str,
_cancel: &AtomicBool,
_on_progress: PullProgressCallback<'_>,
) -> Result<(), Error>
fn pull_model( &self, _model: &str, _cancel: &AtomicBool, _on_progress: PullProgressCallback<'_>, ) -> Result<(), Error>
Download (install) a model, streaming progress to
on_progress. cancel
is polled during the download; flipping it aborts the pull. Blocking
until the download finishes (or fails / is cancelled); run it off the UI
thread. Default: unsupported.Source§fn delete_model(&self, _model: &str) -> Result<(), Error>
fn delete_model(&self, _model: &str) -> Result<(), Error>
Remove an installed local model. Removing one that’s already absent
succeeds (the requested end state). Default: unsupported.
Source§fn login(&self, _on_event: InstallCallback) -> Result<(), Error>
fn login(&self, _on_event: InstallCallback) -> Result<(), Error>
Trigger the harness’s own interactive sign-in (its CLI’s OAuth),
streaming progress as
InstallEvents. The flow opens the user’s
browser; this blocks until the login process exits, then
Done { ok } reports success. This is the agent authenticating
itself — distinct from installing it, which the host’s user does.
Default: unsupported, for harnesses the host authenticates by key.Source§fn run(
&self,
request: RunRequest,
) -> Result<(RunHandle, Receiver<RunEvent>), Error>
fn run( &self, request: RunRequest, ) -> Result<(RunHandle, Receiver<RunEvent>), Error>
Convenience over
run for callers that want to
pull events off a channel instead of supplying a push callback.
Forwards each RunEvent into an mpsc channel and hands the
receiver back alongside the run handle, so the caller can simply
for event in rx { … } rather than re-write the
Arc::new(move |ev| tx.send(ev)) plumbing at every call site. Read moreAuto Trait Implementations§
impl Freeze for AcpHarness
impl RefUnwindSafe for AcpHarness
impl Send for AcpHarness
impl Sync for AcpHarness
impl Unpin for AcpHarness
impl UnsafeUnpin for AcpHarness
impl UnwindSafe for AcpHarness
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
Mutably borrows from an owned value. Read more