1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//! Salvor is a durable execution runtime for AI agents, written in Rust.
//!
//! A salvor is the party that recovers a wrecked ship and its cargo. This runtime does the same for
//! a crashed agent run: every run is an append-only event log, so a process killed mid-step resumes
//! exactly where it stopped, with no repeated side effects.
//!
//! This crate is a facade. It holds no logic of its own; it re-exports the `salvor-*` family so one
//! dependency covers the library. Everything here is equally reachable by depending on the
//! individual crates, which is the better choice when you want a narrow build.
//!
//! # What the default features give you
//!
//! The agent loop ([`runtime`]), the tool contract ([`tools`]), the SQLite event store ([`store`]),
//! the Messages API client ([`llm`]), and the event model and replay engine ([`core`]). That is the
//! set needed to define an agent, point it at a model, run it, kill it, and resume it.
//!
//! `llm` rides along with `runtime` rather than sitting behind its own opt-in: `runtime` already
//! depends on `salvor-llm` unconditionally, since the agent loop has no code path that skips
//! calling a model, so the dependency (`reqwest` and the rest of that tree) is compiled into every
//! default build regardless of whether this feature is named. Turning `llm` on by default costs
//! nothing further; leaving it off by default would have cost a working `Config` import.
//!
//! # What is optional
//!
//! Each of these is off by default, because each pulls a dependency tree worth opting into
//! deliberately:
//!
//! - `graph`: the declarative graph document format and its validator.
//! - `engine`: the walker that executes a graph document. Implies `graph`.
//! - `server`: the HTTP and server-sent-events control plane.
//! - `wasm`: sandboxed WebAssembly component tools. Heavy, since it builds wasmtime.
//! - `mcp`: Model Context Protocol tools, forwarded to `salvor-tools`.
//!
//! # Versioning
//!
//! Every re-exported crate is pinned to this crate's exact version, so upgrading `salvor` moves the
//! whole family together and cannot mix versions that were never tested against each other.
/// The event model, replay cursor, and state fold: the durability engine's core.
///
/// Re-export of `salvor-core`. Pure and IO-free, which is also why it compiles to wasm for a
/// browser that wants to fold a log itself.
/// The agent loop, budgets, and the deterministic run context.
///
/// Re-export of `salvor-runtime`. This is the IO edge: the part that calls a model, records what it
/// did, and enforces the ceilings. Requires the `runtime` feature, on by default.
/// The tool contract: effect classification, typed handlers, and the `#[derive(Tool)]` macro.
///
/// Re-export of `salvor-tools`. Requires the `tools` feature, on by default.
/// The event store trait and its SQLite implementation.
///
/// Re-export of `salvor-store`. Requires the `store` feature, on by default.
/// The declarative graph document format and its validator.
///
/// Re-export of `salvor-graph`. Requires the `graph` feature.
/// The walker that executes a graph document: linear chains, gates, branches, maps, and forks.
///
/// Re-export of `salvor-engine`. Requires the `engine` feature.
/// The HTTP and server-sent-events control plane over the durable runtime.
///
/// Re-export of `salvor-server`. Requires the `server` feature.
/// The Messages API client, for hosted and local model endpoints.
///
/// Re-export of `salvor-llm`. Requires the `llm` feature, on by default.
/// Sandboxed WebAssembly component tools, run under wasmtime with WASI capabilities denied.
///
/// Re-export of `salvor-wasm`. Requires the `wasm` feature.
/// The run input a caller hands to `Runtime::start`, as unstructured JSON.
///
/// Re-export of `serde_json::json`. Every run input and completed output crosses the log as a
/// `serde_json::Value`, so this stays available without an extra `serde_json` dependency line in
/// a caller's own `Cargo.toml`.
pub use json;
/// The handful of names most programs want, in one import.
///
/// Deliberately small: enough to define an agent, point it at a model, give it tools, run it
/// against a store, and read the outcome. Anything more specific is one module path away.