spectra-cli 4.1.1 → 4.2.0
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/README.md +1 -1
- package/dist/adapters/go-adapter.d.ts.map +1 -1
- package/dist/adapters/go-adapter.js +2 -0
- package/dist/adapters/go-adapter.js.map +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/java-adapter.d.ts.map +1 -1
- package/dist/adapters/java-adapter.js +2 -0
- package/dist/adapters/java-adapter.js.map +1 -1
- package/dist/adapters/language-adapter.d.ts +47 -9
- package/dist/adapters/language-adapter.d.ts.map +1 -1
- package/dist/adapters/python-adapter.d.ts +34 -6
- package/dist/adapters/python-adapter.d.ts.map +1 -1
- package/dist/adapters/python-adapter.js +157 -59
- package/dist/adapters/python-adapter.js.map +1 -1
- package/dist/adapters/ts-js-adapter.d.ts +13 -5
- package/dist/adapters/ts-js-adapter.d.ts.map +1 -1
- package/dist/adapters/ts-js-adapter.js +55 -14
- package/dist/adapters/ts-js-adapter.js.map +1 -1
- package/dist/batch/batch-orchestrator.d.ts +30 -4
- package/dist/batch/batch-orchestrator.d.ts.map +1 -1
- package/dist/batch/batch-orchestrator.js +284 -7
- package/dist/batch/batch-orchestrator.js.map +1 -1
- package/dist/batch/delta-regenerator.d.ts +2 -2
- package/dist/batch/delta-regenerator.d.ts.map +1 -1
- package/dist/batch/delta-regenerator.js.map +1 -1
- package/dist/batch/module-grouper.d.ts +2 -2
- package/dist/batch/module-grouper.d.ts.map +1 -1
- package/dist/batch/module-grouper.js +1 -1
- package/dist/batch/module-grouper.js.map +1 -1
- package/dist/cli/commands/graph.js +1 -1
- package/dist/cli/commands/graph.js.map +1 -1
- package/dist/cli/commands/index.d.ts +8 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +274 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/query.d.ts.map +1 -1
- package/dist/cli/commands/query.js +3 -1
- package/dist/cli/commands/query.js.map +1 -1
- package/dist/cli/index.js +9 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/parse-args.d.ts +13 -1
- package/dist/cli/utils/parse-args.d.ts.map +1 -1
- package/dist/cli/utils/parse-args.js +79 -2
- package/dist/cli/utils/parse-args.js.map +1 -1
- package/dist/core/ast-analyzer.d.ts.map +1 -1
- package/dist/core/ast-analyzer.js +79 -5
- package/dist/core/ast-analyzer.js.map +1 -1
- package/dist/core/import-resolver.d.ts +90 -0
- package/dist/core/import-resolver.d.ts.map +1 -0
- package/dist/core/import-resolver.js +273 -0
- package/dist/core/import-resolver.js.map +1 -0
- package/dist/core/query-mappers/base-mapper.d.ts +13 -0
- package/dist/core/query-mappers/base-mapper.d.ts.map +1 -1
- package/dist/core/query-mappers/go-mapper.d.ts +68 -0
- package/dist/core/query-mappers/go-mapper.d.ts.map +1 -1
- package/dist/core/query-mappers/go-mapper.js +421 -0
- package/dist/core/query-mappers/go-mapper.js.map +1 -1
- package/dist/core/query-mappers/java-mapper.d.ts +196 -0
- package/dist/core/query-mappers/java-mapper.d.ts.map +1 -1
- package/dist/core/query-mappers/java-mapper.js +600 -0
- package/dist/core/query-mappers/java-mapper.js.map +1 -1
- package/dist/core/query-mappers/python-mapper.d.ts +55 -0
- package/dist/core/query-mappers/python-mapper.d.ts.map +1 -1
- package/dist/core/query-mappers/python-mapper.js +273 -0
- package/dist/core/query-mappers/python-mapper.js.map +1 -1
- package/dist/core/query-mappers/typescript-mapper.d.ts +102 -0
- package/dist/core/query-mappers/typescript-mapper.d.ts.map +1 -1
- package/dist/core/query-mappers/typescript-mapper.js +470 -0
- package/dist/core/query-mappers/typescript-mapper.js.map +1 -1
- package/dist/core/single-spec-orchestrator.d.ts.map +1 -1
- package/dist/core/single-spec-orchestrator.js +146 -9
- package/dist/core/single-spec-orchestrator.js.map +1 -1
- package/dist/core/tree-sitter-analyzer.d.ts +6 -0
- package/dist/core/tree-sitter-analyzer.d.ts.map +1 -1
- package/dist/core/tree-sitter-analyzer.js +33 -1
- package/dist/core/tree-sitter-analyzer.js.map +1 -1
- package/dist/core/tree-sitter-fallback.d.ts +7 -4
- package/dist/core/tree-sitter-fallback.d.ts.map +1 -1
- package/dist/core/tree-sitter-fallback.js +157 -12
- package/dist/core/tree-sitter-fallback.js.map +1 -1
- package/dist/extraction/extraction-types.d.ts +25 -25
- package/dist/generator/index-generator.d.ts +3 -3
- package/dist/generator/index-generator.d.ts.map +1 -1
- package/dist/generator/index-generator.js +1 -1
- package/dist/generator/index-generator.js.map +1 -1
- package/dist/graph/directory-graph.d.ts +14 -4
- package/dist/graph/directory-graph.d.ts.map +1 -1
- package/dist/graph/directory-graph.js +71 -128
- package/dist/graph/directory-graph.js.map +1 -1
- package/dist/graph/mermaid-renderer.d.ts +8 -5
- package/dist/graph/mermaid-renderer.d.ts.map +1 -1
- package/dist/graph/mermaid-renderer.js +3 -3
- package/dist/graph/mermaid-renderer.js.map +1 -1
- package/dist/graph/topological-sort.d.ts +13 -6
- package/dist/graph/topological-sort.d.ts.map +1 -1
- package/dist/graph/topological-sort.js +2 -2
- package/dist/graph/topological-sort.js.map +1 -1
- package/dist/knowledge-graph/call-resolver.d.ts +64 -0
- package/dist/knowledge-graph/call-resolver.d.ts.map +1 -0
- package/dist/knowledge-graph/call-resolver.js +323 -0
- package/dist/knowledge-graph/call-resolver.js.map +1 -0
- package/dist/knowledge-graph/import-resolver.d.ts +114 -0
- package/dist/knowledge-graph/import-resolver.d.ts.map +1 -0
- package/dist/knowledge-graph/import-resolver.js +537 -0
- package/dist/knowledge-graph/import-resolver.js.map +1 -0
- package/dist/knowledge-graph/incremental.d.ts +110 -0
- package/dist/knowledge-graph/incremental.d.ts.map +1 -0
- package/dist/knowledge-graph/incremental.js +410 -0
- package/dist/knowledge-graph/incremental.js.map +1 -0
- package/dist/knowledge-graph/index.d.ts +74 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -0
- package/dist/knowledge-graph/index.js +156 -0
- package/dist/knowledge-graph/index.js.map +1 -0
- package/dist/knowledge-graph/module-derivation.d.ts +238 -0
- package/dist/knowledge-graph/module-derivation.d.ts.map +1 -0
- package/dist/knowledge-graph/module-derivation.js +418 -0
- package/dist/knowledge-graph/module-derivation.js.map +1 -0
- package/dist/knowledge-graph/persistence.d.ts +270 -0
- package/dist/knowledge-graph/persistence.d.ts.map +1 -0
- package/dist/knowledge-graph/persistence.js +226 -0
- package/dist/knowledge-graph/persistence.js.map +1 -0
- package/dist/knowledge-graph/query-helpers.d.ts +164 -0
- package/dist/knowledge-graph/query-helpers.d.ts.map +1 -0
- package/dist/knowledge-graph/query-helpers.js +394 -0
- package/dist/knowledge-graph/query-helpers.js.map +1 -0
- package/dist/knowledge-graph/unified-graph.d.ts +310 -0
- package/dist/knowledge-graph/unified-graph.d.ts.map +1 -0
- package/dist/knowledge-graph/unified-graph.js +182 -0
- package/dist/knowledge-graph/unified-graph.js.map +1 -0
- package/dist/mcp/agent-context-tools.d.ts +104 -0
- package/dist/mcp/agent-context-tools.d.ts.map +1 -0
- package/dist/mcp/agent-context-tools.js +854 -0
- package/dist/mcp/agent-context-tools.js.map +1 -0
- package/dist/mcp/graph-tools.d.ts +20 -0
- package/dist/mcp/graph-tools.d.ts.map +1 -1
- package/dist/mcp/graph-tools.js +71 -11
- package/dist/mcp/graph-tools.js.map +1 -1
- package/dist/mcp/lib/response-helpers.d.ts +67 -0
- package/dist/mcp/lib/response-helpers.d.ts.map +1 -0
- package/dist/mcp/lib/response-helpers.js +103 -0
- package/dist/mcp/lib/response-helpers.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +9 -10
- package/dist/mcp/server.js.map +1 -1
- package/dist/models/call-site.d.ts +68 -0
- package/dist/models/call-site.d.ts.map +1 -0
- package/dist/models/call-site.js +60 -0
- package/dist/models/call-site.js.map +1 -0
- package/dist/models/code-skeleton.d.ts +78 -6
- package/dist/models/code-skeleton.d.ts.map +1 -1
- package/dist/models/code-skeleton.js +29 -0
- package/dist/models/code-skeleton.js.map +1 -1
- package/dist/models/drift-item.d.ts +4 -4
- package/dist/models/module-spec.d.ts +155 -94
- package/dist/models/module-spec.d.ts.map +1 -1
- package/dist/panoramic/adr-decision-pipeline.d.ts +53 -0
- package/dist/panoramic/adr-decision-pipeline.d.ts.map +1 -0
- package/dist/panoramic/adr-decision-pipeline.js +685 -0
- package/dist/panoramic/adr-decision-pipeline.js.map +1 -0
- package/dist/panoramic/api-surface-generator.d.ts +56 -0
- package/dist/panoramic/api-surface-generator.d.ts.map +1 -0
- package/dist/panoramic/api-surface-generator.js +1671 -0
- package/dist/panoramic/api-surface-generator.js.map +1 -0
- package/dist/panoramic/architecture-ir-builder.d.ts +19 -0
- package/dist/panoramic/architecture-ir-builder.d.ts.map +1 -0
- package/dist/panoramic/architecture-ir-builder.js +561 -0
- package/dist/panoramic/architecture-ir-builder.js.map +1 -0
- package/dist/panoramic/architecture-ir-exporters.d.ts +7 -0
- package/dist/panoramic/architecture-ir-exporters.d.ts.map +1 -0
- package/dist/panoramic/architecture-ir-exporters.js +183 -0
- package/dist/panoramic/architecture-ir-exporters.js.map +1 -0
- package/dist/panoramic/architecture-ir-generator.d.ts +36 -0
- package/dist/panoramic/architecture-ir-generator.d.ts.map +1 -0
- package/dist/panoramic/architecture-ir-generator.js +51 -0
- package/dist/panoramic/architecture-ir-generator.js.map +1 -0
- package/dist/panoramic/architecture-ir-mermaid-adapter.d.ts +6 -0
- package/dist/panoramic/architecture-ir-mermaid-adapter.d.ts.map +1 -0
- package/dist/panoramic/architecture-ir-mermaid-adapter.js +98 -0
- package/dist/panoramic/architecture-ir-mermaid-adapter.js.map +1 -0
- package/dist/panoramic/architecture-ir-model.d.ts +87 -0
- package/dist/panoramic/architecture-ir-model.d.ts.map +1 -0
- package/dist/panoramic/architecture-ir-model.js +20 -0
- package/dist/panoramic/architecture-ir-model.js.map +1 -0
- package/dist/panoramic/architecture-narrative.d.ts +68 -0
- package/dist/panoramic/architecture-narrative.d.ts.map +1 -0
- package/dist/panoramic/architecture-narrative.js +401 -0
- package/dist/panoramic/architecture-narrative.js.map +1 -0
- package/dist/panoramic/architecture-overview-generator.d.ts +31 -0
- package/dist/panoramic/architecture-overview-generator.d.ts.map +1 -0
- package/dist/panoramic/architecture-overview-generator.js +454 -0
- package/dist/panoramic/architecture-overview-generator.js.map +1 -0
- package/dist/panoramic/architecture-overview-model.d.ts +77 -0
- package/dist/panoramic/architecture-overview-model.d.ts.map +1 -0
- package/dist/panoramic/architecture-overview-model.js +31 -0
- package/dist/panoramic/architecture-overview-model.js.map +1 -0
- package/dist/panoramic/batch-project-docs.d.ts.map +1 -1
- package/dist/panoramic/batch-project-docs.js +4 -2
- package/dist/panoramic/batch-project-docs.js.map +1 -1
- package/dist/panoramic/builders/component-view-builder.d.ts +25 -1
- package/dist/panoramic/builders/component-view-builder.d.ts.map +1 -1
- package/dist/panoramic/builders/component-view-builder.js +83 -3
- package/dist/panoramic/builders/component-view-builder.js.map +1 -1
- package/dist/panoramic/builders/doc-graph-builder.d.ts +2 -2
- package/dist/panoramic/builders/doc-graph-builder.d.ts.map +1 -1
- package/dist/panoramic/builders/doc-graph-builder.js.map +1 -1
- package/dist/panoramic/component-view-builder.d.ts +17 -0
- package/dist/panoramic/component-view-builder.d.ts.map +1 -0
- package/dist/panoramic/component-view-builder.js +652 -0
- package/dist/panoramic/component-view-builder.js.map +1 -0
- package/dist/panoramic/component-view-model.d.ts +127 -0
- package/dist/panoramic/component-view-model.d.ts.map +1 -0
- package/dist/panoramic/component-view-model.js +65 -0
- package/dist/panoramic/component-view-model.js.map +1 -0
- package/dist/panoramic/config-reference-generator.d.ts +78 -0
- package/dist/panoramic/config-reference-generator.d.ts.map +1 -0
- package/dist/panoramic/config-reference-generator.js +199 -0
- package/dist/panoramic/config-reference-generator.js.map +1 -0
- package/dist/panoramic/coverage-auditor.d.ts +95 -0
- package/dist/panoramic/coverage-auditor.d.ts.map +1 -0
- package/dist/panoramic/coverage-auditor.js +290 -0
- package/dist/panoramic/coverage-auditor.js.map +1 -0
- package/dist/panoramic/cross-package-analyzer.d.ts +112 -0
- package/dist/panoramic/cross-package-analyzer.d.ts.map +1 -0
- package/dist/panoramic/cross-package-analyzer.js +258 -0
- package/dist/panoramic/cross-package-analyzer.js.map +1 -0
- package/dist/panoramic/data-model-generator.d.ts +528 -0
- package/dist/panoramic/data-model-generator.d.ts.map +1 -0
- package/dist/panoramic/data-model-generator.js +647 -0
- package/dist/panoramic/data-model-generator.js.map +1 -0
- package/dist/panoramic/doc-graph-builder.d.ts +80 -0
- package/dist/panoramic/doc-graph-builder.d.ts.map +1 -0
- package/dist/panoramic/doc-graph-builder.js +352 -0
- package/dist/panoramic/doc-graph-builder.js.map +1 -0
- package/dist/panoramic/docs-bundle-manifest-reader.d.ts +26 -0
- package/dist/panoramic/docs-bundle-manifest-reader.d.ts.map +1 -0
- package/dist/panoramic/docs-bundle-manifest-reader.js +106 -0
- package/dist/panoramic/docs-bundle-manifest-reader.js.map +1 -0
- package/dist/panoramic/docs-bundle-orchestrator.d.ts +14 -0
- package/dist/panoramic/docs-bundle-orchestrator.d.ts.map +1 -0
- package/dist/panoramic/docs-bundle-orchestrator.js +538 -0
- package/dist/panoramic/docs-bundle-orchestrator.js.map +1 -0
- package/dist/panoramic/docs-bundle-profiles.d.ts +4 -0
- package/dist/panoramic/docs-bundle-profiles.d.ts.map +1 -0
- package/dist/panoramic/docs-bundle-profiles.js +82 -0
- package/dist/panoramic/docs-bundle-profiles.js.map +1 -0
- package/dist/panoramic/docs-bundle-types.d.ts +94 -0
- package/dist/panoramic/docs-bundle-types.d.ts.map +1 -0
- package/dist/panoramic/docs-bundle-types.js +10 -0
- package/dist/panoramic/docs-bundle-types.js.map +1 -0
- package/dist/panoramic/docs-quality-evaluator.d.ts +31 -0
- package/dist/panoramic/docs-quality-evaluator.d.ts.map +1 -0
- package/dist/panoramic/docs-quality-evaluator.js +941 -0
- package/dist/panoramic/docs-quality-evaluator.js.map +1 -0
- package/dist/panoramic/docs-quality-model.d.ts +125 -0
- package/dist/panoramic/docs-quality-model.d.ts.map +1 -0
- package/dist/panoramic/docs-quality-model.js +166 -0
- package/dist/panoramic/docs-quality-model.js.map +1 -0
- package/dist/panoramic/dynamic-scenarios-builder.d.ts +18 -0
- package/dist/panoramic/dynamic-scenarios-builder.d.ts.map +1 -0
- package/dist/panoramic/dynamic-scenarios-builder.js +316 -0
- package/dist/panoramic/dynamic-scenarios-builder.js.map +1 -0
- package/dist/panoramic/event-surface-generator.d.ts +52 -0
- package/dist/panoramic/event-surface-generator.d.ts.map +1 -0
- package/dist/panoramic/event-surface-generator.js +507 -0
- package/dist/panoramic/event-surface-generator.js.map +1 -0
- package/dist/panoramic/generator-registry.d.ts +1 -1
- package/dist/panoramic/generator-registry.d.ts.map +1 -1
- package/dist/panoramic/generator-registry.js +5 -2
- package/dist/panoramic/generator-registry.js.map +1 -1
- package/dist/panoramic/generators/cross-package-analyzer.d.ts +5 -5
- package/dist/panoramic/generators/cross-package-analyzer.d.ts.map +1 -1
- package/dist/panoramic/generators/cross-package-analyzer.js +1 -1
- package/dist/panoramic/generators/cross-package-analyzer.js.map +1 -1
- package/dist/panoramic/generators/data-model-generator.d.ts +27 -27
- package/dist/panoramic/graph/confidence-mapper.d.ts +18 -0
- package/dist/panoramic/graph/confidence-mapper.d.ts.map +1 -1
- package/dist/panoramic/graph/confidence-mapper.js +26 -0
- package/dist/panoramic/graph/confidence-mapper.js.map +1 -1
- package/dist/panoramic/graph/graph-builder.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-builder.js +78 -0
- package/dist/panoramic/graph/graph-builder.js.map +1 -1
- package/dist/panoramic/graph/graph-paths.d.ts +8 -0
- package/dist/panoramic/graph/graph-paths.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-paths.js +10 -0
- package/dist/panoramic/graph/graph-paths.js.map +1 -1
- package/dist/panoramic/graph/graph-query.d.ts +33 -2
- package/dist/panoramic/graph/graph-query.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-query.js +69 -19
- package/dist/panoramic/graph/graph-query.js.map +1 -1
- package/dist/panoramic/graph/graph-types.d.ts +32 -3
- package/dist/panoramic/graph/graph-types.d.ts.map +1 -1
- package/dist/panoramic/hyperedges/schema.d.ts +6 -6
- package/dist/panoramic/interface-surface-generator.d.ts +50 -0
- package/dist/panoramic/interface-surface-generator.d.ts.map +1 -0
- package/dist/panoramic/interface-surface-generator.js +388 -0
- package/dist/panoramic/interface-surface-generator.js.map +1 -0
- package/dist/panoramic/interfaces.d.ts +2 -2
- package/dist/panoramic/mock-readme-generator.d.ts +90 -0
- package/dist/panoramic/mock-readme-generator.d.ts.map +1 -0
- package/dist/panoramic/mock-readme-generator.js +111 -0
- package/dist/panoramic/mock-readme-generator.js.map +1 -0
- package/dist/panoramic/models/component-view-model.d.ts +1 -1
- package/dist/panoramic/models/component-view-model.d.ts.map +1 -1
- package/dist/panoramic/models/component-view-model.js.map +1 -1
- package/dist/panoramic/narrative-provenance-adapter.d.ts +8 -0
- package/dist/panoramic/narrative-provenance-adapter.d.ts.map +1 -0
- package/dist/panoramic/narrative-provenance-adapter.js +99 -0
- package/dist/panoramic/narrative-provenance-adapter.js.map +1 -0
- package/dist/panoramic/parser-registry.d.ts +1 -1
- package/dist/panoramic/parser-registry.js +1 -1
- package/dist/panoramic/parsers/types.d.ts +6 -6
- package/dist/panoramic/pattern-hints-generator.d.ts +28 -0
- package/dist/panoramic/pattern-hints-generator.d.ts.map +1 -0
- package/dist/panoramic/pattern-hints-generator.js +218 -0
- package/dist/panoramic/pattern-hints-generator.js.map +1 -0
- package/dist/panoramic/pattern-hints-model.d.ts +89 -0
- package/dist/panoramic/pattern-hints-model.d.ts.map +1 -0
- package/dist/panoramic/pattern-hints-model.js +61 -0
- package/dist/panoramic/pattern-hints-model.js.map +1 -0
- package/dist/panoramic/pattern-knowledge-base.d.ts +31 -0
- package/dist/panoramic/pattern-knowledge-base.d.ts.map +1 -0
- package/dist/panoramic/pattern-knowledge-base.js +407 -0
- package/dist/panoramic/pattern-knowledge-base.js.map +1 -0
- package/dist/panoramic/pipelines/coverage-auditor.d.ts.map +1 -1
- package/dist/panoramic/pipelines/coverage-auditor.js +4 -2
- package/dist/panoramic/pipelines/coverage-auditor.js.map +1 -1
- package/dist/panoramic/pipelines/docs-bundle-orchestrator.js +13 -6
- package/dist/panoramic/pipelines/docs-bundle-orchestrator.js.map +1 -1
- package/dist/panoramic/pipelines/product-ux-docs.d.ts +5 -0
- package/dist/panoramic/pipelines/product-ux-docs.d.ts.map +1 -1
- package/dist/panoramic/pipelines/product-ux-docs.js +34 -6
- package/dist/panoramic/pipelines/product-ux-docs.js.map +1 -1
- package/dist/panoramic/product-ux-docs.d.ts +104 -0
- package/dist/panoramic/product-ux-docs.d.ts.map +1 -0
- package/dist/panoramic/product-ux-docs.js +817 -0
- package/dist/panoramic/product-ux-docs.js.map +1 -0
- package/dist/panoramic/qa/__tests__/citation.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/citation.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/citation.test.js +193 -0
- package/dist/panoramic/qa/__tests__/citation.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/debt-context.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/debt-context.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/debt-context.test.js +154 -0
- package/dist/panoramic/qa/__tests__/debt-context.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/graph-retriever.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/graph-retriever.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/graph-retriever.test.js +148 -0
- package/dist/panoramic/qa/__tests__/graph-retriever.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/index.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/index.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/index.test.js +246 -0
- package/dist/panoramic/qa/__tests__/index.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/llm-caller.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/llm-caller.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/llm-caller.test.js +168 -0
- package/dist/panoramic/qa/__tests__/llm-caller.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/prompt-builder.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/prompt-builder.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/prompt-builder.test.js +150 -0
- package/dist/panoramic/qa/__tests__/prompt-builder.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/qa-integration.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/qa-integration.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/qa-integration.test.js +296 -0
- package/dist/panoramic/qa/__tests__/qa-integration.test.js.map +1 -0
- package/dist/panoramic/qa/__tests__/rag-reranker.test.d.ts +2 -0
- package/dist/panoramic/qa/__tests__/rag-reranker.test.d.ts.map +1 -0
- package/dist/panoramic/qa/__tests__/rag-reranker.test.js +136 -0
- package/dist/panoramic/qa/__tests__/rag-reranker.test.js.map +1 -0
- package/dist/panoramic/qa/index.d.ts.map +1 -1
- package/dist/panoramic/qa/index.js +10 -3
- package/dist/panoramic/qa/index.js.map +1 -1
- package/dist/panoramic/runtime-topology-generator.d.ts +77 -0
- package/dist/panoramic/runtime-topology-generator.d.ts.map +1 -0
- package/dist/panoramic/runtime-topology-generator.js +676 -0
- package/dist/panoramic/runtime-topology-generator.js.map +1 -0
- package/dist/panoramic/runtime-topology-model.d.ts +145 -0
- package/dist/panoramic/runtime-topology-model.d.ts.map +1 -0
- package/dist/panoramic/runtime-topology-model.js +300 -0
- package/dist/panoramic/runtime-topology-model.js.map +1 -0
- package/dist/panoramic/troubleshooting-generator.d.ts +51 -0
- package/dist/panoramic/troubleshooting-generator.d.ts.map +1 -0
- package/dist/panoramic/troubleshooting-generator.js +451 -0
- package/dist/panoramic/troubleshooting-generator.js.map +1 -0
- package/dist/panoramic/utils/text-segmenter.d.ts +15 -0
- package/dist/panoramic/utils/text-segmenter.d.ts.map +1 -1
- package/dist/panoramic/utils/text-segmenter.js +38 -0
- package/dist/panoramic/utils/text-segmenter.js.map +1 -1
- package/dist/panoramic/workspace-index-generator.d.ts +148 -0
- package/dist/panoramic/workspace-index-generator.d.ts.map +1 -0
- package/dist/panoramic/workspace-index-generator.js +497 -0
- package/dist/panoramic/workspace-index-generator.js.map +1 -0
- package/dist/runtime-bootstrap.d.ts +9 -0
- package/dist/runtime-bootstrap.d.ts.map +1 -0
- package/dist/runtime-bootstrap.js +33 -0
- package/dist/runtime-bootstrap.js.map +1 -0
- package/dist/utils/file-scanner.js +1 -1
- package/dist/utils/file-scanner.js.map +1 -1
- package/package.json +12 -2
- package/plugins/spec-driver/.claude-plugin/plugin.json +1 -1
- package/plugins/spec-driver/README.md +18 -1
- package/plugins/spec-driver/agents/implement.md +20 -1
- package/plugins/spec-driver/agents/plan.md +20 -1
- package/plugins/spec-driver/agents/quality-review.md +20 -1
- package/plugins/spec-driver/agents/spec-review.md +20 -1
- package/plugins/spec-driver/agents/verify.md +20 -1
- package/plugins/spec-driver/docs/customization.md +134 -0
- package/plugins/spec-driver/docs/spectra-mcp-integration.md +165 -0
- package/plugins/spec-driver/lib/preference-rules.mjs +96 -0
- package/plugins/spec-driver/scripts/postinstall.sh +1 -1
- package/plugins/spec-driver/scripts/sync-preference-rules.mjs +148 -0
- package/plugins/spec-driver/skills/spec-driver-feature/SKILL.md +10 -0
- package/plugins/spec-driver/skills/spec-driver-fix/SKILL.md +10 -0
- package/plugins/spec-driver/skills/spec-driver-implement/SKILL.md +10 -0
- package/plugins/spec-driver/skills/spec-driver-refactor/SKILL.md +10 -0
- package/plugins/spec-driver/skills/spec-driver-story/SKILL.md +10 -0
- package/plugins/spec-driver/templates/preference-rules.md +39 -0
- package/plugins/spectra/.claude-plugin/plugin.json +1 -1
- package/plugins/spectra/README.md +48 -1
- package/plugins/spectra/hooks/post-commit.sh +40 -0
- package/templates/product-overview.hbs +1 -1
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataModelGenerator — 通用数据模型文档生成器
|
|
3
|
+
*
|
|
4
|
+
* 从 Python dataclass / Pydantic BaseModel / TypeScript interface / type alias
|
|
5
|
+
* 中提取字段定义,生成数据模型参考文档和 Mermaid ER 图。
|
|
6
|
+
*
|
|
7
|
+
* 实现 DocumentGenerator<DataModelInput, DataModelOutput> 接口。
|
|
8
|
+
*
|
|
9
|
+
* 提取策略:
|
|
10
|
+
* - Python: 通过 TreeSitterAnalyzer 获取 CodeSkeleton 识别 class,
|
|
11
|
+
* 读取源文件文本按行提取字段声明
|
|
12
|
+
* - TypeScript: 通过 TreeSitterAnalyzer 获取 CodeSkeleton,
|
|
13
|
+
* 从 exports 中筛选 interface/type,从 members 提取 property
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import type { DocumentGenerator, ProjectContext, GenerateOptions } from './interfaces.js';
|
|
17
|
+
import type { CodeSkeleton } from '../models/code-skeleton.js';
|
|
18
|
+
/** 单个数据模型字段 Schema */
|
|
19
|
+
export declare const DataModelFieldSchema: z.ZodObject<{
|
|
20
|
+
/** 字段名称 */
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
/** 类型注解的原始文本 */
|
|
23
|
+
typeStr: z.ZodString;
|
|
24
|
+
/** 是否可选 */
|
|
25
|
+
optional: z.ZodBoolean;
|
|
26
|
+
/** 默认值文本(无默认值时为 null) */
|
|
27
|
+
defaultValue: z.ZodNullable<z.ZodString>;
|
|
28
|
+
/** 字段描述 */
|
|
29
|
+
description: z.ZodNullable<z.ZodString>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string | null;
|
|
33
|
+
defaultValue: string | null;
|
|
34
|
+
typeStr: string;
|
|
35
|
+
optional: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string | null;
|
|
39
|
+
defaultValue: string | null;
|
|
40
|
+
typeStr: string;
|
|
41
|
+
optional: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
export type DataModelField = z.infer<typeof DataModelFieldSchema>;
|
|
44
|
+
/** 数据模型类型枚举 */
|
|
45
|
+
export declare const DataModelKindSchema: z.ZodEnum<["dataclass", "pydantic", "interface", "type"]>;
|
|
46
|
+
export type DataModelKind = z.infer<typeof DataModelKindSchema>;
|
|
47
|
+
/** 单个数据模型 Schema */
|
|
48
|
+
export declare const DataModelSchema: z.ZodObject<{
|
|
49
|
+
/** 模型名称 */
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
/** 源文件相对路径 */
|
|
52
|
+
filePath: z.ZodString;
|
|
53
|
+
/** 所属语言 */
|
|
54
|
+
language: z.ZodEnum<["python", "typescript"]>;
|
|
55
|
+
/** 模型定义类型 */
|
|
56
|
+
kind: z.ZodEnum<["dataclass", "pydantic", "interface", "type"]>;
|
|
57
|
+
/** 字段列表 */
|
|
58
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
59
|
+
/** 字段名称 */
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
/** 类型注解的原始文本 */
|
|
62
|
+
typeStr: z.ZodString;
|
|
63
|
+
/** 是否可选 */
|
|
64
|
+
optional: z.ZodBoolean;
|
|
65
|
+
/** 默认值文本(无默认值时为 null) */
|
|
66
|
+
defaultValue: z.ZodNullable<z.ZodString>;
|
|
67
|
+
/** 字段描述 */
|
|
68
|
+
description: z.ZodNullable<z.ZodString>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string | null;
|
|
72
|
+
defaultValue: string | null;
|
|
73
|
+
typeStr: string;
|
|
74
|
+
optional: boolean;
|
|
75
|
+
}, {
|
|
76
|
+
name: string;
|
|
77
|
+
description: string | null;
|
|
78
|
+
defaultValue: string | null;
|
|
79
|
+
typeStr: string;
|
|
80
|
+
optional: boolean;
|
|
81
|
+
}>, "many">;
|
|
82
|
+
/** 基类/扩展接口名称列表 */
|
|
83
|
+
bases: z.ZodArray<z.ZodString, "many">;
|
|
84
|
+
/** 模型级描述 */
|
|
85
|
+
description: z.ZodNullable<z.ZodString>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
name: string;
|
|
88
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
89
|
+
filePath: string;
|
|
90
|
+
language: "typescript" | "python";
|
|
91
|
+
description: string | null;
|
|
92
|
+
fields: {
|
|
93
|
+
name: string;
|
|
94
|
+
description: string | null;
|
|
95
|
+
defaultValue: string | null;
|
|
96
|
+
typeStr: string;
|
|
97
|
+
optional: boolean;
|
|
98
|
+
}[];
|
|
99
|
+
bases: string[];
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
103
|
+
filePath: string;
|
|
104
|
+
language: "typescript" | "python";
|
|
105
|
+
description: string | null;
|
|
106
|
+
fields: {
|
|
107
|
+
name: string;
|
|
108
|
+
description: string | null;
|
|
109
|
+
defaultValue: string | null;
|
|
110
|
+
typeStr: string;
|
|
111
|
+
optional: boolean;
|
|
112
|
+
}[];
|
|
113
|
+
bases: string[];
|
|
114
|
+
}>;
|
|
115
|
+
export type DataModel = z.infer<typeof DataModelSchema>;
|
|
116
|
+
/** 关系类型枚举 */
|
|
117
|
+
export declare const RelationTypeSchema: z.ZodEnum<["inherits", "has", "contains"]>;
|
|
118
|
+
/** 模型间关系 Schema */
|
|
119
|
+
export declare const ModelRelationSchema: z.ZodObject<{
|
|
120
|
+
/** 源模型名称 */
|
|
121
|
+
source: z.ZodString;
|
|
122
|
+
/** 目标模型名称 */
|
|
123
|
+
target: z.ZodString;
|
|
124
|
+
/** 关系类型 */
|
|
125
|
+
type: z.ZodEnum<["inherits", "has", "contains"]>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
type: "inherits" | "has" | "contains";
|
|
128
|
+
source: string;
|
|
129
|
+
target: string;
|
|
130
|
+
}, {
|
|
131
|
+
type: "inherits" | "has" | "contains";
|
|
132
|
+
source: string;
|
|
133
|
+
target: string;
|
|
134
|
+
}>;
|
|
135
|
+
export type ModelRelation = z.infer<typeof ModelRelationSchema>;
|
|
136
|
+
/** DataModelGenerator.extract() 的输出类型 Schema */
|
|
137
|
+
export declare const DataModelInputSchema: z.ZodObject<{
|
|
138
|
+
models: z.ZodArray<z.ZodObject<{
|
|
139
|
+
/** 模型名称 */
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
/** 源文件相对路径 */
|
|
142
|
+
filePath: z.ZodString;
|
|
143
|
+
/** 所属语言 */
|
|
144
|
+
language: z.ZodEnum<["python", "typescript"]>;
|
|
145
|
+
/** 模型定义类型 */
|
|
146
|
+
kind: z.ZodEnum<["dataclass", "pydantic", "interface", "type"]>;
|
|
147
|
+
/** 字段列表 */
|
|
148
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
149
|
+
/** 字段名称 */
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
/** 类型注解的原始文本 */
|
|
152
|
+
typeStr: z.ZodString;
|
|
153
|
+
/** 是否可选 */
|
|
154
|
+
optional: z.ZodBoolean;
|
|
155
|
+
/** 默认值文本(无默认值时为 null) */
|
|
156
|
+
defaultValue: z.ZodNullable<z.ZodString>;
|
|
157
|
+
/** 字段描述 */
|
|
158
|
+
description: z.ZodNullable<z.ZodString>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
name: string;
|
|
161
|
+
description: string | null;
|
|
162
|
+
defaultValue: string | null;
|
|
163
|
+
typeStr: string;
|
|
164
|
+
optional: boolean;
|
|
165
|
+
}, {
|
|
166
|
+
name: string;
|
|
167
|
+
description: string | null;
|
|
168
|
+
defaultValue: string | null;
|
|
169
|
+
typeStr: string;
|
|
170
|
+
optional: boolean;
|
|
171
|
+
}>, "many">;
|
|
172
|
+
/** 基类/扩展接口名称列表 */
|
|
173
|
+
bases: z.ZodArray<z.ZodString, "many">;
|
|
174
|
+
/** 模型级描述 */
|
|
175
|
+
description: z.ZodNullable<z.ZodString>;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
name: string;
|
|
178
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
179
|
+
filePath: string;
|
|
180
|
+
language: "typescript" | "python";
|
|
181
|
+
description: string | null;
|
|
182
|
+
fields: {
|
|
183
|
+
name: string;
|
|
184
|
+
description: string | null;
|
|
185
|
+
defaultValue: string | null;
|
|
186
|
+
typeStr: string;
|
|
187
|
+
optional: boolean;
|
|
188
|
+
}[];
|
|
189
|
+
bases: string[];
|
|
190
|
+
}, {
|
|
191
|
+
name: string;
|
|
192
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
193
|
+
filePath: string;
|
|
194
|
+
language: "typescript" | "python";
|
|
195
|
+
description: string | null;
|
|
196
|
+
fields: {
|
|
197
|
+
name: string;
|
|
198
|
+
description: string | null;
|
|
199
|
+
defaultValue: string | null;
|
|
200
|
+
typeStr: string;
|
|
201
|
+
optional: boolean;
|
|
202
|
+
}[];
|
|
203
|
+
bases: string[];
|
|
204
|
+
}>, "many">;
|
|
205
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
206
|
+
/** 源模型名称 */
|
|
207
|
+
source: z.ZodString;
|
|
208
|
+
/** 目标模型名称 */
|
|
209
|
+
target: z.ZodString;
|
|
210
|
+
/** 关系类型 */
|
|
211
|
+
type: z.ZodEnum<["inherits", "has", "contains"]>;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
type: "inherits" | "has" | "contains";
|
|
214
|
+
source: string;
|
|
215
|
+
target: string;
|
|
216
|
+
}, {
|
|
217
|
+
type: "inherits" | "has" | "contains";
|
|
218
|
+
source: string;
|
|
219
|
+
target: string;
|
|
220
|
+
}>, "many">;
|
|
221
|
+
sourceFiles: z.ZodArray<z.ZodString, "many">;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
models: {
|
|
224
|
+
name: string;
|
|
225
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
226
|
+
filePath: string;
|
|
227
|
+
language: "typescript" | "python";
|
|
228
|
+
description: string | null;
|
|
229
|
+
fields: {
|
|
230
|
+
name: string;
|
|
231
|
+
description: string | null;
|
|
232
|
+
defaultValue: string | null;
|
|
233
|
+
typeStr: string;
|
|
234
|
+
optional: boolean;
|
|
235
|
+
}[];
|
|
236
|
+
bases: string[];
|
|
237
|
+
}[];
|
|
238
|
+
relations: {
|
|
239
|
+
type: "inherits" | "has" | "contains";
|
|
240
|
+
source: string;
|
|
241
|
+
target: string;
|
|
242
|
+
}[];
|
|
243
|
+
sourceFiles: string[];
|
|
244
|
+
}, {
|
|
245
|
+
models: {
|
|
246
|
+
name: string;
|
|
247
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
248
|
+
filePath: string;
|
|
249
|
+
language: "typescript" | "python";
|
|
250
|
+
description: string | null;
|
|
251
|
+
fields: {
|
|
252
|
+
name: string;
|
|
253
|
+
description: string | null;
|
|
254
|
+
defaultValue: string | null;
|
|
255
|
+
typeStr: string;
|
|
256
|
+
optional: boolean;
|
|
257
|
+
}[];
|
|
258
|
+
bases: string[];
|
|
259
|
+
}[];
|
|
260
|
+
relations: {
|
|
261
|
+
type: "inherits" | "has" | "contains";
|
|
262
|
+
source: string;
|
|
263
|
+
target: string;
|
|
264
|
+
}[];
|
|
265
|
+
sourceFiles: string[];
|
|
266
|
+
}>;
|
|
267
|
+
export type DataModelInput = z.infer<typeof DataModelInputSchema>;
|
|
268
|
+
/** 统计摘要 Schema */
|
|
269
|
+
export declare const SummarySchema: z.ZodObject<{
|
|
270
|
+
totalModels: z.ZodNumber;
|
|
271
|
+
totalFields: z.ZodNumber;
|
|
272
|
+
byLanguage: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
273
|
+
byKind: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
totalModels: number;
|
|
276
|
+
totalFields: number;
|
|
277
|
+
byLanguage: Record<string, number>;
|
|
278
|
+
byKind: Record<string, number>;
|
|
279
|
+
}, {
|
|
280
|
+
totalModels: number;
|
|
281
|
+
totalFields: number;
|
|
282
|
+
byLanguage: Record<string, number>;
|
|
283
|
+
byKind: Record<string, number>;
|
|
284
|
+
}>;
|
|
285
|
+
/** DataModelGenerator.generate() 的输出类型 Schema */
|
|
286
|
+
export declare const DataModelOutputSchema: z.ZodObject<{
|
|
287
|
+
models: z.ZodArray<z.ZodObject<{
|
|
288
|
+
/** 模型名称 */
|
|
289
|
+
name: z.ZodString;
|
|
290
|
+
/** 源文件相对路径 */
|
|
291
|
+
filePath: z.ZodString;
|
|
292
|
+
/** 所属语言 */
|
|
293
|
+
language: z.ZodEnum<["python", "typescript"]>;
|
|
294
|
+
/** 模型定义类型 */
|
|
295
|
+
kind: z.ZodEnum<["dataclass", "pydantic", "interface", "type"]>;
|
|
296
|
+
/** 字段列表 */
|
|
297
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
298
|
+
/** 字段名称 */
|
|
299
|
+
name: z.ZodString;
|
|
300
|
+
/** 类型注解的原始文本 */
|
|
301
|
+
typeStr: z.ZodString;
|
|
302
|
+
/** 是否可选 */
|
|
303
|
+
optional: z.ZodBoolean;
|
|
304
|
+
/** 默认值文本(无默认值时为 null) */
|
|
305
|
+
defaultValue: z.ZodNullable<z.ZodString>;
|
|
306
|
+
/** 字段描述 */
|
|
307
|
+
description: z.ZodNullable<z.ZodString>;
|
|
308
|
+
}, "strip", z.ZodTypeAny, {
|
|
309
|
+
name: string;
|
|
310
|
+
description: string | null;
|
|
311
|
+
defaultValue: string | null;
|
|
312
|
+
typeStr: string;
|
|
313
|
+
optional: boolean;
|
|
314
|
+
}, {
|
|
315
|
+
name: string;
|
|
316
|
+
description: string | null;
|
|
317
|
+
defaultValue: string | null;
|
|
318
|
+
typeStr: string;
|
|
319
|
+
optional: boolean;
|
|
320
|
+
}>, "many">;
|
|
321
|
+
/** 基类/扩展接口名称列表 */
|
|
322
|
+
bases: z.ZodArray<z.ZodString, "many">;
|
|
323
|
+
/** 模型级描述 */
|
|
324
|
+
description: z.ZodNullable<z.ZodString>;
|
|
325
|
+
}, "strip", z.ZodTypeAny, {
|
|
326
|
+
name: string;
|
|
327
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
328
|
+
filePath: string;
|
|
329
|
+
language: "typescript" | "python";
|
|
330
|
+
description: string | null;
|
|
331
|
+
fields: {
|
|
332
|
+
name: string;
|
|
333
|
+
description: string | null;
|
|
334
|
+
defaultValue: string | null;
|
|
335
|
+
typeStr: string;
|
|
336
|
+
optional: boolean;
|
|
337
|
+
}[];
|
|
338
|
+
bases: string[];
|
|
339
|
+
}, {
|
|
340
|
+
name: string;
|
|
341
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
342
|
+
filePath: string;
|
|
343
|
+
language: "typescript" | "python";
|
|
344
|
+
description: string | null;
|
|
345
|
+
fields: {
|
|
346
|
+
name: string;
|
|
347
|
+
description: string | null;
|
|
348
|
+
defaultValue: string | null;
|
|
349
|
+
typeStr: string;
|
|
350
|
+
optional: boolean;
|
|
351
|
+
}[];
|
|
352
|
+
bases: string[];
|
|
353
|
+
}>, "many">;
|
|
354
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
355
|
+
/** 源模型名称 */
|
|
356
|
+
source: z.ZodString;
|
|
357
|
+
/** 目标模型名称 */
|
|
358
|
+
target: z.ZodString;
|
|
359
|
+
/** 关系类型 */
|
|
360
|
+
type: z.ZodEnum<["inherits", "has", "contains"]>;
|
|
361
|
+
}, "strip", z.ZodTypeAny, {
|
|
362
|
+
type: "inherits" | "has" | "contains";
|
|
363
|
+
source: string;
|
|
364
|
+
target: string;
|
|
365
|
+
}, {
|
|
366
|
+
type: "inherits" | "has" | "contains";
|
|
367
|
+
source: string;
|
|
368
|
+
target: string;
|
|
369
|
+
}>, "many">;
|
|
370
|
+
erDiagram: z.ZodString;
|
|
371
|
+
summary: z.ZodObject<{
|
|
372
|
+
totalModels: z.ZodNumber;
|
|
373
|
+
totalFields: z.ZodNumber;
|
|
374
|
+
byLanguage: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
375
|
+
byKind: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
376
|
+
}, "strip", z.ZodTypeAny, {
|
|
377
|
+
totalModels: number;
|
|
378
|
+
totalFields: number;
|
|
379
|
+
byLanguage: Record<string, number>;
|
|
380
|
+
byKind: Record<string, number>;
|
|
381
|
+
}, {
|
|
382
|
+
totalModels: number;
|
|
383
|
+
totalFields: number;
|
|
384
|
+
byLanguage: Record<string, number>;
|
|
385
|
+
byKind: Record<string, number>;
|
|
386
|
+
}>;
|
|
387
|
+
}, "strip", z.ZodTypeAny, {
|
|
388
|
+
summary: {
|
|
389
|
+
totalModels: number;
|
|
390
|
+
totalFields: number;
|
|
391
|
+
byLanguage: Record<string, number>;
|
|
392
|
+
byKind: Record<string, number>;
|
|
393
|
+
};
|
|
394
|
+
models: {
|
|
395
|
+
name: string;
|
|
396
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
397
|
+
filePath: string;
|
|
398
|
+
language: "typescript" | "python";
|
|
399
|
+
description: string | null;
|
|
400
|
+
fields: {
|
|
401
|
+
name: string;
|
|
402
|
+
description: string | null;
|
|
403
|
+
defaultValue: string | null;
|
|
404
|
+
typeStr: string;
|
|
405
|
+
optional: boolean;
|
|
406
|
+
}[];
|
|
407
|
+
bases: string[];
|
|
408
|
+
}[];
|
|
409
|
+
relations: {
|
|
410
|
+
type: "inherits" | "has" | "contains";
|
|
411
|
+
source: string;
|
|
412
|
+
target: string;
|
|
413
|
+
}[];
|
|
414
|
+
erDiagram: string;
|
|
415
|
+
}, {
|
|
416
|
+
summary: {
|
|
417
|
+
totalModels: number;
|
|
418
|
+
totalFields: number;
|
|
419
|
+
byLanguage: Record<string, number>;
|
|
420
|
+
byKind: Record<string, number>;
|
|
421
|
+
};
|
|
422
|
+
models: {
|
|
423
|
+
name: string;
|
|
424
|
+
kind: "interface" | "type" | "dataclass" | "pydantic";
|
|
425
|
+
filePath: string;
|
|
426
|
+
language: "typescript" | "python";
|
|
427
|
+
description: string | null;
|
|
428
|
+
fields: {
|
|
429
|
+
name: string;
|
|
430
|
+
description: string | null;
|
|
431
|
+
defaultValue: string | null;
|
|
432
|
+
typeStr: string;
|
|
433
|
+
optional: boolean;
|
|
434
|
+
}[];
|
|
435
|
+
bases: string[];
|
|
436
|
+
}[];
|
|
437
|
+
relations: {
|
|
438
|
+
type: "inherits" | "has" | "contains";
|
|
439
|
+
source: string;
|
|
440
|
+
target: string;
|
|
441
|
+
}[];
|
|
442
|
+
erDiagram: string;
|
|
443
|
+
}>;
|
|
444
|
+
export type DataModelOutput = z.infer<typeof DataModelOutputSchema>;
|
|
445
|
+
/**
|
|
446
|
+
* 解析 Pydantic Field() 调用,提取 default 和 description
|
|
447
|
+
*
|
|
448
|
+
* @param text - Field(...) 调用文本
|
|
449
|
+
* @returns default 和 description
|
|
450
|
+
*/
|
|
451
|
+
export declare function parsePydanticFieldCall(text: string): {
|
|
452
|
+
default: string | null;
|
|
453
|
+
description: string | null;
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* 从 Python 类源代码行中提取字段声明
|
|
457
|
+
* 使用 AST 确定的类边界(startLine/endLine),从源文本提取字段
|
|
458
|
+
*
|
|
459
|
+
* @param sourceLines - 源文件按行分割的数组
|
|
460
|
+
* @param startLine - 类定义起始行(1-based,含装饰器)
|
|
461
|
+
* @param endLine - 类定义结束行(1-based)
|
|
462
|
+
* @returns 字段列表
|
|
463
|
+
*/
|
|
464
|
+
export declare function extractPythonFieldsFromLines(sourceLines: string[], startLine: number, endLine: number): DataModelField[];
|
|
465
|
+
/**
|
|
466
|
+
* 从 TypeScript CodeSkeleton 中提取数据模型
|
|
467
|
+
*
|
|
468
|
+
* @param skeleton - TreeSitterAnalyzer 输出的 CodeSkeleton
|
|
469
|
+
* @param projectRoot - 项目根目录(用于计算相对路径)
|
|
470
|
+
* @returns DataModel 列表
|
|
471
|
+
*/
|
|
472
|
+
export declare function extractTypeScriptModelsFromSkeleton(skeleton: CodeSkeleton, projectRoot: string): DataModel[];
|
|
473
|
+
/**
|
|
474
|
+
* 从数据模型列表中构建模型间关系
|
|
475
|
+
*
|
|
476
|
+
* @param models - 数据模型列表
|
|
477
|
+
* @returns 关系列表(去重)
|
|
478
|
+
*/
|
|
479
|
+
export declare function buildModelRelations(models: DataModel[]): ModelRelation[];
|
|
480
|
+
/**
|
|
481
|
+
* 生成 Mermaid erDiagram 代码
|
|
482
|
+
*
|
|
483
|
+
* @param models - 数据模型列表
|
|
484
|
+
* @param relations - 模型间关系列表
|
|
485
|
+
* @returns Mermaid erDiagram 源代码
|
|
486
|
+
*/
|
|
487
|
+
export declare function generateMermaidErDiagram(models: DataModel[], relations: ModelRelation[]): string;
|
|
488
|
+
/**
|
|
489
|
+
* 通用数据模型文档生成器
|
|
490
|
+
* 实现 DocumentGenerator<DataModelInput, DataModelOutput>
|
|
491
|
+
*
|
|
492
|
+
* 生命周期: isApplicable → extract → generate → render
|
|
493
|
+
*/
|
|
494
|
+
export declare class DataModelGenerator implements DocumentGenerator<DataModelInput, DataModelOutput> {
|
|
495
|
+
readonly id: "data-model";
|
|
496
|
+
readonly name: "Data Model Generator";
|
|
497
|
+
readonly description = "\u4ECE Python dataclass / Pydantic model / TypeScript interface \u63D0\u53D6\u5B57\u6BB5\u5B9A\u4E49\uFF0C\u751F\u6210\u6570\u636E\u6A21\u578B\u6587\u6863\u548C Mermaid ER \u56FE";
|
|
498
|
+
/**
|
|
499
|
+
* 判断当前项目是否适用此 Generator
|
|
500
|
+
* 检查 detectedLanguages 是否包含 Python 或 TypeScript/TS-JS adapter
|
|
501
|
+
*/
|
|
502
|
+
isApplicable(context: ProjectContext): boolean;
|
|
503
|
+
/**
|
|
504
|
+
* 从项目中提取数据模型定义
|
|
505
|
+
*
|
|
506
|
+
* Python: 使用 TreeSitterAnalyzer 获取 CodeSkeleton,识别 @dataclass 和 BaseModel 类,
|
|
507
|
+
* 从源文件文本提取字段声明
|
|
508
|
+
* TypeScript: 使用 TreeSitterAnalyzer 获取 CodeSkeleton,筛选 interface/type exports
|
|
509
|
+
*/
|
|
510
|
+
extract(context: ProjectContext): Promise<DataModelInput>;
|
|
511
|
+
/**
|
|
512
|
+
* 将提取的数据转换为结构化输出
|
|
513
|
+
*/
|
|
514
|
+
generate(input: DataModelInput, options?: GenerateOptions): Promise<DataModelOutput>;
|
|
515
|
+
/**
|
|
516
|
+
* 将输出渲染为 Markdown 字符串
|
|
517
|
+
*/
|
|
518
|
+
render(output: DataModelOutput): string;
|
|
519
|
+
/**
|
|
520
|
+
* 从单个 Python 文件中提取数据模型
|
|
521
|
+
*/
|
|
522
|
+
private extractPythonModelsFromFile;
|
|
523
|
+
/**
|
|
524
|
+
* 从单个 TypeScript 文件中提取数据模型
|
|
525
|
+
*/
|
|
526
|
+
private extractTypeScriptModelsFromFile;
|
|
527
|
+
}
|
|
528
|
+
//# sourceMappingURL=data-model-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-model-generator.d.ts","sourceRoot":"","sources":["../../src/panoramic/data-model-generator.ts"],"names":[],"mappings":"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"}
|