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
//! # `oxide-mirror` — Local, Event-Sourced Data Mirror
//!
//! `oxide-mirror` keeps a SQLite-backed local copy of remote API data so AI
//! agents can run complex SQL queries (joins, aggregations, time-window
//! filters) across many services without paying the latency or rate-limit
//! cost of going over the wire every time.
//!
//! The crate is organised around four cooperating pieces:
//!
//! * [`event`] — the durable, append-only [`Delta`](event::Delta) log shape
//! that every sync source emits. Each delta carries an explicit
//! [`Provenance`](event::Provenance) (source id + confidence) so callers can
//! reason about who wrote what.
//! * [`source`] — the [`SyncSource`](source::SyncSource) trait that
//! `oxide-gen` generated clients implement. A source knows how to pull a
//! batch of deltas starting from a cursor and to advance the cursor when
//! the batch has been applied.
//! * [`store`] — [`MirrorStore`](store::MirrorStore) owns the SQLite pool,
//! the schema migrations, the event log, the materialised
//! [`MirroredRecord`](event::MirroredRecord) table, and the per-source
//! cursor table. Exposes [`MirrorStore::query`] for read-only SQL.
//! * [`sync`] — [`Syncer`](sync::Syncer) ties the previous two together,
//! pulling deltas from a `SyncSource`, applying them through a
//! [`ConflictStrategy`](conflict::ConflictStrategy), and persisting the
//! new cursor.
//!
//! [`kernel::MirrorModule`] wires everything into the `oxide-k` kernel so
//! sync runs and queries can be triggered via the kernel message bus.
pub use ;
pub use ;
pub use ;
pub use MirrorModule;
pub use ;
pub use MirrorStore;
pub use ;