Skip to main content

zero_commands/
lib.rs

1//! Slash-command framework and the M1 command set.
2//!
3//! Commands are routed by the TUI's prompt, the command palette,
4//! and the non-interactive `zero <command>` entrypoint. All three
5//! paths produce the same [`DispatchOutput`], which downstream
6//! renders as text, JSON, or a typed widget.
7//!
8//! The crate enforces ADR-014 (risk asymmetry) at the type level
9//! via [`risk::FrictionGate`]: only `Increases`-classified commands
10//! can be friction-wrapped. Risk-reducing actions (`/quit`,
11//! `/kill`, `/flatten-all`, `/pause-entries`, `/break`) are
12//! instant and cannot be gated — the compiler refuses.
13
14#![allow(clippy::module_name_repetitions)]
15
16pub mod command;
17pub mod config;
18pub mod dispatch;
19pub mod friction;
20pub mod parse;
21pub mod risk;
22pub mod session;
23pub mod supervisor;
24
25pub use command::{
26    AutoAction, COMMAND_CATALOG, Command, CommandInfo, HeadlessAction, ModeTarget, OverlayTarget,
27    resolve,
28};
29pub use config::{ConfigDoctorFinding, ConfigShowRow, ConfigSource, DoctorSeverity};
30pub use dispatch::{
31    DispatchContext, DispatchOutput, Never, OutputLine, ReplayLine, StateSource, StaticLabel,
32    dispatch, run_bypass_friction,
33};
34pub use friction::{
35    FALLBACK_REREAD_PHRASE, FrictionDecision, TYPED_CONFIRM_WORD, decide, decide_with_risk,
36};
37pub use parse::{ParsedLine, parse_line};
38pub use risk::{FrictionGate, Gateable, Increases, RiskDirection};
39pub use session::{ReplayEvent, ReplayKind, SessionError, SessionSource, SessionSummary};
40pub use supervisor::{
41    AutoMode, AutoReply, AutoRequest, AutoSource, MockAutoSource, MockSupervisorSource,
42    SupervisorAction, SupervisorError, SupervisorReply, SupervisorSource, SupervisorState,
43};