DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

XA-anjiu /

XA-anjiu/dsh-notify-sfx

Verified

Windows toast notifications with selectable opencode sound packs for DeepSeek Harness; click a notification to open the matching session.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: master@69864698

dsh-notify-sfx

给 DeepSeek Harness 用的 Windows 桌面通知插件:一轮对话结束、需要你批准、需要你回答时,弹一条带 DSH 图标的 Windows 通知,同时播放 opencode 音效包里的提示音;点通知直接跳到对应会话。

音效包与通知行为参考 opencode 的开源实现(音效资源来自 opencode,MIT)。

功能

  • Windows 原生通知:ToastGeneric 版式,图标取自 DSH 应用本身;自动注册 AUMID 与开始菜单快捷方式,让 toast 能被点击激活。
  • opencode 音效包:内置 5 组共 45 个音效(alert / bip-bop / staplebops / nope / yup),每个事件单独选音效,选完立即试听。
  • 逐事件音效:对话完成 / 出错 / 等待批准 / 等待回答 / 其他通知,五个事件各自一个音效胶囊。
  • 导入自己的音效:支持 wav / mp3 / m4a / wma / aac / flac / ogg,导入后自动以文件名出现在每个事件的卡片里。
  • 点击跳转:点击通知 → 编译型启动器(bin/dshnotify.exe,无控制台窗口)通知宿主聚焦窗口并切到对应会话,全程约 0.3 秒。
  • 设置面板:设置 → 通知与音效(也挂在插件详情页与会话头部铃铛的右侧栏里),改动即时保存、无需重启。
  • 入口可关:主界面铃铛图标与设置页入口都能单独隐藏。

安装

dsh plugin add dsh-notify-sfx

或从源码安装:

cd <profile 目录>
pnpm add -w "file:<本仓库路径>"

装完重启桌面端。插件自带 cordis.patch.yml,会被自动挂载;如需自定义配置,在 profile 的 cordis.patch.yml 里追加:

- id: dsh-notify-sfx
  name: dsh-notify-sfx
  config:
    enabled: true
    sound:
      mode: file          # file | none

配置

日常修改请用图形界面(设置 → 通知与音效),界面里的选择保存在 profile 的 data/dsh-notify-sfx/settings.json,并覆盖 cordis.patch.yml 里的默认值。

配置项 说明 默认
enabled 总开关 true
clickTarget 点击行为:app 聚焦窗口并切会话、web 用浏览器打开会话、none 不跳转 app
lifetime 通知停留:short / long / persistent short
surface 通知形式:system 系统通知、inapp 应用内浮层、both system
visible.homeIcon 会话头部铃铛入口 true
visible.settingsSection 设置页「通知与音效」入口 true
sound.mode file 播放音效 / none 静音 file
sound.events 逐事件音效,取值如 pack:staplebops-01、file:<绝对路径>、none 见下
sound.pack 每个事件的默认音效 staplebops-01 / 03 / 02 / 05 / 01
sound.volume 播放音量 0–1(也可写进 data/dsh-notify-sfx/settings.json 的 volume,改完立即生效) 1
includeSubagents 子代理的通知是否也弹 false

默认事件音效:对话完成 staplebops-01、出错 staplebops-03、等待批准 staplebops-02、等待回答 staplebops-05、其他 staplebops-01。

音效包

音效包 名称 数量 风格
staplebops 便签轻敲 7 短促木质敲击,适合「完成」
bip-bop 哔啵电子 10 电子双音,适合「提问」
alert 清脆提醒 10 明亮提示音
nope 低沉否定 12 下行音,适合「出错」
yup 上扬应声 6 上行确认音

音效文件位于 assets/opencode/,来自 opencode 仓库的 packages/ui/src/assets/audio(MIT,见 NOTICE.md)。想加自己的音效,用面板里的「导入音效」,或把文件放进 assets/opencode/ 后重装。

工作原理

  1. lib/index.js 监听 session/event 的 turn/end、approval/asked、ask_user_question,按事件挑音效规格。
  2. lib/notify.ps1 手写 ToastGeneric 载荷(标题 = 状态,正文 = 会话名 + 详情两行),附加 <audio> 或静音,用 ToastNotificationManager 发出;同时负责 AUMID 注册与音效播放(WinRT MediaPlayer)。
  3. lib/install-shortcut.ps1 在开始菜单建一条带 AUMID 的快捷方式——非打包 Win32 程序的 toast 点击激活依赖它。
  4. 点击走 dshnotify:// 协议 → bin/dshnotify.exe(lib/launcher.cs 编译,lib/build-launcher.ps1 负责重建)→ POST /api/dsh-notify-sfx/settings 写入待聚焦会话,并聚焦 DSH 窗口;浏览器半区轮询到会话 id 后调用宿主的 uiWorkspace.openSession。
  5. lib/panel.js 提供设置桥(同源校验、仅本机),lib/client.js 负责设置面板、会话头部铃铛、右侧栏页面。

开发

node test/sound.test.mjs    # 音效规格解析
node test/panel.test.mjs    # 设置桥
node test/client.test.mjs   # 浏览器半区渲染
node tools/preview.mjs      # 逐个事件试听

改完 lib/ 后要同步到 profile 的 node_modules/dsh-notify-sfx(安装副本是真实目录,不是软链),再重启桌面端。

致谢

  • 通知与 AUMID 处理基于 SeverusZh/dsh-notify-windows(MIT)派生。
  • 音效资源与通知行为参考 opencode(MIT, Copyright (c) 2025 opencode)。

License

MIT,见 LICENSE 与 NOTICE.md。

—/ 5

No ratings yet

Verified DSH bundle

Commit 6986469888f2

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout