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
//! CortEX + RedEX + NetDb surface.
//!
//! Re-exports of the core event-sourced storage layer so SDK users
//! can open typed domain adapters (tasks, memories) without depending
//! on the `net` crate directly.
//!
//! ## Entry points
//!
//! - [`Redex`] — storage manager. Create in-memory with [`Redex::new`]
//! or disk-backed with [`Redex::with_persistent_dir`].
//! - [`NetDb`] — unified handle bundling the enabled model adapters
//! behind a single query facade. Build via [`NetDb::builder`].
//! - [`TasksAdapter`] / [`MemoriesAdapter`] — typed adapters if you
//! only need one model and don't want the `NetDb` wrapper.
//! - [`RedexFile`] — raw event-log primitive for domain-agnostic use.
//!
//! ## Example
//!
//! ```no_run
//! use net_sdk::cortex::{NetDb, Redex};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # tokio::runtime::Runtime::new()?.block_on(async {
//! let redex = Redex::new();
//! let db = NetDb::builder(redex)
//! .origin(0xABCD_EF01)
//! .with_tasks()
//! .with_memories()
//! .build()
//! .await?;
//!
//! // Drive the tasks adapter:
//! let seq = db.tasks().create(1, "write docs", 0)?;
//! db.tasks().wait_for_seq(seq).await;
//!
//! // Snapshot + watch for reactive UI:
//! let watcher = db.tasks().watch();
//! let (snapshot, _stream) = db.tasks().snapshot_and_watch(watcher);
//! assert_eq!(snapshot.len(), 1);
//! # Ok::<_, Box<dyn std::error::Error>>(())
//! # })
//! # }
//! ```
//!
//! ## Persistence
//!
//! Disk-backed files need `Redex::with_persistent_dir`. Pair with
//! `NetDbBuilder::persistent(true)` to route every enabled model's
//! RedEX file through the disk segment:
//!
//! ```no_run
//! # use net_sdk::cortex::{NetDb, Redex};
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # tokio::runtime::Runtime::new()?.block_on(async {
//! let redex = Redex::new().with_persistent_dir("/var/lib/net/redex");
//! let db = NetDb::builder(redex)
//! .origin(0xABCD_EF01)
//! .persistent(true)
//! .with_tasks()
//! .build()
//! .await?;
//! # drop(db);
//! # Ok::<_, Box<dyn std::error::Error>>(())
//! # })
//! # }
//! ```
// ---- Storage primitive (RedEX) ---------------------------------------------
pub use ;
// ---- CortEX domain adapters ------------------------------------------------
pub use ;
pub use ;
/// Re-export of the tasks-module `OrderBy` enum. Aliased so the
/// memories variant can coexist in this flat namespace.
pub use OrderBy as TasksOrderBy;
pub use ;
pub use OrderBy as MemoriesOrderBy;
// ---- NetDb facade ----------------------------------------------------------
pub use ;