gitnexus 1.6.4-rc.10 → 1.6.4-rc.101
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 +35 -0
- package/dist/_shared/index.d.ts +2 -0
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +2 -0
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/integrations/understand-quickly.d.ts +79 -0
- package/dist/_shared/integrations/understand-quickly.d.ts.map +1 -0
- package/dist/_shared/integrations/understand-quickly.js +139 -0
- package/dist/_shared/integrations/understand-quickly.js.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +11 -9
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.js +91 -36
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/cli/ai-context.js +2 -1
- package/dist/cli/analyze.d.ts +14 -1
- package/dist/cli/analyze.js +223 -40
- package/dist/cli/clean.js +4 -3
- package/dist/cli/cli-message.d.ts +15 -0
- package/dist/cli/cli-message.js +61 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +31 -0
- package/dist/cli/eval-server.js +37 -12
- package/dist/cli/group.js +4 -3
- package/dist/cli/index-repo.js +2 -2
- package/dist/cli/index.js +25 -2
- package/dist/cli/mcp.d.ts +21 -0
- package/dist/cli/mcp.js +52 -15
- package/dist/cli/optional-grammars.d.ts +47 -0
- package/dist/cli/optional-grammars.js +87 -0
- package/dist/cli/publish.d.ts +29 -0
- package/dist/cli/publish.js +174 -0
- package/dist/cli/remove.js +7 -4
- package/dist/cli/serve.js +31 -13
- package/dist/cli/setup.js +46 -16
- package/dist/cli/tool.js +6 -5
- package/dist/cli/wiki.js +39 -6
- package/dist/config/ignore-service.js +4 -1
- package/dist/core/augmentation/engine.js +1 -1
- package/dist/core/embedding-mode.d.ts +21 -0
- package/dist/core/embedding-mode.js +18 -0
- package/dist/core/embeddings/config.d.ts +2 -0
- package/dist/core/embeddings/config.js +36 -0
- package/dist/core/embeddings/embedder.js +55 -27
- package/dist/core/embeddings/embedding-pipeline.d.ts +7 -1
- package/dist/core/embeddings/embedding-pipeline.js +106 -40
- package/dist/core/embeddings/exact-search.d.ts +15 -0
- package/dist/core/embeddings/exact-search.js +27 -0
- package/dist/core/embeddings/hf-env.d.ts +163 -0
- package/dist/core/embeddings/hf-env.js +250 -0
- package/dist/core/embeddings/types.d.ts +4 -0
- package/dist/core/embeddings/types.js +2 -0
- package/dist/core/git-staleness.d.ts +6 -0
- package/dist/core/git-staleness.js +35 -5
- package/dist/core/group/bridge-db.js +318 -170
- package/dist/core/group/config-parser.js +23 -1
- package/dist/core/group/cross-impact.d.ts +44 -0
- package/dist/core/group/cross-impact.js +82 -8
- package/dist/core/group/extractors/elixir-workspace-extractor.d.ts +15 -0
- package/dist/core/group/extractors/elixir-workspace-extractor.js +204 -0
- package/dist/core/group/extractors/go-workspace-extractor.d.ts +14 -0
- package/dist/core/group/extractors/go-workspace-extractor.js +217 -0
- package/dist/core/group/extractors/grpc-extractor.js +15 -3
- package/dist/core/group/extractors/http-route-extractor.js +9 -1
- package/dist/core/group/extractors/include-extractor.d.ts +39 -0
- package/dist/core/group/extractors/include-extractor.js +565 -0
- package/dist/core/group/extractors/java-workspace-extractor.d.ts +16 -0
- package/dist/core/group/extractors/java-workspace-extractor.js +204 -0
- package/dist/core/group/extractors/manifest-extractor.js +34 -6
- package/dist/core/group/extractors/node-workspace-extractor.d.ts +14 -0
- package/dist/core/group/extractors/node-workspace-extractor.js +207 -0
- package/dist/core/group/extractors/python-workspace-extractor.d.ts +15 -0
- package/dist/core/group/extractors/python-workspace-extractor.js +205 -0
- package/dist/core/group/extractors/rust-workspace-extractor.d.ts +44 -0
- package/dist/core/group/extractors/rust-workspace-extractor.js +240 -0
- package/dist/core/group/extractors/thrift-extractor.d.ts +22 -0
- package/dist/core/group/extractors/thrift-extractor.js +282 -0
- package/dist/core/group/extractors/thrift-patterns/index.d.ts +4 -0
- package/dist/core/group/extractors/thrift-patterns/index.js +10 -0
- package/dist/core/group/extractors/thrift-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/thrift-patterns/java.js +220 -0
- package/dist/core/group/extractors/thrift-patterns/types.d.ts +17 -0
- package/dist/core/group/extractors/thrift-patterns/types.js +1 -0
- package/dist/core/group/extractors/topic-extractor.js +14 -14
- package/dist/core/group/extractors/workspace-extractor.d.ts +13 -0
- package/dist/core/group/extractors/workspace-extractor.js +65 -0
- package/dist/core/group/matching.d.ts +3 -3
- package/dist/core/group/matching.js +136 -50
- package/dist/core/group/service.d.ts +1 -0
- package/dist/core/group/service.js +5 -4
- package/dist/core/group/storage.js +70 -4
- package/dist/core/group/sync.js +85 -14
- package/dist/core/group/types.d.ts +22 -1
- package/dist/core/ingestion/ast-cache.js +2 -1
- package/dist/core/ingestion/call-processor.d.ts +3 -3
- package/dist/core/ingestion/call-processor.js +59 -65
- package/dist/core/ingestion/cluster-enricher.js +3 -2
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +4 -20
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +2 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +14 -2
- package/dist/core/ingestion/entry-point-scoring.d.ts +0 -18
- package/dist/core/ingestion/entry-point-scoring.js +7 -188
- package/dist/core/ingestion/field-extractors/configs/csharp.js +8 -3
- package/dist/core/ingestion/filesystem-walker.js +3 -2
- package/dist/core/ingestion/framework-detection.d.ts +0 -120
- package/dist/core/ingestion/framework-detection.js +7 -365
- package/dist/core/ingestion/heritage-processor.js +3 -2
- package/dist/core/ingestion/import-processor.js +14 -12
- package/dist/core/ingestion/language-config.js +6 -5
- package/dist/core/ingestion/language-provider.d.ts +23 -0
- package/dist/core/ingestion/languages/c-cpp.js +70 -0
- package/dist/core/ingestion/languages/cobol.js +2 -0
- package/dist/core/ingestion/languages/csharp/captures.js +93 -0
- package/dist/core/ingestion/languages/csharp/query.js +6 -0
- package/dist/core/ingestion/languages/csharp.js +49 -0
- package/dist/core/ingestion/languages/dart.js +36 -0
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +8 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +37 -0
- package/dist/core/ingestion/languages/go/arity.d.ts +2 -0
- package/dist/core/ingestion/languages/go/arity.js +14 -0
- package/dist/core/ingestion/languages/go/cache-stats.d.ts +7 -0
- package/dist/core/ingestion/languages/go/cache-stats.js +15 -0
- package/dist/core/ingestion/languages/go/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/go/captures.js +128 -0
- package/dist/core/ingestion/languages/go/expand-wildcards.d.ts +15 -0
- package/dist/core/ingestion/languages/go/expand-wildcards.js +93 -0
- package/dist/core/ingestion/languages/go/import-decomposer.d.ts +3 -0
- package/dist/core/ingestion/languages/go/import-decomposer.js +44 -0
- package/dist/core/ingestion/languages/go/import-target.d.ts +21 -0
- package/dist/core/ingestion/languages/go/import-target.js +67 -0
- package/dist/core/ingestion/languages/go/index.d.ts +17 -0
- package/dist/core/ingestion/languages/go/index.js +17 -0
- package/dist/core/ingestion/languages/go/interface-impls.d.ts +4 -0
- package/dist/core/ingestion/languages/go/interface-impls.js +72 -0
- package/dist/core/ingestion/languages/go/interpret.d.ts +11 -0
- package/dist/core/ingestion/languages/go/interpret.js +146 -0
- package/dist/core/ingestion/languages/go/merge-bindings.d.ts +2 -0
- package/dist/core/ingestion/languages/go/merge-bindings.js +18 -0
- package/dist/core/ingestion/languages/go/method-owners.d.ts +17 -0
- package/dist/core/ingestion/languages/go/method-owners.js +96 -0
- package/dist/core/ingestion/languages/go/namespace-mirror.d.ts +15 -0
- package/dist/core/ingestion/languages/go/namespace-mirror.js +53 -0
- package/dist/core/ingestion/languages/go/package-siblings.d.ts +11 -0
- package/dist/core/ingestion/languages/go/package-siblings.js +84 -0
- package/dist/core/ingestion/languages/go/query.d.ts +3 -0
- package/dist/core/ingestion/languages/go/query.js +207 -0
- package/dist/core/ingestion/languages/go/range-binding.d.ts +8 -0
- package/dist/core/ingestion/languages/go/range-binding.js +108 -0
- package/dist/core/ingestion/languages/go/receiver-binding.d.ts +3 -0
- package/dist/core/ingestion/languages/go/receiver-binding.js +21 -0
- package/dist/core/ingestion/languages/go/scope-resolver.d.ts +2 -0
- package/dist/core/ingestion/languages/go/scope-resolver.js +33 -0
- package/dist/core/ingestion/languages/go/simple-hooks.d.ts +4 -0
- package/dist/core/ingestion/languages/go/simple-hooks.js +21 -0
- package/dist/core/ingestion/languages/go/type-binding.d.ts +3 -0
- package/dist/core/ingestion/languages/go/type-binding.js +237 -0
- package/dist/core/ingestion/languages/go.js +50 -0
- package/dist/core/ingestion/languages/java.js +21 -0
- package/dist/core/ingestion/languages/kotlin.js +41 -0
- package/dist/core/ingestion/languages/php.js +35 -0
- package/dist/core/ingestion/languages/python/captures.js +19 -4
- package/dist/core/ingestion/languages/python/import-target.js +121 -25
- package/dist/core/ingestion/languages/python.js +41 -0
- package/dist/core/ingestion/languages/ruby.js +25 -0
- package/dist/core/ingestion/languages/rust.js +35 -0
- package/dist/core/ingestion/languages/swift.js +68 -0
- package/dist/core/ingestion/languages/typescript/captures.js +22 -0
- package/dist/core/ingestion/languages/typescript/query.d.ts +7 -0
- package/dist/core/ingestion/languages/typescript/query.js +205 -5
- package/dist/core/ingestion/languages/typescript.js +132 -11
- package/dist/core/ingestion/languages/vue.js +2 -0
- package/dist/core/ingestion/method-extractors/configs/swift.js +3 -4
- package/dist/core/ingestion/method-extractors/generic.js +2 -1
- package/dist/core/ingestion/model/resolve.js +31 -11
- package/dist/core/ingestion/parsing-processor.js +23 -11
- package/dist/core/ingestion/pipeline-phases/cobol.js +4 -3
- package/dist/core/ingestion/pipeline-phases/communities.js +2 -1
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +5 -4
- package/dist/core/ingestion/pipeline-phases/cross-file.js +3 -2
- package/dist/core/ingestion/pipeline-phases/markdown.js +2 -1
- package/dist/core/ingestion/pipeline-phases/mro.js +2 -1
- package/dist/core/ingestion/pipeline-phases/orm.js +2 -1
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +9 -8
- package/dist/core/ingestion/pipeline-phases/processes.js +12 -6
- package/dist/core/ingestion/pipeline-phases/routes.js +4 -3
- package/dist/core/ingestion/pipeline-phases/runner.js +3 -2
- package/dist/core/ingestion/pipeline-phases/tools.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/tools.js +12 -5
- package/dist/core/ingestion/process-processor.js +4 -3
- package/dist/core/ingestion/registry-primary-flag.js +1 -0
- package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
- package/dist/core/ingestion/scope-extractor.js +18 -5
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +60 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +33 -3
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +3 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +49 -1
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +7 -1
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +1 -1
- package/dist/core/ingestion/scope-resolution/passes/mro.js +2 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +48 -25
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +3 -2
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +2 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +27 -6
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.d.ts +1 -1
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.js +7 -1
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +23 -0
- package/dist/core/ingestion/tree-sitter-queries.d.ts +2 -2
- package/dist/core/ingestion/tree-sitter-queries.js +149 -0
- package/dist/core/ingestion/type-env.js +2 -1
- package/dist/core/ingestion/type-extractors/swift.js +7 -4
- package/dist/core/ingestion/utils/ast-helpers.d.ts +12 -1
- package/dist/core/ingestion/utils/ast-helpers.js +15 -1
- package/dist/core/ingestion/utils/max-file-size.js +2 -1
- package/dist/core/ingestion/vue-sfc-extractor.js +18 -1
- package/dist/core/ingestion/workers/parse-worker.d.ts +1 -0
- package/dist/core/ingestion/workers/parse-worker.js +17 -10
- package/dist/core/ingestion/workers/worker-pool.d.ts +11 -4
- package/dist/core/ingestion/workers/worker-pool.js +303 -49
- package/dist/core/lbug/csv-generator.js +5 -1
- package/dist/core/lbug/extension-loader.d.ts +86 -0
- package/dist/core/lbug/extension-loader.js +186 -0
- package/dist/core/lbug/lbug-adapter.d.ts +54 -17
- package/dist/core/lbug/lbug-adapter.js +202 -158
- package/dist/core/lbug/lbug-config.d.ts +102 -0
- package/dist/core/lbug/lbug-config.js +303 -0
- package/dist/core/lbug/pool-adapter.d.ts +1 -4
- package/dist/core/lbug/pool-adapter.js +82 -39
- package/dist/core/lbug/schema.d.ts +1 -1
- package/dist/core/lbug/schema.js +12 -1
- package/dist/core/logger.d.ts +125 -0
- package/dist/core/logger.js +323 -0
- package/dist/core/platform/capabilities.d.ts +24 -0
- package/dist/core/platform/capabilities.js +54 -0
- package/dist/core/run-analyze.d.ts +8 -1
- package/dist/core/run-analyze.js +71 -16
- package/dist/core/search/bm25-index.d.ts +6 -1
- package/dist/core/search/bm25-index.js +27 -10
- package/dist/core/search/hybrid-search.d.ts +4 -3
- package/dist/core/search/hybrid-search.js +6 -5
- package/dist/core/tree-sitter/parser-loader.d.ts +2 -2
- package/dist/core/tree-sitter/parser-loader.js +173 -68
- package/dist/core/wiki/cursor-client.js +2 -1
- package/dist/core/wiki/llm-client.js +6 -11
- package/dist/mcp/compatible-stdio-transport.js +7 -1
- package/dist/mcp/core/embedder.js +37 -16
- package/dist/mcp/core/lbug-adapter.d.ts +7 -1
- package/dist/mcp/core/lbug-adapter.js +7 -1
- package/dist/mcp/local/local-backend.d.ts +9 -0
- package/dist/mcp/local/local-backend.js +199 -45
- package/dist/mcp/server.js +26 -8
- package/dist/mcp/stdio-capture.d.ts +40 -0
- package/dist/mcp/stdio-capture.js +53 -0
- package/dist/mcp/stdio-context.d.ts +47 -0
- package/dist/mcp/stdio-context.js +145 -0
- package/dist/mcp/tools.d.ts +2 -0
- package/dist/mcp/tools.js +33 -0
- package/dist/server/api.d.ts +25 -0
- package/dist/server/api.js +323 -79
- package/dist/server/git-clone.d.ts +75 -2
- package/dist/server/git-clone.js +229 -13
- package/dist/server/mcp-http.js +2 -1
- package/dist/server/validation.d.ts +98 -0
- package/dist/server/validation.js +142 -0
- package/dist/storage/git.d.ts +57 -0
- package/dist/storage/git.js +124 -2
- package/dist/storage/repo-manager.d.ts +40 -2
- package/dist/storage/repo-manager.js +121 -13
- package/hooks/claude/gitnexus-hook.cjs +62 -3
- package/package.json +14 -10
- package/scripts/build-tree-sitter-dart.cjs +53 -0
- package/scripts/build-tree-sitter-proto.cjs +12 -1
- package/scripts/build.js +22 -2
- package/scripts/install-duckdb-extension.mjs +48 -0
- package/vendor/tree-sitter-dart/README.md +18 -0
- package/vendor/tree-sitter-dart/binding.gyp +31 -0
- package/vendor/tree-sitter-dart/bindings/node/binding.cc +20 -0
- package/vendor/tree-sitter-dart/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-dart/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-dart/grammar.js +2895 -0
- package/vendor/tree-sitter-dart/package.json +18 -0
- package/vendor/tree-sitter-dart/queries/highlights.scm +246 -0
- package/vendor/tree-sitter-dart/queries/tags.scm +92 -0
- package/vendor/tree-sitter-dart/queries/test.scm +1 -0
- package/vendor/tree-sitter-dart/src/grammar.json +12459 -0
- package/vendor/tree-sitter-dart/src/node-types.json +15055 -0
- package/vendor/tree-sitter-dart/src/parser.c +196127 -0
- package/vendor/tree-sitter-dart/src/scanner.c +130 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/alloc.h +54 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/array.h +290 -0
- package/vendor/tree-sitter-dart/src/tree_sitter/parser.h +265 -0
- package/vendor/tree-sitter-swift/LICENSE +21 -0
- package/vendor/tree-sitter-swift/README.md +139 -0
- package/vendor/tree-sitter-swift/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-swift/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-swift/package.json +28 -0
- package/vendor/tree-sitter-swift/prebuilds/darwin-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/darwin-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/linux-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/linux-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/win32-arm64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/prebuilds/win32-x64/tree-sitter-swift.node +0 -0
- package/vendor/tree-sitter-swift/src/node-types.json +30694 -0
- package/web/assets/agent-Dl2d-mDi.js +597 -0
- package/web/assets/architecture-YZFGNWBL-S5CXDPWN-BYXnTu07.js +1 -0
- package/web/assets/architectureDiagram-EMZXCZ2Q-uiiIna83.js +36 -0
- package/web/assets/blockDiagram-IGV67L2C-uBKdDzXA.js +132 -0
- package/web/assets/c4Diagram-DFAF54RM-DTxaX43T.js +10 -0
- package/web/assets/chunk-3GS5O3IE-BxKKu7d7.js +231 -0
- package/web/assets/chunk-3YCYZ6SJ-BJZnGFjg.js +1 -0
- package/web/assets/chunk-6NTNNK5N-CIL_eO2d.js +1 -0
- package/web/assets/chunk-7RZVMHOQ-BdIU-RGO.js +321 -0
- package/web/assets/chunk-A34GCYZU-Dv4Vkem9.js +1 -0
- package/web/assets/chunk-AEOMTBSW-D7qjBMHW.js +1 -0
- package/web/assets/chunk-CilyBKbf.js +1 -0
- package/web/assets/chunk-DJ7UZH7F-Cskl-nb3.js +1 -0
- package/web/assets/chunk-DKKBVRCY-D3S2BD56.js +4 -0
- package/web/assets/chunk-DU5LTGQ6-B8Zh51LG.js +1 -0
- package/web/assets/chunk-FXACKDTF-Cb4xHVUz.js +159 -0
- package/web/assets/chunk-H3VCZNTA-BOGhqvxW.js +1 -0
- package/web/assets/chunk-HN6EAY2L-CitKFy1e.js +1 -0
- package/web/assets/chunk-KSICW3F5-C2tZmXwv.js +15 -0
- package/web/assets/chunk-O5ABG6QK-V3sk7Bps.js +1 -0
- package/web/assets/chunk-PK6DOVAG-FvG7aKfZ.js +206 -0
- package/web/assets/chunk-RNJOYNJ4-BPANsy8V.js +1 -0
- package/web/assets/chunk-RWUO3TPN-BHusg2jI.js +1 -0
- package/web/assets/chunk-TBF5ZNIQ-CXamrpH3.js +1 -0
- package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +1 -0
- package/web/assets/chunk-TYMNRAUI-BnMe6HfP.js +1 -0
- package/web/assets/chunk-VELTKBKT-C9dVN39o.js +1 -0
- package/web/assets/chunk-W7ZLLLMY-BqZFKM5j.js +1 -0
- package/web/assets/chunk-WSB5WSVC-EKS7-Nnc.js +1 -0
- package/web/assets/chunk-XGPFEOL4-BBab-enK.js +1 -0
- package/web/assets/classDiagram-PPOCWD7C-B-LkKU0P.js +1 -0
- package/web/assets/classDiagram-v2-23LJLIIU-_NGI4VEh.js +1 -0
- package/web/assets/context-builder-CqQNhRj1.js +15 -0
- package/web/assets/cose-bilkent-PNC4W37J-DjEQkTZ4.js +1 -0
- package/web/assets/dagre-E77IOHMT-D6Xacg1x.js +4 -0
- package/web/assets/diagram-H7BISOXX-CMuISoJL.js +43 -0
- package/web/assets/diagram-JC5VWROH-DHq_eoeM.js +24 -0
- package/web/assets/diagram-LXUTUG65-C0NczIgW.js +10 -0
- package/web/assets/diagram-WEHSV5V5-WsBnpSuc.js +24 -0
- package/web/assets/erDiagram-GCSMX5X6-DxHFHFR6.js +85 -0
- package/web/assets/flowDiagram-OTCZ4VVT-_G1VxyQS.js +162 -0
- package/web/assets/ganttDiagram-MUNLMDZQ-BIHObj0t.js +292 -0
- package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-BXJXsixL.js +1 -0
- package/web/assets/gitGraphDiagram-3HKGZ4G3-COZUkHTD.js +106 -0
- package/web/assets/index-BleGLU8S.css +2 -0
- package/web/assets/index-DDcYO1IJ.js +886 -0
- package/web/assets/info-OMHHGYJF-BF2H5H6G-C820LK0J.js +1 -0
- package/web/assets/infoDiagram-MN7RKWGX-BeOjfPc_.js +2 -0
- package/web/assets/ishikawaDiagram-YMYX4NHK-C-JI2Ih7.js +70 -0
- package/web/assets/journeyDiagram-SO5T7YLQ-IPX4h3iD.js +139 -0
- package/web/assets/kanban-definition-LJHFXRCJ-B23LtshQ.js +89 -0
- package/web/assets/katex-GD7MH7QM-CJiOjBBJ.js +261 -0
- package/web/assets/mindmap-definition-2EUWGEK5-DJKUsrCo.js +96 -0
- package/web/assets/packet-4T2RLAQJ-EV4IVRXR-BvWtM5jq.js +1 -0
- package/web/assets/pie-ZZUOXDRM-N23DN5KN-BnDgj0TQ.js +1 -0
- package/web/assets/pieDiagram-3IATQBI2-Bj26KTKk.js +30 -0
- package/web/assets/quadrantDiagram-E256RVCF-VAk5oIRr.js +7 -0
- package/web/assets/radar-PYXPWWZC-P6TP7ZYP-2IuDlZ6r.js +1 -0
- package/web/assets/requirementDiagram-M5DCFWZL-CmlTJ_vQ.js +84 -0
- package/web/assets/sankeyDiagram-L3NBLAOT-C-f_DdcX.js +10 -0
- package/web/assets/sequenceDiagram-ZOUHS735-DmtNf1NF.js +157 -0
- package/web/assets/stateDiagram-MLPALWAM-Lq7UVrkj.js +1 -0
- package/web/assets/stateDiagram-v2-B5LQ5ZB2-DCiXBPeS.js +1 -0
- package/web/assets/timeline-definition-5SPVSISX-BkpqZxt2.js +120 -0
- package/web/assets/treeView-SZITEDCU-5DXDK3XO-Ipq1EIaF.js +1 -0
- package/web/assets/treemap-W4RFUUIX-WYLRDWKO-DESFxovu.js +1 -0
- package/web/assets/vennDiagram-IE5QUKF5-iAJ08JBe.js +34 -0
- package/web/assets/wardley-RL74JXVD-BCRCBASE-BVkhckBY.js +1 -0
- package/web/assets/wardleyDiagram-XU3VSMPF-BDiKTkL4.js +20 -0
- package/web/assets/xychartDiagram-ZHJ5623Y-CknyZyQK.js +7 -0
- package/web/index.html +21 -0
- package/scripts/patch-tree-sitter-swift.cjs +0 -78
package/README.md
CHANGED
|
@@ -156,6 +156,7 @@ gitnexus analyze --embeddings # Enable embedding generation (slower, better s
|
|
|
156
156
|
gitnexus analyze --skip-agents-md # Preserve custom AGENTS.md/CLAUDE.md gitnexus section edits
|
|
157
157
|
gitnexus analyze --verbose # Log skipped files when parsers are unavailable
|
|
158
158
|
gitnexus analyze --max-file-size 1024 # Skip files larger than N KB (default: 512, cap: 32768)
|
|
159
|
+
gitnexus analyze --worker-timeout 60 # Increase worker idle timeout for slow parses
|
|
159
160
|
gitnexus mcp # Start MCP server (stdio) — serves all indexed repos
|
|
160
161
|
gitnexus serve # Start local HTTP server (multi-repo) for web UI
|
|
161
162
|
gitnexus index # Register an existing .gitnexus/ folder into the global registry
|
|
@@ -295,6 +296,25 @@ If `npm install -g gitnexus` fails on native modules:
|
|
|
295
296
|
npm install -g gitnexus
|
|
296
297
|
```
|
|
297
298
|
|
|
299
|
+
### Analyze warns about unavailable FTS or VECTOR extensions
|
|
300
|
+
|
|
301
|
+
GitNexus uses optional DuckDB extensions for BM25 and vector search. The `gitnexus serve` and MCP read paths only ever try to `LOAD` the extensions — they never block on a network install. The `analyze` command, by default, attempts one bounded out-of-process `INSTALL` if `LOAD` fails and proceeds even when that install times out, so the index is always written to disk; BM25/vector search degrade gracefully until the extensions become available.
|
|
302
|
+
|
|
303
|
+
Configure the behavior with two environment variables:
|
|
304
|
+
|
|
305
|
+
| Variable | Values | Default | Effect |
|
|
306
|
+
|----------|--------|---------|--------|
|
|
307
|
+
| `GITNEXUS_LBUG_EXTENSION_INSTALL` | `auto`, `load-only`, `never` | `auto` | `auto` runs one bounded INSTALL if LOAD fails. `load-only` only uses already-installed extensions (recommended for offline / firewalled environments). `never` skips optional extensions entirely. |
|
|
308
|
+
| `GITNEXUS_LBUG_EXTENSION_INSTALL_TIMEOUT_MS` | positive integer | `15000` | Wall-clock budget for the out-of-process `INSTALL` child before it is killed. |
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
# Offline/airgapped: never reach the network for extensions
|
|
312
|
+
GITNEXUS_LBUG_EXTENSION_INSTALL=load-only npx gitnexus analyze
|
|
313
|
+
|
|
314
|
+
# Slow network: give extension downloads more time
|
|
315
|
+
GITNEXUS_LBUG_EXTENSION_INSTALL_TIMEOUT_MS=30000 npx gitnexus analyze
|
|
316
|
+
```
|
|
317
|
+
|
|
298
318
|
### Analysis runs out of memory
|
|
299
319
|
|
|
300
320
|
For very large repositories:
|
|
@@ -323,6 +343,21 @@ npx gitnexus analyze
|
|
|
323
343
|
|
|
324
344
|
Values above **32768 KB (32 MB)** are clamped to the tree-sitter parser ceiling; invalid values fall back to the 512 KB default with a one-time warning. When an override is active, `analyze` prints the effective threshold in its startup banner (e.g. `GITNEXUS_MAX_FILE_SIZE: effective threshold 2048KB (default 512KB)`).
|
|
325
345
|
|
|
346
|
+
### Analyze reports a worker timeout
|
|
347
|
+
|
|
348
|
+
Worker parse timeouts are recoverable. GitNexus retries stalled worker jobs with backoff, splits large jobs to isolate slow files, and falls back to the sequential parser when needed. If a large repository needs more time per worker job, use either:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
# CLI flag, in seconds
|
|
352
|
+
npx gitnexus analyze --worker-timeout 60
|
|
353
|
+
|
|
354
|
+
# Environment variable, in milliseconds
|
|
355
|
+
export GITNEXUS_WORKER_SUB_BATCH_TIMEOUT_MS=60000
|
|
356
|
+
npx gitnexus analyze
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
For repositories with very large source files, `GITNEXUS_WORKER_SUB_BATCH_MAX_BYTES` controls the worker job byte budget. The default is **8388608 bytes (8 MB)**.
|
|
360
|
+
|
|
326
361
|
## Privacy
|
|
327
362
|
|
|
328
363
|
- All processing happens locally on your machine
|
package/dist/_shared/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export { buildScopeTree, canParentScope, ScopeTreeInvariantError, } from './scop
|
|
|
48
48
|
export type { ScopeTree } from './scope-resolution/scope-tree.js';
|
|
49
49
|
export { buildPositionIndex } from './scope-resolution/position-index.js';
|
|
50
50
|
export type { PositionIndex } from './scope-resolution/position-index.js';
|
|
51
|
+
export { UNDERSTAND_QUICKLY_DISPATCH_URL, UNDERSTAND_QUICKLY_EVENT_TYPE, UNDERSTAND_QUICKLY_TOKEN_ENV, buildUqDispatchPayload, isValidOwnerRepo, parseOwnerRepoFromRemote, stripGitSuffix, } from './integrations/understand-quickly.js';
|
|
52
|
+
export type { UqDispatchPayload } from './integrations/understand-quickly.js';
|
|
51
53
|
export { diffResolutions } from './scope-resolution/shadow/diff.js';
|
|
52
54
|
export type { ShadowAgreement, ShadowCallsite, ShadowDiff, } from './scope-resolution/shadow/diff.js';
|
|
53
55
|
export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACjG,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIr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AAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,YAAY,EACV,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC"}
|
package/dist/_shared/index.js
CHANGED
|
@@ -33,6 +33,8 @@ export { CLASS_KINDS, METHOD_KINDS, FIELD_KINDS } from './scope-resolution/regis
|
|
|
33
33
|
export { makeScopeId, clearScopeIdInternPool } from './scope-resolution/scope-id.js';
|
|
34
34
|
export { buildScopeTree, canParentScope, ScopeTreeInvariantError, } from './scope-resolution/scope-tree.js';
|
|
35
35
|
export { buildPositionIndex } from './scope-resolution/position-index.js';
|
|
36
|
+
// Understand-Quickly registry integration (opt-in)
|
|
37
|
+
export { UNDERSTAND_QUICKLY_DISPATCH_URL, UNDERSTAND_QUICKLY_EVENT_TYPE, UNDERSTAND_QUICKLY_TOKEN_ENV, buildUqDispatchPayload, isValidOwnerRepo, parseOwnerRepoFromRemote, stripGitSuffix, } from './integrations/understand-quickly.js';
|
|
36
38
|
// Shadow-mode diff + aggregation (RFC §6.3; Ring 2 SHARED #918)
|
|
37
39
|
export { diffResolutions } from './scope-resolution/shadow/diff.js';
|
|
38
40
|
export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
|
|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|
|
2
|
+
* Understand-Quickly registry integration helpers.
|
|
3
|
+
*
|
|
4
|
+
* Pure, runtime-agnostic logic for opting in to publishing a GitNexus
|
|
5
|
+
* index to the [`looptech-ai/understand-quickly`](https://github.com/looptech-ai/understand-quickly)
|
|
6
|
+
* registry. Lives in `gitnexus-shared` so both the Node CLI and any
|
|
7
|
+
* future browser-side surface can construct identical dispatch payloads.
|
|
8
|
+
*
|
|
9
|
+
* Network I/O lives in the CLI command (`gitnexus/src/cli/publish.ts`)
|
|
10
|
+
* to keep this module free of Node-only imports — see the comment at
|
|
11
|
+
* the top of `gitnexus-shared/src/graph/types.ts`.
|
|
12
|
+
*
|
|
13
|
+
* The protocol contract (single dispatch event, no graph upload) is
|
|
14
|
+
* documented at:
|
|
15
|
+
* https://github.com/looptech-ai/understand-quickly/blob/main/docs/integrations/protocol.md
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* URL of the registry repo's repository_dispatch endpoint. Hardcoded
|
|
19
|
+
* because the registry is the canonical home for this integration —
|
|
20
|
+
* users who want a private registry can fork and patch.
|
|
21
|
+
*/
|
|
22
|
+
export declare const UNDERSTAND_QUICKLY_DISPATCH_URL = "https://api.github.com/repos/looptech-ai/understand-quickly/dispatches";
|
|
23
|
+
/**
|
|
24
|
+
* Event type the registry's sync workflow listens for.
|
|
25
|
+
* See `looptech-ai/understand-quickly/.github/workflows/sync.yml`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const UNDERSTAND_QUICKLY_EVENT_TYPE = "sync-entry";
|
|
28
|
+
/** Environment variable that gates the dispatch. */
|
|
29
|
+
export declare const UNDERSTAND_QUICKLY_TOKEN_ENV = "UNDERSTAND_QUICKLY_TOKEN";
|
|
30
|
+
export interface UqDispatchPayload {
|
|
31
|
+
event_type: typeof UNDERSTAND_QUICKLY_EVENT_TYPE;
|
|
32
|
+
client_payload: {
|
|
33
|
+
/** `<owner>/<repo>` shape — must match the registered entry. */
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build the JSON body for the `repository_dispatch` ping. Pure — no
|
|
39
|
+
* env reads, no network. Validates that `id` looks like `owner/repo`
|
|
40
|
+
* (one slash, no whitespace, both halves non-empty) so a misconfigured
|
|
41
|
+
* caller fails loudly before the round-trip.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildUqDispatchPayload(id: string): UqDispatchPayload;
|
|
44
|
+
/**
|
|
45
|
+
* `owner/repo` validation. Conservative on purpose: GitHub's actual
|
|
46
|
+
* naming rules are looser, but we want to catch local paths
|
|
47
|
+
* (`/Users/...`), bare slugs (`my-repo`), and accidental whitespace.
|
|
48
|
+
*
|
|
49
|
+
* Matches GitHub's published slug rules:
|
|
50
|
+
* owner: starts with alnum, then alnum/hyphen only, must end with
|
|
51
|
+
* alnum (no trailing hyphen — GitHub rejects this at account
|
|
52
|
+
* creation, so a `my-org-/repo` input would otherwise pass us
|
|
53
|
+
* and 422 from GitHub). No underscore, no dot. Length cap 39.
|
|
54
|
+
* repo: any of alnum/dot/hyphen/underscore. Length cap 100.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isValidOwnerRepo(id: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Strip a single trailing `.git` (case-insensitive) and any trailing
|
|
59
|
+
* slashes from a URL-ish string. Bounded linear: each character is
|
|
60
|
+
* visited at most twice, no backtracking.
|
|
61
|
+
*
|
|
62
|
+
* Replaces `s.replace(/\.git\/*$/i, '').replace(/\/+$/, '')` which
|
|
63
|
+
* CodeQL's polynomial-regex check (codeql/js/polynomial-redos) flags as
|
|
64
|
+
* a worst-case O(n²) on adversarial input like "////.../x".
|
|
65
|
+
*/
|
|
66
|
+
export declare function stripGitSuffix(input: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Parse `owner/repo` out of a git remote URL. Mirrors the heuristic in
|
|
69
|
+
* `gitnexus/src/storage/git.ts:parseRepoNameFromUrl` but keeps both
|
|
70
|
+
* halves so we can build a registry id. Returns `null` on shapes we
|
|
71
|
+
* don't recognise.
|
|
72
|
+
*
|
|
73
|
+
* Examples:
|
|
74
|
+
* git@github.com:looptech-ai/understand-quickly.git
|
|
75
|
+
* https://github.com/looptech-ai/understand-quickly
|
|
76
|
+
* ssh://git@github.com/looptech-ai/understand-quickly.git
|
|
77
|
+
*/
|
|
78
|
+
export declare function parseOwnerRepoFromRemote(url: string | null | undefined): string | null;
|
|
79
|
+
//# sourceMappingURL=understand-quickly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"understand-quickly.d.ts","sourceRoot":"","sources":["../../src/integrations/understand-quickly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,2EAC8B,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D,oDAAoD;AACpD,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,OAAO,6BAA6B,CAAC;IACjD,cAAc,EAAE;QACd,gEAAgE;QAChE,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAYpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAsCtF"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Understand-Quickly registry integration helpers.
|
|
3
|
+
*
|
|
4
|
+
* Pure, runtime-agnostic logic for opting in to publishing a GitNexus
|
|
5
|
+
* index to the [`looptech-ai/understand-quickly`](https://github.com/looptech-ai/understand-quickly)
|
|
6
|
+
* registry. Lives in `gitnexus-shared` so both the Node CLI and any
|
|
7
|
+
* future browser-side surface can construct identical dispatch payloads.
|
|
8
|
+
*
|
|
9
|
+
* Network I/O lives in the CLI command (`gitnexus/src/cli/publish.ts`)
|
|
10
|
+
* to keep this module free of Node-only imports — see the comment at
|
|
11
|
+
* the top of `gitnexus-shared/src/graph/types.ts`.
|
|
12
|
+
*
|
|
13
|
+
* The protocol contract (single dispatch event, no graph upload) is
|
|
14
|
+
* documented at:
|
|
15
|
+
* https://github.com/looptech-ai/understand-quickly/blob/main/docs/integrations/protocol.md
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* URL of the registry repo's repository_dispatch endpoint. Hardcoded
|
|
19
|
+
* because the registry is the canonical home for this integration —
|
|
20
|
+
* users who want a private registry can fork and patch.
|
|
21
|
+
*/
|
|
22
|
+
export const UNDERSTAND_QUICKLY_DISPATCH_URL = 'https://api.github.com/repos/looptech-ai/understand-quickly/dispatches';
|
|
23
|
+
/**
|
|
24
|
+
* Event type the registry's sync workflow listens for.
|
|
25
|
+
* See `looptech-ai/understand-quickly/.github/workflows/sync.yml`.
|
|
26
|
+
*/
|
|
27
|
+
export const UNDERSTAND_QUICKLY_EVENT_TYPE = 'sync-entry';
|
|
28
|
+
/** Environment variable that gates the dispatch. */
|
|
29
|
+
export const UNDERSTAND_QUICKLY_TOKEN_ENV = 'UNDERSTAND_QUICKLY_TOKEN';
|
|
30
|
+
/**
|
|
31
|
+
* Build the JSON body for the `repository_dispatch` ping. Pure — no
|
|
32
|
+
* env reads, no network. Validates that `id` looks like `owner/repo`
|
|
33
|
+
* (one slash, no whitespace, both halves non-empty) so a misconfigured
|
|
34
|
+
* caller fails loudly before the round-trip.
|
|
35
|
+
*/
|
|
36
|
+
export function buildUqDispatchPayload(id) {
|
|
37
|
+
if (!isValidOwnerRepo(id)) {
|
|
38
|
+
throw new Error(`[understand-quickly] expected id of the form "owner/repo", got "${id}". ` +
|
|
39
|
+
`The registry uses this string to look up your entry in registry.json — ` +
|
|
40
|
+
`it must match the GitHub owner/repo of the source code, not a local path.`);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
event_type: UNDERSTAND_QUICKLY_EVENT_TYPE,
|
|
44
|
+
client_payload: { id },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `owner/repo` validation. Conservative on purpose: GitHub's actual
|
|
49
|
+
* naming rules are looser, but we want to catch local paths
|
|
50
|
+
* (`/Users/...`), bare slugs (`my-repo`), and accidental whitespace.
|
|
51
|
+
*
|
|
52
|
+
* Matches GitHub's published slug rules:
|
|
53
|
+
* owner: starts with alnum, then alnum/hyphen only, must end with
|
|
54
|
+
* alnum (no trailing hyphen — GitHub rejects this at account
|
|
55
|
+
* creation, so a `my-org-/repo` input would otherwise pass us
|
|
56
|
+
* and 422 from GitHub). No underscore, no dot. Length cap 39.
|
|
57
|
+
* repo: any of alnum/dot/hyphen/underscore. Length cap 100.
|
|
58
|
+
*/
|
|
59
|
+
export function isValidOwnerRepo(id) {
|
|
60
|
+
return /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/[A-Za-z0-9._-]{1,100}$/.test(id);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Strip a single trailing `.git` (case-insensitive) and any trailing
|
|
64
|
+
* slashes from a URL-ish string. Bounded linear: each character is
|
|
65
|
+
* visited at most twice, no backtracking.
|
|
66
|
+
*
|
|
67
|
+
* Replaces `s.replace(/\.git\/*$/i, '').replace(/\/+$/, '')` which
|
|
68
|
+
* CodeQL's polynomial-regex check (codeql/js/polynomial-redos) flags as
|
|
69
|
+
* a worst-case O(n²) on adversarial input like "////.../x".
|
|
70
|
+
*/
|
|
71
|
+
export function stripGitSuffix(input) {
|
|
72
|
+
let end = input.length;
|
|
73
|
+
// Trim trailing '/'.
|
|
74
|
+
while (end > 0 && input.charCodeAt(end - 1) === 0x2f)
|
|
75
|
+
end--;
|
|
76
|
+
// Drop one trailing '.git' (case-insensitive).
|
|
77
|
+
if (end >= 4) {
|
|
78
|
+
const tail = input.slice(end - 4, end).toLowerCase();
|
|
79
|
+
if (tail === '.git')
|
|
80
|
+
end -= 4;
|
|
81
|
+
}
|
|
82
|
+
// Trim trailing '/' that may have sat between '.git' and the rest.
|
|
83
|
+
while (end > 0 && input.charCodeAt(end - 1) === 0x2f)
|
|
84
|
+
end--;
|
|
85
|
+
return input.slice(0, end);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Parse `owner/repo` out of a git remote URL. Mirrors the heuristic in
|
|
89
|
+
* `gitnexus/src/storage/git.ts:parseRepoNameFromUrl` but keeps both
|
|
90
|
+
* halves so we can build a registry id. Returns `null` on shapes we
|
|
91
|
+
* don't recognise.
|
|
92
|
+
*
|
|
93
|
+
* Examples:
|
|
94
|
+
* git@github.com:looptech-ai/understand-quickly.git
|
|
95
|
+
* https://github.com/looptech-ai/understand-quickly
|
|
96
|
+
* ssh://git@github.com/looptech-ai/understand-quickly.git
|
|
97
|
+
*/
|
|
98
|
+
export function parseOwnerRepoFromRemote(url) {
|
|
99
|
+
if (!url)
|
|
100
|
+
return null;
|
|
101
|
+
const trimmed = url.trim();
|
|
102
|
+
if (!trimmed)
|
|
103
|
+
return null;
|
|
104
|
+
// Strip a trailing `.git` (case-insensitive) and any trailing slashes
|
|
105
|
+
// so https://h/o/r and https://h/o/r.git collapse to the same id.
|
|
106
|
+
// Bounded-linear helper avoids the polynomial-regex CodeQL alert.
|
|
107
|
+
const stripped = stripGitSuffix(trimmed);
|
|
108
|
+
// SCP-form SSH (`git@host:owner/repo`). Capture host so we can reject
|
|
109
|
+
// non-GitHub remotes — a GitLab origin like
|
|
110
|
+
// `https://gitlab.example.com/group/sub/project.git` would otherwise
|
|
111
|
+
// silently dispatch the wrong id (LOW 9).
|
|
112
|
+
const ssh = stripped.match(/^[^@]+@([^:]+):([^/]+)\/([^/]+)$/);
|
|
113
|
+
if (ssh) {
|
|
114
|
+
const host = ssh[1].toLowerCase();
|
|
115
|
+
if (host !== 'github.com' && host !== 'www.github.com')
|
|
116
|
+
return null;
|
|
117
|
+
return `${ssh[2]}/${ssh[3]}`;
|
|
118
|
+
}
|
|
119
|
+
// URL forms (https://, ssh://, git://, file://) — last two path segments.
|
|
120
|
+
const url2 = stripped.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/([^/]+)\/(.+)$/);
|
|
121
|
+
if (url2) {
|
|
122
|
+
// Strip optional `userinfo@` (e.g. `ssh://git@github.com/...`).
|
|
123
|
+
const authority = url2[1];
|
|
124
|
+
const atIdx = authority.lastIndexOf('@');
|
|
125
|
+
const hostAndPort = atIdx >= 0 ? authority.slice(atIdx + 1) : authority;
|
|
126
|
+
// Strip `:port` suffix if present.
|
|
127
|
+
const colonIdx = hostAndPort.indexOf(':');
|
|
128
|
+
const host = (colonIdx >= 0 ? hostAndPort.slice(0, colonIdx) : hostAndPort).toLowerCase();
|
|
129
|
+
if (host !== 'github.com' && host !== 'www.github.com')
|
|
130
|
+
return null;
|
|
131
|
+
const segments = url2[2].split('/').filter(Boolean);
|
|
132
|
+
if (segments.length >= 2) {
|
|
133
|
+
const [owner, repo] = segments.slice(-2);
|
|
134
|
+
return `${owner}/${repo}`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=understand-quickly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"understand-quickly.js","sourceRoot":"","sources":["../../src/integrations/understand-quickly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,wEAAwE,CAAC;AAE3E;;;GAGG;AACH,MAAM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AC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1F,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,gBAAgB;YAAE,OAAO,IAAI,CAAC;QACpE,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -83,7 +83,7 @@ export interface FinalizeHooks {
|
|
|
83
83
|
* Return `null` when no target file is resolvable (e.g., `np.foo` when
|
|
84
84
|
* `numpy` is external to the workspace).
|
|
85
85
|
*/
|
|
86
|
-
resolveImportTarget(targetRaw: string, fromFile: string, workspaceIndex: WorkspaceIndex): string | null;
|
|
86
|
+
resolveImportTarget(targetRaw: string, fromFile: string, workspaceIndex: WorkspaceIndex): string | readonly string[] | null;
|
|
87
87
|
/**
|
|
88
88
|
* For a wildcard `import * from M`, return the names visible in the
|
|
89
89
|
* exporting module scope `M`. The finalize pass looks each name up in
|
|
@@ -109,20 +109,22 @@ export interface FinalizedScc {
|
|
|
109
109
|
/**
|
|
110
110
|
* Counters reported by `finalize`.
|
|
111
111
|
*
|
|
112
|
-
* **Counting granularity** —
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* that
|
|
117
|
-
*
|
|
112
|
+
* **Counting granularity** — `totalEdges` is **per-generated-`ImportEdgeDraft`**,
|
|
113
|
+
* which may exceed the number of `ParsedImport` records when
|
|
114
|
+
* `resolveImportTarget` returns a multi-file array (e.g. Go package-scoped
|
|
115
|
+
* imports fan out to every `.go` file in the target directory). A single
|
|
116
|
+
* `wildcard` ParsedImport that expands to N exports also counts as one
|
|
117
|
+
* linked edge here; the materialized output (`FinalizeOutput.imports`) will
|
|
118
|
+
* have N edges for that input. `dynamic-unresolved` ParsedImports count as
|
|
119
|
+
* linked (they pass through with no `linkStatus`), so `linkedEdges` ≠ "has a
|
|
118
120
|
* BindingRef" — use the `bindings` map for that.
|
|
119
121
|
*
|
|
120
|
-
* In other words: `totalEdges
|
|
122
|
+
* In other words: `totalEdges >= input.parsedImports.length` summed
|
|
121
123
|
* across files, and `linkedEdges + unresolvedEdges === totalEdges`.
|
|
122
124
|
*/
|
|
123
125
|
export interface FinalizeStats {
|
|
124
126
|
readonly totalFiles: number;
|
|
125
|
-
/** Total `
|
|
127
|
+
/** Total `ImportEdgeDraft` records generated (≥ ParsedImport count). */
|
|
126
128
|
readonly totalEdges: number;
|
|
127
129
|
/**
|
|
128
130
|
* `ParsedImport`s whose finalized edge does NOT carry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finalize-algorithm.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/finalize-algorithm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIhG,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,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AE,CAAC,CAAC,CAAC;IACpF,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;CAC/B;AAID,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,cAAc,CA8InF"}
|
|
@@ -44,9 +44,9 @@ export function finalize(input, hooks) {
|
|
|
44
44
|
for (const file of input.files) {
|
|
45
45
|
const drafts = [];
|
|
46
46
|
for (const parsed of file.parsedImports) {
|
|
47
|
-
const
|
|
48
|
-
drafts.push(
|
|
49
|
-
totalEdges
|
|
47
|
+
const draftArray = makeEdgeDrafts(parsed, file, hooks, input.workspaceIndex);
|
|
48
|
+
drafts.push(...draftArray);
|
|
49
|
+
totalEdges += draftArray.length;
|
|
50
50
|
}
|
|
51
51
|
edgeIndex.set(file.filePath, drafts);
|
|
52
52
|
}
|
|
@@ -172,7 +172,7 @@ export function finalize(input, hooks) {
|
|
|
172
172
|
stats,
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function makeEdgeDrafts(parsed, file, hooks, workspace) {
|
|
176
176
|
// Dynamic-unresolved passes through — no `BindingRef`, no target file.
|
|
177
177
|
if (parsed.kind === 'dynamic-unresolved') {
|
|
178
178
|
const base = {
|
|
@@ -181,14 +181,16 @@ function makeEdgeDraft(parsed, file, hooks, workspace) {
|
|
|
181
181
|
targetExportedName: '',
|
|
182
182
|
kind: 'dynamic-unresolved',
|
|
183
183
|
};
|
|
184
|
-
return
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
184
|
+
return [
|
|
185
|
+
{
|
|
186
|
+
source: parsed,
|
|
187
|
+
fromFile: file.filePath,
|
|
188
|
+
fromScope: file.moduleScope,
|
|
189
|
+
targetFile: null,
|
|
190
|
+
base,
|
|
191
|
+
finalized: base, // already fully finalized
|
|
192
|
+
},
|
|
193
|
+
];
|
|
192
194
|
}
|
|
193
195
|
const targetFile = hooks.resolveImportTarget(parsed.targetRaw ?? '', file.filePath, workspace);
|
|
194
196
|
// Edge is unresolvable at the file level — mark unresolved now.
|
|
@@ -200,35 +202,40 @@ function makeEdgeDraft(parsed, file, hooks, workspace) {
|
|
|
200
202
|
kind: edgeKindFor(parsed),
|
|
201
203
|
linkStatus: 'unresolved',
|
|
202
204
|
};
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
return [
|
|
206
|
+
{
|
|
207
|
+
source: parsed,
|
|
208
|
+
fromFile: file.filePath,
|
|
209
|
+
fromScope: file.moduleScope,
|
|
210
|
+
targetFile: null,
|
|
211
|
+
base,
|
|
212
|
+
finalized: base,
|
|
213
|
+
},
|
|
214
|
+
];
|
|
211
215
|
}
|
|
212
216
|
// Resolvable at the file level; intra-SCC fixpoint may still fail to fill
|
|
213
217
|
// in `targetDefId` (e.g., symbol not exported from target). Side-effect
|
|
214
218
|
// and resolved-dynamic imports are terminal at the file level — no
|
|
215
219
|
// `targetDefId` needed since they materialize no `BindingRef`. Pre-
|
|
216
220
|
// finalize them here so the fixpoint loop skips them entirely.
|
|
217
|
-
const
|
|
218
|
-
localName: extractLocalName(parsed),
|
|
219
|
-
targetFile,
|
|
220
|
-
targetExportedName: extractExportedName(parsed),
|
|
221
|
-
kind: edgeKindFor(parsed),
|
|
222
|
-
};
|
|
221
|
+
const targetFiles = Array.isArray(targetFile) ? targetFile : [targetFile];
|
|
223
222
|
const isFileLevelTerminal = parsed.kind === 'side-effect' || parsed.kind === 'dynamic-resolved';
|
|
224
|
-
return {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
223
|
+
return targetFiles.map((tf) => {
|
|
224
|
+
const base = {
|
|
225
|
+
localName: extractLocalName(parsed),
|
|
226
|
+
targetFile: tf,
|
|
227
|
+
targetExportedName: extractExportedName(parsed),
|
|
228
|
+
kind: edgeKindFor(parsed),
|
|
229
|
+
};
|
|
230
|
+
return {
|
|
231
|
+
source: parsed,
|
|
232
|
+
fromFile: file.filePath,
|
|
233
|
+
fromScope: file.moduleScope,
|
|
234
|
+
targetFile: tf,
|
|
235
|
+
base,
|
|
236
|
+
finalized: isFileLevelTerminal ? base : null,
|
|
237
|
+
};
|
|
238
|
+
});
|
|
232
239
|
}
|
|
233
240
|
function edgeKindFor(parsed) {
|
|
234
241
|
if (parsed.kind === 'wildcard')
|
|
@@ -541,11 +548,59 @@ function deriveSimpleName(def) {
|
|
|
541
548
|
return dot === -1 ? q : q.slice(dot + 1);
|
|
542
549
|
}
|
|
543
550
|
function findExportByName(defs, name) {
|
|
551
|
+
// GENERIC RULE (applies to every language using this finalize
|
|
552
|
+
// algorithm): when MULTIPLE `SymbolDefinition`s share the same simple
|
|
553
|
+
// name in `localDefs`, prefer callable / type-like defs over plain
|
|
554
|
+
// value defs (`Variable`, `Property`, …). The CALLER side of an
|
|
555
|
+
// import almost always wants the callable, not a value shadow that
|
|
556
|
+
// happens to share the name — and without a deterministic
|
|
557
|
+
// preference, capture order silently decides which def the import
|
|
558
|
+
// binds to.
|
|
559
|
+
//
|
|
560
|
+
// The single-def case is unchanged: when only one def has the name,
|
|
561
|
+
// it's returned regardless of its type (the `fallback` path below).
|
|
562
|
+
//
|
|
563
|
+
// TypeScript is the first known language where this matters in
|
|
564
|
+
// practice: `const fn = () => {}` emits BOTH a `Function` def (from
|
|
565
|
+
// `@declaration.function` on the inner arrow) AND a `Variable` def
|
|
566
|
+
// (from the generic `@declaration.variable` pattern matching the
|
|
567
|
+
// wrapping `lexical_declaration`), and consumers of `import { fn }`
|
|
568
|
+
// need to bind to the callable. Other migrated languages don't
|
|
569
|
+
// currently produce dual emits of this shape, so the rule is a no-op
|
|
570
|
+
// for them today; future languages get the same correctness
|
|
571
|
+
// guarantee for free if they ever do.
|
|
572
|
+
//
|
|
573
|
+
// See `gitnexus/test/integration/resolvers/typescript-hof-callbacks.test.ts`
|
|
574
|
+
// for the cross-file regression this rule prevents.
|
|
575
|
+
let fallback;
|
|
544
576
|
for (const d of defs) {
|
|
545
|
-
if (deriveSimpleName(d)
|
|
577
|
+
if (deriveSimpleName(d) !== name)
|
|
578
|
+
continue;
|
|
579
|
+
if (isCallableOrTypeLike(d.type))
|
|
546
580
|
return d;
|
|
581
|
+
if (fallback === undefined)
|
|
582
|
+
fallback = d;
|
|
547
583
|
}
|
|
548
|
-
return
|
|
584
|
+
return fallback;
|
|
585
|
+
}
|
|
586
|
+
const CALLABLE_OR_TYPE_LIKE = new Set([
|
|
587
|
+
'Function',
|
|
588
|
+
'Method',
|
|
589
|
+
'Constructor',
|
|
590
|
+
'Class',
|
|
591
|
+
'Interface',
|
|
592
|
+
'Enum',
|
|
593
|
+
'Struct',
|
|
594
|
+
'Record',
|
|
595
|
+
'Trait',
|
|
596
|
+
'Namespace',
|
|
597
|
+
'Module',
|
|
598
|
+
'TypeAlias',
|
|
599
|
+
'Type',
|
|
600
|
+
'Typedef',
|
|
601
|
+
]);
|
|
602
|
+
function isCallableOrTypeLike(type) {
|
|
603
|
+
return CALLABLE_OR_TYPE_LIKE.has(type);
|
|
549
604
|
}
|
|
550
605
|
function countEdgesWithin(edgeIndex, files) {
|
|
551
606
|
let n = 0;
|