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,772 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ScopeExtractor` — the central, source-agnostic driver that turns a
|
|
3
|
+
* language provider's `CaptureMatch[]` into a `ParsedFile`
|
|
4
|
+
* (RFC §5.3 + §3.2 Phase 1; Ring 2 PKG #919).
|
|
5
|
+
*
|
|
6
|
+
* Exactly one entry point: `extract(matches, filePath, provider) → ParsedFile`.
|
|
7
|
+
* Runs a five-pass pipeline over the matches. Each pass is internal; the
|
|
8
|
+
* public contract is the output `ParsedFile`.
|
|
9
|
+
*
|
|
10
|
+
* ## Design principles
|
|
11
|
+
*
|
|
12
|
+
* - **Source-agnostic.** Consumes `CaptureMatch[]` from providers;
|
|
13
|
+
* doesn't know whether they came from tree-sitter queries or COBOL's
|
|
14
|
+
* regex tagger. No `Tree` / `SyntaxNode` types leak into this file.
|
|
15
|
+
* - **One AST walk per language.** Providers do the AST walk inside
|
|
16
|
+
* their `emitScopeCaptures` hook; this driver does zero further
|
|
17
|
+
* traversal — it consumes captures only.
|
|
18
|
+
* - **Pure-ish.** The extractor itself is pure (same matches →
|
|
19
|
+
* same ParsedFile) when providers are pure. No side effects, no I/O.
|
|
20
|
+
* - **Centralized invariant enforcement.** Structural invariants on the
|
|
21
|
+
* scope tree (non-module has parent; parent contains child; siblings
|
|
22
|
+
* don't overlap) are enforced by `buildScopeTree` from Ring 2 SHARED
|
|
23
|
+
* (#912). Malformed inputs throw `ScopeTreeInvariantError`.
|
|
24
|
+
*
|
|
25
|
+
* ## The five passes
|
|
26
|
+
*
|
|
27
|
+
* 1. **Build scope tree.** Walk `@scope.*` matches. For each, consult
|
|
28
|
+
* `provider.resolveScopeKind` (default: suffix of the capture name).
|
|
29
|
+
* Derive parent by lexical-range containment. Hand the resulting
|
|
30
|
+
* `Scope[]` to `buildScopeTree` for validation.
|
|
31
|
+
* 2. **Attach declarations + local bindings.** Walk `@declaration.*`
|
|
32
|
+
* matches. For each, build a `SymbolDefinition` and attach it to
|
|
33
|
+
* `provider.bindingScopeFor` (default: innermost containing scope)
|
|
34
|
+
* as `ownedDefs` + a local `BindingRef { origin: 'local' }`.
|
|
35
|
+
* 3. **Collect raw imports.** Walk `@import.*` matches. Call
|
|
36
|
+
* `provider.interpretImport` per match; attach the returned
|
|
37
|
+
* `ParsedImport` to the ParsedFile (not to any `Scope` — finalize
|
|
38
|
+
* reconstructs the owning scope via `provider.importOwningScope`
|
|
39
|
+
* during Phase 2).
|
|
40
|
+
* 4. **Collect type bindings.** Walk `@type-binding.*` matches. Call
|
|
41
|
+
* `provider.interpretTypeBinding` per match. Attach the resulting
|
|
42
|
+
* `TypeRef` to the innermost containing scope's `typeBindings`
|
|
43
|
+
* (or override via `provider.bindingScopeFor` if set).
|
|
44
|
+
* 5. **Collect reference sites.** Walk `@reference.*` matches. Emit
|
|
45
|
+
* one `ReferenceSite` per match. Classify call form via
|
|
46
|
+
* `provider.classifyCallForm` (default: the capture's sub-tag if
|
|
47
|
+
* present; else `'free'`).
|
|
48
|
+
*
|
|
49
|
+
* ## What gets attached where
|
|
50
|
+
*
|
|
51
|
+
* - `Scope.bindings` — **local bindings only** at this stage (Pass 2).
|
|
52
|
+
* Finalize (#915) merges imports/wildcards on top.
|
|
53
|
+
* - `Scope.ownedDefs` — declarations structurally owned by this scope.
|
|
54
|
+
* - `Scope.typeBindings` — local type facts (parameter annotations, `self`).
|
|
55
|
+
* - `Scope.imports` — empty here. Populated by the finalize algorithm
|
|
56
|
+
* when it resolves `ParsedImport.targetRaw`.
|
|
57
|
+
* - `ParsedFile.parsedImports` — every raw import in this file.
|
|
58
|
+
* - `ParsedFile.localDefs` — flattened union of `Scope.ownedDefs`.
|
|
59
|
+
* - `ParsedFile.referenceSites` — pre-resolution usage facts.
|
|
60
|
+
*/
|
|
61
|
+
import { buildPositionIndex, buildScopeTree, canParentScope, makeScopeId } from '../../_shared/index.js';
|
|
62
|
+
// ─── Public entry point ─────────────────────────────────────────────────────
|
|
63
|
+
/**
|
|
64
|
+
* Drive the five extraction passes and return a `ParsedFile`.
|
|
65
|
+
*
|
|
66
|
+
* Throws `ScopeTreeInvariantError` (from #912) when the provider emits
|
|
67
|
+
* captures that violate structural scope invariants. The error surfaces
|
|
68
|
+
* upward rather than being silently corrected — a malformed capture set
|
|
69
|
+
* is a bug in the provider's `emitScopeCaptures`, not a data condition
|
|
70
|
+
* to tolerate.
|
|
71
|
+
*/
|
|
72
|
+
export function extract(matches, filePath, provider) {
|
|
73
|
+
// Partition matches by topic up front — one linear pass over the input.
|
|
74
|
+
const partitioned = partitionByTopic(matches);
|
|
75
|
+
// ── Pass 1: build the scope tree ─────────────────────────────────────
|
|
76
|
+
const scopeDrafts = pass1BuildScopes(partitioned.scope, filePath, provider);
|
|
77
|
+
const moduleScope = ensureModuleScope(scopeDrafts, matches.length, filePath);
|
|
78
|
+
const scopes = scopeDrafts.map(draftToScope);
|
|
79
|
+
// buildScopeTree validates invariants (throws on violation) and exposes
|
|
80
|
+
// the lookup contract consumed by Passes 2-5.
|
|
81
|
+
//
|
|
82
|
+
// **Snapshot semantics.** Both `scopeTree` and `positionIndex` are built
|
|
83
|
+
// from the post-Pass-1 `scopes` — parent/range/kind are accurate, but
|
|
84
|
+
// `bindings`, `ownedDefs`, and `typeBindings` are all empty here. Later
|
|
85
|
+
// passes write into the *drafts*, not into these snapshots; any hook
|
|
86
|
+
// that reads `scope.bindings` etc. via the `scopeTree` argument sees a
|
|
87
|
+
// structural view only. This is by design — hooks use scopeTree for
|
|
88
|
+
// "what's the parent chain?" queries, not for content queries.
|
|
89
|
+
const scopeTree = buildScopeTree(scopes);
|
|
90
|
+
const positionIndex = buildPositionIndex(scopes);
|
|
91
|
+
// ── Pass 2: attach declarations + local bindings ────────────────────
|
|
92
|
+
const localDefs = [];
|
|
93
|
+
pass2AttachDeclarations(partitioned.declaration, scopeDrafts, positionIndex, localDefs, filePath, provider, scopeTree);
|
|
94
|
+
// ── Pass 3: collect raw imports ─────────────────────────────────────
|
|
95
|
+
const parsedImports = [];
|
|
96
|
+
pass3CollectImports(partitioned.import_, parsedImports, provider);
|
|
97
|
+
// ── Pass 4: collect type bindings ───────────────────────────────────
|
|
98
|
+
pass4CollectTypeBindings(partitioned.typeBinding, scopeDrafts, positionIndex, filePath, provider, scopeTree);
|
|
99
|
+
// ── Pass 5: collect reference sites ─────────────────────────────────
|
|
100
|
+
const referenceSites = [];
|
|
101
|
+
pass5CollectReferences(partitioned.reference, positionIndex, filePath, referenceSites, provider, scopeTree);
|
|
102
|
+
// Freeze Scope drafts into final shape and return.
|
|
103
|
+
const frozenScopes = scopeDrafts.map(draftToScope);
|
|
104
|
+
return Object.freeze({
|
|
105
|
+
filePath,
|
|
106
|
+
moduleScope: moduleScope.id,
|
|
107
|
+
scopes: Object.freeze(frozenScopes),
|
|
108
|
+
parsedImports: Object.freeze(parsedImports.slice()),
|
|
109
|
+
localDefs: Object.freeze(localDefs.slice()),
|
|
110
|
+
referenceSites: Object.freeze(referenceSites.slice()),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Bucket each match by the topic of its anchor capture. The anchor is the
|
|
115
|
+
* capture whose name is prefixed with the match's topic (`@scope.*`,
|
|
116
|
+
* `@declaration.*`, `@import.*`, `@type-binding.*`, `@reference.*`).
|
|
117
|
+
*
|
|
118
|
+
* A match may contain additional captures (e.g., `@import.source`,
|
|
119
|
+
* `@declaration.class.name`) that are used by the provider hooks to
|
|
120
|
+
* decode details. Those live inside the `CaptureMatch` and are surfaced
|
|
121
|
+
* to hooks verbatim — the extractor itself only routes by anchor.
|
|
122
|
+
*/
|
|
123
|
+
function partitionByTopic(matches) {
|
|
124
|
+
const scope = [];
|
|
125
|
+
const declaration = [];
|
|
126
|
+
const import_ = [];
|
|
127
|
+
const typeBinding = [];
|
|
128
|
+
const reference = [];
|
|
129
|
+
for (const match of matches) {
|
|
130
|
+
const topic = topicOf(match);
|
|
131
|
+
switch (topic) {
|
|
132
|
+
case 'scope':
|
|
133
|
+
scope.push(match);
|
|
134
|
+
break;
|
|
135
|
+
case 'declaration':
|
|
136
|
+
declaration.push(match);
|
|
137
|
+
break;
|
|
138
|
+
case 'import':
|
|
139
|
+
import_.push(match);
|
|
140
|
+
break;
|
|
141
|
+
case 'type-binding':
|
|
142
|
+
typeBinding.push(match);
|
|
143
|
+
break;
|
|
144
|
+
case 'reference':
|
|
145
|
+
reference.push(match);
|
|
146
|
+
break;
|
|
147
|
+
case 'unknown':
|
|
148
|
+
// Unrecognized anchor — silently skip. Providers may emit extra
|
|
149
|
+
// captures (e.g., `@comment`) that the extractor has no topic for.
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return { scope, declaration, import_, typeBinding, reference };
|
|
154
|
+
}
|
|
155
|
+
function topicOf(match) {
|
|
156
|
+
// The anchor is the capture whose name uses one of the known topic
|
|
157
|
+
// prefixes. For multi-capture matches, ALL captures share the topic;
|
|
158
|
+
// we pick the first matching key for efficiency.
|
|
159
|
+
for (const name of Object.keys(match)) {
|
|
160
|
+
if (name.startsWith('@scope.'))
|
|
161
|
+
return 'scope';
|
|
162
|
+
if (name.startsWith('@declaration.'))
|
|
163
|
+
return 'declaration';
|
|
164
|
+
if (name.startsWith('@import.'))
|
|
165
|
+
return 'import';
|
|
166
|
+
if (name.startsWith('@type-binding.'))
|
|
167
|
+
return 'type-binding';
|
|
168
|
+
if (name.startsWith('@reference.'))
|
|
169
|
+
return 'reference';
|
|
170
|
+
}
|
|
171
|
+
return 'unknown';
|
|
172
|
+
}
|
|
173
|
+
function ensureModuleScope(scopeDrafts, matchCount, filePath) {
|
|
174
|
+
const moduleScope = scopeDrafts.find((s) => s.kind === 'Module');
|
|
175
|
+
if (moduleScope !== undefined)
|
|
176
|
+
return moduleScope;
|
|
177
|
+
if (scopeDrafts.length === 0 && matchCount === 0) {
|
|
178
|
+
const range = { startLine: 0, startCol: 0, endLine: 0, endCol: 0 };
|
|
179
|
+
const synthetic = makeDraft(makeScopeId({ filePath, range, kind: 'Module' }), null, 'Module', range, filePath);
|
|
180
|
+
scopeDrafts.push(synthetic);
|
|
181
|
+
return synthetic;
|
|
182
|
+
}
|
|
183
|
+
throw new Error(`ScopeExtractor: no Module scope found for '${filePath}'. ` +
|
|
184
|
+
`Provider must emit at least one @scope.module capture per file.`);
|
|
185
|
+
}
|
|
186
|
+
function draftToScope(draft) {
|
|
187
|
+
const frozenBindings = new Map();
|
|
188
|
+
for (const [name, refs] of draft.bindings) {
|
|
189
|
+
frozenBindings.set(name, Object.freeze(refs.slice()));
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
id: draft.id,
|
|
193
|
+
parent: draft.parent,
|
|
194
|
+
kind: draft.kind,
|
|
195
|
+
range: draft.range,
|
|
196
|
+
filePath: draft.filePath,
|
|
197
|
+
bindings: frozenBindings,
|
|
198
|
+
ownedDefs: Object.freeze(draft.ownedDefs.slice()),
|
|
199
|
+
imports: Object.freeze(draft.imports.slice()),
|
|
200
|
+
typeBindings: new Map(draft.typeBindings),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// ─── Pass 1: build scope tree ──────────────────────────────────────────────
|
|
204
|
+
/**
|
|
205
|
+
* Convert `@scope.*` matches into `ScopeDraft[]`. Parent relationships
|
|
206
|
+
* are derived from range containment (outermost scope containing `range`
|
|
207
|
+
* becomes the parent).
|
|
208
|
+
*/
|
|
209
|
+
function pass1BuildScopes(matches, filePath, provider) {
|
|
210
|
+
const candidates = [];
|
|
211
|
+
for (const match of matches) {
|
|
212
|
+
const anchor = anchorCaptureFor(match, '@scope.');
|
|
213
|
+
if (anchor === undefined)
|
|
214
|
+
continue;
|
|
215
|
+
const kind = resolveKindForScopeMatch(match, anchor, provider);
|
|
216
|
+
if (kind === null)
|
|
217
|
+
continue;
|
|
218
|
+
const id = makeScopeId({ filePath, range: anchor.range, kind });
|
|
219
|
+
candidates.push({ match, range: anchor.range, kind, id });
|
|
220
|
+
}
|
|
221
|
+
// Sort by (startLine, startCol) ASC, (endLine, endCol) DESC so outer
|
|
222
|
+
// scopes appear before their children for parent-resolution. When two
|
|
223
|
+
// candidates have exactly equal ranges (e.g. a `compilation_unit` and
|
|
224
|
+
// the only top-level scope in the file — see `canParentScope`), Module
|
|
225
|
+
// sorts first so it lands on the stack ahead of the candidate that will
|
|
226
|
+
// claim it as parent.
|
|
227
|
+
candidates.sort((a, b) => {
|
|
228
|
+
if (a.range.startLine !== b.range.startLine)
|
|
229
|
+
return a.range.startLine - b.range.startLine;
|
|
230
|
+
if (a.range.startCol !== b.range.startCol)
|
|
231
|
+
return a.range.startCol - b.range.startCol;
|
|
232
|
+
if (a.range.endLine !== b.range.endLine)
|
|
233
|
+
return b.range.endLine - a.range.endLine;
|
|
234
|
+
if (a.range.endCol !== b.range.endCol)
|
|
235
|
+
return b.range.endCol - a.range.endCol;
|
|
236
|
+
if (a.kind === b.kind)
|
|
237
|
+
return 0;
|
|
238
|
+
if (a.kind === 'Module')
|
|
239
|
+
return -1;
|
|
240
|
+
if (b.kind === 'Module')
|
|
241
|
+
return 1;
|
|
242
|
+
return 0;
|
|
243
|
+
});
|
|
244
|
+
const drafts = [];
|
|
245
|
+
const stack = []; // enclosing real scopes, outermost at [0]
|
|
246
|
+
for (const cand of candidates) {
|
|
247
|
+
// Pop the stack until the top can parent this candidate (strict
|
|
248
|
+
// containment, plus the equal-range Module carve-out).
|
|
249
|
+
while (stack.length > 0 &&
|
|
250
|
+
!canParentScope(stack[stack.length - 1].range, cand.range, stack[stack.length - 1].kind, cand.kind)) {
|
|
251
|
+
stack.pop();
|
|
252
|
+
}
|
|
253
|
+
const parent = stack.length > 0 ? stack[stack.length - 1].id : null;
|
|
254
|
+
drafts.push(makeDraft(cand.id, parent, cand.kind, cand.range, filePath));
|
|
255
|
+
stack.push(cand);
|
|
256
|
+
}
|
|
257
|
+
return drafts;
|
|
258
|
+
}
|
|
259
|
+
function resolveKindForScopeMatch(match, anchor, provider) {
|
|
260
|
+
// Provider override takes precedence.
|
|
261
|
+
const override = provider.resolveScopeKind?.(match);
|
|
262
|
+
if (override !== undefined && override !== null)
|
|
263
|
+
return override;
|
|
264
|
+
// Default: derive from capture name suffix (`@scope.function` → 'Function').
|
|
265
|
+
const suffix = anchor.name.slice('@scope.'.length);
|
|
266
|
+
switch (suffix.toLowerCase()) {
|
|
267
|
+
case 'module':
|
|
268
|
+
return 'Module';
|
|
269
|
+
case 'namespace':
|
|
270
|
+
return 'Namespace';
|
|
271
|
+
case 'class':
|
|
272
|
+
return 'Class';
|
|
273
|
+
case 'function':
|
|
274
|
+
return 'Function';
|
|
275
|
+
case 'block':
|
|
276
|
+
return 'Block';
|
|
277
|
+
case 'expression':
|
|
278
|
+
return 'Expression';
|
|
279
|
+
default:
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function makeDraft(id, parent, kind, range, filePath) {
|
|
284
|
+
return {
|
|
285
|
+
id,
|
|
286
|
+
parent,
|
|
287
|
+
kind,
|
|
288
|
+
range,
|
|
289
|
+
filePath,
|
|
290
|
+
bindings: new Map(),
|
|
291
|
+
ownedDefs: [],
|
|
292
|
+
imports: [],
|
|
293
|
+
typeBindings: new Map(),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
// ─── Pass 2: attach declarations + local bindings ──────────────────────────
|
|
297
|
+
function pass2AttachDeclarations(matches, drafts, positionIndex, localDefs, filePath, provider, scopeTree) {
|
|
298
|
+
const draftById = new Map();
|
|
299
|
+
for (const d of drafts)
|
|
300
|
+
draftById.set(d.id, d);
|
|
301
|
+
for (const match of matches) {
|
|
302
|
+
const anchor = anchorCaptureFor(match, '@declaration.');
|
|
303
|
+
if (anchor === undefined)
|
|
304
|
+
continue;
|
|
305
|
+
const def = buildDefFromDeclarationMatch(match, anchor, filePath);
|
|
306
|
+
if (def === undefined)
|
|
307
|
+
continue;
|
|
308
|
+
// Find the innermost scope that contains the declaration's anchor range.
|
|
309
|
+
const innermostId = positionIndex.atPosition(filePath, anchor.range.startLine, anchor.range.startCol);
|
|
310
|
+
if (innermostId === undefined)
|
|
311
|
+
continue;
|
|
312
|
+
const innermost = draftById.get(innermostId);
|
|
313
|
+
if (innermost === undefined)
|
|
314
|
+
continue;
|
|
315
|
+
// Ownership: attach the def to the innermost scope's `ownedDefs` — that
|
|
316
|
+
// is the structural owner. `def.ownerId` is NOT populated here — the
|
|
317
|
+
// extractor has no clean path to the parent's own DefId mid-extraction
|
|
318
|
+
// (the parent declaration may not yet have been processed, or may live
|
|
319
|
+
// in a different scope entirely). Providers that need `ownerId` should
|
|
320
|
+
// set it directly from the declaration hook (e.g., derive from the
|
|
321
|
+
// `@declaration.owner` capture or the parent scope id); otherwise
|
|
322
|
+
// `finalize` populates method/field `ownerId` via `MethodDispatchIndex`
|
|
323
|
+
// (#914) in a follow-up pass that sees every def already in place.
|
|
324
|
+
innermost.ownedDefs.push(def);
|
|
325
|
+
localDefs.push(def);
|
|
326
|
+
// Binding visibility: default to innermost; allow hoisting via
|
|
327
|
+
// `provider.bindingScopeFor`. `draftToScope(innermost)` here is a
|
|
328
|
+
// **structural** snapshot — parent/range/kind only. Hooks MUST NOT
|
|
329
|
+
// rely on `scope.bindings`, `ownedDefs`, or `typeBindings` being
|
|
330
|
+
// populated during Pass 2: those fields are written across passes,
|
|
331
|
+
// so reading them mid-extraction yields a partial view. The
|
|
332
|
+
// `scopeTree` argument is similarly snapshot-before-mutation.
|
|
333
|
+
//
|
|
334
|
+
// Auto-hoist for scope-creating declarations: when the declaration's
|
|
335
|
+
// anchor range is the same node that produced `innermost` (e.g. a
|
|
336
|
+
// `function_definition` is both `@scope.function` and the
|
|
337
|
+
// `@declaration.function` anchor), the name is visible OUTSIDE the
|
|
338
|
+
// body, not inside. Hoisting to the parent scope is what every
|
|
339
|
+
// mainstream language wants for function/class declarations. Hooks
|
|
340
|
+
// can override by returning a non-null scope id.
|
|
341
|
+
const autoHostedId = innermost.parent !== null && rangesEqual(anchor.range, innermost.range)
|
|
342
|
+
? innermost.parent
|
|
343
|
+
: innermost.id;
|
|
344
|
+
const bindingScopeId = provider.bindingScopeFor?.(match, draftToScope(innermost), scopeTree) ?? autoHostedId;
|
|
345
|
+
const bindingHost = draftById.get(bindingScopeId) ?? innermost;
|
|
346
|
+
const nameKey = deriveDeclarationName(match, def);
|
|
347
|
+
if (nameKey === undefined)
|
|
348
|
+
continue;
|
|
349
|
+
const existing = bindingHost.bindings.get(nameKey) ?? [];
|
|
350
|
+
existing.push({ def, origin: 'local' });
|
|
351
|
+
bindingHost.bindings.set(nameKey, existing);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function buildDefFromDeclarationMatch(match, anchor, filePath) {
|
|
355
|
+
// Anchor name pattern: `@declaration.<kind>` where <kind> maps to NodeLabel.
|
|
356
|
+
const kindStr = anchor.name.slice('@declaration.'.length);
|
|
357
|
+
const type = normalizeNodeLabel(kindStr);
|
|
358
|
+
if (type === undefined)
|
|
359
|
+
return undefined;
|
|
360
|
+
const nameCap = match['@declaration.name'] ?? match[`@declaration.${kindStr}.name`] ?? match[anchor.name];
|
|
361
|
+
if (nameCap === undefined)
|
|
362
|
+
return undefined;
|
|
363
|
+
const qualifiedCap = match['@declaration.qualified_name'];
|
|
364
|
+
const qualifiedName = qualifiedCap?.text;
|
|
365
|
+
// Optional arity metadata — producers (e.g. Python emit-captures)
|
|
366
|
+
// synthesize these on function/method declarations. Their absence is
|
|
367
|
+
// the normal case for other producers; readers treat undefined as
|
|
368
|
+
// "unknown" per `SymbolDefinition` contract.
|
|
369
|
+
const parameterCount = parseIntCapture(match['@declaration.parameter-count']);
|
|
370
|
+
const requiredParameterCount = parseIntCapture(match['@declaration.required-parameter-count']);
|
|
371
|
+
const parameterTypes = parseJsonStringArrayCapture(match['@declaration.parameter-types']);
|
|
372
|
+
const declaredType = match['@declaration.field-type']?.text;
|
|
373
|
+
const returnType = match['@declaration.return-type']?.text;
|
|
374
|
+
return {
|
|
375
|
+
nodeId: makeDefId(filePath, anchor.range, type, nameCap.text),
|
|
376
|
+
filePath,
|
|
377
|
+
type,
|
|
378
|
+
...(qualifiedName !== undefined ? { qualifiedName } : { qualifiedName: nameCap.text }),
|
|
379
|
+
...(parameterCount !== undefined ? { parameterCount } : {}),
|
|
380
|
+
...(requiredParameterCount !== undefined ? { requiredParameterCount } : {}),
|
|
381
|
+
...(parameterTypes !== undefined ? { parameterTypes } : {}),
|
|
382
|
+
...(declaredType !== undefined ? { declaredType } : {}),
|
|
383
|
+
...(returnType !== undefined ? { returnType } : {}),
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function parseIntCapture(cap) {
|
|
387
|
+
if (cap === undefined)
|
|
388
|
+
return undefined;
|
|
389
|
+
const n = Number.parseInt(cap.text, 10);
|
|
390
|
+
return Number.isFinite(n) ? n : undefined;
|
|
391
|
+
}
|
|
392
|
+
function parseJsonStringArrayCapture(cap) {
|
|
393
|
+
if (cap === undefined)
|
|
394
|
+
return undefined;
|
|
395
|
+
try {
|
|
396
|
+
const parsed = JSON.parse(cap.text);
|
|
397
|
+
if (!Array.isArray(parsed))
|
|
398
|
+
return undefined;
|
|
399
|
+
return parsed.every((x) => typeof x === 'string') ? parsed : undefined;
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
return undefined;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function deriveDeclarationName(match, def) {
|
|
406
|
+
const nameCap = match['@declaration.name'] ??
|
|
407
|
+
match[Object.keys(match).find((k) => k.startsWith('@declaration.') && k.endsWith('.name')) ?? ''];
|
|
408
|
+
if (nameCap !== undefined)
|
|
409
|
+
return nameCap.text;
|
|
410
|
+
// Fall back to qualifiedName tail.
|
|
411
|
+
const q = def.qualifiedName;
|
|
412
|
+
if (q !== undefined && q.length > 0) {
|
|
413
|
+
const dot = q.lastIndexOf('.');
|
|
414
|
+
return dot === -1 ? q : q.slice(dot + 1);
|
|
415
|
+
}
|
|
416
|
+
return undefined;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Map a lower-case declaration kind (from `@declaration.<kind>`) to a
|
|
420
|
+
* graph `NodeLabel`. Silently returns `undefined` for kinds we don't
|
|
421
|
+
* recognize — providers can emit richer captures without breaking the
|
|
422
|
+
* driver.
|
|
423
|
+
*/
|
|
424
|
+
function normalizeNodeLabel(kindStr) {
|
|
425
|
+
switch (kindStr.toLowerCase()) {
|
|
426
|
+
case 'class':
|
|
427
|
+
return 'Class';
|
|
428
|
+
case 'interface':
|
|
429
|
+
return 'Interface';
|
|
430
|
+
case 'enum':
|
|
431
|
+
return 'Enum';
|
|
432
|
+
case 'struct':
|
|
433
|
+
return 'Struct';
|
|
434
|
+
case 'union':
|
|
435
|
+
return 'Union';
|
|
436
|
+
case 'trait':
|
|
437
|
+
return 'Trait';
|
|
438
|
+
case 'method':
|
|
439
|
+
return 'Method';
|
|
440
|
+
case 'function':
|
|
441
|
+
return 'Function';
|
|
442
|
+
case 'constructor':
|
|
443
|
+
return 'Constructor';
|
|
444
|
+
case 'field':
|
|
445
|
+
case 'property':
|
|
446
|
+
return 'Property';
|
|
447
|
+
case 'variable':
|
|
448
|
+
case 'const':
|
|
449
|
+
return 'Variable';
|
|
450
|
+
case 'typealias':
|
|
451
|
+
case 'type_alias':
|
|
452
|
+
return 'TypeAlias';
|
|
453
|
+
case 'typedef':
|
|
454
|
+
return 'Typedef';
|
|
455
|
+
case 'record':
|
|
456
|
+
return 'Record';
|
|
457
|
+
case 'delegate':
|
|
458
|
+
return 'Delegate';
|
|
459
|
+
case 'annotation':
|
|
460
|
+
return 'Annotation';
|
|
461
|
+
case 'namespace':
|
|
462
|
+
return 'Namespace';
|
|
463
|
+
default:
|
|
464
|
+
return undefined;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function makeDefId(filePath, range, type, name) {
|
|
468
|
+
return `def:${filePath}#${range.startLine}:${range.startCol}:${type}:${name}`;
|
|
469
|
+
}
|
|
470
|
+
// ─── Pass 3: collect raw imports ───────────────────────────────────────────
|
|
471
|
+
function pass3CollectImports(matches, parsedImports, provider) {
|
|
472
|
+
if (provider.interpretImport === undefined)
|
|
473
|
+
return;
|
|
474
|
+
for (const match of matches) {
|
|
475
|
+
const anchor = anchorCaptureFor(match, '@import.');
|
|
476
|
+
if (anchor === undefined)
|
|
477
|
+
continue;
|
|
478
|
+
const parsed = provider.interpretImport(match);
|
|
479
|
+
if (parsed === null)
|
|
480
|
+
continue;
|
|
481
|
+
parsedImports.push(parsed);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
// ─── Pass 4: collect type bindings ─────────────────────────────────────────
|
|
485
|
+
function pass4CollectTypeBindings(matches, drafts, positionIndex, filePath, provider, scopeTree) {
|
|
486
|
+
const draftById = new Map();
|
|
487
|
+
for (const d of drafts)
|
|
488
|
+
draftById.set(d.id, d);
|
|
489
|
+
for (const match of matches) {
|
|
490
|
+
const anchor = anchorCaptureFor(match, '@type-binding.');
|
|
491
|
+
if (anchor === undefined)
|
|
492
|
+
continue;
|
|
493
|
+
const parsed = provider.interpretTypeBinding?.(match);
|
|
494
|
+
if (parsed === null || parsed === undefined)
|
|
495
|
+
continue;
|
|
496
|
+
const innermostId = positionIndex.atPosition(filePath, anchor.range.startLine, anchor.range.startCol);
|
|
497
|
+
if (innermostId === undefined)
|
|
498
|
+
continue;
|
|
499
|
+
const innermost = draftById.get(innermostId);
|
|
500
|
+
if (innermost === undefined)
|
|
501
|
+
continue;
|
|
502
|
+
// Auto-hoist for scope-creating type bindings (e.g. Python's
|
|
503
|
+
// `@type-binding.return` whose anchor is the function_definition
|
|
504
|
+
// itself). Same condition as Pass 2 — when the anchor coincides
|
|
505
|
+
// with the innermost scope's range, the binding belongs in the
|
|
506
|
+
// enclosing scope (callers, not the function body, look up the
|
|
507
|
+
// return type by the function's name).
|
|
508
|
+
const autoHostedId = innermost.parent !== null && rangesEqual(anchor.range, innermost.range)
|
|
509
|
+
? innermost.parent
|
|
510
|
+
: innermost.id;
|
|
511
|
+
// `bindingScopeFor` may hoist the type binding to an outer scope.
|
|
512
|
+
const hostId = provider.bindingScopeFor?.(match, draftToScope(innermost), scopeTree) ?? autoHostedId;
|
|
513
|
+
const host = draftById.get(hostId) ?? innermost;
|
|
514
|
+
const typeRef = {
|
|
515
|
+
rawName: parsed.rawTypeName,
|
|
516
|
+
declaredAtScope: host.id,
|
|
517
|
+
source: parsed.source,
|
|
518
|
+
};
|
|
519
|
+
// Prefer stronger sources when multiple matches fire for the same
|
|
520
|
+
// bound name in the same scope. Example: `u: User = find()` matches
|
|
521
|
+
// both the annotation and constructor-inferred patterns; the explicit
|
|
522
|
+
// annotation (stronger source) must win over the call-site guess
|
|
523
|
+
// regardless of query-match arrival order.
|
|
524
|
+
const existing = host.typeBindings.get(parsed.boundName);
|
|
525
|
+
if (existing === undefined ||
|
|
526
|
+
typeBindingStrength(typeRef.source) >= typeBindingStrength(existing.source)) {
|
|
527
|
+
host.typeBindings.set(parsed.boundName, typeRef);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
// ── Transitive closure over identifier-chain type bindings ─────────
|
|
531
|
+
// Captures like `(assignment left: (ident) right: (ident))` emit a
|
|
532
|
+
// TypeRef whose `rawName` is the RHS identifier. When the RHS name is
|
|
533
|
+
// itself a bound variable with a known type in the same scope (or a
|
|
534
|
+
// parent scope), follow the chain so `alias` ultimately points at the
|
|
535
|
+
// class type — not at another local variable name. Without this,
|
|
536
|
+
// `resolveTypeRef` hits the chained name, sees it's a local Variable
|
|
537
|
+
// (non-type kind), and strict-returns null.
|
|
538
|
+
for (const draft of drafts) {
|
|
539
|
+
for (const [name, ref] of draft.typeBindings) {
|
|
540
|
+
const resolved = followChainedRef(ref, draftById);
|
|
541
|
+
if (resolved !== ref)
|
|
542
|
+
draft.typeBindings.set(name, resolved);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
/** Max chain depth: practical programs rarely exceed 4-5 re-bindings;
|
|
547
|
+
* the cap just prevents runaway loops when providers emit cycles. */
|
|
548
|
+
const CHAIN_MAX_DEPTH = 16;
|
|
549
|
+
/**
|
|
550
|
+
* Follow an identifier-chain TypeRef through successive typeBindings
|
|
551
|
+
* lookups in the declaring scope and its ancestors. Returns the terminal
|
|
552
|
+
* TypeRef (or the original if the chain dead-ends or cycles).
|
|
553
|
+
*/
|
|
554
|
+
function followChainedRef(start, draftById) {
|
|
555
|
+
let current = start;
|
|
556
|
+
const visited = new Set();
|
|
557
|
+
for (let depth = 0; depth < CHAIN_MAX_DEPTH; depth++) {
|
|
558
|
+
// A rawName containing a dot (`models.User`) goes through
|
|
559
|
+
// `QualifiedNameIndex` at resolution time — don't follow it here.
|
|
560
|
+
if (current.rawName.includes('.'))
|
|
561
|
+
return current;
|
|
562
|
+
// Look up the current rawName in the declaring scope and walk up
|
|
563
|
+
// the chain until we hit a scope that has a binding for it.
|
|
564
|
+
let scopeId = current.declaredAtScope;
|
|
565
|
+
let next;
|
|
566
|
+
while (scopeId !== null) {
|
|
567
|
+
const scope = draftById.get(scopeId);
|
|
568
|
+
if (scope === undefined)
|
|
569
|
+
break;
|
|
570
|
+
next = scope.typeBindings.get(current.rawName);
|
|
571
|
+
if (next !== undefined)
|
|
572
|
+
break;
|
|
573
|
+
scopeId = scope.parent;
|
|
574
|
+
}
|
|
575
|
+
if (next === undefined)
|
|
576
|
+
return current; // dead end — nothing to chain to
|
|
577
|
+
if (next === current)
|
|
578
|
+
return current; // self-ref
|
|
579
|
+
if (visited.has(next.rawName))
|
|
580
|
+
return current; // cycle guard
|
|
581
|
+
visited.add(next.rawName);
|
|
582
|
+
current = next;
|
|
583
|
+
}
|
|
584
|
+
return current;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Priority ordering when multiple `TypeRef`s compete for the same bound
|
|
588
|
+
* name in the same scope. Higher number wins; ties keep the later match
|
|
589
|
+
* (last-write-wins preserves historical order within a tier).
|
|
590
|
+
*
|
|
591
|
+
* Rationale: explicit annotations always beat inferred ones because they
|
|
592
|
+
* reflect user intent. `self`/`cls` are treated as strongly as annotations
|
|
593
|
+
* because they are language-required receiver types.
|
|
594
|
+
*/
|
|
595
|
+
function typeBindingStrength(source) {
|
|
596
|
+
switch (source) {
|
|
597
|
+
case 'annotation':
|
|
598
|
+
case 'parameter-annotation':
|
|
599
|
+
case 'return-annotation':
|
|
600
|
+
case 'self':
|
|
601
|
+
return 2;
|
|
602
|
+
case 'assignment-inferred':
|
|
603
|
+
case 'constructor-inferred':
|
|
604
|
+
case 'receiver-propagated':
|
|
605
|
+
return 1;
|
|
606
|
+
default:
|
|
607
|
+
return 0;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
// ─── Pass 5: collect reference sites ───────────────────────────────────────
|
|
611
|
+
function pass5CollectReferences(matches, positionIndex, filePath, referenceSites, provider, scopeTree) {
|
|
612
|
+
for (const match of matches) {
|
|
613
|
+
const anchor = anchorCaptureFor(match, '@reference.');
|
|
614
|
+
if (anchor === undefined)
|
|
615
|
+
continue;
|
|
616
|
+
const kind = referenceKindFromAnchor(anchor.name);
|
|
617
|
+
if (kind === undefined)
|
|
618
|
+
continue;
|
|
619
|
+
const nameCap = match['@reference.name'] ?? anchor;
|
|
620
|
+
const inScopeId = positionIndex.atPosition(filePath, anchor.range.startLine, anchor.range.startCol);
|
|
621
|
+
if (inScopeId === undefined)
|
|
622
|
+
continue;
|
|
623
|
+
const callForm = kind === 'call'
|
|
624
|
+
? classifyCallFormForMatch(match, anchor.name, provider, scopeTree, inScopeId)
|
|
625
|
+
: undefined;
|
|
626
|
+
const explicitReceiver = extractExplicitReceiver(match);
|
|
627
|
+
const arity = extractArity(match);
|
|
628
|
+
const argumentTypes = extractArgumentTypes(match);
|
|
629
|
+
const site = {
|
|
630
|
+
name: nameCap.text,
|
|
631
|
+
atRange: anchor.range,
|
|
632
|
+
inScope: inScopeId,
|
|
633
|
+
kind,
|
|
634
|
+
...(callForm !== undefined ? { callForm } : {}),
|
|
635
|
+
...(explicitReceiver !== undefined ? { explicitReceiver } : {}),
|
|
636
|
+
...(arity !== undefined ? { arity } : {}),
|
|
637
|
+
...(argumentTypes !== undefined ? { argumentTypes } : {}),
|
|
638
|
+
};
|
|
639
|
+
referenceSites.push(site);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function referenceKindFromAnchor(name) {
|
|
643
|
+
const suffix = name.slice('@reference.'.length);
|
|
644
|
+
// Strip sub-tag after the kind (`@reference.call.member` → `call`).
|
|
645
|
+
const firstDot = suffix.indexOf('.');
|
|
646
|
+
const head = firstDot === -1 ? suffix : suffix.slice(0, firstDot);
|
|
647
|
+
switch (head.toLowerCase()) {
|
|
648
|
+
case 'call':
|
|
649
|
+
return 'call';
|
|
650
|
+
case 'read':
|
|
651
|
+
return 'read';
|
|
652
|
+
case 'write':
|
|
653
|
+
return 'write';
|
|
654
|
+
case 'type':
|
|
655
|
+
case 'type_reference':
|
|
656
|
+
return 'type-reference';
|
|
657
|
+
case 'inherits':
|
|
658
|
+
return 'inherits';
|
|
659
|
+
case 'import_use':
|
|
660
|
+
case 'import-use':
|
|
661
|
+
return 'import-use';
|
|
662
|
+
default:
|
|
663
|
+
return undefined;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function classifyCallFormForMatch(match, anchorName, provider, scopeTree, inScopeId) {
|
|
667
|
+
// Declarative sub-tag path first: `@reference.call.member` → 'member'.
|
|
668
|
+
const suffix = anchorName.slice('@reference.call.'.length);
|
|
669
|
+
switch (suffix.toLowerCase()) {
|
|
670
|
+
case 'free':
|
|
671
|
+
return 'free';
|
|
672
|
+
case 'member':
|
|
673
|
+
return 'member';
|
|
674
|
+
case 'constructor':
|
|
675
|
+
return 'constructor';
|
|
676
|
+
case 'index':
|
|
677
|
+
return 'index';
|
|
678
|
+
}
|
|
679
|
+
// Hook-based path: provider knows.
|
|
680
|
+
const hook = provider.classifyCallForm;
|
|
681
|
+
if (hook !== undefined) {
|
|
682
|
+
const scope = scopeTree.getScope(inScopeId);
|
|
683
|
+
if (scope !== undefined)
|
|
684
|
+
return hook(match, scope);
|
|
685
|
+
}
|
|
686
|
+
return 'free';
|
|
687
|
+
}
|
|
688
|
+
function extractExplicitReceiver(match) {
|
|
689
|
+
const cap = match['@reference.receiver'];
|
|
690
|
+
if (cap === undefined)
|
|
691
|
+
return undefined;
|
|
692
|
+
return { name: cap.text };
|
|
693
|
+
}
|
|
694
|
+
function extractArity(match) {
|
|
695
|
+
const cap = match['@reference.arity'];
|
|
696
|
+
if (cap === undefined)
|
|
697
|
+
return undefined;
|
|
698
|
+
const n = Number.parseInt(cap.text, 10);
|
|
699
|
+
return Number.isFinite(n) ? n : undefined;
|
|
700
|
+
}
|
|
701
|
+
function extractArgumentTypes(match) {
|
|
702
|
+
const cap = match['@reference.parameter-types'];
|
|
703
|
+
if (cap === undefined)
|
|
704
|
+
return undefined;
|
|
705
|
+
try {
|
|
706
|
+
const parsed = JSON.parse(cap.text);
|
|
707
|
+
if (Array.isArray(parsed) && parsed.every((x) => typeof x === 'string'))
|
|
708
|
+
return parsed;
|
|
709
|
+
}
|
|
710
|
+
catch {
|
|
711
|
+
/* malformed — fall through */
|
|
712
|
+
}
|
|
713
|
+
return undefined;
|
|
714
|
+
}
|
|
715
|
+
// ─── Internal: range + capture utilities ───────────────────────────────────
|
|
716
|
+
function rangesEqual(a, b) {
|
|
717
|
+
return (a.startLine === b.startLine &&
|
|
718
|
+
a.startCol === b.startCol &&
|
|
719
|
+
a.endLine === b.endLine &&
|
|
720
|
+
a.endCol === b.endCol);
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Capture names that are never anchors — they are sub-tags nested inside a
|
|
724
|
+
* larger anchor (e.g., the receiver expression inside a `@reference.call`
|
|
725
|
+
* may span more source than the called name, but is not the call itself).
|
|
726
|
+
*
|
|
727
|
+
* The list is maintained here centrally rather than per-pass because the
|
|
728
|
+
* set is small and stable; adding a new sub-tag convention is a one-line
|
|
729
|
+
* change.
|
|
730
|
+
*/
|
|
731
|
+
const KNOWN_SUB_TAGS = new Set([
|
|
732
|
+
'@declaration.name',
|
|
733
|
+
'@declaration.qualified_name',
|
|
734
|
+
'@import.name',
|
|
735
|
+
'@import.source',
|
|
736
|
+
'@import.alias',
|
|
737
|
+
'@type-binding.name',
|
|
738
|
+
'@type-binding.type',
|
|
739
|
+
'@reference.name',
|
|
740
|
+
'@reference.receiver',
|
|
741
|
+
'@reference.arity',
|
|
742
|
+
'@reference.parameter-types',
|
|
743
|
+
'@declaration.parameter-count',
|
|
744
|
+
'@declaration.required-parameter-count',
|
|
745
|
+
'@declaration.parameter-types',
|
|
746
|
+
]);
|
|
747
|
+
/**
|
|
748
|
+
* Return the anchor capture for a match — the one whose name begins with
|
|
749
|
+
* `prefix` AND is not in the known-sub-tag set. When multiple candidates
|
|
750
|
+
* remain, the broadest-ranged one wins: tree-sitter queries often tag
|
|
751
|
+
* both a whole statement and a sub-token under the same topic
|
|
752
|
+
* (`@scope.function` + `@scope.function.name`); the anchor is the
|
|
753
|
+
* statement-level one.
|
|
754
|
+
*/
|
|
755
|
+
function anchorCaptureFor(match, prefix) {
|
|
756
|
+
let best;
|
|
757
|
+
let bestSpan = -1;
|
|
758
|
+
for (const name of Object.keys(match)) {
|
|
759
|
+
if (!name.startsWith(prefix))
|
|
760
|
+
continue;
|
|
761
|
+
if (KNOWN_SUB_TAGS.has(name))
|
|
762
|
+
continue;
|
|
763
|
+
const cap = match[name];
|
|
764
|
+
const span = (cap.range.endLine - cap.range.startLine) * 1_000_000 +
|
|
765
|
+
(cap.range.endCol - cap.range.startCol);
|
|
766
|
+
if (span > bestSpan) {
|
|
767
|
+
bestSpan = span;
|
|
768
|
+
best = cap;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return best;
|
|
772
|
+
}
|