Skip to main content

aios_protocol/
lib.rs

1//! # aios-protocol — Canonical Agent OS Protocol
2//!
3//! This crate defines the shared types, event taxonomy, and trait interfaces
4//! that all Agent OS projects (Arcan, Lago, Autonomic) depend on.
5//!
6//! It is intentionally dependency-light (no runtime deps like tokio, axum, or redb)
7//! so it can be used as a pure contract crate.
8//!
9//! ## Module Overview
10//!
11//! - [`ids`] — Typed ID wrappers (SessionId, EventId, BranchId, BlobHash, etc.)
12//! - [`event`] — EventEnvelope + EventKind (~55 variants, forward-compatible)
13//! - [`state`] — AgentStateVector, BudgetState (homeostasis vitals)
14//! - [`mode`] — OperatingMode, GatingProfile (operating constraints)
15//! - [`policy`] — Capability, PolicySet, PolicyEvaluation
16//! - [`tool`] — ToolCall, ToolOutcome
17//! - [`memory`] — SoulProfile, Observation, Provenance, MemoryScope
18//! - [`session`] — SessionManifest, BranchInfo, CheckpointManifest
19//! - [`ports`] — Runtime boundary ports (event store, provider, tools, policy, approvals, memory)
20//! - [`error`] — KernelError, KernelResult
21
22pub mod error;
23pub mod event;
24pub mod ids;
25pub mod memory;
26pub mod mode;
27pub mod policy;
28pub mod ports;
29pub mod session;
30pub mod state;
31pub mod tool;
32
33// Re-export the most commonly used types at the crate root.
34pub use error::{KernelError, KernelResult};
35pub use event::{
36    ActorType, ApprovalDecision, EventActor, EventEnvelope, EventKind, EventRecord, EventSchema,
37    LoopPhase, PolicyDecisionKind, RiskLevel, SnapshotType, SpanStatus, TokenUsage,
38};
39pub use ids::{
40    AgentId, ApprovalId, BlobHash, BranchId, CheckpointId, EventId, MemoryId, RunId, SeqNo,
41    SessionId, SnapshotId, ToolRunId,
42};
43pub use memory::{FileProvenance, MemoryScope, Observation, Provenance, SoulProfile};
44pub use mode::{GatingProfile, OperatingMode};
45pub use policy::{Capability, PolicyEvaluation, PolicySet};
46pub use ports::{
47    ApprovalPort, ApprovalRequest, ApprovalResolution, ApprovalTicket, EventRecordStream,
48    EventStorePort, ModelCompletion, ModelCompletionRequest, ModelDirective, ModelProviderPort,
49    ModelStopReason, PolicyGateDecision, PolicyGatePort, ToolExecutionReport, ToolExecutionRequest,
50    ToolHarnessPort,
51};
52pub use session::{
53    BranchInfo, BranchMergeResult, CheckpointManifest, ModelRouting, SessionManifest,
54};
55pub use state::{
56    AgentStateVector, BlobRef, BudgetState, CanonicalState, MemoryNamespace, PatchApplyError,
57    PatchOp, ProvenanceRef, StatePatch, VersionedCanonicalState,
58};
59pub use tool::{ToolCall, ToolOutcome};