spectra-cli 4.1.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/LICENSE +21 -0
- package/README.md +350 -0
- package/dist/adapters/go-adapter.d.ts +38 -0
- package/dist/adapters/go-adapter.d.ts.map +1 -0
- package/dist/adapters/go-adapter.js +58 -0
- package/dist/adapters/go-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +21 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +36 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/java-adapter.d.ts +39 -0
- package/dist/adapters/java-adapter.d.ts.map +1 -0
- package/dist/adapters/java-adapter.js +65 -0
- package/dist/adapters/java-adapter.js.map +1 -0
- package/dist/adapters/language-adapter-registry.d.ts +56 -0
- package/dist/adapters/language-adapter-registry.d.ts.map +1 -0
- package/dist/adapters/language-adapter-registry.js +110 -0
- package/dist/adapters/language-adapter-registry.js.map +1 -0
- package/dist/adapters/language-adapter.d.ts +127 -0
- package/dist/adapters/language-adapter.d.ts.map +1 -0
- package/dist/adapters/language-adapter.js +2 -0
- package/dist/adapters/language-adapter.js.map +1 -0
- package/dist/adapters/python-adapter.d.ts +61 -0
- package/dist/adapters/python-adapter.d.ts.map +1 -0
- package/dist/adapters/python-adapter.js +260 -0
- package/dist/adapters/python-adapter.js.map +1 -0
- package/dist/adapters/tree-sitter-comment-extractor.d.ts +15 -0
- package/dist/adapters/tree-sitter-comment-extractor.d.ts.map +1 -0
- package/dist/adapters/tree-sitter-comment-extractor.js +105 -0
- package/dist/adapters/tree-sitter-comment-extractor.js.map +1 -0
- package/dist/adapters/ts-js-adapter.d.ts +38 -0
- package/dist/adapters/ts-js-adapter.d.ts.map +1 -0
- package/dist/adapters/ts-js-adapter.js +164 -0
- package/dist/adapters/ts-js-adapter.js.map +1 -0
- package/dist/auth/auth-detector.d.ts +41 -0
- package/dist/auth/auth-detector.d.ts.map +1 -0
- package/dist/auth/auth-detector.js +324 -0
- package/dist/auth/auth-detector.js.map +1 -0
- package/dist/auth/cli-proxy.d.ts +35 -0
- package/dist/auth/cli-proxy.d.ts.map +1 -0
- package/dist/auth/cli-proxy.js +225 -0
- package/dist/auth/cli-proxy.js.map +1 -0
- package/dist/auth/codex-proxy.d.ts +22 -0
- package/dist/auth/codex-proxy.d.ts.map +1 -0
- package/dist/auth/codex-proxy.js +199 -0
- package/dist/auth/codex-proxy.js.map +1 -0
- package/dist/batch/batch-orchestrator.d.ts +214 -0
- package/dist/batch/batch-orchestrator.d.ts.map +1 -0
- package/dist/batch/batch-orchestrator.js +1552 -0
- package/dist/batch/batch-orchestrator.js.map +1 -0
- package/dist/batch/batch-readme-generator.d.ts +32 -0
- package/dist/batch/batch-readme-generator.d.ts.map +1 -0
- package/dist/batch/batch-readme-generator.js +153 -0
- package/dist/batch/batch-readme-generator.js.map +1 -0
- package/dist/batch/budget-gate.d.ts +107 -0
- package/dist/batch/budget-gate.d.ts.map +1 -0
- package/dist/batch/budget-gate.js +279 -0
- package/dist/batch/budget-gate.js.map +1 -0
- package/dist/batch/checkpoint.d.ts +25 -0
- package/dist/batch/checkpoint.d.ts.map +1 -0
- package/dist/batch/checkpoint.js +68 -0
- package/dist/batch/checkpoint.js.map +1 -0
- package/dist/batch/cost-summary.d.ts +78 -0
- package/dist/batch/cost-summary.d.ts.map +1 -0
- package/dist/batch/cost-summary.js +191 -0
- package/dist/batch/cost-summary.js.map +1 -0
- package/dist/batch/delta-regenerator.d.ts +41 -0
- package/dist/batch/delta-regenerator.d.ts.map +1 -0
- package/dist/batch/delta-regenerator.js +267 -0
- package/dist/batch/delta-regenerator.js.map +1 -0
- package/dist/batch/directory-classifier.d.ts +79 -0
- package/dist/batch/directory-classifier.d.ts.map +1 -0
- package/dist/batch/directory-classifier.js +270 -0
- package/dist/batch/directory-classifier.js.map +1 -0
- package/dist/batch/language-grouper.d.ts +28 -0
- package/dist/batch/language-grouper.d.ts.map +1 -0
- package/dist/batch/language-grouper.js +67 -0
- package/dist/batch/language-grouper.js.map +1 -0
- package/dist/batch/model-override-decision.d.ts +27 -0
- package/dist/batch/model-override-decision.d.ts.map +1 -0
- package/dist/batch/model-override-decision.js +14 -0
- package/dist/batch/model-override-decision.js.map +1 -0
- package/dist/batch/module-grouper.d.ts +59 -0
- package/dist/batch/module-grouper.d.ts.map +1 -0
- package/dist/batch/module-grouper.js +286 -0
- package/dist/batch/module-grouper.js.map +1 -0
- package/dist/batch/progress-reporter.d.ts +68 -0
- package/dist/batch/progress-reporter.d.ts.map +1 -0
- package/dist/batch/progress-reporter.js +273 -0
- package/dist/batch/progress-reporter.js.map +1 -0
- package/dist/batch/readme-graph-section.d.ts +53 -0
- package/dist/batch/readme-graph-section.d.ts.map +1 -0
- package/dist/batch/readme-graph-section.js +183 -0
- package/dist/batch/readme-graph-section.js.map +1 -0
- package/dist/cli/commands/auth-status.d.ts +10 -0
- package/dist/cli/commands/auth-status.d.ts.map +1 -0
- package/dist/cli/commands/auth-status.js +50 -0
- package/dist/cli/commands/auth-status.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +10 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +133 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/cache.d.ts +13 -0
- package/dist/cli/commands/cache.d.ts.map +1 -0
- package/dist/cli/commands/cache.js +65 -0
- package/dist/cli/commands/cache.js.map +1 -0
- package/dist/cli/commands/community.d.ts +10 -0
- package/dist/cli/commands/community.d.ts.map +1 -0
- package/dist/cli/commands/community.js +92 -0
- package/dist/cli/commands/community.js.map +1 -0
- package/dist/cli/commands/diff.d.ts +10 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/diff.js +49 -0
- package/dist/cli/commands/diff.js.map +1 -0
- package/dist/cli/commands/direction-audit.d.ts +12 -0
- package/dist/cli/commands/direction-audit.d.ts.map +1 -0
- package/dist/cli/commands/direction-audit.js +458 -0
- package/dist/cli/commands/direction-audit.js.map +1 -0
- package/dist/cli/commands/export.d.ts +22 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +123 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +10 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +50 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/graph.d.ts +20 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/graph.js +189 -0
- package/dist/cli/commands/graph.js.map +1 -0
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +33 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install.d.ts +11 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +52 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/mcp-server.d.ts +23 -0
- package/dist/cli/commands/mcp-server.d.ts.map +1 -0
- package/dist/cli/commands/mcp-server.js +90 -0
- package/dist/cli/commands/mcp-server.js.map +1 -0
- package/dist/cli/commands/panoramic.d.ts +7 -0
- package/dist/cli/commands/panoramic.d.ts.map +1 -0
- package/dist/cli/commands/panoramic.js +43 -0
- package/dist/cli/commands/panoramic.js.map +1 -0
- package/dist/cli/commands/prepare.d.ts +13 -0
- package/dist/cli/commands/prepare.d.ts.map +1 -0
- package/dist/cli/commands/prepare.js +148 -0
- package/dist/cli/commands/prepare.js.map +1 -0
- package/dist/cli/commands/query.d.ts +13 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +116 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +16 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +188 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +193 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/error-handler.d.ts +41 -0
- package/dist/cli/utils/error-handler.d.ts.map +1 -0
- package/dist/cli/utils/error-handler.js +90 -0
- package/dist/cli/utils/error-handler.js.map +1 -0
- package/dist/cli/utils/parse-args.d.ts +111 -0
- package/dist/cli/utils/parse-args.d.ts.map +1 -0
- package/dist/cli/utils/parse-args.js +756 -0
- package/dist/cli/utils/parse-args.js.map +1 -0
- package/dist/config/project-config.d.ts +49 -0
- package/dist/config/project-config.d.ts.map +1 -0
- package/dist/config/project-config.js +118 -0
- package/dist/config/project-config.js.map +1 -0
- package/dist/config/spec-driver-config.d.ts +32 -0
- package/dist/config/spec-driver-config.d.ts.map +1 -0
- package/dist/config/spec-driver-config.js +91 -0
- package/dist/config/spec-driver-config.js.map +1 -0
- package/dist/core/ast-analyzer.d.ts +49 -0
- package/dist/core/ast-analyzer.d.ts.map +1 -0
- package/dist/core/ast-analyzer.js +439 -0
- package/dist/core/ast-analyzer.js.map +1 -0
- package/dist/core/code-slice-extractor.d.ts +47 -0
- package/dist/core/code-slice-extractor.d.ts.map +1 -0
- package/dist/core/code-slice-extractor.js +227 -0
- package/dist/core/code-slice-extractor.js.map +1 -0
- package/dist/core/context-assembler.d.ts +80 -0
- package/dist/core/context-assembler.d.ts.map +1 -0
- package/dist/core/context-assembler.js +262 -0
- package/dist/core/context-assembler.js.map +1 -0
- package/dist/core/grammar-manager.d.ts +79 -0
- package/dist/core/grammar-manager.d.ts.map +1 -0
- package/dist/core/grammar-manager.js +188 -0
- package/dist/core/grammar-manager.js.map +1 -0
- package/dist/core/llm-client.d.ts +120 -0
- package/dist/core/llm-client.d.ts.map +1 -0
- package/dist/core/llm-client.js +608 -0
- package/dist/core/llm-client.js.map +1 -0
- package/dist/core/model-selection.d.ts +50 -0
- package/dist/core/model-selection.d.ts.map +1 -0
- package/dist/core/model-selection.js +410 -0
- package/dist/core/model-selection.js.map +1 -0
- package/dist/core/query-mappers/base-mapper.d.ts +22 -0
- package/dist/core/query-mappers/base-mapper.d.ts.map +1 -0
- package/dist/core/query-mappers/base-mapper.js +2 -0
- package/dist/core/query-mappers/base-mapper.js.map +1 -0
- package/dist/core/query-mappers/go-mapper.d.ts +46 -0
- package/dist/core/query-mappers/go-mapper.d.ts.map +1 -0
- package/dist/core/query-mappers/go-mapper.js +477 -0
- package/dist/core/query-mappers/go-mapper.js.map +1 -0
- package/dist/core/query-mappers/index.d.ts +6 -0
- package/dist/core/query-mappers/index.d.ts.map +1 -0
- package/dist/core/query-mappers/index.js +5 -0
- package/dist/core/query-mappers/index.js.map +1 -0
- package/dist/core/query-mappers/java-mapper.d.ts +40 -0
- package/dist/core/query-mappers/java-mapper.d.ts.map +1 -0
- package/dist/core/query-mappers/java-mapper.js +405 -0
- package/dist/core/query-mappers/java-mapper.js.map +1 -0
- package/dist/core/query-mappers/python-mapper.d.ts +65 -0
- package/dist/core/query-mappers/python-mapper.d.ts.map +1 -0
- package/dist/core/query-mappers/python-mapper.js +673 -0
- package/dist/core/query-mappers/python-mapper.js.map +1 -0
- package/dist/core/query-mappers/typescript-mapper.d.ts +54 -0
- package/dist/core/query-mappers/typescript-mapper.d.ts.map +1 -0
- package/dist/core/query-mappers/typescript-mapper.js +706 -0
- package/dist/core/query-mappers/typescript-mapper.js.map +1 -0
- package/dist/core/secret-redactor.d.ts +10 -0
- package/dist/core/secret-redactor.d.ts.map +1 -0
- package/dist/core/secret-redactor.js +208 -0
- package/dist/core/secret-redactor.js.map +1 -0
- package/dist/core/single-spec-orchestrator.d.ts +103 -0
- package/dist/core/single-spec-orchestrator.d.ts.map +1 -0
- package/dist/core/single-spec-orchestrator.js +911 -0
- package/dist/core/single-spec-orchestrator.js.map +1 -0
- package/dist/core/token-counter.d.ts +48 -0
- package/dist/core/token-counter.d.ts.map +1 -0
- package/dist/core/token-counter.js +136 -0
- package/dist/core/token-counter.js.map +1 -0
- package/dist/core/tree-sitter-analyzer.d.ts +62 -0
- package/dist/core/tree-sitter-analyzer.d.ts.map +1 -0
- package/dist/core/tree-sitter-analyzer.js +229 -0
- package/dist/core/tree-sitter-analyzer.js.map +1 -0
- package/dist/core/tree-sitter-fallback.d.ts +14 -0
- package/dist/core/tree-sitter-fallback.d.ts.map +1 -0
- package/dist/core/tree-sitter-fallback.js +423 -0
- package/dist/core/tree-sitter-fallback.js.map +1 -0
- package/dist/debt-scanner/aggregator/quality-report-patcher.d.ts +22 -0
- package/dist/debt-scanner/aggregator/quality-report-patcher.d.ts.map +1 -0
- package/dist/debt-scanner/aggregator/quality-report-patcher.js +107 -0
- package/dist/debt-scanner/aggregator/quality-report-patcher.js.map +1 -0
- package/dist/debt-scanner/aggregator/readme-indexer.d.ts +6 -0
- package/dist/debt-scanner/aggregator/readme-indexer.d.ts.map +1 -0
- package/dist/debt-scanner/aggregator/readme-indexer.js +52 -0
- package/dist/debt-scanner/aggregator/readme-indexer.js.map +1 -0
- package/dist/debt-scanner/aggregator/report-builder.d.ts +25 -0
- package/dist/debt-scanner/aggregator/report-builder.d.ts.map +1 -0
- package/dist/debt-scanner/aggregator/report-builder.js +162 -0
- package/dist/debt-scanner/aggregator/report-builder.js.map +1 -0
- package/dist/debt-scanner/comments/debt-classifier.d.ts +28 -0
- package/dist/debt-scanner/comments/debt-classifier.d.ts.map +1 -0
- package/dist/debt-scanner/comments/debt-classifier.js +50 -0
- package/dist/debt-scanner/comments/debt-classifier.js.map +1 -0
- package/dist/debt-scanner/comments/index.d.ts +32 -0
- package/dist/debt-scanner/comments/index.d.ts.map +1 -0
- package/dist/debt-scanner/comments/index.js +103 -0
- package/dist/debt-scanner/comments/index.js.map +1 -0
- package/dist/debt-scanner/comments/symbol-resolver.d.ts +18 -0
- package/dist/debt-scanner/comments/symbol-resolver.d.ts.map +1 -0
- package/dist/debt-scanner/comments/symbol-resolver.js +18 -0
- package/dist/debt-scanner/comments/symbol-resolver.js.map +1 -0
- package/dist/debt-scanner/design-docs/doc-discoverer.d.ts +6 -0
- package/dist/debt-scanner/design-docs/doc-discoverer.d.ts.map +1 -0
- package/dist/debt-scanner/design-docs/doc-discoverer.js +62 -0
- package/dist/debt-scanner/design-docs/doc-discoverer.js.map +1 -0
- package/dist/debt-scanner/design-docs/index.d.ts +28 -0
- package/dist/debt-scanner/design-docs/index.d.ts.map +1 -0
- package/dist/debt-scanner/design-docs/index.js +60 -0
- package/dist/debt-scanner/design-docs/index.js.map +1 -0
- package/dist/debt-scanner/design-docs/llm-topic-inferrer.d.ts +68 -0
- package/dist/debt-scanner/design-docs/llm-topic-inferrer.d.ts.map +1 -0
- package/dist/debt-scanner/design-docs/llm-topic-inferrer.js +151 -0
- package/dist/debt-scanner/design-docs/llm-topic-inferrer.js.map +1 -0
- package/dist/debt-scanner/design-docs/markdown-sections.d.ts +24 -0
- package/dist/debt-scanner/design-docs/markdown-sections.d.ts.map +1 -0
- package/dist/debt-scanner/design-docs/markdown-sections.js +92 -0
- package/dist/debt-scanner/design-docs/markdown-sections.js.map +1 -0
- package/dist/debt-scanner/design-docs/rule-detector.d.ts +18 -0
- package/dist/debt-scanner/design-docs/rule-detector.d.ts.map +1 -0
- package/dist/debt-scanner/design-docs/rule-detector.js +46 -0
- package/dist/debt-scanner/design-docs/rule-detector.js.map +1 -0
- package/dist/debt-scanner/index.d.ts +43 -0
- package/dist/debt-scanner/index.d.ts.map +1 -0
- package/dist/debt-scanner/index.js +177 -0
- package/dist/debt-scanner/index.js.map +1 -0
- package/dist/debt-scanner/llm-clients.d.ts +33 -0
- package/dist/debt-scanner/llm-clients.d.ts.map +1 -0
- package/dist/debt-scanner/llm-clients.js +78 -0
- package/dist/debt-scanner/llm-clients.js.map +1 -0
- package/dist/debt-scanner/types.d.ts +97 -0
- package/dist/debt-scanner/types.d.ts.map +1 -0
- package/dist/debt-scanner/types.js +7 -0
- package/dist/debt-scanner/types.js.map +1 -0
- package/dist/diff/drift-orchestrator.d.ts +25 -0
- package/dist/diff/drift-orchestrator.d.ts.map +1 -0
- package/dist/diff/drift-orchestrator.js +248 -0
- package/dist/diff/drift-orchestrator.js.map +1 -0
- package/dist/diff/noise-filter.d.ts +27 -0
- package/dist/diff/noise-filter.d.ts.map +1 -0
- package/dist/diff/noise-filter.js +129 -0
- package/dist/diff/noise-filter.js.map +1 -0
- package/dist/diff/semantic-diff.d.ts +12 -0
- package/dist/diff/semantic-diff.d.ts.map +1 -0
- package/dist/diff/semantic-diff.js +94 -0
- package/dist/diff/semantic-diff.js.map +1 -0
- package/dist/diff/structural-diff.d.ts +16 -0
- package/dist/diff/structural-diff.d.ts.map +1 -0
- package/dist/diff/structural-diff.js +171 -0
- package/dist/diff/structural-diff.js.map +1 -0
- package/dist/extraction/artifact-classifier.d.ts +19 -0
- package/dist/extraction/artifact-classifier.d.ts.map +1 -0
- package/dist/extraction/artifact-classifier.js +104 -0
- package/dist/extraction/artifact-classifier.js.map +1 -0
- package/dist/extraction/extraction-cache.d.ts +32 -0
- package/dist/extraction/extraction-cache.d.ts.map +1 -0
- package/dist/extraction/extraction-cache.js +117 -0
- package/dist/extraction/extraction-cache.js.map +1 -0
- package/dist/extraction/extraction-pipeline.d.ts +44 -0
- package/dist/extraction/extraction-pipeline.d.ts.map +1 -0
- package/dist/extraction/extraction-pipeline.js +286 -0
- package/dist/extraction/extraction-pipeline.js.map +1 -0
- package/dist/extraction/extraction-types.d.ts +180 -0
- package/dist/extraction/extraction-types.d.ts.map +1 -0
- package/dist/extraction/extraction-types.js +63 -0
- package/dist/extraction/extraction-types.js.map +1 -0
- package/dist/extraction/image-extractor.d.ts +21 -0
- package/dist/extraction/image-extractor.d.ts.map +1 -0
- package/dist/extraction/image-extractor.js +211 -0
- package/dist/extraction/image-extractor.js.map +1 -0
- package/dist/extraction/index.d.ts +8 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +6 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/markdown-extractor.d.ts +11 -0
- package/dist/extraction/markdown-extractor.d.ts.map +1 -0
- package/dist/extraction/markdown-extractor.js +212 -0
- package/dist/extraction/markdown-extractor.js.map +1 -0
- package/dist/extraction/openapi-extractor.d.ts +10 -0
- package/dist/extraction/openapi-extractor.d.ts.map +1 -0
- package/dist/extraction/openapi-extractor.js +449 -0
- package/dist/extraction/openapi-extractor.js.map +1 -0
- package/dist/generator/frontmatter.d.ts +58 -0
- package/dist/generator/frontmatter.d.ts.map +1 -0
- package/dist/generator/frontmatter.js +100 -0
- package/dist/generator/frontmatter.js.map +1 -0
- package/dist/generator/index-generator.d.ts +27 -0
- package/dist/generator/index-generator.d.ts.map +1 -0
- package/dist/generator/index-generator.js +129 -0
- package/dist/generator/index-generator.js.map +1 -0
- package/dist/generator/mermaid-class-diagram.d.ts +14 -0
- package/dist/generator/mermaid-class-diagram.d.ts.map +1 -0
- package/dist/generator/mermaid-class-diagram.js +115 -0
- package/dist/generator/mermaid-class-diagram.js.map +1 -0
- package/dist/generator/mermaid-dependency-graph.d.ts +15 -0
- package/dist/generator/mermaid-dependency-graph.d.ts.map +1 -0
- package/dist/generator/mermaid-dependency-graph.js +84 -0
- package/dist/generator/mermaid-dependency-graph.js.map +1 -0
- package/dist/generator/spec-renderer.d.ts +24 -0
- package/dist/generator/spec-renderer.d.ts.map +1 -0
- package/dist/generator/spec-renderer.js +110 -0
- package/dist/generator/spec-renderer.js.map +1 -0
- package/dist/graph/dependency-graph.d.ts +24 -0
- package/dist/graph/dependency-graph.d.ts.map +1 -0
- package/dist/graph/dependency-graph.js +206 -0
- package/dist/graph/dependency-graph.js.map +1 -0
- package/dist/graph/directory-graph.d.ts +16 -0
- package/dist/graph/directory-graph.d.ts.map +1 -0
- package/dist/graph/directory-graph.js +281 -0
- package/dist/graph/directory-graph.js.map +1 -0
- package/dist/graph/mermaid-renderer.d.ts +22 -0
- package/dist/graph/mermaid-renderer.d.ts.map +1 -0
- package/dist/graph/mermaid-renderer.js +133 -0
- package/dist/graph/mermaid-renderer.js.map +1 -0
- package/dist/graph/topological-sort.d.ts +31 -0
- package/dist/graph/topological-sort.d.ts.map +1 -0
- package/dist/graph/topological-sort.js +167 -0
- package/dist/graph/topological-sort.js.map +1 -0
- package/dist/hooks/git-hook-installer.d.ts +37 -0
- package/dist/hooks/git-hook-installer.d.ts.map +1 -0
- package/dist/hooks/git-hook-installer.js +136 -0
- package/dist/hooks/git-hook-installer.js.map +1 -0
- package/dist/hooks/hook-installer.d.ts +39 -0
- package/dist/hooks/hook-installer.d.ts.map +1 -0
- package/dist/hooks/hook-installer.js +164 -0
- package/dist/hooks/hook-installer.js.map +1 -0
- package/dist/installer/skill-installer.d.ts +63 -0
- package/dist/installer/skill-installer.d.ts.map +1 -0
- package/dist/installer/skill-installer.js +203 -0
- package/dist/installer/skill-installer.js.map +1 -0
- package/dist/installer/skill-templates.d.ts +19 -0
- package/dist/installer/skill-templates.d.ts.map +1 -0
- package/dist/installer/skill-templates.js +42 -0
- package/dist/installer/skill-templates.js.map +1 -0
- package/dist/mcp/graph-tools.d.ts +17 -0
- package/dist/mcp/graph-tools.d.ts.map +1 -0
- package/dist/mcp/graph-tools.js +269 -0
- package/dist/mcp/graph-tools.js.map +1 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +18 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +235 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/models/code-skeleton.d.ts +394 -0
- package/dist/models/code-skeleton.d.ts.map +1 -0
- package/dist/models/code-skeleton.js +119 -0
- package/dist/models/code-skeleton.js.map +1 -0
- package/dist/models/dependency-graph.d.ts +172 -0
- package/dist/models/dependency-graph.d.ts.map +1 -0
- package/dist/models/dependency-graph.js +44 -0
- package/dist/models/dependency-graph.js.map +1 -0
- package/dist/models/drift-item.d.ts +104 -0
- package/dist/models/drift-item.d.ts.map +1 -0
- package/dist/models/drift-item.js +38 -0
- package/dist/models/drift-item.js.map +1 -0
- package/dist/models/module-spec.d.ts +1905 -0
- package/dist/models/module-spec.d.ts.map +1 -0
- package/dist/models/module-spec.js +272 -0
- package/dist/models/module-spec.js.map +1 -0
- package/dist/panoramic/abstract-registry.d.ts +87 -0
- package/dist/panoramic/abstract-registry.d.ts.map +1 -0
- package/dist/panoramic/abstract-registry.js +88 -0
- package/dist/panoramic/abstract-registry.js.map +1 -0
- package/dist/panoramic/anchoring/chunker.d.ts +34 -0
- package/dist/panoramic/anchoring/chunker.d.ts.map +1 -0
- package/dist/panoramic/anchoring/chunker.js +274 -0
- package/dist/panoramic/anchoring/chunker.js.map +1 -0
- package/dist/panoramic/anchoring/edge-builder.d.ts +53 -0
- package/dist/panoramic/anchoring/edge-builder.d.ts.map +1 -0
- package/dist/panoramic/anchoring/edge-builder.js +183 -0
- package/dist/panoramic/anchoring/edge-builder.js.map +1 -0
- package/dist/panoramic/anchoring/embedding-provider.d.ts +51 -0
- package/dist/panoramic/anchoring/embedding-provider.d.ts.map +1 -0
- package/dist/panoramic/anchoring/embedding-provider.js +7 -0
- package/dist/panoramic/anchoring/embedding-provider.js.map +1 -0
- package/dist/panoramic/anchoring/index.d.ts +73 -0
- package/dist/panoramic/anchoring/index.d.ts.map +1 -0
- package/dist/panoramic/anchoring/index.js +91 -0
- package/dist/panoramic/anchoring/index.js.map +1 -0
- package/dist/panoramic/anchoring/providers/factory.d.ts +35 -0
- package/dist/panoramic/anchoring/providers/factory.d.ts.map +1 -0
- package/dist/panoramic/anchoring/providers/factory.js +33 -0
- package/dist/panoramic/anchoring/providers/factory.js.map +1 -0
- package/dist/panoramic/anchoring/providers/local-provider.d.ts +48 -0
- package/dist/panoramic/anchoring/providers/local-provider.d.ts.map +1 -0
- package/dist/panoramic/anchoring/providers/local-provider.js +145 -0
- package/dist/panoramic/anchoring/providers/local-provider.js.map +1 -0
- package/dist/panoramic/anchoring/providers/openai-provider.d.ts +45 -0
- package/dist/panoramic/anchoring/providers/openai-provider.d.ts.map +1 -0
- package/dist/panoramic/anchoring/providers/openai-provider.js +78 -0
- package/dist/panoramic/anchoring/providers/openai-provider.js.map +1 -0
- package/dist/panoramic/anchoring/similarity.d.ts +37 -0
- package/dist/panoramic/anchoring/similarity.d.ts.map +1 -0
- package/dist/panoramic/anchoring/similarity.js +75 -0
- package/dist/panoramic/anchoring/similarity.js.map +1 -0
- package/dist/panoramic/api-surface/endpoint-utils.d.ts +15 -0
- package/dist/panoramic/api-surface/endpoint-utils.d.ts.map +1 -0
- package/dist/panoramic/api-surface/endpoint-utils.js +145 -0
- package/dist/panoramic/api-surface/endpoint-utils.js.map +1 -0
- package/dist/panoramic/api-surface/express-extractor.d.ts +3 -0
- package/dist/panoramic/api-surface/express-extractor.d.ts.map +1 -0
- package/dist/panoramic/api-surface/express-extractor.js +288 -0
- package/dist/panoramic/api-surface/express-extractor.js.map +1 -0
- package/dist/panoramic/api-surface/fastapi-extractor.d.ts +6 -0
- package/dist/panoramic/api-surface/fastapi-extractor.d.ts.map +1 -0
- package/dist/panoramic/api-surface/fastapi-extractor.js +287 -0
- package/dist/panoramic/api-surface/fastapi-extractor.js.map +1 -0
- package/dist/panoramic/api-surface/framework-introspection.d.ts +3 -0
- package/dist/panoramic/api-surface/framework-introspection.d.ts.map +1 -0
- package/dist/panoramic/api-surface/framework-introspection.js +189 -0
- package/dist/panoramic/api-surface/framework-introspection.js.map +1 -0
- package/dist/panoramic/api-surface/index.d.ts +13 -0
- package/dist/panoramic/api-surface/index.d.ts.map +1 -0
- package/dist/panoramic/api-surface/index.js +238 -0
- package/dist/panoramic/api-surface/index.js.map +1 -0
- package/dist/panoramic/api-surface/openapi-extractor.d.ts +3 -0
- package/dist/panoramic/api-surface/openapi-extractor.d.ts.map +1 -0
- package/dist/panoramic/api-surface/openapi-extractor.js +247 -0
- package/dist/panoramic/api-surface/openapi-extractor.js.map +1 -0
- package/dist/panoramic/api-surface/types.d.ts +140 -0
- package/dist/panoramic/api-surface/types.d.ts.map +1 -0
- package/dist/panoramic/api-surface/types.js +7 -0
- package/dist/panoramic/api-surface/types.js.map +1 -0
- package/dist/panoramic/api-surface/utils.d.ts +29 -0
- package/dist/panoramic/api-surface/utils.d.ts.map +1 -0
- package/dist/panoramic/api-surface/utils.js +340 -0
- package/dist/panoramic/api-surface/utils.js.map +1 -0
- package/dist/panoramic/batch-project-docs.d.ts +101 -0
- package/dist/panoramic/batch-project-docs.d.ts.map +1 -0
- package/dist/panoramic/batch-project-docs.js +616 -0
- package/dist/panoramic/batch-project-docs.js.map +1 -0
- package/dist/panoramic/builders/architecture-ir-builder.d.ts +19 -0
- package/dist/panoramic/builders/architecture-ir-builder.d.ts.map +1 -0
- package/dist/panoramic/builders/architecture-ir-builder.js +561 -0
- package/dist/panoramic/builders/architecture-ir-builder.js.map +1 -0
- package/dist/panoramic/builders/architecture-ir-mermaid-adapter.d.ts +6 -0
- package/dist/panoramic/builders/architecture-ir-mermaid-adapter.d.ts.map +1 -0
- package/dist/panoramic/builders/architecture-ir-mermaid-adapter.js +98 -0
- package/dist/panoramic/builders/architecture-ir-mermaid-adapter.js.map +1 -0
- package/dist/panoramic/builders/component-view-builder.d.ts +38 -0
- package/dist/panoramic/builders/component-view-builder.d.ts.map +1 -0
- package/dist/panoramic/builders/component-view-builder.js +694 -0
- package/dist/panoramic/builders/component-view-builder.js.map +1 -0
- package/dist/panoramic/builders/doc-graph-builder.d.ts +179 -0
- package/dist/panoramic/builders/doc-graph-builder.d.ts.map +1 -0
- package/dist/panoramic/builders/doc-graph-builder.js +546 -0
- package/dist/panoramic/builders/doc-graph-builder.js.map +1 -0
- package/dist/panoramic/builders/dynamic-scenarios-builder.d.ts +38 -0
- package/dist/panoramic/builders/dynamic-scenarios-builder.d.ts.map +1 -0
- package/dist/panoramic/builders/dynamic-scenarios-builder.js +361 -0
- package/dist/panoramic/builders/dynamic-scenarios-builder.js.map +1 -0
- package/dist/panoramic/cache/cache-key-builder.d.ts +25 -0
- package/dist/panoramic/cache/cache-key-builder.d.ts.map +1 -0
- package/dist/panoramic/cache/cache-key-builder.js +119 -0
- package/dist/panoramic/cache/cache-key-builder.js.map +1 -0
- package/dist/panoramic/cache/cache-manager.d.ts +58 -0
- package/dist/panoramic/cache/cache-manager.d.ts.map +1 -0
- package/dist/panoramic/cache/cache-manager.js +170 -0
- package/dist/panoramic/cache/cache-manager.js.map +1 -0
- package/dist/panoramic/cache/content-hasher.d.ts +47 -0
- package/dist/panoramic/cache/content-hasher.d.ts.map +1 -0
- package/dist/panoramic/cache/content-hasher.js +89 -0
- package/dist/panoramic/cache/content-hasher.js.map +1 -0
- package/dist/panoramic/cache/index.d.ts +10 -0
- package/dist/panoramic/cache/index.d.ts.map +1 -0
- package/dist/panoramic/cache/index.js +13 -0
- package/dist/panoramic/cache/index.js.map +1 -0
- package/dist/panoramic/cache/manifest-manager.d.ts +83 -0
- package/dist/panoramic/cache/manifest-manager.d.ts.map +1 -0
- package/dist/panoramic/cache/manifest-manager.js +119 -0
- package/dist/panoramic/cache/manifest-manager.js.map +1 -0
- package/dist/panoramic/cache/schemas.d.ts +199 -0
- package/dist/panoramic/cache/schemas.d.ts.map +1 -0
- package/dist/panoramic/cache/schemas.js +53 -0
- package/dist/panoramic/cache/schemas.js.map +1 -0
- package/dist/panoramic/cluster-orchestrator.d.ts +278 -0
- package/dist/panoramic/cluster-orchestrator.d.ts.map +1 -0
- package/dist/panoramic/cluster-orchestrator.js +531 -0
- package/dist/panoramic/cluster-orchestrator.js.map +1 -0
- package/dist/panoramic/community/community-detector.d.ts +41 -0
- package/dist/panoramic/community/community-detector.d.ts.map +1 -0
- package/dist/panoramic/community/community-detector.js +190 -0
- package/dist/panoramic/community/community-detector.js.map +1 -0
- package/dist/panoramic/community/god-node-analyzer.d.ts +28 -0
- package/dist/panoramic/community/god-node-analyzer.d.ts.map +1 -0
- package/dist/panoramic/community/god-node-analyzer.js +91 -0
- package/dist/panoramic/community/god-node-analyzer.js.map +1 -0
- package/dist/panoramic/community/graph-report-generator.d.ts +31 -0
- package/dist/panoramic/community/graph-report-generator.d.ts.map +1 -0
- package/dist/panoramic/community/graph-report-generator.js +98 -0
- package/dist/panoramic/community/graph-report-generator.js.map +1 -0
- package/dist/panoramic/community/index.d.ts +31 -0
- package/dist/panoramic/community/index.d.ts.map +1 -0
- package/dist/panoramic/community/index.js +63 -0
- package/dist/panoramic/community/index.js.map +1 -0
- package/dist/panoramic/community/surprising-edges.d.ts +42 -0
- package/dist/panoramic/community/surprising-edges.d.ts.map +1 -0
- package/dist/panoramic/community/surprising-edges.js +154 -0
- package/dist/panoramic/community/surprising-edges.js.map +1 -0
- package/dist/panoramic/cross-reference-index.d.ts +4 -0
- package/dist/panoramic/cross-reference-index.d.ts.map +1 -0
- package/dist/panoramic/cross-reference-index.js +201 -0
- package/dist/panoramic/cross-reference-index.js.map +1 -0
- package/dist/panoramic/exporters/architecture-ir-exporters.d.ts +7 -0
- package/dist/panoramic/exporters/architecture-ir-exporters.d.ts.map +1 -0
- package/dist/panoramic/exporters/architecture-ir-exporters.js +183 -0
- package/dist/panoramic/exporters/architecture-ir-exporters.js.map +1 -0
- package/dist/panoramic/exporters/export-types.d.ts +33 -0
- package/dist/panoramic/exporters/export-types.d.ts.map +1 -0
- package/dist/panoramic/exporters/export-types.js +7 -0
- package/dist/panoramic/exporters/export-types.js.map +1 -0
- package/dist/panoramic/exporters/html-exporter.d.ts +83 -0
- package/dist/panoramic/exporters/html-exporter.d.ts.map +1 -0
- package/dist/panoramic/exporters/html-exporter.js +224 -0
- package/dist/panoramic/exporters/html-exporter.js.map +1 -0
- package/dist/panoramic/exporters/html-template.d.ts +32 -0
- package/dist/panoramic/exporters/html-template.d.ts.map +1 -0
- package/dist/panoramic/exporters/html-template.js +737 -0
- package/dist/panoramic/exporters/html-template.js.map +1 -0
- package/dist/panoramic/exporters/obsidian-exporter.d.ts +67 -0
- package/dist/panoramic/exporters/obsidian-exporter.d.ts.map +1 -0
- package/dist/panoramic/exporters/obsidian-exporter.js +333 -0
- package/dist/panoramic/exporters/obsidian-exporter.js.map +1 -0
- package/dist/panoramic/generator-registry.d.ts +86 -0
- package/dist/panoramic/generator-registry.d.ts.map +1 -0
- package/dist/panoramic/generator-registry.js +194 -0
- package/dist/panoramic/generator-registry.js.map +1 -0
- package/dist/panoramic/generators/architecture-ir-generator.d.ts +36 -0
- package/dist/panoramic/generators/architecture-ir-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/architecture-ir-generator.js +51 -0
- package/dist/panoramic/generators/architecture-ir-generator.js.map +1 -0
- package/dist/panoramic/generators/architecture-overview-generator.d.ts +31 -0
- package/dist/panoramic/generators/architecture-overview-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/architecture-overview-generator.js +454 -0
- package/dist/panoramic/generators/architecture-overview-generator.js.map +1 -0
- package/dist/panoramic/generators/config-reference-generator.d.ts +78 -0
- package/dist/panoramic/generators/config-reference-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/config-reference-generator.js +201 -0
- package/dist/panoramic/generators/config-reference-generator.js.map +1 -0
- package/dist/panoramic/generators/cross-package-analyzer.d.ts +112 -0
- package/dist/panoramic/generators/cross-package-analyzer.d.ts.map +1 -0
- package/dist/panoramic/generators/cross-package-analyzer.js +258 -0
- package/dist/panoramic/generators/cross-package-analyzer.js.map +1 -0
- package/dist/panoramic/generators/data-model-generator.d.ts +528 -0
- package/dist/panoramic/generators/data-model-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/data-model-generator.js +674 -0
- package/dist/panoramic/generators/data-model-generator.js.map +1 -0
- package/dist/panoramic/generators/event-surface-generator.d.ts +52 -0
- package/dist/panoramic/generators/event-surface-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/event-surface-generator.js +634 -0
- package/dist/panoramic/generators/event-surface-generator.js.map +1 -0
- package/dist/panoramic/generators/interface-surface-generator.d.ts +50 -0
- package/dist/panoramic/generators/interface-surface-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/interface-surface-generator.js +393 -0
- package/dist/panoramic/generators/interface-surface-generator.js.map +1 -0
- package/dist/panoramic/generators/mock-readme-generator.d.ts +90 -0
- package/dist/panoramic/generators/mock-readme-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/mock-readme-generator.js +113 -0
- package/dist/panoramic/generators/mock-readme-generator.js.map +1 -0
- package/dist/panoramic/generators/pattern-hints-generator.d.ts +28 -0
- package/dist/panoramic/generators/pattern-hints-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/pattern-hints-generator.js +170 -0
- package/dist/panoramic/generators/pattern-hints-generator.js.map +1 -0
- package/dist/panoramic/generators/runtime-topology-generator.d.ts +77 -0
- package/dist/panoramic/generators/runtime-topology-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/runtime-topology-generator.js +679 -0
- package/dist/panoramic/generators/runtime-topology-generator.js.map +1 -0
- package/dist/panoramic/generators/troubleshooting-generator.d.ts +51 -0
- package/dist/panoramic/generators/troubleshooting-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/troubleshooting-generator.js +464 -0
- package/dist/panoramic/generators/troubleshooting-generator.js.map +1 -0
- package/dist/panoramic/generators/workspace-index-generator.d.ts +148 -0
- package/dist/panoramic/generators/workspace-index-generator.d.ts.map +1 -0
- package/dist/panoramic/generators/workspace-index-generator.js +500 -0
- package/dist/panoramic/generators/workspace-index-generator.js.map +1 -0
- package/dist/panoramic/graph/confidence-mapper.d.ts +39 -0
- package/dist/panoramic/graph/confidence-mapper.d.ts.map +1 -0
- package/dist/panoramic/graph/confidence-mapper.js +55 -0
- package/dist/panoramic/graph/confidence-mapper.js.map +1 -0
- package/dist/panoramic/graph/graph-builder.d.ts +33 -0
- package/dist/panoramic/graph/graph-builder.d.ts.map +1 -0
- package/dist/panoramic/graph/graph-builder.js +382 -0
- package/dist/panoramic/graph/graph-builder.js.map +1 -0
- package/dist/panoramic/graph/graph-paths.d.ts +13 -0
- package/dist/panoramic/graph/graph-paths.d.ts.map +1 -0
- package/dist/panoramic/graph/graph-paths.js +16 -0
- package/dist/panoramic/graph/graph-paths.js.map +1 -0
- package/dist/panoramic/graph/graph-query.d.ts +226 -0
- package/dist/panoramic/graph/graph-query.d.ts.map +1 -0
- package/dist/panoramic/graph/graph-query.js +571 -0
- package/dist/panoramic/graph/graph-query.js.map +1 -0
- package/dist/panoramic/graph/graph-types.d.ts +156 -0
- package/dist/panoramic/graph/graph-types.d.ts.map +1 -0
- package/dist/panoramic/graph/graph-types.js +10 -0
- package/dist/panoramic/graph/graph-types.js.map +1 -0
- package/dist/panoramic/graph/index.d.ts +6 -0
- package/dist/panoramic/graph/index.d.ts.map +1 -0
- package/dist/panoramic/graph/index.js +8 -0
- package/dist/panoramic/graph/index.js.map +1 -0
- package/dist/panoramic/hyperedges/constants.d.ts +16 -0
- package/dist/panoramic/hyperedges/constants.d.ts.map +1 -0
- package/dist/panoramic/hyperedges/constants.js +13 -0
- package/dist/panoramic/hyperedges/constants.js.map +1 -0
- package/dist/panoramic/hyperedges/extractor.d.ts +80 -0
- package/dist/panoramic/hyperedges/extractor.d.ts.map +1 -0
- package/dist/panoramic/hyperedges/extractor.js +133 -0
- package/dist/panoramic/hyperedges/extractor.js.map +1 -0
- package/dist/panoramic/hyperedges/index.d.ts +12 -0
- package/dist/panoramic/hyperedges/index.d.ts.map +1 -0
- package/dist/panoramic/hyperedges/index.js +19 -0
- package/dist/panoramic/hyperedges/index.js.map +1 -0
- package/dist/panoramic/hyperedges/prompt.d.ts +30 -0
- package/dist/panoramic/hyperedges/prompt.d.ts.map +1 -0
- package/dist/panoramic/hyperedges/prompt.js +88 -0
- package/dist/panoramic/hyperedges/prompt.js.map +1 -0
- package/dist/panoramic/hyperedges/schema.d.ts +91 -0
- package/dist/panoramic/hyperedges/schema.d.ts.map +1 -0
- package/dist/panoramic/hyperedges/schema.js +52 -0
- package/dist/panoramic/hyperedges/schema.js.map +1 -0
- package/dist/panoramic/index.d.ts +17 -0
- package/dist/panoramic/index.d.ts.map +1 -0
- package/dist/panoramic/index.js +22 -0
- package/dist/panoramic/index.js.map +1 -0
- package/dist/panoramic/interfaces.d.ts +243 -0
- package/dist/panoramic/interfaces.d.ts.map +1 -0
- package/dist/panoramic/interfaces.js +130 -0
- package/dist/panoramic/interfaces.js.map +1 -0
- package/dist/panoramic/internal.d.ts +67 -0
- package/dist/panoramic/internal.d.ts.map +1 -0
- package/dist/panoramic/internal.js +93 -0
- package/dist/panoramic/internal.js.map +1 -0
- package/dist/panoramic/models/architecture-ir-model.d.ts +92 -0
- package/dist/panoramic/models/architecture-ir-model.d.ts.map +1 -0
- package/dist/panoramic/models/architecture-ir-model.js +14 -0
- package/dist/panoramic/models/architecture-ir-model.js.map +1 -0
- package/dist/panoramic/models/architecture-overview-model.d.ts +77 -0
- package/dist/panoramic/models/architecture-overview-model.d.ts.map +1 -0
- package/dist/panoramic/models/architecture-overview-model.js +31 -0
- package/dist/panoramic/models/architecture-overview-model.js.map +1 -0
- package/dist/panoramic/models/component-view-model.d.ts +127 -0
- package/dist/panoramic/models/component-view-model.d.ts.map +1 -0
- package/dist/panoramic/models/component-view-model.js +65 -0
- package/dist/panoramic/models/component-view-model.js.map +1 -0
- package/dist/panoramic/models/docs-bundle-profiles.d.ts +4 -0
- package/dist/panoramic/models/docs-bundle-profiles.d.ts.map +1 -0
- package/dist/panoramic/models/docs-bundle-profiles.js +82 -0
- package/dist/panoramic/models/docs-bundle-profiles.js.map +1 -0
- package/dist/panoramic/models/docs-bundle-types.d.ts +94 -0
- package/dist/panoramic/models/docs-bundle-types.d.ts.map +1 -0
- package/dist/panoramic/models/docs-bundle-types.js +10 -0
- package/dist/panoramic/models/docs-bundle-types.js.map +1 -0
- package/dist/panoramic/models/docs-quality-model.d.ts +125 -0
- package/dist/panoramic/models/docs-quality-model.d.ts.map +1 -0
- package/dist/panoramic/models/docs-quality-model.js +166 -0
- package/dist/panoramic/models/docs-quality-model.js.map +1 -0
- package/dist/panoramic/models/pattern-hints-model.d.ts +89 -0
- package/dist/panoramic/models/pattern-hints-model.d.ts.map +1 -0
- package/dist/panoramic/models/pattern-hints-model.js +61 -0
- package/dist/panoramic/models/pattern-hints-model.js.map +1 -0
- package/dist/panoramic/models/pattern-knowledge-base.d.ts +31 -0
- package/dist/panoramic/models/pattern-knowledge-base.d.ts.map +1 -0
- package/dist/panoramic/models/pattern-knowledge-base.js +407 -0
- package/dist/panoramic/models/pattern-knowledge-base.js.map +1 -0
- package/dist/panoramic/models/runtime-topology-model.d.ts +145 -0
- package/dist/panoramic/models/runtime-topology-model.d.ts.map +1 -0
- package/dist/panoramic/models/runtime-topology-model.js +300 -0
- package/dist/panoramic/models/runtime-topology-model.js.map +1 -0
- package/dist/panoramic/output-filenames.d.ts +26 -0
- package/dist/panoramic/output-filenames.d.ts.map +1 -0
- package/dist/panoramic/output-filenames.js +48 -0
- package/dist/panoramic/output-filenames.js.map +1 -0
- package/dist/panoramic/parser-registry.d.ts +89 -0
- package/dist/panoramic/parser-registry.d.ts.map +1 -0
- package/dist/panoramic/parser-registry.js +169 -0
- package/dist/panoramic/parser-registry.js.map +1 -0
- package/dist/panoramic/parsers/abstract-artifact-parser.d.ts +48 -0
- package/dist/panoramic/parsers/abstract-artifact-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/abstract-artifact-parser.js +52 -0
- package/dist/panoramic/parsers/abstract-artifact-parser.js.map +1 -0
- package/dist/panoramic/parsers/abstract-config-parser.d.ts +35 -0
- package/dist/panoramic/parsers/abstract-config-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/abstract-config-parser.js +34 -0
- package/dist/panoramic/parsers/abstract-config-parser.js.map +1 -0
- package/dist/panoramic/parsers/behavior-yaml-parser.d.ts +34 -0
- package/dist/panoramic/parsers/behavior-yaml-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/behavior-yaml-parser.js +195 -0
- package/dist/panoramic/parsers/behavior-yaml-parser.js.map +1 -0
- package/dist/panoramic/parsers/comment-tracker.d.ts +37 -0
- package/dist/panoramic/parsers/comment-tracker.d.ts.map +1 -0
- package/dist/panoramic/parsers/comment-tracker.js +50 -0
- package/dist/panoramic/parsers/comment-tracker.js.map +1 -0
- package/dist/panoramic/parsers/dockerfile-parser.d.ts +42 -0
- package/dist/panoramic/parsers/dockerfile-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/dockerfile-parser.js +128 -0
- package/dist/panoramic/parsers/dockerfile-parser.js.map +1 -0
- package/dist/panoramic/parsers/env-config-parser.d.ts +37 -0
- package/dist/panoramic/parsers/env-config-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/env-config-parser.js +73 -0
- package/dist/panoramic/parsers/env-config-parser.js.map +1 -0
- package/dist/panoramic/parsers/index.d.ts +25 -0
- package/dist/panoramic/parsers/index.d.ts.map +1 -0
- package/dist/panoramic/parsers/index.js +25 -0
- package/dist/panoramic/parsers/index.js.map +1 -0
- package/dist/panoramic/parsers/skill-md-parser.d.ts +42 -0
- package/dist/panoramic/parsers/skill-md-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/skill-md-parser.js +105 -0
- package/dist/panoramic/parsers/skill-md-parser.js.map +1 -0
- package/dist/panoramic/parsers/toml-config-parser.d.ts +39 -0
- package/dist/panoramic/parsers/toml-config-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/toml-config-parser.js +98 -0
- package/dist/panoramic/parsers/toml-config-parser.js.map +1 -0
- package/dist/panoramic/parsers/types.d.ts +314 -0
- package/dist/panoramic/parsers/types.d.ts.map +1 -0
- package/dist/panoramic/parsers/types.js +136 -0
- package/dist/panoramic/parsers/types.js.map +1 -0
- package/dist/panoramic/parsers/yaml-config-parser.d.ts +58 -0
- package/dist/panoramic/parsers/yaml-config-parser.d.ts.map +1 -0
- package/dist/panoramic/parsers/yaml-config-parser.js +356 -0
- package/dist/panoramic/parsers/yaml-config-parser.js.map +1 -0
- package/dist/panoramic/pipelines/adr-decision-pipeline.d.ts +74 -0
- package/dist/panoramic/pipelines/adr-decision-pipeline.d.ts.map +1 -0
- package/dist/panoramic/pipelines/adr-decision-pipeline.js +421 -0
- package/dist/panoramic/pipelines/adr-decision-pipeline.js.map +1 -0
- package/dist/panoramic/pipelines/adr-evidence-verifier.d.ts +30 -0
- package/dist/panoramic/pipelines/adr-evidence-verifier.d.ts.map +1 -0
- package/dist/panoramic/pipelines/adr-evidence-verifier.js +141 -0
- package/dist/panoramic/pipelines/adr-evidence-verifier.js.map +1 -0
- package/dist/panoramic/pipelines/adr-mapreduce.d.ts +316 -0
- package/dist/panoramic/pipelines/adr-mapreduce.d.ts.map +1 -0
- package/dist/panoramic/pipelines/adr-mapreduce.js +331 -0
- package/dist/panoramic/pipelines/adr-mapreduce.js.map +1 -0
- package/dist/panoramic/pipelines/adr-migration.d.ts +26 -0
- package/dist/panoramic/pipelines/adr-migration.d.ts.map +1 -0
- package/dist/panoramic/pipelines/adr-migration.js +203 -0
- package/dist/panoramic/pipelines/adr-migration.js.map +1 -0
- package/dist/panoramic/pipelines/architecture-narrative-mapreduce.d.ts +121 -0
- package/dist/panoramic/pipelines/architecture-narrative-mapreduce.d.ts.map +1 -0
- package/dist/panoramic/pipelines/architecture-narrative-mapreduce.js +412 -0
- package/dist/panoramic/pipelines/architecture-narrative-mapreduce.js.map +1 -0
- package/dist/panoramic/pipelines/architecture-narrative.d.ts +123 -0
- package/dist/panoramic/pipelines/architecture-narrative.d.ts.map +1 -0
- package/dist/panoramic/pipelines/architecture-narrative.js +419 -0
- package/dist/panoramic/pipelines/architecture-narrative.js.map +1 -0
- package/dist/panoramic/pipelines/coverage-auditor.d.ts +95 -0
- package/dist/panoramic/pipelines/coverage-auditor.d.ts.map +1 -0
- package/dist/panoramic/pipelines/coverage-auditor.js +290 -0
- package/dist/panoramic/pipelines/coverage-auditor.js.map +1 -0
- package/dist/panoramic/pipelines/debt-intelligence-pipeline.d.ts +32 -0
- package/dist/panoramic/pipelines/debt-intelligence-pipeline.d.ts.map +1 -0
- package/dist/panoramic/pipelines/debt-intelligence-pipeline.js +108 -0
- package/dist/panoramic/pipelines/debt-intelligence-pipeline.js.map +1 -0
- package/dist/panoramic/pipelines/docs-bundle-manifest-reader.d.ts +26 -0
- package/dist/panoramic/pipelines/docs-bundle-manifest-reader.d.ts.map +1 -0
- package/dist/panoramic/pipelines/docs-bundle-manifest-reader.js +108 -0
- package/dist/panoramic/pipelines/docs-bundle-manifest-reader.js.map +1 -0
- package/dist/panoramic/pipelines/docs-bundle-orchestrator.d.ts +16 -0
- package/dist/panoramic/pipelines/docs-bundle-orchestrator.d.ts.map +1 -0
- package/dist/panoramic/pipelines/docs-bundle-orchestrator.js +588 -0
- package/dist/panoramic/pipelines/docs-bundle-orchestrator.js.map +1 -0
- package/dist/panoramic/pipelines/docs-quality-evaluator.d.ts +55 -0
- package/dist/panoramic/pipelines/docs-quality-evaluator.d.ts.map +1 -0
- package/dist/panoramic/pipelines/docs-quality-evaluator.js +1045 -0
- package/dist/panoramic/pipelines/docs-quality-evaluator.js.map +1 -0
- package/dist/panoramic/pipelines/narrative-provenance-adapter.d.ts +8 -0
- package/dist/panoramic/pipelines/narrative-provenance-adapter.d.ts.map +1 -0
- package/dist/panoramic/pipelines/narrative-provenance-adapter.js +99 -0
- package/dist/panoramic/pipelines/narrative-provenance-adapter.js.map +1 -0
- package/dist/panoramic/pipelines/product-ux-docs.d.ts +123 -0
- package/dist/panoramic/pipelines/product-ux-docs.d.ts.map +1 -0
- package/dist/panoramic/pipelines/product-ux-docs.js +959 -0
- package/dist/panoramic/pipelines/product-ux-docs.js.map +1 -0
- package/dist/panoramic/project-context.d.ts +17 -0
- package/dist/panoramic/project-context.d.ts.map +1 -0
- package/dist/panoramic/project-context.js +289 -0
- package/dist/panoramic/project-context.js.map +1 -0
- package/dist/panoramic/qa/citation.d.ts +21 -0
- package/dist/panoramic/qa/citation.d.ts.map +1 -0
- package/dist/panoramic/qa/citation.js +184 -0
- package/dist/panoramic/qa/citation.js.map +1 -0
- package/dist/panoramic/qa/debt-context.d.ts +33 -0
- package/dist/panoramic/qa/debt-context.d.ts.map +1 -0
- package/dist/panoramic/qa/debt-context.js +82 -0
- package/dist/panoramic/qa/debt-context.js.map +1 -0
- package/dist/panoramic/qa/graph-retriever.d.ts +29 -0
- package/dist/panoramic/qa/graph-retriever.d.ts.map +1 -0
- package/dist/panoramic/qa/graph-retriever.js +65 -0
- package/dist/panoramic/qa/graph-retriever.js.map +1 -0
- package/dist/panoramic/qa/index.d.ts +23 -0
- package/dist/panoramic/qa/index.d.ts.map +1 -0
- package/dist/panoramic/qa/index.js +201 -0
- package/dist/panoramic/qa/index.js.map +1 -0
- package/dist/panoramic/qa/llm-caller.d.ts +35 -0
- package/dist/panoramic/qa/llm-caller.d.ts.map +1 -0
- package/dist/panoramic/qa/llm-caller.js +138 -0
- package/dist/panoramic/qa/llm-caller.js.map +1 -0
- package/dist/panoramic/qa/prompt-builder.d.ts +36 -0
- package/dist/panoramic/qa/prompt-builder.d.ts.map +1 -0
- package/dist/panoramic/qa/prompt-builder.js +143 -0
- package/dist/panoramic/qa/prompt-builder.js.map +1 -0
- package/dist/panoramic/qa/rag-reranker.d.ts +43 -0
- package/dist/panoramic/qa/rag-reranker.d.ts.map +1 -0
- package/dist/panoramic/qa/rag-reranker.js +129 -0
- package/dist/panoramic/qa/rag-reranker.js.map +1 -0
- package/dist/panoramic/qa/types.d.ts +126 -0
- package/dist/panoramic/qa/types.d.ts.map +1 -0
- package/dist/panoramic/qa/types.js +6 -0
- package/dist/panoramic/qa/types.js.map +1 -0
- package/dist/panoramic/query.d.ts +29 -0
- package/dist/panoramic/query.d.ts.map +1 -0
- package/dist/panoramic/query.js +80 -0
- package/dist/panoramic/query.js.map +1 -0
- package/dist/panoramic/stored-module-specs.d.ts +26 -0
- package/dist/panoramic/stored-module-specs.d.ts.map +1 -0
- package/dist/panoramic/stored-module-specs.js +155 -0
- package/dist/panoramic/stored-module-specs.js.map +1 -0
- package/dist/panoramic/utils/html-sanitizer.d.ts +33 -0
- package/dist/panoramic/utils/html-sanitizer.d.ts.map +1 -0
- package/dist/panoramic/utils/html-sanitizer.js +170 -0
- package/dist/panoramic/utils/html-sanitizer.js.map +1 -0
- package/dist/panoramic/utils/llm-enricher.d.ts +74 -0
- package/dist/panoramic/utils/llm-enricher.d.ts.map +1 -0
- package/dist/panoramic/utils/llm-enricher.js +315 -0
- package/dist/panoramic/utils/llm-enricher.js.map +1 -0
- package/dist/panoramic/utils/llm-facade.d.ts +66 -0
- package/dist/panoramic/utils/llm-facade.d.ts.map +1 -0
- package/dist/panoramic/utils/llm-facade.js +136 -0
- package/dist/panoramic/utils/llm-facade.js.map +1 -0
- package/dist/panoramic/utils/logger.d.ts +43 -0
- package/dist/panoramic/utils/logger.d.ts.map +1 -0
- package/dist/panoramic/utils/logger.js +76 -0
- package/dist/panoramic/utils/logger.js.map +1 -0
- package/dist/panoramic/utils/mermaid-helpers.d.ts +19 -0
- package/dist/panoramic/utils/mermaid-helpers.d.ts.map +1 -0
- package/dist/panoramic/utils/mermaid-helpers.js +21 -0
- package/dist/panoramic/utils/mermaid-helpers.js.map +1 -0
- package/dist/panoramic/utils/multi-format-writer.d.ts +43 -0
- package/dist/panoramic/utils/multi-format-writer.d.ts.map +1 -0
- package/dist/panoramic/utils/multi-format-writer.js +73 -0
- package/dist/panoramic/utils/multi-format-writer.js.map +1 -0
- package/dist/panoramic/utils/template-loader.d.ts +15 -0
- package/dist/panoramic/utils/template-loader.d.ts.map +1 -0
- package/dist/panoramic/utils/template-loader.js +65 -0
- package/dist/panoramic/utils/template-loader.js.map +1 -0
- package/dist/panoramic/utils/text-segmenter.d.ts +50 -0
- package/dist/panoramic/utils/text-segmenter.d.ts.map +1 -0
- package/dist/panoramic/utils/text-segmenter.js +151 -0
- package/dist/panoramic/utils/text-segmenter.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +7 -0
- package/dist/scripts/postinstall.d.ts.map +1 -0
- package/dist/scripts/postinstall.js +70 -0
- package/dist/scripts/postinstall.js.map +1 -0
- package/dist/scripts/preuninstall.d.ts +7 -0
- package/dist/scripts/preuninstall.d.ts.map +1 -0
- package/dist/scripts/preuninstall.js +62 -0
- package/dist/scripts/preuninstall.js.map +1 -0
- package/dist/spec-store/index.d.ts +9 -0
- package/dist/spec-store/index.d.ts.map +1 -0
- package/dist/spec-store/index.js +9 -0
- package/dist/spec-store/index.js.map +1 -0
- package/dist/spec-store/spec-identity.d.ts +28 -0
- package/dist/spec-store/spec-identity.d.ts.map +1 -0
- package/dist/spec-store/spec-identity.js +24 -0
- package/dist/spec-store/spec-identity.js.map +1 -0
- package/dist/spec-store/spec-store.d.ts +62 -0
- package/dist/spec-store/spec-store.d.ts.map +1 -0
- package/dist/spec-store/spec-store.js +201 -0
- package/dist/spec-store/spec-store.js.map +1 -0
- package/dist/utils/atomic-write.d.ts +10 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/atomic-write.js +27 -0
- package/dist/utils/atomic-write.js.map +1 -0
- package/dist/utils/chunk-splitter.d.ts +32 -0
- package/dist/utils/chunk-splitter.d.ts.map +1 -0
- package/dist/utils/chunk-splitter.js +116 -0
- package/dist/utils/chunk-splitter.js.map +1 -0
- package/dist/utils/file-scanner.d.ts +38 -0
- package/dist/utils/file-scanner.d.ts.map +1 -0
- package/dist/utils/file-scanner.js +323 -0
- package/dist/utils/file-scanner.js.map +1 -0
- package/dist/utils/git-blame.d.ts +32 -0
- package/dist/utils/git-blame.d.ts.map +1 -0
- package/dist/utils/git-blame.js +151 -0
- package/dist/utils/git-blame.js.map +1 -0
- package/dist/utils/specify-template-sync.d.ts +16 -0
- package/dist/utils/specify-template-sync.d.ts.map +1 -0
- package/dist/utils/specify-template-sync.js +66 -0
- package/dist/utils/specify-template-sync.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts +77 -0
- package/dist/watcher/file-watcher.d.ts.map +1 -0
- package/dist/watcher/file-watcher.js +233 -0
- package/dist/watcher/file-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +6 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +5 -0
- package/dist/watcher/index.js.map +1 -0
- package/grammars/manifest.json +28 -0
- package/grammars/tree-sitter-go.wasm +0 -0
- package/grammars/tree-sitter-java.wasm +0 -0
- package/grammars/tree-sitter-javascript.wasm +0 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/package.json +84 -0
- package/plugins/spec-driver/.claude-plugin/plugin.json +16 -0
- package/plugins/spec-driver/README.md +401 -0
- package/plugins/spec-driver/agents/analyze.artifact.yaml +10 -0
- package/plugins/spec-driver/agents/analyze.md +144 -0
- package/plugins/spec-driver/agents/checklist.artifact.yaml +8 -0
- package/plugins/spec-driver/agents/checklist.md +84 -0
- package/plugins/spec-driver/agents/clarify.artifact.yaml +6 -0
- package/plugins/spec-driver/agents/clarify.md +104 -0
- package/plugins/spec-driver/agents/constitution.artifact.yaml +9 -0
- package/plugins/spec-driver/agents/constitution.md +100 -0
- package/plugins/spec-driver/agents/implement.artifact.yaml +8 -0
- package/plugins/spec-driver/agents/implement.md +159 -0
- package/plugins/spec-driver/agents/plan.artifact.yaml +12 -0
- package/plugins/spec-driver/agents/plan.md +116 -0
- package/plugins/spec-driver/agents/product-research.artifact.yaml +11 -0
- package/plugins/spec-driver/agents/product-research.md +94 -0
- package/plugins/spec-driver/agents/quality-review.artifact.yaml +11 -0
- package/plugins/spec-driver/agents/quality-review.md +165 -0
- package/plugins/spec-driver/agents/refactor-plan.md +132 -0
- package/plugins/spec-driver/agents/spec-review.artifact.yaml +12 -0
- package/plugins/spec-driver/agents/spec-review.md +111 -0
- package/plugins/spec-driver/agents/specify.artifact.yaml +9 -0
- package/plugins/spec-driver/agents/specify.md +109 -0
- package/plugins/spec-driver/agents/sync.artifact.yaml +19 -0
- package/plugins/spec-driver/agents/sync.md +91 -0
- package/plugins/spec-driver/agents/tasks.artifact.yaml +10 -0
- package/plugins/spec-driver/agents/tasks.md +88 -0
- package/plugins/spec-driver/agents/tech-research.artifact.yaml +12 -0
- package/plugins/spec-driver/agents/tech-research.md +102 -0
- package/plugins/spec-driver/agents/verify.artifact.yaml +11 -0
- package/plugins/spec-driver/agents/verify.md +204 -0
- package/plugins/spec-driver/config/orchestration.yaml +779 -0
- package/plugins/spec-driver/contracts/orchestration-overrides-contract.yaml +124 -0
- package/plugins/spec-driver/contracts/orchestration-schema.mjs +301 -0
- package/plugins/spec-driver/contracts/scan-project-output.md +70 -0
- package/plugins/spec-driver/contracts/wrapper-source-of-truth.yaml +44 -0
- package/plugins/spec-driver/hooks/hooks.json +70 -0
- package/plugins/spec-driver/hooks/post-tool-use-format.sh +28 -0
- package/plugins/spec-driver/hooks/pre-tool-use-guard.sh +42 -0
- package/plugins/spec-driver/hooks/stop-task-check.sh +22 -0
- package/plugins/spec-driver/hooks/worktree-lifecycle.sh +33 -0
- package/plugins/spec-driver/lib/orchestration-output-serializer.mjs +219 -0
- package/plugins/spec-driver/lib/orchestration-resolver.mjs +485 -0
- package/plugins/spec-driver/lib/orchestrator-fallback.mjs +98 -0
- package/plugins/spec-driver/lib/orchestrator.mjs +280 -0
- package/plugins/spec-driver/scorecards/default-governance.yaml +63 -0
- package/plugins/spec-driver/scripts/codex-skills.sh +225 -0
- package/plugins/spec-driver/scripts/experimental/README.md +9 -0
- package/plugins/spec-driver/scripts/generate-adoption-insights.mjs +523 -0
- package/plugins/spec-driver/scripts/generate-product-entity-catalog.mjs +472 -0
- package/plugins/spec-driver/scripts/generate-product-quality-reports.mjs +18 -0
- package/plugins/spec-driver/scripts/generate-product-scorecards.mjs +25 -0
- package/plugins/spec-driver/scripts/generate-project-context-suggestions.mjs +622 -0
- package/plugins/spec-driver/scripts/generate-workflow-registry.mjs +16 -0
- package/plugins/spec-driver/scripts/init-project.sh +328 -0
- package/plugins/spec-driver/scripts/lib/config-schema.mjs +433 -0
- package/plugins/spec-driver/scripts/lib/init-project-output.sh +146 -0
- package/plugins/spec-driver/scripts/lib/product-artifact-patchers.mjs +29 -0
- package/plugins/spec-driver/scripts/lib/product-artifact-paths.mjs +129 -0
- package/plugins/spec-driver/scripts/lib/product-governance-helpers.mjs +48 -0
- package/plugins/spec-driver/scripts/lib/product-quality-core.mjs +531 -0
- package/plugins/spec-driver/scripts/lib/product-scorecard-core.mjs +810 -0
- package/plugins/spec-driver/scripts/lib/project-context-paths.mjs +21 -0
- package/plugins/spec-driver/scripts/lib/project-profile-resolver.mjs +704 -0
- package/plugins/spec-driver/scripts/lib/project-profile-schema.mjs +78 -0
- package/plugins/spec-driver/scripts/lib/script-cli-args.mjs +25 -0
- package/plugins/spec-driver/scripts/lib/script-diagnostics.mjs +29 -0
- package/plugins/spec-driver/scripts/lib/script-report-io.mjs +37 -0
- package/plugins/spec-driver/scripts/lib/simple-yaml.mjs +257 -0
- package/plugins/spec-driver/scripts/lib/sync-conflict-resolver.mjs +128 -0
- package/plugins/spec-driver/scripts/lib/sync-merge-strategy.mjs +388 -0
- package/plugins/spec-driver/scripts/lib/sync-product-mapping.mjs +228 -0
- package/plugins/spec-driver/scripts/lib/sync-timeline-builder.mjs +114 -0
- package/plugins/spec-driver/scripts/lib/sync-validator.mjs +174 -0
- package/plugins/spec-driver/scripts/lib/workflow-registry-core.mjs +281 -0
- package/plugins/spec-driver/scripts/orchestrator-cli.mjs +490 -0
- package/plugins/spec-driver/scripts/orchestrator-cli.sh +36 -0
- package/plugins/spec-driver/scripts/postinstall.sh +101 -0
- package/plugins/spec-driver/scripts/record-workflow-run.mjs +332 -0
- package/plugins/spec-driver/scripts/resolve-project-context.mjs +56 -0
- package/plugins/spec-driver/scripts/scan-project.sh +668 -0
- package/plugins/spec-driver/scripts/sync-merge-engine.mjs +663 -0
- package/plugins/spec-driver/scripts/validate-config.mjs +223 -0
- package/plugins/spec-driver/scripts/validate-orchestration-overrides.mjs +190 -0
- package/plugins/spec-driver/scripts/validate-wrapper-sources.mjs +302 -0
- package/plugins/spec-driver/skills/spec-driver-constitution/SKILL.md +77 -0
- package/plugins/spec-driver/skills/spec-driver-doc/SKILL.md +732 -0
- package/plugins/spec-driver/skills/spec-driver-feature/SKILL.md +336 -0
- package/plugins/spec-driver/skills/spec-driver-fix/SKILL.md +457 -0
- package/plugins/spec-driver/skills/spec-driver-implement/SKILL.md +653 -0
- package/plugins/spec-driver/skills/spec-driver-refactor/SKILL.md +250 -0
- package/plugins/spec-driver/skills/spec-driver-resume/SKILL.md +325 -0
- package/plugins/spec-driver/skills/spec-driver-story/SKILL.md +566 -0
- package/plugins/spec-driver/skills/spec-driver-sync/SKILL.md +300 -0
- package/plugins/spec-driver/templates/code-of-conduct-v2.1.md +85 -0
- package/plugins/spec-driver/templates/licenses/Apache-2.0.txt +201 -0
- package/plugins/spec-driver/templates/licenses/BSD-2-Clause.txt +24 -0
- package/plugins/spec-driver/templates/licenses/BSD-3-Clause.txt +28 -0
- package/plugins/spec-driver/templates/licenses/GPL-3.0.txt +232 -0
- package/plugins/spec-driver/templates/licenses/ISC.txt +15 -0
- package/plugins/spec-driver/templates/licenses/MIT.txt +21 -0
- package/plugins/spec-driver/templates/licenses/MPL-2.0.txt +373 -0
- package/plugins/spec-driver/templates/licenses/Unlicense.txt +24 -0
- package/plugins/spec-driver/templates/orchestration-overrides.example.yaml +81 -0
- package/plugins/spec-driver/templates/product-research-template.md +95 -0
- package/plugins/spec-driver/templates/product-spec-template.md +250 -0
- package/plugins/spec-driver/templates/research-synthesis-template.md +102 -0
- package/plugins/spec-driver/templates/spec-driver.config-template.yaml +244 -0
- package/plugins/spec-driver/templates/specify-base/agent-file-template.md +28 -0
- package/plugins/spec-driver/templates/specify-base/checklist-template.md +40 -0
- package/plugins/spec-driver/templates/specify-base/constitution-template.md +50 -0
- package/plugins/spec-driver/templates/specify-base/plan-template.md +134 -0
- package/plugins/spec-driver/templates/specify-base/product-research-template.md +95 -0
- package/plugins/spec-driver/templates/specify-base/project-context-template.yaml +40 -0
- package/plugins/spec-driver/templates/specify-base/research-synthesis-template.md +102 -0
- package/plugins/spec-driver/templates/specify-base/spec-template.md +115 -0
- package/plugins/spec-driver/templates/specify-base/tasks-template.md +266 -0
- package/plugins/spec-driver/templates/specify-base/tech-research-template.md +111 -0
- package/plugins/spec-driver/templates/specify-base/verification-report-template.md +63 -0
- package/plugins/spec-driver/templates/tech-research-template.md +111 -0
- package/plugins/spec-driver/templates/verification-report-template.md +63 -0
- package/plugins/spec-driver/workflows/golden-paths.yaml +39 -0
- package/plugins/spec-driver/workflows/spec-driver-doc.yaml +24 -0
- package/plugins/spec-driver/workflows/spec-driver-feature.yaml +29 -0
- package/plugins/spec-driver/workflows/spec-driver-fix.yaml +21 -0
- package/plugins/spec-driver/workflows/spec-driver-implement.yaml +23 -0
- package/plugins/spec-driver/workflows/spec-driver-resume.yaml +20 -0
- package/plugins/spec-driver/workflows/spec-driver-story.yaml +24 -0
- package/plugins/spec-driver/workflows/spec-driver-sync.yaml +34 -0
- package/plugins/spectra/.claude-plugin/plugin.json +20 -0
- package/plugins/spectra/.mcp.json +8 -0
- package/plugins/spectra/README.md +128 -0
- package/plugins/spectra/contracts/skill-source-of-truth.yaml +34 -0
- package/plugins/spectra/hooks/hooks.json +15 -0
- package/plugins/spectra/scripts/postinstall.sh +12 -0
- package/plugins/spectra/scripts/sync-skill-mirrors.mjs +148 -0
- package/plugins/spectra/scripts/validate-skill-sources.mjs +280 -0
- package/plugins/spectra/skills/spectra/SKILL.md +214 -0
- package/plugins/spectra/skills/spectra-batch/SKILL.md +232 -0
- package/plugins/spectra/skills/spectra-diff/SKILL.md +99 -0
- package/queries/go.scm +54 -0
- package/queries/java.scm +50 -0
- package/queries/javascript.scm +30 -0
- package/queries/python.scm +35 -0
- package/queries/typescript.scm +50 -0
- package/scripts/lifecycle-runner.cjs +33 -0
- package/templates/adr-draft.hbs +51 -0
- package/templates/adr-index.hbs +25 -0
- package/templates/api-surface.hbs +40 -0
- package/templates/architecture-ir.hbs +49 -0
- package/templates/architecture-narrative.hbs +116 -0
- package/templates/architecture-overview.hbs +103 -0
- package/templates/component-view.hbs +87 -0
- package/templates/config-reference.hbs +22 -0
- package/templates/coverage-report.hbs +84 -0
- package/templates/cross-package-analysis.hbs +43 -0
- package/templates/data-model.hbs +72 -0
- package/templates/delta-report.hbs +53 -0
- package/templates/docs-bundle-index.hbs +41 -0
- package/templates/drift-report.hbs +53 -0
- package/templates/dynamic-scenarios.hbs +46 -0
- package/templates/event-surface.hbs +90 -0
- package/templates/feature-brief-index.hbs +27 -0
- package/templates/feature-brief.hbs +28 -0
- package/templates/index-spec.hbs +57 -0
- package/templates/interface-surface.hbs +87 -0
- package/templates/module-spec.hbs +117 -0
- package/templates/pattern-hints.hbs +85 -0
- package/templates/product-overview.hbs +65 -0
- package/templates/quality-report.hbs +130 -0
- package/templates/runtime-topology.hbs +128 -0
- package/templates/troubleshooting.hbs +86 -0
- package/templates/user-journeys.hbs +44 -0
- package/templates/workspace-index.hbs +26 -0
|
@@ -0,0 +1,911 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 单模块 Spec 生成编排器
|
|
3
|
+
* /spectra 命令入口 — 串联三阶段流水线
|
|
4
|
+
* 参见 contracts/core-pipeline.md
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from 'node:fs';
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { createHash } from 'node:crypto';
|
|
9
|
+
import { scanFiles } from '../utils/file-scanner.js';
|
|
10
|
+
import { analyzeFiles } from './ast-analyzer.js';
|
|
11
|
+
import { redact } from './secret-redactor.js';
|
|
12
|
+
import { assembleContext } from './context-assembler.js';
|
|
13
|
+
import { estimateFast } from './token-counter.js';
|
|
14
|
+
import { callLLM, parseLLMResponse, LLMUnavailableError } from './llm-client.js';
|
|
15
|
+
import { extractCodeSlices } from './code-slice-extractor.js';
|
|
16
|
+
import { LanguageAdapterRegistry } from '../adapters/language-adapter-registry.js';
|
|
17
|
+
import { generateFrontmatter } from '../generator/frontmatter.js';
|
|
18
|
+
import { renderSpec, initRenderer } from '../generator/spec-renderer.js';
|
|
19
|
+
import { generateClassDiagram } from '../generator/mermaid-class-diagram.js';
|
|
20
|
+
import { generateDependencyDiagram } from '../generator/mermaid-dependency-graph.js';
|
|
21
|
+
import { splitIntoChunks, CHUNK_THRESHOLD } from '../utils/chunk-splitter.js';
|
|
22
|
+
// ============================================================
|
|
23
|
+
// 置信度计算
|
|
24
|
+
// ============================================================
|
|
25
|
+
/**
|
|
26
|
+
* 根据流水线执行结果计算置信度
|
|
27
|
+
*/
|
|
28
|
+
function calculateConfidence(skeletons, uncertaintyCount, contextTruncated, llmDegraded) {
|
|
29
|
+
const totalFiles = skeletons.length;
|
|
30
|
+
const filesWithErrors = skeletons.filter((s) => s.parseErrors && s.parseErrors.length > 0).length;
|
|
31
|
+
const errorRatio = totalFiles > 0 ? filesWithErrors / totalFiles : 0;
|
|
32
|
+
// LOW: >30% 文件有解析错误,或标记数 >3,或 LLM 降级
|
|
33
|
+
if (errorRatio > 0.3 || uncertaintyCount > 3 || llmDegraded) {
|
|
34
|
+
return 'low';
|
|
35
|
+
}
|
|
36
|
+
// MEDIUM: 有解析错误、标记数 >0 但 ≤3、或上下文被截断
|
|
37
|
+
if (filesWithErrors > 0 || uncertaintyCount > 0 || contextTruncated) {
|
|
38
|
+
return 'medium';
|
|
39
|
+
}
|
|
40
|
+
// HIGH: 零错误、零标记、LLM 正常返回
|
|
41
|
+
return 'high';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 将多个 CodeSkeleton 合并为一个代表性骨架
|
|
45
|
+
*/
|
|
46
|
+
function mergeSkeletons(skeletons) {
|
|
47
|
+
if (skeletons.length === 1)
|
|
48
|
+
return skeletons[0];
|
|
49
|
+
// 合并所有导出和导入
|
|
50
|
+
const allExports = skeletons.flatMap((s) => s.exports);
|
|
51
|
+
const allImports = skeletons.flatMap((s) => s.imports);
|
|
52
|
+
const allErrors = skeletons.flatMap((s) => s.parseErrors ?? []);
|
|
53
|
+
const totalLoc = skeletons.reduce((sum, s) => sum + s.loc, 0);
|
|
54
|
+
// 使用第一个文件的路径(或目录名)
|
|
55
|
+
const filePath = skeletons[0].filePath;
|
|
56
|
+
// 计算合并哈希
|
|
57
|
+
const combinedContent = skeletons.map((s) => s.hash).join('');
|
|
58
|
+
const hash = createHash('sha256').update(combinedContent).digest('hex');
|
|
59
|
+
return {
|
|
60
|
+
filePath,
|
|
61
|
+
language: skeletons[0].language,
|
|
62
|
+
loc: totalLoc,
|
|
63
|
+
exports: allExports,
|
|
64
|
+
imports: allImports,
|
|
65
|
+
parseErrors: allErrors.length > 0 ? allErrors : undefined,
|
|
66
|
+
hash,
|
|
67
|
+
analyzedAt: new Date().toISOString(),
|
|
68
|
+
parserUsed: skeletons[0].parserUsed,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// ============================================================
|
|
72
|
+
// 核心 API
|
|
73
|
+
// ============================================================
|
|
74
|
+
/**
|
|
75
|
+
* 预处理 + 上下文组装(阶段 1-2)
|
|
76
|
+
* 不调用 LLM,不需要 API key。
|
|
77
|
+
* 供 prepare 子命令和 generateSpec 共用。
|
|
78
|
+
*
|
|
79
|
+
* @param targetPath - 待分析的目录或文件路径
|
|
80
|
+
* @param options - 生成选项
|
|
81
|
+
* @returns 预处理结果
|
|
82
|
+
*/
|
|
83
|
+
export async function prepareContext(targetPath, options = {}) {
|
|
84
|
+
const { deep = false, projectRoot, onStageProgress } = options;
|
|
85
|
+
// --- 阶段 1:预处理 ---
|
|
86
|
+
// 步骤 1:扫描文件
|
|
87
|
+
const resolvedTarget = path.resolve(targetPath);
|
|
88
|
+
let filePaths;
|
|
89
|
+
const stat = fs.statSync(resolvedTarget);
|
|
90
|
+
if (stat.isFile()) {
|
|
91
|
+
filePaths = [resolvedTarget];
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// 单文件时跳过 scan 阶段的独立进度行
|
|
95
|
+
const scanStart = Date.now();
|
|
96
|
+
onStageProgress?.({ stage: 'scan', message: '文件扫描中...' });
|
|
97
|
+
const scanResult = scanFiles(resolvedTarget, { projectRoot });
|
|
98
|
+
filePaths = scanResult.files.map((f) => path.join(resolvedTarget, f));
|
|
99
|
+
if (filePaths.length === 0) {
|
|
100
|
+
throw new Error(`目标路径中未找到支持的源文件: ${targetPath}`);
|
|
101
|
+
}
|
|
102
|
+
onStageProgress?.({ stage: 'scan', message: '文件扫描完成', duration: Date.now() - scanStart });
|
|
103
|
+
}
|
|
104
|
+
// 步骤 2:AST 分析
|
|
105
|
+
const astStart = Date.now();
|
|
106
|
+
onStageProgress?.({ stage: 'ast', message: `AST 分析中 (${filePaths.length} 个文件)...` });
|
|
107
|
+
const skeletons = await analyzeFiles(filePaths);
|
|
108
|
+
onStageProgress?.({ stage: 'ast', message: 'AST 分析完成', duration: Date.now() - astStart });
|
|
109
|
+
// 合并为代表性骨架
|
|
110
|
+
const mergedSkeleton = mergeSkeletons(skeletons);
|
|
111
|
+
// 步骤 3:脱敏
|
|
112
|
+
const codeSnippets = [];
|
|
113
|
+
if (deep) {
|
|
114
|
+
for (const filePath of filePaths) {
|
|
115
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
116
|
+
const lines = content.split('\n');
|
|
117
|
+
if (lines.length > CHUNK_THRESHOLD) {
|
|
118
|
+
const chunks = splitIntoChunks(content);
|
|
119
|
+
for (const chunk of chunks) {
|
|
120
|
+
const { redactedContent } = redact(chunk.content, filePath);
|
|
121
|
+
codeSnippets.push(redactedContent);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const { redactedContent } = redact(content, filePath);
|
|
126
|
+
codeSnippets.push(redactedContent);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// --- 阶段 2:上下文组装 ---
|
|
131
|
+
const contextStart = Date.now();
|
|
132
|
+
onStageProgress?.({ stage: 'context', message: '上下文组装中...' });
|
|
133
|
+
// 步骤 2.5:提取代码切片(控制流骨架,FR-001)
|
|
134
|
+
// 降级保护:extractCodeSlices 内部有 try/catch,失败时返回空数组
|
|
135
|
+
let codeSlices = [];
|
|
136
|
+
try {
|
|
137
|
+
codeSlices = extractCodeSlices(skeletons, undefined, {
|
|
138
|
+
maxTokens: 200_000,
|
|
139
|
+
});
|
|
140
|
+
if (codeSlices.length > 0) {
|
|
141
|
+
onStageProgress?.({ stage: 'context', message: `代码切片提取完成(${codeSlices.length} 个函数,~${codeSlices.reduce((s, c) => s + c.estimatedTokens, 0).toLocaleString()} tokens)` });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
// FR-011:降级保护,切片提取失败不影响主流程
|
|
146
|
+
onStageProgress?.({ stage: 'context', message: `⚠ 代码切片提取失败,已降级(${err instanceof Error ? err.message : String(err)})` });
|
|
147
|
+
codeSlices = [];
|
|
148
|
+
}
|
|
149
|
+
// 步骤 2.6:读取 README.md(FR-007)
|
|
150
|
+
const README_MAX_CHARS = 6000;
|
|
151
|
+
let readmeContext;
|
|
152
|
+
const targetDir = fs.statSync(path.resolve(targetPath)).isDirectory()
|
|
153
|
+
? path.resolve(targetPath)
|
|
154
|
+
: path.dirname(path.resolve(targetPath));
|
|
155
|
+
const projectRootDir = options.projectRoot ? path.resolve(options.projectRoot) : process.cwd();
|
|
156
|
+
for (const readmeDir of [targetDir, projectRootDir]) {
|
|
157
|
+
const readmePath = path.join(readmeDir, 'README.md');
|
|
158
|
+
if (fs.existsSync(readmePath)) {
|
|
159
|
+
try {
|
|
160
|
+
const readmeContent = fs.readFileSync(readmePath, 'utf-8');
|
|
161
|
+
readmeContext = readmeContent.slice(0, README_MAX_CHARS);
|
|
162
|
+
if (readmeContent.length > README_MAX_CHARS) {
|
|
163
|
+
readmeContext += '\n\n...(README 内容已截断)';
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
// 读取失败时跳过(降级保护)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// 步骤 2.7:扫描 Markdown 知识文件(FR-009)
|
|
173
|
+
const KNOWLEDGE_MAX_CHARS = 8000;
|
|
174
|
+
let knowledgeFiles;
|
|
175
|
+
try {
|
|
176
|
+
const knowledgePatterns = ['SKILL.md', 'AGENTS.md', 'CLAUDE.md'];
|
|
177
|
+
const knowledgeDirs = ['skills', 'commands', 'agents'];
|
|
178
|
+
const knowledgeParts = [];
|
|
179
|
+
let knowledgeChars = 0;
|
|
180
|
+
// 扫描根目录的知识文件
|
|
181
|
+
for (const pattern of knowledgePatterns) {
|
|
182
|
+
const filePath = path.join(projectRootDir, pattern);
|
|
183
|
+
if (fs.existsSync(filePath)) {
|
|
184
|
+
try {
|
|
185
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
186
|
+
const snippet = content.slice(0, 2000);
|
|
187
|
+
knowledgeParts.push(`### ${pattern}\n\n${snippet}${content.length > 2000 ? '\n...(已截断)' : ''}`);
|
|
188
|
+
knowledgeChars += snippet.length;
|
|
189
|
+
}
|
|
190
|
+
catch { /* 跳过 */ }
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// 扫描 skills/、commands/、agents/ 目录下的 .md 文件
|
|
194
|
+
for (const dir of knowledgeDirs) {
|
|
195
|
+
const dirPath = path.join(projectRootDir, dir);
|
|
196
|
+
if (fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory()) {
|
|
197
|
+
try {
|
|
198
|
+
const entries = fs.readdirSync(dirPath);
|
|
199
|
+
for (const entry of entries) {
|
|
200
|
+
if (knowledgeChars >= KNOWLEDGE_MAX_CHARS)
|
|
201
|
+
break;
|
|
202
|
+
const fullPath = path.join(dirPath, entry);
|
|
203
|
+
// 支持 skills/wiki/SKILL.md 嵌套结构
|
|
204
|
+
const mdPath = fs.statSync(fullPath).isDirectory()
|
|
205
|
+
? path.join(fullPath, 'SKILL.md')
|
|
206
|
+
: (entry.endsWith('.md') ? fullPath : null);
|
|
207
|
+
if (mdPath && fs.existsSync(mdPath)) {
|
|
208
|
+
try {
|
|
209
|
+
const content = fs.readFileSync(mdPath, 'utf-8');
|
|
210
|
+
const maxChunk = Math.min(1500, KNOWLEDGE_MAX_CHARS - knowledgeChars);
|
|
211
|
+
if (maxChunk <= 0)
|
|
212
|
+
break;
|
|
213
|
+
const snippet = content.slice(0, maxChunk);
|
|
214
|
+
knowledgeParts.push(`### ${path.relative(projectRootDir, mdPath)}\n\n${snippet}${content.length > maxChunk ? '\n...(已截断)' : ''}`);
|
|
215
|
+
knowledgeChars += snippet.length;
|
|
216
|
+
}
|
|
217
|
+
catch { /* 跳过 */ }
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch { /* 跳过 */ }
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (knowledgeParts.length > 0) {
|
|
225
|
+
knowledgeFiles = knowledgeParts.join('\n\n---\n\n');
|
|
226
|
+
onStageProgress?.({ stage: 'context', message: `知识文件发现 ${knowledgeParts.length} 个` });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// FR-011:知识文件扫描失败不影响主流程
|
|
231
|
+
}
|
|
232
|
+
// 步骤 2.8:构建调用方上下文(FR-008)
|
|
233
|
+
let callerContext;
|
|
234
|
+
try {
|
|
235
|
+
// 从 skeleton 的 imports 反向推断:哪些模块的 exports 被当前模块引用
|
|
236
|
+
const callerModules = mergedSkeleton.imports
|
|
237
|
+
.filter(imp => imp.isRelative)
|
|
238
|
+
.map(imp => imp.moduleSpecifier)
|
|
239
|
+
.slice(0, 10);
|
|
240
|
+
if (callerModules.length > 0) {
|
|
241
|
+
callerContext = `当前模块依赖以下 ${callerModules.length} 个内部模块:\n${callerModules.map(m => `- \`${m}\``).join('\n')}\n\n请基于这些依赖关系理解本模块在架构中的定位。`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
// 降级保护
|
|
246
|
+
}
|
|
247
|
+
// 步骤 2.9:扫描测试文件,注入测试覆盖上下文(FR-008 测试文件感知)
|
|
248
|
+
let testContext;
|
|
249
|
+
try {
|
|
250
|
+
const testInfo = scanTestFiles(projectRootDir);
|
|
251
|
+
if (testInfo) {
|
|
252
|
+
testContext = `## 项目测试文件概览\n\n${testInfo}\n\n请在生成 Section 8(测试覆盖)时参考以上实际测试文件列表,列出已覆盖的功能模块,并指出尚未覆盖的关键路径。`;
|
|
253
|
+
onStageProgress?.({ stage: 'context', message: `测试文件扫描完成` });
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
// FR-011:测试文件扫描失败不影响主流程
|
|
258
|
+
}
|
|
259
|
+
// 将测试上下文追加到 README 上下文中(避免增加新参数,复用 readmeContext 扩展)
|
|
260
|
+
const combinedReadmeContext = [readmeContext, testContext].filter(Boolean).join('\n\n---\n\n') || undefined;
|
|
261
|
+
const context = await assembleContext(mergedSkeleton, {
|
|
262
|
+
codeSnippets,
|
|
263
|
+
codeSlices: codeSlices.length > 0 ? codeSlices : undefined,
|
|
264
|
+
readmeContext: combinedReadmeContext,
|
|
265
|
+
knowledgeFiles,
|
|
266
|
+
callerContext,
|
|
267
|
+
});
|
|
268
|
+
// token 数警告(当 token 超过 400,000——即 500,000 预算的 80%)
|
|
269
|
+
if (context.tokenCount > 400_000) {
|
|
270
|
+
onStageProgress?.({ stage: 'context', message: `⚠ 上下文 token 数较大 (${context.tokenCount.toLocaleString()}),可能影响质量` });
|
|
271
|
+
}
|
|
272
|
+
onStageProgress?.({ stage: 'context', message: '上下文组装完成', duration: Date.now() - contextStart });
|
|
273
|
+
return { skeletons, mergedSkeleton, context, codeSnippets, filePaths, codeSlices };
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* 单模块 Spec 生成端到端编排
|
|
277
|
+
*
|
|
278
|
+
* 流水线步骤:
|
|
279
|
+
* 1-4. prepareContext()(预处理 + 上下文组装)
|
|
280
|
+
* 5. 调用 Claude API
|
|
281
|
+
* 6. 解析 + 验证 LLM 响应
|
|
282
|
+
* 7. 注入不确定性标记
|
|
283
|
+
* 8. Handlebars 渲染 → specs/*.spec.md
|
|
284
|
+
* 9. 基线骨架序列化
|
|
285
|
+
*
|
|
286
|
+
* @param targetPath - 待分析的目录或文件路径
|
|
287
|
+
* @param options - 生成选项
|
|
288
|
+
* @returns 生成结果
|
|
289
|
+
*/
|
|
290
|
+
export async function generateSpec(targetPath, options = {}) {
|
|
291
|
+
const { outputDir = 'specs', existingVersion, onStageProgress } = options;
|
|
292
|
+
const warnings = [];
|
|
293
|
+
let tokenUsage = 0;
|
|
294
|
+
let llmDegraded = false;
|
|
295
|
+
// Feature 127:成本元数据采集
|
|
296
|
+
let costInputTokens = 0;
|
|
297
|
+
let costOutputTokens = 0;
|
|
298
|
+
let costDurationMs = 0;
|
|
299
|
+
let costLlmModel = '';
|
|
300
|
+
let costFallbackReason = null;
|
|
301
|
+
// 阶段 1-2:预处理 + 上下文组装
|
|
302
|
+
const { skeletons, mergedSkeleton, context, filePaths } = await prepareContext(targetPath, options);
|
|
303
|
+
// --- 阶段 3:生成增强 ---
|
|
304
|
+
// 步骤 5:调用 LLM
|
|
305
|
+
const llmStart = Date.now();
|
|
306
|
+
onStageProgress?.({ stage: 'llm', message: 'LLM 调用中...' });
|
|
307
|
+
// 将 onRetry 回调转换为阶段进度格式
|
|
308
|
+
const onRetry = onStageProgress
|
|
309
|
+
? (event) => {
|
|
310
|
+
const typeLabel = event.errorType === 'timeout' ? '超时'
|
|
311
|
+
: event.errorType === 'rate-limit' ? '速率限制'
|
|
312
|
+
: '服务器错误';
|
|
313
|
+
onStageProgress({ stage: 'llm', message: `↻ 重试 ${event.attempt}/${event.maxAttempts} (${typeLabel})...` });
|
|
314
|
+
}
|
|
315
|
+
: undefined;
|
|
316
|
+
// 从 Registry 获取目标语言的术语映射
|
|
317
|
+
const adapter = LanguageAdapterRegistry.getInstance().getAdapter(mergedSkeleton.filePath);
|
|
318
|
+
const languageTerminology = adapter?.getTerminology();
|
|
319
|
+
let llmContent;
|
|
320
|
+
try {
|
|
321
|
+
const llmResponse = await callLLM(context, { languageTerminology, ...(options.modelOverride ? { model: options.modelOverride } : {}) }, onRetry);
|
|
322
|
+
llmContent = llmResponse.content;
|
|
323
|
+
tokenUsage = llmResponse.inputTokens + llmResponse.outputTokens;
|
|
324
|
+
// Feature 127:记录 LLM#1 成本
|
|
325
|
+
costInputTokens += llmResponse.inputTokens;
|
|
326
|
+
costOutputTokens += llmResponse.outputTokens;
|
|
327
|
+
costDurationMs += llmResponse.duration;
|
|
328
|
+
costLlmModel = llmResponse.model;
|
|
329
|
+
}
|
|
330
|
+
catch (error) {
|
|
331
|
+
if (error instanceof LLMUnavailableError) {
|
|
332
|
+
// LLM 不可用,降级为 AST-only 输出
|
|
333
|
+
llmDegraded = true;
|
|
334
|
+
warnings.push('LLM 不可用,已降级为 AST-only Spec');
|
|
335
|
+
costFallbackReason = 'LLM 不可用';
|
|
336
|
+
onStageProgress?.({ stage: 'llm', message: '⚠ LLM 不可用,降级为 AST-only' });
|
|
337
|
+
llmContent = generateAstOnlyContent(mergedSkeleton);
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
throw error;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
onStageProgress?.({ stage: 'llm', message: 'LLM 调用完成', duration: Date.now() - llmStart });
|
|
344
|
+
// 步骤 6:解析 LLM 响应
|
|
345
|
+
const parseStart = Date.now();
|
|
346
|
+
onStageProgress?.({ stage: 'parse', message: '响应解析中...' });
|
|
347
|
+
const parsed = parseLLMResponse(llmContent);
|
|
348
|
+
warnings.push(...parsed.parseWarnings);
|
|
349
|
+
onStageProgress?.({ stage: 'parse', message: '响应解析完成', duration: Date.now() - parseStart });
|
|
350
|
+
// 步骤 7:不确定性标记已在 parseLLMResponse 中提取
|
|
351
|
+
const uncertaintyCount = parsed.uncertaintyMarkers.length;
|
|
352
|
+
// 步骤 7.5:混合渲染策略(FR-007)
|
|
353
|
+
// 叙述优先:LLM 的文字描述放前面(对人友好),AST 精确表格放后面(作参考)
|
|
354
|
+
// LLM 优先的章节(意图、业务逻辑、约束、边界、技术债务、测试覆盖、依赖关系)保持 LLM 为主
|
|
355
|
+
const astInterfaceDef = generateAstInterfaceDefinition(skeletons);
|
|
356
|
+
const astDataStructures = generateAstDataStructures(skeletons);
|
|
357
|
+
const sections = { ...parsed.sections };
|
|
358
|
+
// 接口定义(Section 3):LLM 叙述在前 + AST 精确参考表在后
|
|
359
|
+
{
|
|
360
|
+
const llmInterface = sections.interfaceDefinition?.trim();
|
|
361
|
+
const hasAst = astInterfaceDef && astInterfaceDef !== '本模块无公共导出。';
|
|
362
|
+
if (llmInterface && hasAst) {
|
|
363
|
+
// 最佳情况:LLM 叙述 + AST 参考表
|
|
364
|
+
sections.interfaceDefinition = llmInterface + '\n\n---\n\n### 完整接口参考(AST 精确提取)\n\n' + astInterfaceDef;
|
|
365
|
+
}
|
|
366
|
+
else if (hasAst) {
|
|
367
|
+
// LLM 无内容:仅 AST 表格
|
|
368
|
+
sections.interfaceDefinition = astInterfaceDef;
|
|
369
|
+
}
|
|
370
|
+
else if (!llmInterface) {
|
|
371
|
+
sections.interfaceDefinition = '本模块无公共导出。';
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// 数据结构(Section 4):LLM 叙述在前 + AST 字段表在后
|
|
375
|
+
{
|
|
376
|
+
const llmDataStructures = sections.dataStructures?.trim();
|
|
377
|
+
const hasAst = !!astDataStructures;
|
|
378
|
+
if (llmDataStructures && hasAst) {
|
|
379
|
+
sections.dataStructures = llmDataStructures + '\n\n---\n\n### 完整字段定义(AST 精确提取)\n\n' + astDataStructures;
|
|
380
|
+
}
|
|
381
|
+
else if (hasAst) {
|
|
382
|
+
sections.dataStructures = astDataStructures;
|
|
383
|
+
}
|
|
384
|
+
// 若 AST 无数据结构,保留 LLM 内容不变
|
|
385
|
+
}
|
|
386
|
+
// 步骤 7.6:Section 2(业务逻辑)二次生成 — 用完整上下文重新生成更详细的版本
|
|
387
|
+
// 策略:先完成其他 Section 的分析积累上下文,再用所有已有内容重新生成 Section 2
|
|
388
|
+
// skipEnrichment: batch 中小模块可跳过此步骤以减少 LLM 调用
|
|
389
|
+
if (!llmDegraded && sections.businessLogic && !options.skipEnrichment) {
|
|
390
|
+
try {
|
|
391
|
+
// 构建包含 Section 3-9 的富上下文摘要
|
|
392
|
+
const otherSectionsContext = [
|
|
393
|
+
sections.interfaceDefinition ? `## 已分析的接口定义摘要\n${sections.interfaceDefinition.slice(0, 3000)}` : '',
|
|
394
|
+
sections.dataStructures ? `## 已分析的数据结构摘要\n${sections.dataStructures.slice(0, 2000)}` : '',
|
|
395
|
+
sections.constraints ? `## 已分析的约束条件\n${sections.constraints}` : '',
|
|
396
|
+
sections.edgeCases ? `## 已分析的边界条件\n${sections.edgeCases}` : '',
|
|
397
|
+
].filter(Boolean).join('\n\n---\n\n');
|
|
398
|
+
// 仅当上下文足够丰富时才执行二次生成(避免空上下文浪费 LLM 调用)
|
|
399
|
+
if (otherSectionsContext.length > 500) {
|
|
400
|
+
const enrichStart = Date.now();
|
|
401
|
+
onStageProgress?.({ stage: 'enrich', message: '二次生成 Section 2(业务逻辑)...' });
|
|
402
|
+
const enrichPrompt = `你是代码架构分析专家。请基于以下上下文为一个代码模块撰写**非常详细的**业务逻辑分析。
|
|
403
|
+
|
|
404
|
+
## 模块骨架信息
|
|
405
|
+
|
|
406
|
+
${context.prompt.slice(0, 8000)}
|
|
407
|
+
|
|
408
|
+
## 其他 Section 已分析的内容(作为参考,你可以引用其中的函数名和常量值)
|
|
409
|
+
|
|
410
|
+
${otherSectionsContext}
|
|
411
|
+
|
|
412
|
+
## 第一版业务逻辑(需要扩展和深化)
|
|
413
|
+
|
|
414
|
+
${sections.businessLogic}
|
|
415
|
+
|
|
416
|
+
## 任务
|
|
417
|
+
|
|
418
|
+
请重写上面的"第一版业务逻辑",使其**大幅扩展**:
|
|
419
|
+
|
|
420
|
+
1. **必须覆盖所有处理阶段**(不要只深入一个阶段而忽略其他阶段)
|
|
421
|
+
2. 每个阶段用 **加粗段落**(如 **阶段 N — 名称**)作为视觉分隔,后跟 3-5 行描述
|
|
422
|
+
3. 每个阶段包含:关键函数名(引用接口定义中的函数,标注文件名)、输入→输出数据类型、核心算法 2-3 步、特殊处理
|
|
423
|
+
4. **必须**保留 Mermaid 流程图(flowchart TD,涵盖全部阶段)和时序图
|
|
424
|
+
5. 篇幅应为第一版的 **2-3 倍**,但重点是**广度**(全阶段覆盖),不是某一阶段的极致深度
|
|
425
|
+
|
|
426
|
+
只输出 Section 2 的内容,不要输出其他 Section。不要输出标题行"## 2. 业务逻辑"。用中文撰写,技术术语保持英文。`;
|
|
427
|
+
try {
|
|
428
|
+
const enrichResponse = await callLLM({ ...context, prompt: enrichPrompt, tokenCount: estimateFast(enrichPrompt) }, { languageTerminology, ...(options.modelOverride ? { model: options.modelOverride } : {}) }, onRetry);
|
|
429
|
+
// Feature 127(Codex review 修复):enrichment 的 LLM 调用总是消耗 tokens,
|
|
430
|
+
// 无论生成内容是否被最终采纳,都必须在所有口径(tokenUsage +
|
|
431
|
+
// costMetadata)中记录,否则会系统性低报 LLM 花销。采纳与否只影响
|
|
432
|
+
// section 内容替换,不改变已发生的真实成本。
|
|
433
|
+
tokenUsage += enrichResponse.inputTokens + enrichResponse.outputTokens;
|
|
434
|
+
costInputTokens += enrichResponse.inputTokens;
|
|
435
|
+
costOutputTokens += enrichResponse.outputTokens;
|
|
436
|
+
costDurationMs += enrichResponse.duration;
|
|
437
|
+
const enrichedContent = enrichResponse.content.trim();
|
|
438
|
+
// 仅当二次生成的内容比第一版长才替换(防止退化)
|
|
439
|
+
if (enrichedContent.length > sections.businessLogic.length * 1.2) {
|
|
440
|
+
sections.businessLogic = enrichedContent;
|
|
441
|
+
}
|
|
442
|
+
onStageProgress?.({ stage: 'enrich', message: 'enrich 完成', duration: Date.now() - enrichStart });
|
|
443
|
+
}
|
|
444
|
+
catch {
|
|
445
|
+
// 二次生成失败时保留第一版,不影响主流程
|
|
446
|
+
onStageProgress?.({ stage: 'enrich', message: '⚠ Section 2 二次生成失败,保留第一版', duration: Date.now() - enrichStart });
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
catch {
|
|
451
|
+
// 降级保护
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
// 计算置信度
|
|
455
|
+
const confidence = calculateConfidence(skeletons, uncertaintyCount, context.truncated, llmDegraded);
|
|
456
|
+
// 步骤 8:渲染 Spec
|
|
457
|
+
const renderStart = Date.now();
|
|
458
|
+
onStageProgress?.({ stage: 'render', message: '渲染写入中...' });
|
|
459
|
+
initRenderer();
|
|
460
|
+
// 统一基准路径(供 sourceTarget、relatedFiles、fileInventory、Mermaid、baseline 共用)
|
|
461
|
+
const baseDir = options.projectRoot ? path.resolve(options.projectRoot) : process.cwd();
|
|
462
|
+
// 将 skeleton 的 filePath 转换为相对路径(供 Mermaid 图和 baseline 使用)
|
|
463
|
+
const relMerged = { ...mergedSkeleton, filePath: path.relative(baseDir, mergedSkeleton.filePath) };
|
|
464
|
+
const relSkeletons = skeletons.map((s) => ({ ...s, filePath: path.relative(baseDir, s.filePath) }));
|
|
465
|
+
// 生成 Mermaid 图表(类图 + 依赖图)
|
|
466
|
+
const classDiagram = generateClassDiagram(relMerged);
|
|
467
|
+
const depDiagram = generateDependencyDiagram(relMerged, relSkeletons);
|
|
468
|
+
// 生成 displayName:从 targetPath 提取最后一级目录名作为人类可读标题
|
|
469
|
+
const resolvedTarget = path.resolve(targetPath);
|
|
470
|
+
const displayName = path.basename(resolvedTarget);
|
|
471
|
+
// Feature 127:成本元数据(LLM#1 + enrichment 累加)
|
|
472
|
+
const costMetadata = {
|
|
473
|
+
tokenUsage: { input: costInputTokens, output: costOutputTokens },
|
|
474
|
+
durationMs: costDurationMs,
|
|
475
|
+
llmModel: costLlmModel,
|
|
476
|
+
fallbackReason: costFallbackReason,
|
|
477
|
+
};
|
|
478
|
+
// Feature 140 FR-012:从 AssembledContext 提取 token 来源细分
|
|
479
|
+
// costBreakdown 仅在 LLM 实际调用过的路径写入(AST-only 降级时跳过,避免误导观测);
|
|
480
|
+
// 即便 LLM 失败但 context 已组装,contextTruncated 仍然如实反映本次 budget 决策。
|
|
481
|
+
//
|
|
482
|
+
// 类型契约:AssembledContext.tokenBreakdown 是必填字段(非 optional),
|
|
483
|
+
// 测试 mock 必须按 TS 类型完整提供该字段;此处不再加 fallback,
|
|
484
|
+
// 由 type system 在编译期捕获不合规 mock。
|
|
485
|
+
const costBreakdown = llmDegraded
|
|
486
|
+
? undefined
|
|
487
|
+
: {
|
|
488
|
+
contextAssembly: context.tokenBreakdown.contextAssembly,
|
|
489
|
+
promptTemplate: context.tokenBreakdown.promptTemplate,
|
|
490
|
+
sourceFile: context.tokenBreakdown.sourceFile,
|
|
491
|
+
llmReasoning: costOutputTokens,
|
|
492
|
+
};
|
|
493
|
+
// 生成 frontmatter
|
|
494
|
+
const frontmatter = generateFrontmatter({
|
|
495
|
+
sourceTarget: path.relative(baseDir, resolvedTarget),
|
|
496
|
+
displayName,
|
|
497
|
+
relatedFiles: filePaths.map((f) => path.relative(baseDir, f)),
|
|
498
|
+
confidence,
|
|
499
|
+
skeletonHash: mergedSkeleton.hash,
|
|
500
|
+
existingVersion,
|
|
501
|
+
tokenUsage: costMetadata.tokenUsage,
|
|
502
|
+
durationMs: costMetadata.durationMs,
|
|
503
|
+
llmModel: costMetadata.llmModel,
|
|
504
|
+
fallbackReason: costMetadata.fallbackReason,
|
|
505
|
+
// Feature 133 P2-1:canonical spec 显式写入 sourceKind 字段,让用户在
|
|
506
|
+
// 视觉/grep 扫描时一眼识别 spec 身份(不再依赖"无字段=canonical"的隐式默认)。
|
|
507
|
+
// bundle_copy / derived 类型的 spec 由 spec-store / docs-bundle 等调用方
|
|
508
|
+
// 在各自路径独立设置,不受此默认影响。
|
|
509
|
+
sourceKind: 'canonical',
|
|
510
|
+
// Bug 142:batch 流程传入 effectiveMode 时写入 generatedByMode;
|
|
511
|
+
// 单文件 generate 不传,frontmatter 中省略该字段。
|
|
512
|
+
...(options.generatedByMode !== undefined
|
|
513
|
+
? { generatedByMode: options.generatedByMode }
|
|
514
|
+
: {}),
|
|
515
|
+
// Feature 140 FR-012:context 来源 input token 细分 + 是否被 budget 裁剪
|
|
516
|
+
...(costBreakdown !== undefined ? { costBreakdown } : {}),
|
|
517
|
+
contextTruncated: context.truncated,
|
|
518
|
+
});
|
|
519
|
+
// 构建 fileInventory(使用短路径:基于 sourceTarget 公共前缀)
|
|
520
|
+
const sourceTargetDir = path.dirname(path.relative(baseDir, resolvedTarget));
|
|
521
|
+
const fileInventory = skeletons.map((s) => {
|
|
522
|
+
const relPath = path.relative(baseDir, s.filePath);
|
|
523
|
+
// shortPath:去掉与 sourceTarget 相同的前缀目录
|
|
524
|
+
const shortPath = relPath.startsWith(sourceTargetDir + path.sep)
|
|
525
|
+
? relPath.slice(sourceTargetDir.length + 1)
|
|
526
|
+
: path.basename(relPath);
|
|
527
|
+
return {
|
|
528
|
+
path: relPath,
|
|
529
|
+
shortPath,
|
|
530
|
+
loc: s.loc,
|
|
531
|
+
purpose: s.exports.length > 0
|
|
532
|
+
? `导出 ${s.exports.map((e) => e.name).join(', ')}`
|
|
533
|
+
: '内部模块',
|
|
534
|
+
};
|
|
535
|
+
});
|
|
536
|
+
// 构建 ModuleSpec
|
|
537
|
+
const specName = path.basename(targetPath).replace(/\.[^.]+$/, '');
|
|
538
|
+
const outputPath = path.join(outputDir, `${specName}.spec.md`);
|
|
539
|
+
// 收集所有 Mermaid 图表
|
|
540
|
+
const diagrams = [];
|
|
541
|
+
if (classDiagram) {
|
|
542
|
+
diagrams.push({ type: 'classDiagram', source: classDiagram, title: '模块类图' });
|
|
543
|
+
}
|
|
544
|
+
if (depDiagram) {
|
|
545
|
+
diagrams.push({ type: 'graph', source: depDiagram, title: '依赖关系图' });
|
|
546
|
+
}
|
|
547
|
+
const moduleSpec = {
|
|
548
|
+
frontmatter,
|
|
549
|
+
// 使用混合渲染后的 sections(步骤 7.5 已将 AST 内容合并到 interfaceDefinition 和 dataStructures)
|
|
550
|
+
sections,
|
|
551
|
+
mermaidDiagrams: diagrams.length > 0 ? diagrams : undefined,
|
|
552
|
+
fileInventory,
|
|
553
|
+
baselineSkeleton: relMerged,
|
|
554
|
+
outputPath,
|
|
555
|
+
};
|
|
556
|
+
const markdown = renderSpec(moduleSpec);
|
|
557
|
+
// 步骤 9:写入文件
|
|
558
|
+
const resolvedOutput = path.resolve(outputPath);
|
|
559
|
+
fs.mkdirSync(path.dirname(resolvedOutput), { recursive: true });
|
|
560
|
+
fs.writeFileSync(resolvedOutput, markdown, 'utf-8');
|
|
561
|
+
onStageProgress?.({ stage: 'render', message: '渲染写入完成', duration: Date.now() - renderStart });
|
|
562
|
+
return {
|
|
563
|
+
specPath: outputPath,
|
|
564
|
+
skeleton: mergedSkeleton,
|
|
565
|
+
tokenUsage,
|
|
566
|
+
confidence,
|
|
567
|
+
warnings,
|
|
568
|
+
moduleSpec,
|
|
569
|
+
costMetadata,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
// ============================================================
|
|
573
|
+
// AST 直出辅助函数(FR-001, FR-002, FR-003, FR-004)
|
|
574
|
+
// ============================================================
|
|
575
|
+
/**
|
|
576
|
+
* 从多个 CodeSkeleton 的 exports 生成按源文件分组的接口定义表格(FR-001, FR-002)
|
|
577
|
+
* 每组输出 `### <文件名>` 子标题 + Markdown 表格
|
|
578
|
+
* 表格列:名称、类型(kind)、签名、成员数
|
|
579
|
+
* 含 members 的类/接口展开为缩进子表格
|
|
580
|
+
*
|
|
581
|
+
* @param skeletons - 各文件的 CodeSkeleton 数组
|
|
582
|
+
* @returns Markdown 格式的接口定义文本
|
|
583
|
+
*/
|
|
584
|
+
export function generateAstInterfaceDefinition(skeletons) {
|
|
585
|
+
// 过滤掉没有任何导出的骨架
|
|
586
|
+
const withExports = skeletons.filter((s) => s.exports.length > 0);
|
|
587
|
+
if (withExports.length === 0) {
|
|
588
|
+
return '本模块无公共导出。';
|
|
589
|
+
}
|
|
590
|
+
const parts = [];
|
|
591
|
+
for (const skeleton of withExports) {
|
|
592
|
+
const fileName = path.basename(skeleton.filePath);
|
|
593
|
+
parts.push(`### ${fileName}`);
|
|
594
|
+
parts.push('');
|
|
595
|
+
parts.push('| 名称 | 类型 | 签名 | 成员数 |');
|
|
596
|
+
parts.push('|------|------|------|--------|');
|
|
597
|
+
for (const exp of skeleton.exports) {
|
|
598
|
+
// 处理签名中的竖线避免破坏表格
|
|
599
|
+
const safeSig = exp.signature.replace(/\|/g, '\\|');
|
|
600
|
+
const memberCount = exp.members ? exp.members.length : '-';
|
|
601
|
+
parts.push(`| \`${exp.name}\` | ${exp.kind} | \`${safeSig}\` | ${memberCount} |`);
|
|
602
|
+
}
|
|
603
|
+
// 展开含 members 的类/接口为缩进子表格(FR-001 US-1 验收场景 3)
|
|
604
|
+
const classLike = skeleton.exports.filter((e) => (e.kind === 'class' || e.kind === 'interface') && e.members && e.members.length > 0);
|
|
605
|
+
for (const cls of classLike) {
|
|
606
|
+
parts.push('');
|
|
607
|
+
parts.push(`**${cls.name} 成员**`);
|
|
608
|
+
parts.push('');
|
|
609
|
+
parts.push('| 成员 | 类型 | 签名 | 可见性 |');
|
|
610
|
+
parts.push('|------|------|------|--------|');
|
|
611
|
+
for (const member of cls.members) {
|
|
612
|
+
const safeMemberSig = member.signature.replace(/\|/g, '\\|');
|
|
613
|
+
const visibility = member.visibility ?? 'public';
|
|
614
|
+
parts.push(`| \`${member.name}\` | ${member.kind} | \`${safeMemberSig}\` | ${visibility} |`);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
parts.push('');
|
|
618
|
+
}
|
|
619
|
+
return parts.join('\n').trimEnd();
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* 从 CodeSkeleton 中提取数据结构并生成字段/值表格(FR-003, FR-004)
|
|
623
|
+
* 处理 kind === 'class' | 'interface' | 'type' | 'enum'
|
|
624
|
+
* 对含 members 的类生成字段表格,对 enum 生成值列表
|
|
625
|
+
*
|
|
626
|
+
* @param skeletons - 各文件的 CodeSkeleton 数组
|
|
627
|
+
* @returns Markdown 格式的数据结构文本
|
|
628
|
+
*/
|
|
629
|
+
export function generateAstDataStructures(skeletons) {
|
|
630
|
+
// 从所有骨架筛选数据结构相关导出
|
|
631
|
+
const dataExports = skeletons.flatMap((s) => s.exports
|
|
632
|
+
.filter((e) => e.kind === 'class' || e.kind === 'interface' || e.kind === 'type' || e.kind === 'enum' || e.kind === 'data_class')
|
|
633
|
+
.map((e) => ({ exp: e, filePath: s.filePath })));
|
|
634
|
+
if (dataExports.length === 0) {
|
|
635
|
+
return '';
|
|
636
|
+
}
|
|
637
|
+
const parts = [];
|
|
638
|
+
for (const { exp, filePath } of dataExports) {
|
|
639
|
+
const fileName = path.basename(filePath);
|
|
640
|
+
if (exp.kind === 'enum') {
|
|
641
|
+
// enum:生成值列表表格
|
|
642
|
+
parts.push(`#### \`${exp.name}\` (enum) — ${fileName}`);
|
|
643
|
+
parts.push('');
|
|
644
|
+
if (exp.members && exp.members.length > 0) {
|
|
645
|
+
parts.push('| 枚举值 | 签名 |');
|
|
646
|
+
parts.push('|--------|------|');
|
|
647
|
+
for (const member of exp.members) {
|
|
648
|
+
const safeSig = member.signature.replace(/\|/g, '\\|');
|
|
649
|
+
parts.push(`| \`${member.name}\` | \`${safeSig}\` |`);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
// 没有成员信息时,展示签名
|
|
654
|
+
const safeSig = exp.signature.replace(/\|/g, '\\|');
|
|
655
|
+
parts.push(`\`${safeSig}\``);
|
|
656
|
+
}
|
|
657
|
+
parts.push('');
|
|
658
|
+
}
|
|
659
|
+
else if (exp.kind === 'class' || exp.kind === 'interface' || exp.kind === 'data_class') {
|
|
660
|
+
// class/interface/dataclass:生成字段表格
|
|
661
|
+
const kindLabel = exp.kind === 'data_class' ? 'dataclass' : exp.kind;
|
|
662
|
+
parts.push(`#### \`${exp.name}\` (${kindLabel}) — ${fileName}`);
|
|
663
|
+
parts.push('');
|
|
664
|
+
if (exp.members && exp.members.length > 0) {
|
|
665
|
+
// 分离属性(property)和方法(method)
|
|
666
|
+
const properties = exp.members.filter((m) => m.kind === 'property' || m.kind === 'getter' || m.kind === 'setter');
|
|
667
|
+
const methods = exp.members.filter((m) => m.kind !== 'property' && m.kind !== 'getter' && m.kind !== 'setter');
|
|
668
|
+
if (properties.length > 0) {
|
|
669
|
+
parts.push('**字段**');
|
|
670
|
+
parts.push('');
|
|
671
|
+
parts.push('| 字段名 | 类型/签名 | 可见性 |');
|
|
672
|
+
parts.push('|--------|-----------|--------|');
|
|
673
|
+
for (const prop of properties) {
|
|
674
|
+
const safeSig = prop.signature.replace(/\|/g, '\\|');
|
|
675
|
+
const visibility = prop.visibility ?? 'public';
|
|
676
|
+
parts.push(`| \`${prop.name}\` | \`${safeSig}\` | ${visibility} |`);
|
|
677
|
+
}
|
|
678
|
+
parts.push('');
|
|
679
|
+
}
|
|
680
|
+
if (methods.length > 0) {
|
|
681
|
+
parts.push('**方法**');
|
|
682
|
+
parts.push('');
|
|
683
|
+
parts.push('| 方法名 | 签名 | 可见性 |');
|
|
684
|
+
parts.push('|--------|------|--------|');
|
|
685
|
+
for (const method of methods) {
|
|
686
|
+
const safeSig = method.signature.replace(/\|/g, '\\|');
|
|
687
|
+
const visibility = method.visibility ?? 'public';
|
|
688
|
+
parts.push(`| \`${method.name}\` | \`${safeSig}\` | ${visibility} |`);
|
|
689
|
+
}
|
|
690
|
+
parts.push('');
|
|
691
|
+
}
|
|
692
|
+
if (properties.length === 0 && methods.length === 0) {
|
|
693
|
+
const safeSig = exp.signature.replace(/\|/g, '\\|');
|
|
694
|
+
parts.push(`\`${safeSig}\``);
|
|
695
|
+
parts.push('');
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
// 没有成员信息时,展示签名
|
|
700
|
+
const safeSig = exp.signature.replace(/\|/g, '\\|');
|
|
701
|
+
parts.push(`\`${safeSig}\``);
|
|
702
|
+
parts.push('');
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
else if (exp.kind === 'type') {
|
|
706
|
+
// type alias:展示签名
|
|
707
|
+
const safeSig = exp.signature.replace(/\|/g, '\\|');
|
|
708
|
+
parts.push(`#### \`${exp.name}\` (type) — ${fileName}`);
|
|
709
|
+
parts.push('');
|
|
710
|
+
parts.push(`\`${safeSig}\``);
|
|
711
|
+
parts.push('');
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return parts.join('\n').trimEnd();
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* 扫描项目测试目录,统计测试文件数和测试函数名(FR-008)
|
|
718
|
+
* 支持模式:.test.* / .spec.* / test_*.py
|
|
719
|
+
*
|
|
720
|
+
* @param projectRootDir - 项目根目录
|
|
721
|
+
* @returns 测试文件统计信息文本,如无测试目录返回空字符串
|
|
722
|
+
*/
|
|
723
|
+
function scanTestFiles(projectRootDir) {
|
|
724
|
+
const testDirCandidates = ['tests', 'test', '__tests__', 'spec'];
|
|
725
|
+
const testFilePatterns = [
|
|
726
|
+
/\.test\.(ts|tsx|js|jsx|py)$/,
|
|
727
|
+
/\.spec\.(ts|tsx|js|jsx|py)$/,
|
|
728
|
+
/^test_.*\.py$/,
|
|
729
|
+
];
|
|
730
|
+
const foundFiles = [];
|
|
731
|
+
// 递归扫描测试文件
|
|
732
|
+
function walkDir(dir, depth = 0) {
|
|
733
|
+
if (depth > 5)
|
|
734
|
+
return; // 避免无限递归
|
|
735
|
+
try {
|
|
736
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
737
|
+
for (const entry of entries) {
|
|
738
|
+
if (!entry.isDirectory() && !entry.isFile())
|
|
739
|
+
continue;
|
|
740
|
+
const fullPath = path.join(dir, entry.name);
|
|
741
|
+
if (entry.isDirectory()) {
|
|
742
|
+
// 跳过 node_modules、.git 等
|
|
743
|
+
if (entry.name === 'node_modules' || entry.name === '.git' || entry.name.startsWith('.'))
|
|
744
|
+
continue;
|
|
745
|
+
walkDir(fullPath, depth + 1);
|
|
746
|
+
}
|
|
747
|
+
else if (entry.isFile()) {
|
|
748
|
+
const isTestFile = testFilePatterns.some((p) => p.test(entry.name));
|
|
749
|
+
if (isTestFile) {
|
|
750
|
+
foundFiles.push({
|
|
751
|
+
filePath: fullPath,
|
|
752
|
+
relativePath: path.relative(projectRootDir, fullPath),
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
catch {
|
|
759
|
+
// 目录读取失败时跳过
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
// 先检查常规测试目录
|
|
763
|
+
for (const candidate of testDirCandidates) {
|
|
764
|
+
const candidatePath = path.join(projectRootDir, candidate);
|
|
765
|
+
if (fs.existsSync(candidatePath) && fs.statSync(candidatePath).isDirectory()) {
|
|
766
|
+
walkDir(candidatePath);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
// 如果没有找到,也扫描项目根目录(处理测试文件散布的情况)
|
|
770
|
+
if (foundFiles.length === 0) {
|
|
771
|
+
walkDir(projectRootDir);
|
|
772
|
+
}
|
|
773
|
+
if (foundFiles.length === 0) {
|
|
774
|
+
return '';
|
|
775
|
+
}
|
|
776
|
+
// 提取测试函数名(轻量正则扫描,不做完整 AST)
|
|
777
|
+
const TEST_FUNCTION_PATTERNS = [
|
|
778
|
+
/(?:describe|it|test)\s*\(\s*['"`]([^'"`]+)['"`]/g, // JS/TS: describe('name'), it('name'), test('name')
|
|
779
|
+
/def\s+(test_\w+)/g, // Python: def test_xxx
|
|
780
|
+
/func\s+(Test\w+)/g, // Go: func TestXxx
|
|
781
|
+
];
|
|
782
|
+
let totalTestFunctions = 0;
|
|
783
|
+
const fileDetails = [];
|
|
784
|
+
const displayFiles = foundFiles.slice(0, 100);
|
|
785
|
+
for (const { filePath, relativePath } of displayFiles) {
|
|
786
|
+
try {
|
|
787
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
788
|
+
const funcNames = [];
|
|
789
|
+
for (const pattern of TEST_FUNCTION_PATTERNS) {
|
|
790
|
+
const re = new RegExp(pattern.source, pattern.flags);
|
|
791
|
+
let m;
|
|
792
|
+
while ((m = re.exec(content)) !== null) {
|
|
793
|
+
if (m[1])
|
|
794
|
+
funcNames.push(m[1]);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
totalTestFunctions += funcNames.length;
|
|
798
|
+
const funcSummary = funcNames.length > 0
|
|
799
|
+
? `(${funcNames.length} 个测试: ${funcNames.slice(0, 5).join(', ')}${funcNames.length > 5 ? ` ...+${funcNames.length - 5}` : ''})`
|
|
800
|
+
: '';
|
|
801
|
+
fileDetails.push(`- \`${relativePath}\`${funcSummary}`);
|
|
802
|
+
}
|
|
803
|
+
catch {
|
|
804
|
+
fileDetails.push(`- \`${relativePath}\``);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
const parts = [];
|
|
808
|
+
parts.push(`扫描到 **${foundFiles.length} 个测试文件**,共 **${totalTestFunctions} 个测试函数**${foundFiles.length > 100 ? '(以下展示前 100 个)' : ''}:`);
|
|
809
|
+
parts.push('');
|
|
810
|
+
parts.push(...fileDetails);
|
|
811
|
+
return parts.join('\n');
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* LLM 不可用时的 AST-only 降级内容生成
|
|
815
|
+
* Section 2 从 skeleton.exports 生成签名表格
|
|
816
|
+
* Section 3 从 skeleton.imports 生成 Mermaid 依赖图
|
|
817
|
+
*/
|
|
818
|
+
function generateAstOnlyContent(skeleton) {
|
|
819
|
+
const sections = [];
|
|
820
|
+
sections.push('## 1. 意图');
|
|
821
|
+
sections.push(`[推断: LLM 不可用] 本模块位于 ${skeleton.filePath},包含 ${skeleton.exports.length} 个导出符号。`);
|
|
822
|
+
// Section 2:从 exports 生成签名表格
|
|
823
|
+
sections.push('## 2. 接口定义');
|
|
824
|
+
if (skeleton.exports.length > 0) {
|
|
825
|
+
sections.push('| 名称 | 类型 | 签名 |');
|
|
826
|
+
sections.push('|------|------|------|');
|
|
827
|
+
for (const exp of skeleton.exports) {
|
|
828
|
+
// 处理签名中的竖线以避免破坏表格
|
|
829
|
+
const safeSig = exp.signature.replace(/\|/g, '\\|');
|
|
830
|
+
sections.push(`| \`${exp.name}\` | ${exp.kind} | \`${safeSig}\` |`);
|
|
831
|
+
}
|
|
832
|
+
// 列出成员详情(如有)
|
|
833
|
+
const classExports = skeleton.exports.filter((e) => e.kind === 'class' && e.members && e.members.length > 0);
|
|
834
|
+
if (classExports.length > 0) {
|
|
835
|
+
sections.push('');
|
|
836
|
+
sections.push('**类成员**');
|
|
837
|
+
for (const cls of classExports) {
|
|
838
|
+
sections.push(`\n*${cls.name}*`);
|
|
839
|
+
sections.push('| 成员 | 类型 | 签名 |');
|
|
840
|
+
sections.push('|------|------|------|');
|
|
841
|
+
for (const member of cls.members) {
|
|
842
|
+
const vis = member.visibility ? `[${member.visibility}] ` : '';
|
|
843
|
+
const safeMemberSig = member.signature.replace(/\|/g, '\\|');
|
|
844
|
+
sections.push(`| \`${member.name}\` | ${member.kind} | ${vis}\`${safeMemberSig}\` |`);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
sections.push('无导出符号。');
|
|
851
|
+
}
|
|
852
|
+
// Section 3:从 imports 生成 Mermaid 依赖图
|
|
853
|
+
sections.push('## 3. 业务逻辑');
|
|
854
|
+
sections.push('[推断: LLM 不可用] 以下为基于 AST 骨架推断的模块依赖关系。');
|
|
855
|
+
if (skeleton.imports.length > 0) {
|
|
856
|
+
// 仅取内部相对导入绘图(外部依赖较多时图太乱)
|
|
857
|
+
const relativeImports = skeleton.imports.filter((imp) => imp.isRelative);
|
|
858
|
+
const externalImports = skeleton.imports.filter((imp) => !imp.isRelative);
|
|
859
|
+
if (relativeImports.length > 0) {
|
|
860
|
+
sections.push('');
|
|
861
|
+
sections.push('```mermaid');
|
|
862
|
+
sections.push('flowchart TD');
|
|
863
|
+
const modName = path.basename(skeleton.filePath, path.extname(skeleton.filePath));
|
|
864
|
+
for (const imp of relativeImports) {
|
|
865
|
+
const depName = path.basename(imp.moduleSpecifier);
|
|
866
|
+
sections.push(` ${modName}["${modName}"] --> ${depName}["${depName}"]`);
|
|
867
|
+
}
|
|
868
|
+
sections.push('```');
|
|
869
|
+
}
|
|
870
|
+
if (externalImports.length > 0) {
|
|
871
|
+
sections.push('');
|
|
872
|
+
sections.push('**外部依赖**');
|
|
873
|
+
for (const imp of externalImports) {
|
|
874
|
+
sections.push(`- \`${imp.moduleSpecifier}\``);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
sections.push('无模块依赖。');
|
|
880
|
+
}
|
|
881
|
+
sections.push('## 4. 数据结构');
|
|
882
|
+
const typeExports = skeleton.exports.filter((e) => e.kind === 'type' || e.kind === 'interface' || e.kind === 'enum');
|
|
883
|
+
if (typeExports.length > 0) {
|
|
884
|
+
for (const exp of typeExports) {
|
|
885
|
+
sections.push(`- \`${exp.signature}\``);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
else {
|
|
889
|
+
sections.push('无数据结构导出。');
|
|
890
|
+
}
|
|
891
|
+
sections.push('## 5. 约束条件');
|
|
892
|
+
sections.push('[推断: LLM 不可用] 无法分析约束条件。');
|
|
893
|
+
sections.push('## 6. 边界条件');
|
|
894
|
+
sections.push('[推断: LLM 不可用] 无法分析边界条件。');
|
|
895
|
+
sections.push('## 7. 技术债务');
|
|
896
|
+
sections.push('[推断: LLM 不可用] 无法分析技术债务。');
|
|
897
|
+
sections.push('## 8. 测试覆盖');
|
|
898
|
+
sections.push('[推断: LLM 不可用] 无法分析测试覆盖。');
|
|
899
|
+
sections.push('## 9. 依赖关系');
|
|
900
|
+
if (skeleton.imports.length > 0) {
|
|
901
|
+
for (const imp of skeleton.imports) {
|
|
902
|
+
const names = imp.namedImports?.join(', ') ?? imp.defaultImport ?? '*';
|
|
903
|
+
sections.push(`- \`${names}\` from \`${imp.moduleSpecifier}\``);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
sections.push('无导入依赖。');
|
|
908
|
+
}
|
|
909
|
+
return sections.join('\n\n');
|
|
910
|
+
}
|
|
911
|
+
//# sourceMappingURL=single-spec-orchestrator.js.map
|