waterc07/dsh-thinking-zh ↗★ 0

dsh-thinking-zh

把 DeepSeek Harness 对话里折叠状态的英文思考预览自动翻译成中文(宿主侧同源代理 + 持久缓存 + 浏览器侧 DOM 就地替换)。

包名
dsh-thinking-zh
兼容性
待验证
版本
0.1.0
许可证
MIT
最近更新
2026年10月28日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:waterc07/dsh-thinking-zh

使用与配置

默认开箱即用,不需要任何配置。插件没有独立 UI,配置通过 Web 同源上的 HTTP 路由完成(DevTools Console、Invoke-RestMethod、curl 均可)。端口就是当前 DSH Web 界面的端口:桌面端是启动时随机分配的 loopback 端口,用 dsh web --port 启动时则是你指定的端口。

查看当前状态:

$port = 5599   # 换成你的 DSH Web 端口;桌面端可在界面地址栏看到
Invoke-RestMethod "http://127.0.0.1:$port/api/dsh-thinking-zh/state"

修改配置:

$body = @{ enabled = $true; targetLanguage = "zh-Hans"; provider = "bing" } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:$port/api/dsh-thinking-zh/set" `
  -ContentType "application/json" -Body $body

可写字段(都是可选的,省略则保持原值):

字段类型说明
enabledbooleanfalse 时停止翻译,并把页面上已翻译的预览恢复成英文
targetLanguagestring目标语言,默认 zh-Hans;可用 zh-Hant 等,见上文归一化规则
provider"bing" / "google"翻译后端,默认 bing;其它值被忽略

配置持久化在 $DSH_HOME/dsh-thinking-zh/state.json。浏览器半每 20 秒轮询一次状态,因此通过 /set 修改后最长约 20 秒生效。

页面内调试接口(浏览器 Console):

window.__dshThinkingZh.status()   // enabled / targetLanguage / 本轮统计
window.__dshThinkingZh.rows()     // 每个思考行的判定结果与跳过原因
window.__dshThinkingZh.events()   // 最近 120 条内部事件
await window.__dshThinkingZh.diag('manual')  // 把 DOM 快照写入 diag 目录