dsh-notify: DSH 桌面通知插件

前言

DeepSeek Harness (DSH) 在执行任务时,经常需要人工介入,例如权限确认、交互式询问或计划审查。当终端或浏览器标签页处于后台时,这些事件很容易被忽略。dsh-notify 旨在解决这一痛点,通过监听 DSH 的事件总线,在特定时刻触发原生桌面通知,确保你不会错过任何需要关注的环节。

核心功能

该插件监听 DSH 的运行状态,并在以下事件发生时发出通知:
* 权限请求:需要确认的权限或沙盒升级。
* 交互询问:ask_user_question 提示或计划审查等待输入。
* 回合/会话结束:Agent 回复完毕并等待下一轮输入。
* 目标状态:目标完成或被阻塞。
* 错误:会话遇到错误。
* 工作流结束:tool_workflow 运行结束。

通知渠道

支持多种通知方式,可根据平台或需求选择:
* auto:默认自动选择(macOS 使用 osascript,Windows 使用 PowerShell,其他使用 notify-send)。
* osascript / notify-send / powershell:强制指定系统通知。
* bell:终端响铃(无依赖回退方案)。
* custom:执行自定义命令(支持 {title}, {body}, {app} 占位符)。
* none:关闭通知。

安装与配置

  1. 安装插件到指定 Profile(以 web 为例):
dsh plugin --profile web add git+https://github.com/knownothing114/dsh-notify.git
  1. 验证 dsh.profile.bundles 中是否包含 dsh-notify。如果未自动包含,需手动添加到 ~/.dsh/profiles/web/package.json。
  2. 重启 DSH Web 服务以加载插件。

配置文件位于 ~/.dsh/profiles/web/cordis.patch.yml。可以通过覆盖 id: dsh-notify 的 config 来修改设置:

- id: dsh-notify
  config:
    channel: auto
    appName: dsh
    sound: true
    minIntervalMs: 3000
    rootsOnly: true
    verbose: false
    customCommand: ""
    triggers:
      approval: true
      question: true
      turnComplete: true
      goal: true
      error: true
      workflow: true
    enabled: true
  • rootsOnly:用于过滤子代理的噪音,仅对根会话发出通知。
  • minIntervalMs:防止通知过于频繁,设置最小间隔。

Web 界面配置

在 web Profile 下,插件会在设置中注册一个“通知”选项卡。你可以通过图形界面开启/关闭主开关、调整渠道、音效、触发器等。配置变更会热加载,无需重启,但首次安装或升级后需要重启。

卸载

dsh plugin --profile web remove dsh-notify

同时需要从 Profile 的 package.json 中移除 dsh-notify 条目并重启。

技术细节

  • 零依赖:除 @deepseek-ai/dsh-settings 和 @deepseek-ai/schemastery 外无额外运行时依赖。
  • 纯观察者:插件不参与决策,仅监听事件并转发 next(),确保权限链路行为与未安装插件时一致。
  • 跨平台:支持 web、headless 和 custom 任意 Profile。
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜