Bundle
dsh-zh-cn-ui
DSH 界面简体中文化客户端插件:API 数据层汉化 + DOM 文本兜底,不修改任何源码。卸载即还原。
- Source
- ngk3pori
- License
- MIT
- Updated
- Updated 23 days ago
Readme
# dsh-zh-cn-ui
DSH(DeepSeek Harness)Web 界面的简体中文化客户端插件。
> 本插件只通过客户端 API 拦截和 DOM 文本兜底实现汉化,不修改 DSH 官方 `node_modules` bundle;移除插件即可恢复原始界面。
## 功能
- **API 数据层汉化**(包装 `window.fetch`,不修改任何源码):
- 命令面板(加号 / 斜杠菜单)中的 `/compact`、`/feedback`、`/goal`、`/permission`、`/plan`、`/export` 命令描述
- 模型目录 `llm.models` / `session.models` 中的推理等级名称:关闭、最低、低、中、高、较高、最高
- **DOM 文本兜底**(MutationObserver 精确替换硬编码英文词条):
- `Deep diving...` → 深度探索中…
- `Think` → 思考
- `Full access` → 完全访问
- `Read Only` → 只读
- `Workspace Write` → 工作区写入
- `Session log` → 会话日志
- `Search` / `Read` / `Write` / `Edit` / `Code` / `Tool call` / `Fetch` / `Inspect` 等工具行标题
- `Off` / `Minimal` / `Low` / `Medium` / `High` / `Max` 等推理等级兜底
- **刻意保留英文**:`Grep`、`Glob`、`Pwsh`、`Bash` 等工具名,保持输入标识清晰。
## 演示效果
### 命令菜单汉化

命令名称(如 `compact`、`export`、`feedback`、`goal`、`permission`、`plan`、`model`)保持原样,只有描述文字翻译为简体中文。
### 工具调用与推理状态

`Tool call`、`Think`、`Deep diving...` 等界面文字会显示为中文;`Glob` 等工具标识按设计保留英文。
## 包结构
```text
dsh-zh-cn-ui/
├── package.json # dsh.bundle.patch + dsh.client 声明
├── cordis.patch.yml # 把宿主插件插入 loader
├── lib/index.js # 宿主空插件(no-op)
├── lib/client.js # 客户端汉化逻辑
├── docs/screenshots/ # 界面演示截图
├── LICENSE
└── README.md
```
桌面 profile 的 loader 要求 bundle 声明 `dsh.bundle.patch`;`dsh.client.platform: "web"` 声明让 loader 提供浏览器客户端 bundle。客户端 factory 必须返回带 `apply` 方法的对象。
## 安装
### 方式一:从 GitHub 克隆
在 PowerShell 中执行:
```powershell
$plugin = "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-zh-cn-ui"
git clone https://github.com/ngk3pori/dsh-zh-cn-ui.git $plugin
```
然后编辑 `%USERPROFILE%\.dsh\profiles\desktop\package.json`,在 `dsh.profile.bundles` 数组中加入:
```json
"dsh-zh-cn-ui"
```
最后重启 DSH Desktop。启动清单中出现 `dsh-zh-cn-ui` 后,刷新页面即可看到汉化。
### 方式二:下载 ZIP
在 GitHub 项目页选择 **Code → Download ZIP**,解压后将项目目录重命名为 `dsh-zh-cn-ui`,放入:
```text
%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-zh-cn-ui\
```
再按上面方式加入 `dsh.profile.bundles` 并重启 DSH Desktop。
### 方式三:使用 npm 压缩包
本项目也可用 `npm pack` 生成 `.tgz`:
```powershell
npm pack
# 将生成的 dsh-zh-cn-ui-*.tgz 解压/安装到 desktop profile 的 node_modules 中
```
注意:本项目是 DSH profile bundle,不是普通的独立 Web 应用;必须同时存在 bundle 文件和 `dsh.profile.bundles` 声明。
## 卸载
1. 从 `%USERPROFILE%\.dsh\profiles\desktop\package.json` 的 `dsh.profile.bundles` 中移除 `"dsh-zh-cn-ui"`。
2. 删除 `%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-zh-cn-ui\` 目录。
3. 重启 DSH Desktop,界面即恢复英文。
插件不修改 DSH 官方源码,因此不需要恢复或覆盖任何官方 bundle。
## 故障排查
### Desktop 启动失败并提示 `declares no dsh.bundle`
确认插件目录内存在:
- `package.json`
- `cordis.patch.yml`
- `lib/index.js`
- `lib/client.js`
并确认 `package.json` 含有:
```json
"dsh": {
"bundle": { "patch": "./cordis.patch.yml" },
"client": { "platform": "web", "immediately": true }
}
```
### 页面仍显示旧文字
先刷新当前页面;模型目录数据可能是在插件更新前缓存的。若仍未生效,完全退出并重新启动 DSH Desktop,确认 profile 的 bundles 中包含 `dsh-zh-cn-ui`。
### 如何确认插件已加载
启动清单中应出现类似:
```text
/plugins/dsh-zh-cn-ui/client.js
```
打开模型选择器应看到中文推理等级;权限菜单应显示「完全访问」「只读」「工作区写入」。
## 许可证
[MIT](LICENSE)
Install
dsh plugin --profile web add github:ngk3pori/dsh-zh-cn-ui
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-zh-cn-ui from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.