cool-workflow 0.2.3 → 0.2.4

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 (65) 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 +2 -1
  10. package/dist/cli/io.js +6 -20
  11. package/dist/core/capability-data.js +2 -2
  12. package/dist/core/format/help.js +7 -1
  13. package/dist/core/util/cli-args.js +33 -0
  14. package/dist/core/version.js +1 -1
  15. package/dist/shell/drive.js +14 -6
  16. package/dist/shell/execution-backend/agent.js +10 -1
  17. package/dist/shell/execution-backend/local.js +15 -10
  18. package/dist/shell/pipeline-cli.js +20 -2
  19. package/dist/shell/reclamation-io.js +74 -6
  20. package/dist/shell/registry-cli.js +4 -0
  21. package/dist/shell/run-registry-io.js +1 -0
  22. package/dist/shell/workflow-app-loader.js +67 -1
  23. package/dist/wiring/capability-table/basics.js +2 -2
  24. package/dist/wiring/capability-table/exec-backend.js +9 -9
  25. package/dist/wiring/capability-table/multi-agent.js +69 -69
  26. package/dist/wiring/capability-table/pipeline.js +28 -28
  27. package/dist/wiring/capability-table/registry-core.js +3 -3
  28. package/dist/wiring/capability-table/reporting.js +38 -38
  29. package/dist/wiring/capability-table/scheduling-registry.js +58 -58
  30. package/dist/wiring/capability-table/state.js +34 -34
  31. package/dist/wiring/capability-table/trust-ledger.js +12 -12
  32. package/dist/wiring/capability-table/workflow-apps.js +15 -15
  33. package/docs/agent-delegation-drive.7.md +2 -0
  34. package/docs/cli-mcp-parity.7.md +18 -13
  35. package/docs/contract-migration-tooling.7.md +2 -0
  36. package/docs/control-plane-scheduling.7.md +2 -0
  37. package/docs/durable-state-and-locking.7.md +2 -0
  38. package/docs/evidence-adoption-reasoning-chain.7.md +2 -0
  39. package/docs/execution-backends.7.md +2 -0
  40. package/docs/multi-agent-cli-mcp-surface.7.md +2 -0
  41. package/docs/multi-agent-eval-replay-harness.7.md +2 -0
  42. package/docs/multi-agent-operator-ux.7.md +2 -0
  43. package/docs/node-snapshot-diff-replay.7.md +2 -0
  44. package/docs/observability-cost-accounting.7.md +2 -0
  45. package/docs/project-index.md +8 -4
  46. package/docs/real-execution-backends.7.md +2 -0
  47. package/docs/release-and-migration.7.md +2 -0
  48. package/docs/release-tooling.7.md +20 -0
  49. package/docs/run-registry-control-plane.7.md +2 -0
  50. package/docs/run-retention-reclamation.7.md +22 -3
  51. package/docs/state-explosion-management.7.md +2 -0
  52. package/docs/team-collaboration.7.md +2 -0
  53. package/docs/trust-audit-anchor.7.md +2 -0
  54. package/docs/web-desktop-workbench.7.md +2 -0
  55. package/manifest/plugin.manifest.json +1 -1
  56. package/package.json +2 -1
  57. package/scripts/block-unapproved-tag.sh +19 -4
  58. package/scripts/bump-version.js +27 -10
  59. package/scripts/canonical-apps.js +4 -4
  60. package/scripts/dogfood-release.js +1 -1
  61. package/scripts/golden-path.js +4 -4
  62. package/scripts/purity-baseline.json +0 -30
  63. package/scripts/release-flow.js +137 -12
  64. package/scripts/release-oneclick.js +407 -0
  65. package/scripts/version-sync-check.js +39 -22
@@ -7,7 +7,7 @@
7
7
  // (extracted with sed, not retyped).
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const registry_core_1 = require("./registry-core");
10
- const io_1 = require("../../cli/io");
10
+ const cli_args_1 = require("../../core/util/cli-args");
11
11
  // MILESTONE 10 (scheduling, registry, gc/reclamation, orphans, clones)
12
12
  // CLI bindings: schedule *, cw loop, routine *, sched *, registry *,
13
13
  // queue *, gc *, orphans *, clones *, run search|list|show|resume|
@@ -58,17 +58,17 @@ function firstPositionalArg(args, index = 0) {
58
58
  case "list":
59
59
  return { json: registryCli.scheduleListCli(args.options) };
60
60
  case "delete":
61
- return { json: registryCli.scheduleDeleteCli((0, io_1.required)(id, "schedule id"), args.options) };
61
+ return { json: registryCli.scheduleDeleteCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
62
62
  case "due":
63
63
  return { json: registryCli.scheduleDueCli(args.options) };
64
64
  case "complete":
65
- return { json: registryCli.scheduleCompleteCli((0, io_1.required)(id, "schedule id"), args.options) };
65
+ return { json: registryCli.scheduleCompleteCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
66
66
  case "pause":
67
- return { json: registryCli.schedulePauseCli((0, io_1.required)(id, "schedule id"), args.options) };
67
+ return { json: registryCli.schedulePauseCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
68
68
  case "resume":
69
- return { json: registryCli.scheduleResumeCli((0, io_1.required)(id, "schedule id"), args.options) };
69
+ return { json: registryCli.scheduleResumeCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
70
70
  case "run-now":
71
- return { json: registryCli.scheduleRunNowCli((0, io_1.required)(id, "schedule id"), args.options) };
71
+ return { json: registryCli.scheduleRunNowCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
72
72
  case "history":
73
73
  return { json: registryCli.scheduleHistoryCli(id, args.options) };
74
74
  case "daemon": {
@@ -92,12 +92,12 @@ function firstPositionalArg(args, index = 0) {
92
92
  registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.create").mcp.handler = (args) => loadRegistryCli().scheduleCreateCli(args);
93
93
  registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.list").mcp.handler = (args) => loadRegistryCli().scheduleListCli(args);
94
94
  registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.due").mcp.handler = (args) => loadRegistryCli().scheduleDueCli(args);
95
- registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.complete").mcp.handler = (args) => loadRegistryCli().scheduleCompleteCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "schedule id"), args);
96
- registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.pause").mcp.handler = (args) => loadRegistryCli().schedulePauseCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "schedule id"), args);
97
- registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.resume").mcp.handler = (args) => loadRegistryCli().scheduleResumeCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "schedule id"), args);
98
- registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.run-now").mcp.handler = (args) => loadRegistryCli().scheduleRunNowCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "schedule id"), args);
99
- registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.history").mcp.handler = (args) => loadRegistryCli().scheduleHistoryCli((0, io_1.optionalArg)(args.id), args);
100
- registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (args) => loadRegistryCli().scheduleDeleteCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "schedule id"), args);
95
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.complete").mcp.handler = (args) => loadRegistryCli().scheduleCompleteCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "schedule id"), args);
96
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.pause").mcp.handler = (args) => loadRegistryCli().schedulePauseCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "schedule id"), args);
97
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.resume").mcp.handler = (args) => loadRegistryCli().scheduleResumeCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "schedule id"), args);
98
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.run-now").mcp.handler = (args) => loadRegistryCli().scheduleRunNowCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "schedule id"), args);
99
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.history").mcp.handler = (args) => loadRegistryCli().scheduleHistoryCli((0, cli_args_1.optionalArg)(args.id), args);
100
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (args) => loadRegistryCli().scheduleDeleteCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "schedule id"), args);
101
101
  // Each `schedule <verb>` sub-action is its own two-token cli row (found
102
102
  // before the ["schedule"] catch-all per the reversed candidate order), so
103
103
  // each capability is a real both-surface dual-bound row. Same shell fns and
@@ -106,12 +106,12 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (arg
106
106
  // literal COMMAND_HELP_ROWS.schedule block.
107
107
  (0, registry_core_1.attachCliBinding)("schedule.create", { path: ["schedule", "create"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleCreateCli(args.options) }) });
108
108
  (0, registry_core_1.attachCliBinding)("schedule.list", { path: ["schedule", "list"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleListCli(args.options) }) });
109
- (0, registry_core_1.attachCliBinding)("schedule.delete", { path: ["schedule", "delete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleDeleteCli((0, io_1.required)(args.positionals[0], "schedule id"), args.options) }) });
109
+ (0, registry_core_1.attachCliBinding)("schedule.delete", { path: ["schedule", "delete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleDeleteCli((0, cli_args_1.required)(args.positionals[0], "schedule id"), args.options) }) });
110
110
  (0, registry_core_1.attachCliBinding)("schedule.due", { path: ["schedule", "due"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleDueCli(args.options) }) });
111
- (0, registry_core_1.attachCliBinding)("schedule.complete", { path: ["schedule", "complete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleCompleteCli((0, io_1.required)(args.positionals[0], "schedule id"), args.options) }) });
112
- (0, registry_core_1.attachCliBinding)("schedule.pause", { path: ["schedule", "pause"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().schedulePauseCli((0, io_1.required)(args.positionals[0], "schedule id"), args.options) }) });
113
- (0, registry_core_1.attachCliBinding)("schedule.resume", { path: ["schedule", "resume"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleResumeCli((0, io_1.required)(args.positionals[0], "schedule id"), args.options) }) });
114
- (0, registry_core_1.attachCliBinding)("schedule.run-now", { path: ["schedule", "run-now"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleRunNowCli((0, io_1.required)(args.positionals[0], "schedule id"), args.options) }) });
111
+ (0, registry_core_1.attachCliBinding)("schedule.complete", { path: ["schedule", "complete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleCompleteCli((0, cli_args_1.required)(args.positionals[0], "schedule id"), args.options) }) });
112
+ (0, registry_core_1.attachCliBinding)("schedule.pause", { path: ["schedule", "pause"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().schedulePauseCli((0, cli_args_1.required)(args.positionals[0], "schedule id"), args.options) }) });
113
+ (0, registry_core_1.attachCliBinding)("schedule.resume", { path: ["schedule", "resume"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleResumeCli((0, cli_args_1.required)(args.positionals[0], "schedule id"), args.options) }) });
114
+ (0, registry_core_1.attachCliBinding)("schedule.run-now", { path: ["schedule", "run-now"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleRunNowCli((0, cli_args_1.required)(args.positionals[0], "schedule id"), args.options) }) });
115
115
  (0, registry_core_1.attachCliBinding)("schedule.history", { path: ["schedule", "history"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleHistoryCli(args.positionals[0], args.options) }) });
116
116
  // ---- routine ------------------------------------------------------------
117
117
  (0, registry_core_1.addCliOnlyCapability)("routine", "cw routine create|list|delete|fire|events — API/GitHub-style triggers.", {
@@ -127,9 +127,9 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (arg
127
127
  case "list":
128
128
  return { json: registryCli.routineListCli(args.options) };
129
129
  case "delete":
130
- return { json: registryCli.routineDeleteCli((0, io_1.required)(idOrKind, "trigger id"), args.options) };
130
+ return { json: registryCli.routineDeleteCli((0, cli_args_1.required)(idOrKind, "trigger id"), args.options) };
131
131
  case "fire": {
132
- const kind = (0, io_1.required)(idOrKind, "trigger kind");
132
+ const kind = (0, cli_args_1.required)(idOrKind, "trigger kind");
133
133
  const payload = registryCli.resolveRoutineFirePayload(payloadPath, args.options);
134
134
  return { json: registryCli.routineFireCli(kind, payload, args.options) };
135
135
  }
@@ -142,9 +142,9 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (arg
142
142
  }, "cw routine is the API/GitHub-style trigger bridge; SPEC/mcp.md declares its MCP peers per verb (cw_routine_*), each wired below.");
143
143
  registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.create").mcp.handler = (args) => loadRegistryCli().routineCreateCli(args);
144
144
  registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.list").mcp.handler = (args) => loadRegistryCli().routineListCli(args);
145
- registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.delete").mcp.handler = (args) => loadRegistryCli().routineDeleteCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "trigger id"), args);
146
- registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.fire").mcp.handler = (args) => loadRegistryCli().routineFireCli((0, io_1.required)((0, io_1.optionalArg)(args.kind), "trigger kind"), args.payload, args);
147
- registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.events").mcp.handler = (args) => loadRegistryCli().routineEventsCli((0, io_1.optionalArg)(args.id), args);
145
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.delete").mcp.handler = (args) => loadRegistryCli().routineDeleteCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "trigger id"), args);
146
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.fire").mcp.handler = (args) => loadRegistryCli().routineFireCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.kind), "trigger kind"), args.payload, args);
147
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.events").mcp.handler = (args) => loadRegistryCli().routineEventsCli((0, cli_args_1.optionalArg)(args.id), args);
148
148
  // Each `routine <verb>` sub-action is its own two-token cli row. The
149
149
  // catch-all read [subcommand, idOrKind, payloadPath], so after the
150
150
  // dispatcher consumes the sub-verb positionals[0]=idOrKind,
@@ -152,13 +152,13 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.events").mcp.handler = (args
152
152
  // rows coming from the single literal COMMAND_HELP_ROWS.routine block.
153
153
  (0, registry_core_1.attachCliBinding)("routine.create", { path: ["routine", "create"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().routineCreateCli(args.options) }) });
154
154
  (0, registry_core_1.attachCliBinding)("routine.list", { path: ["routine", "list"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().routineListCli(args.options) }) });
155
- (0, registry_core_1.attachCliBinding)("routine.delete", { path: ["routine", "delete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().routineDeleteCli((0, io_1.required)(args.positionals[0], "trigger id"), args.options) }) });
155
+ (0, registry_core_1.attachCliBinding)("routine.delete", { path: ["routine", "delete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().routineDeleteCli((0, cli_args_1.required)(args.positionals[0], "trigger id"), args.options) }) });
156
156
  (0, registry_core_1.attachCliBinding)("routine.fire", {
157
157
  path: ["routine", "fire"],
158
158
  jsonMode: "default",
159
159
  hiddenFromHelp: true,
160
160
  handler: (args) => {
161
- const kind = (0, io_1.required)(args.positionals[0], "trigger kind");
161
+ const kind = (0, cli_args_1.required)(args.positionals[0], "trigger kind");
162
162
  const payloadPath = args.positionals[1];
163
163
  const registryCli = loadRegistryCli();
164
164
  const payload = registryCli.resolveRoutineFirePayload(payloadPath, args.options);
@@ -261,7 +261,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
261
261
  hiddenFromHelp: true,
262
262
  handler: (args) => {
263
263
  const report = loadRegistryCli().registryRefreshCli(args.options);
264
- return (0, io_1.wantsJson)(args.options) ? { json: report } : { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
264
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: report } : { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
265
265
  },
266
266
  });
267
267
  (0, registry_core_1.attachCliBinding)("registry.show", {
@@ -270,7 +270,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
270
270
  hiddenFromHelp: true,
271
271
  handler: (args) => {
272
272
  const report = loadRegistryCli().registryShowCli(args.options);
273
- return (0, io_1.wantsJson)(args.options) ? { json: report } : { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
273
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: report } : { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
274
274
  },
275
275
  });
276
276
  // ---- queue (add|list|drain|show) ----------------------------------------
@@ -286,12 +286,12 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
286
286
  return { json: registryCli.queueAddCli(args.options) };
287
287
  case "list": {
288
288
  const result = registryCli.queueListCli(args.options);
289
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadRunRegistryIo().formatQueueList(result) };
289
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadRunRegistryIo().formatQueueList(result) };
290
290
  }
291
291
  case "drain":
292
292
  return { json: registryCli.queueDrainCli(args.options) };
293
293
  case "show":
294
- return { json: registryCli.queueShowCli((0, io_1.required)(id, "queue id"), args.options) };
294
+ return { json: registryCli.queueShowCli((0, cli_args_1.required)(id, "queue id"), args.options) };
295
295
  default:
296
296
  throw new Error("Usage: cw queue add|list|drain|show [queue-id] [--repo PATH] [--priority N]");
297
297
  }
@@ -300,7 +300,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
300
300
  registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.add").mcp.handler = (args) => loadRegistryCli().queueAddCli(args);
301
301
  registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.list").mcp.handler = (args) => loadRegistryCli().queueListCli(args);
302
302
  registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.drain").mcp.handler = (args) => loadRegistryCli().queueDrainCli(args);
303
- registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) => loadRegistryCli().queueShowCli((0, io_1.required)((0, io_1.optionalArg)(args.id), "queue id"), args);
303
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) => loadRegistryCli().queueShowCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "queue id"), args);
304
304
  // `queue add|list|drain|show` each carry their own two-token cli.path
305
305
  // (found before the ["queue"] catch-all). `hiddenFromHelp` keeps `cw help
306
306
  // queue`'s rows coming from the single literal COMMAND_HELP_ROWS.queue
@@ -318,7 +318,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) =>
318
318
  hiddenFromHelp: true,
319
319
  handler: (args) => {
320
320
  const result = loadRegistryCli().queueListCli(args.options);
321
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadRunRegistryIo().formatQueueList(result) };
321
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadRunRegistryIo().formatQueueList(result) };
322
322
  },
323
323
  });
324
324
  (0, registry_core_1.attachCliBinding)("queue.drain", {
@@ -331,10 +331,10 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) =>
331
331
  path: ["queue", "show"],
332
332
  jsonMode: "default",
333
333
  hiddenFromHelp: true,
334
- handler: (args) => ({ json: loadRegistryCli().queueShowCli((0, io_1.required)(args.positionals[0], "queue id"), args.options) }),
334
+ handler: (args) => ({ json: loadRegistryCli().queueShowCli((0, cli_args_1.required)(args.positionals[0], "queue id"), args.options) }),
335
335
  });
336
336
  // ---- gc (plan|run|verify) ------------------------------------------------
337
- (0, registry_core_1.addCliOnlyCapability)("gc", "cw gc plan|run|verify [run-id] [--reclaimAfterArchiveDays N] [--keep-scratch] [--keep-snapshots] [--limit N] [--json] — run retention & provable reclamation.", {
337
+ (0, registry_core_1.addCliOnlyCapability)("gc", "cw gc plan|run|verify [run-id] [--reclaimAfterArchiveDays N] [--keep-scratch] [--keep-snapshots] [--keep-commits] [--limit N] [--json] — run retention & provable reclamation.", {
338
338
  path: ["gc"],
339
339
  jsonMode: "flag",
340
340
  hiddenFromHelp: true,
@@ -345,25 +345,25 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) =>
345
345
  switch (subcommand) {
346
346
  case "plan": {
347
347
  const result = registryCli.gcPlanCli(id, args.options);
348
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatGcPlan(result) };
348
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatGcPlan(result) };
349
349
  }
350
350
  case "run": {
351
351
  const result = registryCli.gcRunCli(id, args.options);
352
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatGcRun(result) };
352
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatGcRun(result) };
353
353
  }
354
354
  case "verify": {
355
- const result = registryCli.gcVerifyCli((0, io_1.required)(id, "run id"), args.options);
355
+ const result = registryCli.gcVerifyCli((0, cli_args_1.required)(id, "run id"), args.options);
356
356
  const text = reclamationIo.formatGcVerify(result);
357
357
  return { json: result, text, exitCode: result.reclaimed && !result.verified ? 1 : undefined };
358
358
  }
359
359
  default:
360
- throw new Error("Usage: cw gc plan|run|verify [run-id] [--reclaimAfterArchiveDays N] [--keep-scratch] [--keep-snapshots] [--limit N] [--json]");
360
+ throw new Error("Usage: cw gc plan|run|verify [run-id] [--reclaimAfterArchiveDays N] [--keep-scratch] [--keep-snapshots] [--keep-commits] [--limit N] [--json]");
361
361
  }
362
362
  },
363
363
  }, "cw gc is run retention & provable reclamation; SPEC/mcp.md declares its MCP peers (cw_gc_plan|run|verify), each wired below.");
364
- registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.plan").mcp.handler = (args) => loadRegistryCli().gcPlanCli((0, io_1.optionalArg)(args.runId), args);
365
- registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").mcp.handler = (args) => loadRegistryCli().gcRunCli((0, io_1.optionalArg)(args.runId), args);
366
- registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.verify").mcp.handler = (args) => loadRegistryCli().gcVerifyCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
364
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.plan").mcp.handler = (args) => loadRegistryCli().gcPlanCli((0, cli_args_1.optionalArg)(args.runId), args);
365
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").mcp.handler = (args) => loadRegistryCli().gcRunCli((0, cli_args_1.optionalArg)(args.runId), args);
366
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.verify").mcp.handler = (args) => loadRegistryCli().gcVerifyCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
367
367
  // PARITY: `gc.run` frees disk and appends a tombstone; both surfaces run
368
368
  // the identical transaction but the payload reports now-derived
369
369
  // bytesFreed/tombstone, so it is a documented opt-out, not drift.
@@ -392,7 +392,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
392
392
  hiddenFromHelp: true,
393
393
  handler: (args) => {
394
394
  const result = loadRegistryCli().gcPlanCli(args.positionals[0], args.options);
395
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatGcPlan(result) };
395
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatGcPlan(result) };
396
396
  },
397
397
  });
398
398
  (0, registry_core_1.attachCliBinding)("gc.verify", {
@@ -400,7 +400,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
400
400
  jsonMode: "flag",
401
401
  hiddenFromHelp: true,
402
402
  handler: (args) => {
403
- const result = loadRegistryCli().gcVerifyCli((0, io_1.required)(args.positionals[0], "run id"), args.options);
403
+ const result = loadRegistryCli().gcVerifyCli((0, cli_args_1.required)(args.positionals[0], "run id"), args.options);
404
404
  const text = loadReclamationIo().formatGcVerify(result);
405
405
  return { json: result, text, exitCode: result.reclaimed && !result.verified ? 1 : undefined };
406
406
  },
@@ -417,7 +417,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
417
417
  hiddenFromHelp: true,
418
418
  handler: (args) => {
419
419
  const result = loadRegistryCli().gcRunCli(args.positionals[0], args.options);
420
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatGcRun(result) };
420
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatGcRun(result) };
421
421
  },
422
422
  });
423
423
  // ---- orphans (list|gc) ---------------------------------------------------
@@ -432,11 +432,11 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
432
432
  switch (subcommand) {
433
433
  case "list": {
434
434
  const result = registryCli.orphansListCli(args.options);
435
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatOrphanRunsList(result) };
435
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatOrphanRunsList(result) };
436
436
  }
437
437
  case "gc": {
438
438
  const result = registryCli.orphansGcCli(args.options);
439
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatOrphanRunsGc(result) };
439
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatOrphanRunsGc(result) };
440
440
  }
441
441
  default:
442
442
  throw new Error("Usage: cw orphans list [--scope repo|home] [--json] | orphans gc [--scope repo|home] [--min-age-minutes N] [--all] [--json] (scope defaults to home: every registered repo)");
@@ -458,7 +458,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").mcp.handler = (args) =>
458
458
  hiddenFromHelp: true,
459
459
  handler: (args) => {
460
460
  const result = loadRegistryCli().orphansListCli(args.options);
461
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatOrphanRunsList(result) };
461
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatOrphanRunsList(result) };
462
462
  },
463
463
  });
464
464
  (0, registry_core_1.attachCliBinding)("orphans.gc", {
@@ -467,7 +467,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").mcp.handler = (args) =>
467
467
  hiddenFromHelp: true,
468
468
  handler: (args) => {
469
469
  const result = loadRegistryCli().orphansGcCli(args.options);
470
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatOrphanRunsGc(result) };
470
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatOrphanRunsGc(result) };
471
471
  },
472
472
  });
473
473
  registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").payloadIdentical = false;
@@ -485,11 +485,11 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").reason =
485
485
  switch (subcommand) {
486
486
  case "list": {
487
487
  const result = registryCli.clonesListCli();
488
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatClonesList(result) };
488
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatClonesList(result) };
489
489
  }
490
490
  case "gc": {
491
491
  const result = registryCli.clonesGcCli(args.options);
492
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatClonesGc(result) };
492
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatClonesGc(result) };
493
493
  }
494
494
  default:
495
495
  throw new Error("Usage: cw clones list [--json] | clones gc [--older-than-days N] [--all] [--json]");
@@ -509,7 +509,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").mcp.handler = (args) =>
509
509
  hiddenFromHelp: true,
510
510
  handler: (args) => {
511
511
  const result = loadRegistryCli().clonesListCli();
512
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatClonesList(result) };
512
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatClonesList(result) };
513
513
  },
514
514
  });
515
515
  (0, registry_core_1.attachCliBinding)("clones.gc", {
@@ -518,7 +518,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").mcp.handler = (args) =>
518
518
  hiddenFromHelp: true,
519
519
  handler: (args) => {
520
520
  const result = loadRegistryCli().clonesGcCli(args.options);
521
- return (0, io_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatClonesGc(result) };
521
+ return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatClonesGc(result) };
522
522
  },
523
523
  });
524
524
  registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").payloadIdentical = false;
@@ -550,35 +550,35 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.list").mcp.handler = (args) => l
550
550
  path: ["run", "show"],
551
551
  jsonMode: "flag",
552
552
  handler: (args) => {
553
- const runId = (0, io_1.required)(args.positionals[0], "run id");
553
+ const runId = (0, cli_args_1.required)(args.positionals[0], "run id");
554
554
  const result = loadRegistryCli().runShowCli(runId, args.options);
555
555
  return { json: result, text: loadRunRegistryIo().formatRunShow(result) };
556
556
  },
557
557
  });
558
- registry_core_1.REGISTRY_BY_CAPABILITY.get("run.show").mcp.handler = (args) => loadRegistryCli().runShowCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
558
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.show").mcp.handler = (args) => loadRegistryCli().runShowCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
559
559
  (0, registry_core_1.attachCliBinding)("run.resume", {
560
560
  path: ["run", "resume"],
561
561
  jsonMode: "flag",
562
562
  handler: async (args) => {
563
- const runId = (0, io_1.required)(args.positionals[0], "run id");
563
+ const runId = (0, cli_args_1.required)(args.positionals[0], "run id");
564
564
  const runRegistryIo = loadRunRegistryIo();
565
565
  const result = await loadRegistryCli().runResumeCli(runId, args.options);
566
566
  return { json: result, text: runRegistryIo.formatResume(result) };
567
567
  },
568
568
  });
569
- registry_core_1.REGISTRY_BY_CAPABILITY.get("run.resume").mcp.handler = (args) => loadRegistryCli().runResumeCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
569
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.resume").mcp.handler = (args) => loadRegistryCli().runResumeCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
570
570
  (0, registry_core_1.attachCliBinding)("run.archive", {
571
571
  path: ["run", "archive"],
572
572
  jsonMode: "default",
573
- handler: (args) => ({ json: loadRegistryCli().runArchiveCli((0, io_1.optionalArg)(args.positionals[0]), args.options) }),
573
+ handler: (args) => ({ json: loadRegistryCli().runArchiveCli((0, cli_args_1.optionalArg)(args.positionals[0]), args.options) }),
574
574
  });
575
- registry_core_1.REGISTRY_BY_CAPABILITY.get("run.archive").mcp.handler = (args) => loadRegistryCli().runArchiveCli((0, io_1.optionalArg)(args.runId), args);
575
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.archive").mcp.handler = (args) => loadRegistryCli().runArchiveCli((0, cli_args_1.optionalArg)(args.runId), args);
576
576
  (0, registry_core_1.attachCliBinding)("run.rerun", {
577
577
  path: ["run", "rerun"],
578
578
  jsonMode: "default",
579
- handler: (args) => ({ json: loadRegistryCli().runRerunCli((0, io_1.required)(args.positionals[0], "run id"), args.options) }),
579
+ handler: (args) => ({ json: loadRegistryCli().runRerunCli((0, cli_args_1.required)(args.positionals[0], "run id"), args.options) }),
580
580
  });
581
- registry_core_1.REGISTRY_BY_CAPABILITY.get("run.rerun").mcp.handler = (args) => loadRegistryCli().runRerunCli((0, io_1.required)((0, io_1.optionalArg)(args.runId), "run id"), args);
581
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.rerun").mcp.handler = (args) => loadRegistryCli().runRerunCli((0, cli_args_1.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
582
582
  // ---- history ---------------------------------------------------------
583
583
  (0, registry_core_1.attachCliBinding)("history", {
584
584
  path: ["history"],
@@ -6,7 +6,7 @@
6
6
  // (extracted with sed, not retyped).
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  const registry_core_1 = require("./registry-core");
9
- const io_1 = require("../../cli/io");
9
+ const cli_args_1 = require("../../core/util/cli-args");
10
10
  // This slice is required unconditionally at startup for every command;
11
11
  // load these shell modules only when a handler that actually needs them runs.
12
12
  function loadReportViewCli() {
@@ -23,17 +23,17 @@ function loadStateExplosionCli() {
23
23
  // Handler BODIES live in shell/state-cli.ts (impure — they read/write
24
24
  // run state on disk); this table only wires argv shape -> handler call
25
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
26
+ // executor contract. `required`/`optionalArg` are core/util/cli-args.ts's
27
+ // shared coercion helpers, imported here so the wiring stays a thin adapter
28
28
  // (Usage-error strings copied byte-for-byte from the old build's
29
29
  // handlers/*.ts).
30
30
  // ---------------------------------------------------------------------
31
- const io_2 = require("../../cli/io");
31
+ const cli_args_2 = require("../../core/util/cli-args");
32
32
  (0, registry_core_1.attachCliBinding)("state.check", {
33
33
  path: ["state", "check"],
34
34
  jsonMode: "default",
35
35
  handler: (args) => {
36
- const runId = (0, io_2.required)(args.positionals[0], "run id");
36
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
37
37
  const report = loadStateCli().checkState(runId, args.options);
38
38
  return { json: report, exitCode: report.status === "unsupported" ? 1 : undefined };
39
39
  },
@@ -47,7 +47,7 @@ const io_2 = require("../../cli/io");
47
47
  path: ["migration", "check"],
48
48
  jsonMode: "default",
49
49
  handler: (args) => {
50
- const target = (0, io_2.required)(args.positionals[0], "target (run-id or state/app file)");
50
+ const target = (0, cli_args_2.required)(args.positionals[0], "target (run-id or state/app file)");
51
51
  const report = loadStateCli().migrationCheck(target, args.options);
52
52
  return { json: report, exitCode: report.status === "unsupported" ? 1 : undefined };
53
53
  },
@@ -56,7 +56,7 @@ const io_2 = require("../../cli/io");
56
56
  path: ["migration", "prove"],
57
57
  jsonMode: "default",
58
58
  handler: (args) => {
59
- const target = (0, io_2.required)(args.positionals[0], "target (run-id or state/app file)");
59
+ const target = (0, cli_args_2.required)(args.positionals[0], "target (run-id or state/app file)");
60
60
  const proof = loadStateCli().migrationProve(target, args.options);
61
61
  return { json: proof, exitCode: proof.pass ? undefined : 1 };
62
62
  },
@@ -64,14 +64,14 @@ const io_2 = require("../../cli/io");
64
64
  (0, registry_core_1.attachCliBinding)("node.list", {
65
65
  path: ["node", "list"],
66
66
  jsonMode: "default",
67
- handler: (args) => ({ json: loadStateCli().listNodes((0, io_2.required)(args.positionals[0], "run id"), args.options) }),
67
+ handler: (args) => ({ json: loadStateCli().listNodes((0, cli_args_2.required)(args.positionals[0], "run id"), args.options) }),
68
68
  });
69
69
  (0, registry_core_1.attachCliBinding)("node.show", {
70
70
  path: ["node", "show"],
71
71
  jsonMode: "default",
72
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");
73
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
74
+ const nodeId = (0, cli_args_2.required)(args.positionals[1], "node id");
75
75
  return { json: loadStateCli().showNode(runId, nodeId, args.options) };
76
76
  },
77
77
  });
@@ -82,7 +82,7 @@ const io_2 = require("../../cli/io");
82
82
  path: ["node", "graph"],
83
83
  jsonMode: "flag",
84
84
  handler: (args) => {
85
- const runId = (0, io_2.required)(args.positionals[0], "run id");
85
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
86
86
  return { json: loadStateCli().graphNodes(runId, args.options), text: `${loadReportViewCli().graphText(runId, args.options)}\n` };
87
87
  },
88
88
  });
@@ -90,8 +90,8 @@ const io_2 = require("../../cli/io");
90
90
  path: ["node", "snapshot"],
91
91
  jsonMode: "default",
92
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");
93
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
94
+ const nodeId = (0, cli_args_2.required)(args.positionals[1], "node id");
95
95
  return { json: loadStateCli().nodeSnapshotCli(runId, nodeId, args.options) };
96
96
  },
97
97
  });
@@ -99,9 +99,9 @@ const io_2 = require("../../cli/io");
99
99
  path: ["node", "diff"],
100
100
  jsonMode: "default",
101
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");
102
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
103
+ const baselineSnapshotId = (0, cli_args_2.required)(args.positionals[1], "baseline snapshot id");
104
+ const candidateSnapshotId = (0, cli_args_2.required)(args.positionals[2], "candidate snapshot id");
105
105
  return { json: loadStateCli().nodeDiffCli(runId, baselineSnapshotId, candidateSnapshotId, args.options) };
106
106
  },
107
107
  });
@@ -109,8 +109,8 @@ const io_2 = require("../../cli/io");
109
109
  path: ["node", "replay"],
110
110
  jsonMode: "default",
111
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");
112
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
113
+ const snapshotId = (0, cli_args_2.required)(args.positionals[1], "snapshot id");
114
114
  return { json: loadStateCli().nodeReplayCli(runId, snapshotId, args.options) };
115
115
  },
116
116
  });
@@ -118,8 +118,8 @@ const io_2 = require("../../cli/io");
118
118
  path: ["node", "verify"],
119
119
  jsonMode: "default",
120
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");
121
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
122
+ const replayId = (0, cli_args_2.required)(args.positionals[1], "replay id");
123
123
  const verdict = loadStateCli().nodeReplayVerifyCli(runId, replayId, args.options);
124
124
  return { json: verdict, exitCode: verdict.pass ? undefined : 1 };
125
125
  },
@@ -127,17 +127,17 @@ const io_2 = require("../../cli/io");
127
127
  // GAP #24: mirror the state-kernel CLI shell fns as MCP handlers (they were
128
128
  // declared MCP tool rows but left on notYetImplemented). Arg-name reads copied
129
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);
130
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("state.check").mcp.handler = (args) => loadStateCli().checkState((0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
131
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);
132
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("migration.check").mcp.handler = (args) => loadStateCli().migrationCheck((0, cli_args_2.required)((0, cli_args_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, cli_args_2.required)((0, cli_args_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, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
135
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.show").mcp.handler = (args) => loadStateCli().showNode((0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), (0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.nodeId), "node id"), args);
136
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.graph").mcp.handler = (args) => loadStateCli().graphNodes((0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), args);
137
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.snapshot").mcp.handler = (args) => loadStateCli().nodeSnapshotCli((0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), (0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.nodeId), "node id"), args);
138
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.diff").mcp.handler = (args) => loadStateCli().nodeDiffCli((0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), (0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.baselineSnapshotId ?? args.baseline), "baseline snapshot id"), (0, cli_args_2.required)((0, cli_args_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, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), (0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.snapshotId), "snapshot id"), args);
140
+ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.replay.verify").mcp.handler = (args) => loadStateCli().nodeReplayVerifyCli((0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.runId), "run id"), (0, cli_args_2.required)((0, cli_args_1.optionalArg)(args.replayId), "replay id"), args);
141
141
  // `contract.show` is not yet a declared MCP_TOOL_DATA row with a CLI peer
142
142
  // wired here (it IS in MCP_TOOL_DATA already); no milestone-3 conformance
143
143
  // case reaches it, so it is intentionally left on its placeholder handler
@@ -152,19 +152,19 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("node.replay.verify").mcp.handler = (
152
152
  // "flag" — text by default, JSON under --json/--format json).
153
153
  // ---------------------------------------------------------------------
154
154
  const state_explosion_text_1 = require("../../core/format/state-explosion-text");
155
- const io_3 = require("../../cli/io");
155
+ const cli_args_3 = require("../../core/util/cli-args");
156
156
  (0, registry_core_1.attachCliBinding)("summary.refresh", {
157
157
  path: ["summary", "refresh"],
158
158
  jsonMode: "flag",
159
159
  handler: (args) => {
160
- const runId = (0, io_2.required)(args.positionals[0], "run id");
160
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
161
161
  const index = loadStateExplosionCli().summaryRefreshCli(runId, args.options);
162
162
  // Byte-exact port of the old build's handleSummary "refresh": the
163
163
  // human-text branch re-reads via a fresh summaryShow call rather than
164
164
  // formatting the refresh's own index record (src/cli/handlers/
165
165
  // operator.ts:118-127); only computed when actually needed, so a
166
166
  // --json call does exactly the one read the old build's if/else did.
167
- if ((0, io_3.wantsJson)(args.options))
167
+ if ((0, cli_args_3.wantsJson)(args.options))
168
168
  return { json: index };
169
169
  return { json: index, text: (0, state_explosion_text_1.formatStateExplosionReport)(loadStateExplosionCli().summaryShowCli(runId, args.options)) };
170
170
  },
@@ -173,7 +173,7 @@ const io_3 = require("../../cli/io");
173
173
  path: ["summary", "show"],
174
174
  jsonMode: "flag",
175
175
  handler: (args) => {
176
- const runId = (0, io_2.required)(args.positionals[0], "run id");
176
+ const runId = (0, cli_args_2.required)(args.positionals[0], "run id");
177
177
  const report = loadStateExplosionCli().summaryShowCli(runId, args.options);
178
178
  return { json: report, text: (0, state_explosion_text_1.formatStateExplosionReport)(report) };
179
179
  },