@saluzi/codegraph 0.2.0 → 0.2.2
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 +2 -2
- package/dist/bin/codegraph.d.ts +26 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +2249 -0
- package/dist/bin/codegraph.js.map +1 -0
- package/dist/bin/command-supervision.d.ts +49 -0
- package/dist/bin/command-supervision.d.ts.map +1 -0
- package/dist/bin/command-supervision.js +95 -0
- package/dist/bin/command-supervision.js.map +1 -0
- package/dist/bin/fatal-handler.d.ts +20 -0
- package/dist/bin/fatal-handler.d.ts.map +1 -0
- package/dist/bin/fatal-handler.js +118 -0
- package/dist/bin/fatal-handler.js.map +1 -0
- package/dist/bin/node-version-check.d.ts +37 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +79 -0
- package/dist/bin/node-version-check.js.map +1 -0
- package/dist/bin/uninstall.d.ts +14 -0
- package/dist/bin/uninstall.d.ts.map +1 -0
- package/dist/bin/uninstall.js +36 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/context/formatter.d.ts +30 -0
- package/dist/context/formatter.d.ts.map +1 -0
- package/dist/context/formatter.js +263 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +119 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1296 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/markers.d.ts +19 -0
- package/dist/context/markers.d.ts.map +1 -0
- package/dist/context/markers.js +22 -0
- package/dist/context/markers.js.map +1 -0
- package/dist/db/index.d.ts +201 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +493 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +44 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +212 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +513 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1886 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +194 -0
- package/dist/db/sqlite-adapter.d.ts +65 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +274 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/db/wal-valve.d.ts +106 -0
- package/dist/db/wal-valve.d.ts.map +1 -0
- package/dist/db/wal-valve.js +208 -0
- package/dist/db/wal-valve.js.map +1 -0
- package/dist/directory.d.ts +183 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +797 -0
- package/dist/directory.js.map +1 -0
- package/dist/errors.d.ts +136 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +219 -0
- package/dist/errors.js.map +1 -0
- package/dist/extraction/astro-extractor.d.ts +79 -0
- package/dist/extraction/astro-extractor.d.ts.map +1 -0
- package/dist/extraction/astro-extractor.js +320 -0
- package/dist/extraction/astro-extractor.js.map +1 -0
- package/dist/extraction/cfml-extractor.d.ts +107 -0
- package/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/dist/extraction/cfml-extractor.js +494 -0
- package/dist/extraction/cfml-extractor.js.map +1 -0
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/dist/extraction/dfm-extractor.js +151 -0
- package/dist/extraction/dfm-extractor.js.map +1 -0
- package/dist/extraction/extraction-version.d.ts +25 -0
- package/dist/extraction/extraction-version.d.ts.map +1 -0
- package/dist/extraction/extraction-version.js +28 -0
- package/dist/extraction/extraction-version.js.map +1 -0
- package/dist/extraction/function-ref.d.ts +118 -0
- package/dist/extraction/function-ref.d.ts.map +1 -0
- package/dist/extraction/function-ref.js +727 -0
- package/dist/extraction/function-ref.js.map +1 -0
- package/dist/extraction/generated-detection.d.ts +30 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -0
- package/dist/extraction/generated-detection.js +83 -0
- package/dist/extraction/generated-detection.js.map +1 -0
- package/dist/extraction/grammars.d.ts +138 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +631 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +232 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +2409 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/languages/arkts.d.ts +3 -0
- package/dist/extraction/languages/arkts.d.ts.map +1 -0
- package/dist/extraction/languages/arkts.js +127 -0
- package/dist/extraction/languages/arkts.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +110 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +837 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/cfquery.d.ts +12 -0
- package/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/dist/extraction/languages/cfquery.js +28 -0
- package/dist/extraction/languages/cfquery.js.map +1 -0
- package/dist/extraction/languages/cfscript.d.ts +3 -0
- package/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/dist/extraction/languages/cfscript.js +73 -0
- package/dist/extraction/languages/cfscript.js.map +1 -0
- package/dist/extraction/languages/cobol.d.ts +33 -0
- package/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/dist/extraction/languages/cobol.js +499 -0
- package/dist/extraction/languages/cobol.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +25 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +175 -0
- package/dist/extraction/languages/csharp.js.map +1 -0
- package/dist/extraction/languages/dart.d.ts +3 -0
- package/dist/extraction/languages/dart.d.ts.map +1 -0
- package/dist/extraction/languages/dart.js +374 -0
- package/dist/extraction/languages/dart.js.map +1 -0
- package/dist/extraction/languages/erlang.d.ts +3 -0
- package/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/dist/extraction/languages/erlang.js +350 -0
- package/dist/extraction/languages/erlang.js.map +1 -0
- package/dist/extraction/languages/go.d.ts +3 -0
- package/dist/extraction/languages/go.d.ts.map +1 -0
- package/dist/extraction/languages/go.js +111 -0
- package/dist/extraction/languages/go.js.map +1 -0
- package/dist/extraction/languages/index.d.ts +10 -0
- package/dist/extraction/languages/index.d.ts.map +1 -0
- package/dist/extraction/languages/index.js +71 -0
- package/dist/extraction/languages/index.js.map +1 -0
- package/dist/extraction/languages/java.d.ts +3 -0
- package/dist/extraction/languages/java.d.ts.map +1 -0
- package/dist/extraction/languages/java.js +315 -0
- package/dist/extraction/languages/java.js.map +1 -0
- package/dist/extraction/languages/javascript.d.ts +3 -0
- package/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/dist/extraction/languages/javascript.js +106 -0
- package/dist/extraction/languages/javascript.js.map +1 -0
- package/dist/extraction/languages/kotlin.d.ts +3 -0
- package/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/dist/extraction/languages/kotlin.js +379 -0
- package/dist/extraction/languages/kotlin.js.map +1 -0
- package/dist/extraction/languages/lua.d.ts +3 -0
- package/dist/extraction/languages/lua.d.ts.map +1 -0
- package/dist/extraction/languages/lua.js +150 -0
- package/dist/extraction/languages/lua.js.map +1 -0
- package/dist/extraction/languages/luau.d.ts +3 -0
- package/dist/extraction/languages/luau.d.ts.map +1 -0
- package/dist/extraction/languages/luau.js +37 -0
- package/dist/extraction/languages/luau.js.map +1 -0
- package/dist/extraction/languages/nix.d.ts +3 -0
- package/dist/extraction/languages/nix.d.ts.map +1 -0
- package/dist/extraction/languages/nix.js +294 -0
- package/dist/extraction/languages/nix.js.map +1 -0
- package/dist/extraction/languages/objc.d.ts +3 -0
- package/dist/extraction/languages/objc.d.ts.map +1 -0
- package/dist/extraction/languages/objc.js +175 -0
- package/dist/extraction/languages/objc.js.map +1 -0
- package/dist/extraction/languages/pascal.d.ts +3 -0
- package/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/dist/extraction/languages/pascal.js +77 -0
- package/dist/extraction/languages/pascal.js.map +1 -0
- package/dist/extraction/languages/php.d.ts +3 -0
- package/dist/extraction/languages/php.d.ts.map +1 -0
- package/dist/extraction/languages/php.js +196 -0
- package/dist/extraction/languages/php.js.map +1 -0
- package/dist/extraction/languages/python.d.ts +3 -0
- package/dist/extraction/languages/python.d.ts.map +1 -0
- package/dist/extraction/languages/python.js +56 -0
- package/dist/extraction/languages/python.js.map +1 -0
- package/dist/extraction/languages/r.d.ts +3 -0
- package/dist/extraction/languages/r.d.ts.map +1 -0
- package/dist/extraction/languages/r.js +314 -0
- package/dist/extraction/languages/r.js.map +1 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +149 -0
- package/dist/extraction/languages/ruby.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +142 -0
- package/dist/extraction/languages/rust.js.map +1 -0
- package/dist/extraction/languages/scala.d.ts +3 -0
- package/dist/extraction/languages/scala.d.ts.map +1 -0
- package/dist/extraction/languages/scala.js +209 -0
- package/dist/extraction/languages/scala.js.map +1 -0
- package/dist/extraction/languages/solidity.d.ts +3 -0
- package/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/dist/extraction/languages/solidity.js +293 -0
- package/dist/extraction/languages/solidity.js.map +1 -0
- package/dist/extraction/languages/swift.d.ts +3 -0
- package/dist/extraction/languages/swift.d.ts.map +1 -0
- package/dist/extraction/languages/swift.js +152 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/terraform.d.ts +3 -0
- package/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/dist/extraction/languages/terraform.js +641 -0
- package/dist/extraction/languages/terraform.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +16 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +167 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/languages/vbnet.d.ts +11 -0
- package/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/dist/extraction/languages/vbnet.js +141 -0
- package/dist/extraction/languages/vbnet.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +59 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +357 -0
- package/dist/extraction/liquid-extractor.js.map +1 -0
- package/dist/extraction/mybatis-extractor.d.ts +68 -0
- package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
- package/dist/extraction/mybatis-extractor.js +300 -0
- package/dist/extraction/mybatis-extractor.js.map +1 -0
- package/dist/extraction/parse-pool.d.ts +152 -0
- package/dist/extraction/parse-pool.d.ts.map +1 -0
- package/dist/extraction/parse-pool.js +387 -0
- package/dist/extraction/parse-pool.js.map +1 -0
- package/dist/extraction/parse-worker.d.ts +8 -0
- package/dist/extraction/parse-worker.d.ts.map +1 -0
- package/dist/extraction/parse-worker.js +104 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/razor-extractor.d.ts +42 -0
- package/dist/extraction/razor-extractor.d.ts.map +1 -0
- package/dist/extraction/razor-extractor.js +285 -0
- package/dist/extraction/razor-extractor.js.map +1 -0
- package/dist/extraction/svelte-extractor.d.ts +56 -0
- package/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/dist/extraction/svelte-extractor.js +275 -0
- package/dist/extraction/svelte-extractor.js.map +1 -0
- package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-helpers.js +153 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +258 -0
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-types.js +10 -0
- package/dist/extraction/tree-sitter-types.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts +706 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +6506 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/vue-extractor.d.ts +51 -0
- package/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/dist/extraction/vue-extractor.js +254 -0
- package/dist/extraction/vue-extractor.js.map +1 -0
- package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +106 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/queries.d.ts +106 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +339 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/graph/traversal.d.ts +127 -0
- package/dist/graph/traversal.d.ts.map +1 -0
- package/dist/graph/traversal.js +599 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +644 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1492 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/config-writer.d.ts +28 -0
- package/dist/installer/config-writer.d.ts.map +1 -0
- package/dist/installer/config-writer.js +91 -0
- package/dist/installer/config-writer.js.map +1 -0
- package/dist/installer/index.d.ts +142 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +619 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +41 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +53 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/antigravity.d.ts +57 -0
- package/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/installer/targets/antigravity.js +308 -0
- package/dist/installer/targets/antigravity.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +62 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +454 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/codex.d.ts +18 -0
- package/dist/installer/targets/codex.d.ts.map +1 -0
- package/dist/installer/targets/codex.js +185 -0
- package/dist/installer/targets/codex.js.map +1 -0
- package/dist/installer/targets/cursor.d.ts +35 -0
- package/dist/installer/targets/cursor.d.ts.map +1 -0
- package/dist/installer/targets/cursor.js +254 -0
- package/dist/installer/targets/cursor.js.map +1 -0
- package/dist/installer/targets/gemini.d.ts +26 -0
- package/dist/installer/targets/gemini.d.ts.map +1 -0
- package/dist/installer/targets/gemini.js +165 -0
- package/dist/installer/targets/gemini.js.map +1 -0
- package/dist/installer/targets/hermes.d.ts +18 -0
- package/dist/installer/targets/hermes.d.ts.map +1 -0
- package/dist/installer/targets/hermes.js +359 -0
- package/dist/installer/targets/hermes.js.map +1 -0
- package/dist/installer/targets/kiro.d.ts +27 -0
- package/dist/installer/targets/kiro.d.ts.map +1 -0
- package/dist/installer/targets/kiro.js +178 -0
- package/dist/installer/targets/kiro.js.map +1 -0
- package/dist/installer/targets/opencode.d.ts +38 -0
- package/dist/installer/targets/opencode.d.ts.map +1 -0
- package/dist/installer/targets/opencode.js +288 -0
- package/dist/installer/targets/opencode.js.map +1 -0
- package/dist/installer/targets/registry.d.ts +35 -0
- package/dist/installer/targets/registry.d.ts.map +1 -0
- package/dist/installer/targets/registry.js +91 -0
- package/dist/installer/targets/registry.js.map +1 -0
- package/dist/installer/targets/shared.d.ts +101 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +264 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/toml.d.ts +52 -0
- package/dist/installer/targets/toml.d.ts.map +1 -0
- package/dist/installer/targets/toml.js +147 -0
- package/dist/installer/targets/toml.js.map +1 -0
- package/dist/installer/targets/types.d.ts +108 -0
- package/dist/installer/targets/types.d.ts.map +1 -0
- package/dist/installer/targets/types.js +16 -0
- package/dist/installer/targets/types.js.map +1 -0
- package/dist/mcp/daemon-manager.d.ts +42 -0
- package/dist/mcp/daemon-manager.d.ts.map +1 -0
- package/dist/mcp/daemon-manager.js +129 -0
- package/dist/mcp/daemon-manager.js.map +1 -0
- package/dist/mcp/daemon-paths.d.ts +73 -0
- package/dist/mcp/daemon-paths.d.ts.map +1 -0
- package/dist/mcp/daemon-paths.js +165 -0
- package/dist/mcp/daemon-paths.js.map +1 -0
- package/dist/mcp/daemon-registry.d.ts +47 -0
- package/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/dist/mcp/daemon-registry.js +233 -0
- package/dist/mcp/daemon-registry.js.map +1 -0
- package/dist/mcp/daemon.d.ts +290 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +862 -0
- package/dist/mcp/daemon.js.map +1 -0
- package/dist/mcp/dynamic-boundaries.d.ts +41 -0
- package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
- package/dist/mcp/dynamic-boundaries.js +360 -0
- package/dist/mcp/dynamic-boundaries.js.map +1 -0
- package/dist/mcp/early-ppid.d.ts +26 -0
- package/dist/mcp/early-ppid.d.ts.map +1 -0
- package/dist/mcp/early-ppid.js +29 -0
- package/dist/mcp/early-ppid.js.map +1 -0
- package/dist/mcp/engine.d.ts +122 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +350 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +113 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +506 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/liveness-watchdog.d.ts +35 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
- package/dist/mcp/liveness-watchdog.js +267 -0
- package/dist/mcp/liveness-watchdog.js.map +1 -0
- package/dist/mcp/ppid-watchdog.d.ts +62 -0
- package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
- package/dist/mcp/ppid-watchdog.js +64 -0
- package/dist/mcp/ppid-watchdog.js.map +1 -0
- package/dist/mcp/proxy.d.ts +87 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +667 -0
- package/dist/mcp/proxy.js.map +1 -0
- package/dist/mcp/query-pool.d.ts +108 -0
- package/dist/mcp/query-pool.d.ts.map +1 -0
- package/dist/mcp/query-pool.js +315 -0
- package/dist/mcp/query-pool.js.map +1 -0
- package/dist/mcp/query-worker.d.ts +24 -0
- package/dist/mcp/query-worker.d.ts.map +1 -0
- package/dist/mcp/query-worker.js +87 -0
- package/dist/mcp/query-worker.js.map +1 -0
- package/dist/mcp/server-instructions.d.ts +34 -0
- package/dist/mcp/server-instructions.d.ts.map +1 -0
- package/dist/mcp/server-instructions.js +106 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +93 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +357 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/startup-handshake.d.ts +44 -0
- package/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/dist/mcp/startup-handshake.js +73 -0
- package/dist/mcp/startup-handshake.js.map +1 -0
- package/dist/mcp/stdin-teardown.d.ts +27 -0
- package/dist/mcp/stdin-teardown.d.ts.map +1 -0
- package/dist/mcp/stdin-teardown.js +49 -0
- package/dist/mcp/stdin-teardown.js.map +1 -0
- package/dist/mcp/tools.d.ts +613 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +4477 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transport.d.ts +188 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +377 -0
- package/dist/mcp/transport.js.map +1 -0
- package/dist/mcp/version.d.ts +19 -0
- package/dist/mcp/version.d.ts.map +1 -0
- package/dist/mcp/version.js +71 -0
- package/dist/mcp/version.js.map +1 -0
- package/dist/project-config.d.ts +94 -0
- package/dist/project-config.d.ts.map +1 -0
- package/dist/project-config.js +374 -0
- package/dist/project-config.js.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +6 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.js +1062 -0
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +15 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +3938 -0
- package/dist/resolution/callback-synthesizer.js.map +1 -0
- package/dist/resolution/cooperative-yield.d.ts +32 -0
- package/dist/resolution/cooperative-yield.d.ts.map +1 -0
- package/dist/resolution/cooperative-yield.js +42 -0
- package/dist/resolution/cooperative-yield.js.map +1 -0
- package/dist/resolution/frameworks/astro.d.ts +9 -0
- package/dist/resolution/frameworks/astro.d.ts.map +1 -0
- package/dist/resolution/frameworks/astro.js +169 -0
- package/dist/resolution/frameworks/astro.js.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/dist/resolution/frameworks/cics.d.ts +20 -0
- package/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/dist/resolution/frameworks/cics.js +90 -0
- package/dist/resolution/frameworks/cics.js.map +1 -0
- package/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/dist/resolution/frameworks/csharp.js +241 -0
- package/dist/resolution/frameworks/csharp.js.map +1 -0
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/dist/resolution/frameworks/drupal.js +367 -0
- package/dist/resolution/frameworks/drupal.js.map +1 -0
- package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
- package/dist/resolution/frameworks/expo-modules.js +148 -0
- package/dist/resolution/frameworks/expo-modules.js.map +1 -0
- package/dist/resolution/frameworks/express.d.ts +8 -0
- package/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/dist/resolution/frameworks/express.js +308 -0
- package/dist/resolution/frameworks/express.js.map +1 -0
- package/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
- package/dist/resolution/frameworks/fabric.js +354 -0
- package/dist/resolution/frameworks/fabric.js.map +1 -0
- package/dist/resolution/frameworks/go.d.ts +8 -0
- package/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/dist/resolution/frameworks/go.js +161 -0
- package/dist/resolution/frameworks/go.js.map +1 -0
- package/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
- package/dist/resolution/frameworks/goframe.js +112 -0
- package/dist/resolution/frameworks/goframe.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +50 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +175 -0
- package/dist/resolution/frameworks/index.js.map +1 -0
- package/dist/resolution/frameworks/java.d.ts +8 -0
- package/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/dist/resolution/frameworks/java.js +517 -0
- package/dist/resolution/frameworks/java.js.map +1 -0
- package/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/dist/resolution/frameworks/laravel.js +257 -0
- package/dist/resolution/frameworks/laravel.js.map +1 -0
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nestjs.js +698 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/frameworks/play.d.ts +19 -0
- package/dist/resolution/frameworks/play.d.ts.map +1 -0
- package/dist/resolution/frameworks/play.js +111 -0
- package/dist/resolution/frameworks/play.js.map +1 -0
- package/dist/resolution/frameworks/python.d.ts +10 -0
- package/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/dist/resolution/frameworks/python.js +400 -0
- package/dist/resolution/frameworks/python.js.map +1 -0
- package/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-native.js +410 -0
- package/dist/resolution/frameworks/react-native.js.map +1 -0
- package/dist/resolution/frameworks/react.d.ts +8 -0
- package/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/dist/resolution/frameworks/react.js +334 -0
- package/dist/resolution/frameworks/react.js.map +1 -0
- package/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/dist/resolution/frameworks/ruby.js +302 -0
- package/dist/resolution/frameworks/ruby.js.map +1 -0
- package/dist/resolution/frameworks/rust.d.ts +8 -0
- package/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/dist/resolution/frameworks/rust.js +304 -0
- package/dist/resolution/frameworks/rust.js.map +1 -0
- package/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/dist/resolution/frameworks/svelte.js +253 -0
- package/dist/resolution/frameworks/svelte.js.map +1 -0
- package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
- package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift-objc.js +252 -0
- package/dist/resolution/frameworks/swift-objc.js.map +1 -0
- package/dist/resolution/frameworks/swift.d.ts +10 -0
- package/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift.js +400 -0
- package/dist/resolution/frameworks/swift.js.map +1 -0
- package/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/dist/resolution/frameworks/terraform.js +277 -0
- package/dist/resolution/frameworks/terraform.js.map +1 -0
- package/dist/resolution/frameworks/vue.d.ts +9 -0
- package/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/dist/resolution/frameworks/vue.js +303 -0
- package/dist/resolution/frameworks/vue.js.map +1 -0
- package/dist/resolution/go-module.d.ts +26 -0
- package/dist/resolution/go-module.d.ts.map +1 -0
- package/dist/resolution/go-module.js +78 -0
- package/dist/resolution/go-module.js.map +1 -0
- package/dist/resolution/goframe-synthesizer.d.ts +29 -0
- package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
- package/dist/resolution/goframe-synthesizer.js +163 -0
- package/dist/resolution/goframe-synthesizer.js.map +1 -0
- package/dist/resolution/import-resolver.d.ts +85 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +1974 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +258 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +1746 -0
- package/dist/resolution/index.js.map +1 -0
- package/dist/resolution/lru-cache.d.ts +24 -0
- package/dist/resolution/lru-cache.d.ts.map +1 -0
- package/dist/resolution/lru-cache.js +62 -0
- package/dist/resolution/lru-cache.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +112 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +1830 -0
- package/dist/resolution/name-matcher.js.map +1 -0
- package/dist/resolution/path-aliases.d.ts +68 -0
- package/dist/resolution/path-aliases.d.ts.map +1 -0
- package/dist/resolution/path-aliases.js +238 -0
- package/dist/resolution/path-aliases.js.map +1 -0
- package/dist/resolution/strip-comments.d.ts +27 -0
- package/dist/resolution/strip-comments.d.ts.map +1 -0
- package/dist/resolution/strip-comments.js +492 -0
- package/dist/resolution/strip-comments.js.map +1 -0
- package/dist/resolution/swift-objc-bridge.d.ts +134 -0
- package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
- package/dist/resolution/swift-objc-bridge.js +256 -0
- package/dist/resolution/swift-objc-bridge.js.map +1 -0
- package/dist/resolution/types.d.ts +262 -0
- package/dist/resolution/types.d.ts.map +1 -0
- package/dist/resolution/types.js +8 -0
- package/dist/resolution/types.js.map +1 -0
- package/dist/resolution/workspace-packages.d.ts +58 -0
- package/dist/resolution/workspace-packages.d.ts.map +1 -0
- package/dist/resolution/workspace-packages.js +346 -0
- package/dist/resolution/workspace-packages.js.map +1 -0
- package/dist/search/identifier-segments.d.ts +60 -0
- package/dist/search/identifier-segments.d.ts.map +1 -0
- package/dist/search/identifier-segments.js +176 -0
- package/dist/search/identifier-segments.js.map +1 -0
- package/dist/search/query-parser.d.ts +57 -0
- package/dist/search/query-parser.d.ts.map +1 -0
- package/dist/search/query-parser.js +177 -0
- package/dist/search/query-parser.js.map +1 -0
- package/dist/search/query-utils.d.ts +87 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +449 -0
- package/dist/search/query-utils.js.map +1 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/git-hooks.d.ts.map +1 -0
- package/dist/sync/git-hooks.js +227 -0
- package/dist/sync/git-hooks.js.map +1 -0
- package/dist/sync/index.d.ts +19 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +35 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watch-policy.d.ts.map +1 -0
- package/dist/sync/watch-policy.js +124 -0
- package/dist/sync/watch-policy.js.map +1 -0
- package/dist/sync/watcher.d.ts +355 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +848 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/sync/worktree.d.ts +63 -0
- package/dist/sync/worktree.d.ts.map +1 -0
- package/dist/sync/worktree.js +182 -0
- package/dist/sync/worktree.js.map +1 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +541 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/types.d.ts +415 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +91 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +78 -0
- package/dist/ui/glyphs.js.map +1 -0
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/dist/ui/shimmer-progress.js +90 -0
- package/dist/ui/shimmer-progress.js.map +1 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/dist/ui/shimmer-worker.js +118 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +3 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/upgrade/index.d.ts +164 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +646 -0
- package/dist/upgrade/index.js.map +1 -0
- package/dist/upgrade/remove-binary.d.ts +87 -0
- package/dist/upgrade/remove-binary.d.ts.map +1 -0
- package/dist/upgrade/remove-binary.js +289 -0
- package/dist/upgrade/remove-binary.js.map +1 -0
- package/dist/upgrade/update-check.d.ts +92 -0
- package/dist/upgrade/update-check.d.ts.map +1 -0
- package/dist/upgrade/update-check.js +258 -0
- package/dist/upgrade/update-check.js.map +1 -0
- package/dist/utils.d.ts +224 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +583 -0
- package/dist/utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-adapter.js","sourceRoot":"","sources":["../../src/db/sqlite-adapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAsQH,wCAqCC;AA5QD;;;;;;;;GAQG;AACH,MAAM,iBAAiB;IACb,GAAG,CAAM;IAEjB,YAAY,MAAc;QACxB,iEAAiE;QACjE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,GAAW;QACjB,oEAAoE;QACpE,4EAA4E;QAC5E,qBAAqB;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO;YACL,GAAG,CAAC,GAAG,MAAa;gBAClB,MAAM,CAAC,GAAG,IAAI,CAAC,G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CAAC,YAAY,CAAC,CAAC;QACtB,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC;YACH,OAAO,EAAE,EAAE,EAAE,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;QACrE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnE,MAAM,IAAI,KAAK,CACb,yCAAyC;gBACzC,+DAA+D;gBAC/D,qBAAqB,GAAG,EAAE,CAC3B,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,EAAE,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IACvE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,0CAA0C;YAC1C,uEAAuE;YACvE,yEAAyE;YACzE,uCAAuC;YACvC,qBAAqB,GAAG,EAAE,CAC3B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAL checkpoint valve — bounds WAL growth while auto-checkpointing is
|
|
3
|
+
* deferred during a bulk index (#1231).
|
|
4
|
+
*
|
|
5
|
+
* Why deferral: SQLite's default `wal_autocheckpoint` (1000 pages) re-writes
|
|
6
|
+
* hot B-tree/FTS pages into the main DB file over and over during a bulk
|
|
7
|
+
* index — measured at ~95% of ALL disk I/O, and the difference between 45s
|
|
8
|
+
* and 19+ minutes on HDD-class storage (150 random IOPS). Deferring
|
|
9
|
+
* checkpoints turns the store into pure sequential WAL appends; each backfill
|
|
10
|
+
* pass writes distinct pages once, in page order (≈ sequential).
|
|
11
|
+
*
|
|
12
|
+
* Why a valve: unbounded deferral is its own failure mode, both measured in
|
|
13
|
+
* the #1231 repro. The WAL duplicates hot pages per COMMIT, so it grows far
|
|
14
|
+
* faster than the DB (5.9GB WAL for a ~340MB DB on a 3.3k-file index) —
|
|
15
|
+
* filling the disk, and poisoning every subsequent read that must page
|
|
16
|
+
* through it (the first resolution-phase read blocked the main thread >60s
|
|
17
|
+
* and the #850 liveness watchdog killed the healthy index). The valve
|
|
18
|
+
* watches WAL growth on a timer and, past a soft threshold, backfills with
|
|
19
|
+
* `PRAGMA wal_checkpoint(PASSIVE)` on a worker-thread connection — PASSIVE
|
|
20
|
+
* never blocks the writer, and off-thread means the main thread (and the
|
|
21
|
+
* watchdog heartbeat) keep turning regardless of how long a backfill takes.
|
|
22
|
+
*
|
|
23
|
+
* The load-bearing subtlety: a WAL file's SIZE never shrinks. After a full
|
|
24
|
+
* backfill, the writer's next commit RESTARTS the WAL from the top and the
|
|
25
|
+
* frames recycle inside the same file — so raw size says nothing about the
|
|
26
|
+
* un-backfilled backlog, and a size-triggered valve degenerates into firing
|
|
27
|
+
* (and pausing the writer) forever once the file passes its threshold
|
|
28
|
+
* (measured: guava crawled at ~9min per 160 files). Instead the valve
|
|
29
|
+
* tracks `sizeAtLastFullBackfill` — refreshed whenever a checkpoint reports
|
|
30
|
+
* `log === checkpointed` (everything backfilled) — and triggers on GROWTH
|
|
31
|
+
* beyond that baseline, which only happens when genuinely un-backfilled
|
|
32
|
+
* frames push past the file's high-water mark.
|
|
33
|
+
*
|
|
34
|
+
* Backpressure: if the writer outruns the checkpointer past a hard cap of
|
|
35
|
+
* growth (2× soft), {@link backpressure} pauses the writer (at a safe,
|
|
36
|
+
* between-transactions boundary) until a FULL backfill lands. One in-flight
|
|
37
|
+
* pass is not enough: on a disk saturated by the writer, every concurrent
|
|
38
|
+
* PASSIVE pass is already stale by the time it finishes (the writer appended
|
|
39
|
+
* past its snapshot), so neither SQLite's WAL wrap nor the baseline ever
|
|
40
|
+
* trigger and the WAL grows without bound (measured: 5.9GB on guava at 150
|
|
41
|
+
* IOPS, then a >60s read stall and a watchdog kill). With the writer parked,
|
|
42
|
+
* the next pass covers everything, the WAL wraps on the following commit,
|
|
43
|
+
* and the pause is the disk's honest catch-up cost — the correct terminal
|
|
44
|
+
* mode when hardware genuinely can't keep up with the append rate.
|
|
45
|
+
*/
|
|
46
|
+
import type { DatabaseConnection } from './index';
|
|
47
|
+
/**
|
|
48
|
+
* Resolve the valve's soft threshold from the `CODEGRAPH_WAL_VALVE_MB`
|
|
49
|
+
* override; non-numeric / non-positive values fall back to the default.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveWalValveMb(envVal: string | undefined): number;
|
|
52
|
+
export declare class WalCheckpointValve {
|
|
53
|
+
private readonly db;
|
|
54
|
+
private readonly intervalMs;
|
|
55
|
+
private readonly log;
|
|
56
|
+
private timer;
|
|
57
|
+
private inflight;
|
|
58
|
+
/** Writer pause in progress (hard cap breached): passes loop until a full backfill. */
|
|
59
|
+
private pause;
|
|
60
|
+
/**
|
|
61
|
+
* WAL file size observed when a checkpoint last reported the ENTIRE WAL
|
|
62
|
+
* backfilled. Growth is measured against this baseline — see the header
|
|
63
|
+
* comment for why absolute size cannot be used.
|
|
64
|
+
*/
|
|
65
|
+
private sizeAtLastFullBackfill;
|
|
66
|
+
private readonly softBytes;
|
|
67
|
+
private readonly hardBytes;
|
|
68
|
+
constructor(db: DatabaseConnection, softMb?: number, intervalMs?: number, log?: (msg: string) => void);
|
|
69
|
+
private mb;
|
|
70
|
+
/** Un-backfilled growth estimate: bytes the WAL has grown past the last full backfill. */
|
|
71
|
+
private growthBytes;
|
|
72
|
+
/** Begin watching the WAL. Idempotent; the timer never holds the loop open. */
|
|
73
|
+
start(): void;
|
|
74
|
+
/** Stop watching. Any in-flight checkpoint keeps running — await drain(). */
|
|
75
|
+
stop(): void;
|
|
76
|
+
/** One poll: fire an off-thread passive checkpoint when growth passes the soft threshold. */
|
|
77
|
+
check(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Writer-side backstop, called at a between-transactions boundary. Returns
|
|
80
|
+
* null (no wait) while growth is under the hard cap; past it, returns a
|
|
81
|
+
* promise that resolves only once a FULL backfill has landed — see the
|
|
82
|
+
* header comment for why a single pass is not enough on a saturated disk.
|
|
83
|
+
*/
|
|
84
|
+
backpressure(): Promise<void> | null;
|
|
85
|
+
/** Await any in-flight checkpoint and writer pause. */
|
|
86
|
+
drain(): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Phase-boundary fold: backfill the ENTIRE WAL now (off-thread, awaited).
|
|
89
|
+
* Called between bulk phases — e.g. after parsing, before resolution's
|
|
90
|
+
* first reads — so the next phase never pages a bulk-write-sized WAL on
|
|
91
|
+
* the main thread (the post-parse read against a multi-GB WAL is what
|
|
92
|
+
* blew the #850 watchdog's 60s window in the #1231 repro). The await
|
|
93
|
+
* keeps the event loop (and the watchdog heartbeat) turning.
|
|
94
|
+
*/
|
|
95
|
+
foldNow(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* With the writer parked on the returned promise, loop passive passes until
|
|
98
|
+
* one reports the entire WAL backfilled (typically the second: the first
|
|
99
|
+
* drains the pass that was already running against a stale snapshot). Gives
|
|
100
|
+
* up after a bounded number of passes — e.g. a reader pinning the WAL —
|
|
101
|
+
* because unbounded WAL growth degrades; a wedged writer never recovers.
|
|
102
|
+
*/
|
|
103
|
+
private backfillFully;
|
|
104
|
+
private fire;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=wal-valve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wal-valve.d.ts","sourceRoot":"","sources":["../../src/db/wal-valve.ts"],"names":[],"mappings":"AA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|
|
3
|
+
* WAL checkpoint valve — bounds WAL growth while auto-checkpointing is
|
|
4
|
+
* deferred during a bulk index (#1231).
|
|
5
|
+
*
|
|
6
|
+
* Why deferral: SQLite's default `wal_autocheckpoint` (1000 pages) re-writes
|
|
7
|
+
* hot B-tree/FTS pages into the main DB file over and over during a bulk
|
|
8
|
+
* index — measured at ~95% of ALL disk I/O, and the difference between 45s
|
|
9
|
+
* and 19+ minutes on HDD-class storage (150 random IOPS). Deferring
|
|
10
|
+
* checkpoints turns the store into pure sequential WAL appends; each backfill
|
|
11
|
+
* pass writes distinct pages once, in page order (≈ sequential).
|
|
12
|
+
*
|
|
13
|
+
* Why a valve: unbounded deferral is its own failure mode, both measured in
|
|
14
|
+
* the #1231 repro. The WAL duplicates hot pages per COMMIT, so it grows far
|
|
15
|
+
* faster than the DB (5.9GB WAL for a ~340MB DB on a 3.3k-file index) —
|
|
16
|
+
* filling the disk, and poisoning every subsequent read that must page
|
|
17
|
+
* through it (the first resolution-phase read blocked the main thread >60s
|
|
18
|
+
* and the #850 liveness watchdog killed the healthy index). The valve
|
|
19
|
+
* watches WAL growth on a timer and, past a soft threshold, backfills with
|
|
20
|
+
* `PRAGMA wal_checkpoint(PASSIVE)` on a worker-thread connection — PASSIVE
|
|
21
|
+
* never blocks the writer, and off-thread means the main thread (and the
|
|
22
|
+
* watchdog heartbeat) keep turning regardless of how long a backfill takes.
|
|
23
|
+
*
|
|
24
|
+
* The load-bearing subtlety: a WAL file's SIZE never shrinks. After a full
|
|
25
|
+
* backfill, the writer's next commit RESTARTS the WAL from the top and the
|
|
26
|
+
* frames recycle inside the same file — so raw size says nothing about the
|
|
27
|
+
* un-backfilled backlog, and a size-triggered valve degenerates into firing
|
|
28
|
+
* (and pausing the writer) forever once the file passes its threshold
|
|
29
|
+
* (measured: guava crawled at ~9min per 160 files). Instead the valve
|
|
30
|
+
* tracks `sizeAtLastFullBackfill` — refreshed whenever a checkpoint reports
|
|
31
|
+
* `log === checkpointed` (everything backfilled) — and triggers on GROWTH
|
|
32
|
+
* beyond that baseline, which only happens when genuinely un-backfilled
|
|
33
|
+
* frames push past the file's high-water mark.
|
|
34
|
+
*
|
|
35
|
+
* Backpressure: if the writer outruns the checkpointer past a hard cap of
|
|
36
|
+
* growth (2× soft), {@link backpressure} pauses the writer (at a safe,
|
|
37
|
+
* between-transactions boundary) until a FULL backfill lands. One in-flight
|
|
38
|
+
* pass is not enough: on a disk saturated by the writer, every concurrent
|
|
39
|
+
* PASSIVE pass is already stale by the time it finishes (the writer appended
|
|
40
|
+
* past its snapshot), so neither SQLite's WAL wrap nor the baseline ever
|
|
41
|
+
* trigger and the WAL grows without bound (measured: 5.9GB on guava at 150
|
|
42
|
+
* IOPS, then a >60s read stall and a watchdog kill). With the writer parked,
|
|
43
|
+
* the next pass covers everything, the WAL wraps on the following commit,
|
|
44
|
+
* and the pause is the disk's honest catch-up cost — the correct terminal
|
|
45
|
+
* mode when hardware genuinely can't keep up with the append rate.
|
|
46
|
+
*/
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.WalCheckpointValve = void 0;
|
|
49
|
+
exports.resolveWalValveMb = resolveWalValveMb;
|
|
50
|
+
/** Soft WAL-growth threshold (MB) that triggers an off-thread passive checkpoint. */
|
|
51
|
+
const DEFAULT_WAL_VALVE_MB = 256;
|
|
52
|
+
/** Hard cap = this × soft threshold; past it the writer pauses for a full backfill. */
|
|
53
|
+
const HARD_CAP_MULTIPLIER = 2;
|
|
54
|
+
/** Passes attempted per writer pause before giving up (a pinned reader could stall forever). */
|
|
55
|
+
const MAX_PAUSED_BACKFILL_PASSES = 20;
|
|
56
|
+
/** How often the timer looks at the WAL file size. */
|
|
57
|
+
const CHECK_INTERVAL_MS = 2000;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the valve's soft threshold from the `CODEGRAPH_WAL_VALVE_MB`
|
|
60
|
+
* override; non-numeric / non-positive values fall back to the default.
|
|
61
|
+
*/
|
|
62
|
+
function resolveWalValveMb(envVal) {
|
|
63
|
+
if (envVal !== undefined && envVal !== '') {
|
|
64
|
+
const n = Number(envVal);
|
|
65
|
+
if (Number.isFinite(n) && n > 0)
|
|
66
|
+
return Math.floor(n);
|
|
67
|
+
}
|
|
68
|
+
return DEFAULT_WAL_VALVE_MB;
|
|
69
|
+
}
|
|
70
|
+
class WalCheckpointValve {
|
|
71
|
+
db;
|
|
72
|
+
intervalMs;
|
|
73
|
+
log;
|
|
74
|
+
timer = null;
|
|
75
|
+
inflight = null;
|
|
76
|
+
/** Writer pause in progress (hard cap breached): passes loop until a full backfill. */
|
|
77
|
+
pause = null;
|
|
78
|
+
/**
|
|
79
|
+
* WAL file size observed when a checkpoint last reported the ENTIRE WAL
|
|
80
|
+
* backfilled. Growth is measured against this baseline — see the header
|
|
81
|
+
* comment for why absolute size cannot be used.
|
|
82
|
+
*/
|
|
83
|
+
sizeAtLastFullBackfill = 0;
|
|
84
|
+
softBytes;
|
|
85
|
+
hardBytes;
|
|
86
|
+
constructor(db, softMb = resolveWalValveMb(process.env.CODEGRAPH_WAL_VALVE_MB), intervalMs = CHECK_INTERVAL_MS, log = () => { }) {
|
|
87
|
+
this.db = db;
|
|
88
|
+
this.intervalMs = intervalMs;
|
|
89
|
+
this.log = log;
|
|
90
|
+
this.softBytes = softMb * 1024 * 1024;
|
|
91
|
+
this.hardBytes = this.softBytes * HARD_CAP_MULTIPLIER;
|
|
92
|
+
}
|
|
93
|
+
mb(n) {
|
|
94
|
+
return `${Math.round(n / 1024 / 1024)}MB`;
|
|
95
|
+
}
|
|
96
|
+
/** Un-backfilled growth estimate: bytes the WAL has grown past the last full backfill. */
|
|
97
|
+
growthBytes() {
|
|
98
|
+
return this.db.getWalSizeBytes() - this.sizeAtLastFullBackfill;
|
|
99
|
+
}
|
|
100
|
+
/** Begin watching the WAL. Idempotent; the timer never holds the loop open. */
|
|
101
|
+
start() {
|
|
102
|
+
if (this.timer)
|
|
103
|
+
return;
|
|
104
|
+
this.timer = setInterval(() => this.check(), this.intervalMs);
|
|
105
|
+
this.timer.unref?.();
|
|
106
|
+
}
|
|
107
|
+
/** Stop watching. Any in-flight checkpoint keeps running — await drain(). */
|
|
108
|
+
stop() {
|
|
109
|
+
if (this.timer) {
|
|
110
|
+
clearInterval(this.timer);
|
|
111
|
+
this.timer = null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** One poll: fire an off-thread passive checkpoint when growth passes the soft threshold. */
|
|
115
|
+
check() {
|
|
116
|
+
if (!this.pause && !this.inflight && this.growthBytes() > this.softBytes)
|
|
117
|
+
this.fire();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Writer-side backstop, called at a between-transactions boundary. Returns
|
|
121
|
+
* null (no wait) while growth is under the hard cap; past it, returns a
|
|
122
|
+
* promise that resolves only once a FULL backfill has landed — see the
|
|
123
|
+
* header comment for why a single pass is not enough on a saturated disk.
|
|
124
|
+
*/
|
|
125
|
+
backpressure() {
|
|
126
|
+
if (this.pause)
|
|
127
|
+
return this.pause;
|
|
128
|
+
if (this.growthBytes() <= this.hardBytes)
|
|
129
|
+
return null;
|
|
130
|
+
this.log(`backpressure: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)} — pausing writer for full backfill`);
|
|
131
|
+
const t0 = Date.now();
|
|
132
|
+
this.pause = this.backfillFully().finally(() => {
|
|
133
|
+
this.pause = null;
|
|
134
|
+
this.log(`backpressure released after ${Date.now() - t0}ms: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)}`);
|
|
135
|
+
});
|
|
136
|
+
return this.pause;
|
|
137
|
+
}
|
|
138
|
+
/** Await any in-flight checkpoint and writer pause. */
|
|
139
|
+
async drain() {
|
|
140
|
+
while (this.pause || this.inflight) {
|
|
141
|
+
if (this.pause)
|
|
142
|
+
await this.pause;
|
|
143
|
+
if (this.inflight)
|
|
144
|
+
await this.inflight;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Phase-boundary fold: backfill the ENTIRE WAL now (off-thread, awaited).
|
|
149
|
+
* Called between bulk phases — e.g. after parsing, before resolution's
|
|
150
|
+
* first reads — so the next phase never pages a bulk-write-sized WAL on
|
|
151
|
+
* the main thread (the post-parse read against a multi-GB WAL is what
|
|
152
|
+
* blew the #850 watchdog's 60s window in the #1231 repro). The await
|
|
153
|
+
* keeps the event loop (and the watchdog heartbeat) turning.
|
|
154
|
+
*/
|
|
155
|
+
async foldNow() {
|
|
156
|
+
await this.drain();
|
|
157
|
+
if (this.growthBytes() <= 0)
|
|
158
|
+
return;
|
|
159
|
+
this.log(`foldNow: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)}`);
|
|
160
|
+
this.pause = this.backfillFully().finally(() => { this.pause = null; });
|
|
161
|
+
await this.pause;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* With the writer parked on the returned promise, loop passive passes until
|
|
165
|
+
* one reports the entire WAL backfilled (typically the second: the first
|
|
166
|
+
* drains the pass that was already running against a stale snapshot). Gives
|
|
167
|
+
* up after a bounded number of passes — e.g. a reader pinning the WAL —
|
|
168
|
+
* because unbounded WAL growth degrades; a wedged writer never recovers.
|
|
169
|
+
*/
|
|
170
|
+
async backfillFully() {
|
|
171
|
+
for (let i = 0; i < MAX_PAUSED_BACKFILL_PASSES; i++) {
|
|
172
|
+
if (this.inflight)
|
|
173
|
+
await this.inflight; // fold in the stale in-flight pass first
|
|
174
|
+
const res = await this.db.checkpointWalPassive();
|
|
175
|
+
if (!res)
|
|
176
|
+
return; // checkpoint machinery unavailable — don't spin
|
|
177
|
+
this.log(`backfill pass ${i + 1}: busy=${res.busy} log=${res.log} checkpointed=${res.checkpointed} wal=${this.mb(this.db.getWalSizeBytes())}`);
|
|
178
|
+
if (res.busy === 0 && res.log === res.checkpointed) {
|
|
179
|
+
this.sizeAtLastFullBackfill = this.db.getWalSizeBytes();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
this.log(`backfill gave up after ${MAX_PAUSED_BACKFILL_PASSES} passes — WAL stays unbounded this cycle`);
|
|
184
|
+
}
|
|
185
|
+
fire() {
|
|
186
|
+
const p = this.db
|
|
187
|
+
.checkpointWalPassive()
|
|
188
|
+
.then((res) => {
|
|
189
|
+
// Full backfill (busy 0, every log frame checkpointed) ⇒ the writer's
|
|
190
|
+
// next commit wraps the WAL; the file's current size becomes the new
|
|
191
|
+
// growth baseline. A partial pass (writer appended during it, or a
|
|
192
|
+
// read transaction pinned frames) leaves the baseline alone, so the
|
|
193
|
+
// next tick fires again and copies the remainder. In non-WAL mode
|
|
194
|
+
// SQLite reports log = checkpointed = -1, which is harmless here.
|
|
195
|
+
if (res && res.busy === 0 && res.log === res.checkpointed) {
|
|
196
|
+
this.sizeAtLastFullBackfill = this.db.getWalSizeBytes();
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
.catch(() => { })
|
|
200
|
+
.finally(() => {
|
|
201
|
+
if (this.inflight === p)
|
|
202
|
+
this.inflight = null;
|
|
203
|
+
});
|
|
204
|
+
this.inflight = p;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.WalCheckpointValve = WalCheckpointValve;
|
|
208
|
+
//# sourceMappingURL=wal-valve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wal-valve.js","sourceRoot":"","sources":["../../src/db/wal-valve.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;;;AAiBH,8CAMC;AAnBD,qFAAqF;AACrF,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACjC,uFAAuF;AACvF,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,gGAAgG;AAChG,MAAM,0BAA0B,GAAG,EAAE,CAAC;AACtC,sDAAsD;AACtD,MAAM,iBAAiB,GAAG,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AChD,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;CACF;AAxID,gDAwIC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory Management
|
|
3
|
+
*
|
|
4
|
+
* Manages the .codegraph/ directory structure for CodeGraph data.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the per-project data directory name, honoring the `CODEGRAPH_DIR`
|
|
8
|
+
* environment override (default `.codegraph`). The override is a single path
|
|
9
|
+
* segment that lives in the project root.
|
|
10
|
+
*
|
|
11
|
+
* Why this exists: two environments that share one working tree must NOT share
|
|
12
|
+
* one `.codegraph/` — most concretely Windows-native and WSL (issue #636). The
|
|
13
|
+
* daemon lockfile (`.codegraph/daemon.pid`) records a platform-specific pid and
|
|
14
|
+
* socket path (a Windows named pipe vs a WSL Unix socket), and SQLite file
|
|
15
|
+
* locking across the WSL2 ↔ Windows filesystem boundary is unreliable, so two
|
|
16
|
+
* daemons sharing one index risks corruption. Setting `CODEGRAPH_DIR=.codegraph-win`
|
|
17
|
+
* on one side gives each environment its own index in the same tree.
|
|
18
|
+
*
|
|
19
|
+
* Read live (not captured at load) so it is both process-accurate and testable.
|
|
20
|
+
* An override that isn't a plain directory name — empty, containing a path
|
|
21
|
+
* separator, `.`, `..`/traversal, or absolute — is ignored (we keep the
|
|
22
|
+
* default) rather than risk writing the index outside the project or into the
|
|
23
|
+
* project root itself; we warn once to stderr so the misconfiguration is seen.
|
|
24
|
+
*/
|
|
25
|
+
export declare function codeGraphDirName(): string;
|
|
26
|
+
/**
|
|
27
|
+
* CodeGraph directory name — a load-time snapshot of {@link codeGraphDirName}.
|
|
28
|
+
* A running process's environment is fixed, so this equals the live value;
|
|
29
|
+
* it's kept as a stable string export for backward compatibility. Internal code
|
|
30
|
+
* resolves the name through {@link codeGraphDirName} / {@link getCodeGraphDir}
|
|
31
|
+
* so the `CODEGRAPH_DIR` override always applies.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CODEGRAPH_DIR: string;
|
|
34
|
+
/**
|
|
35
|
+
* Is `name` (a single path segment) a CodeGraph data directory? Matches the
|
|
36
|
+
* default `.codegraph`, the active `CODEGRAPH_DIR` override, and any
|
|
37
|
+
* `.codegraph-*` sibling. File-watching and the indexer skip ALL of these, so
|
|
38
|
+
* when two environments share one working tree (Windows + WSL, issue #636)
|
|
39
|
+
* neither indexes or watches the other's index directory.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isCodeGraphDataDir(name: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Get the .codegraph directory path for a project
|
|
44
|
+
*/
|
|
45
|
+
export declare function getCodeGraphDir(projectRoot: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Check if a project has been initialized with CodeGraph
|
|
48
|
+
* Requires both .codegraph/ directory AND codegraph.db to exist
|
|
49
|
+
*/
|
|
50
|
+
export declare function isInitialized(projectRoot: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Find the nearest parent directory containing .codegraph/
|
|
53
|
+
*
|
|
54
|
+
* Walks up from the given path to find a CodeGraph-initialized project,
|
|
55
|
+
* similar to how git finds .git/ directories.
|
|
56
|
+
*
|
|
57
|
+
* @param startPath - Directory to start searching from
|
|
58
|
+
* @returns The project root containing .codegraph/, or null if not found
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Reason a directory is unsafe to use as an index ROOT, or null when it's fine.
|
|
62
|
+
*
|
|
63
|
+
* Indexing your home directory or a filesystem root drags in caches, `Library`,
|
|
64
|
+
* every other project, etc. — a multi-GB index, constant file-watcher churn, and
|
|
65
|
+
* (pre-1.0 on macOS) a file-descriptor blowup that exhausted `kern.maxfiles` and
|
|
66
|
+
* took unrelated apps / the whole machine down (#845). The classic trigger:
|
|
67
|
+
* running the installer or `codegraph init` from `$HOME`, which auto-indexes the
|
|
68
|
+
* current directory. These are never intended project roots, so the installer
|
|
69
|
+
* and `init`/`index` refuse them (overridable with `--force`).
|
|
70
|
+
*
|
|
71
|
+
* Pure-ish (reads only `os.homedir()` + realpath) so it's easy to unit-test.
|
|
72
|
+
* The returned string is a human phrase that slots into "… looks like {reason}".
|
|
73
|
+
*/
|
|
74
|
+
export declare function unsafeIndexRootReason(projectRoot: string): string | null;
|
|
75
|
+
export declare function findNearestCodeGraphRoot(startPath: string): string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Indexed sub-project roots beneath `root` (bounded breadth-first scan). For
|
|
78
|
+
* the monorepo case behind #964: the index lives in a CHILD
|
|
79
|
+
* (`packages/x/.codegraph/`), not at the workspace root the agent's cwd points
|
|
80
|
+
* at. Descent stops at the first indexed directory on a branch (a project's
|
|
81
|
+
* own sub-dirs aren't separate projects) and is bounded by depth + count so it
|
|
82
|
+
* never turns into a full-tree crawl on a large repo.
|
|
83
|
+
*/
|
|
84
|
+
export declare function findIndexedSubprojectRoots(root: string, opts?: {
|
|
85
|
+
maxDepth?: number;
|
|
86
|
+
max?: number;
|
|
87
|
+
}): string[];
|
|
88
|
+
/**
|
|
89
|
+
* Does `prompt` contain an explicit structural keyword? A keyword is a strong,
|
|
90
|
+
* self-contained signal, so the front-load hook fires on it directly — no graph
|
|
91
|
+
* check needed. (A *code-token* match, by contrast, is only a candidate the
|
|
92
|
+
* hook verifies against the graph first; see {@link extractCodeTokens}.)
|
|
93
|
+
* Coverage is multilingual (#994, #1126): the ~29 languages with the largest
|
|
94
|
+
* developer populations, across Latin, Cyrillic, Greek, CJK, Hangul, Arabic,
|
|
95
|
+
* Hebrew, Thai, and Devanagari scripts. Languages beyond the keyword table
|
|
96
|
+
* still fire through the language-agnostic code-token path.
|
|
97
|
+
*/
|
|
98
|
+
export declare function hasStructuralKeyword(prompt: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Identifier-shaped tokens in `prompt` — camelCase / PascalCase-with-inner-cap,
|
|
101
|
+
* snake_case, a `name(` call, or the two sides of an `a.b` member access. Naming
|
|
102
|
+
* a symbol is a code question whatever the surrounding human language, and these
|
|
103
|
+
* shapes almost never occur in ordinary prose, so they catch the common
|
|
104
|
+
* "<symbol> 的调用链?" / "where is <symbol> 定義" prompts no keyword list would.
|
|
105
|
+
*
|
|
106
|
+
* These are *candidates*, not a verdict: a tech brand like `JavaScript` or
|
|
107
|
+
* `GitHub` is identifier-shaped too, so the front-load hook checks each token
|
|
108
|
+
* against the actual index ({@link getNodesByName}) and only fires when one is a
|
|
109
|
+
* real symbol here — otherwise a brand-name prompt would inject ~16KB of
|
|
110
|
+
* low-relevance context (issue #994 follow-up). A doc/data filename ("README.md")
|
|
111
|
+
* is excluded from the member-access form since it's a file reference, not a symbol.
|
|
112
|
+
*/
|
|
113
|
+
export declare function extractCodeTokens(prompt: string): string[];
|
|
114
|
+
/**
|
|
115
|
+
* Cheap, graph-free candidate gate for the front-load hook: could `prompt` be a
|
|
116
|
+
* structural / flow / impact / "where-how" question worth front-loading context
|
|
117
|
+
* for? True on an explicit keyword in any covered language (#994, #1126) OR an
|
|
118
|
+
* identifier-shaped token. A keyword is sufficient to fire on its own; a
|
|
119
|
+
* token-only match is only a candidate the hook then verifies against the graph
|
|
120
|
+
* (a brand name like `JavaScript` is token-shaped but isn't a symbol). Every
|
|
121
|
+
* non-candidate prompt ("fix this typo", in any language) stays a zero-cost no-op.
|
|
122
|
+
*/
|
|
123
|
+
export declare function isStructuralPrompt(prompt: string): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* What the front-load hook should do for a prompt issued from a directory.
|
|
126
|
+
*/
|
|
127
|
+
export interface FrontloadPlan {
|
|
128
|
+
/** Open + explore this project and inject its source as context. `null` when
|
|
129
|
+
* there's no single project to front-load (none indexed, or several indexed
|
|
130
|
+
* sub-projects with no clear match — see {@link nudgeProjects}). */
|
|
131
|
+
exploreRoot: string | null;
|
|
132
|
+
/** Indexed sub-projects to surface in a "pass `projectPath`" nudge: the rest
|
|
133
|
+
* of a monorepo's indexed projects alongside `exploreRoot`, or — when no one
|
|
134
|
+
* project clearly matches — the full list (with `exploreRoot` null). */
|
|
135
|
+
nudgeProjects: string[];
|
|
136
|
+
/** True when the plan came from scanning DOWN into sub-projects (cwd itself
|
|
137
|
+
* is not under any index) — the monorepo case, where a follow-up
|
|
138
|
+
* `codegraph_explore` needs an explicit `projectPath`. */
|
|
139
|
+
viaSubScan: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Decide what the front-load hook injects for a `prompt` issued from `cwd`,
|
|
143
|
+
* shaped by where the `.codegraph/` index(es) actually are:
|
|
144
|
+
* 1. **cwd (or an ancestor) is indexed** → front-load that project. The
|
|
145
|
+
* normal single-project / nested-file case.
|
|
146
|
+
* 2. **cwd isn't indexed but looks like a workspace root** → the indexes live
|
|
147
|
+
* in sub-projects (the monorepo case behind #964). One indexed
|
|
148
|
+
* sub-project → front-load it; several → front-load the one the prompt
|
|
149
|
+
* names (by relative path like `packages/api`, or package directory name)
|
|
150
|
+
* and nudge about the rest; several with no match → nudge the full list so
|
|
151
|
+
* the agent passes `projectPath`, rather than guessing wrong.
|
|
152
|
+
* 3. **nothing indexed reachable** → do nothing (the agent's own tools apply).
|
|
153
|
+
*/
|
|
154
|
+
export declare function planFrontload(cwd: string, prompt: string): FrontloadPlan;
|
|
155
|
+
/**
|
|
156
|
+
* Create the .codegraph directory structure
|
|
157
|
+
* Note: Only throws if codegraph.db already exists, not just if .codegraph/ exists.
|
|
158
|
+
*/
|
|
159
|
+
export declare function createDirectory(projectRoot: string): void;
|
|
160
|
+
/**
|
|
161
|
+
* Remove the .codegraph directory
|
|
162
|
+
*/
|
|
163
|
+
export declare function removeDirectory(projectRoot: string): void;
|
|
164
|
+
/**
|
|
165
|
+
* Get all files in the .codegraph directory
|
|
166
|
+
*/
|
|
167
|
+
export declare function listDirectoryContents(projectRoot: string): string[];
|
|
168
|
+
/**
|
|
169
|
+
* Get the total size of the .codegraph directory in bytes
|
|
170
|
+
*/
|
|
171
|
+
export declare function getDirectorySize(projectRoot: string): number;
|
|
172
|
+
/**
|
|
173
|
+
* Ensure a subdirectory exists within .codegraph
|
|
174
|
+
*/
|
|
175
|
+
export declare function ensureSubdirectory(projectRoot: string, subdirName: string): string;
|
|
176
|
+
/**
|
|
177
|
+
* Check if the .codegraph directory has valid structure
|
|
178
|
+
*/
|
|
179
|
+
export declare function validateDirectory(projectRoot: string): {
|
|
180
|
+
valid: boolean;
|
|
181
|
+
errors: string[];
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAqBzC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,QAAqB,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAQ1D;AAED;;;;;;;;GAQG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8BxE;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmBzE;AA2BD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,MAAM,EAAE,CAmBV;AAsND;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM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