spec-gen-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1078 -0
- package/dist/api/analyze.d.ts +17 -0
- package/dist/api/analyze.d.ts.map +1 -0
- package/dist/api/analyze.js +109 -0
- package/dist/api/analyze.js.map +1 -0
- package/dist/api/drift.d.ts +21 -0
- package/dist/api/drift.d.ts.map +1 -0
- package/dist/api/drift.js +145 -0
- package/dist/api/drift.js.map +1 -0
- package/dist/api/generate.d.ts +18 -0
- package/dist/api/generate.d.ts.map +1 -0
- package/dist/api/generate.js +251 -0
- package/dist/api/generate.js.map +1 -0
- package/dist/api/index.d.ts +39 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +32 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/init.d.ts +18 -0
- package/dist/api/init.d.ts.map +1 -0
- package/dist/api/init.js +82 -0
- package/dist/api/init.js.map +1 -0
- package/dist/api/run.d.ts +19 -0
- package/dist/api/run.d.ts.map +1 -0
- package/dist/api/run.js +291 -0
- package/dist/api/run.js.map +1 -0
- package/dist/api/specs.d.ts +49 -0
- package/dist/api/specs.d.ts.map +1 -0
- package/dist/api/specs.js +136 -0
- package/dist/api/specs.js.map +1 -0
- package/dist/api/types.d.ts +176 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +9 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/verify.d.ts +20 -0
- package/dist/api/verify.d.ts.map +1 -0
- package/dist/api/verify.js +117 -0
- package/dist/api/verify.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +27 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +485 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/drift.d.ts +9 -0
- package/dist/cli/commands/drift.d.ts.map +1 -0
- package/dist/cli/commands/drift.js +540 -0
- package/dist/cli/commands/drift.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +9 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +633 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +171 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +638 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +574 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/run.d.ts +24 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +546 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +9 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +417 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/commands/view.d.ts +9 -0
- package/dist/cli/commands/view.d.ts.map +1 -0
- package/dist/cli/commands/view.js +511 -0
- package/dist/cli/commands/view.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +83 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/analyzer/architecture-writer.d.ts +67 -0
- package/dist/core/analyzer/architecture-writer.d.ts.map +1 -0
- package/dist/core/analyzer/architecture-writer.js +209 -0
- package/dist/core/analyzer/architecture-writer.js.map +1 -0
- package/dist/core/analyzer/artifact-generator.d.ts +222 -0
- package/dist/core/analyzer/artifact-generator.d.ts.map +1 -0
- package/dist/core/analyzer/artifact-generator.js +726 -0
- package/dist/core/analyzer/artifact-generator.js.map +1 -0
- package/dist/core/analyzer/call-graph.d.ts +83 -0
- package/dist/core/analyzer/call-graph.d.ts.map +1 -0
- package/dist/core/analyzer/call-graph.js +827 -0
- package/dist/core/analyzer/call-graph.js.map +1 -0
- package/dist/core/analyzer/code-shaper.d.ts +33 -0
- package/dist/core/analyzer/code-shaper.d.ts.map +1 -0
- package/dist/core/analyzer/code-shaper.js +149 -0
- package/dist/core/analyzer/code-shaper.js.map +1 -0
- package/dist/core/analyzer/dependency-graph.d.ts +179 -0
- package/dist/core/analyzer/dependency-graph.d.ts.map +1 -0
- package/dist/core/analyzer/dependency-graph.js +574 -0
- package/dist/core/analyzer/dependency-graph.js.map +1 -0
- package/dist/core/analyzer/duplicate-detector.d.ts +52 -0
- package/dist/core/analyzer/duplicate-detector.d.ts.map +1 -0
- package/dist/core/analyzer/duplicate-detector.js +279 -0
- package/dist/core/analyzer/duplicate-detector.js.map +1 -0
- package/dist/core/analyzer/embedding-service.d.ts +50 -0
- package/dist/core/analyzer/embedding-service.d.ts.map +1 -0
- package/dist/core/analyzer/embedding-service.js +104 -0
- package/dist/core/analyzer/embedding-service.js.map +1 -0
- package/dist/core/analyzer/file-walker.d.ts +78 -0
- package/dist/core/analyzer/file-walker.d.ts.map +1 -0
- package/dist/core/analyzer/file-walker.js +531 -0
- package/dist/core/analyzer/file-walker.js.map +1 -0
- package/dist/core/analyzer/import-parser.d.ts +91 -0
- package/dist/core/analyzer/import-parser.d.ts.map +1 -0
- package/dist/core/analyzer/import-parser.js +720 -0
- package/dist/core/analyzer/import-parser.js.map +1 -0
- package/dist/core/analyzer/index.d.ts +10 -0
- package/dist/core/analyzer/index.d.ts.map +1 -0
- package/dist/core/analyzer/index.js +10 -0
- package/dist/core/analyzer/index.js.map +1 -0
- package/dist/core/analyzer/refactor-analyzer.d.ts +80 -0
- package/dist/core/analyzer/refactor-analyzer.d.ts.map +1 -0
- package/dist/core/analyzer/refactor-analyzer.js +339 -0
- package/dist/core/analyzer/refactor-analyzer.js.map +1 -0
- package/dist/core/analyzer/repository-mapper.d.ts +150 -0
- package/dist/core/analyzer/repository-mapper.d.ts.map +1 -0
- package/dist/core/analyzer/repository-mapper.js +731 -0
- package/dist/core/analyzer/repository-mapper.js.map +1 -0
- package/dist/core/analyzer/signature-extractor.d.ts +31 -0
- package/dist/core/analyzer/signature-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/signature-extractor.js +387 -0
- package/dist/core/analyzer/signature-extractor.js.map +1 -0
- package/dist/core/analyzer/significance-scorer.d.ts +79 -0
- package/dist/core/analyzer/significance-scorer.d.ts.map +1 -0
- package/dist/core/analyzer/significance-scorer.js +407 -0
- package/dist/core/analyzer/significance-scorer.js.map +1 -0
- package/dist/core/analyzer/subgraph-extractor.d.ts +43 -0
- package/dist/core/analyzer/subgraph-extractor.d.ts.map +1 -0
- package/dist/core/analyzer/subgraph-extractor.js +129 -0
- package/dist/core/analyzer/subgraph-extractor.js.map +1 -0
- package/dist/core/analyzer/vector-index.d.ts +63 -0
- package/dist/core/analyzer/vector-index.d.ts.map +1 -0
- package/dist/core/analyzer/vector-index.js +169 -0
- package/dist/core/analyzer/vector-index.js.map +1 -0
- package/dist/core/drift/drift-detector.d.ts +102 -0
- package/dist/core/drift/drift-detector.d.ts.map +1 -0
- package/dist/core/drift/drift-detector.js +597 -0
- package/dist/core/drift/drift-detector.js.map +1 -0
- package/dist/core/drift/git-diff.d.ts +55 -0
- package/dist/core/drift/git-diff.d.ts.map +1 -0
- package/dist/core/drift/git-diff.js +356 -0
- package/dist/core/drift/git-diff.js.map +1 -0
- package/dist/core/drift/index.d.ts +12 -0
- package/dist/core/drift/index.d.ts.map +1 -0
- package/dist/core/drift/index.js +9 -0
- package/dist/core/drift/index.js.map +1 -0
- package/dist/core/drift/spec-mapper.d.ts +73 -0
- package/dist/core/drift/spec-mapper.d.ts.map +1 -0
- package/dist/core/drift/spec-mapper.js +353 -0
- package/dist/core/drift/spec-mapper.js.map +1 -0
- package/dist/core/generator/adr-generator.d.ts +32 -0
- package/dist/core/generator/adr-generator.d.ts.map +1 -0
- package/dist/core/generator/adr-generator.js +192 -0
- package/dist/core/generator/adr-generator.js.map +1 -0
- package/dist/core/generator/index.d.ts +9 -0
- package/dist/core/generator/index.d.ts.map +1 -0
- package/dist/core/generator/index.js +12 -0
- package/dist/core/generator/index.js.map +1 -0
- package/dist/core/generator/mapping-generator.d.ts +54 -0
- package/dist/core/generator/mapping-generator.d.ts.map +1 -0
- package/dist/core/generator/mapping-generator.js +239 -0
- package/dist/core/generator/mapping-generator.js.map +1 -0
- package/dist/core/generator/openspec-compat.d.ts +160 -0
- package/dist/core/generator/openspec-compat.d.ts.map +1 -0
- package/dist/core/generator/openspec-compat.js +523 -0
- package/dist/core/generator/openspec-compat.js.map +1 -0
- package/dist/core/generator/openspec-format-generator.d.ts +111 -0
- package/dist/core/generator/openspec-format-generator.d.ts.map +1 -0
- package/dist/core/generator/openspec-format-generator.js +817 -0
- package/dist/core/generator/openspec-format-generator.js.map +1 -0
- package/dist/core/generator/openspec-writer.d.ts +131 -0
- package/dist/core/generator/openspec-writer.d.ts.map +1 -0
- package/dist/core/generator/openspec-writer.js +379 -0
- package/dist/core/generator/openspec-writer.js.map +1 -0
- package/dist/core/generator/prompts.d.ts +35 -0
- package/dist/core/generator/prompts.d.ts.map +1 -0
- package/dist/core/generator/prompts.js +212 -0
- package/dist/core/generator/prompts.js.map +1 -0
- package/dist/core/generator/spec-pipeline.d.ts +94 -0
- package/dist/core/generator/spec-pipeline.d.ts.map +1 -0
- package/dist/core/generator/spec-pipeline.js +474 -0
- package/dist/core/generator/spec-pipeline.js.map +1 -0
- package/dist/core/generator/stages/stage1-survey.d.ts +19 -0
- package/dist/core/generator/stages/stage1-survey.d.ts.map +1 -0
- package/dist/core/generator/stages/stage1-survey.js +105 -0
- package/dist/core/generator/stages/stage1-survey.js.map +1 -0
- package/dist/core/generator/stages/stage2-entities.d.ts +11 -0
- package/dist/core/generator/stages/stage2-entities.d.ts.map +1 -0
- package/dist/core/generator/stages/stage2-entities.js +67 -0
- package/dist/core/generator/stages/stage2-entities.js.map +1 -0
- package/dist/core/generator/stages/stage3-services.d.ts +11 -0
- package/dist/core/generator/stages/stage3-services.d.ts.map +1 -0
- package/dist/core/generator/stages/stage3-services.js +75 -0
- package/dist/core/generator/stages/stage3-services.js.map +1 -0
- package/dist/core/generator/stages/stage4-api.d.ts +11 -0
- package/dist/core/generator/stages/stage4-api.d.ts.map +1 -0
- package/dist/core/generator/stages/stage4-api.js +65 -0
- package/dist/core/generator/stages/stage4-api.js.map +1 -0
- package/dist/core/generator/stages/stage5-architecture.d.ts +10 -0
- package/dist/core/generator/stages/stage5-architecture.d.ts.map +1 -0
- package/dist/core/generator/stages/stage5-architecture.js +62 -0
- package/dist/core/generator/stages/stage5-architecture.js.map +1 -0
- package/dist/core/generator/stages/stage6-adr.d.ts +8 -0
- package/dist/core/generator/stages/stage6-adr.d.ts.map +1 -0
- package/dist/core/generator/stages/stage6-adr.js +41 -0
- package/dist/core/generator/stages/stage6-adr.js.map +1 -0
- package/dist/core/services/chat-agent.d.ts +45 -0
- package/dist/core/services/chat-agent.d.ts.map +1 -0
- package/dist/core/services/chat-agent.js +310 -0
- package/dist/core/services/chat-agent.js.map +1 -0
- package/dist/core/services/chat-tools.d.ts +32 -0
- package/dist/core/services/chat-tools.d.ts.map +1 -0
- package/dist/core/services/chat-tools.js +270 -0
- package/dist/core/services/chat-tools.js.map +1 -0
- package/dist/core/services/config-manager.d.ts +61 -0
- package/dist/core/services/config-manager.d.ts.map +1 -0
- package/dist/core/services/config-manager.js +143 -0
- package/dist/core/services/config-manager.js.map +1 -0
- package/dist/core/services/gitignore-manager.d.ts +29 -0
- package/dist/core/services/gitignore-manager.d.ts.map +1 -0
- package/dist/core/services/gitignore-manager.js +106 -0
- package/dist/core/services/gitignore-manager.js.map +1 -0
- package/dist/core/services/index.d.ts +8 -0
- package/dist/core/services/index.d.ts.map +1 -0
- package/dist/core/services/index.js +8 -0
- package/dist/core/services/index.js.map +1 -0
- package/dist/core/services/llm-service.d.ts +336 -0
- package/dist/core/services/llm-service.d.ts.map +1 -0
- package/dist/core/services/llm-service.js +1155 -0
- package/dist/core/services/llm-service.js.map +1 -0
- package/dist/core/services/mcp-handlers/analysis.d.ts +42 -0
- package/dist/core/services/mcp-handlers/analysis.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/analysis.js +300 -0
- package/dist/core/services/mcp-handlers/analysis.js.map +1 -0
- package/dist/core/services/mcp-handlers/graph.d.ts +65 -0
- package/dist/core/services/mcp-handlers/graph.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/graph.js +509 -0
- package/dist/core/services/mcp-handlers/graph.js.map +1 -0
- package/dist/core/services/mcp-handlers/semantic.d.ts +38 -0
- package/dist/core/services/mcp-handlers/semantic.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/semantic.js +172 -0
- package/dist/core/services/mcp-handlers/semantic.js.map +1 -0
- package/dist/core/services/mcp-handlers/utils.d.ts +21 -0
- package/dist/core/services/mcp-handlers/utils.d.ts.map +1 -0
- package/dist/core/services/mcp-handlers/utils.js +62 -0
- package/dist/core/services/mcp-handlers/utils.js.map +1 -0
- package/dist/core/services/project-detector.d.ts +32 -0
- package/dist/core/services/project-detector.d.ts.map +1 -0
- package/dist/core/services/project-detector.js +111 -0
- package/dist/core/services/project-detector.js.map +1 -0
- package/dist/core/verifier/index.d.ts +5 -0
- package/dist/core/verifier/index.d.ts.map +1 -0
- package/dist/core/verifier/index.js +5 -0
- package/dist/core/verifier/index.js.map +1 -0
- package/dist/core/verifier/verification-engine.d.ts +226 -0
- package/dist/core/verifier/verification-engine.d.ts.map +1 -0
- package/dist/core/verifier/verification-engine.js +681 -0
- package/dist/core/verifier/verification-engine.js.map +1 -0
- package/dist/types/index.d.ts +252 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/pipeline.d.ts +148 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/pipeline.js +5 -0
- package/dist/types/pipeline.js.map +1 -0
- package/dist/utils/errors.d.ts +51 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +128 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +149 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +331 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/progress.d.ts +142 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +280 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/prompts.d.ts +53 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +199 -0
- package/dist/utils/prompts.js.map +1 -0
- package/dist/utils/shutdown.d.ts +89 -0
- package/dist/utils/shutdown.d.ts.map +1 -0
- package/dist/utils/shutdown.js +237 -0
- package/dist/utils/shutdown.js.map +1 -0
- package/package.json +114 -0
- package/src/viewer/InteractiveGraphViewer.jsx +1486 -0
- package/src/viewer/app/index.html +17 -0
- package/src/viewer/app/main.jsx +13 -0
- package/src/viewer/components/ArchitectureView.jsx +177 -0
- package/src/viewer/components/ChatPanel.jsx +448 -0
- package/src/viewer/components/ClusterGraph.jsx +441 -0
- package/src/viewer/components/FilterBar.jsx +179 -0
- package/src/viewer/components/FlatGraph.jsx +275 -0
- package/src/viewer/components/MicroComponents.jsx +83 -0
- package/src/viewer/hooks/usePanZoom.js +79 -0
- package/src/viewer/utils/constants.js +47 -0
- package/src/viewer/utils/graph-helpers.js +291 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spec-gen API: spec requirements extractor
|
|
3
|
+
*
|
|
4
|
+
* Reads `.spec-gen/analysis/mapping.json` and extracts the exact requirement
|
|
5
|
+
* blocks from the spec files referenced by each mapping entry.
|
|
6
|
+
*
|
|
7
|
+
* The function returns a mapping from the mapping.requirement key to a
|
|
8
|
+
* structured object:
|
|
9
|
+
*
|
|
10
|
+
* {
|
|
11
|
+
* title: string, // requirement heading as found in the file
|
|
12
|
+
* body: string, // markdown body of the requirement (everything after the heading)
|
|
13
|
+
* specFile?: string, // spec file path exactly as referenced in mapping.json
|
|
14
|
+
* domain?: string, // domain from mapping
|
|
15
|
+
* service?: string // service from mapping
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* Behavior:
|
|
19
|
+
* - For each mapping entry we read the referenced spec file (exact path).
|
|
20
|
+
* - We attempt a deterministic (case-insensitive) equality match of the
|
|
21
|
+
* requirement heading (the text right after "### Requirement:").
|
|
22
|
+
* - If found, we return the extracted body. If not found or the file cannot
|
|
23
|
+
* be read, an empty body string is returned (the caller can interpret this
|
|
24
|
+
* as "not available").
|
|
25
|
+
*
|
|
26
|
+
* This API intentionally avoids fuzzy heuristics — it uses the exact specFile
|
|
27
|
+
* path coming from mapping.json and only performs case-insensitive title
|
|
28
|
+
* equality checks.
|
|
29
|
+
*/
|
|
30
|
+
import { readFile } from 'node:fs/promises';
|
|
31
|
+
import { existsSync } from 'node:fs';
|
|
32
|
+
import { join, resolve } from 'node:path';
|
|
33
|
+
/**
|
|
34
|
+
* Read spec requirements referenced in mapping.json.
|
|
35
|
+
*
|
|
36
|
+
* @param options.rootPath project root (default: process.cwd())
|
|
37
|
+
* @returns an object keyed by mapping.requirement with SpecRequirement values
|
|
38
|
+
*/
|
|
39
|
+
export async function specGenGetSpecRequirements(options = {}) {
|
|
40
|
+
const rootPath = options.rootPath ?? process.cwd();
|
|
41
|
+
const mappingPath = join(rootPath, '.spec-gen', 'analysis', 'mapping.json');
|
|
42
|
+
const result = {};
|
|
43
|
+
let generatedAt = undefined;
|
|
44
|
+
if (!existsSync(mappingPath)) {
|
|
45
|
+
// No mapping available; return empty map
|
|
46
|
+
return { generatedAt, requirements: result };
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const mappingContent = await readFile(mappingPath, 'utf-8');
|
|
50
|
+
const mappingJson = JSON.parse(mappingContent);
|
|
51
|
+
generatedAt = mappingJson?.generatedAt;
|
|
52
|
+
const mappings = mappingJson?.mappings || [];
|
|
53
|
+
for (const m of mappings) {
|
|
54
|
+
// Use the mapping.requirement as the canonical key
|
|
55
|
+
const reqKey = m.requirement;
|
|
56
|
+
if (!reqKey)
|
|
57
|
+
continue;
|
|
58
|
+
// If we've already loaded this requirement, skip (first-wins)
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(result, reqKey))
|
|
60
|
+
continue;
|
|
61
|
+
const specFileRel = m.specFile;
|
|
62
|
+
if (!specFileRel) {
|
|
63
|
+
// No spec file recorded — create placeholder
|
|
64
|
+
result[reqKey] = {
|
|
65
|
+
title: reqKey,
|
|
66
|
+
body: '',
|
|
67
|
+
domain: m.domain,
|
|
68
|
+
service: m.service,
|
|
69
|
+
};
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const specFileAbs = resolve(rootPath, specFileRel);
|
|
73
|
+
if (!existsSync(specFileAbs)) {
|
|
74
|
+
result[reqKey] = {
|
|
75
|
+
title: reqKey,
|
|
76
|
+
body: '',
|
|
77
|
+
specFile: specFileRel,
|
|
78
|
+
domain: m.domain,
|
|
79
|
+
service: m.service,
|
|
80
|
+
};
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const content = await readFile(specFileAbs, 'utf-8');
|
|
85
|
+
// Split into "### Requirement:" sections and search for exact (case-insensitive) title match
|
|
86
|
+
const sections = content.split(/^###\s+Requirement:\s*/m);
|
|
87
|
+
let found = false;
|
|
88
|
+
for (let i = 1; i < sections.length; i++) {
|
|
89
|
+
const lines = sections[i].split('\n');
|
|
90
|
+
const rawTitle = lines[0].trim();
|
|
91
|
+
if (!rawTitle)
|
|
92
|
+
continue;
|
|
93
|
+
if (rawTitle.toLowerCase() === reqKey.toLowerCase()) {
|
|
94
|
+
const body = lines.slice(1).join('\n').trim();
|
|
95
|
+
result[reqKey] = {
|
|
96
|
+
title: rawTitle,
|
|
97
|
+
body,
|
|
98
|
+
specFile: specFileRel,
|
|
99
|
+
domain: m.domain,
|
|
100
|
+
service: m.service,
|
|
101
|
+
};
|
|
102
|
+
found = true;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!found) {
|
|
107
|
+
// Requirement heading not found in the referenced file — return placeholder
|
|
108
|
+
result[reqKey] = {
|
|
109
|
+
title: reqKey,
|
|
110
|
+
body: '',
|
|
111
|
+
specFile: specFileRel,
|
|
112
|
+
domain: m.domain,
|
|
113
|
+
service: m.service,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// On read/parse error, store a placeholder so the caller knows we attempted to load it
|
|
119
|
+
result[reqKey] = {
|
|
120
|
+
title: reqKey,
|
|
121
|
+
body: '',
|
|
122
|
+
specFile: specFileRel,
|
|
123
|
+
domain: m.domain,
|
|
124
|
+
service: m.service,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
// If mapping.json cannot be read/parsed, return empty set
|
|
131
|
+
return { generatedAt, requirements: result };
|
|
132
|
+
}
|
|
133
|
+
return { generatedAt, requirements: result };
|
|
134
|
+
}
|
|
135
|
+
export default specGenGetSpecRequirements;
|
|
136
|
+
//# sourceMappingURL=specs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/api/specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAW1C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,UAAuB,EAAE;IAIxE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACnD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,EA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C5E,MAAM,CAAC,MAAM,CAAC,GAAG;wBACf,KAAK,EAAE,MAAM;wBACb,IAAI,EAAE,EAAE;wBACR,QAAQ,EAAE,WAAW;wBACrB,MAAM,EAAE,CAAC,CAAC,MAAM;wBAChB,OAAO,EAAE,CAAC,CAAC,OAAO;qBACnB,CAAC;gBACJ,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,uFAAuF;gBACvF,MAAM,CAAC,MAAM,CAAC,GAAG;oBACf,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,EAAE;oBACR,QAAQ,EAAE,WAAW;oBACrB,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,OAAO,EAAE,CAAC,CAAC,OAAO;iBACnB,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,0DAA0D;QAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic API types for spec-gen
|
|
3
|
+
*
|
|
4
|
+
* These types define the options and results for the spec-gen API functions.
|
|
5
|
+
* They are designed for programmatic consumers (like OpenSpec CLI) and are
|
|
6
|
+
* free of CLI-specific concerns (no process.exit, no console.log).
|
|
7
|
+
*/
|
|
8
|
+
import type { RepositoryMap as CoreRepositoryMap } from '../core/analyzer/repository-mapper.js';
|
|
9
|
+
import type { DependencyGraphResult } from '../core/analyzer/dependency-graph.js';
|
|
10
|
+
import type { AnalysisArtifacts } from '../core/analyzer/artifact-generator.js';
|
|
11
|
+
import type { PipelineResult } from '../core/generator/spec-pipeline.js';
|
|
12
|
+
import type { GenerationReport } from '../core/generator/openspec-writer.js';
|
|
13
|
+
import type { VerificationReport } from '../core/verifier/verification-engine.js';
|
|
14
|
+
import type { DriftResult, DriftSeverity } from '../types/index.js';
|
|
15
|
+
export type { CoreRepositoryMap as RepositoryMap };
|
|
16
|
+
export type { DependencyGraphResult };
|
|
17
|
+
export type { AnalysisArtifacts };
|
|
18
|
+
export type { PipelineResult };
|
|
19
|
+
export type { GenerationReport };
|
|
20
|
+
export type { VerificationReport };
|
|
21
|
+
export type { DriftResult, DriftSeverity };
|
|
22
|
+
/** Progress callback for consumers to show their own UI */
|
|
23
|
+
export type ProgressCallback = (event: ProgressEvent) => void;
|
|
24
|
+
export interface ProgressEvent {
|
|
25
|
+
/** Which phase is reporting: 'init' | 'analyze' | 'generate' | 'verify' | 'drift' */
|
|
26
|
+
phase: string;
|
|
27
|
+
/** Human-readable step description */
|
|
28
|
+
step: string;
|
|
29
|
+
/** Current status of this step */
|
|
30
|
+
status: 'start' | 'progress' | 'complete' | 'skip';
|
|
31
|
+
/** Optional extra detail */
|
|
32
|
+
detail?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Base options shared by all API functions */
|
|
35
|
+
export interface BaseOptions {
|
|
36
|
+
/** Project root path. Default: process.cwd() */
|
|
37
|
+
rootPath?: string;
|
|
38
|
+
/** Path to spec-gen config file. Default: '.spec-gen/config.json' */
|
|
39
|
+
configPath?: string;
|
|
40
|
+
/** Progress callback for status updates */
|
|
41
|
+
onProgress?: ProgressCallback;
|
|
42
|
+
}
|
|
43
|
+
export interface InitApiOptions extends BaseOptions {
|
|
44
|
+
/** Overwrite existing configuration */
|
|
45
|
+
force?: boolean;
|
|
46
|
+
/** Custom path for openspec/ output directory. Default: './openspec' */
|
|
47
|
+
openspecPath?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface InitResult {
|
|
50
|
+
/** Path to the created config file */
|
|
51
|
+
configPath: string;
|
|
52
|
+
/** Path to the openspec directory */
|
|
53
|
+
openspecPath: string;
|
|
54
|
+
/** Detected project type */
|
|
55
|
+
projectType: string;
|
|
56
|
+
/** Whether a new config was created (false if already existed and !force) */
|
|
57
|
+
created: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface AnalyzeApiOptions extends BaseOptions {
|
|
60
|
+
/** Maximum files to analyze. Default: 500 */
|
|
61
|
+
maxFiles?: number;
|
|
62
|
+
/** Additional glob patterns to include */
|
|
63
|
+
includePatterns?: string[];
|
|
64
|
+
/** Additional glob patterns to exclude */
|
|
65
|
+
excludePatterns?: string[];
|
|
66
|
+
/** Force re-analysis even if recent analysis exists */
|
|
67
|
+
force?: boolean;
|
|
68
|
+
/** Output directory for analysis artifacts. Default: '.spec-gen/analysis/' */
|
|
69
|
+
outputPath?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface AnalyzeResult {
|
|
72
|
+
repoMap: CoreRepositoryMap;
|
|
73
|
+
depGraph: DependencyGraphResult;
|
|
74
|
+
artifacts: AnalysisArtifacts;
|
|
75
|
+
duration: number;
|
|
76
|
+
}
|
|
77
|
+
export interface GenerateApiOptions extends BaseOptions {
|
|
78
|
+
/** LLM provider to use */
|
|
79
|
+
provider?: 'anthropic' | 'openai' | 'openai-compat' | 'gemini';
|
|
80
|
+
/** LLM model name */
|
|
81
|
+
model?: string;
|
|
82
|
+
/** Custom LLM API base URL */
|
|
83
|
+
apiBase?: string;
|
|
84
|
+
/** Enable/disable SSL certificate verification. Default: true */
|
|
85
|
+
sslVerify?: boolean;
|
|
86
|
+
/** OpenAI-compatible base URL (for Mistral, Groq, Ollama, etc.) */
|
|
87
|
+
openaiCompatBaseUrl?: string;
|
|
88
|
+
/** Only generate specific domains */
|
|
89
|
+
domains?: string[];
|
|
90
|
+
/** Write mode for existing specs */
|
|
91
|
+
writeMode?: 'replace' | 'merge' | 'skip';
|
|
92
|
+
/** Generate Architecture Decision Records */
|
|
93
|
+
adr?: boolean;
|
|
94
|
+
/** Only generate ADRs (skip spec generation) */
|
|
95
|
+
adrOnly?: boolean;
|
|
96
|
+
/** Generate requirement-to-function mapping */
|
|
97
|
+
mapping?: boolean;
|
|
98
|
+
/** Preview what would be generated without writing */
|
|
99
|
+
dryRun?: boolean;
|
|
100
|
+
/** Path to analysis directory. Default: '.spec-gen/analysis/' */
|
|
101
|
+
analysisPath?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface GenerateResult {
|
|
104
|
+
report: GenerationReport;
|
|
105
|
+
pipelineResult: PipelineResult;
|
|
106
|
+
duration: number;
|
|
107
|
+
}
|
|
108
|
+
export interface VerifyApiOptions extends BaseOptions {
|
|
109
|
+
/** LLM provider to use */
|
|
110
|
+
provider?: 'anthropic' | 'openai' | 'openai-compat' | 'gemini';
|
|
111
|
+
/** LLM model name */
|
|
112
|
+
model?: string;
|
|
113
|
+
/** Custom LLM API base URL */
|
|
114
|
+
apiBase?: string;
|
|
115
|
+
/** Enable/disable SSL certificate verification. Default: true */
|
|
116
|
+
sslVerify?: boolean;
|
|
117
|
+
/** Number of files to sample for verification. Default: 5 */
|
|
118
|
+
samples?: number;
|
|
119
|
+
/** Minimum confidence score to pass. Default: 0.7 */
|
|
120
|
+
threshold?: number;
|
|
121
|
+
/** Only verify specific domains */
|
|
122
|
+
domains?: string[];
|
|
123
|
+
}
|
|
124
|
+
export interface VerifyResult {
|
|
125
|
+
report: VerificationReport;
|
|
126
|
+
duration: number;
|
|
127
|
+
}
|
|
128
|
+
export interface DriftApiOptions extends BaseOptions {
|
|
129
|
+
/** Git ref to compare against. Default: 'auto' (auto-detect main/master) */
|
|
130
|
+
baseRef?: string;
|
|
131
|
+
/** Specific files to check */
|
|
132
|
+
files?: string[];
|
|
133
|
+
/** Only check specific domains */
|
|
134
|
+
domains?: string[];
|
|
135
|
+
/** Use LLM for deeper semantic comparison */
|
|
136
|
+
llmEnhanced?: boolean;
|
|
137
|
+
/** LLM provider (required if llmEnhanced is true) */
|
|
138
|
+
provider?: 'anthropic' | 'openai' | 'openai-compat' | 'gemini';
|
|
139
|
+
/** Custom LLM API base URL */
|
|
140
|
+
apiBase?: string;
|
|
141
|
+
/** Enable/disable SSL certificate verification. Default: true */
|
|
142
|
+
sslVerify?: boolean;
|
|
143
|
+
/** Exit threshold severity. Default: 'warning' */
|
|
144
|
+
failOn?: DriftSeverity;
|
|
145
|
+
/** Maximum changed files to analyze. Default: 100 */
|
|
146
|
+
maxFiles?: number;
|
|
147
|
+
}
|
|
148
|
+
export interface RunApiOptions extends BaseOptions {
|
|
149
|
+
/** Reinitialize even if config exists */
|
|
150
|
+
force?: boolean;
|
|
151
|
+
/** Force fresh analysis even if recent exists */
|
|
152
|
+
reanalyze?: boolean;
|
|
153
|
+
/** LLM provider to use */
|
|
154
|
+
provider?: 'anthropic' | 'openai' | 'openai-compat' | 'gemini';
|
|
155
|
+
/** LLM model name */
|
|
156
|
+
model?: string;
|
|
157
|
+
/** Custom LLM API base URL */
|
|
158
|
+
apiBase?: string;
|
|
159
|
+
/** Enable/disable SSL certificate verification. Default: true */
|
|
160
|
+
sslVerify?: boolean;
|
|
161
|
+
/** OpenAI-compatible base URL */
|
|
162
|
+
openaiCompatBaseUrl?: string;
|
|
163
|
+
/** Maximum files to analyze. Default: 500 */
|
|
164
|
+
maxFiles?: number;
|
|
165
|
+
/** Generate Architecture Decision Records */
|
|
166
|
+
adr?: boolean;
|
|
167
|
+
/** Preview what would happen without changes */
|
|
168
|
+
dryRun?: boolean;
|
|
169
|
+
}
|
|
170
|
+
export interface RunResult {
|
|
171
|
+
init: InitResult;
|
|
172
|
+
analysis: AnalyzeResult;
|
|
173
|
+
generation: GenerateResult;
|
|
174
|
+
duration: number;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAChG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,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B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kDAAkD;IAClD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,eAAe,GAAG,QAAQ,CAAC;IAC/D,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,gDAAgD;IAChD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic API types for spec-gen
|
|
3
|
+
*
|
|
4
|
+
* These types define the options and results for the spec-gen API functions.
|
|
5
|
+
* They are designed for programmatic consumers (like OpenSpec CLI) and are
|
|
6
|
+
* free of CLI-specific concerns (no process.exit, no console.log).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spec-gen verify — programmatic API
|
|
3
|
+
*
|
|
4
|
+
* Tests generated spec accuracy against actual source code.
|
|
5
|
+
* No side effects (no process.exit, no console.log).
|
|
6
|
+
*/
|
|
7
|
+
import type { VerifyApiOptions, VerifyResult } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Verify generated specs against actual source code.
|
|
10
|
+
*
|
|
11
|
+
* Samples files and validates that specs accurately describe behavior
|
|
12
|
+
* using an LLM to predict behavior from specs and compare against code.
|
|
13
|
+
*
|
|
14
|
+
* @throws Error if no spec-gen configuration found
|
|
15
|
+
* @throws Error if no specs or analysis found
|
|
16
|
+
* @throws Error if no LLM API key found
|
|
17
|
+
* @throws Error if no verification candidates found
|
|
18
|
+
*/
|
|
19
|
+
export declare function specGenVerify(options?: VerifyApiOptions): Promise<VerifyResult>;
|
|
20
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/api/verify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAoB,MAAM,YAAY,CAAC;AAenF;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,CA2FzF"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spec-gen verify — programmatic API
|
|
3
|
+
*
|
|
4
|
+
* Tests generated spec accuracy against actual source code.
|
|
5
|
+
* No side effects (no process.exit, no console.log).
|
|
6
|
+
*/
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { access, readFile } from 'node:fs/promises';
|
|
9
|
+
import { readSpecGenConfig } from '../core/services/config-manager.js';
|
|
10
|
+
import { createLLMService } from '../core/services/llm-service.js';
|
|
11
|
+
import { SpecVerificationEngine } from '../core/verifier/verification-engine.js';
|
|
12
|
+
function progress(onProgress, step, status, detail) {
|
|
13
|
+
onProgress?.({ phase: 'verify', step, status, detail });
|
|
14
|
+
}
|
|
15
|
+
async function fileExists(path) {
|
|
16
|
+
try {
|
|
17
|
+
await access(path);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Verify generated specs against actual source code.
|
|
26
|
+
*
|
|
27
|
+
* Samples files and validates that specs accurately describe behavior
|
|
28
|
+
* using an LLM to predict behavior from specs and compare against code.
|
|
29
|
+
*
|
|
30
|
+
* @throws Error if no spec-gen configuration found
|
|
31
|
+
* @throws Error if no specs or analysis found
|
|
32
|
+
* @throws Error if no LLM API key found
|
|
33
|
+
* @throws Error if no verification candidates found
|
|
34
|
+
*/
|
|
35
|
+
export async function specGenVerify(options = {}) {
|
|
36
|
+
const startTime = Date.now();
|
|
37
|
+
const rootPath = options.rootPath ?? process.cwd();
|
|
38
|
+
const samples = options.samples ?? 5;
|
|
39
|
+
const threshold = options.threshold ?? 0.7;
|
|
40
|
+
const { onProgress } = options;
|
|
41
|
+
// Load config
|
|
42
|
+
const specGenConfig = await readSpecGenConfig(rootPath);
|
|
43
|
+
if (!specGenConfig) {
|
|
44
|
+
throw new Error('No spec-gen configuration found. Run specGenInit() first.');
|
|
45
|
+
}
|
|
46
|
+
// Check specs exist
|
|
47
|
+
const openspecPath = join(rootPath, specGenConfig.openspecPath ?? 'openspec');
|
|
48
|
+
const specsPath = join(openspecPath, 'specs');
|
|
49
|
+
if (!(await fileExists(specsPath))) {
|
|
50
|
+
throw new Error('No specs found. Run specGenGenerate() first.');
|
|
51
|
+
}
|
|
52
|
+
// Load dependency graph
|
|
53
|
+
progress(onProgress, 'Loading analysis', 'start');
|
|
54
|
+
const analysisPath = join(rootPath, '.spec-gen', 'analysis');
|
|
55
|
+
const depGraphPath = join(analysisPath, 'dependency-graph.json');
|
|
56
|
+
if (!(await fileExists(depGraphPath))) {
|
|
57
|
+
throw new Error('No analysis found. Run specGenAnalyze() first.');
|
|
58
|
+
}
|
|
59
|
+
const depGraphContent = await readFile(depGraphPath, 'utf-8');
|
|
60
|
+
const depGraph = JSON.parse(depGraphContent);
|
|
61
|
+
// Load generation report
|
|
62
|
+
let generationContext = [];
|
|
63
|
+
const reportPath = join(rootPath, '.spec-gen', 'outputs', 'generation-report.json');
|
|
64
|
+
if (await fileExists(reportPath)) {
|
|
65
|
+
const reportContent = await readFile(reportPath, 'utf-8');
|
|
66
|
+
const genReport = JSON.parse(reportContent);
|
|
67
|
+
generationContext = genReport.filesWritten ?? [];
|
|
68
|
+
}
|
|
69
|
+
progress(onProgress, 'Loading analysis', 'complete');
|
|
70
|
+
// Create LLM service
|
|
71
|
+
const anthropicKey = process.env.ANTHROPIC_API_KEY;
|
|
72
|
+
const openaiKey = process.env.OPENAI_API_KEY;
|
|
73
|
+
if (!anthropicKey && !openaiKey) {
|
|
74
|
+
throw new Error('No LLM API key found. Set ANTHROPIC_API_KEY or OPENAI_API_KEY.');
|
|
75
|
+
}
|
|
76
|
+
const provider = options.provider ?? (anthropicKey ? 'anthropic' : 'openai');
|
|
77
|
+
let llm;
|
|
78
|
+
try {
|
|
79
|
+
llm = createLLMService({
|
|
80
|
+
provider,
|
|
81
|
+
model: options.model,
|
|
82
|
+
apiBase: options.apiBase ?? specGenConfig.llm?.apiBase,
|
|
83
|
+
sslVerify: options.sslVerify ?? specGenConfig.llm?.sslVerify ?? true,
|
|
84
|
+
enableLogging: true,
|
|
85
|
+
logDir: join(rootPath, '.spec-gen', 'logs'),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
throw new Error(`Failed to create LLM service: ${error.message}`);
|
|
90
|
+
}
|
|
91
|
+
// Run verification
|
|
92
|
+
progress(onProgress, 'Selecting verification files', 'start');
|
|
93
|
+
const verificationDir = join(rootPath, '.spec-gen', 'verification');
|
|
94
|
+
const engine = new SpecVerificationEngine(llm, {
|
|
95
|
+
rootPath,
|
|
96
|
+
openspecPath,
|
|
97
|
+
outputDir: verificationDir,
|
|
98
|
+
filesPerDomain: Math.ceil(samples / 4),
|
|
99
|
+
passThreshold: threshold,
|
|
100
|
+
generationContext,
|
|
101
|
+
});
|
|
102
|
+
const candidates = engine.selectCandidates(depGraph);
|
|
103
|
+
if (candidates.length === 0) {
|
|
104
|
+
throw new Error('No suitable verification candidates found.');
|
|
105
|
+
}
|
|
106
|
+
progress(onProgress, 'Selecting verification files', 'complete', `${Math.min(candidates.length, samples)} candidates`);
|
|
107
|
+
progress(onProgress, 'Verifying specs against codebase', 'start');
|
|
108
|
+
const report = await engine.verify(depGraph, specGenConfig.version);
|
|
109
|
+
progress(onProgress, 'Verifying specs against codebase', 'complete', `${(report.overallConfidence * 100).toFixed(0)}% confidence`);
|
|
110
|
+
// Save LLM logs
|
|
111
|
+
await llm.saveLogs().catch(() => { });
|
|
112
|
+
return {
|
|
113
|
+
report,
|
|
114
|
+
duration: Date.now() - startTime,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/api/verify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAA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C;IAChE,CAAC;IACD,QAAQ,CAAC,UAAU,EAAE,8BAA8B,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEvH,QAAQ,CAAC,UAAU,EAAE,kCAAkC,EAAE,OAAO,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACpE,QAAQ,CAAC,UAAU,EAAE,kCAAkC,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,iBAAiB,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAEnI,gBAAgB;IAChB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAErC,OAAO;QACL,MAAM;QACN,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spec-gen analyze command
|
|
3
|
+
*
|
|
4
|
+
* Runs static analysis on the codebase without LLM involvement.
|
|
5
|
+
* Outputs repository map, dependency graph, and file significance scores.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
import { type RepositoryMap } from '../../core/analyzer/repository-mapper.js';
|
|
9
|
+
import { type DependencyGraphResult } from '../../core/analyzer/dependency-graph.js';
|
|
10
|
+
import { type AnalysisArtifacts } from '../../core/analyzer/artifact-generator.js';
|
|
11
|
+
interface AnalysisResult {
|
|
12
|
+
repoMap: RepositoryMap;
|
|
13
|
+
depGraph: DependencyGraphResult;
|
|
14
|
+
artifacts: AnalysisArtifacts;
|
|
15
|
+
duration: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Run the complete analysis pipeline
|
|
19
|
+
*/
|
|
20
|
+
export declare function runAnalysis(rootPath: string, outputPath: string, options: {
|
|
21
|
+
maxFiles: number;
|
|
22
|
+
include: string[];
|
|
23
|
+
exclude: string[];
|
|
24
|
+
}): Promise<AnalysisResult>;
|
|
25
|
+
export declare const analyzeCommand: Command;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/analyze.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEhG,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,2CAA2C,CAAC;AAenD,UAAU,cAAc;IACtB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GACA,OAAO,CAAC,cAAc,CAAC,CAiEzB;AAMD,eAAO,MAAM,cAAc,SAwZvB,CAAC"}
|