@codragraph/cli 1.6.2
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 +341 -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 +55 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +39 -0
- package/dist/_shared/index.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 +139 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js +479 -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 +80 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js +79 -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 +332 -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 +61 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.js +186 -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 +356 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/types.js +17 -0
- package/dist/_shared/scope-resolution/types.js.map +1 -0
- package/dist/cli/ai-context.d.ts +27 -0
- package/dist/cli/ai-context.js +270 -0
- package/dist/cli/analyze.d.ts +43 -0
- package/dist/cli/analyze.js +312 -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 +78 -0
- package/dist/cli/config.d.ts +27 -0
- package/dist/cli/config.js +106 -0
- package/dist/cli/eval-server.d.ts +37 -0
- package/dist/cli/eval-server.js +398 -0
- package/dist/cli/graphstore.d.ts +40 -0
- package/dist/cli/graphstore.js +639 -0
- package/dist/cli/group.d.ts +2 -0
- package/dist/cli/group.js +306 -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 +236 -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 +8 -0
- package/dist/cli/mcp.js +36 -0
- package/dist/cli/remove.d.ts +30 -0
- package/dist/cli/remove.js +99 -0
- package/dist/cli/serve.d.ts +4 -0
- package/dist/cli/serve.js +37 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +543 -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 +168 -0
- package/dist/cli/wiki.d.ts +21 -0
- package/dist/cli/wiki.js +579 -0
- package/dist/config/ignore-service.d.ts +35 -0
- package/dist/config/ignore-service.js +436 -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 +252 -0
- package/dist/core/embeddings/ast-utils.d.ts +22 -0
- package/dist/core/embeddings/ast-utils.js +105 -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/embedder.d.ts +65 -0
- package/dist/core/embeddings/embedder.js +320 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +62 -0
- package/dist/core/embeddings/embedding-pipeline.js +486 -0
- package/dist/core/embeddings/http-client.d.ts +31 -0
- package/dist/core/embeddings/http-client.js +179 -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 +207 -0
- package/dist/core/embeddings/types.js +200 -0
- package/dist/core/git-staleness.d.ts +31 -0
- package/dist/core/git-staleness.js +137 -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/graphstore/index.d.ts +46 -0
- package/dist/core/graphstore/index.js +80 -0
- package/dist/core/graphstore/lbug-row-source.d.ts +19 -0
- package/dist/core/graphstore/lbug-row-source.js +141 -0
- package/dist/core/group/bridge-db.d.ts +82 -0
- package/dist/core/group/bridge-db.js +460 -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 +100 -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 +41 -0
- package/dist/core/group/cross-impact.js +441 -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/grpc-extractor.d.ts +25 -0
- package/dist/core/group/extractors/grpc-extractor.js +401 -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 +133 -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 +421 -0
- package/dist/core/group/extractors/manifest-extractor.d.ts +54 -0
- package/dist/core/group/extractors/manifest-extractor.js +292 -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 +94 -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 +198 -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 +55 -0
- package/dist/core/group/service.js +394 -0
- package/dist/core/group/storage.d.ts +9 -0
- package/dist/core/group/storage.js +91 -0
- package/dist/core/group/sync.d.ts +21 -0
- package/dist/core/group/sync.js +196 -0
- package/dist/core/group/types.d.ts +160 -0
- package/dist/core/group/types.js +1 -0
- package/dist/core/ingestion/ast-cache.d.ts +26 -0
- package/dist/core/ingestion/ast-cache.js +47 -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 +2639 -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 +168 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.d.ts +57 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +392 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +210 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +1715 -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 +318 -0
- package/dist/core/ingestion/constants.d.ts +16 -0
- package/dist/core/ingestion/constants.js +16 -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 +58 -0
- package/dist/core/ingestion/entry-point-scoring.js +380 -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 +116 -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 +91 -0
- package/dist/core/ingestion/finalize-orchestrator.d.ts +63 -0
- package/dist/core/ingestion/finalize-orchestrator.js +139 -0
- package/dist/core/ingestion/framework-detection.d.ts +150 -0
- package/dist/core/ingestion/framework-detection.js +786 -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 +360 -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 +373 -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 +30 -0
- package/dist/core/ingestion/import-resolvers/standard.js +142 -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 +149 -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 +181 -0
- package/dist/core/ingestion/language-provider.d.ts +410 -0
- package/dist/core/ingestion/language-provider.js +24 -0
- package/dist/core/ingestion/languages/c-cpp.d.ts +12 -0
- package/dist/core/ingestion/languages/c-cpp.js +329 -0
- package/dist/core/ingestion/languages/cobol.d.ts +1 -0
- package/dist/core/ingestion/languages/cobol.js +26 -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 +249 -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 +50 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +374 -0
- package/dist/core/ingestion/languages/csharp/query.d.ts +35 -0
- package/dist/core/ingestion/languages/csharp/query.js +515 -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 +152 -0
- package/dist/core/ingestion/languages/dart.d.ts +12 -0
- package/dist/core/ingestion/languages/dart.js +102 -0
- package/dist/core/ingestion/languages/go.d.ts +11 -0
- package/dist/core/ingestion/languages/go.js +44 -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.d.ts +9 -0
- package/dist/core/ingestion/languages/java.js +44 -0
- package/dist/core/ingestion/languages/kotlin.d.ts +9 -0
- package/dist/core/ingestion/languages/kotlin.js +123 -0
- package/dist/core/ingestion/languages/php.d.ts +8 -0
- package/dist/core/ingestion/languages/php.js +240 -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 +106 -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 +99 -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 +23 -0
- package/dist/core/ingestion/languages/python/simple-hooks.js +35 -0
- package/dist/core/ingestion/languages/python.d.ts +12 -0
- package/dist/core/ingestion/languages/python.js +91 -0
- package/dist/core/ingestion/languages/ruby.d.ts +9 -0
- package/dist/core/ingestion/languages/ruby.js +210 -0
- package/dist/core/ingestion/languages/rust.d.ts +12 -0
- package/dist/core/ingestion/languages/rust.js +132 -0
- package/dist/core/ingestion/languages/swift.d.ts +12 -0
- package/dist/core/ingestion/languages/swift.js +244 -0
- package/dist/core/ingestion/languages/typescript.d.ts +11 -0
- package/dist/core/ingestion/languages/typescript.js +184 -0
- package/dist/core/ingestion/languages/vue.d.ts +13 -0
- package/dist/core/ingestion/languages/vue.js +77 -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 +277 -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 +204 -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 +381 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +59 -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 +40 -0
- package/dist/core/ingestion/parsing-processor.js +576 -0
- package/dist/core/ingestion/pipeline-phases/cobol.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/cobol.js +45 -0
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/communities.js +62 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +156 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +37 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.js +63 -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 +33 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +18 -0
- package/dist/core/ingestion/pipeline-phases/mro.js +36 -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 +74 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +58 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +458 -0
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +74 -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 +143 -0
- package/dist/core/ingestion/pipeline-phases/routes.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/routes.js +243 -0
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/runner.js +203 -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 +20 -0
- package/dist/core/ingestion/pipeline-phases/tools.js +79 -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 +36 -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 +317 -0
- package/dist/core/ingestion/registry-primary-flag.d.ts +86 -0
- package/dist/core/ingestion/registry-primary-flag.js +111 -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 +32 -0
- package/dist/core/ingestion/scope-extractor-bridge.js +44 -0
- package/dist/core/ingestion/scope-extractor.d.ts +86 -0
- package/dist/core/ingestion/scope-extractor.js +758 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +372 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +212 -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 +112 -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 +30 -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 +113 -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 +198 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +27 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +131 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +48 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +130 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.js +99 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +26 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +61 -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 +327 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +47 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +130 -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 +21 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +66 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +157 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.d.ts +36 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.js +52 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +127 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +349 -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 +1338 -0
- package/dist/core/ingestion/type-env.d.ts +86 -0
- package/dist/core/ingestion/type-env.js +1128 -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 +484 -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 +89 -0
- package/dist/core/ingestion/utils/ast-helpers.js +535 -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 +10 -0
- package/dist/core/ingestion/utils/env.js +10 -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 +52 -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 +94 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +198 -0
- package/dist/core/ingestion/workers/parse-worker.js +1928 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +16 -0
- package/dist/core/ingestion/workers/worker-pool.js +126 -0
- package/dist/core/lbug/csv-generator.d.ts +33 -0
- package/dist/core/lbug/csv-generator.js +459 -0
- package/dist/core/lbug/lbug-adapter.d.ts +173 -0
- package/dist/core/lbug/lbug-adapter.js +1188 -0
- package/dist/core/lbug/pool-adapter.d.ts +93 -0
- package/dist/core/lbug/pool-adapter.js +543 -0
- package/dist/core/lbug/schema.d.ts +62 -0
- package/dist/core/lbug/schema.js +484 -0
- package/dist/core/run-analyze.d.ts +72 -0
- package/dist/core/run-analyze.js +315 -0
- package/dist/core/search/bm25-index.d.ts +41 -0
- package/dist/core/search/bm25-index.js +209 -0
- package/dist/core/search/hybrid-search.d.ts +49 -0
- package/dist/core/search/hybrid-search.js +118 -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 +84 -0
- package/dist/core/wiki/cursor-client.d.ts +31 -0
- package/dist/core/wiki/cursor-client.js +122 -0
- package/dist/core/wiki/generator.d.ts +129 -0
- package/dist/core/wiki/generator.js +898 -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 +303 -0
- package/dist/core/wiki/llm-client.d.ts +63 -0
- package/dist/core/wiki/llm-client.js +234 -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 +200 -0
- package/dist/mcp/core/embedder.d.ts +27 -0
- package/dist/mcp/core/embedder.js +122 -0
- package/dist/mcp/core/lbug-adapter.d.ts +5 -0
- package/dist/mcp/core/lbug-adapter.js +5 -0
- package/dist/mcp/local/graphstore-handler.d.ts +214 -0
- package/dist/mcp/local/graphstore-handler.js +272 -0
- package/dist/mcp/local/local-backend.d.ts +347 -0
- package/dist/mcp/local/local-backend.js +3218 -0
- package/dist/mcp/resources.d.ts +62 -0
- package/dist/mcp/resources.js +696 -0
- package/dist/mcp/server.d.ts +23 -0
- package/dist/mcp/server.js +533 -0
- package/dist/mcp/staleness.d.ts +5 -0
- package/dist/mcp/staleness.js +4 -0
- package/dist/mcp/tools.d.ts +27 -0
- package/dist/mcp/tools.js +823 -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 +47 -0
- package/dist/server/api.js +1727 -0
- package/dist/server/git-clone.d.ts +26 -0
- package/dist/server/git-clone.js +184 -0
- package/dist/server/mcp-http.d.ts +13 -0
- package/dist/server/mcp-http.js +100 -0
- package/dist/storage/git.d.ts +80 -0
- package/dist/storage/git.js +190 -0
- package/dist/storage/repo-manager.d.ts +458 -0
- package/dist/storage/repo-manager.js +766 -0
- package/dist/types/pipeline.d.ts +18 -0
- package/dist/types/pipeline.js +1 -0
- package/hooks/claude/codragraph-hook.cjs +268 -0
- package/hooks/claude/pre-tool-use.sh +79 -0
- package/hooks/claude/session-start.sh +42 -0
- package/package.json +127 -0
- package/scripts/bench-scope-resolution.ts +134 -0
- package/scripts/build-tree-sitter-proto.cjs +82 -0
- package/scripts/build.js +90 -0
- package/scripts/ci-list-migrated-languages.ts +24 -0
- package/scripts/patch-tree-sitter-swift.cjs +78 -0
- package/skills/codragraph-cli.md +82 -0
- package/skills/codragraph-debugging.md +89 -0
- package/skills/codragraph-exploring.md +78 -0
- package/skills/codragraph-guide.md +64 -0
- package/skills/codragraph-impact-analysis.md +97 -0
- package/skills/codragraph-pr-review.md +163 -0
- package/skills/codragraph-refactoring.md +121 -0
- package/vendor/leiden/index.cjs +355 -0
- package/vendor/leiden/utils.cjs +392 -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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PHP PSR-4 import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Strategy lives in configs/php.ts.
|
|
5
|
+
* This file contains the shared helper for PSR-4 resolution via composer.json.
|
|
6
|
+
*/
|
|
7
|
+
import type { SuffixIndex } from './utils.js';
|
|
8
|
+
import type { ComposerConfig } from '../language-config.js';
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a PHP use-statement import path using PSR-4 mappings (low-level helper).
|
|
11
|
+
* e.g. "App\Http\Controllers\UserController" -> "app/Http/Controllers/UserController.php"
|
|
12
|
+
*
|
|
13
|
+
* For function/constant imports (use function App\Models\getUser), the last
|
|
14
|
+
* segment is the symbol name, not a class name, so it may not map directly to
|
|
15
|
+
* a file. When PSR-4 class-style resolution fails, we fall back to scanning
|
|
16
|
+
* .php files in the namespace directory.
|
|
17
|
+
*
|
|
18
|
+
* NOTE: The function-import fallback returns the first matching .php file in the
|
|
19
|
+
* namespace directory. When multiple files exist in the same namespace directory,
|
|
20
|
+
* resolution is non-deterministic (depends on Set/index iteration order). This is
|
|
21
|
+
* a known limitation — PHP function imports cannot be resolved to a specific file
|
|
22
|
+
* without parsing all candidate files.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolvePhpImportInternal(importPath: string, composerConfig: ComposerConfig | null, allFiles: Set<string>, normalizedFileList: string[], allFileList: string[], index?: SuffixIndex): string | null;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PHP PSR-4 import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Strategy lives in configs/php.ts.
|
|
5
|
+
* This file contains the shared helper for PSR-4 resolution via composer.json.
|
|
6
|
+
*/
|
|
7
|
+
import { suffixResolve } from './utils.js';
|
|
8
|
+
/** Get or compute the sorted PSR-4 entries (cached after first call). */
|
|
9
|
+
function getSortedPsr4(config) {
|
|
10
|
+
if (!config.psr4Sorted) {
|
|
11
|
+
const sorted = [...config.psr4.entries()].sort((a, b) => b[0].length - a[0].length);
|
|
12
|
+
config.psr4Sorted = sorted;
|
|
13
|
+
}
|
|
14
|
+
return config.psr4Sorted;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a PHP use-statement import path using PSR-4 mappings (low-level helper).
|
|
18
|
+
* e.g. "App\Http\Controllers\UserController" -> "app/Http/Controllers/UserController.php"
|
|
19
|
+
*
|
|
20
|
+
* For function/constant imports (use function App\Models\getUser), the last
|
|
21
|
+
* segment is the symbol name, not a class name, so it may not map directly to
|
|
22
|
+
* a file. When PSR-4 class-style resolution fails, we fall back to scanning
|
|
23
|
+
* .php files in the namespace directory.
|
|
24
|
+
*
|
|
25
|
+
* NOTE: The function-import fallback returns the first matching .php file in the
|
|
26
|
+
* namespace directory. When multiple files exist in the same namespace directory,
|
|
27
|
+
* resolution is non-deterministic (depends on Set/index iteration order). This is
|
|
28
|
+
* a known limitation — PHP function imports cannot be resolved to a specific file
|
|
29
|
+
* without parsing all candidate files.
|
|
30
|
+
*/
|
|
31
|
+
export function resolvePhpImportInternal(importPath, composerConfig, allFiles, normalizedFileList, allFileList, index) {
|
|
32
|
+
// Normalize: replace backslashes with forward slashes
|
|
33
|
+
const normalized = importPath.replace(/\\/g, '/');
|
|
34
|
+
// Reject path traversal attempts (defense-in-depth — walker whitelist also prevents this)
|
|
35
|
+
if (normalized.includes('..'))
|
|
36
|
+
return null;
|
|
37
|
+
if (composerConfig) {
|
|
38
|
+
const sorted = getSortedPsr4(composerConfig);
|
|
39
|
+
for (const [nsPrefix, dirPrefix] of sorted) {
|
|
40
|
+
const nsPrefixSlash = nsPrefix.replace(/\\/g, '/');
|
|
41
|
+
if (normalized.startsWith(nsPrefixSlash + '/') || normalized === nsPrefixSlash) {
|
|
42
|
+
const remainder = normalized.slice(nsPrefixSlash.length).replace(/^\//, '');
|
|
43
|
+
// 1. Try class-style PSR-4: full path → file (e.g. App\Models\User → app/Models/User.php)
|
|
44
|
+
const filePath = dirPrefix + (remainder ? '/' + remainder : '') + '.php';
|
|
45
|
+
if (allFiles.has(filePath))
|
|
46
|
+
return filePath;
|
|
47
|
+
if (index) {
|
|
48
|
+
const result = index.getInsensitive(filePath);
|
|
49
|
+
if (result)
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
// 2. Function/constant fallback: strip last segment (symbol name), scan namespace directory.
|
|
53
|
+
// e.g. App\Models\getUser → directory app/Models/, find first .php file in that dir.
|
|
54
|
+
const lastSlash = remainder.lastIndexOf('/');
|
|
55
|
+
const nsDir = lastSlash >= 0 ? dirPrefix + '/' + remainder.slice(0, lastSlash) : dirPrefix;
|
|
56
|
+
// Prefer SuffixIndex directory lookup (O(log n + matches)) over linear scan
|
|
57
|
+
if (index) {
|
|
58
|
+
const candidates = index.getFilesInDir(nsDir, '.php');
|
|
59
|
+
if (candidates.length > 0)
|
|
60
|
+
return candidates[0];
|
|
61
|
+
}
|
|
62
|
+
// Fallback: linear scan (only when SuffixIndex unavailable)
|
|
63
|
+
const nsDirPrefix = nsDir.endsWith('/') ? nsDir : nsDir + '/';
|
|
64
|
+
for (const f of allFiles) {
|
|
65
|
+
if (f.startsWith(nsDirPrefix) &&
|
|
66
|
+
f.endsWith('.php') &&
|
|
67
|
+
!f.slice(nsDirPrefix.length).includes('/')) {
|
|
68
|
+
return f;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Fallback: suffix matching (works without composer.json)
|
|
75
|
+
const pathParts = normalized.split('/').filter(Boolean);
|
|
76
|
+
return suffixResolve(pathParts, normalizedFileList, allFileList, index);
|
|
77
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python import resolution — PEP 328 relative imports and proximity-based bare imports.
|
|
3
|
+
* Import system spec: PEP 302 (original), PEP 451 (current).
|
|
4
|
+
*
|
|
5
|
+
* Strategy lives in configs/python.ts.
|
|
6
|
+
* This file contains the shared internal helper used by the strategy and tests.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a Python import to a file path (low-level helper).
|
|
10
|
+
*
|
|
11
|
+
* 1. Relative (PEP 328): `.module`, `..module` — 1 dot = current package, each extra dot goes up one level.
|
|
12
|
+
* 2. Proximity bare import: static heuristic — checks the importer's own directory first.
|
|
13
|
+
* Approximates the common case where co-located files find each other without an installed package.
|
|
14
|
+
* Single-segment only — multi-segment (e.g. `os.path`) falls through to suffixResolve.
|
|
15
|
+
* Checks package (__init__.py) before module (.py), matching CPython's finder order (PEP 451 §4).
|
|
16
|
+
* Coexistence of both is physically impossible (same name = file vs directory), so the order
|
|
17
|
+
* only matters for spec compliance.
|
|
18
|
+
* Note: implicit namespace packages (Python 3.3+, directory without __init__.py) are not handled.
|
|
19
|
+
*
|
|
20
|
+
* Returns null to let the caller fall through to suffixResolve.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolvePythonImportInternal(currentFile: string, importPath: string, allFiles: Set<string>): string | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python import resolution — PEP 328 relative imports and proximity-based bare imports.
|
|
3
|
+
* Import system spec: PEP 302 (original), PEP 451 (current).
|
|
4
|
+
*
|
|
5
|
+
* Strategy lives in configs/python.ts.
|
|
6
|
+
* This file contains the shared internal helper used by the strategy and tests.
|
|
7
|
+
*/
|
|
8
|
+
import { tryResolveWithExtensions } from './utils.js';
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a Python import to a file path (low-level helper).
|
|
11
|
+
*
|
|
12
|
+
* 1. Relative (PEP 328): `.module`, `..module` — 1 dot = current package, each extra dot goes up one level.
|
|
13
|
+
* 2. Proximity bare import: static heuristic — checks the importer's own directory first.
|
|
14
|
+
* Approximates the common case where co-located files find each other without an installed package.
|
|
15
|
+
* Single-segment only — multi-segment (e.g. `os.path`) falls through to suffixResolve.
|
|
16
|
+
* Checks package (__init__.py) before module (.py), matching CPython's finder order (PEP 451 §4).
|
|
17
|
+
* Coexistence of both is physically impossible (same name = file vs directory), so the order
|
|
18
|
+
* only matters for spec compliance.
|
|
19
|
+
* Note: implicit namespace packages (Python 3.3+, directory without __init__.py) are not handled.
|
|
20
|
+
*
|
|
21
|
+
* Returns null to let the caller fall through to suffixResolve.
|
|
22
|
+
*/
|
|
23
|
+
export function resolvePythonImportInternal(currentFile, importPath, allFiles) {
|
|
24
|
+
// Relative import — PEP 328 (https://peps.python.org/pep-0328/)
|
|
25
|
+
if (importPath.startsWith('.')) {
|
|
26
|
+
const dotMatch = importPath.match(/^(\.+)(.*)/);
|
|
27
|
+
if (!dotMatch)
|
|
28
|
+
return null;
|
|
29
|
+
const dotCount = dotMatch[1].length;
|
|
30
|
+
const modulePart = dotMatch[2];
|
|
31
|
+
const dirParts = currentFile.split('/').slice(0, -1);
|
|
32
|
+
// PEP 328: more dots than directory levels → beyond top-level package → invalid
|
|
33
|
+
if (dotCount - 1 > dirParts.length)
|
|
34
|
+
return null;
|
|
35
|
+
for (let i = 1; i < dotCount; i++)
|
|
36
|
+
dirParts.pop();
|
|
37
|
+
if (modulePart) {
|
|
38
|
+
dirParts.push(...modulePart.replace(/\./g, '/').split('/'));
|
|
39
|
+
}
|
|
40
|
+
return tryResolveWithExtensions(dirParts.join('/'), allFiles);
|
|
41
|
+
}
|
|
42
|
+
// Proximity bare import — single-segment only; package before module (PEP 451 §4)
|
|
43
|
+
const pathLike = importPath.replace(/\./g, '/');
|
|
44
|
+
if (pathLike.includes('/'))
|
|
45
|
+
return null;
|
|
46
|
+
// Normalize for Windows backslashes
|
|
47
|
+
const importerDir = currentFile.replace(/\\/g, '/').split('/').slice(0, -1).join('/');
|
|
48
|
+
// Proximity check — only applies when the importer lives in a subdirectory.
|
|
49
|
+
// Root-level importers (importerDir === '') skip straight to the ancestor
|
|
50
|
+
// walk below, which handles the root case correctly (prefix becomes '').
|
|
51
|
+
if (importerDir) {
|
|
52
|
+
if (allFiles.has(`${importerDir}/${pathLike}/__init__.py`))
|
|
53
|
+
return `${importerDir}/${pathLike}/__init__.py`;
|
|
54
|
+
if (allFiles.has(`${importerDir}/${pathLike}.py`))
|
|
55
|
+
return `${importerDir}/${pathLike}.py`;
|
|
56
|
+
}
|
|
57
|
+
// Ancestor directory walk — Python resolves bare imports against sys.path entries,
|
|
58
|
+
// which typically includes the project root and package directories. Walk up from the
|
|
59
|
+
// importer's directory to find the module in an ancestor, preferring the closest match.
|
|
60
|
+
// This prevents cross-language misresolution (e.g., Python `from middleware import X`
|
|
61
|
+
// resolving to a TypeScript middleware.ts via suffix matching). Issue #417.
|
|
62
|
+
const dirParts = importerDir.split('/');
|
|
63
|
+
for (let i = dirParts.length - 1; i >= 0; i--) {
|
|
64
|
+
const ancestorDir = dirParts.slice(0, i).join('/');
|
|
65
|
+
const prefix = ancestorDir ? `${ancestorDir}/` : '';
|
|
66
|
+
if (allFiles.has(`${prefix}${pathLike}/__init__.py`))
|
|
67
|
+
return `${prefix}${pathLike}/__init__.py`;
|
|
68
|
+
if (allFiles.has(`${prefix}${pathLike}.py`))
|
|
69
|
+
return `${prefix}${pathLike}.py`;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import resolver factory — creates a composable import resolver from
|
|
3
|
+
* an ordered list of strategies.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the method-extractors/generic.ts and call-extractors/generic.ts
|
|
6
|
+
* pattern: declare a config per language, produce a runtime resolver via factory.
|
|
7
|
+
*
|
|
8
|
+
* Each strategy is tried in order. The first non-null result wins.
|
|
9
|
+
* A result with an empty `files` array is treated as "handled but unresolved"
|
|
10
|
+
* (stops the chain without producing import edges).
|
|
11
|
+
*/
|
|
12
|
+
import type { ImportResolverFn, ImportResolutionConfig } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Create an ImportResolverFn from a declarative config.
|
|
15
|
+
*
|
|
16
|
+
* Chains strategies in declaration order — first non-null result wins.
|
|
17
|
+
* Returns null only if every strategy returns null.
|
|
18
|
+
*
|
|
19
|
+
* Error behaviour: if a strategy throws, the error propagates immediately
|
|
20
|
+
* and remaining strategies are not tried. Strategies are expected to be
|
|
21
|
+
* pure data transforms that never throw; any unexpected exception indicates
|
|
22
|
+
* a bug in the strategy implementation.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createImportResolver(config: ImportResolutionConfig): ImportResolverFn;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import resolver factory — creates a composable import resolver from
|
|
3
|
+
* an ordered list of strategies.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the method-extractors/generic.ts and call-extractors/generic.ts
|
|
6
|
+
* pattern: declare a config per language, produce a runtime resolver via factory.
|
|
7
|
+
*
|
|
8
|
+
* Each strategy is tried in order. The first non-null result wins.
|
|
9
|
+
* A result with an empty `files` array is treated as "handled but unresolved"
|
|
10
|
+
* (stops the chain without producing import edges).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Create an ImportResolverFn from a declarative config.
|
|
14
|
+
*
|
|
15
|
+
* Chains strategies in declaration order — first non-null result wins.
|
|
16
|
+
* Returns null only if every strategy returns null.
|
|
17
|
+
*
|
|
18
|
+
* Error behaviour: if a strategy throws, the error propagates immediately
|
|
19
|
+
* and remaining strategies are not tried. Strategies are expected to be
|
|
20
|
+
* pure data transforms that never throw; any unexpected exception indicates
|
|
21
|
+
* a bug in the strategy implementation.
|
|
22
|
+
*/
|
|
23
|
+
export function createImportResolver(config) {
|
|
24
|
+
const { strategies } = config;
|
|
25
|
+
return (rawImportPath, filePath, ctx) => {
|
|
26
|
+
for (const strategy of strategies) {
|
|
27
|
+
const result = strategy(rawImportPath, filePath, ctx);
|
|
28
|
+
if (result)
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby require/require_relative import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Strategy lives in configs/ruby.ts.
|
|
5
|
+
* This file only contains the low-level helper used by the strategy.
|
|
6
|
+
*/
|
|
7
|
+
import type { SuffixIndex } from './utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a Ruby require/require_relative path to a matching .rb file (low-level helper).
|
|
10
|
+
*
|
|
11
|
+
* require_relative paths are pre-normalized to './' prefix by the caller.
|
|
12
|
+
* require paths use suffix matching (gem-style paths like 'json', 'net/http').
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveRubyImportInternal(importPath: string, normalizedFileList: string[], allFileList: string[], index?: SuffixIndex): string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby require/require_relative import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Strategy lives in configs/ruby.ts.
|
|
5
|
+
* This file only contains the low-level helper used by the strategy.
|
|
6
|
+
*/
|
|
7
|
+
import { suffixResolve } from './utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a Ruby require/require_relative path to a matching .rb file (low-level helper).
|
|
10
|
+
*
|
|
11
|
+
* require_relative paths are pre-normalized to './' prefix by the caller.
|
|
12
|
+
* require paths use suffix matching (gem-style paths like 'json', 'net/http').
|
|
13
|
+
*/
|
|
14
|
+
export function resolveRubyImportInternal(importPath, normalizedFileList, allFileList, index) {
|
|
15
|
+
const pathParts = importPath.replace(/^\.\//, '').split('/').filter(Boolean);
|
|
16
|
+
return suffixResolve(pathParts, normalizedFileList, allFileList, index);
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust module import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Strategy lives in configs/rust.ts.
|
|
5
|
+
* This file contains shared helpers used by the strategy and standard.ts.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Resolve Rust use-path to a file (low-level helper).
|
|
9
|
+
* Handles crate::, super::, self:: prefixes and :: path separators.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveRustImportInternal(currentFile: string, importPath: string, allFiles: Set<string>): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Try to resolve a Rust module path to a file.
|
|
14
|
+
* Tries: path.rs, path/mod.rs, and with the last segment stripped
|
|
15
|
+
* (last segment might be a symbol name, not a module).
|
|
16
|
+
*/
|
|
17
|
+
export declare function tryRustModulePath(modulePath: string, allFiles: Set<string>): string | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust module import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Strategy lives in configs/rust.ts.
|
|
5
|
+
* This file contains shared helpers used by the strategy and standard.ts.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Resolve Rust use-path to a file (low-level helper).
|
|
9
|
+
* Handles crate::, super::, self:: prefixes and :: path separators.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveRustImportInternal(currentFile, importPath, allFiles) {
|
|
12
|
+
let rustPath;
|
|
13
|
+
if (importPath.startsWith('crate::')) {
|
|
14
|
+
// crate:: resolves from src/ directory (standard Rust layout)
|
|
15
|
+
rustPath = importPath.slice(7).replace(/::/g, '/');
|
|
16
|
+
// Try from src/ (standard layout)
|
|
17
|
+
const fromSrc = tryRustModulePath('src/' + rustPath, allFiles);
|
|
18
|
+
if (fromSrc)
|
|
19
|
+
return fromSrc;
|
|
20
|
+
// Try from repo root (non-standard)
|
|
21
|
+
const fromRoot = tryRustModulePath(rustPath, allFiles);
|
|
22
|
+
if (fromRoot)
|
|
23
|
+
return fromRoot;
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (importPath.startsWith('super::')) {
|
|
27
|
+
// super:: = parent directory of current file's module
|
|
28
|
+
const currentDir = currentFile.split('/').slice(0, -1);
|
|
29
|
+
currentDir.pop(); // Go up one level for super::
|
|
30
|
+
rustPath = importPath.slice(7).replace(/::/g, '/');
|
|
31
|
+
const fullPath = [...currentDir, rustPath].join('/');
|
|
32
|
+
return tryRustModulePath(fullPath, allFiles);
|
|
33
|
+
}
|
|
34
|
+
if (importPath.startsWith('self::')) {
|
|
35
|
+
// self:: = current module's directory
|
|
36
|
+
const currentDir = currentFile.split('/').slice(0, -1);
|
|
37
|
+
rustPath = importPath.slice(6).replace(/::/g, '/');
|
|
38
|
+
const fullPath = [...currentDir, rustPath].join('/');
|
|
39
|
+
return tryRustModulePath(fullPath, allFiles);
|
|
40
|
+
}
|
|
41
|
+
// Bare path without prefix (e.g., from a use in a nested module)
|
|
42
|
+
// Convert :: to / and try suffix matching
|
|
43
|
+
if (importPath.includes('::')) {
|
|
44
|
+
rustPath = importPath.replace(/::/g, '/');
|
|
45
|
+
return tryRustModulePath(rustPath, allFiles);
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Try to resolve a Rust module path to a file.
|
|
51
|
+
* Tries: path.rs, path/mod.rs, and with the last segment stripped
|
|
52
|
+
* (last segment might be a symbol name, not a module).
|
|
53
|
+
*/
|
|
54
|
+
export function tryRustModulePath(modulePath, allFiles) {
|
|
55
|
+
// Try direct: path.rs
|
|
56
|
+
if (allFiles.has(modulePath + '.rs'))
|
|
57
|
+
return modulePath + '.rs';
|
|
58
|
+
// Try directory: path/mod.rs
|
|
59
|
+
if (allFiles.has(modulePath + '/mod.rs'))
|
|
60
|
+
return modulePath + '/mod.rs';
|
|
61
|
+
// Try path/lib.rs (for crate root)
|
|
62
|
+
if (allFiles.has(modulePath + '/lib.rs'))
|
|
63
|
+
return modulePath + '/lib.rs';
|
|
64
|
+
// The last segment might be a symbol (function, struct, etc.), not a module.
|
|
65
|
+
// Strip it and try again.
|
|
66
|
+
const lastSlash = modulePath.lastIndexOf('/');
|
|
67
|
+
if (lastSlash > 0) {
|
|
68
|
+
const parentPath = modulePath.substring(0, lastSlash);
|
|
69
|
+
if (allFiles.has(parentPath + '.rs'))
|
|
70
|
+
return parentPath + '.rs';
|
|
71
|
+
if (allFiles.has(parentPath + '/mod.rs'))
|
|
72
|
+
return parentPath + '/mod.rs';
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard import path resolution.
|
|
3
|
+
* Handles relative imports, path alias rewriting, and generic suffix matching.
|
|
4
|
+
* Used as the fallback when language-specific resolvers don't match.
|
|
5
|
+
*/
|
|
6
|
+
import type { SuffixIndex } from './utils.js';
|
|
7
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
8
|
+
import type { ImportResult, ImportResolverStrategy, ResolveCtx } from './types.js';
|
|
9
|
+
import type { TsconfigPaths } from '../language-config.js';
|
|
10
|
+
/** Max entries in the resolve cache. Beyond this, entries are evicted.
|
|
11
|
+
* 100K entries ≈ 15MB — covers the most common import patterns. */
|
|
12
|
+
export declare const RESOLVE_CACHE_CAP = 100000;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve an import path to a file path in the repository.
|
|
15
|
+
*
|
|
16
|
+
* Language-specific preprocessing is applied before the generic resolution:
|
|
17
|
+
* - TypeScript/JavaScript: rewrites tsconfig path aliases
|
|
18
|
+
* - Rust: converts crate::/super::/self:: to relative paths
|
|
19
|
+
*
|
|
20
|
+
* Java wildcards and Go package imports are handled separately in processImports
|
|
21
|
+
* because they resolve to multiple files.
|
|
22
|
+
*/
|
|
23
|
+
export declare const resolveImportPath: (currentFile: string, importPath: string, allFiles: Set<string>, allFileList: string[], normalizedFileList: string[], resolveCache: Map<string, string | null>, language: SupportedLanguages, tsconfigPaths: TsconfigPaths | null, index?: SuffixIndex) => string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Standard single-file resolution (TS/JS/C/C++ and fallback for other languages).
|
|
26
|
+
* Handles relative imports, tsconfig path aliases, and suffix matching.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveStandard(rawImportPath: string, filePath: string, ctx: ResolveCtx, language: SupportedLanguages): ImportResult;
|
|
29
|
+
/** Create a reusable standard-resolution strategy for a given language. */
|
|
30
|
+
export declare function createStandardStrategy(language: SupportedLanguages): ImportResolverStrategy;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard import path resolution.
|
|
3
|
+
* Handles relative imports, path alias rewriting, and generic suffix matching.
|
|
4
|
+
* Used as the fallback when language-specific resolvers don't match.
|
|
5
|
+
*/
|
|
6
|
+
import { tryResolveWithExtensions, suffixResolve } from './utils.js';
|
|
7
|
+
import { resolveRustImportInternal } from './rust.js';
|
|
8
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
9
|
+
/** Max entries in the resolve cache. Beyond this, entries are evicted.
|
|
10
|
+
* 100K entries ≈ 15MB — covers the most common import patterns. */
|
|
11
|
+
export const RESOLVE_CACHE_CAP = 100_000;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve an import path to a file path in the repository.
|
|
14
|
+
*
|
|
15
|
+
* Language-specific preprocessing is applied before the generic resolution:
|
|
16
|
+
* - TypeScript/JavaScript: rewrites tsconfig path aliases
|
|
17
|
+
* - Rust: converts crate::/super::/self:: to relative paths
|
|
18
|
+
*
|
|
19
|
+
* Java wildcards and Go package imports are handled separately in processImports
|
|
20
|
+
* because they resolve to multiple files.
|
|
21
|
+
*/
|
|
22
|
+
export const resolveImportPath = (currentFile, importPath, allFiles, allFileList, normalizedFileList, resolveCache, language, tsconfigPaths, index) => {
|
|
23
|
+
const cacheKey = `${currentFile}::${importPath}`;
|
|
24
|
+
if (resolveCache.has(cacheKey))
|
|
25
|
+
return resolveCache.get(cacheKey) ?? null;
|
|
26
|
+
const cache = (result) => {
|
|
27
|
+
// Evict oldest 20% when cap is reached instead of clearing all
|
|
28
|
+
if (resolveCache.size >= RESOLVE_CACHE_CAP) {
|
|
29
|
+
const evictCount = Math.floor(RESOLVE_CACHE_CAP * 0.2);
|
|
30
|
+
const iter = resolveCache.keys();
|
|
31
|
+
for (let i = 0; i < evictCount; i++) {
|
|
32
|
+
const key = iter.next().value;
|
|
33
|
+
if (key !== undefined)
|
|
34
|
+
resolveCache.delete(key);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
resolveCache.set(cacheKey, result);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
// ---- TypeScript/JavaScript: rewrite path aliases ----
|
|
41
|
+
if ((language === SupportedLanguages.TypeScript || language === SupportedLanguages.JavaScript) &&
|
|
42
|
+
tsconfigPaths &&
|
|
43
|
+
!importPath.startsWith('.')) {
|
|
44
|
+
for (const [aliasPrefix, targetPrefix] of tsconfigPaths.aliases) {
|
|
45
|
+
if (importPath.startsWith(aliasPrefix)) {
|
|
46
|
+
const remainder = importPath.slice(aliasPrefix.length);
|
|
47
|
+
// Build the rewritten path relative to baseUrl
|
|
48
|
+
const rewritten = tsconfigPaths.baseUrl === '.'
|
|
49
|
+
? targetPrefix + remainder
|
|
50
|
+
: tsconfigPaths.baseUrl + '/' + targetPrefix + remainder;
|
|
51
|
+
// Try direct resolution from repo root
|
|
52
|
+
const resolved = tryResolveWithExtensions(rewritten, allFiles);
|
|
53
|
+
if (resolved)
|
|
54
|
+
return cache(resolved);
|
|
55
|
+
// Try suffix matching as fallback
|
|
56
|
+
const parts = rewritten.split('/').filter(Boolean);
|
|
57
|
+
const suffixResult = suffixResolve(parts, normalizedFileList, allFileList, index);
|
|
58
|
+
if (suffixResult)
|
|
59
|
+
return cache(suffixResult);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// ---- Rust: convert module path syntax to file paths ----
|
|
64
|
+
if (language === SupportedLanguages.Rust) {
|
|
65
|
+
// Handle grouped imports: use crate::module::{Foo, Bar, Baz}
|
|
66
|
+
// Extract the prefix path before ::{...} and resolve the module, not the symbols
|
|
67
|
+
let rustImportPath = importPath;
|
|
68
|
+
const braceIdx = importPath.indexOf('::{');
|
|
69
|
+
if (braceIdx !== -1) {
|
|
70
|
+
rustImportPath = importPath.substring(0, braceIdx);
|
|
71
|
+
}
|
|
72
|
+
else if (importPath.startsWith('{') && importPath.endsWith('}')) {
|
|
73
|
+
// Top-level grouped imports: use {crate::a, crate::b}
|
|
74
|
+
// Iterate each part and return the first that resolves. This function returns a single
|
|
75
|
+
// string, so callers that need ALL edges must intercept before reaching here (see the
|
|
76
|
+
// Rust grouped-import blocks in processImports / processImportsBatch). This fallback
|
|
77
|
+
// handles any path that reaches resolveImportPath directly.
|
|
78
|
+
const inner = importPath.slice(1, -1);
|
|
79
|
+
const parts = inner
|
|
80
|
+
.split(',')
|
|
81
|
+
.map((p) => p.trim())
|
|
82
|
+
.filter(Boolean);
|
|
83
|
+
for (const part of parts) {
|
|
84
|
+
const partResult = resolveRustImportInternal(currentFile, part, allFiles);
|
|
85
|
+
if (partResult)
|
|
86
|
+
return cache(partResult);
|
|
87
|
+
}
|
|
88
|
+
return cache(null);
|
|
89
|
+
}
|
|
90
|
+
const rustResult = resolveRustImportInternal(currentFile, rustImportPath, allFiles);
|
|
91
|
+
if (rustResult)
|
|
92
|
+
return cache(rustResult);
|
|
93
|
+
// Fall through to generic resolution if Rust-specific didn't match
|
|
94
|
+
}
|
|
95
|
+
// ---- Generic relative import resolution (./ and ../) ----
|
|
96
|
+
const currentDir = currentFile.split('/').slice(0, -1);
|
|
97
|
+
const parts = importPath.split('/');
|
|
98
|
+
for (const part of parts) {
|
|
99
|
+
if (part === '.')
|
|
100
|
+
continue;
|
|
101
|
+
if (part === '..') {
|
|
102
|
+
currentDir.pop();
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
currentDir.push(part);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const basePath = currentDir.join('/');
|
|
109
|
+
if (importPath.startsWith('.')) {
|
|
110
|
+
const resolved = tryResolveWithExtensions(basePath, allFiles);
|
|
111
|
+
return cache(resolved);
|
|
112
|
+
}
|
|
113
|
+
// ---- Generic package/absolute import resolution (suffix matching) ----
|
|
114
|
+
// Java wildcards are handled in processImports, not here
|
|
115
|
+
if (importPath.endsWith('.*')) {
|
|
116
|
+
return cache(null);
|
|
117
|
+
}
|
|
118
|
+
// C/C++ includes use actual file paths (e.g. "animal.h") — don't convert dots to slashes
|
|
119
|
+
const isCpp = language === SupportedLanguages.C || language === SupportedLanguages.CPlusPlus;
|
|
120
|
+
const pathLike = importPath.includes('/') || isCpp ? importPath : importPath.replace(/\./g, '/');
|
|
121
|
+
const pathParts = pathLike.split('/').filter(Boolean);
|
|
122
|
+
const resolved = suffixResolve(pathParts, normalizedFileList, allFileList, index);
|
|
123
|
+
return cache(resolved);
|
|
124
|
+
};
|
|
125
|
+
// ============================================================================
|
|
126
|
+
// Per-language dispatch functions (moved from import-resolution.ts)
|
|
127
|
+
// ============================================================================
|
|
128
|
+
/**
|
|
129
|
+
* Standard single-file resolution (TS/JS/C/C++ and fallback for other languages).
|
|
130
|
+
* Handles relative imports, tsconfig path aliases, and suffix matching.
|
|
131
|
+
*/
|
|
132
|
+
export function resolveStandard(rawImportPath, filePath, ctx, language) {
|
|
133
|
+
const resolvedPath = resolveImportPath(filePath, rawImportPath, ctx.allFilePaths, ctx.allFileList, ctx.normalizedFileList, ctx.resolveCache, language, ctx.configs.tsconfigPaths, ctx.index);
|
|
134
|
+
return resolvedPath ? { kind: 'files', files: [resolvedPath] } : null;
|
|
135
|
+
}
|
|
136
|
+
// ============================================================================
|
|
137
|
+
// Strategy factory — composable hook for ImportResolutionConfig
|
|
138
|
+
// ============================================================================
|
|
139
|
+
/** Create a reusable standard-resolution strategy for a given language. */
|
|
140
|
+
export function createStandardStrategy(language) {
|
|
141
|
+
return (raw, fp, ctx) => resolveStandard(raw, fp, ctx, language);
|
|
142
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import resolution types — shared across all per-language resolvers.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from import-resolution.ts to co-locate types with their consumers.
|
|
5
|
+
*/
|
|
6
|
+
import type { TsconfigPaths, GoModuleConfig, CSharpProjectConfig, ComposerConfig } from '../language-config.js';
|
|
7
|
+
import type { SwiftPackageConfig } from '../language-config.js';
|
|
8
|
+
import type { SuffixIndex } from './utils.js';
|
|
9
|
+
import type { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Result of resolving an import via language-specific dispatch.
|
|
12
|
+
* - 'files': resolved to one or more files -> add to ImportMap
|
|
13
|
+
* - 'package': resolved to a directory -> add graph edges + store dirSuffix in PackageMap
|
|
14
|
+
* - null: no resolution (external dependency, etc.)
|
|
15
|
+
*/
|
|
16
|
+
export type ImportResult = {
|
|
17
|
+
kind: 'files';
|
|
18
|
+
files: string[];
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'package';
|
|
21
|
+
files: string[];
|
|
22
|
+
dirSuffix: string;
|
|
23
|
+
} | null;
|
|
24
|
+
/** Bundled language-specific configs loaded once per ingestion run. */
|
|
25
|
+
export interface ImportConfigs {
|
|
26
|
+
tsconfigPaths: TsconfigPaths | null;
|
|
27
|
+
goModule: GoModuleConfig | null;
|
|
28
|
+
composerConfig: ComposerConfig | null;
|
|
29
|
+
swiftPackageConfig: SwiftPackageConfig | null;
|
|
30
|
+
csharpConfigs: CSharpProjectConfig[];
|
|
31
|
+
}
|
|
32
|
+
/** Pre-built lookup structures for import resolution. Build once, reuse across chunks. */
|
|
33
|
+
export interface ImportResolutionContext {
|
|
34
|
+
allFilePaths: Set<string>;
|
|
35
|
+
allFileList: string[];
|
|
36
|
+
normalizedFileList: string[];
|
|
37
|
+
index: SuffixIndex;
|
|
38
|
+
resolveCache: Map<string, string | null>;
|
|
39
|
+
}
|
|
40
|
+
/** Full context for import resolution: file lookups + language configs. */
|
|
41
|
+
export interface ResolveCtx extends ImportResolutionContext {
|
|
42
|
+
configs: ImportConfigs;
|
|
43
|
+
}
|
|
44
|
+
/** Per-language import resolver -- function alias matching ExportChecker/CallRouter pattern. */
|
|
45
|
+
export type ImportResolverFn = (rawImportPath: string, filePath: string, resolveCtx: ResolveCtx) => ImportResult;
|
|
46
|
+
/**
|
|
47
|
+
* A single import resolution strategy — one step in a composable chain.
|
|
48
|
+
* Same signature as ImportResolverFn. Returns null to let the next strategy
|
|
49
|
+
* in the chain try; returns a result (even with empty files) to stop the chain.
|
|
50
|
+
*/
|
|
51
|
+
export type ImportResolverStrategy = ImportResolverFn;
|
|
52
|
+
/**
|
|
53
|
+
* Declarative config for composable import resolution — mirrors the
|
|
54
|
+
* MethodExtractionConfig / CallExtractionConfig pattern.
|
|
55
|
+
*
|
|
56
|
+
* Each language declares an ordered list of strategies to try.
|
|
57
|
+
* The factory (`createImportResolver`) chains them: first non-null result wins.
|
|
58
|
+
*/
|
|
59
|
+
export interface ImportResolutionConfig {
|
|
60
|
+
/**
|
|
61
|
+
* Documentation-only metadata identifying which language this config serves.
|
|
62
|
+
* **Not used by `createImportResolver`** — the factory only iterates `strategies`.
|
|
63
|
+
* Useful for logging, debugging, and compile-time exhaustiveness checks when
|
|
64
|
+
* mapping `SupportedLanguages → ImportResolutionConfig` in language providers.
|
|
65
|
+
*/
|
|
66
|
+
readonly language: SupportedLanguages;
|
|
67
|
+
readonly strategies: readonly ImportResolverStrategy[];
|
|
68
|
+
}
|