Skip to main content

salvor_core/
lib.rs

1//! Salvor core: the stable public surface for the event model, replay engine,
2//! and deterministic context of durable agent runs.
3//!
4//! A run is an append-only sequence of events; nothing else is state. On
5//! resume, completed model and tool calls are read from the log, never
6//! re-executed, and execution continues live from the first unrecorded step.
7//!
8//! # What lives where
9//!
10//! The types themselves live in [`salvor_replay`], a pure, IO-free crate that
11//! also builds for `wasm32-unknown-unknown` so the v0.3 browser inspector can
12//! fold event logs client-side. That crate holds the event vocabulary
13//! ([`Event`], [`EventEnvelope`], [`RunId`], [`SequenceNumber`],
14//! [`SCHEMA_VERSION`]), the replay cursor ([`ReplayCursor`] and its typed
15//! [`Outcome`] permits), the state fold ([`derive_state`] into [`RunState`]),
16//! the values read back out of a log ([`ParkReason`], [`RunSummary`]), and the
17//! event renderers ([`event_kind`], [`event_detail`]).
18//!
19//! `salvor-core` re-exports that surface unchanged. Every `salvor_core::` path
20//! that existed before the extraction keeps resolving, so the store, the
21//! runtime, the tools layer, and the CLI compile against the same names they
22//! always used. New code may depend on either crate; the names are identical.
23//! The split exists so the runtime and the browser inspector fold events with
24//! literally the same code, without the runtime's IO edge leaking into the
25//! pure path.
26
27pub use salvor_replay::{
28    BeginPermit, Budget, BudgetKind, Effect, Emitted, Event, EventEnvelope, ForkOrigin,
29    GraphBeginPermit, LogValidator, LoggedStep, ModelCallPermit, ModelReply, NowPermit, Outcome,
30    ParkReason, Parked, PendingCall, RandomPermit, ReplayCursor, ReplayError, RequestedStep, RunId,
31    RunState, RunStatus, RunSummary, SCHEMA_VERSION, SequenceNumber, TokenTotals, TokenUsage,
32    ToolCallPermit, UnresolvedWrite, ValidationError, derive_state, event_detail, event_kind,
33    validate_next,
34};