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,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature 127 — Dry-run 预估 + Budget 守护 gate
|
|
3
|
+
*
|
|
4
|
+
* 职责:
|
|
5
|
+
* - estimateModuleCost(files, projectRoot):基于 AST-free 的快速估算,输出单模块 input/output token
|
|
6
|
+
* - buildDryRunReport(estimates):生成 Markdown 预估报告
|
|
7
|
+
* - buildBudgetDecision(estimates, budget, handler):根据超预算状态调用 handler 选择下一步动作
|
|
8
|
+
*
|
|
9
|
+
* 估算模型(首版):
|
|
10
|
+
* - input ≈ estimateFast(所有源码拼接)
|
|
11
|
+
* - output ≈ Math.round(input × 0.3)
|
|
12
|
+
* - 假设写入报告正文供用户审视
|
|
13
|
+
*/
|
|
14
|
+
import * as fs from 'node:fs';
|
|
15
|
+
import * as path from 'node:path';
|
|
16
|
+
import { estimateFast } from '../core/token-counter.js';
|
|
17
|
+
// ============================================================
|
|
18
|
+
// 估算
|
|
19
|
+
// ============================================================
|
|
20
|
+
/** output ≈ 0.3 × input */
|
|
21
|
+
const OUTPUT_RATIO = 0.3;
|
|
22
|
+
/**
|
|
23
|
+
* 单模块 system prompt + 上下文骨架的固定开销估算(Bug 修复 — Phase 2 集成测试发现)
|
|
24
|
+
*
|
|
25
|
+
* 经验值来源:micrograd(4 个 Python 文件)实测 system prompt + AST skeleton +
|
|
26
|
+
* panoramic context 约 6,000-8,000 input tokens / 模块。取保守值 6,500,让 dry-run
|
|
27
|
+
* 估算从之前 ~64x 偏差缩到 < 1.5x。
|
|
28
|
+
*
|
|
29
|
+
* 这是固定开销不随源码大小线性增长,所以加常数项而非 ratio。
|
|
30
|
+
*/
|
|
31
|
+
const SYSTEM_PROMPT_TOKENS_PER_MODULE = 6500;
|
|
32
|
+
/** 估算假设的人类可读说明(写入报告) */
|
|
33
|
+
export const ESTIMATION_ASSUMPTION = 'input ≈ estimateFast(源文件拼接文本) + 6500(system prompt + AST skeleton 固定开销 / 模块),output ≈ 0.3 × input。基于历史平均比率,首版不校准。';
|
|
34
|
+
/**
|
|
35
|
+
* 估算单个模块的 token 成本
|
|
36
|
+
*
|
|
37
|
+
* @param moduleName - 模块标识
|
|
38
|
+
* @param files - 模块包含的相对路径
|
|
39
|
+
* @param projectRoot - 项目根目录
|
|
40
|
+
*/
|
|
41
|
+
export function estimateModuleCost(moduleName, files, projectRoot) {
|
|
42
|
+
let sourceInput = 0;
|
|
43
|
+
let loc = 0;
|
|
44
|
+
for (const rel of files) {
|
|
45
|
+
const abs = path.isAbsolute(rel) ? rel : path.join(projectRoot, rel);
|
|
46
|
+
try {
|
|
47
|
+
const content = fs.readFileSync(abs, 'utf-8');
|
|
48
|
+
sourceInput += estimateFast(content);
|
|
49
|
+
loc += content.split('\n').length;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// 读取失败跳过
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// 真实 input = 源码 token + system prompt / AST skeleton / panoramic context 固定开销
|
|
56
|
+
const input = sourceInput + SYSTEM_PROMPT_TOKENS_PER_MODULE;
|
|
57
|
+
const estimatedOutput = Math.round(input * OUTPUT_RATIO);
|
|
58
|
+
return {
|
|
59
|
+
moduleName,
|
|
60
|
+
files: [...files],
|
|
61
|
+
loc,
|
|
62
|
+
estimatedInput: input,
|
|
63
|
+
estimatedOutput,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** 聚合所有模块估算 */
|
|
67
|
+
export function buildDryRunReport(estimates) {
|
|
68
|
+
const totalInput = estimates.reduce((s, e) => s + e.estimatedInput, 0);
|
|
69
|
+
const totalOutput = estimates.reduce((s, e) => s + e.estimatedOutput, 0);
|
|
70
|
+
return {
|
|
71
|
+
generatedAt: new Date().toISOString(),
|
|
72
|
+
totalModules: estimates.length,
|
|
73
|
+
totalEstimatedInput: totalInput,
|
|
74
|
+
totalEstimatedOutput: totalOutput,
|
|
75
|
+
assumption: ESTIMATION_ASSUMPTION,
|
|
76
|
+
modules: estimates.slice().sort((a, b) => b.estimatedInput - a.estimatedInput),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 渲染 dry-run 报告为 Markdown,写入 `_meta/dry-run-estimate.md`
|
|
81
|
+
*/
|
|
82
|
+
export function renderDryRunReport(report) {
|
|
83
|
+
const lines = [];
|
|
84
|
+
lines.push('# Dry-run Estimate');
|
|
85
|
+
lines.push('');
|
|
86
|
+
lines.push(`> 自动生成于 ${report.generatedAt}`);
|
|
87
|
+
lines.push('');
|
|
88
|
+
lines.push(`**本次估算未调用 LLM,未生成任何 \`.spec.md\` 文件。**`);
|
|
89
|
+
lines.push('');
|
|
90
|
+
lines.push('## 总估算');
|
|
91
|
+
lines.push('');
|
|
92
|
+
lines.push('| 指标 | 数值 |');
|
|
93
|
+
lines.push('|------|------|');
|
|
94
|
+
lines.push(`| 模块数 | ${report.totalModules} |`);
|
|
95
|
+
lines.push(`| 预估 input tokens | ${report.totalEstimatedInput.toLocaleString()} |`);
|
|
96
|
+
lines.push(`| 预估 output tokens | ${report.totalEstimatedOutput.toLocaleString()} |`);
|
|
97
|
+
lines.push(`| 预估总 tokens | ${(report.totalEstimatedInput + report.totalEstimatedOutput).toLocaleString()} |`);
|
|
98
|
+
lines.push('');
|
|
99
|
+
lines.push(`_估算假设:${report.assumption}_`);
|
|
100
|
+
lines.push('');
|
|
101
|
+
lines.push('## 按模块明细');
|
|
102
|
+
lines.push('');
|
|
103
|
+
lines.push('| 模块 | 文件数 | LOC | 预估 input | 预估 output |');
|
|
104
|
+
lines.push('|------|--------|-----|-----------|------------|');
|
|
105
|
+
for (const m of report.modules) {
|
|
106
|
+
lines.push(`| ${m.moduleName} | ${m.files.length} | ${m.loc} | ${m.estimatedInput.toLocaleString()} | ${m.estimatedOutput.toLocaleString()} |`);
|
|
107
|
+
}
|
|
108
|
+
lines.push('');
|
|
109
|
+
return lines.join('\n');
|
|
110
|
+
}
|
|
111
|
+
// ============================================================
|
|
112
|
+
// 预算决策
|
|
113
|
+
// ============================================================
|
|
114
|
+
/**
|
|
115
|
+
* 判断是否超预算,并选择后续动作(FR-013 / FR-014 / Edge Case 8)
|
|
116
|
+
*/
|
|
117
|
+
export async function buildBudgetDecision(input) {
|
|
118
|
+
const { totalEstimate, budget, preset, isTTY, attempt = 0 } = input;
|
|
119
|
+
if (totalEstimate <= budget) {
|
|
120
|
+
return {
|
|
121
|
+
policy: 'continue',
|
|
122
|
+
interactive: false,
|
|
123
|
+
message: `预估 ${totalEstimate.toLocaleString()} tokens ≤ 预算 ${budget.toLocaleString()},继续执行`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const overMessage = `预估 ${totalEstimate.toLocaleString()} tokens > 预算 ${budget.toLocaleString()}`;
|
|
127
|
+
// 显式 preset 优先
|
|
128
|
+
if (preset) {
|
|
129
|
+
return {
|
|
130
|
+
policy: preset,
|
|
131
|
+
interactive: false,
|
|
132
|
+
message: `${overMessage};非交互策略: ${preset}`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// Edge Case 8:已重估 1 次后仍超预算,强制 cancel
|
|
136
|
+
if (attempt >= 1) {
|
|
137
|
+
return {
|
|
138
|
+
policy: 'cancel',
|
|
139
|
+
interactive: false,
|
|
140
|
+
message: `${overMessage};已重估 ${attempt} 次仍超预算,默认 cancel 以防循环`,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// 非 TTY 未给 preset:视为 cancel
|
|
144
|
+
if (!isTTY) {
|
|
145
|
+
return {
|
|
146
|
+
policy: 'cancel',
|
|
147
|
+
interactive: false,
|
|
148
|
+
message: `${overMessage};非交互环境未传 --on-over-budget,默认 cancel`,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
// TTY 交互
|
|
152
|
+
const prompt = input.promptPolicy ?? defaultInteractivePrompt;
|
|
153
|
+
const policy = await prompt();
|
|
154
|
+
return {
|
|
155
|
+
policy,
|
|
156
|
+
interactive: true,
|
|
157
|
+
message: `${overMessage};用户交互选择: ${policy}`,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 根据降级 policy 调整估算值(Feature 127 Codex review 修复)
|
|
162
|
+
*
|
|
163
|
+
* - skip-enrichment:enrichment 是 Section 2 的二次 LLM 调用,平均约占
|
|
164
|
+
* 整体 token 消耗的 30%;跳过后估算减为 70%
|
|
165
|
+
* - cheaper-model:tokens 数不变(budget 以 token 为单位),返回原值
|
|
166
|
+
* - continue / cancel:返回原值
|
|
167
|
+
*/
|
|
168
|
+
export function applyPolicyToEstimate(baseEstimate, policy) {
|
|
169
|
+
switch (policy) {
|
|
170
|
+
case 'skip-enrichment':
|
|
171
|
+
return Math.round(baseEstimate * 0.7);
|
|
172
|
+
case 'cheaper-model':
|
|
173
|
+
case 'continue':
|
|
174
|
+
case 'cancel':
|
|
175
|
+
default:
|
|
176
|
+
return baseEstimate;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 驱动完整的预算 gate 循环(Feature 127 Codex review 修复 — Finding 1)
|
|
181
|
+
*
|
|
182
|
+
* 与 buildBudgetDecision 的差别:
|
|
183
|
+
* - buildBudgetDecision 只做一次性决策(policy 选择)
|
|
184
|
+
* - runBudgetGate 负责把"降级 policy → 重估 → 二次 gate"的闭环跑完
|
|
185
|
+
*
|
|
186
|
+
* 语义:
|
|
187
|
+
* 1. attempt 0:用 baseEstimate 做首次 gate
|
|
188
|
+
* 2. policy 是 continue / cancel:立即返回
|
|
189
|
+
* 3. policy 是 cheaper-model / skip-enrichment:应用 policy → 重估 → attempt++ 再进
|
|
190
|
+
* 4. attempt ≥ 1(Edge Case 8):即便还是超预算,也强制 cancel 避免循环
|
|
191
|
+
*
|
|
192
|
+
* 任一成功降级后得到 ≤ 预算的估算 → 返回 continue + 记录所采纳的降级
|
|
193
|
+
*/
|
|
194
|
+
export async function runBudgetGate(args) {
|
|
195
|
+
const attempts = [];
|
|
196
|
+
let estimate = args.baseEstimate;
|
|
197
|
+
let skipEnrichmentApplied = false;
|
|
198
|
+
let cheaperModelApplied = false;
|
|
199
|
+
for (let attempt = 0; attempt <= 1; attempt++) {
|
|
200
|
+
const decision = await buildBudgetDecision({
|
|
201
|
+
totalEstimate: estimate,
|
|
202
|
+
budget: args.budget,
|
|
203
|
+
preset: args.preset,
|
|
204
|
+
isTTY: args.isTTY,
|
|
205
|
+
promptPolicy: args.promptPolicy,
|
|
206
|
+
attempt,
|
|
207
|
+
});
|
|
208
|
+
attempts.push({
|
|
209
|
+
attempt,
|
|
210
|
+
estimate,
|
|
211
|
+
policy: decision.policy,
|
|
212
|
+
message: decision.message,
|
|
213
|
+
});
|
|
214
|
+
// 终态 policy:直接返回
|
|
215
|
+
if (decision.policy === 'continue' || decision.policy === 'cancel') {
|
|
216
|
+
return {
|
|
217
|
+
finalPolicy: decision.policy,
|
|
218
|
+
finalEstimate: estimate,
|
|
219
|
+
skipEnrichmentApplied,
|
|
220
|
+
cheaperModelApplied,
|
|
221
|
+
attempts,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
// 降级 policy:应用调整后进入下一轮 gate
|
|
225
|
+
if (decision.policy === 'skip-enrichment') {
|
|
226
|
+
skipEnrichmentApplied = true;
|
|
227
|
+
}
|
|
228
|
+
else if (decision.policy === 'cheaper-model') {
|
|
229
|
+
cheaperModelApplied = true;
|
|
230
|
+
}
|
|
231
|
+
estimate = applyPolicyToEstimate(estimate, decision.policy);
|
|
232
|
+
}
|
|
233
|
+
// Edge Case 8:两轮仍超预算(例如 cheaper-model 不减 tokens),强制 cancel
|
|
234
|
+
attempts.push({
|
|
235
|
+
attempt: 2,
|
|
236
|
+
estimate,
|
|
237
|
+
policy: 'cancel',
|
|
238
|
+
message: `两轮降级后估算 ${estimate.toLocaleString()} tokens 仍 > 预算 ${args.budget.toLocaleString()},强制 cancel`,
|
|
239
|
+
});
|
|
240
|
+
return {
|
|
241
|
+
finalPolicy: 'cancel',
|
|
242
|
+
finalEstimate: estimate,
|
|
243
|
+
skipEnrichmentApplied,
|
|
244
|
+
cheaperModelApplied,
|
|
245
|
+
attempts,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
async function defaultInteractivePrompt() {
|
|
249
|
+
// 动态引入,避免 test 环境的 readline 副作用
|
|
250
|
+
const readline = await import('node:readline/promises');
|
|
251
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
252
|
+
try {
|
|
253
|
+
process.stdout.write('\n超预算。请选择后续动作:\n' +
|
|
254
|
+
' 1) continue — 继续执行(放弃预算)\n' +
|
|
255
|
+
' 2) cheaper-model — 降级到更便宜的 model 重估\n' +
|
|
256
|
+
' 3) skip-enrichment — 跳过 Section 2 二次增强重估\n' +
|
|
257
|
+
' 4) cancel — 立即取消\n');
|
|
258
|
+
const answer = (await rl.question('选择 [1-4]: ')).trim();
|
|
259
|
+
switch (answer) {
|
|
260
|
+
case '1':
|
|
261
|
+
case 'continue':
|
|
262
|
+
return 'continue';
|
|
263
|
+
case '2':
|
|
264
|
+
case 'cheaper-model':
|
|
265
|
+
return 'cheaper-model';
|
|
266
|
+
case '3':
|
|
267
|
+
case 'skip-enrichment':
|
|
268
|
+
return 'skip-enrichment';
|
|
269
|
+
case '4':
|
|
270
|
+
case 'cancel':
|
|
271
|
+
default:
|
|
272
|
+
return 'cancel';
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
finally {
|
|
276
|
+
rl.close();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=budget-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget-gate.js","sourceRoot":"","sources":["../../src/batch/budget-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAoExD,+DAA+D;AAC/D,KAAK;AACL,+DAA+D;AAE/D,2BAA2B;AAC3B,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB;;;;;;;;GAQG;AACH,MAAM,+BAA+B,GAAG,IAAI,CAAC;AAE7C,wBAAwB;AACxB,MAAM,CAAC,MAAM,qBAAqB,GAChC,mHAAmH,CAAC;AAEtH;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,KAAe,EACf,WAAmB;IAEnB,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACrE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC9C,WAAW,IA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,CAAC;AAED,KAAK,UAAU,wBAAwB;IACrC,gCAAgC;IAChC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IACxD,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,kBAAkB;YAChB,wCAAwC;YACxC,8CAA8C;YAC9C,iDAAiD;YACjD,kCAAkC,CACrC,CAAC;QACF,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACxD,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,GAAG,CAAC;YACT,KAAK,UAAU;gBACb,OAAO,UAAU,CAAC;YACpB,KAAK,GAAG,CAAC;YACT,KAAK,eAAe;gBAClB,OAAO,eAAe,CAAC;YACzB,KAAK,GAAG,CAAC;YACT,KAAK,iBAAiB;gBACpB,OAAO,iBAAiB,CAAC;YAC3B,KAAK,GAAG,CAAC;YACT,KAAK,QAAQ,CAAC;YACd;gBACE,OAAO,QAAQ,CAAC;QACpB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type BatchState } from '../models/module-spec.js';
|
|
2
|
+
/** 默认检查点路径(Constitution IV:位于 specs/ 内) */
|
|
3
|
+
export declare const DEFAULT_CHECKPOINT_PATH = "specs/.spectra-checkpoint.json";
|
|
4
|
+
/**
|
|
5
|
+
* 加载已有检查点以恢复执行
|
|
6
|
+
*
|
|
7
|
+
* @param checkpointPath - 检查点文件路径
|
|
8
|
+
* @returns BatchState 或 null(未找到)
|
|
9
|
+
*/
|
|
10
|
+
export declare function loadCheckpoint(checkpointPath: string): BatchState | null;
|
|
11
|
+
/**
|
|
12
|
+
* 原子写入检查点状态
|
|
13
|
+
* 先写临时文件再重命名,防止写入中断导致数据损坏
|
|
14
|
+
*
|
|
15
|
+
* @param state - 当前批处理状态
|
|
16
|
+
* @param checkpointPath - 检查点文件路径
|
|
17
|
+
*/
|
|
18
|
+
export declare function saveCheckpoint(state: BatchState, checkpointPath: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* 批处理成功完成后删除检查点
|
|
21
|
+
*
|
|
22
|
+
* @param checkpointPath - 检查点文件路径
|
|
23
|
+
*/
|
|
24
|
+
export declare function clearCheckpoint(checkpointPath: string): void;
|
|
25
|
+
//# sourceMappingURL=checkpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/batch/checkpoint.ts"],"names":[],"mappings":"AAOA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE7E,2CAA2C;AAC3C,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAiBxE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,MAAM,GACrB,IAAI,CAaN;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAY5D"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 断点恢复检查点持久化(FR-017)
|
|
3
|
+
* 原子写入(临时文件+重命名)防止数据损坏
|
|
4
|
+
* 参见 contracts/batch-module.md
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from 'node:fs';
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { BatchStateSchema } from '../models/module-spec.js';
|
|
9
|
+
/** 默认检查点路径(Constitution IV:位于 specs/ 内) */
|
|
10
|
+
export const DEFAULT_CHECKPOINT_PATH = 'specs/.spectra-checkpoint.json';
|
|
11
|
+
/**
|
|
12
|
+
* 加载已有检查点以恢复执行
|
|
13
|
+
*
|
|
14
|
+
* @param checkpointPath - 检查点文件路径
|
|
15
|
+
* @returns BatchState 或 null(未找到)
|
|
16
|
+
*/
|
|
17
|
+
export function loadCheckpoint(checkpointPath) {
|
|
18
|
+
const resolvedPath = path.resolve(checkpointPath);
|
|
19
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const content = fs.readFileSync(resolvedPath, 'utf-8');
|
|
24
|
+
const data = JSON.parse(content);
|
|
25
|
+
// 使用 Zod 验证
|
|
26
|
+
return BatchStateSchema.parse(data);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// 损坏的检查点文件,返回 null
|
|
30
|
+
console.warn(`检查点文件损坏或无效: ${checkpointPath},将重新开始`);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 原子写入检查点状态
|
|
36
|
+
* 先写临时文件再重命名,防止写入中断导致数据损坏
|
|
37
|
+
*
|
|
38
|
+
* @param state - 当前批处理状态
|
|
39
|
+
* @param checkpointPath - 检查点文件路径
|
|
40
|
+
*/
|
|
41
|
+
export function saveCheckpoint(state, checkpointPath) {
|
|
42
|
+
const resolvedPath = path.resolve(checkpointPath);
|
|
43
|
+
const dir = path.dirname(resolvedPath);
|
|
44
|
+
// 确保目录存在
|
|
45
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
46
|
+
// 原子写入:先写临时文件
|
|
47
|
+
const tmpPath = `${resolvedPath}.tmp`;
|
|
48
|
+
const content = JSON.stringify(state, null, 2);
|
|
49
|
+
fs.writeFileSync(tmpPath, content, 'utf-8');
|
|
50
|
+
fs.renameSync(tmpPath, resolvedPath);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 批处理成功完成后删除检查点
|
|
54
|
+
*
|
|
55
|
+
* @param checkpointPath - 检查点文件路径
|
|
56
|
+
*/
|
|
57
|
+
export function clearCheckpoint(checkpointPath) {
|
|
58
|
+
const resolvedPath = path.resolve(checkpointPath);
|
|
59
|
+
if (fs.existsSync(resolvedPath)) {
|
|
60
|
+
fs.unlinkSync(resolvedPath);
|
|
61
|
+
}
|
|
62
|
+
// 清理临时文件
|
|
63
|
+
const tmpPath = `${resolvedPath}.tmp`;
|
|
64
|
+
if (fs.existsSync(tmpPath)) {
|
|
65
|
+
fs.unlinkSync(tmpPath);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=checkpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../../src/batch/checkpoint.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,cAAsB;IACnD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAElD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,YAAY;QACZ,OAAO,gBAAgB,CAAC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
|
|
1
|
+
/**
|
|
2
|
+
* Feature 127 — Batch 成本汇总
|
|
3
|
+
*
|
|
4
|
+
* 提供:
|
|
5
|
+
* - CostSummary 类型定义
|
|
6
|
+
* - aggregateCostSummary() 聚合每模块 CostMetadata 为批级汇总
|
|
7
|
+
* - renderSummaryCostSection() / renderQualityCostSection() 渲染 Markdown
|
|
8
|
+
*
|
|
9
|
+
* 职责边界:
|
|
10
|
+
* - 只负责聚合与渲染;不触碰 LLM 调用、不落盘
|
|
11
|
+
* - 渲染出的 Markdown 由调用方追加到 batch-summary.md / quality-report.md
|
|
12
|
+
*/
|
|
13
|
+
import type { CostMetadata } from '../models/module-spec.js';
|
|
14
|
+
/** 单个模块的成本记录 */
|
|
15
|
+
export interface ModuleCostRecord {
|
|
16
|
+
moduleName: string;
|
|
17
|
+
/** 总代码行数(用于 tokens/kLOC 指标;未知时传 0) */
|
|
18
|
+
loc: number;
|
|
19
|
+
cost: CostMetadata;
|
|
20
|
+
}
|
|
21
|
+
/** 预估成本(dry-run / budget 场景) */
|
|
22
|
+
export interface EstimatedCost {
|
|
23
|
+
/** 所有模块预估 input token 总和 */
|
|
24
|
+
totalInput: number;
|
|
25
|
+
/** 所有模块预估 output token 总和 */
|
|
26
|
+
totalOutput: number;
|
|
27
|
+
/** 用户可读的假设说明(例如 "output ≈ 0.3 × input") */
|
|
28
|
+
assumption: string;
|
|
29
|
+
}
|
|
30
|
+
/** 批处理成本汇总 */
|
|
31
|
+
export interface CostSummary {
|
|
32
|
+
totalInputTokens: number;
|
|
33
|
+
totalOutputTokens: number;
|
|
34
|
+
totalDurationMs: number;
|
|
35
|
+
/** 按模块的明细,降序排列 */
|
|
36
|
+
byModule: Array<{
|
|
37
|
+
moduleName: string;
|
|
38
|
+
input: number;
|
|
39
|
+
output: number;
|
|
40
|
+
durationMs: number;
|
|
41
|
+
llmModel: string;
|
|
42
|
+
fallbackReason: string | null;
|
|
43
|
+
loc: number;
|
|
44
|
+
}>;
|
|
45
|
+
/** 按生成器(实际 llmModel)的聚合 */
|
|
46
|
+
byGenerator: Array<{
|
|
47
|
+
generator: string;
|
|
48
|
+
input: number;
|
|
49
|
+
output: number;
|
|
50
|
+
/** 该生成器 token 总量占总量的百分比(0-100,保留一位小数) */
|
|
51
|
+
share: number;
|
|
52
|
+
moduleCount: number;
|
|
53
|
+
}>;
|
|
54
|
+
/** 总代码行数(用于 tokens/kLOC) */
|
|
55
|
+
totalLoc: number;
|
|
56
|
+
/** 预估(若传入) */
|
|
57
|
+
estimated?: EstimatedCost;
|
|
58
|
+
/** 实际 vs 预估偏差百分比(仅 estimated 存在时计算;> 20 时告警) */
|
|
59
|
+
actualVsEstimatedDelta?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 聚合每模块 CostMetadata 为 CostSummary
|
|
63
|
+
*
|
|
64
|
+
* @param records - 模块级成本记录;允许为空(返回全零 summary)
|
|
65
|
+
* @param estimated - 预估值(可选,来自 dry-run / budget 预检)
|
|
66
|
+
*/
|
|
67
|
+
export declare function aggregateCostSummary(records: ModuleCostRecord[], estimated?: EstimatedCost): CostSummary;
|
|
68
|
+
/**
|
|
69
|
+
* 渲染给 batch-summary.md 的 "LLM 成本汇总" 节
|
|
70
|
+
* FR-008
|
|
71
|
+
*/
|
|
72
|
+
export declare function renderSummaryCostSection(summary: CostSummary): string;
|
|
73
|
+
/**
|
|
74
|
+
* 渲染给 quality-report.md 的 "LLM 成本与预算" 节
|
|
75
|
+
* FR-009
|
|
76
|
+
*/
|
|
77
|
+
export declare function renderQualityCostSection(summary: CostSummary): string;
|
|
78
|
+
//# sourceMappingURL=cost-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-summary.d.ts","sourceRoot":"","sources":["../../src/batch/cost-summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAM7D,gBAAgB;AAChB,MAA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;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA2ErE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA6CrE"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// 聚合
|
|
3
|
+
// ============================================================
|
|
4
|
+
/**
|
|
5
|
+
* 聚合每模块 CostMetadata 为 CostSummary
|
|
6
|
+
*
|
|
7
|
+
* @param records - 模块级成本记录;允许为空(返回全零 summary)
|
|
8
|
+
* @param estimated - 预估值(可选,来自 dry-run / budget 预检)
|
|
9
|
+
*/
|
|
10
|
+
export function aggregateCostSummary(records, estimated) {
|
|
11
|
+
let totalInput = 0;
|
|
12
|
+
let totalOutput = 0;
|
|
13
|
+
let totalDuration = 0;
|
|
14
|
+
let totalLoc = 0;
|
|
15
|
+
for (const rec of records) {
|
|
16
|
+
totalInput += rec.cost.tokenUsage.input;
|
|
17
|
+
totalOutput += rec.cost.tokenUsage.output;
|
|
18
|
+
totalDuration += rec.cost.durationMs;
|
|
19
|
+
totalLoc += rec.loc;
|
|
20
|
+
}
|
|
21
|
+
// 按模块明细:按 input+output 降序
|
|
22
|
+
const byModule = records
|
|
23
|
+
.map((rec) => ({
|
|
24
|
+
moduleName: rec.moduleName,
|
|
25
|
+
input: rec.cost.tokenUsage.input,
|
|
26
|
+
output: rec.cost.tokenUsage.output,
|
|
27
|
+
durationMs: rec.cost.durationMs,
|
|
28
|
+
llmModel: rec.cost.llmModel,
|
|
29
|
+
fallbackReason: rec.cost.fallbackReason,
|
|
30
|
+
loc: rec.loc,
|
|
31
|
+
}))
|
|
32
|
+
.sort((a, b) => b.input + b.output - (a.input + a.output));
|
|
33
|
+
// 按生成器分组:llmModel 为空字符串时归入 'ast-only'
|
|
34
|
+
const generatorMap = new Map();
|
|
35
|
+
for (const rec of records) {
|
|
36
|
+
const key = rec.cost.llmModel || 'ast-only';
|
|
37
|
+
const existing = generatorMap.get(key) ?? { input: 0, output: 0, moduleCount: 0 };
|
|
38
|
+
existing.input += rec.cost.tokenUsage.input;
|
|
39
|
+
existing.output += rec.cost.tokenUsage.output;
|
|
40
|
+
existing.moduleCount += 1;
|
|
41
|
+
generatorMap.set(key, existing);
|
|
42
|
+
}
|
|
43
|
+
const totalTokens = totalInput + totalOutput;
|
|
44
|
+
const byGenerator = [...generatorMap.entries()]
|
|
45
|
+
.map(([generator, v]) => ({
|
|
46
|
+
generator,
|
|
47
|
+
input: v.input,
|
|
48
|
+
output: v.output,
|
|
49
|
+
share: totalTokens > 0
|
|
50
|
+
? Math.round(((v.input + v.output) / totalTokens) * 1000) / 10
|
|
51
|
+
: 0,
|
|
52
|
+
moduleCount: v.moduleCount,
|
|
53
|
+
}))
|
|
54
|
+
.sort((a, b) => b.input + b.output - (a.input + a.output));
|
|
55
|
+
const summary = {
|
|
56
|
+
totalInputTokens: totalInput,
|
|
57
|
+
totalOutputTokens: totalOutput,
|
|
58
|
+
totalDurationMs: totalDuration,
|
|
59
|
+
byModule,
|
|
60
|
+
byGenerator,
|
|
61
|
+
totalLoc,
|
|
62
|
+
};
|
|
63
|
+
// 预估对比
|
|
64
|
+
if (estimated) {
|
|
65
|
+
summary.estimated = estimated;
|
|
66
|
+
const estimatedTotal = estimated.totalInput + estimated.totalOutput;
|
|
67
|
+
if (estimatedTotal > 0) {
|
|
68
|
+
const actualTotal = totalTokens;
|
|
69
|
+
summary.actualVsEstimatedDelta =
|
|
70
|
+
Math.round(((actualTotal - estimatedTotal) / estimatedTotal) * 1000) / 10;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return summary;
|
|
74
|
+
}
|
|
75
|
+
// ============================================================
|
|
76
|
+
// 渲染
|
|
77
|
+
// ============================================================
|
|
78
|
+
/**
|
|
79
|
+
* 渲染给 batch-summary.md 的 "LLM 成本汇总" 节
|
|
80
|
+
* FR-008
|
|
81
|
+
*/
|
|
82
|
+
export function renderSummaryCostSection(summary) {
|
|
83
|
+
const lines = [];
|
|
84
|
+
lines.push('## LLM 成本汇总');
|
|
85
|
+
lines.push('');
|
|
86
|
+
const totalTokens = summary.totalInputTokens + summary.totalOutputTokens;
|
|
87
|
+
if (totalTokens === 0) {
|
|
88
|
+
lines.push('本次 batch 未调用 LLM(可能为 AST-only 或 dry-run 模式)。');
|
|
89
|
+
lines.push('');
|
|
90
|
+
return lines.join('\n');
|
|
91
|
+
}
|
|
92
|
+
lines.push('| 指标 | 数值 |');
|
|
93
|
+
lines.push('|------|------|');
|
|
94
|
+
lines.push(`| 总 input tokens | ${summary.totalInputTokens.toLocaleString()} |`);
|
|
95
|
+
lines.push(`| 总 output tokens | ${summary.totalOutputTokens.toLocaleString()} |`);
|
|
96
|
+
lines.push(`| 总 token 数 | ${totalTokens.toLocaleString()} |`);
|
|
97
|
+
lines.push(`| LLM 总耗时 | ${(summary.totalDurationMs / 1000).toFixed(1)}s |`);
|
|
98
|
+
if (summary.totalLoc > 0) {
|
|
99
|
+
const tokensPerKLoc = Math.round((totalTokens / summary.totalLoc) * 1000);
|
|
100
|
+
lines.push(`| tokens / kLOC | ${tokensPerKLoc.toLocaleString()} |`);
|
|
101
|
+
}
|
|
102
|
+
lines.push('');
|
|
103
|
+
// 按生成器
|
|
104
|
+
lines.push('### 按生成器分组');
|
|
105
|
+
lines.push('');
|
|
106
|
+
lines.push('| 生成器 / Model | 模块数 | input | output | 占比 |');
|
|
107
|
+
lines.push('|----------------|--------|-------|--------|------|');
|
|
108
|
+
for (const g of summary.byGenerator) {
|
|
109
|
+
lines.push(`| \`${g.generator}\` | ${g.moduleCount} | ${g.input.toLocaleString()} | ${g.output.toLocaleString()} | ${g.share.toFixed(1)}% |`);
|
|
110
|
+
}
|
|
111
|
+
lines.push('');
|
|
112
|
+
// 按模块(从高到低,最多 20 条,避免报告过长)
|
|
113
|
+
lines.push('### 按模块分组(Top 20,从高到低)');
|
|
114
|
+
lines.push('');
|
|
115
|
+
lines.push('| 模块 | Model | input | output | 耗时 | 降级 |');
|
|
116
|
+
lines.push('|------|-------|-------|--------|------|------|');
|
|
117
|
+
for (const m of summary.byModule.slice(0, 20)) {
|
|
118
|
+
const fb = m.fallbackReason ? `⚠ ${m.fallbackReason}` : '—';
|
|
119
|
+
const model = m.llmModel || 'ast-only';
|
|
120
|
+
lines.push(`| ${m.moduleName} | \`${model}\` | ${m.input.toLocaleString()} | ${m.output.toLocaleString()} | ${(m.durationMs / 1000).toFixed(1)}s | ${fb} |`);
|
|
121
|
+
}
|
|
122
|
+
if (summary.byModule.length > 20) {
|
|
123
|
+
lines.push('');
|
|
124
|
+
lines.push(`_...另有 ${summary.byModule.length - 20} 个模块未展示_`);
|
|
125
|
+
}
|
|
126
|
+
lines.push('');
|
|
127
|
+
// 预估对比
|
|
128
|
+
if (summary.estimated) {
|
|
129
|
+
const est = summary.estimated;
|
|
130
|
+
lines.push('### 预估 vs 实际');
|
|
131
|
+
lines.push('');
|
|
132
|
+
lines.push('| 指标 | 预估 | 实际 |');
|
|
133
|
+
lines.push('|------|------|------|');
|
|
134
|
+
lines.push(`| input tokens | ${est.totalInput.toLocaleString()} | ${summary.totalInputTokens.toLocaleString()} |`);
|
|
135
|
+
lines.push(`| output tokens | ${est.totalOutput.toLocaleString()} | ${summary.totalOutputTokens.toLocaleString()} |`);
|
|
136
|
+
lines.push('');
|
|
137
|
+
lines.push(`- 预估假设:${est.assumption}`);
|
|
138
|
+
if (typeof summary.actualVsEstimatedDelta === 'number') {
|
|
139
|
+
const delta = summary.actualVsEstimatedDelta;
|
|
140
|
+
const sign = delta > 0 ? '+' : '';
|
|
141
|
+
const warn = Math.abs(delta) > 20 ? ' ⚠ 偏差超 20%,估算模型需调整' : '';
|
|
142
|
+
lines.push(`- 偏差:${sign}${delta.toFixed(1)}%${warn}`);
|
|
143
|
+
}
|
|
144
|
+
lines.push('');
|
|
145
|
+
}
|
|
146
|
+
return lines.join('\n');
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 渲染给 quality-report.md 的 "LLM 成本与预算" 节
|
|
150
|
+
* FR-009
|
|
151
|
+
*/
|
|
152
|
+
export function renderQualityCostSection(summary) {
|
|
153
|
+
const lines = [];
|
|
154
|
+
lines.push('## LLM 成本与预算');
|
|
155
|
+
lines.push('');
|
|
156
|
+
const totalTokens = summary.totalInputTokens + summary.totalOutputTokens;
|
|
157
|
+
if (totalTokens === 0) {
|
|
158
|
+
lines.push('本次 batch 未调用 LLM。成本为 0。');
|
|
159
|
+
lines.push('');
|
|
160
|
+
return lines.join('\n');
|
|
161
|
+
}
|
|
162
|
+
lines.push('### 本次总成本');
|
|
163
|
+
lines.push('');
|
|
164
|
+
lines.push(`- 总 input tokens: **${summary.totalInputTokens.toLocaleString()}**`);
|
|
165
|
+
lines.push(`- 总 output tokens: **${summary.totalOutputTokens.toLocaleString()}**`);
|
|
166
|
+
lines.push(`- 总耗时: **${(summary.totalDurationMs / 1000).toFixed(1)}s**`);
|
|
167
|
+
if (summary.totalLoc > 0) {
|
|
168
|
+
const tokensPerKLoc = Math.round((totalTokens / summary.totalLoc) * 1000);
|
|
169
|
+
lines.push(`- 性价比: **${tokensPerKLoc.toLocaleString()} tokens / kLOC** (${summary.totalLoc.toLocaleString()} LOC)`);
|
|
170
|
+
}
|
|
171
|
+
lines.push('');
|
|
172
|
+
lines.push('### 按生成器占比');
|
|
173
|
+
lines.push('');
|
|
174
|
+
lines.push('| 生成器 | 占比 | 模块数 |');
|
|
175
|
+
lines.push('|--------|------|--------|');
|
|
176
|
+
for (const g of summary.byGenerator) {
|
|
177
|
+
lines.push(`| \`${g.generator}\` | ${g.share.toFixed(1)}% | ${g.moduleCount} |`);
|
|
178
|
+
}
|
|
179
|
+
lines.push('');
|
|
180
|
+
if (summary.estimated &&
|
|
181
|
+
typeof summary.actualVsEstimatedDelta === 'number' &&
|
|
182
|
+
Math.abs(summary.actualVsEstimatedDelta) > 20) {
|
|
183
|
+
lines.push('> ⚠ 本次估算与实际偏差超 20%(' +
|
|
184
|
+
(summary.actualVsEstimatedDelta > 0 ? '+' : '') +
|
|
185
|
+
summary.actualVsEstimatedDelta.toFixed(1) +
|
|
186
|
+
'%),估算可靠性低,建议校准估算模型。');
|
|
187
|
+
lines.push('');
|
|
188
|
+
}
|
|
189
|
+
return lines.join('\n');
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=cost-summary.js.map
|