Skip to main content

meerkat_store/
lib.rs

1//! meerkat-store - Session persistence for Meerkat
2//!
3//! This crate provides storage backends for persisting conversation sessions.
4
5// On wasm32, use tokio_with_wasm as a drop-in replacement for tokio.
6#[cfg(target_arch = "wasm32")]
7pub mod tokio {
8    pub use tokio_with_wasm::alias::*;
9}
10
11pub mod adapter;
12#[cfg(not(target_arch = "wasm32"))]
13pub mod approval_file_store;
14pub mod artifact;
15pub mod blob;
16mod error;
17
18#[cfg(not(target_arch = "wasm32"))]
19pub mod index;
20#[cfg(not(target_arch = "wasm32"))]
21pub mod realm;
22#[cfg(all(feature = "sqlite", not(target_arch = "wasm32")))]
23pub mod schedule_sqlite_store;
24
25#[cfg(all(feature = "jsonl", not(target_arch = "wasm32")))]
26pub mod jsonl;
27
28#[cfg(feature = "memory")]
29pub mod memory;
30
31#[cfg(all(feature = "sqlite", not(target_arch = "wasm32")))]
32pub mod sqlite_store;
33
34pub use adapter::StoreAdapter;
35#[cfg(not(target_arch = "wasm32"))]
36pub use approval_file_store::FileApprovalStore;
37pub use artifact::MemoryArtifactStore;
38pub use blob::MemoryBlobStore;
39pub use error::StoreError;
40
41// Re-export the canonical trait, filter, and error from meerkat-core.
42// Custom storage backends depend only on meerkat-core; existing consumers
43// of meerkat-store see no change.
44pub use meerkat_core::{SessionFilter, SessionStore, SessionStoreError};
45
46#[cfg(not(target_arch = "wasm32"))]
47pub use artifact::FsArtifactStore;
48#[cfg(not(target_arch = "wasm32"))]
49pub use blob::FsBlobStore;
50#[cfg(not(target_arch = "wasm32"))]
51pub use realm::{
52    REALM_LEASE_HEARTBEAT_SECS, REALM_LEASE_STALE_TTL_SECS, RealmBackend, RealmLeaseGuard,
53    RealmLeaseRecord, RealmLeaseStatus, RealmManifest, RealmManifestEntry, RealmOrigin, RealmPaths,
54    derive_workspace_realm_id, ensure_realm_manifest, ensure_realm_manifest_in, fnv1a64_hex,
55    generate_realm_id, inspect_realm_leases, inspect_realm_leases_in, list_realm_manifests_in,
56    open_realm_session_store, open_realm_session_store_in, realm_lease_dir, realm_paths,
57    realm_paths_in, sanitize_realm_id, start_realm_lease, start_realm_lease_in,
58};
59#[cfg(all(feature = "sqlite", not(target_arch = "wasm32")))]
60pub use schedule_sqlite_store::SqliteScheduleStore;
61#[cfg(all(feature = "sqlite", not(target_arch = "wasm32")))]
62pub use sqlite_store::SqliteSessionStore;
63
64#[cfg(all(feature = "jsonl", not(target_arch = "wasm32")))]
65pub use jsonl::JsonlStore;
66
67#[cfg(feature = "memory")]
68pub use memory::MemoryStore;