Bundle
dsh-plugin-sound-alert
DSH Web 轻量提示音插件:回答完成 / 需要授权时响铃提醒,提示音可替换为用户自己的 WAV 文件(纯客户端,零资源文件)
- Source
- WanchunLian
- License
- MIT
- Updated
- Updated 4 days ago
Readme
# dsh-plugin-sound-alert
DSH Web 轻量提示音插件(纯客户端 · 零资源文件 · 小而美):
- 回答完成时响铃(叮-咚 上行双音 / 可自定义 WAV)
- 需要授权 / 计划审阅 / 向你提问时响铃(三连提示音 / 可自定义 WAV)
- 设置入口:**设置 → 提示音**(Settings → Sound Alerts)
- 自定义铃声直接选本机 **.wav** 文件即可,Data URL 持久化在本机浏览器,不上传
> 提醒:本插件为第三方开发,安装前请审阅源码。
## 安装(本地 link,方式与 dsh-plugin-polish-my-expression 相同)
```bash
# 1) 在 web profile 中加入依赖(link 到本项目)
# 等价于在 C:\Users\wanch\.dsh\profiles\web 下执行:
# pnpm add "link:D:/mycode/dsh/dsh-plugin-sound-alert"
#
# 并把 "dsh-plugin-sound-alert" 追加进 package.json 的
# dsh.profile.bundles 列表(顺序放在最后一个 bundle 后即可)。
# 若用 dsh 命令:
# dsh plugin --profile web add "link:D:/mycode/dsh/dsh-plugin-sound-alert"
# 2) 重新安装/组合 bundle
# dsh plugin --profile web install
# 3) 重启 web profile 使新 bundle 层生效
# (在运行 GUI 的终端里 Ctrl-C 后重新 dsh web,或按你的启动方式重启)
```
对 GitHub 发布版使用者:
```bash
dsh plugin --profile web add github:WanchunLian/dsh-plugin-sound-alert
```
## 使用
1. 打开 **设置(齿轮)→ 提示音**。
2. 勾选 **启用声音提醒**。
3. 完成音 / 授权音各自选择:
- **内置铃声**:无需任何文件,WebAudio 合成;
- **自定义 WAV**:点“选择 WAV…”挑一个本机 `.wav`(建议简短、≤3MB),
出现后可 **试听** / **移除**。
4. 可选:**提醒范围**(仅当前会话 / 所有会话)、**音量**。
## 行为说明
| 场景 | 铃声 |
| --- | --- |
| 会话 busy 态结束(回答/处理完成) | 完成音 |
| 后台会话出现“已完成”提醒(范围=所有会话) | 完成音 |
| 授权请求 / 计划审阅 / 向你提问(pendingInteraction 出现) | 授权音 |
| 完成帧与等待授权同时出现 | 只响授权音(不重复打扰) |
- 默认 **仅当前会话**,避免子会话/后台任务频繁打扰;需要后台完成提醒时切“所有会话”。
- 内置防抖(完成 1.6s / 授权 0.5s),避免一帧多个事件重复响。
- 浏览器自动播放策略:页面有过任意一次点击/按键后即可发声;若从未交互,声音会被浏览器静默拦截(首次试听请先点一下页面)。
## 数据与隐私
- 配置与自定义 WAV 仅存于本机浏览器 `localStorage`(键 `dsh-plugin-sound-alert:cfg`),
不上传、不写入会话;换浏览器/设备后需重新设置。
- 插件纯浏览器实现,不注册任何后端路由、不调用 LLM。
## 目录结构
```
lib/index.js 宿主半边(cordis 空壳,插件为纯客户端)
lib/client.js 浏览器半边:状态监听 + 声音引擎 + 设置页
cordis.yml bundle patch(web profile loader 入口)
docs/design.md 设计取舍说明
```
## License
MIT
Install
dsh plugin --profile web add github:WanchunLian/dsh-plugin-sound-alert
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-plugin-sound-alert from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.