DeepSeek Harness 插件

dsh-voice-wencharm

Voice input for DeepSeek Harness: a local Whisper speech-to-text service (ONNX) plus the browser mic button and the /voice/transcribe routes(英文原文)

跳到安装方式

来源信息

GitHub 仓库
wencharmwang/dsh-voice
最近更新
2026年8月18日
分类
工具与能力
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/wencharmwang/dsh-voice
插件名:dsh-voice-wencharm
作者:wencharmwang

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-voice

Voice input for DeepSeek Harness (dsh).

A single dual-face plugin that brings local, private speech-to-text to both the Web UI and the TUI:

  • Host half — a ctx.stt service backed by an ONNX Whisper model

(@huggingface/transformers + onnxruntime-node), plus the HTTP routes the browser mic button posts to.

  • Browser half — a microphone button in the composer (exports["./client"]).

No external binaries are required: the ONNX runtime ships as a prebuilt native addon per platform, and the model is a quantized Whisper ONNX downloaded from the Hugging Face Hub on first use. Microphone recording in the TUI still needs a system recorder (ffmpeg / sox / arecord); web voice records in the browser and needs nothing extra.

Install

dsh-voice is a bundle you add to a dsh profile. From npm:

dsh plugin --profile web add dsh-voice

Or straight from this repository (pnpm runs the prepare build on install):

dsh plugin --profile web add github:wencharmwang/dsh-voice

> pnpm ≥10 refuses to run a git dependency's prepare script until it is > allowlisted. If the first add fails, copy the printed package key into the > profile's pnpm-workspace.yaml under allowBuilds and re-run the add.

The bundle declares its own cordis.patch.yml, so dsh plugin add both installs the package and activates the voice row. For a manual profile you can declare the row yourself in ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: voice
      name: dsh-voice

Configuration

All fields are optional. Configure them either on the bundle row, or — once the voice row exists — by patching it by id in the profile's cordis.patch.yml:

- id: voice
  config:
    model: onnx-community/whisper-medium  # a Hugging Face Whisper ONNX id | a local dir
    language: auto                       # 'auto' | 'zh' | 'en' | ...
    dtype: q8                            # 'q8' | 'fp32' | 'q4'
    dir: ''                              # model cache + recordings dir; empty = ~/.dsh/voice

The effective model is resolved in two layers:

1. Schema defaultonnx-community/whisper-medium (q8, downloaded on first use). 2. cordis.patch.yml — the plugin's model config overrides the default per deployment.

Switching models downloads the new one on first use after the switch; the superseded pipeline is disposed once no transcription is using it.

Service API (ctx.stt)

interface SttService {
  /** Readiness + effective model id, without loading or downloading anything. */
  status(): { ready: boolean; preloading: boolean; model: string }
  /** Ensure the effective model is downloaded and loaded. */
  ensureModel(onProgress?: (done: number, total?: number) => void): Promise<string>
  /** Transcribe audio input to text. */
  transcribe(
    input: string | Buffer | Float32Array,
    options?: { language?: string; signal?: AbortSignal; format?: string },
  ): Promise<string>
  /** Record from the microphone to a WAV file (TUI only). */
  startRecording(): { readonly path: string; stop(): Promise<string>; cancel(): Promise<void> }
}

transcribe accepts a Float32Array (16 kHz mono), a Buffer of PCM/WAV bytes, or a path to a WAV file. Use format to hint the byte layout: pcm16 (default), f32, or wav.

HTTP routes (web)

RouteMethodDescription
/voice/transcribePOSTBuffer the uploaded audio and return the transcript as { "text": "…" }. Optional ?lang=<iso> pins the language.
/voice/statusGET{ "ready": true } when the model is loaded.

The browser mic button records, decodes to 16 kHz mono PCM in the browser, and POSTs it as audio/l16;rate=16000.

Models

idapprox. sizenotes
onnx-community/whisper-small~250 MBlighter option
onnx-community/whisper-medium~0.8 GBq8, the default
onnx-community/whisper-large-v3~1.6 GB

Models are cached under ~/.dsh/voice/models after the first download.

Developing

This plugin is a self-contained bundle — it builds independently with pnpm install && pnpm run build (no monorepo checkout required). The prepare script runs the same build on git/tarball installs. See [PUBLISHING.md](PUBLISHING.md) for how to publish it to the dsh-plugin community.

License

[MIT](LICENSE)