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

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

The rich edit tool for DeepSeek Harness (replace / patch / apply_patch / hashline modes) with embedded format-on-write and diagnostics — a standalone plugin with no upstream harness changes required.

原始使用文档

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

The rich edit tool plugin for DeepSeek Harness: replace / patch / apply_patch / hashline modes with an embedded LSP client (format-on-write + diagnostics).

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

Official harness releases (rc.8+): installing the bundle disables the shipped str_replace_editor tool, and the rich editor replaces the stock edit by agent-scope shadowing. Mount the provided preset row — see the Replacing the built-in editor section and examples/agent-preset/ in this package. Installing the bundle alone never breaks boot.

Full usage, configuration, and the benchmark against the built-in str_replace_editor: https://github.com/hy-sde/dsh-tool-edit#readme

TypeScript 7 native LSP (opt-in)

TypeScript 7 dropped the JS lib/tsserver.js that typescript-language-server wraps and speaks the language protocol natively via tsc --lsp --stdio, so the wrapper fails at initialize on TypeScript 7 projects. Set typescriptNative (off unless set — exactly as upstream oh-my-pi commit 530664c8f5) to make the embedded client pick exactly one server per workspace:

- id: tool-edit
  config:
    lspCommand: npx --yes typescript-language-server --stdio
    typescriptNative: {}        # enabled; native launcher defaults to `tsc`
    # typescriptNative:
    #   command: tsc             # override the native launcher name/path,
    #                            # e.g. a tsc wrapper or `tsgo`

Selection runs once per workspace at first spawn, from the workspace root of the edit (workspaceRoot): a workspace TypeScript install (walking up to the repo root, so monorepo workspaces use the root install) with no lib/tsserver.js spawns the workspace's own tsc (.bin/tsc, with win32 .exe/.cmd/.bat candidates, falling back to the package's bin/tsc) with --lsp --stdio; a classic install (has lib/tsserver.js) or no install keeps lspCommand unchanged; with no workspace install, the native launcher resolved on PATH is used only when its install also lacks lib/tsserver.js; anything undetectable keeps lspCommand exactly as today.

版本与发布记录

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

版本发布日期距今
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.2.22026/10/0529 天前
0.2.0-rc.2.12026/10/0529 天前

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

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

富人 edit DeepSeek线束工具(替换/ patch / apply_patch / hashline模式),内置写时格式化和诊断-一个独立的插件,不需要更改上游线束。

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

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

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

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

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

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

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

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

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

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

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

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