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原生系统弹窗提醒的用户。

パッケージ
dsh-system-notification-plugin
互換性
未検証
Harness ピア範囲
0.2.0-rc.1
Cordis ピア範囲
4.0.4
バージョン
0.2.0-rc.1.1
ライセンス
Apache-2.0
最終更新
2026/09/29

インストール

$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,发送 AppleScript display notification;该接口不支持指定自定义通知图标。
  • Windows:调用系统自带的 powershell.exe 和 .NET System.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

手动测试:

  1. 在 Web Profile 中触发普通任务,等待 turn/end 原因为 completed,确认收到“任务执行完成”。
  2. 再触发需要审批的操作,确认收到“等待你的确认”。

卸载单独安装的插件:

dsh plugin --profile web remove dsh-system-notification-plugin