mermaid_model/lib.rs
1//! The model layer and the things it needs, and nothing above it.
2//!
3//! `mermaid-model` is the dependency-closed bottom of the tree: provider
4//! adapters and their wire types, the capability catalog, the shared retry
5//! policy, the tool-run and action value types those wire types embed, plus
6//! `constants` and `utils`. Nothing here may reach up into `app`, `domain`,
7//! `providers`, `render`, `effect`, or `cli` — the crate boundary is what
8//! enforces that, in place of review.
9//!
10//! It exists because five edges pointed the wrong way. `models` read
11//! `app::Config` (through a `from_app_config` nothing had ever called), reached
12//! into `prompts` for a system prompt that every production path immediately
13//! overwrote, borrowed `ActionDisplay` from `domain`, called the retry
14//! middleware up in `effect`, and — the one that mattered — invoked
15//! `ollama::ensure_running` to spawn a server from inside a wire adapter. That
16//! last inversion is why a connection-refused retry sat unnoticed inside a
17//! read-only listing path; recovery is now a capability the caller injects
18//! (`models::adapters::ollama::LocalServerRecovery`), so a path that must not
19//! start a process simply isn't given the means to.
20//!
21//! `mermaid-cli` re-exports every module below under its historical path
22//! (`crate::models`, `crate::utils`, `crate::constants`, `domain::action`,
23//! `domain::runtime`), the same shim pattern `crate::runtime` already used for
24//! `mermaid-runtime`, so no call site had to change.
25
26pub mod action;
27pub mod constants;
28pub mod ids;
29pub mod models;
30pub mod question;
31pub mod tool_run;
32pub mod utils;