arceus-s 1.6.4
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 +395 -0
- package/dist/_shared/graph/types.d.ts +81 -0
- package/dist/_shared/graph/types.d.ts.map +1 -0
- package/dist/_shared/graph/types.js +8 -0
- package/dist/_shared/graph/types.js.map +1 -0
- package/dist/_shared/index.d.ts +63 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +48 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/integrations/circuit-breaker.d.ts +183 -0
- package/dist/_shared/integrations/circuit-breaker.d.ts.map +1 -0
- package/dist/_shared/integrations/circuit-breaker.js +236 -0
- package/dist/_shared/integrations/circuit-breaker.js.map +1 -0
- package/dist/_shared/integrations/resilient-fetch.d.ts +99 -0
- package/dist/_shared/integrations/resilient-fetch.d.ts.map +1 -0
- package/dist/_shared/integrations/resilient-fetch.js +204 -0
- package/dist/_shared/integrations/resilient-fetch.js.map +1 -0
- package/dist/_shared/integrations/retry.d.ts +60 -0
- package/dist/_shared/integrations/retry.d.ts.map +1 -0
- package/dist/_shared/integrations/retry.js +67 -0
- package/dist/_shared/integrations/retry.js.map +1 -0
- package/dist/_shared/integrations/understand-quickly.d.ts +77 -0
- package/dist/_shared/integrations/understand-quickly.d.ts.map +1 -0
- package/dist/_shared/integrations/understand-quickly.js +176 -0
- package/dist/_shared/integrations/understand-quickly.js.map +1 -0
- package/dist/_shared/language-detection.d.ts +23 -0
- package/dist/_shared/language-detection.d.ts.map +1 -0
- package/dist/_shared/language-detection.js +139 -0
- package/dist/_shared/language-detection.js.map +1 -0
- package/dist/_shared/languages.d.ts +26 -0
- package/dist/_shared/languages.d.ts.map +1 -0
- package/dist/_shared/languages.js +27 -0
- package/dist/_shared/languages.js.map +1 -0
- package/dist/_shared/lbug/schema-constants.d.ts +16 -0
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -0
- package/dist/_shared/lbug/schema-constants.js +67 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -0
- package/dist/_shared/mro-strategy.d.ts +41 -0
- package/dist/_shared/mro-strategy.d.ts.map +1 -0
- package/dist/_shared/mro-strategy.js +2 -0
- package/dist/_shared/mro-strategy.js.map +1 -0
- package/dist/_shared/pipeline.d.ts +16 -0
- package/dist/_shared/pipeline.d.ts.map +1 -0
- package/dist/_shared/pipeline.js +5 -0
- package/dist/_shared/pipeline.js.map +1 -0
- package/dist/_shared/scope-resolution/def-index.d.ts +36 -0
- package/dist/_shared/scope-resolution/def-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/def-index.js +51 -0
- package/dist/_shared/scope-resolution/def-index.js.map +1 -0
- package/dist/_shared/scope-resolution/evidence-weights.d.ts +69 -0
- package/dist/_shared/scope-resolution/evidence-weights.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/evidence-weights.js +84 -0
- package/dist/_shared/scope-resolution/evidence-weights.js.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +149 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js +795 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts +26 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/language-classification.js +44 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +106 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js +98 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -0
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +46 -0
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/module-scope-index.js +58 -0
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -0
- package/dist/_shared/scope-resolution/origin-priority.d.ts +14 -0
- package/dist/_shared/scope-resolution/origin-priority.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/origin-priority.js +21 -0
- package/dist/_shared/scope-resolution/origin-priority.js.map +1 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts +76 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/parsed-file.js +54 -0
- package/dist/_shared/scope-resolution/parsed-file.js.map +1 -0
- package/dist/_shared/scope-resolution/position-index.d.ts +62 -0
- package/dist/_shared/scope-resolution/position-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/position-index.js +134 -0
- package/dist/_shared/scope-resolution/position-index.js.map +1 -0
- package/dist/_shared/scope-resolution/qualified-name-index.d.ts +44 -0
- package/dist/_shared/scope-resolution/qualified-name-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/qualified-name-index.js +75 -0
- package/dist/_shared/scope-resolution/qualified-name-index.js.map +1 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts +75 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/reference-site.js +24 -0
- package/dist/_shared/scope-resolution/reference-site.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts +27 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js +30 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts +69 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.js +44 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +56 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.js +150 -0
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts +26 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js +31 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts +81 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js +349 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts +33 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js +56 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts +36 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts +43 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js +60 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js.map +1 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.d.ts +53 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.js +126 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.js.map +1 -0
- package/dist/_shared/scope-resolution/scope-id.d.ts +43 -0
- package/dist/_shared/scope-resolution/scope-id.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-id.js +46 -0
- package/dist/_shared/scope-resolution/scope-id.js.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts +83 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.js +220 -0
- package/dist/_shared/scope-resolution/scope-tree.js.map +1 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +63 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.js +122 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +1 -0
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +59 -0
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/shadow/diff.js +79 -0
- package/dist/_shared/scope-resolution/shadow/diff.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +34 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.js +12 -0
- package/dist/_shared/scope-resolution/symbol-definition.js.map +1 -0
- package/dist/_shared/scope-resolution/types.d.ts +400 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/types.js +25 -0
- package/dist/_shared/scope-resolution/types.js.map +1 -0
- package/dist/_shared/test-helpers.d.ts +13 -0
- package/dist/_shared/test-helpers.d.ts.map +1 -0
- package/dist/_shared/test-helpers.js +13 -0
- package/dist/_shared/test-helpers.js.map +1 -0
- package/dist/cli/ai-context.d.ts +28 -0
- package/dist/cli/ai-context.js +289 -0
- package/dist/cli/analyze.d.ts +80 -0
- package/dist/cli/analyze.js +525 -0
- package/dist/cli/augment.d.ts +13 -0
- package/dist/cli/augment.js +33 -0
- package/dist/cli/clean.d.ts +10 -0
- package/dist/cli/clean.js +79 -0
- package/dist/cli/cli-message.d.ts +16 -0
- package/dist/cli/cli-message.js +71 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +31 -0
- package/dist/cli/eval-server.d.ts +37 -0
- package/dist/cli/eval-server.js +423 -0
- package/dist/cli/group.d.ts +1 -0
- package/dist/cli/group.js +323 -0
- package/dist/cli/index-repo.d.ts +15 -0
- package/dist/cli/index-repo.js +120 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +492 -0
- package/dist/cli/lazy-action.d.ts +6 -0
- package/dist/cli/lazy-action.js +18 -0
- package/dist/cli/list.d.ts +6 -0
- package/dist/cli/list.js +40 -0
- package/dist/cli/mcp.d.ts +29 -0
- package/dist/cli/mcp.js +73 -0
- package/dist/cli/optional-grammars.d.ts +47 -0
- package/dist/cli/optional-grammars.js +87 -0
- package/dist/cli/publish.d.ts +29 -0
- package/dist/cli/publish.js +174 -0
- package/dist/cli/remove.d.ts +30 -0
- package/dist/cli/remove.js +102 -0
- package/dist/cli/serve.d.ts +4 -0
- package/dist/cli/serve.js +55 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +642 -0
- package/dist/cli/skill-gen.d.ts +26 -0
- package/dist/cli/skill-gen.js +555 -0
- package/dist/cli/status.d.ts +6 -0
- package/dist/cli/status.js +36 -0
- package/dist/cli/tool.d.ts +43 -0
- package/dist/cli/tool.js +169 -0
- package/dist/cli/wiki.d.ts +23 -0
- package/dist/cli/wiki.js +616 -0
- package/dist/config/ignore-service.d.ts +35 -0
- package/dist/config/ignore-service.js +439 -0
- package/dist/config/supported-languages.d.ts +13 -0
- package/dist/config/supported-languages.js +13 -0
- package/dist/core/augmentation/engine.d.ts +26 -0
- package/dist/core/augmentation/engine.js +272 -0
- package/dist/core/embedding-mode.d.ts +51 -0
- package/dist/core/embedding-mode.js +48 -0
- package/dist/core/embeddings/ast-utils.d.ts +22 -0
- package/dist/core/embeddings/ast-utils.js +106 -0
- package/dist/core/embeddings/character-chunk.d.ts +12 -0
- package/dist/core/embeddings/character-chunk.js +43 -0
- package/dist/core/embeddings/chunker.d.ts +14 -0
- package/dist/core/embeddings/chunker.js +239 -0
- package/dist/core/embeddings/config.d.ts +2 -0
- package/dist/core/embeddings/config.js +36 -0
- package/dist/core/embeddings/embedder.d.ts +65 -0
- package/dist/core/embeddings/embedder.js +349 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +68 -0
- package/dist/core/embeddings/embedding-pipeline.js +552 -0
- package/dist/core/embeddings/exact-search.d.ts +15 -0
- package/dist/core/embeddings/exact-search.js +27 -0
- package/dist/core/embeddings/hf-env.d.ts +135 -0
- package/dist/core/embeddings/hf-env.js +232 -0
- package/dist/core/embeddings/http-client.d.ts +37 -0
- package/dist/core/embeddings/http-client.js +199 -0
- package/dist/core/embeddings/index.d.ts +10 -0
- package/dist/core/embeddings/index.js +10 -0
- package/dist/core/embeddings/line-index.d.ts +7 -0
- package/dist/core/embeddings/line-index.js +42 -0
- package/dist/core/embeddings/server-mapping.d.ts +15 -0
- package/dist/core/embeddings/server-mapping.js +33 -0
- package/dist/core/embeddings/structural-extractor.d.ts +15 -0
- package/dist/core/embeddings/structural-extractor.js +58 -0
- package/dist/core/embeddings/text-generator.d.ts +31 -0
- package/dist/core/embeddings/text-generator.js +208 -0
- package/dist/core/embeddings/types.d.ts +211 -0
- package/dist/core/embeddings/types.js +202 -0
- package/dist/core/git-staleness.d.ts +37 -0
- package/dist/core/git-staleness.js +167 -0
- package/dist/core/graph/graph.d.ts +2 -0
- package/dist/core/graph/graph.js +173 -0
- package/dist/core/graph/types.d.ts +36 -0
- package/dist/core/graph/types.js +1 -0
- package/dist/core/group/bridge-db.d.ts +82 -0
- package/dist/core/group/bridge-db.js +609 -0
- package/dist/core/group/bridge-schema.d.ts +27 -0
- package/dist/core/group/bridge-schema.js +55 -0
- package/dist/core/group/config-parser.d.ts +7 -0
- package/dist/core/group/config-parser.js +122 -0
- package/dist/core/group/contract-extractor.d.ts +7 -0
- package/dist/core/group/contract-extractor.js +1 -0
- package/dist/core/group/cross-impact.d.ts +85 -0
- package/dist/core/group/cross-impact.js +515 -0
- package/dist/core/group/extractors/elixir-workspace-extractor.d.ts +15 -0
- package/dist/core/group/extractors/elixir-workspace-extractor.js +204 -0
- package/dist/core/group/extractors/fs-utils.d.ts +10 -0
- package/dist/core/group/extractors/fs-utils.js +24 -0
- package/dist/core/group/extractors/go-workspace-extractor.d.ts +14 -0
- package/dist/core/group/extractors/go-workspace-extractor.js +217 -0
- package/dist/core/group/extractors/grpc-extractor.d.ts +25 -0
- package/dist/core/group/extractors/grpc-extractor.js +414 -0
- package/dist/core/group/extractors/grpc-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/go.js +97 -0
- package/dist/core/group/extractors/grpc-patterns/index.d.ts +19 -0
- package/dist/core/group/extractors/grpc-patterns/index.js +46 -0
- package/dist/core/group/extractors/grpc-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/java.js +173 -0
- package/dist/core/group/extractors/grpc-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/grpc-patterns/node.js +290 -0
- package/dist/core/group/extractors/grpc-patterns/proto.d.ts +9 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +134 -0
- package/dist/core/group/extractors/grpc-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/python.js +67 -0
- package/dist/core/group/extractors/grpc-patterns/types.d.ts +50 -0
- package/dist/core/group/extractors/grpc-patterns/types.js +1 -0
- package/dist/core/group/extractors/http-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/go.js +215 -0
- package/dist/core/group/extractors/http-patterns/index.d.ts +17 -0
- package/dist/core/group/extractors/http-patterns/index.js +44 -0
- package/dist/core/group/extractors/http-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/java.js +253 -0
- package/dist/core/group/extractors/http-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/http-patterns/node.js +484 -0
- package/dist/core/group/extractors/http-patterns/php.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/php.js +178 -0
- package/dist/core/group/extractors/http-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/python.js +308 -0
- package/dist/core/group/extractors/http-patterns/types.d.ts +61 -0
- package/dist/core/group/extractors/http-patterns/types.js +1 -0
- package/dist/core/group/extractors/http-route-extractor.d.ts +21 -0
- package/dist/core/group/extractors/http-route-extractor.js +430 -0
- package/dist/core/group/extractors/include-extractor.d.ts +39 -0
- package/dist/core/group/extractors/include-extractor.js +566 -0
- package/dist/core/group/extractors/java-workspace-extractor.d.ts +16 -0
- package/dist/core/group/extractors/java-workspace-extractor.js +204 -0
- package/dist/core/group/extractors/manifest-extractor.d.ts +54 -0
- package/dist/core/group/extractors/manifest-extractor.js +320 -0
- package/dist/core/group/extractors/node-workspace-extractor.d.ts +14 -0
- package/dist/core/group/extractors/node-workspace-extractor.js +207 -0
- package/dist/core/group/extractors/python-workspace-extractor.d.ts +15 -0
- package/dist/core/group/extractors/python-workspace-extractor.js +205 -0
- package/dist/core/group/extractors/rust-workspace-extractor.d.ts +44 -0
- package/dist/core/group/extractors/rust-workspace-extractor.js +240 -0
- package/dist/core/group/extractors/thrift-extractor.d.ts +22 -0
- package/dist/core/group/extractors/thrift-extractor.js +283 -0
- package/dist/core/group/extractors/thrift-patterns/index.d.ts +4 -0
- package/dist/core/group/extractors/thrift-patterns/index.js +10 -0
- package/dist/core/group/extractors/thrift-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/thrift-patterns/java.js +220 -0
- package/dist/core/group/extractors/thrift-patterns/types.d.ts +17 -0
- package/dist/core/group/extractors/thrift-patterns/types.js +1 -0
- package/dist/core/group/extractors/topic-extractor.d.ts +8 -0
- package/dist/core/group/extractors/topic-extractor.js +97 -0
- package/dist/core/group/extractors/topic-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/go.js +120 -0
- package/dist/core/group/extractors/topic-patterns/index.d.ts +14 -0
- package/dist/core/group/extractors/topic-patterns/index.js +38 -0
- package/dist/core/group/extractors/topic-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/java.js +80 -0
- package/dist/core/group/extractors/topic-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/topic-patterns/node.js +155 -0
- package/dist/core/group/extractors/topic-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/python.js +116 -0
- package/dist/core/group/extractors/topic-patterns/types.d.ts +25 -0
- package/dist/core/group/extractors/topic-patterns/types.js +10 -0
- package/dist/core/group/extractors/tree-sitter-scanner.d.ts +113 -0
- package/dist/core/group/extractors/tree-sitter-scanner.js +95 -0
- package/dist/core/group/extractors/workspace-extractor.d.ts +13 -0
- package/dist/core/group/extractors/workspace-extractor.js +65 -0
- package/dist/core/group/group-path-utils.d.ts +17 -0
- package/dist/core/group/group-path-utils.js +40 -0
- package/dist/core/group/matching.d.ts +13 -0
- package/dist/core/group/matching.js +284 -0
- package/dist/core/group/normalization.d.ts +3 -0
- package/dist/core/group/normalization.js +115 -0
- package/dist/core/group/resolve-at-member.d.ts +10 -0
- package/dist/core/group/resolve-at-member.js +31 -0
- package/dist/core/group/service-boundary-detector.d.ts +8 -0
- package/dist/core/group/service-boundary-detector.js +155 -0
- package/dist/core/group/service.d.ts +56 -0
- package/dist/core/group/service.js +395 -0
- package/dist/core/group/storage.d.ts +9 -0
- package/dist/core/group/storage.js +157 -0
- package/dist/core/group/sync.d.ts +21 -0
- package/dist/core/group/sync.js +267 -0
- package/dist/core/group/types.d.ts +181 -0
- package/dist/core/group/types.js +1 -0
- package/dist/core/incremental/shadow-candidates.d.ts +44 -0
- package/dist/core/incremental/shadow-candidates.js +74 -0
- package/dist/core/incremental/subgraph-extract.d.ts +64 -0
- package/dist/core/incremental/subgraph-extract.js +111 -0
- package/dist/core/ingestion/ast-cache.d.ts +26 -0
- package/dist/core/ingestion/ast-cache.js +48 -0
- package/dist/core/ingestion/binding-accumulator.d.ts +212 -0
- package/dist/core/ingestion/binding-accumulator.js +336 -0
- package/dist/core/ingestion/call-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/c-cpp.js +8 -0
- package/dist/core/ingestion/call-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/csharp.js +6 -0
- package/dist/core/ingestion/call-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/dart.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/go.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/jvm.js +51 -0
- package/dist/core/ingestion/call-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/php.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/python.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/ruby.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/rust.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/swift.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/typescript-javascript.js +8 -0
- package/dist/core/ingestion/call-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/call-extractors/generic.js +59 -0
- package/dist/core/ingestion/call-processor.d.ts +235 -0
- package/dist/core/ingestion/call-processor.js +2754 -0
- package/dist/core/ingestion/call-routing.d.ts +55 -0
- package/dist/core/ingestion/call-routing.js +95 -0
- package/dist/core/ingestion/call-types.d.ts +135 -0
- package/dist/core/ingestion/call-types.js +2 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +11 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.js +21 -0
- package/dist/core/ingestion/class-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/dart.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.js +35 -0
- package/dist/core/ingestion/class-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/php.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/python.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/rust.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/swift.js +18 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.d.ts +4 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.js +28 -0
- package/dist/core/ingestion/class-extractors/generic.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/generic.js +135 -0
- package/dist/core/ingestion/class-types.d.ts +34 -0
- package/dist/core/ingestion/class-types.js +1 -0
- package/dist/core/ingestion/cluster-enricher.d.ts +38 -0
- package/dist/core/ingestion/cluster-enricher.js +169 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.d.ts +57 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +376 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +212 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +1727 -0
- package/dist/core/ingestion/cobol/jcl-parser.d.ts +68 -0
- package/dist/core/ingestion/cobol/jcl-parser.js +217 -0
- package/dist/core/ingestion/cobol/jcl-processor.d.ts +33 -0
- package/dist/core/ingestion/cobol/jcl-processor.js +229 -0
- package/dist/core/ingestion/cobol-processor.d.ts +54 -0
- package/dist/core/ingestion/cobol-processor.js +1232 -0
- package/dist/core/ingestion/community-processor.d.ts +39 -0
- package/dist/core/ingestion/community-processor.js +336 -0
- package/dist/core/ingestion/constants.d.ts +17 -0
- package/dist/core/ingestion/constants.js +21 -0
- package/dist/core/ingestion/cpp-ue-preprocessor.d.ts +12 -0
- package/dist/core/ingestion/cpp-ue-preprocessor.js +260 -0
- package/dist/core/ingestion/emit-references.d.ts +88 -0
- package/dist/core/ingestion/emit-references.js +229 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +40 -0
- package/dist/core/ingestion/entry-point-scoring.js +196 -0
- package/dist/core/ingestion/export-detection.d.ts +57 -0
- package/dist/core/ingestion/export-detection.js +233 -0
- package/dist/core/ingestion/field-extractor.d.ts +29 -0
- package/dist/core/ingestion/field-extractor.js +25 -0
- package/dist/core/ingestion/field-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/c-cpp.js +104 -0
- package/dist/core/ingestion/field-extractors/configs/csharp.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/csharp.js +121 -0
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/dart.js +78 -0
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +11 -0
- package/dist/core/ingestion/field-extractors/configs/go.js +60 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +53 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.js +158 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.js +118 -0
- package/dist/core/ingestion/field-extractors/configs/php.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/php.js +65 -0
- package/dist/core/ingestion/field-extractors/configs/python.d.ts +12 -0
- package/dist/core/ingestion/field-extractors/configs/python.js +91 -0
- package/dist/core/ingestion/field-extractors/configs/ruby.d.ts +16 -0
- package/dist/core/ingestion/field-extractors/configs/ruby.js +76 -0
- package/dist/core/ingestion/field-extractors/configs/rust.d.ts +9 -0
- package/dist/core/ingestion/field-extractors/configs/rust.js +52 -0
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/swift.js +65 -0
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +56 -0
- package/dist/core/ingestion/field-extractors/generic.d.ts +49 -0
- package/dist/core/ingestion/field-extractors/generic.js +117 -0
- package/dist/core/ingestion/field-extractors/typescript.d.ts +77 -0
- package/dist/core/ingestion/field-extractors/typescript.js +291 -0
- package/dist/core/ingestion/field-types.d.ts +61 -0
- package/dist/core/ingestion/field-types.js +2 -0
- package/dist/core/ingestion/filesystem-walker.d.ts +28 -0
- package/dist/core/ingestion/filesystem-walker.js +92 -0
- package/dist/core/ingestion/finalize-orchestrator.d.ts +63 -0
- package/dist/core/ingestion/finalize-orchestrator.js +142 -0
- package/dist/core/ingestion/framework-detection.d.ts +30 -0
- package/dist/core/ingestion/framework-detection.js +428 -0
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +13 -0
- package/dist/core/ingestion/heritage-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +18 -0
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +65 -0
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +23 -0
- package/dist/core/ingestion/heritage-extractors/generic.js +47 -0
- package/dist/core/ingestion/heritage-processor.d.ts +54 -0
- package/dist/core/ingestion/heritage-processor.js +367 -0
- package/dist/core/ingestion/heritage-types.d.ts +73 -0
- package/dist/core/ingestion/heritage-types.js +2 -0
- package/dist/core/ingestion/import-processor.d.ts +23 -0
- package/dist/core/ingestion/import-processor.js +377 -0
- package/dist/core/ingestion/import-resolvers/configs/c-cpp.d.ts +7 -0
- package/dist/core/ingestion/import-resolvers/configs/c-cpp.js +14 -0
- package/dist/core/ingestion/import-resolvers/configs/csharp.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/csharp.js +27 -0
- package/dist/core/ingestion/import-resolvers/configs/dart.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/configs/dart.js +54 -0
- package/dist/core/ingestion/import-resolvers/configs/go.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/go.js +26 -0
- package/dist/core/ingestion/import-resolvers/configs/jvm.d.ts +13 -0
- package/dist/core/ingestion/import-resolvers/configs/jvm.js +68 -0
- package/dist/core/ingestion/import-resolvers/configs/php.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/php.js +15 -0
- package/dist/core/ingestion/import-resolvers/configs/python.d.ts +12 -0
- package/dist/core/ingestion/import-resolvers/configs/python.js +41 -0
- package/dist/core/ingestion/import-resolvers/configs/ruby.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/ruby.js +16 -0
- package/dist/core/ingestion/import-resolvers/configs/rust.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/rust.js +54 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +29 -0
- package/dist/core/ingestion/import-resolvers/configs/typescript-javascript.d.ts +9 -0
- package/dist/core/ingestion/import-resolvers/configs/typescript-javascript.js +23 -0
- package/dist/core/ingestion/import-resolvers/csharp.d.ts +18 -0
- package/dist/core/ingestion/import-resolvers/csharp.js +115 -0
- package/dist/core/ingestion/import-resolvers/go.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/go.js +46 -0
- package/dist/core/ingestion/import-resolvers/jvm.d.ts +27 -0
- package/dist/core/ingestion/import-resolvers/jvm.js +106 -0
- package/dist/core/ingestion/import-resolvers/php.d.ts +24 -0
- package/dist/core/ingestion/import-resolvers/php.js +77 -0
- package/dist/core/ingestion/import-resolvers/python.d.ts +22 -0
- package/dist/core/ingestion/import-resolvers/python.js +72 -0
- package/dist/core/ingestion/import-resolvers/resolver-factory.d.ts +24 -0
- package/dist/core/ingestion/import-resolvers/resolver-factory.js +33 -0
- package/dist/core/ingestion/import-resolvers/ruby.d.ts +14 -0
- package/dist/core/ingestion/import-resolvers/ruby.js +17 -0
- package/dist/core/ingestion/import-resolvers/rust.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/rust.js +75 -0
- package/dist/core/ingestion/import-resolvers/standard.d.ts +35 -0
- package/dist/core/ingestion/import-resolvers/standard.js +168 -0
- package/dist/core/ingestion/import-resolvers/types.d.ts +68 -0
- package/dist/core/ingestion/import-resolvers/types.js +6 -0
- package/dist/core/ingestion/import-resolvers/utils.d.ts +35 -0
- package/dist/core/ingestion/import-resolvers/utils.js +153 -0
- package/dist/core/ingestion/import-target-adapter.d.ts +73 -0
- package/dist/core/ingestion/import-target-adapter.js +95 -0
- package/dist/core/ingestion/language-config.d.ts +52 -0
- package/dist/core/ingestion/language-config.js +182 -0
- package/dist/core/ingestion/language-provider.d.ts +465 -0
- package/dist/core/ingestion/language-provider.js +24 -0
- package/dist/core/ingestion/languages/c/arity-metadata.d.ts +14 -0
- package/dist/core/ingestion/languages/c/arity-metadata.js +94 -0
- package/dist/core/ingestion/languages/c/arity.d.ts +6 -0
- package/dist/core/ingestion/languages/c/arity.js +18 -0
- package/dist/core/ingestion/languages/c/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/c/captures.js +105 -0
- package/dist/core/ingestion/languages/c/header-scan.d.ts +7 -0
- package/dist/core/ingestion/languages/c/header-scan.js +55 -0
- package/dist/core/ingestion/languages/c/import-decomposer.d.ts +8 -0
- package/dist/core/ingestion/languages/c/import-decomposer.js +50 -0
- package/dist/core/ingestion/languages/c/import-target.d.ts +14 -0
- package/dist/core/ingestion/languages/c/import-target.js +57 -0
- package/dist/core/ingestion/languages/c/index.d.ts +11 -0
- package/dist/core/ingestion/languages/c/index.js +11 -0
- package/dist/core/ingestion/languages/c/interpret.d.ts +14 -0
- package/dist/core/ingestion/languages/c/interpret.js +48 -0
- package/dist/core/ingestion/languages/c/merge-bindings.d.ts +7 -0
- package/dist/core/ingestion/languages/c/merge-bindings.js +23 -0
- package/dist/core/ingestion/languages/c/query.d.ts +3 -0
- package/dist/core/ingestion/languages/c/query.js +161 -0
- package/dist/core/ingestion/languages/c/scope-resolver.d.ts +13 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +60 -0
- package/dist/core/ingestion/languages/c/simple-hooks.d.ts +14 -0
- package/dist/core/ingestion/languages/c/simple-hooks.js +19 -0
- package/dist/core/ingestion/languages/c/static-linkage.d.ts +13 -0
- package/dist/core/ingestion/languages/c/static-linkage.js +57 -0
- package/dist/core/ingestion/languages/c-cpp.d.ts +12 -0
- package/dist/core/ingestion/languages/c-cpp.js +411 -0
- package/dist/core/ingestion/languages/cobol.d.ts +1 -0
- package/dist/core/ingestion/languages/cobol.js +28 -0
- package/dist/core/ingestion/languages/csharp/accessor-unwrap.d.ts +21 -0
- package/dist/core/ingestion/languages/csharp/accessor-unwrap.js +56 -0
- package/dist/core/ingestion/languages/csharp/arity-metadata.d.ts +26 -0
- package/dist/core/ingestion/languages/csharp/arity-metadata.js +46 -0
- package/dist/core/ingestion/languages/csharp/arity.d.ts +23 -0
- package/dist/core/ingestion/languages/csharp/arity.js +37 -0
- package/dist/core/ingestion/languages/csharp/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/csharp/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/csharp/captures.d.ts +19 -0
- package/dist/core/ingestion/languages/csharp/captures.js +346 -0
- package/dist/core/ingestion/languages/csharp/import-decomposer.d.ts +19 -0
- package/dist/core/ingestion/languages/csharp/import-decomposer.js +93 -0
- package/dist/core/ingestion/languages/csharp/import-target.d.ts +25 -0
- package/dist/core/ingestion/languages/csharp/import-target.js +123 -0
- package/dist/core/ingestion/languages/csharp/index.d.ts +82 -0
- package/dist/core/ingestion/languages/csharp/index.js +82 -0
- package/dist/core/ingestion/languages/csharp/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/csharp/interpret.js +132 -0
- package/dist/core/ingestion/languages/csharp/merge-bindings.d.ts +27 -0
- package/dist/core/ingestion/languages/csharp/merge-bindings.js +55 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +51 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +387 -0
- package/dist/core/ingestion/languages/csharp/query.d.ts +35 -0
- package/dist/core/ingestion/languages/csharp/query.js +521 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.d.ts +31 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +135 -0
- package/dist/core/ingestion/languages/csharp/scope-resolver.d.ts +10 -0
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +63 -0
- package/dist/core/ingestion/languages/csharp/simple-hooks.d.ts +53 -0
- package/dist/core/ingestion/languages/csharp/simple-hooks.js +76 -0
- package/dist/core/ingestion/languages/csharp.d.ts +8 -0
- package/dist/core/ingestion/languages/csharp.js +201 -0
- package/dist/core/ingestion/languages/dart.d.ts +12 -0
- package/dist/core/ingestion/languages/dart.js +138 -0
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +8 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +37 -0
- package/dist/core/ingestion/languages/go/arity.d.ts +2 -0
- package/dist/core/ingestion/languages/go/arity.js +14 -0
- package/dist/core/ingestion/languages/go/cache-stats.d.ts +7 -0
- package/dist/core/ingestion/languages/go/cache-stats.js +15 -0
- package/dist/core/ingestion/languages/go/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/go/captures.js +129 -0
- package/dist/core/ingestion/languages/go/expand-wildcards.d.ts +15 -0
- package/dist/core/ingestion/languages/go/expand-wildcards.js +93 -0
- package/dist/core/ingestion/languages/go/import-decomposer.d.ts +3 -0
- package/dist/core/ingestion/languages/go/import-decomposer.js +44 -0
- package/dist/core/ingestion/languages/go/import-target.d.ts +21 -0
- package/dist/core/ingestion/languages/go/import-target.js +67 -0
- package/dist/core/ingestion/languages/go/index.d.ts +17 -0
- package/dist/core/ingestion/languages/go/index.js +17 -0
- package/dist/core/ingestion/languages/go/interface-impls.d.ts +4 -0
- package/dist/core/ingestion/languages/go/interface-impls.js +72 -0
- package/dist/core/ingestion/languages/go/interpret.d.ts +11 -0
- package/dist/core/ingestion/languages/go/interpret.js +146 -0
- package/dist/core/ingestion/languages/go/merge-bindings.d.ts +2 -0
- package/dist/core/ingestion/languages/go/merge-bindings.js +18 -0
- package/dist/core/ingestion/languages/go/method-owners.d.ts +17 -0
- package/dist/core/ingestion/languages/go/method-owners.js +96 -0
- package/dist/core/ingestion/languages/go/namespace-mirror.d.ts +15 -0
- package/dist/core/ingestion/languages/go/namespace-mirror.js +53 -0
- package/dist/core/ingestion/languages/go/package-siblings.d.ts +11 -0
- package/dist/core/ingestion/languages/go/package-siblings.js +84 -0
- package/dist/core/ingestion/languages/go/query.d.ts +3 -0
- package/dist/core/ingestion/languages/go/query.js +207 -0
- package/dist/core/ingestion/languages/go/range-binding.d.ts +8 -0
- package/dist/core/ingestion/languages/go/range-binding.js +109 -0
- package/dist/core/ingestion/languages/go/receiver-binding.d.ts +3 -0
- package/dist/core/ingestion/languages/go/receiver-binding.js +21 -0
- package/dist/core/ingestion/languages/go/scope-resolver.d.ts +2 -0
- package/dist/core/ingestion/languages/go/scope-resolver.js +33 -0
- package/dist/core/ingestion/languages/go/simple-hooks.d.ts +4 -0
- package/dist/core/ingestion/languages/go/simple-hooks.js +21 -0
- package/dist/core/ingestion/languages/go/type-binding.d.ts +3 -0
- package/dist/core/ingestion/languages/go/type-binding.js +237 -0
- package/dist/core/ingestion/languages/go.d.ts +11 -0
- package/dist/core/ingestion/languages/go.js +94 -0
- package/dist/core/ingestion/languages/index.d.ts +39 -0
- package/dist/core/ingestion/languages/index.js +64 -0
- package/dist/core/ingestion/languages/java/arity-metadata.d.ts +18 -0
- package/dist/core/ingestion/languages/java/arity-metadata.js +40 -0
- package/dist/core/ingestion/languages/java/arity.d.ts +10 -0
- package/dist/core/ingestion/languages/java/arity.js +24 -0
- package/dist/core/ingestion/languages/java/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/java/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/java/captures.d.ts +17 -0
- package/dist/core/ingestion/languages/java/captures.js +187 -0
- package/dist/core/ingestion/languages/java/import-decomposer.d.ts +18 -0
- package/dist/core/ingestion/languages/java/import-decomposer.js +85 -0
- package/dist/core/ingestion/languages/java/import-target.d.ts +17 -0
- package/dist/core/ingestion/languages/java/import-target.js +100 -0
- package/dist/core/ingestion/languages/java/index.d.ts +29 -0
- package/dist/core/ingestion/languages/java/index.js +29 -0
- package/dist/core/ingestion/languages/java/interpret.d.ts +13 -0
- package/dist/core/ingestion/languages/java/interpret.js +131 -0
- package/dist/core/ingestion/languages/java/merge-bindings.d.ts +12 -0
- package/dist/core/ingestion/languages/java/merge-bindings.js +40 -0
- package/dist/core/ingestion/languages/java/query.d.ts +30 -0
- package/dist/core/ingestion/languages/java/query.js +192 -0
- package/dist/core/ingestion/languages/java/receiver-binding.d.ts +11 -0
- package/dist/core/ingestion/languages/java/receiver-binding.js +95 -0
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +74 -0
- package/dist/core/ingestion/languages/java/simple-hooks.d.ts +13 -0
- package/dist/core/ingestion/languages/java/simple-hooks.js +34 -0
- package/dist/core/ingestion/languages/java.d.ts +9 -0
- package/dist/core/ingestion/languages/java.js +76 -0
- package/dist/core/ingestion/languages/kotlin.d.ts +9 -0
- package/dist/core/ingestion/languages/kotlin.js +164 -0
- package/dist/core/ingestion/languages/php/arity-metadata.d.ts +28 -0
- package/dist/core/ingestion/languages/php/arity-metadata.js +63 -0
- package/dist/core/ingestion/languages/php/arity.d.ts +25 -0
- package/dist/core/ingestion/languages/php/arity.js +40 -0
- package/dist/core/ingestion/languages/php/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/php/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/php/captures.d.ts +34 -0
- package/dist/core/ingestion/languages/php/captures.js +739 -0
- package/dist/core/ingestion/languages/php/import-decomposer.d.ts +28 -0
- package/dist/core/ingestion/languages/php/import-decomposer.js +265 -0
- package/dist/core/ingestion/languages/php/import-target.d.ts +47 -0
- package/dist/core/ingestion/languages/php/import-target.js +100 -0
- package/dist/core/ingestion/languages/php/index.d.ts +68 -0
- package/dist/core/ingestion/languages/php/index.js +72 -0
- package/dist/core/ingestion/languages/php/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/php/interpret.js +241 -0
- package/dist/core/ingestion/languages/php/merge-bindings.d.ts +19 -0
- package/dist/core/ingestion/languages/php/merge-bindings.js +47 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.d.ts +51 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.js +288 -0
- package/dist/core/ingestion/languages/php/query.d.ts +32 -0
- package/dist/core/ingestion/languages/php/query.js +326 -0
- package/dist/core/ingestion/languages/php/receiver-binding.d.ts +36 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +128 -0
- package/dist/core/ingestion/languages/php/scope-resolver.d.ts +23 -0
- package/dist/core/ingestion/languages/php/scope-resolver.js +358 -0
- package/dist/core/ingestion/languages/php/simple-hooks.d.ts +42 -0
- package/dist/core/ingestion/languages/php/simple-hooks.js +111 -0
- package/dist/core/ingestion/languages/php.d.ts +1 -0
- package/dist/core/ingestion/languages/php.js +290 -0
- package/dist/core/ingestion/languages/python/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/python/arity-metadata.js +45 -0
- package/dist/core/ingestion/languages/python/arity.d.ts +22 -0
- package/dist/core/ingestion/languages/python/arity.js +38 -0
- package/dist/core/ingestion/languages/python/cache-stats.d.ts +17 -0
- package/dist/core/ingestion/languages/python/cache-stats.js +28 -0
- package/dist/core/ingestion/languages/python/captures.d.ts +19 -0
- package/dist/core/ingestion/languages/python/captures.js +130 -0
- package/dist/core/ingestion/languages/python/import-decomposer.d.ts +15 -0
- package/dist/core/ingestion/languages/python/import-decomposer.js +112 -0
- package/dist/core/ingestion/languages/python/import-target.d.ts +21 -0
- package/dist/core/ingestion/languages/python/import-target.js +195 -0
- package/dist/core/ingestion/languages/python/index.d.ts +80 -0
- package/dist/core/ingestion/languages/python/index.js +80 -0
- package/dist/core/ingestion/languages/python/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/python/interpret.js +191 -0
- package/dist/core/ingestion/languages/python/merge-bindings.d.ts +16 -0
- package/dist/core/ingestion/languages/python/merge-bindings.js +44 -0
- package/dist/core/ingestion/languages/python/query.d.ts +9 -0
- package/dist/core/ingestion/languages/python/query.js +267 -0
- package/dist/core/ingestion/languages/python/receiver-binding.d.ts +21 -0
- package/dist/core/ingestion/languages/python/receiver-binding.js +116 -0
- package/dist/core/ingestion/languages/python/scope-resolver.d.ts +16 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +53 -0
- package/dist/core/ingestion/languages/python/simple-hooks.d.ts +25 -0
- package/dist/core/ingestion/languages/python/simple-hooks.js +43 -0
- package/dist/core/ingestion/languages/python.d.ts +12 -0
- package/dist/core/ingestion/languages/python.js +133 -0
- package/dist/core/ingestion/languages/ruby.d.ts +9 -0
- package/dist/core/ingestion/languages/ruby.js +235 -0
- package/dist/core/ingestion/languages/rust.d.ts +12 -0
- package/dist/core/ingestion/languages/rust.js +167 -0
- package/dist/core/ingestion/languages/swift.d.ts +12 -0
- package/dist/core/ingestion/languages/swift.js +312 -0
- package/dist/core/ingestion/languages/typescript/arity-metadata.d.ts +59 -0
- package/dist/core/ingestion/languages/typescript/arity-metadata.js +103 -0
- package/dist/core/ingestion/languages/typescript/arity.d.ts +37 -0
- package/dist/core/ingestion/languages/typescript/arity.js +54 -0
- package/dist/core/ingestion/languages/typescript/cache-stats.d.ts +17 -0
- package/dist/core/ingestion/languages/typescript/cache-stats.js +28 -0
- package/dist/core/ingestion/languages/typescript/captures.d.ts +28 -0
- package/dist/core/ingestion/languages/typescript/captures.js +474 -0
- package/dist/core/ingestion/languages/typescript/import-decomposer.d.ts +49 -0
- package/dist/core/ingestion/languages/typescript/import-decomposer.js +371 -0
- package/dist/core/ingestion/languages/typescript/import-target.d.ts +50 -0
- package/dist/core/ingestion/languages/typescript/import-target.js +61 -0
- package/dist/core/ingestion/languages/typescript/index.d.ts +94 -0
- package/dist/core/ingestion/languages/typescript/index.js +94 -0
- package/dist/core/ingestion/languages/typescript/interpret.d.ts +35 -0
- package/dist/core/ingestion/languages/typescript/interpret.js +317 -0
- package/dist/core/ingestion/languages/typescript/merge-bindings.d.ts +62 -0
- package/dist/core/ingestion/languages/typescript/merge-bindings.js +158 -0
- package/dist/core/ingestion/languages/typescript/query.d.ts +84 -0
- package/dist/core/ingestion/languages/typescript/query.js +978 -0
- package/dist/core/ingestion/languages/typescript/receiver-binding.d.ts +59 -0
- package/dist/core/ingestion/languages/typescript/receiver-binding.js +171 -0
- package/dist/core/ingestion/languages/typescript/scope-resolver.d.ts +16 -0
- package/dist/core/ingestion/languages/typescript/scope-resolver.js +113 -0
- package/dist/core/ingestion/languages/typescript/simple-hooks.d.ts +71 -0
- package/dist/core/ingestion/languages/typescript/simple-hooks.js +131 -0
- package/dist/core/ingestion/languages/typescript.d.ts +11 -0
- package/dist/core/ingestion/languages/typescript.js +324 -0
- package/dist/core/ingestion/languages/vue.d.ts +13 -0
- package/dist/core/ingestion/languages/vue.js +79 -0
- package/dist/core/ingestion/markdown-processor.d.ts +17 -0
- package/dist/core/ingestion/markdown-processor.js +124 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.js +287 -0
- package/dist/core/ingestion/method-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +376 -0
- package/dist/core/ingestion/method-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/go.js +176 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.js +336 -0
- package/dist/core/ingestion/method-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/php.js +304 -0
- package/dist/core/ingestion/method-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/python.js +309 -0
- package/dist/core/ingestion/method-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/ruby.js +286 -0
- package/dist/core/ingestion/method-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/rust.js +195 -0
- package/dist/core/ingestion/method-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/swift.js +276 -0
- package/dist/core/ingestion/method-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/typescript-javascript.js +338 -0
- package/dist/core/ingestion/method-extractors/generic.d.ts +11 -0
- package/dist/core/ingestion/method-extractors/generic.js +205 -0
- package/dist/core/ingestion/method-types.d.ts +90 -0
- package/dist/core/ingestion/method-types.js +2 -0
- package/dist/core/ingestion/model/field-registry.d.ts +18 -0
- package/dist/core/ingestion/model/field-registry.js +22 -0
- package/dist/core/ingestion/model/heritage-map.d.ts +105 -0
- package/dist/core/ingestion/model/heritage-map.js +260 -0
- package/dist/core/ingestion/model/index.d.ts +20 -0
- package/dist/core/ingestion/model/index.js +43 -0
- package/dist/core/ingestion/model/method-registry.d.ts +71 -0
- package/dist/core/ingestion/model/method-registry.js +134 -0
- package/dist/core/ingestion/model/registration-table.d.ts +138 -0
- package/dist/core/ingestion/model/registration-table.js +224 -0
- package/dist/core/ingestion/model/resolution-context.d.ts +93 -0
- package/dist/core/ingestion/model/resolution-context.js +337 -0
- package/dist/core/ingestion/model/resolve.d.ts +61 -0
- package/dist/core/ingestion/model/resolve.js +401 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +72 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.js +42 -0
- package/dist/core/ingestion/model/semantic-model.d.ts +150 -0
- package/dist/core/ingestion/model/semantic-model.js +175 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +200 -0
- package/dist/core/ingestion/model/symbol-table.js +206 -0
- package/dist/core/ingestion/model/type-registry.d.ts +39 -0
- package/dist/core/ingestion/model/type-registry.js +62 -0
- package/dist/core/ingestion/mro-processor.d.ts +46 -0
- package/dist/core/ingestion/mro-processor.js +597 -0
- package/dist/core/ingestion/named-bindings/csharp.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/csharp.js +37 -0
- package/dist/core/ingestion/named-bindings/java.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/java.js +29 -0
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/kotlin.js +36 -0
- package/dist/core/ingestion/named-bindings/php.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/php.js +61 -0
- package/dist/core/ingestion/named-bindings/python.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/python.js +49 -0
- package/dist/core/ingestion/named-bindings/rust.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/rust.js +66 -0
- package/dist/core/ingestion/named-bindings/types.d.ts +16 -0
- package/dist/core/ingestion/named-bindings/types.js +6 -0
- package/dist/core/ingestion/named-bindings/typescript.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/typescript.js +58 -0
- package/dist/core/ingestion/parsing-processor.d.ts +60 -0
- package/dist/core/ingestion/parsing-processor.js +627 -0
- package/dist/core/ingestion/pipeline-phases/cobol.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/cobol.js +46 -0
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/communities.js +63 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +157 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +37 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.js +64 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/index.js +23 -0
- package/dist/core/ingestion/pipeline-phases/markdown.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/markdown.js +34 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +18 -0
- package/dist/core/ingestion/pipeline-phases/mro.js +37 -0
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +92 -0
- package/dist/core/ingestion/pipeline-phases/orm.d.ts +15 -0
- package/dist/core/ingestion/pipeline-phases/orm.js +75 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +63 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +567 -0
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +88 -0
- package/dist/core/ingestion/pipeline-phases/parse.js +33 -0
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/processes.js +149 -0
- package/dist/core/ingestion/pipeline-phases/routes.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/routes.js +244 -0
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/runner.js +204 -0
- package/dist/core/ingestion/pipeline-phases/scan.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/scan.js +46 -0
- package/dist/core/ingestion/pipeline-phases/structure.d.ts +27 -0
- package/dist/core/ingestion/pipeline-phases/structure.js +35 -0
- package/dist/core/ingestion/pipeline-phases/tools.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/tools.js +86 -0
- package/dist/core/ingestion/pipeline-phases/types.d.ts +79 -0
- package/dist/core/ingestion/pipeline-phases/types.js +37 -0
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +70 -0
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +312 -0
- package/dist/core/ingestion/pipeline.d.ts +49 -0
- package/dist/core/ingestion/pipeline.js +89 -0
- package/dist/core/ingestion/process-processor.d.ts +51 -0
- package/dist/core/ingestion/process-processor.js +318 -0
- package/dist/core/ingestion/registry-primary-flag.d.ts +88 -0
- package/dist/core/ingestion/registry-primary-flag.js +117 -0
- package/dist/core/ingestion/resolve-references.d.ts +63 -0
- package/dist/core/ingestion/resolve-references.js +175 -0
- package/dist/core/ingestion/route-extractors/expo.d.ts +1 -0
- package/dist/core/ingestion/route-extractors/expo.js +36 -0
- package/dist/core/ingestion/route-extractors/middleware.d.ts +47 -0
- package/dist/core/ingestion/route-extractors/middleware.js +167 -0
- package/dist/core/ingestion/route-extractors/nextjs.d.ts +3 -0
- package/dist/core/ingestion/route-extractors/nextjs.js +76 -0
- package/dist/core/ingestion/route-extractors/php.d.ts +7 -0
- package/dist/core/ingestion/route-extractors/php.js +22 -0
- package/dist/core/ingestion/route-extractors/response-shapes.d.ts +20 -0
- package/dist/core/ingestion/route-extractors/response-shapes.js +294 -0
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +35 -0
- package/dist/core/ingestion/scope-extractor-bridge.js +49 -0
- package/dist/core/ingestion/scope-extractor.d.ts +86 -0
- package/dist/core/ingestion/scope-extractor.js +772 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +558 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +250 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +43 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +79 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +57 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +142 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +46 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +19 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +40 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.d.ts +37 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +118 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +38 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +73 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +467 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +53 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +251 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +75 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +202 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.js +102 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +30 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +81 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +46 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +377 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +47 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +152 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.d.ts +68 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +125 -0
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +31 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +91 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +218 -0
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.d.ts +39 -0
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +65 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.d.ts +36 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.js +58 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +170 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +447 -0
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +52 -0
- package/dist/core/ingestion/scope-resolution/workspace-index.js +61 -0
- package/dist/core/ingestion/shadow-harness.d.ts +113 -0
- package/dist/core/ingestion/shadow-harness.js +148 -0
- package/dist/core/ingestion/structure-processor.d.ts +2 -0
- package/dist/core/ingestion/structure-processor.js +36 -0
- package/dist/core/ingestion/tree-sitter-queries.d.ts +16 -0
- package/dist/core/ingestion/tree-sitter-queries.js +1497 -0
- package/dist/core/ingestion/type-env.d.ts +86 -0
- package/dist/core/ingestion/type-env.js +1129 -0
- package/dist/core/ingestion/type-extractors/c-cpp.d.ts +7 -0
- package/dist/core/ingestion/type-extractors/c-cpp.js +532 -0
- package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/csharp.js +583 -0
- package/dist/core/ingestion/type-extractors/dart.d.ts +15 -0
- package/dist/core/ingestion/type-extractors/dart.js +369 -0
- package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/go.js +513 -0
- package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
- package/dist/core/ingestion/type-extractors/jvm.js +856 -0
- package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/php.js +534 -0
- package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/python.js +474 -0
- package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/ruby.js +377 -0
- package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/rust.js +515 -0
- package/dist/core/ingestion/type-extractors/shared.d.ts +131 -0
- package/dist/core/ingestion/type-extractors/shared.js +796 -0
- package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/swift.js +487 -0
- package/dist/core/ingestion/type-extractors/types.d.ts +172 -0
- package/dist/core/ingestion/type-extractors/types.js +1 -0
- package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/typescript.js +661 -0
- package/dist/core/ingestion/utils/ast-helpers.d.ts +102 -0
- package/dist/core/ingestion/utils/ast-helpers.js +561 -0
- package/dist/core/ingestion/utils/call-analysis.d.ts +75 -0
- package/dist/core/ingestion/utils/call-analysis.js +574 -0
- package/dist/core/ingestion/utils/env.d.ts +20 -0
- package/dist/core/ingestion/utils/env.js +24 -0
- package/dist/core/ingestion/utils/event-loop.d.ts +5 -0
- package/dist/core/ingestion/utils/event-loop.js +5 -0
- package/dist/core/ingestion/utils/graph-sort.d.ts +58 -0
- package/dist/core/ingestion/utils/graph-sort.js +100 -0
- package/dist/core/ingestion/utils/max-file-size.d.ts +20 -0
- package/dist/core/ingestion/utils/max-file-size.js +53 -0
- package/dist/core/ingestion/utils/method-props.d.ts +32 -0
- package/dist/core/ingestion/utils/method-props.js +147 -0
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +52 -0
- package/dist/core/ingestion/utils/ruby-self-call.js +59 -0
- package/dist/core/ingestion/utils/verbose.d.ts +1 -0
- package/dist/core/ingestion/utils/verbose.js +7 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +81 -0
- package/dist/core/ingestion/variable-extractors/configs/csharp.d.ts +9 -0
- package/dist/core/ingestion/variable-extractors/configs/csharp.js +63 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +94 -0
- package/dist/core/ingestion/variable-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/go.js +83 -0
- package/dist/core/ingestion/variable-extractors/configs/jvm.d.ts +18 -0
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +115 -0
- package/dist/core/ingestion/variable-extractors/configs/php.d.ts +14 -0
- package/dist/core/ingestion/variable-extractors/configs/php.js +58 -0
- package/dist/core/ingestion/variable-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/python.js +101 -0
- package/dist/core/ingestion/variable-extractors/configs/ruby.d.ts +11 -0
- package/dist/core/ingestion/variable-extractors/configs/ruby.js +52 -0
- package/dist/core/ingestion/variable-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/rust.js +76 -0
- package/dist/core/ingestion/variable-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/swift.js +88 -0
- package/dist/core/ingestion/variable-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/variable-extractors/configs/typescript-javascript.js +83 -0
- package/dist/core/ingestion/variable-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/variable-extractors/generic.js +80 -0
- package/dist/core/ingestion/variable-types.d.ts +82 -0
- package/dist/core/ingestion/variable-types.js +2 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +44 -0
- package/dist/core/ingestion/vue-sfc-extractor.js +111 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +199 -0
- package/dist/core/ingestion/workers/parse-worker.js +1940 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +23 -0
- package/dist/core/ingestion/workers/worker-pool.js +380 -0
- package/dist/core/lbug/csv-generator.d.ts +33 -0
- package/dist/core/lbug/csv-generator.js +463 -0
- package/dist/core/lbug/extension-loader.d.ts +86 -0
- package/dist/core/lbug/extension-loader.js +186 -0
- package/dist/core/lbug/lbug-adapter.d.ts +243 -0
- package/dist/core/lbug/lbug-adapter.js +1377 -0
- package/dist/core/lbug/lbug-config.d.ts +102 -0
- package/dist/core/lbug/lbug-config.js +303 -0
- package/dist/core/lbug/pool-adapter.d.ts +90 -0
- package/dist/core/lbug/pool-adapter.js +592 -0
- package/dist/core/lbug/schema.d.ts +62 -0
- package/dist/core/lbug/schema.js +495 -0
- package/dist/core/logger.d.ts +125 -0
- package/dist/core/logger.js +323 -0
- package/dist/core/platform/capabilities.d.ts +24 -0
- package/dist/core/platform/capabilities.js +54 -0
- package/dist/core/run-analyze.d.ts +92 -0
- package/dist/core/run-analyze.js +672 -0
- package/dist/core/search/bm25-index.d.ts +29 -0
- package/dist/core/search/bm25-index.js +118 -0
- package/dist/core/search/fts-indexes.d.ts +1 -0
- package/dist/core/search/fts-indexes.js +7 -0
- package/dist/core/search/fts-schema.d.ts +6 -0
- package/dist/core/search/fts-schema.js +7 -0
- package/dist/core/search/hybrid-search.d.ts +53 -0
- package/dist/core/search/hybrid-search.js +136 -0
- package/dist/core/search/phase-timer.d.ts +72 -0
- package/dist/core/search/phase-timer.js +106 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +8 -0
- package/dist/core/tree-sitter/parser-loader.js +189 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +6 -0
- package/dist/core/tree-sitter/safe-parse.js +32 -0
- package/dist/core/wiki/cursor-client.d.ts +31 -0
- package/dist/core/wiki/cursor-client.js +123 -0
- package/dist/core/wiki/generator.d.ts +129 -0
- package/dist/core/wiki/generator.js +899 -0
- package/dist/core/wiki/graph-queries.d.ts +84 -0
- package/dist/core/wiki/graph-queries.js +244 -0
- package/dist/core/wiki/html-viewer.d.ts +10 -0
- package/dist/core/wiki/html-viewer.js +304 -0
- package/dist/core/wiki/llm-client.d.ts +83 -0
- package/dist/core/wiki/llm-client.js +267 -0
- package/dist/core/wiki/mermaid-sanitizer.d.ts +2 -0
- package/dist/core/wiki/mermaid-sanitizer.js +100 -0
- package/dist/core/wiki/prompts.d.ts +53 -0
- package/dist/core/wiki/prompts.js +181 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +3 -0
- package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
- package/dist/mcp/compatible-stdio-transport.js +206 -0
- package/dist/mcp/core/embedder.d.ts +27 -0
- package/dist/mcp/core/embedder.js +145 -0
- package/dist/mcp/core/lbug-adapter.d.ts +11 -0
- package/dist/mcp/core/lbug-adapter.js +11 -0
- package/dist/mcp/local/local-backend.d.ts +356 -0
- package/dist/mcp/local/local-backend.js +3251 -0
- package/dist/mcp/resources.d.ts +62 -0
- package/dist/mcp/resources.js +512 -0
- package/dist/mcp/server.d.ts +23 -0
- package/dist/mcp/server.js +314 -0
- package/dist/mcp/staleness.d.ts +5 -0
- package/dist/mcp/staleness.js +4 -0
- package/dist/mcp/stdio-capture.d.ts +40 -0
- package/dist/mcp/stdio-capture.js +53 -0
- package/dist/mcp/stdio-context.d.ts +47 -0
- package/dist/mcp/stdio-context.js +145 -0
- package/dist/mcp/tools.d.ts +29 -0
- package/dist/mcp/tools.js +506 -0
- package/dist/server/analyze-job.d.ts +55 -0
- package/dist/server/analyze-job.js +150 -0
- package/dist/server/analyze-worker.d.ts +13 -0
- package/dist/server/analyze-worker.js +59 -0
- package/dist/server/api.d.ts +72 -0
- package/dist/server/api.js +1638 -0
- package/dist/server/git-clone.d.ts +99 -0
- package/dist/server/git-clone.js +397 -0
- package/dist/server/mcp-http.d.ts +13 -0
- package/dist/server/mcp-http.js +101 -0
- package/dist/server/validation.d.ts +98 -0
- package/dist/server/validation.js +142 -0
- package/dist/storage/file-hash.d.ts +47 -0
- package/dist/storage/file-hash.js +86 -0
- package/dist/storage/git.d.ts +148 -0
- package/dist/storage/git.js +346 -0
- package/dist/storage/parse-cache.d.ts +67 -0
- package/dist/storage/parse-cache.js +182 -0
- package/dist/storage/repo-manager.d.ts +467 -0
- package/dist/storage/repo-manager.js +804 -0
- package/dist/types/pipeline.d.ts +18 -0
- package/dist/types/pipeline.js +1 -0
- package/hooks/claude/arc-hook.cjs +334 -0
- package/hooks/claude/hook-lock.cjs +119 -0
- package/hooks/claude/pre-tool-use.sh +79 -0
- package/hooks/claude/session-start.sh +42 -0
- package/package.json +122 -0
- package/scripts/bench-scope-resolution.ts +134 -0
- package/scripts/build-tree-sitter-dart.cjs +53 -0
- package/scripts/build-tree-sitter-proto.cjs +93 -0
- package/scripts/build.js +99 -0
- package/scripts/ci-list-migrated-languages.ts +24 -0
- package/scripts/install-duckdb-extension.mjs +48 -0
- package/skills/arc-cli.md +83 -0
- package/skills/arc-debugging.md +89 -0
- package/skills/arc-exploring.md +78 -0
- package/skills/arc-guide.md +64 -0
- package/skills/arc-impact-analysis.md +97 -0
- package/skills/arc-pr-review.md +163 -0
- package/skills/arc-refactoring.md +121 -0
- package/vendor/leiden/index.cjs +355 -0
- package/vendor/leiden/utils.cjs +392 -0
- package/vendor/tree-sitter-dart/README.md +18 -0
- package/vendor/tree-sitter-dart/binding.gyp +31 -0
- package/vendor/tree-sitter-dart/bindings/node/binding.cc +20 -0
- package/vendor/tree-sitter-dart/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-dart/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-dart/grammar.js +2895 -0
- package/vendor/tree-sitter-dart/package.json +18 -0
- package/vendor/tree-sitter-dart/queries/highlights.scm +246 -0
- package/vendor/tree-sitter-dart/queries/tags.scm +92 -0
- package/vendor/tree-sitter-dart/queries/test.scm +1 -0
- package/vendor/tree-sitter-dart/src/grammar.json +12459 -0
- package/vendor/tree-sitter-dart/src/node-types.json +15055 -0
- package/vendor/tree-sitter-dart/src/parser.c +196127 -0
- package/vendor/tree-sitter-dart/src/scanner.c +130 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/alloc.h +54 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/array.h +290 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/parser.h +265 -0
- package/vendor/tree-sitter-proto/binding.gyp +30 -0
- package/vendor/tree-sitter-proto/bindings/node/binding.cc +20 -0
- package/vendor/tree-sitter-proto/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-proto/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-proto/package.json +12 -0
- package/vendor/tree-sitter-proto/src/node-types.json +1145 -0
- package/vendor/tree-sitter-proto/src/parser.c +10149 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/alloc.h +54 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/array.h +291 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/parser.h +266 -0
- package/vendor/tree-sitter-swift/LICENSE +21 -0
- package/vendor/tree-sitter-swift/README.md +139 -0
- package/vendor/tree-sitter-swift/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-swift/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-swift/package.json +28 -0
- package/vendor/tree-sitter-swift/prebuilds/darwin-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/darwin-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/linux-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/linux-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/win32-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/win32-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/src/node-types.json +30694 -0
- package/web/assets/__vite-browser-external-CLwMvL_q.js +1 -0
- package/web/assets/agent-DaYmiVrk.js +601 -0
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-aGTGQQQG.js +1 -0
- package/web/assets/architectureDiagram-UL44E2DR-613o-OfM.js +36 -0
- package/web/assets/blockDiagram-7IZFK4PR-BBJRt4vF.js +132 -0
- package/web/assets/c4Diagram-Y2BXMSZH-BhR2CErx.js +10 -0
- package/web/assets/chunk-3SSMPTDK-DWfEAoKy.js +321 -0
- package/web/assets/chunk-6764PJDD-NOXEgi3n.js +1 -0
- package/web/assets/chunk-AZZRMDJM-DVvcxwI7.js +15 -0
- package/web/assets/chunk-JQRUD6KW-CQgkrimK.js +1 -0
- package/web/assets/chunk-KGYTTC2M-DxOdSoAJ.js +161 -0
- package/web/assets/chunk-KRXBNO2N-BlnQTnxv.js +1 -0
- package/web/assets/chunk-LCXTWHL2-Dhf_u-1F.js +231 -0
- package/web/assets/chunk-LII3EMHJ-Cb3HLCZX.js +1 -0
- package/web/assets/chunk-RG4AUYOV-DLCfNede.js +206 -0
- package/web/assets/chunk-T5OCTHI4-B0CGAG7q.js +1 -0
- package/web/assets/chunk-W44A43WB-ZyrAMwtT.js +1 -0
- package/web/assets/chunk-ZXARS5L4-B0TJPmj5.js +1 -0
- package/web/assets/classDiagram-KGZ6W3CR-CvSnsfJD.js +1 -0
- package/web/assets/classDiagram-v2-72OJOZXJ-CvSnsfJD.js +1 -0
- package/web/assets/context-builder-BREgwful.js +15 -0
- package/web/assets/cose-bilkent-UX7MHV2Q-BsPIaeag.js +1 -0
- package/web/assets/dagre-ND4H6XIP-CV4l9vOZ.js +4 -0
- package/web/assets/diagram-3NCE3AQN-9kSzEbS8.js +43 -0
- package/web/assets/diagram-GF46GFSD-qRvqbex6.js +24 -0
- package/web/assets/diagram-HNR7UZ2L-Dj_ye4Ua.js +3 -0
- package/web/assets/diagram-QXG6HAR7-COwBV6B0.js +24 -0
- package/web/assets/diagram-WEQXMOUZ-C9xjn5dU.js +10 -0
- package/web/assets/erDiagram-L5TCEMPS-fRp0t1Yd.js +85 -0
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-BR0Ygfrw.js +1 -0
- package/web/assets/flowDiagram-H6V6AXG4-Ccr8FDLD.js +162 -0
- package/web/assets/ganttDiagram-JCBTUEKG-DfBPqAGN.js +292 -0
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-CYihBz6Z.js +1 -0
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CHvG_UQ0.js +106 -0
- package/web/assets/index-B7cw1L6-.css +2 -0
- package/web/assets/index-CJJQgfSH.js +886 -0
- package/web/assets/info-J43DQDTF-KCYPFFUO-BmmoeX4D.js +1 -0
- package/web/assets/infoDiagram-3YFTVSEB-C7cMy-GP.js +2 -0
- package/web/assets/ishikawaDiagram-BNXS4ZKH-C80yCPYi.js +70 -0
- package/web/assets/journeyDiagram-M6C3CM3L-BHxH1zjE.js +139 -0
- package/web/assets/kanban-definition-75IXJCU3-DNZo1hOE.js +89 -0
- package/web/assets/katex-K3KEBU37-CbyuvTf1.js +261 -0
- package/web/assets/mindmap-definition-2TDM6QVE-Dpgl3Elt.js +96 -0
- package/web/assets/packet-YPE3B663-LP52Z2RK-7JAqDnUy.js +1 -0
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-Bv9vE7io.js +1 -0
- package/web/assets/pieDiagram-CU6KROY3-BW0mr0ek.js +30 -0
- package/web/assets/quadrantDiagram-VICAPDV7-C1dCMBbk.js +7 -0
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-dtZpcOZd.js +1 -0
- package/web/assets/requirementDiagram-JXO7QTGE-Dyqqny4j.js +84 -0
- package/web/assets/sankeyDiagram-URQDO5SZ-B3FGr5SL.js +40 -0
- package/web/assets/sequenceDiagram-VS2MUI6T-B4LlGP9C.js +162 -0
- package/web/assets/stateDiagram-7D4R322I-V9F-klBP.js +1 -0
- package/web/assets/stateDiagram-v2-36443NZ5-CKDYYzqR.js +1 -0
- package/web/assets/timeline-definition-O6YCAMPW-CX2WjkZA.js +120 -0
- package/web/assets/treeView-BLDUP644-QA4HXRO3-BQaKTdhr.js +1 -0
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-Bqlxdyrq.js +1 -0
- package/web/assets/vennDiagram-MWXL3ELB-BxZPYqOF.js +34 -0
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-dofeprUr.js +1 -0
- package/web/assets/wardleyDiagram-CUQ6CDDI-BLdJJYkV.js +78 -0
- package/web/assets/xychartDiagram-N2JHSOCM-DqDgigLa.js +7 -0
- package/web/index.html +19 -0
|
@@ -0,0 +1,1940 @@
|
|
|
1
|
+
import { parentPort } from 'node:worker_threads';
|
|
2
|
+
import Parser from 'tree-sitter';
|
|
3
|
+
import JavaScript from 'tree-sitter-javascript';
|
|
4
|
+
import TypeScript from 'tree-sitter-typescript';
|
|
5
|
+
import Python from 'tree-sitter-python';
|
|
6
|
+
import Java from 'tree-sitter-java';
|
|
7
|
+
import C from 'tree-sitter-c';
|
|
8
|
+
import CPP from 'tree-sitter-cpp';
|
|
9
|
+
// Explicit subpath import — see parser-loader.ts for rationale (#1013).
|
|
10
|
+
import CSharp from 'tree-sitter-c-sharp/bindings/node/index.js';
|
|
11
|
+
import Go from 'tree-sitter-go';
|
|
12
|
+
import Rust from 'tree-sitter-rust';
|
|
13
|
+
import PHP from 'tree-sitter-php';
|
|
14
|
+
import Ruby from 'tree-sitter-ruby';
|
|
15
|
+
import { createRequire } from 'node:module';
|
|
16
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
17
|
+
import { getProvider } from '../languages/index.js';
|
|
18
|
+
import { getTreeSitterBufferSize, getTreeSitterContentByteLength, TREE_SITTER_MAX_BUFFER, } from '../constants.js';
|
|
19
|
+
import { parseSourceSafe } from '../../tree-sitter/safe-parse.js';
|
|
20
|
+
// tree-sitter-swift is an optionalDependency — may not be installed
|
|
21
|
+
const _require = createRequire(import.meta.url);
|
|
22
|
+
let Swift = null;
|
|
23
|
+
try {
|
|
24
|
+
Swift = _require('tree-sitter-swift');
|
|
25
|
+
}
|
|
26
|
+
catch { }
|
|
27
|
+
// tree-sitter-dart is an optionalDependency — may not be installed
|
|
28
|
+
let Dart = null;
|
|
29
|
+
try {
|
|
30
|
+
Dart = _require('tree-sitter-dart');
|
|
31
|
+
}
|
|
32
|
+
catch { }
|
|
33
|
+
// tree-sitter-kotlin is an optionalDependency — may not be installed
|
|
34
|
+
let Kotlin = null;
|
|
35
|
+
try {
|
|
36
|
+
Kotlin = _require('tree-sitter-kotlin');
|
|
37
|
+
}
|
|
38
|
+
catch { }
|
|
39
|
+
import { getLanguageFromFilename } from '../../../_shared/index.js';
|
|
40
|
+
import { FUNCTION_NODE_TYPES, getDefinitionNodeFromCaptures, findEnclosingClassInfo, getLabelFromCaptures, findDescendant, extractStringContent, genericFuncName, inferFunctionLabel, CLASS_CONTAINER_TYPES, } from '../utils/ast-helpers.js';
|
|
41
|
+
import { extractCallArgTypes } from '../utils/call-analysis.js';
|
|
42
|
+
import { buildTypeEnv } from '../type-env.js';
|
|
43
|
+
import { detectFrameworkFromAST } from '../framework-detection.js';
|
|
44
|
+
import { generateId } from '../../../lib/utils.js';
|
|
45
|
+
import { preprocessImportPath } from '../import-processor.js';
|
|
46
|
+
import { extractVueScript, extractTemplateComponents, isVueSetupTopLevel, } from '../vue-sfc-extractor.js';
|
|
47
|
+
import { buildMethodProps, arityForIdFromInfo, typeTagForId, constTagForId, buildCollisionGroups, } from '../utils/method-props.js';
|
|
48
|
+
import { extractParsedFile } from '../scope-extractor-bridge.js';
|
|
49
|
+
import { logger } from '../../logger.js';
|
|
50
|
+
// ============================================================================
|
|
51
|
+
// Worker-local parser + language map
|
|
52
|
+
// ============================================================================
|
|
53
|
+
const parser = new Parser();
|
|
54
|
+
const languageMap = {
|
|
55
|
+
[SupportedLanguages.JavaScript]: JavaScript,
|
|
56
|
+
[SupportedLanguages.TypeScript]: TypeScript.typescript,
|
|
57
|
+
[`${SupportedLanguages.TypeScript}:tsx`]: TypeScript.tsx,
|
|
58
|
+
[SupportedLanguages.Python]: Python,
|
|
59
|
+
[SupportedLanguages.Java]: Java,
|
|
60
|
+
[SupportedLanguages.C]: C,
|
|
61
|
+
[SupportedLanguages.CPlusPlus]: CPP,
|
|
62
|
+
[SupportedLanguages.CSharp]: CSharp,
|
|
63
|
+
[SupportedLanguages.Go]: Go,
|
|
64
|
+
[SupportedLanguages.Rust]: Rust,
|
|
65
|
+
...(Kotlin ? { [SupportedLanguages.Kotlin]: Kotlin } : {}),
|
|
66
|
+
[SupportedLanguages.PHP]: PHP.php_only,
|
|
67
|
+
[SupportedLanguages.Ruby]: Ruby,
|
|
68
|
+
[SupportedLanguages.Vue]: TypeScript.typescript,
|
|
69
|
+
...(Dart ? { [SupportedLanguages.Dart]: Dart } : {}),
|
|
70
|
+
...(Swift ? { [SupportedLanguages.Swift]: Swift } : {}),
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Check if a language grammar is available in this worker.
|
|
74
|
+
* Duplicated from parser-loader.ts because workers can't import from the main thread.
|
|
75
|
+
* Extra filePath parameter needed to distinguish .tsx from .ts (different grammars
|
|
76
|
+
* under the same SupportedLanguages.TypeScript key).
|
|
77
|
+
*/
|
|
78
|
+
const isLanguageAvailable = (language, filePath) => {
|
|
79
|
+
const key = language === SupportedLanguages.TypeScript && filePath.endsWith('.tsx')
|
|
80
|
+
? `${language}:tsx`
|
|
81
|
+
: language;
|
|
82
|
+
return key in languageMap && languageMap[key] != null;
|
|
83
|
+
};
|
|
84
|
+
const setLanguage = (language, filePath) => {
|
|
85
|
+
const key = language === SupportedLanguages.TypeScript && filePath.endsWith('.tsx')
|
|
86
|
+
? `${language}:tsx`
|
|
87
|
+
: language;
|
|
88
|
+
const lang = languageMap[key];
|
|
89
|
+
if (!lang)
|
|
90
|
+
throw new Error(`Unsupported language: ${language}`);
|
|
91
|
+
parser.setLanguage(lang);
|
|
92
|
+
};
|
|
93
|
+
// ============================================================================
|
|
94
|
+
// Per-file O(1) memoization — avoids repeated parent-chain walks per symbol.
|
|
95
|
+
// Three bare Maps cleared at file boundaries. Map.get() returns undefined for
|
|
96
|
+
// missing keys, so `cached !== undefined` distinguishes "not computed" from
|
|
97
|
+
// a stored null (enclosing class/function not found = top-level).
|
|
98
|
+
// ============================================================================
|
|
99
|
+
const classIdCache = new Map();
|
|
100
|
+
const functionIdCache = new Map();
|
|
101
|
+
const exportCache = new Map();
|
|
102
|
+
const clearCaches = () => {
|
|
103
|
+
classIdCache.clear();
|
|
104
|
+
functionIdCache.clear();
|
|
105
|
+
exportCache.clear();
|
|
106
|
+
fieldInfoCache.clear();
|
|
107
|
+
methodInfoCache.clear();
|
|
108
|
+
};
|
|
109
|
+
// ============================================================================
|
|
110
|
+
// FieldExtractor cache — extract field metadata once per class, reuse for each property.
|
|
111
|
+
// Keyed by class node startIndex (unique per AST node within a file).
|
|
112
|
+
// ============================================================================
|
|
113
|
+
const fieldInfoCache = new Map();
|
|
114
|
+
/**
|
|
115
|
+
* Walk up from a definition node to find the nearest enclosing class/struct/interface
|
|
116
|
+
* AST node. Returns the SyntaxNode itself (not an ID) for passing to FieldExtractor.
|
|
117
|
+
*/
|
|
118
|
+
function findEnclosingClassNode(node) {
|
|
119
|
+
let current = node.parent;
|
|
120
|
+
while (current) {
|
|
121
|
+
if (CLASS_CONTAINER_TYPES.has(current.type)) {
|
|
122
|
+
// Return singleton_class directly so the method extractor sees it as
|
|
123
|
+
// the owner node and correctly marks methods as static. Name resolution
|
|
124
|
+
// for qualified names is handled separately by findEnclosingClassInfo.
|
|
125
|
+
return current;
|
|
126
|
+
}
|
|
127
|
+
current = current.parent;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* For C++ out-of-class method definitions (e.g. `void Foo::bar() {}`), extract the
|
|
133
|
+
* class name from the qualified_identifier scope and find the class declaration in the
|
|
134
|
+
* file's AST. Returns the class SyntaxNode or null if not found.
|
|
135
|
+
*
|
|
136
|
+
* Handles pointer/reference return types where function_declarator is nested inside
|
|
137
|
+
* pointer_declarator or reference_declarator.
|
|
138
|
+
*/
|
|
139
|
+
function findClassNodeByQualifiedName(node) {
|
|
140
|
+
const declarator = node.childForFieldName('declarator');
|
|
141
|
+
if (!declarator)
|
|
142
|
+
return null;
|
|
143
|
+
// Find the function_declarator, recursively unwrapping pointer_declarator /
|
|
144
|
+
// reference_declarator chains (e.g. int** Foo::bar() has
|
|
145
|
+
// pointer_declarator → pointer_declarator → function_declarator).
|
|
146
|
+
let funcDecl = null;
|
|
147
|
+
if (declarator.type === 'function_declarator') {
|
|
148
|
+
funcDecl = declarator;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
let current = declarator;
|
|
152
|
+
while (current && !funcDecl) {
|
|
153
|
+
for (let i = 0; i < current.namedChildCount; i++) {
|
|
154
|
+
const child = current.namedChild(i);
|
|
155
|
+
if (child?.type === 'function_declarator') {
|
|
156
|
+
funcDecl = child;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (!funcDecl) {
|
|
161
|
+
const next = current.namedChildren.find((c) => c.type === 'pointer_declarator' || c.type === 'reference_declarator');
|
|
162
|
+
current = next ?? null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!funcDecl)
|
|
167
|
+
return null;
|
|
168
|
+
// Check if the inner declarator is a qualified_identifier (Foo::bar)
|
|
169
|
+
const innerDecl = funcDecl.childForFieldName('declarator');
|
|
170
|
+
if (!innerDecl || innerDecl.type !== 'qualified_identifier')
|
|
171
|
+
return null;
|
|
172
|
+
const scope = innerDecl.childForFieldName('scope');
|
|
173
|
+
if (!scope)
|
|
174
|
+
return null;
|
|
175
|
+
const className = scope.text;
|
|
176
|
+
// Search the file for a matching class/struct specifier, including inside
|
|
177
|
+
// namespace_definition blocks (the majority of production C++ uses namespaces).
|
|
178
|
+
const root = node.tree.rootNode;
|
|
179
|
+
const classTypes = new Set(['class_specifier', 'struct_specifier']);
|
|
180
|
+
const searchIn = (parent) => {
|
|
181
|
+
for (let i = 0; i < parent.namedChildCount; i++) {
|
|
182
|
+
const child = parent.namedChild(i);
|
|
183
|
+
if (!child)
|
|
184
|
+
continue;
|
|
185
|
+
if (classTypes.has(child.type)) {
|
|
186
|
+
const nameNode = child.childForFieldName('name');
|
|
187
|
+
if (nameNode?.text === className)
|
|
188
|
+
return child;
|
|
189
|
+
}
|
|
190
|
+
// Recurse into namespace blocks
|
|
191
|
+
if (child.type === 'namespace_definition') {
|
|
192
|
+
const found = searchIn(child);
|
|
193
|
+
if (found)
|
|
194
|
+
return found;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
};
|
|
199
|
+
return searchIn(root);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Minimal no-op SymbolTable stub for FieldExtractorContext in the worker.
|
|
203
|
+
* Field extraction only uses symbolTable.lookupExactAll for optional type
|
|
204
|
+
* resolution — returning [] causes the extractor to use the raw type
|
|
205
|
+
* string, which is fine for us. Every other method is a no-op so the
|
|
206
|
+
* stub remains safe if a future FieldExtractor consults it through the
|
|
207
|
+
* full {@link SymbolTableReader} surface.
|
|
208
|
+
*/
|
|
209
|
+
const NOOP_SYMBOL_TABLE = {
|
|
210
|
+
lookupExact: () => undefined,
|
|
211
|
+
lookupExactFull: () => undefined,
|
|
212
|
+
lookupExactAll: () => [],
|
|
213
|
+
lookupCallableByName: () => [],
|
|
214
|
+
getFiles: () => [][Symbol.iterator](),
|
|
215
|
+
getStats: () => ({ fileCount: 0 }),
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Get (or extract and cache) field info for a class node.
|
|
219
|
+
* Returns a name→FieldInfo map, or undefined if the provider has no field extractor
|
|
220
|
+
* or the class yielded no fields.
|
|
221
|
+
*/
|
|
222
|
+
function getFieldInfo(classNode, provider, context) {
|
|
223
|
+
if (!provider.fieldExtractor)
|
|
224
|
+
return undefined;
|
|
225
|
+
const cacheKey = classNode.startIndex;
|
|
226
|
+
let cached = fieldInfoCache.get(cacheKey);
|
|
227
|
+
if (cached)
|
|
228
|
+
return cached;
|
|
229
|
+
const result = provider.fieldExtractor.extract(classNode, context);
|
|
230
|
+
if (!result?.fields?.length)
|
|
231
|
+
return undefined;
|
|
232
|
+
cached = new Map();
|
|
233
|
+
for (const field of result.fields) {
|
|
234
|
+
cached.set(field.name, field);
|
|
235
|
+
}
|
|
236
|
+
fieldInfoCache.set(cacheKey, cached);
|
|
237
|
+
return cached;
|
|
238
|
+
}
|
|
239
|
+
// ============================================================================
|
|
240
|
+
// MethodExtractor cache — extract method metadata once per class, reuse for each method.
|
|
241
|
+
// Keyed by class node startIndex (unique per AST node within a file).
|
|
242
|
+
// ============================================================================
|
|
243
|
+
const methodInfoCache = new Map();
|
|
244
|
+
/**
|
|
245
|
+
* Get (or extract and cache) method info for a class node.
|
|
246
|
+
* Returns a "name:line" → MethodInfo map, or undefined if the provider has no method extractor
|
|
247
|
+
* or the class yielded no methods.
|
|
248
|
+
* Keyed by name:line (not name alone) to support overloaded methods in Java/Kotlin.
|
|
249
|
+
*/
|
|
250
|
+
function getMethodInfo(classNode, provider, context) {
|
|
251
|
+
if (!provider.methodExtractor)
|
|
252
|
+
return undefined;
|
|
253
|
+
const cacheKey = classNode.startIndex;
|
|
254
|
+
let cached = methodInfoCache.get(cacheKey);
|
|
255
|
+
if (cached)
|
|
256
|
+
return cached;
|
|
257
|
+
const result = provider.methodExtractor.extract(classNode, context);
|
|
258
|
+
if (!result?.methods?.length)
|
|
259
|
+
return undefined;
|
|
260
|
+
cached = new Map();
|
|
261
|
+
for (const method of result.methods) {
|
|
262
|
+
cached.set(`${method.name}:${method.line}`, method);
|
|
263
|
+
}
|
|
264
|
+
methodInfoCache.set(cacheKey, cached);
|
|
265
|
+
return cached;
|
|
266
|
+
}
|
|
267
|
+
// ============================================================================
|
|
268
|
+
// Enclosing function detection (for call extraction) — cached
|
|
269
|
+
// ============================================================================
|
|
270
|
+
/** Walk up AST to find enclosing function, return its generateId or null for top-level.
|
|
271
|
+
* Applies provider.labelOverride so the label matches the definition phase (single source of truth). */
|
|
272
|
+
const findEnclosingFunctionId = (node, filePath, provider) => {
|
|
273
|
+
const cached = functionIdCache.get(node);
|
|
274
|
+
if (cached !== undefined)
|
|
275
|
+
return cached;
|
|
276
|
+
let current = node.parent;
|
|
277
|
+
while (current) {
|
|
278
|
+
if (FUNCTION_NODE_TYPES.has(current.type)) {
|
|
279
|
+
const efnResult = provider.methodExtractor?.extractFunctionName?.(current);
|
|
280
|
+
const funcName = efnResult?.funcName ?? genericFuncName(current);
|
|
281
|
+
const label = efnResult?.label ?? inferFunctionLabel(current.type);
|
|
282
|
+
if (funcName) {
|
|
283
|
+
// Apply labelOverride so label matches definition phase (e.g., Kotlin Function→Method).
|
|
284
|
+
// null means "skip as definition" — keep original label for scope identification.
|
|
285
|
+
let finalLabel = label;
|
|
286
|
+
if (provider.labelOverride) {
|
|
287
|
+
const override = provider.labelOverride(current, label);
|
|
288
|
+
if (override !== null)
|
|
289
|
+
finalLabel = override;
|
|
290
|
+
}
|
|
291
|
+
// Qualify with enclosing class to match definition-phase node IDs
|
|
292
|
+
const classInfo = cachedFindEnclosingClassInfo(current, filePath, provider.resolveEnclosingOwner);
|
|
293
|
+
const encLang = getLanguageFromFilename(filePath);
|
|
294
|
+
const standaloneMethodInfo = (finalLabel === 'Method' || finalLabel === 'Constructor') &&
|
|
295
|
+
encLang === SupportedLanguages.Go &&
|
|
296
|
+
provider.methodExtractor?.extractFromNode
|
|
297
|
+
? provider.methodExtractor.extractFromNode(current, {
|
|
298
|
+
filePath,
|
|
299
|
+
language: encLang,
|
|
300
|
+
})
|
|
301
|
+
: null;
|
|
302
|
+
const ownerName = classInfo?.className ?? standaloneMethodInfo?.receiverType ?? undefined;
|
|
303
|
+
const qualifiedName = ownerName ? `${ownerName}.${funcName}` : funcName;
|
|
304
|
+
// Include #<arity> suffix to match definition-phase Method/Constructor IDs.
|
|
305
|
+
// Use the same MethodExtractor (getMethodInfo) as the definition phase.
|
|
306
|
+
// When same-arity collisions exist, also append ~type1,type2.
|
|
307
|
+
let arity;
|
|
308
|
+
let encTypeTag = '';
|
|
309
|
+
if (finalLabel === 'Method' || finalLabel === 'Constructor') {
|
|
310
|
+
if (standaloneMethodInfo) {
|
|
311
|
+
arity = standaloneMethodInfo.parameters.some((p) => p.isVariadic)
|
|
312
|
+
? undefined
|
|
313
|
+
: standaloneMethodInfo.parameters.length;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
const classNode = findEnclosingClassNode(current) ?? findClassNodeByQualifiedName(current);
|
|
317
|
+
if (classNode && encLang) {
|
|
318
|
+
const methodMap = getMethodInfo(classNode, provider, {
|
|
319
|
+
filePath,
|
|
320
|
+
language: encLang,
|
|
321
|
+
});
|
|
322
|
+
const defLine = current.startPosition.row + 1;
|
|
323
|
+
const info = methodMap?.get(`${funcName}:${defLine}`);
|
|
324
|
+
if (info) {
|
|
325
|
+
arity = info.parameters.some((p) => p.isVariadic)
|
|
326
|
+
? undefined
|
|
327
|
+
: info.parameters.length;
|
|
328
|
+
if (methodMap && arity !== undefined) {
|
|
329
|
+
const g = buildCollisionGroups(methodMap);
|
|
330
|
+
encTypeTag =
|
|
331
|
+
typeTagForId(methodMap, funcName, arity, info, encLang, g) +
|
|
332
|
+
constTagForId(methodMap, funcName, arity, info, g);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const arityTag = arity !== undefined ? `#${arity}${encTypeTag}` : '';
|
|
339
|
+
const result = generateId(finalLabel, `${filePath}:${qualifiedName}${arityTag}`);
|
|
340
|
+
functionIdCache.set(node, result);
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// Language-specific enclosing function resolution (e.g., Dart where
|
|
345
|
+
// function_body is a sibling of function_signature, not a child).
|
|
346
|
+
if (provider.enclosingFunctionFinder) {
|
|
347
|
+
const customResult = provider.enclosingFunctionFinder(current);
|
|
348
|
+
if (customResult) {
|
|
349
|
+
let finalLabel = customResult.label;
|
|
350
|
+
if (provider.labelOverride) {
|
|
351
|
+
const override = provider.labelOverride(current.previousSibling, finalLabel);
|
|
352
|
+
if (override !== null)
|
|
353
|
+
finalLabel = override;
|
|
354
|
+
}
|
|
355
|
+
// Qualify custom result with enclosing class
|
|
356
|
+
const classInfo = cachedFindEnclosingClassInfo(current.previousSibling ?? current, filePath, provider.resolveEnclosingOwner);
|
|
357
|
+
const qualifiedName = classInfo
|
|
358
|
+
? `${classInfo.className}.${customResult.funcName}`
|
|
359
|
+
: customResult.funcName;
|
|
360
|
+
// Include #<arity> suffix to match definition-phase Method/Constructor IDs.
|
|
361
|
+
// When same-arity collisions exist, also append ~type1,type2.
|
|
362
|
+
const sigNode = current.previousSibling ?? current;
|
|
363
|
+
let arity2;
|
|
364
|
+
let encTypeTag2 = '';
|
|
365
|
+
if (finalLabel === 'Method' || finalLabel === 'Constructor') {
|
|
366
|
+
const encLang2 = getLanguageFromFilename(filePath);
|
|
367
|
+
const classNode2 = findEnclosingClassNode(sigNode) ?? findClassNodeByQualifiedName(sigNode);
|
|
368
|
+
if (classNode2 && encLang2) {
|
|
369
|
+
const methodMap2 = getMethodInfo(classNode2, provider, {
|
|
370
|
+
filePath,
|
|
371
|
+
language: encLang2,
|
|
372
|
+
});
|
|
373
|
+
const defLine2 = sigNode.startPosition.row + 1;
|
|
374
|
+
const info2 = methodMap2?.get(`${customResult.funcName}:${defLine2}`);
|
|
375
|
+
if (info2) {
|
|
376
|
+
arity2 = info2.parameters.some((p) => p.isVariadic)
|
|
377
|
+
? undefined
|
|
378
|
+
: info2.parameters.length;
|
|
379
|
+
if (methodMap2 && arity2 !== undefined) {
|
|
380
|
+
const g2 = buildCollisionGroups(methodMap2);
|
|
381
|
+
encTypeTag2 =
|
|
382
|
+
typeTagForId(methodMap2, customResult.funcName, arity2, info2, encLang2, g2) +
|
|
383
|
+
constTagForId(methodMap2, customResult.funcName, arity2, info2, g2);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
const arityTag2 = arity2 !== undefined ? `#${arity2}${encTypeTag2}` : '';
|
|
389
|
+
const result = generateId(finalLabel, `${filePath}:${qualifiedName}${arityTag2}`);
|
|
390
|
+
functionIdCache.set(node, result);
|
|
391
|
+
return result;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
current = current.parent;
|
|
395
|
+
}
|
|
396
|
+
functionIdCache.set(node, null);
|
|
397
|
+
return null;
|
|
398
|
+
};
|
|
399
|
+
/** Cached wrapper for findEnclosingClassInfo — avoids repeated parent walks. */
|
|
400
|
+
const cachedFindEnclosingClassInfo = (node, filePath, resolveEnclosingOwner) => {
|
|
401
|
+
const cached = classIdCache.get(node);
|
|
402
|
+
if (cached !== undefined)
|
|
403
|
+
return cached;
|
|
404
|
+
const result = findEnclosingClassInfo(node, filePath, resolveEnclosingOwner);
|
|
405
|
+
classIdCache.set(node, result);
|
|
406
|
+
return result;
|
|
407
|
+
};
|
|
408
|
+
/** Cached wrapper for export checking — avoids repeated parent walks per symbol. */
|
|
409
|
+
const cachedExportCheck = (checker, node, name) => {
|
|
410
|
+
const cached = exportCache.get(node);
|
|
411
|
+
if (cached !== undefined)
|
|
412
|
+
return cached;
|
|
413
|
+
const result = checker(node, name);
|
|
414
|
+
exportCache.set(node, result);
|
|
415
|
+
return result;
|
|
416
|
+
};
|
|
417
|
+
// Label detection moved to shared getLabelFromCaptures in utils.ts
|
|
418
|
+
// DEFINITION_CAPTURE_KEYS and getDefinitionNodeFromCaptures imported from ../utils.js
|
|
419
|
+
// ============================================================================
|
|
420
|
+
// Process a batch of files
|
|
421
|
+
// ============================================================================
|
|
422
|
+
const processBatch = (files, onProgress) => {
|
|
423
|
+
const result = {
|
|
424
|
+
nodes: [],
|
|
425
|
+
relationships: [],
|
|
426
|
+
symbols: [],
|
|
427
|
+
imports: [],
|
|
428
|
+
calls: [],
|
|
429
|
+
assignments: [],
|
|
430
|
+
heritage: [],
|
|
431
|
+
routes: [],
|
|
432
|
+
fetchCalls: [],
|
|
433
|
+
decoratorRoutes: [],
|
|
434
|
+
toolDefs: [],
|
|
435
|
+
ormQueries: [],
|
|
436
|
+
constructorBindings: [],
|
|
437
|
+
fileScopeBindings: [],
|
|
438
|
+
parsedFiles: [],
|
|
439
|
+
skippedLanguages: {},
|
|
440
|
+
fileCount: 0,
|
|
441
|
+
};
|
|
442
|
+
// Group by language to minimize setLanguage calls
|
|
443
|
+
const byLanguage = new Map();
|
|
444
|
+
for (const file of files) {
|
|
445
|
+
const lang = getLanguageFromFilename(file.path);
|
|
446
|
+
if (!lang)
|
|
447
|
+
continue;
|
|
448
|
+
let list = byLanguage.get(lang);
|
|
449
|
+
if (!list) {
|
|
450
|
+
list = [];
|
|
451
|
+
byLanguage.set(lang, list);
|
|
452
|
+
}
|
|
453
|
+
list.push(file);
|
|
454
|
+
}
|
|
455
|
+
let totalProcessed = 0;
|
|
456
|
+
let lastReported = 0;
|
|
457
|
+
const PROGRESS_INTERVAL = Math.max(1, Math.min(100, Math.ceil(files.length / 10)));
|
|
458
|
+
const onFileProcessed = onProgress
|
|
459
|
+
? () => {
|
|
460
|
+
totalProcessed++;
|
|
461
|
+
if (totalProcessed - lastReported >= PROGRESS_INTERVAL) {
|
|
462
|
+
lastReported = totalProcessed;
|
|
463
|
+
onProgress(totalProcessed);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
: undefined;
|
|
467
|
+
for (const [language, langFiles] of byLanguage) {
|
|
468
|
+
const provider = getProvider(language);
|
|
469
|
+
const queryString = provider.treeSitterQueries;
|
|
470
|
+
if (!queryString)
|
|
471
|
+
continue;
|
|
472
|
+
// Track if we need to handle tsx separately
|
|
473
|
+
const tsxFiles = [];
|
|
474
|
+
const regularFiles = [];
|
|
475
|
+
if (language === SupportedLanguages.TypeScript) {
|
|
476
|
+
for (const f of langFiles) {
|
|
477
|
+
if (f.path.endsWith('.tsx')) {
|
|
478
|
+
tsxFiles.push(f);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
regularFiles.push(f);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
// Manual loop (not spread) — `push(...arr)` blows the stack on very
|
|
487
|
+
// large arrays when langFiles has tens of thousands of entries.
|
|
488
|
+
for (const f of langFiles)
|
|
489
|
+
regularFiles.push(f);
|
|
490
|
+
}
|
|
491
|
+
// Process regular files for this language
|
|
492
|
+
if (regularFiles.length > 0) {
|
|
493
|
+
if (isLanguageAvailable(language, regularFiles[0].path)) {
|
|
494
|
+
try {
|
|
495
|
+
setLanguage(language, regularFiles[0].path);
|
|
496
|
+
processFileGroup(regularFiles, language, queryString, result, onFileProcessed);
|
|
497
|
+
}
|
|
498
|
+
catch {
|
|
499
|
+
// parser unavailable — skip this language group
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
result.skippedLanguages[language] =
|
|
504
|
+
(result.skippedLanguages[language] || 0) + regularFiles.length;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
// Process tsx files separately (different grammar)
|
|
508
|
+
if (tsxFiles.length > 0) {
|
|
509
|
+
if (isLanguageAvailable(language, tsxFiles[0].path)) {
|
|
510
|
+
try {
|
|
511
|
+
setLanguage(language, tsxFiles[0].path);
|
|
512
|
+
processFileGroup(tsxFiles, language, queryString, result, onFileProcessed);
|
|
513
|
+
}
|
|
514
|
+
catch {
|
|
515
|
+
// parser unavailable — skip this language group
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
result.skippedLanguages[language] =
|
|
520
|
+
(result.skippedLanguages[language] || 0) + tsxFiles.length;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (onProgress && totalProcessed !== lastReported) {
|
|
525
|
+
onProgress(totalProcessed);
|
|
526
|
+
}
|
|
527
|
+
return result;
|
|
528
|
+
};
|
|
529
|
+
const ROUTE_HTTP_METHODS = new Set([
|
|
530
|
+
'get',
|
|
531
|
+
'post',
|
|
532
|
+
'put',
|
|
533
|
+
'patch',
|
|
534
|
+
'delete',
|
|
535
|
+
'options',
|
|
536
|
+
'any',
|
|
537
|
+
'match',
|
|
538
|
+
]);
|
|
539
|
+
const ROUTE_RESOURCE_METHODS = new Set(['resource', 'apiResource']);
|
|
540
|
+
// Express/Hono method names that register routes
|
|
541
|
+
const EXPRESS_ROUTE_METHODS = new Set([
|
|
542
|
+
'get',
|
|
543
|
+
'post',
|
|
544
|
+
'put',
|
|
545
|
+
'delete',
|
|
546
|
+
'patch',
|
|
547
|
+
'all',
|
|
548
|
+
'use',
|
|
549
|
+
'route',
|
|
550
|
+
]);
|
|
551
|
+
// HTTP client methods that are ONLY used by clients, not Express route registration.
|
|
552
|
+
// Methods like get/post/put/delete/patch overlap with Express — those are captured by
|
|
553
|
+
// the express_route handler as route definitions, not consumers. The fetch() global
|
|
554
|
+
// function is captured separately by the route.fetch query.
|
|
555
|
+
const HTTP_CLIENT_ONLY_METHODS = new Set(['head', 'options', 'request', 'ajax']);
|
|
556
|
+
// Known HTTP client receivers u2014 skip these, they're API consumers not routes
|
|
557
|
+
const HTTP_CLIENT_RECEIVERS = new Set([
|
|
558
|
+
'axios',
|
|
559
|
+
'request',
|
|
560
|
+
'fetch',
|
|
561
|
+
'http',
|
|
562
|
+
'https',
|
|
563
|
+
'got',
|
|
564
|
+
'ky',
|
|
565
|
+
'superagent',
|
|
566
|
+
'needle',
|
|
567
|
+
'undici',
|
|
568
|
+
'apiclient',
|
|
569
|
+
'client',
|
|
570
|
+
'httpclient',
|
|
571
|
+
'api',
|
|
572
|
+
'$http',
|
|
573
|
+
'session',
|
|
574
|
+
'httpservice',
|
|
575
|
+
'conn',
|
|
576
|
+
]);
|
|
577
|
+
// Decorator names that indicate HTTP route handlers (NestJS, Flask, FastAPI, Spring)
|
|
578
|
+
const ROUTE_DECORATOR_NAMES = new Set([
|
|
579
|
+
'Get',
|
|
580
|
+
'Post',
|
|
581
|
+
'Put',
|
|
582
|
+
'Delete',
|
|
583
|
+
'Patch',
|
|
584
|
+
'Route',
|
|
585
|
+
'get',
|
|
586
|
+
'post',
|
|
587
|
+
'put',
|
|
588
|
+
'delete',
|
|
589
|
+
'patch',
|
|
590
|
+
'route',
|
|
591
|
+
'RequestMapping',
|
|
592
|
+
'GetMapping',
|
|
593
|
+
'PostMapping',
|
|
594
|
+
'PutMapping',
|
|
595
|
+
'DeleteMapping',
|
|
596
|
+
]);
|
|
597
|
+
const RESOURCE_ACTIONS = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy'];
|
|
598
|
+
const API_RESOURCE_ACTIONS = ['index', 'store', 'show', 'update', 'destroy'];
|
|
599
|
+
/** Check if node is a scoped_call_expression with object 'Route' */
|
|
600
|
+
function isRouteStaticCall(node) {
|
|
601
|
+
if (node.type !== 'scoped_call_expression')
|
|
602
|
+
return false;
|
|
603
|
+
const obj = node.childForFieldName?.('object') ?? node.children?.[0];
|
|
604
|
+
return obj?.text === 'Route';
|
|
605
|
+
}
|
|
606
|
+
/** Get the method name from a scoped_call_expression or member_call_expression */
|
|
607
|
+
function getCallMethodName(node) {
|
|
608
|
+
const nameNode = node.childForFieldName?.('name') ?? node.children?.find((c) => c.type === 'name');
|
|
609
|
+
return nameNode?.text ?? null;
|
|
610
|
+
}
|
|
611
|
+
/** Get the arguments node from a call expression */
|
|
612
|
+
function getArguments(node) {
|
|
613
|
+
return node.children?.find((c) => c.type === 'arguments') ?? null;
|
|
614
|
+
}
|
|
615
|
+
/** Find the closure body inside arguments */
|
|
616
|
+
function findClosureBody(argsNode) {
|
|
617
|
+
if (!argsNode)
|
|
618
|
+
return null;
|
|
619
|
+
for (const child of argsNode.children ?? []) {
|
|
620
|
+
if (child.type === 'argument') {
|
|
621
|
+
for (const inner of child.children ?? []) {
|
|
622
|
+
if (inner.type === 'anonymous_function' || inner.type === 'arrow_function') {
|
|
623
|
+
return (inner.childForFieldName?.('body') ??
|
|
624
|
+
inner.children?.find((c) => c.type === 'compound_statement') ??
|
|
625
|
+
null);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
if (child.type === 'anonymous_function' || child.type === 'arrow_function') {
|
|
630
|
+
return (child.childForFieldName?.('body') ??
|
|
631
|
+
child.children?.find((c) => c.type === 'compound_statement') ??
|
|
632
|
+
null);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
/** Extract first string argument from arguments node */
|
|
638
|
+
function extractFirstStringArg(argsNode) {
|
|
639
|
+
if (!argsNode)
|
|
640
|
+
return null;
|
|
641
|
+
for (const child of argsNode.children ?? []) {
|
|
642
|
+
const target = child.type === 'argument' ? child.children?.[0] : child;
|
|
643
|
+
if (!target)
|
|
644
|
+
continue;
|
|
645
|
+
if (target.type === 'string' || target.type === 'encapsed_string') {
|
|
646
|
+
return extractStringContent(target);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
/** Extract middleware from arguments — handles string or array */
|
|
652
|
+
function extractMiddlewareArg(argsNode) {
|
|
653
|
+
if (!argsNode)
|
|
654
|
+
return [];
|
|
655
|
+
for (const child of argsNode.children ?? []) {
|
|
656
|
+
const target = child.type === 'argument' ? child.children?.[0] : child;
|
|
657
|
+
if (!target)
|
|
658
|
+
continue;
|
|
659
|
+
if (target.type === 'string' || target.type === 'encapsed_string') {
|
|
660
|
+
const val = extractStringContent(target);
|
|
661
|
+
return val ? [val] : [];
|
|
662
|
+
}
|
|
663
|
+
if (target.type === 'array_creation_expression') {
|
|
664
|
+
const items = [];
|
|
665
|
+
for (const el of target.children ?? []) {
|
|
666
|
+
if (el.type === 'array_element_initializer') {
|
|
667
|
+
const str = el.children?.find((c) => c.type === 'string' || c.type === 'encapsed_string');
|
|
668
|
+
const val = str ? extractStringContent(str) : null;
|
|
669
|
+
if (val)
|
|
670
|
+
items.push(val);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return items;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return [];
|
|
677
|
+
}
|
|
678
|
+
/** Extract Controller::class from arguments */
|
|
679
|
+
function extractClassArg(argsNode) {
|
|
680
|
+
if (!argsNode)
|
|
681
|
+
return null;
|
|
682
|
+
for (const child of argsNode.children ?? []) {
|
|
683
|
+
const target = child.type === 'argument' ? child.children?.[0] : child;
|
|
684
|
+
if (target?.type === 'class_constant_access_expression') {
|
|
685
|
+
return target.children?.find((c) => c.type === 'name')?.text ?? null;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return null;
|
|
689
|
+
}
|
|
690
|
+
/** Extract controller class name from arguments: [Controller::class, 'method'] or 'Controller@method' */
|
|
691
|
+
function extractControllerTarget(argsNode) {
|
|
692
|
+
if (!argsNode)
|
|
693
|
+
return { controller: null, method: null };
|
|
694
|
+
const args = [];
|
|
695
|
+
for (const child of argsNode.children ?? []) {
|
|
696
|
+
if (child.type === 'argument')
|
|
697
|
+
args.push(child.children?.[0]);
|
|
698
|
+
else if (child.type !== '(' && child.type !== ')' && child.type !== ',')
|
|
699
|
+
args.push(child);
|
|
700
|
+
}
|
|
701
|
+
// Second arg is the handler
|
|
702
|
+
const handlerNode = args[1];
|
|
703
|
+
if (!handlerNode)
|
|
704
|
+
return { controller: null, method: null };
|
|
705
|
+
// Array syntax: [UserController::class, 'index']
|
|
706
|
+
if (handlerNode.type === 'array_creation_expression') {
|
|
707
|
+
let controller = null;
|
|
708
|
+
let method = null;
|
|
709
|
+
const elements = [];
|
|
710
|
+
for (const el of handlerNode.children ?? []) {
|
|
711
|
+
if (el.type === 'array_element_initializer')
|
|
712
|
+
elements.push(el);
|
|
713
|
+
}
|
|
714
|
+
if (elements[0]) {
|
|
715
|
+
const classAccess = findDescendant(elements[0], 'class_constant_access_expression');
|
|
716
|
+
if (classAccess) {
|
|
717
|
+
controller = classAccess.children?.find((c) => c.type === 'name')?.text ?? null;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
if (elements[1]) {
|
|
721
|
+
const str = findDescendant(elements[1], 'string');
|
|
722
|
+
method = str ? extractStringContent(str) : null;
|
|
723
|
+
}
|
|
724
|
+
return { controller, method };
|
|
725
|
+
}
|
|
726
|
+
// String syntax: 'UserController@index'
|
|
727
|
+
if (handlerNode.type === 'string' || handlerNode.type === 'encapsed_string') {
|
|
728
|
+
const text = extractStringContent(handlerNode);
|
|
729
|
+
if (text?.includes('@')) {
|
|
730
|
+
const [controller, method] = text.split('@');
|
|
731
|
+
return { controller, method };
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
// Class reference: UserController::class (invokable controller)
|
|
735
|
+
if (handlerNode.type === 'class_constant_access_expression') {
|
|
736
|
+
const controller = handlerNode.children?.find((c) => c.type === 'name')?.text ?? null;
|
|
737
|
+
return { controller, method: '__invoke' };
|
|
738
|
+
}
|
|
739
|
+
return { controller: null, method: null };
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Unwrap a chained call like Route::middleware('auth')->prefix('api')->group(fn)
|
|
743
|
+
*/
|
|
744
|
+
function unwrapRouteChain(node) {
|
|
745
|
+
if (node.type !== 'member_call_expression')
|
|
746
|
+
return null;
|
|
747
|
+
const terminalMethod = getCallMethodName(node);
|
|
748
|
+
if (!terminalMethod)
|
|
749
|
+
return null;
|
|
750
|
+
const terminalArgs = getArguments(node);
|
|
751
|
+
const attributes = [];
|
|
752
|
+
let current = node.children?.[0];
|
|
753
|
+
while (current) {
|
|
754
|
+
if (current.type === 'member_call_expression') {
|
|
755
|
+
const method = getCallMethodName(current);
|
|
756
|
+
const args = getArguments(current);
|
|
757
|
+
if (method)
|
|
758
|
+
attributes.unshift({ method, argsNode: args });
|
|
759
|
+
current = current.children?.[0];
|
|
760
|
+
}
|
|
761
|
+
else if (current.type === 'scoped_call_expression') {
|
|
762
|
+
const obj = current.childForFieldName?.('object') ?? current.children?.[0];
|
|
763
|
+
if (obj?.text !== 'Route')
|
|
764
|
+
return null;
|
|
765
|
+
const method = getCallMethodName(current);
|
|
766
|
+
const args = getArguments(current);
|
|
767
|
+
if (method)
|
|
768
|
+
attributes.unshift({ method, argsNode: args });
|
|
769
|
+
return { isRouteFacade: true, terminalMethod, attributes, terminalArgs, node };
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
return null;
|
|
776
|
+
}
|
|
777
|
+
/** Parse Route::group(['middleware' => ..., 'prefix' => ...], fn) array syntax */
|
|
778
|
+
function parseArrayGroupArgs(argsNode) {
|
|
779
|
+
const ctx = { middleware: [], prefix: null, controller: null };
|
|
780
|
+
if (!argsNode)
|
|
781
|
+
return ctx;
|
|
782
|
+
for (const child of argsNode.children ?? []) {
|
|
783
|
+
const target = child.type === 'argument' ? child.children?.[0] : child;
|
|
784
|
+
if (target?.type === 'array_creation_expression') {
|
|
785
|
+
for (const el of target.children ?? []) {
|
|
786
|
+
if (el.type !== 'array_element_initializer')
|
|
787
|
+
continue;
|
|
788
|
+
const children = el.children ?? [];
|
|
789
|
+
const arrowIdx = children.findIndex((c) => c.type === '=>');
|
|
790
|
+
if (arrowIdx === -1)
|
|
791
|
+
continue;
|
|
792
|
+
const key = extractStringContent(children[arrowIdx - 1]);
|
|
793
|
+
const val = children[arrowIdx + 1];
|
|
794
|
+
if (key === 'middleware') {
|
|
795
|
+
if (val?.type === 'string') {
|
|
796
|
+
const s = extractStringContent(val);
|
|
797
|
+
if (s)
|
|
798
|
+
ctx.middleware.push(s);
|
|
799
|
+
}
|
|
800
|
+
else if (val?.type === 'array_creation_expression') {
|
|
801
|
+
for (const item of val.children ?? []) {
|
|
802
|
+
if (item.type === 'array_element_initializer') {
|
|
803
|
+
const str = item.children?.find((c) => c.type === 'string');
|
|
804
|
+
const s = str ? extractStringContent(str) : null;
|
|
805
|
+
if (s)
|
|
806
|
+
ctx.middleware.push(s);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
else if (key === 'prefix') {
|
|
812
|
+
ctx.prefix = extractStringContent(val) ?? null;
|
|
813
|
+
}
|
|
814
|
+
else if (key === 'controller') {
|
|
815
|
+
if (val?.type === 'class_constant_access_expression') {
|
|
816
|
+
ctx.controller = val.children?.find((c) => c.type === 'name')?.text ?? null;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
return ctx;
|
|
823
|
+
}
|
|
824
|
+
function extractLaravelRoutes(tree, filePath) {
|
|
825
|
+
const routes = [];
|
|
826
|
+
function resolveStack(stack) {
|
|
827
|
+
const middleware = [];
|
|
828
|
+
let prefix = null;
|
|
829
|
+
let controller = null;
|
|
830
|
+
for (const ctx of stack) {
|
|
831
|
+
middleware.push(...ctx.middleware);
|
|
832
|
+
if (ctx.prefix)
|
|
833
|
+
prefix = prefix ? `${prefix}/${ctx.prefix}`.replace(/\/+/g, '/') : ctx.prefix;
|
|
834
|
+
if (ctx.controller)
|
|
835
|
+
controller = ctx.controller;
|
|
836
|
+
}
|
|
837
|
+
return { middleware, prefix, controller };
|
|
838
|
+
}
|
|
839
|
+
function emitRoute(httpMethod, argsNode, lineNumber, groupStack, chainAttrs) {
|
|
840
|
+
const effective = resolveStack(groupStack);
|
|
841
|
+
for (const attr of chainAttrs) {
|
|
842
|
+
if (attr.method === 'middleware')
|
|
843
|
+
effective.middleware.push(...extractMiddlewareArg(attr.argsNode));
|
|
844
|
+
if (attr.method === 'prefix') {
|
|
845
|
+
const p = extractFirstStringArg(attr.argsNode);
|
|
846
|
+
if (p)
|
|
847
|
+
effective.prefix = effective.prefix ? `${effective.prefix}/${p}` : p;
|
|
848
|
+
}
|
|
849
|
+
if (attr.method === 'controller') {
|
|
850
|
+
const cls = extractClassArg(attr.argsNode);
|
|
851
|
+
if (cls)
|
|
852
|
+
effective.controller = cls;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
const routePath = extractFirstStringArg(argsNode);
|
|
856
|
+
if (ROUTE_RESOURCE_METHODS.has(httpMethod)) {
|
|
857
|
+
const target = extractControllerTarget(argsNode);
|
|
858
|
+
const actions = httpMethod === 'apiResource' ? API_RESOURCE_ACTIONS : RESOURCE_ACTIONS;
|
|
859
|
+
for (const action of actions) {
|
|
860
|
+
routes.push({
|
|
861
|
+
filePath,
|
|
862
|
+
httpMethod,
|
|
863
|
+
routePath,
|
|
864
|
+
controllerName: target.controller ?? effective.controller,
|
|
865
|
+
methodName: action,
|
|
866
|
+
middleware: [...effective.middleware],
|
|
867
|
+
prefix: effective.prefix,
|
|
868
|
+
lineNumber,
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
const target = extractControllerTarget(argsNode);
|
|
874
|
+
routes.push({
|
|
875
|
+
filePath,
|
|
876
|
+
httpMethod,
|
|
877
|
+
routePath,
|
|
878
|
+
controllerName: target.controller ?? effective.controller,
|
|
879
|
+
methodName: target.method,
|
|
880
|
+
middleware: [...effective.middleware],
|
|
881
|
+
prefix: effective.prefix,
|
|
882
|
+
lineNumber,
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
const walkStack = [{ node: tree.rootNode, groupSnapshot: [] }];
|
|
887
|
+
while (walkStack.length > 0) {
|
|
888
|
+
const { node, groupSnapshot } = walkStack.pop();
|
|
889
|
+
// Case 1: Simple Route::get(...), Route::post(...), etc.
|
|
890
|
+
if (isRouteStaticCall(node)) {
|
|
891
|
+
const method = getCallMethodName(node);
|
|
892
|
+
if (method && (ROUTE_HTTP_METHODS.has(method) || ROUTE_RESOURCE_METHODS.has(method))) {
|
|
893
|
+
emitRoute(method, getArguments(node), node.startPosition.row, groupSnapshot, []);
|
|
894
|
+
continue;
|
|
895
|
+
}
|
|
896
|
+
if (method === 'group') {
|
|
897
|
+
const argsNode = getArguments(node);
|
|
898
|
+
const groupCtx = parseArrayGroupArgs(argsNode);
|
|
899
|
+
const body = findClosureBody(argsNode);
|
|
900
|
+
if (body) {
|
|
901
|
+
const childSnapshot = [...groupSnapshot, groupCtx];
|
|
902
|
+
const children = body.children ?? [];
|
|
903
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
904
|
+
walkStack.push({ node: children[i], groupSnapshot: childSnapshot });
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
// Case 2: Fluent chain — Route::middleware(...)->group(...) or Route::middleware(...)->get(...)
|
|
911
|
+
const chain = unwrapRouteChain(node);
|
|
912
|
+
if (chain) {
|
|
913
|
+
if (chain.terminalMethod === 'group') {
|
|
914
|
+
const groupCtx = { middleware: [], prefix: null, controller: null };
|
|
915
|
+
for (const attr of chain.attributes) {
|
|
916
|
+
if (attr.method === 'middleware')
|
|
917
|
+
groupCtx.middleware.push(...extractMiddlewareArg(attr.argsNode));
|
|
918
|
+
if (attr.method === 'prefix')
|
|
919
|
+
groupCtx.prefix = extractFirstStringArg(attr.argsNode);
|
|
920
|
+
if (attr.method === 'controller')
|
|
921
|
+
groupCtx.controller = extractClassArg(attr.argsNode);
|
|
922
|
+
}
|
|
923
|
+
const body = findClosureBody(chain.terminalArgs);
|
|
924
|
+
if (body) {
|
|
925
|
+
const childSnapshot = [...groupSnapshot, groupCtx];
|
|
926
|
+
const children = body.children ?? [];
|
|
927
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
928
|
+
walkStack.push({ node: children[i], groupSnapshot: childSnapshot });
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
continue;
|
|
932
|
+
}
|
|
933
|
+
if (ROUTE_HTTP_METHODS.has(chain.terminalMethod) ||
|
|
934
|
+
ROUTE_RESOURCE_METHODS.has(chain.terminalMethod)) {
|
|
935
|
+
emitRoute(chain.terminalMethod, chain.terminalArgs, node.startPosition.row, groupSnapshot, chain.attributes);
|
|
936
|
+
continue;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
// Default: push children in reverse so leftmost is processed first
|
|
940
|
+
const children = node.children ?? [];
|
|
941
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
942
|
+
walkStack.push({ node: children[i], groupSnapshot });
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return routes;
|
|
946
|
+
}
|
|
947
|
+
// ============================================================================
|
|
948
|
+
// ORM Query Detection (Prisma + Supabase)
|
|
949
|
+
// ============================================================================
|
|
950
|
+
const PRISMA_QUERY_RE = /\bprisma\.(\w+)\.(findMany|findFirst|findUnique|findUniqueOrThrow|findFirstOrThrow|create|createMany|update|updateMany|delete|deleteMany|upsert|count|aggregate|groupBy)\s*\(/g;
|
|
951
|
+
const SUPABASE_QUERY_RE = /\bsupabase\.from\s*\(\s*['"](\w+)['"]\s*\)\s*\.(select|insert|update|delete|upsert)\s*\(/g;
|
|
952
|
+
/**
|
|
953
|
+
* Extract ORM query calls from file content via regex.
|
|
954
|
+
* Appends results to the provided array (avoids allocation when no matches).
|
|
955
|
+
*/
|
|
956
|
+
export function extractORMQueries(filePath, content, out) {
|
|
957
|
+
const hasPrisma = content.includes('prisma.');
|
|
958
|
+
const hasSupabase = content.includes('supabase.from');
|
|
959
|
+
if (!hasPrisma && !hasSupabase)
|
|
960
|
+
return;
|
|
961
|
+
if (hasPrisma) {
|
|
962
|
+
PRISMA_QUERY_RE.lastIndex = 0;
|
|
963
|
+
let m;
|
|
964
|
+
while ((m = PRISMA_QUERY_RE.exec(content)) !== null) {
|
|
965
|
+
const model = m[1];
|
|
966
|
+
if (model.startsWith('$'))
|
|
967
|
+
continue;
|
|
968
|
+
out.push({
|
|
969
|
+
filePath,
|
|
970
|
+
orm: 'prisma',
|
|
971
|
+
model,
|
|
972
|
+
method: m[2],
|
|
973
|
+
lineNumber: content.substring(0, m.index).split('\n').length - 1,
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (hasSupabase) {
|
|
978
|
+
SUPABASE_QUERY_RE.lastIndex = 0;
|
|
979
|
+
let m;
|
|
980
|
+
while ((m = SUPABASE_QUERY_RE.exec(content)) !== null) {
|
|
981
|
+
out.push({
|
|
982
|
+
filePath,
|
|
983
|
+
orm: 'supabase',
|
|
984
|
+
model: m[1],
|
|
985
|
+
method: m[2],
|
|
986
|
+
lineNumber: content.substring(0, m.index).split('\n').length - 1,
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
const processFileGroup = (files, language, queryString, result, onFileProcessed) => {
|
|
992
|
+
let query;
|
|
993
|
+
try {
|
|
994
|
+
const lang = parser.getLanguage();
|
|
995
|
+
query = new Parser.Query(lang, queryString);
|
|
996
|
+
}
|
|
997
|
+
catch (err) {
|
|
998
|
+
const message = `Query compilation failed for ${language}: ${err instanceof Error ? err.message : String(err)}`;
|
|
999
|
+
if (parentPort) {
|
|
1000
|
+
parentPort.postMessage({ type: 'warning', message });
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
logger.warn(message);
|
|
1004
|
+
}
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
for (const file of files) {
|
|
1008
|
+
// Skip files larger than the max tree-sitter buffer (32 MB)
|
|
1009
|
+
if (getTreeSitterContentByteLength(file.content) > TREE_SITTER_MAX_BUFFER)
|
|
1010
|
+
continue;
|
|
1011
|
+
// Vue SFC preprocessing: extract <script> block content
|
|
1012
|
+
let parseContent = file.content;
|
|
1013
|
+
let lineOffset = 0;
|
|
1014
|
+
let isVueSetup = false;
|
|
1015
|
+
if (language === SupportedLanguages.Vue) {
|
|
1016
|
+
const extracted = extractVueScript(file.content);
|
|
1017
|
+
if (!extracted)
|
|
1018
|
+
continue; // skip .vue files with no script block
|
|
1019
|
+
parseContent = extracted.scriptContent;
|
|
1020
|
+
lineOffset = extracted.lineOffset;
|
|
1021
|
+
isVueSetup = extracted.isSetup;
|
|
1022
|
+
}
|
|
1023
|
+
// Per-language source-text transform (e.g., UE macro stripping for C++).
|
|
1024
|
+
// Length-preserving — see LanguageProvider.preprocessSource contract.
|
|
1025
|
+
parseContent =
|
|
1026
|
+
getProvider(language).preprocessSource?.(parseContent, file.path) ?? parseContent;
|
|
1027
|
+
clearCaches(); // Reset memoization before each new file
|
|
1028
|
+
let tree;
|
|
1029
|
+
try {
|
|
1030
|
+
tree = parseSourceSafe(parser, parseContent, undefined, {
|
|
1031
|
+
bufferSize: getTreeSitterBufferSize(parseContent),
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
catch (err) {
|
|
1035
|
+
logger.warn(`Failed to parse file ${file.path}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1036
|
+
continue;
|
|
1037
|
+
}
|
|
1038
|
+
result.fileCount++;
|
|
1039
|
+
onFileProcessed?.();
|
|
1040
|
+
let matches;
|
|
1041
|
+
try {
|
|
1042
|
+
matches = query.matches(tree.rootNode);
|
|
1043
|
+
}
|
|
1044
|
+
catch (err) {
|
|
1045
|
+
logger.warn(`Query execution failed for ${file.path}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
const provider = getProvider(language);
|
|
1049
|
+
// RFC #909 Ring 2: produce a `ParsedFile` for the new scope-based
|
|
1050
|
+
// resolution pipeline. No-op (returns undefined) for every language
|
|
1051
|
+
// today — only fires once a provider implements `emitScopeCaptures`.
|
|
1052
|
+
// Runs BEFORE legacy extraction and its result is independent: a
|
|
1053
|
+
// failure here is caught inside `extractParsedFile` and does NOT
|
|
1054
|
+
// affect the legacy DAG path that follows.
|
|
1055
|
+
const parsedFile = extractParsedFile(provider, parseContent, file.path, (message) => {
|
|
1056
|
+
if (parentPort)
|
|
1057
|
+
parentPort.postMessage({ type: 'warning', message });
|
|
1058
|
+
else
|
|
1059
|
+
logger.warn(message);
|
|
1060
|
+
}, tree);
|
|
1061
|
+
if (parsedFile !== undefined)
|
|
1062
|
+
result.parsedFiles.push(parsedFile);
|
|
1063
|
+
// Pre-pass: extract heritage from query matches to build parentMap for buildTypeEnv.
|
|
1064
|
+
// Heritage edges (EXTENDS/IMPLEMENTS) are created by heritage-processor which runs
|
|
1065
|
+
// in PARALLEL with call-processor, so the graph edges don't exist when buildTypeEnv
|
|
1066
|
+
// runs. This pre-pass makes parent class information available for type resolution.
|
|
1067
|
+
const fileParentMap = new Map();
|
|
1068
|
+
if (provider.heritageExtractor) {
|
|
1069
|
+
for (const match of matches) {
|
|
1070
|
+
const captureMap = {};
|
|
1071
|
+
for (const c of match.captures) {
|
|
1072
|
+
captureMap[c.name] = c.node;
|
|
1073
|
+
}
|
|
1074
|
+
if (captureMap['heritage.class']) {
|
|
1075
|
+
const heritageItems = provider.heritageExtractor.extract(captureMap, {
|
|
1076
|
+
filePath: file.path,
|
|
1077
|
+
language,
|
|
1078
|
+
});
|
|
1079
|
+
for (const item of heritageItems) {
|
|
1080
|
+
if (item.kind === 'extends') {
|
|
1081
|
+
let parents = fileParentMap.get(item.className);
|
|
1082
|
+
if (!parents) {
|
|
1083
|
+
parents = [];
|
|
1084
|
+
fileParentMap.set(item.className, parents);
|
|
1085
|
+
}
|
|
1086
|
+
if (!parents.includes(item.parentName))
|
|
1087
|
+
parents.push(item.parentName);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
// Build per-file type environment + constructor bindings in a single AST walk.
|
|
1094
|
+
// Constructor bindings are verified against the SymbolTable in processCallsFromExtracted.
|
|
1095
|
+
const parentMap = fileParentMap;
|
|
1096
|
+
const typeEnv = buildTypeEnv(tree, language, {
|
|
1097
|
+
parentMap,
|
|
1098
|
+
enclosingFunctionFinder: provider?.enclosingFunctionFinder,
|
|
1099
|
+
extractFunctionName: provider?.methodExtractor?.extractFunctionName,
|
|
1100
|
+
});
|
|
1101
|
+
const callRouter = provider.callRouter;
|
|
1102
|
+
if (typeEnv.constructorBindings.length > 0) {
|
|
1103
|
+
result.constructorBindings.push({
|
|
1104
|
+
filePath: file.path,
|
|
1105
|
+
bindings: [...typeEnv.constructorBindings],
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
// Serialize file-scope bindings for BindingAccumulator. These feed the
|
|
1109
|
+
// ExportedTypeMap enrichment loop in pipeline.ts — the only current
|
|
1110
|
+
// consumer of worker-path binding data.
|
|
1111
|
+
//
|
|
1112
|
+
// Historical note: we previously serialized all scopes
|
|
1113
|
+
// (`typeEnv.allScopes()`), which pushed ~4.9 MB of function-scope
|
|
1114
|
+
// bindings across the IPC boundary on every worker batch with zero
|
|
1115
|
+
// downstream readers. Narrowing to `fileScope()` recovers that cost.
|
|
1116
|
+
// See the `FileScopeBindings` JSDoc above for the Phase 9 reversion
|
|
1117
|
+
// path when a function-scope consumer lands.
|
|
1118
|
+
const fileScope = typeEnv.fileScope();
|
|
1119
|
+
if (fileScope.size > 0) {
|
|
1120
|
+
const scopeBindings = [];
|
|
1121
|
+
for (const [varName, typeName] of fileScope) {
|
|
1122
|
+
scopeBindings.push([varName, typeName]);
|
|
1123
|
+
}
|
|
1124
|
+
result.fileScopeBindings.push({ filePath: file.path, bindings: scopeBindings });
|
|
1125
|
+
}
|
|
1126
|
+
// Per-file map: decorator end-line → decorator info, for associating with definitions
|
|
1127
|
+
const fileDecorators = new Map();
|
|
1128
|
+
// Track start indices of definition nodes already processed by higher-priority captures
|
|
1129
|
+
// (e.g. @definition.function) to avoid duplicate nodes when @definition.const/@definition.variable
|
|
1130
|
+
// patterns overlap with the same source range.
|
|
1131
|
+
const processedDefinitionNodes = new Set();
|
|
1132
|
+
for (const match of matches) {
|
|
1133
|
+
const captureMap = {};
|
|
1134
|
+
for (const c of match.captures) {
|
|
1135
|
+
captureMap[c.name] = c.node;
|
|
1136
|
+
}
|
|
1137
|
+
// Extract import paths before skipping
|
|
1138
|
+
if (captureMap['import'] && captureMap['import.source']) {
|
|
1139
|
+
const rawImportPath = preprocessImportPath(captureMap['import.source'].text, captureMap['import'], provider);
|
|
1140
|
+
if (!rawImportPath)
|
|
1141
|
+
continue;
|
|
1142
|
+
const extractor = provider.namedBindingExtractor;
|
|
1143
|
+
const namedBindings = extractor ? extractor(captureMap['import']) : undefined;
|
|
1144
|
+
result.imports.push({
|
|
1145
|
+
filePath: file.path,
|
|
1146
|
+
rawImportPath,
|
|
1147
|
+
language: language,
|
|
1148
|
+
...(namedBindings ? { namedBindings } : {}),
|
|
1149
|
+
});
|
|
1150
|
+
continue;
|
|
1151
|
+
}
|
|
1152
|
+
// Extract assignment sites (field write access)
|
|
1153
|
+
if (captureMap['assignment'] &&
|
|
1154
|
+
captureMap['assignment.receiver'] &&
|
|
1155
|
+
captureMap['assignment.property']) {
|
|
1156
|
+
const receiverText = captureMap['assignment.receiver'].text;
|
|
1157
|
+
const propertyName = captureMap['assignment.property'].text;
|
|
1158
|
+
if (receiverText && propertyName) {
|
|
1159
|
+
const srcId = findEnclosingFunctionId(captureMap['assignment'], file.path, provider) ||
|
|
1160
|
+
generateId('File', file.path);
|
|
1161
|
+
let receiverTypeName;
|
|
1162
|
+
if (typeEnv) {
|
|
1163
|
+
receiverTypeName = typeEnv.lookup(receiverText, captureMap['assignment']) ?? undefined;
|
|
1164
|
+
}
|
|
1165
|
+
result.assignments.push({
|
|
1166
|
+
filePath: file.path,
|
|
1167
|
+
sourceId: srcId,
|
|
1168
|
+
receiverText,
|
|
1169
|
+
propertyName,
|
|
1170
|
+
...(receiverTypeName ? { receiverTypeName } : {}),
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
if (!captureMap['call'])
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1176
|
+
// Store decorator metadata for later association with definitions
|
|
1177
|
+
if (captureMap['decorator'] && captureMap['decorator.name']) {
|
|
1178
|
+
const decoratorName = captureMap['decorator.name'].text;
|
|
1179
|
+
const decoratorArg = captureMap['decorator.arg']?.text;
|
|
1180
|
+
const decoratorNode = captureMap['decorator'];
|
|
1181
|
+
// Store by the decorator's end line — the definition follows immediately after
|
|
1182
|
+
fileDecorators.set(decoratorNode.endPosition.row, {
|
|
1183
|
+
name: decoratorName,
|
|
1184
|
+
arg: decoratorArg,
|
|
1185
|
+
});
|
|
1186
|
+
if (ROUTE_DECORATOR_NAMES.has(decoratorName)) {
|
|
1187
|
+
const routePath = decoratorArg || '';
|
|
1188
|
+
const method = decoratorName.replace('Mapping', '').toUpperCase();
|
|
1189
|
+
const httpMethod = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'].includes(method)
|
|
1190
|
+
? method
|
|
1191
|
+
: 'GET';
|
|
1192
|
+
result.decoratorRoutes.push({
|
|
1193
|
+
filePath: file.path,
|
|
1194
|
+
routePath,
|
|
1195
|
+
httpMethod,
|
|
1196
|
+
decoratorName,
|
|
1197
|
+
lineNumber: decoratorNode.startPosition.row + lineOffset,
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
// MCP/RPC tool detection: @mcp.tool(), @app.tool(), @server.tool()
|
|
1201
|
+
if (decoratorName === 'tool') {
|
|
1202
|
+
// Re-store with isTool flag for the definition handler
|
|
1203
|
+
fileDecorators.set(decoratorNode.endPosition.row, {
|
|
1204
|
+
name: decoratorName,
|
|
1205
|
+
arg: decoratorArg,
|
|
1206
|
+
isTool: true,
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
continue;
|
|
1210
|
+
}
|
|
1211
|
+
// Extract HTTP consumer URLs: fetch(), axios.get(), $.get(), requests.get(), etc.
|
|
1212
|
+
if (captureMap['route.fetch']) {
|
|
1213
|
+
const urlNode = captureMap['route.url'] ?? captureMap['route.template_url'];
|
|
1214
|
+
if (urlNode) {
|
|
1215
|
+
result.fetchCalls.push({
|
|
1216
|
+
filePath: file.path,
|
|
1217
|
+
fetchURL: urlNode.text,
|
|
1218
|
+
lineNumber: captureMap['route.fetch'].startPosition.row + lineOffset,
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
continue;
|
|
1222
|
+
}
|
|
1223
|
+
// HTTP client calls: axios.get('/path'), $.post('/path'), requests.get('/path')
|
|
1224
|
+
// Skip methods also in EXPRESS_ROUTE_METHODS to avoid double-registering Express
|
|
1225
|
+
// routes as both route definitions AND consumers (both queries match same AST node)
|
|
1226
|
+
if (captureMap['http_client'] && captureMap['http_client.url']) {
|
|
1227
|
+
const method = captureMap['http_client.method']?.text;
|
|
1228
|
+
const url = captureMap['http_client.url'].text;
|
|
1229
|
+
if (method && HTTP_CLIENT_ONLY_METHODS.has(method) && url.startsWith('/')) {
|
|
1230
|
+
result.fetchCalls.push({
|
|
1231
|
+
filePath: file.path,
|
|
1232
|
+
fetchURL: url,
|
|
1233
|
+
lineNumber: captureMap['http_client'].startPosition.row + lineOffset,
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
continue;
|
|
1237
|
+
}
|
|
1238
|
+
// Express/Hono route registration: app.get('/path', handler)
|
|
1239
|
+
if (captureMap['express_route'] &&
|
|
1240
|
+
captureMap['express_route.method'] &&
|
|
1241
|
+
captureMap['express_route.path']) {
|
|
1242
|
+
const method = captureMap['express_route.method'].text;
|
|
1243
|
+
const routePath = captureMap['express_route.path'].text;
|
|
1244
|
+
if (EXPRESS_ROUTE_METHODS.has(method) && routePath.startsWith('/')) {
|
|
1245
|
+
// Extract the receiver (the object the method is called on) to filter out
|
|
1246
|
+
// HTTP client calls like axios.get('/api/users') that match the same pattern
|
|
1247
|
+
// as Express route registrations.
|
|
1248
|
+
const callNode = captureMap['express_route'];
|
|
1249
|
+
const funcNode = callNode.childForFieldName?.('function') ?? callNode.children?.[0];
|
|
1250
|
+
// Walk through nested member_expressions and call_expressions to
|
|
1251
|
+
// reach the innermost receiver identifier. Handles chains like:
|
|
1252
|
+
// this.httpService.get('/path') -> member chain -> 'httpservice'
|
|
1253
|
+
// getClient().get('/path') -> call_expression -> 'getclient'
|
|
1254
|
+
// axios.get('/path') -> bare identifier -> 'axios'
|
|
1255
|
+
let receiverNode = funcNode?.childForFieldName?.('object') ?? funcNode?.children?.[0];
|
|
1256
|
+
while (receiverNode?.type === 'member_expression' ||
|
|
1257
|
+
receiverNode?.type === 'call_expression') {
|
|
1258
|
+
if (receiverNode.type === 'member_expression') {
|
|
1259
|
+
// Drill into the property (rightmost part) of the member expression
|
|
1260
|
+
const propNode = receiverNode.childForFieldName?.('property');
|
|
1261
|
+
if (propNode) {
|
|
1262
|
+
receiverNode = propNode;
|
|
1263
|
+
}
|
|
1264
|
+
else {
|
|
1265
|
+
break;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
else {
|
|
1269
|
+
// call_expression: unwrap to the function being called
|
|
1270
|
+
const innerFunc = receiverNode.childForFieldName?.('function') ?? receiverNode.children?.[0];
|
|
1271
|
+
if (innerFunc && innerFunc !== receiverNode) {
|
|
1272
|
+
receiverNode = innerFunc;
|
|
1273
|
+
}
|
|
1274
|
+
else {
|
|
1275
|
+
break;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
const receiverText = receiverNode?.text?.toLowerCase() ?? '';
|
|
1280
|
+
if (HTTP_CLIENT_RECEIVERS.has(receiverText)) {
|
|
1281
|
+
// This is an HTTP client call, not a route definition u2014 skip it
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1284
|
+
const httpMethod = method === 'all' || method === 'use' || method === 'route'
|
|
1285
|
+
? 'GET'
|
|
1286
|
+
: method.toUpperCase();
|
|
1287
|
+
result.decoratorRoutes.push({
|
|
1288
|
+
filePath: file.path,
|
|
1289
|
+
routePath,
|
|
1290
|
+
httpMethod,
|
|
1291
|
+
decoratorName: `express.${method}`,
|
|
1292
|
+
lineNumber: captureMap['express_route'].startPosition.row + lineOffset,
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
continue;
|
|
1296
|
+
}
|
|
1297
|
+
// Extract call sites
|
|
1298
|
+
if (captureMap['call']) {
|
|
1299
|
+
const callNode = captureMap['call'];
|
|
1300
|
+
const callNameNode = captureMap['call.name'];
|
|
1301
|
+
const callExtractor = provider.callExtractor;
|
|
1302
|
+
if (callExtractor) {
|
|
1303
|
+
// ── Path 1: Language-specific call site (bypasses routing) ────
|
|
1304
|
+
// Try language-specific extraction (e.g. Java `::` method references)
|
|
1305
|
+
// without callNameNode. If successful, skip routing and the generic
|
|
1306
|
+
// path entirely.
|
|
1307
|
+
const langCallSite = callExtractor.extract(callNode, undefined);
|
|
1308
|
+
if (langCallSite) {
|
|
1309
|
+
if (!provider.isBuiltInName(langCallSite.calledName)) {
|
|
1310
|
+
const sourceId = findEnclosingFunctionId(callNode, file.path, provider) ||
|
|
1311
|
+
generateId('File', file.path);
|
|
1312
|
+
const receiverName = langCallSite.callForm === 'member' ? langCallSite.receiverName : undefined;
|
|
1313
|
+
let receiverTypeName = receiverName
|
|
1314
|
+
? typeEnv.lookup(receiverName, callNode)
|
|
1315
|
+
: undefined;
|
|
1316
|
+
// Type-as-receiver heuristic (e.g. Java `User::getName`)
|
|
1317
|
+
if (langCallSite.typeAsReceiverHeuristic &&
|
|
1318
|
+
receiverName !== undefined &&
|
|
1319
|
+
receiverTypeName === undefined &&
|
|
1320
|
+
langCallSite.callForm === 'member') {
|
|
1321
|
+
const c0 = receiverName.charCodeAt(0);
|
|
1322
|
+
if (c0 >= 65 && c0 <= 90)
|
|
1323
|
+
receiverTypeName = receiverName;
|
|
1324
|
+
}
|
|
1325
|
+
result.calls.push({
|
|
1326
|
+
filePath: file.path,
|
|
1327
|
+
calledName: langCallSite.calledName,
|
|
1328
|
+
sourceId,
|
|
1329
|
+
callForm: langCallSite.callForm,
|
|
1330
|
+
...(receiverName !== undefined ? { receiverName } : {}),
|
|
1331
|
+
...(receiverTypeName !== undefined ? { receiverTypeName } : {}),
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
continue;
|
|
1335
|
+
}
|
|
1336
|
+
// ── Path 2: Generic extraction via @call.name ────────────────
|
|
1337
|
+
if (callNameNode) {
|
|
1338
|
+
const calledName = callNameNode.text;
|
|
1339
|
+
// Check heritage extractor for call-based heritage (e.g., Ruby include/extend/prepend)
|
|
1340
|
+
if (provider.heritageExtractor?.extractFromCall) {
|
|
1341
|
+
const heritageItems = provider.heritageExtractor.extractFromCall(calledName, callNode, { filePath: file.path, language });
|
|
1342
|
+
if (heritageItems !== null) {
|
|
1343
|
+
for (const item of heritageItems) {
|
|
1344
|
+
result.heritage.push({
|
|
1345
|
+
filePath: file.path,
|
|
1346
|
+
className: item.className,
|
|
1347
|
+
parentName: item.parentName,
|
|
1348
|
+
kind: item.kind,
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
continue;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
// Dispatch: route language-specific calls (properties, imports)
|
|
1355
|
+
// Heritage routing is handled by heritageExtractor.extractFromCall above.
|
|
1356
|
+
const routed = callRouter?.(calledName, captureMap['call']);
|
|
1357
|
+
if (routed) {
|
|
1358
|
+
if (routed.kind === 'skip')
|
|
1359
|
+
continue;
|
|
1360
|
+
if (routed.kind === 'import') {
|
|
1361
|
+
result.imports.push({
|
|
1362
|
+
filePath: file.path,
|
|
1363
|
+
rawImportPath: routed.importPath,
|
|
1364
|
+
language,
|
|
1365
|
+
});
|
|
1366
|
+
continue;
|
|
1367
|
+
}
|
|
1368
|
+
if (routed.kind === 'properties') {
|
|
1369
|
+
const propEnclosingInfo = cachedFindEnclosingClassInfo(captureMap['call'], file.path, provider.resolveEnclosingOwner);
|
|
1370
|
+
const propEnclosingClassId = propEnclosingInfo?.classId ?? null;
|
|
1371
|
+
// Enrich routed properties with FieldExtractor metadata
|
|
1372
|
+
let routedFieldMap;
|
|
1373
|
+
if (provider.fieldExtractor && typeEnv) {
|
|
1374
|
+
const classNode = findEnclosingClassNode(captureMap['call']);
|
|
1375
|
+
if (classNode) {
|
|
1376
|
+
routedFieldMap = getFieldInfo(classNode, provider, {
|
|
1377
|
+
typeEnv,
|
|
1378
|
+
symbolTable: NOOP_SYMBOL_TABLE,
|
|
1379
|
+
filePath: file.path,
|
|
1380
|
+
language,
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
for (const item of routed.items) {
|
|
1385
|
+
const routedFieldInfo = routedFieldMap?.get(item.propName);
|
|
1386
|
+
const propQualifiedName = propEnclosingInfo
|
|
1387
|
+
? `${propEnclosingInfo.className}.${item.propName}`
|
|
1388
|
+
: item.propName;
|
|
1389
|
+
const nodeId = generateId('Property', `${file.path}:${propQualifiedName}`);
|
|
1390
|
+
result.nodes.push({
|
|
1391
|
+
id: nodeId,
|
|
1392
|
+
label: 'Property',
|
|
1393
|
+
properties: {
|
|
1394
|
+
name: item.propName,
|
|
1395
|
+
filePath: file.path,
|
|
1396
|
+
startLine: item.startLine,
|
|
1397
|
+
endLine: item.endLine,
|
|
1398
|
+
language,
|
|
1399
|
+
isExported: true,
|
|
1400
|
+
description: item.accessorType,
|
|
1401
|
+
...(item.declaredType
|
|
1402
|
+
? { declaredType: item.declaredType }
|
|
1403
|
+
: routedFieldInfo?.type
|
|
1404
|
+
? { declaredType: routedFieldInfo.type }
|
|
1405
|
+
: {}),
|
|
1406
|
+
...(routedFieldInfo?.visibility !== undefined
|
|
1407
|
+
? { visibility: routedFieldInfo.visibility }
|
|
1408
|
+
: {}),
|
|
1409
|
+
...(routedFieldInfo?.isStatic !== undefined
|
|
1410
|
+
? { isStatic: routedFieldInfo.isStatic }
|
|
1411
|
+
: {}),
|
|
1412
|
+
...(routedFieldInfo?.isReadonly !== undefined
|
|
1413
|
+
? { isReadonly: routedFieldInfo.isReadonly }
|
|
1414
|
+
: {}),
|
|
1415
|
+
},
|
|
1416
|
+
});
|
|
1417
|
+
result.symbols.push({
|
|
1418
|
+
filePath: file.path,
|
|
1419
|
+
name: item.propName,
|
|
1420
|
+
nodeId,
|
|
1421
|
+
type: 'Property',
|
|
1422
|
+
...(propEnclosingClassId ? { ownerId: propEnclosingClassId } : {}),
|
|
1423
|
+
...(item.declaredType
|
|
1424
|
+
? { declaredType: item.declaredType }
|
|
1425
|
+
: routedFieldInfo?.type
|
|
1426
|
+
? { declaredType: routedFieldInfo.type }
|
|
1427
|
+
: {}),
|
|
1428
|
+
...(routedFieldInfo?.visibility !== undefined
|
|
1429
|
+
? { visibility: routedFieldInfo.visibility }
|
|
1430
|
+
: {}),
|
|
1431
|
+
...(routedFieldInfo?.isStatic !== undefined
|
|
1432
|
+
? { isStatic: routedFieldInfo.isStatic }
|
|
1433
|
+
: {}),
|
|
1434
|
+
...(routedFieldInfo?.isReadonly !== undefined
|
|
1435
|
+
? { isReadonly: routedFieldInfo.isReadonly }
|
|
1436
|
+
: {}),
|
|
1437
|
+
});
|
|
1438
|
+
const fileId = generateId('File', file.path);
|
|
1439
|
+
const relId = generateId('DEFINES', `${fileId}->${nodeId}`);
|
|
1440
|
+
result.relationships.push({
|
|
1441
|
+
id: relId,
|
|
1442
|
+
sourceId: fileId,
|
|
1443
|
+
targetId: nodeId,
|
|
1444
|
+
type: 'DEFINES',
|
|
1445
|
+
confidence: 1.0,
|
|
1446
|
+
reason: '',
|
|
1447
|
+
});
|
|
1448
|
+
if (propEnclosingClassId) {
|
|
1449
|
+
result.relationships.push({
|
|
1450
|
+
id: generateId('HAS_PROPERTY', `${propEnclosingClassId}->${nodeId}`),
|
|
1451
|
+
sourceId: propEnclosingClassId,
|
|
1452
|
+
targetId: nodeId,
|
|
1453
|
+
type: 'HAS_PROPERTY',
|
|
1454
|
+
confidence: 1.0,
|
|
1455
|
+
reason: '',
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
// kind === 'call' — fall through to normal call processing below
|
|
1462
|
+
}
|
|
1463
|
+
if (!provider.isBuiltInName(calledName)) {
|
|
1464
|
+
const callSite = callExtractor.extract(callNode, callNameNode);
|
|
1465
|
+
if (callSite) {
|
|
1466
|
+
const sourceId = findEnclosingFunctionId(callNode, file.path, provider) ||
|
|
1467
|
+
generateId('File', file.path);
|
|
1468
|
+
let receiverTypeName = callSite.receiverName
|
|
1469
|
+
? typeEnv.lookup(callSite.receiverName, callNode)
|
|
1470
|
+
: undefined;
|
|
1471
|
+
// Type-as-receiver heuristic
|
|
1472
|
+
if (callSite.typeAsReceiverHeuristic &&
|
|
1473
|
+
callSite.receiverName !== undefined &&
|
|
1474
|
+
receiverTypeName === undefined &&
|
|
1475
|
+
callSite.callForm === 'member') {
|
|
1476
|
+
const c0 = callSite.receiverName.charCodeAt(0);
|
|
1477
|
+
if (c0 >= 65 && c0 <= 90)
|
|
1478
|
+
receiverTypeName = callSite.receiverName;
|
|
1479
|
+
}
|
|
1480
|
+
const inferLiteralType = provider.typeConfig?.inferLiteralType;
|
|
1481
|
+
// Skip when no arg list / zero args: nothing to infer for overload typing
|
|
1482
|
+
const argTypes = inferLiteralType && callSite.argCount !== undefined && callSite.argCount > 0
|
|
1483
|
+
? extractCallArgTypes(callNode, inferLiteralType, (varName, cn) => typeEnv.lookup(varName, cn))
|
|
1484
|
+
: undefined;
|
|
1485
|
+
result.calls.push({
|
|
1486
|
+
filePath: file.path,
|
|
1487
|
+
calledName: callSite.calledName,
|
|
1488
|
+
sourceId,
|
|
1489
|
+
...(callSite.argCount !== undefined ? { argCount: callSite.argCount } : {}),
|
|
1490
|
+
...(callSite.callForm !== undefined ? { callForm: callSite.callForm } : {}),
|
|
1491
|
+
...(callSite.receiverName !== undefined
|
|
1492
|
+
? { receiverName: callSite.receiverName }
|
|
1493
|
+
: {}),
|
|
1494
|
+
...(receiverTypeName !== undefined ? { receiverTypeName } : {}),
|
|
1495
|
+
...(callSite.receiverMixedChain !== undefined
|
|
1496
|
+
? { receiverMixedChain: callSite.receiverMixedChain }
|
|
1497
|
+
: {}),
|
|
1498
|
+
...(argTypes !== undefined ? { argTypes } : {}),
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
continue;
|
|
1505
|
+
}
|
|
1506
|
+
// Extract heritage (extends/implements) via provider heritage extractor
|
|
1507
|
+
if (captureMap['heritage.class']) {
|
|
1508
|
+
if (provider.heritageExtractor) {
|
|
1509
|
+
const heritageItems = provider.heritageExtractor.extract(captureMap, {
|
|
1510
|
+
filePath: file.path,
|
|
1511
|
+
language,
|
|
1512
|
+
});
|
|
1513
|
+
for (const item of heritageItems) {
|
|
1514
|
+
result.heritage.push({
|
|
1515
|
+
filePath: file.path,
|
|
1516
|
+
className: item.className,
|
|
1517
|
+
parentName: item.parentName,
|
|
1518
|
+
kind: item.kind,
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
// When the extractor consumes the match, skip symbol processing below.
|
|
1522
|
+
if (heritageItems.length > 0) {
|
|
1523
|
+
continue;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
// Fallback: the extractor returned [] (or is absent), but the match still
|
|
1527
|
+
// carries a heritage-specific capture. The match belongs to a heritage
|
|
1528
|
+
// clause and must not fall through to generic symbol processing.
|
|
1529
|
+
if (captureMap['heritage.extends'] ||
|
|
1530
|
+
captureMap['heritage.implements'] ||
|
|
1531
|
+
captureMap['heritage.trait']) {
|
|
1532
|
+
continue;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
const definitionNode = getDefinitionNodeFromCaptures(captureMap);
|
|
1536
|
+
const defaultNodeLabel = getLabelFromCaptures(captureMap, provider);
|
|
1537
|
+
if (!defaultNodeLabel)
|
|
1538
|
+
continue;
|
|
1539
|
+
const nameNode = captureMap['name'];
|
|
1540
|
+
const extractedClassSymbol = definitionNode && provider.classExtractor?.isTypeDeclaration(definitionNode)
|
|
1541
|
+
? provider.classExtractor.extract(definitionNode, {
|
|
1542
|
+
name: nameNode?.text,
|
|
1543
|
+
type: defaultNodeLabel,
|
|
1544
|
+
})
|
|
1545
|
+
: null;
|
|
1546
|
+
const nodeLabel = extractedClassSymbol?.type ?? defaultNodeLabel;
|
|
1547
|
+
// Dedup: variable captures (Const/Static/Variable) may overlap with higher-priority
|
|
1548
|
+
// captures (e.g. `const fn = () => {}` matches both @definition.function and @definition.const).
|
|
1549
|
+
// Skip variable captures whose definition node was already processed.
|
|
1550
|
+
if ((nodeLabel === 'Const' || nodeLabel === 'Static' || nodeLabel === 'Variable') &&
|
|
1551
|
+
definitionNode &&
|
|
1552
|
+
processedDefinitionNodes.has(definitionNode.startIndex)) {
|
|
1553
|
+
continue;
|
|
1554
|
+
}
|
|
1555
|
+
if (definitionNode) {
|
|
1556
|
+
processedDefinitionNodes.add(definitionNode.startIndex);
|
|
1557
|
+
}
|
|
1558
|
+
// Synthesize name for constructors without explicit @name capture (e.g. Swift init)
|
|
1559
|
+
if (!nameNode && nodeLabel !== 'Constructor' && !extractedClassSymbol)
|
|
1560
|
+
continue;
|
|
1561
|
+
const nodeName = extractedClassSymbol?.name ?? (nameNode ? nameNode.text : 'init');
|
|
1562
|
+
const startLine = definitionNode
|
|
1563
|
+
? definitionNode.startPosition.row + lineOffset
|
|
1564
|
+
: nameNode
|
|
1565
|
+
? nameNode.startPosition.row + lineOffset
|
|
1566
|
+
: lineOffset;
|
|
1567
|
+
// Compute enclosing class BEFORE node ID — needed to qualify method IDs
|
|
1568
|
+
const needsOwner = nodeLabel === 'Method' ||
|
|
1569
|
+
nodeLabel === 'Constructor' ||
|
|
1570
|
+
nodeLabel === 'Property' ||
|
|
1571
|
+
nodeLabel === 'Function';
|
|
1572
|
+
const enclosingClassInfo = needsOwner
|
|
1573
|
+
? cachedFindEnclosingClassInfo(nameNode || definitionNode, file.path, provider.resolveEnclosingOwner)
|
|
1574
|
+
: null;
|
|
1575
|
+
const enclosingClassId = enclosingClassInfo?.classId ?? null;
|
|
1576
|
+
// Qualify method/property IDs with enclosing class name to avoid collisions
|
|
1577
|
+
const qualifiedName = enclosingClassInfo
|
|
1578
|
+
? `${enclosingClassInfo.className}.${nodeName}`
|
|
1579
|
+
: nodeName;
|
|
1580
|
+
// Extract method metadata BEFORE generating node ID — parameterCount is needed
|
|
1581
|
+
// to disambiguate overloaded methods via #<arity> suffix in the ID.
|
|
1582
|
+
let declaredType;
|
|
1583
|
+
let methodProps = {};
|
|
1584
|
+
let arityForId; // raw param count for ID, even for variadic
|
|
1585
|
+
let defMethodMap;
|
|
1586
|
+
let defMethodInfo;
|
|
1587
|
+
if (nodeLabel === 'Function' || nodeLabel === 'Method' || nodeLabel === 'Constructor') {
|
|
1588
|
+
// Use MethodExtractor for method metadata — provides parameterCount, parameterTypes,
|
|
1589
|
+
// returnType, isAbstract/isFinal/annotations, visibility, and more.
|
|
1590
|
+
let enrichedByMethodExtractor = false;
|
|
1591
|
+
if (provider.methodExtractor && definitionNode) {
|
|
1592
|
+
const classNode = findEnclosingClassNode(definitionNode) ?? findClassNodeByQualifiedName(definitionNode);
|
|
1593
|
+
if (classNode) {
|
|
1594
|
+
const methodMap = getMethodInfo(classNode, provider, {
|
|
1595
|
+
filePath: file.path,
|
|
1596
|
+
language,
|
|
1597
|
+
});
|
|
1598
|
+
const defLine = definitionNode.startPosition.row + 1;
|
|
1599
|
+
const info = methodMap?.get(`${nodeName}:${defLine}`);
|
|
1600
|
+
if (info) {
|
|
1601
|
+
enrichedByMethodExtractor = true;
|
|
1602
|
+
arityForId = arityForIdFromInfo(info);
|
|
1603
|
+
methodProps = buildMethodProps(info);
|
|
1604
|
+
defMethodMap = methodMap;
|
|
1605
|
+
defMethodInfo = info;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
// For top-level methods (e.g. Go method_declaration), try extractFromNode
|
|
1610
|
+
if (!enrichedByMethodExtractor &&
|
|
1611
|
+
provider.methodExtractor?.extractFromNode &&
|
|
1612
|
+
definitionNode) {
|
|
1613
|
+
const info = provider.methodExtractor.extractFromNode(definitionNode, {
|
|
1614
|
+
filePath: file.path,
|
|
1615
|
+
language,
|
|
1616
|
+
});
|
|
1617
|
+
if (info) {
|
|
1618
|
+
enrichedByMethodExtractor = true;
|
|
1619
|
+
arityForId = arityForIdFromInfo(info);
|
|
1620
|
+
methodProps = buildMethodProps(info);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
// Append #<paramCount> to owned callable IDs to disambiguate overloads.
|
|
1625
|
+
// Top-level Function IDs stay stable; functions inside an owner may overload.
|
|
1626
|
+
// When same-arity collisions exist, append ~type1,type2 for further disambiguation.
|
|
1627
|
+
const needsAritySuffix = nodeLabel === 'Method' ||
|
|
1628
|
+
nodeLabel === 'Constructor' ||
|
|
1629
|
+
(nodeLabel === 'Function' && enclosingClassId !== null);
|
|
1630
|
+
let arityTag = needsAritySuffix && arityForId !== undefined ? `#${arityForId}` : '';
|
|
1631
|
+
if (arityTag && defMethodMap && defMethodInfo) {
|
|
1632
|
+
const groups = buildCollisionGroups(defMethodMap);
|
|
1633
|
+
arityTag += typeTagForId(defMethodMap, nodeName, arityForId, defMethodInfo, language, groups);
|
|
1634
|
+
arityTag += constTagForId(defMethodMap, nodeName, arityForId, defMethodInfo, groups);
|
|
1635
|
+
}
|
|
1636
|
+
const nodeId = generateId(nodeLabel, `${file.path}:${qualifiedName}${arityTag}`);
|
|
1637
|
+
const classNodeForSymbol = definitionNode || nameNode;
|
|
1638
|
+
const qualifiedTypeName = extractedClassSymbol?.qualifiedName ??
|
|
1639
|
+
(classNodeForSymbol && provider.classExtractor?.isTypeDeclaration(classNodeForSymbol)
|
|
1640
|
+
? (provider.classExtractor.extractQualifiedName(classNodeForSymbol, nodeName) ?? nodeName)
|
|
1641
|
+
: undefined);
|
|
1642
|
+
const description = provider.descriptionExtractor?.(nodeLabel, nodeName, captureMap);
|
|
1643
|
+
let frameworkHint = definitionNode
|
|
1644
|
+
? detectFrameworkFromAST(language, (definitionNode.text || '').slice(0, 300))
|
|
1645
|
+
: null;
|
|
1646
|
+
// Suppress Spring framework hint for methods inside interfaces
|
|
1647
|
+
// (Feign clients, JAX-RS proxies are consumers, not providers)
|
|
1648
|
+
if (frameworkHint && definitionNode) {
|
|
1649
|
+
let classCheck = definitionNode.parent;
|
|
1650
|
+
while (classCheck) {
|
|
1651
|
+
if (classCheck.type === 'interface_declaration') {
|
|
1652
|
+
frameworkHint = null;
|
|
1653
|
+
break;
|
|
1654
|
+
}
|
|
1655
|
+
if (classCheck.type === 'class_declaration' || classCheck.type === 'program') {
|
|
1656
|
+
break;
|
|
1657
|
+
}
|
|
1658
|
+
classCheck = classCheck.parent;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
// Decorators appear on lines immediately before their definition; allow up to
|
|
1662
|
+
// MAX_DECORATOR_SCAN_LINES gap for blank lines / multi-line decorator stacks.
|
|
1663
|
+
const MAX_DECORATOR_SCAN_LINES = 5;
|
|
1664
|
+
if (definitionNode) {
|
|
1665
|
+
const defStartLine = definitionNode.startPosition.row;
|
|
1666
|
+
for (let checkLine = defStartLine - 1; checkLine >= Math.max(0, defStartLine - MAX_DECORATOR_SCAN_LINES); checkLine--) {
|
|
1667
|
+
const dec = fileDecorators.get(checkLine);
|
|
1668
|
+
if (dec) {
|
|
1669
|
+
// Use first (closest) decorator found for framework hint
|
|
1670
|
+
if (!frameworkHint) {
|
|
1671
|
+
frameworkHint = {
|
|
1672
|
+
framework: 'decorator',
|
|
1673
|
+
entryPointMultiplier: 1.2,
|
|
1674
|
+
reason: `@${dec.name}${dec.arg ? `("${dec.arg}")` : ''}`,
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
// Emit tool definition if this is a @tool decorator
|
|
1678
|
+
if (dec.isTool) {
|
|
1679
|
+
result.toolDefs.push({
|
|
1680
|
+
filePath: file.path,
|
|
1681
|
+
toolName: nodeName,
|
|
1682
|
+
description: (dec.arg || description || '').slice(0, 200),
|
|
1683
|
+
lineNumber: definitionNode.startPosition.row + lineOffset,
|
|
1684
|
+
handlerNodeId: nodeId,
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
fileDecorators.delete(checkLine);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
// Property metadata extraction (not needed before nodeId — Properties don't overload)
|
|
1692
|
+
if (nodeLabel === 'Property' && definitionNode) {
|
|
1693
|
+
// FieldExtractor is the single source of truth when available
|
|
1694
|
+
if (provider.fieldExtractor && typeEnv) {
|
|
1695
|
+
const classNode = findEnclosingClassNode(definitionNode);
|
|
1696
|
+
if (classNode) {
|
|
1697
|
+
const fieldMap = getFieldInfo(classNode, provider, {
|
|
1698
|
+
typeEnv,
|
|
1699
|
+
symbolTable: NOOP_SYMBOL_TABLE,
|
|
1700
|
+
filePath: file.path,
|
|
1701
|
+
language,
|
|
1702
|
+
});
|
|
1703
|
+
const info = fieldMap?.get(nodeName);
|
|
1704
|
+
if (info) {
|
|
1705
|
+
declaredType = info.type ?? undefined;
|
|
1706
|
+
methodProps.visibility = info.visibility;
|
|
1707
|
+
methodProps.isStatic = info.isStatic;
|
|
1708
|
+
methodProps.isReadonly = info.isReadonly;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
// Variable/Const/Static metadata extraction via VariableExtractor
|
|
1714
|
+
if ((nodeLabel === 'Const' || nodeLabel === 'Static' || nodeLabel === 'Variable') &&
|
|
1715
|
+
definitionNode &&
|
|
1716
|
+
provider.variableExtractor) {
|
|
1717
|
+
const varCtx = {
|
|
1718
|
+
filePath: file.path,
|
|
1719
|
+
language,
|
|
1720
|
+
};
|
|
1721
|
+
const varInfo = provider.variableExtractor.extract(definitionNode, varCtx);
|
|
1722
|
+
if (varInfo) {
|
|
1723
|
+
if (varInfo.type)
|
|
1724
|
+
declaredType = varInfo.type;
|
|
1725
|
+
methodProps.visibility = varInfo.visibility;
|
|
1726
|
+
methodProps.isStatic = varInfo.isStatic;
|
|
1727
|
+
methodProps.isConst = varInfo.isConst;
|
|
1728
|
+
methodProps.isMutable = varInfo.isMutable;
|
|
1729
|
+
methodProps.scope = varInfo.scope;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
result.nodes.push({
|
|
1733
|
+
id: nodeId,
|
|
1734
|
+
label: nodeLabel,
|
|
1735
|
+
properties: {
|
|
1736
|
+
name: nodeName,
|
|
1737
|
+
filePath: file.path,
|
|
1738
|
+
startLine: definitionNode ? definitionNode.startPosition.row + lineOffset : startLine,
|
|
1739
|
+
endLine: definitionNode ? definitionNode.endPosition.row + lineOffset : startLine,
|
|
1740
|
+
language: language,
|
|
1741
|
+
isExported: language === SupportedLanguages.Vue && isVueSetup
|
|
1742
|
+
? isVueSetupTopLevel(nameNode || definitionNode)
|
|
1743
|
+
: cachedExportCheck(provider.exportChecker, nameNode || definitionNode, nodeName),
|
|
1744
|
+
...(qualifiedTypeName !== undefined ? { qualifiedName: qualifiedTypeName } : {}),
|
|
1745
|
+
...(frameworkHint
|
|
1746
|
+
? {
|
|
1747
|
+
astFrameworkMultiplier: frameworkHint.entryPointMultiplier,
|
|
1748
|
+
astFrameworkReason: frameworkHint.reason,
|
|
1749
|
+
}
|
|
1750
|
+
: {}),
|
|
1751
|
+
...(description !== undefined ? { description } : {}),
|
|
1752
|
+
...methodProps,
|
|
1753
|
+
...(declaredType !== undefined ? { declaredType } : {}),
|
|
1754
|
+
},
|
|
1755
|
+
});
|
|
1756
|
+
// enclosingClassId already computed above (before nodeId generation)
|
|
1757
|
+
result.symbols.push({
|
|
1758
|
+
filePath: file.path,
|
|
1759
|
+
name: nodeName,
|
|
1760
|
+
nodeId,
|
|
1761
|
+
type: nodeLabel,
|
|
1762
|
+
...(qualifiedTypeName !== undefined ? { qualifiedName: qualifiedTypeName } : {}),
|
|
1763
|
+
parameterCount: methodProps.parameterCount,
|
|
1764
|
+
requiredParameterCount: methodProps.requiredParameterCount,
|
|
1765
|
+
parameterTypes: methodProps.parameterTypes,
|
|
1766
|
+
returnType: methodProps.returnType,
|
|
1767
|
+
...(declaredType !== undefined ? { declaredType } : {}),
|
|
1768
|
+
...(enclosingClassId ? { ownerId: enclosingClassId } : {}),
|
|
1769
|
+
visibility: methodProps.visibility,
|
|
1770
|
+
isStatic: methodProps.isStatic,
|
|
1771
|
+
isReadonly: methodProps.isReadonly,
|
|
1772
|
+
isAbstract: methodProps.isAbstract,
|
|
1773
|
+
isFinal: methodProps.isFinal,
|
|
1774
|
+
...(methodProps.isVirtual !== undefined
|
|
1775
|
+
? { isVirtual: methodProps.isVirtual }
|
|
1776
|
+
: {}),
|
|
1777
|
+
...(methodProps.isOverride !== undefined
|
|
1778
|
+
? { isOverride: methodProps.isOverride }
|
|
1779
|
+
: {}),
|
|
1780
|
+
...(methodProps.isAsync !== undefined ? { isAsync: methodProps.isAsync } : {}),
|
|
1781
|
+
...(methodProps.isPartial !== undefined
|
|
1782
|
+
? { isPartial: methodProps.isPartial }
|
|
1783
|
+
: {}),
|
|
1784
|
+
...(methodProps.annotations !== undefined
|
|
1785
|
+
? { annotations: methodProps.annotations }
|
|
1786
|
+
: {}),
|
|
1787
|
+
});
|
|
1788
|
+
const fileId = generateId('File', file.path);
|
|
1789
|
+
const relId = generateId('DEFINES', `${fileId}->${nodeId}`);
|
|
1790
|
+
result.relationships.push({
|
|
1791
|
+
id: relId,
|
|
1792
|
+
sourceId: fileId,
|
|
1793
|
+
targetId: nodeId,
|
|
1794
|
+
type: 'DEFINES',
|
|
1795
|
+
confidence: 1.0,
|
|
1796
|
+
reason: '',
|
|
1797
|
+
});
|
|
1798
|
+
// ── HAS_METHOD / HAS_PROPERTY: link member to enclosing class ──
|
|
1799
|
+
if (enclosingClassId) {
|
|
1800
|
+
const memberEdgeType = nodeLabel === 'Property' ? 'HAS_PROPERTY' : 'HAS_METHOD';
|
|
1801
|
+
result.relationships.push({
|
|
1802
|
+
id: generateId(memberEdgeType, `${enclosingClassId}->${nodeId}`),
|
|
1803
|
+
sourceId: enclosingClassId,
|
|
1804
|
+
targetId: nodeId,
|
|
1805
|
+
type: memberEdgeType,
|
|
1806
|
+
confidence: 1.0,
|
|
1807
|
+
reason: '',
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
// Extract framework routes via provider detection (e.g., Laravel routes.php)
|
|
1812
|
+
if (provider.isRouteFile?.(file.path)) {
|
|
1813
|
+
const extractedRoutes = extractLaravelRoutes(tree, file.path);
|
|
1814
|
+
for (const r of extractedRoutes)
|
|
1815
|
+
result.routes.push(r);
|
|
1816
|
+
}
|
|
1817
|
+
// Extract ORM queries (Prisma, Supabase)
|
|
1818
|
+
extractORMQueries(file.path, parseContent, result.ormQueries);
|
|
1819
|
+
// Vue: emit CALLS edges for components used in <template>
|
|
1820
|
+
if (language === SupportedLanguages.Vue) {
|
|
1821
|
+
const templateComponents = extractTemplateComponents(file.content);
|
|
1822
|
+
for (const componentName of templateComponents) {
|
|
1823
|
+
result.calls.push({
|
|
1824
|
+
filePath: file.path,
|
|
1825
|
+
calledName: componentName,
|
|
1826
|
+
sourceId: generateId('File', file.path),
|
|
1827
|
+
callForm: 'free',
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
};
|
|
1833
|
+
// ============================================================================
|
|
1834
|
+
// Worker message handler — supports sub-batch streaming
|
|
1835
|
+
// ============================================================================
|
|
1836
|
+
/** Accumulated result across sub-batches */
|
|
1837
|
+
let accumulated = {
|
|
1838
|
+
nodes: [],
|
|
1839
|
+
relationships: [],
|
|
1840
|
+
symbols: [],
|
|
1841
|
+
imports: [],
|
|
1842
|
+
calls: [],
|
|
1843
|
+
assignments: [],
|
|
1844
|
+
heritage: [],
|
|
1845
|
+
routes: [],
|
|
1846
|
+
fetchCalls: [],
|
|
1847
|
+
decoratorRoutes: [],
|
|
1848
|
+
toolDefs: [],
|
|
1849
|
+
ormQueries: [],
|
|
1850
|
+
constructorBindings: [],
|
|
1851
|
+
fileScopeBindings: [],
|
|
1852
|
+
parsedFiles: [],
|
|
1853
|
+
skippedLanguages: {},
|
|
1854
|
+
fileCount: 0,
|
|
1855
|
+
};
|
|
1856
|
+
let cumulativeProcessed = 0;
|
|
1857
|
+
// Use a loop instead of push(...spread) to avoid hitting V8's argument limit
|
|
1858
|
+
// when merging large result sets (push(...arr) calls apply() under the hood
|
|
1859
|
+
// and blows the stack when arr has >~65k elements).
|
|
1860
|
+
const appendAll = (target, src) => {
|
|
1861
|
+
for (let i = 0; i < src.length; i++)
|
|
1862
|
+
target.push(src[i]);
|
|
1863
|
+
};
|
|
1864
|
+
const mergeResult = (target, src) => {
|
|
1865
|
+
appendAll(target.nodes, src.nodes);
|
|
1866
|
+
appendAll(target.relationships, src.relationships);
|
|
1867
|
+
appendAll(target.symbols, src.symbols);
|
|
1868
|
+
appendAll(target.imports, src.imports);
|
|
1869
|
+
appendAll(target.calls, src.calls);
|
|
1870
|
+
appendAll(target.assignments, src.assignments);
|
|
1871
|
+
appendAll(target.heritage, src.heritage);
|
|
1872
|
+
appendAll(target.routes, src.routes);
|
|
1873
|
+
appendAll(target.fetchCalls, src.fetchCalls);
|
|
1874
|
+
appendAll(target.decoratorRoutes, src.decoratorRoutes);
|
|
1875
|
+
appendAll(target.toolDefs, src.toolDefs);
|
|
1876
|
+
appendAll(target.ormQueries, src.ormQueries);
|
|
1877
|
+
appendAll(target.constructorBindings, src.constructorBindings);
|
|
1878
|
+
appendAll(target.fileScopeBindings, src.fileScopeBindings);
|
|
1879
|
+
appendAll(target.parsedFiles, src.parsedFiles);
|
|
1880
|
+
for (const [lang, count] of Object.entries(src.skippedLanguages)) {
|
|
1881
|
+
target.skippedLanguages[lang] = (target.skippedLanguages[lang] || 0) + count;
|
|
1882
|
+
}
|
|
1883
|
+
target.fileCount += src.fileCount;
|
|
1884
|
+
};
|
|
1885
|
+
parentPort.on('message', (msg) => {
|
|
1886
|
+
try {
|
|
1887
|
+
// Legacy single-message mode (backward compat): array of files
|
|
1888
|
+
if (Array.isArray(msg)) {
|
|
1889
|
+
const result = processBatch(msg, (filesProcessed) => {
|
|
1890
|
+
parentPort.postMessage({ type: 'progress', filesProcessed });
|
|
1891
|
+
});
|
|
1892
|
+
parentPort.postMessage({ type: 'result', data: result });
|
|
1893
|
+
return;
|
|
1894
|
+
}
|
|
1895
|
+
// Sub-batch mode: { type: 'sub-batch', files: [...] }
|
|
1896
|
+
if (msg.type === 'sub-batch') {
|
|
1897
|
+
const result = processBatch(msg.files, (filesProcessed) => {
|
|
1898
|
+
parentPort.postMessage({
|
|
1899
|
+
type: 'progress',
|
|
1900
|
+
filesProcessed: cumulativeProcessed + filesProcessed,
|
|
1901
|
+
});
|
|
1902
|
+
});
|
|
1903
|
+
cumulativeProcessed += result.fileCount;
|
|
1904
|
+
mergeResult(accumulated, result);
|
|
1905
|
+
// Signal ready for next sub-batch
|
|
1906
|
+
parentPort.postMessage({ type: 'sub-batch-done' });
|
|
1907
|
+
return;
|
|
1908
|
+
}
|
|
1909
|
+
// Flush: send accumulated results
|
|
1910
|
+
if (msg.type === 'flush') {
|
|
1911
|
+
parentPort.postMessage({ type: 'result', data: accumulated });
|
|
1912
|
+
// Reset for potential reuse
|
|
1913
|
+
accumulated = {
|
|
1914
|
+
nodes: [],
|
|
1915
|
+
relationships: [],
|
|
1916
|
+
symbols: [],
|
|
1917
|
+
imports: [],
|
|
1918
|
+
calls: [],
|
|
1919
|
+
assignments: [],
|
|
1920
|
+
heritage: [],
|
|
1921
|
+
routes: [],
|
|
1922
|
+
fetchCalls: [],
|
|
1923
|
+
decoratorRoutes: [],
|
|
1924
|
+
toolDefs: [],
|
|
1925
|
+
ormQueries: [],
|
|
1926
|
+
constructorBindings: [],
|
|
1927
|
+
fileScopeBindings: [],
|
|
1928
|
+
parsedFiles: [],
|
|
1929
|
+
skippedLanguages: {},
|
|
1930
|
+
fileCount: 0,
|
|
1931
|
+
};
|
|
1932
|
+
cumulativeProcessed = 0;
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
catch (err) {
|
|
1937
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1938
|
+
parentPort.postMessage({ type: 'error', error: message });
|
|
1939
|
+
}
|
|
1940
|
+
});
|