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,58 +0,0 @@
|
|
|
1
|
-
import { findChild } from '../utils/ast-helpers.js';
|
|
2
|
-
export function extractTsNamedBindings(importNode) {
|
|
3
|
-
// import_statement > import_clause > named_imports > import_specifier*
|
|
4
|
-
const importClause = findChild(importNode, 'import_clause');
|
|
5
|
-
if (importClause) {
|
|
6
|
-
const namedImports = findChild(importClause, 'named_imports');
|
|
7
|
-
if (!namedImports)
|
|
8
|
-
return undefined; // default import, namespace import, or side-effect
|
|
9
|
-
const bindings = [];
|
|
10
|
-
for (let i = 0; i < namedImports.namedChildCount; i++) {
|
|
11
|
-
const specifier = namedImports.namedChild(i);
|
|
12
|
-
if (specifier?.type !== 'import_specifier')
|
|
13
|
-
continue;
|
|
14
|
-
const identifiers = [];
|
|
15
|
-
for (let j = 0; j < specifier.namedChildCount; j++) {
|
|
16
|
-
const child = specifier.namedChild(j);
|
|
17
|
-
if (child?.type === 'identifier')
|
|
18
|
-
identifiers.push(child.text);
|
|
19
|
-
}
|
|
20
|
-
if (identifiers.length === 1) {
|
|
21
|
-
bindings.push({ local: identifiers[0], exported: identifiers[0] });
|
|
22
|
-
}
|
|
23
|
-
else if (identifiers.length === 2) {
|
|
24
|
-
// import { Foo as Bar } → exported='Foo', local='Bar'
|
|
25
|
-
bindings.push({ local: identifiers[1], exported: identifiers[0] });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return bindings.length > 0 ? bindings : undefined;
|
|
29
|
-
}
|
|
30
|
-
// Re-export: export { X } from './y' → export_statement > export_clause > export_specifier
|
|
31
|
-
const exportClause = findChild(importNode, 'export_clause');
|
|
32
|
-
if (exportClause) {
|
|
33
|
-
const bindings = [];
|
|
34
|
-
for (let i = 0; i < exportClause.namedChildCount; i++) {
|
|
35
|
-
const specifier = exportClause.namedChild(i);
|
|
36
|
-
if (specifier?.type !== 'export_specifier')
|
|
37
|
-
continue;
|
|
38
|
-
const identifiers = [];
|
|
39
|
-
for (let j = 0; j < specifier.namedChildCount; j++) {
|
|
40
|
-
const child = specifier.namedChild(j);
|
|
41
|
-
if (child?.type === 'identifier')
|
|
42
|
-
identifiers.push(child.text);
|
|
43
|
-
}
|
|
44
|
-
if (identifiers.length === 1) {
|
|
45
|
-
// export { User } from './base' → re-exports User as User
|
|
46
|
-
bindings.push({ local: identifiers[0], exported: identifiers[0] });
|
|
47
|
-
}
|
|
48
|
-
else if (identifiers.length === 2) {
|
|
49
|
-
// export { Repo as Repository } from './models' → name=Repo, alias=Repository
|
|
50
|
-
// For re-exports, the first id is the source name, second is what's exported
|
|
51
|
-
// When another file imports { Repository }, they get Repo from the source
|
|
52
|
-
bindings.push({ local: identifiers[1], exported: identifiers[0] });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return bindings.length > 0 ? bindings : undefined;
|
|
56
|
-
}
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cross-file binding propagation — extracted from pipeline.ts.
|
|
3
|
-
*
|
|
4
|
-
* Seeds downstream files with resolved type bindings from upstream exports.
|
|
5
|
-
* Files are processed in topological import order so upstream bindings
|
|
6
|
-
* are available when downstream files are re-resolved.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import type { createResolutionContext } from '../model/resolution-context.js';
|
|
11
|
-
import { type PipelineProgress } from '../../../_shared/index.js';
|
|
12
|
-
import type { KnowledgeGraph } from '../../graph/types.js';
|
|
13
|
-
/**
|
|
14
|
-
* Cross-file binding propagation.
|
|
15
|
-
* Returns the number of files re-processed.
|
|
16
|
-
*/
|
|
17
|
-
export declare function runCrossFileBindingPropagation(graph: KnowledgeGraph, ctx: ReturnType<typeof createResolutionContext>, parseExportedTypeMap: ReadonlyMap<string, ReadonlyMap<string, string>>, allPathSet: ReadonlySet<string>, totalFiles: number, repoPath: string, pipelineStart: number, onProgress: (progress: PipelineProgress) => void): Promise<number>;
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cross-file binding propagation — extracted from pipeline.ts.
|
|
3
|
-
*
|
|
4
|
-
* Seeds downstream files with resolved type bindings from upstream exports.
|
|
5
|
-
* Files are processed in topological import order so upstream bindings
|
|
6
|
-
* are available when downstream files are re-resolved.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import { processCalls, buildImportedReturnTypes, buildImportedRawReturnTypes, } from '../call-processor.js';
|
|
11
|
-
import { createASTCache } from '../ast-cache.js';
|
|
12
|
-
import { getLanguageFromFilename, } from '../../../_shared/index.js';
|
|
13
|
-
import { readFileContents } from '../filesystem-walker.js';
|
|
14
|
-
import { isLanguageAvailable } from '../../tree-sitter/parser-loader.js';
|
|
15
|
-
import { isRegistryPrimary } from '../registry-primary-flag.js';
|
|
16
|
-
import { topologicalLevelSort } from '../utils/graph-sort.js';
|
|
17
|
-
import { isDev } from '../utils/env.js';
|
|
18
|
-
import { logger } from '../../logger.js';
|
|
19
|
-
/** Max AST trees to keep in LRU cache for cross-file binding propagation. */
|
|
20
|
-
const AST_CACHE_CAP = 50;
|
|
21
|
-
/** Minimum percentage of files that must benefit from cross-file seeding. */
|
|
22
|
-
const CROSS_FILE_SKIP_THRESHOLD = 0.03;
|
|
23
|
-
/** Hard cap on files re-processed during cross-file propagation. */
|
|
24
|
-
const MAX_CROSS_FILE_REPROCESS = 2000;
|
|
25
|
-
/**
|
|
26
|
-
* Cross-file binding propagation.
|
|
27
|
-
* Returns the number of files re-processed.
|
|
28
|
-
*/
|
|
29
|
-
export async function runCrossFileBindingPropagation(graph, ctx, parseExportedTypeMap, allPathSet, totalFiles, repoPath, pipelineStart, onProgress) {
|
|
30
|
-
if (parseExportedTypeMap.size === 0 || ctx.namedImportMap.size === 0)
|
|
31
|
-
return 0;
|
|
32
|
-
// Build a local mutable working copy. Per-file re-resolution below mutates
|
|
33
|
-
// this map (each `processCalls` writes that file's exports back into it so
|
|
34
|
-
// later iterations in the same level/loop can resolve transitive bindings).
|
|
35
|
-
// Owning a local copy here keeps `ParseOutput.exportedTypeMap` truly
|
|
36
|
-
// read-only at the phase boundary — no cast, no shared-mutable handoff.
|
|
37
|
-
const exportedTypeMap = new Map();
|
|
38
|
-
for (const [fp, exports] of parseExportedTypeMap) {
|
|
39
|
-
exportedTypeMap.set(fp, new Map(exports));
|
|
40
|
-
}
|
|
41
|
-
const { levels, cycleCount } = topologicalLevelSort(ctx.importMap);
|
|
42
|
-
if (isDev && cycleCount > 0) {
|
|
43
|
-
logger.info(`🔄 ${cycleCount} files in import cycles (processed last in undefined order)`);
|
|
44
|
-
}
|
|
45
|
-
let filesWithGaps = 0;
|
|
46
|
-
const gapThreshold = Math.max(1, Math.ceil(totalFiles * CROSS_FILE_SKIP_THRESHOLD));
|
|
47
|
-
outer: for (const level of levels) {
|
|
48
|
-
for (const filePath of level) {
|
|
49
|
-
const imports = ctx.namedImportMap.get(filePath);
|
|
50
|
-
if (!imports)
|
|
51
|
-
continue;
|
|
52
|
-
for (const [, binding] of imports) {
|
|
53
|
-
const upstream = exportedTypeMap.get(binding.sourcePath);
|
|
54
|
-
if (upstream?.has(binding.exportedName)) {
|
|
55
|
-
filesWithGaps++;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
const def = ctx.model.symbols.lookupExactFull(binding.sourcePath, binding.exportedName);
|
|
59
|
-
if (def?.returnType) {
|
|
60
|
-
filesWithGaps++;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (filesWithGaps >= gapThreshold)
|
|
65
|
-
break outer;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const gapRatio = totalFiles > 0 ? filesWithGaps / totalFiles : 0;
|
|
69
|
-
if (gapRatio < CROSS_FILE_SKIP_THRESHOLD && filesWithGaps < gapThreshold) {
|
|
70
|
-
if (isDev) {
|
|
71
|
-
logger.info(`⏭️ Cross-file re-resolution skipped (${filesWithGaps}/${totalFiles} files, ${(gapRatio * 100).toFixed(1)}% < ${CROSS_FILE_SKIP_THRESHOLD * 100}% threshold)`);
|
|
72
|
-
}
|
|
73
|
-
return 0;
|
|
74
|
-
}
|
|
75
|
-
// Intentionally reports `phase: 'parsing'` rather than a separate
|
|
76
|
-
// 'crossFile' phase: cross-file re-resolution is logically a continuation of
|
|
77
|
-
// the parsing/resolution work and is bucketed under "parsing" in any
|
|
78
|
-
// telemetry that groups events by phase name. Kept consistent with the
|
|
79
|
-
// upstream `parse` phase's progress events so the UI shows one continuous
|
|
80
|
-
// progress segment instead of a phase flicker. If a future change splits
|
|
81
|
-
// this out into its own phase, also rename `parse-impl.ts` per-chunk
|
|
82
|
-
// progress events accordingly.
|
|
83
|
-
onProgress({
|
|
84
|
-
phase: 'parsing',
|
|
85
|
-
percent: 82,
|
|
86
|
-
message: `Cross-file type propagation (${filesWithGaps}+ files)...`,
|
|
87
|
-
stats: { filesProcessed: totalFiles, totalFiles, nodesCreated: graph.nodeCount },
|
|
88
|
-
});
|
|
89
|
-
let crossFileResolved = 0;
|
|
90
|
-
const crossFileStart = Date.now();
|
|
91
|
-
const astCache = createASTCache(AST_CACHE_CAP);
|
|
92
|
-
// Compiled query objects keyed by language name. Shared across all processCalls
|
|
93
|
-
// invocations in this phase so the same tree-sitter query string is only
|
|
94
|
-
// compiled once per language instead of once per file (O(1) vs O(N)).
|
|
95
|
-
const compiledQueryCache = new Map();
|
|
96
|
-
// Snapshot total topological candidates for progress math. We walk the
|
|
97
|
-
// levels once more here (fast — no I/O) so we can report meaningful
|
|
98
|
-
// percentages rather than a frozen display.
|
|
99
|
-
let totalCandidates = 0;
|
|
100
|
-
for (const level of levels) {
|
|
101
|
-
for (const filePath of level) {
|
|
102
|
-
if (totalCandidates >= MAX_CROSS_FILE_REPROCESS)
|
|
103
|
-
break;
|
|
104
|
-
const imports = ctx.namedImportMap.get(filePath);
|
|
105
|
-
if (!imports)
|
|
106
|
-
continue;
|
|
107
|
-
if (!allPathSet.has(filePath))
|
|
108
|
-
continue;
|
|
109
|
-
const lang = getLanguageFromFilename(filePath);
|
|
110
|
-
if (!lang || !isLanguageAvailable(lang))
|
|
111
|
-
continue;
|
|
112
|
-
// Registry-primary languages have their call resolution handled by the
|
|
113
|
-
// scope-resolution pipeline — processCalls skips them immediately. Skip
|
|
114
|
-
// here too so we avoid the I/O cost (readFileContents) and map-building
|
|
115
|
-
// overhead for files that would be no-ops anyway.
|
|
116
|
-
if (isRegistryPrimary(lang))
|
|
117
|
-
continue;
|
|
118
|
-
totalCandidates++;
|
|
119
|
-
}
|
|
120
|
-
if (totalCandidates >= MAX_CROSS_FILE_REPROCESS)
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
const cappedTotal = Math.min(totalCandidates, MAX_CROSS_FILE_REPROCESS);
|
|
124
|
-
/** Emit a progress event every PROGRESS_INTERVAL files so the UI stays alive. */
|
|
125
|
-
const PROGRESS_INTERVAL = 25;
|
|
126
|
-
for (const level of levels) {
|
|
127
|
-
const levelCandidates = [];
|
|
128
|
-
for (const filePath of level) {
|
|
129
|
-
if (crossFileResolved + levelCandidates.length >= MAX_CROSS_FILE_REPROCESS)
|
|
130
|
-
break;
|
|
131
|
-
const imports = ctx.namedImportMap.get(filePath);
|
|
132
|
-
if (!imports)
|
|
133
|
-
continue;
|
|
134
|
-
const seeded = new Map();
|
|
135
|
-
for (const [localName, binding] of imports) {
|
|
136
|
-
const upstream = exportedTypeMap.get(binding.sourcePath);
|
|
137
|
-
if (upstream) {
|
|
138
|
-
const type = upstream.get(binding.exportedName);
|
|
139
|
-
if (type)
|
|
140
|
-
seeded.set(localName, type);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
const importedReturns = buildImportedReturnTypes(filePath, ctx.namedImportMap, ctx.model.symbols);
|
|
144
|
-
const importedRawReturns = buildImportedRawReturnTypes(filePath, ctx.namedImportMap, ctx.model.symbols);
|
|
145
|
-
if (seeded.size === 0 && importedReturns.size === 0)
|
|
146
|
-
continue;
|
|
147
|
-
if (!allPathSet.has(filePath))
|
|
148
|
-
continue;
|
|
149
|
-
const lang = getLanguageFromFilename(filePath);
|
|
150
|
-
if (!lang || !isLanguageAvailable(lang))
|
|
151
|
-
continue;
|
|
152
|
-
// Registry-primary languages have their call resolution handled by the
|
|
153
|
-
// scope-resolution pipeline — processCalls skips them immediately. Skip
|
|
154
|
-
// here to avoid readFileContents I/O and map-building for no-op files.
|
|
155
|
-
if (isRegistryPrimary(lang))
|
|
156
|
-
continue;
|
|
157
|
-
levelCandidates.push({ filePath, seeded, importedReturns, importedRawReturns });
|
|
158
|
-
}
|
|
159
|
-
if (levelCandidates.length === 0)
|
|
160
|
-
continue;
|
|
161
|
-
const levelPaths = levelCandidates.map((c) => c.filePath);
|
|
162
|
-
const contentMap = await readFileContents(repoPath, levelPaths);
|
|
163
|
-
for (const { filePath, seeded, importedReturns, importedRawReturns } of levelCandidates) {
|
|
164
|
-
const content = contentMap.get(filePath);
|
|
165
|
-
if (!content)
|
|
166
|
-
continue;
|
|
167
|
-
const reFile = [{ path: filePath, content }];
|
|
168
|
-
const bindings = new Map();
|
|
169
|
-
if (seeded.size > 0)
|
|
170
|
-
bindings.set(filePath, seeded);
|
|
171
|
-
const importedReturnTypesMap = new Map();
|
|
172
|
-
if (importedReturns.size > 0) {
|
|
173
|
-
importedReturnTypesMap.set(filePath, importedReturns);
|
|
174
|
-
}
|
|
175
|
-
const importedRawReturnTypesMap = new Map();
|
|
176
|
-
if (importedRawReturns.size > 0) {
|
|
177
|
-
importedRawReturnTypesMap.set(filePath, importedRawReturns);
|
|
178
|
-
}
|
|
179
|
-
await processCalls(graph, reFile, astCache, ctx, undefined, exportedTypeMap, bindings.size > 0 ? bindings : undefined, importedReturnTypesMap.size > 0 ? importedReturnTypesMap : undefined, importedRawReturnTypesMap.size > 0 ? importedRawReturnTypesMap : undefined, undefined, undefined, compiledQueryCache);
|
|
180
|
-
crossFileResolved++;
|
|
181
|
-
// Emit progress every PROGRESS_INTERVAL files so the UI shows real
|
|
182
|
-
// movement instead of a frozen display (cross-file can take minutes
|
|
183
|
-
// on large repos with many cross-file imports).
|
|
184
|
-
if (crossFileResolved % PROGRESS_INTERVAL === 0 || crossFileResolved === cappedTotal) {
|
|
185
|
-
const pct = cappedTotal > 0 ? Math.round((crossFileResolved / cappedTotal) * 8) : 0;
|
|
186
|
-
onProgress({
|
|
187
|
-
phase: 'parsing',
|
|
188
|
-
percent: 82 + pct,
|
|
189
|
-
message: `Cross-file type propagation (${crossFileResolved}/${cappedTotal} files)...`,
|
|
190
|
-
stats: { filesProcessed: crossFileResolved, totalFiles, nodesCreated: graph.nodeCount },
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
if (crossFileResolved >= MAX_CROSS_FILE_REPROCESS) {
|
|
195
|
-
if (isDev)
|
|
196
|
-
logger.info(`⚠️ Cross-file re-resolution capped at ${MAX_CROSS_FILE_REPROCESS} files`);
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
astCache.clear();
|
|
201
|
-
if (isDev) {
|
|
202
|
-
const elapsed = Date.now() - crossFileStart;
|
|
203
|
-
const totalElapsed = Date.now() - pipelineStart;
|
|
204
|
-
const reResolutionPct = totalElapsed > 0 ? ((elapsed / totalElapsed) * 100).toFixed(1) : '0';
|
|
205
|
-
logger.info(`🔗 Cross-file re-resolution: ${crossFileResolved} candidates re-processed` +
|
|
206
|
-
` in ${elapsed}ms (${reResolutionPct}% of total ingestion time so far)`);
|
|
207
|
-
}
|
|
208
|
-
return crossFileResolved;
|
|
209
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inline ORM query extraction (sequential fallback path).
|
|
3
|
-
*
|
|
4
|
-
* Extracts Prisma and Supabase query calls from source content using
|
|
5
|
-
* regex patterns. Used by the sequential parse path when workers are
|
|
6
|
-
* not available — the worker path extracts ORM queries via tree-sitter
|
|
7
|
-
* queries instead.
|
|
8
|
-
*
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
import type { ExtractedORMQuery } from '../workers/parse-worker.js';
|
|
12
|
-
/**
|
|
13
|
-
* Extract ORM query calls from file content using regex.
|
|
14
|
-
*
|
|
15
|
-
* Fast-path: skips files that don't contain `prisma.` or `supabase.from`.
|
|
16
|
-
* Results are appended to the `out` array (push pattern avoids allocation).
|
|
17
|
-
*
|
|
18
|
-
* @param filePath Relative path of the source file
|
|
19
|
-
* @param content File content string
|
|
20
|
-
* @param out Output array to append extracted queries to
|
|
21
|
-
*/
|
|
22
|
-
export declare function extractORMQueriesInline(filePath: string, content: string, out: ExtractedORMQuery[]): void;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inline ORM query extraction (sequential fallback path).
|
|
3
|
-
*
|
|
4
|
-
* Extracts Prisma and Supabase query calls from source content using
|
|
5
|
-
* regex patterns. Used by the sequential parse path when workers are
|
|
6
|
-
* not available — the worker path extracts ORM queries via tree-sitter
|
|
7
|
-
* queries instead.
|
|
8
|
-
*
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
// ── Regex patterns ─────────────────────────────────────────────────────────
|
|
12
|
-
/** Matches Prisma client method calls: `prisma.user.findMany(...)` */
|
|
13
|
-
const PRISMA_QUERY_RE = /\bprisma\.(\w+)\.(findMany|findFirst|findUnique|findUniqueOrThrow|findFirstOrThrow|create|createMany|update|updateMany|delete|deleteMany|upsert|count|aggregate|groupBy)\s*\(/g;
|
|
14
|
-
/** Matches Supabase client method calls: `supabase.from('users').select(...)` */
|
|
15
|
-
const SUPABASE_QUERY_RE = /\bsupabase\.from\s*\(\s*['"](\w+)['"]\s*\)\s*\.(select|insert|update|delete|upsert)\s*\(/g;
|
|
16
|
-
// ── Extraction function ───────────────────────────────────────────────────
|
|
17
|
-
/**
|
|
18
|
-
* Extract ORM query calls from file content using regex.
|
|
19
|
-
*
|
|
20
|
-
* Fast-path: skips files that don't contain `prisma.` or `supabase.from`.
|
|
21
|
-
* Results are appended to the `out` array (push pattern avoids allocation).
|
|
22
|
-
*
|
|
23
|
-
* @param filePath Relative path of the source file
|
|
24
|
-
* @param content File content string
|
|
25
|
-
* @param out Output array to append extracted queries to
|
|
26
|
-
*/
|
|
27
|
-
export function extractORMQueriesInline(filePath, content, out) {
|
|
28
|
-
const hasPrisma = content.includes('prisma.');
|
|
29
|
-
const hasSupabase = content.includes('supabase.from');
|
|
30
|
-
if (!hasPrisma && !hasSupabase)
|
|
31
|
-
return;
|
|
32
|
-
// Pre-compute line number offsets to avoid O(n²) substring+split per match
|
|
33
|
-
const lineOffsets = buildLineOffsets(content);
|
|
34
|
-
if (hasPrisma) {
|
|
35
|
-
PRISMA_QUERY_RE.lastIndex = 0;
|
|
36
|
-
let m;
|
|
37
|
-
while ((m = PRISMA_QUERY_RE.exec(content)) !== null) {
|
|
38
|
-
const model = m[1];
|
|
39
|
-
if (model.startsWith('$'))
|
|
40
|
-
continue;
|
|
41
|
-
out.push({
|
|
42
|
-
filePath,
|
|
43
|
-
orm: 'prisma',
|
|
44
|
-
model,
|
|
45
|
-
method: m[2],
|
|
46
|
-
lineNumber: lineNumberAtOffset(lineOffsets, m.index),
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (hasSupabase) {
|
|
51
|
-
SUPABASE_QUERY_RE.lastIndex = 0;
|
|
52
|
-
let m;
|
|
53
|
-
while ((m = SUPABASE_QUERY_RE.exec(content)) !== null) {
|
|
54
|
-
out.push({
|
|
55
|
-
filePath,
|
|
56
|
-
orm: 'supabase',
|
|
57
|
-
model: m[1],
|
|
58
|
-
method: m[2],
|
|
59
|
-
lineNumber: lineNumberAtOffset(lineOffsets, m.index),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// ── Line offset helpers ───────────────────────────────────────────────────
|
|
65
|
-
/** Build an array of byte offsets where each newline occurs (O(n) once). */
|
|
66
|
-
function buildLineOffsets(content) {
|
|
67
|
-
const offsets = [];
|
|
68
|
-
for (let i = 0; i < content.length; i++) {
|
|
69
|
-
if (content[i] === '\n')
|
|
70
|
-
offsets.push(i);
|
|
71
|
-
}
|
|
72
|
-
return offsets;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Binary search for 0-based line number at a given character offset.
|
|
76
|
-
*
|
|
77
|
-
* Returns the number of newlines that occur before `offset` in the content,
|
|
78
|
-
* which is the 0-based line number. When `offset` is beyond the last newline,
|
|
79
|
-
* returns `lineOffsets.length` (i.e., the last line index).
|
|
80
|
-
*/
|
|
81
|
-
function lineNumberAtOffset(lineOffsets, offset) {
|
|
82
|
-
let lo = 0;
|
|
83
|
-
let hi = lineOffsets.length;
|
|
84
|
-
while (lo < hi) {
|
|
85
|
-
const mid = (lo + hi) >>> 1;
|
|
86
|
-
if (lineOffsets[mid] < offset)
|
|
87
|
-
lo = mid + 1;
|
|
88
|
-
else
|
|
89
|
-
hi = mid;
|
|
90
|
-
}
|
|
91
|
-
return lo;
|
|
92
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wildcard import binding synthesis.
|
|
3
|
-
*
|
|
4
|
-
* Languages with whole-module import semantics (Go, Ruby, C/C++, Swift)
|
|
5
|
-
* import all exported symbols from a file, not specific named symbols.
|
|
6
|
-
* After parsing, we know which symbols each file exports (via graph
|
|
7
|
-
* `isExported`), so we can expand IMPORTS edges into per-symbol bindings
|
|
8
|
-
* that the cross-file propagation phase can use for type resolution.
|
|
9
|
-
*
|
|
10
|
-
* Also builds Python module-alias maps for namespace-import languages
|
|
11
|
-
* (`import models` → `models.User()` resolves to `models.py:User`).
|
|
12
|
-
*
|
|
13
|
-
* @module
|
|
14
|
-
*/
|
|
15
|
-
import type { KnowledgeGraph } from '../../graph/types.js';
|
|
16
|
-
import type { createResolutionContext } from '../model/resolution-context.js';
|
|
17
|
-
import type { SupportedLanguages } from '../../../_shared/index.js';
|
|
18
|
-
/** Check if a language uses wildcard (whole-module) import semantics. */
|
|
19
|
-
export declare function isWildcardImportLanguage(lang: SupportedLanguages): boolean;
|
|
20
|
-
/** Check if a language needs synthesis before call resolution.
|
|
21
|
-
* True for wildcard-import languages AND namespace-import languages (Python). */
|
|
22
|
-
export declare function needsSynthesis(lang: SupportedLanguages): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Strategy implementation for `importSemantics: 'wildcard-transitive'` (C, C++).
|
|
25
|
-
*
|
|
26
|
-
* Textual-include languages chain symbols through files: if `dict.c` includes
|
|
27
|
-
* `server.h` and `server.h` includes `dict.h`, then `dict.c` sees symbols from
|
|
28
|
-
* all three files. This helper walks the include graph (combining both the
|
|
29
|
-
* ingestion-context `importMap` and the graph-level IMPORTS edges) until the
|
|
30
|
-
* closure is stable.
|
|
31
|
-
*
|
|
32
|
-
* **Order matters.** The returned `Set` preserves iteration order (insertion
|
|
33
|
-
* order). `synthesizeWildcardImportBindings` dedupes bindings by symbol name
|
|
34
|
-
* on a first-seen-wins basis, so this closure's ordering determines which
|
|
35
|
-
* declaration wins when multiple headers export the same name (e.g. overloaded
|
|
36
|
-
* free functions like `write_audit()` vs `write_audit(const char*)` in
|
|
37
|
-
* different headers). We therefore:
|
|
38
|
-
* 1. Seed the closure with direct imports in declaration order (matches the
|
|
39
|
-
* order of `#include` directives in the source file).
|
|
40
|
-
* 2. Use FIFO / true BFS (`queue.shift()`) for transitive expansion, so
|
|
41
|
-
* closer headers are seen before deeper ones.
|
|
42
|
-
*
|
|
43
|
-
* Cycle-safe: the `closure.has(file)` guard prevents infinite loops on circular
|
|
44
|
-
* header includes, which are valid C/C++ when paired with `#pragma once` or
|
|
45
|
-
* include guards.
|
|
46
|
-
*
|
|
47
|
-
* Size-bounded: the closure is capped at `MAX_TRANSITIVE_CLOSURE_SIZE` files to
|
|
48
|
-
* prevent OOM on pathological codebases (e.g. boost, monoheader kernel code)
|
|
49
|
-
* where one translation unit can transitively reach tens of thousands of
|
|
50
|
-
* headers. Partial closures still yield useful bindings for the cluster of
|
|
51
|
-
* headers closest to the importer, which is what overload resolution and
|
|
52
|
-
* cross-file call resolution care about.
|
|
53
|
-
*
|
|
54
|
-
* Queue implementation: uses a head-index over a growing array (O(1) dequeue)
|
|
55
|
-
* instead of `Array.prototype.shift()` (O(n)) so deep chains stay linear.
|
|
56
|
-
*/
|
|
57
|
-
export declare function expandTransitiveIncludeClosure(directImports: Iterable<string>, importMap: ReadonlyMap<string, ReadonlySet<string>>, graphImports: ReadonlyMap<string, ReadonlySet<string>>): Set<string>;
|
|
58
|
-
/**
|
|
59
|
-
* Synthesize namedImportMap entries for languages with whole-module imports.
|
|
60
|
-
*
|
|
61
|
-
* For each file that imports another file via wildcard semantics:
|
|
62
|
-
* 1. Look up all exported symbols from the imported file (via graph nodes)
|
|
63
|
-
* 2. Create synthetic named bindings: `{ name → { sourcePath, exportedName } }`
|
|
64
|
-
* 3. Build Python module-alias maps for namespace-import languages
|
|
65
|
-
*
|
|
66
|
-
* @param graph The knowledge graph with parsed symbol nodes
|
|
67
|
-
* @param ctx Resolution context with importMap and namedImportMap
|
|
68
|
-
* @returns Number of synthetic bindings created
|
|
69
|
-
*/
|
|
70
|
-
export declare function synthesizeWildcardImportBindings(graph: KnowledgeGraph, ctx: ReturnType<typeof createResolutionContext>): number;
|