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.
Files changed (64) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/{changelog-URU2TFNM.js → changelog-OUP2RXWN.js} +4 -4
  3. package/dist/check-3XQYO3HU.js +109 -0
  4. package/dist/check-3XQYO3HU.js.map +1 -0
  5. package/dist/{pack-OJAC7JF2.js → chunk-4THCEWAK.js} +53 -169
  6. package/dist/chunk-4THCEWAK.js.map +1 -0
  7. package/dist/chunk-6BWZEAST.js +1051 -0
  8. package/dist/chunk-6BWZEAST.js.map +1 -0
  9. package/dist/{chunk-LU6M5O63.js → chunk-DDFLMRPC.js} +2 -2
  10. package/dist/chunk-HMXUNURD.js +490 -0
  11. package/dist/chunk-HMXUNURD.js.map +1 -0
  12. package/dist/{chunk-276J7LR6.js → chunk-PHR7AV6I.js} +2 -2
  13. package/dist/{chunk-XLEN6ZYM.js → chunk-ZX4HVL5M.js} +92 -4
  14. package/dist/chunk-ZX4HVL5M.js.map +1 -0
  15. package/dist/{diff-55PTEVB3.js → diff-275PLXYH.js} +4 -4
  16. package/dist/dist-PQCG2XXF.js +11 -0
  17. package/dist/dist-PQCG2XXF.js.map +1 -0
  18. package/dist/dist-QXLX77XG.js +279 -0
  19. package/dist/dist-QXLX77XG.js.map +1 -0
  20. package/dist/{explain-YXUILNEA.js → explain-I7AQMEEH.js} +3 -3
  21. package/dist/generate-PC7BIB7G.js +13 -0
  22. package/dist/generate-PC7BIB7G.js.map +1 -0
  23. package/dist/generate-story-7WHPPFHY.js +192 -0
  24. package/dist/generate-story-7WHPPFHY.js.map +1 -0
  25. package/dist/generate-test-plan-U5LMWGKX.js +154 -0
  26. package/dist/generate-test-plan-U5LMWGKX.js.map +1 -0
  27. package/dist/{graph-OWQJWVSN.js → graph-RCAPF55A.js} +3 -3
  28. package/dist/index.js +390 -16
  29. package/dist/index.js.map +1 -1
  30. package/dist/{lint-U7VLGS75.js → lint-XPAFMLZN.js} +4 -4
  31. package/dist/main.js +23 -14
  32. package/dist/main.js.map +1 -1
  33. package/dist/mcp-6RCSHMXD.js +17 -0
  34. package/dist/mcp-6RCSHMXD.js.map +1 -0
  35. package/dist/migrate-L7W5RHSS.js +56 -0
  36. package/dist/migrate-L7W5RHSS.js.map +1 -0
  37. package/dist/pack-QCOXMURY.js +167 -0
  38. package/dist/pack-QCOXMURY.js.map +1 -0
  39. package/dist/{ready-3OIF4QHM.js → ready-ZXG74W7Y.js} +5 -5
  40. package/dist/skills/specdx-check-drift.md +71 -0
  41. package/dist/skills/specdx-review-spec.md +77 -0
  42. package/dist/skills/specdx-verify.md +70 -0
  43. package/dist/{skills-XJYTWGDK.js → skills-3GBBWZW2.js} +5 -2
  44. package/dist/skills-3GBBWZW2.js.map +1 -0
  45. package/dist/{status-LYZUO6AJ.js → status-EKWK47O5.js} +5 -5
  46. package/dist/update-HIWDDEZQ.js +132 -0
  47. package/dist/update-HIWDDEZQ.js.map +1 -0
  48. package/dist/{validate-DOZZEZFC.js → validate-N2WSG75W.js} +3 -3
  49. package/package.json +3 -1
  50. package/dist/chunk-ATLVRGHI.js +0 -237
  51. package/dist/chunk-ATLVRGHI.js.map +0 -1
  52. package/dist/chunk-XLEN6ZYM.js.map +0 -1
  53. package/dist/pack-OJAC7JF2.js.map +0 -1
  54. package/dist/skills-XJYTWGDK.js.map +0 -1
  55. /package/dist/{changelog-URU2TFNM.js.map → changelog-OUP2RXWN.js.map} +0 -0
  56. /package/dist/{chunk-LU6M5O63.js.map → chunk-DDFLMRPC.js.map} +0 -0
  57. /package/dist/{chunk-276J7LR6.js.map → chunk-PHR7AV6I.js.map} +0 -0
  58. /package/dist/{diff-55PTEVB3.js.map → diff-275PLXYH.js.map} +0 -0
  59. /package/dist/{explain-YXUILNEA.js.map → explain-I7AQMEEH.js.map} +0 -0
  60. /package/dist/{graph-OWQJWVSN.js.map → graph-RCAPF55A.js.map} +0 -0
  61. /package/dist/{lint-U7VLGS75.js.map → lint-XPAFMLZN.js.map} +0 -0
  62. /package/dist/{ready-3OIF4QHM.js.map → ready-ZXG74W7Y.js.map} +0 -0
  63. /package/dist/{status-LYZUO6AJ.js.map → status-EKWK47O5.js.map} +0 -0
  64. /package/dist/{validate-DOZZEZFC.js.map → validate-N2WSG75W.js.map} +0 -0
@@ -0,0 +1,490 @@
1
+ import {
2
+ REQUIRED_SECTIONS
3
+ } from "./chunk-ZX4HVL5M.js";
4
+
5
+ // ../lint/dist/engine.js
6
+ function createLintEngine(options) {
7
+ return {
8
+ lint(specs) {
9
+ const diagnostics = [];
10
+ for (const spec of specs) {
11
+ for (const rule of options.rules) {
12
+ const results = rule.run({
13
+ spec,
14
+ allSpecs: specs,
15
+ config: options.config,
16
+ graph: options.graph
17
+ });
18
+ diagnostics.push(...results);
19
+ }
20
+ }
21
+ return {
22
+ diagnostics,
23
+ hasErrors: diagnostics.some((d) => d.severity === "error"),
24
+ hasWarnings: diagnostics.some((d) => d.severity === "warn")
25
+ };
26
+ }
27
+ };
28
+ }
29
+
30
+ // ../lint/dist/rules/valid-frontmatter.js
31
+ var validFrontmatterRule = {
32
+ id: "structure/valid-frontmatter",
33
+ description: "Frontmatter matches the schema for the declared spec type",
34
+ severity: "error",
35
+ run(context) {
36
+ if (context.spec.valid)
37
+ return [];
38
+ const errors = context.spec.validationErrors ?? [];
39
+ return errors.map((err) => ({
40
+ ruleId: "structure/valid-frontmatter",
41
+ severity: "error",
42
+ message: `Invalid frontmatter: ${err.message ?? JSON.stringify(err)}`,
43
+ filePath: context.spec.filePath
44
+ }));
45
+ }
46
+ };
47
+
48
+ // ../lint/dist/rules/required-sections.js
49
+ var requiredSectionsRule = {
50
+ id: "structure/required-sections",
51
+ description: "Spec body contains all required sections for its type",
52
+ severity: "error",
53
+ run(context) {
54
+ const ext = context.spec.filePath.split(".").pop()?.toLowerCase();
55
+ if (ext === "yaml" || ext === "yml")
56
+ return [];
57
+ const specType = context.spec.frontmatter.type;
58
+ const required = REQUIRED_SECTIONS[specType];
59
+ if (!required)
60
+ return [];
61
+ const missing = required.filter((s) => !context.spec.sections.includes(s));
62
+ return missing.map((section) => ({
63
+ ruleId: "structure/required-sections",
64
+ severity: "error",
65
+ message: `Missing required section: "${section}"`,
66
+ filePath: context.spec.filePath,
67
+ section
68
+ }));
69
+ }
70
+ };
71
+
72
+ // ../lint/dist/rules/valid-references.js
73
+ var validReferencesRule = {
74
+ id: "structure/valid-references",
75
+ description: "All references in frontmatter point to specs that exist in the suite",
76
+ severity: "error",
77
+ run(context) {
78
+ const refs = context.spec.frontmatter.references;
79
+ if (!refs || refs.length === 0)
80
+ return [];
81
+ const allIds = new Set(context.allSpecs.map((s) => s.frontmatter.id));
82
+ return refs.filter((ref) => !allIds.has(ref.id)).map((ref) => ({
83
+ ruleId: "structure/valid-references",
84
+ severity: "error",
85
+ message: `Reference "${ref.id}" does not match any spec in the suite`,
86
+ filePath: context.spec.filePath
87
+ }));
88
+ }
89
+ };
90
+
91
+ // ../lint/dist/rules/no-circular-deps.js
92
+ var noCircularDepsRule = {
93
+ id: "structure/no-circular-deps",
94
+ description: "The dependency graph has no cycles",
95
+ severity: "error",
96
+ run() {
97
+ return [];
98
+ }
99
+ };
100
+
101
+ // ../lint/dist/rules/story-coverage.js
102
+ var FEATURE_PATTERN = /\*\*F\d+\*\*:\s*(.+)/g;
103
+ var storyCoverageRule = {
104
+ id: "completeness/story-coverage",
105
+ description: "Every feature listed in a PRD has at least one corresponding user story",
106
+ severity: "warn",
107
+ run(context) {
108
+ if (context.spec.frontmatter.type !== "prd")
109
+ return [];
110
+ const features = [];
111
+ let match;
112
+ const re = new RegExp(FEATURE_PATTERN.source, "g");
113
+ while ((match = re.exec(context.spec.content)) !== null) {
114
+ features.push(match[1].trim());
115
+ }
116
+ if (features.length === 0)
117
+ return [];
118
+ const stories = context.allSpecs.filter((s) => s.frontmatter.type === "user-story");
119
+ const storyContent = stories.map((s) => s.content + " " + s.frontmatter.title).join(" ");
120
+ return features.filter((feature) => !storyContent.toLowerCase().includes(feature.toLowerCase())).map((feature) => ({
121
+ ruleId: "completeness/story-coverage",
122
+ severity: "warn",
123
+ message: `Feature "${feature}" has no corresponding user story`,
124
+ filePath: context.spec.filePath
125
+ }));
126
+ }
127
+ };
128
+
129
+ // ../lint/dist/rules/staleness-check.js
130
+ var stalenessCheckRule = {
131
+ id: "freshness/staleness-check",
132
+ description: "Warns if a spec hasn't been updated since its upstream dependency changed",
133
+ severity: "warn",
134
+ run(context) {
135
+ const refs = context.spec.frontmatter.references;
136
+ if (!refs || refs.length === 0)
137
+ return [];
138
+ const specUpdated = context.spec.frontmatter.updated ?? context.spec.frontmatter.created;
139
+ const specDate = new Date(specUpdated);
140
+ const diagnostics = [];
141
+ for (const ref of refs) {
142
+ if (ref.relationship !== "depends-on" && ref.relationship !== "implemented-by")
143
+ continue;
144
+ const upstream = context.allSpecs.find((s) => s.frontmatter.id === ref.id);
145
+ if (!upstream)
146
+ continue;
147
+ const upstreamUpdated = upstream.frontmatter.updated ?? upstream.frontmatter.created;
148
+ const upstreamDate = new Date(upstreamUpdated);
149
+ if (upstreamDate > specDate) {
150
+ diagnostics.push({
151
+ ruleId: "freshness/staleness-check",
152
+ severity: "warn",
153
+ message: `Potentially stale: upstream "${upstream.frontmatter.id}" was updated on ${upstreamUpdated}, but this spec was last updated on ${specUpdated}`,
154
+ filePath: context.spec.filePath
155
+ });
156
+ }
157
+ }
158
+ return diagnostics;
159
+ }
160
+ };
161
+
162
+ // ../lint/dist/rules/no-vague-language.js
163
+ var DEFAULT_VAGUE_PATTERNS = [
164
+ "as appropriate",
165
+ "handle edge cases",
166
+ "as needed",
167
+ "etc\\.",
168
+ "TBD",
169
+ "TODO",
170
+ "and so on",
171
+ "various",
172
+ "somehow",
173
+ "straightforward",
174
+ "obviously",
175
+ "simply",
176
+ "just need to"
177
+ ];
178
+ var noVagueLanguageRule = {
179
+ id: "clarity/no-vague-language",
180
+ description: "Flags known ambiguous phrases",
181
+ severity: "warn",
182
+ run(context) {
183
+ if (!context.spec.content)
184
+ return [];
185
+ const diagnostics = [];
186
+ for (const pattern of DEFAULT_VAGUE_PATTERNS) {
187
+ const regex = new RegExp(`\\b${pattern}`, "gi");
188
+ let match;
189
+ while ((match = regex.exec(context.spec.content)) !== null) {
190
+ diagnostics.push({
191
+ ruleId: "clarity/no-vague-language",
192
+ severity: "warn",
193
+ message: `Vague language: "${match[0]}"`,
194
+ filePath: context.spec.filePath
195
+ });
196
+ }
197
+ }
198
+ return diagnostics;
199
+ }
200
+ };
201
+
202
+ // ../lint/dist/rules/single-project-context.js
203
+ var singleProjectContextRule = {
204
+ id: "structure/single-project-context",
205
+ description: "Only one project-context spec should exist per suite",
206
+ severity: "warn",
207
+ run(context) {
208
+ if (context.spec.frontmatter.type !== "project-context")
209
+ return [];
210
+ const contextSpecs = context.allSpecs.filter((s) => s.frontmatter.type === "project-context");
211
+ if (contextSpecs.length > 1) {
212
+ return [
213
+ {
214
+ ruleId: "structure/single-project-context",
215
+ severity: "warn",
216
+ message: `Multiple project-context specs found (${contextSpecs.length}). Only one should exist per suite.`,
217
+ filePath: context.spec.filePath
218
+ }
219
+ ];
220
+ }
221
+ return [];
222
+ }
223
+ };
224
+
225
+ // ../lint/dist/rules/terminology.js
226
+ function normalizeCompound(term) {
227
+ return term.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]/g, " ").toLowerCase().trim();
228
+ }
229
+ function extractCompoundTerms(content) {
230
+ const terms = [];
231
+ const camelCaseRegex = /\b[a-zA-Z]*[a-z][A-Z][a-zA-Z]*\b/g;
232
+ let match;
233
+ while ((match = camelCaseRegex.exec(content)) !== null) {
234
+ terms.push(match[0]);
235
+ }
236
+ const hyphenatedRegex = /\b[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)+\b/g;
237
+ while ((match = hyphenatedRegex.exec(content)) !== null) {
238
+ terms.push(match[0]);
239
+ }
240
+ return terms;
241
+ }
242
+ var terminologyRule = {
243
+ id: "consistency/terminology",
244
+ description: "Detects terminology drift (e.g., user-profile vs UserProfile vs user profile) across specs",
245
+ severity: "warn",
246
+ run(context) {
247
+ if (context.spec !== context.allSpecs[0])
248
+ return [];
249
+ const termMap = /* @__PURE__ */ new Map();
250
+ for (const spec of context.allSpecs) {
251
+ if (!spec.content)
252
+ continue;
253
+ const terms = extractCompoundTerms(spec.content);
254
+ for (const term of terms) {
255
+ const normalized = normalizeCompound(term);
256
+ if (!normalized.includes(" "))
257
+ continue;
258
+ if (!termMap.has(normalized)) {
259
+ termMap.set(normalized, /* @__PURE__ */ new Set());
260
+ }
261
+ termMap.get(normalized).add(term);
262
+ }
263
+ }
264
+ const diagnostics = [];
265
+ for (const [normalized, variants] of termMap) {
266
+ if (variants.size >= 2) {
267
+ const variantList = [...variants].join(", ");
268
+ diagnostics.push({
269
+ ruleId: "consistency/terminology",
270
+ severity: "warn",
271
+ message: `Inconsistent terminology for "${normalized}": found variants [${variantList}]. Standardize terminology across specs.`,
272
+ filePath: context.spec.filePath
273
+ });
274
+ }
275
+ }
276
+ return diagnostics;
277
+ }
278
+ };
279
+
280
+ // ../lint/dist/rules/edge-case-coverage.js
281
+ var EDGE_CASE_KEYWORDS = [
282
+ "error",
283
+ "invalid",
284
+ "empty",
285
+ "timeout",
286
+ "fails",
287
+ "failure",
288
+ "boundary",
289
+ "edge case",
290
+ "null",
291
+ "undefined",
292
+ "reject",
293
+ "unauthorized",
294
+ "forbidden",
295
+ "404",
296
+ "500",
297
+ "missing",
298
+ "malformed",
299
+ "overflow",
300
+ "duplicate"
301
+ ];
302
+ var edgeCaseCoverageRule = {
303
+ id: "completeness/edge-case-coverage",
304
+ description: "Flag user stories or test plans that don't mention error states or edge cases",
305
+ severity: "warn",
306
+ run(context) {
307
+ const type = context.spec.frontmatter.type;
308
+ if (type !== "user-story" && type !== "test-plan")
309
+ return [];
310
+ const content = context.spec.content.toLowerCase();
311
+ const hasEdgeCases = EDGE_CASE_KEYWORDS.some((kw) => content.includes(kw));
312
+ if (hasEdgeCases)
313
+ return [];
314
+ return [
315
+ {
316
+ ruleId: "completeness/edge-case-coverage",
317
+ severity: "warn",
318
+ message: "No error states or edge cases mentioned. Consider adding error handling, boundary conditions, or failure mode scenarios.",
319
+ filePath: context.spec.filePath
320
+ }
321
+ ];
322
+ }
323
+ };
324
+
325
+ // ../lint/dist/rules/naming-conventions.js
326
+ var namingConventionsRule = {
327
+ id: "consistency/naming-conventions",
328
+ description: "Enforce consistent naming conventions across specs",
329
+ severity: "warn",
330
+ run(context) {
331
+ const { spec } = context;
332
+ const type = spec.frontmatter.type;
333
+ const diagnostics = [];
334
+ if (type === "prd") {
335
+ const sectionParts = spec.content.split(/^(?=## )/m);
336
+ const featuresSection = sectionParts.find((p) => /^## Features\b/.test(p));
337
+ if (featuresSection) {
338
+ const bullets = featuresSection.match(/^- .+$/gm) ?? [];
339
+ for (const bullet of bullets) {
340
+ if (bullet.match(/^- \*\*F\d+\*\*:/) === null && bullet.trim().length > 2) {
341
+ diagnostics.push({
342
+ ruleId: "consistency/naming-conventions",
343
+ severity: "warn",
344
+ message: `PRD feature missing feature ID pattern (**F<N>**:): "${bullet.slice(0, 60)}"`,
345
+ filePath: spec.filePath
346
+ });
347
+ }
348
+ }
349
+ }
350
+ }
351
+ if (type === "user-story") {
352
+ const id = spec.frontmatter.id;
353
+ if (!id.startsWith("story-")) {
354
+ diagnostics.push({
355
+ ruleId: "consistency/naming-conventions",
356
+ severity: "warn",
357
+ message: `User story ID "${id}" should start with "story-" (e.g., "story-${id}")`,
358
+ filePath: spec.filePath
359
+ });
360
+ }
361
+ }
362
+ if (type === "api-contract") {
363
+ const endpointRe = /^###\s+(GET|POST|PUT|PATCH|DELETE)\s+(\S+)/gm;
364
+ let match;
365
+ while ((match = endpointRe.exec(spec.content)) !== null) {
366
+ const path = match[2];
367
+ if (/\/[a-z]+[A-Z]/.test(path)) {
368
+ diagnostics.push({
369
+ ruleId: "consistency/naming-conventions",
370
+ severity: "warn",
371
+ message: `Endpoint path "${path}" uses camelCase \u2014 use kebab-case instead (e.g., "${path.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}")`,
372
+ filePath: spec.filePath
373
+ });
374
+ }
375
+ }
376
+ }
377
+ return diagnostics;
378
+ }
379
+ };
380
+
381
+ // ../lint/dist/rules/threat-coverage.js
382
+ var STOPWORDS = /* @__PURE__ */ new Set(["the", "and", "for", "with", "from", "that", "this", "into", "via"]);
383
+ function extractThreats(content) {
384
+ const parts = content.split(/^(?=## )/m);
385
+ const threats = [];
386
+ for (const part of parts) {
387
+ if (!/^##\s+(Threats|Security)\b/i.test(part))
388
+ continue;
389
+ const bullets = part.match(/^- .+$/gm) ?? [];
390
+ threats.push(...bullets.map((b) => b.slice(2).trim()));
391
+ }
392
+ return threats;
393
+ }
394
+ function extractKeyTerms(text) {
395
+ return text.toLowerCase().split(/\W+/).filter((w) => w.length > 3).filter((w) => !STOPWORDS.has(w));
396
+ }
397
+ var threatCoverageRule = {
398
+ id: "security/threat-coverage",
399
+ description: "Technical design specs must address threats identified in other specs",
400
+ severity: "warn",
401
+ run(context) {
402
+ if (context.spec.frontmatter.type !== "technical-design")
403
+ return [];
404
+ const allThreats = [];
405
+ for (const spec of context.allSpecs) {
406
+ if (spec.filePath === context.spec.filePath)
407
+ continue;
408
+ allThreats.push(...extractThreats(spec.content));
409
+ }
410
+ if (allThreats.length === 0)
411
+ return [];
412
+ const techContent = context.spec.content.toLowerCase();
413
+ const diagnostics = [];
414
+ for (const threat of allThreats) {
415
+ const keyTerms = extractKeyTerms(threat);
416
+ const covered = keyTerms.some((term) => techContent.includes(term));
417
+ if (!covered) {
418
+ diagnostics.push({
419
+ ruleId: "security/threat-coverage",
420
+ severity: "warn",
421
+ message: `Threat not addressed in technical design: "${threat}". Ensure the design covers this threat.`,
422
+ filePath: context.spec.filePath
423
+ });
424
+ }
425
+ }
426
+ return diagnostics;
427
+ }
428
+ };
429
+
430
+ // ../lint/dist/rules/ambiguity-score-ai.js
431
+ var ambiguityScoreAiRule = {
432
+ id: "clarity/ambiguity-score-ai",
433
+ description: "AI-powered ambiguity detection (requires ANTHROPIC_API_KEY)",
434
+ severity: "info",
435
+ run(context) {
436
+ if (!process.env["ANTHROPIC_API_KEY"])
437
+ return [];
438
+ return [
439
+ {
440
+ ruleId: "clarity/ambiguity-score-ai",
441
+ severity: "info",
442
+ message: "AI ambiguity analysis available \u2014 run `sdx check --ai` for LLM-powered ambiguity detection",
443
+ filePath: context.spec.filePath
444
+ }
445
+ ];
446
+ }
447
+ };
448
+
449
+ // ../lint/dist/rules/index.js
450
+ var structureRules = [
451
+ validFrontmatterRule,
452
+ requiredSectionsRule,
453
+ validReferencesRule,
454
+ noCircularDepsRule,
455
+ singleProjectContextRule
456
+ ];
457
+ var contentRules = [
458
+ storyCoverageRule,
459
+ stalenessCheckRule,
460
+ noVagueLanguageRule,
461
+ terminologyRule,
462
+ edgeCaseCoverageRule,
463
+ namingConventionsRule,
464
+ threatCoverageRule,
465
+ ambiguityScoreAiRule
466
+ ];
467
+ var allBuiltinRules = [...structureRules, ...contentRules];
468
+
469
+ // ../lint/dist/presets.js
470
+ function getPreset(name) {
471
+ switch (name) {
472
+ case "minimal":
473
+ return structureRules;
474
+ case "recommended":
475
+ return allBuiltinRules;
476
+ case "strict":
477
+ return allBuiltinRules.map((rule) => ({ ...rule, severity: "error" }));
478
+ default:
479
+ throw new Error(`Unknown preset: "${name}". Use "minimal", "recommended", or "strict", or resolve external presets via resolvePreset() from @specdx/core.`);
480
+ }
481
+ }
482
+
483
+ // ../lint/dist/custom-rule-loader.js
484
+ import { pathToFileURL } from "url";
485
+
486
+ export {
487
+ createLintEngine,
488
+ getPreset
489
+ };
490
+ //# sourceMappingURL=chunk-HMXUNURD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../lint/src/engine.ts","../../lint/src/rules/valid-frontmatter.ts","../../lint/src/rules/required-sections.ts","../../lint/src/rules/valid-references.ts","../../lint/src/rules/no-circular-deps.ts","../../lint/src/rules/story-coverage.ts","../../lint/src/rules/staleness-check.ts","../../lint/src/rules/no-vague-language.ts","../../lint/src/rules/single-project-context.ts","../../lint/src/rules/terminology.ts","../../lint/src/rules/edge-case-coverage.ts","../../lint/src/rules/naming-conventions.ts","../../lint/src/rules/threat-coverage.ts","../../lint/src/rules/ambiguity-score-ai.ts","../../lint/src/rules/index.ts","../../lint/src/presets.ts","../../lint/src/custom-rule-loader.ts"],"sourcesContent":["import type { ParsedSpec, DependencyGraph } from \"@specdx/core\";\nimport type { SdxConfig } from \"@specdx/schema\";\nimport type { LintRule, LintResults, Diagnostic } from \"./types.js\";\n\nexport interface LintEngineOptions {\n rules: LintRule[];\n config?: SdxConfig;\n graph?: DependencyGraph;\n}\n\nexport interface LintEngine {\n lint(specs: ParsedSpec[]): LintResults;\n}\n\nexport function createLintEngine(options: LintEngineOptions): LintEngine {\n return {\n lint(specs: ParsedSpec[]): LintResults {\n const diagnostics: Diagnostic[] = [];\n for (const spec of specs) {\n for (const rule of options.rules) {\n const results = rule.run({\n spec,\n allSpecs: specs,\n config: options.config,\n graph: options.graph,\n });\n diagnostics.push(...results);\n }\n }\n return {\n diagnostics,\n hasErrors: diagnostics.some((d) => d.severity === \"error\"),\n hasWarnings: diagnostics.some((d) => d.severity === \"warn\"),\n };\n },\n };\n}\n","import type { LintRule } from \"../types.js\";\n\nexport const validFrontmatterRule: LintRule = {\n id: \"structure/valid-frontmatter\",\n description: \"Frontmatter matches the schema for the declared spec type\",\n severity: \"error\",\n run(context) {\n if (context.spec.valid) return [];\n const errors = context.spec.validationErrors ?? [];\n return errors.map((err) => ({\n ruleId: \"structure/valid-frontmatter\",\n severity: \"error\" as const,\n message: `Invalid frontmatter: ${err.message ?? JSON.stringify(err)}`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\nimport { REQUIRED_SECTIONS } from \"@specdx/schema\";\nimport type { SpecType } from \"@specdx/schema\";\n\nexport const requiredSectionsRule: LintRule = {\n id: \"structure/required-sections\",\n description: \"Spec body contains all required sections for its type\",\n severity: \"error\",\n run(context) {\n // Skip YAML specs (no markdown body)\n const ext = context.spec.filePath.split(\".\").pop()?.toLowerCase();\n if (ext === \"yaml\" || ext === \"yml\") return [];\n\n const specType = context.spec.frontmatter.type as SpecType;\n const required = REQUIRED_SECTIONS[specType];\n if (!required) return [];\n\n const missing = required.filter((s) => !context.spec.sections.includes(s));\n return missing.map((section) => ({\n ruleId: \"structure/required-sections\",\n severity: \"error\" as const,\n message: `Missing required section: \"${section}\"`,\n filePath: context.spec.filePath,\n section,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const validReferencesRule: LintRule = {\n id: \"structure/valid-references\",\n description: \"All references in frontmatter point to specs that exist in the suite\",\n severity: \"error\",\n run(context) {\n const refs = context.spec.frontmatter.references;\n if (!refs || refs.length === 0) return [];\n const allIds = new Set(context.allSpecs.map((s) => s.frontmatter.id));\n return refs\n .filter((ref) => !allIds.has(ref.id))\n .map((ref) => ({\n ruleId: \"structure/valid-references\",\n severity: \"error\" as const,\n message: `Reference \"${ref.id}\" does not match any spec in the suite`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const noCircularDepsRule: LintRule = {\n id: \"structure/no-circular-deps\",\n description: \"The dependency graph has no cycles\",\n severity: \"error\",\n run() {\n // Cycle detection happens in buildGraph() — if graph construction succeeds, it's acyclic.\n // GraphErrors are surfaced as diagnostics by the lint command, not by this rule.\n return [];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst FEATURE_PATTERN = /\\*\\*F\\d+\\*\\*:\\s*(.+)/g;\n\nexport const storyCoverageRule: LintRule = {\n id: \"completeness/story-coverage\",\n description: \"Every feature listed in a PRD has at least one corresponding user story\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"prd\") return [];\n const features: string[] = [];\n let match;\n const re = new RegExp(FEATURE_PATTERN.source, \"g\");\n while ((match = re.exec(context.spec.content)) !== null) {\n features.push(match[1]!.trim());\n }\n if (features.length === 0) return [];\n const stories = context.allSpecs.filter((s) => s.frontmatter.type === \"user-story\");\n const storyContent = stories.map((s) => s.content + \" \" + s.frontmatter.title).join(\" \");\n return features\n .filter((feature) => !storyContent.toLowerCase().includes(feature.toLowerCase()))\n .map((feature) => ({\n ruleId: \"completeness/story-coverage\",\n severity: \"warn\" as const,\n message: `Feature \"${feature}\" has no corresponding user story`,\n filePath: context.spec.filePath,\n }));\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const stalenessCheckRule: LintRule = {\n id: \"freshness/staleness-check\",\n description: \"Warns if a spec hasn't been updated since its upstream dependency changed\",\n severity: \"warn\",\n run(context) {\n const refs = context.spec.frontmatter.references;\n if (!refs || (refs as unknown[]).length === 0) return [];\n const specUpdated =\n (context.spec.frontmatter.updated as string | undefined) ??\n (context.spec.frontmatter.created as string);\n const specDate = new Date(specUpdated);\n const diagnostics = [];\n for (const ref of refs as Array<{ id: string; relationship: string }>) {\n if (ref.relationship !== \"depends-on\" && ref.relationship !== \"implemented-by\") continue;\n const upstream = context.allSpecs.find((s) => s.frontmatter.id === ref.id);\n if (!upstream) continue;\n const upstreamUpdated =\n (upstream.frontmatter.updated as string | undefined) ??\n (upstream.frontmatter.created as string);\n const upstreamDate = new Date(upstreamUpdated);\n if (upstreamDate > specDate) {\n diagnostics.push({\n ruleId: \"freshness/staleness-check\",\n severity: \"warn\" as const,\n message: `Potentially stale: upstream \"${upstream.frontmatter.id}\" was updated on ${upstreamUpdated}, but this spec was last updated on ${specUpdated}`,\n filePath: context.spec.filePath,\n });\n }\n }\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst DEFAULT_VAGUE_PATTERNS = [\n \"as appropriate\",\n \"handle edge cases\",\n \"as needed\",\n \"etc\\\\.\",\n \"TBD\",\n \"TODO\",\n \"and so on\",\n \"various\",\n \"somehow\",\n \"straightforward\",\n \"obviously\",\n \"simply\",\n \"just need to\",\n];\n\nexport const noVagueLanguageRule: LintRule = {\n id: \"clarity/no-vague-language\",\n description: \"Flags known ambiguous phrases\",\n severity: \"warn\",\n run(context) {\n if (!context.spec.content) return [];\n const diagnostics = [];\n for (const pattern of DEFAULT_VAGUE_PATTERNS) {\n const regex = new RegExp(`\\\\b${pattern}`, \"gi\");\n let match;\n while ((match = regex.exec(context.spec.content)) !== null) {\n diagnostics.push({\n ruleId: \"clarity/no-vague-language\",\n severity: \"warn\" as const,\n message: `Vague language: \"${match[0]}\"`,\n filePath: context.spec.filePath,\n });\n }\n }\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const singleProjectContextRule: LintRule = {\n id: \"structure/single-project-context\",\n description: \"Only one project-context spec should exist per suite\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"project-context\") return [];\n\n const contextSpecs = context.allSpecs.filter(\n (s) => s.frontmatter.type === \"project-context\",\n );\n\n if (contextSpecs.length > 1) {\n return [\n {\n ruleId: \"structure/single-project-context\",\n severity: \"warn\" as const,\n message: `Multiple project-context specs found (${contextSpecs.length}). Only one should exist per suite.`,\n filePath: context.spec.filePath,\n },\n ];\n }\n\n return [];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nfunction normalizeCompound(term: string): string {\n // Split camelCase: \"UserProfile\" → \"user profile\"\n // Split hyphens/underscores: \"user-profile\" → \"user profile\"\n return term\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .replace(/[-_]/g, \" \")\n .toLowerCase()\n .trim();\n}\n\nfunction extractCompoundTerms(content: string): string[] {\n const terms: string[] = [];\n\n // Extract camelCase words (e.g., UserProfile, userProfile)\n const camelCaseRegex = /\\b[a-zA-Z]*[a-z][A-Z][a-zA-Z]*\\b/g;\n let match;\n while ((match = camelCaseRegex.exec(content)) !== null) {\n terms.push(match[0]);\n }\n\n // Extract hyphenated words (e.g., user-profile, my-component)\n const hyphenatedRegex = /\\b[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)+\\b/g;\n while ((match = hyphenatedRegex.exec(content)) !== null) {\n terms.push(match[0]);\n }\n\n return terms;\n}\n\nexport const terminologyRule: LintRule = {\n id: \"consistency/terminology\",\n description: \"Detects terminology drift (e.g., user-profile vs UserProfile vs user profile) across specs\",\n severity: \"warn\",\n run(context) {\n // Only run on the first spec to avoid duplicate diagnostics\n if (context.spec !== context.allSpecs[0]) return [];\n\n // Build a map: normalized form → Set of original forms found across all specs\n const termMap = new Map<string, Set<string>>();\n\n for (const spec of context.allSpecs) {\n if (!spec.content) continue;\n const terms = extractCompoundTerms(spec.content);\n for (const term of terms) {\n const normalized = normalizeCompound(term);\n // Only track multi-word normalized forms (skip single words)\n if (!normalized.includes(\" \")) continue;\n if (!termMap.has(normalized)) {\n termMap.set(normalized, new Set());\n }\n termMap.get(normalized)!.add(term);\n }\n }\n\n const diagnostics = [];\n\n for (const [normalized, variants] of termMap) {\n if (variants.size >= 2) {\n const variantList = [...variants].join(\", \");\n diagnostics.push({\n ruleId: \"consistency/terminology\",\n severity: \"warn\" as const,\n message: `Inconsistent terminology for \"${normalized}\": found variants [${variantList}]. Standardize terminology across specs.`,\n filePath: context.spec.filePath,\n });\n }\n }\n\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst EDGE_CASE_KEYWORDS = [\n \"error\",\n \"invalid\",\n \"empty\",\n \"timeout\",\n \"fails\",\n \"failure\",\n \"boundary\",\n \"edge case\",\n \"null\",\n \"undefined\",\n \"reject\",\n \"unauthorized\",\n \"forbidden\",\n \"404\",\n \"500\",\n \"missing\",\n \"malformed\",\n \"overflow\",\n \"duplicate\",\n];\n\nexport const edgeCaseCoverageRule: LintRule = {\n id: \"completeness/edge-case-coverage\",\n description: \"Flag user stories or test plans that don't mention error states or edge cases\",\n severity: \"warn\",\n run(context) {\n const type = context.spec.frontmatter.type as string;\n if (type !== \"user-story\" && type !== \"test-plan\") return [];\n\n const content = context.spec.content.toLowerCase();\n const hasEdgeCases = EDGE_CASE_KEYWORDS.some((kw) => content.includes(kw));\n\n if (hasEdgeCases) return [];\n\n return [\n {\n ruleId: \"completeness/edge-case-coverage\",\n severity: \"warn\" as const,\n message:\n \"No error states or edge cases mentioned. Consider adding error handling, boundary conditions, or failure mode scenarios.\",\n filePath: context.spec.filePath,\n },\n ];\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const namingConventionsRule: LintRule = {\n id: \"consistency/naming-conventions\",\n description: \"Enforce consistent naming conventions across specs\",\n severity: \"warn\",\n run(context) {\n const { spec } = context;\n const type = spec.frontmatter.type as string;\n const diagnostics = [];\n\n if (type === \"prd\") {\n // Split content into sections and find the Features section\n const sectionParts = spec.content.split(/^(?=## )/m);\n const featuresSection = sectionParts.find((p) => /^## Features\\b/.test(p));\n if (featuresSection) {\n const bullets = featuresSection.match(/^- .+$/gm) ?? [];\n for (const bullet of bullets) {\n if (bullet.match(/^- \\*\\*F\\d+\\*\\*:/) === null && bullet.trim().length > 2) {\n diagnostics.push({\n ruleId: \"consistency/naming-conventions\",\n severity: \"warn\" as const,\n message: `PRD feature missing feature ID pattern (**F<N>**:): \"${bullet.slice(0, 60)}\"`,\n filePath: spec.filePath,\n });\n }\n }\n }\n }\n\n if (type === \"user-story\") {\n const id = spec.frontmatter.id as string;\n if (!id.startsWith(\"story-\")) {\n diagnostics.push({\n ruleId: \"consistency/naming-conventions\",\n severity: \"warn\" as const,\n message: `User story ID \"${id}\" should start with \"story-\" (e.g., \"story-${id}\")`,\n filePath: spec.filePath,\n });\n }\n }\n\n if (type === \"api-contract\") {\n // Check endpoints for camelCase path segments\n const endpointRe = /^###\\s+(GET|POST|PUT|PATCH|DELETE)\\s+(\\S+)/gm;\n let match;\n while ((match = endpointRe.exec(spec.content)) !== null) {\n const path = match[2]!;\n if (/\\/[a-z]+[A-Z]/.test(path)) {\n diagnostics.push({\n ruleId: \"consistency/naming-conventions\",\n severity: \"warn\" as const,\n message: `Endpoint path \"${path}\" uses camelCase — use kebab-case instead (e.g., \"${path.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase()}\")`,\n filePath: spec.filePath,\n });\n }\n }\n }\n\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nconst STOPWORDS = new Set([\"the\", \"and\", \"for\", \"with\", \"from\", \"that\", \"this\", \"into\", \"via\"]);\n\nfunction extractThreats(content: string): string[] {\n // Split into sections at each ## heading, then filter for Threats/Security\n const parts = content.split(/^(?=## )/m);\n const threats: string[] = [];\n for (const part of parts) {\n if (!/^##\\s+(Threats|Security)\\b/i.test(part)) continue;\n const bullets = part.match(/^- .+$/gm) ?? [];\n threats.push(...bullets.map((b) => b.slice(2).trim()));\n }\n return threats;\n}\n\nfunction extractKeyTerms(text: string): string[] {\n return text\n .toLowerCase()\n .split(/\\W+/)\n .filter((w) => w.length > 3)\n .filter((w) => !STOPWORDS.has(w));\n}\n\nexport const threatCoverageRule: LintRule = {\n id: \"security/threat-coverage\",\n description: \"Technical design specs must address threats identified in other specs\",\n severity: \"warn\",\n run(context) {\n if (context.spec.frontmatter.type !== \"technical-design\") return [];\n\n const allThreats: string[] = [];\n for (const spec of context.allSpecs) {\n if (spec.filePath === context.spec.filePath) continue;\n allThreats.push(...extractThreats(spec.content));\n }\n\n if (allThreats.length === 0) return [];\n\n const techContent = context.spec.content.toLowerCase();\n const diagnostics = [];\n\n for (const threat of allThreats) {\n const keyTerms = extractKeyTerms(threat);\n const covered = keyTerms.some((term) => techContent.includes(term));\n if (!covered) {\n diagnostics.push({\n ruleId: \"security/threat-coverage\",\n severity: \"warn\" as const,\n message: `Threat not addressed in technical design: \"${threat}\". Ensure the design covers this threat.`,\n filePath: context.spec.filePath,\n });\n }\n }\n\n return diagnostics;\n },\n};\n","import type { LintRule } from \"../types.js\";\n\nexport const ambiguityScoreAiRule: LintRule = {\n id: \"clarity/ambiguity-score-ai\",\n description: \"AI-powered ambiguity detection (requires ANTHROPIC_API_KEY)\",\n severity: \"info\",\n run(context) {\n if (!process.env[\"ANTHROPIC_API_KEY\"]) return [];\n\n return [\n {\n ruleId: \"clarity/ambiguity-score-ai\",\n severity: \"info\" as const,\n message:\n \"AI ambiguity analysis available — run `sdx check --ai` for LLM-powered ambiguity detection\",\n filePath: context.spec.filePath,\n },\n ];\n },\n};\n","import { validFrontmatterRule } from \"./valid-frontmatter.js\";\nimport { requiredSectionsRule } from \"./required-sections.js\";\nimport { validReferencesRule } from \"./valid-references.js\";\nimport { noCircularDepsRule } from \"./no-circular-deps.js\";\nimport { storyCoverageRule } from \"./story-coverage.js\";\nimport { stalenessCheckRule } from \"./staleness-check.js\";\nimport { noVagueLanguageRule } from \"./no-vague-language.js\";\nimport { singleProjectContextRule } from \"./single-project-context.js\";\nimport { terminologyRule } from \"./terminology.js\";\nimport { edgeCaseCoverageRule } from \"./edge-case-coverage.js\";\nimport { namingConventionsRule } from \"./naming-conventions.js\";\nimport { threatCoverageRule } from \"./threat-coverage.js\";\nimport { ambiguityScoreAiRule } from \"./ambiguity-score-ai.js\";\nimport type { LintRule } from \"../types.js\";\n\nexport const structureRules: LintRule[] = [\n validFrontmatterRule,\n requiredSectionsRule,\n validReferencesRule,\n noCircularDepsRule,\n singleProjectContextRule,\n];\n\nexport const contentRules: LintRule[] = [\n storyCoverageRule,\n stalenessCheckRule,\n noVagueLanguageRule,\n terminologyRule,\n edgeCaseCoverageRule,\n namingConventionsRule,\n threatCoverageRule,\n ambiguityScoreAiRule,\n];\n\nexport const allBuiltinRules: LintRule[] = [...structureRules, ...contentRules];\n\nexport {\n validFrontmatterRule,\n requiredSectionsRule,\n validReferencesRule,\n noCircularDepsRule,\n storyCoverageRule,\n stalenessCheckRule,\n noVagueLanguageRule,\n singleProjectContextRule,\n terminologyRule,\n edgeCaseCoverageRule,\n namingConventionsRule,\n threatCoverageRule,\n ambiguityScoreAiRule,\n};\n","import type { LintRule } from \"./types.js\";\nimport { structureRules, allBuiltinRules } from \"./rules/index.js\";\n\nexport function getPreset(name: string): LintRule[] {\n switch (name) {\n case \"minimal\":\n return structureRules;\n case \"recommended\":\n return allBuiltinRules;\n case \"strict\":\n return allBuiltinRules.map((rule) => ({ ...rule, severity: \"error\" as const }));\n default:\n throw new Error(`Unknown preset: \"${name}\". Use \"minimal\", \"recommended\", or \"strict\", or resolve external presets via resolvePreset() from @specdx/core.`);\n }\n}\n","import { pathToFileURL } from \"node:url\";\nimport type { LintRule } from \"./types.js\";\n\nexport async function loadCustomRule(filePath: string): Promise<LintRule> {\n const module = await import(pathToFileURL(filePath).href);\n const rule = module.default ?? module.rule;\n if (!rule || !rule.id || !rule.run) {\n throw new Error(\n `Custom rule at ${filePath} must export a default LintRule with id and run function`,\n );\n }\n return rule as LintRule;\n}\n"],"mappings":";;;;;AAcM,SAAU,iBAAiB,SAA0B;AACzD,SAAO;IACL,KAAK,OAAmB;AACtB,YAAM,cAA4B,CAAA;AAClC,iBAAW,QAAQ,OAAO;AACxB,mBAAW,QAAQ,QAAQ,OAAO;AAChC,gBAAM,UAAU,KAAK,IAAI;YACvB;YACA,UAAU;YACV,QAAQ,QAAQ;YAChB,OAAO,QAAQ;WAChB;AACD,sBAAY,KAAK,GAAG,OAAO;QAC7B;MACF;AACA,aAAO;QACL;QACA,WAAW,YAAY,KAAK,CAAC,MAAM,EAAE,aAAa,OAAO;QACzD,aAAa,YAAY,KAAK,CAAC,MAAM,EAAE,aAAa,MAAM;;IAE9D;;AAEJ;;;AClCO,IAAM,uBAAiC;EAC5C,IAAI;EACJ,aAAa;EACb,UAAU;EACV,IAAI,SAAO;AACT,QAAI,QAAQ,KAAK;AAAO,aAAO,CAAA;AAC/B,UAAM,SAAS,QAAQ,KAAK,oBAAoB,CAAA;AAChD,WAAO,OAAO,IAAI,CAAC,SAAS;MAC1B,QAAQ;MACR,UAAU;MACV,SAAS,wBAAwB,IAAI,WAAW,KAAK,UAAU,GAAG,CAAC;MACnE,UAAU,QAAQ,KAAK;MACvB;EACJ;;;;ACXK,IAAM,uBAAiC;EAC5C,I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,YAAW;AACpD,UAAM,cAAc,CAAA;AAEpB,eAAW,UAAU,YAAY;AAC/B,YAAM,WAAW,gBAAgB,MAAM;AACvC,YAAM,UAAU,SAAS,KAAK,CAAC,SAAS,YAAY,SAAS,IAAI,CAAC;AAClE,UAAI,CAAC,SAAS;AACZ,oBAAY,KAAK;UACf,QAAQ;UACR,UAAU;UACV,SAAS,8CAA8C,MAAM;UAC7D,UAAU,QAAQ,KAAK;SACxB;MACH;IACF;AAEA,WAAO;EACT;;;;ACtDK,IAAM,uBAAiC;EAC5C,IAAI;EACJ,aAAa;EACb,UAAU;EACV,IAAI,SAAO;AACT,QAAI,CAAC,QAAQ,IAAI,mBAAmB;AAAG,aAAO,CAAA;AAE9C,WAAO;MACL;QACE,QAAQ;QACR,UAAU;QACV,SACE;QACF,UAAU,QAAQ,KAAK;;;EAG7B;;;;ACHK,IAAM,iBAA6B;EACxC;EACA;EACA;EACA;EACA;;AAGK,IAAM,eAA2B;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAM,kBAA8B,CAAC,GAAG,gBAAgB,GAAG,YAAY;;;AC/BxE,SAAU,UAAU,MAAY;AACpC,UAAQ,MAAM;IACZ,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO,gBAAgB,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,UAAU,QAAgB,EAAG;IAChF;AACE,YAAM,IAAI,MAAM,oBAAoB,IAAI,kHAAkH;EAC9J;AACF;;;ACdA,SAAS,qBAAqB;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  validateConfig,
3
3
  validateSpec
4
- } from "./chunk-XLEN6ZYM.js";
4
+ } from "./chunk-ZX4HVL5M.js";
5
5
 
6
6
  // ../core/dist/config.js
7
7
  import { readFile } from "fs/promises";
@@ -297,4 +297,4 @@ export {
297
297
  resolveGlob,
298
298
  createLogger
299
299
  };
300
- //# sourceMappingURL=chunk-276J7LR6.js.map
300
+ //# sourceMappingURL=chunk-PHR7AV6I.js.map