zz-zhi54/dsh-plugins--packages-system-notification ↗★ 2
dsh-system-notification-plugin
Native macOS and Windows notifications for DSH task and approval events 适合需要在后台运行任务时,接收macOS或Windows原生系统弹窗提醒的用户。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zz-zhi54/dsh-plugins#4df357a644c30e43cca3b0911780ee7f24ddfd7c&path:packages/system-notificationドキュメント
README 全文を読む ↗dsh-system-notification-plugin
项目选择、统一安装入口和仓库结构见根目录 README。
非官方社区插件。
为 DSH Host 提供轻量级 macOS / Windows 系统通知。插件只旁路监听事件,不接管或修改 Agent 或审批流程。
运行时依赖
本插件通过 DSH Host 传入的 Cordis Context 注册事件监听,不在插件内复制 Context.on 实现。为明确运行时契约,package.json 声明以下 Host 侧 peerDependencies,由 DSH Profile 提供:
@deepseek-ai/cordis:提供Context.on/ctx.on事件 API。@deepseek-ai/dsh-session:提供session/event事件契约。
具体兼容约束集中维护在本项目的 package.json 中;这些依赖不会被插件重复安装或打包,插件自身没有额外的运行时 npm dependencies。Context.on 的具体实现可参考 DeepSeek Harness 源码仓库。
安装
直接从 GitHub 安装当前分支:
dsh plugin --profile web add 'github:zz-zhi54/dsh-plugins#path:packages/system-notification'
固定 release 时,将路径替换为 #v&path:packages/system-notification。
监听行为
- 监听
session/event:turn/end原因为completed时通知“任务执行完成”;这是按轮次通知,不额外追踪 Agent 的连续运行或子 Agent。 - 识别持久化事件
approval/asked,通知“等待你的确认”;审批事件按 Session 的seq去重。 - 不监听旧的
approval/request,也不向审批链注册 answerer。 - 通知失败只记录 warning,不影响 Agent 循环或已提交的 Session 事件。
平台实现
- macOS:调用系统自带的
osascript,发送 AppleScriptdisplay notification;该接口不支持指定自定义通知图标。 - Windows:调用系统自带的
powershell.exe和 .NETSystem.Windows.Forms.NotifyIcon气泡通知,并使用assets/dsh.ico作为 DSH 图标,不需要安装第三方 PowerShell 模块或运行时库。 - 其他平台:插件仍可加载,但不发送通知。
验证
检查最终 Profile:
dsh --profile web --dump-config
运行语法检查和单元测试:
pnpm --filter dsh-system-notification-plugin run check
pnpm --filter dsh-system-notification-plugin run test
手动测试:
- 在 Web Profile 中触发普通任务,等待
turn/end原因为completed,确认收到“任务执行完成”。 - 再触发需要审批的操作,确认收到“等待你的确认”。
卸载单独安装的插件:
dsh plugin --profile web remove dsh-system-notification-plugin