跳到正文

pitetow/dsh-notify-on-complete

40最近提交 2026年8月15日

dsh-notify-on-complete DSH 插件

当 DeepSeek Harness 任务运行完成时,或模型向你提问、等待审批时,该插件会发送系统桌面通知。通知内容指示结果类型(成功、失败、中止、达到 token 上限),支持配置声音和阻塞通知的开关。跨平台,零运行时依赖,使用原生 OS 命令通过 child_process.spawn 非阻塞发送。

如何安装 dsh-notify-on-complete DSH 插件

dsh plugin --profile web add link:/path/to/dsh-notify-on-complete

复制不会执行命令。安装 dsh-notify-on-complete DSH 插件前请核对仓库和版本。

dsh-notify-on-complete DSH 插件数据来源

dsh-notify-on-complete DSH 插件快照日期:2026年8月16日

discovered

dsh-notify-on-complete DSH 插件能做什么

  • 零运行时依赖,通知通过分离的子进程发送,不阻塞且不受 harness 退出影响。
  • 跨平台自动选择:macOS 使用 osascript,Linux 使用 notify-send/kdialog,Windows 使用 PowerShell。
  • 支持系统提示音并可关闭:macOS Glass 声音、Windows .NET SystemSounds、Linux canberra-gtk-play(回退 paplay),通过 sound: false 禁用。
  • 会话中阻塞即时通知:模型提问(ask_user_question)和沙箱提权/工具权限审批时触发。
  • 只通知顶层运行,过滤子代理,一次 CLI 运行只产生一条通知。
  • 通过 cordis.patch.yml 配置:enabled、title、sound、onBlocked、onQuestion、onApproval。

dsh-notify-on-complete DSH 插件适合哪些场景

  • 运行长时间 DSH 任务后立即收到完成通知,无需一直盯着终端。
  • 在 headless 模式下运行任务,通过桌面通知即时获知结果。
  • 监控模型需要人工介入的提问或权限审批,避免错过关键交互。
  • 开发 DSH 插件时,利用通知了解运行状态,提高效率。

dsh-notify-on-complete DSH 插件适合谁

  • 希望在终端不活跃时仍能收到运行完成或模型交互通知的 DSH 用户。
  • 运行自动化评估或交互式会话的开发者,需要多任务处理而不错过重要事件。

dsh-notify-on-complete DSH 插件的限制

  • 需要 Node.js ^22 和已安装的 DSH CLI,不能独立使用。
  • 早期会话事件的通知标题可能缺少会话标题,因为标题是异步生成的。
  • macOS 上需要授予终端应用通知权限(系统设置 → 通知)。
  • 仅通知顶层运行,不通知子代理会话。
  • 配置阻塞通知(onQuestion、onApproval)时整行覆盖,需指定完整配置而非深度合并。

dsh-notify-on-complete DSH 插件的仓库 README 摘录

以下文字摘自 dsh-notify-on-complete DSH 插件的上游仓库 pitetow/dsh-notify-on-complete 的 README,版权归原作者,仅作引用。

Send desktop notifications from [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`): get a system notification when a run finishes, and an immediate one when the model asks you a question (`ask_user_question`) or waits for approval (sandbox escalation / tool permission). The body reflects the result (completed / error / aborted / max-tokens). DeepSeek Harness(`dsh`)桌面通知插件:运行结束时向系统发送桌面通知;会话进行中模型提问(`ask_user_question`)或等待审批(沙箱提权 / 工具权限)时也会即时提醒你回来处理。正文按结果区分(成功 / 失败 / 中止 / 达到 token 上限)。 > Author: [Luozy](https://github.com/pitetow) · License: [MIT](LICENSE) · 中文文档:[README.zh.md](README.zh.md) - **Zero runtime dependencies**: no `dsh` internal packages, no `ctx.shell`. Notifications are fired via `child_process.spawn` as a detached child process — **non-blocking and unaffected by the harness exit path**. - **Cross-platform**: the notifier command is picked from `process.platform` (macOS `osascript` / Linux `notify-send` → `kdialog` / Windows PowerShell). Unsupported platforms are skipped at load with a warning, never throwing per-event. - **System sound**: macOS system sound (`sound name "Glass"`), Windows .NET `SystemSounds`, Linux `canberra-gtk-play` (falls

阅读完整 README仓库许可: MIT

dsh-notify-on-complete DSH 插件常见问题

安装后为什么没有收到通知?

首先检查插件是否已加载:运行 `dsh --profile web --dump-config | grep notify-on-complete`。如果没有显示,请重新运行安装脚本或检查手动安装步骤。另外,确保 macOS 上的终端应用已获得通知权限(系统设置→通知),Linux 上需要安装 `notify-send`。如果使用 `dsh web`,安装后需要重启 web 进程。

每次运行收到两条通知,怎么解决?

这是重复挂载导致的:你很可能在 `cordis.patch.yml` 中手动添加了插件条目,而插件已经通过自动挂载生效。删除 patch 文件中 `- id: notify-on-complete` 那一行即可。一键安装脚本会自动清理重复,但手动安装的话,需要编辑 `~/.dsh/profiles/web/cordis.patch.yml` 删除该行。

可以关闭声音只保留通知吗?

可以,在插件配置中设置 `sound: false`。在对应 profile 的 `cordis.patch.yml` 中,修改或添加 `notify-on-complete` 行,例如:`- id: notify-on-complete name: dsh-notify-on-complete config: sound: false`。然后重启 `dsh web` 或运行下一次 CLI 任务即可生效。

这个插件支持 Windows 吗?

支持,它使用 PowerShell 的 `WScript.Shell.Popup` 显示通知弹窗,5 秒后自动关闭,并通过 .NET `SystemSounds` 播放系统声音。确保系统上有 PowerShell 即可,无需额外模块。

如何更新插件到最新版本?

重新运行安装脚本并添加 `--force` 参数:`curl -fsSL https://raw.githubusercontent.com/pitetow/dsh-notify-on-complete/main/scripts/install.sh | bash -s -- --force`。这会删除旧源码目录,下载最新版并重新构建。或者手动进入 `~/.dsh/plugins/dsh-notify-on-complete`,执行 `git pull && pnpm install && pnpm run build`,然后通过 `dsh plugin --profile web add link:.` 重新添加。