@rsaglobaltech/specgate 0.12.0 → 0.13.0
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/CHANGELOG.md +126 -0
- package/README.md +66 -58
- package/bin/specgate.ts +35 -0
- package/dist/bin/specgate.js +31 -0
- package/dist/bin/specgate.js.map +1 -1
- package/dist/packages/core/src/application/ArchiveChangeUseCase.js +22 -0
- package/dist/packages/core/src/application/ArchiveChangeUseCase.js.map +1 -1
- package/dist/packages/core/src/domain/DeltaFeature.js +39 -0
- package/dist/packages/core/src/domain/DeltaFeature.js.map +1 -0
- package/dist/packages/core/src/domain/DerivedMatrix.js +25 -19
- package/dist/packages/core/src/domain/DerivedMatrix.js.map +1 -1
- package/dist/packages/core/test/unit/delta-feature.test.js +74 -0
- package/dist/packages/core/test/unit/delta-feature.test.js.map +1 -0
- package/dist/packages/mcp-spec-driven/src/native-tools.js +256 -0
- package/dist/packages/mcp-spec-driven/src/native-tools.js.map +1 -0
- package/dist/packages/mcp-spec-driven/src/server.js +276 -0
- package/dist/packages/mcp-spec-driven/src/server.js.map +1 -0
- package/dist/packages/mcp-spec-driven/src/tools.js +667 -0
- package/dist/packages/mcp-spec-driven/src/tools.js.map +1 -0
- package/dist/scripts/agents/init.js +1 -1
- package/dist/scripts/agents/init.js.map +1 -1
- package/dist/scripts/alm/cli.js +4 -0
- package/dist/scripts/alm/cli.js.map +1 -1
- package/dist/scripts/change/instructions.js +5 -4
- package/dist/scripts/change/instructions.js.map +1 -1
- package/dist/scripts/cli/commands/config/CiInitCommand.js +47 -3
- package/dist/scripts/cli/commands/config/CiInitCommand.js.map +1 -1
- package/dist/scripts/cli/commands/harness/RunCommand.js +3 -2
- package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -1
- package/dist/scripts/cli/commands/mcp/McpInstallCommand.js +7 -1
- package/dist/scripts/cli/commands/mcp/McpInstallCommand.js.map +1 -1
- package/dist/scripts/cli/commands/mcp/index.js +52 -0
- package/dist/scripts/cli/commands/mcp/index.js.map +1 -1
- package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js +38 -0
- package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js.map +1 -1
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js +11 -3
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/DoneCommand.js +20 -6
- package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -1
- package/dist/scripts/docs/nav.js +5 -0
- package/dist/scripts/docs/nav.js.map +1 -1
- package/dist/scripts/gen_mcp_tools.js +22 -9
- package/dist/scripts/gen_mcp_tools.js.map +1 -1
- package/dist/scripts/lib/derived-writes.js +21 -6
- package/dist/scripts/lib/derived-writes.js.map +1 -1
- package/dist/scripts/lib/surface.js +12 -9
- package/dist/scripts/lib/surface.js.map +1 -1
- package/package.json +12 -3
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// GENERATED FILE - DO NOT EDIT BY HAND
|
|
3
|
+
// Derived from scripts/lib/surface.ts
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.markRequirementDone = exports.plan = exports.validateProject = exports.lintPack = exports.updateTraceability = exports.listRequirements = exports.readSpec = exports.TOOLS = exports.GenericCliTool = void 0;
|
|
39
|
+
const fs = __importStar(require("node:fs"));
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const node_child_process_1 = require("node:child_process");
|
|
42
|
+
const native_tools_1 = require("./native-tools");
|
|
43
|
+
class ProjectHelper {
|
|
44
|
+
/**
|
|
45
|
+
* A tool that is handed a directory which is not a spec-driven project has to
|
|
46
|
+
* say so. #138 reduced this to a type check, so every such call went on to
|
|
47
|
+
* shell out and came back `{ exitCode: 1, raw: "" }` — a failure with no
|
|
48
|
+
* reason in it, which is exactly the shape ADR-0017 exists to prevent.
|
|
49
|
+
*/
|
|
50
|
+
static ensureProjectDir(projectDir) {
|
|
51
|
+
if (!projectDir || typeof projectDir !== "string") {
|
|
52
|
+
throw new Error("projectDir is required (absolute path to a spec-driven project)");
|
|
53
|
+
}
|
|
54
|
+
if (!fs.existsSync(projectDir)) {
|
|
55
|
+
throw new Error(`projectDir does not exist: ${projectDir}`);
|
|
56
|
+
}
|
|
57
|
+
if (!fs.existsSync(path.join(projectDir, "spec.md"))) {
|
|
58
|
+
throw new Error(`Not a spec-driven project (no spec.md): ${projectDir}`);
|
|
59
|
+
}
|
|
60
|
+
return projectDir;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class CliInvoker {
|
|
64
|
+
/**
|
|
65
|
+
* Split a command line, honouring quotes.
|
|
66
|
+
*
|
|
67
|
+
* `bin.split(" ")` was the whole parser after #138, so any interpreter path
|
|
68
|
+
* with a space in it — `"/Users/me/My Tools/node" "…/cli.js"` — was torn into
|
|
69
|
+
* fragments and the spawn failed with no output.
|
|
70
|
+
*/
|
|
71
|
+
static parseCliCommand(cliPath) {
|
|
72
|
+
const raw = (cliPath || process.env.SPECGATE_CLI || "npx @rsaglobaltech/specgate").trim();
|
|
73
|
+
const tokens = [];
|
|
74
|
+
const re = /"([^"]*)"|'([^']*)'|(\S+)/g;
|
|
75
|
+
let m;
|
|
76
|
+
while ((m = re.exec(raw)) !== null) {
|
|
77
|
+
tokens.push(m[1] !== undefined ? m[1] : m[2] !== undefined ? m[2] : m[3]);
|
|
78
|
+
}
|
|
79
|
+
return tokens;
|
|
80
|
+
}
|
|
81
|
+
static spawnCli(cliPath, args) {
|
|
82
|
+
const cmd = CliInvoker.parseCliCommand(cliPath);
|
|
83
|
+
const useShell = process.platform === "win32";
|
|
84
|
+
const quote = (v) => (useShell && /\s/.test(v) ? `"${v}"` : v);
|
|
85
|
+
return (0, node_child_process_1.spawnSync)(quote(cmd[0]), [...cmd.slice(1), ...args].map(quote), {
|
|
86
|
+
encoding: "utf8",
|
|
87
|
+
shell: useShell,
|
|
88
|
+
timeout: 60000,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class GenericCliTool {
|
|
93
|
+
name;
|
|
94
|
+
description;
|
|
95
|
+
csda;
|
|
96
|
+
inputSchema;
|
|
97
|
+
dirStyle;
|
|
98
|
+
editsContract;
|
|
99
|
+
constructor(name, description, csda, inputSchema,
|
|
100
|
+
/**
|
|
101
|
+
* How this command takes the project directory. `validate` takes it as a
|
|
102
|
+
* positional `<dir>` and rejects `--project-dir` outright, so the flag form
|
|
103
|
+
* made `validate_project` — the most used tool of the seven — fail with
|
|
104
|
+
* "Unknown flag(s)" and an empty payload over MCP. The surface already
|
|
105
|
+
* records which is which in `json.args`; this reads it instead of assuming.
|
|
106
|
+
*/
|
|
107
|
+
dirStyle = "flag",
|
|
108
|
+
/**
|
|
109
|
+
* True when this command may write a path the write-scope rules protect.
|
|
110
|
+
* Computed at generation time from scripts/lib/surface.ts and
|
|
111
|
+
* WriteScope.DEFAULT_PROTECTED_PATHS, so the rule has one definition.
|
|
112
|
+
*/
|
|
113
|
+
editsContract = false) {
|
|
114
|
+
this.name = name;
|
|
115
|
+
this.description = description;
|
|
116
|
+
this.csda = csda;
|
|
117
|
+
this.inputSchema = inputSchema;
|
|
118
|
+
this.dirStyle = dirStyle;
|
|
119
|
+
this.editsContract = editsContract;
|
|
120
|
+
}
|
|
121
|
+
handler(args) {
|
|
122
|
+
const dir = ProjectHelper.ensureProjectDir(args.projectDir);
|
|
123
|
+
// C10-04. The prompt has always told the agent not to rewrite the
|
|
124
|
+
// specification it is being measured against; nothing enforced it over MCP.
|
|
125
|
+
// An agent that cannot make a scenario pass can otherwise relax the
|
|
126
|
+
// scenario, and the gate approves — the exact failure this product exists
|
|
127
|
+
// to prevent. The change cycle is the way to edit a spec on purpose, and it
|
|
128
|
+
// leaves a reviewable trail.
|
|
129
|
+
if (this.editsContract)
|
|
130
|
+
(0, native_tools_1.assertContractEditable)(this.name, dir);
|
|
131
|
+
const argv = this.csda.split(" ");
|
|
132
|
+
if (this.dirStyle === "positional")
|
|
133
|
+
argv.push(dir);
|
|
134
|
+
else
|
|
135
|
+
argv.push("--project-dir", dir);
|
|
136
|
+
// Pass args safely
|
|
137
|
+
for (const [k, v] of Object.entries(args)) {
|
|
138
|
+
if (k === "projectDir" || k === "cliPath")
|
|
139
|
+
continue;
|
|
140
|
+
if (typeof v === "string") {
|
|
141
|
+
argv.push(v); // Quick hack, we need proper arg mapping
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (!argv.includes("--json")) {
|
|
145
|
+
argv.push("--json");
|
|
146
|
+
}
|
|
147
|
+
const result = CliInvoker.spawnCli(args.cliPath, argv);
|
|
148
|
+
const combined = (result.stdout || "") + "\n" + (result.stderr || "");
|
|
149
|
+
try {
|
|
150
|
+
if (result.stdout && result.stdout.trim().startsWith("{")) {
|
|
151
|
+
return JSON.parse(result.stdout.trim());
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// Not JSON: fall through to the raw envelope below.
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
exitCode: typeof result.status === "number" ? result.status : 1,
|
|
159
|
+
raw: combined.trim(),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.GenericCliTool = GenericCliTool;
|
|
164
|
+
exports.TOOLS = {};
|
|
165
|
+
exports.TOOLS["specgate_init"] = new GenericCliTool("specgate_init", "Adopt this repo if it has code, else scaffold one; --new forces a scaffold.", "init", {
|
|
166
|
+
type: "object",
|
|
167
|
+
properties: {
|
|
168
|
+
projectDir: { type: "string" },
|
|
169
|
+
cliPath: { type: "string" },
|
|
170
|
+
},
|
|
171
|
+
required: ["projectDir"],
|
|
172
|
+
}, "flag", true);
|
|
173
|
+
exports.TOOLS["specgate_adopt"] = new GenericCliTool("specgate_adopt", "Install SDD on an EXISTING repository (brownfield, non-invasive).", "adopt", {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: {
|
|
176
|
+
projectDir: { type: "string" },
|
|
177
|
+
cliPath: { type: "string" },
|
|
178
|
+
},
|
|
179
|
+
required: ["projectDir"],
|
|
180
|
+
}, "flag", true);
|
|
181
|
+
exports.TOOLS["specgate_onboard"] = new GenericCliTool("specgate_onboard", "Read an existing repo and propose the capabilities its code implies.", "onboard", {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
projectDir: { type: "string" },
|
|
185
|
+
cliPath: { type: "string" },
|
|
186
|
+
},
|
|
187
|
+
required: ["projectDir"],
|
|
188
|
+
}, "flag", false);
|
|
189
|
+
exports.TOOLS["specgate_doctor"] = new GenericCliTool("specgate_doctor", "Diagnose the project and environment; every finding ships a fix.", "doctor", {
|
|
190
|
+
type: "object",
|
|
191
|
+
properties: {
|
|
192
|
+
projectDir: { type: "string" },
|
|
193
|
+
cliPath: { type: "string" },
|
|
194
|
+
},
|
|
195
|
+
required: ["projectDir"],
|
|
196
|
+
}, "flag", false);
|
|
197
|
+
exports.TOOLS["specgate_status"] = new GenericCliTool("specgate_status", "Daily dashboard: what is done, what is orphaned, what to do next.", "status", {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
projectDir: { type: "string" },
|
|
201
|
+
cliPath: { type: "string" },
|
|
202
|
+
},
|
|
203
|
+
required: ["projectDir"],
|
|
204
|
+
}, "flag", false);
|
|
205
|
+
exports.TOOLS["specgate_ci_init"] = new GenericCliTool("specgate_ci_init", "Generate the spec gate for GitHub, GitLab, Azure, or Jenkins.", "ci init", {
|
|
206
|
+
type: "object",
|
|
207
|
+
properties: {
|
|
208
|
+
projectDir: { type: "string" },
|
|
209
|
+
cliPath: { type: "string" },
|
|
210
|
+
},
|
|
211
|
+
required: ["projectDir"],
|
|
212
|
+
}, "flag", false);
|
|
213
|
+
exports.TOOLS["specgate_alm_sync"] = new GenericCliTool("specgate_alm_sync", "Sync REQs with Jira / Azure Boards (create, close, drift).", "alm sync", {
|
|
214
|
+
type: "object",
|
|
215
|
+
properties: {
|
|
216
|
+
projectDir: { type: "string" },
|
|
217
|
+
cliPath: { type: "string" },
|
|
218
|
+
},
|
|
219
|
+
required: ["projectDir"],
|
|
220
|
+
}, "flag", false);
|
|
221
|
+
exports.TOOLS["specgate_alm_link"] = new GenericCliTool("specgate_alm_link", "Run specgate alm link", "alm link", {
|
|
222
|
+
type: "object",
|
|
223
|
+
properties: {
|
|
224
|
+
projectDir: { type: "string" },
|
|
225
|
+
cliPath: { type: "string" },
|
|
226
|
+
},
|
|
227
|
+
required: ["projectDir"],
|
|
228
|
+
}, "flag", false);
|
|
229
|
+
exports.TOOLS["specgate_alm_status"] = new GenericCliTool("specgate_alm_status", "Run specgate alm status", "alm status", {
|
|
230
|
+
type: "object",
|
|
231
|
+
properties: {
|
|
232
|
+
projectDir: { type: "string" },
|
|
233
|
+
cliPath: { type: "string" },
|
|
234
|
+
},
|
|
235
|
+
required: ["projectDir"],
|
|
236
|
+
}, "flag", false);
|
|
237
|
+
exports.TOOLS["specgate_alm_pull"] = new GenericCliTool("specgate_alm_pull", "Run specgate alm pull", "alm pull", {
|
|
238
|
+
type: "object",
|
|
239
|
+
properties: {
|
|
240
|
+
projectDir: { type: "string" },
|
|
241
|
+
cliPath: { type: "string" },
|
|
242
|
+
},
|
|
243
|
+
required: ["projectDir"],
|
|
244
|
+
}, "flag", true);
|
|
245
|
+
exports.TOOLS["specgate_check"] = new GenericCliTool("specgate_check", "The gate: validate --strict, then your tests — before you open a PR.", "check", {
|
|
246
|
+
type: "object",
|
|
247
|
+
properties: {
|
|
248
|
+
projectDir: { type: "string" },
|
|
249
|
+
cliPath: { type: "string" },
|
|
250
|
+
},
|
|
251
|
+
required: ["projectDir"],
|
|
252
|
+
}, "positional", false);
|
|
253
|
+
exports.TOOLS["validate_project"] = new GenericCliTool("validate_project", "Check structure, traceability, Gherkin. --strict is the gate: TDD, links, scenarios, requirements and coverage.", "validate", {
|
|
254
|
+
type: "object",
|
|
255
|
+
properties: {
|
|
256
|
+
projectDir: { type: "string" },
|
|
257
|
+
cliPath: { type: "string" },
|
|
258
|
+
},
|
|
259
|
+
required: ["projectDir"],
|
|
260
|
+
}, "positional", false);
|
|
261
|
+
exports.TOOLS["specgate_expand"] = new GenericCliTool("specgate_expand", "Apply a domain pack (local path or remote git tag).", "expand", {
|
|
262
|
+
type: "object",
|
|
263
|
+
properties: {
|
|
264
|
+
projectDir: { type: "string" },
|
|
265
|
+
cliPath: { type: "string" },
|
|
266
|
+
},
|
|
267
|
+
required: ["projectDir"],
|
|
268
|
+
}, "flag", true);
|
|
269
|
+
exports.TOOLS["plan"] = new GenericCliTool("plan", "List requirements that still need a test or implementation.", "plan", {
|
|
270
|
+
type: "object",
|
|
271
|
+
properties: {
|
|
272
|
+
projectDir: { type: "string" },
|
|
273
|
+
cliPath: { type: "string" },
|
|
274
|
+
},
|
|
275
|
+
required: ["projectDir"],
|
|
276
|
+
}, "flag", false);
|
|
277
|
+
exports.TOOLS["specgate_report"] = new GenericCliTool("specgate_report", "Spec-coverage dashboard as self-contained HTML (CI/Pages artifact).", "report", {
|
|
278
|
+
type: "object",
|
|
279
|
+
properties: {
|
|
280
|
+
projectDir: { type: "string" },
|
|
281
|
+
cliPath: { type: "string" },
|
|
282
|
+
},
|
|
283
|
+
required: ["projectDir"],
|
|
284
|
+
}, "flag", false);
|
|
285
|
+
exports.TOOLS["mark_requirement_done"] = new GenericCliTool("mark_requirement_done", "Mark a requirement Implemented — after the gate passes for it.", "done", {
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
projectDir: { type: "string" },
|
|
289
|
+
cliPath: { type: "string" },
|
|
290
|
+
requirement: { type: "string", description: "The <REQ> argument of `specgate done`." },
|
|
291
|
+
},
|
|
292
|
+
required: ["projectDir", "requirement"],
|
|
293
|
+
}, "flag", true);
|
|
294
|
+
exports.TOOLS["specgate_new"] = new GenericCliTool("specgate_new", "One requirement in one step: spec.md section, tagged scenario, matrix row.", "new", {
|
|
295
|
+
type: "object",
|
|
296
|
+
properties: {
|
|
297
|
+
projectDir: { type: "string" },
|
|
298
|
+
cliPath: { type: "string" },
|
|
299
|
+
title: { type: "string", description: "The <title> argument of `specgate new`." },
|
|
300
|
+
},
|
|
301
|
+
required: ["projectDir", "title"],
|
|
302
|
+
}, "flag", true);
|
|
303
|
+
exports.TOOLS["specgate_req_add"] = new GenericCliTool("specgate_req_add", "Run specgate req add", "req add", {
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: {
|
|
306
|
+
projectDir: { type: "string" },
|
|
307
|
+
cliPath: { type: "string" },
|
|
308
|
+
},
|
|
309
|
+
required: ["projectDir"],
|
|
310
|
+
}, "flag", true);
|
|
311
|
+
exports.TOOLS["specgate_req_link"] = new GenericCliTool("specgate_req_link", "Run specgate req link", "req link", {
|
|
312
|
+
type: "object",
|
|
313
|
+
properties: {
|
|
314
|
+
projectDir: { type: "string" },
|
|
315
|
+
cliPath: { type: "string" },
|
|
316
|
+
},
|
|
317
|
+
required: ["projectDir"],
|
|
318
|
+
}, "flag", true);
|
|
319
|
+
exports.TOOLS["specgate_req_done"] = new GenericCliTool("specgate_req_done", "Run specgate req done", "req done", {
|
|
320
|
+
type: "object",
|
|
321
|
+
properties: {
|
|
322
|
+
projectDir: { type: "string" },
|
|
323
|
+
cliPath: { type: "string" },
|
|
324
|
+
},
|
|
325
|
+
required: ["projectDir"],
|
|
326
|
+
}, "flag", true);
|
|
327
|
+
exports.TOOLS["specgate_req_rm"] = new GenericCliTool("specgate_req_rm", "Run specgate req rm", "req rm", {
|
|
328
|
+
type: "object",
|
|
329
|
+
properties: {
|
|
330
|
+
projectDir: { type: "string" },
|
|
331
|
+
cliPath: { type: "string" },
|
|
332
|
+
},
|
|
333
|
+
required: ["projectDir"],
|
|
334
|
+
}, "flag", true);
|
|
335
|
+
exports.TOOLS["specgate_req_list"] = new GenericCliTool("specgate_req_list", "Run specgate req list", "req list", {
|
|
336
|
+
type: "object",
|
|
337
|
+
properties: {
|
|
338
|
+
projectDir: { type: "string" },
|
|
339
|
+
cliPath: { type: "string" },
|
|
340
|
+
},
|
|
341
|
+
required: ["projectDir"],
|
|
342
|
+
}, "flag", false);
|
|
343
|
+
exports.TOOLS["specgate_fix"] = new GenericCliTool("specgate_fix", "Apply the fixes validate suggests (--dry-run to preview).", "fix", {
|
|
344
|
+
type: "object",
|
|
345
|
+
properties: {
|
|
346
|
+
projectDir: { type: "string" },
|
|
347
|
+
cliPath: { type: "string" },
|
|
348
|
+
},
|
|
349
|
+
required: ["projectDir"],
|
|
350
|
+
}, "flag", true);
|
|
351
|
+
exports.TOOLS["specgate_change_new"] = new GenericCliTool("specgate_change_new", "Run specgate change new", "change new", {
|
|
352
|
+
type: "object",
|
|
353
|
+
properties: {
|
|
354
|
+
projectDir: { type: "string" },
|
|
355
|
+
cliPath: { type: "string" },
|
|
356
|
+
},
|
|
357
|
+
required: ["projectDir"],
|
|
358
|
+
}, "flag", false);
|
|
359
|
+
exports.TOOLS["specgate_change_list"] = new GenericCliTool("specgate_change_list", "Run specgate change list", "change list", {
|
|
360
|
+
type: "object",
|
|
361
|
+
properties: {
|
|
362
|
+
projectDir: { type: "string" },
|
|
363
|
+
cliPath: { type: "string" },
|
|
364
|
+
},
|
|
365
|
+
required: ["projectDir"],
|
|
366
|
+
}, "flag", false);
|
|
367
|
+
exports.TOOLS["specgate_change_show"] = new GenericCliTool("specgate_change_show", "Run specgate change show", "change show", {
|
|
368
|
+
type: "object",
|
|
369
|
+
properties: {
|
|
370
|
+
projectDir: { type: "string" },
|
|
371
|
+
cliPath: { type: "string" },
|
|
372
|
+
id: { type: "string", description: "The <id> argument of `specgate change show`." },
|
|
373
|
+
},
|
|
374
|
+
required: ["projectDir", "id"],
|
|
375
|
+
}, "flag", false);
|
|
376
|
+
exports.TOOLS["specgate_change_status"] = new GenericCliTool("specgate_change_status", "Run specgate change status", "change status", {
|
|
377
|
+
type: "object",
|
|
378
|
+
properties: {
|
|
379
|
+
projectDir: { type: "string" },
|
|
380
|
+
cliPath: { type: "string" },
|
|
381
|
+
},
|
|
382
|
+
required: ["projectDir"],
|
|
383
|
+
}, "flag", false);
|
|
384
|
+
exports.TOOLS["specgate_change_validate"] = new GenericCliTool("specgate_change_validate", "Run specgate change validate", "change validate", {
|
|
385
|
+
type: "object",
|
|
386
|
+
properties: {
|
|
387
|
+
projectDir: { type: "string" },
|
|
388
|
+
cliPath: { type: "string" },
|
|
389
|
+
id: { type: "string", description: "The <id> argument of `specgate change validate`." },
|
|
390
|
+
},
|
|
391
|
+
required: ["projectDir", "id"],
|
|
392
|
+
}, "flag", false);
|
|
393
|
+
exports.TOOLS["specgate_change_archive"] = new GenericCliTool("specgate_change_archive", "Run specgate change archive", "change archive", {
|
|
394
|
+
type: "object",
|
|
395
|
+
properties: {
|
|
396
|
+
projectDir: { type: "string" },
|
|
397
|
+
cliPath: { type: "string" },
|
|
398
|
+
id: { type: "string", description: "The <id> argument of `specgate change archive`." },
|
|
399
|
+
},
|
|
400
|
+
required: ["projectDir", "id"],
|
|
401
|
+
}, "flag", false);
|
|
402
|
+
exports.TOOLS["specgate_change_instructions"] = new GenericCliTool("specgate_change_instructions", "Run specgate change instructions", "change instructions", {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
projectDir: { type: "string" },
|
|
406
|
+
cliPath: { type: "string" },
|
|
407
|
+
artifact: {
|
|
408
|
+
type: "string",
|
|
409
|
+
description: "The <artifact> argument of `specgate change instructions`.",
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
required: ["projectDir", "artifact"],
|
|
413
|
+
}, "flag", false);
|
|
414
|
+
exports.TOOLS["specgate_change_author"] = new GenericCliTool("specgate_change_author", "Run specgate change author", "change author", {
|
|
415
|
+
type: "object",
|
|
416
|
+
properties: {
|
|
417
|
+
projectDir: { type: "string" },
|
|
418
|
+
cliPath: { type: "string" },
|
|
419
|
+
id: { type: "string", description: "The <id> argument of `specgate change author`." },
|
|
420
|
+
},
|
|
421
|
+
required: ["projectDir", "id"],
|
|
422
|
+
}, "flag", false);
|
|
423
|
+
exports.TOOLS["specgate_pack_init"] = new GenericCliTool("specgate_pack_init", "Scaffold a new pack skeleton (backend · frontend · contracts).", "pack init", {
|
|
424
|
+
type: "object",
|
|
425
|
+
properties: {
|
|
426
|
+
projectDir: { type: "string" },
|
|
427
|
+
cliPath: { type: "string" },
|
|
428
|
+
},
|
|
429
|
+
required: ["projectDir"],
|
|
430
|
+
}, "flag", false);
|
|
431
|
+
exports.TOOLS["lint_pack"] = new GenericCliTool("lint_pack", "Lint a pack: schema, cross-refs, and scenario quality (--strict).", "pack lint", {
|
|
432
|
+
type: "object",
|
|
433
|
+
properties: {
|
|
434
|
+
projectDir: { type: "string" },
|
|
435
|
+
cliPath: { type: "string" },
|
|
436
|
+
},
|
|
437
|
+
required: ["projectDir"],
|
|
438
|
+
}, "flag", false);
|
|
439
|
+
exports.TOOLS["specgate_pack_infer"] = new GenericCliTool("specgate_pack_infer", "Propose a pack.yaml skeleton from a .feature file.", "pack infer", {
|
|
440
|
+
type: "object",
|
|
441
|
+
properties: {
|
|
442
|
+
projectDir: { type: "string" },
|
|
443
|
+
cliPath: { type: "string" },
|
|
444
|
+
},
|
|
445
|
+
required: ["projectDir"],
|
|
446
|
+
}, "flag", false);
|
|
447
|
+
exports.TOOLS["specgate_pack_bundle"] = new GenericCliTool("specgate_pack_bundle", "Export a pack repo as a git bundle for air-gapped use.", "pack bundle", {
|
|
448
|
+
type: "object",
|
|
449
|
+
properties: {
|
|
450
|
+
projectDir: { type: "string" },
|
|
451
|
+
cliPath: { type: "string" },
|
|
452
|
+
},
|
|
453
|
+
required: ["projectDir"],
|
|
454
|
+
}, "flag", false);
|
|
455
|
+
exports.TOOLS["specgate_specops_add"] = new GenericCliTool("specgate_specops_add", "Add a pack (npm-install-style); writes .specops.lock.", "specops add", {
|
|
456
|
+
type: "object",
|
|
457
|
+
properties: {
|
|
458
|
+
projectDir: { type: "string" },
|
|
459
|
+
cliPath: { type: "string" },
|
|
460
|
+
},
|
|
461
|
+
required: ["projectDir"],
|
|
462
|
+
}, "flag", true);
|
|
463
|
+
exports.TOOLS["specgate_specops_remove"] = new GenericCliTool("specgate_specops_remove", "Drop a pack entry from .specops.lock.", "specops remove", {
|
|
464
|
+
type: "object",
|
|
465
|
+
properties: {
|
|
466
|
+
projectDir: { type: "string" },
|
|
467
|
+
cliPath: { type: "string" },
|
|
468
|
+
},
|
|
469
|
+
required: ["projectDir"],
|
|
470
|
+
}, "flag", true);
|
|
471
|
+
exports.TOOLS["specgate_specops_sync"] = new GenericCliTool("specgate_specops_sync", "Re-expand packs and three-way merge them, preserving local edits.", "specops sync", {
|
|
472
|
+
type: "object",
|
|
473
|
+
properties: {
|
|
474
|
+
projectDir: { type: "string" },
|
|
475
|
+
cliPath: { type: "string" },
|
|
476
|
+
},
|
|
477
|
+
required: ["projectDir"],
|
|
478
|
+
}, "flag", true);
|
|
479
|
+
exports.TOOLS["specgate_specops_diff"] = new GenericCliTool("specgate_specops_diff", "Preview a version bump; --as-change derives a reviewable change.", "specops diff", {
|
|
480
|
+
type: "object",
|
|
481
|
+
properties: {
|
|
482
|
+
projectDir: { type: "string" },
|
|
483
|
+
cliPath: { type: "string" },
|
|
484
|
+
},
|
|
485
|
+
required: ["projectDir"],
|
|
486
|
+
}, "flag", false);
|
|
487
|
+
exports.TOOLS["specgate_specops_contribute"] = new GenericCliTool("specgate_specops_contribute", "Send a local change back upstream to the pack (never pushes).", "specops contribute", {
|
|
488
|
+
type: "object",
|
|
489
|
+
properties: {
|
|
490
|
+
projectDir: { type: "string" },
|
|
491
|
+
cliPath: { type: "string" },
|
|
492
|
+
},
|
|
493
|
+
required: ["projectDir"],
|
|
494
|
+
}, "flag", false);
|
|
495
|
+
exports.TOOLS["specgate_harness_run"] = new GenericCliTool("specgate_harness_run", "Run the plan → agent → verify → done loop for every pending requirement.", "harness run", {
|
|
496
|
+
type: "object",
|
|
497
|
+
properties: {
|
|
498
|
+
projectDir: { type: "string" },
|
|
499
|
+
cliPath: { type: "string" },
|
|
500
|
+
},
|
|
501
|
+
required: ["projectDir"],
|
|
502
|
+
}, "flag", true);
|
|
503
|
+
exports.TOOLS["specgate_harness_prompt"] = new GenericCliTool("specgate_harness_prompt", "Print the prompt the harness would hand an agent for one REQ.", "harness prompt", {
|
|
504
|
+
type: "object",
|
|
505
|
+
properties: {
|
|
506
|
+
projectDir: { type: "string" },
|
|
507
|
+
cliPath: { type: "string" },
|
|
508
|
+
},
|
|
509
|
+
required: ["projectDir"],
|
|
510
|
+
}, "flag", false);
|
|
511
|
+
exports.TOOLS["specgate_harness_init"] = new GenericCliTool("specgate_harness_init", "Scaffold harness.config.yaml and the prompt prefix.", "harness init", {
|
|
512
|
+
type: "object",
|
|
513
|
+
properties: {
|
|
514
|
+
projectDir: { type: "string" },
|
|
515
|
+
cliPath: { type: "string" },
|
|
516
|
+
},
|
|
517
|
+
required: ["projectDir"],
|
|
518
|
+
}, "flag", true);
|
|
519
|
+
exports.TOOLS["specgate_harness_report"] = new GenericCliTool("specgate_harness_report", "What the harness has cost: first-attempt rate, time per delivered requirement.", "harness report", {
|
|
520
|
+
type: "object",
|
|
521
|
+
properties: {
|
|
522
|
+
projectDir: { type: "string" },
|
|
523
|
+
cliPath: { type: "string" },
|
|
524
|
+
},
|
|
525
|
+
required: ["projectDir"],
|
|
526
|
+
}, "flag", false);
|
|
527
|
+
exports.TOOLS["specgate_config_init"] = new GenericCliTool("specgate_config_init", "Run specgate config init", "config init", {
|
|
528
|
+
type: "object",
|
|
529
|
+
properties: {
|
|
530
|
+
projectDir: { type: "string" },
|
|
531
|
+
cliPath: { type: "string" },
|
|
532
|
+
},
|
|
533
|
+
required: ["projectDir"],
|
|
534
|
+
}, "flag", false);
|
|
535
|
+
exports.TOOLS["specgate_config_set"] = new GenericCliTool("specgate_config_set", "Run specgate config set", "config set", {
|
|
536
|
+
type: "object",
|
|
537
|
+
properties: {
|
|
538
|
+
projectDir: { type: "string" },
|
|
539
|
+
cliPath: { type: "string" },
|
|
540
|
+
},
|
|
541
|
+
required: ["projectDir"],
|
|
542
|
+
}, "flag", false);
|
|
543
|
+
exports.TOOLS["specgate_config_get"] = new GenericCliTool("specgate_config_get", "Run specgate config get", "config get", {
|
|
544
|
+
type: "object",
|
|
545
|
+
properties: {
|
|
546
|
+
projectDir: { type: "string" },
|
|
547
|
+
cliPath: { type: "string" },
|
|
548
|
+
},
|
|
549
|
+
required: ["projectDir"],
|
|
550
|
+
}, "flag", false);
|
|
551
|
+
exports.TOOLS["specgate_config_list"] = new GenericCliTool("specgate_config_list", "Run specgate config list", "config list", {
|
|
552
|
+
type: "object",
|
|
553
|
+
properties: {
|
|
554
|
+
projectDir: { type: "string" },
|
|
555
|
+
cliPath: { type: "string" },
|
|
556
|
+
},
|
|
557
|
+
required: ["projectDir"],
|
|
558
|
+
}, "flag", false);
|
|
559
|
+
exports.TOOLS["specgate_agents_init"] = new GenericCliTool("specgate_agents_init", "Wire the loop into Claude, Cursor, Copilot, Aider and more.", "agents init", {
|
|
560
|
+
type: "object",
|
|
561
|
+
properties: {
|
|
562
|
+
projectDir: { type: "string" },
|
|
563
|
+
cliPath: { type: "string" },
|
|
564
|
+
},
|
|
565
|
+
required: ["projectDir"],
|
|
566
|
+
}, "flag", false);
|
|
567
|
+
exports.TOOLS["specgate_update"] = new GenericCliTool("specgate_update", "Refresh generated agent files after a CLI upgrade, keeping your edits.", "update", {
|
|
568
|
+
type: "object",
|
|
569
|
+
properties: {
|
|
570
|
+
projectDir: { type: "string" },
|
|
571
|
+
cliPath: { type: "string" },
|
|
572
|
+
},
|
|
573
|
+
required: ["projectDir"],
|
|
574
|
+
}, "flag", true);
|
|
575
|
+
exports.TOOLS["specgate_schema_which"] = new GenericCliTool("specgate_schema_which", "Run specgate schema which", "schema which", {
|
|
576
|
+
type: "object",
|
|
577
|
+
properties: {
|
|
578
|
+
projectDir: { type: "string" },
|
|
579
|
+
cliPath: { type: "string" },
|
|
580
|
+
},
|
|
581
|
+
required: ["projectDir"],
|
|
582
|
+
}, "flag", false);
|
|
583
|
+
exports.TOOLS["specgate_schema_init"] = new GenericCliTool("specgate_schema_init", "Run specgate schema init", "schema init", {
|
|
584
|
+
type: "object",
|
|
585
|
+
properties: {
|
|
586
|
+
projectDir: { type: "string" },
|
|
587
|
+
cliPath: { type: "string" },
|
|
588
|
+
},
|
|
589
|
+
required: ["projectDir"],
|
|
590
|
+
}, "flag", false);
|
|
591
|
+
exports.TOOLS["specgate_schema_fork"] = new GenericCliTool("specgate_schema_fork", "Run specgate schema fork", "schema fork", {
|
|
592
|
+
type: "object",
|
|
593
|
+
properties: {
|
|
594
|
+
projectDir: { type: "string" },
|
|
595
|
+
cliPath: { type: "string" },
|
|
596
|
+
},
|
|
597
|
+
required: ["projectDir"],
|
|
598
|
+
}, "flag", false);
|
|
599
|
+
exports.TOOLS["specgate_schema_validate"] = new GenericCliTool("specgate_schema_validate", "Run specgate schema validate", "schema validate", {
|
|
600
|
+
type: "object",
|
|
601
|
+
properties: {
|
|
602
|
+
projectDir: { type: "string" },
|
|
603
|
+
cliPath: { type: "string" },
|
|
604
|
+
},
|
|
605
|
+
required: ["projectDir"],
|
|
606
|
+
}, "flag", false);
|
|
607
|
+
exports.TOOLS["specgate_completion_bash"] = new GenericCliTool("specgate_completion_bash", "Run specgate completion bash", "completion bash", {
|
|
608
|
+
type: "object",
|
|
609
|
+
properties: {
|
|
610
|
+
projectDir: { type: "string" },
|
|
611
|
+
cliPath: { type: "string" },
|
|
612
|
+
},
|
|
613
|
+
required: ["projectDir"],
|
|
614
|
+
}, "flag", false);
|
|
615
|
+
exports.TOOLS["specgate_completion_zsh"] = new GenericCliTool("specgate_completion_zsh", "Run specgate completion zsh", "completion zsh", {
|
|
616
|
+
type: "object",
|
|
617
|
+
properties: {
|
|
618
|
+
projectDir: { type: "string" },
|
|
619
|
+
cliPath: { type: "string" },
|
|
620
|
+
},
|
|
621
|
+
required: ["projectDir"],
|
|
622
|
+
}, "flag", false);
|
|
623
|
+
exports.TOOLS["specgate_completion_fish"] = new GenericCliTool("specgate_completion_fish", "Run specgate completion fish", "completion fish", {
|
|
624
|
+
type: "object",
|
|
625
|
+
properties: {
|
|
626
|
+
projectDir: { type: "string" },
|
|
627
|
+
cliPath: { type: "string" },
|
|
628
|
+
},
|
|
629
|
+
required: ["projectDir"],
|
|
630
|
+
}, "flag", false);
|
|
631
|
+
exports.TOOLS["specgate_studio"] = new GenericCliTool("specgate_studio", "Serve a local, read-only HTML view of the spec tree (--json for agents).", "studio", {
|
|
632
|
+
type: "object",
|
|
633
|
+
properties: {
|
|
634
|
+
projectDir: { type: "string" },
|
|
635
|
+
cliPath: { type: "string" },
|
|
636
|
+
},
|
|
637
|
+
required: ["projectDir"],
|
|
638
|
+
}, "flag", false);
|
|
639
|
+
// ── The published seven ──────────────────────────────────────────────────────
|
|
640
|
+
exports.TOOLS["read_spec"] = new native_tools_1.ReadSpecTool();
|
|
641
|
+
exports.TOOLS["list_requirements"] = new native_tools_1.ListRequirementsTool();
|
|
642
|
+
exports.TOOLS["update_traceability"] = new native_tools_1.UpdateTraceabilityTool();
|
|
643
|
+
// Aliases: the documented name and the generated id are the same tool.
|
|
644
|
+
for (const [published, generated] of [
|
|
645
|
+
["lint_pack", "specgate_pack_lint"],
|
|
646
|
+
["validate_project", "specgate_validate"],
|
|
647
|
+
["plan", "specgate_plan"],
|
|
648
|
+
["mark_requirement_done", "specgate_done"],
|
|
649
|
+
]) {
|
|
650
|
+
if (exports.TOOLS[generated])
|
|
651
|
+
exports.TOOLS[published] = exports.TOOLS[generated];
|
|
652
|
+
}
|
|
653
|
+
const readSpec = (args) => exports.TOOLS["read_spec"].handler(args);
|
|
654
|
+
exports.readSpec = readSpec;
|
|
655
|
+
const listRequirements = (args) => exports.TOOLS["list_requirements"].handler(args);
|
|
656
|
+
exports.listRequirements = listRequirements;
|
|
657
|
+
const updateTraceability = (args) => exports.TOOLS["update_traceability"].handler(args);
|
|
658
|
+
exports.updateTraceability = updateTraceability;
|
|
659
|
+
const lintPack = (args) => exports.TOOLS["lint_pack"].handler(args);
|
|
660
|
+
exports.lintPack = lintPack;
|
|
661
|
+
const validateProject = (args) => exports.TOOLS["validate_project"].handler(args);
|
|
662
|
+
exports.validateProject = validateProject;
|
|
663
|
+
const plan = (args) => exports.TOOLS["plan"].handler(args);
|
|
664
|
+
exports.plan = plan;
|
|
665
|
+
const markRequirementDone = (args) => exports.TOOLS["mark_requirement_done"].handler(args);
|
|
666
|
+
exports.markRequirementDone = markRequirementDone;
|
|
667
|
+
//# sourceMappingURL=tools.js.map
|