Skip to main content

Crate cairn_runtime

Crate cairn_runtime 

Source
Expand description

§cairn-runtime

The core of Cairn: an event-sourced agent runtime.

Every model call, tool call, approval and policy decision is appended to a Journal. The agent’s state is only ever a fold over those events (RunState::apply), so the same code path powers live execution, crash recovery, human-in-the-loop suspension and time-travel debugging.

Re-exports§

pub use agent::Agent;
pub use agent::AgentBuilder;
pub use agent::AgentError;
pub use agent::RunOutcome;
pub use budget::Budget;
pub use event::Event;
pub use event::EventKind;
pub use journal::InMemoryJournal;
pub use journal::Journal;
pub use journal::JournalError;
pub use journal::JsonlJournal;
pub use journal::LeaseHolder;
pub use message::Content;
pub use message::Message;
pub use message::Role;
pub use model::FallbackModel;
pub use model::Model;
pub use model::ModelError;
pub use model::ModelRequest;
pub use model::ModelResponse;
pub use model::ModelStream;
pub use model::RejectedAttempt;
pub use model::StopReason;
pub use model::StreamEvent;
pub use model::Usage;
pub use model::synthesize_stream;
pub use policy::AllowAll;
pub use policy::Decision;
pub use policy::EffectPolicy;
pub use policy::Policy;
pub use pricing::Priced;
pub use pricing::Pricing;
pub use state::PendingCall;
pub use state::RunState;
pub use state::Status;
pub use tool::Effect;
pub use tool::Tool;
pub use tool::ToolCtx;
pub use tool::ToolError;
pub use tool::ToolSpec;
pub use tool::tool;

Modules§

agent
budget
eval
Evals by replay: re-run recorded runs on a candidate configuration (e.g. another model), score the results and compare cost.
event
journal
message
model
output
Helpers for reading structured output out of model text.
policy
pricing
state
testing
Deterministic models for tests and offline examples.
tool