Skip to main content

Module contract

Module contract 

Source
Expand description

The harness-integration seam: the AgentHarness / AgentSession traits. The harness-integration seam: the AgentHarness trait an integrator implements and the live AgentSession it produces.

This is the SDK’s published extension seam, mirroring aion-client’s WorkflowTransport (a dedicated #[async_trait] contract module). It is harness-blind by construction: no signature names a concrete harness, a transport, or a wire protocol. A harness is integrated by implementing these traits in a separate adapter crate; the seam speaks only neutral run identity, the neutral ActivityEvent / InterventionCommand types, the neutral InterventionCapabilities advertisement, and a neutral terminal Payload.

§Designed from two cases so it is provably general

The seam is designed against two deliberately different integrations at once, so it cannot be shaped by any one harness:

  • a full rich-path harness (a bidirectional channel, streamed events out, acknowledged commands in, a structured terminal result), and
  • a plain-stdout, observability-only CLI agent (no command channel at all): it demuxes interleaved stdout into ActivityEvents (mostly aion_core::ActivityEventKind::Raw), advertises an empty InterventionCapabilities set, and yields its final output as the result.

The empty-capability case is what forces AgentSession::intervene to be optional-by-capability: an empty advertisement is a valid, first-class tier, and a session that advertises it rejects every command with HarnessError::CapabilityNotSupported.

Traits§

AgentHarness
How to run one agent harness — the SDK’s published extension seam.
AgentSession
A live agent run for one activity attempt.
DynAgentHarness
An object-safe erased AgentHarness, so a worker can HOLD a harness behind a Arc<dyn DynAgentHarness> (the typed AgentHarness is not object-safe — it has an associated Session type).
DynAgentSession
An object-safe erased AgentSession, so a worker can drive a session behind a Box<dyn ..> without being generic over the concrete harness.