diff --git a/docs/tools/debug.md b/docs/tools/debug.md index 667f51784..8b94627b0 100644 --- a/docs/tools/debug.md +++ b/docs/tools/debug.md @@ -330,9 +330,8 @@ Example `.omp/dap.json`: ## Notes - `packages/coding-agent/src/prompts/tools/debug.md` tells the model only one active root session is supported. Adapter-requested child sessions belong to that root tree. -- The default JavaScript/TypeScript adapter runs vscode-js-debug's `dapDebugServer.js` over TCP. It is **not** an npm package — `npm i -g js-debug-adapter` 404s (`js-debug-adapter` is the omp adapter id, not an installable package). Install `dapDebugServer.js` one of these ways; the first two are auto-discovered by `resolveJsDebugServerPath()` in `packages/coding-agent/src/dap/config.ts`: - - Mason (`:MasonInstall js-debug-adapter`) → discovered at `~/.local/share/nvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js`. - - Standalone release tarball, extracted so `dapDebugServer.js` lands at `~/.local/opt/js-debug/src/dapDebugServer.js`: +- The default JavaScript/TypeScript adapter runs vscode-js-debug's `dapDebugServer.js` over TCP. Install it one of these ways; the first and last are auto-discovered by `resolveJsDebugServerPath()` in `packages/coding-agent/src/dap/config.ts`. (Don't try `npm i -g js-debug-adapter` — it 404s; `js-debug-adapter` is the omp adapter id, not an npm package.) + - Release tarball, extracted so `dapDebugServer.js` lands at `~/.local/opt/js-debug/src/dapDebugServer.js`: ```sh curl -sL -o js-debug-dap.tar.gz \ https://github.com/microsoft/vscode-js-debug/releases/download/v1.117.0/js-debug-dap-v1.117.0.tar.gz @@ -340,6 +339,7 @@ Example `.omp/dap.json`: ``` Replace `v1.117.0` with the latest tag from the [releases page](https://github.com/microsoft/vscode-js-debug/releases). - Any other location via `JS_DEBUG_DAP_SERVER=`. + - Neovim users with Mason: `:MasonInstall js-debug-adapter` → discovered at `~/.local/share/nvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js`. - The adapter runs under `node` if on `PATH`, otherwise under the omp host (Bun); `resolveDefaultJsDebugAdapter()` falls back to `process.execPath`, so a Bun-only setup is supported. - `configurationDone` is sent automatically during root and child launch/attach handshakes and lazily before later requests if the initial handshake did not complete. - `startDebugging` reverse requests create recursive child sessions on the same TCP server; a stopped child becomes the target for thread-level actions. diff --git a/packages/coding-agent/src/tools/debug.ts b/packages/coding-agent/src/tools/debug.ts index ba5e31983..150193762 100644 --- a/packages/coding-agent/src/tools/debug.ts +++ b/packages/coding-agent/src/tools/debug.ts @@ -505,7 +505,7 @@ const ADAPTER_UNAVAILABLE_MESSAGES: Readonly> = { dlv: "adapter 'dlv' is not available: install with 'go install github.com/go-delve/delve/cmd/dlv@latest'", rdbg: "adapter 'rdbg' is not available: install with 'gem install debug'", "js-debug-adapter": - "adapter 'js-debug-adapter' is not available: vscode-js-debug is not an npm package — install via Mason (`:MasonInstall js-debug-adapter`), extract the release tarball (https://github.com/microsoft/vscode-js-debug/releases) under ~/.local/opt, or set JS_DEBUG_DAP_SERVER to dapDebugServer.js", + "adapter 'js-debug-adapter' is not available: download it from https://github.com/microsoft/vscode-js-debug", }; const ADAPTER_CANONICAL_COMMANDS: Readonly> = { diff --git a/packages/coding-agent/test/debug/dap-launch-failures.test.ts b/packages/coding-agent/test/debug/dap-launch-failures.test.ts index a10a55626..8d905d27b 100644 --- a/packages/coding-agent/test/debug/dap-launch-failures.test.ts +++ b/packages/coding-agent/test/debug/dap-launch-failures.test.ts @@ -882,7 +882,7 @@ describe("DebugTool launch validation", () => { const tool = new DebugTool(session); await expect(tool.execute("call", { action: "launch", program: "main.js" })).rejects.toThrow( - /Mason.*release tarball.*JS_DEBUG_DAP_SERVER/, + /download.*github\.com\/microsoft\/vscode-js-debug/, ); } finally { await removeWithRetries(cwd);