Yihong89/dsh-voice-core

Plugin插件 Native原生 ⭐ 2 Vision & Media视觉与多媒体

语音引擎,使用Qwen TTS模型

Project Overview项目介绍

This is a core shared voice library built exclusively for DeepSeek Harness (DSH). It is not a standalone plugin, but rather a shared dependency that powers the two DSH plugins dsh-teacher and dsh-companion. To install it via the DSH CLI, users can run the command dsh plugin --profile web add github:Yihong89/dsh-voice-core, then add an entry for it in their profile’s cordis.patch.yml to register the library’s events. The library splits functionality into a host side and a client side, with the host handling routing to a local Qwen3-TTS service that runs on the user’s own machine. The default port for the local TTS service is 3091, which can be overridden via the DSH_VOICE_TTS_URL environment variable.

The host side of the library provides multiple key features for voice functionality in DSH. It exposes the applyVoice(ctx, config) method that consuming plugins call in their own apply() setup. It adds speak and cheer model tools, registers /speak, /cheer, /voice and other slash commands, and manages session projection for voice events. It also includes a daily greeting scheduler that can trigger the agent to generate a welcome message plus a daily fun fact or news item to read aloud, or read a fixed configured message if that is preferred by the user. Users can configure multiple voice styles and set a default style via the library’s config.

The client side of the library handles the actual audio playback and user-facing behavior, but it does not include any built-in UI like icons or buttons. All configuration and selection interfaces are handled by the consuming plugins that depend on this core library. It automatically queues audio files for sequential playback, so audio clips never overlap, and it automatically reads aloud every assistant response after a 1-second delay to let text render first. It stores a persistent cursor in the user’s localStorage per session, so switching sessions or refreshing the page will not re-read old messages. The library is released under the open source MIT license, and includes 49 unit tests to validate core functionality.

这是专为DeepSeek Harness(DSH)开发的共享语音核心库,并非独立可用的插件,主要为DSH生态中的dsh-teacher和dsh-companion两个插件提供公共语音底层能力。它对接本地运行的Qwen3-TTS服务,默认转发请求到127.0.0.1:3091,也可通过环境变量DSH_VOICE_TTS_URL覆盖地址,提供语音播报、指令调度等基础能力。

它分为Host端和Client端两部分,Host端负责路由转发、命令注册和会话管理,支持配置多种不同音色,还可开启每日问候调度,到点自动让Agent生成欢迎语加每日趣闻朗读,也可配置固定文案。Client端不自带UI,只提供音频队列播放、自动朗读、会话持久化等底层行为,配置界面交给消费插件实现。

安装时可通过DSH CLI执行dsh plugin --profile web add github:Yihong89/dsh-voice-core完成,之后需要在profile的cordis.patch.yml中注册该库的事件。由于pnpm 11默认开启blockExoticSubdeps,若遇到依赖报错,需要在pnpm-workspace.yaml中手动关闭该配置项。项目采用MIT许可证,包含49个单元测试可验证功能正确性。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:Yihong89/dsh-voice-core

把 Yihong89/dsh-voice-core 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-voice-core

共享语音引擎(Shared Voice Engine)—— dsh-teacher 与 dsh-companion 的公共底层。

一个 library,不是独立插件:消费插件(dsh-teacher / dsh-companion)在自己的 apply() 里调用 applyVoice(ctx, config)(host 侧),client 侧通过 createVoiceClient(opts) 组合共享 UI。语音由 mac mini 上的 Qwen3-TTS (VoiceDesign,MPS 加速)生成,浏览器播放——声音从使用者自己的机器出来。

提供的能力

Host(applyVoice(ctx, config))

  • Qwen3-TTS 代理路由:{ttsPath}(如 /dsh-teacher/tts)+ -health,转发到 本地 TTS 服务(127.0.0.1:3091,可用 DSH_VOICE_TTS_URL 覆盖)
  • speak / cheer 模型工具(log-only voice/* 事件)
  • /speak /cheer /cheer-at /cheer-text /voice 命令
  • voiceSpeak 会话投影(fold voice/speak / voice/spoken / voice/cheer)
  • 每日问候调度器:到点 agent.followup 让 Agent 自己生成"欢迎 + 趣闻/新闻" (或配置固定文案直接朗读);schedulerEnabled 控制开关
  • 音色配置驱动:config.styles(音色目录)+ config.defaultStyle

Client(createVoiceClient(opts))

  • 无内置 UI(不渲染任何图标/按钮)——只提供底层行为:自动朗读、音频播放、 💛 cheer 卡片,配置/选择界面完全交给消费插件自己实现
  • 音频队列播放(fetch WAV → <audio>,顺序播放不重叠)
  • 自动朗读每条 assistant 回复(1s 先显示文字),带按会话持久化的 localStorage cursor —— 切换会话/刷新页面不会重复朗读旧消息
  • preset 门控:只在该消费插件的 agent preset 会话里生效
  • opts.resolveInstruct(sessionId) 可选:按会话动态决定 TTS instruct(优先于 defaultStyle 的静态值),供需要"每个会话自己的音色"的消费者使用

配置示例

// dsh-teacher 的 apply()
import { applyVoice } from 'dsh-voice-core'

await applyVoice(ctx, {
  presetName: 'teacher',
  ttsPath: '/dsh-teacher/tts',
  styles: { onee: { label: '🎧 清冷御姐', instruct: '清冷柔和的成年女声…' } },
  defaultStyle: 'onee',
  schedulerEnabled: false,
})
// client 侧
import { createVoiceClient } from 'dsh-voice-core'

var voiceClient = createVoiceClient({
  presetName: 'teacher',
  ttsPath: '/dsh-teacher/tts',
  styles: { onee: { label: '🎧 清冷御姐', instruct: '…' } },
  defaultStyle: 'onee',
})
// 在 apply 里:voiceClient.apply(ctx)

安装

dsh plugin --profile web add github:Yihong89/dsh-voice-core

profile 的 cordis.patch.yml 注册事件:

- insert:
    - id: dsh-voice-registrar
      name: dsh-voice-core/register-events

pnpm 11 默认 blockExoticSubdeps: true,而 dsh-teacher/dsh-companion 把 dsh-voice-core 作为 git 子依赖。若报 ERR_PNPM_EXOTIC_SUBDEP,在 profile 的 pnpm-workspace.yaml 加 blockExoticSubdeps: false。

测试

node --test test/*.test.js   # 49 tests

License

MIT

← 上一个 Prev dsh-locale-pack 下一个 Next dsh-win-fable-report →