gitnexus 1.6.6-rc.99 → 1.6.6
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 +122 -68
- package/dist/_shared/graph/types.d.ts +17 -1
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +3 -5
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +2 -4
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.js +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -1
- package/dist/_shared/scope-resolution/parsed-file.d.ts +24 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +13 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.d.ts +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.js +6 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.js +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts +29 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +9 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +1 -1
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +35 -1
- package/dist/cli/ai-context.js +111 -12
- package/dist/cli/analyze-config.d.ts +92 -0
- package/dist/cli/analyze-config.js +364 -0
- package/dist/cli/analyze.d.ts +17 -1
- package/dist/cli/analyze.js +224 -71
- package/dist/cli/cli-message.d.ts +1 -1
- package/dist/cli/doctor.d.ts +18 -0
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/i18n/en.d.ts +2 -2
- package/dist/cli/i18n/en.js +2 -2
- package/dist/cli/i18n/resources.d.ts +2 -2
- package/dist/cli/i18n/zh-CN.js +2 -2
- package/dist/cli/index.js +4 -2
- package/dist/cli/resolve-invocation.d.ts +21 -0
- package/dist/cli/resolve-invocation.js +68 -0
- package/dist/cli/setup.d.ts +33 -0
- package/dist/cli/setup.js +96 -35
- package/dist/cli/skill-gen.js +2 -2
- package/dist/cli/wiki.js +20 -4
- package/dist/core/embeddings/embedder.d.ts +1 -1
- package/dist/core/embeddings/embedder.js +14 -1
- package/dist/core/embeddings/runtime-support.d.ts +41 -0
- package/dist/core/embeddings/runtime-support.js +65 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +2 -1
- package/dist/core/group/extractors/http-patterns/java.js +15 -1
- package/dist/core/ingestion/call-processor.d.ts +57 -227
- package/dist/core/ingestion/call-processor.js +172 -2595
- package/dist/core/ingestion/call-routing.d.ts +6 -5
- package/dist/core/ingestion/call-routing.js +6 -6
- package/dist/core/ingestion/call-types.d.ts +0 -75
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +26 -1
- package/dist/core/ingestion/class-extractors/configs/ruby.js +3 -0
- package/dist/core/ingestion/class-extractors/generic.js +9 -11
- package/dist/core/ingestion/class-types.d.ts +23 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +11 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +227 -73
- package/dist/core/ingestion/cobol-processor.d.ts +1 -0
- package/dist/core/ingestion/cobol-processor.js +51 -2
- package/dist/core/ingestion/emit-references.js +8 -2
- package/dist/core/ingestion/export-detection.d.ts +2 -1
- package/dist/core/ingestion/export-detection.js +2 -6
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +0 -6
- package/dist/core/ingestion/field-extractors/configs/dart.js +62 -44
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +0 -9
- package/dist/core/ingestion/field-extractors/configs/go.js +40 -1
- package/dist/core/ingestion/field-extractors/configs/jvm.js +43 -4
- package/dist/core/ingestion/field-extractors/configs/php.js +1 -2
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +12 -1
- package/dist/core/ingestion/field-extractors/configs/swift.js +31 -6
- package/dist/core/ingestion/field-extractors/generic.d.ts +6 -0
- package/dist/core/ingestion/field-extractors/generic.js +5 -4
- package/dist/core/ingestion/field-extractors/typescript.js +0 -29
- package/dist/core/ingestion/filesystem-walker.d.ts +0 -9
- package/dist/core/ingestion/filesystem-walker.js +0 -11
- package/dist/core/ingestion/finalize-orchestrator.js +14 -2
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +21 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +72 -11
- package/dist/core/ingestion/import-resolvers/python.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.d.ts +2 -2
- package/dist/core/ingestion/import-resolvers/standard.js +6 -5
- package/dist/core/ingestion/import-resolvers/utils.d.ts +2 -5
- package/dist/core/ingestion/import-resolvers/utils.js +1 -9
- package/dist/core/ingestion/language-provider.d.ts +39 -119
- package/dist/core/ingestion/language-provider.js +0 -2
- package/dist/core/ingestion/languages/c/capture-side-channel.d.ts +62 -0
- package/dist/core/ingestion/languages/c/capture-side-channel.js +65 -0
- package/dist/core/ingestion/languages/c/captures.js +41 -23
- package/dist/core/ingestion/languages/c/import-decomposer.d.ts +9 -0
- package/dist/core/ingestion/languages/c/import-decomposer.js +15 -0
- package/dist/core/ingestion/languages/c/import-target.js +52 -9
- package/dist/core/ingestion/languages/c/index.d.ts +2 -1
- package/dist/core/ingestion/languages/c/index.js +2 -1
- package/dist/core/ingestion/languages/c/query.js +15 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +47 -4
- package/dist/core/ingestion/languages/c/static-linkage.d.ts +8 -0
- package/dist/core/ingestion/languages/c/static-linkage.js +46 -1
- package/dist/core/ingestion/languages/c-cpp.js +16 -7
- package/dist/core/ingestion/languages/cobol/captures.js +25 -2
- package/dist/core/ingestion/languages/cpp/adl.d.ts +88 -4
- package/dist/core/ingestion/languages/cpp/adl.js +380 -160
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +2 -8
- package/dist/core/ingestion/languages/cpp/capture-side-channel.d.ts +65 -0
- package/dist/core/ingestion/languages/cpp/capture-side-channel.js +78 -0
- package/dist/core/ingestion/languages/cpp/captures.js +162 -54
- package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +18 -52
- package/dist/core/ingestion/languages/cpp/file-local-linkage.js +49 -1
- package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +7 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.js +12 -0
- package/dist/core/ingestion/languages/cpp/index.d.ts +1 -0
- package/dist/core/ingestion/languages/cpp/index.js +1 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +8 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +21 -0
- package/dist/core/ingestion/languages/cpp/query.js +21 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.js +20 -5
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +52 -5
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +20 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +83 -3
- package/dist/core/ingestion/languages/csharp/captures.js +205 -41
- package/dist/core/ingestion/languages/csharp/index.d.ts +3 -4
- package/dist/core/ingestion/languages/csharp/index.js +3 -4
- package/dist/core/ingestion/languages/csharp/interpret.js +17 -3
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +17 -7
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +129 -124
- package/dist/core/ingestion/languages/csharp/qualified-type-names.d.ts +14 -0
- package/dist/core/ingestion/languages/csharp/qualified-type-names.js +59 -0
- package/dist/core/ingestion/languages/csharp/query.js +13 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +10 -6
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -1
- package/dist/core/ingestion/languages/csharp.js +0 -5
- package/dist/core/ingestion/languages/dart/arity-metadata.d.ts +25 -0
- package/dist/core/ingestion/languages/dart/arity-metadata.js +35 -0
- package/dist/core/ingestion/languages/dart/arity.d.ts +19 -0
- package/dist/core/ingestion/languages/dart/arity.js +31 -0
- package/dist/core/ingestion/languages/dart/built-ins.d.ts +11 -0
- package/dist/core/ingestion/languages/dart/built-ins.js +34 -0
- package/dist/core/ingestion/languages/dart/cache-stats.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/cache-stats.js +24 -0
- package/dist/core/ingestion/languages/dart/captures.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/captures.js +445 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.js +31 -0
- package/dist/core/ingestion/languages/dart/import-target.d.ts +15 -0
- package/dist/core/ingestion/languages/dart/import-target.js +65 -0
- package/dist/core/ingestion/languages/dart/index.d.ts +28 -0
- package/dist/core/ingestion/languages/dart/index.js +28 -0
- package/dist/core/ingestion/languages/dart/interpret.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/interpret.js +95 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.d.ts +10 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.js +39 -0
- package/dist/core/ingestion/languages/dart/query.d.ts +26 -0
- package/dist/core/ingestion/languages/dart/query.js +142 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.js +87 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.js +194 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.d.ts +23 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.js +51 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.d.ts +20 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.js +47 -0
- package/dist/core/ingestion/languages/dart.d.ts +0 -1
- package/dist/core/ingestion/languages/dart.js +15 -29
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +1 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +31 -1
- package/dist/core/ingestion/languages/go/captures.js +162 -3
- package/dist/core/ingestion/languages/go/interface-impls.js +476 -50
- package/dist/core/ingestion/languages/go/interpret.js +21 -11
- package/dist/core/ingestion/languages/go/method-owners.js +20 -8
- package/dist/core/ingestion/languages/go/query.js +15 -7
- package/dist/core/ingestion/languages/go/range-binding.js +24 -9
- package/dist/core/ingestion/languages/go/receiver-binding.js +1 -1
- package/dist/core/ingestion/languages/go/scope-resolver.js +2 -2
- package/dist/core/ingestion/languages/go/simple-hooks.js +10 -5
- package/dist/core/ingestion/languages/go/type-binding.d.ts +1 -0
- package/dist/core/ingestion/languages/go/type-binding.js +40 -2
- package/dist/core/ingestion/languages/go.d.ts +0 -1
- package/dist/core/ingestion/languages/go.js +0 -5
- package/dist/core/ingestion/languages/index.d.ts +0 -5
- package/dist/core/ingestion/languages/index.js +0 -3
- package/dist/core/ingestion/languages/java/captures.js +252 -23
- package/dist/core/ingestion/languages/java/interpret.js +12 -6
- package/dist/core/ingestion/languages/java/package-siblings.js +18 -5
- package/dist/core/ingestion/languages/java/query.js +16 -1
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +2 -8
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -8
- package/dist/core/ingestion/languages/java.js +0 -5
- package/dist/core/ingestion/languages/javascript/captures.js +185 -11
- package/dist/core/ingestion/languages/javascript/query.js +107 -1
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +57 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +60 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +213 -22
- package/dist/core/ingestion/languages/kotlin/companion-scopes.d.ts +7 -0
- package/dist/core/ingestion/languages/kotlin/companion-scopes.js +10 -0
- package/dist/core/ingestion/languages/kotlin/index.d.ts +1 -0
- package/dist/core/ingestion/languages/kotlin/index.js +1 -0
- package/dist/core/ingestion/languages/kotlin/query.js +30 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.d.ts +5 -7
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +22 -7
- package/dist/core/ingestion/languages/kotlin.js +8 -5
- package/dist/core/ingestion/languages/php/captures.js +135 -19
- package/dist/core/ingestion/languages/php/import-decomposer.js +21 -63
- package/dist/core/ingestion/languages/php/index.d.ts +3 -4
- package/dist/core/ingestion/languages/php/index.js +3 -4
- package/dist/core/ingestion/languages/php/query.js +5 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +8 -4
- package/dist/core/ingestion/languages/php.js +0 -4
- package/dist/core/ingestion/languages/python/captures.js +128 -13
- package/dist/core/ingestion/languages/python/depends-references.js +1 -1
- package/dist/core/ingestion/languages/python/import-target.d.ts +4 -5
- package/dist/core/ingestion/languages/python/import-target.js +108 -16
- package/dist/core/ingestion/languages/python/index-stats.d.ts +18 -0
- package/dist/core/ingestion/languages/python/index-stats.js +25 -0
- package/dist/core/ingestion/languages/python/index.d.ts +3 -4
- package/dist/core/ingestion/languages/python/index.js +3 -4
- package/dist/core/ingestion/languages/python/query.js +17 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +7 -6
- package/dist/core/ingestion/languages/python.d.ts +0 -2
- package/dist/core/ingestion/languages/python.js +0 -7
- package/dist/core/ingestion/languages/ruby/captures.js +174 -31
- package/dist/core/ingestion/languages/ruby/import-target.js +2 -1
- package/dist/core/ingestion/languages/ruby/interpret.js +2 -1
- package/dist/core/ingestion/languages/ruby/query.js +10 -0
- package/dist/core/ingestion/languages/ruby/scope-resolver.js +61 -11
- package/dist/core/ingestion/languages/ruby.js +4 -53
- package/dist/core/ingestion/languages/rust/captures.js +95 -13
- package/dist/core/ingestion/languages/rust/query.js +64 -1
- package/dist/core/ingestion/languages/rust/range-binding.js +40 -12
- package/dist/core/ingestion/languages/rust/receiver-binding.js +9 -0
- package/dist/core/ingestion/languages/rust/scope-resolver.js +75 -1
- package/dist/core/ingestion/languages/rust.d.ts +0 -2
- package/dist/core/ingestion/languages/rust.js +0 -6
- package/dist/core/ingestion/languages/swift/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/arity-metadata.js +41 -0
- package/dist/core/ingestion/languages/swift/arity.d.ts +29 -0
- package/dist/core/ingestion/languages/swift/arity.js +42 -0
- package/dist/core/ingestion/languages/swift/base-type.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/base-type.js +27 -0
- package/dist/core/ingestion/languages/swift/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/swift/captures.d.ts +35 -0
- package/dist/core/ingestion/languages/swift/captures.js +495 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.js +57 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.js +84 -0
- package/dist/core/ingestion/languages/swift/import-target.d.ts +33 -0
- package/dist/core/ingestion/languages/swift/import-target.js +81 -0
- package/dist/core/ingestion/languages/swift/index.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/index.js +37 -0
- package/dist/core/ingestion/languages/swift/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/interpret.js +89 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.js +48 -0
- package/dist/core/ingestion/languages/swift/query.d.ts +46 -0
- package/dist/core/ingestion/languages/swift/query.js +194 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.d.ts +40 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.js +161 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.js +189 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.js +65 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.d.ts +25 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.js +66 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.js +60 -0
- package/dist/core/ingestion/languages/swift/target-grouping.d.ts +51 -0
- package/dist/core/ingestion/languages/swift/target-grouping.js +93 -0
- package/dist/core/ingestion/languages/swift/target-siblings.d.ts +30 -0
- package/dist/core/ingestion/languages/swift/target-siblings.js +71 -0
- package/dist/core/ingestion/languages/swift.d.ts +0 -5
- package/dist/core/ingestion/languages/swift.js +11 -87
- package/dist/core/ingestion/languages/typescript/array-callback.d.ts +3 -29
- package/dist/core/ingestion/languages/typescript/array-callback.js +4 -43
- package/dist/core/ingestion/languages/typescript/captures.js +147 -17
- package/dist/core/ingestion/languages/typescript/index.d.ts +3 -4
- package/dist/core/ingestion/languages/typescript/index.js +3 -4
- package/dist/core/ingestion/languages/typescript/query.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript/query.js +125 -4
- package/dist/core/ingestion/languages/typescript/receiver-binding.js +0 -1
- package/dist/core/ingestion/languages/typescript.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript.js +46 -23
- package/dist/core/ingestion/languages/vue/captures.d.ts +46 -0
- package/dist/core/ingestion/languages/vue/captures.js +67 -0
- package/dist/core/ingestion/languages/vue/import-target.d.ts +27 -0
- package/dist/core/ingestion/languages/vue/import-target.js +58 -0
- package/dist/core/ingestion/languages/vue/index.d.ts +49 -0
- package/dist/core/ingestion/languages/vue/index.js +49 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.d.ts +55 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.js +292 -0
- package/dist/core/ingestion/languages/vue.js +12 -4
- package/dist/core/ingestion/local-symbol-pruner.d.ts +11 -0
- package/dist/core/ingestion/local-symbol-pruner.js +63 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +14 -1
- package/dist/core/ingestion/method-extractors/configs/jvm.js +37 -20
- package/dist/core/ingestion/method-extractors/configs/php.js +0 -1
- package/dist/core/ingestion/method-extractors/configs/swift.js +11 -4
- package/dist/core/ingestion/method-types.d.ts +2 -2
- package/dist/core/ingestion/model/index.d.ts +0 -3
- package/dist/core/ingestion/model/index.js +0 -8
- package/dist/core/ingestion/model/resolve.d.ts +7 -43
- package/dist/core/ingestion/model/resolve.js +7 -226
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +46 -1
- package/dist/core/ingestion/model/semantic-model.d.ts +4 -6
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +3 -4
- package/dist/core/ingestion/model/symbol-table.js +3 -4
- package/dist/core/ingestion/parsing-processor.d.ts +30 -24
- package/dist/core/ingestion/parsing-processor.js +76 -640
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/communities.js +5 -2
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +9 -8
- package/dist/core/ingestion/pipeline-phases/cross-file.js +16 -12
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/mro.js +2 -2
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +44 -22
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +426 -565
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +13 -33
- package/dist/core/ingestion/pipeline-phases/parse.js +2 -2
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +5 -3
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.d.ts +14 -0
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.js +26 -0
- package/dist/core/ingestion/pipeline.d.ts +27 -19
- package/dist/core/ingestion/pipeline.js +4 -2
- package/dist/core/ingestion/resolve-references.js +15 -3
- package/dist/core/ingestion/route-extractors/laravel.d.ts +10 -0
- package/dist/core/ingestion/route-extractors/laravel.js +88 -9
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +2 -1
- package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
- package/dist/core/ingestion/scope-extractor.js +13 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +181 -15
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +21 -10
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +10 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +7 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +58 -6
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +24 -5
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +68 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +189 -29
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +21 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1 -1
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +8 -11
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +171 -50
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +3 -4
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +9 -4
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +28 -5
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +191 -24
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +31 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +72 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +440 -39
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +18 -2
- package/dist/core/ingestion/scope-resolution/workspace-index.js +94 -7
- package/dist/core/ingestion/tree-sitter-queries.d.ts +14 -14
- package/dist/core/ingestion/tree-sitter-queries.js +380 -158
- package/dist/core/ingestion/ts-js-hoc-utils.d.ts +12 -0
- package/dist/core/ingestion/ts-js-hoc-utils.js +105 -0
- package/dist/core/ingestion/type-env.d.ts +2 -1
- package/dist/core/ingestion/type-env.js +6 -8
- package/dist/core/ingestion/type-extractors/c-cpp.js +8 -10
- package/dist/core/ingestion/type-extractors/csharp.js +18 -34
- package/dist/core/ingestion/type-extractors/go.js +2 -10
- package/dist/core/ingestion/type-extractors/jvm.js +6 -5
- package/dist/core/ingestion/type-extractors/php.js +1 -1
- package/dist/core/ingestion/type-extractors/python.js +1 -1
- package/dist/core/ingestion/type-extractors/ruby.js +2 -2
- package/dist/core/ingestion/type-extractors/rust.js +0 -16
- package/dist/core/ingestion/type-extractors/shared.d.ts +2 -2
- package/dist/core/ingestion/type-extractors/shared.js +25 -11
- package/dist/core/ingestion/type-extractors/swift.js +5 -5
- package/dist/core/ingestion/type-extractors/types.d.ts +1 -1
- package/dist/core/ingestion/type-extractors/typescript.js +1 -1
- package/dist/core/ingestion/utils/ast-helpers.d.ts +119 -1
- package/dist/core/ingestion/utils/ast-helpers.js +260 -13
- package/dist/core/ingestion/utils/callable-labels.d.ts +13 -0
- package/dist/core/ingestion/utils/callable-labels.js +14 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.d.ts +10 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.js +30 -0
- package/dist/core/ingestion/utils/heap-probe.d.ts +20 -0
- package/dist/core/ingestion/utils/heap-probe.js +39 -0
- package/dist/core/ingestion/utils/heritage-marker.d.ts +33 -0
- package/dist/core/ingestion/utils/heritage-marker.js +41 -0
- package/dist/core/ingestion/utils/qualified-name.d.ts +37 -0
- package/dist/core/ingestion/utils/qualified-name.js +67 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +49 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +76 -62
- package/dist/core/ingestion/variable-extractors/configs/go.js +74 -7
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +35 -8
- package/dist/core/ingestion/variable-extractors/generic.js +40 -12
- package/dist/core/ingestion/variable-types.d.ts +9 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +97 -7
- package/dist/core/ingestion/vue-sfc-extractor.js +433 -11
- package/dist/core/ingestion/workers/parse-worker.d.ts +0 -11
- package/dist/core/ingestion/workers/parse-worker.js +358 -187
- package/dist/core/ingestion/workers/worker-pool.d.ts +78 -9
- package/dist/core/ingestion/workers/worker-pool.js +346 -49
- package/dist/core/lbug/csv-generator.js +20 -2
- package/dist/core/lbug/lbug-adapter.js +29 -10
- package/dist/core/lbug/native-check.js +17 -5
- package/dist/core/lbug/pool-adapter.d.ts +0 -19
- package/dist/core/lbug/pool-adapter.js +40 -77
- package/dist/core/lbug/query-result-utils.d.ts +19 -0
- package/dist/core/lbug/query-result-utils.js +28 -0
- package/dist/core/run-analyze.d.ts +9 -2
- package/dist/core/run-analyze.js +24 -3
- package/dist/core/tree-sitter/parser-loader.d.ts +13 -0
- package/dist/core/tree-sitter/parser-loader.js +4 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +70 -3
- package/dist/core/tree-sitter/safe-parse.js +214 -11
- package/dist/core/wiki/generator.js +13 -5
- package/dist/core/wiki/graph-queries.d.ts +3 -0
- package/dist/core/wiki/graph-queries.js +9 -1
- package/dist/core/wiki/llm-client.d.ts +1 -1
- package/dist/core/wiki/llm-client.js +7 -2
- package/dist/core/wiki/local-cli-client.d.ts +2 -1
- package/dist/core/wiki/local-cli-client.js +62 -4
- package/dist/mcp/compatible-stdio-transport.d.ts +3 -0
- package/dist/mcp/compatible-stdio-transport.js +22 -0
- package/dist/mcp/core/embedder.d.ts +1 -1
- package/dist/mcp/core/embedder.js +13 -1
- package/dist/mcp/local/local-backend.d.ts +37 -5
- package/dist/mcp/local/local-backend.js +227 -129
- package/dist/mcp/resources.js +3 -3
- package/dist/mcp/server.js +9 -1
- package/dist/storage/git.d.ts +11 -0
- package/dist/storage/git.js +30 -0
- package/dist/storage/parse-cache.d.ts +23 -1
- package/dist/storage/parse-cache.js +138 -32
- package/dist/storage/parsedfile-store.d.ts +142 -0
- package/dist/storage/parsedfile-store.js +367 -0
- package/dist/storage/repo-manager.d.ts +2 -1
- package/dist/storage/scope-index-store.d.ts +114 -0
- package/dist/storage/scope-index-store.js +236 -0
- package/dist/types/pipeline.d.ts +6 -3
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +2 -1
- package/hooks/claude/gitnexus-hook.cjs +2 -1
- package/hooks/claude/resolve-analyze-cmd.cjs +323 -0
- package/package.json +4 -5
- package/scripts/bench-scope-resolution.ts +1 -3
- package/scripts/cross-platform-tests.ts +4 -1
- package/skills/gitnexus-cli.md +8 -6
- package/skills/gitnexus-debugging.md +15 -15
- package/skills/gitnexus-exploring.md +11 -11
- package/skills/gitnexus-guide.md +1 -1
- package/skills/gitnexus-impact-analysis.md +10 -10
- package/skills/gitnexus-pr-review.md +19 -19
- package/skills/gitnexus-refactoring.md +25 -25
- package/web/assets/{agent-BRX-afm3.js → agent-EkX7webX.js} +156 -131
- package/web/assets/{architectureDiagram-UL44E2DR-B1oYB8-c.js → architectureDiagram-UL44E2DR-BoczH8cv.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-SPC6pgWI.js → chunk-LCXTWHL2-By5HB3b-.js} +1 -1
- package/web/assets/{chunk-RG4AUYOV-DZXr4Yv3.js → chunk-RG4AUYOV-BQE_DkpL.js} +1 -1
- package/web/assets/{classDiagram-KGZ6W3CR-BqpOj8L9.js → classDiagram-KGZ6W3CR-Dj_02GUH.js} +1 -1
- package/web/assets/{classDiagram-v2-72OJOZXJ-FmElywK2.js → classDiagram-v2-72OJOZXJ-D-NArMpf.js} +1 -1
- package/web/assets/{diagram-3NCE3AQN-BWtJXMDq.js → diagram-3NCE3AQN-VXtXDO95.js} +1 -1
- package/web/assets/{diagram-GF46GFSD-Hh-fChxU.js → diagram-GF46GFSD-B1qab2Ah.js} +1 -1
- package/web/assets/{diagram-QXG6HAR7-DYeQHxGU.js → diagram-QXG6HAR7-BSCHGzzT.js} +1 -1
- package/web/assets/{diagram-WEQXMOUZ-DYGU4T0y.js → diagram-WEQXMOUZ-DHtknmNT.js} +1 -1
- package/web/assets/{erDiagram-L5TCEMPS-bN3wlP2A.js → erDiagram-L5TCEMPS-Db-IYTmm.js} +1 -1
- package/web/assets/{flowDiagram-H6V6AXG4-YACVtF3-.js → flowDiagram-H6V6AXG4-BHDoyVoW.js} +1 -1
- package/web/assets/{index-BhnAdWTt.js → index-BR0IhgbR.js} +10 -10
- package/web/assets/{infoDiagram-3YFTVSEB-BWBzD28-.js → infoDiagram-3YFTVSEB-6h8wbWEe.js} +1 -1
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-B8qYT-j9.js → ishikawaDiagram-BNXS4ZKH-Dx2OkPk1.js} +1 -1
- package/web/assets/{kanban-definition-75IXJCU3-BeoPr5Tl.js → kanban-definition-75IXJCU3-CIIEZfqV.js} +1 -1
- package/web/assets/{mindmap-definition-2TDM6QVE-CdLLN_so.js → mindmap-definition-2TDM6QVE-DUAqydRq.js} +1 -1
- package/web/assets/{pieDiagram-CU6KROY3-DEd2a_k_.js → pieDiagram-CU6KROY3-BntYuYZa.js} +1 -1
- package/web/assets/{requirementDiagram-JXO7QTGE-QNeTo5C_.js → requirementDiagram-JXO7QTGE-QCD6I29n.js} +1 -1
- package/web/assets/{sequenceDiagram-VS2MUI6T-BHC7q7yJ.js → sequenceDiagram-VS2MUI6T-DScFwLz2.js} +1 -1
- package/web/assets/{stateDiagram-7D4R322I-KONnc2Px.js → stateDiagram-7D4R322I-AkRAm6Hl.js} +1 -1
- package/web/assets/{stateDiagram-v2-36443NZ5-C2QfuMlu.js → stateDiagram-v2-36443NZ5-BCK1vigR.js} +1 -1
- package/web/assets/{timeline-definition-O6YCAMPW-D4t4NJx1.js → timeline-definition-O6YCAMPW-BvpIVXjX.js} +1 -1
- package/web/assets/{vennDiagram-MWXL3ELB-6bctC9Yg.js → vennDiagram-MWXL3ELB-BYGWk6dK.js} +1 -1
- package/web/assets/{wardleyDiagram-CUQ6CDDI-BPZYNTvC.js → wardleyDiagram-CUQ6CDDI-Dk1z7H2T.js} +1 -1
- package/web/assets/{xychartDiagram-N2JHSOCM-lBI9O6DW.js → xychartDiagram-N2JHSOCM-2N6NCSWN.js} +1 -1
- package/web/index.html +1 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +0 -63
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.js +0 -122
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +0 -59
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.js +0 -79
- package/dist/_shared/scope-resolution/shadow/diff.js.map +0 -1
- package/dist/core/ingestion/ast-cache.d.ts +0 -26
- package/dist/core/ingestion/ast-cache.js +0 -48
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +0 -13
- package/dist/core/ingestion/heritage-extractors/configs/go.js +0 -20
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +0 -18
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +0 -65
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +0 -23
- package/dist/core/ingestion/heritage-extractors/generic.js +0 -47
- package/dist/core/ingestion/heritage-processor.d.ts +0 -54
- package/dist/core/ingestion/heritage-processor.js +0 -367
- package/dist/core/ingestion/heritage-types.d.ts +0 -73
- package/dist/core/ingestion/heritage-types.js +0 -2
- package/dist/core/ingestion/import-processor.d.ts +0 -23
- package/dist/core/ingestion/import-processor.js +0 -377
- package/dist/core/ingestion/model/heritage-map.d.ts +0 -105
- package/dist/core/ingestion/model/heritage-map.js +0 -294
- package/dist/core/ingestion/model/resolution-context.d.ts +0 -93
- package/dist/core/ingestion/model/resolution-context.js +0 -337
- package/dist/core/ingestion/named-bindings/csharp.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/csharp.js +0 -37
- package/dist/core/ingestion/named-bindings/java.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/java.js +0 -29
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/kotlin.js +0 -36
- package/dist/core/ingestion/named-bindings/php.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/php.js +0 -61
- package/dist/core/ingestion/named-bindings/python.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/python.js +0 -49
- package/dist/core/ingestion/named-bindings/rust.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/rust.js +0 -66
- package/dist/core/ingestion/named-bindings/types.d.ts +0 -16
- package/dist/core/ingestion/named-bindings/types.js +0 -6
- package/dist/core/ingestion/named-bindings/typescript.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/typescript.js +0 -58
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +0 -17
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +0 -209
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +0 -22
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +0 -92
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +0 -70
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +0 -312
- package/dist/core/ingestion/registry-primary-flag.d.ts +0 -89
- package/dist/core/ingestion/registry-primary-flag.js +0 -122
- package/dist/core/ingestion/shadow-harness.d.ts +0 -113
- package/dist/core/ingestion/shadow-harness.js +0 -148
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +0 -52
- package/dist/core/ingestion/utils/ruby-self-call.js +0 -59
- package/scripts/ci-list-migrated-languages.ts +0 -24
- package/scripts/run-parity.ts +0 -128
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import Parser from 'tree-sitter';
|
|
2
|
-
import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/parser-loader.js';
|
|
3
|
-
import { getProvider, getProviderForFile, providersWithImplicitWiring } from './languages/index.js';
|
|
4
|
-
import { generateId } from '../../lib/utils.js';
|
|
5
|
-
import { getLanguageFromFilename } from '../../_shared/index.js';
|
|
6
|
-
import { isVerboseIngestionEnabled } from './utils/verbose.js';
|
|
7
|
-
import { yieldToEventLoop } from './utils/event-loop.js';
|
|
8
|
-
import { parseSourceSafe } from '../tree-sitter/safe-parse.js';
|
|
9
|
-
import { getTreeSitterBufferSize } from './constants.js';
|
|
10
|
-
import { loadImportConfigs } from './language-config.js';
|
|
11
|
-
import { buildSuffixIndex } from './import-resolvers/utils.js';
|
|
12
|
-
import { isDev } from './utils/env.js';
|
|
13
|
-
import { isRegistryPrimary } from './registry-primary-flag.js';
|
|
14
|
-
import { logger } from '../logger.js';
|
|
15
|
-
/** Group files by provider (only those with implicit import wiring), then call each wirer
|
|
16
|
-
* with its own language's files. O(n) over files, O(1) per provider lookup. */
|
|
17
|
-
function wireImplicitImports(files, importMap, addImportEdge, projectConfig) {
|
|
18
|
-
if (providersWithImplicitWiring.length === 0)
|
|
19
|
-
return;
|
|
20
|
-
const grouped = new Map();
|
|
21
|
-
for (const file of files) {
|
|
22
|
-
const provider = getProviderForFile(file);
|
|
23
|
-
if (!provider?.implicitImportWirer)
|
|
24
|
-
continue;
|
|
25
|
-
let list = grouped.get(provider);
|
|
26
|
-
if (!list) {
|
|
27
|
-
list = [];
|
|
28
|
-
grouped.set(provider, list);
|
|
29
|
-
}
|
|
30
|
-
list.push(file);
|
|
31
|
-
}
|
|
32
|
-
for (const [provider, langFiles] of grouped) {
|
|
33
|
-
if (langFiles.length > 1) {
|
|
34
|
-
provider.implicitImportWirer(langFiles, importMap, addImportEdge, projectConfig);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// ImportResolutionContext is defined in ./import-resolvers/types.ts — re-exported here for consumers.
|
|
39
|
-
export function buildImportResolutionContext(allPaths) {
|
|
40
|
-
const allFileList = allPaths;
|
|
41
|
-
const normalizedFileList = allFileList.map((p) => p.replace(/\\/g, '/'));
|
|
42
|
-
const allFilePaths = new Set(allFileList);
|
|
43
|
-
const index = buildSuffixIndex(normalizedFileList, allFileList);
|
|
44
|
-
return { allFilePaths, allFileList, normalizedFileList, index, resolveCache: new Map() };
|
|
45
|
-
}
|
|
46
|
-
// Config loaders extracted to ./language-config.ts (Phase 2 refactor)
|
|
47
|
-
// Resolver types are in ./import-resolvers/types.ts; named binding types in ./named-bindings/types.ts
|
|
48
|
-
// ============================================================================
|
|
49
|
-
// Import path preprocessing
|
|
50
|
-
// ============================================================================
|
|
51
|
-
/**
|
|
52
|
-
* Clean and preprocess a raw import source text into a resolved import path.
|
|
53
|
-
* Strips quotes/angle brackets (universal) and applies provider-specific
|
|
54
|
-
* transformations (currently only Kotlin wildcard import detection).
|
|
55
|
-
*/
|
|
56
|
-
export function preprocessImportPath(sourceText, importNode, provider) {
|
|
57
|
-
const cleaned = sourceText.replace(/['"<>]/g, '');
|
|
58
|
-
// Defense-in-depth: reject null bytes and control characters (matches Ruby call-routing pattern)
|
|
59
|
-
if (!cleaned || cleaned.length > 2048 || /[\x00-\x1f]/.test(cleaned))
|
|
60
|
-
return null;
|
|
61
|
-
if (provider.importPathPreprocessor) {
|
|
62
|
-
return provider.importPathPreprocessor(cleaned, importNode);
|
|
63
|
-
}
|
|
64
|
-
return cleaned;
|
|
65
|
-
}
|
|
66
|
-
/** Create IMPORTS edge helpers that share a resolved-count tracker. */
|
|
67
|
-
function createImportEdgeHelpers(graph, importMap) {
|
|
68
|
-
let totalImportsResolved = 0;
|
|
69
|
-
const addImportGraphEdge = (filePath, resolvedPath) => {
|
|
70
|
-
const language = getLanguageFromFilename(filePath);
|
|
71
|
-
if (language !== null && isRegistryPrimary(language))
|
|
72
|
-
return;
|
|
73
|
-
const sourceId = generateId('File', filePath);
|
|
74
|
-
const targetId = generateId('File', resolvedPath);
|
|
75
|
-
const relId = generateId('IMPORTS', `${filePath}->${resolvedPath}`);
|
|
76
|
-
totalImportsResolved++;
|
|
77
|
-
graph.addRelationship({
|
|
78
|
-
id: relId,
|
|
79
|
-
sourceId,
|
|
80
|
-
targetId,
|
|
81
|
-
type: 'IMPORTS',
|
|
82
|
-
confidence: 1.0,
|
|
83
|
-
reason: '',
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const addImportEdge = (filePath, resolvedPath) => {
|
|
87
|
-
addImportGraphEdge(filePath, resolvedPath);
|
|
88
|
-
if (!importMap.has(filePath))
|
|
89
|
-
importMap.set(filePath, new Set());
|
|
90
|
-
importMap.get(filePath).add(resolvedPath);
|
|
91
|
-
};
|
|
92
|
-
return { addImportEdge, addImportGraphEdge, getResolvedCount: () => totalImportsResolved };
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Apply an ImportResult: emit graph edges and update ImportMap/PackageMap.
|
|
96
|
-
* If namedBindings are provided and the import resolves to a single file,
|
|
97
|
-
* also populate the NamedImportMap for precise Tier 2a resolution.
|
|
98
|
-
* Bindings tagged with `isModuleAlias` are routed to moduleAliasMap instead.
|
|
99
|
-
*/
|
|
100
|
-
function applyImportResult(result, filePath, importMap, packageMap, addImportEdge, addImportGraphEdge, namedBindings, namedImportMap, moduleAliasMap) {
|
|
101
|
-
if (!result)
|
|
102
|
-
return;
|
|
103
|
-
if (result.kind === 'package' && packageMap) {
|
|
104
|
-
// Store directory suffix in PackageMap (skip ImportMap expansion)
|
|
105
|
-
for (const resolvedFile of result.files) {
|
|
106
|
-
addImportGraphEdge(filePath, resolvedFile);
|
|
107
|
-
}
|
|
108
|
-
if (!packageMap.has(filePath))
|
|
109
|
-
packageMap.set(filePath, new Set());
|
|
110
|
-
packageMap.get(filePath).add(result.dirSuffix);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// 'files' kind, or 'package' without PackageMap — use ImportMap directly
|
|
114
|
-
const files = result.files;
|
|
115
|
-
for (const resolvedFile of files) {
|
|
116
|
-
addImportEdge(filePath, resolvedFile);
|
|
117
|
-
}
|
|
118
|
-
// Route module aliases (import X as Y) directly to moduleAliasMap.
|
|
119
|
-
// These are module-level aliases, not symbol bindings — they don't belong in namedImportMap.
|
|
120
|
-
if (namedBindings && moduleAliasMap && files.length === 1) {
|
|
121
|
-
const resolvedFile = files[0];
|
|
122
|
-
for (const binding of namedBindings) {
|
|
123
|
-
if (!binding.isModuleAlias)
|
|
124
|
-
continue;
|
|
125
|
-
let aliasMap = moduleAliasMap.get(filePath);
|
|
126
|
-
if (!aliasMap) {
|
|
127
|
-
aliasMap = new Map();
|
|
128
|
-
moduleAliasMap.set(filePath, aliasMap);
|
|
129
|
-
}
|
|
130
|
-
aliasMap.set(binding.local, resolvedFile);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
// Record named bindings for precise Tier 2a resolution.
|
|
134
|
-
// If the same local name is imported from multiple files (e.g., Java static imports
|
|
135
|
-
// of overloaded methods), remove the entry so resolution falls through to Tier 2a
|
|
136
|
-
// import-scoped which sees all candidates and can apply arity narrowing.
|
|
137
|
-
if (namedBindings && namedImportMap) {
|
|
138
|
-
if (!namedImportMap.has(filePath))
|
|
139
|
-
namedImportMap.set(filePath, new Map());
|
|
140
|
-
const fileBindings = namedImportMap.get(filePath);
|
|
141
|
-
if (files.length === 1) {
|
|
142
|
-
const resolvedFile = files[0];
|
|
143
|
-
for (const binding of namedBindings) {
|
|
144
|
-
if (binding.isModuleAlias)
|
|
145
|
-
continue; // already routed to moduleAliasMap
|
|
146
|
-
const existing = fileBindings.get(binding.local);
|
|
147
|
-
if (existing && existing.sourcePath !== resolvedFile) {
|
|
148
|
-
fileBindings.delete(binding.local);
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
fileBindings.set(binding.local, {
|
|
152
|
-
sourcePath: resolvedFile,
|
|
153
|
-
exportedName: binding.exported,
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
// Multi-file resolution (e.g., Rust `use crate::models::{User, Repo}`).
|
|
160
|
-
// Match each binding to a resolved file by comparing the lowercase binding name
|
|
161
|
-
// to the file's basename (without extension). If no match, skip the binding.
|
|
162
|
-
for (const binding of namedBindings) {
|
|
163
|
-
if (binding.isModuleAlias)
|
|
164
|
-
continue;
|
|
165
|
-
const lowerName = binding.exported.toLowerCase();
|
|
166
|
-
const matchedFile = files.find((f) => {
|
|
167
|
-
const base = f.replace(/\\/g, '/').split('/').pop() ?? '';
|
|
168
|
-
const nameWithoutExt = base.substring(0, base.lastIndexOf('.')).toLowerCase();
|
|
169
|
-
return nameWithoutExt === lowerName;
|
|
170
|
-
});
|
|
171
|
-
if (matchedFile) {
|
|
172
|
-
const existing = fileBindings.get(binding.local);
|
|
173
|
-
if (existing && existing.sourcePath !== matchedFile) {
|
|
174
|
-
fileBindings.delete(binding.local);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
fileBindings.set(binding.local, {
|
|
178
|
-
sourcePath: matchedFile,
|
|
179
|
-
exportedName: binding.exported,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// ============================================================================
|
|
189
|
-
// MAIN IMPORT PROCESSOR
|
|
190
|
-
// ============================================================================
|
|
191
|
-
export const processImports = async (graph, files, astCache, ctx, onProgress, repoRoot, allPaths) => {
|
|
192
|
-
const importMap = ctx.importMap;
|
|
193
|
-
const packageMap = ctx.packageMap;
|
|
194
|
-
const namedImportMap = ctx.namedImportMap;
|
|
195
|
-
const moduleAliasMap = ctx.moduleAliasMap;
|
|
196
|
-
// Use allPaths (full repo) when available for cross-chunk resolution, else fall back to chunk files
|
|
197
|
-
const allFileList = allPaths ?? files.map((f) => f.path);
|
|
198
|
-
const allFilePaths = new Set(allFileList);
|
|
199
|
-
const parser = await loadParser();
|
|
200
|
-
const logSkipped = isVerboseIngestionEnabled();
|
|
201
|
-
const skippedByLang = logSkipped ? new Map() : null;
|
|
202
|
-
const resolveCache = new Map();
|
|
203
|
-
// Pre-compute normalized file list once (forward slashes)
|
|
204
|
-
const normalizedFileList = allFileList.map((p) => p.replace(/\\/g, '/'));
|
|
205
|
-
// Build suffix index for O(1) lookups
|
|
206
|
-
const index = buildSuffixIndex(normalizedFileList, allFileList);
|
|
207
|
-
// Track import statistics
|
|
208
|
-
let totalImportsFound = 0;
|
|
209
|
-
// Load language-specific configs once before the file loop
|
|
210
|
-
const configs = await loadImportConfigs(repoRoot || '');
|
|
211
|
-
const resolveCtx = {
|
|
212
|
-
allFilePaths,
|
|
213
|
-
allFileList,
|
|
214
|
-
normalizedFileList,
|
|
215
|
-
index,
|
|
216
|
-
resolveCache,
|
|
217
|
-
configs,
|
|
218
|
-
};
|
|
219
|
-
const { addImportEdge, addImportGraphEdge, getResolvedCount } = createImportEdgeHelpers(graph, importMap);
|
|
220
|
-
for (let i = 0; i < files.length; i++) {
|
|
221
|
-
const file = files[i];
|
|
222
|
-
onProgress?.(i + 1, files.length);
|
|
223
|
-
if (i % 20 === 0)
|
|
224
|
-
await yieldToEventLoop();
|
|
225
|
-
// 1. Check language support first
|
|
226
|
-
const language = getLanguageFromFilename(file.path);
|
|
227
|
-
if (!language)
|
|
228
|
-
continue;
|
|
229
|
-
if (!isLanguageAvailable(language)) {
|
|
230
|
-
if (skippedByLang) {
|
|
231
|
-
skippedByLang.set(language, (skippedByLang.get(language) ?? 0) + 1);
|
|
232
|
-
}
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
const provider = getProvider(language);
|
|
236
|
-
const queryStr = provider.treeSitterQueries;
|
|
237
|
-
if (!queryStr)
|
|
238
|
-
continue;
|
|
239
|
-
// 2. ALWAYS load the language before querying (parser is stateful)
|
|
240
|
-
await loadLanguage(language, file.path);
|
|
241
|
-
// 3. Get AST (Try Cache First)
|
|
242
|
-
let tree = astCache.get(file.path);
|
|
243
|
-
let wasReparsed = false;
|
|
244
|
-
if (!tree) {
|
|
245
|
-
const parseContent = provider.preprocessSource?.(file.content, file.path) ?? file.content;
|
|
246
|
-
try {
|
|
247
|
-
tree = parseSourceSafe(parser, parseContent, undefined, {
|
|
248
|
-
bufferSize: getTreeSitterBufferSize(parseContent),
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
catch (parseError) {
|
|
252
|
-
continue;
|
|
253
|
-
}
|
|
254
|
-
wasReparsed = true;
|
|
255
|
-
// Cache re-parsed tree so call/heritage phases get hits
|
|
256
|
-
astCache.set(file.path, tree);
|
|
257
|
-
}
|
|
258
|
-
let query;
|
|
259
|
-
let matches;
|
|
260
|
-
try {
|
|
261
|
-
const lang = parser.getLanguage();
|
|
262
|
-
query = new Parser.Query(lang, queryStr);
|
|
263
|
-
matches = query.matches(tree.rootNode);
|
|
264
|
-
}
|
|
265
|
-
catch (queryError) {
|
|
266
|
-
if (isDev) {
|
|
267
|
-
logger.error({
|
|
268
|
-
file: file.path,
|
|
269
|
-
language,
|
|
270
|
-
err: queryError?.message || queryError,
|
|
271
|
-
queryPreview: queryStr.substring(0, 200) + '...',
|
|
272
|
-
contentPreview: file.content.substring(0, 300),
|
|
273
|
-
astRootType: tree.rootNode?.type,
|
|
274
|
-
astHasError: tree.rootNode?.hasError,
|
|
275
|
-
}, 'tree-sitter query error');
|
|
276
|
-
}
|
|
277
|
-
if (wasReparsed)
|
|
278
|
-
tree.delete?.();
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
matches.forEach((match) => {
|
|
282
|
-
const captureMap = {};
|
|
283
|
-
match.captures.forEach((c) => (captureMap[c.name] = c.node));
|
|
284
|
-
if (captureMap['import']) {
|
|
285
|
-
const sourceNode = captureMap['import.source'];
|
|
286
|
-
if (!sourceNode) {
|
|
287
|
-
if (isDev) {
|
|
288
|
-
logger.info(`⚠️ Import captured but no source node in ${file.path}`);
|
|
289
|
-
}
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
const rawImportPath = preprocessImportPath(sourceNode.text, captureMap['import'], provider);
|
|
293
|
-
if (!rawImportPath)
|
|
294
|
-
return;
|
|
295
|
-
totalImportsFound++;
|
|
296
|
-
const result = provider.importResolver(rawImportPath, file.path, resolveCtx);
|
|
297
|
-
const extractor = provider.namedBindingExtractor;
|
|
298
|
-
const bindings = namedImportMap && extractor ? extractor(captureMap['import']) : undefined;
|
|
299
|
-
applyImportResult(result, file.path, importMap, packageMap, addImportEdge, addImportGraphEdge, bindings, namedImportMap, moduleAliasMap);
|
|
300
|
-
}
|
|
301
|
-
// ---- Language-specific call-as-import routing (Ruby require, etc.) ----
|
|
302
|
-
if (captureMap['call']) {
|
|
303
|
-
const callNameNode = captureMap['call.name'];
|
|
304
|
-
if (callNameNode) {
|
|
305
|
-
const routed = provider.callRouter?.(callNameNode.text, captureMap['call']);
|
|
306
|
-
if (routed && routed.kind === 'import') {
|
|
307
|
-
totalImportsFound++;
|
|
308
|
-
const result = provider.importResolver(routed.importPath, file.path, resolveCtx);
|
|
309
|
-
applyImportResult(result, file.path, importMap, packageMap, addImportEdge, addImportGraphEdge);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
// Tree is now owned by the LRU cache — no manual delete needed
|
|
315
|
-
}
|
|
316
|
-
wireImplicitImports(allFileList, importMap, addImportEdge, configs);
|
|
317
|
-
if (skippedByLang && skippedByLang.size > 0) {
|
|
318
|
-
for (const [lang, count] of skippedByLang.entries()) {
|
|
319
|
-
logger.warn(`[ingestion] Skipped ${count} ${lang} file(s) in import processing — ${lang} parser not available.`);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
if (isDev) {
|
|
323
|
-
logger.info(`📊 Import processing complete: ${getResolvedCount()}/${totalImportsFound} imports resolved to graph edges`);
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
// ============================================================================
|
|
327
|
-
// FAST PATH: Resolve pre-extracted imports (no parsing needed)
|
|
328
|
-
// ============================================================================
|
|
329
|
-
export const processImportsFromExtracted = async (graph, files, extractedImports, ctx, onProgress, repoRoot, prebuiltCtx) => {
|
|
330
|
-
const importMap = ctx.importMap;
|
|
331
|
-
const packageMap = ctx.packageMap;
|
|
332
|
-
const namedImportMap = ctx.namedImportMap;
|
|
333
|
-
const moduleAliasMap = ctx.moduleAliasMap;
|
|
334
|
-
const importCtx = prebuiltCtx ?? buildImportResolutionContext(files.map((f) => f.path));
|
|
335
|
-
const { allFilePaths, allFileList, normalizedFileList, index, resolveCache } = importCtx;
|
|
336
|
-
let totalImportsFound = 0;
|
|
337
|
-
const configs = await loadImportConfigs(repoRoot || '');
|
|
338
|
-
const resolveCtx = {
|
|
339
|
-
allFilePaths,
|
|
340
|
-
allFileList,
|
|
341
|
-
normalizedFileList,
|
|
342
|
-
index,
|
|
343
|
-
resolveCache,
|
|
344
|
-
configs,
|
|
345
|
-
};
|
|
346
|
-
const { addImportEdge, addImportGraphEdge, getResolvedCount } = createImportEdgeHelpers(graph, importMap);
|
|
347
|
-
// Group by file for progress reporting (users see file count, not import count)
|
|
348
|
-
const importsByFile = new Map();
|
|
349
|
-
for (const imp of extractedImports) {
|
|
350
|
-
let list = importsByFile.get(imp.filePath);
|
|
351
|
-
if (!list) {
|
|
352
|
-
list = [];
|
|
353
|
-
importsByFile.set(imp.filePath, list);
|
|
354
|
-
}
|
|
355
|
-
list.push(imp);
|
|
356
|
-
}
|
|
357
|
-
const totalFiles = importsByFile.size;
|
|
358
|
-
let filesProcessed = 0;
|
|
359
|
-
for (const [filePath, fileImports] of importsByFile) {
|
|
360
|
-
filesProcessed++;
|
|
361
|
-
if (filesProcessed % 100 === 0) {
|
|
362
|
-
onProgress?.(filesProcessed, totalFiles);
|
|
363
|
-
await yieldToEventLoop();
|
|
364
|
-
}
|
|
365
|
-
for (const imp of fileImports) {
|
|
366
|
-
totalImportsFound++;
|
|
367
|
-
const provider = getProvider(imp.language);
|
|
368
|
-
const result = provider.importResolver(imp.rawImportPath, filePath, resolveCtx);
|
|
369
|
-
applyImportResult(result, filePath, importMap, packageMap, addImportEdge, addImportGraphEdge, imp.namedBindings, namedImportMap, moduleAliasMap);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
onProgress?.(totalFiles, totalFiles);
|
|
373
|
-
wireImplicitImports(files.map((f) => f.path), importMap, addImportEdge, configs);
|
|
374
|
-
if (isDev) {
|
|
375
|
-
logger.info(`📊 Import processing (fast path): ${getResolvedCount()}/${totalImportsFound} imports resolved to graph edges`);
|
|
376
|
-
}
|
|
377
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Heritage Map
|
|
3
|
-
*
|
|
4
|
-
* Unified inheritance data structure built from accumulated
|
|
5
|
-
* {@link ExtractedHeritage} records **after all chunks complete** (between
|
|
6
|
-
* chunk processing and call resolution). Consumes `ExtractedHeritage[]` and
|
|
7
|
-
* resolves type names to nodeIds via `lookupClassByName`, NOT graph-edge
|
|
8
|
-
* queries.
|
|
9
|
-
*
|
|
10
|
-
* Combines two concerns:
|
|
11
|
-
* 1. **Parent/ancestor lookup** (MRO-aware method resolution)
|
|
12
|
-
* 2. **Implementor lookup** (interface dispatch — which files contain
|
|
13
|
-
* classes implementing a given interface)
|
|
14
|
-
*/
|
|
15
|
-
import type { ResolutionContext } from './resolution-context.js';
|
|
16
|
-
import { type SupportedLanguages } from '../../../_shared/index.js';
|
|
17
|
-
export interface ExtractedHeritage {
|
|
18
|
-
filePath: string;
|
|
19
|
-
className: string;
|
|
20
|
-
parentName: string;
|
|
21
|
-
/** 'extends' | 'implements' | 'trait-impl' | 'include' | 'extend' | 'prepend' */
|
|
22
|
-
kind: string;
|
|
23
|
-
}
|
|
24
|
-
export interface HeritageResolutionStrategy {
|
|
25
|
-
/** If set and the parent name matches, force IMPLEMENTS even when the
|
|
26
|
-
* symbol is unresolved (e.g. `/^I[A-Z]/` for C# / Java). */
|
|
27
|
-
readonly interfaceNamePattern?: RegExp;
|
|
28
|
-
/** Fallback edge for unresolved parents when the name pattern doesn't
|
|
29
|
-
* match (Swift uses 'IMPLEMENTS' for protocol conformance). */
|
|
30
|
-
readonly defaultEdge: 'EXTENDS' | 'IMPLEMENTS';
|
|
31
|
-
}
|
|
32
|
-
/** Callback used by `buildHeritageMap` to look up the resolution strategy
|
|
33
|
-
* for a given language. Injected by callers so the model module doesn't
|
|
34
|
-
* depend on `../languages/index.js`. */
|
|
35
|
-
export type HeritageStrategyLookup = (lang: SupportedLanguages) => HeritageResolutionStrategy;
|
|
36
|
-
/**
|
|
37
|
-
* Determine whether a heritage.extends capture is actually an IMPLEMENTS
|
|
38
|
-
* relationship. Consults the symbol table first (authoritative — Tier 1 /
|
|
39
|
-
* Tier 2 resolution); falls back to the injected {@link HeritageResolutionStrategy}
|
|
40
|
-
* heuristics for external symbols not present in the graph.
|
|
41
|
-
*/
|
|
42
|
-
export declare const resolveExtendsType: (parentName: string, currentFilePath: string, ctx: ResolutionContext, strategy: HeritageResolutionStrategy) => {
|
|
43
|
-
type: "EXTENDS" | "IMPLEMENTS";
|
|
44
|
-
idPrefix: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Direct parent entry with the heritage kind that produced it. Preserved
|
|
48
|
-
* so kind-aware consumers (Ruby MRO, see `lookupMethodByOwnerWithMRO`) can
|
|
49
|
-
* walk prepend/include providers in the correct order. Flat-string consumers
|
|
50
|
-
* use `getParents` / `getAncestors` and see only the parent nodeIds.
|
|
51
|
-
*/
|
|
52
|
-
export interface ParentEntry {
|
|
53
|
-
readonly parentId: string;
|
|
54
|
-
/** 'extends' | 'implements' | 'trait-impl' | 'include' | 'extend' | 'prepend' */
|
|
55
|
-
readonly kind: string;
|
|
56
|
-
}
|
|
57
|
-
export interface HeritageMap {
|
|
58
|
-
/** Direct parents of `childNodeId` (extends + implements + trait-impl). */
|
|
59
|
-
getParents(childNodeId: string): string[];
|
|
60
|
-
/** Full ancestor chain (BFS, bounded depth, cycle-safe). */
|
|
61
|
-
getAncestors(childNodeId: string): string[];
|
|
62
|
-
/**
|
|
63
|
-
* Direct parents with heritage kind preserved, insertion-ordered. Used by
|
|
64
|
-
* kind-aware consumers (Ruby MRO) that need to distinguish prepend /
|
|
65
|
-
* include / extend / extends for walk-order decisions.
|
|
66
|
-
*
|
|
67
|
-
* Insertion order mirrors the order `ExtractedHeritage` records were fed
|
|
68
|
-
* into `buildHeritageMap`, which in turn mirrors tree-sitter match order.
|
|
69
|
-
* For Ruby, this matches source declaration order for `prepend` / `include`
|
|
70
|
-
* statements — the MRO walk reverses this (last-declared-first) at the
|
|
71
|
-
* consumer side.
|
|
72
|
-
*/
|
|
73
|
-
getParentEntries(childNodeId: string): readonly ParentEntry[];
|
|
74
|
-
/**
|
|
75
|
-
* Ordered ancestry for instance method dispatch (Ruby-aware): includes
|
|
76
|
-
* `extends`, `implements`, `trait-impl`, `include`, `prepend` kinds.
|
|
77
|
-
* Excludes `extend` (singleton-only). Order is caller-determined in Unit 3.
|
|
78
|
-
* For non-Ruby callers (first-wins, c3, etc.), this matches `getAncestors`.
|
|
79
|
-
*/
|
|
80
|
-
getInstanceAncestry(childNodeId: string): readonly ParentEntry[];
|
|
81
|
-
/**
|
|
82
|
-
* Ordered ancestry for singleton / class-method dispatch (Ruby-aware):
|
|
83
|
-
* only `extend` kind parents. For non-Ruby languages this is always empty.
|
|
84
|
-
*/
|
|
85
|
-
getSingletonAncestry(childNodeId: string): readonly ParentEntry[];
|
|
86
|
-
/**
|
|
87
|
-
* File paths of classes that directly implement or extend-as-interface the
|
|
88
|
-
* given interface/abstract-class **name**. Replaces the standalone
|
|
89
|
-
* `ImplementorMap` — used by interface-dispatch in call resolution.
|
|
90
|
-
*/
|
|
91
|
-
getImplementorFiles(interfaceName: string): ReadonlySet<string>;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Build a HeritageMap from accumulated ExtractedHeritage records.
|
|
95
|
-
*
|
|
96
|
-
* Resolves class/interface/struct/trait names to nodeIds via
|
|
97
|
-
* `ctx.model.types.lookupClassByName`. When a name resolves to multiple
|
|
98
|
-
* candidates, all are recorded (partial-class / cross-file scenario).
|
|
99
|
-
* Unresolvable names are silently skipped — a missing parent is better
|
|
100
|
-
* than a wrong edge.
|
|
101
|
-
*
|
|
102
|
-
* Also builds the implementor index (interface name → implementing file
|
|
103
|
-
* paths) used by interface-dispatch in call resolution.
|
|
104
|
-
*/
|
|
105
|
-
export declare const buildHeritageMap: (heritage: readonly ExtractedHeritage[], ctx: ResolutionContext, getHeritageStrategy?: HeritageStrategyLookup) => HeritageMap;
|