cool-workflow 0.2.2 → 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.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/apps/architecture-review/app.json +1 -1
- package/apps/architecture-review-fast/app.json +1 -1
- package/apps/end-to-end-golden-path/app.json +1 -1
- package/apps/pr-review-fix-ci/app.json +1 -1
- package/apps/release-cut/app.json +1 -1
- package/apps/research-synthesis/app.json +1 -1
- package/dist/cli/dispatch.js +13 -6
- package/dist/cli/entry.js +41 -1
- package/dist/cli/io.js +12 -22
- package/dist/cli/parseargv.js +1 -0
- package/dist/core/capability-data.js +3 -2
- package/dist/core/format/completion.js +68 -0
- package/dist/core/format/help.js +31 -6
- package/dist/core/format/safe-json.js +73 -0
- package/dist/core/format/state-explosion-text.js +1 -1
- package/dist/core/multi-agent/candidate-scoring.js +5 -1
- package/dist/core/multi-agent/collaboration.js +3 -3
- package/dist/core/multi-agent/coordinator.js +5 -5
- package/dist/core/multi-agent/runtime.js +4 -4
- package/dist/core/multi-agent/topology.js +3 -3
- package/dist/core/pipeline/dispatch.js +18 -4
- package/dist/core/pipeline/drive-decide.js +2 -1
- package/dist/core/state/migrations.js +16 -1
- package/dist/core/state/state-explosion/digest.js +13 -13
- package/dist/core/state/state-explosion/graph.js +17 -11
- package/dist/core/state/state-explosion/report.js +6 -6
- package/dist/core/util/cli-args.js +33 -0
- package/dist/core/util/numeric-flag.js +40 -0
- package/dist/core/version.js +1 -1
- package/dist/mcp/server.js +99 -11
- package/dist/shell/audit-cli.js +57 -25
- package/dist/shell/coordinator-io.js +73 -13
- package/dist/shell/dispatch.js +1 -1
- package/dist/shell/doctor.js +80 -1
- package/dist/shell/drive.js +251 -49
- package/dist/shell/eval-text.js +2 -2
- package/dist/shell/evidence-reasoning.js +4 -4
- package/dist/shell/execution-backend/agent.js +30 -2
- package/dist/shell/execution-backend/container.js +4 -1
- package/dist/shell/execution-backend/local.js +19 -11
- package/dist/shell/feedback-cli.js +6 -6
- package/dist/shell/fs-atomic.js +218 -29
- package/dist/shell/man-cli.js +6 -0
- package/dist/shell/metrics-cli.js +2 -1
- package/dist/shell/multi-agent-cli.js +367 -323
- package/dist/shell/multi-agent-host.js +9 -9
- package/dist/shell/multi-agent-operator-ux.js +80 -38
- package/dist/shell/node-store.js +10 -4
- package/dist/shell/observability.js +1 -1
- package/dist/shell/operator-ux-text.js +22 -22
- package/dist/shell/operator-ux.js +15 -14
- package/dist/shell/orchestrator.js +49 -38
- package/dist/shell/pipeline-cli.js +107 -42
- package/dist/shell/reclamation-io.js +88 -10
- package/dist/shell/registry-cli.js +23 -17
- package/dist/shell/remote-source.js +13 -8
- package/dist/shell/report-cli.js +45 -0
- package/dist/shell/report.js +2 -1
- package/dist/shell/run-registry-io.js +78 -19
- package/dist/shell/run-store.js +74 -2
- package/dist/shell/scheduling-io.js +12 -13
- package/dist/shell/state-cli.js +2 -7
- package/dist/shell/state-explosion-cli.js +17 -9
- package/dist/shell/topology-io.js +36 -5
- package/dist/shell/trust-audit.js +224 -22
- package/dist/shell/trust-policy-io.js +1 -1
- package/dist/shell/worker-cli.js +35 -31
- package/dist/shell/workflow-app-loader.js +67 -1
- package/dist/wiring/capability-table/basics.js +33 -8
- package/dist/wiring/capability-table/exec-backend.js +28 -19
- package/dist/wiring/capability-table/multi-agent.js +187 -180
- package/dist/wiring/capability-table/parity.js +1 -0
- package/dist/wiring/capability-table/pipeline.js +64 -52
- package/dist/wiring/capability-table/registry-core.js +30 -11
- package/dist/wiring/capability-table/reporting.js +147 -106
- package/dist/wiring/capability-table/scheduling-registry.js +201 -167
- package/dist/wiring/capability-table/state.js +59 -51
- package/dist/wiring/capability-table/trust-ledger.js +52 -28
- package/dist/wiring/capability-table/workflow-apps.js +85 -70
- package/docs/agent-delegation-drive.7.md +4 -0
- package/docs/candidate-scoring.7.md +1 -1
- package/docs/canonical-workflow-apps.7.md +7 -7
- package/docs/cli-mcp-parity.7.md +26 -16
- package/docs/contract-migration-tooling.7.md +4 -0
- package/docs/control-plane-scheduling.7.md +4 -0
- package/docs/coordinator-blackboard.7.md +17 -17
- package/docs/dogfood-one-real-repo.7.md +11 -11
- package/docs/durable-state-and-locking.7.md +4 -0
- package/docs/end-to-end-golden-path.7.md +14 -14
- package/docs/evidence-adoption-reasoning-chain.7.md +4 -0
- package/docs/execution-backends.7.md +4 -0
- package/docs/getting-started.md +37 -37
- package/docs/multi-agent-cli-mcp-surface.7.md +21 -17
- package/docs/multi-agent-eval-replay-harness.7.md +17 -13
- package/docs/multi-agent-operator-ux.7.md +23 -19
- package/docs/multi-agent-runtime-core.7.md +22 -22
- package/docs/multi-agent-topologies.7.md +6 -6
- package/docs/multi-agent-trust-policy-audit.7.md +11 -11
- package/docs/node-snapshot-diff-replay.7.md +4 -0
- package/docs/observability-cost-accounting.7.md +4 -0
- package/docs/operator-ux.7.md +34 -34
- package/docs/pipeline-runner.7.md +4 -4
- package/docs/project-index.md +31 -4
- package/docs/real-execution-backends.7.md +4 -0
- package/docs/release-and-migration.7.md +5 -1
- package/docs/release-tooling.7.md +22 -0
- package/docs/routines.md +4 -4
- package/docs/run-registry-control-plane.7.md +23 -19
- package/docs/run-retention-reclamation.7.md +24 -3
- package/docs/scheduled-tasks.md +14 -14
- package/docs/security-trust-hardening.7.md +15 -15
- package/docs/state-explosion-management.7.md +14 -10
- package/docs/team-collaboration.7.md +4 -0
- package/docs/trust-audit-anchor.7.md +4 -0
- package/docs/unix-principles.md +3 -1
- package/docs/verifier-gated-commit.7.md +1 -1
- package/docs/web-desktop-workbench.7.md +4 -0
- package/docs/workflow-app-framework.7.md +13 -13
- package/manifest/plugin.manifest.json +1 -1
- package/package.json +3 -2
- package/scripts/agents/claude-p-agent.js +2 -2
- package/scripts/block-unapproved-tag.sh +42 -6
- package/scripts/bump-version.js +27 -10
- package/scripts/canonical-apps.js +4 -4
- package/scripts/children/batch-delegate-child.js +52 -2
- package/scripts/dogfood-release.js +1 -1
- package/scripts/fake-date-for-reproduction.js +44 -0
- package/scripts/golden-path.js +4 -4
- package/scripts/purity-baseline.json +0 -27
- package/scripts/release-flow.js +194 -13
- package/scripts/release-oneclick.js +407 -0
- package/scripts/verdict-keygen.js +83 -0
- package/scripts/verify-bump-reproduction.sh +148 -0
- package/scripts/verify-verdict-signature.js +61 -0
- package/scripts/version-sync-check.js +39 -22
- package/skills/cool-workflow/SKILL.md +9 -9
- package/skills/cool-workflow/references/commands.md +89 -88
- package/ui/workbench/app.css +37 -1
- package/ui/workbench/app.js +124 -6
|
@@ -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
|
|
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|
|
|
@@ -19,10 +19,23 @@ const io_1 = require("../../cli/io");
|
|
|
19
19
|
// the old build's handlers/{scheduling,registry,maintenance,orphans,
|
|
20
20
|
// clones}.ts.
|
|
21
21
|
// ---------------------------------------------------------------------
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
// This whole module is required unconditionally at CLI/MCP startup for
|
|
23
|
+
// EVERY command; loading these 4 shell modules lazily (only inside the
|
|
24
|
+
// handler that actually calls into them) keeps that load cost off every
|
|
25
|
+
// invocation that never touches schedule/routine/sched/registry/queue/
|
|
26
|
+
// gc/orphans/clones/run/history.
|
|
27
|
+
function loadRegistryCli() {
|
|
28
|
+
return require("../../shell/registry-cli");
|
|
29
|
+
}
|
|
30
|
+
function loadReclamationIo() {
|
|
31
|
+
return require("../../shell/reclamation-io");
|
|
32
|
+
}
|
|
33
|
+
function loadRunRegistryIo() {
|
|
34
|
+
return require("../../shell/run-registry-io");
|
|
35
|
+
}
|
|
36
|
+
function loadSchedulingIo() {
|
|
37
|
+
return require("../../shell/scheduling-io");
|
|
38
|
+
}
|
|
26
39
|
function firstPositionalArg(args, index = 0) {
|
|
27
40
|
return args.positionals[index];
|
|
28
41
|
}
|
|
@@ -30,7 +43,7 @@ function firstPositionalArg(args, index = 0) {
|
|
|
30
43
|
(0, registry_core_1.addCliOnlyCapability)("loop", 'cw loop — sugar for "schedule create --kind loop".', {
|
|
31
44
|
path: ["loop"],
|
|
32
45
|
jsonMode: "default",
|
|
33
|
-
handler: (args) => ({ json: (
|
|
46
|
+
handler: (args) => ({ json: loadRegistryCli().scheduleCreateCli({ ...args.options, kind: "loop" }) }),
|
|
34
47
|
}, "loop is CLI-only sugar over schedule.create; the old build never gave it an MCP tool of its own (SPEC/scheduling-registry.md section I).");
|
|
35
48
|
(0, registry_core_1.addCliOnlyCapability)("schedule", "cw schedule create|list|delete|due|complete|pause|resume|run-now|history|daemon — the wall-clock scheduler.", {
|
|
36
49
|
path: ["schedule"],
|
|
@@ -38,36 +51,37 @@ function firstPositionalArg(args, index = 0) {
|
|
|
38
51
|
hiddenFromHelp: true,
|
|
39
52
|
handler: (args) => {
|
|
40
53
|
const [subcommand, id] = args.positionals;
|
|
54
|
+
const registryCli = loadRegistryCli();
|
|
41
55
|
switch (subcommand) {
|
|
42
56
|
case "create":
|
|
43
|
-
return { json:
|
|
57
|
+
return { json: registryCli.scheduleCreateCli(args.options) };
|
|
44
58
|
case "list":
|
|
45
|
-
return { json:
|
|
59
|
+
return { json: registryCli.scheduleListCli(args.options) };
|
|
46
60
|
case "delete":
|
|
47
|
-
return { json:
|
|
61
|
+
return { json: registryCli.scheduleDeleteCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
|
|
48
62
|
case "due":
|
|
49
|
-
return { json:
|
|
63
|
+
return { json: registryCli.scheduleDueCli(args.options) };
|
|
50
64
|
case "complete":
|
|
51
|
-
return { json:
|
|
65
|
+
return { json: registryCli.scheduleCompleteCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
|
|
52
66
|
case "pause":
|
|
53
|
-
return { json:
|
|
67
|
+
return { json: registryCli.schedulePauseCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
|
|
54
68
|
case "resume":
|
|
55
|
-
return { json:
|
|
69
|
+
return { json: registryCli.scheduleResumeCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
|
|
56
70
|
case "run-now":
|
|
57
|
-
return { json:
|
|
71
|
+
return { json: registryCli.scheduleRunNowCli((0, cli_args_1.required)(id, "schedule id"), args.options) };
|
|
58
72
|
case "history":
|
|
59
|
-
return { json:
|
|
73
|
+
return { json: registryCli.scheduleHistoryCli(id, args.options) };
|
|
60
74
|
case "daemon": {
|
|
61
75
|
if (args.options.once)
|
|
62
|
-
return { json:
|
|
76
|
+
return { json: registryCli.scheduleDaemonTickCli(args.options) };
|
|
63
77
|
// Never returns (matches the old build's forever daemon loop);
|
|
64
78
|
// the process stays alive via the DesktopSchedulerDaemon's own
|
|
65
79
|
// setInterval, printing one tick line per interval.
|
|
66
|
-
void
|
|
80
|
+
void registryCli.scheduleDaemonRunForever(args.options);
|
|
67
81
|
return {};
|
|
68
82
|
}
|
|
69
83
|
default:
|
|
70
|
-
throw new Error("Usage: cw
|
|
84
|
+
throw new Error("Usage: cw schedule create|list|delete|due|complete|pause|resume|run-now|history|daemon");
|
|
71
85
|
}
|
|
72
86
|
},
|
|
73
87
|
}, "cw schedule is the desktop wall-clock scheduler; SPEC/mcp.md declares its MCP peers per verb (cw_schedule_*), each wired below.");
|
|
@@ -75,30 +89,30 @@ function firstPositionalArg(args, index = 0) {
|
|
|
75
89
|
// notYetImplemented placeholder (the "each wired below" comment was never
|
|
76
90
|
// satisfied). Mirror the CLI switch's shell fns; arg-name reads (id/status)
|
|
77
91
|
// copied from the old build's mcp/tool-call.ts scheduler arms.
|
|
78
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.create").mcp.handler = (args) => (
|
|
79
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.list").mcp.handler = (args) => (
|
|
80
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.due").mcp.handler = (args) => (
|
|
81
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.complete").mcp.handler = (args) => (
|
|
82
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.pause").mcp.handler = (args) => (
|
|
83
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.resume").mcp.handler = (args) => (
|
|
84
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.run-now").mcp.handler = (args) => (
|
|
85
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.history").mcp.handler = (args) => (
|
|
86
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (args) => (
|
|
92
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.create").mcp.handler = (args) => loadRegistryCli().scheduleCreateCli(args);
|
|
93
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.list").mcp.handler = (args) => loadRegistryCli().scheduleListCli(args);
|
|
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, 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);
|
|
87
101
|
// Each `schedule <verb>` sub-action is its own two-token cli row (found
|
|
88
102
|
// before the ["schedule"] catch-all per the reversed candidate order), so
|
|
89
103
|
// each capability is a real both-surface dual-bound row. Same shell fns and
|
|
90
104
|
// [subcommand, id] positional mapping as the catch-all switch above.
|
|
91
105
|
// `hiddenFromHelp` keeps `cw help schedule`'s rows coming from the single
|
|
92
106
|
// literal COMMAND_HELP_ROWS.schedule block.
|
|
93
|
-
(0, registry_core_1.attachCliBinding)("schedule.create", { path: ["schedule", "create"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
94
|
-
(0, registry_core_1.attachCliBinding)("schedule.list", { path: ["schedule", "list"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
95
|
-
(0, registry_core_1.attachCliBinding)("schedule.delete", { path: ["schedule", "delete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
96
|
-
(0, registry_core_1.attachCliBinding)("schedule.due", { path: ["schedule", "due"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
97
|
-
(0, registry_core_1.attachCliBinding)("schedule.complete", { path: ["schedule", "complete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
98
|
-
(0, registry_core_1.attachCliBinding)("schedule.pause", { path: ["schedule", "pause"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
99
|
-
(0, registry_core_1.attachCliBinding)("schedule.resume", { path: ["schedule", "resume"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
100
|
-
(0, registry_core_1.attachCliBinding)("schedule.run-now", { path: ["schedule", "run-now"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
101
|
-
(0, registry_core_1.attachCliBinding)("schedule.history", { path: ["schedule", "history"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
107
|
+
(0, registry_core_1.attachCliBinding)("schedule.create", { path: ["schedule", "create"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleCreateCli(args.options) }) });
|
|
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, cli_args_1.required)(args.positionals[0], "schedule id"), args.options) }) });
|
|
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, 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
|
+
(0, registry_core_1.attachCliBinding)("schedule.history", { path: ["schedule", "history"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().scheduleHistoryCli(args.positionals[0], args.options) }) });
|
|
102
116
|
// ---- routine ------------------------------------------------------------
|
|
103
117
|
(0, registry_core_1.addCliOnlyCapability)("routine", "cw routine create|list|delete|fire|events — API/GitHub-style triggers.", {
|
|
104
118
|
path: ["routine"],
|
|
@@ -106,50 +120,52 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("schedule.delete").mcp.handler = (arg
|
|
|
106
120
|
hiddenFromHelp: true,
|
|
107
121
|
handler: (args) => {
|
|
108
122
|
const [subcommand, idOrKind, payloadPath] = args.positionals;
|
|
123
|
+
const registryCli = loadRegistryCli();
|
|
109
124
|
switch (subcommand) {
|
|
110
125
|
case "create":
|
|
111
|
-
return { json:
|
|
126
|
+
return { json: registryCli.routineCreateCli(args.options) };
|
|
112
127
|
case "list":
|
|
113
|
-
return { json:
|
|
128
|
+
return { json: registryCli.routineListCli(args.options) };
|
|
114
129
|
case "delete":
|
|
115
|
-
return { json:
|
|
130
|
+
return { json: registryCli.routineDeleteCli((0, cli_args_1.required)(idOrKind, "trigger id"), args.options) };
|
|
116
131
|
case "fire": {
|
|
117
|
-
const kind = (0,
|
|
118
|
-
const payload =
|
|
119
|
-
return { json:
|
|
132
|
+
const kind = (0, cli_args_1.required)(idOrKind, "trigger kind");
|
|
133
|
+
const payload = registryCli.resolveRoutineFirePayload(payloadPath, args.options);
|
|
134
|
+
return { json: registryCli.routineFireCli(kind, payload, args.options) };
|
|
120
135
|
}
|
|
121
136
|
case "events":
|
|
122
|
-
return { json:
|
|
137
|
+
return { json: registryCli.routineEventsCli(idOrKind, args.options) };
|
|
123
138
|
default:
|
|
124
|
-
throw new Error("Usage: cw
|
|
139
|
+
throw new Error("Usage: cw routine create|list|delete|fire|events");
|
|
125
140
|
}
|
|
126
141
|
},
|
|
127
142
|
}, "cw routine is the API/GitHub-style trigger bridge; SPEC/mcp.md declares its MCP peers per verb (cw_routine_*), each wired below.");
|
|
128
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.create").mcp.handler = (args) => (
|
|
129
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.list").mcp.handler = (args) => (
|
|
130
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.delete").mcp.handler = (args) => (
|
|
131
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.fire").mcp.handler = (args) => (
|
|
132
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.events").mcp.handler = (args) => (
|
|
143
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.create").mcp.handler = (args) => loadRegistryCli().routineCreateCli(args);
|
|
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, 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);
|
|
133
148
|
// Each `routine <verb>` sub-action is its own two-token cli row. The
|
|
134
149
|
// catch-all read [subcommand, idOrKind, payloadPath], so after the
|
|
135
150
|
// dispatcher consumes the sub-verb positionals[0]=idOrKind,
|
|
136
151
|
// positionals[1]=payloadPath. `hiddenFromHelp` keeps `cw help routine`'s
|
|
137
152
|
// rows coming from the single literal COMMAND_HELP_ROWS.routine block.
|
|
138
|
-
(0, registry_core_1.attachCliBinding)("routine.create", { path: ["routine", "create"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
139
|
-
(0, registry_core_1.attachCliBinding)("routine.list", { path: ["routine", "list"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
140
|
-
(0, registry_core_1.attachCliBinding)("routine.delete", { path: ["routine", "delete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
153
|
+
(0, registry_core_1.attachCliBinding)("routine.create", { path: ["routine", "create"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().routineCreateCli(args.options) }) });
|
|
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, cli_args_1.required)(args.positionals[0], "trigger id"), args.options) }) });
|
|
141
156
|
(0, registry_core_1.attachCliBinding)("routine.fire", {
|
|
142
157
|
path: ["routine", "fire"],
|
|
143
158
|
jsonMode: "default",
|
|
144
159
|
hiddenFromHelp: true,
|
|
145
160
|
handler: (args) => {
|
|
146
|
-
const kind = (0,
|
|
161
|
+
const kind = (0, cli_args_1.required)(args.positionals[0], "trigger kind");
|
|
147
162
|
const payloadPath = args.positionals[1];
|
|
148
|
-
const
|
|
149
|
-
|
|
163
|
+
const registryCli = loadRegistryCli();
|
|
164
|
+
const payload = registryCli.resolveRoutineFirePayload(payloadPath, args.options);
|
|
165
|
+
return { json: registryCli.routineFireCli(kind, payload, args.options) };
|
|
150
166
|
},
|
|
151
167
|
});
|
|
152
|
-
(0, registry_core_1.attachCliBinding)("routine.events", { path: ["routine", "events"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
168
|
+
(0, registry_core_1.attachCliBinding)("routine.events", { path: ["routine", "events"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadRegistryCli().routineEventsCli(args.positionals[0], args.options) }) });
|
|
153
169
|
// ---- sched (control-plane leases over the durable queue) ---------------
|
|
154
170
|
(0, registry_core_1.addCliOnlyCapability)("sched", "cw sched plan|lease|release|complete|reclaim|reset|policy [show|set] — control-plane lease scheduling over the durable queue.", {
|
|
155
171
|
path: ["sched"],
|
|
@@ -157,38 +173,39 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("routine.events").mcp.handler = (args
|
|
|
157
173
|
hiddenFromHelp: true,
|
|
158
174
|
handler: (args) => {
|
|
159
175
|
const [subcommand, idArg] = args.positionals;
|
|
176
|
+
const schedulingIo = loadSchedulingIo();
|
|
160
177
|
switch (subcommand) {
|
|
161
178
|
case "plan":
|
|
162
|
-
return { json:
|
|
179
|
+
return { json: schedulingIo.schedPlanCli(args.options) };
|
|
163
180
|
case "lease":
|
|
164
|
-
return { json:
|
|
181
|
+
return { json: schedulingIo.schedLeaseCli(args.options) };
|
|
165
182
|
case "release":
|
|
166
|
-
return { json:
|
|
183
|
+
return { json: schedulingIo.schedReleaseCli(String(args.options.leaseId || idArg || ""), args.options) };
|
|
167
184
|
case "complete":
|
|
168
|
-
return { json:
|
|
185
|
+
return { json: schedulingIo.schedCompleteCli(String(args.options.leaseId || idArg || ""), args.options) };
|
|
169
186
|
case "reclaim":
|
|
170
|
-
return { json:
|
|
187
|
+
return { json: schedulingIo.schedReclaimCli(args.options) };
|
|
171
188
|
case "reset":
|
|
172
|
-
return { json:
|
|
189
|
+
return { json: schedulingIo.schedResetCli(String(args.options.id || idArg || ""), args.options) };
|
|
173
190
|
case "policy": {
|
|
174
191
|
const action = args.positionals[1];
|
|
175
192
|
if (action === "set")
|
|
176
|
-
return { json:
|
|
177
|
-
return { json:
|
|
193
|
+
return { json: schedulingIo.schedPolicySetCli(args.options) };
|
|
194
|
+
return { json: schedulingIo.schedPolicyShowCli(args.options) };
|
|
178
195
|
}
|
|
179
196
|
default:
|
|
180
|
-
throw new Error("Usage: cw
|
|
197
|
+
throw new Error("Usage: cw sched plan|lease|release|complete|reclaim|reset|policy [show|set] [id] [--maxConcurrent N --maxAttempts N ...]");
|
|
181
198
|
}
|
|
182
199
|
},
|
|
183
200
|
}, "cw sched is the durable-queue lease scheduler; SPEC/mcp.md declares its MCP peers per verb (cw_sched_*), each wired below.");
|
|
184
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.plan").mcp.handler = (args) => (
|
|
185
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.lease").mcp.handler = (args) => (
|
|
186
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.release").mcp.handler = (args) => (
|
|
187
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.complete").mcp.handler = (args) => (
|
|
188
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.reclaim").mcp.handler = (args) => (
|
|
189
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.reset").mcp.handler = (args) => (
|
|
190
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.policy.show").mcp.handler = (args) => (
|
|
191
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.policy.set").mcp.handler = (args) => (
|
|
201
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.plan").mcp.handler = (args) => loadSchedulingIo().schedPlanCli(args);
|
|
202
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.lease").mcp.handler = (args) => loadSchedulingIo().schedLeaseCli(args);
|
|
203
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.release").mcp.handler = (args) => loadSchedulingIo().schedReleaseCli(String(args.leaseId || ""), args);
|
|
204
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.complete").mcp.handler = (args) => loadSchedulingIo().schedCompleteCli(String(args.leaseId || ""), args);
|
|
205
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.reclaim").mcp.handler = (args) => loadSchedulingIo().schedReclaimCli(args);
|
|
206
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.reset").mcp.handler = (args) => loadSchedulingIo().schedResetCli(String(args.id || ""), args);
|
|
207
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.policy.show").mcp.handler = (args) => loadSchedulingIo().schedPolicyShowCli(args);
|
|
208
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.policy.set").mcp.handler = (args) => loadSchedulingIo().schedPolicySetCli(args);
|
|
192
209
|
// Each `sched <verb>` sub-action is its own two-token cli row. The
|
|
193
210
|
// catch-all read [subcommand, idArg]; after the dispatcher consumes the
|
|
194
211
|
// sub-verb, positionals[0]=idArg (release/complete read --leaseId or that
|
|
@@ -197,17 +214,18 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("sched.policy.set").mcp.handler = (ar
|
|
|
197
214
|
// from the first positional (like blackboard.message.post/list).
|
|
198
215
|
// `hiddenFromHelp` keeps `cw help sched`'s rows coming from the single
|
|
199
216
|
// literal COMMAND_HELP_ROWS.sched block.
|
|
200
|
-
(0, registry_core_1.attachCliBinding)("sched.plan", { path: ["sched", "plan"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
201
|
-
(0, registry_core_1.attachCliBinding)("sched.lease", { path: ["sched", "lease"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
202
|
-
(0, registry_core_1.attachCliBinding)("sched.release", { path: ["sched", "release"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
203
|
-
(0, registry_core_1.attachCliBinding)("sched.complete", { path: ["sched", "complete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
204
|
-
(0, registry_core_1.attachCliBinding)("sched.reclaim", { path: ["sched", "reclaim"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
205
|
-
(0, registry_core_1.attachCliBinding)("sched.reset", { path: ["sched", "reset"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: (
|
|
217
|
+
(0, registry_core_1.attachCliBinding)("sched.plan", { path: ["sched", "plan"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadSchedulingIo().schedPlanCli(args.options) }) });
|
|
218
|
+
(0, registry_core_1.attachCliBinding)("sched.lease", { path: ["sched", "lease"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadSchedulingIo().schedLeaseCli(args.options) }) });
|
|
219
|
+
(0, registry_core_1.attachCliBinding)("sched.release", { path: ["sched", "release"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadSchedulingIo().schedReleaseCli(String(args.options.leaseId || args.positionals[0] || ""), args.options) }) });
|
|
220
|
+
(0, registry_core_1.attachCliBinding)("sched.complete", { path: ["sched", "complete"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadSchedulingIo().schedCompleteCli(String(args.options.leaseId || args.positionals[0] || ""), args.options) }) });
|
|
221
|
+
(0, registry_core_1.attachCliBinding)("sched.reclaim", { path: ["sched", "reclaim"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadSchedulingIo().schedReclaimCli(args.options) }) });
|
|
222
|
+
(0, registry_core_1.attachCliBinding)("sched.reset", { path: ["sched", "reset"], jsonMode: "default", hiddenFromHelp: true, handler: (args) => ({ json: loadSchedulingIo().schedResetCli(String(args.options.id || args.positionals[0] || ""), args.options) }) });
|
|
206
223
|
function schedPolicyHandler(args) {
|
|
207
224
|
const action = args.positionals[0];
|
|
225
|
+
const schedulingIo = loadSchedulingIo();
|
|
208
226
|
if (action === "set")
|
|
209
|
-
return { json:
|
|
210
|
-
return { json:
|
|
227
|
+
return { json: schedulingIo.schedPolicySetCli(args.options) };
|
|
228
|
+
return { json: schedulingIo.schedPolicyShowCli(args.options) };
|
|
211
229
|
}
|
|
212
230
|
(0, registry_core_1.attachCliBinding)("sched.policy.show", { path: ["sched", "policy"], helpPath: ["sched", "policy"], jsonMode: "default", hiddenFromHelp: true, handler: schedPolicyHandler });
|
|
213
231
|
(0, registry_core_1.attachCliBinding)("sched.policy.set", { path: ["sched", "policy"], helpPath: ["sched", "policy"], jsonMode: "default", hiddenFromHelp: true, handler: schedPolicyHandler });
|
|
@@ -218,18 +236,19 @@ function schedPolicyHandler(args) {
|
|
|
218
236
|
hiddenFromHelp: true,
|
|
219
237
|
handler: (args) => {
|
|
220
238
|
const subcommand = firstPositionalArg(args);
|
|
239
|
+
const registryCli = loadRegistryCli();
|
|
221
240
|
let report;
|
|
222
241
|
if (subcommand === "refresh")
|
|
223
|
-
report =
|
|
242
|
+
report = registryCli.registryRefreshCli(args.options);
|
|
224
243
|
else if (subcommand === "show")
|
|
225
|
-
report =
|
|
244
|
+
report = registryCli.registryShowCli(args.options);
|
|
226
245
|
else
|
|
227
|
-
throw new Error("Usage: cw
|
|
228
|
-
return { json: report, text: (
|
|
246
|
+
throw new Error("Usage: cw registry refresh|show [--scope repo|home] [--json]");
|
|
247
|
+
return { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
|
|
229
248
|
},
|
|
230
249
|
}, "cw registry is the derived run-registry index; SPEC/mcp.md declares its MCP peers (cw_registry_refresh|show), each wired below.");
|
|
231
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.refresh").mcp.handler = (args) => (
|
|
232
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args) => (
|
|
250
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.refresh").mcp.handler = (args) => loadRegistryCli().registryRefreshCli(args);
|
|
251
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args) => loadRegistryCli().registryShowCli(args);
|
|
233
252
|
// `registry.refresh`/`registry.show` each carry their own two-token
|
|
234
253
|
// cli.path (found before the ["registry"] catch-all). `hiddenFromHelp`
|
|
235
254
|
// keeps `cw help registry`'s rows coming from the single literal
|
|
@@ -241,8 +260,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
|
|
|
241
260
|
jsonMode: "flag",
|
|
242
261
|
hiddenFromHelp: true,
|
|
243
262
|
handler: (args) => {
|
|
244
|
-
const report = (
|
|
245
|
-
return (0,
|
|
263
|
+
const report = loadRegistryCli().registryRefreshCli(args.options);
|
|
264
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: report } : { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
|
|
246
265
|
},
|
|
247
266
|
});
|
|
248
267
|
(0, registry_core_1.attachCliBinding)("registry.show", {
|
|
@@ -250,8 +269,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
|
|
|
250
269
|
jsonMode: "flag",
|
|
251
270
|
hiddenFromHelp: true,
|
|
252
271
|
handler: (args) => {
|
|
253
|
-
const report = (
|
|
254
|
-
return (0,
|
|
272
|
+
const report = loadRegistryCli().registryShowCli(args.options);
|
|
273
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: report } : { json: report, text: loadRunRegistryIo().formatRegistryReport(report) };
|
|
255
274
|
},
|
|
256
275
|
});
|
|
257
276
|
// ---- queue (add|list|drain|show) ----------------------------------------
|
|
@@ -261,26 +280,27 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("registry.show").mcp.handler = (args)
|
|
|
261
280
|
hiddenFromHelp: true,
|
|
262
281
|
handler: (args) => {
|
|
263
282
|
const [subcommand, id] = args.positionals;
|
|
283
|
+
const registryCli = loadRegistryCli();
|
|
264
284
|
switch (subcommand) {
|
|
265
285
|
case "add":
|
|
266
|
-
return { json:
|
|
286
|
+
return { json: registryCli.queueAddCli(args.options) };
|
|
267
287
|
case "list": {
|
|
268
|
-
const result =
|
|
269
|
-
return (0,
|
|
288
|
+
const result = registryCli.queueListCli(args.options);
|
|
289
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadRunRegistryIo().formatQueueList(result) };
|
|
270
290
|
}
|
|
271
291
|
case "drain":
|
|
272
|
-
return { json:
|
|
292
|
+
return { json: registryCli.queueDrainCli(args.options) };
|
|
273
293
|
case "show":
|
|
274
|
-
return { json:
|
|
294
|
+
return { json: registryCli.queueShowCli((0, cli_args_1.required)(id, "queue id"), args.options) };
|
|
275
295
|
default:
|
|
276
|
-
throw new Error("Usage: cw
|
|
296
|
+
throw new Error("Usage: cw queue add|list|drain|show [queue-id] [--repo PATH] [--priority N]");
|
|
277
297
|
}
|
|
278
298
|
},
|
|
279
299
|
}, "cw queue is the durable run queue; SPEC/mcp.md declares its MCP peers (cw_queue_add|list|drain|show), each wired below.");
|
|
280
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.add").mcp.handler = (args) => (
|
|
281
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.list").mcp.handler = (args) => (
|
|
282
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.drain").mcp.handler = (args) => (
|
|
283
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) => (
|
|
300
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.add").mcp.handler = (args) => loadRegistryCli().queueAddCli(args);
|
|
301
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.list").mcp.handler = (args) => loadRegistryCli().queueListCli(args);
|
|
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, cli_args_1.required)((0, cli_args_1.optionalArg)(args.id), "queue id"), args);
|
|
284
304
|
// `queue add|list|drain|show` each carry their own two-token cli.path
|
|
285
305
|
// (found before the ["queue"] catch-all). `hiddenFromHelp` keeps `cw help
|
|
286
306
|
// queue`'s rows coming from the single literal COMMAND_HELP_ROWS.queue
|
|
@@ -290,58 +310,60 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("queue.show").mcp.handler = (args) =>
|
|
|
290
310
|
path: ["queue", "add"],
|
|
291
311
|
jsonMode: "default",
|
|
292
312
|
hiddenFromHelp: true,
|
|
293
|
-
handler: (args) => ({ json: (
|
|
313
|
+
handler: (args) => ({ json: loadRegistryCli().queueAddCli(args.options) }),
|
|
294
314
|
});
|
|
295
315
|
(0, registry_core_1.attachCliBinding)("queue.list", {
|
|
296
316
|
path: ["queue", "list"],
|
|
297
317
|
jsonMode: "flag",
|
|
298
318
|
hiddenFromHelp: true,
|
|
299
319
|
handler: (args) => {
|
|
300
|
-
const result = (
|
|
301
|
-
return (0,
|
|
320
|
+
const result = loadRegistryCli().queueListCli(args.options);
|
|
321
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadRunRegistryIo().formatQueueList(result) };
|
|
302
322
|
},
|
|
303
323
|
});
|
|
304
324
|
(0, registry_core_1.attachCliBinding)("queue.drain", {
|
|
305
325
|
path: ["queue", "drain"],
|
|
306
326
|
jsonMode: "default",
|
|
307
327
|
hiddenFromHelp: true,
|
|
308
|
-
handler: (args) => ({ json: (
|
|
328
|
+
handler: (args) => ({ json: loadRegistryCli().queueDrainCli(args.options) }),
|
|
309
329
|
});
|
|
310
330
|
(0, registry_core_1.attachCliBinding)("queue.show", {
|
|
311
331
|
path: ["queue", "show"],
|
|
312
332
|
jsonMode: "default",
|
|
313
333
|
hiddenFromHelp: true,
|
|
314
|
-
handler: (args) => ({ json: (
|
|
334
|
+
handler: (args) => ({ json: loadRegistryCli().queueShowCli((0, cli_args_1.required)(args.positionals[0], "queue id"), args.options) }),
|
|
315
335
|
});
|
|
316
336
|
// ---- gc (plan|run|verify) ------------------------------------------------
|
|
317
|
-
(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.", {
|
|
318
338
|
path: ["gc"],
|
|
319
339
|
jsonMode: "flag",
|
|
320
340
|
hiddenFromHelp: true,
|
|
321
341
|
handler: (args) => {
|
|
322
342
|
const [subcommand, id] = args.positionals;
|
|
343
|
+
const registryCli = loadRegistryCli();
|
|
344
|
+
const reclamationIo = loadReclamationIo();
|
|
323
345
|
switch (subcommand) {
|
|
324
346
|
case "plan": {
|
|
325
|
-
const result =
|
|
326
|
-
return (0,
|
|
347
|
+
const result = registryCli.gcPlanCli(id, args.options);
|
|
348
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatGcPlan(result) };
|
|
327
349
|
}
|
|
328
350
|
case "run": {
|
|
329
|
-
const result =
|
|
330
|
-
return (0,
|
|
351
|
+
const result = registryCli.gcRunCli(id, args.options);
|
|
352
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatGcRun(result) };
|
|
331
353
|
}
|
|
332
354
|
case "verify": {
|
|
333
|
-
const result =
|
|
334
|
-
const text =
|
|
355
|
+
const result = registryCli.gcVerifyCli((0, cli_args_1.required)(id, "run id"), args.options);
|
|
356
|
+
const text = reclamationIo.formatGcVerify(result);
|
|
335
357
|
return { json: result, text, exitCode: result.reclaimed && !result.verified ? 1 : undefined };
|
|
336
358
|
}
|
|
337
359
|
default:
|
|
338
|
-
throw new Error("Usage: cw
|
|
360
|
+
throw new Error("Usage: cw gc plan|run|verify [run-id] [--reclaimAfterArchiveDays N] [--keep-scratch] [--keep-snapshots] [--keep-commits] [--limit N] [--json]");
|
|
339
361
|
}
|
|
340
362
|
},
|
|
341
363
|
}, "cw gc is run retention & provable reclamation; SPEC/mcp.md declares its MCP peers (cw_gc_plan|run|verify), each wired below.");
|
|
342
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.plan").mcp.handler = (args) => (
|
|
343
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").mcp.handler = (args) => (
|
|
344
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.verify").mcp.handler = (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);
|
|
345
367
|
// PARITY: `gc.run` frees disk and appends a tombstone; both surfaces run
|
|
346
368
|
// the identical transaction but the payload reports now-derived
|
|
347
369
|
// bytesFreed/tombstone, so it is a documented opt-out, not drift.
|
|
@@ -359,20 +381,27 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
|
|
|
359
381
|
// capabilities for the payload-identity probe. `gc.run` stays reachable
|
|
360
382
|
// only via the ["gc"] catch-all (it is a documented payload-probe
|
|
361
383
|
// opt-out above, so it does not need its own dual-bound row).
|
|
384
|
+
// `hiddenFromHelp` keeps `cw help gc`'s rows coming from the single
|
|
385
|
+
// literal COMMAND_HELP_ROWS.gc entries, same as `gc.run` below — without
|
|
386
|
+
// it these rows double-print alongside those literal rows (a rebuild
|
|
387
|
+
// regression the old build's `docs/rebuild/SPEC/cli-help/gc.txt` ground
|
|
388
|
+
// truth does not show; fixed here to match `gc.run`'s existing pattern).
|
|
362
389
|
(0, registry_core_1.attachCliBinding)("gc.plan", {
|
|
363
390
|
path: ["gc", "plan"],
|
|
364
391
|
jsonMode: "flag",
|
|
392
|
+
hiddenFromHelp: true,
|
|
365
393
|
handler: (args) => {
|
|
366
|
-
const result = (
|
|
367
|
-
return (0,
|
|
394
|
+
const result = loadRegistryCli().gcPlanCli(args.positionals[0], args.options);
|
|
395
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatGcPlan(result) };
|
|
368
396
|
},
|
|
369
397
|
});
|
|
370
398
|
(0, registry_core_1.attachCliBinding)("gc.verify", {
|
|
371
399
|
path: ["gc", "verify"],
|
|
372
400
|
jsonMode: "flag",
|
|
401
|
+
hiddenFromHelp: true,
|
|
373
402
|
handler: (args) => {
|
|
374
|
-
const result = (
|
|
375
|
-
const text = (
|
|
403
|
+
const result = loadRegistryCli().gcVerifyCli((0, cli_args_1.required)(args.positionals[0], "run id"), args.options);
|
|
404
|
+
const text = loadReclamationIo().formatGcVerify(result);
|
|
376
405
|
return { json: result, text, exitCode: result.reclaimed && !result.verified ? 1 : undefined };
|
|
377
406
|
},
|
|
378
407
|
});
|
|
@@ -387,8 +416,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
|
|
|
387
416
|
jsonMode: "flag",
|
|
388
417
|
hiddenFromHelp: true,
|
|
389
418
|
handler: (args) => {
|
|
390
|
-
const result = (
|
|
391
|
-
return (0,
|
|
419
|
+
const result = loadRegistryCli().gcRunCli(args.positionals[0], args.options);
|
|
420
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatGcRun(result) };
|
|
392
421
|
},
|
|
393
422
|
});
|
|
394
423
|
// ---- orphans (list|gc) ---------------------------------------------------
|
|
@@ -398,22 +427,24 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("gc.run").reason =
|
|
|
398
427
|
hiddenFromHelp: true,
|
|
399
428
|
handler: (args) => {
|
|
400
429
|
const subcommand = firstPositionalArg(args);
|
|
430
|
+
const registryCli = loadRegistryCli();
|
|
431
|
+
const reclamationIo = loadReclamationIo();
|
|
401
432
|
switch (subcommand) {
|
|
402
433
|
case "list": {
|
|
403
|
-
const result =
|
|
404
|
-
return (0,
|
|
434
|
+
const result = registryCli.orphansListCli(args.options);
|
|
435
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatOrphanRunsList(result) };
|
|
405
436
|
}
|
|
406
437
|
case "gc": {
|
|
407
|
-
const result =
|
|
408
|
-
return (0,
|
|
438
|
+
const result = registryCli.orphansGcCli(args.options);
|
|
439
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatOrphanRunsGc(result) };
|
|
409
440
|
}
|
|
410
441
|
default:
|
|
411
|
-
throw new Error("Usage: cw
|
|
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)");
|
|
412
443
|
}
|
|
413
444
|
},
|
|
414
445
|
}, "cw orphans reclaims killed-process run dirs with no state.json; SPEC/mcp.md declares its MCP peers (cw_orphans_list|gc), each wired below.");
|
|
415
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.list").mcp.handler = (args) => (
|
|
416
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").mcp.handler = (args) => (
|
|
446
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.list").mcp.handler = (args) => loadRegistryCli().orphansListCli(args);
|
|
447
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").mcp.handler = (args) => loadRegistryCli().orphansGcCli(args);
|
|
417
448
|
// `orphans.list`/`orphans.gc` each carry their own two-token cli.path
|
|
418
449
|
// (found before the ["orphans"] catch-all per the reversed-candidate
|
|
419
450
|
// order), so both are real both-surface dual-bound rows. `hiddenFromHelp`
|
|
@@ -426,8 +457,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").mcp.handler = (args) =>
|
|
|
426
457
|
jsonMode: "flag",
|
|
427
458
|
hiddenFromHelp: true,
|
|
428
459
|
handler: (args) => {
|
|
429
|
-
const result = (
|
|
430
|
-
return (0,
|
|
460
|
+
const result = loadRegistryCli().orphansListCli(args.options);
|
|
461
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatOrphanRunsList(result) };
|
|
431
462
|
},
|
|
432
463
|
});
|
|
433
464
|
(0, registry_core_1.attachCliBinding)("orphans.gc", {
|
|
@@ -435,8 +466,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").mcp.handler = (args) =>
|
|
|
435
466
|
jsonMode: "flag",
|
|
436
467
|
hiddenFromHelp: true,
|
|
437
468
|
handler: (args) => {
|
|
438
|
-
const result = (
|
|
439
|
-
return (0,
|
|
469
|
+
const result = loadRegistryCli().orphansGcCli(args.options);
|
|
470
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatOrphanRunsGc(result) };
|
|
440
471
|
},
|
|
441
472
|
});
|
|
442
473
|
registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").payloadIdentical = false;
|
|
@@ -449,22 +480,24 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("orphans.gc").reason =
|
|
|
449
480
|
hiddenFromHelp: true,
|
|
450
481
|
handler: (args) => {
|
|
451
482
|
const subcommand = firstPositionalArg(args);
|
|
483
|
+
const registryCli = loadRegistryCli();
|
|
484
|
+
const reclamationIo = loadReclamationIo();
|
|
452
485
|
switch (subcommand) {
|
|
453
486
|
case "list": {
|
|
454
|
-
const result =
|
|
455
|
-
return (0,
|
|
487
|
+
const result = registryCli.clonesListCli();
|
|
488
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatClonesList(result) };
|
|
456
489
|
}
|
|
457
490
|
case "gc": {
|
|
458
|
-
const result =
|
|
459
|
-
return (0,
|
|
491
|
+
const result = registryCli.clonesGcCli(args.options);
|
|
492
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: reclamationIo.formatClonesGc(result) };
|
|
460
493
|
}
|
|
461
494
|
default:
|
|
462
|
-
throw new Error("Usage: cw
|
|
495
|
+
throw new Error("Usage: cw clones list [--json] | clones gc [--older-than-days N] [--all] [--json]");
|
|
463
496
|
}
|
|
464
497
|
},
|
|
465
498
|
}, "cw clones is the cached remote-source checkout cache; SPEC/mcp.md declares its MCP peers (cw_clones_list|gc), each wired below.");
|
|
466
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.list").mcp.handler = () => (
|
|
467
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").mcp.handler = (args) => (
|
|
499
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.list").mcp.handler = () => loadRegistryCli().clonesListCli();
|
|
500
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").mcp.handler = (args) => loadRegistryCli().clonesGcCli(args);
|
|
468
501
|
// `clones.list`/`clones.gc` each carry their own two-token cli.path (found
|
|
469
502
|
// before the ["clones"] catch-all). `hiddenFromHelp` keeps the byte-pinned
|
|
470
503
|
// `cw help clones` fixture's rows coming from the single literal
|
|
@@ -475,8 +508,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").mcp.handler = (args) =>
|
|
|
475
508
|
jsonMode: "flag",
|
|
476
509
|
hiddenFromHelp: true,
|
|
477
510
|
handler: (args) => {
|
|
478
|
-
const result = (
|
|
479
|
-
return (0,
|
|
511
|
+
const result = loadRegistryCli().clonesListCli();
|
|
512
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatClonesList(result) };
|
|
480
513
|
},
|
|
481
514
|
});
|
|
482
515
|
(0, registry_core_1.attachCliBinding)("clones.gc", {
|
|
@@ -484,8 +517,8 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").mcp.handler = (args) =>
|
|
|
484
517
|
jsonMode: "flag",
|
|
485
518
|
hiddenFromHelp: true,
|
|
486
519
|
handler: (args) => {
|
|
487
|
-
const result = (
|
|
488
|
-
return (0,
|
|
520
|
+
const result = loadRegistryCli().clonesGcCli(args.options);
|
|
521
|
+
return (0, cli_args_1.wantsJson)(args.options) ? { json: result } : { json: result, text: loadReclamationIo().formatClonesGc(result) };
|
|
489
522
|
},
|
|
490
523
|
});
|
|
491
524
|
registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").payloadIdentical = false;
|
|
@@ -499,60 +532,61 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("clones.gc").reason =
|
|
|
499
532
|
path: ["run", "search"],
|
|
500
533
|
jsonMode: "flag",
|
|
501
534
|
handler: (args) => {
|
|
502
|
-
const result = (
|
|
503
|
-
return { json: result, text: (
|
|
535
|
+
const result = loadRegistryCli().runSearchCli(args.options);
|
|
536
|
+
return { json: result, text: loadRunRegistryIo().formatRunSearch(result) };
|
|
504
537
|
},
|
|
505
538
|
});
|
|
506
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.search").mcp.handler = (args) => (
|
|
539
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.search").mcp.handler = (args) => loadRegistryCli().runSearchCli(args);
|
|
507
540
|
(0, registry_core_1.attachCliBinding)("run.list", {
|
|
508
541
|
path: ["run", "list"],
|
|
509
542
|
jsonMode: "flag",
|
|
510
543
|
handler: (args) => {
|
|
511
|
-
const result = (
|
|
512
|
-
return { json: result, text: (
|
|
544
|
+
const result = loadRegistryCli().runListCli(args.options);
|
|
545
|
+
return { json: result, text: loadRunRegistryIo().formatRunSearch(result) };
|
|
513
546
|
},
|
|
514
547
|
});
|
|
515
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.list").mcp.handler = (args) => (
|
|
548
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.list").mcp.handler = (args) => loadRegistryCli().runListCli(args);
|
|
516
549
|
(0, registry_core_1.attachCliBinding)("run.show", {
|
|
517
550
|
path: ["run", "show"],
|
|
518
551
|
jsonMode: "flag",
|
|
519
552
|
handler: (args) => {
|
|
520
|
-
const runId = (0,
|
|
521
|
-
const result = (
|
|
522
|
-
return { json: result, text: (
|
|
553
|
+
const runId = (0, cli_args_1.required)(args.positionals[0], "run id");
|
|
554
|
+
const result = loadRegistryCli().runShowCli(runId, args.options);
|
|
555
|
+
return { json: result, text: loadRunRegistryIo().formatRunShow(result) };
|
|
523
556
|
},
|
|
524
557
|
});
|
|
525
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.show").mcp.handler = (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);
|
|
526
559
|
(0, registry_core_1.attachCliBinding)("run.resume", {
|
|
527
560
|
path: ["run", "resume"],
|
|
528
561
|
jsonMode: "flag",
|
|
529
|
-
handler: (args) => {
|
|
530
|
-
const runId = (0,
|
|
531
|
-
const
|
|
532
|
-
|
|
562
|
+
handler: async (args) => {
|
|
563
|
+
const runId = (0, cli_args_1.required)(args.positionals[0], "run id");
|
|
564
|
+
const runRegistryIo = loadRunRegistryIo();
|
|
565
|
+
const result = await loadRegistryCli().runResumeCli(runId, args.options);
|
|
566
|
+
return { json: result, text: runRegistryIo.formatResume(result) };
|
|
533
567
|
},
|
|
534
568
|
});
|
|
535
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.resume").mcp.handler = (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);
|
|
536
570
|
(0, registry_core_1.attachCliBinding)("run.archive", {
|
|
537
571
|
path: ["run", "archive"],
|
|
538
572
|
jsonMode: "default",
|
|
539
|
-
handler: (args) => ({ json: (
|
|
573
|
+
handler: (args) => ({ json: loadRegistryCli().runArchiveCli((0, cli_args_1.optionalArg)(args.positionals[0]), args.options) }),
|
|
540
574
|
});
|
|
541
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.archive").mcp.handler = (args) => (
|
|
575
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.archive").mcp.handler = (args) => loadRegistryCli().runArchiveCli((0, cli_args_1.optionalArg)(args.runId), args);
|
|
542
576
|
(0, registry_core_1.attachCliBinding)("run.rerun", {
|
|
543
577
|
path: ["run", "rerun"],
|
|
544
578
|
jsonMode: "default",
|
|
545
|
-
handler: (args) => ({ json: (
|
|
579
|
+
handler: (args) => ({ json: loadRegistryCli().runRerunCli((0, cli_args_1.required)(args.positionals[0], "run id"), args.options) }),
|
|
546
580
|
});
|
|
547
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.rerun").mcp.handler = (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);
|
|
548
582
|
// ---- history ---------------------------------------------------------
|
|
549
583
|
(0, registry_core_1.attachCliBinding)("history", {
|
|
550
584
|
path: ["history"],
|
|
551
585
|
jsonMode: "flag",
|
|
552
586
|
handler: (args) => {
|
|
553
|
-
const result = (
|
|
554
|
-
return { json: result, text: (
|
|
587
|
+
const result = loadRegistryCli().historyCli(args.options);
|
|
588
|
+
return { json: result, text: loadRunRegistryIo().formatHistory(result) };
|
|
555
589
|
},
|
|
556
590
|
});
|
|
557
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("history").mcp.handler = (args) => (
|
|
591
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("history").mcp.handler = (args) => loadRegistryCli().historyCli(args);
|
|
558
592
|
// ---------------------------------------------------------------------
|