Back to home@Cmjingahaha

dsh-dudulu

嘟一声 · DSH 任务完成提示音插件:Agent 回合完成时播放提示音,带设置面板(音量/试听/上传)

Stars
0
Language
JavaScript
Created
Aug 27, 2026
Updated
Aug 27, 2026
GitHub repo

Introduction

dudulu(嘟一声)· DSH 任务完成提示音插件

Agent 回合完成(turn/end, reason.kind === 'completed')时播放【嘟嘟噜~】提示音。失败 / 中断 / 等待审批 / token 超限 不响,子代理不响。

带设置面板:启用开关、音量滑条(拖动即试听)、提示音路径、文件上传。

安装

dsh plugin --profile web add npm:dsh-dudulu

或手动挂载:

# 1. 克隆到 ~/.dsh/plugins-local/
git clone https://github.com/Cmjingahaha/dsh-dudulu.git ~/.dsh/plugins-local/dsh-dudulu

# 2. 软链到 profile
ln -sfn ~/.dsh/plugins-local/dsh-dudulu ~/.dsh/profiles/web/node_modules/dsh-dudulu

# 3. 加入 profile 的 bundles
# 编辑 ~/.dsh/profiles/web/package.json:
#   "dependencies": { "dsh-dudulu": "file:../../plugins-local/dsh-dudulu" }
#   "dsh.profile.bundles": [ ..., "dsh-dudulu" ]

# 4. 重启
systemctl --user restart dsh-web.service

配置

重启后在 DSH 设置侧边栏打开「dudulu · 嘟一声」面板:

设置项说明默认值
启用总开关true
音量0–100,拖动滑条实时试听100
提示音路径自定义音频文件绝对路径~/dudulu01.wav
上传选本地音频文件,自动转码 48kHz WAV 并切为当前提示音

配置持久化在 settings 文档中,重启不丢。

播放链

pw-play(PipeWire 原生)→ ffplaypaplaympv,依次降级。

触发与判定

怎样触发何时不触发
Host 事件 session/eventevent.type === 'turn/end'event.data.reason.kind === 'completed'失败 (error)、被打断 (aborted)、阻塞 (blocked)、token 超限 (max-tokens)、中断 (interrupted)
仅顶层会话(session.header.origin !== 'subagent'delegationDepth === 0子代理 / workflow 子会话
去抖 1200ms连续完成

文件结构

index.js           # Host 半片:设置注册、事件订阅、播放、路由
client/client.js   # Client 半片:设置面板 UI(settings.section 槽)
cordis.patch.yml   # 组合补丁:插入 host 行
package.json       # 含 dsh.bundle + dsh.client 声明

许可

MIT