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
//! Plan parsing and execution (transaction) for the library API.
use Path;
use cratePathGuard;
use PlanReport; // reexport alias from tx
/// Parse a transaction plan from a JSON string.
/// Execute a transaction plan atomically.
///
/// All operations succeed or all are rolled back. Returns the exit code
/// (For library users this returns `PlanReport` directly; CLI/MCP retain
/// the (code, JSON) form for compatibility.)
///
/// See `PlanReport` fields and embedding docs for typed usage:
///
/// ```ignore
/// let report: PlanReport = execute_plan(plan, cwd, guard)?;
/// assert!(report.ok);
/// // report.changes, report.searches etc are typed
/// ```
///
/// The optional `guard` is threaded through to all operations for
/// PathGuard enforcement (see module docs for PathGuard usage). Pass
/// `None` for no additional containment checks (current default behavior
/// for most callers).
///
/// Available with the `files` feature (for pure library use without the
/// CLI) or the `cli` feature.