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
// Copyright 2026 AlphaOne LLC
// SPDX-License-Identifier: Apache-2.0
//! CLI command modules. Wave 5a (v0.6.3) extracted these out of
//! `main.rs` so each handler can be unit-tested by capturing output
//! into a `Vec<u8>` via `CliOutput` instead of literal `println!`s.
//!
//! ## Public surface
//!
//! - `CliOutput` (re-exported at `cli::CliOutput`): output abstraction.
//! - `helpers::{id_short, auto_namespace, human_age}`: pure helpers.
//! - `store::run`, `update::run`, `io::{export, import, mine}`:
//! handler entry points called by `main.rs`'s dispatch arm.
//!
//! Each handler takes `&mut CliOutput<'_>` and routes every emit
//! through `writeln!` so tests can assert on captured bytes.
/// v0.7.0 QW-1 — new-format CLI command modules (return exit codes
/// rather than calling `process::exit`).
/// v0.7.0 L2-5 (issue #670) — `ai-memory export-forensic-bundle` and
/// `ai-memory verify-forensic-bundle` subcommands.
/// v0.7.0 issue #863 — `ai-memory governance check-action` subcommand.
/// Shell-side parity for the MCP tool `memory_check_agent_action` so
/// operators can dry-run a substrate rule from a terminal without
/// driving JSON-RPC over stdio.
/// v0.7.0 7th-form (issue #760) — `ai-memory governance install-defaults`
/// subcommand. Bulk-flip seed rules R001-R004 to `enabled = 1` after
/// operator confirmation (interactive prompt; `--yes` overrides).
/// v0.7.0 (issue #800) — `ai-memory namespace` subcommand. CRUD over
/// the per-namespace standard policy memory pointer. Closes Crack 1
/// from the Batman Mode acceptance review by giving operators a
/// first-class CLI verb instead of forcing them into an MCP-stdio
/// JSON-RPC dance just to bind a `GovernancePolicy` to a namespace.
/// v0.7.0 QW-3 — `ai-memory offload` / `ai-memory deref` subcommands.
/// Substrate-only wrappers over `crate::offload::ContextOffloader`.
/// v0.7.0 (issue #691) — `ai-memory rules` subcommand. CRUD for the
/// substrate-level agent-action rules engine. Mutation verbs (add /
/// enable / disable / remove) require the operator keypair on disk.
/// v0.7.0 #1095 — `ai-memory share` subcommand. Closes the SR-4
/// three-surface-parity gap by shipping the CLI counterpart to the
/// MCP tool `memory_share` and the HTTP route `POST /api/v1/share`.
/// All three surfaces dispatch through the same substrate primitive
/// (`crate::mcp::tools::share::handle_share`).
// Convenience re-export so callers can `use ai_memory::cli::CliOutput`
// without a deeper path.
pub use CliOutput;