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,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR 决策流水线
|
|
3
|
+
*
|
|
4
|
+
* 基于项目级结构化输出、模块 spec、current-spec、增量 spec 与 git 提交历史,
|
|
5
|
+
* 生成候选 ADR 草稿与索引。该流水线优先使用确定性证据匹配,避免把 ADR 草稿
|
|
6
|
+
* 变成“看起来合理”的纯 LLM 幻觉文本。
|
|
7
|
+
*/
|
|
8
|
+
import * as fs from 'node:fs';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { spawnSync } from 'node:child_process';
|
|
11
|
+
import { loadTemplate } from '../utils/template-loader.js';
|
|
12
|
+
export function generateBatchAdrDocs(options) {
|
|
13
|
+
const corpus = buildAdrCorpus(options);
|
|
14
|
+
const warnings = new Set();
|
|
15
|
+
const candidates = buildAdrCandidates(corpus);
|
|
16
|
+
if (candidates.length === 0) {
|
|
17
|
+
warnings.add('未识别到足够稳定的 ADR 候选信号,已仅生成空索引。');
|
|
18
|
+
}
|
|
19
|
+
const drafts = candidates
|
|
20
|
+
.sort((left, right) => right.score - left.score || left.title.localeCompare(right.title))
|
|
21
|
+
.slice(0, 4)
|
|
22
|
+
.map((candidate, index) => finalizeDraft(index + 1, candidate));
|
|
23
|
+
const adrDir = path.join(options.outputDir, 'docs', 'adr');
|
|
24
|
+
const writtenFiles = [];
|
|
25
|
+
for (const draft of drafts) {
|
|
26
|
+
const markdown = renderAdrDraft(draft);
|
|
27
|
+
const baseName = `${draft.decisionId.toLowerCase()}-${draft.slug}`;
|
|
28
|
+
const mdPath = path.join(adrDir, `${baseName}.md`);
|
|
29
|
+
fs.mkdirSync(adrDir, { recursive: true });
|
|
30
|
+
fs.writeFileSync(mdPath, markdown, 'utf-8');
|
|
31
|
+
writtenFiles.push(mdPath);
|
|
32
|
+
}
|
|
33
|
+
const index = {
|
|
34
|
+
title: `ADR 决策索引: ${corpus.projectName}`,
|
|
35
|
+
generatedAt: new Date().toISOString(),
|
|
36
|
+
projectName: corpus.projectName,
|
|
37
|
+
summary: buildIndexSummary(corpus, drafts),
|
|
38
|
+
draftCount: drafts.length,
|
|
39
|
+
warnings: [...warnings],
|
|
40
|
+
drafts,
|
|
41
|
+
};
|
|
42
|
+
fs.mkdirSync(adrDir, { recursive: true });
|
|
43
|
+
const indexMarkdown = renderAdrIndex(index);
|
|
44
|
+
const indexMarkdownPath = path.join(adrDir, 'index.md');
|
|
45
|
+
fs.writeFileSync(indexMarkdownPath, indexMarkdown, 'utf-8');
|
|
46
|
+
writtenFiles.push(indexMarkdownPath);
|
|
47
|
+
return {
|
|
48
|
+
index,
|
|
49
|
+
drafts,
|
|
50
|
+
warnings: [...warnings],
|
|
51
|
+
writtenFiles,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function renderAdrDraft(draft) {
|
|
55
|
+
const template = loadTemplate('adr-draft.hbs', import.meta.url);
|
|
56
|
+
return template(draft);
|
|
57
|
+
}
|
|
58
|
+
function renderAdrIndex(output) {
|
|
59
|
+
const template = loadTemplate('adr-index.hbs', import.meta.url);
|
|
60
|
+
return template(output);
|
|
61
|
+
}
|
|
62
|
+
function buildAdrCorpus(options) {
|
|
63
|
+
const entries = [];
|
|
64
|
+
const projectName = options.architectureNarrative.projectName;
|
|
65
|
+
entries.push({
|
|
66
|
+
sourceType: 'architecture-narrative',
|
|
67
|
+
label: 'executive-summary',
|
|
68
|
+
path: path.join(options.outputDir, 'architecture-narrative.md'),
|
|
69
|
+
text: [
|
|
70
|
+
...options.architectureNarrative.executiveSummary,
|
|
71
|
+
...options.architectureNarrative.observations,
|
|
72
|
+
].join('\n'),
|
|
73
|
+
});
|
|
74
|
+
for (const module of options.architectureNarrative.keyModules) {
|
|
75
|
+
entries.push({
|
|
76
|
+
sourceType: 'architecture-narrative',
|
|
77
|
+
label: `module:${module.sourceTarget}`,
|
|
78
|
+
path: path.join(options.outputDir, 'architecture-narrative.md'),
|
|
79
|
+
text: [
|
|
80
|
+
module.sourceTarget,
|
|
81
|
+
module.displayName,
|
|
82
|
+
module.intentSummary,
|
|
83
|
+
module.businessSummary,
|
|
84
|
+
module.dependencySummary,
|
|
85
|
+
...module.keySymbols.map((symbol) => `${symbol.kind}:${symbol.name}:${symbol.note}`),
|
|
86
|
+
...module.keyMethods.map((method) => `${method.kind}:${method.name}:${method.note}`),
|
|
87
|
+
].join('\n'),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (options.patternHints) {
|
|
91
|
+
entries.push({
|
|
92
|
+
sourceType: 'pattern-hints',
|
|
93
|
+
label: 'pattern-summary',
|
|
94
|
+
path: path.join(options.outputDir, 'pattern-hints.md'),
|
|
95
|
+
text: options.patternHints.model.matchedPatterns
|
|
96
|
+
.map((hint) => [
|
|
97
|
+
hint.patternName,
|
|
98
|
+
hint.summary,
|
|
99
|
+
hint.explanation,
|
|
100
|
+
...hint.matchedSignals,
|
|
101
|
+
].join('\n'))
|
|
102
|
+
.join('\n\n'),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (options.architectureOverview) {
|
|
106
|
+
entries.push({
|
|
107
|
+
sourceType: 'architecture-overview',
|
|
108
|
+
label: 'overview-summary',
|
|
109
|
+
path: path.join(options.outputDir, 'architecture-overview.md'),
|
|
110
|
+
text: [
|
|
111
|
+
options.architectureOverview.title,
|
|
112
|
+
summarizeArchitectureSection(options.architectureOverview.systemContext),
|
|
113
|
+
summarizeArchitectureSection(options.architectureOverview.deploymentView),
|
|
114
|
+
summarizeArchitectureSection(options.architectureOverview.layeredView),
|
|
115
|
+
].filter(Boolean).join('\n'),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
for (const filePath of collectMarkdownEvidenceFiles(options.projectRoot)) {
|
|
119
|
+
const normalized = normalizeProjectPath(filePath, options.projectRoot);
|
|
120
|
+
const lower = normalized.toLowerCase();
|
|
121
|
+
let sourceType = 'spec';
|
|
122
|
+
if (lower.endsWith('/current-spec.md')) {
|
|
123
|
+
sourceType = 'current-spec';
|
|
124
|
+
}
|
|
125
|
+
else if (lower.endsWith('/blueprint.md')) {
|
|
126
|
+
sourceType = 'blueprint';
|
|
127
|
+
}
|
|
128
|
+
entries.push({
|
|
129
|
+
sourceType,
|
|
130
|
+
label: normalized,
|
|
131
|
+
path: normalized,
|
|
132
|
+
text: readTrimmed(filePath, 24_000),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
for (const sourcePath of collectSourcePathSignals(options.projectRoot)) {
|
|
136
|
+
entries.push({
|
|
137
|
+
sourceType: 'source-path',
|
|
138
|
+
label: sourcePath,
|
|
139
|
+
path: sourcePath,
|
|
140
|
+
text: sourcePath,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const commits = loadRecentGitCommits(options.projectRoot);
|
|
144
|
+
for (const commit of commits) {
|
|
145
|
+
entries.push({
|
|
146
|
+
sourceType: 'commit',
|
|
147
|
+
label: commit.sha.slice(0, 7),
|
|
148
|
+
text: [commit.subject, commit.body].filter(Boolean).join('\n'),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
projectName,
|
|
153
|
+
projectRoot: options.projectRoot,
|
|
154
|
+
architectureNarrative: options.architectureNarrative,
|
|
155
|
+
architectureOverview: options.architectureOverview,
|
|
156
|
+
patternHints: options.patternHints,
|
|
157
|
+
commits,
|
|
158
|
+
entries,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// Feature 140 T37 (FR-003) — buildAdrCandidates 内部 8 个 hardcoded candidate 函数已删除:
|
|
162
|
+
// - buildCliHostedRuntimeCandidate / buildStreamJsonProtocolCandidate
|
|
163
|
+
// - buildRegistryExtensibilityCandidate / buildDeterministicFactsCandidate
|
|
164
|
+
// - buildCurrentSpecFactSourceCandidate / buildAppendOnlySessionCandidate
|
|
165
|
+
// - buildContainerizedRuntimeCandidate / buildModularSeparationCandidate
|
|
166
|
+
// 还有 buildGenericCoreSeparationCandidate fallback 也已删除。
|
|
167
|
+
//
|
|
168
|
+
// 这 8 个函数原本基于关键词匹配(matchEvidence)触发候选,导致任何足够大的项目都会
|
|
169
|
+
// 偶然命中关键词,产出 Spectra 自身架构的模板套壳 ADR(hallucination),这是 spec
|
|
170
|
+
// FR-003 锁定要求清除的"ADR 质量问题 1 — ADR hallucinate"根因。
|
|
171
|
+
//
|
|
172
|
+
// 替代实现:`runAdrMapReduce`(src/panoramic/pipelines/adr-mapreduce.ts)通过
|
|
173
|
+
// cluster orchestrator + Map (sonnet) / Reduce (opus) + evidence 真实性校验
|
|
174
|
+
// 产出项目特有的 ADR。本同步入口保留作为兼容 stub:返回空数组让既有 caller
|
|
175
|
+
// 不至于崩溃,但 ADR 实际产出依赖调用方传入 anthropicClient 并切换到 MapReduce 路径。
|
|
176
|
+
function buildAdrCandidates(_corpus) {
|
|
177
|
+
// 同步路径不再产出 ADR(MapReduce 路径是 async,由 caller 显式选择)
|
|
178
|
+
return [];
|
|
179
|
+
}
|
|
180
|
+
function finalizeDraft(index, candidate) {
|
|
181
|
+
const decisionId = `ADR-${String(index).padStart(4, '0')}`;
|
|
182
|
+
const slug = slugify(candidate.title);
|
|
183
|
+
const sourceTypes = uniqueSorted(candidate.evidence.map((item) => item.sourceType));
|
|
184
|
+
return {
|
|
185
|
+
decisionId,
|
|
186
|
+
slug,
|
|
187
|
+
title: candidate.title,
|
|
188
|
+
status: 'proposed',
|
|
189
|
+
category: candidate.category,
|
|
190
|
+
confidence: candidate.confidence,
|
|
191
|
+
inferred: candidate.inferred,
|
|
192
|
+
sourceTypes,
|
|
193
|
+
summary: candidate.summary,
|
|
194
|
+
decision: candidate.decision,
|
|
195
|
+
context: candidate.context,
|
|
196
|
+
consequences: candidate.consequences,
|
|
197
|
+
alternatives: candidate.alternatives,
|
|
198
|
+
evidence: candidate.evidence,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function buildIndexSummary(corpus, drafts) {
|
|
202
|
+
const lines = [
|
|
203
|
+
`本批次基于 ${drafts.length} 个候选 ADR 草稿组织决策索引,输入事实主要来自架构叙事、模式提示、现有 spec/current-spec 与近期提交历史。`,
|
|
204
|
+
];
|
|
205
|
+
if (corpus.patternHints?.model.matchedPatterns.length) {
|
|
206
|
+
lines.push(`模式提示中识别到 ${corpus.patternHints.model.matchedPatterns.length} 条可用模式证据,可作为 ADR 背景的结构化补充。`);
|
|
207
|
+
}
|
|
208
|
+
if (corpus.commits.length > 0) {
|
|
209
|
+
lines.push(`已纳入最近 ${Math.min(corpus.commits.length, 20)} 条 git 提交标题作为演进证据。`);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
lines.push('未检测到可读取的 git 提交历史,部分 ADR 仅基于当前代码与文档结构推断。');
|
|
213
|
+
}
|
|
214
|
+
return lines;
|
|
215
|
+
}
|
|
216
|
+
function evidenceFromModule(module) {
|
|
217
|
+
const excerpt = [module.intentSummary, module.businessSummary, module.dependencySummary]
|
|
218
|
+
.filter(Boolean)
|
|
219
|
+
.join(' ')
|
|
220
|
+
.trim();
|
|
221
|
+
if (!excerpt) {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
sourceType: 'architecture-narrative',
|
|
226
|
+
label: module.sourceTarget,
|
|
227
|
+
path: 'architecture-narrative.md',
|
|
228
|
+
excerpt,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function summarizeArchitectureSection(section) {
|
|
232
|
+
if (!section) {
|
|
233
|
+
return '';
|
|
234
|
+
}
|
|
235
|
+
const parts = [
|
|
236
|
+
section.title,
|
|
237
|
+
section.description ?? '',
|
|
238
|
+
...section.nodes.slice(0, 4).map((node) => `${node.kind}:${node.label}`),
|
|
239
|
+
...section.edges.slice(0, 4).map((edge) => `${edge.from}->${edge.to}:${edge.relation}`),
|
|
240
|
+
section.missingReason ?? '',
|
|
241
|
+
].filter(Boolean);
|
|
242
|
+
return parts.join(' | ');
|
|
243
|
+
}
|
|
244
|
+
function summarizeEvidenceText(text, loweredKeywords) {
|
|
245
|
+
const normalized = text.replace(/\r/g, '');
|
|
246
|
+
const lines = normalized.split('\n').map((line) => line.trim()).filter(Boolean);
|
|
247
|
+
const matchedLine = lines.find((line) => {
|
|
248
|
+
const lowered = line.toLowerCase();
|
|
249
|
+
return loweredKeywords.some((keyword) => lowered.includes(keyword));
|
|
250
|
+
});
|
|
251
|
+
const source = matchedLine ?? lines[0] ?? normalized;
|
|
252
|
+
return source.length > 240 ? `${source.slice(0, 237)}...` : source;
|
|
253
|
+
}
|
|
254
|
+
function collectMarkdownEvidenceFiles(projectRoot) {
|
|
255
|
+
const specsDir = path.join(projectRoot, 'specs');
|
|
256
|
+
if (!fs.existsSync(specsDir)) {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
const results = [];
|
|
260
|
+
walkDirectory(specsDir, (filePath) => {
|
|
261
|
+
const relative = normalizeProjectPath(filePath, projectRoot).toLowerCase();
|
|
262
|
+
if (relative.endsWith('/current-spec.md')
|
|
263
|
+
|| relative.endsWith('/blueprint.md')
|
|
264
|
+
|| relative.endsWith('/spec.md')) {
|
|
265
|
+
results.push(filePath);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
return results.sort((left, right) => left.localeCompare(right));
|
|
269
|
+
}
|
|
270
|
+
function collectSourcePathSignals(projectRoot) {
|
|
271
|
+
const results = [];
|
|
272
|
+
walkDirectory(projectRoot, (filePath) => {
|
|
273
|
+
const relative = normalizeProjectPath(filePath, projectRoot);
|
|
274
|
+
const lower = relative.toLowerCase();
|
|
275
|
+
if (lower.startsWith('.git/')
|
|
276
|
+
|| lower.startsWith('node_modules/')
|
|
277
|
+
|| lower.startsWith('dist/')
|
|
278
|
+
|| lower.startsWith('coverage/')
|
|
279
|
+
|| lower.startsWith('specs/')
|
|
280
|
+
|| lower.startsWith('.spectra')) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
results.push(relative);
|
|
284
|
+
});
|
|
285
|
+
return results.sort((left, right) => left.localeCompare(right));
|
|
286
|
+
}
|
|
287
|
+
function walkDirectory(dir, onFile) {
|
|
288
|
+
if (!fs.existsSync(dir)) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
292
|
+
if (entry.isSymbolicLink()) {
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
const fullPath = path.join(dir, entry.name);
|
|
296
|
+
if (entry.isDirectory()) {
|
|
297
|
+
walkDirectory(fullPath, onFile);
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if (entry.isFile()) {
|
|
301
|
+
onFile(fullPath);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function loadRecentGitCommits(projectRoot) {
|
|
306
|
+
const result = spawnSync('git', ['-C', projectRoot, 'log', '--no-color', '--pretty=format:%H%x1f%s%x1f%b%x1e', '-n', '20'], { encoding: 'utf-8' });
|
|
307
|
+
if (result.status !== 0 || !result.stdout) {
|
|
308
|
+
return [];
|
|
309
|
+
}
|
|
310
|
+
return result.stdout
|
|
311
|
+
.split('\x1e')
|
|
312
|
+
.map((chunk) => chunk.trim())
|
|
313
|
+
.filter(Boolean)
|
|
314
|
+
.map((chunk) => {
|
|
315
|
+
const [sha, subject, body] = chunk.split('\x1f');
|
|
316
|
+
return {
|
|
317
|
+
sha: sha ?? '',
|
|
318
|
+
subject: subject ?? '',
|
|
319
|
+
body: body ?? '',
|
|
320
|
+
};
|
|
321
|
+
})
|
|
322
|
+
.filter((entry) => entry.sha && entry.subject);
|
|
323
|
+
}
|
|
324
|
+
function normalizeProjectPath(filePath, projectRoot) {
|
|
325
|
+
const relative = path.relative(projectRoot, filePath);
|
|
326
|
+
return relative.split(path.sep).join('/');
|
|
327
|
+
}
|
|
328
|
+
function readTrimmed(filePath, maxLength) {
|
|
329
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
330
|
+
const normalized = content.replace(/\r/g, '');
|
|
331
|
+
return normalized.length > maxLength ? normalized.slice(0, maxLength) : normalized;
|
|
332
|
+
}
|
|
333
|
+
function slugify(value) {
|
|
334
|
+
return value
|
|
335
|
+
.toLowerCase()
|
|
336
|
+
.replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
|
|
337
|
+
.replace(/-+/g, '-')
|
|
338
|
+
.replace(/^-|-$/g, '')
|
|
339
|
+
.slice(0, 80);
|
|
340
|
+
}
|
|
341
|
+
function uniqueSorted(items) {
|
|
342
|
+
return [...new Set(items)].sort((left, right) => left.localeCompare(right));
|
|
343
|
+
}
|
|
344
|
+
// ============================================================
|
|
345
|
+
// DocumentGenerator Adapter
|
|
346
|
+
// ============================================================
|
|
347
|
+
/**
|
|
348
|
+
* AdrDecisionPipelineGenerator
|
|
349
|
+
*
|
|
350
|
+
* 将 generateBatchAdrDocs() 适配为 DocumentGenerator 接口。
|
|
351
|
+
* generate() 包含 fs 文件写出副作用(写出 ADR 草稿与索引)。
|
|
352
|
+
* render() 为纯 Markdown 摘要,不含 fs 调用。
|
|
353
|
+
*
|
|
354
|
+
* TInput: GenerateBatchAdrDocsOptions
|
|
355
|
+
* TOutput: GenerateBatchAdrDocsResult
|
|
356
|
+
*/
|
|
357
|
+
export class AdrDecisionPipelineGenerator {
|
|
358
|
+
id = 'adr-decision-pipeline';
|
|
359
|
+
name = 'ADR 决策流水线生成器';
|
|
360
|
+
description = '基于架构事实与模块 spec 生成候选 ADR 草稿与索引,并写出到 outputDir/docs/adr/';
|
|
361
|
+
outputDir;
|
|
362
|
+
constructor(outputDir) {
|
|
363
|
+
this.outputDir = outputDir;
|
|
364
|
+
}
|
|
365
|
+
isApplicable(context) {
|
|
366
|
+
// 只要项目根目录存在即可适用(outputDir 由构造函数注入)
|
|
367
|
+
return Boolean(context.projectRoot);
|
|
368
|
+
}
|
|
369
|
+
async extract(context) {
|
|
370
|
+
// 构造最小化 options,必需字段来自 context 和 outputDir
|
|
371
|
+
// architectureNarrative 必须提供,此处使用最小 stub(由编排层注入完整值)
|
|
372
|
+
return {
|
|
373
|
+
projectRoot: context.projectRoot,
|
|
374
|
+
outputDir: this.outputDir,
|
|
375
|
+
projectContext: context,
|
|
376
|
+
generatedDocs: [],
|
|
377
|
+
architectureNarrative: {
|
|
378
|
+
title: '',
|
|
379
|
+
generatedAt: new Date().toISOString().split('T')[0],
|
|
380
|
+
projectName: '',
|
|
381
|
+
executiveSummary: [],
|
|
382
|
+
repositoryMap: [],
|
|
383
|
+
keyModules: [],
|
|
384
|
+
keySymbols: [],
|
|
385
|
+
keyMethods: [],
|
|
386
|
+
observations: [],
|
|
387
|
+
supportingDocs: [],
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
async generate(input, _options) {
|
|
392
|
+
// generate() 包含 fs 写出副作用(写出 ADR 文件)
|
|
393
|
+
return generateBatchAdrDocs(input);
|
|
394
|
+
}
|
|
395
|
+
render(output) {
|
|
396
|
+
// render() 为纯摘要,无 fs 调用
|
|
397
|
+
const { index } = output;
|
|
398
|
+
const lines = [
|
|
399
|
+
`# ${index.title}`,
|
|
400
|
+
'',
|
|
401
|
+
`**生成时间**: ${index.generatedAt}`,
|
|
402
|
+
`**ADR 草稿数**: ${index.draftCount}`,
|
|
403
|
+
'',
|
|
404
|
+
...index.summary,
|
|
405
|
+
];
|
|
406
|
+
if (output.writtenFiles.length > 0) {
|
|
407
|
+
lines.push('', '**写出文件**:');
|
|
408
|
+
for (const file of output.writtenFiles) {
|
|
409
|
+
lines.push(`- ${file}`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (output.warnings.length > 0) {
|
|
413
|
+
lines.push('', '**警告**:');
|
|
414
|
+
for (const warning of output.warnings) {
|
|
415
|
+
lines.push(`- ${warning}`);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return lines.join('\n');
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
//# sourceMappingURL=adr-decision-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adr-decision-pipeline.js","sourceRoot":"","sources":["../../../src/panoramic/pipelines/adr-decision-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AA6G3D,MAAM,UAAU,oBAAoB,CAClC,OAAoC;IAEpC,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAE9C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,QAAQ,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,MAAM,GAAG,UAAU;SACtB,IAAI,CAAC,CAAC,IAAI,E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AQ,CACZ,KAAkC,EAClC,QAA0B;QAE1B,oCAAoC;QACpC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,MAAkC;QACvC,wBAAwB;QACxB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,MAAM,KAAK,GAAa;YACtB,KAAK,KAAK,CAAC,KAAK,EAAE;YAClB,EAAE;YACF,aAAa,KAAK,CAAC,WAAW,EAAE;YAChC,gBAAgB,KAAK,CAAC,UAAU,EAAE;YAClC,EAAE;YACF,GAAG,KAAK,CAAC,OAAO;SACjB,CAAC;QAEF,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;YAC5B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;gBACvC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAC1B,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACtC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature 140 ADR evidenceRef 输入格式(来自 LLM Map 阶段输出)。
|
|
3
|
+
*
|
|
4
|
+
* 与既有 `AdrEvidenceRef` 不同:本结构是 LLM 必须填充的"代码 evidence"格式,
|
|
5
|
+
* 强制要求 source(文件路径)+ location(行号范围)+ snippet(原文片段)三件套。
|
|
6
|
+
*/
|
|
7
|
+
export interface EvidenceRefInput {
|
|
8
|
+
/** 文件路径(相对 projectRoot 或绝对路径)*/
|
|
9
|
+
source: string;
|
|
10
|
+
/** 行号范围("L42-58" 格式,包含两端;单行可写 "L42" 或 "L42-42")*/
|
|
11
|
+
location: string;
|
|
12
|
+
/** 文件实际内容片段(用于校验 snippet 匹配) */
|
|
13
|
+
snippet: string;
|
|
14
|
+
}
|
|
15
|
+
/** 校验后的 evidenceRef,追加 verified + verificationReason 字段 */
|
|
16
|
+
export interface VerifiedEvidenceRef extends EvidenceRefInput {
|
|
17
|
+
/** 是否通过 file/line/snippet 三重验证 */
|
|
18
|
+
verified: boolean;
|
|
19
|
+
/** 校验失败原因(仅 verified=false 时填充)*/
|
|
20
|
+
verificationReason?: 'file-not-found' | 'invalid-location-format' | 'line-out-of-range' | 'snippet-mismatch' | 'read-failed';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 校验一组 evidenceRef 的真实性。
|
|
24
|
+
*
|
|
25
|
+
* @param refs LLM 输出的 evidenceRef 列表
|
|
26
|
+
* @param projectRoot 项目根目录(绝对路径),用于解析相对 source
|
|
27
|
+
* @returns 每条 ref 追加 verified + 失败原因;不抛错(无效 ref 标 verified=false 但保留在结果中)
|
|
28
|
+
*/
|
|
29
|
+
export declare function verifyEvidenceRefs(refs: EvidenceRefInput[], projectRoot: string): VerifiedEvidenceRef[];
|
|
30
|
+
//# sourceMappingURL=adr-evidence-verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adr-evidence-verifier.d.ts","sourceRoot":"","sources":["../../../src/panoramic/pipelines/adr-evidence-verifier.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2DAA2D;AAC3D,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,kBAAkB,CAAC,EACf,gBAAgB,GAChB,yBAAyB,GACzB,mBAAmB,GACnB,kBAAkB,GAClB,aAAa,CAAC;CACnB;AAgBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,gBAAgB,EAAE,EACxB,WAAW,EAAE,MAAM,GAClB,mBAAmB,EAAE,CAEvB"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR Evidence Verifier (Feature 140 T40)
|
|
3
|
+
*
|
|
4
|
+
* 实现 spec FR-005 — ADR evidenceRef 自动真实性校验。
|
|
5
|
+
*
|
|
6
|
+
* 防止 LLM 在 ADR 草稿中编造不存在的代码引用。每条 evidenceRef 程序化校验:
|
|
7
|
+
* (1) source 文件存在(fs.existsSync)
|
|
8
|
+
* (2) location 行号范围有效(解析 "L42-58" 格式,检查文件实际行数)
|
|
9
|
+
* (3) snippet 与文件实际内容字符匹配(允许 ≤10% 空白差异:normalize whitespace 后
|
|
10
|
+
* Levenshtein 距离 / snippet.length ≤ 0.1)
|
|
11
|
+
*
|
|
12
|
+
* Validation gate:有效 evidenceRefs(verified=true)< 2 条的 ADR 应从产物中移除
|
|
13
|
+
* (由 caller 实施;本模块只负责打 verified 标记)。
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from 'node:fs';
|
|
16
|
+
import * as path from 'node:path';
|
|
17
|
+
// ============================================================
|
|
18
|
+
// 常量
|
|
19
|
+
// ============================================================
|
|
20
|
+
/** spec FR-005 锁定:snippet 允许的空白差异比例上限(10%)*/
|
|
21
|
+
const SNIPPET_WHITESPACE_DIFF_TOLERANCE = 0.1;
|
|
22
|
+
/** location 格式正则:匹配 "L42" 或 "L42-58"(允许大写 L 或小写 l)*/
|
|
23
|
+
const LOCATION_REGEX = /^[Ll](\d+)(?:-(\d+))?$/;
|
|
24
|
+
// ============================================================
|
|
25
|
+
// 核心校验函数
|
|
26
|
+
// ============================================================
|
|
27
|
+
/**
|
|
28
|
+
* 校验一组 evidenceRef 的真实性。
|
|
29
|
+
*
|
|
30
|
+
* @param refs LLM 输出的 evidenceRef 列表
|
|
31
|
+
* @param projectRoot 项目根目录(绝对路径),用于解析相对 source
|
|
32
|
+
* @returns 每条 ref 追加 verified + 失败原因;不抛错(无效 ref 标 verified=false 但保留在结果中)
|
|
33
|
+
*/
|
|
34
|
+
export function verifyEvidenceRefs(refs, projectRoot) {
|
|
35
|
+
return refs.map((ref) => verifyOne(ref, projectRoot));
|
|
36
|
+
}
|
|
37
|
+
function verifyOne(ref, projectRoot) {
|
|
38
|
+
// 解析文件绝对路径
|
|
39
|
+
const absPath = path.isAbsolute(ref.source)
|
|
40
|
+
? ref.source
|
|
41
|
+
: path.join(projectRoot, ref.source);
|
|
42
|
+
// 修复 Codex W-2: path traversal 防护 — evidence 必须在 projectRoot 内
|
|
43
|
+
// 防止 LLM 用 `../../../etc/passwd` 这类相对路径拿到任意文件作 fake evidence
|
|
44
|
+
const normalizedAbs = path.resolve(absPath);
|
|
45
|
+
const normalizedRoot = path.resolve(projectRoot);
|
|
46
|
+
if (!normalizedAbs.startsWith(normalizedRoot + path.sep) && normalizedAbs !== normalizedRoot) {
|
|
47
|
+
return { ...ref, verified: false, verificationReason: 'file-not-found' };
|
|
48
|
+
}
|
|
49
|
+
// (1) 文件存在性
|
|
50
|
+
if (!fs.existsSync(absPath)) {
|
|
51
|
+
return { ...ref, verified: false, verificationReason: 'file-not-found' };
|
|
52
|
+
}
|
|
53
|
+
// (2) 解析 location 格式
|
|
54
|
+
const locationMatch = LOCATION_REGEX.exec(ref.location);
|
|
55
|
+
if (!locationMatch) {
|
|
56
|
+
return { ...ref, verified: false, verificationReason: 'invalid-location-format' };
|
|
57
|
+
}
|
|
58
|
+
const startLine = parseInt(locationMatch[1], 10);
|
|
59
|
+
const endLine = locationMatch[2] !== undefined ? parseInt(locationMatch[2], 10) : startLine;
|
|
60
|
+
// 行号必须 ≥ 1 且 startLine ≤ endLine
|
|
61
|
+
if (startLine < 1 || endLine < startLine) {
|
|
62
|
+
return { ...ref, verified: false, verificationReason: 'invalid-location-format' };
|
|
63
|
+
}
|
|
64
|
+
// (3) 读取文件内容并校验行号范围 + snippet
|
|
65
|
+
let fileContent;
|
|
66
|
+
try {
|
|
67
|
+
fileContent = fs.readFileSync(absPath, 'utf-8');
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return { ...ref, verified: false, verificationReason: 'read-failed' };
|
|
71
|
+
}
|
|
72
|
+
const lines = fileContent.split('\n');
|
|
73
|
+
// 行号越界(注:文件最后一行可能没有 trailing newline,lines.length 可能 = endLine 或 endLine+1)
|
|
74
|
+
if (endLine > lines.length) {
|
|
75
|
+
return { ...ref, verified: false, verificationReason: 'line-out-of-range' };
|
|
76
|
+
}
|
|
77
|
+
// 提取 location 指定行的实际内容(1-based, 含两端)
|
|
78
|
+
const actualSnippet = lines.slice(startLine - 1, endLine).join('\n');
|
|
79
|
+
// (4) snippet 匹配(≤10% 空白差异)
|
|
80
|
+
if (!snippetMatches(ref.snippet, actualSnippet)) {
|
|
81
|
+
return { ...ref, verified: false, verificationReason: 'snippet-mismatch' };
|
|
82
|
+
}
|
|
83
|
+
return { ...ref, verified: true };
|
|
84
|
+
}
|
|
85
|
+
// ============================================================
|
|
86
|
+
// snippet 匹配算法
|
|
87
|
+
// ============================================================
|
|
88
|
+
/**
|
|
89
|
+
* 比较两个 snippet 是否"实质相等",允许 ≤10% 空白差异。
|
|
90
|
+
*
|
|
91
|
+
* 算法:
|
|
92
|
+
* 1. Normalize 双方:折叠所有连续空白(含换行)为单个空格、首尾 trim
|
|
93
|
+
* 2. 计算 Levenshtein 距离(normalize 后)
|
|
94
|
+
* 3. 距离 / max(len1, len2) ≤ 0.1 → 视为匹配
|
|
95
|
+
*
|
|
96
|
+
* 这种宽容匹配兼容 LLM 输出中的空白格式漂移(缩进 / 换行风格 / trailing space)。
|
|
97
|
+
*/
|
|
98
|
+
function snippetMatches(llmSnippet, fileSnippet) {
|
|
99
|
+
const a = normalizeWhitespace(llmSnippet);
|
|
100
|
+
const b = normalizeWhitespace(fileSnippet);
|
|
101
|
+
if (a === b)
|
|
102
|
+
return true;
|
|
103
|
+
if (a.length === 0 || b.length === 0)
|
|
104
|
+
return false;
|
|
105
|
+
const distance = levenshtein(a, b);
|
|
106
|
+
const ratio = distance / Math.max(a.length, b.length);
|
|
107
|
+
return ratio <= SNIPPET_WHITESPACE_DIFF_TOLERANCE;
|
|
108
|
+
}
|
|
109
|
+
function normalizeWhitespace(s) {
|
|
110
|
+
return s.replace(/\s+/g, ' ').trim();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Levenshtein 距离(编辑距离)— 标准 DP 实现。
|
|
114
|
+
* 复杂度 O(m*n)。snippet 通常 < 200 字符,性能可接受。
|
|
115
|
+
*/
|
|
116
|
+
function levenshtein(a, b) {
|
|
117
|
+
if (a.length === 0)
|
|
118
|
+
return b.length;
|
|
119
|
+
if (b.length === 0)
|
|
120
|
+
return a.length;
|
|
121
|
+
// 滚动数组优化:只需保留 prev 行(O(min(m, n)) 空间)
|
|
122
|
+
const m = a.length;
|
|
123
|
+
const n = b.length;
|
|
124
|
+
// 选短的一边作内层循环,长的作外层(减少内层数组大小)
|
|
125
|
+
const [shorter, longer] = m <= n ? [a, b] : [b, a];
|
|
126
|
+
const sm = shorter.length;
|
|
127
|
+
const ln = longer.length;
|
|
128
|
+
let prev = Array.from({ length: sm + 1 }, (_, i) => i);
|
|
129
|
+
for (let i = 1; i <= ln; i++) {
|
|
130
|
+
const curr = [i];
|
|
131
|
+
for (let j = 1; j <= sm; j++) {
|
|
132
|
+
const cost = longer[i - 1] === shorter[j - 1] ? 0 : 1;
|
|
133
|
+
curr.push(Math.min(prev[j] + 1, // 删除
|
|
134
|
+
curr[j - 1] + 1, // 插入
|
|
135
|
+
prev[j - 1] + cost));
|
|
136
|
+
}
|
|
137
|
+
prev = curr;
|
|
138
|
+
}
|
|
139
|
+
return prev[sm];
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=adr-evidence-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adr-evidence-verifier.js","sourceRoot":"","sources":["../../../src/panoramic/pipelines/adr-evidence-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAkClC,+DAA+D;AAC/D,KAAK;AACL,+DAA+D;AAE/D,6CAA6C;AAC7C,MAAM,iCAAiC,GAAG,GAAG,CAAC;AAE9C,qDAAqD;AACrD,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD,+DAA+D;AAC/D,SAAS;AACT,+DAA+D;AAE/D;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAwB,EACxB,WAAmB;IAEnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,SAAS,CAAC,GAAqB,EAAE,WAAmB;IAC3D,WAAW;IACX,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC;QACzC,CAAC,CAAC,GAAG,CAAC,MAAM;QACZ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,+DAA+D;IAC/D,6DAA6D;IAC7D,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,WA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