1#![allow(clippy::result_large_err)]
72#![deny(missing_docs)]
73
74#[cfg(any(feature = "sqlite", feature = "postgres"))]
75pub mod approval;
77pub mod archive;
78#[cfg(any(feature = "sqlite", feature = "postgres"))]
79pub mod audit_log;
81pub mod consent_gate;
83#[cfg(any(feature = "sqlite", feature = "postgres"))]
84mod durable_sql;
85pub mod event;
87#[cfg(any(feature = "sqlite", feature = "postgres"))]
88pub mod governance_state;
90pub mod history;
91pub mod inmemory;
93#[cfg(any(feature = "sqlite", feature = "postgres"))]
94pub mod lease;
96pub mod migration;
98#[cfg(any(feature = "sqlite", feature = "postgres"))]
99pub mod run_store;
101#[cfg(any(feature = "sqlite", feature = "postgres"))]
102pub mod schedule;
104pub mod service;
106pub mod session;
108pub mod state;
110pub mod state_utils;
112pub mod subject;
113#[cfg(any(feature = "sqlite", feature = "postgres"))]
114pub mod subject_sql;
116
117#[cfg(any(feature = "redis", feature = "mongodb", feature = "neo4j", feature = "firestore"))]
118mod durable_common;
119#[cfg(any(feature = "mongodb", feature = "neo4j", feature = "firestore"))]
120mod durable_transitions;
121#[cfg(any(feature = "redis", feature = "mongodb", feature = "neo4j", feature = "firestore"))]
122mod subject_common;
123
124#[cfg(feature = "encrypted-session")]
125pub mod encrypted;
127#[cfg(feature = "encrypted-session")]
128pub mod encrypted_approval;
130#[cfg(feature = "encrypted-session")]
131pub mod encryption_key;
133#[cfg(feature = "encrypted-session")]
134pub mod envelope;
136#[cfg(feature = "firestore")]
137pub mod firestore;
139#[cfg(feature = "firestore")]
140pub mod firestore_audit_log;
142#[cfg(feature = "firestore")]
143pub mod firestore_runtime;
145#[cfg(feature = "firestore")]
146pub mod firestore_stores;
148#[cfg(feature = "mongodb")]
149pub mod mongodb;
151#[cfg(feature = "mongodb")]
152pub mod mongodb_audit_log;
154#[cfg(feature = "mongodb")]
155pub mod mongodb_runtime;
157#[cfg(feature = "mongodb")]
158pub mod mongodb_stores;
160#[cfg(feature = "neo4j")]
161pub mod neo4j;
163#[cfg(feature = "neo4j")]
164pub mod neo4j_audit_log;
166#[cfg(feature = "neo4j")]
167pub mod neo4j_runtime;
169#[cfg(feature = "neo4j")]
170pub mod neo4j_stores;
172#[cfg(feature = "postgres")]
173pub mod postgres;
175#[cfg(feature = "postgres")]
176pub mod postgres_action_ledger;
178#[cfg(feature = "redis")]
179pub mod redis;
181#[cfg(feature = "redis")]
182pub mod redis_audit_log;
184#[cfg(feature = "redis")]
185pub mod redis_runtime;
187#[cfg(feature = "redis")]
188pub mod redis_stores;
190#[cfg(any(feature = "sqlite", feature = "postgres"))]
191pub mod spend;
193#[cfg(feature = "sqlite")]
194pub mod sqlite;
196#[cfg(feature = "sqlite")]
197pub mod sqlite_action_ledger;
199#[cfg(feature = "firestore")]
200pub mod subject_firestore;
202#[cfg(feature = "mongodb")]
203pub mod subject_mongodb;
205#[cfg(feature = "neo4j")]
206pub mod subject_neo4j;
208#[cfg(feature = "redis")]
209pub mod subject_redis;
211#[cfg(feature = "vertex-session")]
212pub mod vertex;
214
215pub use archive::{
216 ARCHIVE_AUTHOR, ARCHIVE_KEY, ArchiveMark, SESSION_BUNDLE_FORMAT, SessionBundle, ensure_writable,
217};
218pub use consent_gate::ConsentGatedSessionService;
219pub use event::{Event, EventActions, Events};
220pub use history::{
221 FORK_ORIGIN_KEY, ForkOrigin, ForkRequest, HistoryChange, HistoryEdit, HistoryOperation,
222 HistoryOutcome, HistoryRewrite, ImportSessionRequest, RewriteHistoryRequest, RewrittenHistory,
223 SessionHistory,
224};
225pub use inmemory::InMemorySessionService;
226pub use service::{
227 AppendEventRequest, CreateRequest, DeleteRequest, GetRequest, ListRequest, SessionService,
228};
229pub use session::{KEY_PREFIX_APP, KEY_PREFIX_TEMP, KEY_PREFIX_USER, Session};
230pub use state::{ReadonlyState, State};
231pub use state_utils::{extract_state_deltas, merge_states};
232pub use subject::SessionSubjectData;
233#[cfg(feature = "firestore")]
234pub use subject_firestore::{FirestoreConsentStore, FirestoreSubjectRegistry};
235#[cfg(feature = "mongodb")]
236pub use subject_mongodb::{MongoConsentStore, MongoSubjectRegistry};
237#[cfg(feature = "neo4j")]
238pub use subject_neo4j::{Neo4jConsentStore, Neo4jSubjectRegistry};
239#[cfg(feature = "redis")]
240pub use subject_redis::{RedisConsentStore, RedisSubjectRegistry};
241#[cfg(feature = "postgres")]
242pub use subject_sql::{PostgresConsentStore, PostgresSubjectRegistry};
243#[cfg(feature = "sqlite")]
244pub use subject_sql::{SqliteConsentStore, SqliteSubjectRegistry};
245
246#[cfg(feature = "postgres")]
247pub use approval::PostgresApprovalStore;
248#[cfg(feature = "sqlite")]
249pub use approval::SqliteApprovalStore;
250#[cfg(feature = "postgres")]
251pub use audit_log::PostgresAuditLogStore;
252#[cfg(feature = "sqlite")]
253pub use audit_log::SqliteAuditLogStore;
254#[cfg(feature = "firestore")]
255pub use firestore_audit_log::FirestoreAuditLogStore;
256#[cfg(feature = "firestore")]
257pub use firestore_runtime::{
258 FirestoreGovernanceStateStore, FirestoreLeaseStore, FirestoreRunStore, FirestoreScheduleStore,
259};
260#[cfg(feature = "firestore")]
261pub use firestore_stores::{FirestoreActionLedger, FirestoreApprovalStore, FirestoreSpendLedger};
262#[cfg(feature = "postgres")]
263pub use governance_state::PostgresGovernanceStateStore;
264#[cfg(feature = "sqlite")]
265pub use governance_state::SqliteGovernanceStateStore;
266#[cfg(feature = "postgres")]
267pub use lease::PostgresLeaseStore;
268#[cfg(feature = "sqlite")]
269pub use lease::SqliteLeaseStore;
270#[cfg(feature = "mongodb")]
271pub use mongodb_audit_log::MongoAuditLogStore;
272#[cfg(feature = "mongodb")]
273pub use mongodb_runtime::{
274 MongoGovernanceStateStore, MongoLeaseStore, MongoRunStore, MongoScheduleStore,
275};
276#[cfg(feature = "mongodb")]
277pub use mongodb_stores::{MongoActionLedger, MongoApprovalStore, MongoSpendLedger};
278#[cfg(feature = "neo4j")]
279pub use neo4j_audit_log::Neo4jAuditLogStore;
280#[cfg(feature = "neo4j")]
281pub use neo4j_runtime::{
282 Neo4jGovernanceStateStore, Neo4jLeaseStore, Neo4jRunStore, Neo4jScheduleStore,
283};
284#[cfg(feature = "neo4j")]
285pub use neo4j_stores::{Neo4jActionLedger, Neo4jApprovalStore, Neo4jSpendLedger};
286#[cfg(feature = "postgres")]
287pub use postgres_action_ledger::PostgresActionLedger;
288#[cfg(feature = "redis")]
289pub use redis_audit_log::RedisAuditLogStore;
290#[cfg(feature = "redis")]
291pub use redis_runtime::{
292 RedisGovernanceStateStore, RedisLeaseStore, RedisRunStore, RedisScheduleStore,
293};
294#[cfg(feature = "redis")]
295pub use redis_stores::{RedisActionLedger, RedisApprovalStore, RedisSpendLedger};
296#[cfg(feature = "postgres")]
297pub use run_store::PostgresRunStore;
298#[cfg(feature = "sqlite")]
299pub use run_store::SqliteRunStore;
300#[cfg(feature = "postgres")]
301pub use schedule::PostgresScheduleStore;
302#[cfg(feature = "sqlite")]
303pub use schedule::SqliteScheduleStore;
304#[cfg(feature = "postgres")]
305pub use spend::PostgresSpendLedger;
306#[cfg(feature = "sqlite")]
307pub use spend::SqliteSpendLedger;
308#[cfg(feature = "sqlite")]
309pub use sqlite::SqliteSessionService;
310#[cfg(feature = "sqlite")]
311pub use sqlite_action_ledger::SqliteActionLedger;
312
313#[cfg(feature = "encrypted-session")]
314pub use encrypted::EncryptedSession;
315#[cfg(feature = "encrypted-session")]
316pub use encrypted_approval::EncryptedApprovalStore;
317#[cfg(feature = "encrypted-session")]
318pub use encryption_key::EncryptionKey;
319#[cfg(feature = "firestore")]
320pub use firestore::{
321 FirestoreSessionConfig, FirestoreSessionService, app_state_path as firestore_app_state_path,
322 event_path as firestore_event_path, session_path as firestore_session_path,
323 user_state_path as firestore_user_state_path,
324};
325#[cfg(feature = "mongodb")]
326pub use mongodb::MongoSessionService;
327#[cfg(feature = "neo4j")]
328pub use neo4j::Neo4jSessionService;
329#[cfg(feature = "postgres")]
330pub use postgres::PostgresSessionService;
331#[cfg(feature = "redis")]
332pub use redis::{
333 RedisSessionConfig, RedisSessionService, app_state_key, events_key, index_key, session_key,
334 updated_index_key, user_state_key,
335};
336#[cfg(feature = "vertex-session")]
337pub use vertex::{VertexAiSessionConfig, VertexAiSessionService};