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,959 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product / UX fact ingestion
|
|
3
|
+
*
|
|
4
|
+
* Feature 060: 将 current-spec、README/设计说明与近期提交
|
|
5
|
+
* 汇总为产品概览、用户旅程与 feature brief 文档。
|
|
6
|
+
*
|
|
7
|
+
* 设计原则:
|
|
8
|
+
* 1. current-spec 是首选事实源;README / 设计文档为补充源
|
|
9
|
+
* 2. 文档生成完全基于仓库内容,不依赖外部 API 或 CLI
|
|
10
|
+
* 3. narrative 与 journey/brief synthesis 必须保留 evidence / confidence / inferred
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from 'node:fs';
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import { spawnSync } from 'node:child_process';
|
|
15
|
+
import { loadTemplate } from '../utils/template-loader.js';
|
|
16
|
+
import { createLogger } from '../utils/logger.js';
|
|
17
|
+
import { truncateAtNaturalBoundary, isDescriptiveText, } from '../utils/text-segmenter.js';
|
|
18
|
+
import { sanitizeMarkdownContent } from '../utils/html-sanitizer.js';
|
|
19
|
+
const logger = createLogger('product-ux-docs');
|
|
20
|
+
export function generateProductUxDocs(options) {
|
|
21
|
+
const corpus = buildProductFactCorpus(options.projectRoot);
|
|
22
|
+
const overview = buildProductOverview(corpus);
|
|
23
|
+
const journeys = buildUserJourneys(corpus, overview);
|
|
24
|
+
const featureBriefIndex = buildFeatureBriefIndex(corpus, overview, journeys);
|
|
25
|
+
const writtenFiles = [];
|
|
26
|
+
writtenFiles.push(...writeOverview(options.outputDir, overview));
|
|
27
|
+
writtenFiles.push(...writeJourneys(options.outputDir, journeys));
|
|
28
|
+
writtenFiles.push(...writeFeatureBriefs(options.outputDir, featureBriefIndex));
|
|
29
|
+
return {
|
|
30
|
+
overview,
|
|
31
|
+
journeys,
|
|
32
|
+
featureBriefIndex,
|
|
33
|
+
warnings: uniqueSorted([
|
|
34
|
+
...corpus.warnings,
|
|
35
|
+
...overview.warnings,
|
|
36
|
+
...journeys.warnings,
|
|
37
|
+
...featureBriefIndex.warnings,
|
|
38
|
+
]),
|
|
39
|
+
writtenFiles,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function writeOverview(outputDir, overview) {
|
|
43
|
+
const mdPath = path.join(outputDir, 'product-overview.md');
|
|
44
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
45
|
+
fs.writeFileSync(mdPath, renderProductOverview(overview), 'utf-8');
|
|
46
|
+
return [mdPath];
|
|
47
|
+
}
|
|
48
|
+
function writeJourneys(outputDir, journeys) {
|
|
49
|
+
const mdPath = path.join(outputDir, 'user-journeys.md');
|
|
50
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
51
|
+
fs.writeFileSync(mdPath, renderUserJourneys(journeys), 'utf-8');
|
|
52
|
+
return [mdPath];
|
|
53
|
+
}
|
|
54
|
+
function writeFeatureBriefs(outputDir, index) {
|
|
55
|
+
const briefsDir = path.join(outputDir, 'feature-briefs');
|
|
56
|
+
const writtenFiles = [];
|
|
57
|
+
fs.mkdirSync(briefsDir, { recursive: true });
|
|
58
|
+
const indexMd = path.join(briefsDir, 'index.md');
|
|
59
|
+
fs.writeFileSync(indexMd, renderFeatureBriefIndex(index), 'utf-8');
|
|
60
|
+
writtenFiles.push(indexMd);
|
|
61
|
+
for (const brief of index.briefs) {
|
|
62
|
+
const mdPath = path.join(briefsDir, `${brief.fileName}.md`);
|
|
63
|
+
fs.writeFileSync(mdPath, renderFeatureBrief(brief), 'utf-8');
|
|
64
|
+
writtenFiles.push(mdPath);
|
|
65
|
+
}
|
|
66
|
+
return writtenFiles;
|
|
67
|
+
}
|
|
68
|
+
function renderProductOverview(output) {
|
|
69
|
+
return loadTemplate('product-overview.hbs', import.meta.url)(output);
|
|
70
|
+
}
|
|
71
|
+
function renderUserJourneys(output) {
|
|
72
|
+
return loadTemplate('user-journeys.hbs', import.meta.url)(output);
|
|
73
|
+
}
|
|
74
|
+
function renderFeatureBriefIndex(output) {
|
|
75
|
+
return loadTemplate('feature-brief-index.hbs', import.meta.url)(output);
|
|
76
|
+
}
|
|
77
|
+
function renderFeatureBrief(output) {
|
|
78
|
+
return loadTemplate('feature-brief.hbs', import.meta.url)(output);
|
|
79
|
+
}
|
|
80
|
+
function buildProductFactCorpus(projectRoot) {
|
|
81
|
+
const currentSpecs = collectCurrentSpecs(projectRoot);
|
|
82
|
+
const readmes = collectReadmes(projectRoot);
|
|
83
|
+
const designDocs = collectLocalDesignDocs(projectRoot);
|
|
84
|
+
const commits = collectRecentCommits(projectRoot, 10);
|
|
85
|
+
const warnings = uniqueSorted([
|
|
86
|
+
...(currentSpecs.length === 0
|
|
87
|
+
? ['未找到 current-spec.md,将更多依赖 README 与设计文档进行产品事实推断。']
|
|
88
|
+
: []),
|
|
89
|
+
...(readmes.length === 0
|
|
90
|
+
? ['未找到项目级 README.md,产品定位摘要将缺少一份高价值补充源。']
|
|
91
|
+
: []),
|
|
92
|
+
...(designDocs.length === 0
|
|
93
|
+
? ['未找到本地设计说明/roadmap Markdown,UX 旅程与 feature brief 将更多依赖 current-spec 与 README。']
|
|
94
|
+
: []),
|
|
95
|
+
]);
|
|
96
|
+
return {
|
|
97
|
+
projectName: resolveProjectName(projectRoot, currentSpecs, readmes),
|
|
98
|
+
currentSpecs,
|
|
99
|
+
readmes,
|
|
100
|
+
designDocs,
|
|
101
|
+
commits,
|
|
102
|
+
warnings,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function buildProductOverview(corpus) {
|
|
106
|
+
const summary = collectOverviewParagraphs(corpus).slice(0, 4);
|
|
107
|
+
const targetUsers = buildTargetUsers(corpus);
|
|
108
|
+
const coreScenarios = buildCoreScenarios(corpus, targetUsers);
|
|
109
|
+
const evidence = uniqueEvidence([
|
|
110
|
+
...collectEvidenceFromSources(corpus.currentSpecs, 'high'),
|
|
111
|
+
...collectEvidenceFromSources(corpus.readmes, 'medium'),
|
|
112
|
+
...collectEvidenceFromSources(corpus.designDocs, 'medium'),
|
|
113
|
+
]);
|
|
114
|
+
const warnings = uniqueSorted([
|
|
115
|
+
...corpus.warnings,
|
|
116
|
+
...(summary.length === 0
|
|
117
|
+
? ['未提取到稳定的产品概述段落,product-overview 将更多依赖推断和标题级摘要。']
|
|
118
|
+
: []),
|
|
119
|
+
...(targetUsers.length === 0
|
|
120
|
+
? ['未识别到显式用户画像表或用户段落,将使用 README / issue 文本推断目标用户。']
|
|
121
|
+
: []),
|
|
122
|
+
...(coreScenarios.length === 0
|
|
123
|
+
? ['未识别到显式核心场景列表,将使用 feature briefs 和 README 文本推断核心任务流。']
|
|
124
|
+
: []),
|
|
125
|
+
]);
|
|
126
|
+
const inferred = corpus.currentSpecs.length === 0;
|
|
127
|
+
return {
|
|
128
|
+
title: `产品概览: ${corpus.projectName}`,
|
|
129
|
+
generatedAt: new Date().toISOString(),
|
|
130
|
+
projectName: corpus.projectName,
|
|
131
|
+
summary: summary.length > 0
|
|
132
|
+
? summary
|
|
133
|
+
: ['仅基于代码与现有规格推断;尚未找到足够稳定的产品事实源。'],
|
|
134
|
+
targetUsers,
|
|
135
|
+
coreScenarios,
|
|
136
|
+
keyTaskFlows: coreScenarios.slice(0, 5).map((scenario) => scenario.title),
|
|
137
|
+
warnings,
|
|
138
|
+
confidence: currentSpecConfidence(corpus.currentSpecs.length > 0, evidence.length),
|
|
139
|
+
inferred,
|
|
140
|
+
evidence,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function buildUserJourneys(corpus, overview) {
|
|
144
|
+
const journeys = overview.coreScenarios.slice(0, 5).map((scenario, index) => {
|
|
145
|
+
const actor = scenario.actors[0] ?? overview.targetUsers[0]?.name ?? '使用者';
|
|
146
|
+
const detail = scenario.summary || scenario.title;
|
|
147
|
+
return {
|
|
148
|
+
id: `journey-${String(index + 1).padStart(2, '0')}`,
|
|
149
|
+
title: scenario.title,
|
|
150
|
+
actor,
|
|
151
|
+
goal: detail,
|
|
152
|
+
outcome: deriveOutcomeFromScenario(scenario, actor),
|
|
153
|
+
steps: [
|
|
154
|
+
{
|
|
155
|
+
title: '触发场景',
|
|
156
|
+
detail: deriveTriggerFromScenario(scenario, actor),
|
|
157
|
+
inferred: true,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
title: '执行关键动作',
|
|
161
|
+
detail,
|
|
162
|
+
inferred: false,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
title: '消费输出',
|
|
166
|
+
detail: deriveConsumptionFromScenario(scenario),
|
|
167
|
+
inferred: true,
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
evidence: scenario.evidence,
|
|
171
|
+
confidence: scenario.confidence,
|
|
172
|
+
inferred: true,
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
const warnings = uniqueSorted([
|
|
176
|
+
...corpus.warnings,
|
|
177
|
+
...(journeys.length === 0
|
|
178
|
+
? ['未识别到可稳定组织成用户旅程的场景,user-journeys 将为空。']
|
|
179
|
+
: []),
|
|
180
|
+
]);
|
|
181
|
+
return {
|
|
182
|
+
title: `用户旅程: ${corpus.projectName}`,
|
|
183
|
+
generatedAt: new Date().toISOString(),
|
|
184
|
+
projectName: corpus.projectName,
|
|
185
|
+
summary: journeys.length > 0
|
|
186
|
+
? [`基于 ${journeys.length} 条核心场景组织用户旅程,优先引用 current-spec、README 与本地设计文档事实。`]
|
|
187
|
+
: ['仅基于代码与现有规格推断;尚未识别到稳定的用户旅程输入。'],
|
|
188
|
+
journeys,
|
|
189
|
+
warnings,
|
|
190
|
+
confidence: currentSpecConfidence(corpus.currentSpecs.length > 0, journeys.length),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function buildFeatureBriefIndex(corpus, overview, journeys) {
|
|
194
|
+
const briefs = [];
|
|
195
|
+
for (const scenario of journeys.journeys.slice(0, 3)) {
|
|
196
|
+
const id = `BRIEF-${String(briefs.length + 1).padStart(2, '0')}`;
|
|
197
|
+
briefs.push({
|
|
198
|
+
id,
|
|
199
|
+
slug: slugify(scenario.title),
|
|
200
|
+
fileName: briefFileName(id, scenario.title),
|
|
201
|
+
title: scenario.title,
|
|
202
|
+
summary: scenario.goal,
|
|
203
|
+
problem: `${scenario.actor} 需要更直接地完成”${scenario.title}”相关任务,当前缺少独立的功能说明文档。`,
|
|
204
|
+
proposedSolution: `围绕 ${scenario.title} 组织一份产品 brief,把用户目标、路径和预期输出显式化。`,
|
|
205
|
+
audience: scenario.actor,
|
|
206
|
+
status: 'candidate',
|
|
207
|
+
evidence: scenario.evidence,
|
|
208
|
+
confidence: 'medium',
|
|
209
|
+
inferred: true,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
title: `Feature Briefs: ${corpus.projectName}`,
|
|
214
|
+
generatedAt: new Date().toISOString(),
|
|
215
|
+
projectName: corpus.projectName,
|
|
216
|
+
summary: [
|
|
217
|
+
`共组织 ${briefs.length} 份 feature brief,基于 current-spec 与用户旅程派生。`,
|
|
218
|
+
],
|
|
219
|
+
briefs: briefs.slice(0, 5),
|
|
220
|
+
warnings: [...corpus.warnings],
|
|
221
|
+
confidence: currentSpecConfidence(corpus.currentSpecs.length > 0, briefs.length),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function collectCurrentSpecs(projectRoot) {
|
|
225
|
+
const currentSpecs = [];
|
|
226
|
+
const productsDir = path.join(projectRoot, 'specs', 'products');
|
|
227
|
+
if (!fs.existsSync(productsDir)) {
|
|
228
|
+
return currentSpecs;
|
|
229
|
+
}
|
|
230
|
+
for (const entry of fs.readdirSync(productsDir, { withFileTypes: true })) {
|
|
231
|
+
if (!entry.isDirectory()) {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
const filePath = path.join(productsDir, entry.name, 'current-spec.md');
|
|
235
|
+
if (!fs.existsSync(filePath)) {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
const text = fs.readFileSync(filePath, 'utf-8');
|
|
239
|
+
currentSpecs.push({
|
|
240
|
+
sourceType: 'current-spec',
|
|
241
|
+
label: `${entry.name}/current-spec.md`,
|
|
242
|
+
path: normalizeProjectPath(filePath, projectRoot),
|
|
243
|
+
text,
|
|
244
|
+
productId: entry.name,
|
|
245
|
+
sections: parseMarkdownSections(text),
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return currentSpecs.sort((left, right) => left.productId.localeCompare(right.productId));
|
|
249
|
+
}
|
|
250
|
+
function collectReadmes(projectRoot) {
|
|
251
|
+
const readmes = [];
|
|
252
|
+
for (const candidate of ['README.md', 'readme.md']) {
|
|
253
|
+
const filePath = path.join(projectRoot, candidate);
|
|
254
|
+
if (!fs.existsSync(filePath)) {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
readmes.push({
|
|
258
|
+
sourceType: 'readme',
|
|
259
|
+
label: candidate,
|
|
260
|
+
path: normalizeProjectPath(filePath, projectRoot),
|
|
261
|
+
text: fs.readFileSync(filePath, 'utf-8'),
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return readmes;
|
|
265
|
+
}
|
|
266
|
+
function collectLocalDesignDocs(projectRoot) {
|
|
267
|
+
const matches = [];
|
|
268
|
+
walkMarkdownDocs(projectRoot, projectRoot, matches);
|
|
269
|
+
return matches.sort((left, right) => left.path.localeCompare(right.path));
|
|
270
|
+
}
|
|
271
|
+
function walkMarkdownDocs(root, dir, results) {
|
|
272
|
+
if (!fs.existsSync(dir)) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
276
|
+
const fullPath = path.join(dir, entry.name);
|
|
277
|
+
const relative = normalizeProjectPath(fullPath, root);
|
|
278
|
+
if (entry.isDirectory()) {
|
|
279
|
+
if (['node_modules', '.git', 'specs', 'dist', 'coverage', 'bundles'].includes(entry.name)
|
|
280
|
+
|| entry.name.startsWith('.spectra')) {
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
walkMarkdownDocs(root, fullPath, results);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
if (!entry.isFile() || !entry.name.toLowerCase().endsWith('.md')) {
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
const lower = relative.toLowerCase();
|
|
290
|
+
const isRootReadme = lower === 'readme.md';
|
|
291
|
+
const isGeneratedOutput = /(^|\/)\.spectra[^/]*\//i.test(lower)
|
|
292
|
+
|| /(^|\/)docs\/adr\//i.test(lower)
|
|
293
|
+
|| /(^|\/)feature-briefs\//i.test(lower);
|
|
294
|
+
const isDesignLike = /(design|product|roadmap|journey|ux|persona|brief|architecture|arch|notes|overview|guide|system|model|diagram)/i.test(entry.name)
|
|
295
|
+
|| /(^|\/)(design|product|roadmap|journey|ux|persona|brief|architecture|arch|notes|overview|guide|system|model|diagram)s?\//i.test(lower);
|
|
296
|
+
if (!isDesignLike || isRootReadme || isGeneratedOutput) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
results.push({
|
|
300
|
+
sourceType: 'design-doc',
|
|
301
|
+
label: path.basename(fullPath),
|
|
302
|
+
path: relative,
|
|
303
|
+
text: fs.readFileSync(fullPath, 'utf-8'),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function collectRecentCommits(projectRoot, limit) {
|
|
308
|
+
const result = spawnSync('git', ['log', `-${limit}`, '--pretty=format:%H%n%s%n%b%n---END-COMMIT---'], {
|
|
309
|
+
cwd: projectRoot,
|
|
310
|
+
encoding: 'utf-8',
|
|
311
|
+
});
|
|
312
|
+
if (result.status !== 0 || !result.stdout) {
|
|
313
|
+
return [];
|
|
314
|
+
}
|
|
315
|
+
return result.stdout
|
|
316
|
+
.split('\n---END-COMMIT---\n')
|
|
317
|
+
.map((chunk) => chunk.trim())
|
|
318
|
+
.filter((chunk) => chunk.length > 0)
|
|
319
|
+
.map((chunk) => {
|
|
320
|
+
const [sha = '', subject = '', ...bodyLines] = chunk.split('\n');
|
|
321
|
+
return {
|
|
322
|
+
sha: sha.trim(),
|
|
323
|
+
subject: subject.trim(),
|
|
324
|
+
body: bodyLines.join('\n').trim(),
|
|
325
|
+
};
|
|
326
|
+
})
|
|
327
|
+
.filter((entry) => entry.sha.length > 0 && entry.subject.length > 0);
|
|
328
|
+
}
|
|
329
|
+
function collectOverviewParagraphs(corpus) {
|
|
330
|
+
const paragraphs = [];
|
|
331
|
+
for (const spec of corpus.currentSpecs) {
|
|
332
|
+
for (const key of ['产品概述', '概览']) {
|
|
333
|
+
const section = spec.sections.get(key);
|
|
334
|
+
if (!section) {
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
paragraphs.push(...extractParagraphs(section));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
for (const source of [...corpus.readmes, ...corpus.designDocs]) {
|
|
341
|
+
paragraphs.push(...extractParagraphs(source.text).slice(0, 2));
|
|
342
|
+
}
|
|
343
|
+
// 当 current-spec 与 README 均不足时,以近期 commit subject 作为补充事实证据
|
|
344
|
+
if (paragraphs.length < 2 && corpus.commits.length > 0) {
|
|
345
|
+
const commitSummary = corpus.commits
|
|
346
|
+
.slice(0, 5)
|
|
347
|
+
.map((commit) => commit.subject)
|
|
348
|
+
.filter((subject) => subject.length >= 10)
|
|
349
|
+
.join(';');
|
|
350
|
+
if (commitSummary.length >= 20) {
|
|
351
|
+
paragraphs.push(`近期变更摘要(基于 git 提交记录推断):${commitSummary}`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return uniqueSorted(paragraphs.filter((paragraph) => paragraph.length >= 20)).slice(0, 6);
|
|
355
|
+
}
|
|
356
|
+
function buildTargetUsers(corpus) {
|
|
357
|
+
const segments = [];
|
|
358
|
+
for (const spec of corpus.currentSpecs) {
|
|
359
|
+
const userSection = spec.sections.get('用户画像与场景');
|
|
360
|
+
if (!userSection) {
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
const rows = parseFirstMarkdownTable(userSection);
|
|
364
|
+
for (const row of rows) {
|
|
365
|
+
const name = row['角色'] || row['用户'] || row['名称'] || row['persona'] || '';
|
|
366
|
+
const description = row['描述'] || row['说明'] || row['description'] || '';
|
|
367
|
+
const scenarios = splitScenarioText(row['主要使用场景'] || row['场景'] || row['scenario'] || '');
|
|
368
|
+
if (!name.trim()) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
segments.push({
|
|
372
|
+
name: name.trim(),
|
|
373
|
+
description: description.trim() || `${name.trim()} 是该产品的关键使用者。`,
|
|
374
|
+
primaryScenarios: scenarios,
|
|
375
|
+
evidence: [{
|
|
376
|
+
sourceType: 'current-spec',
|
|
377
|
+
label: spec.label,
|
|
378
|
+
path: spec.path,
|
|
379
|
+
excerpt: `${name} | ${description} | ${scenarios.join(' / ')}`,
|
|
380
|
+
confidence: 'high',
|
|
381
|
+
inferred: false,
|
|
382
|
+
}],
|
|
383
|
+
confidence: 'high',
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (segments.length > 0) {
|
|
388
|
+
return dedupeSegments(segments);
|
|
389
|
+
}
|
|
390
|
+
const readmeParagraph = corpus.readmes
|
|
391
|
+
.flatMap((source) => extractParagraphs(source.text))
|
|
392
|
+
.find((para) => isDescriptiveParagraph(para));
|
|
393
|
+
if (!readmeParagraph) {
|
|
394
|
+
return [];
|
|
395
|
+
}
|
|
396
|
+
return [{
|
|
397
|
+
name: '开发者',
|
|
398
|
+
description: firstSentence(readmeParagraph) ?? readmeParagraph,
|
|
399
|
+
primaryScenarios: ['阅读文档、生成规格、理解系统行为'],
|
|
400
|
+
evidence: [{
|
|
401
|
+
sourceType: 'readme',
|
|
402
|
+
label: corpus.readmes[0].label,
|
|
403
|
+
path: corpus.readmes[0].path,
|
|
404
|
+
excerpt: readmeParagraph,
|
|
405
|
+
confidence: 'medium',
|
|
406
|
+
inferred: true,
|
|
407
|
+
}],
|
|
408
|
+
confidence: 'medium',
|
|
409
|
+
}];
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* 判断一段文字是否是有意义的描述性段落(非标题、非导航链接)。
|
|
413
|
+
* Feature 125: 委托给 Unicode 感知的 isDescriptiveText,按字符数判断链接密度,
|
|
414
|
+
* 避免按 ASCII 空格分词导致中文段落被误过滤。
|
|
415
|
+
*/
|
|
416
|
+
function isDescriptiveParagraph(text) {
|
|
417
|
+
return isDescriptiveText(text, { minLength: 30, linkThreshold: 0.5 });
|
|
418
|
+
}
|
|
419
|
+
function buildCoreScenarios(corpus, targetUsers) {
|
|
420
|
+
const scenarios = [];
|
|
421
|
+
for (const spec of corpus.currentSpecs) {
|
|
422
|
+
const userSection = spec.sections.get('用户画像与场景');
|
|
423
|
+
if (!userSection) {
|
|
424
|
+
continue;
|
|
425
|
+
}
|
|
426
|
+
const items = extractListItems(userSection);
|
|
427
|
+
for (const item of items) {
|
|
428
|
+
const [titlePart, ...restParts] = item.split(/[::]/);
|
|
429
|
+
const title = titlePart?.trim() || item;
|
|
430
|
+
const summary = restParts.join(':').trim() || item;
|
|
431
|
+
const actors = inferActors(title + summary, targetUsers);
|
|
432
|
+
scenarios.push({
|
|
433
|
+
id: `scenario-${scenarios.length + 1}`,
|
|
434
|
+
title,
|
|
435
|
+
summary,
|
|
436
|
+
actors,
|
|
437
|
+
evidence: [{
|
|
438
|
+
sourceType: 'current-spec',
|
|
439
|
+
label: spec.label,
|
|
440
|
+
path: spec.path,
|
|
441
|
+
excerpt: item,
|
|
442
|
+
confidence: 'high',
|
|
443
|
+
inferred: false,
|
|
444
|
+
}],
|
|
445
|
+
confidence: 'high',
|
|
446
|
+
inferred: false,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// README Usage/Features 节 fallback
|
|
451
|
+
if (scenarios.length === 0) {
|
|
452
|
+
scenarios.push(...extractScenariosFromReadme(corpus, targetUsers));
|
|
453
|
+
}
|
|
454
|
+
// Phase 3:从 README Features/How it works 等标题下提取叙述段落场景
|
|
455
|
+
if (scenarios.length === 0) {
|
|
456
|
+
for (const readme of corpus.readmes) {
|
|
457
|
+
scenarios.push(...extractScenariosFromReadme(readme, targetUsers));
|
|
458
|
+
if (scenarios.length >= 3)
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return dedupeScenarios(scenarios).slice(0, 6);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* 从 README 提取场景:
|
|
466
|
+
* 1. corpus 模式优先读取 Features / Usage 等章节列表项
|
|
467
|
+
* 2. 单文档模式回退到叙述型标题段落与段落文本
|
|
468
|
+
*/
|
|
469
|
+
function extractScenariosFromReadme(source, targetUsers) {
|
|
470
|
+
if ('currentSpecs' in source) {
|
|
471
|
+
return extractScenariosFromReadmeCorpus(source, targetUsers);
|
|
472
|
+
}
|
|
473
|
+
return extractScenariosFromReadmeDocument(source, targetUsers);
|
|
474
|
+
}
|
|
475
|
+
function extractScenariosFromReadmeCorpus(corpus, targetUsers) {
|
|
476
|
+
const scenarios = [];
|
|
477
|
+
const sectionKeySet = new Set([
|
|
478
|
+
'usage', 'features', 'getting started', 'quick start', 'overview',
|
|
479
|
+
'使用', '使用方法', '功能', '快速开始', '特性',
|
|
480
|
+
]);
|
|
481
|
+
for (const readme of corpus.readmes) {
|
|
482
|
+
const sections = parseMarkdownSections(readme.text);
|
|
483
|
+
for (const [rawKey, section] of sections) {
|
|
484
|
+
if (!sectionKeySet.has(rawKey.toLowerCase()))
|
|
485
|
+
continue;
|
|
486
|
+
const items = extractListItems(section);
|
|
487
|
+
for (const item of items.slice(0, 4)) {
|
|
488
|
+
if (item.length < 10)
|
|
489
|
+
continue;
|
|
490
|
+
const [titlePart, ...restParts] = item.split(/[::]/);
|
|
491
|
+
const title = titlePart?.trim() || item;
|
|
492
|
+
const summary = restParts.join(':').trim() || item;
|
|
493
|
+
scenarios.push({
|
|
494
|
+
id: `scenario-${scenarios.length + 1}`,
|
|
495
|
+
title: truncateAtNaturalBoundary(title, 80),
|
|
496
|
+
summary: truncateAtNaturalBoundary(summary || title, 200),
|
|
497
|
+
actors: [inferAudience(title, targetUsers) ?? targetUsers[0]?.name ?? '开发者'],
|
|
498
|
+
evidence: [{
|
|
499
|
+
sourceType: 'readme',
|
|
500
|
+
label: readme.label,
|
|
501
|
+
path: readme.path,
|
|
502
|
+
excerpt: item,
|
|
503
|
+
confidence: 'medium',
|
|
504
|
+
inferred: true,
|
|
505
|
+
}],
|
|
506
|
+
confidence: 'medium',
|
|
507
|
+
inferred: true,
|
|
508
|
+
});
|
|
509
|
+
if (scenarios.length >= 4)
|
|
510
|
+
return scenarios;
|
|
511
|
+
}
|
|
512
|
+
if (scenarios.length >= 4)
|
|
513
|
+
return scenarios;
|
|
514
|
+
}
|
|
515
|
+
if (scenarios.length >= 4)
|
|
516
|
+
return scenarios;
|
|
517
|
+
}
|
|
518
|
+
return scenarios;
|
|
519
|
+
}
|
|
520
|
+
function extractScenariosFromReadmeDocument(readme, targetUsers) {
|
|
521
|
+
const FEATURE_HEADING = /^(Features?|How\s+it\s+works?|What\s+(?:it\s+)?does|Capabilities|Use\s+cases?|Getting\s+started|Overview|About)\s*$/i;
|
|
522
|
+
const scenarios = [];
|
|
523
|
+
const lines = readme.text.split('\n');
|
|
524
|
+
let inSection = false;
|
|
525
|
+
let sectionLines = [];
|
|
526
|
+
const sections = [];
|
|
527
|
+
for (const line of lines) {
|
|
528
|
+
const headingMatch = /^#{1,3}\s+(.+)$/.exec(line);
|
|
529
|
+
if (headingMatch) {
|
|
530
|
+
if (inSection && sectionLines.length > 0) {
|
|
531
|
+
sections.push(sectionLines.join('\n'));
|
|
532
|
+
}
|
|
533
|
+
inSection = FEATURE_HEADING.test(headingMatch[1]?.trim() ?? '');
|
|
534
|
+
sectionLines = [];
|
|
535
|
+
}
|
|
536
|
+
else if (inSection) {
|
|
537
|
+
sectionLines.push(line);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
if (inSection && sectionLines.length > 0) {
|
|
541
|
+
sections.push(sectionLines.join('\n'));
|
|
542
|
+
}
|
|
543
|
+
for (const section of sections) {
|
|
544
|
+
const items = extractListItems(section);
|
|
545
|
+
if (items.length > 0) {
|
|
546
|
+
for (const item of items.slice(0, 4)) {
|
|
547
|
+
const colonIdx = item.search(/[::]/);
|
|
548
|
+
const title = colonIdx > 0 ? item.slice(0, colonIdx).trim() : item;
|
|
549
|
+
const summary = colonIdx > 0 ? item.slice(colonIdx + 1).trim() : item;
|
|
550
|
+
scenarios.push({
|
|
551
|
+
id: `scenario-${scenarios.length + 1}`,
|
|
552
|
+
title,
|
|
553
|
+
summary: summary || title,
|
|
554
|
+
actors: inferActors(title + summary, targetUsers),
|
|
555
|
+
evidence: [{
|
|
556
|
+
sourceType: 'readme',
|
|
557
|
+
label: readme.label,
|
|
558
|
+
path: readme.path,
|
|
559
|
+
excerpt: item,
|
|
560
|
+
confidence: 'medium',
|
|
561
|
+
inferred: true,
|
|
562
|
+
}],
|
|
563
|
+
confidence: 'medium',
|
|
564
|
+
inferred: true,
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
// 无列表时从段落提取
|
|
570
|
+
for (const para of extractParagraphs(section).slice(0, 2)) {
|
|
571
|
+
const title = firstSentence(para) ?? truncateAtNaturalBoundary(para, 60);
|
|
572
|
+
scenarios.push({
|
|
573
|
+
id: `scenario-${scenarios.length + 1}`,
|
|
574
|
+
title,
|
|
575
|
+
summary: para,
|
|
576
|
+
actors: inferActors(para, targetUsers),
|
|
577
|
+
evidence: [{
|
|
578
|
+
sourceType: 'readme',
|
|
579
|
+
label: readme.label,
|
|
580
|
+
path: readme.path,
|
|
581
|
+
excerpt: para,
|
|
582
|
+
confidence: 'low',
|
|
583
|
+
inferred: true,
|
|
584
|
+
}],
|
|
585
|
+
confidence: 'low',
|
|
586
|
+
inferred: true,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (scenarios.length >= 3)
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
return scenarios;
|
|
594
|
+
}
|
|
595
|
+
function parseMarkdownSections(markdown) {
|
|
596
|
+
const sections = new Map();
|
|
597
|
+
const matches = [...markdown.matchAll(/^##\s+(.+)$/gm)];
|
|
598
|
+
for (let index = 0; index < matches.length; index += 1) {
|
|
599
|
+
const current = matches[index];
|
|
600
|
+
const next = matches[index + 1];
|
|
601
|
+
if (current?.index == null) {
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
const rawHeading = current[1]?.trim() ?? '';
|
|
605
|
+
const start = current.index + current[0].length;
|
|
606
|
+
const end = next?.index ?? markdown.length;
|
|
607
|
+
const content = markdown.slice(start, end).trim();
|
|
608
|
+
const normalized = normalizeHeading(rawHeading);
|
|
609
|
+
if (normalized) {
|
|
610
|
+
sections.set(normalized, content);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return sections;
|
|
614
|
+
}
|
|
615
|
+
function normalizeHeading(heading) {
|
|
616
|
+
return heading
|
|
617
|
+
.replace(/^[0-9]+\.\s*/, '')
|
|
618
|
+
.replace(/^[一二三四五六七八九十]+\.\s*/, '')
|
|
619
|
+
.replace(/[::]\s*$/, '')
|
|
620
|
+
.trim();
|
|
621
|
+
}
|
|
622
|
+
function parseFirstMarkdownTable(content) {
|
|
623
|
+
const lines = content
|
|
624
|
+
.split('\n')
|
|
625
|
+
.map((line) => line.trim())
|
|
626
|
+
.filter((line) => line.startsWith('|'));
|
|
627
|
+
if (lines.length < 3) {
|
|
628
|
+
return [];
|
|
629
|
+
}
|
|
630
|
+
const header = splitMarkdownTableLine(lines[0]);
|
|
631
|
+
const divider = lines[1];
|
|
632
|
+
if (!divider.includes('---')) {
|
|
633
|
+
return [];
|
|
634
|
+
}
|
|
635
|
+
return lines.slice(2).map((line) => {
|
|
636
|
+
const values = splitMarkdownTableLine(line);
|
|
637
|
+
const row = {};
|
|
638
|
+
for (let index = 0; index < header.length; index += 1) {
|
|
639
|
+
row[header[index] ?? `col-${index}`] = values[index] ?? '';
|
|
640
|
+
}
|
|
641
|
+
return row;
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
function splitMarkdownTableLine(line) {
|
|
645
|
+
return line
|
|
646
|
+
.split('|')
|
|
647
|
+
.map((segment) => segment.trim())
|
|
648
|
+
.filter((segment) => segment.length > 0);
|
|
649
|
+
}
|
|
650
|
+
function extractListItems(content) {
|
|
651
|
+
return [...content.matchAll(/^(?:[-*]|\d+\.)\s+(.+)$/gm)]
|
|
652
|
+
.map((match) => match[1]?.trim() ?? '')
|
|
653
|
+
.filter((item) => item.length > 0);
|
|
654
|
+
}
|
|
655
|
+
function extractParagraphs(content) {
|
|
656
|
+
// 先做 block-level HTML 净化(保留行内尖括号如 Array<T>、<target>)
|
|
657
|
+
// 再 decode entity(< → <),然后按段落切分
|
|
658
|
+
const sanitized = sanitizeMarkdownContent(content);
|
|
659
|
+
return sanitized
|
|
660
|
+
.split(/\n\s*\n/g)
|
|
661
|
+
.map((paragraph) => paragraph.replace(/\n+/g, ' ').trim())
|
|
662
|
+
.filter((paragraph) => paragraph.length >= 20
|
|
663
|
+
&& !paragraph.startsWith('|')
|
|
664
|
+
&& !paragraph.startsWith('##')
|
|
665
|
+
&& !paragraph.startsWith('```')
|
|
666
|
+
&& !isBadgeLine(paragraph)
|
|
667
|
+
&& !isPureLinkLine(paragraph));
|
|
668
|
+
}
|
|
669
|
+
/** 是否为纯徽章行(仅含  或 [](url2) 无其他文字) */
|
|
670
|
+
function isBadgeLine(text) {
|
|
671
|
+
// 先移除图片  再移除剩余链接壳 [...](...) ,判断是否为空
|
|
672
|
+
const withoutImages = text.replace(/!\[[^\]]*\]\([^)]+\)/g, '');
|
|
673
|
+
const withoutAll = withoutImages.replace(/\[[^\]]*\]\([^)]+\)/g, '').trim();
|
|
674
|
+
return withoutAll.length === 0 && text.includes(' 无其他文字) */
|
|
677
|
+
function isPureLinkLine(text) {
|
|
678
|
+
const withoutLinks = text.replace(/\[[^\]]*\]\([^)]+\)/g, '').trim();
|
|
679
|
+
return withoutLinks.length === 0 && text.includes('](');
|
|
680
|
+
}
|
|
681
|
+
function splitScenarioText(value) {
|
|
682
|
+
return value
|
|
683
|
+
.split(/[、,,/]/)
|
|
684
|
+
.map((item) => item.trim())
|
|
685
|
+
.filter((item) => item.length > 0);
|
|
686
|
+
}
|
|
687
|
+
function inferActors(text, users) {
|
|
688
|
+
const matched = users
|
|
689
|
+
.filter((user) => text.includes(user.name) || user.primaryScenarios.some((scenario) => text.includes(scenario)))
|
|
690
|
+
.map((user) => user.name);
|
|
691
|
+
if (matched.length > 0) {
|
|
692
|
+
return uniqueSorted(matched);
|
|
693
|
+
}
|
|
694
|
+
return users[0] ? [users[0].name] : [];
|
|
695
|
+
}
|
|
696
|
+
function inferAudience(title, users) {
|
|
697
|
+
return inferActors(title, users)[0];
|
|
698
|
+
}
|
|
699
|
+
function dedupeSegments(segments) {
|
|
700
|
+
const byName = new Map();
|
|
701
|
+
for (const segment of segments) {
|
|
702
|
+
const existing = byName.get(segment.name);
|
|
703
|
+
if (!existing) {
|
|
704
|
+
byName.set(segment.name, segment);
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
existing.description = existing.description.length >= segment.description.length
|
|
708
|
+
? existing.description
|
|
709
|
+
: segment.description;
|
|
710
|
+
existing.primaryScenarios = uniqueSorted([...existing.primaryScenarios, ...segment.primaryScenarios]);
|
|
711
|
+
existing.evidence = uniqueEvidence([...existing.evidence, ...segment.evidence]);
|
|
712
|
+
}
|
|
713
|
+
return [...byName.values()];
|
|
714
|
+
}
|
|
715
|
+
function dedupeScenarios(scenarios) {
|
|
716
|
+
const byTitle = new Map();
|
|
717
|
+
for (const scenario of scenarios) {
|
|
718
|
+
const key = scenario.title.toLowerCase();
|
|
719
|
+
const existing = byTitle.get(key);
|
|
720
|
+
if (!existing) {
|
|
721
|
+
byTitle.set(key, scenario);
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
existing.summary = existing.summary.length >= scenario.summary.length ? existing.summary : scenario.summary;
|
|
725
|
+
existing.actors = uniqueSorted([...existing.actors, ...scenario.actors]);
|
|
726
|
+
existing.evidence = uniqueEvidence([...existing.evidence, ...scenario.evidence]);
|
|
727
|
+
}
|
|
728
|
+
return [...byTitle.values()];
|
|
729
|
+
}
|
|
730
|
+
function collectEvidenceFromSources(sources, confidence) {
|
|
731
|
+
return sources.slice(0, 3).map((source) => ({
|
|
732
|
+
sourceType: source.sourceType,
|
|
733
|
+
label: source.label,
|
|
734
|
+
path: source.path,
|
|
735
|
+
excerpt: extractParagraphs(source.text)[0] ?? source.text.slice(0, 160).trim(),
|
|
736
|
+
confidence,
|
|
737
|
+
inferred: false,
|
|
738
|
+
}));
|
|
739
|
+
}
|
|
740
|
+
function currentSpecConfidence(hasCurrentSpec, signalCount) {
|
|
741
|
+
if (hasCurrentSpec && signalCount >= 2) {
|
|
742
|
+
return 'high';
|
|
743
|
+
}
|
|
744
|
+
if (signalCount > 0) {
|
|
745
|
+
return 'medium';
|
|
746
|
+
}
|
|
747
|
+
return 'low';
|
|
748
|
+
}
|
|
749
|
+
function resolveProjectName(projectRoot, currentSpecs, readmes) {
|
|
750
|
+
const currentSpecTitle = currentSpecs[0]?.text.match(/^#\s+(.+)$/m)?.[1]?.trim();
|
|
751
|
+
if (currentSpecTitle) {
|
|
752
|
+
return currentSpecTitle.replace(/^[^—-]+[—-]\s*/, '').replace(/^产品规范活文档[::]?\s*/, '').trim();
|
|
753
|
+
}
|
|
754
|
+
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
755
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
756
|
+
try {
|
|
757
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
758
|
+
if (pkg.name?.trim()) {
|
|
759
|
+
return pkg.name.trim();
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
catch (err) {
|
|
763
|
+
logger.debug(`package.json 读取失败,尝试从 README 获取项目名称: ${String(err)}`);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
const readmeTitle = readmes[0]?.text.match(/^#\s+(.+)$/m)?.[1]?.trim();
|
|
767
|
+
if (readmeTitle) {
|
|
768
|
+
return readmeTitle;
|
|
769
|
+
}
|
|
770
|
+
return path.basename(projectRoot);
|
|
771
|
+
}
|
|
772
|
+
function firstMeaningfulSentence(text) {
|
|
773
|
+
const normalized = text.replace(/\s+/g, ' ').trim();
|
|
774
|
+
if (!normalized) {
|
|
775
|
+
return undefined;
|
|
776
|
+
}
|
|
777
|
+
const sentence = normalized.split(/(?<=[。.!?])\s+/)[0]?.trim();
|
|
778
|
+
return sentence && sentence.length > 0 ? sentence : normalized;
|
|
779
|
+
}
|
|
780
|
+
function firstSentence(text) {
|
|
781
|
+
return firstMeaningfulSentence(text);
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* 提取 scenario 中"最后一句话",作为"消费输出"/"outcome"的描述。
|
|
785
|
+
* 最后一句通常承载结果语义(如 "...returns a result"、"...得到 XXX")。
|
|
786
|
+
* 若无明显句子分隔符,返回整段文字的 trim。
|
|
787
|
+
*
|
|
788
|
+
* 规则:
|
|
789
|
+
* - 英文句尾 `.?!` 必须后跟 `\s+`(空格)才计为句子边界,
|
|
790
|
+
* 避免把 "e.g" / "i.e" / "2.1" 等缩写/版本号误拆
|
|
791
|
+
* - 中文全角标点 `。!?` 不强制空格(中文无空格习惯)
|
|
792
|
+
*/
|
|
793
|
+
function lastMeaningfulSentence(text) {
|
|
794
|
+
const normalized = text.replace(/\s+/g, ' ').trim();
|
|
795
|
+
if (!normalized)
|
|
796
|
+
return undefined;
|
|
797
|
+
const sentences = normalized
|
|
798
|
+
.split(/(?<=[。!?])|(?<=[.?!])\s+/)
|
|
799
|
+
.filter((s) => s.trim().length > 0);
|
|
800
|
+
if (sentences.length === 0)
|
|
801
|
+
return undefined;
|
|
802
|
+
return sentences[sentences.length - 1].trim();
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Feature 125 Story 1: 从 scenario 的事实字段(summary / evidence)推导"消费输出"描述。
|
|
806
|
+
* 这是 evidence-backed mapping,替代 Fix 124 的关键词桶分类。
|
|
807
|
+
*
|
|
808
|
+
* 优先级:
|
|
809
|
+
* 1. scenario.summary 的最后一句(承载结果语义)— 前提长度 ≥ 10
|
|
810
|
+
* 2. scenario.evidence[0].excerpt 的最后一句
|
|
811
|
+
* 3. scenario.title 的最后一句
|
|
812
|
+
* 4. 兜底 fallback(只在完全无事实时使用)
|
|
813
|
+
*/
|
|
814
|
+
function deriveConsumptionFromScenario(scenario) {
|
|
815
|
+
// 优先从 summary 取最后一句
|
|
816
|
+
if (scenario.summary && scenario.summary.length >= 10) {
|
|
817
|
+
const last = lastMeaningfulSentence(scenario.summary);
|
|
818
|
+
if (last && last.length >= 10) {
|
|
819
|
+
return truncateAtNaturalBoundary(last, 140);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
// 次选:evidence excerpt 的最后一句
|
|
823
|
+
const evidenceExcerpt = scenario.evidence?.[0]?.excerpt;
|
|
824
|
+
if (evidenceExcerpt && evidenceExcerpt.length >= 10) {
|
|
825
|
+
const last = lastMeaningfulSentence(evidenceExcerpt);
|
|
826
|
+
if (last && last.length >= 10 && last !== scenario.title) {
|
|
827
|
+
return truncateAtNaturalBoundary(last, 140);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
// 再次:title 本身作为"消费输出"的粗略描述
|
|
831
|
+
if (scenario.title && scenario.title.length >= 10) {
|
|
832
|
+
return truncateAtNaturalBoundary(scenario.title, 140);
|
|
833
|
+
}
|
|
834
|
+
// 兜底 fallback(低置信度通用句子,仅完全无事实时触发)
|
|
835
|
+
return '查看场景输出,继续后续工作流程。';
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Feature 125 Story 1: 从 scenario 的 summary/title 推导"触发场景"描述。
|
|
839
|
+
* 优先用 summary 的首句(承载动机/入口),避免直接复述 title 造成三步同文。
|
|
840
|
+
*/
|
|
841
|
+
function deriveTriggerFromScenario(scenario, actor) {
|
|
842
|
+
// summary 首句(承载动机)
|
|
843
|
+
if (scenario.summary && scenario.summary.length >= 10) {
|
|
844
|
+
const first = firstMeaningfulSentence(scenario.summary);
|
|
845
|
+
// 避免和 title 完全一致(会和第二步"执行关键动作"重复)
|
|
846
|
+
if (first && first !== scenario.title && first.length >= 10) {
|
|
847
|
+
return `${actor} 开始:${truncateAtNaturalBoundary(first, 120)}`;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
// 兜底:用 title
|
|
851
|
+
return `${actor} 需要:${truncateAtNaturalBoundary(scenario.title, 120)}`;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Feature 125 Story 1: 基于 scenario 生成 outcome(场景完成后的状态)。
|
|
855
|
+
* 用 actor + scenario summary/title 合成,保留场景完成后的结果语义。
|
|
856
|
+
*/
|
|
857
|
+
function deriveOutcomeFromScenario(scenario, actor) {
|
|
858
|
+
// outcome = 消费输出 + 推进语,避免和步骤 detail 完全相同
|
|
859
|
+
const consumption = deriveConsumptionFromScenario(scenario);
|
|
860
|
+
return `${actor} 完成场景后:${consumption}`;
|
|
861
|
+
}
|
|
862
|
+
function slugify(value) {
|
|
863
|
+
const slug = value
|
|
864
|
+
.toLowerCase()
|
|
865
|
+
.replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
|
|
866
|
+
.replace(/^-+|-+$/g, '')
|
|
867
|
+
.replace(/-+/g, '-');
|
|
868
|
+
return slug || 'untitled';
|
|
869
|
+
}
|
|
870
|
+
function briefFileName(id, title) {
|
|
871
|
+
return `${id.toLowerCase()}-${slugify(title)}`;
|
|
872
|
+
}
|
|
873
|
+
function normalizeProjectPath(filePath, projectRoot) {
|
|
874
|
+
return path.relative(projectRoot, filePath).split(path.sep).join('/');
|
|
875
|
+
}
|
|
876
|
+
function uniqueSorted(values) {
|
|
877
|
+
return [...new Set(values.filter((value) => value.trim().length > 0))].sort((left, right) => left.localeCompare(right, 'zh-Hans-CN'));
|
|
878
|
+
}
|
|
879
|
+
function uniqueEvidence(entries) {
|
|
880
|
+
const seen = new Set();
|
|
881
|
+
const deduped = [];
|
|
882
|
+
for (const entry of entries) {
|
|
883
|
+
const key = [
|
|
884
|
+
entry.sourceType,
|
|
885
|
+
entry.label,
|
|
886
|
+
entry.path ?? '',
|
|
887
|
+
entry.ref ?? '',
|
|
888
|
+
entry.excerpt,
|
|
889
|
+
].join('|');
|
|
890
|
+
if (seen.has(key)) {
|
|
891
|
+
continue;
|
|
892
|
+
}
|
|
893
|
+
seen.add(key);
|
|
894
|
+
deduped.push(entry);
|
|
895
|
+
}
|
|
896
|
+
return deduped;
|
|
897
|
+
}
|
|
898
|
+
// ============================================================
|
|
899
|
+
// DocumentGenerator Adapter
|
|
900
|
+
// ============================================================
|
|
901
|
+
/**
|
|
902
|
+
* ProductUxDocsGenerator
|
|
903
|
+
*
|
|
904
|
+
* 将 generateProductUxDocs() 适配为 DocumentGenerator 接口。
|
|
905
|
+
* generate() 包含 fs 文件写出副作用(写出产品概览、用户旅程、feature brief)。
|
|
906
|
+
* render() 为纯摘要,不含 fs 调用。
|
|
907
|
+
*
|
|
908
|
+
* TInput: GenerateProductUxDocsOptions
|
|
909
|
+
* TOutput: GenerateProductUxDocsResult
|
|
910
|
+
*/
|
|
911
|
+
export class ProductUxDocsGenerator {
|
|
912
|
+
id = 'product-ux-docs';
|
|
913
|
+
name = '产品 UX 文档生成器';
|
|
914
|
+
description = '基于 current-spec、README 与本地设计文档生成产品概览、用户旅程与 feature brief 文档';
|
|
915
|
+
outputDir;
|
|
916
|
+
constructor(outputDir) {
|
|
917
|
+
this.outputDir = outputDir;
|
|
918
|
+
}
|
|
919
|
+
isApplicable(context) {
|
|
920
|
+
// 只要项目根目录存在即可适用
|
|
921
|
+
return Boolean(context.projectRoot);
|
|
922
|
+
}
|
|
923
|
+
async extract(context) {
|
|
924
|
+
return {
|
|
925
|
+
projectRoot: context.projectRoot,
|
|
926
|
+
outputDir: this.outputDir,
|
|
927
|
+
projectContext: context,
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
async generate(input, _options) {
|
|
931
|
+
// generate() 包含 fs 写出副作用
|
|
932
|
+
return generateProductUxDocs(input);
|
|
933
|
+
}
|
|
934
|
+
render(output) {
|
|
935
|
+
// render() 为纯摘要,无 fs 调用
|
|
936
|
+
const lines = [
|
|
937
|
+
`# 产品文档生成摘要`,
|
|
938
|
+
'',
|
|
939
|
+
`**产品概览**: ${output.overview.title}`,
|
|
940
|
+
`**用户旅程**: ${output.journeys.journeys.length} 条`,
|
|
941
|
+
`**Feature Brief**: ${output.featureBriefIndex.briefs.length} 个`,
|
|
942
|
+
'',
|
|
943
|
+
];
|
|
944
|
+
if (output.writtenFiles.length > 0) {
|
|
945
|
+
lines.push('**写出文件**:');
|
|
946
|
+
for (const file of output.writtenFiles) {
|
|
947
|
+
lines.push(`- ${file}`);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
if (output.warnings.length > 0) {
|
|
951
|
+
lines.push('', '**警告**:');
|
|
952
|
+
for (const warning of output.warnings) {
|
|
953
|
+
lines.push(`- ${warning}`);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return lines.join('\n');
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
//# sourceMappingURL=product-ux-docs.js.map
|