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
package/dist/server/api.js
CHANGED
|
@@ -11,7 +11,6 @@ import express from 'express';
|
|
|
11
11
|
import cors from 'cors';
|
|
12
12
|
import path from 'path';
|
|
13
13
|
import fs from 'fs/promises';
|
|
14
|
-
import { createRequire } from 'node:module';
|
|
15
14
|
import { canonicalizePath, cloneDirBelongsToEntry, loadMeta, saveMeta, listRegisteredRepos, getStoragePath, registryPathEquals, } from '../storage/repo-manager.js';
|
|
16
15
|
import { executeQuery, executePrepared, executeWithReusedStatement, streamQuery, flushWAL, closeLbug, withLbugDb, isReadOnlyDbError, } from '../core/lbug/lbug-adapter.js';
|
|
17
16
|
import { isValidQueryParams } from '../core/lbug/query-params.js';
|
|
@@ -20,15 +19,17 @@ import { searchFTSFromLbug } from '../core/search/bm25-index.js';
|
|
|
20
19
|
import { hybridSearch } from '../core/search/hybrid-search.js';
|
|
21
20
|
import { ftsDegradedWarning } from '../core/search/fts-indexes.js';
|
|
22
21
|
import { LocalBackend } from '../mcp/local/local-backend.js';
|
|
23
|
-
import { mountMCPEndpoints } from './mcp-http.js';
|
|
22
|
+
import { installServeMcpAuth, mountMCPEndpoints } from './mcp-http.js';
|
|
24
23
|
import { fileURLToPath } from 'url';
|
|
25
24
|
import { isTerminalJobStatus, JobManager } from './analyze-job.js';
|
|
26
25
|
import { mountSSEProgress } from './sse-progress.js';
|
|
27
26
|
import { resolveEmbedRunOutcome, withMeasuredEmbeddingCount, } from './embed-run-outcome.js';
|
|
28
27
|
import { decideEmbeddingResume, mintInterruptedCheckpoint } from '../core/embedding-checkpoint.js';
|
|
29
28
|
import { measurePersistedEmbeddingCount, persistedEmbeddingCountOrUndefined, } from '../core/embedding-count.js';
|
|
30
|
-
import { assertString,
|
|
31
|
-
import {
|
|
29
|
+
import { assertString, BadRequestError, createRouteLimiter } from './validation.js';
|
|
30
|
+
import { parseGrepQuery, GREP_TIME_BUDGET_MS } from './grep-params.js';
|
|
31
|
+
import { runGrepScanInWorker } from './grep-scan.js';
|
|
32
|
+
import { extractWebRepoName, getCloneDir, cloneOrPull, warnIfInsecureAzureConfig, GITHUB_TOKEN_HOSTS, } from './git-clone.js';
|
|
32
33
|
import { createAnalyzeUploadHandler } from './analyze-upload.js';
|
|
33
34
|
import { assertServeAuthForPublicOrigin, createPublicOriginMatcher, createWriteOriginGuard, logOriginPolicy, PUBLIC_ORIGIN_ENV, resolveTrustProxy, TRUST_PROXY_ENV, warnIfRateLimitKeysCollapse, } from './middleware.js';
|
|
34
35
|
import { createLaunchAnalysisWorker } from './analyze-launch.js';
|
|
@@ -36,8 +37,8 @@ import { UPLOAD_ROOT } from './upload-paths.js';
|
|
|
36
37
|
import { sweepStaleUploads } from './upload-sweep.js';
|
|
37
38
|
import { isRfc1918PrivateIpv4 } from './private-ip.js';
|
|
38
39
|
import { logger, flushLoggerSync } from '../core/logger.js';
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
import { bindServeUpdateControllerLifecycle, buildServerInfo, createServeUpdateController, } from './update-controller.js';
|
|
41
|
+
export { bindServeUpdateControllerLifecycle, buildServerInfo, createServeUpdateController, } from './update-controller.js';
|
|
41
42
|
/**
|
|
42
43
|
* Determine whether an HTTP Origin header value is allowed by CORS policy.
|
|
43
44
|
*
|
|
@@ -264,7 +265,18 @@ export const writeNdjsonRecord = async (res, record, signal) => {
|
|
|
264
265
|
throw err;
|
|
265
266
|
}
|
|
266
267
|
};
|
|
267
|
-
const
|
|
268
|
+
const ROUTE_NODE_CORE_PROJECTION = 'n.id AS id, n.name AS name, n.filePath AS filePath, ' +
|
|
269
|
+
'n.responseKeys AS responseKeys, n.errorKeys AS errorKeys, n.middleware AS middleware';
|
|
270
|
+
const LEGACY_ROUTE_NODE_QUERY = `MATCH (n:\`Route\`) RETURN ${ROUTE_NODE_CORE_PROJECTION}`;
|
|
271
|
+
const isMissingRouteRuntimePropertyError = (err) => {
|
|
272
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
273
|
+
const mentionsRuntimeProperty = ['runtimeConfirmed', 'runtimeSource', 'runtimeStatus'].some((property) => message.includes(property));
|
|
274
|
+
return (mentionsRuntimeProperty &&
|
|
275
|
+
(/cannot find property/i.test(message) ||
|
|
276
|
+
/property .* does not exist/i.test(message) ||
|
|
277
|
+
/property .* not found/i.test(message)));
|
|
278
|
+
};
|
|
279
|
+
export const buildGraph = async (includeContent = false) => {
|
|
268
280
|
const nodes = [];
|
|
269
281
|
for (const table of NODE_TABLES) {
|
|
270
282
|
try {
|
|
@@ -274,6 +286,13 @@ const buildGraph = async (includeContent = false) => {
|
|
|
274
286
|
}
|
|
275
287
|
}
|
|
276
288
|
catch (err) {
|
|
289
|
+
if (table === 'Route' && isMissingRouteRuntimePropertyError(err)) {
|
|
290
|
+
const rows = await executeQuery(LEGACY_ROUTE_NODE_QUERY);
|
|
291
|
+
for (const row of rows) {
|
|
292
|
+
nodes.push(mapGraphNodeRow(table, row, includeContent));
|
|
293
|
+
}
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
277
296
|
if (!isIgnorableGraphQueryError(err)) {
|
|
278
297
|
throw err;
|
|
279
298
|
}
|
|
@@ -314,11 +333,14 @@ export const getNodeQuery = (table, includeContent) => {
|
|
|
314
333
|
return `MATCH (n:${tableLabel}) RETURN n.id AS id, n.label AS label, n.heuristicLabel AS heuristicLabel, n.processType AS processType, n.stepCount AS stepCount, n.communities AS communities, n.entryPointId AS entryPointId, n.terminalId AS terminalId`;
|
|
315
334
|
}
|
|
316
335
|
if (table === 'Route') {
|
|
317
|
-
return `MATCH (n:${tableLabel}) RETURN
|
|
336
|
+
return `MATCH (n:${tableLabel}) RETURN ${ROUTE_NODE_CORE_PROJECTION}, n.runtimeConfirmed AS runtimeConfirmed, n.runtimeSource AS runtimeSource, n.runtimeStatus AS runtimeStatus`;
|
|
318
337
|
}
|
|
319
338
|
if (table === 'Tool') {
|
|
320
339
|
return `MATCH (n:${tableLabel}) RETURN n.id AS id, n.name AS name, n.filePath AS filePath, n.description AS description`;
|
|
321
340
|
}
|
|
341
|
+
if (table === 'Destination') {
|
|
342
|
+
return `MATCH (n:${tableLabel}) RETURN n.id AS id, n.name AS name, n.filePath AS filePath, n.startLine AS startLine, n.endLine AS endLine, n.address AS address, n.broker AS broker, n.resolution AS resolution, n.configKey AS configKey, n.configDefault AS configDefault`;
|
|
343
|
+
}
|
|
322
344
|
return includeContent
|
|
323
345
|
? `MATCH (n:${tableLabel}) RETURN n.id AS id, n.name AS name, n.filePath AS filePath, n.startLine AS startLine, n.endLine AS endLine, n.content AS content`
|
|
324
346
|
: `MATCH (n:${tableLabel}) RETURN n.id AS id, n.name AS name, n.filePath AS filePath, n.startLine AS startLine, n.endLine AS endLine`;
|
|
@@ -342,6 +364,29 @@ const mapGraphNodeRow = (table, row, includeContent) => ({
|
|
|
342
364
|
responseKeys: row.responseKeys,
|
|
343
365
|
errorKeys: row.errorKeys,
|
|
344
366
|
middleware: row.middleware,
|
|
367
|
+
// Normalize legacy Route projections to the modern contract. Source is
|
|
368
|
+
// provenance; only runtimeConfirmed === true is authoritative.
|
|
369
|
+
runtimeConfirmed: table === 'Route' ? (row.runtimeConfirmed ?? false) : undefined,
|
|
370
|
+
runtimeSource: table === 'Route' ? row.runtimeSource : undefined,
|
|
371
|
+
runtimeStatus: table === 'Route' ? row.runtimeStatus : undefined,
|
|
372
|
+
// The Destination overlay written by `pipeline-phases/spring-destinations.ts`.
|
|
373
|
+
// Gated on the label for the same reason as the Route columns above: no
|
|
374
|
+
// other node query projects them, so an ungated read would put a key on
|
|
375
|
+
// every node in the graph.
|
|
376
|
+
//
|
|
377
|
+
// `?? undefined` is not decoration. LadybugDB returns NULL columns as
|
|
378
|
+
// `null`, and `address` is the cross-repository JOIN KEY that a destination
|
|
379
|
+
// carries ONLY when it resolved. Passing the `null` straight through would
|
|
380
|
+
// serialize `"address": null` for every unresolved destination, turning an
|
|
381
|
+
// ABSENT property — which cannot match anything — into a PRESENT one that
|
|
382
|
+
// every other unresolved destination shares. That is the false connection
|
|
383
|
+
// the keying rule exists to prevent, reintroduced at the API boundary, so
|
|
384
|
+
// the null is normalized back to absent for all five columns alike.
|
|
385
|
+
address: table === 'Destination' ? (row.address ?? undefined) : undefined,
|
|
386
|
+
broker: table === 'Destination' ? (row.broker ?? undefined) : undefined,
|
|
387
|
+
resolution: table === 'Destination' ? (row.resolution ?? undefined) : undefined,
|
|
388
|
+
configKey: table === 'Destination' ? (row.configKey ?? undefined) : undefined,
|
|
389
|
+
configDefault: table === 'Destination' ? (row.configDefault ?? undefined) : undefined,
|
|
345
390
|
heuristicLabel: row.heuristicLabel,
|
|
346
391
|
cohesion: row.cohesion,
|
|
347
392
|
symbolCount: row.symbolCount,
|
|
@@ -373,6 +418,15 @@ export const streamGraphNdjson = async (res, includeContent = false, signal) =>
|
|
|
373
418
|
});
|
|
374
419
|
}
|
|
375
420
|
catch (err) {
|
|
421
|
+
if (table === 'Route' && isMissingRouteRuntimePropertyError(err)) {
|
|
422
|
+
await streamQuery(LEGACY_ROUTE_NODE_QUERY, async (row) => {
|
|
423
|
+
await writeNdjsonRecord(res, {
|
|
424
|
+
type: 'node',
|
|
425
|
+
data: mapGraphNodeRow(table, row, includeContent),
|
|
426
|
+
}, signal);
|
|
427
|
+
});
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
376
430
|
if (!isIgnorableGraphQueryError(err)) {
|
|
377
431
|
throw err;
|
|
378
432
|
}
|
|
@@ -616,6 +670,9 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
616
670
|
callback(null, isAllowedOrigin(origin));
|
|
617
671
|
},
|
|
618
672
|
}));
|
|
673
|
+
// Optional protocol-layer auth for the MCP route. Keep this before the
|
|
674
|
+
// global body parser so rejected requests do not consume the JSON budget.
|
|
675
|
+
installServeMcpAuth(app);
|
|
619
676
|
app.use(express.json({ limit: '10mb' }));
|
|
620
677
|
// Origin guard for write routes: loopback, the server's own bound host, and
|
|
621
678
|
// any configured public origin — prevents CSRF from other devices.
|
|
@@ -631,6 +688,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
631
688
|
await backend.init();
|
|
632
689
|
const cleanupMcp = await mountMCPEndpoints(app, backend);
|
|
633
690
|
const jobManager = new JobManager();
|
|
691
|
+
const updateController = createServeUpdateController();
|
|
634
692
|
// Backstop: remove any upload staging dirs orphaned by a previous crash.
|
|
635
693
|
void sweepStaleUploads().catch(() => { });
|
|
636
694
|
// Shared repo lock — prevents concurrent analyze + embed on the same repo path,
|
|
@@ -744,21 +802,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
744
802
|
});
|
|
745
803
|
// Server info: version and launch context (npx / global / local dev)
|
|
746
804
|
app.get('/api/info', (_req, res) => {
|
|
747
|
-
|
|
748
|
-
const argv0 = process.argv[1] ?? '';
|
|
749
|
-
let launchContext;
|
|
750
|
-
if (execPath.includes('npx') ||
|
|
751
|
-
argv0.includes('_npx') ||
|
|
752
|
-
process.env.npm_config_prefix?.includes('_npx')) {
|
|
753
|
-
launchContext = 'npx';
|
|
754
|
-
}
|
|
755
|
-
else if (argv0.includes('node_modules')) {
|
|
756
|
-
launchContext = 'local';
|
|
757
|
-
}
|
|
758
|
-
else {
|
|
759
|
-
launchContext = 'global';
|
|
760
|
-
}
|
|
761
|
-
res.json({ version: pkg.version, launchContext, nodeVersion: process.version });
|
|
805
|
+
res.json(buildServerInfo(updateController.snapshot()));
|
|
762
806
|
});
|
|
763
807
|
// List all registered repos
|
|
764
808
|
app.get('/api/repos', async (_req, res) => {
|
|
@@ -1126,75 +1170,29 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1126
1170
|
res.status(404).json({ error: 'Repository not found' });
|
|
1127
1171
|
return;
|
|
1128
1172
|
}
|
|
1129
|
-
//
|
|
1130
|
-
//
|
|
1131
|
-
//
|
|
1132
|
-
|
|
1133
|
-
const rawPattern = req.query.pattern;
|
|
1134
|
-
if (rawPattern === undefined) {
|
|
1135
|
-
res.status(400).json({ error: 'Missing "pattern" query parameter' });
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
const pattern = assertString(rawPattern, 'pattern');
|
|
1139
|
-
if (pattern.length === 0) {
|
|
1140
|
-
res.status(400).json({ error: 'Missing "pattern" query parameter' });
|
|
1141
|
-
return;
|
|
1142
|
-
}
|
|
1143
|
-
// Length cap: applies to both literal and regex modes as a defense-in-depth
|
|
1144
|
-
// bound against pathological input.
|
|
1145
|
-
if (pattern.length > 200) {
|
|
1146
|
-
res.status(400).json({ error: 'Pattern too long (max 200 characters)' });
|
|
1147
|
-
return;
|
|
1148
|
-
}
|
|
1149
|
-
// Treat user input as a literal substring in all cases to prevent
|
|
1150
|
-
// regex-injection/ReDoS via attacker-controlled regex syntax.
|
|
1151
|
-
const effectivePattern = escapeRegExp(pattern);
|
|
1152
|
-
// Validate regex syntax (catches both opt-in user regex and any escapeRegExp bug)
|
|
1153
|
-
let regex;
|
|
1154
|
-
try {
|
|
1155
|
-
regex = new RegExp(effectivePattern, 'gim');
|
|
1156
|
-
}
|
|
1157
|
-
catch {
|
|
1158
|
-
res.status(400).json({ error: 'Invalid regex pattern' });
|
|
1159
|
-
return;
|
|
1160
|
-
}
|
|
1161
|
-
const parsedLimit = Number(req.query.limit ?? 50);
|
|
1162
|
-
const limit = Number.isFinite(parsedLimit)
|
|
1163
|
-
? Math.max(1, Math.min(200, Math.trunc(parsedLimit)))
|
|
1164
|
-
: 50;
|
|
1165
|
-
const results = [];
|
|
1173
|
+
// Pattern parsing lives in grep-params.ts (unit-testable without
|
|
1174
|
+
// Express + LadybugDB). Matching runs in a worker so terminate() can
|
|
1175
|
+
// cut a stuck regex.test() when the wall-clock budget expires.
|
|
1176
|
+
const { regex, fileFilter, limit } = parseGrepQuery(req.query);
|
|
1166
1177
|
const repoRoot = path.resolve(entry.path);
|
|
1167
|
-
// Get file paths from the graph (lightweight — no content loaded)
|
|
1168
1178
|
const lbugPath = path.join(entry.storagePath, 'lbug');
|
|
1169
1179
|
const fileRows = await withLbugDb(lbugPath, () => executeQuery(`MATCH (n:File) WHERE n.content IS NOT NULL RETURN n.filePath AS filePath`), { readOnly: true });
|
|
1170
|
-
|
|
1180
|
+
const filePaths = [];
|
|
1171
1181
|
for (const row of fileRows) {
|
|
1172
|
-
if (results.length >= limit)
|
|
1173
|
-
break;
|
|
1174
1182
|
const filePath = row.filePath || '';
|
|
1175
|
-
|
|
1176
|
-
// Path traversal guard
|
|
1177
|
-
const safeRepoRoot = repoRoot.endsWith(path.sep) ? repoRoot : repoRoot + path.sep;
|
|
1178
|
-
if (!fullPath.startsWith(safeRepoRoot) && fullPath !== repoRoot)
|
|
1183
|
+
if (fileFilter && !filePath.toLowerCase().includes(fileFilter))
|
|
1179
1184
|
continue;
|
|
1180
|
-
|
|
1181
|
-
try {
|
|
1182
|
-
content = await fs.readFile(fullPath, 'utf-8');
|
|
1183
|
-
}
|
|
1184
|
-
catch {
|
|
1185
|
-
continue; // File may have been deleted since indexing
|
|
1186
|
-
}
|
|
1187
|
-
const lines = content.split('\n');
|
|
1188
|
-
for (let i = 0; i < lines.length; i++) {
|
|
1189
|
-
if (results.length >= limit)
|
|
1190
|
-
break;
|
|
1191
|
-
if (regex.test(lines[i])) {
|
|
1192
|
-
results.push({ filePath, line: i + 1, text: lines[i].trim().slice(0, 200) });
|
|
1193
|
-
}
|
|
1194
|
-
regex.lastIndex = 0;
|
|
1195
|
-
}
|
|
1185
|
+
filePaths.push(filePath);
|
|
1196
1186
|
}
|
|
1197
|
-
|
|
1187
|
+
const { results, timedOut } = await runGrepScanInWorker({
|
|
1188
|
+
repoRoot,
|
|
1189
|
+
filePaths,
|
|
1190
|
+
pattern: regex.source,
|
|
1191
|
+
flags: regex.flags,
|
|
1192
|
+
limit,
|
|
1193
|
+
deadlineMs: Date.now() + GREP_TIME_BUDGET_MS,
|
|
1194
|
+
});
|
|
1195
|
+
res.json({ results, ...(timedOut ? { timedOut: true } : {}) });
|
|
1198
1196
|
}
|
|
1199
1197
|
catch (err) {
|
|
1200
1198
|
res.status(statusFromError(err)).json({ error: err.message || 'Grep failed' });
|
|
@@ -1266,7 +1264,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1266
1264
|
// POST /api/analyze — start a new analysis job
|
|
1267
1265
|
app.post('/api/analyze', createRouteLimiter({ limit: 10 }), requireTrustedOrigin, async (req, res) => {
|
|
1268
1266
|
try {
|
|
1269
|
-
const { url: repoUrl, path: repoLocalPath, force, embeddings, dropEmbeddings, token: repoToken, } = req.body;
|
|
1267
|
+
const { url: repoUrl, path: repoLocalPath, force, embeddings, dropEmbeddings, springActuatorPath, asyncApiSpecPath, token: repoToken, } = req.body;
|
|
1270
1268
|
// Input type validation
|
|
1271
1269
|
if (repoUrl !== undefined && typeof repoUrl !== 'string') {
|
|
1272
1270
|
res.status(400).json({ error: '"url" must be a string' });
|
|
@@ -1276,6 +1274,16 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1276
1274
|
res.status(400).json({ error: '"path" must be a string' });
|
|
1277
1275
|
return;
|
|
1278
1276
|
}
|
|
1277
|
+
if (springActuatorPath !== undefined &&
|
|
1278
|
+
(typeof springActuatorPath !== 'string' || springActuatorPath.trim().length === 0)) {
|
|
1279
|
+
res.status(400).json({ error: '"springActuatorPath" must be a non-empty string' });
|
|
1280
|
+
return;
|
|
1281
|
+
}
|
|
1282
|
+
if (asyncApiSpecPath !== undefined &&
|
|
1283
|
+
(typeof asyncApiSpecPath !== 'string' || asyncApiSpecPath.trim().length === 0)) {
|
|
1284
|
+
res.status(400).json({ error: '"asyncApiSpecPath" must be a non-empty string' });
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1279
1287
|
if (!repoUrl && !repoLocalPath) {
|
|
1280
1288
|
res.status(400).json({ error: 'Provide "url" (git URL) or "path" (local path)' });
|
|
1281
1289
|
return;
|
|
@@ -1328,7 +1336,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1328
1336
|
try {
|
|
1329
1337
|
// Clone if URL provided
|
|
1330
1338
|
if (repoUrl && !repoLocalPath) {
|
|
1331
|
-
const repoName =
|
|
1339
|
+
const repoName = extractWebRepoName(repoUrl);
|
|
1332
1340
|
targetPath = getCloneDir(repoName);
|
|
1333
1341
|
jobManager.updateJob(job.id, {
|
|
1334
1342
|
status: 'cloning',
|
|
@@ -1344,7 +1352,13 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1344
1352
|
if (!targetPath) {
|
|
1345
1353
|
throw new Error('No target path resolved');
|
|
1346
1354
|
}
|
|
1347
|
-
launchAnalysisWorker(job, targetPath, {
|
|
1355
|
+
launchAnalysisWorker(job, targetPath, {
|
|
1356
|
+
force,
|
|
1357
|
+
embeddings,
|
|
1358
|
+
dropEmbeddings,
|
|
1359
|
+
springActuatorPath,
|
|
1360
|
+
asyncApiSpecPath,
|
|
1361
|
+
});
|
|
1348
1362
|
}
|
|
1349
1363
|
catch (err) {
|
|
1350
1364
|
if (targetPath)
|
|
@@ -1702,11 +1716,14 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1702
1716
|
resolve();
|
|
1703
1717
|
});
|
|
1704
1718
|
server.on('error', (err) => reject(err));
|
|
1719
|
+
// `listening` is the successful startup boundary for notifier work.
|
|
1720
|
+
bindServeUpdateControllerLifecycle(server, updateController);
|
|
1705
1721
|
// Graceful shutdown — close Express + LadybugDB cleanly. Pino's default
|
|
1706
1722
|
// destination is `sync: false` (buffered); `flushLoggerSync()` before
|
|
1707
1723
|
// `process.exit` so records emitted during cleanup reach stderr.
|
|
1708
1724
|
const shutdown = async () => {
|
|
1709
1725
|
console.log('\nShutting down...');
|
|
1726
|
+
updateController.stop();
|
|
1710
1727
|
server.close();
|
|
1711
1728
|
jobManager.dispose();
|
|
1712
1729
|
embedJobManager.dispose();
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Shallow-clones repositories into the clone root (getGlobalDir()/repos/{name}/).
|
|
5
5
|
* If already cloned, does git pull instead.
|
|
6
6
|
*/
|
|
7
|
+
import { spawn } from 'child_process';
|
|
8
|
+
import { validateGitUrl } from '../core/net/url-guard.js';
|
|
9
|
+
export { validateGitUrl };
|
|
7
10
|
export declare const REPO_NAME_PATTERN: RegExp;
|
|
8
11
|
/**
|
|
9
12
|
* Extract the repository name from a git URL (HTTPS or SSH).
|
|
@@ -13,18 +16,39 @@ export declare const REPO_NAME_PATTERN: RegExp;
|
|
|
13
16
|
* clone root via path traversal.
|
|
14
17
|
*/
|
|
15
18
|
export declare function extractRepoName(url: string): string;
|
|
16
|
-
/** Get the clone target directory for a repo name. */
|
|
17
|
-
export declare function getCloneDir(repoName: string): string;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* Derive a clone directory name for the web `/api/analyze` boundary.
|
|
21
|
+
*
|
|
22
|
+
* The API historically accepted Azure DevOps and similar URLs whose repo
|
|
23
|
+
* segment contains spaces or other directory-unsafe characters by sanitizing
|
|
24
|
+
* the final segment. Keep that compatibility at the web boundary while leaving
|
|
25
|
+
* `extractRepoName()` strict for internal/security-sensitive callers.
|
|
22
26
|
*/
|
|
23
|
-
export declare function
|
|
27
|
+
export declare function extractWebRepoName(url: string): string;
|
|
28
|
+
/** Get the clone target directory for a repo name. */
|
|
29
|
+
export declare function getCloneDir(repoName: string): string;
|
|
24
30
|
export interface CloneProgress {
|
|
25
31
|
phase: 'cloning' | 'pulling';
|
|
26
32
|
message: string;
|
|
27
33
|
}
|
|
34
|
+
export interface CloneOrPullOptions {
|
|
35
|
+
token?: string;
|
|
36
|
+
allowedCloneRoot?: string;
|
|
37
|
+
expectedRepoName?: string;
|
|
38
|
+
quarantineRoot?: string;
|
|
39
|
+
allowAutoSyncSsh?: boolean;
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
branch?: string;
|
|
42
|
+
overwriteLocalChanges?: boolean;
|
|
43
|
+
runGitForTest?: typeof runGit;
|
|
44
|
+
}
|
|
45
|
+
type RunGitOptions = {
|
|
46
|
+
token?: string;
|
|
47
|
+
url?: string;
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
timeoutKillGraceMs?: number;
|
|
50
|
+
spawnForTest?: typeof spawn;
|
|
51
|
+
};
|
|
28
52
|
/**
|
|
29
53
|
* Build the `git clone` argument list for a given URL and target directory.
|
|
30
54
|
*
|
|
@@ -55,6 +79,7 @@ export declare function isAzureDevOpsUrl(url: string): boolean;
|
|
|
55
79
|
*/
|
|
56
80
|
export declare function warnIfInsecureAzureConfig(): void;
|
|
57
81
|
export declare function buildCloneArgs(url: string, targetDir: string): string[];
|
|
82
|
+
export declare function buildBranchCloneArgs(url: string, targetDir: string, branch: string): string[];
|
|
58
83
|
/**
|
|
59
84
|
* Normalize a git URL into a comparable form.
|
|
60
85
|
*
|
|
@@ -76,7 +101,7 @@ export declare function normalizeGitUrlForCompare(url: string): string;
|
|
|
76
101
|
* remote means for its threat model — for cloneOrPull, a missing remote
|
|
77
102
|
* on an existing clone is treated as a refuse-to-pull condition.
|
|
78
103
|
*/
|
|
79
|
-
export declare function getRemoteOriginUrl(cwd: string): Promise<string | null>;
|
|
104
|
+
export declare function getRemoteOriginUrl(cwd: string, timeoutMs?: number): Promise<string | null>;
|
|
80
105
|
/**
|
|
81
106
|
* Verify that an existing clone's `remote.origin.url` matches the requested
|
|
82
107
|
* URL (after normalization). Throws on mismatch or missing remote.
|
|
@@ -91,7 +116,7 @@ export declare function getRemoteOriginUrl(cwd: string): Promise<string | null>;
|
|
|
91
116
|
* Exported so the comparison logic is testable in isolation against any
|
|
92
117
|
* tmpdir-based fixture, without needing to populate CLONE_ROOT.
|
|
93
118
|
*/
|
|
94
|
-
export declare function assertRemoteMatchesRequestedUrl(targetDir: string, requestedUrl: string): Promise<void>;
|
|
119
|
+
export declare function assertRemoteMatchesRequestedUrl(targetDir: string, requestedUrl: string, timeoutMs?: number): Promise<void>;
|
|
95
120
|
/**
|
|
96
121
|
* Clone or pull a git repository.
|
|
97
122
|
* If targetDir doesn't exist: git clone --depth 1
|
|
@@ -116,9 +141,7 @@ export declare function assertRemoteMatchesRequestedUrl(targetDir: string, reque
|
|
|
116
141
|
* `--` (e.g. `--upload-pack=evil`) cannot be interpreted as a git option
|
|
117
142
|
* (CodeQL js/second-order-command-line-injection).
|
|
118
143
|
*/
|
|
119
|
-
export declare function cloneOrPull(url: string, targetDir: string, onProgress?: (progress: CloneProgress) => void, options?:
|
|
120
|
-
token?: string;
|
|
121
|
-
}): Promise<string>;
|
|
144
|
+
export declare function cloneOrPull(url: string, targetDir: string, onProgress?: (progress: CloneProgress) => void, options?: CloneOrPullOptions): Promise<string>;
|
|
122
145
|
/**
|
|
123
146
|
* Hosts the per-request GitHub PAT may be sent to. Exported so the
|
|
124
147
|
* /api/analyze boundary check and this injection-site check share one
|
|
@@ -127,14 +150,15 @@ export declare function cloneOrPull(url: string, targetDir: string, onProgress?:
|
|
|
127
150
|
*/
|
|
128
151
|
export declare const GITHUB_TOKEN_HOSTS: ReadonlySet<string>;
|
|
129
152
|
/**
|
|
130
|
-
* Build the spawn env for `git
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* any existing `GIT_CONFIG_COUNT` rather than overwriting it. Exported for
|
|
153
|
+
* Build the spawn env for managed `git` commands. Suppresses credential
|
|
154
|
+
* prompts, disables repository hooks, and injects at most one host-scoped
|
|
155
|
+
* Authorization header via the `GIT_CONFIG_*` env protocol (git ≥2.31).
|
|
156
|
+
* Managed settings append after any existing GIT_CONFIG_COUNT. Exported for
|
|
135
157
|
* unit tests.
|
|
136
158
|
*/
|
|
137
159
|
export declare function buildGitEnv(baseEnv: NodeJS.ProcessEnv, options?: {
|
|
138
160
|
token?: string;
|
|
139
161
|
url?: string;
|
|
140
162
|
}): NodeJS.ProcessEnv;
|
|
163
|
+
export declare function runGit(args: string[], cwd?: string, options?: RunGitOptions): Promise<string>;
|
|
164
|
+
export declare const runGitForTest: typeof runGit;
|