cool-workflow 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +11 -5
- package/dist/cli/entry.js +41 -1
- package/dist/cli/io.js +6 -2
- package/dist/cli/parseargv.js +1 -0
- package/dist/core/capability-data.js +1 -0
- package/dist/core/format/completion.js +68 -0
- package/dist/core/format/help.js +25 -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/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 +243 -49
- package/dist/shell/eval-text.js +2 -2
- package/dist/shell/evidence-reasoning.js +4 -4
- package/dist/shell/execution-backend/agent.js +20 -1
- package/dist/shell/execution-backend/container.js +4 -1
- package/dist/shell/execution-backend/local.js +4 -1
- 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 +87 -40
- package/dist/shell/reclamation-io.js +14 -4
- package/dist/shell/registry-cli.js +19 -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 +77 -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/wiring/capability-table/basics.js +33 -8
- package/dist/wiring/capability-table/exec-backend.js +20 -11
- package/dist/wiring/capability-table/multi-agent.js +172 -165
- package/dist/wiring/capability-table/parity.js +1 -0
- package/dist/wiring/capability-table/pipeline.js +54 -42
- package/dist/wiring/capability-table/registry-core.js +29 -10
- package/dist/wiring/capability-table/reporting.js +137 -96
- package/dist/wiring/capability-table/scheduling-registry.js +195 -161
- package/dist/wiring/capability-table/state.js +36 -28
- package/dist/wiring/capability-table/trust-ledger.js +46 -22
- package/dist/wiring/capability-table/workflow-apps.js +83 -68
- package/docs/agent-delegation-drive.7.md +2 -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 +8 -3
- package/docs/contract-migration-tooling.7.md +2 -0
- package/docs/control-plane-scheduling.7.md +2 -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 +2 -0
- package/docs/end-to-end-golden-path.7.md +14 -14
- package/docs/evidence-adoption-reasoning-chain.7.md +2 -0
- package/docs/execution-backends.7.md +2 -0
- package/docs/getting-started.md +37 -37
- package/docs/multi-agent-cli-mcp-surface.7.md +19 -17
- package/docs/multi-agent-eval-replay-harness.7.md +15 -13
- package/docs/multi-agent-operator-ux.7.md +21 -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 +2 -0
- package/docs/observability-cost-accounting.7.md +2 -0
- package/docs/operator-ux.7.md +34 -34
- package/docs/pipeline-runner.7.md +4 -4
- package/docs/project-index.md +27 -4
- package/docs/real-execution-backends.7.md +2 -0
- package/docs/release-and-migration.7.md +3 -1
- package/docs/release-tooling.7.md +2 -0
- package/docs/routines.md +4 -4
- package/docs/run-registry-control-plane.7.md +21 -19
- package/docs/run-retention-reclamation.7.md +2 -0
- package/docs/scheduled-tasks.md +14 -14
- package/docs/security-trust-hardening.7.md +15 -15
- package/docs/state-explosion-management.7.md +12 -10
- package/docs/team-collaboration.7.md +2 -0
- package/docs/trust-audit-anchor.7.md +2 -0
- package/docs/unix-principles.md +3 -1
- package/docs/verifier-gated-commit.7.md +1 -1
- package/docs/web-desktop-workbench.7.md +2 -0
- package/docs/workflow-app-framework.7.md +13 -13
- package/manifest/plugin.manifest.json +1 -1
- package/package.json +2 -2
- package/scripts/agents/claude-p-agent.js +2 -2
- package/scripts/block-unapproved-tag.sh +23 -2
- 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 +3 -0
- package/scripts/release-flow.js +57 -1
- package/scripts/verdict-keygen.js +83 -0
- package/scripts/verify-bump-reproduction.sh +148 -0
- package/scripts/verify-verdict-signature.js +61 -0
- 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
|
@@ -15,8 +15,15 @@ const io_2 = require("../../cli/io");
|
|
|
15
15
|
// wires argv shape -> handler call, per cli/dispatch.ts's generic
|
|
16
16
|
// executor contract.
|
|
17
17
|
// ---------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// This file is required unconditionally at startup for every command, so
|
|
19
|
+
// a top-level import of pipeline-cli/commit-summary would cost every
|
|
20
|
+
// invocation, not just plan/run/dispatch/result/commit/commit.summary ones.
|
|
21
|
+
function loadPipelineCli() {
|
|
22
|
+
return require("../../shell/pipeline-cli");
|
|
23
|
+
}
|
|
24
|
+
function loadCommitSummary() {
|
|
25
|
+
return require("../../shell/commit-summary");
|
|
26
|
+
}
|
|
20
27
|
(0, registry_core_1.attachCliBinding)("plan", {
|
|
21
28
|
path: ["plan"],
|
|
22
29
|
jsonMode: "default",
|
|
@@ -25,7 +32,7 @@ const commit_summary_1 = require("../../shell/commit-summary");
|
|
|
25
32
|
if (!workflowId) {
|
|
26
33
|
throw new Error('Missing workflow id.\n Tip: plan an architecture review with "cw plan architecture-review"');
|
|
27
34
|
}
|
|
28
|
-
return { json: (
|
|
35
|
+
return { json: loadPipelineCli().planRun({ ...args.options, workflowId }) };
|
|
29
36
|
},
|
|
30
37
|
});
|
|
31
38
|
// `cw run <app> --drive [--once]` and `cw run drive <run-id> [--step]`
|
|
@@ -40,19 +47,19 @@ const commit_summary_1 = require("../../shell/commit-summary");
|
|
|
40
47
|
path: ["run"],
|
|
41
48
|
helpPath: ["run", "drive"],
|
|
42
49
|
jsonMode: "default",
|
|
43
|
-
handler: (args) => {
|
|
50
|
+
handler: async (args) => {
|
|
44
51
|
const registrySubcommands = new Set(["drive", "search", "list", "show", "resume", "archive", "rerun", "export", "import", "verify-import", "inspect-archive", "restore"]);
|
|
45
52
|
const target = args.positionals[0];
|
|
46
53
|
if (args.options.drive && !registrySubcommands.has(String(target || ""))) {
|
|
47
54
|
const runId = (0, io_2.optionalArg)(args.options.run) || (0, io_2.optionalArg)(args.options.runId);
|
|
48
55
|
if (args.options.preview)
|
|
49
|
-
return { json: (
|
|
56
|
+
return { json: loadPipelineCli().runDrivePreview({ ...args.options, runId: runId || target }) };
|
|
50
57
|
const driveArgs = { ...args.options };
|
|
51
58
|
if (runId)
|
|
52
59
|
driveArgs.runId = runId;
|
|
53
60
|
else
|
|
54
61
|
driveArgs.appId = target;
|
|
55
|
-
return { json: (
|
|
62
|
+
return { json: await loadPipelineCli().runDriveStep(driveArgs) };
|
|
56
63
|
}
|
|
57
64
|
const [subcommand, id] = args.positionals;
|
|
58
65
|
if (subcommand === "drive") {
|
|
@@ -60,34 +67,34 @@ const commit_summary_1 = require("../../shell/commit-summary");
|
|
|
60
67
|
const driveArgs = { ...args.options };
|
|
61
68
|
if (id)
|
|
62
69
|
driveArgs.runId = id;
|
|
63
|
-
return { json: (
|
|
70
|
+
return { json: await loadPipelineCli().runDriveStep(driveArgs) };
|
|
64
71
|
}
|
|
65
|
-
return { json: (
|
|
72
|
+
return { json: loadPipelineCli().runDrivePreview({ ...args.options, runId: (0, io_1.required)(id, "run id") }) };
|
|
66
73
|
}
|
|
67
74
|
// MILESTONE 11 (reporting/run-export) — the archive family. Handler
|
|
68
75
|
// bodies live in shell/run-export-cli.ts; this arm only wires argv
|
|
69
76
|
// shape -> handler call.
|
|
70
77
|
if (subcommand === "export") {
|
|
71
|
-
const result = (
|
|
78
|
+
const result = loadRunExportCli().runExportCli((0, io_1.required)(id, "run id"), args.options);
|
|
72
79
|
return { json: result };
|
|
73
80
|
}
|
|
74
81
|
if (subcommand === "import") {
|
|
75
|
-
const result = (
|
|
82
|
+
const result = loadRunExportCli().runImportCli((0, io_1.required)(id, "archive path"), args.options);
|
|
76
83
|
return { json: result };
|
|
77
84
|
}
|
|
78
85
|
if (subcommand === "verify-import") {
|
|
79
|
-
const result = (
|
|
86
|
+
const result = loadRunExportCli().runVerifyImportCli((0, io_1.required)(id, "run id"), args.options);
|
|
80
87
|
return { json: result, exitCode: args.options.strict && !result.ok ? 1 : undefined };
|
|
81
88
|
}
|
|
82
89
|
if (subcommand === "inspect-archive") {
|
|
83
|
-
const result = (
|
|
90
|
+
const result = loadRunExportCli().runInspectArchiveCli((0, io_1.required)(id, "archive path"), args.options);
|
|
84
91
|
return { json: result, exitCode: result.ok ? undefined : 1 };
|
|
85
92
|
}
|
|
86
93
|
if (subcommand === "restore") {
|
|
87
|
-
const result = (
|
|
94
|
+
const result = loadRunExportCli().runRestoreCli((0, io_1.required)(id, "archive path"), args.options);
|
|
88
95
|
return { json: result, exitCode: result.ok ? undefined : 1 };
|
|
89
96
|
}
|
|
90
|
-
throw new Error("Usage: cw
|
|
97
|
+
throw new Error("Usage: cw run search|list|show|resume|archive|rerun|drive|export|import|verify-import|inspect-archive|restore [run-id|archive] [--scope repo|home] [--json] | cw run <app> --drive [--once] [--incremental] [--repo R --question Q]");
|
|
91
98
|
},
|
|
92
99
|
});
|
|
93
100
|
// PARITY: `run.drive` (the read-only MCP preview tool) now ALSO carries
|
|
@@ -104,19 +111,19 @@ const commit_summary_1 = require("../../shell/commit-summary");
|
|
|
104
111
|
(0, registry_core_1.attachCliBinding)("run.drive", {
|
|
105
112
|
path: ["run", "drive"],
|
|
106
113
|
jsonMode: "default",
|
|
107
|
-
handler: (args) => {
|
|
114
|
+
handler: async (args) => {
|
|
108
115
|
const id = args.positionals[0];
|
|
109
116
|
if (args.options.step) {
|
|
110
117
|
const driveArgs = { ...args.options };
|
|
111
118
|
if (id)
|
|
112
119
|
driveArgs.runId = id;
|
|
113
|
-
return { json: (
|
|
120
|
+
return { json: await loadPipelineCli().runDriveStep(driveArgs) };
|
|
114
121
|
}
|
|
115
|
-
return { json: (
|
|
122
|
+
return { json: loadPipelineCli().runDrivePreview({ ...args.options, runId: (0, io_1.required)(id, "run id") }) };
|
|
116
123
|
},
|
|
117
124
|
});
|
|
118
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive").mcp.handler = (args) => (
|
|
119
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive.step").mcp.handler = (args) => (
|
|
125
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive").mcp.handler = (args) => loadPipelineCli().runDrivePreview(args);
|
|
126
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive.step").mcp.handler = (args) => loadPipelineCli().runDriveStep(args);
|
|
120
127
|
// PARITY: `run.drive.step` advances the run by spawning the external
|
|
121
128
|
// agent per worker and recording attested output — not a read probe.
|
|
122
129
|
// CLI (--drive/--step) and MCP route through the same drive() core; the
|
|
@@ -124,20 +131,20 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive.step").mcp.handler = (args
|
|
|
124
131
|
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive.step").payloadIdentical = false;
|
|
125
132
|
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.drive.step").reason =
|
|
126
133
|
"Mutating: advances the run by spawning the external agent per worker and recording attested output — not a read probe. CLI (--drive/--step) and MCP route through the same drive() core.";
|
|
127
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("plan").mcp.handler = (args) => (
|
|
134
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("plan").mcp.handler = (args) => loadPipelineCli().planRun(args);
|
|
128
135
|
// GAP #24: dispatchRun reads the sandbox profile from `args.sandbox` only
|
|
129
136
|
// (the CLI's --sandbox flag). The cw_dispatch MCP tool also accepts the
|
|
130
137
|
// `sandboxProfile`/`sandboxProfileId` aliases (its declared properties), so
|
|
131
138
|
// normalize them onto `sandbox` here — mirrors the old build's
|
|
132
139
|
// sandboxProfileIdFrom() alias set — before handing off.
|
|
133
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("dispatch").mcp.handler = (args) => (
|
|
134
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("result").mcp.handler = (args) => (
|
|
140
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("dispatch").mcp.handler = (args) => loadPipelineCli().dispatchRun({ ...args, sandbox: args.sandbox ?? args.sandboxProfile ?? args.sandboxProfileId });
|
|
141
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("result").mcp.handler = (args) => loadPipelineCli().recordResultRun(args);
|
|
135
142
|
// `cw_commit` returns the FLAT commit envelope (verifierGated/checkpoint/
|
|
136
143
|
// selectionId/… at the top level, plus a nested `commit`), matching the old
|
|
137
144
|
// build's commitEnvelope. `commitRun` (CLI shape) returns `{ runId, commit }`;
|
|
138
145
|
// lift the commit's key fields to the top for the MCP surface.
|
|
139
146
|
registry_core_1.REGISTRY_BY_CAPABILITY.get("commit").mcp.handler = (args) => {
|
|
140
|
-
const result = (
|
|
147
|
+
const result = loadPipelineCli().commitRun(args);
|
|
141
148
|
const commit = result.commit || {};
|
|
142
149
|
return {
|
|
143
150
|
runId: result.runId,
|
|
@@ -168,12 +175,16 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("commit").reason =
|
|
|
168
175
|
// handler above; these tools are called directly by name over MCP, so
|
|
169
176
|
// each needs its own mcp.handler per byte-compat item 5's two-field
|
|
170
177
|
// row shape).
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.
|
|
178
|
+
// Same lazy-load reasoning as loadPipelineCli/loadCommitSummary above, for
|
|
179
|
+
// the run.export/import/verify-import/inspect-archive/restore family.
|
|
180
|
+
function loadRunExportCli() {
|
|
181
|
+
return require("../../shell/run-export-cli");
|
|
182
|
+
}
|
|
183
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.export").mcp.handler = (args) => loadRunExportCli().runExportCli((0, io_1.required)((0, io_2.optionalArg)(args.runId), "run id"), args);
|
|
184
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.import").mcp.handler = (args) => loadRunExportCli().runImportCli((0, io_1.required)((0, io_2.optionalArg)(args.archive || args.path || args.file), "archive path"), args);
|
|
185
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.verify-import").mcp.handler = (args) => loadRunExportCli().runVerifyImportCli((0, io_1.required)((0, io_2.optionalArg)(args.runId), "run id"), args);
|
|
186
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.inspect-archive").mcp.handler = (args) => loadRunExportCli().runInspectArchiveCli((0, io_1.required)((0, io_2.optionalArg)(args.archive || args.path || args.file), "archive path"), args);
|
|
187
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) => loadRunExportCli().runRestoreCli((0, io_1.required)((0, io_2.optionalArg)(args.archive || args.path || args.file), "archive path"), args);
|
|
177
188
|
// `run export|import|verify-import|inspect-archive|restore` each carry their
|
|
178
189
|
// own two-token cli.path (found before the ["run"] run.drive.step catch-all
|
|
179
190
|
// per the reversed candidate order), calling the same shell fns with the
|
|
@@ -184,20 +195,20 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
184
195
|
path: ["run", "export"],
|
|
185
196
|
jsonMode: "default",
|
|
186
197
|
hiddenFromHelp: true,
|
|
187
|
-
handler: (args) => ({ json: (
|
|
198
|
+
handler: (args) => ({ json: loadRunExportCli().runExportCli((0, io_1.required)(args.positionals[0], "run id"), args.options) }),
|
|
188
199
|
});
|
|
189
200
|
(0, registry_core_1.attachCliBinding)("run.import", {
|
|
190
201
|
path: ["run", "import"],
|
|
191
202
|
jsonMode: "default",
|
|
192
203
|
hiddenFromHelp: true,
|
|
193
|
-
handler: (args) => ({ json: (
|
|
204
|
+
handler: (args) => ({ json: loadRunExportCli().runImportCli((0, io_1.required)(args.positionals[0], "archive path"), args.options) }),
|
|
194
205
|
});
|
|
195
206
|
(0, registry_core_1.attachCliBinding)("run.verify-import", {
|
|
196
207
|
path: ["run", "verify-import"],
|
|
197
208
|
jsonMode: "default",
|
|
198
209
|
hiddenFromHelp: true,
|
|
199
210
|
handler: (args) => {
|
|
200
|
-
const result = (
|
|
211
|
+
const result = loadRunExportCli().runVerifyImportCli((0, io_1.required)(args.positionals[0], "run id"), args.options);
|
|
201
212
|
return { json: result, exitCode: args.options.strict && !result.ok ? 1 : undefined };
|
|
202
213
|
},
|
|
203
214
|
});
|
|
@@ -206,7 +217,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
206
217
|
jsonMode: "default",
|
|
207
218
|
hiddenFromHelp: true,
|
|
208
219
|
handler: (args) => {
|
|
209
|
-
const result = (
|
|
220
|
+
const result = loadRunExportCli().runInspectArchiveCli((0, io_1.required)(args.positionals[0], "archive path"), args.options);
|
|
210
221
|
return { json: result, exitCode: result.ok ? undefined : 1 };
|
|
211
222
|
},
|
|
212
223
|
});
|
|
@@ -215,7 +226,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
215
226
|
jsonMode: "default",
|
|
216
227
|
hiddenFromHelp: true,
|
|
217
228
|
handler: (args) => {
|
|
218
|
-
const result = (
|
|
229
|
+
const result = loadRunExportCli().runRestoreCli((0, io_1.required)(args.positionals[0], "archive path"), args.options);
|
|
219
230
|
return { json: result, exitCode: result.ok ? undefined : 1 };
|
|
220
231
|
},
|
|
221
232
|
});
|
|
@@ -225,9 +236,9 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
225
236
|
// wrapper (byte-behavior port of the old build's caseTokens).
|
|
226
237
|
caseTokens: ["quickstart", "audit-run"],
|
|
227
238
|
jsonMode: "default",
|
|
228
|
-
handler: (args) => {
|
|
239
|
+
handler: async (args) => {
|
|
229
240
|
const appId = (0, io_2.optionalArg)(args.positionals[0]);
|
|
230
|
-
const result = (
|
|
241
|
+
const result = (await loadPipelineCli().quickstartRun({ ...args.options, appId }));
|
|
231
242
|
// Fail closed on both known bad outcomes: a --check preflight that
|
|
232
243
|
// found a blocking gap, OR a --bundle that did not self-verify.
|
|
233
244
|
const bundle = result.bundle;
|
|
@@ -241,7 +252,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
241
252
|
jsonMode: "default",
|
|
242
253
|
handler: (args) => {
|
|
243
254
|
const runId = (0, io_1.required)((0, io_2.optionalArg)(args.positionals[0]), "run id");
|
|
244
|
-
return { json: (
|
|
255
|
+
return { json: loadPipelineCli().dispatchRun({ ...args.options, runId }) };
|
|
245
256
|
},
|
|
246
257
|
});
|
|
247
258
|
(0, registry_core_1.attachCliBinding)("result", {
|
|
@@ -251,7 +262,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
251
262
|
const runId = (0, io_1.required)((0, io_2.optionalArg)(args.positionals[0]), "run id");
|
|
252
263
|
const taskId = (0, io_1.required)((0, io_2.optionalArg)(args.positionals[1]), "task id");
|
|
253
264
|
const resultPath = (0, io_1.required)((0, io_2.optionalArg)(args.positionals[2]), "result file path");
|
|
254
|
-
return { json: (
|
|
265
|
+
return { json: loadPipelineCli().recordResultRun({ ...args.options, runId, taskId, resultPath }) };
|
|
255
266
|
},
|
|
256
267
|
});
|
|
257
268
|
(0, registry_core_1.attachCliBinding)("commit", {
|
|
@@ -259,7 +270,7 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
259
270
|
jsonMode: "default",
|
|
260
271
|
handler: (args) => {
|
|
261
272
|
const runId = (0, io_1.required)((0, io_2.optionalArg)(args.positionals[0]), "run id");
|
|
262
|
-
return { json: (
|
|
273
|
+
return { json: loadPipelineCli().commitRun({ ...args.options, runId }) };
|
|
263
274
|
},
|
|
264
275
|
});
|
|
265
276
|
// GAP #26: restore `cw commit summary <run-id>` (CLI + help row). The old
|
|
@@ -272,9 +283,10 @@ registry_core_1.REGISTRY_BY_CAPABILITY.get("run.restore").mcp.handler = (args) =
|
|
|
272
283
|
path: ["commit", "summary"],
|
|
273
284
|
jsonMode: "flag",
|
|
274
285
|
handler: (args) => {
|
|
275
|
-
const
|
|
276
|
-
|
|
286
|
+
const commitSummary = loadCommitSummary();
|
|
287
|
+
const summary = commitSummary.commitSummaryCli({ ...args.options, runId: (0, io_1.required)(args.positionals[0], "run id") });
|
|
288
|
+
return { json: summary, text: `${commitSummary.formatCommitSummaryText(summary)}\n` };
|
|
277
289
|
},
|
|
278
290
|
});
|
|
279
|
-
registry_core_1.REGISTRY_BY_CAPABILITY.get("commit.summary").mcp.handler = (args) => (
|
|
291
|
+
registry_core_1.REGISTRY_BY_CAPABILITY.get("commit.summary").mcp.handler = (args) => loadCommitSummary().commitSummaryCli(args);
|
|
280
292
|
// ---------------------------------------------------------------------
|
|
@@ -33,10 +33,28 @@ exports.declaredMcpTools = declaredMcpTools;
|
|
|
33
33
|
exports.findCapabilityByMcpTool = findCapabilityByMcpTool;
|
|
34
34
|
const capability_data_1 = require("../../core/capability-data");
|
|
35
35
|
const io_1 = require("../../cli/io");
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
// Every capability-table module (this file plus each domain slice) is
|
|
37
|
+
// required unconditionally at CLI/MCP startup, for every single command
|
|
38
|
+
// (index.ts's whole point is to populate REGISTRY before dispatch can
|
|
39
|
+
// look anything up) — so a top-level `import` of a shell module here
|
|
40
|
+
// means EVERY invocation pays that module's full load cost, even the
|
|
41
|
+
// 99% of commands that never touch `status`/`summary.refresh`/`list`.
|
|
42
|
+
// Requiring these 4 lazily (inside the handler that actually uses them)
|
|
43
|
+
// measured live: this file alone was ~30-45ms of a ~75-100ms `cw --version`
|
|
44
|
+
// require chain, the single largest slice. The 8 domain slices have the
|
|
45
|
+
// same shape and are a natural follow-up, not attempted here.
|
|
46
|
+
function loadRunStore() {
|
|
47
|
+
return require("../../shell/run-store");
|
|
48
|
+
}
|
|
49
|
+
function loadOperatorUx() {
|
|
50
|
+
return require("../../shell/operator-ux");
|
|
51
|
+
}
|
|
52
|
+
function loadWorkflowAppLoader() {
|
|
53
|
+
return require("../../shell/workflow-app-loader");
|
|
54
|
+
}
|
|
55
|
+
function loadStateExplosionCli() {
|
|
56
|
+
return require("../../shell/state-explosion-cli");
|
|
57
|
+
}
|
|
40
58
|
/** Real handlers implemented at THIS milestone, keyed by capability id.
|
|
41
59
|
* Every tool row not listed here gets `notYetImplemented`. Kept as a
|
|
42
60
|
* small side table (rather than inlined into MCP_TOOL_DATA above) so the
|
|
@@ -47,8 +65,8 @@ const MCP_REAL_HANDLERS = {
|
|
|
47
65
|
list: () => listBundledWorkflows(),
|
|
48
66
|
"sandbox.list": () => listBundledSandboxProfiles(),
|
|
49
67
|
status: (args) => statusPayload(optionalString(args.runId)),
|
|
50
|
-
"summary.refresh": (args) => (
|
|
51
|
-
"summary.show": (args) => (
|
|
68
|
+
"summary.refresh": (args) => loadStateExplosionCli().summaryRefreshCli((0, io_1.required)(optionalString(args.runId), "run id"), args),
|
|
69
|
+
"summary.show": (args) => loadStateExplosionCli().summaryShowCli((0, io_1.required)(optionalString(args.runId), "run id"), args),
|
|
52
70
|
};
|
|
53
71
|
function optionalString(value) {
|
|
54
72
|
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -57,7 +75,7 @@ function optionalString(value) {
|
|
|
57
75
|
* `apps/*\/app.json` + legacy `workflows/*.workflow.js` on disk, per
|
|
58
76
|
* `listWorkflowsShallow` (shell/workflow-app-loader.ts). */
|
|
59
77
|
function listBundledWorkflows() {
|
|
60
|
-
return (
|
|
78
|
+
return loadWorkflowAppLoader().listWorkflowsShallow();
|
|
61
79
|
}
|
|
62
80
|
/** PLACEHOLDER (milestone 5, execution-backend/sandbox) — the real
|
|
63
81
|
* `sandbox.list` resolves and stamps each of the 4 bundled profiles
|
|
@@ -77,11 +95,12 @@ function listBundledSandboxProfiles() {
|
|
|
77
95
|
* shape exactly (`{runId:null, nextActions}`); a real run id resolves to
|
|
78
96
|
* `summarizeRun`'s payload (MILESTONE 11, reporting/observability). */
|
|
79
97
|
function statusPayload(runId, cwd) {
|
|
98
|
+
const operatorUx = loadOperatorUx();
|
|
80
99
|
if (!runId) {
|
|
81
|
-
return { runId: null, nextActions:
|
|
100
|
+
return { runId: null, nextActions: operatorUx.adviseNoRun() };
|
|
82
101
|
}
|
|
83
|
-
const run = (
|
|
84
|
-
return
|
|
102
|
+
const run = loadRunStore().loadRunFromCwd(runId, cwd || process.cwd());
|
|
103
|
+
return operatorUx.summarizeRun(run);
|
|
85
104
|
}
|
|
86
105
|
// ---------------------------------------------------------------------
|
|
87
106
|
// Public table-derived API
|