spectra-cli 4.1.1 → 4.3.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 +12 -5
- package/dist/.spectra-build-meta.json +9 -0
- 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 +42 -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 +168 -61
- 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 +74 -5
- package/dist/batch/batch-orchestrator.d.ts.map +1 -1
- package/dist/batch/batch-orchestrator.js +583 -70
- 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 +21 -28
- package/dist/batch/delta-regenerator.js.map +1 -1
- package/dist/batch/module-grouper.d.ts +9 -2
- package/dist/batch/module-grouper.d.ts.map +1 -1
- package/dist/batch/module-grouper.js +3 -1
- package/dist/batch/module-grouper.js.map +1 -1
- package/dist/batch/regen-plan.d.ts +78 -0
- package/dist/batch/regen-plan.d.ts.map +1 -0
- package/dist/batch/regen-plan.js +93 -0
- package/dist/batch/regen-plan.js.map +1 -0
- package/dist/cli/commands/batch.d.ts.map +1 -1
- package/dist/cli/commands/batch.js +36 -8
- package/dist/cli/commands/batch.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/commands/scaffold-kb.d.ts +9 -0
- package/dist/cli/commands/scaffold-kb.d.ts.map +1 -0
- package/dist/cli/commands/scaffold-kb.js +179 -0
- package/dist/cli/commands/scaffold-kb.js.map +1 -0
- package/dist/cli/index.js +33 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/error-handler.d.ts +0 -6
- package/dist/cli/utils/error-handler.d.ts.map +1 -1
- package/dist/cli/utils/error-handler.js +0 -13
- package/dist/cli/utils/error-handler.js.map +1 -1
- package/dist/cli/utils/parse-args.d.ts +55 -3
- package/dist/cli/utils/parse-args.d.ts.map +1 -1
- package/dist/cli/utils/parse-args.js +176 -13
- package/dist/cli/utils/parse-args.js.map +1 -1
- package/dist/cli/version-meta.d.ts +16 -0
- package/dist/cli/version-meta.d.ts.map +1 -0
- package/dist/cli/version-meta.js +28 -0
- package/dist/cli/version-meta.js.map +1 -0
- package/dist/core/ast-analyzer.d.ts.map +1 -1
- package/dist/core/ast-analyzer.js +75 -5
- package/dist/core/ast-analyzer.js.map +1 -1
- package/dist/core/import-resolver.d.ts +93 -0
- package/dist/core/import-resolver.d.ts.map +1 -0
- package/dist/core/import-resolver.js +414 -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 +21 -0
- package/dist/core/single-spec-orchestrator.d.ts.map +1 -1
- package/dist/core/single-spec-orchestrator.js +187 -23
- package/dist/core/single-spec-orchestrator.js.map +1 -1
- package/dist/core/skeleton-hash.d.ts +33 -0
- package/dist/core/skeleton-hash.d.ts.map +1 -0
- package/dist/core/skeleton-hash.js +76 -0
- package/dist/core/skeleton-hash.js.map +1 -0
- package/dist/core/tree-sitter-analyzer.d.ts +7 -0
- package/dist/core/tree-sitter-analyzer.d.ts.map +1 -1
- package/dist/core/tree-sitter-analyzer.js +32 -1
- package/dist/core/tree-sitter-analyzer.js.map +1 -1
- package/dist/core/tree-sitter-fallback.d.ts +12 -4
- package/dist/core/tree-sitter-fallback.d.ts.map +1 -1
- package/dist/core/tree-sitter-fallback.js +160 -12
- package/dist/core/tree-sitter-fallback.js.map +1 -1
- package/dist/extraction/extraction-types.d.ts +25 -25
- package/dist/extraction/image-extractor.d.ts.map +1 -1
- package/dist/extraction/image-extractor.js +3 -1
- package/dist/extraction/image-extractor.js.map +1 -1
- package/dist/extraction/markdown-extractor.d.ts.map +1 -1
- package/dist/extraction/markdown-extractor.js +3 -1
- package/dist/extraction/markdown-extractor.js.map +1 -1
- package/dist/generator/frontmatter.d.ts +5 -0
- package/dist/generator/frontmatter.d.ts.map +1 -1
- package/dist/generator/frontmatter.js +4 -0
- package/dist/generator/frontmatter.js.map +1 -1
- 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/kb-mcp/index.d.ts +14 -0
- package/dist/kb-mcp/index.d.ts.map +1 -0
- package/dist/kb-mcp/index.js +24 -0
- package/dist/kb-mcp/index.js.map +1 -0
- package/dist/kb-mcp/lib/kb-error.d.ts +21 -0
- package/dist/kb-mcp/lib/kb-error.d.ts.map +1 -0
- package/dist/kb-mcp/lib/kb-error.js +28 -0
- package/dist/kb-mcp/lib/kb-error.js.map +1 -0
- package/dist/kb-mcp/lib/kb-locator.d.ts +58 -0
- package/dist/kb-mcp/lib/kb-locator.d.ts.map +1 -0
- package/dist/kb-mcp/lib/kb-locator.js +85 -0
- package/dist/kb-mcp/lib/kb-locator.js.map +1 -0
- package/dist/kb-mcp/lib/result-merger.d.ts +35 -0
- package/dist/kb-mcp/lib/result-merger.d.ts.map +1 -0
- package/dist/kb-mcp/lib/result-merger.js +64 -0
- package/dist/kb-mcp/lib/result-merger.js.map +1 -0
- package/dist/kb-mcp/server.d.ts +12 -0
- package/dist/kb-mcp/server.d.ts.map +1 -0
- package/dist/kb-mcp/server.js +29 -0
- package/dist/kb-mcp/server.js.map +1 -0
- package/dist/kb-mcp/tools/kb-api-lookup.d.ts +28 -0
- package/dist/kb-mcp/tools/kb-api-lookup.d.ts.map +1 -0
- package/dist/kb-mcp/tools/kb-api-lookup.js +237 -0
- package/dist/kb-mcp/tools/kb-api-lookup.js.map +1 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.d.ts +20 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.d.ts.map +1 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.js +92 -0
- package/dist/kb-mcp/tools/kb-doc-lookup.js.map +1 -0
- package/dist/kb-mcp/tools/kb-search.d.ts +23 -0
- package/dist/kb-mcp/tools/kb-search.d.ts.map +1 -0
- package/dist/kb-mcp/tools/kb-search.js +126 -0
- package/dist/kb-mcp/tools/kb-search.js.map +1 -0
- 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 +39 -0
- package/dist/knowledge-graph/import-resolver.d.ts.map +1 -0
- package/dist/knowledge-graph/import-resolver.js +214 -0
- package/dist/knowledge-graph/import-resolver.js.map +1 -0
- package/dist/knowledge-graph/incremental.d.ts +131 -0
- package/dist/knowledge-graph/incremental.d.ts.map +1 -0
- package/dist/knowledge-graph/incremental.js +432 -0
- package/dist/knowledge-graph/incremental.js.map +1 -0
- package/dist/knowledge-graph/index.d.ts +85 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -0
- package/dist/knowledge-graph/index.js +198 -0
- package/dist/knowledge-graph/index.js.map +1 -0
- package/dist/knowledge-graph/module-derivation.d.ts +252 -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 +310 -0
- package/dist/knowledge-graph/persistence.d.ts.map +1 -0
- package/dist/knowledge-graph/persistence.js +280 -0
- package/dist/knowledge-graph/persistence.js.map +1 -0
- package/dist/knowledge-graph/query-helpers.d.ts +191 -0
- package/dist/knowledge-graph/query-helpers.d.ts.map +1 -0
- package/dist/knowledge-graph/query-helpers.js +559 -0
- package/dist/knowledge-graph/query-helpers.js.map +1 -0
- package/dist/knowledge-graph/relativize.d.ts +51 -0
- package/dist/knowledge-graph/relativize.d.ts.map +1 -0
- package/dist/knowledge-graph/relativize.js +104 -0
- package/dist/knowledge-graph/relativize.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 +53 -0
- package/dist/mcp/agent-context-tools.d.ts.map +1 -0
- package/dist/mcp/agent-context-tools.js +806 -0
- package/dist/mcp/agent-context-tools.js.map +1 -0
- package/dist/mcp/file-nav-tools.d.ts +42 -0
- package/dist/mcp/file-nav-tools.d.ts.map +1 -0
- package/dist/mcp/file-nav-tools.js +318 -0
- package/dist/mcp/file-nav-tools.js.map +1 -0
- package/dist/mcp/graph-tools.d.ts +22 -0
- package/dist/mcp/graph-tools.d.ts.map +1 -1
- package/dist/mcp/graph-tools.js +204 -133
- package/dist/mcp/graph-tools.js.map +1 -1
- package/dist/mcp/lib/file-nav-helpers.d.ts +128 -0
- package/dist/mcp/lib/file-nav-helpers.d.ts.map +1 -0
- package/dist/mcp/lib/file-nav-helpers.js +305 -0
- package/dist/mcp/lib/file-nav-helpers.js.map +1 -0
- 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/lib/telemetry.d.ts +69 -0
- package/dist/mcp/lib/telemetry.d.ts.map +1 -0
- package/dist/mcp/lib/telemetry.js +113 -0
- package/dist/mcp/lib/telemetry.js.map +1 -0
- package/dist/mcp/lib/tool-response.d.ts +46 -0
- package/dist/mcp/lib/tool-response.d.ts.map +1 -0
- package/dist/mcp/lib/tool-response.js +83 -0
- package/dist/mcp/lib/tool-response.js.map +1 -0
- package/dist/mcp/server.d.ts +14 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +216 -158
- 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 +80 -6
- package/dist/models/code-skeleton.d.ts.map +1 -1
- package/dist/models/code-skeleton.js +30 -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 +173 -94
- package/dist/models/module-spec.d.ts.map +1 -1
- package/dist/models/module-spec.js +6 -0
- package/dist/models/module-spec.js.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 +15 -2
- package/dist/panoramic/builders/doc-graph-builder.d.ts.map +1 -1
- package/dist/panoramic/builders/doc-graph-builder.js +20 -0
- 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 +72 -2
- package/dist/panoramic/graph/graph-builder.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-builder.js +330 -46
- 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 +49 -2
- package/dist/panoramic/graph/graph-query.d.ts.map +1 -1
- package/dist/panoramic/graph/graph-query.js +117 -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/graph/index.d.ts +2 -1
- package/dist/panoramic/graph/index.d.ts.map +1 -1
- package/dist/panoramic/graph/index.js +1 -1
- package/dist/panoramic/graph/index.js.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/adr-evidence-verifier.d.ts.map +1 -1
- package/dist/panoramic/pipelines/adr-evidence-verifier.js +1 -29
- package/dist/panoramic/pipelines/adr-evidence-verifier.js.map +1 -1
- 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/query.d.ts +1 -0
- package/dist/panoramic/query.d.ts.map +1 -1
- package/dist/panoramic/query.js +5 -0
- package/dist/panoramic/query.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/scaffold-kb/api-entities-serializer.d.ts +12 -0
- package/dist/scaffold-kb/api-entities-serializer.d.ts.map +1 -0
- package/dist/scaffold-kb/api-entities-serializer.js +144 -0
- package/dist/scaffold-kb/api-entities-serializer.js.map +1 -0
- package/dist/scaffold-kb/arbitration.d.ts +44 -0
- package/dist/scaffold-kb/arbitration.d.ts.map +1 -0
- package/dist/scaffold-kb/arbitration.js +144 -0
- package/dist/scaffold-kb/arbitration.js.map +1 -0
- package/dist/scaffold-kb/chunk-splitter.d.ts +20 -0
- package/dist/scaffold-kb/chunk-splitter.d.ts.map +1 -0
- package/dist/scaffold-kb/chunk-splitter.js +309 -0
- package/dist/scaffold-kb/chunk-splitter.js.map +1 -0
- package/dist/scaffold-kb/doc-graph-builder.d.ts +26 -0
- package/dist/scaffold-kb/doc-graph-builder.d.ts.map +1 -0
- package/dist/scaffold-kb/doc-graph-builder.js +72 -0
- package/dist/scaffold-kb/doc-graph-builder.js.map +1 -0
- package/dist/scaffold-kb/entity-extractor.d.ts +40 -0
- package/dist/scaffold-kb/entity-extractor.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-extractor.js +0 -0
- package/dist/scaffold-kb/entity-extractor.js.map +1 -0
- package/dist/scaffold-kb/entity-heuristic.d.ts +14 -0
- package/dist/scaffold-kb/entity-heuristic.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-heuristic.js +107 -0
- package/dist/scaffold-kb/entity-heuristic.js.map +1 -0
- package/dist/scaffold-kb/entity-matcher.d.ts +20 -0
- package/dist/scaffold-kb/entity-matcher.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-matcher.js +53 -0
- package/dist/scaffold-kb/entity-matcher.js.map +1 -0
- package/dist/scaffold-kb/entity-util.d.ts +11 -0
- package/dist/scaffold-kb/entity-util.d.ts.map +1 -0
- package/dist/scaffold-kb/entity-util.js +23 -0
- package/dist/scaffold-kb/entity-util.js.map +1 -0
- package/dist/scaffold-kb/evidence-envelope.d.ts +17 -0
- package/dist/scaffold-kb/evidence-envelope.d.ts.map +1 -0
- package/dist/scaffold-kb/evidence-envelope.js +32 -0
- package/dist/scaffold-kb/evidence-envelope.js.map +1 -0
- package/dist/scaffold-kb/index.d.ts +20 -0
- package/dist/scaffold-kb/index.d.ts.map +1 -0
- package/dist/scaffold-kb/index.js +102 -0
- package/dist/scaffold-kb/index.js.map +1 -0
- package/dist/scaffold-kb/ingest/ingest-core.d.ts +47 -0
- package/dist/scaffold-kb/ingest/ingest-core.d.ts.map +1 -0
- package/dist/scaffold-kb/ingest/ingest-core.js +231 -0
- package/dist/scaffold-kb/ingest/ingest-core.js.map +1 -0
- package/dist/scaffold-kb/ingest/office-parser.d.ts +33 -0
- package/dist/scaffold-kb/ingest/office-parser.d.ts.map +1 -0
- package/dist/scaffold-kb/ingest/office-parser.js +187 -0
- package/dist/scaffold-kb/ingest/office-parser.js.map +1 -0
- package/dist/scaffold-kb/ingest/url-fetcher.d.ts +43 -0
- package/dist/scaffold-kb/ingest/url-fetcher.d.ts.map +1 -0
- package/dist/scaffold-kb/ingest/url-fetcher.js +245 -0
- package/dist/scaffold-kb/ingest/url-fetcher.js.map +1 -0
- package/dist/scaffold-kb/ingester.d.ts +38 -0
- package/dist/scaffold-kb/ingester.d.ts.map +1 -0
- package/dist/scaffold-kb/ingester.js +261 -0
- package/dist/scaffold-kb/ingester.js.map +1 -0
- package/dist/scaffold-kb/injection-format.d.ts +25 -0
- package/dist/scaffold-kb/injection-format.d.ts.map +1 -0
- package/dist/scaffold-kb/injection-format.js +55 -0
- package/dist/scaffold-kb/injection-format.js.map +1 -0
- package/dist/scaffold-kb/kb-writer.d.ts +13 -0
- package/dist/scaffold-kb/kb-writer.d.ts.map +1 -0
- package/dist/scaffold-kb/kb-writer.js +69 -0
- package/dist/scaffold-kb/kb-writer.js.map +1 -0
- package/dist/scaffold-kb/keyword-extract.d.ts +16 -0
- package/dist/scaffold-kb/keyword-extract.d.ts.map +1 -0
- package/dist/scaffold-kb/keyword-extract.js +49 -0
- package/dist/scaffold-kb/keyword-extract.js.map +1 -0
- package/dist/scaffold-kb/query-sanitizer.d.ts +28 -0
- package/dist/scaffold-kb/query-sanitizer.d.ts.map +1 -0
- package/dist/scaffold-kb/query-sanitizer.js +38 -0
- package/dist/scaffold-kb/query-sanitizer.js.map +1 -0
- package/dist/scaffold-kb/recall-eval.d.ts +48 -0
- package/dist/scaffold-kb/recall-eval.d.ts.map +1 -0
- package/dist/scaffold-kb/recall-eval.js +55 -0
- package/dist/scaffold-kb/recall-eval.js.map +1 -0
- package/dist/scaffold-kb/schema-compat.d.ts +22 -0
- package/dist/scaffold-kb/schema-compat.d.ts.map +1 -0
- package/dist/scaffold-kb/schema-compat.js +32 -0
- package/dist/scaffold-kb/schema-compat.js.map +1 -0
- package/dist/scaffold-kb/search-core.d.ts +42 -0
- package/dist/scaffold-kb/search-core.d.ts.map +1 -0
- package/dist/scaffold-kb/search-core.js +89 -0
- package/dist/scaffold-kb/search-core.js.map +1 -0
- package/dist/scaffold-kb/sqlite-engine.d.ts +58 -0
- package/dist/scaffold-kb/sqlite-engine.d.ts.map +1 -0
- package/dist/scaffold-kb/sqlite-engine.js +61 -0
- package/dist/scaffold-kb/sqlite-engine.js.map +1 -0
- package/dist/scaffold-kb/sqlite-writer.d.ts +18 -0
- package/dist/scaffold-kb/sqlite-writer.d.ts.map +1 -0
- package/dist/scaffold-kb/sqlite-writer.js +76 -0
- package/dist/scaffold-kb/sqlite-writer.js.map +1 -0
- package/dist/scaffold-kb/tokenizer.d.ts +26 -0
- package/dist/scaffold-kb/tokenizer.d.ts.map +1 -0
- package/dist/scaffold-kb/tokenizer.js +97 -0
- package/dist/scaffold-kb/tokenizer.js.map +1 -0
- package/dist/scaffold-kb/types.d.ts +157 -0
- package/dist/scaffold-kb/types.d.ts.map +1 -0
- package/dist/scaffold-kb/types.js +5 -0
- package/dist/scaffold-kb/types.js.map +1 -0
- package/dist/utils/file-scanner.d.ts +15 -0
- package/dist/utils/file-scanner.d.ts.map +1 -1
- package/dist/utils/file-scanner.js +18 -1
- package/dist/utils/file-scanner.js.map +1 -1
- package/dist/utils/string-distance.d.ts +20 -0
- package/dist/utils/string-distance.d.ts.map +1 -0
- package/dist/utils/string-distance.js +38 -0
- package/dist/utils/string-distance.js.map +1 -0
- package/package.json +22 -3
- package/plugins/demo-kb-en/.claude-plugin/plugin.json +11 -0
- package/plugins/demo-kb-en/.mcp.json +8 -0
- package/plugins/demo-kb-en/FIXTURE.json +23 -0
- package/plugins/demo-kb-en/FIXTURE.md +53 -0
- package/plugins/demo-kb-en/ingest-samples/meeting-notes.md +13 -0
- package/plugins/demo-kb-en/kb/api-entities.json +3445 -0
- package/plugins/demo-kb-en/kb/chunks.sqlite +0 -0
- package/plugins/demo-kb-en/kb/doc-graph.json +113 -0
- package/plugins/demo-kb-zh/.claude-plugin/plugin.json +11 -0
- package/plugins/demo-kb-zh/.mcp.json +8 -0
- package/plugins/demo-kb-zh/FIXTURE.json +23 -0
- package/plugins/demo-kb-zh/FIXTURE.md +63 -0
- package/plugins/demo-kb-zh/ingest-samples/meeting-notes.md +13 -0
- package/plugins/demo-kb-zh/kb/api-entities.json +990 -0
- package/plugins/demo-kb-zh/kb/chunks.sqlite +0 -0
- package/plugins/demo-kb-zh/kb/doc-graph.json +113 -0
- package/plugins/spec-driver/.claude-plugin/plugin.json +1 -1
- package/plugins/spec-driver/README.md +50 -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 +108 -1
- package/plugins/spec-driver/config/orchestration.yaml +39 -31
- package/plugins/spec-driver/contracts/orchestration-overrides-contract.yaml +27 -0
- package/plugins/spec-driver/contracts/orchestration-schema.mjs +272 -227
- package/plugins/spec-driver/contracts/wrapper-source-of-truth.yaml +3 -0
- package/plugins/spec-driver/docs/customization.md +134 -0
- package/plugins/spec-driver/docs/spectra-mcp-integration.md +165 -0
- package/plugins/spec-driver/hooks/hooks.json +9 -0
- package/plugins/spec-driver/hooks/stop-fix-compliance-check.sh +36 -0
- package/plugins/spec-driver/lib/delegation-contract.mjs +84 -0
- package/plugins/spec-driver/lib/orchestration-resolver.mjs +49 -0
- package/plugins/spec-driver/lib/orchestrator.mjs +29 -1
- package/plugins/spec-driver/lib/preference-rules.mjs +96 -0
- package/plugins/spec-driver/scripts/codex-skills.sh +28 -28
- package/plugins/spec-driver/scripts/dev/spike-fix-compliance-e2e.mjs +130 -0
- package/plugins/spec-driver/scripts/fix-compliance-judge.mjs +415 -0
- package/plugins/spec-driver/scripts/generate-adoption-insights.mjs +48 -1
- package/plugins/spec-driver/scripts/goal-loop-cli.mjs +307 -0
- package/plugins/spec-driver/scripts/init-project.sh +56 -0
- package/plugins/spec-driver/scripts/kb-prequery.mjs +125 -0
- package/plugins/spec-driver/scripts/lib/config-schema.mjs +200 -94
- package/plugins/spec-driver/scripts/lib/ensure-gitignore.sh +277 -0
- package/plugins/spec-driver/scripts/lib/extract-wrapper-body.mjs +136 -0
- package/plugins/spec-driver/scripts/lib/fix-compliance-core.mjs +434 -0
- package/plugins/spec-driver/scripts/lib/fix-compliance-io.mjs +335 -0
- package/plugins/spec-driver/scripts/lib/goal-loop-core.mjs +783 -0
- package/plugins/spec-driver/scripts/lib/init-project-output.sh +28 -0
- package/plugins/spec-driver/scripts/lib/load-zod.mjs +62 -0
- package/plugins/spec-driver/scripts/lib/project-profile-resolver.mjs +141 -49
- package/plugins/spec-driver/scripts/lib/project-profile-schema.mjs +88 -54
- package/plugins/spec-driver/scripts/postinstall.sh +13 -1
- package/plugins/spec-driver/scripts/record-workflow-run.mjs +75 -0
- package/plugins/spec-driver/scripts/sync-delegation-contract.mjs +187 -0
- package/plugins/spec-driver/scripts/sync-preference-rules.mjs +148 -0
- package/plugins/spec-driver/scripts/validate-orchestrator-models.mjs +156 -0
- package/plugins/spec-driver/scripts/validate-wrapper-sources.mjs +46 -1
- package/plugins/spec-driver/skills/spec-driver-feature/SKILL.md +302 -0
- package/plugins/spec-driver/skills/spec-driver-fix/SKILL.md +97 -8
- package/plugins/spec-driver/skills/spec-driver-implement/SKILL.md +18 -0
- package/plugins/spec-driver/skills/spec-driver-refactor/SKILL.md +10 -0
- package/plugins/spec-driver/skills/spec-driver-resume/SKILL.md +12 -1
- package/plugins/spec-driver/skills/spec-driver-story/SKILL.md +30 -0
- package/plugins/spec-driver/templates/delegation-contract.md +27 -0
- package/plugins/spec-driver/templates/goal-loop-override-template.yaml +284 -0
- package/plugins/spec-driver/templates/preference-rules.md +39 -0
- package/plugins/spec-driver/templates/specify-base/project-context-template.yaml +10 -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/module-spec.hbs +1 -0
- package/templates/product-overview.hbs +1 -1
|
@@ -1,4 +1,53 @@
|
|
|
1
1
|
// ============================================================
|
|
2
|
+
// Feature 154 — callSites 抽取常量
|
|
3
|
+
// 集合内容与 scripts/lib/java-call-extractor.mjs 同名集合保持完全一致;
|
|
4
|
+
// java-mapper-callsite.test.ts 在常量同源 describe 块中通过 import extractor
|
|
5
|
+
// 侧 export 做集合相等断言,CI 全集校验,任一侧扩展时另一侧必失败提示。
|
|
6
|
+
// ============================================================
|
|
7
|
+
/** 大文件兜底阈值(FR-006)— 1 MB 字节数(非字符数) */
|
|
8
|
+
export const CALLSITES_MAX_FILE_BYTES = 1_048_576;
|
|
9
|
+
/**
|
|
10
|
+
* 反射方法名集合(FR-005)— 与 java-call-extractor.mjs:REFLECTION_METHOD_NAMES 同源。
|
|
11
|
+
* receiver 检查之前优先短路:callee 名命中此集合 → calleeKind: 'unresolved'。
|
|
12
|
+
*/
|
|
13
|
+
export const JAVA_REFLECTION_METHOD_NAMES = new Set([
|
|
14
|
+
'forName',
|
|
15
|
+
'invoke',
|
|
16
|
+
'newInstance',
|
|
17
|
+
'getDeclaredMethod',
|
|
18
|
+
'getMethod',
|
|
19
|
+
'getDeclaredField',
|
|
20
|
+
'getField',
|
|
21
|
+
'getConstructor',
|
|
22
|
+
'getDeclaredConstructor',
|
|
23
|
+
'getConstructors',
|
|
24
|
+
'getDeclaredConstructors',
|
|
25
|
+
'newProxyInstance',
|
|
26
|
+
]);
|
|
27
|
+
/**
|
|
28
|
+
* Java 标准库 acronym 类型白名单 — 与 java-call-extractor.mjs:JAVA_ACRONYM_TYPE_NAMES 同源。
|
|
29
|
+
* 全大写但属于 Java 标准库类型(如 java.util.UUID, java.net.URL);用于 _isJavaTypeName。
|
|
30
|
+
*/
|
|
31
|
+
export const JAVA_ACRONYM_TYPE_NAMES = new Set([
|
|
32
|
+
'URL', 'URI', 'UUID',
|
|
33
|
+
'XML', 'JSON', 'CSV',
|
|
34
|
+
'API', 'JDBC', 'JNDI',
|
|
35
|
+
'AWS', 'TCP', 'UDP',
|
|
36
|
+
'SQL', 'JPA',
|
|
37
|
+
'IO',
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Java 包根名白名单 — 与 java-call-extractor.mjs:JAVA_PACKAGE_ROOT_NAMES 同源。
|
|
41
|
+
* 仅在 _looksLikePackageQualifiedType 内使用,用于判定 FQN 类型路径
|
|
42
|
+
* (如 java.util.UUID);**不在 _isJavaTypeName 内使用**,避免 `com` / `org`
|
|
43
|
+
* 单独被误判为类型(Codex P1 WARNING W-2)。
|
|
44
|
+
*/
|
|
45
|
+
export const JAVA_PACKAGE_ROOT_NAMES = new Set([
|
|
46
|
+
'java', 'javax', 'jakarta',
|
|
47
|
+
'com', 'org', 'net',
|
|
48
|
+
'io', 'edu', 'gov', 'mil',
|
|
49
|
+
]);
|
|
50
|
+
// ============================================================
|
|
2
51
|
// 辅助工具
|
|
3
52
|
// ============================================================
|
|
4
53
|
/** 获取节点的命名字段文本 */
|
|
@@ -161,6 +210,46 @@ export class JavaMapper {
|
|
|
161
210
|
this._collectErrors(tree.rootNode, errors);
|
|
162
211
|
return errors;
|
|
163
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Feature 154 — 抽取 Java 函数调用点(FR-001 ~ FR-013)。
|
|
215
|
+
*
|
|
216
|
+
* 节点覆盖(FR-001):
|
|
217
|
+
* - method_invocation:实例 / 静态方法调用
|
|
218
|
+
* - object_creation_expression:构造器调用 (new ClassName())
|
|
219
|
+
* - explicit_constructor_invocation:super(...) / this(...)
|
|
220
|
+
* - lambda_expression 内部上述三类调用
|
|
221
|
+
*
|
|
222
|
+
* 大文件兜底(FR-006,Codex P1 WARNING W-1 修订:用字节数而非字符数):
|
|
223
|
+
* - Buffer.byteLength(source, 'utf8') > CALLSITES_MAX_FILE_BYTES → 直接返回 []
|
|
224
|
+
*
|
|
225
|
+
* Parse 异常兜底:
|
|
226
|
+
* - 任何异常被外层 try-catch 捕获 → 返回 [] + warn 日志,不污染 CodeSkeleton
|
|
227
|
+
*
|
|
228
|
+
* 详细 kind 映射规则见 spec FR-003 + plan _classifyMethodInvocation 优先级 dispatch。
|
|
229
|
+
*/
|
|
230
|
+
extractCallSites(tree, source) {
|
|
231
|
+
const byteLength = Buffer.byteLength(source, 'utf8');
|
|
232
|
+
if (byteLength > CALLSITES_MAX_FILE_BYTES) {
|
|
233
|
+
// FR-006:大文件兜底必须 warn(Codex T-1 review CRITICAL B 修订)
|
|
234
|
+
console.warn(`[java-mapper] extractCallSites 大文件跳过:byteLength=${byteLength} > ${CALLSITES_MAX_FILE_BYTES}`);
|
|
235
|
+
return [];
|
|
236
|
+
}
|
|
237
|
+
try {
|
|
238
|
+
const out = [];
|
|
239
|
+
this._walkCallSites(tree.rootNode, out);
|
|
240
|
+
return out;
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
// 异常兜底:保留诊断上下文(root node type + byteLength + stack)
|
|
244
|
+
// 便于排错而非静默吞掉真实 bug(Codex T-1 review WARNING C 修订)
|
|
245
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
246
|
+
const stack = err instanceof Error ? err.stack : undefined;
|
|
247
|
+
console.warn(`[java-mapper] extractCallSites 异常兜底:` +
|
|
248
|
+
`rootType=${tree.rootNode.type} byteLength=${byteLength} message=${message}` +
|
|
249
|
+
(stack ? `\n${stack}` : ''));
|
|
250
|
+
return [];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
164
253
|
// ============================================================
|
|
165
254
|
// 内部方法 — 顶层声明提取
|
|
166
255
|
// ============================================================
|
|
@@ -401,5 +490,516 @@ export class JavaMapper {
|
|
|
401
490
|
}
|
|
402
491
|
}
|
|
403
492
|
}
|
|
493
|
+
// ============================================================
|
|
494
|
+
// Feature 154 — call sites walker(T-3.1 阶段填充逻辑)
|
|
495
|
+
// ============================================================
|
|
496
|
+
/**
|
|
497
|
+
* 迭代式 DFS walker(手工栈,避免大文件递归爆栈)。
|
|
498
|
+
*
|
|
499
|
+
* 节点类型 dispatch(FR-001):
|
|
500
|
+
* - method_invocation → _handleMethodInvocation
|
|
501
|
+
* - object_creation_expression → _handleObjectCreation
|
|
502
|
+
* - explicit_constructor_invocation → _handleExplicitConstructorInvocation
|
|
503
|
+
*
|
|
504
|
+
* ERROR / MISSING 跳过策略(FR-007):
|
|
505
|
+
* - node.type === 'ERROR' 或 node.isMissing === true → 跳过该节点 + 不入栈子节点
|
|
506
|
+
* - 非 ERROR/MISSING 节点正常入栈 namedChildren
|
|
507
|
+
*/
|
|
508
|
+
_walkCallSites(root, out) {
|
|
509
|
+
const stack = [root];
|
|
510
|
+
while (stack.length > 0) {
|
|
511
|
+
const node = stack.pop();
|
|
512
|
+
if (!node)
|
|
513
|
+
continue;
|
|
514
|
+
// ERROR / MISSING 子树整体跳过(不抽取本节点 + 不入栈子节点)
|
|
515
|
+
if (node.type === 'ERROR' || node.isMissing === true) {
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
switch (node.type) {
|
|
519
|
+
case 'method_invocation':
|
|
520
|
+
this._handleMethodInvocation(node, out);
|
|
521
|
+
break;
|
|
522
|
+
case 'object_creation_expression':
|
|
523
|
+
this._handleObjectCreation(node, out);
|
|
524
|
+
break;
|
|
525
|
+
case 'explicit_constructor_invocation':
|
|
526
|
+
this._handleExplicitConstructorInvocation(node, out);
|
|
527
|
+
break;
|
|
528
|
+
default:
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
// 入栈所有 namedChildren(继续 DFS)
|
|
532
|
+
const children = node.namedChildren;
|
|
533
|
+
if (children && children.length > 0) {
|
|
534
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
535
|
+
const child = children[i];
|
|
536
|
+
if (child)
|
|
537
|
+
stack.push(child);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
// ============================================================
|
|
543
|
+
// Feature 154 — callerContext 解析(T-3.2)
|
|
544
|
+
// ============================================================
|
|
545
|
+
/**
|
|
546
|
+
* 向上 walk 找最近一层 function-like enclosing scope,输出 callerContext 字符串。
|
|
547
|
+
*
|
|
548
|
+
* 与 scripts/lib/java-call-extractor.mjs 的 _resolveJavaCaller 嵌套优先策略一致:
|
|
549
|
+
* - method_declaration → "{TypeName}.{methodName}"
|
|
550
|
+
* - constructor_declaration → "{TypeName}.<init>"
|
|
551
|
+
* - compact_constructor_declaration → "{TypeName}.<init>" (Java 14+ record)
|
|
552
|
+
* - lambda_expression → "<lambda:{startLine}:{startColumn}>"
|
|
553
|
+
* - 顶层(无 enclosing scope) → "<top-level>"
|
|
554
|
+
*
|
|
555
|
+
* 嵌套优先:第一个匹配立即 return,不继续向上 walk。
|
|
556
|
+
*/
|
|
557
|
+
_resolveCallerContext(node) {
|
|
558
|
+
let cursor = node.parent;
|
|
559
|
+
while (cursor) {
|
|
560
|
+
const t = cursor.type;
|
|
561
|
+
if (t === 'method_declaration') {
|
|
562
|
+
const nameNode = cursor.childForFieldName('name');
|
|
563
|
+
const methodName = nameNode && typeof nameNode.text === 'string' ? nameNode.text : '<anon-method>';
|
|
564
|
+
const typeName = this._findEnclosingTypeName(cursor.parent);
|
|
565
|
+
return `${typeName}.${methodName}`;
|
|
566
|
+
}
|
|
567
|
+
if (t === 'constructor_declaration' || t === 'compact_constructor_declaration') {
|
|
568
|
+
const typeName = this._findEnclosingTypeName(cursor.parent);
|
|
569
|
+
return `${typeName}.<init>`;
|
|
570
|
+
}
|
|
571
|
+
if (t === 'lambda_expression') {
|
|
572
|
+
const line = (cursor.startPosition?.row ?? 0) + 1;
|
|
573
|
+
const col = cursor.startPosition?.column ?? 0;
|
|
574
|
+
return `<lambda:${line}:${col}>`;
|
|
575
|
+
}
|
|
576
|
+
cursor = cursor.parent;
|
|
577
|
+
}
|
|
578
|
+
return '<top-level>';
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* 从给定节点向上找最近的类型容器,返回类型名或特殊标记。
|
|
582
|
+
*
|
|
583
|
+
* 支持的类型节点(Codex P1 CRITICAL C-7 修订:5 类全覆盖):
|
|
584
|
+
* - class_declaration / interface_declaration / enum_declaration
|
|
585
|
+
* - record_declaration(Java 14+)
|
|
586
|
+
* - annotation_type_declaration(@interface)
|
|
587
|
+
*
|
|
588
|
+
* 特殊:遇 object_creation_expression 内层 class_body → 返回 '<anon-class>'。
|
|
589
|
+
* 找不到容器 → '<top-level>'。
|
|
590
|
+
*/
|
|
591
|
+
_findEnclosingTypeName(node) {
|
|
592
|
+
let cursor = node;
|
|
593
|
+
while (cursor) {
|
|
594
|
+
const t = cursor.type;
|
|
595
|
+
if (t === 'class_declaration' ||
|
|
596
|
+
t === 'interface_declaration' ||
|
|
597
|
+
t === 'enum_declaration' ||
|
|
598
|
+
t === 'record_declaration' ||
|
|
599
|
+
t === 'annotation_type_declaration') {
|
|
600
|
+
const nameNode = cursor.childForFieldName('name');
|
|
601
|
+
if (nameNode && typeof nameNode.text === 'string') {
|
|
602
|
+
return nameNode.text;
|
|
603
|
+
}
|
|
604
|
+
return '<anon-class>';
|
|
605
|
+
}
|
|
606
|
+
// 匿名类:method_declaration 父 class_body 父是 object_creation_expression
|
|
607
|
+
if (t === 'object_creation_expression') {
|
|
608
|
+
return '<anon-class>';
|
|
609
|
+
}
|
|
610
|
+
cursor = cursor.parent;
|
|
611
|
+
}
|
|
612
|
+
return '<top-level>';
|
|
613
|
+
}
|
|
614
|
+
// ============================================================
|
|
615
|
+
// Feature 154 — phantom call 防护 + CallSite 构造(T-3.3 + T-3.4)
|
|
616
|
+
// ============================================================
|
|
617
|
+
/**
|
|
618
|
+
* 判断 method_invocation / object_creation_expression / explicit_constructor_invocation
|
|
619
|
+
* 是否是 phantom call(受 parse error 影响但本节点 type 仍非 ERROR)。
|
|
620
|
+
*
|
|
621
|
+
* Codex P1 CRITICAL C-6 修订:判定为 OR(不是 AND):
|
|
622
|
+
* - 关键 callee 字段子树 hasError === true,OR
|
|
623
|
+
* - direct children 中含 ERROR / MISSING
|
|
624
|
+
*
|
|
625
|
+
* phantom 命中时调用方仅跳过当前 call 的抽取(不 push out),但 walker 继续
|
|
626
|
+
* 入栈 namedChildren,避免内层真实 call 被误杀。
|
|
627
|
+
*/
|
|
628
|
+
_isPhantomCall(node, kind) {
|
|
629
|
+
let calleeForCheck = null;
|
|
630
|
+
if (typeof node.childForFieldName === 'function') {
|
|
631
|
+
if (kind === 'method-invocation') {
|
|
632
|
+
calleeForCheck = node.childForFieldName('name');
|
|
633
|
+
}
|
|
634
|
+
else if (kind === 'object-creation') {
|
|
635
|
+
calleeForCheck = node.childForFieldName('type');
|
|
636
|
+
}
|
|
637
|
+
else if (kind === 'explicit-constructor') {
|
|
638
|
+
calleeForCheck = node.childForFieldName('constructor');
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (calleeForCheck && calleeForCheck.hasError === true) {
|
|
642
|
+
return true;
|
|
643
|
+
}
|
|
644
|
+
const allChildren = Array.isArray(node.children) ? node.children : [];
|
|
645
|
+
return allChildren.some((c) => c && (c.type === 'ERROR' || c.isMissing === true));
|
|
646
|
+
}
|
|
647
|
+
/** 构造单个 CallSite 记录(按 CallSiteSchema,可选字段仅在非 undefined 时写入) */
|
|
648
|
+
_mkCallSite(calleeName, calleeKind, line, column, callerContext, calleeQualifier) {
|
|
649
|
+
// column 由调用方传入(来自 startPosition.column ?? 0),始终为 number,
|
|
650
|
+
// 不需要 if (column !== undefined) 判断(Codex quality-review WARN 修订)
|
|
651
|
+
const cs = {
|
|
652
|
+
calleeName,
|
|
653
|
+
calleeKind,
|
|
654
|
+
line,
|
|
655
|
+
column,
|
|
656
|
+
};
|
|
657
|
+
if (callerContext !== undefined)
|
|
658
|
+
cs.callerContext = callerContext;
|
|
659
|
+
if (calleeQualifier !== undefined)
|
|
660
|
+
cs.calleeQualifier = calleeQualifier;
|
|
661
|
+
return cs;
|
|
662
|
+
}
|
|
663
|
+
// ============================================================
|
|
664
|
+
// Feature 154 — receiver 类型探测辅助(T-2.1)
|
|
665
|
+
// 设计与 scripts/lib/java-call-extractor.mjs 同源(语义对齐 truth-set)
|
|
666
|
+
// ============================================================
|
|
667
|
+
/**
|
|
668
|
+
* 判断 identifier text 是否符合 Java 类型命名约定。
|
|
669
|
+
*
|
|
670
|
+
* Java 命名约定:
|
|
671
|
+
* - PascalCase(首字母大写 + 含至少一个小写字母):Math, Logger, FileInputStream
|
|
672
|
+
* - 全大写 Acronym(≥ 2 字符且属于白名单):URL, UUID, JSON
|
|
673
|
+
* - 常量 SCREAMING_SNAKE_CASE:LOGGER, MAX_SIZE — **不**视为类型名
|
|
674
|
+
*
|
|
675
|
+
* Codex P1 WARNING W-2 修订:**不在此函数内**判定 JAVA_PACKAGE_ROOT_NAMES。
|
|
676
|
+
* 包根判定只在 _looksLikePackageQualifiedType 内对完整 field_access 链使用,
|
|
677
|
+
* 避免 `com` / `org` 单独被误归为类型。
|
|
678
|
+
*/
|
|
679
|
+
_isJavaTypeName(text) {
|
|
680
|
+
if (typeof text !== 'string' || text.length === 0)
|
|
681
|
+
return false;
|
|
682
|
+
if (!/^[A-Z]/.test(text))
|
|
683
|
+
return false;
|
|
684
|
+
// PascalCase(含小写字母)
|
|
685
|
+
if (/[a-z]/.test(text))
|
|
686
|
+
return true;
|
|
687
|
+
// Acronym 白名单(全大写)
|
|
688
|
+
if (JAVA_ACRONYM_TYPE_NAMES.has(text))
|
|
689
|
+
return true;
|
|
690
|
+
return false;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* 判断 field_access 节点的末段 field 是否是类型名。
|
|
694
|
+
*
|
|
695
|
+
* 三层判定(Codex T-2 review CRITICAL C-1 修订:必须先要求整条链可拆为 segments,
|
|
696
|
+
* 避免 `foo().bar.Baz.call()` 这种 leftmost 是 method_invocation 的链被误判为
|
|
697
|
+
* 类型路径):
|
|
698
|
+
* 0. _fieldAccessSegments 拆链失败(leftmost 不是 simple identifier)→ false
|
|
699
|
+
* 1. 末段 field 是 PascalCase / acronym → 类型路径(Outer.Inner)
|
|
700
|
+
* 2. 末段 field 全大写但首字母大写 + 整条链是已知 Java 包路径 → FQN
|
|
701
|
+
* 类型路径(java.util.UUID)
|
|
702
|
+
*/
|
|
703
|
+
_fieldAccessTerminalIsType(node) {
|
|
704
|
+
// 必须能拆为 [leftmost identifier, ..., field] segment 列表
|
|
705
|
+
const segments = this._fieldAccessSegments(node);
|
|
706
|
+
if (!segments)
|
|
707
|
+
return false;
|
|
708
|
+
const fieldNameNode = node.childForFieldName('field');
|
|
709
|
+
if (!fieldNameNode || typeof fieldNameNode.text !== 'string')
|
|
710
|
+
return false;
|
|
711
|
+
// 局部命名 terminalFieldName 避免与模块顶层 fieldText 工具函数遮蔽
|
|
712
|
+
const terminalFieldName = fieldNameNode.text;
|
|
713
|
+
// Path 1+2: PascalCase 或 acronym 白名单
|
|
714
|
+
if (this._isJavaTypeName(terminalFieldName))
|
|
715
|
+
return true;
|
|
716
|
+
// Path 3: 全大写 field + 整条链是已知 Java 包路径 → FQN type
|
|
717
|
+
if (/^[A-Z]/.test(terminalFieldName)) {
|
|
718
|
+
if (this._looksLikePackageQualifiedType(node))
|
|
719
|
+
return true;
|
|
720
|
+
}
|
|
721
|
+
return false;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* 把 field_access 链拆为 [leftmost, ..., field] 的 segment 数组。
|
|
725
|
+
*
|
|
726
|
+
* 例如 `java.util.UUID` 树形:
|
|
727
|
+
* field_access(field='UUID')
|
|
728
|
+
* └ field_access(field='util')
|
|
729
|
+
* └ identifier 'java'
|
|
730
|
+
* 返回 ['java', 'util', 'UUID']。
|
|
731
|
+
*
|
|
732
|
+
* 任一节点缺 'object'/'field' 字段或 leftmost 非 identifier → 返回 null。
|
|
733
|
+
*/
|
|
734
|
+
_fieldAccessSegments(node) {
|
|
735
|
+
const reversed = [];
|
|
736
|
+
let cursor = node;
|
|
737
|
+
while (cursor &&
|
|
738
|
+
cursor.type === 'field_access' &&
|
|
739
|
+
typeof cursor.childForFieldName === 'function') {
|
|
740
|
+
const fieldNode = cursor.childForFieldName('field');
|
|
741
|
+
if (!fieldNode || typeof fieldNode.text !== 'string')
|
|
742
|
+
return null;
|
|
743
|
+
reversed.push(fieldNode.text);
|
|
744
|
+
cursor = cursor.childForFieldName('object');
|
|
745
|
+
}
|
|
746
|
+
if (!cursor || cursor.type !== 'identifier' || typeof cursor.text !== 'string') {
|
|
747
|
+
return null;
|
|
748
|
+
}
|
|
749
|
+
reversed.push(cursor.text);
|
|
750
|
+
return reversed.reverse();
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* 判断 field_access 链是否是"包路径.类型"形态。
|
|
754
|
+
*
|
|
755
|
+
* 三个条件全满足才返回 true:
|
|
756
|
+
* 1. 链至少 3 段(leftmost + ≥ 1 中间 + 末段类型)
|
|
757
|
+
* 2. leftmost 在 JAVA_PACKAGE_ROOT_NAMES(仅在此函数内使用)
|
|
758
|
+
* 3. 末段之外每段都是 lowercase package segment 形态(^[a-z][a-z0-9_]*$)
|
|
759
|
+
*/
|
|
760
|
+
_looksLikePackageQualifiedType(node) {
|
|
761
|
+
const segments = this._fieldAccessSegments(node);
|
|
762
|
+
if (!segments || segments.length < 3)
|
|
763
|
+
return false;
|
|
764
|
+
// Codex T-2 review WARNING W-2 修订:合同自洽 — 末段必须 PascalCase
|
|
765
|
+
const terminal = segments[segments.length - 1];
|
|
766
|
+
if (!terminal || !/^[A-Z]/.test(terminal))
|
|
767
|
+
return false;
|
|
768
|
+
const packageSegments = segments.slice(0, -1);
|
|
769
|
+
const leftmost = packageSegments[0];
|
|
770
|
+
if (leftmost === undefined || !JAVA_PACKAGE_ROOT_NAMES.has(leftmost))
|
|
771
|
+
return false;
|
|
772
|
+
return packageSegments.every((s) => /^[a-z][a-z0-9_]*$/.test(s));
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* 把 scoped type name normalize 到末段(label-only 对齐 truth-set)。
|
|
776
|
+
* 例如 `Outer.Inner` → `Inner`;`com.foo.Bar` → `Bar`。
|
|
777
|
+
*/
|
|
778
|
+
_normalizeJavaTypeName(name) {
|
|
779
|
+
if (typeof name !== 'string' || name.length === 0)
|
|
780
|
+
return name;
|
|
781
|
+
const lastDot = name.lastIndexOf('.');
|
|
782
|
+
return lastDot === -1 ? name : name.slice(lastDot + 1);
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* 剥离 generic_type.text 中的 type arguments。
|
|
786
|
+
*
|
|
787
|
+
* Codex T-2 review WARNING W-1 修订:用 depth-based 解析处理嵌套泛型,
|
|
788
|
+
* 避免 `Outer<T>.Inner<K>` 被首个 `<` 截断为 `Outer`(应保留 `Outer.Inner`)。
|
|
789
|
+
*
|
|
790
|
+
* 例如:
|
|
791
|
+
* `ArrayList<String>` → `ArrayList`
|
|
792
|
+
* `Outer.Inner<T,K>` → `Outer.Inner`
|
|
793
|
+
* `Outer<T>.Inner<K>` → `Outer.Inner`
|
|
794
|
+
* `Map<K, List<V>>` → `Map`
|
|
795
|
+
*/
|
|
796
|
+
_stripTypeArgs(text) {
|
|
797
|
+
if (typeof text !== 'string' || text.length === 0)
|
|
798
|
+
return text;
|
|
799
|
+
let depth = 0;
|
|
800
|
+
let out = '';
|
|
801
|
+
for (const ch of text) {
|
|
802
|
+
if (ch === '<') {
|
|
803
|
+
depth += 1;
|
|
804
|
+
continue;
|
|
805
|
+
}
|
|
806
|
+
if (ch === '>') {
|
|
807
|
+
depth = Math.max(0, depth - 1);
|
|
808
|
+
continue;
|
|
809
|
+
}
|
|
810
|
+
if (depth === 0)
|
|
811
|
+
out += ch;
|
|
812
|
+
}
|
|
813
|
+
return out;
|
|
814
|
+
}
|
|
815
|
+
// ============================================================
|
|
816
|
+
// Feature 154 — classify methods(T-2.2 + T-2.3)
|
|
817
|
+
// 优先级 dispatch 详见 spec FR-003 + plan 修订版伪代码
|
|
818
|
+
// ============================================================
|
|
819
|
+
/**
|
|
820
|
+
* 分类 method_invocation 节点 → CallSite 元数据。
|
|
821
|
+
*
|
|
822
|
+
* 优先级 dispatch(spec FR-003 + Codex CRITICAL E 修订):
|
|
823
|
+
* 1. objectNode.type === 'super' → super
|
|
824
|
+
* 2. callee 名 ∈ JAVA_REFLECTION_METHOD_NAMES → unresolved
|
|
825
|
+
* 3. objectNode.type === 'this' → member + undefined
|
|
826
|
+
* 4. type_identifier / scoped_type_identifier → member + 末段类名
|
|
827
|
+
* 5. identifier (PascalCase / acronym) → member + identifier 文本
|
|
828
|
+
* 6. identifier (lowercase 变量名) → cross-module + identifier 文本
|
|
829
|
+
* 7. field_access 末段 type → member + 末段类名
|
|
830
|
+
* 8. field_access 末段非 type → cross-module + undefined
|
|
831
|
+
* 9. 其它带 receiver → cross-module + undefined
|
|
832
|
+
* 10. 无 receiver → member + undefined
|
|
833
|
+
*/
|
|
834
|
+
_classifyMethodInvocation(node) {
|
|
835
|
+
if (typeof node.childForFieldName !== 'function') {
|
|
836
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
837
|
+
}
|
|
838
|
+
const nameNode = node.childForFieldName('name');
|
|
839
|
+
if (!nameNode || typeof nameNode.text !== 'string') {
|
|
840
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
841
|
+
}
|
|
842
|
+
const calleeName = nameNode.text;
|
|
843
|
+
const objectNode = node.childForFieldName('object');
|
|
844
|
+
// 1. super.method() → super(super() / this() 由 _handleExplicitConstructorInvocation 处理)
|
|
845
|
+
if (objectNode && objectNode.type === 'super') {
|
|
846
|
+
return { calleeName, calleeKind: 'super' };
|
|
847
|
+
}
|
|
848
|
+
// 2. 反射方法名 short-circuit
|
|
849
|
+
if (JAVA_REFLECTION_METHOD_NAMES.has(calleeName)) {
|
|
850
|
+
return { calleeName, calleeKind: 'unresolved' };
|
|
851
|
+
}
|
|
852
|
+
// 3. this.method() — Codex CRITICAL E:tree-sitter 把 'this' 解析为独立 node type
|
|
853
|
+
if (objectNode && objectNode.type === 'this') {
|
|
854
|
+
return { calleeName, calleeKind: 'member' };
|
|
855
|
+
}
|
|
856
|
+
if (objectNode) {
|
|
857
|
+
// 4. type_identifier / scoped_type_identifier
|
|
858
|
+
if (objectNode.type === 'type_identifier' ||
|
|
859
|
+
objectNode.type === 'scoped_type_identifier') {
|
|
860
|
+
return {
|
|
861
|
+
calleeName,
|
|
862
|
+
calleeKind: 'member',
|
|
863
|
+
calleeQualifier: this._normalizeJavaTypeName(objectNode.text),
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
// 5/6. identifier
|
|
867
|
+
if (objectNode.type === 'identifier' && typeof objectNode.text === 'string') {
|
|
868
|
+
if (this._isJavaTypeName(objectNode.text)) {
|
|
869
|
+
// PascalCase / acronym → static member
|
|
870
|
+
return {
|
|
871
|
+
calleeName,
|
|
872
|
+
calleeKind: 'member',
|
|
873
|
+
calleeQualifier: objectNode.text,
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
// lowercase variable → instance method
|
|
877
|
+
return {
|
|
878
|
+
calleeName,
|
|
879
|
+
calleeKind: 'cross-module',
|
|
880
|
+
calleeQualifier: objectNode.text,
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
// 7/8. field_access — Codex T-2 review CRITICAL C-1 修订:
|
|
884
|
+
// _fieldAccessTerminalIsType 内已强制要求 _fieldAccessSegments 非空,
|
|
885
|
+
// 此处 segs 必非空,直接取末段做 qualifier
|
|
886
|
+
if (objectNode.type === 'field_access') {
|
|
887
|
+
if (this._fieldAccessTerminalIsType(objectNode)) {
|
|
888
|
+
const segs = this._fieldAccessSegments(objectNode);
|
|
889
|
+
// _fieldAccessTerminalIsType 已验证 segs 非空,但 TS 类型仍需 narrowing
|
|
890
|
+
const qualifier = segs && segs.length > 0
|
|
891
|
+
? segs[segs.length - 1]
|
|
892
|
+
: this._normalizeJavaTypeName(objectNode.text);
|
|
893
|
+
return { calleeName, calleeKind: 'member', calleeQualifier: qualifier };
|
|
894
|
+
}
|
|
895
|
+
return { calleeName, calleeKind: 'cross-module' };
|
|
896
|
+
}
|
|
897
|
+
// 9. 其它 receiver(method_invocation 链 / array_access / parenthesized 等)
|
|
898
|
+
return { calleeName, calleeKind: 'cross-module' };
|
|
899
|
+
}
|
|
900
|
+
// 10. 无 receiver(含 static import 展开 free function)→ 统一归 member
|
|
901
|
+
// spec FR-003 deferred 决策:不输出 free,与 truth-set kind=method 对齐
|
|
902
|
+
return { calleeName, calleeKind: 'member' };
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* 分类 object_creation_expression 节点(new ClassName())→ CallSite 元数据。
|
|
906
|
+
*
|
|
907
|
+
* type 字段三种形态:
|
|
908
|
+
* - type_identifier (`new Foo()`)
|
|
909
|
+
* - generic_type (`new ArrayList<Integer>()`,内层 type_identifier 或 scoped_type_identifier)
|
|
910
|
+
* - scoped_type_identifier (`new Outer.Inner()`)
|
|
911
|
+
*
|
|
912
|
+
* 输出统一 calleeName = calleeQualifier = normalized 末段类名。
|
|
913
|
+
*/
|
|
914
|
+
_classifyObjectCreation(node) {
|
|
915
|
+
if (typeof node.childForFieldName !== 'function') {
|
|
916
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
917
|
+
}
|
|
918
|
+
const typeNode = node.childForFieldName('type');
|
|
919
|
+
if (!typeNode) {
|
|
920
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
921
|
+
}
|
|
922
|
+
let rawName;
|
|
923
|
+
if (typeNode.type === 'type_identifier' && typeof typeNode.text === 'string') {
|
|
924
|
+
rawName = typeNode.text;
|
|
925
|
+
}
|
|
926
|
+
else if (typeNode.type === 'scoped_type_identifier' && typeof typeNode.text === 'string') {
|
|
927
|
+
rawName = typeNode.text;
|
|
928
|
+
}
|
|
929
|
+
else if (typeNode.type === 'generic_type') {
|
|
930
|
+
// 内层 type_identifier / scoped_type_identifier 优先
|
|
931
|
+
const named = Array.isArray(typeNode.namedChildren) ? typeNode.namedChildren : [];
|
|
932
|
+
const inner = named.find((c) => c && (c.type === 'type_identifier' || c.type === 'scoped_type_identifier'));
|
|
933
|
+
if (inner && typeof inner.text === 'string') {
|
|
934
|
+
rawName = inner.text;
|
|
935
|
+
}
|
|
936
|
+
else if (typeof typeNode.text === 'string') {
|
|
937
|
+
rawName = this._stripTypeArgs(typeNode.text);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
else if (typeof typeNode.text === 'string' && typeNode.text.length > 0) {
|
|
941
|
+
rawName = this._stripTypeArgs(typeNode.text);
|
|
942
|
+
}
|
|
943
|
+
if (!rawName) {
|
|
944
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
945
|
+
}
|
|
946
|
+
const className = this._normalizeJavaTypeName(rawName);
|
|
947
|
+
return {
|
|
948
|
+
calleeName: className,
|
|
949
|
+
calleeKind: 'member',
|
|
950
|
+
calleeQualifier: className,
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* 分类 explicit_constructor_invocation 节点(构造器内 super(...) / this(...))。
|
|
955
|
+
*
|
|
956
|
+
* constructor 字段 type === 'super' / 'this' → kind=super,calleeName 为字面值。
|
|
957
|
+
* 其它形态 → unresolved。
|
|
958
|
+
*/
|
|
959
|
+
_classifyExplicitConstructorInvocation(node) {
|
|
960
|
+
if (typeof node.childForFieldName !== 'function') {
|
|
961
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
962
|
+
}
|
|
963
|
+
const ctorNode = node.childForFieldName('constructor');
|
|
964
|
+
if (!ctorNode) {
|
|
965
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
966
|
+
}
|
|
967
|
+
if (ctorNode.type === 'super' || ctorNode.type === 'this') {
|
|
968
|
+
return { calleeName: ctorNode.type, calleeKind: 'super' };
|
|
969
|
+
}
|
|
970
|
+
if (typeof ctorNode.text === 'string') {
|
|
971
|
+
return { calleeName: ctorNode.text, calleeKind: 'unresolved' };
|
|
972
|
+
}
|
|
973
|
+
return { calleeName: '<unknown>', calleeKind: 'unresolved' };
|
|
974
|
+
}
|
|
975
|
+
// ============================================================
|
|
976
|
+
// Feature 154 — handler 接通完整链路(T-3.4)
|
|
977
|
+
// 流程:phantom 检查 → classify → callerContext → push out
|
|
978
|
+
//
|
|
979
|
+
// Codex T-3 review WARNING F 修订:3 个 handler 共用 _emitCallSite helper,
|
|
980
|
+
// 避免 line/column/callerContext/push 写入逻辑在多处漂移。
|
|
981
|
+
// ============================================================
|
|
982
|
+
/** 共用 emit 流程:phantom check → classify → callerContext → push */
|
|
983
|
+
_emitCallSite(node, out, phantomKind, classifier) {
|
|
984
|
+
if (this._isPhantomCall(node, phantomKind))
|
|
985
|
+
return;
|
|
986
|
+
const cls = classifier(node);
|
|
987
|
+
const callerCtx = this._resolveCallerContext(node);
|
|
988
|
+
const line = (node.startPosition?.row ?? 0) + 1;
|
|
989
|
+
const col = node.startPosition?.column ?? 0;
|
|
990
|
+
out.push(this._mkCallSite(cls.calleeName, cls.calleeKind, line, col, callerCtx, cls.calleeQualifier));
|
|
991
|
+
}
|
|
992
|
+
/** method_invocation handler */
|
|
993
|
+
_handleMethodInvocation(node, out) {
|
|
994
|
+
this._emitCallSite(node, out, 'method-invocation', (n) => this._classifyMethodInvocation(n));
|
|
995
|
+
}
|
|
996
|
+
/** object_creation_expression handler */
|
|
997
|
+
_handleObjectCreation(node, out) {
|
|
998
|
+
this._emitCallSite(node, out, 'object-creation', (n) => this._classifyObjectCreation(n));
|
|
999
|
+
}
|
|
1000
|
+
/** explicit_constructor_invocation handler */
|
|
1001
|
+
_handleExplicitConstructorInvocation(node, out) {
|
|
1002
|
+
this._emitCallSite(node, out, 'explicit-constructor', (n) => this._classifyExplicitConstructorInvocation(n));
|
|
1003
|
+
}
|
|
404
1004
|
}
|
|
405
1005
|
//# sourceMappingURL=java-mapper.js.map
|