dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH plugin for switching conversation language between Chinese and English
DSH 插件:对话语言切换器
允许在中文和英文之间切换对话语言。切换后 AI 将使用对应语言进行思考和回复。
cordis.patch.yml)⚠️ 安装完成后必须重启 DeepSeek Harness,插件才能生效。
# 先 cd 到插件目录
cd /path/to/dsh-conversation-language
dsh plugin --profile web add .
git clone https://github.com/Dingpenghui-good/dsh-conversation-language.git ~/.dsh/plugins/dsh-conversation-language
# Windows: git clone https://github.com/Dingpenghui-good/dsh-conversation-language.git %USERPROFILE%\.dsh\plugins\dsh-conversation-language
~/.dsh/profiles/web/package.json:{
"dependencies": {
"@dingpenghui/dsh-conversation-language": "link:C:/Users/<你的用户名>/.dsh/plugins/dsh-conversation-language"
},
"dsh": {
"profile": {
"bundles": [
// ... 其他 bundles
"@dingpenghui/dsh-conversation-language"
]
}
}
}
cd ~/.dsh/profiles/web
pnpm install
重启 DSH 后,打开 插件 → @dingpenghui/dsh-conversation-language,在详情页的语言选择表单中切换并保存。
编辑当前 profile 的 cordis.patch.yml(Windows:%USERPROFILE%\.dsh\profiles\web\cordis.patch.yml):
- id: tool-conversation-language
config:
conversationLanguage: en # 或 zh
然后重启 DSH。
2.0.0 起设置不再写入
~/.dsh/settings.yaml:新架构中每个插件 entry 的Configschema 由 settings 框架投影,写入目标是当前 profile 的 Cordis patch。
切换语言后,AI 将自动以对应语言进行思考和回复,并让所有面向用户可见的文本保持同一语言——
包括工具调用的参数值(pwsh/bash 卡片上显示的 description、todo_write 的 content、
subagent 的 description、任务与作业名称等)。也可通过 get_conversation_language Tool
查询当前设置。
| 项目 | 值 |
|---|---|
| Settings Namespace | tool-conversation-language(= profile entry id) |
| Schema | { conversationLanguage: 'zh' | 'en' }(volatile,默认 zh) |
| 默认值 | zh (中文) |
| Persona Override | system-prompt/assemble waterfall 拦截,按语言在 persona section 追加指令 |
| Tool 注册 | get_conversation_language — 查询当前语言设置 |
src/index.ts):声明 Config schema(z.union(['zh','en']).volatile().default('zh')),
settings 框架按 entry id 自动注册命名空间;system-prompt/assemble 拦截器在每次组装时
通过 ctx.settings.describe() 读取实时值,语言切换无需重启。apply 注入
['systemPrompt', 'tools']——settings 服务缺失时回退默认 zh。src/client/):
configForms.whileServed([NS], …) 守卫注册
plugins.bundle.config(key = 包名)与 plugins.row.config(key = <包名>#<row-id>)
两个 slot,渲染 PluginDetailPage(摘要行 / 语言表单 + 保存 / 恢复默认)。
表单走 SettingsFormModel(staged form)+ SettingsForm,
在 0.1.7 表面下这两个 slot 名不存在时 slots.inject 静默 no-op,不抛异常。settings.general.item),语言设置仅在插件详情页提供,
避免同一功能在两个入口重复出现。src/shared.ts,保证客户端 bundle 不 value-import
任何宿主侧包(客户端 bundle purity gate)。dsh-conversation-language/
├── src/
│ ├── index.ts # Host 层:Config schema + persona 拦截 + tool
│ ├── shared.ts # 共享常量(namespace / 语言类型)
│ ├── client/
│ │ ├── index.ts # Client 层:UI 注册(configForms + slots)
│ │ ├── PluginDetailPage.tsx # React 组件(详情页:表单 + 保存/恢复)
│ │ ├── PluginDetailPage.module.css
│ │ └── plugin-detail-controller.ts # 详情页 staged-form 控制器(SettingsFormModel 桥接)
│ └── locales/
│ └── index.ts # 国际化字典(zh / en)
├── lib/ # 构建产物(tsdown 生成,安装时必须存在)
├── cordis.patch.yml # Cordis bundle patch(entry id = settings namespace)
├── build-and-verify.mjs # 一键构建 + 全量验证流水线
├── runtime-verify.mjs # 宿主侧运行时回归
├── client-verify-0.1.7.mjs # 0.1.7-alpha.2 回归验证
├── contract-test.mjs # 0.2.0-rc.1 客户端契约模拟验证
├── package.json
└── README.md
| DSH 版本 | 插件版本 | 说明 |
|---|---|---|
| 0.1.2-rc.1 | ≤ 1.4.0 | 旧的单一 deployment:persona section(PERSONA_SECTION) |
| 0.1.5-rc.1 | ≥ 1.5.0 | persona 拆分为 prefix/suffix;宿主侧 settings 采用旧的 settings.register() 命名空间模式 |
| 0.1.7-alpha.2+ | ≥ 2.0.0 | settings 框架重构为 plugin entry Config schema + describe()/update()/mutate();客户端 settingsScope 服务移除,改用 configForms |
| 0.2.0-rc.1 | ≥ 3.1.0 | 宿主侧改用 settings service(describe() + mutate());客户端注册 plugins.bundle.config / plugins.row.config slot 实现详情页;SettingsFormModel(staged form)+ SettingsForm 渲染保存/恢复默认;0.1.7 表面下 slot 降级静默 no-op |
| 0.2.0-rc.1 | ≥ 3.2.0 | 移除通用设置行(settings.general.item),语言设置仅在插件详情页提供(唯一入口) |
cd dsh-conversation-language
pnpm install
pnpm run build # 构建产物到 lib/;安装前必须执行此步
升级 DSH 大版本后,可对当前 node_modules 中的 @deepseek-ai/* 版本做回归:
node runtime-verify.mjs # 宿主侧:tool 注册/执行、system-prompt/assemble 拦截
node client-verify-0.1.7.mjs # 0.1.7 回归:CJS 包装 / purity gate / slot 降级
node contract-test.mjs # 0.2.0-rc.1 契约:apply(ctx) 注册行 + whileServed 详情页 + 词典 + 写回
node build-and-verify.mjs # 一键流水线:tsdown build + tsc + 上述全部验证
⚠️ 必须执行构建,插件运行时依赖
lib/下的构建产物,不能直接使用源码。请使用 pnpm 安装依赖:
@deepseek-ai/dsh-*@0.1.7-alpha.2等预发布版本在 npm 注册表中 处于「已发布但不可被 npm 解析」状态,npm install会以ETARGET失败;pnpm 可以正常 解析并安装这些版本。
MIT