specdx 0.3.0-alpha.2 → 0.4.0-alpha.1
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/dist/{changelog-URU2TFNM.js → changelog-OUP2RXWN.js} +4 -4
- package/dist/check-3XQYO3HU.js +109 -0
- package/dist/check-3XQYO3HU.js.map +1 -0
- package/dist/{pack-OJAC7JF2.js → chunk-4THCEWAK.js} +53 -169
- package/dist/chunk-4THCEWAK.js.map +1 -0
- package/dist/chunk-6BWZEAST.js +1051 -0
- package/dist/chunk-6BWZEAST.js.map +1 -0
- package/dist/{chunk-LU6M5O63.js → chunk-DDFLMRPC.js} +2 -2
- package/dist/chunk-HMXUNURD.js +490 -0
- package/dist/chunk-HMXUNURD.js.map +1 -0
- package/dist/{chunk-276J7LR6.js → chunk-PHR7AV6I.js} +2 -2
- package/dist/{chunk-XLEN6ZYM.js → chunk-ZX4HVL5M.js} +92 -4
- package/dist/chunk-ZX4HVL5M.js.map +1 -0
- package/dist/{diff-55PTEVB3.js → diff-275PLXYH.js} +4 -4
- package/dist/dist-PQCG2XXF.js +11 -0
- package/dist/dist-PQCG2XXF.js.map +1 -0
- package/dist/dist-QXLX77XG.js +279 -0
- package/dist/dist-QXLX77XG.js.map +1 -0
- package/dist/{explain-YXUILNEA.js → explain-I7AQMEEH.js} +3 -3
- package/dist/generate-PC7BIB7G.js +13 -0
- package/dist/generate-PC7BIB7G.js.map +1 -0
- package/dist/generate-story-7WHPPFHY.js +192 -0
- package/dist/generate-story-7WHPPFHY.js.map +1 -0
- package/dist/generate-test-plan-U5LMWGKX.js +154 -0
- package/dist/generate-test-plan-U5LMWGKX.js.map +1 -0
- package/dist/{graph-OWQJWVSN.js → graph-RCAPF55A.js} +3 -3
- package/dist/index.js +390 -16
- package/dist/index.js.map +1 -1
- package/dist/{lint-U7VLGS75.js → lint-XPAFMLZN.js} +4 -4
- package/dist/main.js +23 -14
- package/dist/main.js.map +1 -1
- package/dist/mcp-6RCSHMXD.js +17 -0
- package/dist/mcp-6RCSHMXD.js.map +1 -0
- package/dist/migrate-L7W5RHSS.js +56 -0
- package/dist/migrate-L7W5RHSS.js.map +1 -0
- package/dist/pack-QCOXMURY.js +167 -0
- package/dist/pack-QCOXMURY.js.map +1 -0
- package/dist/{ready-3OIF4QHM.js → ready-ZXG74W7Y.js} +5 -5
- package/dist/skills/specdx-check-drift.md +71 -0
- package/dist/skills/specdx-review-spec.md +77 -0
- package/dist/skills/specdx-verify.md +70 -0
- package/dist/{skills-XJYTWGDK.js → skills-3GBBWZW2.js} +5 -2
- package/dist/skills-3GBBWZW2.js.map +1 -0
- package/dist/{status-LYZUO6AJ.js → status-EKWK47O5.js} +5 -5
- package/dist/update-HIWDDEZQ.js +132 -0
- package/dist/update-HIWDDEZQ.js.map +1 -0
- package/dist/{validate-DOZZEZFC.js → validate-N2WSG75W.js} +3 -3
- package/package.json +3 -1
- package/dist/chunk-ATLVRGHI.js +0 -237
- package/dist/chunk-ATLVRGHI.js.map +0 -1
- package/dist/chunk-XLEN6ZYM.js.map +0 -1
- package/dist/pack-OJAC7JF2.js.map +0 -1
- package/dist/skills-XJYTWGDK.js.map +0 -1
- /package/dist/{changelog-URU2TFNM.js.map → changelog-OUP2RXWN.js.map} +0 -0
- /package/dist/{chunk-LU6M5O63.js.map → chunk-DDFLMRPC.js.map} +0 -0
- /package/dist/{chunk-276J7LR6.js.map → chunk-PHR7AV6I.js.map} +0 -0
- /package/dist/{diff-55PTEVB3.js.map → diff-275PLXYH.js.map} +0 -0
- /package/dist/{explain-YXUILNEA.js.map → explain-I7AQMEEH.js.map} +0 -0
- /package/dist/{graph-OWQJWVSN.js.map → graph-RCAPF55A.js.map} +0 -0
- /package/dist/{lint-U7VLGS75.js.map → lint-XPAFMLZN.js.map} +0 -0
- /package/dist/{ready-3OIF4QHM.js.map → ready-ZXG74W7Y.js.map} +0 -0
- /package/dist/{status-LYZUO6AJ.js.map → status-EKWK47O5.js.map} +0 -0
- /package/dist/{validate-DOZZEZFC.js.map → validate-N2WSG75W.js.map} +0 -0
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
// ../schema/dist/types.js
|
|
2
|
+
var SPEC_TYPES = [
|
|
3
|
+
"prd",
|
|
4
|
+
"technical-design",
|
|
5
|
+
"user-story",
|
|
6
|
+
"test-plan",
|
|
7
|
+
"adr",
|
|
8
|
+
"api-contract",
|
|
9
|
+
"epic",
|
|
10
|
+
"quick-spec",
|
|
11
|
+
"project-context"
|
|
12
|
+
];
|
|
13
|
+
|
|
1
14
|
// ../schema/dist/sections.js
|
|
2
15
|
var REQUIRED_SECTIONS = {
|
|
3
16
|
prd: ["Problem Statement", "Goals", "Non-Goals", "Features", "Success Criteria"],
|
|
@@ -13,7 +26,10 @@ var REQUIRED_SECTIONS = {
|
|
|
13
26
|
"user-story": ["Description", "Acceptance Criteria", "Dependencies", "Notes"],
|
|
14
27
|
"test-plan": ["Scope", "Test Cases", "Coverage Matrix", "Edge Cases"],
|
|
15
28
|
adr: ["Context", "Decision", "Status", "Consequences"],
|
|
16
|
-
"api-contract": ["Endpoints", "Request/Response Schemas", "Auth", "Error Codes"]
|
|
29
|
+
"api-contract": ["Endpoints", "Request/Response Schemas", "Auth", "Error Codes"],
|
|
30
|
+
epic: ["Overview", "Stories", "Acceptance Criteria", "Dependencies"],
|
|
31
|
+
"quick-spec": ["Intent", "Boundaries", "Tasks"],
|
|
32
|
+
"project-context": ["Technology Stack", "Critical Implementation Rules", "Coding Patterns"]
|
|
17
33
|
};
|
|
18
34
|
|
|
19
35
|
// ../schema/dist/validator.js
|
|
@@ -26,7 +42,7 @@ var base_spec_default = {
|
|
|
26
42
|
type: "object",
|
|
27
43
|
properties: {
|
|
28
44
|
id: { type: "string", minLength: 1 },
|
|
29
|
-
type: { type: "string", enum: ["prd", "technical-design", "user-story", "test-plan", "adr", "api-contract"] },
|
|
45
|
+
type: { type: "string", enum: ["prd", "technical-design", "user-story", "test-plan", "adr", "api-contract", "epic", "quick-spec", "project-context"] },
|
|
30
46
|
title: { type: "string", minLength: 1 },
|
|
31
47
|
status: { type: "string", enum: ["draft", "review", "approved", "superseded"] },
|
|
32
48
|
version: { type: "string" },
|
|
@@ -136,6 +152,24 @@ var config_default = {
|
|
|
136
152
|
}
|
|
137
153
|
},
|
|
138
154
|
additionalProperties: false
|
|
155
|
+
},
|
|
156
|
+
check: {
|
|
157
|
+
type: "object",
|
|
158
|
+
properties: {
|
|
159
|
+
framework: {
|
|
160
|
+
type: "string",
|
|
161
|
+
enum: ["auto", "express", "hono", "nextjs"]
|
|
162
|
+
},
|
|
163
|
+
routes_dir: { type: "string" },
|
|
164
|
+
app_dir: { type: "string" },
|
|
165
|
+
types_dir: { type: "string" },
|
|
166
|
+
tests_dir: { type: "string" },
|
|
167
|
+
ignore: {
|
|
168
|
+
type: "array",
|
|
169
|
+
items: { type: "string" }
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
additionalProperties: false
|
|
139
173
|
}
|
|
140
174
|
},
|
|
141
175
|
required: ["version", "specs"],
|
|
@@ -211,6 +245,56 @@ var api_contract_default = {
|
|
|
211
245
|
]
|
|
212
246
|
};
|
|
213
247
|
|
|
248
|
+
// ../schema/dist/schemas/epic.json
|
|
249
|
+
var epic_default = {
|
|
250
|
+
$id: "epic",
|
|
251
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
252
|
+
allOf: [
|
|
253
|
+
{ $ref: "base-spec" },
|
|
254
|
+
{
|
|
255
|
+
type: "object",
|
|
256
|
+
properties: {
|
|
257
|
+
type: { const: "epic" },
|
|
258
|
+
epic_id: { type: "string", minLength: 1 },
|
|
259
|
+
priority: { type: "string", enum: ["critical", "high", "medium", "low"] }
|
|
260
|
+
},
|
|
261
|
+
required: ["type", "epic_id", "priority"]
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// ../schema/dist/schemas/quick-spec.json
|
|
267
|
+
var quick_spec_default = {
|
|
268
|
+
$id: "quick-spec",
|
|
269
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
270
|
+
allOf: [
|
|
271
|
+
{ $ref: "base-spec" },
|
|
272
|
+
{
|
|
273
|
+
type: "object",
|
|
274
|
+
properties: {
|
|
275
|
+
type: { const: "quick-spec" }
|
|
276
|
+
},
|
|
277
|
+
required: ["type"]
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
// ../schema/dist/schemas/project-context.json
|
|
283
|
+
var project_context_default = {
|
|
284
|
+
$id: "project-context",
|
|
285
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
286
|
+
allOf: [
|
|
287
|
+
{ $ref: "base-spec" },
|
|
288
|
+
{
|
|
289
|
+
type: "object",
|
|
290
|
+
properties: {
|
|
291
|
+
type: { const: "project-context" }
|
|
292
|
+
},
|
|
293
|
+
required: ["type"]
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
};
|
|
297
|
+
|
|
214
298
|
// ../schema/dist/validator.js
|
|
215
299
|
import * as addFormatsNs from "ajv-formats";
|
|
216
300
|
var addFormats = addFormatsNs.default ?? addFormatsNs;
|
|
@@ -223,7 +307,10 @@ var specValidators = {
|
|
|
223
307
|
"user-story": ajv.compile(user_story_default),
|
|
224
308
|
"test-plan": ajv.compile(test_plan_default),
|
|
225
309
|
adr: ajv.compile(adr_default),
|
|
226
|
-
"api-contract": ajv.compile(api_contract_default)
|
|
310
|
+
"api-contract": ajv.compile(api_contract_default),
|
|
311
|
+
epic: ajv.compile(epic_default),
|
|
312
|
+
"quick-spec": ajv.compile(quick_spec_default),
|
|
313
|
+
"project-context": ajv.compile(project_context_default)
|
|
227
314
|
};
|
|
228
315
|
var configValidator = ajv.compile(config_default);
|
|
229
316
|
function validateSpec(type, data) {
|
|
@@ -240,8 +327,9 @@ function validateConfig(data) {
|
|
|
240
327
|
}
|
|
241
328
|
|
|
242
329
|
export {
|
|
330
|
+
SPEC_TYPES,
|
|
243
331
|
REQUIRED_SECTIONS,
|
|
244
332
|
validateSpec,
|
|
245
333
|
validateConfig
|
|
246
334
|
};
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
335
|
+
//# sourceMappingURL=chunk-ZX4HVL5M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../schema/src/types.ts","../../schema/src/sections.ts","../../schema/src/validator.ts","../../schema/dist/schemas/base-spec.json","../../schema/dist/schemas/config.json","../../schema/dist/schemas/prd.json","../../schema/dist/schemas/technical-design.json","../../schema/dist/schemas/user-story.json","../../schema/dist/schemas/test-plan.json","../../schema/dist/schemas/adr.json","../../schema/dist/schemas/api-contract.json","../../schema/dist/schemas/epic.json","../../schema/dist/schemas/quick-spec.json","../../schema/dist/schemas/project-context.json"],"sourcesContent":["export const SPEC_TYPES = [\n \"prd\",\n \"technical-design\",\n \"user-story\",\n \"test-plan\",\n \"adr\",\n \"api-contract\",\n \"epic\",\n \"quick-spec\",\n \"project-context\",\n] as const;\nexport type SpecType = (typeof SPEC_TYPES)[number];\n\nexport const SPEC_STATUSES = [\"draft\", \"review\", \"approved\", \"superseded\"] as const;\nexport type SpecStatus = (typeof SPEC_STATUSES)[number];\n\nexport interface SpecReference {\n id: string;\n relationship: \"implemented-by\" | \"decomposed-into\" | \"depends-on\" | \"supersedes\" | \"related-to\";\n}\n\nexport interface BaseSpec {\n id: string;\n type: SpecType;\n title: string;\n status: SpecStatus;\n version: string;\n created: string;\n updated?: string;\n authors: string[];\n tags?: string[];\n references?: SpecReference[];\n}\n\nexport interface PrdSpec extends BaseSpec {\n type: \"prd\";\n}\nexport interface TechnicalDesignSpec extends BaseSpec {\n type: \"technical-design\";\n}\nexport interface UserStorySpec extends BaseSpec {\n type: \"user-story\";\n story_id: string;\n priority: \"critical\" | \"high\" | \"medium\" | \"low\";\n estimate: string;\n}\nexport interface TestPlanSpec extends BaseSpec {\n type: \"test-plan\";\n}\nexport interface AdrSpec extends BaseSpec {\n type: \"adr\";\n}\nexport interface ApiContractSpec extends BaseSpec {\n type: \"api-contract\";\n}\n\nexport interface EpicSpec extends BaseSpec {\n type: \"epic\";\n epic_id: string;\n priority: \"critical\" | \"high\" | \"medium\" | \"low\";\n}\n\nexport interface QuickSpecSpec extends BaseSpec {\n type: \"quick-spec\";\n}\n\nexport interface ProjectContextSpec extends BaseSpec {\n type: \"project-context\";\n}\n\nexport type Spec =\n | PrdSpec\n | TechnicalDesignSpec\n | UserStorySpec\n | TestPlanSpec\n | AdrSpec\n | ApiContractSpec\n | EpicSpec\n | QuickSpecSpec\n | ProjectContextSpec;\n\nexport interface SpecEntry {\n path: string;\n type: SpecType;\n required?: boolean;\n requires?: string[];\n owner?: string;\n}\n\nexport interface PackCompressionConfig {\n strip_boilerplate?: boolean;\n stable_days?: number;\n collapse_resolved_adrs?: boolean;\n}\n\nexport interface PackConfig {\n max_tokens?: number;\n format?: \"xml\" | \"markdown\" | \"json\";\n compression?: PackCompressionConfig;\n boilerplate_sections?: string[];\n}\n\nexport interface SdxConfig {\n version: string;\n project?: { name?: string; description?: string };\n specs: Record<string, SpecEntry>;\n lint?: {\n extends?: string;\n rules?: Record<string, unknown>;\n ignore?: string[];\n };\n pack?: PackConfig;\n diff?: {\n baseline_ref?: string;\n staleness_threshold_days?: number;\n ignore_paths?: string[];\n };\n ci?: {\n block_on?: (\"error\" | \"warn\" | \"info\")[];\n post_comment?: boolean;\n update_badge?: boolean;\n trigger_paths?: string[];\n };\n check?: {\n framework?: \"auto\" | \"express\" | \"hono\" | \"nextjs\";\n routes_dir?: string;\n app_dir?: string;\n types_dir?: string;\n tests_dir?: string;\n ignore?: string[];\n };\n}\n","import type { SpecType } from \"./types.js\";\n\nexport const REQUIRED_SECTIONS: Record<SpecType, string[]> = {\n prd: [\"Problem Statement\", \"Goals\", \"Non-Goals\", \"Features\", \"Success Criteria\"],\n \"technical-design\": [\n \"Overview\",\n \"Architecture\",\n \"Data Model\",\n \"API Design\",\n \"Dependencies\",\n \"Risks\",\n \"Open Questions\",\n ],\n \"user-story\": [\"Description\", \"Acceptance Criteria\", \"Dependencies\", \"Notes\"],\n \"test-plan\": [\"Scope\", \"Test Cases\", \"Coverage Matrix\", \"Edge Cases\"],\n adr: [\"Context\", \"Decision\", \"Status\", \"Consequences\"],\n \"api-contract\": [\"Endpoints\", \"Request/Response Schemas\", \"Auth\", \"Error Codes\"],\n epic: [\"Overview\", \"Stories\", \"Acceptance Criteria\", \"Dependencies\"],\n \"quick-spec\": [\"Intent\", \"Boundaries\", \"Tasks\"],\n \"project-context\": [\"Technology Stack\", \"Critical Implementation Rules\", \"Coding Patterns\"],\n};\n","import { Ajv as AjvClass, type ErrorObject } from \"ajv\";\nimport type { SpecType } from \"./types.js\";\n\nimport baseSpecSchema from \"./schemas/base-spec.json\" with { type: \"json\" };\nimport configSchema from \"./schemas/config.json\" with { type: \"json\" };\nimport prdSchema from \"./schemas/prd.json\" with { type: \"json\" };\nimport technicalDesignSchema from \"./schemas/technical-design.json\" with { type: \"json\" };\nimport userStorySchema from \"./schemas/user-story.json\" with { type: \"json\" };\nimport testPlanSchema from \"./schemas/test-plan.json\" with { type: \"json\" };\nimport adrSchema from \"./schemas/adr.json\" with { type: \"json\" };\nimport apiContractSchema from \"./schemas/api-contract.json\" with { type: \"json\" };\nimport epicSchema from \"./schemas/epic.json\" with { type: \"json\" };\nimport quickSpecSchema from \"./schemas/quick-spec.json\" with { type: \"json\" };\nimport projectContextSchema from \"./schemas/project-context.json\" with { type: \"json\" };\n\n// addFormats is CJS-only; access via the namespace default at runtime\n// The type cast is needed because TypeScript's NodeNext resolution exposes\n// the CJS module as a namespace without a callable default signature.\nimport * as addFormatsNs from \"ajv-formats\";\ntype AddFormatsPlugin = (ajv: AjvClass, formats?: unknown) => AjvClass;\nconst addFormats = ((addFormatsNs as unknown as { default?: AddFormatsPlugin }).default ??\n (addFormatsNs as unknown as AddFormatsPlugin)) as AddFormatsPlugin;\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ErrorObject[] | null;\n}\n\nconst ajv = new AjvClass({ allErrors: true, strict: true });\naddFormats(ajv, [\"date\"]);\najv.addSchema(baseSpecSchema);\n\nconst specValidators: Record<string, ReturnType<typeof ajv.compile>> = {\n prd: ajv.compile(prdSchema),\n \"technical-design\": ajv.compile(technicalDesignSchema),\n \"user-story\": ajv.compile(userStorySchema),\n \"test-plan\": ajv.compile(testPlanSchema),\n adr: ajv.compile(adrSchema),\n \"api-contract\": ajv.compile(apiContractSchema),\n epic: ajv.compile(epicSchema),\n \"quick-spec\": ajv.compile(quickSpecSchema),\n \"project-context\": ajv.compile(projectContextSchema),\n};\n\nconst configValidator = ajv.compile(configSchema);\n\nexport function validateSpec(type: SpecType, data: Record<string, unknown>): ValidationResult {\n const validate = specValidators[type];\n if (!validate) {\n return { valid: false, errors: [{ message: `Unknown spec type: \"${type}\"` } as ErrorObject] };\n }\n const valid = validate(data);\n return { valid: !!valid, errors: valid ? null : (validate.errors ?? null) };\n}\n\nexport function validateConfig(data: Record<string, unknown>): ValidationResult {\n const valid = configValidator(data);\n return { valid: !!valid, errors: valid ? null : (configValidator.errors ?? null) };\n}\n","{\n \"$id\": \"base-spec\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\", \"minLength\": 1 },\n \"type\": { \"type\": \"string\", \"enum\": [\"prd\", \"technical-design\", \"user-story\", \"test-plan\", \"adr\", \"api-contract\", \"epic\", \"quick-spec\", \"project-context\"] },\n \"title\": { \"type\": \"string\", \"minLength\": 1 },\n \"status\": { \"type\": \"string\", \"enum\": [\"draft\", \"review\", \"approved\", \"superseded\"] },\n \"version\": { \"type\": \"string\" },\n \"created\": { \"type\": \"string\", \"format\": \"date\" },\n \"updated\": { \"type\": \"string\", \"format\": \"date\" },\n \"authors\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"minItems\": 1 },\n \"tags\": { \"type\": \"array\", \"items\": { \"type\": \"string\" }, \"default\": [] },\n \"references\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\" },\n \"relationship\": { \"type\": \"string\", \"enum\": [\"implemented-by\", \"decomposed-into\", \"depends-on\", \"supersedes\", \"related-to\"] }\n },\n \"required\": [\"id\", \"relationship\"],\n \"additionalProperties\": false\n },\n \"default\": []\n }\n },\n \"required\": [\"id\", \"type\", \"title\", \"status\", \"version\", \"created\", \"authors\"],\n \"additionalProperties\": true\n}\n","{\n \"$id\": \"sdx-config\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"version\": { \"type\": \"string\" },\n \"project\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" }\n },\n \"additionalProperties\": false\n },\n \"specs\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"prd\", \"technical-design\", \"user-story\", \"test-plan\", \"adr\", \"api-contract\"] },\n \"required\": { \"type\": \"boolean\", \"default\": false },\n \"requires\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"owner\": { \"type\": \"string\" }\n },\n \"required\": [\"path\", \"type\"],\n \"additionalProperties\": false\n }\n },\n \"lint\": {\n \"type\": \"object\",\n \"properties\": {\n \"extends\": { \"type\": \"string\" },\n \"rules\": { \"type\": \"object\" },\n \"ignore\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n },\n \"additionalProperties\": false\n },\n \"pack\": {\n \"type\": \"object\",\n \"properties\": {\n \"max_tokens\": { \"type\": \"integer\", \"minimum\": 1 },\n \"format\": { \"type\": \"string\", \"enum\": [\"xml\", \"markdown\", \"json\"] },\n \"compression\": {\n \"type\": \"object\",\n \"properties\": {\n \"strip_boilerplate\": { \"type\": \"boolean\" },\n \"stable_days\": { \"type\": \"integer\", \"minimum\": 0 },\n \"collapse_resolved_adrs\": { \"type\": \"boolean\" }\n },\n \"additionalProperties\": false\n },\n \"boilerplate_sections\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n },\n \"diff\": {\n \"type\": \"object\",\n \"properties\": {\n \"baseline_ref\": { \"type\": \"string\", \"default\": \"main\" },\n \"staleness_threshold_days\": { \"type\": \"integer\", \"minimum\": 1, \"default\": 14 },\n \"ignore_paths\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } }\n },\n \"additionalProperties\": false\n },\n \"ci\": {\n \"type\": \"object\",\n \"properties\": {\n \"block_on\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"enum\": [\"error\", \"warn\", \"info\"] }\n },\n \"post_comment\": { \"type\": \"boolean\", \"default\": true },\n \"update_badge\": { \"type\": \"boolean\", \"default\": true },\n \"trigger_paths\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n },\n \"check\": {\n \"type\": \"object\",\n \"properties\": {\n \"framework\": {\n \"type\": \"string\",\n \"enum\": [\"auto\", \"express\", \"hono\", \"nextjs\"]\n },\n \"routes_dir\": { \"type\": \"string\" },\n \"app_dir\": { \"type\": \"string\" },\n \"types_dir\": { \"type\": \"string\" },\n \"tests_dir\": { \"type\": \"string\" },\n \"ignore\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n },\n \"additionalProperties\": false\n }\n },\n \"required\": [\"version\", \"specs\"],\n \"additionalProperties\": false\n}\n","{\n \"$id\": \"prd\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"prd\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"technical-design\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"technical-design\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"user-story\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"user-story\" },\n \"story_id\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"string\", \"enum\": [\"critical\", \"high\", \"medium\", \"low\"] },\n \"estimate\": { \"type\": \"string\" }\n },\n \"required\": [\"type\", \"story_id\", \"priority\", \"estimate\"]\n }\n ]\n}\n","{\n \"$id\": \"test-plan\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"test-plan\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"adr\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"adr\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"api-contract\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n { \"type\": \"object\", \"properties\": { \"type\": { \"const\": \"api-contract\" } }, \"required\": [\"type\"] }\n ]\n}\n","{\n \"$id\": \"epic\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"epic\" },\n \"epic_id\": { \"type\": \"string\", \"minLength\": 1 },\n \"priority\": { \"type\": \"string\", \"enum\": [\"critical\", \"high\", \"medium\", \"low\"] }\n },\n \"required\": [\"type\", \"epic_id\", \"priority\"]\n }\n ]\n}\n","{\n \"$id\": \"quick-spec\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"quick-spec\" }\n },\n \"required\": [\"type\"]\n }\n ]\n}\n","{\n \"$id\": \"project-context\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"allOf\": [\n { \"$ref\": \"base-spec\" },\n {\n \"type\": \"object\",\n \"properties\": {\n \"type\": { \"const\": \"project-context\" }\n },\n \"required\": [\"type\"]\n }\n ]\n}\n"],"mappings":";AAAO,IAAM,aAAa;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;ACPK,IAAM,oBAAgD;EAC3D,KAAK,CAAC,qBAAqB,SAAS,aAAa,YAAY,kBAAkB;EAC/E,oBAAoB;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,cAAc,CAAC,eAAe,uBAAuB,gBAAgB,OAAO;EAC5E,aAAa,CAAC,SAAS,cAAc,mBAAmB,YAAY;EACpE,KAAK,CAAC,WAAW,YAAY,UAAU,cAAc;EACrD,gBAAgB,CAAC,aAAa,4BAA4B,QAAQ,aAAa;EAC/E,MAAM,CAAC,YAAY,WAAW,uBAAuB,cAAc;EACnE,cAAc,CAAC,UAAU,cAAc,OAAO;EAC9C,mBAAmB,CAAC,oBAAoB,iCAAiC,iBAAiB;;;;ACnB5F,SAAS,OAAO,gBAAkC;;;ACAlD;AAAA,EACI,KAAO;AAAA,EACP,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,YAAc;AAAA,IACV,IAAM,EAAE,MAAQ,UAAU,WAAa,EAAE;AAAA,IACzC,MAAQ,EAAE,MAAQ,UAAU,MAAQ,CAAC,OAAO,oBAAoB,cAAc,aAAa,OAAO,gBAAgB,QAAQ,cAAc,iBAAiB,EAAE;AAAA,IAC3J,OAAS,EAAE,MAAQ,UAAU,WAAa,EAAE;AAAA,IAC5C,QAAU,EAAE,MAAQ,UAAU,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Q,wBAAqB;EACrD,cAAc,IAAI,QAAQ,kBAAe;EACzC,aAAa,IAAI,QAAQ,iBAAc;EACvC,KAAK,IAAI,QAAQ,WAAS;EAC1B,gBAAgB,IAAI,QAAQ,oBAAiB;EAC7C,MAAM,IAAI,QAAQ,YAAU;EAC5B,cAAc,IAAI,QAAQ,kBAAe;EACzC,mBAAmB,IAAI,QAAQ,uBAAoB;;AAGrD,IAAM,kBAAkB,IAAI,QAAQ,cAAY;AAE1C,SAAU,aAAa,MAAgB,MAA6B;AACxE,QAAM,WAAW,eAAe,IAAI;AACpC,MAAI,CAAC,UAAU;AACb,WAAO,EAAE,OAAO,OAAO,QAAQ,CAAC,EAAE,SAAS,uBAAuB,IAAI,IAAG,CAAiB,EAAC;EAC7F;AACA,QAAM,QAAQ,SAAS,IAAI;AAC3B,SAAO,EAAE,OAAO,CAAC,CAAC,OAAO,QAAQ,QAAQ,OAAQ,SAAS,UAAU,KAAK;AAC3E;AAEM,SAAU,eAAe,MAA6B;AAC1D,QAAM,QAAQ,gBAAgB,IAAI;AAClC,SAAO,EAAE,OAAO,CAAC,CAAC,OAAO,QAAQ,QAAQ,OAAQ,gBAAgB,UAAU,KAAK;AAClF;","names":[]}
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
DEFAULT_DIFF_CONFIG,
|
|
3
3
|
DiffError,
|
|
4
4
|
diffBetweenRefs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DDFLMRPC.js";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-PHR7AV6I.js";
|
|
9
|
+
import "./chunk-ZX4HVL5M.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/diff.ts
|
|
12
12
|
import { defineCommand } from "citty";
|
|
@@ -97,4 +97,4 @@ export {
|
|
|
97
97
|
diff_default as default,
|
|
98
98
|
runDiff
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=diff-
|
|
100
|
+
//# sourceMappingURL=diff-275PLXYH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runCheck
|
|
3
|
+
} from "./chunk-6BWZEAST.js";
|
|
4
|
+
import {
|
|
5
|
+
pack
|
|
6
|
+
} from "./chunk-4THCEWAK.js";
|
|
7
|
+
import {
|
|
8
|
+
createLintEngine,
|
|
9
|
+
getPreset
|
|
10
|
+
} from "./chunk-HMXUNURD.js";
|
|
11
|
+
import {
|
|
12
|
+
DEFAULT_DIFF_CONFIG,
|
|
13
|
+
DiffError,
|
|
14
|
+
diffBetweenRefs
|
|
15
|
+
} from "./chunk-DDFLMRPC.js";
|
|
16
|
+
import {
|
|
17
|
+
ConfigError,
|
|
18
|
+
GraphError,
|
|
19
|
+
buildGraph,
|
|
20
|
+
loadConfig,
|
|
21
|
+
parseSpec,
|
|
22
|
+
resolveGlob
|
|
23
|
+
} from "./chunk-PHR7AV6I.js";
|
|
24
|
+
import "./chunk-ZX4HVL5M.js";
|
|
25
|
+
|
|
26
|
+
// ../mcp/dist/server.js
|
|
27
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
28
|
+
import { z } from "zod";
|
|
29
|
+
|
|
30
|
+
// ../mcp/dist/tools/validate.js
|
|
31
|
+
async function handleValidate(params) {
|
|
32
|
+
try {
|
|
33
|
+
const configDir = params.configPath ?? process.cwd();
|
|
34
|
+
const config = await loadConfig(void 0, configDir);
|
|
35
|
+
return JSON.stringify({
|
|
36
|
+
valid: true,
|
|
37
|
+
specCount: Object.keys(config.specs).length,
|
|
38
|
+
project: config.project?.name ?? "unknown"
|
|
39
|
+
});
|
|
40
|
+
} catch (err) {
|
|
41
|
+
if (err instanceof ConfigError) {
|
|
42
|
+
return JSON.stringify({ valid: false, error: err.message, details: err.errors });
|
|
43
|
+
}
|
|
44
|
+
throw err;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ../mcp/dist/tools/lint.js
|
|
49
|
+
async function handleLint(params) {
|
|
50
|
+
const configDir = process.cwd();
|
|
51
|
+
const config = await loadConfig(void 0, configDir);
|
|
52
|
+
const preset = params.preset ?? config.lint?.extends ?? "recommended";
|
|
53
|
+
const rules = getPreset(preset);
|
|
54
|
+
const specs = [];
|
|
55
|
+
for (const [, entry] of Object.entries(config.specs)) {
|
|
56
|
+
const files = await resolveGlob(entry.path, configDir);
|
|
57
|
+
for (const file of files) {
|
|
58
|
+
if (params.specPath && !file.includes(params.specPath))
|
|
59
|
+
continue;
|
|
60
|
+
specs.push(await parseSpec(file));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
let graph;
|
|
64
|
+
try {
|
|
65
|
+
graph = buildGraph(config);
|
|
66
|
+
} catch {
|
|
67
|
+
}
|
|
68
|
+
const engine = createLintEngine({ rules, config, graph });
|
|
69
|
+
const results = engine.lint(specs);
|
|
70
|
+
return JSON.stringify({
|
|
71
|
+
diagnostics: results.diagnostics,
|
|
72
|
+
hasErrors: results.hasErrors,
|
|
73
|
+
hasWarnings: results.hasWarnings,
|
|
74
|
+
specsChecked: specs.length
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ../mcp/dist/tools/pack.js
|
|
79
|
+
async function handlePack(params) {
|
|
80
|
+
const configDir = process.cwd();
|
|
81
|
+
const config = await loadConfig(void 0, configDir);
|
|
82
|
+
const allSpecs = [];
|
|
83
|
+
for (const [, entry] of Object.entries(config.specs)) {
|
|
84
|
+
const files = await resolveGlob(entry.path, configDir);
|
|
85
|
+
for (const file of files) {
|
|
86
|
+
allSpecs.push(await parseSpec(file));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
let graph;
|
|
90
|
+
try {
|
|
91
|
+
graph = buildGraph(config);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
const result = pack(allSpecs, {
|
|
95
|
+
task: params.task,
|
|
96
|
+
budget: params.budget,
|
|
97
|
+
format: params.format ?? void 0
|
|
98
|
+
}, config.pack, graph);
|
|
99
|
+
return result.output;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ../mcp/dist/tools/status.js
|
|
103
|
+
async function handleStatus() {
|
|
104
|
+
const configDir = process.cwd();
|
|
105
|
+
const config = await loadConfig(void 0, configDir);
|
|
106
|
+
const specs = [];
|
|
107
|
+
for (const [, entry] of Object.entries(config.specs)) {
|
|
108
|
+
const paths = await resolveGlob(entry.path, configDir);
|
|
109
|
+
for (const p of paths) {
|
|
110
|
+
const spec = await parseSpec(p);
|
|
111
|
+
specs.push({ spec, entry });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const byStatus = {};
|
|
115
|
+
for (const { spec } of specs) {
|
|
116
|
+
const status = spec.frontmatter.status || "unknown";
|
|
117
|
+
byStatus[status] = (byStatus[status] ?? 0) + 1;
|
|
118
|
+
}
|
|
119
|
+
const presetName = config.lint?.extends ?? "recommended";
|
|
120
|
+
const rules = getPreset(presetName);
|
|
121
|
+
let graph;
|
|
122
|
+
let graphError;
|
|
123
|
+
try {
|
|
124
|
+
graph = buildGraph(config);
|
|
125
|
+
} catch (err) {
|
|
126
|
+
graphError = err.message;
|
|
127
|
+
}
|
|
128
|
+
const engine = createLintEngine({ rules, config, graph });
|
|
129
|
+
const lintResults = engine.lint(specs.map((s) => s.spec));
|
|
130
|
+
const errors = lintResults.diagnostics.filter((d) => d.severity === "error").length;
|
|
131
|
+
const warnings = lintResults.diagnostics.filter((d) => d.severity === "warn").length;
|
|
132
|
+
const thresholdDays = config.diff?.staleness_threshold_days ?? DEFAULT_DIFF_CONFIG.staleness_threshold_days;
|
|
133
|
+
const now = Date.now();
|
|
134
|
+
const staleSpecs = [];
|
|
135
|
+
for (const { spec, entry } of specs) {
|
|
136
|
+
const dateStr = spec.frontmatter.updated || spec.frontmatter.created;
|
|
137
|
+
if (dateStr) {
|
|
138
|
+
const days = Math.floor((now - new Date(dateStr).getTime()) / (1e3 * 60 * 60 * 24));
|
|
139
|
+
if (days > thresholdDays) {
|
|
140
|
+
staleSpecs.push({
|
|
141
|
+
specId: spec.frontmatter.id,
|
|
142
|
+
daysSinceUpdate: days,
|
|
143
|
+
owner: entry.owner
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let verdict = "healthy";
|
|
149
|
+
if (errors > 0 || graphError)
|
|
150
|
+
verdict = "errors";
|
|
151
|
+
else if (warnings > 0 || staleSpecs.length > 0)
|
|
152
|
+
verdict = "warnings";
|
|
153
|
+
return JSON.stringify({
|
|
154
|
+
project: config.project?.name ?? "unknown",
|
|
155
|
+
specCount: specs.length,
|
|
156
|
+
byStatus,
|
|
157
|
+
lintHealth: { errors, warnings, passing: specs.length - errors },
|
|
158
|
+
staleSpecs,
|
|
159
|
+
integrityIssues: graphError ? [graphError] : [],
|
|
160
|
+
verdict
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ../mcp/dist/tools/check.js
|
|
165
|
+
async function handleCheck(params) {
|
|
166
|
+
const configDir = process.cwd();
|
|
167
|
+
const config = await loadConfig(void 0, configDir);
|
|
168
|
+
const specs = [];
|
|
169
|
+
for (const [, entry] of Object.entries(config.specs)) {
|
|
170
|
+
const paths = await resolveGlob(entry.path, configDir);
|
|
171
|
+
for (const p of paths) {
|
|
172
|
+
const spec = await parseSpec(p);
|
|
173
|
+
if (params.specId && spec.frontmatter.id !== params.specId)
|
|
174
|
+
continue;
|
|
175
|
+
specs.push(spec);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const checkConfig = {
|
|
179
|
+
...config.check,
|
|
180
|
+
...params.framework ? { framework: params.framework } : {}
|
|
181
|
+
};
|
|
182
|
+
const result = await runCheck(specs, configDir, checkConfig);
|
|
183
|
+
return JSON.stringify(result);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// ../mcp/dist/tools/diff.js
|
|
187
|
+
import { join } from "path";
|
|
188
|
+
async function handleDiff(params) {
|
|
189
|
+
const configDir = process.cwd();
|
|
190
|
+
const config = await loadConfig(void 0, configDir);
|
|
191
|
+
const baseRef = params.base ?? config.diff?.baseline_ref ?? DEFAULT_DIFF_CONFIG.baseline_ref;
|
|
192
|
+
const headRef = params.head ?? "HEAD";
|
|
193
|
+
const configPath = join(configDir, "spec.config.yaml");
|
|
194
|
+
try {
|
|
195
|
+
const result = await diffBetweenRefs(configPath, baseRef, headRef);
|
|
196
|
+
return JSON.stringify(result);
|
|
197
|
+
} catch (err) {
|
|
198
|
+
if (err instanceof DiffError) {
|
|
199
|
+
return JSON.stringify({ error: err.message });
|
|
200
|
+
}
|
|
201
|
+
throw err;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ../mcp/dist/tools/graph.js
|
|
206
|
+
async function handleGraph(params) {
|
|
207
|
+
const configDir = process.cwd();
|
|
208
|
+
const config = await loadConfig(void 0, configDir);
|
|
209
|
+
try {
|
|
210
|
+
const graph = buildGraph(config);
|
|
211
|
+
const sorted = graph.topologicalSort();
|
|
212
|
+
if (params.format === "dot") {
|
|
213
|
+
const lines = ["digraph specs {"];
|
|
214
|
+
for (const edge of graph.edges)
|
|
215
|
+
lines.push(` "${edge.from}" -> "${edge.to}";`);
|
|
216
|
+
lines.push("}");
|
|
217
|
+
return lines.join("\n");
|
|
218
|
+
}
|
|
219
|
+
return JSON.stringify({
|
|
220
|
+
nodes: sorted,
|
|
221
|
+
edges: graph.edges,
|
|
222
|
+
downstream: Object.fromEntries(sorted.map((n) => [n, graph.getDownstream(n)]))
|
|
223
|
+
});
|
|
224
|
+
} catch (err) {
|
|
225
|
+
if (err instanceof GraphError) {
|
|
226
|
+
return JSON.stringify({ error: err.message });
|
|
227
|
+
}
|
|
228
|
+
throw err;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// ../mcp/dist/server.js
|
|
233
|
+
function createMcpServer() {
|
|
234
|
+
const server = new McpServer({
|
|
235
|
+
name: "specdx",
|
|
236
|
+
version: "0.3.0"
|
|
237
|
+
});
|
|
238
|
+
server.tool("sdx_validate", "Validate the spec.config.yaml configuration file", { configPath: z.string().optional().describe("Path to config directory") }, async (params) => ({
|
|
239
|
+
content: [{ type: "text", text: await handleValidate(params) }]
|
|
240
|
+
}));
|
|
241
|
+
server.tool("sdx_lint", "Run lint rules against the spec suite", {
|
|
242
|
+
preset: z.string().optional().describe("Lint preset: minimal, recommended, strict"),
|
|
243
|
+
specPath: z.string().optional().describe("Lint a specific spec file")
|
|
244
|
+
}, async (params) => ({
|
|
245
|
+
content: [{ type: "text", text: await handleLint(params) }]
|
|
246
|
+
}));
|
|
247
|
+
server.tool("sdx_pack", "Pack spec context for LLM consumption within a token budget", {
|
|
248
|
+
task: z.string().optional().describe("Task description for relevance scoring"),
|
|
249
|
+
format: z.string().optional().describe("Output format: xml, markdown, json"),
|
|
250
|
+
budget: z.number().optional().describe("Token budget (default: 12000)")
|
|
251
|
+
}, async (params) => ({
|
|
252
|
+
content: [{ type: "text", text: await handlePack(params) }]
|
|
253
|
+
}));
|
|
254
|
+
server.tool("sdx_status", "Get spec suite health overview (lint health, staleness, integrity)", {}, async () => ({
|
|
255
|
+
content: [{ type: "text", text: await handleStatus() }]
|
|
256
|
+
}));
|
|
257
|
+
server.tool("sdx_check", "Run spec-to-implementation drift analysis", {
|
|
258
|
+
framework: z.string().optional().describe("Framework: express, hono, nextjs"),
|
|
259
|
+
specId: z.string().optional().describe("Check a specific spec by ID")
|
|
260
|
+
}, async (params) => ({
|
|
261
|
+
content: [{ type: "text", text: await handleCheck(params) }]
|
|
262
|
+
}));
|
|
263
|
+
server.tool("sdx_diff", "Show spec changes and downstream impact between git refs", {
|
|
264
|
+
base: z.string().optional().describe("Base git ref (default: main)"),
|
|
265
|
+
head: z.string().optional().describe("Head git ref (default: HEAD)")
|
|
266
|
+
}, async (params) => ({
|
|
267
|
+
content: [{ type: "text", text: await handleDiff(params) }]
|
|
268
|
+
}));
|
|
269
|
+
server.tool("sdx_graph", "Get the spec dependency graph", {
|
|
270
|
+
format: z.string().optional().describe("Output format: json (default) or dot")
|
|
271
|
+
}, async (params) => ({
|
|
272
|
+
content: [{ type: "text", text: await handleGraph(params) }]
|
|
273
|
+
}));
|
|
274
|
+
return server;
|
|
275
|
+
}
|
|
276
|
+
export {
|
|
277
|
+
createMcpServer
|
|
278
|
+
};
|
|
279
|
+
//# sourceMappingURL=dist-QXLX77XG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../mcp/src/server.ts","../../mcp/src/tools/validate.ts","../../mcp/src/tools/lint.ts","../../mcp/src/tools/pack.ts","../../mcp/src/tools/status.ts","../../mcp/src/tools/check.ts","../../mcp/src/tools/diff.ts","../../mcp/src/tools/graph.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\nimport { handleValidate } from \"./tools/validate.js\";\nimport { handleLint } from \"./tools/lint.js\";\nimport { handlePack } from \"./tools/pack.js\";\nimport { handleStatus } from \"./tools/status.js\";\nimport { handleCheck } from \"./tools/check.js\";\nimport { handleDiff } from \"./tools/diff.js\";\nimport { handleGraph } from \"./tools/graph.js\";\n\nexport function createMcpServer(): McpServer {\n const server = new McpServer({\n name: \"specdx\",\n version: \"0.3.0\",\n });\n\n server.tool(\n \"sdx_validate\",\n \"Validate the spec.config.yaml configuration file\",\n { configPath: z.string().optional().describe(\"Path to config directory\") },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleValidate(params) }],\n }),\n );\n\n server.tool(\n \"sdx_lint\",\n \"Run lint rules against the spec suite\",\n {\n preset: z.string().optional().describe(\"Lint preset: minimal, recommended, strict\"),\n specPath: z.string().optional().describe(\"Lint a specific spec file\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleLint(params) }],\n }),\n );\n\n server.tool(\n \"sdx_pack\",\n \"Pack spec context for LLM consumption within a token budget\",\n {\n task: z.string().optional().describe(\"Task description for relevance scoring\"),\n format: z.string().optional().describe(\"Output format: xml, markdown, json\"),\n budget: z.number().optional().describe(\"Token budget (default: 12000)\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handlePack(params) }],\n }),\n );\n\n server.tool(\n \"sdx_status\",\n \"Get spec suite health overview (lint health, staleness, integrity)\",\n {},\n async () => ({\n content: [{ type: \"text\" as const, text: await handleStatus() }],\n }),\n );\n\n server.tool(\n \"sdx_check\",\n \"Run spec-to-implementation drift analysis\",\n {\n framework: z.string().optional().describe(\"Framework: express, hono, nextjs\"),\n specId: z.string().optional().describe(\"Check a specific spec by ID\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleCheck(params) }],\n }),\n );\n\n server.tool(\n \"sdx_diff\",\n \"Show spec changes and downstream impact between git refs\",\n {\n base: z.string().optional().describe(\"Base git ref (default: main)\"),\n head: z.string().optional().describe(\"Head git ref (default: HEAD)\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleDiff(params) }],\n }),\n );\n\n server.tool(\n \"sdx_graph\",\n \"Get the spec dependency graph\",\n {\n format: z.string().optional().describe(\"Output format: json (default) or dot\"),\n },\n async (params) => ({\n content: [{ type: \"text\" as const, text: await handleGraph(params) }],\n }),\n );\n\n return server;\n}\n","import { loadConfig, ConfigError } from \"@specdx/core\";\n\nexport async function handleValidate(params: { configPath?: string }): Promise<string> {\n try {\n const configDir = params.configPath ?? process.cwd();\n const config = await loadConfig(undefined, configDir);\n return JSON.stringify({\n valid: true,\n specCount: Object.keys(config.specs).length,\n project: config.project?.name ?? \"unknown\",\n });\n } catch (err) {\n if (err instanceof ConfigError) {\n return JSON.stringify({ valid: false, error: err.message, details: err.errors });\n }\n throw err;\n }\n}\n","import { loadConfig, parseSpec, resolveGlob, buildGraph } from \"@specdx/core\";\nimport { createLintEngine, getPreset } from \"@specdx/lint\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handleLint(params: { preset?: string; specPath?: string }): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n const preset = params.preset ?? config.lint?.extends ?? \"recommended\";\n const rules = getPreset(preset);\n\n const specs: ParsedSpec[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const files = await resolveGlob(entry.path, configDir);\n for (const file of files) {\n if (params.specPath && !file.includes(params.specPath)) continue;\n specs.push(await parseSpec(file));\n }\n }\n\n let graph;\n try {\n graph = buildGraph(config);\n } catch {\n // non-fatal\n }\n\n const engine = createLintEngine({ rules, config, graph });\n const results = engine.lint(specs);\n\n return JSON.stringify({\n diagnostics: results.diagnostics,\n hasErrors: results.hasErrors,\n hasWarnings: results.hasWarnings,\n specsChecked: specs.length,\n });\n}\n","import { loadConfig, parseSpec, resolveGlob, buildGraph } from \"@specdx/core\";\nimport { pack } from \"@specdx/pack\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handlePack(params: {\n task?: string;\n format?: string;\n budget?: number;\n}): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n const allSpecs: ParsedSpec[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const files = await resolveGlob(entry.path, configDir);\n for (const file of files) {\n allSpecs.push(await parseSpec(file));\n }\n }\n\n let graph;\n try {\n graph = buildGraph(config);\n } catch {\n // non-fatal\n }\n\n const result = pack(\n allSpecs,\n {\n task: params.task,\n budget: params.budget,\n format: (params.format as \"xml\" | \"markdown\" | \"json\") ?? undefined,\n },\n config.pack,\n graph,\n );\n\n return result.output;\n}\n","import { loadConfig, parseSpec, resolveGlob, buildGraph } from \"@specdx/core\";\nimport { createLintEngine, getPreset } from \"@specdx/lint\";\nimport { DEFAULT_DIFF_CONFIG } from \"@specdx/diff\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handleStatus(): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n const specs: { spec: ParsedSpec; entry: { path: string; owner?: string } }[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const paths = await resolveGlob(entry.path, configDir);\n for (const p of paths) {\n const spec = await parseSpec(p);\n specs.push({ spec, entry: entry as { path: string; owner?: string } });\n }\n }\n\n const byStatus: Record<string, number> = {};\n for (const { spec } of specs) {\n const status = (spec.frontmatter.status as string) || \"unknown\";\n byStatus[status] = (byStatus[status] ?? 0) + 1;\n }\n\n const presetName = config.lint?.extends ?? \"recommended\";\n const rules = getPreset(presetName);\n\n let graph;\n let graphError: string | undefined;\n try {\n graph = buildGraph(config);\n } catch (err) {\n graphError = (err as Error).message;\n }\n\n const engine = createLintEngine({ rules, config, graph });\n const lintResults = engine.lint(specs.map((s) => s.spec));\n\n const errors = lintResults.diagnostics.filter((d) => d.severity === \"error\").length;\n const warnings = lintResults.diagnostics.filter((d) => d.severity === \"warn\").length;\n\n const thresholdDays =\n config.diff?.staleness_threshold_days ?? DEFAULT_DIFF_CONFIG.staleness_threshold_days;\n const now = Date.now();\n const staleSpecs: { specId: string; daysSinceUpdate: number; owner?: string }[] = [];\n for (const { spec, entry } of specs) {\n const dateStr =\n (spec.frontmatter.updated as string | undefined) ||\n (spec.frontmatter.created as string | undefined);\n if (dateStr) {\n const days = Math.floor((now - new Date(dateStr).getTime()) / (1000 * 60 * 60 * 24));\n if (days > thresholdDays) {\n staleSpecs.push({\n specId: spec.frontmatter.id as string,\n daysSinceUpdate: days,\n owner: entry.owner,\n });\n }\n }\n }\n\n let verdict: \"healthy\" | \"warnings\" | \"errors\" = \"healthy\";\n if (errors > 0 || graphError) verdict = \"errors\";\n else if (warnings > 0 || staleSpecs.length > 0) verdict = \"warnings\";\n\n return JSON.stringify({\n project: config.project?.name ?? \"unknown\",\n specCount: specs.length,\n byStatus,\n lintHealth: { errors, warnings, passing: specs.length - errors },\n staleSpecs,\n integrityIssues: graphError ? [graphError] : [],\n verdict,\n });\n}\n","import { loadConfig, parseSpec, resolveGlob } from \"@specdx/core\";\nimport { runCheck } from \"@specdx/check\";\nimport type { ParsedSpec } from \"@specdx/core\";\n\nexport async function handleCheck(params: {\n framework?: string;\n specId?: string;\n}): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n const specs: ParsedSpec[] = [];\n for (const [, entry] of Object.entries(config.specs)) {\n const paths = await resolveGlob(entry.path, configDir);\n for (const p of paths) {\n const spec = await parseSpec(p);\n if (params.specId && spec.frontmatter.id !== params.specId) continue;\n specs.push(spec);\n }\n }\n\n const checkConfig = {\n ...config.check,\n ...(params.framework\n ? { framework: params.framework as \"express\" | \"hono\" | \"nextjs\" }\n : {}),\n };\n\n const result = await runCheck(specs, configDir, checkConfig);\n return JSON.stringify(result);\n}\n","import { join } from \"node:path\";\nimport { loadConfig } from \"@specdx/core\";\nimport { diffBetweenRefs, DEFAULT_DIFF_CONFIG, DiffError } from \"@specdx/diff\";\n\nexport async function handleDiff(params: { base?: string; head?: string }): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n const baseRef = params.base ?? config.diff?.baseline_ref ?? DEFAULT_DIFF_CONFIG.baseline_ref;\n const headRef = params.head ?? \"HEAD\";\n const configPath = join(configDir, \"spec.config.yaml\");\n\n try {\n const result = await diffBetweenRefs(configPath, baseRef, headRef);\n return JSON.stringify(result);\n } catch (err) {\n if (err instanceof DiffError) {\n return JSON.stringify({ error: err.message });\n }\n throw err;\n }\n}\n","import { loadConfig, buildGraph, GraphError } from \"@specdx/core\";\n\nexport async function handleGraph(params: { format?: string }): Promise<string> {\n const configDir = process.cwd();\n const config = await loadConfig(undefined, configDir);\n\n try {\n const graph = buildGraph(config);\n const sorted = graph.topologicalSort();\n\n if (params.format === \"dot\") {\n const lines = [\"digraph specs {\"];\n for (const edge of graph.edges) lines.push(` \"${edge.from}\" -> \"${edge.to}\";`);\n lines.push(\"}\");\n return lines.join(\"\\n\");\n }\n\n return JSON.stringify({\n nodes: sorted,\n edges: graph.edges,\n downstream: Object.fromEntries(sorted.map((n) => [n, graph.getDownstream(n)])),\n });\n } catch (err) {\n if (err instanceof GraphError) {\n return JSON.stringify({ error: err.message });\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,SAAS;;;ACClB,eAAsB,eAAe,QAA+B;AAClE,MAAI;AACF,UAAM,YAAY,OAAO,cAAc,QAAQ,IAAG;AAClD,UAAM,SAAS,MAAM,WAAW,QAAW,SAAS;AACpD,WAAO,KAAK,UAAU;MACpB,OAAO;MACP,WAAW,OAAO,KAAK,OAAO,KAAK,EAAE;MACrC,SAAS,OAAO,SAAS,QAAQ;KAClC;EACH,SAAS,KAAK;AACZ,QAAI,eAAe,aAAa;AAC9B,aAAO,KAAK,UAAU,EAAE,OAAO,OAAO,OAAO,IAAI,SAAS,SAAS,IAAI,OAAM,CAAE;IACjF;AACA,UAAM;EACR;AACF;;;ACbA,eAAsB,WAAW,QAA8C;AAC7E,QAAM,YAAY,QAAQ,IAAG;AAC7B,QAAM,SAAS,MAAM,WAAW,QAAW,SAAS;AACpD,QAAM,SAAS,OAAO,UAAU,OAAO,MAAM,WAAW;AACxD,QAAM,QAAQ,UAAU,MAAM;AAE9B,QAAM,QAAsB,CAAA;AAC5B,aAAW,CAAC,EAAE,KAAK,KAAK,OAAO,QAAQ,OAAO,KAAK,GAAG;AACpD,UAAM,QAAQ,MAAM,YAAY,MAAM,MAAM,SAAS;AACrD,eAAW,QAAQ,OAAO;AACxB,UAAI,OAAO,YAAY,CAAC,KAAK,SAAS,OAAO,QAAQ;AAAG;AACxD,YAAM,KAAK,MAAM,UAAU,IAAI,CAAC;IAClC;EACF;AAEA,MAAI;AACJ,MAAI;AACF,YAAQ,WAAW,MAAM;EAC3B,QAAQ;EAER;AAEA,QAAM,SAAS,iBAAiB,EAAE,OAAO,QAAQ,MAAK,CAAE;A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,cACA,sEACA,CAAA,GACA,aAAa;IACX,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,MAAM,aAAY,EAAE,CAAE;IAC/D;AAGJ,SAAO,KACL,aACA,6CACA;IACE,WAAW,EAAE,OAAM,EAAG,SAAQ,EAAG,SAAS,kCAAkC;IAC5E,QAAQ,EAAE,OAAM,EAAG,SAAQ,EAAG,SAAS,6BAA6B;KAEtE,OAAO,YAAY;IACjB,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,MAAM,YAAY,MAAM,EAAC,CAAE;IACpE;AAGJ,SAAO,KACL,YACA,4DACA;IACE,MAAM,EAAE,OAAM,EAAG,SAAQ,EAAG,SAAS,8BAA8B;IACnE,MAAM,EAAE,OAAM,EAAG,SAAQ,EAAG,SAAS,8BAA8B;KAErE,OAAO,YAAY;IACjB,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,MAAM,WAAW,MAAM,EAAC,CAAE;IACnE;AAGJ,SAAO,KACL,aACA,iCACA;IACE,QAAQ,EAAE,OAAM,EAAG,SAAQ,EAAG,SAAS,sCAAsC;KAE/E,OAAO,YAAY;IACjB,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,MAAM,YAAY,MAAM,EAAC,CAAE;IACpE;AAGJ,SAAO;AACT;","names":[]}
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
loadConfig,
|
|
4
4
|
parseSpec,
|
|
5
5
|
resolveGlob
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-PHR7AV6I.js";
|
|
7
|
+
import "./chunk-ZX4HVL5M.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/explain.ts
|
|
10
10
|
import { defineCommand } from "citty";
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
explain_default as default,
|
|
100
100
|
runExplain
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=explain-
|
|
102
|
+
//# sourceMappingURL=explain-I7AQMEEH.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/commands/generate.ts
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
var generate_default = defineCommand({
|
|
4
|
+
meta: { name: "generate", description: "Generate spec stubs from existing specs" },
|
|
5
|
+
subCommands: {
|
|
6
|
+
story: () => import("./generate-story-7WHPPFHY.js").then((m) => m.default),
|
|
7
|
+
"test-plan": () => import("./generate-test-plan-U5LMWGKX.js").then((m) => m.default)
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
generate_default as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=generate-PC7BIB7G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\n\nexport default defineCommand({\n meta: { name: \"generate\", description: \"Generate spec stubs from existing specs\" },\n subCommands: {\n story: () => import(\"./generate-story.js\").then((m) => m.default),\n \"test-plan\": () => import(\"./generate-test-plan.js\").then((m) => m.default),\n },\n});\n"],"mappings":";AAAA,SAAS,qBAAqB;AAE9B,IAAO,mBAAQ,cAAc;AAAA,EAC3B,MAAM,EAAE,MAAM,YAAY,aAAa,0CAA0C;AAAA,EACjF,aAAa;AAAA,IACX,OAAO,MAAM,OAAO,8BAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAChE,aAAa,MAAM,OAAO,kCAAyB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EAC5E;AACF,CAAC;","names":[]}
|