zjzqs/dsh-client-ui-voice-input ↗★ 1
dsh-client-ui-voice-input
Voice input for the dsh web GUI: a mic button in the composer tool row that transcribes speech into the draft via the browser Web Speech API (zh-CN by default).
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-client-ui-voice-input
English | 中文

语音输入 + 提示词优化插件 for DeepSeek Harness 的 Web GUI(dsh web)。
输入框工具行右侧(发送按钮左边)有两个按钮:
- 🎤 语音输入:点击开始连续监听(不会因停顿自动断掉),识别文字实时
写入草稿箱(最终+中间结果原地替换,不叠加不重复),意外中断自动恢复;
再点一下结束。识别用浏览器 Web Speech API(
SpeechRecognition),纯前端。 - ✨ 优化提示词:把当前草稿发给宿主端
POST /dsh-voice-input/optimize端点,由 harness 自己的 LLM 服务(ctx.llm,provider/model 取agentDefaultModel的当前默认值,即 DeepSeek,已关闭推理)重写为更 清晰、具体的提示词,成功后替换草稿;若优化期间草稿被修改则不覆盖。优化 成功后 ✨ 按钮变为撤回图标(↶),点击恢复优化前的草稿,撤回入口 常驻直到被使用或草稿变化。优化中/成功/失败有状态提示条。
- 默认识别语言:
zh-CN(普通话),修改lib/client.js顶部的RECOGNITION_LANG常量后重新部署 - 识别走 Chromium 内置的 Web Speech 云端识别,需要联网
- 支持浏览器:Chrome / Edge;Firefox 不支持(按钮置灰并提示)
工作原理
- 包声明
dsh.client: { platform: "web" };浏览器端 bundle 在lib/client.js(window.__ModuleLoader__.load({ id, factory })工厂格式, 与官方dsh-client-ui-*包一致) apply(ctx)把组件注册进conversation.input.right插槽;locale命名空间voice.input提供中/英文案- 宿主端
lib/index.js注入webServer/llm/agentDefaultModel服务, 注册/dsh-voice-input/optimize精确路由:读请求体 →ctx.llm.stream(system 提示词限定"只返回优化后的提示词",reasoningEffort: "off", 30s 超时,4096 token 上限)→ 返回{ text };所有错误路径返回 JSON 错误 - 依赖:宿主端需要
@deepseek-ai/dsh-llm(npm 安装插件时会自动带上)
安装到另一台电脑(从 GitHub)
前提:该电脑已能运行 dsh web,浏览器为 Chrome / Edge。
# ① 下载插件源码(或 GitHub 页面 Code → Download ZIP)
git clone https://github.com/zjzqs/dsh-client-ui-voice-input.git D:\dsh-voice-input
# ② web profile 目录
$profile = "$env:USERPROFILE\.dsh\profiles\web"
# ③ 源码放入 profile 树内(必须放 profile 目录下:宿主端 import 依赖时
# 从自身真实路径向上找 node_modules,放 profile 树内才能解析到)
Copy-Item -Recurse -Force "D:\dsh-voice-input" "$profile\voice-input-src"
# ④ 在 $profile\package.json 的 "dependencies" 里加一行:
# "dsh-client-ui-voice-input": "file:./voice-input-src"
# 然后安装(npm 会自动装插件的依赖 @deepseek-ai/dsh-llm 并建好链接):
& npm.cmd install --no-audit --no-fund --prefix $profile