aion_integrations/lib.rs
1//! Harness-integration SDK for Aion — the inbound analogue of `aion-client`.
2//!
3//! Where [`aion-client`](https://docs.rs/aion-client) is the SDK for a caller *driving* Aion,
4//! `aion-integrations` is the SDK for an agent harness Aion *drives*. It defines the
5//! harness-neutral extension seam an integrator implements — the [`AgentHarness`] /
6//! [`AgentSession`] traits — plus the reusable machinery an adapter would otherwise hand-roll,
7//! and it re-exports the neutral `aion-core` types so an integrator has a single dependency.
8//!
9//! # The seam
10//!
11//! Implement [`AgentHarness`] (in a separate adapter crate) to teach Aion how to run one agent
12//! harness for one activity attempt. The seam is **harness-blind by construction**: no signature
13//! names a concrete harness, a transport, or a wire protocol. A session:
14//!
15//! - advertises which neutral intervention primitives it supports via
16//! [`AgentSession::capabilities`] — an **empty set is first-class** (an observability-only
17//! harness supports no interventions),
18//! - streams neutral [`ActivityEvent`]s OUT via [`AgentSession::events`],
19//! - accepts neutral [`InterventionCommand`]s IN via [`AgentSession::intervene`], and
20//! - yields a single terminal [`Payload`] via [`AgentSession::wait_result`].
21//!
22//! # Building blocks
23//!
24//! - [`jsonrpc`] — a generic JSON-RPC 2.0 over newline-delimited stdio helper (envelopes, id
25//! correlation, a single serializing writer) that **any** stdio-JSON-RPC adapter reuses. It is
26//! machinery, not a harness: it names no concrete harness and no method namespace.
27//!
28//! # Re-exported neutral types
29//!
30//! The neutral `aion-core` types the integration surface speaks are re-exported from the crate
31//! root (a curated re-export, the `aion-client` house style — not a blanket `pub use aion_core`),
32//! so an integrator depends only on `aion-integrations`.
33
34/// The harness-integration seam: the [`AgentHarness`] / [`AgentSession`] traits.
35pub mod contract;
36/// The harness-neutral error taxonomy for the seam.
37pub mod error;
38/// A generic JSON-RPC 2.0 over newline-delimited stdio building block.
39pub mod jsonrpc;
40/// The neutral run identity handed to a harness at start.
41pub mod spec;
42
43pub use contract::{AgentHarness, AgentSession, DynAgentHarness, DynAgentSession};
44pub use error::HarnessError;
45pub use spec::AgentRunSpec;
46
47// Curated re-export of the neutral `aion-core` types the integration surface speaks, so an
48// integrator has one dependency and never reaches directly into `aion-core` for these.
49pub use aion_core::{
50 ActivityEvent, ActivityEventKind, ApprovalDecision, ContentType, InjectPriority,
51 InterventionCapabilities, InterventionCommand, InterventionKind, InterventionPrimitive,
52 MessageRole, Payload, ProgressDetail, StopKind,
53};
54// The id types an `AgentRunSpec` needs, so the spec can be constructed without a second dependency.
55pub use aion_core::{ActivityId, WorkflowId};