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,449 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI / AsyncAPI 提取器(Feature 107)
|
|
3
|
+
* 独立实现,不修改 api-surface/openapi-extractor.ts
|
|
4
|
+
* 输出:ExtractionResult(包含 api / api-schema / event 节点)
|
|
5
|
+
*
|
|
6
|
+
* 实现的功能:
|
|
7
|
+
* - JSON/YAML 格式 OpenAPI 3.x/Swagger 2.x 解析
|
|
8
|
+
* - AsyncAPI 2.x channel/message → event 节点
|
|
9
|
+
* - $ref 循环检测(visited set + 5 层绝对深度上限 + 占位节点)
|
|
10
|
+
* - 置信度均为 EXTRACTED(确定性提取)
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from 'node:fs';
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import { createLogger } from '../panoramic/utils/logger.js';
|
|
15
|
+
import { EMPTY_EXTRACTION_RESULT } from './extraction-types.js';
|
|
16
|
+
const logger = createLogger('extraction-openapi');
|
|
17
|
+
// ============================================================
|
|
18
|
+
// $ref 循环检测常量
|
|
19
|
+
// ============================================================
|
|
20
|
+
/** $ref 解析绝对层数上限(超过则插入占位节点) */
|
|
21
|
+
const REF_MAX_DEPTH = 5;
|
|
22
|
+
// ============================================================
|
|
23
|
+
// 轻量 YAML 解析(仅覆盖 OpenAPI spec 的 key-value + $ref 场景)
|
|
24
|
+
// ============================================================
|
|
25
|
+
/**
|
|
26
|
+
* 极简 YAML 解析器,仅支持 OpenAPI/AsyncAPI spec 所需的子集:
|
|
27
|
+
* - key: value(字符串、数字、布尔)
|
|
28
|
+
* - key: (嵌套对象,通过缩进识别)
|
|
29
|
+
* - $ref: "#/..."
|
|
30
|
+
*
|
|
31
|
+
* 不支持 YAML 锚点、别名、多文档等高级特性。
|
|
32
|
+
* 对于无法解析的内容返回 null。
|
|
33
|
+
*/
|
|
34
|
+
function parseSimpleYaml(content) {
|
|
35
|
+
const lines = content.split('\n');
|
|
36
|
+
// 使用迭代式栈解析缩进层次
|
|
37
|
+
return parseYamlBlock(lines, 0, -1).value;
|
|
38
|
+
}
|
|
39
|
+
function unquote(s) {
|
|
40
|
+
if ((s.startsWith('"') && s.endsWith('"')) || (s.startsWith("'") && s.endsWith("'"))) {
|
|
41
|
+
return s.slice(1, -1);
|
|
42
|
+
}
|
|
43
|
+
return s;
|
|
44
|
+
}
|
|
45
|
+
function parseYamlValue(raw) {
|
|
46
|
+
const s = raw.trim();
|
|
47
|
+
if (s === 'true' || s === 'yes')
|
|
48
|
+
return true;
|
|
49
|
+
if (s === 'false' || s === 'no')
|
|
50
|
+
return false;
|
|
51
|
+
if (s === 'null' || s === '~' || s === '')
|
|
52
|
+
return null;
|
|
53
|
+
const num = Number(s);
|
|
54
|
+
if (!isNaN(num) && s !== '')
|
|
55
|
+
return num;
|
|
56
|
+
return unquote(s);
|
|
57
|
+
}
|
|
58
|
+
function parseYamlBlock(lines, startLine, parentIndent) {
|
|
59
|
+
const result = {};
|
|
60
|
+
let i = startLine;
|
|
61
|
+
while (i < lines.length) {
|
|
62
|
+
const line = lines[i];
|
|
63
|
+
// 跳过注释和空行
|
|
64
|
+
const trimmed = line.trimStart();
|
|
65
|
+
if (trimmed.startsWith('#') || trimmed === '') {
|
|
66
|
+
i++;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
// 计算当前缩进
|
|
70
|
+
const indent = line.length - trimmed.length;
|
|
71
|
+
// 当前行缩进不超过父级,返回
|
|
72
|
+
if (indent <= parentIndent) {
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
// 解析 key: value 或 key:
|
|
76
|
+
const colonIdx = trimmed.indexOf(': ');
|
|
77
|
+
const colonEnd = trimmed.endsWith(':') ? trimmed.length - 1 : -1;
|
|
78
|
+
if (colonIdx !== -1) {
|
|
79
|
+
const key = unquote(trimmed.slice(0, colonIdx).trim());
|
|
80
|
+
const valueStr = trimmed.slice(colonIdx + 2).trim();
|
|
81
|
+
if (valueStr === '' || valueStr.startsWith('#')) {
|
|
82
|
+
// key: (子对象或数组,由下一行决定)
|
|
83
|
+
const nextNonEmpty = lines.slice(i + 1).findIndex((l) => l.trimStart() !== '' && !l.trimStart().startsWith('#'));
|
|
84
|
+
const nextLine = nextNonEmpty === -1 ? lines.length : i + 1 + nextNonEmpty;
|
|
85
|
+
const nextTrimmed = nextLine < lines.length ? lines[nextLine].trimStart() : '';
|
|
86
|
+
if (nextTrimmed.startsWith('- ')) {
|
|
87
|
+
// 数组 block
|
|
88
|
+
const arr = parseYamlArray(lines, i + 1, indent);
|
|
89
|
+
result[key] = arr.value;
|
|
90
|
+
i = arr.nextLine;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
const sub = parseYamlBlock(lines, i + 1, indent);
|
|
94
|
+
result[key] = sub.value;
|
|
95
|
+
i = sub.nextLine;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
result[key] = parseYamlValue(valueStr);
|
|
100
|
+
i++;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (colonEnd !== -1) {
|
|
104
|
+
const key = unquote(trimmed.slice(0, colonEnd).trim());
|
|
105
|
+
const sub = parseYamlBlock(lines, i + 1, indent);
|
|
106
|
+
result[key] = sub.value;
|
|
107
|
+
i = sub.nextLine;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
// 非 key: value 行,跳过
|
|
111
|
+
i++;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return { value: result, nextLine: i };
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 解析 YAML 列表块(`- item` 格式)
|
|
118
|
+
*/
|
|
119
|
+
function parseYamlArray(lines, startLine, parentIndent) {
|
|
120
|
+
const result = [];
|
|
121
|
+
let i = startLine;
|
|
122
|
+
while (i < lines.length) {
|
|
123
|
+
const line = lines[i];
|
|
124
|
+
const trimmed = line.trimStart();
|
|
125
|
+
if (trimmed.startsWith('#') || trimmed === '') {
|
|
126
|
+
i++;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const indent = line.length - trimmed.length;
|
|
130
|
+
if (indent <= parentIndent)
|
|
131
|
+
break;
|
|
132
|
+
if (trimmed.startsWith('- ')) {
|
|
133
|
+
result.push(parseYamlValue(trimmed.slice(2).trim()));
|
|
134
|
+
i++;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return { value: result, nextLine: i };
|
|
141
|
+
}
|
|
142
|
+
// ============================================================
|
|
143
|
+
// 辅助:类型检查
|
|
144
|
+
// ============================================================
|
|
145
|
+
function isObj(v) {
|
|
146
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
147
|
+
}
|
|
148
|
+
// ============================================================
|
|
149
|
+
// $ref 解析(内部,带循环检测)
|
|
150
|
+
// ============================================================
|
|
151
|
+
/**
|
|
152
|
+
* 解析 JSON Pointer 格式的 $ref(如 #/components/schemas/User)
|
|
153
|
+
*/
|
|
154
|
+
function resolveRef(doc, ref) {
|
|
155
|
+
if (!ref.startsWith('#/'))
|
|
156
|
+
return null;
|
|
157
|
+
const segments = ref.slice(2).split('/').map((s) => s.replace(/~1/g, '/').replace(/~0/g, '~'));
|
|
158
|
+
let cur = doc;
|
|
159
|
+
for (const seg of segments) {
|
|
160
|
+
if (!isObj(cur))
|
|
161
|
+
return null;
|
|
162
|
+
cur = cur[seg];
|
|
163
|
+
}
|
|
164
|
+
return cur ?? null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 递归解引用 $ref,带深度限制和已访问集合(循环检测)
|
|
168
|
+
*/
|
|
169
|
+
function dereferenceWithDepth(doc, value, visited, depth) {
|
|
170
|
+
if (depth > REF_MAX_DEPTH) {
|
|
171
|
+
return { _truncated: true, reason: '[ref-truncated]' };
|
|
172
|
+
}
|
|
173
|
+
if (!isObj(value) || typeof value.$ref !== 'string') {
|
|
174
|
+
return value;
|
|
175
|
+
}
|
|
176
|
+
const ref = value.$ref;
|
|
177
|
+
if (visited.has(ref)) {
|
|
178
|
+
return { _truncated: true, reason: `[ref-cycle: ${ref}]` };
|
|
179
|
+
}
|
|
180
|
+
const resolved = resolveRef(doc, ref);
|
|
181
|
+
if (!resolved)
|
|
182
|
+
return value;
|
|
183
|
+
visited.add(ref);
|
|
184
|
+
const result = dereferenceWithDepth(doc, resolved, visited, depth + 1);
|
|
185
|
+
visited.delete(ref);
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
// ============================================================
|
|
189
|
+
// 节点 ID 生成(遵循 data-model.md 规则)
|
|
190
|
+
// ============================================================
|
|
191
|
+
function makeApiNodeId(method, pathStr, sourceFile) {
|
|
192
|
+
return `api:${method.toUpperCase()}:${pathStr}:${sourceFile}`;
|
|
193
|
+
}
|
|
194
|
+
function makeSchemaNodeId(schemaName, sourceFile) {
|
|
195
|
+
return `schema:${schemaName}:${sourceFile}`;
|
|
196
|
+
}
|
|
197
|
+
function makeEventNodeId(channelName, sourceFile) {
|
|
198
|
+
return `event:${channelName}:${sourceFile}`;
|
|
199
|
+
}
|
|
200
|
+
// ============================================================
|
|
201
|
+
// OpenAPI 解析核心逻辑
|
|
202
|
+
// ============================================================
|
|
203
|
+
const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'];
|
|
204
|
+
/**
|
|
205
|
+
* 解析 OpenAPI 3.x / Swagger 2.x 文档,生成节点和边
|
|
206
|
+
*/
|
|
207
|
+
function parseOpenApiDoc(doc, relativeSourceFile) {
|
|
208
|
+
const nodes = [];
|
|
209
|
+
const edges = [];
|
|
210
|
+
if (!isObj(doc))
|
|
211
|
+
return { nodes, edges };
|
|
212
|
+
// 解析 components.schemas → api-schema 节点
|
|
213
|
+
const schemas = [];
|
|
214
|
+
if (isObj(doc.components) && isObj(doc.components.schemas)) {
|
|
215
|
+
for (const schemaName of Object.keys(doc.components.schemas)) {
|
|
216
|
+
const nodeId = makeSchemaNodeId(schemaName, relativeSourceFile);
|
|
217
|
+
schemas.push(nodeId);
|
|
218
|
+
nodes.push({
|
|
219
|
+
id: nodeId,
|
|
220
|
+
label: schemaName,
|
|
221
|
+
kind: 'api-schema',
|
|
222
|
+
source_file: relativeSourceFile,
|
|
223
|
+
confidence: 'EXTRACTED',
|
|
224
|
+
metadata: { sourceType: 'openapi-schema' },
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Swagger 2.x definitions → api-schema 节点
|
|
229
|
+
if (isObj(doc.definitions)) {
|
|
230
|
+
for (const schemaName of Object.keys(doc.definitions)) {
|
|
231
|
+
const nodeId = makeSchemaNodeId(schemaName, relativeSourceFile);
|
|
232
|
+
if (!schemas.includes(nodeId)) {
|
|
233
|
+
schemas.push(nodeId);
|
|
234
|
+
nodes.push({
|
|
235
|
+
id: nodeId,
|
|
236
|
+
label: schemaName,
|
|
237
|
+
kind: 'api-schema',
|
|
238
|
+
source_file: relativeSourceFile,
|
|
239
|
+
confidence: 'EXTRACTED',
|
|
240
|
+
metadata: { sourceType: 'swagger-definition' },
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// 解析 paths → api 节点
|
|
246
|
+
if (isObj(doc.paths)) {
|
|
247
|
+
for (const [pathStr, pathItem] of Object.entries(doc.paths)) {
|
|
248
|
+
if (!isObj(pathItem))
|
|
249
|
+
continue;
|
|
250
|
+
for (const method of HTTP_METHODS) {
|
|
251
|
+
const operation = pathItem[method];
|
|
252
|
+
if (!isObj(operation))
|
|
253
|
+
continue;
|
|
254
|
+
const nodeId = makeApiNodeId(method, pathStr, relativeSourceFile);
|
|
255
|
+
const label = `${method.toUpperCase()} ${pathStr}`;
|
|
256
|
+
nodes.push({
|
|
257
|
+
id: nodeId,
|
|
258
|
+
label,
|
|
259
|
+
kind: 'api',
|
|
260
|
+
source_file: relativeSourceFile,
|
|
261
|
+
confidence: 'EXTRACTED',
|
|
262
|
+
metadata: {
|
|
263
|
+
method: method.toUpperCase(),
|
|
264
|
+
path: pathStr,
|
|
265
|
+
summary: typeof operation.summary === 'string' ? operation.summary : undefined,
|
|
266
|
+
operationId: typeof operation.operationId === 'string' ? operation.operationId : undefined,
|
|
267
|
+
tags: Array.isArray(operation.tags) ? operation.tags : [],
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
// 建立 api → schema 的 uses-schema 边(扫描 $ref)
|
|
271
|
+
const refsInOperation = extractRefs(operation);
|
|
272
|
+
for (const ref of refsInOperation) {
|
|
273
|
+
const schemaName = ref.split('/').pop();
|
|
274
|
+
if (schemaName) {
|
|
275
|
+
const schemaId = makeSchemaNodeId(schemaName, relativeSourceFile);
|
|
276
|
+
if (schemas.includes(schemaId)) {
|
|
277
|
+
edges.push({
|
|
278
|
+
source: nodeId,
|
|
279
|
+
target: schemaId,
|
|
280
|
+
relation: 'uses-schema',
|
|
281
|
+
confidence: 'EXTRACTED',
|
|
282
|
+
weight: 1.0,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// schema defines 边:来源 api-schema 节点 → 目标(当前版本仅记录节点,不生成 schema-to-schema 边)
|
|
291
|
+
return { nodes, edges };
|
|
292
|
+
}
|
|
293
|
+
/** 递归提取对象中的所有 $ref 字符串 */
|
|
294
|
+
function extractRefs(obj, found = new Set(), depth = 0) {
|
|
295
|
+
if (depth > REF_MAX_DEPTH || !isObj(obj))
|
|
296
|
+
return found;
|
|
297
|
+
if (typeof obj.$ref === 'string') {
|
|
298
|
+
found.add(obj.$ref);
|
|
299
|
+
return found;
|
|
300
|
+
}
|
|
301
|
+
for (const val of Object.values(obj)) {
|
|
302
|
+
if (isObj(val))
|
|
303
|
+
extractRefs(val, found, depth + 1);
|
|
304
|
+
}
|
|
305
|
+
return found;
|
|
306
|
+
}
|
|
307
|
+
// ============================================================
|
|
308
|
+
// AsyncAPI 解析
|
|
309
|
+
// ============================================================
|
|
310
|
+
/**
|
|
311
|
+
* 解析 AsyncAPI 2.x 文档,channels → event 节点
|
|
312
|
+
*/
|
|
313
|
+
function parseAsyncApiDoc(doc, relativeSourceFile) {
|
|
314
|
+
const nodes = [];
|
|
315
|
+
const edges = [];
|
|
316
|
+
if (!isObj(doc) || !isObj(doc.channels))
|
|
317
|
+
return { nodes, edges };
|
|
318
|
+
// 创建 service 节点(代表该文件本身)
|
|
319
|
+
const serviceNodeId = `service:${relativeSourceFile}`;
|
|
320
|
+
const serviceLabel = relativeSourceFile.split('/').pop()?.replace(/\.[^.]+$/, '') ?? relativeSourceFile;
|
|
321
|
+
nodes.push({
|
|
322
|
+
id: serviceNodeId,
|
|
323
|
+
label: serviceLabel,
|
|
324
|
+
kind: 'service',
|
|
325
|
+
source_file: relativeSourceFile,
|
|
326
|
+
confidence: 'EXTRACTED',
|
|
327
|
+
metadata: { sourceTarget: relativeSourceFile },
|
|
328
|
+
});
|
|
329
|
+
for (const [channelName, channelItem] of Object.entries(doc.channels)) {
|
|
330
|
+
if (!isObj(channelItem))
|
|
331
|
+
continue;
|
|
332
|
+
const nodeId = makeEventNodeId(channelName, relativeSourceFile);
|
|
333
|
+
nodes.push({
|
|
334
|
+
id: nodeId,
|
|
335
|
+
label: channelName,
|
|
336
|
+
kind: 'event',
|
|
337
|
+
source_file: relativeSourceFile,
|
|
338
|
+
confidence: 'EXTRACTED',
|
|
339
|
+
metadata: {
|
|
340
|
+
channelName,
|
|
341
|
+
hasPublish: isObj(channelItem.publish),
|
|
342
|
+
hasSubscribe: isObj(channelItem.subscribe),
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
// publish → publishes 边(service 节点已存在,不会悬空)
|
|
346
|
+
if (isObj(channelItem.publish)) {
|
|
347
|
+
edges.push({
|
|
348
|
+
source: serviceNodeId,
|
|
349
|
+
target: nodeId,
|
|
350
|
+
relation: 'publishes',
|
|
351
|
+
confidence: 'EXTRACTED',
|
|
352
|
+
weight: 1.0,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
// subscribe → subscribes 边
|
|
356
|
+
if (isObj(channelItem.subscribe)) {
|
|
357
|
+
edges.push({
|
|
358
|
+
source: serviceNodeId,
|
|
359
|
+
target: nodeId,
|
|
360
|
+
relation: 'subscribes',
|
|
361
|
+
confidence: 'EXTRACTED',
|
|
362
|
+
weight: 1.0,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return { nodes, edges };
|
|
367
|
+
}
|
|
368
|
+
// ============================================================
|
|
369
|
+
// 判断是否为 AsyncAPI 文档
|
|
370
|
+
// ============================================================
|
|
371
|
+
function isAsyncApiDoc(doc) {
|
|
372
|
+
return isObj(doc) && typeof doc.asyncapi === 'string';
|
|
373
|
+
}
|
|
374
|
+
// ============================================================
|
|
375
|
+
// 公开 API
|
|
376
|
+
// ============================================================
|
|
377
|
+
/**
|
|
378
|
+
* 从单个 OpenAPI/AsyncAPI 文件提取节点和边
|
|
379
|
+
*
|
|
380
|
+
* @param filePath - 文件绝对路径
|
|
381
|
+
* @param projectRoot - 项目根目录(用于计算相对路径)
|
|
382
|
+
* @returns ExtractionResult(降级时返回 EMPTY_EXTRACTION_RESULT)
|
|
383
|
+
*/
|
|
384
|
+
export function extractOpenApi(filePath, projectRoot) {
|
|
385
|
+
if (!fs.existsSync(filePath)) {
|
|
386
|
+
logger.debug(`OpenAPI 文件不存在,跳过: ${filePath}`);
|
|
387
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
388
|
+
}
|
|
389
|
+
let content;
|
|
390
|
+
try {
|
|
391
|
+
content = fs.readFileSync(filePath, 'utf-8');
|
|
392
|
+
}
|
|
393
|
+
catch (err) {
|
|
394
|
+
logger.warn(`读取 OpenAPI 文件失败: ${filePath} — ${String(err)}`);
|
|
395
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
396
|
+
}
|
|
397
|
+
// 解析 JSON 或 YAML
|
|
398
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
399
|
+
let doc;
|
|
400
|
+
if (ext === '.json') {
|
|
401
|
+
try {
|
|
402
|
+
doc = JSON.parse(content);
|
|
403
|
+
}
|
|
404
|
+
catch (err) {
|
|
405
|
+
logger.warn(`JSON 解析失败,跳过: ${filePath} — ${String(err)}`);
|
|
406
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
else if (ext === '.yaml' || ext === '.yml') {
|
|
410
|
+
try {
|
|
411
|
+
doc = parseSimpleYaml(content);
|
|
412
|
+
}
|
|
413
|
+
catch (err) {
|
|
414
|
+
logger.warn(`YAML 解析失败,跳过: ${filePath} — ${String(err)}`);
|
|
415
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
logger.debug(`不支持的文件格式,跳过: ${filePath}`);
|
|
420
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
421
|
+
}
|
|
422
|
+
if (!isObj(doc)) {
|
|
423
|
+
logger.warn(`文件内容无效(非对象),跳过: ${filePath}`);
|
|
424
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
425
|
+
}
|
|
426
|
+
// 计算相对路径(用于节点 ID)
|
|
427
|
+
const relativeSourceFile = path.relative(projectRoot, filePath).replace(/\\/g, '/');
|
|
428
|
+
try {
|
|
429
|
+
// AsyncAPI 文档单独处理
|
|
430
|
+
if (isAsyncApiDoc(doc)) {
|
|
431
|
+
const { nodes, edges } = parseAsyncApiDoc(doc, relativeSourceFile);
|
|
432
|
+
if (nodes.length === 0 && edges.length === 0) {
|
|
433
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
434
|
+
}
|
|
435
|
+
return { nodes, edges };
|
|
436
|
+
}
|
|
437
|
+
// OpenAPI 文档处理
|
|
438
|
+
const { nodes, edges } = parseOpenApiDoc(doc, relativeSourceFile);
|
|
439
|
+
if (nodes.length === 0 && edges.length === 0) {
|
|
440
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
441
|
+
}
|
|
442
|
+
return { nodes, edges };
|
|
443
|
+
}
|
|
444
|
+
catch (err) {
|
|
445
|
+
logger.warn(`OpenAPI 解析失败,跳过: ${filePath} — ${String(err)}`);
|
|
446
|
+
return EMPTY_EXTRACTION_RESULT;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=openapi-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-extractor.js","sourceRoot":"","sources":["../../src/extraction/openapi-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,MAAM,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;AAElD,+DAA+D;AAC/D,cAAc;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akdown, SpecFrontmatter, TokenUsage } from '../models/module-spec.js';
|
|
2
|
+
/**
|
|
3
|
+
* 从 package.json 动态读取 Spectra 版本号,返回 "spectra vX.Y.Z" 格式字符串。
|
|
4
|
+
* 读取失败时返回 "spectra (unknown version)" 并打印警告,避免硬编码版本字符串。
|
|
5
|
+
* 结果在模块生命周期内缓存,多次调用不重复 I/O。
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSpectraVersionString(): string;
|
|
8
|
+
export interface FrontmatterInput {
|
|
9
|
+
/** 源目标路径 */
|
|
10
|
+
sourceTarget: string;
|
|
11
|
+
/** 人类可读的模块显示名(默认取目录名) */
|
|
12
|
+
displayName?: string;
|
|
13
|
+
/** 相关文件路径列表 */
|
|
14
|
+
relatedFiles: string[];
|
|
15
|
+
/** 置信度等级 */
|
|
16
|
+
confidence: 'high' | 'medium' | 'low';
|
|
17
|
+
/** baseline CodeSkeleton 的 SHA-256 哈希 */
|
|
18
|
+
skeletonHash: string;
|
|
19
|
+
/** 已有版本号(如 'v3'),用于自动递增 */
|
|
20
|
+
existingVersion?: string;
|
|
21
|
+
/** 模块主要编程语言(多语言项目时设置) */
|
|
22
|
+
language?: string;
|
|
23
|
+
/** 跨语言引用(如 ['go:services/auth', 'python:scripts/deploy']) */
|
|
24
|
+
crossLanguageRefs?: string[];
|
|
25
|
+
/** 本次生成消耗的 token 使用量(Feature 127) */
|
|
26
|
+
tokenUsage?: TokenUsage;
|
|
27
|
+
/** LLM + enrichment 总耗时(毫秒)(Feature 127) */
|
|
28
|
+
durationMs?: number;
|
|
29
|
+
/** 实际使用的 LLM 模型 ID(Feature 127) */
|
|
30
|
+
llmModel?: string;
|
|
31
|
+
/** 降级原因(Feature 127);未降级时为 null,未知时不传 */
|
|
32
|
+
fallbackReason?: string | null;
|
|
33
|
+
/** spec 身份类型(Feature 128,canonical / derived / bundle_copy) */
|
|
34
|
+
sourceKind?: 'canonical' | 'derived' | 'bundle_copy';
|
|
35
|
+
/** 派生来源 spec 的 outputPath(Feature 128);canonical 时为 null 或 undefined */
|
|
36
|
+
derivedFrom?: string | null;
|
|
37
|
+
/** 生成本 spec 时的批处理模式(Bug 142);单文件 generate 不传,batch 流程传入 effectiveMode */
|
|
38
|
+
generatedByMode?: 'full' | 'reading' | 'code-only';
|
|
39
|
+
/**
|
|
40
|
+
* Feature 140 FR-012 — context 来源 input token 细分。
|
|
41
|
+
* 由 single-spec-orchestrator 从 `AssembledContext.tokenBreakdown` + LLM response usage
|
|
42
|
+
* 组装传入;AST-only / 失败模式不传。
|
|
43
|
+
*/
|
|
44
|
+
costBreakdown?: CostBreakdown;
|
|
45
|
+
/**
|
|
46
|
+
* Feature 140 FR-012 — context 是否因 budget 被裁剪。
|
|
47
|
+
* 由 single-spec-orchestrator 从 `AssembledContext.truncated` 透传。
|
|
48
|
+
*/
|
|
49
|
+
contextTruncated?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 生成 YAML Frontmatter 数据
|
|
53
|
+
*
|
|
54
|
+
* @param data - Frontmatter 输入
|
|
55
|
+
* @returns SpecFrontmatter
|
|
56
|
+
*/
|
|
57
|
+
export declare function generateFrontmatter(data: FrontmatterInput): SpecFrontmatter;
|
|
58
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/generator/frontmatter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK3F;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAahD;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY;IACZ,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,qCAAqC;IACrC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,aAAa,CAAC;IACrD,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;IACnD;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAcD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,eAAe,CA2D3E"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML Frontmatter 生成器(含版本自增)
|
|
3
|
+
* 参见 contracts/generator.md
|
|
4
|
+
*/
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
6
|
+
/** 模块级缓存,避免每次生成 frontmatter 都重复读取 package.json */
|
|
7
|
+
let _versionCache;
|
|
8
|
+
/**
|
|
9
|
+
* 从 package.json 动态读取 Spectra 版本号,返回 "spectra vX.Y.Z" 格式字符串。
|
|
10
|
+
* 读取失败时返回 "spectra (unknown version)" 并打印警告,避免硬编码版本字符串。
|
|
11
|
+
* 结果在模块生命周期内缓存,多次调用不重复 I/O。
|
|
12
|
+
*/
|
|
13
|
+
export function getSpectraVersionString() {
|
|
14
|
+
if (_versionCache !== undefined) {
|
|
15
|
+
return _versionCache;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const _require = createRequire(import.meta.url);
|
|
19
|
+
const pkg = _require('../../package.json');
|
|
20
|
+
_versionCache = `spectra v${pkg.version}`;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
process.stderr.write('[warn] frontmatter: 读取 package.json 版本失败,降级为 unknown version\n');
|
|
24
|
+
_versionCache = 'spectra (unknown version)';
|
|
25
|
+
}
|
|
26
|
+
return _versionCache;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 版本号自增
|
|
30
|
+
* v1 → v2, v3 → v4
|
|
31
|
+
* 新规格无已有版本时返回 v1
|
|
32
|
+
*/
|
|
33
|
+
function incrementVersion(existing) {
|
|
34
|
+
if (!existing)
|
|
35
|
+
return 'v1';
|
|
36
|
+
const match = /^v(\d+)$/.exec(existing);
|
|
37
|
+
if (!match)
|
|
38
|
+
return 'v1';
|
|
39
|
+
return `v${parseInt(match[1], 10) + 1}`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 生成 YAML Frontmatter 数据
|
|
43
|
+
*
|
|
44
|
+
* @param data - Frontmatter 输入
|
|
45
|
+
* @returns SpecFrontmatter
|
|
46
|
+
*/
|
|
47
|
+
export function generateFrontmatter(data) {
|
|
48
|
+
const frontmatter = {
|
|
49
|
+
type: 'module-spec',
|
|
50
|
+
version: incrementVersion(data.existingVersion),
|
|
51
|
+
generatedBy: getSpectraVersionString(),
|
|
52
|
+
sourceTarget: data.sourceTarget,
|
|
53
|
+
relatedFiles: data.relatedFiles,
|
|
54
|
+
lastUpdated: new Date().toISOString(),
|
|
55
|
+
confidence: data.confidence,
|
|
56
|
+
skeletonHash: data.skeletonHash,
|
|
57
|
+
};
|
|
58
|
+
// displayName(人类可读标题)
|
|
59
|
+
if (data.displayName) {
|
|
60
|
+
frontmatter.displayName = data.displayName;
|
|
61
|
+
}
|
|
62
|
+
// 多语言项目扩展字段(仅设置时填充)
|
|
63
|
+
if (data.language) {
|
|
64
|
+
frontmatter.language = data.language;
|
|
65
|
+
}
|
|
66
|
+
if (data.crossLanguageRefs && data.crossLanguageRefs.length > 0) {
|
|
67
|
+
frontmatter.crossLanguageRefs = data.crossLanguageRefs;
|
|
68
|
+
}
|
|
69
|
+
// 成本元数据(Feature 127)— 4 个字段作为一组写入
|
|
70
|
+
// 只要 tokenUsage 传入就把全组写入,包括 output=0 / durationMs=0 / llmModel='' 等 AST-only 情形
|
|
71
|
+
if (data.tokenUsage) {
|
|
72
|
+
frontmatter.tokenUsage = data.tokenUsage;
|
|
73
|
+
frontmatter.durationMs = typeof data.durationMs === 'number' ? data.durationMs : 0;
|
|
74
|
+
frontmatter.llmModel = typeof data.llmModel === 'string' ? data.llmModel : '';
|
|
75
|
+
frontmatter.fallbackReason =
|
|
76
|
+
data.fallbackReason === undefined ? null : data.fallbackReason;
|
|
77
|
+
}
|
|
78
|
+
// spec 身份字段(Feature 128,bundle_copy / derived 时由调用方注入)
|
|
79
|
+
if (data.sourceKind !== undefined) {
|
|
80
|
+
frontmatter.sourceKind = data.sourceKind;
|
|
81
|
+
}
|
|
82
|
+
if (data.derivedFrom !== undefined) {
|
|
83
|
+
frontmatter.derivedFrom = data.derivedFrom;
|
|
84
|
+
}
|
|
85
|
+
// 批处理模式标记(Bug 142);仅 batch 流程传入,单文件 generate 不写入
|
|
86
|
+
if (data.generatedByMode !== undefined) {
|
|
87
|
+
frontmatter.generatedByMode = data.generatedByMode;
|
|
88
|
+
}
|
|
89
|
+
// Feature 140 FR-012:context 来源 input token 细分 + 是否被 budget 裁剪
|
|
90
|
+
// 仅 single-spec-orchestrator 主流程传入;AST-only 模式 / 早期失败路径不写入此字段
|
|
91
|
+
// (下游聚合 Top N 时遇缺失字段视为未观测,跳过)。
|
|
92
|
+
if (data.costBreakdown !== undefined) {
|
|
93
|
+
frontmatter.costBreakdown = data.costBreakdown;
|
|
94
|
+
}
|
|
95
|
+
if (data.contextTruncated !== undefined) {
|
|
96
|
+
frontmatter.contextTruncated = data.contextTruncated;
|
|
97
|
+
}
|
|
98
|
+
return frontmatter;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/generator/frontmatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,kDAAkD;AAClD,IAAI,aAAiC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB;IACrC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,oBAAoB,CAAwB,CAAC;QAClE,aAAa,GAAG,YAAY,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;QACvF,aAAa,GAAG,2BAA2B,CAAC;IAC9C,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AA8CD;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,QAAiB;IACzC,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,IAAI,QAAQ,CAAC,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C,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,WAAW,CAAC,cAAc;YACxB,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IACnE,CAAC;IAED,uDAAuD;IACvD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAClC,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IAC3C,CAAC;IACD,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACnC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IAC7C,CAAC;IAED,iDAAiD;IACjD,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACvC,WAAW,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;IACrD,CAAC;IAED,+DAA+D;IAC/D,8DAA8D;IAC9D,+BAA+B;IAC/B,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACrC,WAAW,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;IACjD,CAAC;IACD,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACxC,WAAW,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;IACvD,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 架构索引生成器
|
|
3
|
+
* 生成 specs/_index.spec.md(FR-013)
|
|
4
|
+
* 支持多语言项目的语言分布展示(Feature 031)
|
|
5
|
+
* 参见 contracts/generator.md
|
|
6
|
+
*/
|
|
7
|
+
import type { ArchitectureIndex } from '../models/module-spec.js';
|
|
8
|
+
import type { SpecFrontmatter, SpecSections } from '../models/module-spec.js';
|
|
9
|
+
import type { DependencyGraph } from '../models/dependency-graph.js';
|
|
10
|
+
import type { LanguageFileStat } from '../utils/file-scanner.js';
|
|
11
|
+
export interface IndexableModuleSpec {
|
|
12
|
+
frontmatter: SpecFrontmatter;
|
|
13
|
+
outputPath: string;
|
|
14
|
+
sections?: Pick<SpecSections, 'intent'>;
|
|
15
|
+
intentSummary?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 生成项目级架构索引
|
|
19
|
+
*
|
|
20
|
+
* @param specs - 所有已生成的 ModuleSpec
|
|
21
|
+
* @param graph - 项目 DependencyGraph(或合并后的图)
|
|
22
|
+
* @param languageStats - 完整扫描的语言统计(可选)
|
|
23
|
+
* @param processedLanguages - 本次实际处理的语言列表(可选)
|
|
24
|
+
* @returns ArchitectureIndex
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateIndex(specs: IndexableModuleSpec[], graph: DependencyGraph, languageStats?: Map<string, LanguageFileStat>, processedLanguages?: string[]): ArchitectureIndex;
|
|
27
|
+
//# sourceMappingURL=index-generator.d.ts.map
|