mini_app_core/lib.rs
1//! # mini-app-core
2//!
3//! Agent-First CRUD store core library. Transport-agnostic DB layer that
4//! drives one table per process from `schema.yaml`, backed by SQLite.
5//!
6//! Transport (MCP / HTTP / CLI) lives in a separate crate (`mini-app-mcp`)
7//! that depends on this one. The dependency is strictly one-way:
8//! `mcp โ core`, never the reverse. Error type conversion to `rmcp::ErrorData`
9//! is performed by an ACL adapter (private free function) in the mcp crate to
10//! comply with the Rust orphan rule (Outline rust book ยง5-1-10 K-orphan-rule).
11
12/// Schema definition, runtime loading, and JSON row validation.
13pub mod schema;
14
15/// Application-level error type.
16pub mod error;
17
18/// Runtime configuration loaded from environment variables.
19pub mod config;
20
21/// SQLite-backed row store (async CRUD via `tokio::task::spawn_blocking`).
22pub mod store;
23
24/// Update semantics for [`store::Store::update`]: [`UpdateMode::Merge`] (default,
25/// RFC 7396 shallow merge) or [`UpdateMode::Replace`] (full replacement).
26pub use store::UpdateMode;
27
28/// Server-side row filter for the `list` tool.
29pub mod filter;
30
31/// Multi-table registry + atomic reload (Arc-Swap based, K-110-compliant).
32pub mod registry;
33
34/// `row_materialize` operation โ row selection, field projection, and
35/// multi-format filesystem output with SHA-256 integrity digest.
36pub mod materialize;
37
38/// Framework-level dump hook utilities (write-only file materialization).
39pub mod dump;
40
41/// Backup utilities (YAML + SQLite online backup with retention).
42pub mod backup;
43
44/// Snapshot utilities (SQLite-only online snapshot with retention).
45pub mod snapshot;
46
47/// Re-export of [`error::MiniAppError`] for convenient `use mini_app_core::MiniAppError`.
48pub use error::MiniAppError;