cool-workflow 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/apps/architecture-review/app.json +1 -1
  4. package/apps/architecture-review-fast/app.json +1 -1
  5. package/apps/end-to-end-golden-path/app.json +1 -1
  6. package/apps/pr-review-fix-ci/app.json +1 -1
  7. package/apps/release-cut/app.json +1 -1
  8. package/apps/research-synthesis/app.json +1 -1
  9. package/dist/cli/dispatch.js +29 -91
  10. package/dist/cli/entry.js +41 -1
  11. package/dist/cli/io.js +6 -2
  12. package/dist/cli/parseargv.js +6 -2
  13. package/dist/core/capability-data.js +271 -0
  14. package/dist/core/capability-table.js +16 -3504
  15. package/dist/core/format/completion.js +68 -0
  16. package/dist/core/format/help.js +50 -8
  17. package/dist/core/format/safe-json.js +73 -0
  18. package/dist/core/format/state-explosion-text.js +1 -1
  19. package/dist/core/multi-agent/candidate-scoring.js +5 -1
  20. package/dist/core/multi-agent/collaboration.js +6 -5
  21. package/dist/core/multi-agent/coordinator.js +9 -8
  22. package/dist/core/multi-agent/runtime.js +4 -4
  23. package/dist/core/multi-agent/topology.js +3 -3
  24. package/dist/core/pipeline/commit-gate.js +2 -1
  25. package/dist/core/pipeline/dispatch.js +18 -4
  26. package/dist/core/pipeline/drive-decide.js +2 -1
  27. package/dist/core/state/migrations.js +16 -1
  28. package/dist/core/state/state-explosion/digest.js +16 -15
  29. package/dist/core/state/state-explosion/graph.js +26 -19
  30. package/dist/core/state/state-explosion/helpers.js +2 -1
  31. package/dist/core/state/state-explosion/report.js +6 -6
  32. package/dist/core/trust/ledger.js +2 -1
  33. package/dist/core/types/execution-backend.js +18 -0
  34. package/dist/core/types/observability.js +7 -0
  35. package/dist/core/util/collate.js +23 -0
  36. package/dist/core/util/numeric-flag.js +40 -0
  37. package/dist/core/version.js +1 -1
  38. package/dist/mcp/server.js +99 -11
  39. package/dist/shell/audit-cli.js +99 -23
  40. package/dist/shell/commit-summary.js +2 -1
  41. package/dist/shell/coordinator-io.js +73 -13
  42. package/dist/shell/dispatch.js +1 -1
  43. package/dist/shell/doctor.js +80 -1
  44. package/dist/shell/drive.js +269 -59
  45. package/dist/shell/eval-text.js +2 -2
  46. package/dist/shell/evidence-reasoning.js +8 -7
  47. package/dist/shell/execution-backend/agent.js +20 -1
  48. package/dist/shell/execution-backend/container.js +4 -1
  49. package/dist/shell/execution-backend/local.js +4 -1
  50. package/dist/shell/execution-backend/registry.js +2 -1
  51. package/dist/shell/execution-backend/types.js +0 -9
  52. package/dist/shell/feedback-cli.js +6 -6
  53. package/dist/shell/fs-atomic.js +232 -30
  54. package/dist/shell/man-cli.js +6 -0
  55. package/dist/shell/metrics-cli.js +2 -1
  56. package/dist/shell/multi-agent-cli.js +367 -323
  57. package/dist/shell/multi-agent-host.js +9 -9
  58. package/dist/shell/multi-agent-operator-ux.js +82 -39
  59. package/dist/shell/node-store.js +10 -4
  60. package/dist/shell/observability.js +13 -12
  61. package/dist/shell/onramp.js +17 -1
  62. package/dist/shell/operator-ux-text.js +24 -23
  63. package/dist/shell/operator-ux.js +22 -20
  64. package/dist/shell/orchestrator.js +49 -38
  65. package/dist/shell/pipeline-cli.js +168 -111
  66. package/dist/shell/reclamation-io.js +16 -5
  67. package/dist/shell/registry-cli.js +19 -17
  68. package/dist/shell/remote-source.js +13 -8
  69. package/dist/shell/report-cli.js +45 -0
  70. package/dist/shell/report.js +4 -2
  71. package/dist/shell/run-registry-io.js +77 -19
  72. package/dist/shell/run-store.js +91 -2
  73. package/dist/shell/scheduling-io.js +12 -13
  74. package/dist/shell/state-cli.js +2 -7
  75. package/dist/shell/state-explosion-cli.js +19 -10
  76. package/dist/shell/topology-io.js +38 -6
  77. package/dist/shell/trust-audit.js +264 -23
  78. package/dist/shell/trust-policy-io.js +1 -1
  79. package/dist/shell/worker-cli.js +41 -29
  80. package/dist/shell/worker-isolation.js +34 -9
  81. package/dist/shell/workflow-app-loader.js +3 -2
  82. package/dist/wiring/capability-table/basics.js +91 -0
  83. package/dist/wiring/capability-table/exec-backend.js +171 -0
  84. package/dist/wiring/capability-table/index.js +42 -0
  85. package/dist/wiring/capability-table/multi-agent.js +630 -0
  86. package/dist/wiring/capability-table/parity.js +467 -0
  87. package/dist/wiring/capability-table/pipeline.js +292 -0
  88. package/dist/wiring/capability-table/registry-core.js +208 -0
  89. package/dist/wiring/capability-table/reporting.js +435 -0
  90. package/dist/wiring/capability-table/scheduling-registry.js +592 -0
  91. package/dist/wiring/capability-table/state.js +181 -0
  92. package/dist/wiring/capability-table/trust-ledger.js +158 -0
  93. package/dist/wiring/capability-table/workflow-apps.js +381 -0
  94. package/docs/agent-delegation-drive.7.md +4 -0
  95. package/docs/candidate-scoring.7.md +1 -1
  96. package/docs/canonical-workflow-apps.7.md +7 -7
  97. package/docs/cli-mcp-parity.7.md +13 -3
  98. package/docs/contract-migration-tooling.7.md +4 -0
  99. package/docs/control-plane-scheduling.7.md +4 -0
  100. package/docs/coordinator-blackboard.7.md +17 -17
  101. package/docs/dogfood-one-real-repo.7.md +11 -11
  102. package/docs/durable-state-and-locking.7.md +24 -0
  103. package/docs/end-to-end-golden-path.7.md +14 -14
  104. package/docs/evidence-adoption-reasoning-chain.7.md +4 -0
  105. package/docs/execution-backends.7.md +4 -0
  106. package/docs/getting-started.md +37 -37
  107. package/docs/index.md +1 -0
  108. package/docs/multi-agent-cli-mcp-surface.7.md +21 -17
  109. package/docs/multi-agent-eval-replay-harness.7.md +17 -13
  110. package/docs/multi-agent-operator-ux.7.md +23 -19
  111. package/docs/multi-agent-runtime-core.7.md +22 -22
  112. package/docs/multi-agent-topologies.7.md +6 -6
  113. package/docs/multi-agent-trust-policy-audit.7.md +11 -11
  114. package/docs/node-snapshot-diff-replay.7.md +4 -0
  115. package/docs/observability-cost-accounting.7.md +4 -0
  116. package/docs/operator-ux.7.md +34 -34
  117. package/docs/pipeline-runner.7.md +4 -4
  118. package/docs/project-index.md +48 -5
  119. package/docs/real-execution-backends.7.md +4 -0
  120. package/docs/release-and-migration.7.md +5 -1
  121. package/docs/release-tooling.7.md +4 -0
  122. package/docs/routines.md +4 -4
  123. package/docs/run-registry-control-plane.7.md +23 -19
  124. package/docs/run-retention-reclamation.7.md +4 -0
  125. package/docs/scheduled-tasks.md +14 -14
  126. package/docs/security-trust-hardening.7.md +43 -13
  127. package/docs/state-explosion-management.7.md +14 -10
  128. package/docs/team-collaboration.7.md +4 -0
  129. package/docs/trust-audit-anchor.7.md +71 -0
  130. package/docs/unix-principles.md +3 -1
  131. package/docs/verifier-gated-commit.7.md +1 -1
  132. package/docs/web-desktop-workbench.7.md +4 -0
  133. package/docs/workflow-app-framework.7.md +13 -13
  134. package/manifest/plugin.manifest.json +1 -1
  135. package/package.json +4 -2
  136. package/scripts/agents/claude-p-agent.js +2 -2
  137. package/scripts/block-unapproved-tag.sh +23 -2
  138. package/scripts/bump-version.js +24 -2
  139. package/scripts/canonical-apps.js +4 -4
  140. package/scripts/children/batch-delegate-child.js +52 -2
  141. package/scripts/dogfood-release.js +1 -1
  142. package/scripts/fake-date-for-reproduction.js +44 -0
  143. package/scripts/golden-path.js +4 -4
  144. package/scripts/purity-baseline.json +71 -0
  145. package/scripts/purity-gate.js +239 -0
  146. package/scripts/release-check.js +8 -1
  147. package/scripts/release-flow.js +57 -1
  148. package/scripts/verdict-keygen.js +83 -0
  149. package/scripts/verify-bump-reproduction.sh +148 -0
  150. package/scripts/verify-verdict-signature.js +61 -0
  151. package/scripts/version-sync-check.js +33 -12
  152. package/skills/cool-workflow/SKILL.md +9 -9
  153. package/skills/cool-workflow/references/commands.md +89 -88
  154. package/ui/workbench/app.css +37 -1
  155. package/ui/workbench/app.js +124 -6
  156. package/workflows/README.md +19 -0
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ // wiring/capability-table/state.ts — MILESTONE 3 (state kernel) + MILESTONE 4
3
+ // (state-explosion summaries) CLI bindings: state.check, migration.list|
4
+ // check|prove, node.list|show|graph|snapshot|diff|replay|replay.verify,
5
+ // summary.refresh|show. Split out of core/capability-table.ts, byte-for-byte
6
+ // (extracted with sed, not retyped).
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const registry_core_1 = require("./registry-core");
9
+ const io_1 = require("../../cli/io");
10
+ // This slice is required unconditionally at startup for every command;
11
+ // load these shell modules only when a handler that actually needs them runs.
12
+ function loadReportViewCli() {
13
+ return require("../../shell/report-view-cli");
14
+ }
15
+ function loadStateCli() {
16
+ return require("../../shell/state-cli");
17
+ }
18
+ function loadStateExplosionCli() {
19
+ return require("../../shell/state-explosion-cli");
20
+ }
21
+ // MILESTONE 3 (state kernel) CLI bindings: state.check, migration.list|
22
+ // check|prove, node.list|show|graph|snapshot|diff|replay|replay.verify.
23
+ // Handler BODIES live in shell/state-cli.ts (impure — they read/write
24
+ // run state on disk); this table only wires argv shape -> handler call
25
+ // and the row's own exit-code rule, per cli/dispatch.ts's generic
26
+ // executor contract. `required`/`optionalArg` are cli/io.ts's shared
27
+ // coercion helpers, imported here so the wiring stays a thin adapter
28
+ // (Usage-error strings copied byte-for-byte from the old build's
29
+ // handlers/*.ts).
30
+ // ---------------------------------------------------------------------
31
+ const io_2 = require("../../cli/io");
32
+ (0, registry_core_1.attachCliBinding)("state.check", {
33
+ path: ["state", "check"],
34
+ jsonMode: "default",
35
+ handler: (args) => {
36
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
37
+ const report = loadStateCli().checkState(runId, args.options);
38
+ return { json: report, exitCode: report.status === "unsupported" ? 1 : undefined };
39
+ },
40
+ });
41
+ (0, registry_core_1.attachCliBinding)("migration.list", {
42
+ path: ["migration", "list"],
43
+ jsonMode: "default",
44
+ handler: () => ({ json: loadStateCli().migrationList() }),
45
+ });
46
+ (0, registry_core_1.attachCliBinding)("migration.check", {
47
+ path: ["migration", "check"],
48
+ jsonMode: "default",
49
+ handler: (args) => {
50
+ const target = (0, io_2.required)(args.positionals[0], "target (run-id or state/app file)");
51
+ const report = loadStateCli().migrationCheck(target, args.options);
52
+ return { json: report, exitCode: report.status === "unsupported" ? 1 : undefined };
53
+ },
54
+ });
55
+ (0, registry_core_1.attachCliBinding)("migration.prove", {
56
+ path: ["migration", "prove"],
57
+ jsonMode: "default",
58
+ handler: (args) => {
59
+ const target = (0, io_2.required)(args.positionals[0], "target (run-id or state/app file)");
60
+ const proof = loadStateCli().migrationProve(target, args.options);
61
+ return { json: proof, exitCode: proof.pass ? undefined : 1 };
62
+ },
63
+ });
64
+ (0, registry_core_1.attachCliBinding)("node.list", {
65
+ path: ["node", "list"],
66
+ jsonMode: "default",
67
+ handler: (args) => ({ json: loadStateCli().listNodes((0, io_2.required)(args.positionals[0], "run id"), args.options) }),
68
+ });
69
+ (0, registry_core_1.attachCliBinding)("node.show", {
70
+ path: ["node", "show"],
71
+ jsonMode: "default",
72
+ handler: (args) => {
73
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
74
+ const nodeId = (0, io_2.required)(args.positionals[1], "node id");
75
+ return { json: loadStateCli().showNode(runId, nodeId, args.options) };
76
+ },
77
+ });
78
+ // jsonMode "flag": `--json` prints the node array (graphNodes); the bare
79
+ // verb prints the operator run-graph text, byte-for-byte the old build's
80
+ // `node graph` render (formatOperatorGraph over runner.operatorGraph).
81
+ (0, registry_core_1.attachCliBinding)("node.graph", {
82
+ path: ["node", "graph"],
83
+ jsonMode: "flag",
84
+ handler: (args) => {
85
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
86
+ return { json: loadStateCli().graphNodes(runId, args.options), text: `${loadReportViewCli().graphText(runId, args.options)}\n` };
87
+ },
88
+ });
89
+ (0, registry_core_1.attachCliBinding)("node.snapshot", {
90
+ path: ["node", "snapshot"],
91
+ jsonMode: "default",
92
+ handler: (args) => {
93
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
94
+ const nodeId = (0, io_2.required)(args.positionals[1], "node id");
95
+ return { json: loadStateCli().nodeSnapshotCli(runId, nodeId, args.options) };
96
+ },
97
+ });
98
+ (0, registry_core_1.attachCliBinding)("node.diff", {
99
+ path: ["node", "diff"],
100
+ jsonMode: "default",
101
+ handler: (args) => {
102
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
103
+ const baselineSnapshotId = (0, io_2.required)(args.positionals[1], "baseline snapshot id");
104
+ const candidateSnapshotId = (0, io_2.required)(args.positionals[2], "candidate snapshot id");
105
+ return { json: loadStateCli().nodeDiffCli(runId, baselineSnapshotId, candidateSnapshotId, args.options) };
106
+ },
107
+ });
108
+ (0, registry_core_1.attachCliBinding)("node.replay", {
109
+ path: ["node", "replay"],
110
+ jsonMode: "default",
111
+ handler: (args) => {
112
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
113
+ const snapshotId = (0, io_2.required)(args.positionals[1], "snapshot id");
114
+ return { json: loadStateCli().nodeReplayCli(runId, snapshotId, args.options) };
115
+ },
116
+ });
117
+ (0, registry_core_1.attachCliBinding)("node.replay.verify", {
118
+ path: ["node", "verify"],
119
+ jsonMode: "default",
120
+ handler: (args) => {
121
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
122
+ const replayId = (0, io_2.required)(args.positionals[1], "replay id");
123
+ const verdict = loadStateCli().nodeReplayVerifyCli(runId, replayId, args.options);
124
+ return { json: verdict, exitCode: verdict.pass ? undefined : 1 };
125
+ },
126
+ });
127
+ // GAP #24: mirror the state-kernel CLI shell fns as MCP handlers (they were
128
+ // declared MCP tool rows but left on notYetImplemented). Arg-name reads copied
129
+ // byte-for-byte from the old build's mcp/tool-call.ts switch arms.
130
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("state.check").mcp.handler = (args) => loadStateCli().checkState((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
131
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("migration.list").mcp.handler = () => loadStateCli().migrationList();
132
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("migration.check").mcp.handler = (args) => loadStateCli().migrationCheck((0, io_2.required)((0, io_1.optionalArg)(args.target ?? args.runId), "target (run-id or state/app file)"), args);
133
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("migration.prove").mcp.handler = (args) => loadStateCli().migrationProve((0, io_2.required)((0, io_1.optionalArg)(args.target ?? args.runId), "target (run-id or state/app file)"), args);
134
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.list").mcp.handler = (args) => loadStateCli().listNodes((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
135
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.show").mcp.handler = (args) => loadStateCli().showNode((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), (0, io_2.required)((0, io_1.optionalArg)(args.nodeId), "node id"), args);
136
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.graph").mcp.handler = (args) => loadStateCli().graphNodes((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
137
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.snapshot").mcp.handler = (args) => loadStateCli().nodeSnapshotCli((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), (0, io_2.required)((0, io_1.optionalArg)(args.nodeId), "node id"), args);
138
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.diff").mcp.handler = (args) => loadStateCli().nodeDiffCli((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), (0, io_2.required)((0, io_1.optionalArg)(args.baselineSnapshotId ?? args.baseline), "baseline snapshot id"), (0, io_2.required)((0, io_1.optionalArg)(args.candidateSnapshotId ?? args.candidate), "candidate snapshot id"), args);
139
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.replay").mcp.handler = (args) => loadStateCli().nodeReplayCli((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), (0, io_2.required)((0, io_1.optionalArg)(args.snapshotId), "snapshot id"), args);
140
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.replay.verify").mcp.handler = (args) => loadStateCli().nodeReplayVerifyCli((0, io_2.required)((0, io_1.optionalArg)(args.runId), "run id"), (0, io_2.required)((0, io_1.optionalArg)(args.replayId), "replay id"), args);
141
+ // `contract.show` is not yet a declared MCP_TOOL_DATA row with a CLI peer
142
+ // wired here (it IS in MCP_TOOL_DATA already); no milestone-3 conformance
143
+ // case reaches it, so it is intentionally left on its placeholder handler
144
+ // until a case demands it — avoids speculative, untested wiring.
145
+ // ---------------------------------------------------------------------
146
+ // MILESTONE 4 (state-explosion summaries) CLI bindings: summary.refresh,
147
+ // summary.show. Handler BODIES live in shell/state-explosion-cli.ts
148
+ // (impure — disk reads/writes summaries under the run dir); this table
149
+ // only wires argv shape -> handler call, per cli/dispatch.ts's generic
150
+ // executor contract. Per SPEC/state-core.md's CLI verbs section: without
151
+ // `--json` both print `formatStateExplosionReport` text (jsonMode
152
+ // "flag" — text by default, JSON under --json/--format json).
153
+ // ---------------------------------------------------------------------
154
+ const state_explosion_text_1 = require("../../core/format/state-explosion-text");
155
+ const io_3 = require("../../cli/io");
156
+ (0, registry_core_1.attachCliBinding)("summary.refresh", {
157
+ path: ["summary", "refresh"],
158
+ jsonMode: "flag",
159
+ handler: (args) => {
160
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
161
+ const index = loadStateExplosionCli().summaryRefreshCli(runId, args.options);
162
+ // Byte-exact port of the old build's handleSummary "refresh": the
163
+ // human-text branch re-reads via a fresh summaryShow call rather than
164
+ // formatting the refresh's own index record (src/cli/handlers/
165
+ // operator.ts:118-127); only computed when actually needed, so a
166
+ // --json call does exactly the one read the old build's if/else did.
167
+ if ((0, io_3.wantsJson)(args.options))
168
+ return { json: index };
169
+ return { json: index, text: (0, state_explosion_text_1.formatStateExplosionReport)(loadStateExplosionCli().summaryShowCli(runId, args.options)) };
170
+ },
171
+ });
172
+ (0, registry_core_1.attachCliBinding)("summary.show", {
173
+ path: ["summary", "show"],
174
+ jsonMode: "flag",
175
+ handler: (args) => {
176
+ const runId = (0, io_2.required)(args.positionals[0], "run id");
177
+ const report = loadStateExplosionCli().summaryShowCli(runId, args.options);
178
+ return { json: report, text: (0, state_explosion_text_1.formatStateExplosionReport)(report) };
179
+ },
180
+ });
181
+ // ---------------------------------------------------------------------
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ // wiring/capability-table/trust-ledger.ts — MILESTONE 8 (ledger, telemetry,
3
+ // trust-audit, tamper/bundle demos) CLI bindings: ledger.*, telemetry.verify,
4
+ // audit.verify, audit.head, demo.*, report.bundle/verify-bundle. Split out
5
+ // of core/capability-table.ts, byte-for-byte (extracted with sed, not
6
+ // retyped).
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const registry_core_1 = require("./registry-core");
9
+ const io_1 = require("../../cli/io");
10
+ // MILESTONE 8 (ledger, telemetry, trust-audit, tamper/bundle demos) CLI
11
+ // bindings: ledger propose|review|verify|apply|list, telemetry verify,
12
+ // audit verify, demo tamper|bundle, report bundle|verify-bundle. Handler
13
+ // BODIES live in shell/ledger-cli.ts, shell/telemetry-cli.ts, shell/
14
+ // audit-cli.ts, shell/demo-cli.ts, shell/report-cli.ts (impure — file/
15
+ // stdin reads, run-state loads, archive IO); this table only wires argv
16
+ // shape -> handler call, per cli/dispatch.ts's generic executor
17
+ // contract. `ledger` is intentionally absent from KNOWN_COMMANDS (see
18
+ // cli/parseargv.ts) even though dispatchTable now handles it as a real
19
+ // row — a known, preserved wart.
20
+ // ---------------------------------------------------------------------
21
+ const ledger_cli_1 = require("../../shell/ledger-cli");
22
+ // This file is required at startup for every command. Loading these shell
23
+ // modules only when their handler runs, not at import time, keeps that
24
+ // load cost out of commands that never touch telemetry/audit/demo/report.
25
+ function loadTelemetryCli() {
26
+ return require("../../shell/telemetry-cli");
27
+ }
28
+ function loadAuditCli() {
29
+ return require("../../shell/audit-cli");
30
+ }
31
+ function loadDemoCli() {
32
+ return require("../../shell/demo-cli");
33
+ }
34
+ function loadTelemetryDemo() {
35
+ return require("../../shell/telemetry-demo");
36
+ }
37
+ function loadReportCli() {
38
+ return require("../../shell/report-cli");
39
+ }
40
+ (0, registry_core_1.attachCliBinding)("ledger.propose", {
41
+ path: ["ledger", "propose"],
42
+ jsonMode: "default",
43
+ handler: (args) => ({ json: (0, ledger_cli_1.ledgerProposeCli)(args.options) }),
44
+ });
45
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("ledger.propose").mcp.handler = (args) => (0, ledger_cli_1.ledgerProposeMcp)(args);
46
+ (0, registry_core_1.attachCliBinding)("ledger.review", {
47
+ path: ["ledger", "review"],
48
+ jsonMode: "default",
49
+ handler: (args) => ({ json: (0, ledger_cli_1.ledgerReviewCli)(args.options) }),
50
+ });
51
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("ledger.review").mcp.handler = (args) => (0, ledger_cli_1.ledgerReviewMcp)(args);
52
+ (0, registry_core_1.attachCliBinding)("ledger.verify", {
53
+ path: ["ledger", "verify"],
54
+ jsonMode: "default",
55
+ handler: (args) => {
56
+ const result = (0, ledger_cli_1.ledgerVerifyCli)(args.options);
57
+ return { json: result, exitCode: result.ok ? undefined : 1 };
58
+ },
59
+ });
60
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("ledger.verify").mcp.handler = (args) => (0, ledger_cli_1.ledgerVerifyEntry)(args.entry);
61
+ (0, registry_core_1.attachCliBinding)("ledger.apply", {
62
+ path: ["ledger", "apply"],
63
+ jsonMode: "default",
64
+ handler: (args) => {
65
+ const result = (0, ledger_cli_1.ledgerApplyCli)(args.options);
66
+ return { json: result, exitCode: result.ok ? undefined : 1 };
67
+ },
68
+ });
69
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("ledger.apply").mcp.handler = (args) => (0, ledger_cli_1.ledgerApplyEntry)(args.entry);
70
+ (0, registry_core_1.attachCliBinding)("ledger.list", {
71
+ path: ["ledger", "list"],
72
+ jsonMode: "default",
73
+ handler: (args) => {
74
+ const result = (0, ledger_cli_1.ledgerListCli)(args.options);
75
+ return { json: result, exitCode: result.allOk ? undefined : 1 };
76
+ },
77
+ });
78
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("ledger.list").mcp.handler = (args) => (0, ledger_cli_1.ledgerListMcp)(args);
79
+ (0, registry_core_1.attachCliBinding)("telemetry.verify", {
80
+ path: ["telemetry", "verify"],
81
+ jsonMode: "flag",
82
+ handler: (args) => {
83
+ const runId = (0, io_1.required)((0, io_1.optionalArg)(args.positionals[0]) || (0, io_1.optionalArg)(args.options.runId) || (0, io_1.optionalArg)(args.options.run), "run id");
84
+ const result = loadTelemetryCli().telemetryVerifyCli(runId, args.options);
85
+ return { json: result, text: loadTelemetryDemo().formatTelemetryVerify(result), exitCode: result.verified ? undefined : 1 };
86
+ },
87
+ });
88
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("telemetry.verify").mcp.handler = (args) => loadTelemetryCli().telemetryVerifyCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
89
+ (0, registry_core_1.attachCliBinding)("audit.verify", {
90
+ path: ["audit", "verify"],
91
+ jsonMode: "default",
92
+ handler: (args) => {
93
+ const runId = (0, io_1.required)((0, io_1.optionalArg)(args.positionals[0]), "run id");
94
+ const result = loadAuditCli().auditVerifyCli(runId, args.options);
95
+ return { json: result, exitCode: result.verified ? undefined : 1 };
96
+ },
97
+ });
98
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("audit.verify").mcp.handler = (args) => loadAuditCli().auditVerifyCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
99
+ (0, registry_core_1.attachCliBinding)("audit.head", {
100
+ path: ["audit", "head"],
101
+ jsonMode: "default",
102
+ handler: (args) => {
103
+ const runId = (0, io_1.required)((0, io_1.optionalArg)(args.positionals[0]), "run id");
104
+ return { json: loadAuditCli().auditHeadCli(runId, args.options) };
105
+ },
106
+ });
107
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("audit.head").mcp.handler = (args) => loadAuditCli().auditHeadCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
108
+ (0, registry_core_1.attachCliBinding)("audit.repair", {
109
+ path: ["audit", "repair"],
110
+ jsonMode: "default",
111
+ handler: (args) => {
112
+ const runId = (0, io_1.required)((0, io_1.optionalArg)(args.positionals[0]), "run id");
113
+ const result = loadAuditCli().auditRepairCli(runId, args.options);
114
+ return { json: result, exitCode: result.outcome === "refused" ? 1 : undefined };
115
+ },
116
+ });
117
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("audit.repair").mcp.handler = (args) => loadAuditCli().auditRepairCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
118
+ (0, registry_core_1.addCliOnlyCapability)("demo.tamper", "Prove tamper-evidence: build a signed telemetry ledger, forge it, watch verification fail offline.", {
119
+ path: ["demo", "tamper"],
120
+ jsonMode: "flag",
121
+ handler: (args) => {
122
+ const result = loadDemoCli().demoTamperCli();
123
+ return { json: result, text: loadTelemetryDemo().formatTamperDemo(result), exitCode: result.proven ? undefined : 1 };
124
+ },
125
+ }, "Human-facing demonstration (operator/newcomer onboarding); the underlying integrity check is exposed programmatically as the both-surface telemetry.verify. No agent or MCP client needs to invoke a demo.");
126
+ (0, registry_core_1.addCliOnlyCapability)("demo.bundle", "Prove portable-bundle verification: export a sealed report bundle, forge it two ways, watch report verify-bundle catch both offline with only the embedded public key.", {
127
+ path: ["demo", "bundle"],
128
+ jsonMode: "flag",
129
+ handler: (args) => {
130
+ const result = loadDemoCli().demoBundleCli();
131
+ return { json: result, text: loadTelemetryDemo().formatBundleDemo(result), exitCode: result.proven ? undefined : 1 };
132
+ },
133
+ }, "Human-facing demonstration (operator/newcomer onboarding); the underlying integrity check is exposed programmatically as the both-surface report.verify-bundle. No agent or MCP client needs to invoke a demo.");
134
+ (0, registry_core_1.attachCliBinding)("report.bundle", {
135
+ path: ["report", "bundle"],
136
+ jsonMode: "default",
137
+ handler: (args) => {
138
+ const runId = (0, io_1.required)((0, io_1.optionalArg)(args.positionals[0]), "run id");
139
+ const result = loadReportCli().reportBundleCli(runId, args.options);
140
+ return { json: result, exitCode: result.ok ? undefined : 1 };
141
+ },
142
+ });
143
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("report.bundle").mcp.handler = (args) => loadReportCli().reportBundleCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
144
+ (0, registry_core_1.attachCliBinding)("report.verify-bundle", {
145
+ path: ["report", "verify-bundle"],
146
+ jsonMode: "flag",
147
+ handler: (args) => {
148
+ const archivePath = (0, io_1.required)((0, io_1.optionalArg)(args.positionals[0]), "bundle path");
149
+ const reportCli = loadReportCli();
150
+ const result = reportCli.reportVerifyBundleCli({ ...args.options, archive: archivePath });
151
+ return { json: result, text: reportCli.formatReportVerifyBundle(result), exitCode: result.ok ? undefined : 1 };
152
+ },
153
+ });
154
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("report.verify-bundle").mcp.handler = (args) => {
155
+ const result = loadReportCli().reportVerifyBundleCli(args);
156
+ return result;
157
+ };
158
+ // ---------------------------------------------------------------------