# @hy-sde-org/dsh-tool-edit 中文文档

规范地址：https://npmcn.com/package/%40hy-sde-org/dsh-tool-edit/

版本：0\.2\.1-rc\.5
npm 元数据更新时间：2026-11-01T04:24:19.810Z
中文译文更新时间：2026-11-01T09:25:11.593Z
软件包许可：MIT

本文由上游 README 机器翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40hy-sde-org/dsh-tool-edit
原文对照：https://npmcn.com/package/%40hy-sde-org/dsh-tool-edit/?lang=original
项目主页：https://github.com/hy-sde/dsh-tool-edit#readme
源码仓库：https://github.com/hy-sde/dsh-tool-edit

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：599 kB，94 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.19\.0
- 运行依赖：2 个
- 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
- 首次发布：2026-08-17T00:01:33.918Z
- 最新版本发布：2026-11-01T04:24:19.611Z
- 已发布版本数：18（近 12 个月 18 个）

## 中文简介

富人 `edit` DeepSeek线束工具（替换/ patch / apply\_patch / hashline模式），内置写时格式化和诊断-一个独立的插件，不需要更改上游线束。

## 安装

```sh
npm install @hy-sde-org/dsh-tool-edit
```

也可以使用：`pnpm add @hy-sde-org/dsh-tool-edit`、`yarn add @hy-sde-org/dsh-tool-edit`、`bun add @hy-sde-org/dsh-tool-edit`

## README

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

富人 `edit` DeepSeek Harness工具插件：将/ patch / apply\_patch / hashline模式替换为嵌入式LSP客户端（format-on-write + diagnostics）。

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

> **官方线束版本（rc.8+）：** 安装bundle会禁用 运 `str_replace_editor` 工具，并且富编辑器替换了库存 `edit` 通过代理作用域跟踪。安装提供的预设行-参见 [替换内置编辑器](https://github.com/hy-sde/dsh-tool-edit#replacing-the-built-in-editor-official-harness-rc8) 节和 `examples/agent-preset/` 在这个包裹里。安装bundle 孤独永不破靴。

完整的使用、配置和针对内置的基准测试 `str_replace_editor`： [https://github.com/hy-sde/dsh-tool-edit#readme](https://github.com/hy-sde/dsh-tool-edit#readme)

## TypeScript 7 native LSP（可选择加入）

TypeScript 7去掉了JS `lib/tsserver.js` 那 `typescript-language-server` 封装并使用本机的语言协议 `tsc --lsp --stdio`，所以 包装器在 `initialize` TypeScript 7项目。集 `typescriptNative` (关闭，除非设置-与上游的oh-my-pi提交完全相同 `530664c8f5`)，以使嵌入式客户端每次只选择一个服务器 工作区:

```yaml
- 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`
```

的工作空间根目录在每个工作空间第一次生成时运行一次选择 编辑(`workspaceRoot`)：一个工作空间的TypeScript安装(走到 Repo根目录，所以monorepo工作区使用根目录安装 `lib/tsserver.js` 生成工作区自己的 `tsc` （`.bin/tsc`，使用win32 `.exe`/`.cmd`/`.bat` 候选人，回到一揽子计划 `bin/tsc`), `--lsp --stdio`;一个经典的安装(有 `lib/tsserver.js`)或不安装 `lspCommand` 不变;由于没有安装工作空间，本机启动程序已解决 仅在其安装还缺少时才使用 `lib/tsserver.js`;任何东西 无法觉察的保持 `lspCommand` 就像今天一样。

## 常见问题

### @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 和提交记录判断。

