Skip to main content

cairn_runtime/
lib.rs

1//! # cairn-runtime
2//!
3//! The core of Cairn: an event-sourced agent runtime.
4//!
5//! Every model call, tool call, approval and policy decision is appended to a
6//! [`Journal`]. The agent's state is *only ever* a fold over those events
7//! ([`RunState::apply`]), so the same code path powers live execution, crash
8//! recovery, human-in-the-loop suspension and time-travel debugging.
9
10pub mod agent;
11pub mod budget;
12pub mod eval;
13pub mod event;
14pub mod journal;
15pub mod message;
16pub mod model;
17pub mod output;
18pub mod policy;
19pub mod pricing;
20pub mod state;
21pub mod testing;
22pub mod tool;
23
24pub use agent::{Agent, AgentBuilder, AgentError, RunOutcome};
25pub use budget::Budget;
26pub use event::{Event, EventKind};
27pub use journal::{InMemoryJournal, Journal, JournalError, JsonlJournal, LeaseHolder};
28pub use message::{Content, Message, Role};
29pub use model::{
30    FallbackModel, Model, ModelError, ModelRequest, ModelResponse, ModelStream, RejectedAttempt, StopReason,
31    StreamEvent, Usage, synthesize_stream,
32};
33pub use policy::{AllowAll, Decision, EffectPolicy, Policy};
34pub use pricing::{Priced, Pricing};
35pub use state::{PendingCall, RunState, Status};
36pub use tool::{Effect, Tool, ToolCtx, ToolError, ToolSpec, tool};