@dsh-voice/bundle
dsh-voice — voice notes in, spoken answers out: dictate audio that becomes user messages (transcribe), have the agent read replies aloud (speak), and leave walk-away narration on long headless runs. Local-first, plain audio files under ~/.dsh/voice/
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Jesse-njx/dsh-voice说明文档
阅读完整 README ↗dsh-voice
语音输入,语音输出。 口述音频变成用户消息,让智能体把回复读出来。DSH 的免手终端。
dsh-voice 是一个 DeepSeek Harness 插件包(bundle)。两个工具、一个持久化事件、一个开关:
transcribe({ source })—— 语音转文字。传{ file }(已有音频文件)或{ record }(用麦克风录几秒)。转写结果会成为用户消息(而不是工具输出),聊天里会渲染一张紧凑的音频卡片:播放/暂停、时长、后端徽标和转写文字。speak({ text, voice?, rate? })—— 后台任务上的文字转语音。工具立刻返回{ jobId, audioRef },绝不阻塞回合;播放异步进行,失败以注入通知呈现。speak同时充当长任务旁白("构建完成,0 失败")。readReplies+/voice—— 会话级开关,自动朗读智能体的回复。默认关闭;用/voice on实时开启。
设计核心是本地优先:音频就是 ~/.dsh/voice/ 下的普通文件(可检查、可 rm),除非你显式配置云端后端,否则数据不出本机;任何音频行为都不会自动运行——必须由模型调用工具。
为什么这样设计
终端智能体有两个日常痛点:你不在键盘前想留下指令(口述),以及任务中途不想读一屏输出(旁白)。dsh-voice 只是 DSH 已有能力(ctx.shell、ctx.jobs、ctx.settings、ctx.attachments、ctx.conversationEvents)之上的薄层,不自己持有音频管线。音频是普通文件,会话日志只保存引用 + 转写文本(attachment/image-ref 模式),回放时不重读音频即可还原音频卡片。
安装
dsh plugin --profile web add @dsh-voice/bundle
安装后会注册 dsh-voice 条目(工具、/voice 命令、网页音频卡片)。在模型调用工具之前,一切都不会运行。
配置
所有字段都可选(profile patch 或 cordis.patch.yml):
plugins:
dsh-voice:
stt:
backend: whisper-local | openai | macos | fake # 缺省 = 自动(whisper-local → macos)
model: whisper-1 # STT 模型
whisperLocal: { bin: whisper-cli, model: tiny } # whisper.cpp 二进制与模型
openai: { baseUrl: https://api.openai.com/v1, apiKeyEnv: OPENAI_API_KEY }
tts:
backend: say | piper | edge-tts | fake # 缺省 = 自动(say → piper)
voice: Samantha # 默认音色
rate: 180 # say 语速(词/分钟)
piper: { bin: piper, model: /path/to/model.onnx }
edgeTts: { voice: en-US-GuyNeural }
readReplies: false # 开启后朗读回复
audioDir: ~/.dsh/voice # 音频文件目录
默认值:stt.backend 自动选择离线后端(whisper-local → macos)、tts.backend: say、readReplies: false、audioDir: ~/.dsh/voice。云端后端永远不会被自动选择——只有显式配置 / 才会启用。 后端通过标准凭据通道读取密钥(,与 polyglot preset 相同的约定),并回退到启动环境变量。