dsh Web Speech Input

August 14, 2026 · View on GitHub

DeepSeek Harness(dsh) Web 输入框增加语音输入能力的独立插件。它使用浏览器 Web Speech API,把最终识别文本写入普通草稿,不会自动发送消息。

当前版本默认识别中文(zh-CN),适合 Chrome、Edge 等支持 SpeechRecognitionwebkitSpeechRecognition 的浏览器。

录音中的波形状态胶囊

功能

  • 在 dsh 输入框右侧增加麦克风按钮。
  • 录音时显示动态波形胶囊和真实时长,例如 正在听 00:04
  • 再次点击录音胶囊即可停止。
  • 只写入最终识别结果;临时结果不会污染草稿。
  • 保留草稿编辑和原有发送流程,不自动提交。
  • 处理浏览器不支持、权限拒绝、未检测到语音和识别失败状态。
  • 支持深色主题令牌、键盘焦点和减少动态效果偏好。

安装

要求:

  • 已安装当前版本的 dsh CLI。
  • 已安装 pnpm(dsh plugin 使用 pnpm 管理 profile 插件)。
  • Node.js 22.18 或更高版本。

从 GitHub 安装到 Web profile:

dsh plugin --profile web add github:Richard-Yang0130/dsh-web-speech-input

插件包含 dsh.bundle 声明,安装后会自动把语音输入行加入 Web profile,无需手工编辑 cordis.patch.yml

启动:

dsh web

打开命令输出的本地网址(通常是 http://127.0.0.1:3080)。

使用

  1. 点击输入框右侧的麦克风按钮。
  2. 浏览器首次询问时允许麦克风权限。
  3. 看到粉红色动态波形和 正在听 00:00 后开始说话。
  4. 等待识别自然结束,或点击录音胶囊主动停止。
  5. 检查、编辑识别文本,再用原来的发送按钮提交。

卸载:

dsh plugin --profile web remove @local/dsh-web-speech-input

隐私与兼容性

插件本身不接入付费语音 API,也不保存音频。麦克风采集由浏览器完成,但部分浏览器会把音频发送给浏览器厂商的识别服务。因此它不是严格的离线转写方案,也不能保证音频只在设备上处理。

浏览器支持情况取决于 Web Speech API。Safari、Firefox 或受企业策略限制的浏览器可能不支持,或者表现与 Chrome/Edge 不同。若你需要断网可用和完全本地处理,应选择本地 Whisper 等方案。

常见问题

没有看到麦克风按钮

确认使用的是 Web profile,并重新启动 dsh web。可以检查插件是否已安装:

dsh plugin --profile web why @local/dsh-web-speech-input

麦克风权限被拒绝

在浏览器地址栏的网站权限中允许当前本地地址使用麦克风,然后刷新页面。

显示“未检测到语音输入”

确认系统输入设备正确、麦克风没有被其他应用独占,并在波形胶囊出现后再开始说话。

浏览器提示不支持

优先使用最新版 Chrome 或 Edge。该插件不会加载远程 polyfill,因为 polyfill 无法替代浏览器的语音识别服务。

本地安装与开发

从本地 checkout 安装:

git clone https://github.com/Richard-Yang0130/dsh-web-speech-input.git
cd dsh-web-speech-input
pnpm install
pnpm check
dsh plugin --profile web add .

开发命令:

pnpm test       # 单元与组件测试
pnpm typecheck  # TypeScript 检查
pnpm build      # 生成 lib/index.mjs 和内联 CSS 的 lib/client.js
pnpm check      # 依次运行以上全部检查

仓库提交了构建后的 lib/,因此通过 GitHub 安装时无需在用户机器上运行构建脚本。

设计边界

该插件只贡献 conversation.input.right 插槽控件。最终文本通过 dsh 原有 setDraft 动作进入普通草稿;插件没有发送消息的方法,也不修改会话持久化。

License

MIT


English

An out-of-tree Web client plugin for DeepSeek Harness. It adds a microphone control, shows an animated recording pill with elapsed time, and appends only final browser speech-recognition results to the editable composer draft.

Install and start:

dsh plugin --profile web add github:Richard-Yang0130/dsh-web-speech-input
dsh web

Click the microphone, grant permission, speak after the recording pill appears, then edit and send the resulting draft normally. The plugin does not call a paid speech API or submit messages automatically. Browser speech recognition may still use a remote browser-provider service and is not guaranteed to work offline.

Development:

pnpm install
pnpm check

Licensed under MIT.