@hy-sde-org/dsh-tool-debug

中文文档
0.2.1-rc.5发布于 2026/11/01MITTypeScriptES Module

Model-facing Debug Adapter Protocol debug tool with 28 operations (launch/attach, breakpoints, stepping, threads/stack/scopes/variables/evaluate, disassembly, memory, terminate) over the standalone DAP seam — no harness changes required.

原始使用文档
文档目录4 节
  1. Tool surface
  2. Behavior notes
  3. Example preset
  4. Testing

@hy-sde-org/dsh-tool-debug

The debug tool plugin for DeepSeek Harness, built on the standalone DAP seam from the sibling package @hy-sde-org/dsh-dap: one tool, 28 operations — launch/attach, source/function/instruction/data breakpoints, continue/pause/step, threads/stackTrace/scopes/variables/evaluate, disassembly, memory access, modules, loaded sources, custom requests, captured output, and termination.

dsh plugin --profile web add @hy-sde-org/dsh-tool-debug

The npm package installs a zero-effect bundle patch (nothing on the official harness collides with the debug name, so there is nothing to disable or shadow); the tool itself is mounted by adding the provided agent preset row to a user preset. Installing the bundle alone never breaks boot. After mounting the preset, agents get the debug tool and can launch/attach real debuggers (debugpy, lldb-dap, gdb, dlv, js-debug, ...) through the mounted DAP provider.

Tool surface

  • name: tool-debug, inject: ['tools', 'dap', 'systemPrompt']
  • Config: maxResultChars (16000), requestTimeoutSec (30), timeoutMs (120000, enforced by dsh-tool-call-timeout-policy).
  • Requires a session workspace cwd (exec.agent.session.header.cwd) and is not concurrency-safe: debug sessions are exclusive.

Behavior notes

  • One active session: an active session must be terminated (or has terminated/exited) before another launch/attach.
  • Paths resolve against the session workspace; cwd overrides per call.
  • Per-request timeout aborts via a combined AbortSignal (call + timeout).
  • Adapter selection errors name the missing adapter and the install command (pip install debugpy, apt install gdb, ...).
  • Breakpoint mutations are serialized per session, and propagated to every live session when an adapter reports a session tree.

Example preset

examples/agent-preset/ contains a ready-to-copy user preset (agent.cordis.yml + preset.yml) that mounts the debug group (the dap service in its own isolated realm so each agent owns its adapter processes) plus the tool-debug row beside it. Copy the directory to ~/.dsh/.agent-presets/<id>/, select the preset in the Web UI preset picker (or dsh agent CLI), and agents in that preset can call debug.

Testing

pnpm --filter @hy-sde-org/dsh-tool-debug test (vitest) covers argument parsing, rendering, and an end-to-end launch/breakpoint/step/evaluate flow through a scripted DAP adapter.

版本与发布记录

@hy-sde-org/dsh-tool-debug 共发布 11 个版本,首次发布于 2026/08/22;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.2.1-rc.5latest2026/11/012 天前
0.2.1-rc.32026/10/259 天前
0.2.1-alpha.42026/10/1618 天前
0.2.1-alpha.22026/10/1321 天前
0.2.0-rc.22026/10/031 个月前
0.1.7-rc.22026/09/291 个月前

关于 @hy-sde-org/dsh-tool-debug 的常见问题

@hy-sde-org/dsh-tool-debug 是什么?

面向模型的调试适配器协议调试工具,在独立的DAP接缝上具有28个操作(启动/附加,断点,步进,线程/堆栈/作用域/变量/求值,拆卸,内存,终止)-无需更改线轴。

如何安装 @hy-sde-org/dsh-tool-debug?

在项目目录运行 npm install @hy-sde-org/dsh-tool-debug,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@deepseek-ai/cordis(~4.0.5)、@deepseek-ai/dsh-tools(^0.2.1-rc.5)、@deepseek-ai/dsh-timeout(^0.2.1-rc.5)、@deepseek-ai/dsh-system-prompt(^0.2.1-rc.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@hy-sde-org/dsh-tool-debug 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@hy-sde-org/dsh-tool-debug 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@hy-sde-org/dsh-tool-debug 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.19.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@hy-sde-org/dsh-tool-debug 可以商用吗?

@hy-sde-org/dsh-tool-debug 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@hy-sde-org/dsh-tool-debug 还在维护吗?

最新版本 0.2.1-rc.5 发布于 2026/11/01(2 天前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/08/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。