dsh-web-search-ddg
aooyoo
Zero-token DuckDuckGo search provider for the DeepSeek Harness (DSH) web seam — local headless browser, no API key, no m…
PROJECT TOPICS
PROJECT README
DeepSeek Harness(dsh)本地离线语音插件,基于 Sherpa-ONNX。
stt_transcribe)tts_speak)dsh-speech-sherpa/
├── index.mjs # host 插件(Cordis):注册 3 个工具 + HTTP 路由
├── remote.mjs # HTTP 路由(/speech-api/*,浏览器录音按钮直调)
├── http-body.mjs # HTTP 请求体读取
├── core/ # 平台无关核心(STT/TTS/模型管理/WAV 编解码)
│ ├── index.js # createSpeechService() 门面
│ ├── models.js # 模型管理(状态/下载/断点续传/镜像回退)
│ ├── stt.js # 语音识别(wav 文件 / data URL)
│ ├── tts.js # 语音合成(data URL / wav 文件)
│ └── wav.js # WAV 编解码 + 8kHz→16kHz 重采样
├── client/ # 浏览器端插件(录音按钮)
│ ├── index.ts # 源码(TSX)
│ └── dist/client.js # 构建产物(CJS factory bundle)
├── cordis.bundle.yml # dsh bundle patch(dsh plugin add 安装)
├── cordis.patch.yml # --patch 开发加载示例
└── scripts/
├── build-client.mjs # 构建 client bundle(esbuild)
└── verify-dsh.mjs # 插件契约验证(mock cordis ctx)
dsh plugin --profile <name> add /path/to/dsh-speech-sherpa
# 或从 git:dsh plugin --profile <name> add github:you/dsh-speech-sherpa
开发期用 --patch:
cd <deepseek-harness 仓库>
pnpm dsh --profile web --patch C:\Users\Administrator\Documents\dsh-speech-sherpa\cordis.patch.yml --port 3099
| 工具 | 输入 | 输出 |
|---|---|---|
stt_transcribe |
audioPath(wav 文件)或 audioBase64(data URL) |
{text} |
tts_speak |
text、speed?、sid?、inline? |
{audioPath, text, dataUrl?} |
sherpa_models_download |
kinds?(['stt','tts']) |
{results, modelDir} |
模型自愈:stt_transcribe/tts_speak 发现模型缺失会报错并提示调用 sherpa_models_download,agent 可自行下载。
config 字段)| 字段 | 默认值 | 说明 |
|---|---|---|
voiceRate |
1.0 |
语速 0.5~2.0 |
sid |
88 |
音色 88/90/92/94 |
modelDir |
$DSH_HOME/models/sherpa |
模型目录(DSH_HOME 默认 ~/.dsh) |
outputDir |
$DSH_HOME/audio/sherpa |
TTS 输出目录 |
聊天输入框工具行左侧的 🎤 按钮(conversation.input.left slot):
getUserMedia + MediaRecorder),按钮变红显示倒计时 120s → .../speech-api/sttTranscribeinputActions.setDraft + submit)重建 client bundle(改源码后):
node scripts/build-client.mjs # 产物 client/dist/client.js
| 模型 | 用途 | 体积 |
|---|---|---|
| streaming-zipformer-zh-int8-2025-06-30 | 中文语音识别 | 126MB |
| vits-icefall-zh-aishell3 | 中文语音合成 | 30MB |
下载后存放于 <modelDir>/stt、<modelDir>/tts。下载走国内镜像(ghfast.top → gh-proxy → GitHub)+ 断点续传。
npm install # sherpa-onnx-node(版本已精确锁定 1.13.4)
node scripts/verify-dsh.mjs # 插件契约验证(14 项)
node scripts/build-client.mjs # 重建 client bundle
tts_speak → stt_transcribe 闭环可用)dsh- 前缀(本包 dsh-speech-sherpa)dsh-plugin 话题便于被发现@deepseek-ai/* 时注意:@deepseek-ai/dsh-tools 的 npm latest tag 是过期线,用 next tag;本插件零 @deepseek-ai 运行时依赖(裸 JSON ToolDefinition)已避开CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。