DeepSeek Harness plugin

dsh-zh-output

DeepSeek Harness 中文输出插件:提供强制「中文思考与输出」的中文预设(标准 / PTC / 极简 / 创造四种模式的中文版)。

Jump to install

Source facts

Repository
YKennen/dsh-zh-output
Latest update
Aug 15, 2026
Category
UI Enhancements
GitHub stars
3
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/YKennen/dsh-zh-output
Plugin: dsh-zh-output
Author: YKennen

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

DeepSeek Harness 中文输出插件(dsh-zh-output)

DeepSeek Harness 提供「强制中文思考与输出」的中文预设(模式)。

每个中文预设都满足两条硬性约束:

1. 注入给模型的第一句话是中文; 2. persona 中写入「语言铁律」,强制模型的全部思考过程与所有输出使用中文(仅代码、命令、标识符、URL、文件路径、日志原文等非自然语言内容可保留原样)。

包含的模式

目录(预设 id)显示名对应官方模式
standard-zh标准模式(中文)standard
code-zhPTC 模式(中文)code
minimal-zh极简模式(中文)minimal
cordis-zh创造模式(中文)cordis
router-standard-zh路由标准模式(中文,实验性)router-standard(自定义)

前四个预设基于官方预设完整复制而来,仅改动人设(persona)、计划模式提示词与注释,功能与官方版本一致。router-standard-zh 基于你自定义的 router-standard(任务感知路由)实验预设:保留 router 的机制与工具(dev_router_status / dev_router_mode / dev_mode_subagent),仅把注入给模型的所有自然语言(人设、模式 persona、路由指导、工具描述)中文化并加入「语言铁律」,压缩引擎同样使用中文版 dsh-zh-compaction

安装

方式一(推荐,任何部署都可靠):复制到用户预设目录

presets/ 下的目录复制到你的用户预设根目录。该目录默认是 ${DSH_HOME:-$HOME/.dsh}/.agent-presets/(Windows 下为 %DSH_HOME%\.agent-presets\,未设置 DSH_HOME 时为 %USERPROFILE%\.dsh\.agent-presets\)。

Windows PowerShell(在本仓库根目录执行):

$root = if ($env:DSH_HOME) { $env:DSH_HOME } else { Join-Path $env:USERPROFILE '.dsh' }
$dest = Join-Path $root '.agent-presets'
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Copy-Item -Recurse -Force .\presets\* $dest

macOS / Linux(在本仓库根目录执行):

mkdir -p "${DSH_HOME:-$HOME/.dsh}/.agent-presets"
cp -R presets/* "${DSH_HOME:-$HOME/.dsh}/.agent-presets/"

复制后,在 Web 界面的模式选择器(或新建会话时)即可看到四个「(中文)」模式。预设名单是即时重扫的,无需重启。

方式二:作为 DSH 组合包(bundle)安装

本仓库同时是一个 DSH 组合包(package.json 声明了 dsh.bundle),可安装进 profile:

# 从 GitHub 安装
dsh plugin --profile <name> add github:<你的用户名>/dsh-zh-output

# 或从本地 checkout 安装
dsh plugin --profile <name> add ./dsh-zh-output

> ⚠️ 注意:标准 web/headless CLI 在启动时会把 agent-presetsroots 强制改写为内置预设根,因此本组合包的预设登记在标准 CLI 下不生效。此方式主要用于自行组合 host 的部署(Python SDK 运行时、自定义 launcher 等)。普通用户请优先用方式一。

使用

1. 在 Web 界面选择「标准模式(中文)」「PTC 模式(中文)」「极简模式(中文)」或「创造模式(中文)」新建会话。 2. 想把中文预设设为默认:在设置里把 agent-presets.default 改为 standard-zh(或其他中文预设 id)。

中文上下文压缩引擎

DeepSeek Harness 的上下文压缩(/compact 或自动压缩)在生成检查点摘要时,摘要指令被官方硬编码为英文(Write concise English engineering prose)。这会导致:即使 persona 要求全程中文,压缩后模型收到的检查点摘要仍是英文,从而「中文约束」失效。

本仓库附带一个中文压缩引擎 dsh-zh-compactionlib/zh-compaction.js),它继承官方 @deepseek-ai/dsh-compaction-basic只覆盖 summarize 这一个钩子,把摘要指令换成中文;其余压缩行为(阈值、保留比例、token 计量、落盘等)与官方完全一致。standard-zhcode-zhcordis-zh 三个预设已用它替换官方压缩引擎(minimal-zh 极简模式不含压缩,无需处理)。

部署中文压缩引擎

插件需要 import 官方 @deepseek-ai/dsh-compaction-basic@deepseek-ai/dsh-llm。标准 CLI 部署下,preset 里的 bare specifier 是从 profiles 目录向上在 pnpm 的 hoisted 依赖目录(<DSH_HOME>\profiles\node_modules)解析的,所以中文压缩引擎必须放在那里,才能被 preset 找到、并解析到官方依赖。仓库根目录的 deploy.ps1 会自动完成这一步,并同步预设:

powershell -ExecutionPolicy Bypass -File .\deploy.ps1

脚本会:把 lib/zh-compaction.js 部署为 <DSH_HOME>\profiles\node_modules\dsh-zh-compaction\(并生成包描述),再把 presets\ 同步到你的用户预设目录。完成后重启 dsh web 生效。若之后执行过 pnpm install(会重建 hoisted 目录、清掉手动放入的包),重跑本脚本即可。

已知限制:checkpoint 前言默认仍为英文(可选补丁)

压缩生成的检查点消息由「前言(preamble)+ 摘要」两部分组成。摘要现在会用中文;但前言是 harness 在 dsh-compaction-basic 内部硬编码的一句英文元指令(This is an automatically generated checkpoint...),纯插件无法覆盖它。

本仓库附带一个可选补丁脚本 patch-preamble-zh.ps1,可把前言改成中文;官方升级 harness 后重跑脚本即可再次应用。完整说明见 [PATCHING.md](PATCHING.md)。

关于「创造模式(中文)」

官方 cordis 预设的 tool-cordis 会注册进程级单例的运行时检查器(Cordis inspect provider),同一进程只能存在一个实例。为避免与官方「创造模式」同时挂载时冲突,cordis-zh 默认禁用了 tool-cordis(见 presets/cordis-zh/agent.cordis.yml 中的注释)。

  • 效果:cordis-zh 保留组合创作指导技能(editing-cordis-compositionscordis-plugin-development),但没有在线运行时检查 / 插件实验工具。
  • 如果你从不使用官方「创造模式」,可删除 presets/cordis-zh/agent.cordis.ymltool-cordis 行里的 disabled: true 以启用它。

目录结构

dsh-zh-output/
├── package.json       # 声明 dsh.bundle(组合包标记)
├── cordis.patch.yml   # 组合包补丁层:登记中文预设根
├── presets/           # 中文预设
│   ├── standard-zh/
│   ├── code-zh/
│   ├── minimal-zh/
│   ├── cordis-zh/     # 含 skills/
│   └── router-standard-zh/  # 路由标准模式(中文,实验性,含 router 插件)
├── lib/
│   └── zh-compaction.js  # 中文上下文压缩引擎
├── deploy.ps1            # 一键部署脚本(部署压缩引擎 + 同步预设)
├── patch-preamble-zh.ps1 # 可选:把压缩「前言」补丁成中文(可重复应用)
├── PATCHING.md           # 前言中文化的可重复补丁方法
├── README.md
├── PUBLISHING.md      # 发布到 GitHub 的步骤
└── LICENSE            # MIT

许可

MIT