gitnexus 1.6.11-rc.8 → 1.6.11
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 +95 -26
- package/dist/_shared/graph/types.d.ts +81 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/integrations/circuit-breaker.d.ts.map +1 -1
- package/dist/_shared/integrations/circuit-breaker.js.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.d.ts.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.js.map +1 -1
- package/dist/_shared/language-detection.d.ts.map +1 -1
- package/dist/_shared/language-detection.js +2 -0
- package/dist/_shared/language-detection.js.map +1 -1
- package/dist/_shared/languages.d.ts +2 -1
- package/dist/_shared/languages.d.ts.map +1 -1
- package/dist/_shared/languages.js +1 -0
- package/dist/_shared/languages.js.map +1 -1
- package/dist/_shared/lbug/schema-constants.d.ts +2 -2
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
- package/dist/_shared/lbug/schema-constants.js +4 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -1
- package/dist/_shared/scope-resolution/evidence-weights.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.js +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.d.ts +3 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.js +4 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +10 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -1
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/scope-tree.js.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +15 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +4 -0
- package/dist/cli/ai-context.js +90 -14
- package/dist/cli/analyze-config.js +14 -0
- package/dist/cli/analyze-options.d.ts +14 -0
- package/dist/cli/analyze-watch.d.ts +20 -0
- package/dist/cli/analyze-watch.js +434 -0
- package/dist/cli/analyze.js +27 -9
- package/dist/cli/auto-sync.d.ts +1 -0
- package/dist/cli/auto-sync.js +107 -0
- package/dist/cli/command-banner.d.ts +15 -0
- package/dist/cli/command-banner.js +42 -0
- package/dist/cli/detect-changes-format.js +21 -0
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.js +14 -0
- package/dist/cli/group.js +7 -1
- package/dist/cli/help-i18n.js +4 -0
- package/dist/cli/i18n/en.d.ts +18 -3
- package/dist/cli/i18n/en.js +18 -3
- package/dist/cli/i18n/resources.d.ts +33 -3
- package/dist/cli/i18n/zh-CN.d.ts +15 -0
- package/dist/cli/i18n/zh-CN.js +18 -3
- package/dist/cli/index.js +34 -7
- package/dist/cli/mcp.d.ts +15 -0
- package/dist/cli/mcp.js +44 -0
- package/dist/cli/optional-grammars.d.ts +3 -2
- package/dist/cli/optional-grammars.js +19 -3
- package/dist/cli/setup.js +41 -15
- package/dist/cli/update-notice.d.ts +34 -0
- package/dist/cli/update-notice.js +91 -0
- package/dist/cli/update.d.ts +21 -0
- package/dist/cli/update.js +93 -0
- package/dist/cli/watch.d.ts +1 -20
- package/dist/cli/watch.js +5 -371
- package/dist/core/analysis-feature-registry.d.ts +2 -0
- package/dist/core/analysis-feature-registry.js +15 -0
- package/dist/core/analyzer-identity.js +21 -3
- package/dist/core/auto-sync/analysis-worker-launch.d.ts +30 -0
- package/dist/core/auto-sync/analysis-worker-launch.js +166 -0
- package/dist/core/auto-sync/config.d.ts +33 -0
- package/dist/core/auto-sync/config.js +320 -0
- package/dist/core/auto-sync/index.d.ts +6 -0
- package/dist/core/auto-sync/index.js +6 -0
- package/dist/core/auto-sync/path-security.d.ts +9 -0
- package/dist/core/auto-sync/path-security.js +251 -0
- package/dist/core/auto-sync/repo.d.ts +1 -0
- package/dist/core/auto-sync/repo.js +6 -0
- package/dist/core/auto-sync/runner.d.ts +44 -0
- package/dist/core/auto-sync/runner.js +428 -0
- package/dist/core/auto-sync/starter.d.ts +50 -0
- package/dist/core/auto-sync/starter.js +497 -0
- package/dist/core/auto-sync/state.d.ts +37 -0
- package/dist/core/auto-sync/state.js +119 -0
- package/dist/core/group/config-parser.js +8 -1
- package/dist/core/group/cross-impact.d.ts +3 -0
- package/dist/core/group/cross-impact.js +36 -4
- package/dist/core/group/extractors/http-patterns/java.js +22 -8
- package/dist/core/group/extractors/http-patterns/kotlin.js +86 -31
- package/dist/core/group/extractors/http-patterns/node.js +145 -8
- package/dist/core/group/extractors/http-patterns/python.js +11 -7
- package/dist/core/group/extractors/http-route-extractor.js +63 -17
- package/dist/core/group/extractors/java-workspace-extractor.js +244 -31
- package/dist/core/group/group-lock.js +5 -6
- package/dist/core/group/normalization.d.ts +38 -1
- package/dist/core/group/normalization.js +59 -3
- package/dist/core/group/service.d.ts +11 -0
- package/dist/core/group/service.js +13 -1
- package/dist/core/group/storage.js +2 -2
- package/dist/core/group/sync.d.ts +24 -1
- package/dist/core/group/sync.js +46 -8
- package/dist/core/group/types.d.ts +13 -0
- package/dist/core/incremental/derived-writeback.d.ts +36 -0
- package/dist/core/incremental/derived-writeback.js +68 -0
- package/dist/core/incremental/spring-config-drift.d.ts +12 -0
- package/dist/core/incremental/spring-config-drift.js +46 -0
- package/dist/core/incremental/subgraph-extract.d.ts +7 -4
- package/dist/core/incremental/subgraph-extract.js +30 -5
- package/dist/core/ingestion/asyncapi/document.d.ts +226 -0
- package/dist/core/ingestion/asyncapi/document.js +758 -0
- package/dist/core/ingestion/asyncapi/protocol.d.ts +79 -0
- package/dist/core/ingestion/asyncapi/protocol.js +203 -0
- package/dist/core/ingestion/call-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/zig.js +4 -0
- package/dist/core/ingestion/call-extractors/zig-static-gating.d.ts +100 -0
- package/dist/core/ingestion/call-extractors/zig-static-gating.js +319 -0
- package/dist/core/ingestion/call-processor.js +3 -1
- package/dist/core/ingestion/class-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/zig.js +32 -0
- package/dist/core/ingestion/class-extractors/generic.js +4 -1
- package/dist/core/ingestion/class-types.d.ts +6 -2
- package/dist/core/ingestion/destination-key.d.ts +59 -0
- package/dist/core/ingestion/destination-key.js +61 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +6 -2
- package/dist/core/ingestion/entry-point-scoring.js +8 -44
- package/dist/core/ingestion/export-detection.d.ts +37 -0
- package/dist/core/ingestion/export-detection.js +60 -0
- package/dist/core/ingestion/field-extractors/configs/zig.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/zig.js +49 -0
- package/dist/core/ingestion/field-extractors/generic.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/generic.js +12 -1
- package/dist/core/ingestion/frameworks/spring/actuator-runtime.d.ts +26 -0
- package/dist/core/ingestion/frameworks/spring/actuator-runtime.js +843 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.d.ts +5 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.js +9 -0
- package/dist/core/ingestion/frameworks/spring/annotation-arguments.js +8 -1
- package/dist/core/ingestion/frameworks/spring/argument-facts.d.ts +80 -0
- package/dist/core/ingestion/frameworks/spring/argument-facts.js +85 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.d.ts +1 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.js +2 -1
- package/dist/core/ingestion/frameworks/spring/destinations.d.ts +539 -0
- package/dist/core/ingestion/frameworks/spring/destinations.js +840 -0
- package/dist/core/ingestion/frameworks/spring/dynamic-lookups.d.ts +22 -0
- package/dist/core/ingestion/frameworks/spring/dynamic-lookups.js +124 -0
- package/dist/core/ingestion/frameworks/spring/message-producers.d.ts +78 -0
- package/dist/core/ingestion/frameworks/spring/message-producers.js +90 -0
- package/dist/core/ingestion/frameworks/spring/non-http-handlers.d.ts +29 -0
- package/dist/core/ingestion/frameworks/spring/vendor-prefixes.d.ts +7 -0
- package/dist/core/ingestion/frameworks/spring/vendor-prefixes.js +22 -0
- package/dist/core/ingestion/import-resolvers/configs/zig.d.ts +13 -0
- package/dist/core/ingestion/import-resolvers/configs/zig.js +26 -0
- package/dist/core/ingestion/import-resolvers/zig.d.ts +34 -0
- package/dist/core/ingestion/import-resolvers/zig.js +193 -0
- package/dist/core/ingestion/language-config.d.ts +177 -0
- package/dist/core/ingestion/language-config.js +719 -0
- package/dist/core/ingestion/language-provider.d.ts +178 -1
- package/dist/core/ingestion/language-provider.js +22 -0
- package/dist/core/ingestion/languages/csharp/razor-view-components.d.ts +62 -0
- package/dist/core/ingestion/languages/csharp/razor-view-components.js +954 -0
- package/dist/core/ingestion/languages/csharp/resolution-config.d.ts +3 -0
- package/dist/core/ingestion/languages/csharp/resolution-config.js +6 -1
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -0
- package/dist/core/ingestion/languages/index.d.ts +1 -0
- package/dist/core/ingestion/languages/index.js +2 -0
- package/dist/core/ingestion/languages/java/analysis-features.d.ts +1 -1
- package/dist/core/ingestion/languages/java/analysis-features.js +14 -6
- package/dist/core/ingestion/languages/java/capture-side-channel.d.ts +8 -0
- package/dist/core/ingestion/languages/java/capture-side-channel.js +34 -0
- package/dist/core/ingestion/languages/java/captures.js +22 -1
- package/dist/core/ingestion/languages/java/lombok-synthesizer.d.ts +42 -0
- package/dist/core/ingestion/languages/java/lombok-synthesizer.js +439 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -0
- package/dist/core/ingestion/languages/java/spring-actuator.d.ts +2 -0
- package/dist/core/ingestion/languages/java/spring-actuator.js +62 -0
- package/dist/core/ingestion/languages/java/spring-di.d.ts +17 -1
- package/dist/core/ingestion/languages/java/spring-di.js +44 -2
- package/dist/core/ingestion/languages/java/spring-dynamic-lookup.d.ts +8 -0
- package/dist/core/ingestion/languages/java/spring-dynamic-lookup.js +62 -0
- package/dist/core/ingestion/languages/java/spring-message-producers.d.ts +20 -0
- package/dist/core/ingestion/languages/java/spring-message-producers.js +83 -0
- package/dist/core/ingestion/languages/java/spring-non-http-handlers.d.ts +11 -1
- package/dist/core/ingestion/languages/java/spring-non-http-handlers.js +13 -3
- package/dist/core/ingestion/languages/java.js +18 -8
- package/dist/core/ingestion/languages/jvm/accessor-synthesis.d.ts +99 -0
- package/dist/core/ingestion/languages/jvm/accessor-synthesis.js +173 -0
- package/dist/core/ingestion/languages/jvm/beanspec.d.ts +17 -0
- package/dist/core/ingestion/languages/jvm/beanspec.js +42 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +15 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +50 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +24 -1
- package/dist/core/ingestion/languages/kotlin/lombok-synthesizer.d.ts +26 -0
- package/dist/core/ingestion/languages/kotlin/lombok-synthesizer.js +417 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +4 -0
- package/dist/core/ingestion/languages/kotlin/spring-actuator.d.ts +4 -0
- package/dist/core/ingestion/languages/kotlin/spring-actuator.js +172 -0
- package/dist/core/ingestion/languages/kotlin/spring-config-bindings.d.ts +18 -0
- package/dist/core/ingestion/languages/kotlin/spring-config-bindings.js +411 -0
- package/dist/core/ingestion/languages/kotlin/spring-di.d.ts +51 -1
- package/dist/core/ingestion/languages/kotlin/spring-di.js +86 -6
- package/dist/core/ingestion/languages/kotlin/spring-dynamic-lookup.d.ts +8 -0
- package/dist/core/ingestion/languages/kotlin/spring-dynamic-lookup.js +77 -0
- package/dist/core/ingestion/languages/kotlin/spring-message-producers.d.ts +17 -0
- package/dist/core/ingestion/languages/kotlin/spring-message-producers.js +119 -0
- package/dist/core/ingestion/languages/kotlin/spring-non-http-handlers.d.ts +16 -0
- package/dist/core/ingestion/languages/kotlin/spring-non-http-handlers.js +77 -2
- package/dist/core/ingestion/languages/kotlin.js +24 -0
- package/dist/core/ingestion/languages/python.js +2 -0
- package/dist/core/ingestion/languages/rust/query.js +8 -8
- package/dist/core/ingestion/languages/zig/captures.d.ts +260 -0
- package/dist/core/ingestion/languages/zig/captures.js +2070 -0
- package/dist/core/ingestion/languages/zig/index.d.ts +4 -0
- package/dist/core/ingestion/languages/zig/index.js +4 -0
- package/dist/core/ingestion/languages/zig/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/zig/interpret.js +176 -0
- package/dist/core/ingestion/languages/zig/query.d.ts +3 -0
- package/dist/core/ingestion/languages/zig/query.js +426 -0
- package/dist/core/ingestion/languages/zig/range-binding.d.ts +37 -0
- package/dist/core/ingestion/languages/zig/range-binding.js +373 -0
- package/dist/core/ingestion/languages/zig/scope-resolver.d.ts +12 -0
- package/dist/core/ingestion/languages/zig/scope-resolver.js +58 -0
- package/dist/core/ingestion/languages/zig/simple-hooks.d.ts +25 -0
- package/dist/core/ingestion/languages/zig/simple-hooks.js +143 -0
- package/dist/core/ingestion/languages/zig.d.ts +32 -0
- package/dist/core/ingestion/languages/zig.js +130 -0
- package/dist/core/ingestion/method-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/zig.js +120 -0
- package/dist/core/ingestion/method-extractors/generic.js +16 -4
- package/dist/core/ingestion/method-types.d.ts +10 -4
- package/dist/core/ingestion/model/field-registry.d.ts +3 -3
- package/dist/core/ingestion/model/field-registry.js +11 -7
- package/dist/core/ingestion/model/method-registry.d.ts +3 -3
- package/dist/core/ingestion/model/method-registry.js +13 -8
- package/dist/core/ingestion/model/registration-table.js +3 -0
- package/dist/core/ingestion/model/type-registry.js +8 -4
- package/dist/core/ingestion/pipeline-phases/di.js +47 -14
- 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/parse-impl.d.ts +7 -1
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +79 -91
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +2 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +39 -4
- package/dist/core/ingestion/pipeline-phases/routes.js +27 -18
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +4 -1
- package/dist/core/ingestion/pipeline-phases/runner.js +34 -14
- package/dist/core/ingestion/pipeline-phases/scan.js +82 -1
- package/dist/core/ingestion/pipeline-phases/spring-auto-configuration.d.ts +2 -0
- package/dist/core/ingestion/pipeline-phases/spring-auto-configuration.js +8 -0
- package/dist/core/ingestion/pipeline-phases/spring-destinations.d.ts +123 -0
- package/dist/core/ingestion/pipeline-phases/spring-destinations.js +688 -0
- package/dist/core/ingestion/pipeline.d.ts +30 -1
- package/dist/core/ingestion/pipeline.js +52 -14
- package/dist/core/ingestion/resolve-references.js +5 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.d.ts +16 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.js +10 -0
- package/dist/core/ingestion/route-extractors/java-const-resolver.d.ts +27 -1
- package/dist/core/ingestion/route-extractors/java-const-resolver.js +161 -13
- package/dist/core/ingestion/route-extractors/kotlin-const-resolver.d.ts +12 -18
- package/dist/core/ingestion/route-extractors/kotlin-const-resolver.js +214 -33
- package/dist/core/ingestion/route-extractors/kotlin-spring.d.ts +13 -0
- package/dist/core/ingestion/route-extractors/kotlin-spring.js +259 -0
- package/dist/core/ingestion/route-extractors/python-decorator-handler.d.ts +6 -0
- package/dist/core/ingestion/route-extractors/python-decorator-handler.js +16 -0
- package/dist/core/ingestion/route-extractors/spring-shared.d.ts +30 -1
- package/dist/core/ingestion/route-extractors/spring-shared.js +77 -9
- package/dist/core/ingestion/route-extractors/spring.js +9 -5
- package/dist/core/ingestion/scope-extractor.js +8 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +62 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +4 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +2 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +28 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +11 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +23 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +24 -3
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.d.ts +11 -1
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.js +26 -6
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +11 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +29 -3
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +8 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +35 -9
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +1 -4
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +277 -9
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +2 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +7 -3
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +43 -9
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +71 -10
- package/dist/core/ingestion/tree-sitter-queries.d.ts +1 -0
- package/dist/core/ingestion/tree-sitter-queries.js +161 -0
- package/dist/core/ingestion/type-extractors/zig.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/zig.js +17 -0
- package/dist/core/ingestion/utils/ast-helpers.d.ts +40 -1
- package/dist/core/ingestion/utils/ast-helpers.js +124 -6
- package/dist/core/ingestion/utils/callable-flow-captures.d.ts +9 -0
- package/dist/core/ingestion/utils/callable-flow-captures.js +75 -14
- package/dist/core/ingestion/utils/test-file-path.d.ts +28 -0
- package/dist/core/ingestion/utils/test-file-path.js +87 -0
- package/dist/core/ingestion/variable-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/zig.js +71 -0
- package/dist/core/ingestion/workers/parse-worker.js +85 -14
- package/dist/core/install-context.d.ts +4 -0
- package/dist/core/install-context.js +152 -0
- package/dist/core/lbug/csv-generator.d.ts +10 -1
- package/dist/core/lbug/csv-generator.js +92 -22
- package/dist/core/lbug/graph-emit-sink.d.ts +3 -2
- package/dist/core/lbug/graph-emit-sink.js +4 -2
- package/dist/core/lbug/lbug-adapter.d.ts +100 -5
- package/dist/core/lbug/lbug-adapter.js +236 -24
- package/dist/core/lbug/schema.d.ts +6 -5
- package/dist/core/lbug/schema.js +84 -22
- package/dist/core/net/url-guard.d.ts +6 -0
- package/dist/core/net/url-guard.js +147 -0
- package/dist/core/package-version.d.ts +5 -0
- package/dist/core/package-version.js +10 -0
- package/dist/core/run-analyze.d.ts +21 -4
- package/dist/core/run-analyze.js +426 -117
- package/dist/core/search/fts-indexes.d.ts +19 -1
- package/dist/core/search/fts-indexes.js +28 -1
- package/dist/core/tree-sitter/parser-loader.js +16 -0
- package/dist/core/update-cache.d.ts +39 -0
- package/dist/core/update-cache.js +141 -0
- package/dist/core/update-check.d.ts +31 -0
- package/dist/core/update-check.js +274 -0
- package/dist/mcp/local/local-backend.d.ts +27 -13
- package/dist/mcp/local/local-backend.js +148 -60
- package/dist/mcp/repository-policy.d.ts +5 -1
- package/dist/mcp/repository-policy.js +48 -4
- package/dist/mcp/resources.js +10 -1
- package/dist/mcp/server.js +8 -9
- package/dist/mcp/tools.js +32 -22
- package/dist/server/analyze-launch.d.ts +2 -0
- package/dist/server/analyze-launch.js +2 -0
- package/dist/server/analyze-worker-protocol.d.ts +6 -1
- package/dist/server/analyze-worker.d.ts +1 -0
- package/dist/server/analyze-worker.js +38 -20
- package/dist/server/api.d.ts +5 -1
- package/dist/server/api.js +105 -88
- package/dist/server/git-clone.d.ts +40 -16
- package/dist/server/git-clone.js +253 -199
- package/dist/server/grep-params.d.ts +18 -0
- package/dist/server/grep-params.js +83 -0
- package/dist/server/grep-scan.d.ts +23 -0
- package/dist/server/grep-scan.js +107 -0
- package/dist/server/grep-worker.d.ts +1 -0
- package/dist/server/grep-worker.js +12 -0
- package/dist/server/mcp-http.d.ts +8 -0
- package/dist/server/mcp-http.js +16 -1
- package/dist/server/update-controller.d.ts +29 -0
- package/dist/server/update-controller.js +82 -0
- package/dist/storage/file-lock.d.ts +15 -0
- package/dist/storage/file-lock.js +155 -0
- package/dist/storage/fs-atomic.d.ts +24 -0
- package/dist/storage/fs-atomic.js +86 -2
- package/dist/storage/global-dir.d.ts +2 -0
- package/dist/storage/global-dir.js +6 -0
- package/dist/storage/parse-cache.d.ts +45 -7
- package/dist/storage/parse-cache.js +189 -42
- package/dist/storage/parsedfile-store.d.ts +41 -60
- package/dist/storage/parsedfile-store.js +247 -171
- package/dist/storage/repo-manager.d.ts +10 -4
- package/dist/storage/repo-manager.js +35 -25
- package/dist/storage/repo-meta.d.ts +34 -0
- package/dist/storage/v8-sidecar.d.ts +48 -0
- package/dist/storage/v8-sidecar.js +347 -0
- package/dist/types/pipeline.d.ts +14 -0
- package/dist/utils/process-identity.d.ts +2 -0
- package/dist/utils/process-identity.js +35 -0
- package/package.json +10 -4
- package/scripts/assert-web-assets.mjs +35 -0
- package/scripts/build-web.js +72 -0
- package/scripts/build.js +31 -28
- package/scripts/cross-platform-tests.ts +5 -0
- package/skills/gitnexus-cli.md +5 -1
- package/web/assets/ProcessFlowModal-DAeX2BHW.js +24 -0
- package/web/assets/{abnfDiagram-QNN2D4NM-Cq2djWWe.js → abnfDiagram-PAR5IXJI-J3OdeHLl.js} +1 -1
- package/web/assets/{agent-BWAXPjC5.js → agent-BMRqXorA.js} +6 -4
- package/web/assets/architecture-7GRP2DOG-M7G3SWCO-G3sWyX6M.js +1 -0
- package/web/assets/architectureDiagram-2PNWDENW-ysKcRlGT.js +36 -0
- package/web/assets/blockDiagram-PUWGUBOA-oLXTa1lY.js +129 -0
- package/web/assets/c4Diagram-3NLNHZP5-D3iu4eC0.js +38 -0
- package/web/assets/{chunk-2SREHG4O-Dip42xOq.js → chunk-2NMSUPJH-B24w-wng.js} +1 -1
- package/web/assets/{chunk-VJFVEZTB-CX66F2ep.js → chunk-32MCUW2P-ByUyt0Sa.js} +3 -3
- package/web/assets/{chunk-4RFN2BYJ-DHHWuC-n.js → chunk-3NPNU5GP-DocZ07Sg.js} +1 -1
- package/web/assets/{chunk-XNMVGMAZ-Cg_LnPtj.js → chunk-3SMGFRGC-CAu4JRLv.js} +1 -1
- package/web/assets/{chunk-W44A43WB-BN8EQc_u.js → chunk-4CAJECRU-DRYMwG9z.js} +1 -1
- package/web/assets/chunk-4OADUZ5Q-CxrSvOwZ.js +10 -0
- package/web/assets/{chunk-DMV4VAQV-Bn6WXDSX.js → chunk-5IQCK5RY-CCMhl4so.js} +2 -2
- package/web/assets/{chunk-RRFMTAIC-CMN0wcYA.js → chunk-5MVFYWFU-Db9KvrYO.js} +1 -1
- package/web/assets/chunk-CLS4B6BI-Uvx5QNsu.js +168 -0
- package/web/assets/chunk-DZP67EKU-B3Mt380j.js +70 -0
- package/web/assets/{chunk-6L755F7B-CMhLBxi2.js → chunk-EICP7K5X-CqwE9hui.js} +1 -1
- package/web/assets/{chunk-BI6VK774-D0oaWk8V.js → chunk-GDY2UAB4-CtQQR0a8.js} +1 -1
- package/web/assets/chunk-H7VHZCWX-CE1nAmt6.js +1 -0
- package/web/assets/chunk-IJBDOHL6-BUKtY6oF.js +1 -0
- package/web/assets/{chunk-OIYT25JQ-CQ6KOZGX.js → chunk-JFFVMJIA-0fJenqia.js} +1 -1
- package/web/assets/{chunk-HNC4WDU7-DoU3KnA7.js → chunk-JZGDI5JK-BeTMSSkJ.js} +1 -1
- package/web/assets/{chunk-EQFTRU2I-1ix7TzW9.js → chunk-KD6SPIPN-Qp1Pflah.js} +1 -1
- package/web/assets/chunk-NF366YI6-CpSpya3n.js +231 -0
- package/web/assets/chunk-NUDPKBEF-CU1-BQIW.js +34 -0
- package/web/assets/{chunk-SATU7PGQ-B1zhgOvc.js → chunk-OJINMHTS-zOCQe4eI.js} +1 -1
- package/web/assets/{chunk-E5QJAATJ-dh-5CtIV.js → chunk-Q6NGPIAH-yyBomb63.js} +1 -1
- package/web/assets/chunk-QJSWEUOL-D_rf9gPD.js +128 -0
- package/web/assets/chunk-R7JDMUKV-CRoqKpD6.js +1 -0
- package/web/assets/{chunk-VE5CLXGZ-C1vB7wpY.js → chunk-RCXAM2GK-CUqrWQDV.js} +1 -1
- package/web/assets/{chunk-66DQ2XMT-CM0xjFAN.js → chunk-RT4MAWR3-zXy9-Lvt.js} +1 -1
- package/web/assets/{chunk-TZUXEDM2-B7p9AcTw.js → chunk-SFMINX4W-J2UrvMpD.js} +1 -1
- package/web/assets/{chunk-LORZLZWG-B57uGw2N.js → chunk-SLDQ463B-CHY6e_bQ.js} +2 -2
- package/web/assets/{chunk-FWYVLQTC-BgDItRzJ.js → chunk-TCEHX7R3-CXPDEVbm.js} +1 -1
- package/web/assets/{chunk-224SPVON-B8gxtXpy.js → chunk-VQC2EELJ-Dc8fIy4R.js} +1 -1
- package/web/assets/chunk-VRZKL3EH-DB3KixTQ.js +1 -0
- package/web/assets/{chunk-A7VWPJGB-B4O3oQdQ.js → chunk-VTHDQ7BV-b7FsPQZO.js} +1 -1
- package/web/assets/chunk-VY2OSTJR-Dkgc3Brg.js +2 -0
- package/web/assets/chunk-WUBWJARI-7FwILJ3k.js +2 -0
- package/web/assets/{chunk-D6VWDJW2-BxcBdZ9c.js → chunk-YBMQ5JGJ-BSnyWZmd.js} +1 -1
- package/web/assets/chunk-YDMLL4PJ-IHhMngTz.js +2 -0
- package/web/assets/chunk-Z6V44ARX-BjCEsF0Q.js +62 -0
- package/web/assets/chunk-ZJJ7VQJP-Dz089b-K.js +321 -0
- package/web/assets/chunk-ZNLK7HRR-B0iFpmW4.js +1 -0
- package/web/assets/chunk-ZQN7UHIL-Cy7KAjQt.js +1 -0
- package/web/assets/{chunk-L5GCOVLC-CE2w8Nm_.js → chunk-ZS6VBONO-DBjJO0w9.js} +2 -2
- package/web/assets/{chunk-NV3KIAZN-5yvcpMiu.js → chunk-ZUNWM646-DNRJyNPe.js} +1 -1
- package/web/assets/classDiagram-FGAMPOII-C5Ibyode.js +1 -0
- package/web/assets/classDiagram-v2-AI5RJEK4-C5Ibyode.js +1 -0
- package/web/assets/{cose-bilkent-RZA4XIPR-BHpK4Crp.js → cose-bilkent-Q72C2OJ3-DMeFXnK8.js} +1 -1
- package/web/assets/cynefin-OW5HDTMX-6OCTWOGG-vlqakYcO.js +1 -0
- package/web/assets/{cynefinDiagram-TR7LZUCG-C3Iar9lZ.js → cynefinDiagram-2OOWUY4M-BY6DZkTt.js} +1 -1
- package/web/assets/dagre-MPVFI544-DWO70fy_.js +4 -0
- package/web/assets/diagram-AE4NWXFW-f7JRVRUL.js +24 -0
- package/web/assets/{diagram-L7DVE3PN-GIRyVUtt.js → diagram-BUJID5UG-BXZv1rCS.js} +2 -2
- package/web/assets/{diagram-JCD7PQ7C-DC5-9FRr.js → diagram-C44CZ5NI-CRNfvjCq.js} +1 -1
- package/web/assets/diagram-EYOLEXXS-DZOjKQVE.js +30 -0
- package/web/assets/diagram-P7B6PWOJ-D3SQmw3_.js +3 -0
- package/web/assets/{ebnfDiagram-DRHRQJWO-D8_CI4ZF.js → ebnfDiagram-FTPZ3PV6-jKWpIDN2.js} +1 -1
- package/web/assets/erDiagram-H3ERR26V-BqJntEuJ.js +99 -0
- package/web/assets/eventmodeling-NTZA5JFV-WKSWQHFS-Bq4FqtBL.js +1 -0
- package/web/assets/flowDiagram-YHGXBVSY-Dnlk2bEu.js +1 -0
- package/web/assets/ganttDiagram-RWFTB7ED-Bl6Y1K5T.js +292 -0
- package/web/assets/gitGraph-4MIJSDKK-JH2HKYUO-B3yc4GkH.js +1 -0
- package/web/assets/gitGraphDiagram-MAR6GKOP-CkNvsrdw.js +106 -0
- package/web/assets/{index-CJDpyH-n.css → index-C2_aej58.css} +1 -1
- package/web/assets/{index-DDRie6_8.js → index-Dj3vQOHK.js} +51 -51
- package/web/assets/info-A6RAGUB7-3TX3OFWW-BM3N5_Dv.js +1 -0
- package/web/assets/infoDiagram-LV547AFH-COkFutAf.js +2 -0
- package/web/assets/{ishikawaDiagram-4JDSWWDM-DmqWtjkl.js → ishikawaDiagram-PUJQGNDS-Bb8FylSR.js} +2 -2
- package/web/assets/{journeyDiagram-QUS3FAKT-XAzVzrQW.js → journeyDiagram-EW5QJT4W-BzoHUBhM.js} +4 -4
- package/web/assets/{kanban-definition-D4L7SQKK-YurRnmYn.js → kanban-definition-JSQERAZB-Uy2Pi0yQ.js} +4 -4
- package/web/assets/katex-CZ4GXH2S-C0Fcou7U.js +257 -0
- package/web/assets/{mindmap-definition-66QP5TD6-ChrWWnil.js → mindmap-definition-VBJCLQLM-B-CnOnt_.js} +3 -3
- package/web/assets/packet-AYTQ26CC-MKII6P3Y-Bd52ZE3V.js +1 -0
- package/web/assets/{pegDiagram-YKIO5C6U-QGeQLEq2.js → pegDiagram-7WILOQTJ-D9sneKXg.js} +1 -1
- package/web/assets/pie-WAS4IAKB-6B4OPMJ5-DW5Xy69Z.js +1 -0
- package/web/assets/pieDiagram-EFA7CBSB-Dx2NQofL.js +39 -0
- package/web/assets/{quadrantDiagram-VO5QLCXA-B7098wSc.js → quadrantDiagram-WARVYA7P-DPKL9_0A.js} +3 -3
- package/web/assets/radar-RG4KPBEZ-UPTR3XUL-CkzibT2h.js +1 -0
- package/web/assets/railroad-74A4TZTK-MEFUPFMS-D9zF-mDN.js +1 -0
- package/web/assets/railroad-abnf-HS5TGJTU-R5YG2S5D-ruacjUbX.js +1 -0
- package/web/assets/railroad-ebnf-LZEXJU2U-G5QEX2L6-S1zc5OiO.js +1 -0
- package/web/assets/railroad-peg-WCYAUIDC-H5I2ZRY2-Cbcr0XzY.js +1 -0
- package/web/assets/{railroadDiagram-M77LTMSB-AXu4vxk_.js → railroadDiagram-5NIQVNLQ-DsweTo14.js} +1 -1
- package/web/assets/{requirementDiagram-RASO5HTO-B-l8InpK.js → requirementDiagram-SXREGOKZ-CXwdNSVR.js} +4 -4
- package/web/assets/{sankeyDiagram-F32LOJ6L-Kd7zjJgX.js → sankeyDiagram-VV74M2VP-CA6jtP9P.js} +3 -3
- package/web/assets/{sequenceDiagram-URATNSBD-BlcdY9DS.js → sequenceDiagram-52ZFIFDL-k_5rEbzm.js} +15 -15
- package/web/assets/src-Df5C1Nz4.js +1 -0
- package/web/assets/stateDiagram-3QAKPIVI-BejHTf31.js +1 -0
- package/web/assets/stateDiagram-v2-HN2P4RDZ-BrfoRuOc.js +1 -0
- package/web/assets/swimlanes-QLVP42QD-CQSVO5D6.js +1 -0
- package/web/assets/swimlanesDiagram-JKPDBFCN-DrWB9kcD.js +8 -0
- package/web/assets/{timeline-definition-WJXWRH4I-DUfp1R3E.js → timeline-definition-GS45XAXW-C0Ks8rPP.js} +4 -4
- package/web/assets/treeView-Q6P3EWNA-ZRJGANNQ-DmKOCo6L.js +1 -0
- package/web/assets/treemap-WGGIJYW6-K64VN5AS-DO3xY92U.js +1 -0
- package/web/assets/{vennDiagram-K3VCMQLI-Bj-FN-XS.js → vennDiagram-QIQU2ZRJ-rgPiS837.js} +3 -3
- package/web/assets/wardley-WFR3VGLG-D67OWCCH-DiDPBNft.js +1 -0
- package/web/assets/wardleyDiagram-U6YNM66N-DRVr7SPi.js +78 -0
- package/web/assets/{xychartDiagram-5VRUVLCW-CK_rbSWE.js → xychartDiagram-XJAZEDNM-COtlZzYb.js} +3 -3
- package/web/index.html +19 -17
- package/web/assets/ProcessFlowModal-Badh2Pbg.js +0 -24
- package/web/assets/architecture-TIHT7OUA-V6N4J3SY-fTePvLoe.js +0 -1
- package/web/assets/architectureDiagram-OT7VKSJ7-mKEXxkeF.js +0 -36
- package/web/assets/blockDiagram-54WLDVWM-Dg_hrRWE.js +0 -132
- package/web/assets/c4Diagram-X2LASM7V-CnhoT4aV.js +0 -10
- package/web/assets/chunk-2AEHWXPW-CV4r6-1I.js +0 -127
- package/web/assets/chunk-5VCL7Z4A-CQ-2dYWj.js +0 -1
- package/web/assets/chunk-6BELYETK-ChsYtfHW.js +0 -1
- package/web/assets/chunk-7CWYLC5S-DRgGkkpF.js +0 -2
- package/web/assets/chunk-7FYTHRHK-CsmYIswB.js +0 -32
- package/web/assets/chunk-KRXBNO2N-C-UNuKKf.js +0 -1
- package/web/assets/chunk-LAHSG3N2-Bz4hcn0N.js +0 -321
- package/web/assets/chunk-LIEV3EAG-pyKGssV3.js +0 -1
- package/web/assets/chunk-NLANEA3F-XpH_NPA5.js +0 -62
- package/web/assets/chunk-PE7DX7ZZ-CCvRVj43.js +0 -10
- package/web/assets/chunk-Q67WD55A-BWCH2SVz.js +0 -156
- package/web/assets/chunk-SZD42YQK-ijyKKVr1.js +0 -70
- package/web/assets/chunk-TFPGFQPA-Dj6a-0pC.js +0 -231
- package/web/assets/chunk-TGVD4F4B-BMc31Gj2.js +0 -2
- package/web/assets/chunk-UAT7B5JY-DW-A_fpI.js +0 -1
- package/web/assets/chunk-VY5UBI4V-yxPQAWxw.js +0 -1
- package/web/assets/chunk-WJBAP47W-BckNkuEN.js +0 -1
- package/web/assets/classDiagram-VPOSVPXH-BjOiXA_C.js +0 -1
- package/web/assets/classDiagram-v2-5VFNUXQA-BjOiXA_C.js +0 -1
- package/web/assets/cynefin-VYW2F7L2-2VAHYKR6-DAsF6GZv.js +0 -1
- package/web/assets/dagre-K64A6Z3X-CUwi79mA.js +0 -4
- package/web/assets/diagram-2TLGJV2N-C2F5Nfym.js +0 -30
- package/web/assets/diagram-KFBZAVDW-Dfmf_4ti.js +0 -3
- package/web/assets/diagram-YP3FGXHI-CyNFYtkd.js +0 -24
- package/web/assets/erDiagram-SZLJLQMB-CohQjznC.js +0 -85
- package/web/assets/eventmodeling-45OFAUF4-AOUJWSLX-BvTc6iQi.js +0 -1
- package/web/assets/flowDiagram-BWE6NHOH-B6RnEvD9.js +0 -1
- package/web/assets/ganttDiagram-2QTCJSNI-Cks_mEcF.js +0 -292
- package/web/assets/gitGraph-TEB2WS4Q-U5VWYIBC-Dy7CCSZ5.js +0 -1
- package/web/assets/gitGraphDiagram-VVZAVV5G-CG41cIVc.js +0 -106
- package/web/assets/info-DKCQHKI2-DX6KST54-BLJg1ikX.js +0 -1
- package/web/assets/infoDiagram-FY4PZKRE-BJ3vPVwW.js +0 -2
- package/web/assets/katex-C5OPUE3Q-Bnbavtmu.js +0 -257
- package/web/assets/packet-7NZHBO7P-5WG45QPS-KUxcuvaA.js +0 -1
- package/web/assets/pie-RZYD4A2V-2OCZ2VTD-DPs08kJY.js +0 -1
- package/web/assets/pieDiagram-YPY3TKG5-BuT3MYzm.js +0 -39
- package/web/assets/radar-I7S5WNFK-EPLSA35B-w5F0K3a7.js +0 -1
- package/web/assets/railroad-3IZDKUUU-PWFQV6Y6-Bu668yqY.js +0 -1
- package/web/assets/railroad-abnf-AHOZXSZD-JYYJX3BS-B6ghpETS.js +0 -1
- package/web/assets/railroad-ebnf-EBAXGLYW-RBZ4ONAP-D-XmHh3M.js +0 -1
- package/web/assets/railroad-peg-LSFZ7HO6-KHNPXGPG-mhkrhzEn.js +0 -1
- package/web/assets/src-C5sx_gMp.js +0 -1
- package/web/assets/stateDiagram-DODFXNG5-DTdHc-fF.js +0 -1
- package/web/assets/stateDiagram-v2-JNMM5JRA-DioNLDDo.js +0 -1
- package/web/assets/swimlanes-OSWOYLSK-CA0ofdwY.js +0 -2
- package/web/assets/swimlanesDiagram-RHGX2RDE-PkwUdckC.js +0 -8
- package/web/assets/treeView-QDETBFTQ-EHYTSQNO-C5lpBgPm.js +0 -1
- package/web/assets/treemap-6X3UGDF4-CCWCF7EK-BB0ZyO-B.js +0 -1
- package/web/assets/wardley-OPB4EBWU-6OWERDVT-CEA3Nq0j.js +0 -1
- package/web/assets/wardleyDiagram-XK6FUAWV-CVV0dHFr.js +0 -78
- /package/web/assets/{sizeCapture-5GORAGP4-BEqQzsxs.js → sizeCapture-FGA5AGYP-BEqQzsxs.js} +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zig module import resolution — internal helpers.
|
|
3
|
+
*
|
|
4
|
+
* Zig imports take three shapes:
|
|
5
|
+
* const std = @import("std"); → stdlib, unresolvable
|
|
6
|
+
* const builtin = @import("builtin"); → compiler builtin, unresolvable
|
|
7
|
+
* const root = @import("root"); → user's main module, unresolvable here
|
|
8
|
+
* const foo = @import("./foo.zig"); → relative path
|
|
9
|
+
* const foo = @import("foo.zig"); → also relative (Zig treats unprefixed
|
|
10
|
+
* paths with a `.zig` extension as
|
|
11
|
+
* filesystem-relative to the importer)
|
|
12
|
+
* const lp = @import("lightpanda"); → the repo's OWN module, declared by
|
|
13
|
+
* its root build.zig (`b.addModule`)
|
|
14
|
+
* const bar = @import("bar"); → package dep declared in build.zig.zon
|
|
15
|
+
*
|
|
16
|
+
* Bare-name resolution is handled when a parsed ZigBuildZonConfig is
|
|
17
|
+
* supplied (see `loadZigBuildConfig`). The import table of the build module
|
|
18
|
+
* the importer belongs to comes first (`buildModules` — per-module
|
|
19
|
+
* `addImport` aliases, see `zigModulesContaining`), then the root
|
|
20
|
+
* build.zig's named modules flattened repo-wide (`rootModules`, name → root
|
|
21
|
+
* file — a repo with no build.zig.zon still resolves them). `.url`-based deps unpack into a build cache outside
|
|
22
|
+
* the repo and so are returned as null; `.path`-based deps are resolved
|
|
23
|
+
* through the root the dep's own build.zig declares, then the conventional
|
|
24
|
+
* `<dep_root>/src/root.zig`, `<dep_root>/src/<name>.zig`,
|
|
25
|
+
* `<dep_root>/src/main.zig` layouts.
|
|
26
|
+
*/
|
|
27
|
+
import { normalizeZigDepPath, } from '../language-config.js';
|
|
28
|
+
const ZIG_STDLIB_NAMES = new Set(['std', 'builtin', 'root']);
|
|
29
|
+
/**
|
|
30
|
+
* The build module(s) a source file belongs to: the module whose ROOT the
|
|
31
|
+
* file is, else the module(s) whose root's directory is the deepest prefix
|
|
32
|
+
* of the file's path. Membership is not declared anywhere static — a module
|
|
33
|
+
* is its root plus whatever that root reaches through relative imports —
|
|
34
|
+
* so the directory is the proxy, and several modules may share one
|
|
35
|
+
* (`src/main.zig` executable beside `src/root.zig` library is the `zig init`
|
|
36
|
+
* layout). A root file is unambiguous by construction: it is its own module.
|
|
37
|
+
*/
|
|
38
|
+
function zigModulesContaining(currentFile, modules) {
|
|
39
|
+
const own = modules.filter((m) => m.root === currentFile);
|
|
40
|
+
if (own.length > 0)
|
|
41
|
+
return own;
|
|
42
|
+
let best = -1;
|
|
43
|
+
let out = [];
|
|
44
|
+
for (const mod of modules) {
|
|
45
|
+
const slash = mod.root.lastIndexOf('/');
|
|
46
|
+
const dir = slash === -1 ? '' : mod.root.slice(0, slash);
|
|
47
|
+
if (dir !== '' && !currentFile.startsWith(`${dir}/`))
|
|
48
|
+
continue;
|
|
49
|
+
if (dir.length > best) {
|
|
50
|
+
best = dir.length;
|
|
51
|
+
out = [mod];
|
|
52
|
+
}
|
|
53
|
+
else if (dir.length === best) {
|
|
54
|
+
out.push(mod);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A bare `@import("<name>")` through the containing module(s)' own import
|
|
61
|
+
* tables. `undefined` when no containing module binds the name (the caller
|
|
62
|
+
* falls back to the repo-wide tables); `null` when the containing modules
|
|
63
|
+
* DISAGREE — two same-directory modules that bind one alias to different
|
|
64
|
+
* roots — or when ANY containing module binds the alias to a root that is
|
|
65
|
+
* not indexed (a generated or skipped file), including the mixed case
|
|
66
|
+
* where a sibling module's target *is* indexed. Both are fail-closed on purpose: the module's
|
|
67
|
+
* own table is the authority for the alias, and falling through to the
|
|
68
|
+
* repo-wide map would reintroduce the first-wins answer this table exists
|
|
69
|
+
* to remove, under a name the module never meant.
|
|
70
|
+
*/
|
|
71
|
+
function resolveThroughBuildModules(currentFile, importPath, allFiles, modules) {
|
|
72
|
+
const targets = new Set();
|
|
73
|
+
for (const mod of zigModulesContaining(currentFile, modules)) {
|
|
74
|
+
const target = mod.imports.get(importPath);
|
|
75
|
+
if (target === undefined)
|
|
76
|
+
continue;
|
|
77
|
+
if (!allFiles.has(target))
|
|
78
|
+
return null;
|
|
79
|
+
targets.add(target);
|
|
80
|
+
}
|
|
81
|
+
if (targets.size === 0)
|
|
82
|
+
return undefined;
|
|
83
|
+
if (targets.size > 1)
|
|
84
|
+
return null;
|
|
85
|
+
return targets.values().next().value ?? null;
|
|
86
|
+
}
|
|
87
|
+
/** Resolve a Zig @import argument to a file path in the repository.
|
|
88
|
+
* Returns null when the import is a stdlib / builtin / root reference,
|
|
89
|
+
* an unresolvable build.zig.zon package dep, or genuinely unresolvable.
|
|
90
|
+
*
|
|
91
|
+
* `buildZon` (optional) supplies the parsed `.dependencies` map from
|
|
92
|
+
* build.zig.zon. */
|
|
93
|
+
export function resolveZigImportInternal(currentFile, importPath, allFiles, buildZon) {
|
|
94
|
+
// Stdlib / compiler builtin / root — not resolvable from source files alone.
|
|
95
|
+
if (ZIG_STDLIB_NAMES.has(importPath))
|
|
96
|
+
return null;
|
|
97
|
+
// Normalize path separators for the path arithmetic below. The `.zig`
|
|
98
|
+
// extension is kept as written: the first candidate is the path as spelled
|
|
99
|
+
// and only the fallback appends `.zig` for extension-less spellings.
|
|
100
|
+
const trimmed = importPath.replace(/\\/g, '/');
|
|
101
|
+
// Absolute paths point outside the repository (Zig itself rejects
|
|
102
|
+
// `@import("/abs.zig")` as an import outside the module path). Splitting
|
|
103
|
+
// would drop the empty leading component and read `/foo.zig` as an
|
|
104
|
+
// importer-relative `foo.zig`, fabricating an in-repo edge.
|
|
105
|
+
// A drive-qualified spelling (`C:/foo.zig`, normalized from `C:\foo.zig`)
|
|
106
|
+
// is absolute too: it carries a `/`, so without this guard it would take
|
|
107
|
+
// the importer-relative branch and probe `src/C:/foo.zig`. Same test as
|
|
108
|
+
// `normalizeZigDepPath`.
|
|
109
|
+
if (trimmed.startsWith('/') || /^[A-Za-z]:\//.test(trimmed))
|
|
110
|
+
return null;
|
|
111
|
+
// Path-bearing import: resolve relative to the current file's directory.
|
|
112
|
+
// Zig allows both "./foo.zig" and "foo.zig" — both are filesystem-relative.
|
|
113
|
+
if (trimmed.endsWith('.zig') || trimmed.includes('/')) {
|
|
114
|
+
const currentDir = currentFile.split('/').slice(0, -1);
|
|
115
|
+
const parts = trimmed.split('/');
|
|
116
|
+
for (const part of parts) {
|
|
117
|
+
if (part === '' || part === '.')
|
|
118
|
+
continue;
|
|
119
|
+
if (part === '..') {
|
|
120
|
+
// Above the repository root: the import names a file outside the
|
|
121
|
+
// repo, so it must not alias a same-named root file (`../bar.zig`
|
|
122
|
+
// from `main.zig` is NOT `bar.zig`).
|
|
123
|
+
if (currentDir.length === 0)
|
|
124
|
+
return null;
|
|
125
|
+
currentDir.pop();
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
currentDir.push(part);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const candidate = currentDir.join('/');
|
|
132
|
+
if (allFiles.has(candidate))
|
|
133
|
+
return candidate;
|
|
134
|
+
if (allFiles.has(candidate + '.zig'))
|
|
135
|
+
return candidate + '.zig';
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
// Bare name without extension or slashes (e.g. @import("bar")).
|
|
139
|
+
if (buildZon) {
|
|
140
|
+
// First the import table of the build module the importer belongs to:
|
|
141
|
+
// an alias is scoped to the module whose `addImport` declared it, so
|
|
142
|
+
// this is the only table that can tell `app`'s `@import("config")` from
|
|
143
|
+
// `tool`'s. A disagreement between same-directory modules is `null`
|
|
144
|
+
// here and stops the chain — the repo-wide fallbacks below would only
|
|
145
|
+
// reintroduce the first-wins answer.
|
|
146
|
+
if (buildZon.buildModules !== undefined && buildZon.buildModules.length > 0) {
|
|
147
|
+
const scoped = resolveThroughBuildModules(currentFile, importPath, allFiles, buildZon.buildModules);
|
|
148
|
+
if (scoped !== undefined)
|
|
149
|
+
return scoped;
|
|
150
|
+
}
|
|
151
|
+
// The repo's own modules, as its root build.zig names them
|
|
152
|
+
// (`b.addModule("lightpanda", .{ .root_source_file = b.path("src/lightpanda.zig") })`),
|
|
153
|
+
// take precedence: that declaration is exactly what an in-repo
|
|
154
|
+
// `@import("lightpanda")` means, whatever the zon says. `std` / `builtin`
|
|
155
|
+
// / `root` were rejected above and can never be reached from here.
|
|
156
|
+
// Authoritative when it binds the name: a root that is not indexed (a
|
|
157
|
+
// generated or skipped file) is `null`, never a fall-through to a
|
|
158
|
+
// same-named zon dep — that would be a different declaration answering
|
|
159
|
+
// under the name (gitnexus-check on fe24b37f; same rule as the
|
|
160
|
+
// build-module tables above).
|
|
161
|
+
const rootModule = buildZon.rootModules?.get(importPath);
|
|
162
|
+
if (rootModule !== undefined)
|
|
163
|
+
return allFiles.has(rootModule) ? rootModule : null;
|
|
164
|
+
// Then build.zig.zon `.path` deps.
|
|
165
|
+
const depPath = buildZon.pathDeps.get(importPath);
|
|
166
|
+
if (depPath) {
|
|
167
|
+
const normalized = normalizeZigDepPath(depPath);
|
|
168
|
+
if (normalized !== null) {
|
|
169
|
+
// What the dep's own build.zig declares comes first (its
|
|
170
|
+
// `addModule` root_source_file — see `parseZigBuildModuleRoots`), then
|
|
171
|
+
// the conventional layouts: `src/root.zig` (the `zig init` library
|
|
172
|
+
// root since 0.12), `src/<name>.zig` (older name-matched convention),
|
|
173
|
+
// `src/main.zig` (executables / older inits). A dep at `.path = "."`
|
|
174
|
+
// (the repo itself) normalizes to '' and must not grow a leading slash
|
|
175
|
+
// — `allFiles` keys are repo-relative.
|
|
176
|
+
const prefix = normalized === '' ? '' : `${normalized}/`;
|
|
177
|
+
const candidates = [
|
|
178
|
+
...(buildZon.moduleRoots?.get(importPath) ?? []),
|
|
179
|
+
`${prefix}src/root.zig`,
|
|
180
|
+
`${prefix}src/${importPath}.zig`,
|
|
181
|
+
`${prefix}src/main.zig`,
|
|
182
|
+
];
|
|
183
|
+
for (const c of candidates) {
|
|
184
|
+
if (allFiles.has(c))
|
|
185
|
+
return c;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// Bare name with no resolution (no build.zig / build.zig.zon, .url-based dep, generated module, or
|
|
191
|
+
// unconventional layout).
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
@@ -68,6 +68,67 @@ export interface SwiftPackageConfig {
|
|
|
68
68
|
/** Map of target name -> source directory path (e.g., "SiuperModel" -> "Package/Sources/SiuperModel") */
|
|
69
69
|
targets: Map<string, string>;
|
|
70
70
|
}
|
|
71
|
+
/** Zig package config parsed from build.zig.zon and the root build.zig */
|
|
72
|
+
export interface ZigBuildZonConfig {
|
|
73
|
+
/**
|
|
74
|
+
* Map of dependency name -> the raw `.path = "..."` value, exactly as
|
|
75
|
+
* written in build.zig.zon (relative to the repo root, and possibly
|
|
76
|
+
* escaping it: `../local_dep`). Consumers normalize — see
|
|
77
|
+
* `normalizeZigDepPath` below, which rejects absolute
|
|
78
|
+
* and repo-escaping values. `.url`-based deps cannot be resolved to a
|
|
79
|
+
* repo-local file (they unpack into a build cache outside the repo) and so
|
|
80
|
+
* are not included here.
|
|
81
|
+
*/
|
|
82
|
+
pathDeps: Map<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* Per path-dep: repo-relative root source files the dep's own `build.zig`
|
|
85
|
+
* declares (`b.addModule("name", .{ .root_source_file = b.path("src/x.zig")
|
|
86
|
+
* })`), keyed by dep name, in file order. Entries whose module name matches
|
|
87
|
+
* the dep name come first — that is the module a consumer's
|
|
88
|
+
* `@import("<dep>")` maps to under the ecosystem convention that the zon key
|
|
89
|
+
* and the module name agree. Absent (or empty) when the dep has no readable
|
|
90
|
+
* `build.zig`; the resolver then falls back to the conventional layouts.
|
|
91
|
+
*/
|
|
92
|
+
moduleRoots?: Map<string, readonly string[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Modules the repo's OWN root `build.zig` declares under an importable
|
|
95
|
+
* name, module name → repo-relative root source file
|
|
96
|
+
* (`b.addModule("lp", .{ .root_source_file = b.path("src/lp.zig") })`, or a
|
|
97
|
+
* `createModule` binding later named through `addImport("lp", binding)`).
|
|
98
|
+
* These are what an in-repo `@import("lp")` means — the most common shape in
|
|
99
|
+
* single-package repos, where every file imports the package's own root
|
|
100
|
+
* module by name. Independent of `build.zig.zon`: a repo with a `build.zig`
|
|
101
|
+
* and no zon still resolves them. See `parseZigRootModules`.
|
|
102
|
+
*/
|
|
103
|
+
rootModules?: Map<string, string>;
|
|
104
|
+
/**
|
|
105
|
+
* Every build module the root `build.zig` declares, each with ITS OWN
|
|
106
|
+
* import table — `addModule` / `createModule` roots and the root modules of
|
|
107
|
+
* `addExecutable` / `addLibrary` / `addTest` artifacts, with the aliases
|
|
108
|
+
* their `addImport("<alias>", …)` calls and `.imports = &.{ … }` fields
|
|
109
|
+
* bind. `rootModules` flattens all of those into one first-wins map, which
|
|
110
|
+
* is wrong as soon as two modules bind one alias to different roots (an
|
|
111
|
+
* `app` and a `tool` executable that each `addImport("config", …)` their
|
|
112
|
+
* own `config.zig`): the second module's files resolved to the first
|
|
113
|
+
* module's target. The resolver walks a source file to its containing
|
|
114
|
+
* module(s) and consults their tables first — see
|
|
115
|
+
* `resolveZigImportInternal` / `parseZigBuildModules`.
|
|
116
|
+
*/
|
|
117
|
+
buildModules?: readonly ZigBuildModule[];
|
|
118
|
+
}
|
|
119
|
+
/** One build module of the root `build.zig` — see `ZigBuildZonConfig.buildModules`. */
|
|
120
|
+
export interface ZigBuildModule {
|
|
121
|
+
/** The `addModule("<name>", …)` name; absent for `createModule` bindings
|
|
122
|
+
* and artifact root modules, which are reachable only through aliases. */
|
|
123
|
+
readonly name?: string;
|
|
124
|
+
/** Repo-relative root source file (`b.path("src/x.zig")`). */
|
|
125
|
+
readonly root: string;
|
|
126
|
+
/** Alias → repo-relative root source file, as this module's own
|
|
127
|
+
* `addImport` calls and `.imports` field declare it. Includes aliases to
|
|
128
|
+
* a path dep's module (`addImport("api", dep.module("core"))`) when the
|
|
129
|
+
* dep's build.zig declares that module. */
|
|
130
|
+
readonly imports: ReadonlyMap<string, string>;
|
|
131
|
+
}
|
|
71
132
|
/**
|
|
72
133
|
* Parse tsconfig.json to extract path aliases.
|
|
73
134
|
* Tries tsconfig.json, tsconfig.app.json, tsconfig.base.json in order.
|
|
@@ -93,6 +154,119 @@ export declare function loadComposerConfig(repoRoot: string): Promise<ComposerCo
|
|
|
93
154
|
*/
|
|
94
155
|
export declare function scanCSharpProject(repoRoot: string): Promise<CSharpProjectScan>;
|
|
95
156
|
export declare function loadSwiftPackageConfig(repoRoot: string): Promise<SwiftPackageConfig | null>;
|
|
157
|
+
/**
|
|
158
|
+
* Load the Zig build configuration a repo's `build.zig.zon` + root `build.zig`
|
|
159
|
+
* declare: `.path` deps (and the roots their own build.zig names) from the
|
|
160
|
+
* zon, and the repo's own named modules from the root build.zig. Either file
|
|
161
|
+
* may be missing — a repo with a `build.zig` but no `build.zig.zon` still
|
|
162
|
+
* resolves `@import("<own module>")`. Null only when neither contributes.
|
|
163
|
+
*
|
|
164
|
+
* `build.zig.zon` is Zig source (an anonymous-struct literal), not JSON.
|
|
165
|
+
* Rather than pull in a tree-sitter parse for one file, we use a small
|
|
166
|
+
* regex-based extractor that handles the common shapes:
|
|
167
|
+
*
|
|
168
|
+
* .dependencies = .{
|
|
169
|
+
* .ziggit_pkg = .{
|
|
170
|
+
* .url = "https://...",
|
|
171
|
+
* .hash = "1220...",
|
|
172
|
+
* },
|
|
173
|
+
* .local_dep = .{
|
|
174
|
+
* .path = "../local_dep",
|
|
175
|
+
* },
|
|
176
|
+
* },
|
|
177
|
+
*
|
|
178
|
+
* Limitations (intentional — bail to null on anything weirder):
|
|
179
|
+
* - Only the top-level `.dependencies = .{ ... }` block is parsed (brace
|
|
180
|
+
* depth 1); a same-named field nested in another struct is ignored.
|
|
181
|
+
* - Each dep entry is matched by a single shape: `.<name> = .{ ... }`
|
|
182
|
+
* where `<name>` is a bare identifier (no `@"…"` quoted form).
|
|
183
|
+
* - Only `.path = "..."` is captured. `.url` deps are left unresolved
|
|
184
|
+
* because their unpacked location lives outside the repo
|
|
185
|
+
* (.zig-cache/p/<hash>/ or ~/.cache/zig/p/<hash>/) and is therefore
|
|
186
|
+
* not in our `allFilePaths` set.
|
|
187
|
+
* - `//` line comments are stripped before scanning (string-aware, so a
|
|
188
|
+
* `//` inside `.url = "https://…"` survives), and brace matching skips
|
|
189
|
+
* string literals — a commented-out `.path` or a `}` inside a comment
|
|
190
|
+
* or string cannot declare a dep or truncate the block.
|
|
191
|
+
*/
|
|
192
|
+
export declare function loadZigBuildConfig(repoRoot: string): Promise<ZigBuildZonConfig | null>;
|
|
193
|
+
/**
|
|
194
|
+
* Normalize a `.path` value from build.zig.zon into a repo-relative form.
|
|
195
|
+
* Returns null for paths that escape the repo root (start with `..`) or
|
|
196
|
+
* are absolute — those point to files we don't index. `.` / `./` normalize
|
|
197
|
+
* to the empty string (the repo root itself). Shared with the import
|
|
198
|
+
* resolver so both sides agree on which deps are in-repo.
|
|
199
|
+
*/
|
|
200
|
+
export declare function normalizeZigDepPath(depPath: string): string | null;
|
|
201
|
+
/**
|
|
202
|
+
* The `root_source_file` paths a `build.zig` declares, dep-relative, with the
|
|
203
|
+
* module whose `addModule("<name>", …)` name equals `preferredName` first.
|
|
204
|
+
*
|
|
205
|
+
* Reads two shapes, which between them cover `zig init` output and the
|
|
206
|
+
* common hand-written build scripts:
|
|
207
|
+
* - `b.addModule("name", .{ .root_source_file = b.path("src/root.zig") })`
|
|
208
|
+
* - any other `.root_source_file = b.path("…")` (exe/lib/test artifacts),
|
|
209
|
+
* kept as unnamed fallbacks in file order.
|
|
210
|
+
* A `.zig` under `b.path` is required — `.{ .cwd_relative = … }` and
|
|
211
|
+
* `LazyPath` values computed at build time are not resolvable statically and
|
|
212
|
+
* are skipped. Duplicates collapse to the first occurrence.
|
|
213
|
+
*/
|
|
214
|
+
export declare function parseZigBuildModuleRoots(buildZig: string, preferredName: string): string[];
|
|
215
|
+
/**
|
|
216
|
+
* The importable modules a repo's ROOT `build.zig` declares, module name →
|
|
217
|
+
* repo-relative root source file. Static scan (no execution) of two shapes:
|
|
218
|
+
*
|
|
219
|
+
* - `b.addModule("<name>", .{ .root_source_file = b.path("<p>.zig"), … })`
|
|
220
|
+
* names the module directly;
|
|
221
|
+
* - `const m = b.createModule(.{ .root_source_file = b.path("<p>.zig"), … })`
|
|
222
|
+
* (or `const m = b.addModule(…)`) bound to an identifier and later named
|
|
223
|
+
* by `x.addImport("<name>", m)` or `.imports = &.{ .{ .name = "<name>",
|
|
224
|
+
* .module = m } }`.
|
|
225
|
+
*
|
|
226
|
+
* Deliberately NOT resolved — they are not in-repo source files: modules whose
|
|
227
|
+
* root is not a static `b.path("….zig")` (generated `opts.createModule()` from
|
|
228
|
+
* `addOptions`, `translate_c.createModule()`, `.cwd_relative` / computed
|
|
229
|
+
* LazyPaths), `addImport("<name>", dep.module("…"))` (a `.url` / path dep,
|
|
230
|
+
* handled through the zon), and aliases whose module operand is anything but a
|
|
231
|
+
* bare identifier bound above (`config.lp_module`). Comments are stripped and
|
|
232
|
+
* string literals skipped; the first declaration of a name wins.
|
|
233
|
+
*/
|
|
234
|
+
export declare function parseZigRootModules(buildZig: string): Map<string, string>;
|
|
235
|
+
/**
|
|
236
|
+
* Every build module the ROOT `build.zig` declares, each with its OWN import
|
|
237
|
+
* table (`ZigBuildModule`). Static scan (no execution) of:
|
|
238
|
+
*
|
|
239
|
+
* - `b.addModule("<name>", .{ .root_source_file = b.path("<p>.zig"), … })`
|
|
240
|
+
* and `const m = b.createModule(.{ .root_source_file = … })` — a module,
|
|
241
|
+
* bound to the identifier a preceding `const m =` names;
|
|
242
|
+
* - `b.addExecutable` / `addLibrary` / `addStaticLibrary` /
|
|
243
|
+
* `addSharedLibrary` / `addTest` / `addObject(.{ .root_source_file =
|
|
244
|
+
* b.path("<p>.zig"), … })` — an artifact whose ROOT MODULE is a module of
|
|
245
|
+
* its own (reached as `exe.root_module.addImport(…)`), or `.root_module =
|
|
246
|
+
* m` / `.root_module = b.createModule(…)` naming one declared inline;
|
|
247
|
+
* - `<m>.addImport("<alias>", <operand>)`, `<exe>.root_module.addImport(…)`
|
|
248
|
+
* and the `.imports = &.{ .{ .name = "<alias>", .module = <operand> } }`
|
|
249
|
+
* field of a module's own arguments — an entry in THAT module's table.
|
|
250
|
+
* The operand is a module binding (`m`) or a path dep's named module,
|
|
251
|
+
* `dep.module("<name>")` with `const dep = b.dependency("<zon name>", …)`,
|
|
252
|
+
* looked up in `depModules` (zon dep name → module name → repo-relative
|
|
253
|
+
* root, from the dep's own build.zig).
|
|
254
|
+
*
|
|
255
|
+
* Why per module rather than one map (`parseZigRootModules`): an alias is
|
|
256
|
+
* scoped to the module that declares it. Two executables that each
|
|
257
|
+
* `addImport("config", …)` their own `config.zig` are the ordinary
|
|
258
|
+
* multi-target layout, and a single first-wins map sent the second module's
|
|
259
|
+
* `@import("config")` to the first module's file — a confident wrong
|
|
260
|
+
* `IMPORTS` edge and every `config.*` call behind it. Deliberately NOT
|
|
261
|
+
* resolved, as in `parseZigRootModules`: generated roots
|
|
262
|
+
* (`addOptions().createModule()`, `translate_c.createModule()`, computed
|
|
263
|
+
* LazyPaths), `.url` deps, and operands that are not a bare identifier or a
|
|
264
|
+
* `dep.module("…")` on a `b.dependency` binding. Comments stripped, string
|
|
265
|
+
* literals masked; the first binding of an identifier wins.
|
|
266
|
+
*/
|
|
267
|
+
export declare function parseZigBuildModules(buildZig: string, depModules?: ReadonlyMap<string, ReadonlyMap<string, string>>): ZigBuildModule[];
|
|
268
|
+
/** Pure parser split out for testability. Returns null when no path-deps found. */
|
|
269
|
+
export declare function parseZigBuildZon(raw: string): ZigBuildZonConfig | null;
|
|
96
270
|
/**
|
|
97
271
|
* Bundled language-specific configs loaded once per ingestion run — the
|
|
98
272
|
* result of {@link loadImportConfigs}, and every field's type is declared
|
|
@@ -112,6 +286,9 @@ export interface ImportConfigs {
|
|
|
112
286
|
csharpConfigs: CSharpProjectConfig[];
|
|
113
287
|
/** In-repo namespace evidence gating C# suffix-fallback resolution (#1881). */
|
|
114
288
|
csharpNamespaces?: CSharpNamespaceEvidence;
|
|
289
|
+
/** Zig `.path` deps from build.zig.zon. Optional so call sites that
|
|
290
|
+
* hand-build ImportConfigs (tests) don't have to supply it. */
|
|
291
|
+
zigBuildZon?: ZigBuildZonConfig | null;
|
|
115
292
|
}
|
|
116
293
|
/** Load all language-specific configs once for an ingestion run. */
|
|
117
294
|
export declare function loadImportConfigs(repoRoot: string): Promise<ImportConfigs>;
|