codegraph-java 0.1.0
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 +131 -0
- package/dist/base-graph/index.d.ts +57 -0
- package/dist/base-graph/index.d.ts.map +1 -0
- package/dist/base-graph/index.js +175 -0
- package/dist/base-graph/index.js.map +1 -0
- package/dist/bin/codegraph.d.ts +28 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +2615 -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 +45 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +98 -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 +36 -0
- package/dist/context/formatter.d.ts.map +1 -0
- package/dist/context/formatter.js +269 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +131 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1378 -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 +380 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +854 -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 +255 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +1060 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +3191 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +209 -0
- package/dist/db/sqlite-adapter.d.ts +55 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +135 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/db/wal-valve.d.ts +119 -0
- package/dist/db/wal-valve.d.ts.map +1 -0
- package/dist/db/wal-valve.js +290 -0
- package/dist/db/wal-valve.js.map +1 -0
- package/dist/directory.d.ts +213 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +781 -0
- package/dist/directory.js.map +1 -0
- package/dist/errors.d.ts +150 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +234 -0
- package/dist/errors.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 +746 -0
- package/dist/extraction/function-ref.js.map +1 -0
- package/dist/extraction/generated-detection.d.ts +66 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -0
- package/dist/extraction/generated-detection.js +248 -0
- package/dist/extraction/generated-detection.js.map +1 -0
- package/dist/extraction/grammars.d.ts +148 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +558 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +367 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +2833 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/kernel/decode.d.ts +9 -0
- package/dist/extraction/kernel/decode.d.ts.map +1 -0
- package/dist/extraction/kernel/decode.js +162 -0
- package/dist/extraction/kernel/decode.js.map +1 -0
- package/dist/extraction/kernel/index.d.ts +64 -0
- package/dist/extraction/kernel/index.d.ts.map +1 -0
- package/dist/extraction/kernel/index.js +204 -0
- package/dist/extraction/kernel/index.js.map +1 -0
- package/dist/extraction/kernel/layout.d.ts +101 -0
- package/dist/extraction/kernel/layout.d.ts.map +1 -0
- package/dist/extraction/kernel/layout.js +104 -0
- package/dist/extraction/kernel/layout.js.map +1 -0
- package/dist/extraction/kernel/loader.d.ts +103 -0
- package/dist/extraction/kernel/loader.d.ts.map +1 -0
- package/dist/extraction/kernel/loader.js +146 -0
- package/dist/extraction/kernel/loader.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +124 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +1689 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/index.d.ts +11 -0
- package/dist/extraction/languages/index.d.ts.map +1 -0
- package/dist/extraction/languages/index.js +15 -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/rust.d.ts +23 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +169 -0
- package/dist/extraction/languages/rust.js.map +1 -0
- package/dist/extraction/parse-pool.d.ts +167 -0
- package/dist/extraction/parse-pool.d.ts.map +1 -0
- package/dist/extraction/parse-pool.js +421 -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 +138 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/store-worker.d.ts +24 -0
- package/dist/extraction/store-worker.d.ts.map +1 -0
- package/dist/extraction/store-worker.js +139 -0
- package/dist/extraction/store-worker.js.map +1 -0
- package/dist/extraction/store-writer.d.ts +63 -0
- package/dist/extraction/store-writer.d.ts.map +1 -0
- package/dist/extraction/store-writer.js +174 -0
- package/dist/extraction/store-writer.js.map +1 -0
- package/dist/extraction/syntax-tokens.d.ts +103 -0
- package/dist/extraction/syntax-tokens.d.ts.map +1 -0
- package/dist/extraction/syntax-tokens.js +381 -0
- package/dist/extraction/syntax-tokens.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 +260 -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 +745 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +6725 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +53 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +130 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/branch-guards.d.ts +248 -0
- package/dist/graph/branch-guards.d.ts.map +1 -0
- package/dist/graph/branch-guards.js +2231 -0
- package/dist/graph/branch-guards.js.map +1 -0
- package/dist/graph/dead-code.d.ts +251 -0
- package/dist/graph/dead-code.d.ts.map +1 -0
- package/dist/graph/dead-code.js +756 -0
- package/dist/graph/dead-code.js.map +1 -0
- package/dist/graph/dynamic-boundary-report.d.ts +121 -0
- package/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
- package/dist/graph/dynamic-boundary-report.js +283 -0
- package/dist/graph/dynamic-boundary-report.js.map +1 -0
- package/dist/graph/index.d.ts +12 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +28 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/named-symbol-flow.d.ts +153 -0
- package/dist/graph/named-symbol-flow.d.ts.map +1 -0
- package/dist/graph/named-symbol-flow.js +609 -0
- package/dist/graph/named-symbol-flow.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 +341 -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/graph/type-hierarchy.d.ts +155 -0
- package/dist/graph/type-hierarchy.d.ts.map +1 -0
- package/dist/graph/type-hierarchy.js +382 -0
- package/dist/graph/type-hierarchy.js.map +1 -0
- package/dist/index.d.ts +886 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2019 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/beta-signup.d.ts +54 -0
- package/dist/installer/beta-signup.d.ts.map +1 -0
- package/dist/installer/beta-signup.js +178 -0
- package/dist/installer/beta-signup.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 +143 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +632 -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 +486 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/codex.d.ts +32 -0
- package/dist/installer/targets/codex.d.ts.map +1 -0
- package/dist/installer/targets/codex.js +202 -0
- package/dist/installer/targets/codex.js.map +1 -0
- package/dist/installer/targets/copilot-cli.d.ts +32 -0
- package/dist/installer/targets/copilot-cli.d.ts.map +1 -0
- package/dist/installer/targets/copilot-cli.js +209 -0
- package/dist/installer/targets/copilot-cli.js.map +1 -0
- package/dist/installer/targets/copilot-jetbrains.d.ts +42 -0
- package/dist/installer/targets/copilot-jetbrains.d.ts.map +1 -0
- package/dist/installer/targets/copilot-jetbrains.js +238 -0
- package/dist/installer/targets/copilot-jetbrains.js.map +1 -0
- package/dist/installer/targets/copilot-vscode.d.ts +47 -0
- package/dist/installer/targets/copilot-vscode.d.ts.map +1 -0
- package/dist/installer/targets/copilot-vscode.js +219 -0
- package/dist/installer/targets/copilot-vscode.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 +101 -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 +53 -0
- package/dist/installer/targets/toml.d.ts.map +1 -0
- package/dist/installer/targets/toml.js +226 -0
- package/dist/installer/targets/toml.js.map +1 -0
- package/dist/installer/targets/trae.d.ts +30 -0
- package/dist/installer/targets/trae.d.ts.map +1 -0
- package/dist/installer/targets/trae.js +164 -0
- package/dist/installer/targets/trae.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/installer/targets/workbuddy.d.ts +29 -0
- package/dist/installer/targets/workbuddy.d.ts.map +1 -0
- package/dist/installer/targets/workbuddy.js +163 -0
- package/dist/installer/targets/workbuddy.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 +79 -0
- package/dist/mcp/daemon-paths.d.ts.map +1 -0
- package/dist/mcp/daemon-paths.js +219 -0
- package/dist/mcp/daemon-paths.js.map +1 -0
- package/dist/mcp/daemon-registry.d.ts +57 -0
- package/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/dist/mcp/daemon-registry.js +281 -0
- package/dist/mcp/daemon-registry.js.map +1 -0
- package/dist/mcp/daemon.d.ts +293 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +864 -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 +125 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +392 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/explore-dedup.d.ts +137 -0
- package/dist/mcp/explore-dedup.d.ts.map +1 -0
- package/dist/mcp/explore-dedup.js +236 -0
- package/dist/mcp/explore-dedup.js.map +1 -0
- package/dist/mcp/explore-diagnostics.d.ts +289 -0
- package/dist/mcp/explore-diagnostics.d.ts.map +1 -0
- package/dist/mcp/explore-diagnostics.js +558 -0
- package/dist/mcp/explore-diagnostics.js.map +1 -0
- package/dist/mcp/explore-session-state.d.ts +217 -0
- package/dist/mcp/explore-session-state.d.ts.map +1 -0
- package/dist/mcp/explore-session-state.js +322 -0
- package/dist/mcp/explore-session-state.js.map +1 -0
- package/dist/mcp/index.d.ts +137 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +567 -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 +269 -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 +672 -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 +111 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +109 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +380 -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 +877 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +6371 -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 +158 -0
- package/dist/project-config.d.ts.map +1 -0
- package/dist/project-config.js +489 -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 +1506 -0
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +59 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +4066 -0
- package/dist/resolution/callback-synthesizer.js.map +1 -0
- package/dist/resolution/cooperative-yield.d.ts +40 -0
- package/dist/resolution/cooperative-yield.d.ts.map +1 -0
- package/dist/resolution/cooperative-yield.js +44 -0
- package/dist/resolution/cooperative-yield.js.map +1 -0
- package/dist/resolution/expo-router-synthesizer.d.ts +32 -0
- package/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
- package/dist/resolution/expo-router-synthesizer.js +189 -0
- package/dist/resolution/expo-router-synthesizer.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 +335 -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/expo-router.d.ts +189 -0
- package/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
- package/dist/resolution/frameworks/expo-router.js +785 -0
- package/dist/resolution/frameworks/expo-router.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 +540 -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 +184 -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 +30 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +72 -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 +690 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/frameworks/nextjs.d.ts +76 -0
- package/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nextjs.js +328 -0
- package/dist/resolution/frameworks/nextjs.js.map +1 -0
- package/dist/resolution/frameworks/object-literal.d.ts +32 -0
- package/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
- package/dist/resolution/frameworks/object-literal.js +139 -0
- package/dist/resolution/frameworks/object-literal.js.map +1 -0
- package/dist/resolution/frameworks/package-deps.d.ts +14 -0
- package/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
- package/dist/resolution/frameworks/package-deps.js +78 -0
- package/dist/resolution/frameworks/package-deps.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 +566 -0
- package/dist/resolution/frameworks/python.js.map +1 -0
- package/dist/resolution/frameworks/react-native.d.ts +29 -0
- package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-native.js +549 -0
- package/dist/resolution/frameworks/react-native.js.map +1 -0
- package/dist/resolution/frameworks/react-router.d.ts +46 -0
- package/dist/resolution/frameworks/react-router.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-router.js +187 -0
- package/dist/resolution/frameworks/react-router.js.map +1 -0
- package/dist/resolution/frameworks/react.d.ts +9 -0
- package/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/dist/resolution/frameworks/react.js +257 -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 +258 -0
- package/dist/resolution/frameworks/svelte.js.map +1 -0
- package/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
- package/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
- package/dist/resolution/frameworks/sveltekit-router.js +156 -0
- package/dist/resolution/frameworks/sveltekit-router.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 +410 -0
- package/dist/resolution/frameworks/swift.js.map +1 -0
- package/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
- package/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
- package/dist/resolution/frameworks/tanstack-router.js +437 -0
- package/dist/resolution/frameworks/tanstack-router.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-router.d.ts +82 -0
- package/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
- package/dist/resolution/frameworks/vue-router.js +377 -0
- package/dist/resolution/frameworks/vue-router.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 +84 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +2240 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +343 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +2352 -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/memory-budget.d.ts +48 -0
- package/dist/resolution/memory-budget.d.ts.map +1 -0
- package/dist/resolution/memory-budget.js +162 -0
- package/dist/resolution/memory-budget.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +153 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +2412 -0
- package/dist/resolution/name-matcher.js.map +1 -0
- package/dist/resolution/next-router-synthesizer.d.ts +27 -0
- package/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
- package/dist/resolution/next-router-synthesizer.js +113 -0
- package/dist/resolution/next-router-synthesizer.js.map +1 -0
- package/dist/resolution/path-aliases.d.ts +70 -0
- package/dist/resolution/path-aliases.d.ts.map +1 -0
- package/dist/resolution/path-aliases.js +346 -0
- package/dist/resolution/path-aliases.js.map +1 -0
- package/dist/resolution/react-router-synthesizer.d.ts +33 -0
- package/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
- package/dist/resolution/react-router-synthesizer.js +126 -0
- package/dist/resolution/react-router-synthesizer.js.map +1 -0
- package/dist/resolution/resolver-pool.d.ts +106 -0
- package/dist/resolution/resolver-pool.d.ts.map +1 -0
- package/dist/resolution/resolver-pool.js +344 -0
- package/dist/resolution/resolver-pool.js.map +1 -0
- package/dist/resolution/resolver-worker.d.ts +17 -0
- package/dist/resolution/resolver-worker.d.ts.map +1 -0
- package/dist/resolution/resolver-worker.js +141 -0
- package/dist/resolution/resolver-worker.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/sveltekit-synthesizer.d.ts +58 -0
- package/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
- package/dist/resolution/sveltekit-synthesizer.js +173 -0
- package/dist/resolution/sveltekit-synthesizer.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/synth-utils.d.ts +26 -0
- package/dist/resolution/synth-utils.d.ts.map +1 -0
- package/dist/resolution/synth-utils.js +75 -0
- package/dist/resolution/synth-utils.js.map +1 -0
- package/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
- package/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
- package/dist/resolution/tanstack-router-synthesizer.js +114 -0
- package/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
- package/dist/resolution/tier-synthesizer.d.ts +48 -0
- package/dist/resolution/tier-synthesizer.d.ts.map +1 -0
- package/dist/resolution/tier-synthesizer.js +907 -0
- package/dist/resolution/tier-synthesizer.js.map +1 -0
- package/dist/resolution/types.d.ts +290 -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/vue-router-synthesizer.d.ts +30 -0
- package/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
- package/dist/resolution/vue-router-synthesizer.js +115 -0
- package/dist/resolution/vue-router-synthesizer.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 +70 -0
- package/dist/search/identifier-segments.d.ts.map +1 -0
- package/dist/search/identifier-segments.js +205 -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-paths.d.ts +57 -0
- package/dist/search/query-paths.d.ts.map +1 -0
- package/dist/search/query-paths.js +298 -0
- package/dist/search/query-paths.js.map +1 -0
- package/dist/search/query-utils.d.ts +102 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +487 -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 +401 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +967 -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 +486 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +118 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/color.d.ts +21 -0
- package/dist/ui/color.d.ts.map +1 -0
- package/dist/ui/color.js +42 -0
- package/dist/ui/color.js.map +1 -0
- package/dist/ui/glyphs.d.ts +67 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +125 -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 +164 -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 +126 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +15 -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/ui-server/api/deadcode.d.ts +84 -0
- package/dist/ui-server/api/deadcode.d.ts.map +1 -0
- package/dist/ui-server/api/deadcode.js +136 -0
- package/dist/ui-server/api/deadcode.js.map +1 -0
- package/dist/ui-server/api/effects.d.ts +87 -0
- package/dist/ui-server/api/effects.d.ts.map +1 -0
- package/dist/ui-server/api/effects.js +499 -0
- package/dist/ui-server/api/effects.js.map +1 -0
- package/dist/ui-server/api/entrypoints.d.ts +86 -0
- package/dist/ui-server/api/entrypoints.d.ts.map +1 -0
- package/dist/ui-server/api/entrypoints.js +279 -0
- package/dist/ui-server/api/entrypoints.js.map +1 -0
- package/dist/ui-server/api/events.d.ts +183 -0
- package/dist/ui-server/api/events.d.ts.map +1 -0
- package/dist/ui-server/api/events.js +430 -0
- package/dist/ui-server/api/events.js.map +1 -0
- package/dist/ui-server/api/file.d.ts +66 -0
- package/dist/ui-server/api/file.d.ts.map +1 -0
- package/dist/ui-server/api/file.js +222 -0
- package/dist/ui-server/api/file.js.map +1 -0
- package/dist/ui-server/api/filecode.d.ts +126 -0
- package/dist/ui-server/api/filecode.d.ts.map +1 -0
- package/dist/ui-server/api/filecode.js +205 -0
- package/dist/ui-server/api/filecode.js.map +1 -0
- package/dist/ui-server/api/flow.d.ts +226 -0
- package/dist/ui-server/api/flow.d.ts.map +1 -0
- package/dist/ui-server/api/flow.js +611 -0
- package/dist/ui-server/api/flow.js.map +1 -0
- package/dist/ui-server/api/hierarchy.d.ts +81 -0
- package/dist/ui-server/api/hierarchy.d.ts.map +1 -0
- package/dist/ui-server/api/hierarchy.js +92 -0
- package/dist/ui-server/api/hierarchy.js.map +1 -0
- package/dist/ui-server/api/index.d.ts +90 -0
- package/dist/ui-server/api/index.d.ts.map +1 -0
- package/dist/ui-server/api/index.js +332 -0
- package/dist/ui-server/api/index.js.map +1 -0
- package/dist/ui-server/api/map.d.ts +187 -0
- package/dist/ui-server/api/map.d.ts.map +1 -0
- package/dist/ui-server/api/map.js +498 -0
- package/dist/ui-server/api/map.js.map +1 -0
- package/dist/ui-server/api/node.d.ts +81 -0
- package/dist/ui-server/api/node.d.ts.map +1 -0
- package/dist/ui-server/api/node.js +388 -0
- package/dist/ui-server/api/node.js.map +1 -0
- package/dist/ui-server/api/nodes.d.ts +25 -0
- package/dist/ui-server/api/nodes.d.ts.map +1 -0
- package/dist/ui-server/api/nodes.js +45 -0
- package/dist/ui-server/api/nodes.js.map +1 -0
- package/dist/ui-server/api/program.d.ts +139 -0
- package/dist/ui-server/api/program.d.ts.map +1 -0
- package/dist/ui-server/api/program.js +315 -0
- package/dist/ui-server/api/program.js.map +1 -0
- package/dist/ui-server/api/respond.d.ts +76 -0
- package/dist/ui-server/api/respond.d.ts.map +1 -0
- package/dist/ui-server/api/respond.js +186 -0
- package/dist/ui-server/api/respond.js.map +1 -0
- package/dist/ui-server/api/route-roots.d.ts +39 -0
- package/dist/ui-server/api/route-roots.d.ts.map +1 -0
- package/dist/ui-server/api/route-roots.js +96 -0
- package/dist/ui-server/api/route-roots.js.map +1 -0
- package/dist/ui-server/api/routes.d.ts +59 -0
- package/dist/ui-server/api/routes.d.ts.map +1 -0
- package/dist/ui-server/api/routes.js +112 -0
- package/dist/ui-server/api/routes.js.map +1 -0
- package/dist/ui-server/api/screens.d.ts +117 -0
- package/dist/ui-server/api/screens.d.ts.map +1 -0
- package/dist/ui-server/api/screens.js +611 -0
- package/dist/ui-server/api/screens.js.map +1 -0
- package/dist/ui-server/api/search.d.ts +29 -0
- package/dist/ui-server/api/search.d.ts.map +1 -0
- package/dist/ui-server/api/search.js +232 -0
- package/dist/ui-server/api/search.js.map +1 -0
- package/dist/ui-server/api/session.d.ts +52 -0
- package/dist/ui-server/api/session.d.ts.map +1 -0
- package/dist/ui-server/api/session.js +196 -0
- package/dist/ui-server/api/session.js.map +1 -0
- package/dist/ui-server/api/source.d.ts +200 -0
- package/dist/ui-server/api/source.d.ts.map +1 -0
- package/dist/ui-server/api/source.js +419 -0
- package/dist/ui-server/api/source.js.map +1 -0
- package/dist/ui-server/api/stats.d.ts +27 -0
- package/dist/ui-server/api/stats.d.ts.map +1 -0
- package/dist/ui-server/api/stats.js +164 -0
- package/dist/ui-server/api/stats.js.map +1 -0
- package/dist/ui-server/api/steps.d.ts +274 -0
- package/dist/ui-server/api/steps.d.ts.map +1 -0
- package/dist/ui-server/api/steps.js +1446 -0
- package/dist/ui-server/api/steps.js.map +1 -0
- package/dist/ui-server/api/trail-store.d.ts +142 -0
- package/dist/ui-server/api/trail-store.d.ts.map +1 -0
- package/dist/ui-server/api/trail-store.js +323 -0
- package/dist/ui-server/api/trail-store.js.map +1 -0
- package/dist/ui-server/api/trails.d.ts +163 -0
- package/dist/ui-server/api/trails.d.ts.map +1 -0
- package/dist/ui-server/api/trails.js +369 -0
- package/dist/ui-server/api/trails.js.map +1 -0
- package/dist/ui-server/api/when.d.ts +125 -0
- package/dist/ui-server/api/when.d.ts.map +1 -0
- package/dist/ui-server/api/when.js +251 -0
- package/dist/ui-server/api/when.js.map +1 -0
- package/dist/ui-server/api/wire.d.ts +179 -0
- package/dist/ui-server/api/wire.d.ts.map +1 -0
- package/dist/ui-server/api/wire.js +231 -0
- package/dist/ui-server/api/wire.js.map +1 -0
- package/dist/ui-server/assets.d.ts +40 -0
- package/dist/ui-server/assets.d.ts.map +1 -0
- package/dist/ui-server/assets.js +110 -0
- package/dist/ui-server/assets.js.map +1 -0
- package/dist/ui-server/constants.d.ts +32 -0
- package/dist/ui-server/constants.d.ts.map +1 -0
- package/dist/ui-server/constants.js +35 -0
- package/dist/ui-server/constants.js.map +1 -0
- package/dist/ui-server/highlight/index.d.ts +113 -0
- package/dist/ui-server/highlight/index.d.ts.map +1 -0
- package/dist/ui-server/highlight/index.js +307 -0
- package/dist/ui-server/highlight/index.js.map +1 -0
- package/dist/ui-server/highlight/languages.d.ts +36 -0
- package/dist/ui-server/highlight/languages.d.ts.map +1 -0
- package/dist/ui-server/highlight/languages.js +50 -0
- package/dist/ui-server/highlight/languages.js.map +1 -0
- package/dist/ui-server/index.d.ts +92 -0
- package/dist/ui-server/index.d.ts.map +1 -0
- package/dist/ui-server/index.js +399 -0
- package/dist/ui-server/index.js.map +1 -0
- package/dist/ui-server/open-browser.d.ts +31 -0
- package/dist/ui-server/open-browser.d.ts.map +1 -0
- package/dist/ui-server/open-browser.js +79 -0
- package/dist/ui-server/open-browser.js.map +1 -0
- package/dist/ui-server/security.d.ts +127 -0
- package/dist/ui-server/security.d.ts.map +1 -0
- package/dist/ui-server/security.js +332 -0
- package/dist/ui-server/security.js.map +1 -0
- package/dist/ui-server/static.d.ts +45 -0
- package/dist/ui-server/static.d.ts.map +1 -0
- package/dist/ui-server/static.js +165 -0
- package/dist/ui-server/static.js.map +1 -0
- package/dist/upgrade/index.d.ts +177 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +665 -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/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
- package/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
- package/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- package/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- package/dist/viewer/assets/index-2IPslW5t.js +13 -0
- package/dist/viewer/assets/index-DSwi2Seu.css +1 -0
- package/dist/viewer/index.html +16 -0
- package/package.json +67 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GET /api/source?file=&from=&to=` — verbatim source, or an honest refusal.
|
|
3
|
+
*
|
|
4
|
+
* This is the one endpoint that reads the user's repository, so two rules
|
|
5
|
+
* govern it and neither is negotiable.
|
|
6
|
+
*
|
|
7
|
+
* **Every read goes through `resolveProjectFile`.** That is the chokepoint from
|
|
8
|
+
* `security.ts` — traversal, in-tree symlinks pointing out of the root,
|
|
9
|
+
* absolute paths, sensitive system directories. Without it,
|
|
10
|
+
* `?file=../../.ssh/id_rsa` is a credential leak over a port the user opened to
|
|
11
|
+
* read their own code.
|
|
12
|
+
*
|
|
13
|
+
* **A file that changed on disk since it was indexed is never sliced under the
|
|
14
|
+
* index's numbering.** The viewer asks for line ranges the *index* recorded; if
|
|
15
|
+
* the file moved on since, those ranges can point at a different symbol's body,
|
|
16
|
+
* which would be served under the requested name and look perfectly plausible.
|
|
17
|
+
* So the bytes are hashed and compared against `files.content_hash`, and on a
|
|
18
|
+
* mismatch the slice is omitted with `drift: true` — the same call
|
|
19
|
+
* `codegraph_node` makes when it says "changed on disk after the last index
|
|
20
|
+
* sync".
|
|
21
|
+
*
|
|
22
|
+
* A caller that has ALREADY decided the index's numbering is off — a viewer
|
|
23
|
+
* about to draw a drift banner — asks with `ondrift=current` and gets the
|
|
24
|
+
* file's CURRENT lines instead of nothing. That is the other half of
|
|
25
|
+
* `codegraph_node`'s behaviour (issue #1474): a drifted file is served whole
|
|
26
|
+
* and current rather than omitted, because current bytes are correct by
|
|
27
|
+
* construction. `showing` says which of the two came back, on every response,
|
|
28
|
+
* so nothing has to infer it from the presence of `lines`.
|
|
29
|
+
*
|
|
30
|
+
* Only files that are IN the index are served. That is a tighter boundary than
|
|
31
|
+
* the MCP tools take, and it costs the viewer nothing (it only ever renders
|
|
32
|
+
* indexed symbols) while making the drift verdict meaningful for every answer:
|
|
33
|
+
* there is always a hash to compare against.
|
|
34
|
+
*/
|
|
35
|
+
import type { FileRecord } from '../../types';
|
|
36
|
+
import type { CodeGraph } from '../../index';
|
|
37
|
+
import { type HighlightResult } from '../highlight';
|
|
38
|
+
import { ApiError } from './respond';
|
|
39
|
+
/**
|
|
40
|
+
* Largest file we will read to answer a source request.
|
|
41
|
+
*
|
|
42
|
+
* The whole file has to be read to hash it, so this bounds the work one request
|
|
43
|
+
* can cause. Well above the 1 MB ceiling extraction itself applies, so anything
|
|
44
|
+
* actually in the index is comfortably inside it.
|
|
45
|
+
*/
|
|
46
|
+
export declare const MAX_SOURCE_BYTES: number;
|
|
47
|
+
/** Lines returned in one response. The Symbol view asks for windows, not files. */
|
|
48
|
+
export declare const MAX_SOURCE_LINES = 4000;
|
|
49
|
+
/**
|
|
50
|
+
* Look up a file record by a viewer-supplied path, WITHOUT validating it.
|
|
51
|
+
*
|
|
52
|
+
* Indexed paths are normalized to forward slashes at extraction time, so that
|
|
53
|
+
* is the form tried first; the platform-separator form is a fallback for an
|
|
54
|
+
* index written before that normalization.
|
|
55
|
+
*
|
|
56
|
+
* Callers that go on to READ the file must use {@link resolveRequestedFile}
|
|
57
|
+
* instead — it puts the path through the security chokepoint first. This one is
|
|
58
|
+
* for endpoints that only need the record (a drift flag on a path the index
|
|
59
|
+
* itself handed us).
|
|
60
|
+
*/
|
|
61
|
+
export declare function findIndexedFile(cg: CodeGraph, requested: string): {
|
|
62
|
+
record: FileRecord;
|
|
63
|
+
storedPath: string;
|
|
64
|
+
} | null;
|
|
65
|
+
/**
|
|
66
|
+
* Forward slashes and no leading `./` — the form indexed paths are stored in.
|
|
67
|
+
*
|
|
68
|
+
* A LEADING SLASH IS LEFT ALONE on purpose. Stripping it would quietly turn
|
|
69
|
+
* `/etc/passwd` into the project-relative `etc/passwd` and answer "not in this
|
|
70
|
+
* index" — reinterpreting the request instead of refusing it, and leaving the
|
|
71
|
+
* chokepoint's absolute-path rule with nothing to catch.
|
|
72
|
+
*/
|
|
73
|
+
export declare function toRequestPath(requested: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Validate a viewer-supplied path, THEN look it up in the index.
|
|
76
|
+
*
|
|
77
|
+
* The order is the point. `resolveProjectFile` runs first, so a traversal, an
|
|
78
|
+
* absolute path or a sensitive system directory is refused as what it is,
|
|
79
|
+
* before the index is consulted — a 403 that says "outside the project", not a
|
|
80
|
+
* 404 that says "not indexed" and quietly depends on the index lookup missing.
|
|
81
|
+
* It also means the absolute path every reader uses has already been through
|
|
82
|
+
* the chokepoint by construction, rather than by remembering to call it.
|
|
83
|
+
*
|
|
84
|
+
* @throws {PathRefusalError} the path is not one we would ever read.
|
|
85
|
+
* @throws {ApiError} `not-found` when it is fine but not in the index.
|
|
86
|
+
*/
|
|
87
|
+
export declare function resolveRequestedFile(cg: CodeGraph, projectRoot: string, requested: string): {
|
|
88
|
+
record: FileRecord;
|
|
89
|
+
storedPath: string;
|
|
90
|
+
absolute: string;
|
|
91
|
+
};
|
|
92
|
+
export declare function notIndexedError(file: string): ApiError;
|
|
93
|
+
/**
|
|
94
|
+
* Split source the way the index counted it.
|
|
95
|
+
*
|
|
96
|
+
* Rows are `\n`-delimited — that is how tree-sitter numbers them — so a CRLF
|
|
97
|
+
* file has the same line numbers here as in the graph. The trailing `\r` is
|
|
98
|
+
* dropped per line so it does not render as a stray glyph.
|
|
99
|
+
*/
|
|
100
|
+
export declare function splitLines(content: string): string[];
|
|
101
|
+
/**
|
|
102
|
+
* The whole text of an INDEXED file, or `null` for anything unreadable.
|
|
103
|
+
*
|
|
104
|
+
* The dead code report's corroboration pass needs to count an identifier in a
|
|
105
|
+
* file's text, and this module is the only one in `api/` that opens a file — so
|
|
106
|
+
* the reader it uses lives here, behind the same chokepoint. Three refusals,
|
|
107
|
+
* all answering `null` rather than throwing, because the caller's rule is
|
|
108
|
+
* already "cannot read it → do not make the claim":
|
|
109
|
+
*
|
|
110
|
+
* - not in the index (the viewer never reads a file the graph does not know);
|
|
111
|
+
* - outside the project (`resolveProjectFile` throws; caught here);
|
|
112
|
+
* - bigger than `maxBytes`.
|
|
113
|
+
*
|
|
114
|
+
* Drift is deliberately NOT checked. The question being asked is "does anything
|
|
115
|
+
* in this file write this name", and the file's current bytes are the better
|
|
116
|
+
* answer to it than the bytes we indexed.
|
|
117
|
+
*/
|
|
118
|
+
export declare function readIndexedFileText(cg: CodeGraph, projectRoot: string, requested: string, maxBytes: number): string | null;
|
|
119
|
+
/**
|
|
120
|
+
* Whether an indexed file has changed on disk since it was indexed — the same
|
|
121
|
+
* verdict `/api/source` returns, for endpoints that must *flag* drift without
|
|
122
|
+
* serving source (a symbol header, a file outline).
|
|
123
|
+
*
|
|
124
|
+
* Cheap first: size plus floored mtime is the identical freshness test the sync
|
|
125
|
+
* fast path uses, so an untouched file costs one `stat`. Only a stat mismatch
|
|
126
|
+
* pays for a hash, which is what keeps a `touch` or a checkout that rewrote
|
|
127
|
+
* identical bytes from reading as drift.
|
|
128
|
+
*
|
|
129
|
+
* Any failure answers `false`. A wrong "stale" flag would put a warning banner
|
|
130
|
+
* over correct source; the cases that would trip it (missing record, unreadable
|
|
131
|
+
* file) have their own handling in the endpoints that actually read.
|
|
132
|
+
*/
|
|
133
|
+
export declare function hasDriftedOnDisk(projectRoot: string, storedPath: string, record: FileRecord): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The drift verdict AND the file's length, from one read.
|
|
136
|
+
*
|
|
137
|
+
* The whole-file view needs both before it draws anything: the drift banner,
|
|
138
|
+
* and the line count that fixes the height of the scrolling document (every
|
|
139
|
+
* line is a fixed 20px, so the total IS the layout). Asking
|
|
140
|
+
* {@link hasDriftedOnDisk} and then a source page would answer the first
|
|
141
|
+
* question against one read of the file and the second against another, which
|
|
142
|
+
* is exactly the window in which a file can change underneath the two.
|
|
143
|
+
*
|
|
144
|
+
* Unlike `hasDriftedOnDisk` there is no stat-only fast path: the bytes have to
|
|
145
|
+
* be read to be counted. That is the cost of knowing the length, and it is
|
|
146
|
+
* bounded by {@link MAX_SOURCE_BYTES} like every other read here.
|
|
147
|
+
*/
|
|
148
|
+
export declare function readFileShape(projectRoot: string, storedPath: string, record: FileRecord): {
|
|
149
|
+
drift: boolean;
|
|
150
|
+
totalLines: number | null;
|
|
151
|
+
reason?: string;
|
|
152
|
+
};
|
|
153
|
+
export interface SourceResult {
|
|
154
|
+
file: string;
|
|
155
|
+
language: string;
|
|
156
|
+
/** The file on disk differs from what was indexed. */
|
|
157
|
+
drift: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Which numbering the returned lines belong to.
|
|
160
|
+
*
|
|
161
|
+
* `'indexed'` — the file matches the index, so the two are the same thing.
|
|
162
|
+
* `'current'` — the file drifted and the caller asked for it anyway
|
|
163
|
+
* (`ondrift=current`): these are the bytes on disk right now, and NOTHING the
|
|
164
|
+
* graph holds about this file (symbol ranges, call-site lines, ports) lines
|
|
165
|
+
* up with them.
|
|
166
|
+
* `'none'` — the file drifted and no slice is served.
|
|
167
|
+
*/
|
|
168
|
+
showing: 'indexed' | 'current' | 'none';
|
|
169
|
+
contentHash: string;
|
|
170
|
+
indexedAt: number;
|
|
171
|
+
generated: boolean;
|
|
172
|
+
totalLines: number | null;
|
|
173
|
+
from?: number;
|
|
174
|
+
to?: number;
|
|
175
|
+
lines?: string[];
|
|
176
|
+
truncated?: boolean;
|
|
177
|
+
reason?: string;
|
|
178
|
+
/**
|
|
179
|
+
* The same lines, classified for the code block — one entry per line, each a
|
|
180
|
+
* list of `[classId, text]` pairs indexed into `highlight.classes`.
|
|
181
|
+
*
|
|
182
|
+
* It rides with the slice rather than living behind its own endpoint because
|
|
183
|
+
* the two are only ever wanted together, and because a second round-trip
|
|
184
|
+
* would let the viewer paint unhighlighted source and then reflow it. Absent
|
|
185
|
+
* whenever `lines` is — a drifted file is not served at all.
|
|
186
|
+
*/
|
|
187
|
+
highlight?: HighlightResult;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* What to do when the file on disk no longer matches the index.
|
|
191
|
+
*
|
|
192
|
+
* `omit` (the default) is the safe answer for a caller that has not decided
|
|
193
|
+
* anything yet. `current` is for one that has: it is about to say, in the
|
|
194
|
+
* pixels, that these are the file's CURRENT lines and that nothing the graph
|
|
195
|
+
* holds about them applies.
|
|
196
|
+
*/
|
|
197
|
+
export type OnDrift = 'omit' | 'current';
|
|
198
|
+
export declare function parseOnDrift(query: URLSearchParams): OnDrift;
|
|
199
|
+
export declare function buildSource(cg: CodeGraph, projectRoot: string, query: URLSearchParams): Promise<SourceResult>;
|
|
200
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/ui-server/api/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,QAAQ,EAA6C,MAAM,WAAW,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAkB,CAAC;AAEhD,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,SAAS,EACb,SAAS,EAAE,MAAM,GAChB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAWnD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,SAAS,EACb,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQ9D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAOtD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAUpD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,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,wBAAsB,WAAW,CAC/B,EAAE,EAAE,SAAS,EACb,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,YAAY,CAAC,CA+HvB"}
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `GET /api/source?file=&from=&to=` — verbatim source, or an honest refusal.
|
|
4
|
+
*
|
|
5
|
+
* This is the one endpoint that reads the user's repository, so two rules
|
|
6
|
+
* govern it and neither is negotiable.
|
|
7
|
+
*
|
|
8
|
+
* **Every read goes through `resolveProjectFile`.** That is the chokepoint from
|
|
9
|
+
* `security.ts` — traversal, in-tree symlinks pointing out of the root,
|
|
10
|
+
* absolute paths, sensitive system directories. Without it,
|
|
11
|
+
* `?file=../../.ssh/id_rsa` is a credential leak over a port the user opened to
|
|
12
|
+
* read their own code.
|
|
13
|
+
*
|
|
14
|
+
* **A file that changed on disk since it was indexed is never sliced under the
|
|
15
|
+
* index's numbering.** The viewer asks for line ranges the *index* recorded; if
|
|
16
|
+
* the file moved on since, those ranges can point at a different symbol's body,
|
|
17
|
+
* which would be served under the requested name and look perfectly plausible.
|
|
18
|
+
* So the bytes are hashed and compared against `files.content_hash`, and on a
|
|
19
|
+
* mismatch the slice is omitted with `drift: true` — the same call
|
|
20
|
+
* `codegraph_node` makes when it says "changed on disk after the last index
|
|
21
|
+
* sync".
|
|
22
|
+
*
|
|
23
|
+
* A caller that has ALREADY decided the index's numbering is off — a viewer
|
|
24
|
+
* about to draw a drift banner — asks with `ondrift=current` and gets the
|
|
25
|
+
* file's CURRENT lines instead of nothing. That is the other half of
|
|
26
|
+
* `codegraph_node`'s behaviour (issue #1474): a drifted file is served whole
|
|
27
|
+
* and current rather than omitted, because current bytes are correct by
|
|
28
|
+
* construction. `showing` says which of the two came back, on every response,
|
|
29
|
+
* so nothing has to infer it from the presence of `lines`.
|
|
30
|
+
*
|
|
31
|
+
* Only files that are IN the index are served. That is a tighter boundary than
|
|
32
|
+
* the MCP tools take, and it costs the viewer nothing (it only ever renders
|
|
33
|
+
* indexed symbols) while making the drift verdict meaningful for every answer:
|
|
34
|
+
* there is always a hash to compare against.
|
|
35
|
+
*/
|
|
36
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
39
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
40
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
41
|
+
}
|
|
42
|
+
Object.defineProperty(o, k2, desc);
|
|
43
|
+
}) : (function(o, m, k, k2) {
|
|
44
|
+
if (k2 === undefined) k2 = k;
|
|
45
|
+
o[k2] = m[k];
|
|
46
|
+
}));
|
|
47
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
48
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
49
|
+
}) : function(o, v) {
|
|
50
|
+
o["default"] = v;
|
|
51
|
+
});
|
|
52
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
53
|
+
var ownKeys = function(o) {
|
|
54
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
55
|
+
var ar = [];
|
|
56
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
57
|
+
return ar;
|
|
58
|
+
};
|
|
59
|
+
return ownKeys(o);
|
|
60
|
+
};
|
|
61
|
+
return function (mod) {
|
|
62
|
+
if (mod && mod.__esModule) return mod;
|
|
63
|
+
var result = {};
|
|
64
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
65
|
+
__setModuleDefault(result, mod);
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
})();
|
|
69
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
exports.MAX_SOURCE_LINES = exports.MAX_SOURCE_BYTES = void 0;
|
|
71
|
+
exports.findIndexedFile = findIndexedFile;
|
|
72
|
+
exports.toRequestPath = toRequestPath;
|
|
73
|
+
exports.resolveRequestedFile = resolveRequestedFile;
|
|
74
|
+
exports.notIndexedError = notIndexedError;
|
|
75
|
+
exports.splitLines = splitLines;
|
|
76
|
+
exports.readIndexedFileText = readIndexedFileText;
|
|
77
|
+
exports.hasDriftedOnDisk = hasDriftedOnDisk;
|
|
78
|
+
exports.readFileShape = readFileShape;
|
|
79
|
+
exports.parseOnDrift = parseOnDrift;
|
|
80
|
+
exports.buildSource = buildSource;
|
|
81
|
+
const crypto_1 = require("crypto");
|
|
82
|
+
const fs = __importStar(require("fs"));
|
|
83
|
+
const path = __importStar(require("path"));
|
|
84
|
+
const security_1 = require("../security");
|
|
85
|
+
const highlight_1 = require("../highlight");
|
|
86
|
+
const respond_1 = require("./respond");
|
|
87
|
+
/**
|
|
88
|
+
* Largest file we will read to answer a source request.
|
|
89
|
+
*
|
|
90
|
+
* The whole file has to be read to hash it, so this bounds the work one request
|
|
91
|
+
* can cause. Well above the 1 MB ceiling extraction itself applies, so anything
|
|
92
|
+
* actually in the index is comfortably inside it.
|
|
93
|
+
*/
|
|
94
|
+
exports.MAX_SOURCE_BYTES = 8 * 1024 * 1024;
|
|
95
|
+
/** Lines returned in one response. The Symbol view asks for windows, not files. */
|
|
96
|
+
exports.MAX_SOURCE_LINES = 4000;
|
|
97
|
+
/**
|
|
98
|
+
* Look up a file record by a viewer-supplied path, WITHOUT validating it.
|
|
99
|
+
*
|
|
100
|
+
* Indexed paths are normalized to forward slashes at extraction time, so that
|
|
101
|
+
* is the form tried first; the platform-separator form is a fallback for an
|
|
102
|
+
* index written before that normalization.
|
|
103
|
+
*
|
|
104
|
+
* Callers that go on to READ the file must use {@link resolveRequestedFile}
|
|
105
|
+
* instead — it puts the path through the security chokepoint first. This one is
|
|
106
|
+
* for endpoints that only need the record (a drift flag on a path the index
|
|
107
|
+
* itself handed us).
|
|
108
|
+
*/
|
|
109
|
+
function findIndexedFile(cg, requested) {
|
|
110
|
+
const posix = toRequestPath(requested);
|
|
111
|
+
const record = cg.getFile(posix);
|
|
112
|
+
if (record)
|
|
113
|
+
return { record, storedPath: posix };
|
|
114
|
+
const native = posix.split('/').join(path.sep);
|
|
115
|
+
if (native !== posix) {
|
|
116
|
+
const legacy = cg.getFile(native);
|
|
117
|
+
if (legacy)
|
|
118
|
+
return { record: legacy, storedPath: native };
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Forward slashes and no leading `./` — the form indexed paths are stored in.
|
|
124
|
+
*
|
|
125
|
+
* A LEADING SLASH IS LEFT ALONE on purpose. Stripping it would quietly turn
|
|
126
|
+
* `/etc/passwd` into the project-relative `etc/passwd` and answer "not in this
|
|
127
|
+
* index" — reinterpreting the request instead of refusing it, and leaving the
|
|
128
|
+
* chokepoint's absolute-path rule with nothing to catch.
|
|
129
|
+
*/
|
|
130
|
+
function toRequestPath(requested) {
|
|
131
|
+
return requested.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Validate a viewer-supplied path, THEN look it up in the index.
|
|
135
|
+
*
|
|
136
|
+
* The order is the point. `resolveProjectFile` runs first, so a traversal, an
|
|
137
|
+
* absolute path or a sensitive system directory is refused as what it is,
|
|
138
|
+
* before the index is consulted — a 403 that says "outside the project", not a
|
|
139
|
+
* 404 that says "not indexed" and quietly depends on the index lookup missing.
|
|
140
|
+
* It also means the absolute path every reader uses has already been through
|
|
141
|
+
* the chokepoint by construction, rather than by remembering to call it.
|
|
142
|
+
*
|
|
143
|
+
* @throws {PathRefusalError} the path is not one we would ever read.
|
|
144
|
+
* @throws {ApiError} `not-found` when it is fine but not in the index.
|
|
145
|
+
*/
|
|
146
|
+
function resolveRequestedFile(cg, projectRoot, requested) {
|
|
147
|
+
const posix = toRequestPath(requested);
|
|
148
|
+
// Refusals happen here, ahead of everything.
|
|
149
|
+
const absolute = (0, security_1.resolveProjectFile)(projectRoot, posix);
|
|
150
|
+
const found = findIndexedFile(cg, posix);
|
|
151
|
+
if (!found)
|
|
152
|
+
throw notIndexedError(posix);
|
|
153
|
+
return { ...found, absolute };
|
|
154
|
+
}
|
|
155
|
+
function notIndexedError(file) {
|
|
156
|
+
return (0, respond_1.notFound)(`${file} is not in this CodeGraph index.`, 'The viewer only reads files the index knows about. If the file is new, ' +
|
|
157
|
+
'it appears after the next sync; if it is excluded (gitignored, generated, ' +
|
|
158
|
+
'or too large to parse), it will not appear at all.');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Split source the way the index counted it.
|
|
162
|
+
*
|
|
163
|
+
* Rows are `\n`-delimited — that is how tree-sitter numbers them — so a CRLF
|
|
164
|
+
* file has the same line numbers here as in the graph. The trailing `\r` is
|
|
165
|
+
* dropped per line so it does not render as a stray glyph.
|
|
166
|
+
*/
|
|
167
|
+
function splitLines(content) {
|
|
168
|
+
const lines = content.split('\n');
|
|
169
|
+
for (let i = 0; i < lines.length; i++) {
|
|
170
|
+
const line = lines[i];
|
|
171
|
+
if (line.endsWith('\r'))
|
|
172
|
+
lines[i] = line.slice(0, -1);
|
|
173
|
+
}
|
|
174
|
+
// A file ending in a newline splits to a final empty string that is not a
|
|
175
|
+
// line of source. Every other trailing empty line IS one.
|
|
176
|
+
if (lines.length > 1 && lines[lines.length - 1] === '')
|
|
177
|
+
lines.pop();
|
|
178
|
+
return lines;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The whole text of an INDEXED file, or `null` for anything unreadable.
|
|
182
|
+
*
|
|
183
|
+
* The dead code report's corroboration pass needs to count an identifier in a
|
|
184
|
+
* file's text, and this module is the only one in `api/` that opens a file — so
|
|
185
|
+
* the reader it uses lives here, behind the same chokepoint. Three refusals,
|
|
186
|
+
* all answering `null` rather than throwing, because the caller's rule is
|
|
187
|
+
* already "cannot read it → do not make the claim":
|
|
188
|
+
*
|
|
189
|
+
* - not in the index (the viewer never reads a file the graph does not know);
|
|
190
|
+
* - outside the project (`resolveProjectFile` throws; caught here);
|
|
191
|
+
* - bigger than `maxBytes`.
|
|
192
|
+
*
|
|
193
|
+
* Drift is deliberately NOT checked. The question being asked is "does anything
|
|
194
|
+
* in this file write this name", and the file's current bytes are the better
|
|
195
|
+
* answer to it than the bytes we indexed.
|
|
196
|
+
*/
|
|
197
|
+
function readIndexedFileText(cg, projectRoot, requested, maxBytes) {
|
|
198
|
+
try {
|
|
199
|
+
const found = findIndexedFile(cg, requested);
|
|
200
|
+
if (!found)
|
|
201
|
+
return null;
|
|
202
|
+
const absolute = (0, security_1.resolveProjectFile)(projectRoot, found.storedPath);
|
|
203
|
+
const stats = fs.statSync(absolute);
|
|
204
|
+
if (!stats.isFile() || stats.size > maxBytes)
|
|
205
|
+
return null;
|
|
206
|
+
return fs.readFileSync(absolute, 'utf8');
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Whether an indexed file has changed on disk since it was indexed — the same
|
|
214
|
+
* verdict `/api/source` returns, for endpoints that must *flag* drift without
|
|
215
|
+
* serving source (a symbol header, a file outline).
|
|
216
|
+
*
|
|
217
|
+
* Cheap first: size plus floored mtime is the identical freshness test the sync
|
|
218
|
+
* fast path uses, so an untouched file costs one `stat`. Only a stat mismatch
|
|
219
|
+
* pays for a hash, which is what keeps a `touch` or a checkout that rewrote
|
|
220
|
+
* identical bytes from reading as drift.
|
|
221
|
+
*
|
|
222
|
+
* Any failure answers `false`. A wrong "stale" flag would put a warning banner
|
|
223
|
+
* over correct source; the cases that would trip it (missing record, unreadable
|
|
224
|
+
* file) have their own handling in the endpoints that actually read.
|
|
225
|
+
*/
|
|
226
|
+
function hasDriftedOnDisk(projectRoot, storedPath, record) {
|
|
227
|
+
try {
|
|
228
|
+
const absolute = (0, security_1.resolveProjectFile)(projectRoot, storedPath);
|
|
229
|
+
const stats = fs.statSync(absolute);
|
|
230
|
+
if (stats.size === record.size && Math.floor(stats.mtimeMs) === Math.floor(record.modifiedAt)) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
if (stats.size > exports.MAX_SOURCE_BYTES)
|
|
234
|
+
return true;
|
|
235
|
+
const content = fs.readFileSync(absolute, 'utf-8');
|
|
236
|
+
return (0, crypto_1.createHash)('sha256').update(content).digest('hex') !== record.contentHash;
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The drift verdict AND the file's length, from one read.
|
|
244
|
+
*
|
|
245
|
+
* The whole-file view needs both before it draws anything: the drift banner,
|
|
246
|
+
* and the line count that fixes the height of the scrolling document (every
|
|
247
|
+
* line is a fixed 20px, so the total IS the layout). Asking
|
|
248
|
+
* {@link hasDriftedOnDisk} and then a source page would answer the first
|
|
249
|
+
* question against one read of the file and the second against another, which
|
|
250
|
+
* is exactly the window in which a file can change underneath the two.
|
|
251
|
+
*
|
|
252
|
+
* Unlike `hasDriftedOnDisk` there is no stat-only fast path: the bytes have to
|
|
253
|
+
* be read to be counted. That is the cost of knowing the length, and it is
|
|
254
|
+
* bounded by {@link MAX_SOURCE_BYTES} like every other read here.
|
|
255
|
+
*/
|
|
256
|
+
function readFileShape(projectRoot, storedPath, record) {
|
|
257
|
+
let absolute;
|
|
258
|
+
try {
|
|
259
|
+
absolute = (0, security_1.resolveProjectFile)(projectRoot, storedPath);
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
// A refusal on a path the INDEX handed us is not a request to refuse — the
|
|
263
|
+
// caller already passed the chokepoint. Treat it as unreadable.
|
|
264
|
+
return { drift: false, totalLines: null };
|
|
265
|
+
}
|
|
266
|
+
try {
|
|
267
|
+
const stats = fs.statSync(absolute);
|
|
268
|
+
if (stats.size > exports.MAX_SOURCE_BYTES) {
|
|
269
|
+
return { drift: false, totalLines: null, reason: 'The file is too large to read here.' };
|
|
270
|
+
}
|
|
271
|
+
const content = fs.readFileSync(absolute, 'utf-8');
|
|
272
|
+
const drift = (0, crypto_1.createHash)('sha256').update(content).digest('hex') !== record.contentHash;
|
|
273
|
+
return {
|
|
274
|
+
drift,
|
|
275
|
+
totalLines: splitLines(content).length,
|
|
276
|
+
...(drift
|
|
277
|
+
? {
|
|
278
|
+
reason: 'This file changed on disk after the last index sync, so the line ' +
|
|
279
|
+
'numbers the graph holds no longer match it.',
|
|
280
|
+
}
|
|
281
|
+
: {}),
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
return {
|
|
286
|
+
drift: true,
|
|
287
|
+
totalLines: null,
|
|
288
|
+
reason: 'The file is in the index but could not be read from disk.',
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/** Said once, so the two places that answer with current bytes cannot diverge. */
|
|
293
|
+
const DRIFT_CURRENT_REASON = 'This file changed on disk after the last index sync. These are its current ' +
|
|
294
|
+
'lines; the indexed line ranges — symbol bodies, call sites, ports — no longer ' +
|
|
295
|
+
'match them. The next sync picks it up.';
|
|
296
|
+
function parseOnDrift(query) {
|
|
297
|
+
const raw = query.get('ondrift');
|
|
298
|
+
if (raw === null || raw === '' || raw === 'omit')
|
|
299
|
+
return 'omit';
|
|
300
|
+
if (raw === 'current')
|
|
301
|
+
return 'current';
|
|
302
|
+
throw (0, respond_1.badRequest)(`Parameter "ondrift" must be "omit" or "current" (got "${raw}").`, 'Omit it to leave a drifted file unsliced; "current" serves the bytes on disk instead.');
|
|
303
|
+
}
|
|
304
|
+
async function buildSource(cg, projectRoot, query) {
|
|
305
|
+
const requested = (0, respond_1.textParam)(query, 'file');
|
|
306
|
+
// Refusal first, index lookup second — see `resolveRequestedFile`.
|
|
307
|
+
const { record, storedPath, absolute } = resolveRequestedFile(cg, projectRoot, requested);
|
|
308
|
+
const from = (0, respond_1.intParam)(query, 'from', { min: 1, max: 5_000_000, default: 1 });
|
|
309
|
+
const to = (0, respond_1.intParam)(query, 'to', { min: 1, max: 5_000_000, default: 0 });
|
|
310
|
+
if (to !== 0 && to < from) {
|
|
311
|
+
throw (0, respond_1.badRequest)(`Parameter "to" (${to}) must not be before "from" (${from}).`);
|
|
312
|
+
}
|
|
313
|
+
const onDrift = parseOnDrift(query);
|
|
314
|
+
const base = {
|
|
315
|
+
file: storedPath.replace(/\\/g, '/'),
|
|
316
|
+
language: record.language,
|
|
317
|
+
drift: false,
|
|
318
|
+
showing: 'indexed',
|
|
319
|
+
contentHash: record.contentHash,
|
|
320
|
+
indexedAt: record.indexedAt,
|
|
321
|
+
generated: record.generated === true,
|
|
322
|
+
totalLines: null,
|
|
323
|
+
};
|
|
324
|
+
let stats;
|
|
325
|
+
try {
|
|
326
|
+
stats = fs.statSync(absolute);
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
// Indexed but gone. That IS drift, and the strongest kind: nothing on disk
|
|
330
|
+
// corresponds to the ranges the graph holds — and `ondrift=current` has
|
|
331
|
+
// nothing to fall back to either.
|
|
332
|
+
return {
|
|
333
|
+
...base,
|
|
334
|
+
drift: true,
|
|
335
|
+
showing: 'none',
|
|
336
|
+
reason: 'The file is in the index but no longer on disk.',
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
if (stats.size > exports.MAX_SOURCE_BYTES) {
|
|
340
|
+
throw (0, respond_1.badRequest)(`${base.file} is ${Math.round(stats.size / 1024 / 1024)} MB — too large to serve as source.`);
|
|
341
|
+
}
|
|
342
|
+
let content;
|
|
343
|
+
try {
|
|
344
|
+
content = fs.readFileSync(absolute, 'utf-8');
|
|
345
|
+
}
|
|
346
|
+
catch (err) {
|
|
347
|
+
throw new respond_1.ApiError('internal', `Could not read ${base.file}: ${err instanceof Error ? err.message : String(err)}`);
|
|
348
|
+
}
|
|
349
|
+
// Byte-identical to extraction's `hashContent` (sha256 over the utf-8
|
|
350
|
+
// string). A touch or a checkout that rewrote the same bytes must not count
|
|
351
|
+
// as drift, which is exactly what hashing content rather than mtime buys.
|
|
352
|
+
const hash = (0, crypto_1.createHash)('sha256').update(content).digest('hex');
|
|
353
|
+
const drift = hash !== record.contentHash;
|
|
354
|
+
if (drift && onDrift === 'omit') {
|
|
355
|
+
return {
|
|
356
|
+
...base,
|
|
357
|
+
drift: true,
|
|
358
|
+
showing: 'none',
|
|
359
|
+
reason: 'This file changed on disk after the last index sync, so the indexed line ' +
|
|
360
|
+
'ranges no longer reliably match. Source is omitted rather than risk showing ' +
|
|
361
|
+
"a different symbol's code; it returns after the next sync.",
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
const all = splitLines(content);
|
|
365
|
+
// Past the end of the file `from` names nothing, which is a caller bug worth
|
|
366
|
+
// surfacing rather than answering with the last line as if that were meant.
|
|
367
|
+
// `to` past the end is different — "line 30 to the end, whatever that is" is
|
|
368
|
+
// an ordinary way to ask, so it clamps.
|
|
369
|
+
//
|
|
370
|
+
// The exception is a drifted file the caller asked for anyway: it has already
|
|
371
|
+
// been told the numbering does not hold, and a save that SHORTENED the file
|
|
372
|
+
// between the length it was given and this read is an ordinary race, not a
|
|
373
|
+
// bug. Those get an empty slice.
|
|
374
|
+
if (from > all.length) {
|
|
375
|
+
if (!drift) {
|
|
376
|
+
throw (0, respond_1.badRequest)(`Parameter "from" (${from}) is past the end of ${base.file}, which has ${all.length} lines.`);
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
...base,
|
|
380
|
+
drift: true,
|
|
381
|
+
showing: 'current',
|
|
382
|
+
totalLines: all.length,
|
|
383
|
+
from,
|
|
384
|
+
to: from - 1,
|
|
385
|
+
lines: [],
|
|
386
|
+
truncated: false,
|
|
387
|
+
reason: DRIFT_CURRENT_REASON,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
const start = from;
|
|
391
|
+
const requestedEnd = to === 0 ? all.length : Math.min(to, all.length);
|
|
392
|
+
const end = Math.min(requestedEnd, start + exports.MAX_SOURCE_LINES - 1);
|
|
393
|
+
const slice = all.slice(start - 1, end);
|
|
394
|
+
return {
|
|
395
|
+
...base,
|
|
396
|
+
drift,
|
|
397
|
+
// The bytes are always the ones on disk. What changes with drift is what
|
|
398
|
+
// they can be *used* for: under `current` the caller must not map anything
|
|
399
|
+
// the index holds onto these numbers.
|
|
400
|
+
showing: drift ? 'current' : 'indexed',
|
|
401
|
+
...(drift ? { reason: DRIFT_CURRENT_REASON } : {}),
|
|
402
|
+
totalLines: all.length,
|
|
403
|
+
from: start,
|
|
404
|
+
to: end,
|
|
405
|
+
lines: slice,
|
|
406
|
+
truncated: end < requestedEnd,
|
|
407
|
+
// Keyed on the hash of the bytes ACTUALLY BEING SERVED, so the cache is
|
|
408
|
+
// invalidated by the file changing rather than by a clock, and two viewers
|
|
409
|
+
// looking at the same symbol share one tokenisation. It must be the disk
|
|
410
|
+
// hash rather than the record's: on a drifted file those differ, and keying
|
|
411
|
+
// current lines under the indexed hash would serve the previous edit's
|
|
412
|
+
// colours over this one's text.
|
|
413
|
+
highlight: await (0, highlight_1.highlightLines)(slice, {
|
|
414
|
+
language: record.language,
|
|
415
|
+
cacheKey: `${hash}:${start}:${end}`,
|
|
416
|
+
}),
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/ui-server/api/source.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCH,0CAcC;AAUD,sCAEC;AAeD,oDAYC;AAED,0CAOC;AASD,gCAUC;AAmBD,kDAgBC;AAgBD,4CAiBC;AAgBD,sCAsCC;AAuDD,oCAQC;AAED,kCAmIC;AAhbD,mCAA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G,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,GAAG,wBAAgB,GAAG,CAAC,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAExC,OAAO;QACL,GAAG,IAAI;QACP,KAAK;QACL,yEAAyE;QACzE,2EAA2E;QAC3E,sCAAsC;QACtC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACtC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,UAAU,EAAE,GAAG,CAAC,MAAM;QACtB,IAAI,EAAE,KAAK;QACX,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,GAAG,GAAG,YAAY;QAC7B,wEAAwE;QACxE,2EAA2E;QAC3E,yEAAyE;QACzE,4EAA4E;QAC5E,uEAAuE;QACvE,gCAAgC;QAChC,SAAS,EAAE,MAAM,IAAA,0BAAc,EAAC,KAAK,EAAE;YACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE;SACpC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GET /api/stats` — what this index is, and how much to trust it.
|
|
3
|
+
*
|
|
4
|
+
* The viewer's top bar shows a couple of numbers from here, but the reason the
|
|
5
|
+
* endpoint carries more than that is honesty: an index can be truncated
|
|
6
|
+
* (`state: "indexing"` after a killed run), built by an older extractor, or
|
|
7
|
+
* simply old. A reader that draws confident graphs over a half-built index is
|
|
8
|
+
* the failure mode worth designing against, so the state travels with the
|
|
9
|
+
* counts rather than being something the UI has to ask for separately.
|
|
10
|
+
*/
|
|
11
|
+
import type { CodeGraph } from '../../index';
|
|
12
|
+
export interface WireBlastScale {
|
|
13
|
+
/** Most distinct dependents any symbol in the index has. Exact — one query. */
|
|
14
|
+
maxDirect: number;
|
|
15
|
+
/** Widest depth-{@link BLAST_DEPTH} radius found across the sampled symbols. */
|
|
16
|
+
maxWithinHops: number;
|
|
17
|
+
hops: number;
|
|
18
|
+
/** How many symbols were measured for `maxWithinHops`. */
|
|
19
|
+
sampled: number;
|
|
20
|
+
/** True whenever `maxWithinHops` came from a sample rather than every symbol. */
|
|
21
|
+
estimated: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function blastScaleFor(cg: CodeGraph, projectRoot: string, edgeCount: number): WireBlastScale;
|
|
24
|
+
/** Drop the memoised scale — for tests, which build a fresh index per case. */
|
|
25
|
+
export declare function resetBlastScaleCache(): void;
|
|
26
|
+
export declare function buildStats(cg: CodeGraph, projectRoot: string): unknown;
|
|
27
|
+
//# sourceMappingURL=stats.d.ts.map
|