dsh-macos-notifications:DeepSeek Harness 的 macOS 原生通知插件

前言

DeepSeek Harness(DSH)在桌面端运行时,默认只会在自身更新或启动时提示,而不会在智能体工作流中发出状态通知。对于需要长时间运行或后台执行的智能体任务,这种“静默”会带来不小的使用负担。dsh-macos-notifications 是一个 Host 插件,它通过 macOS Notification Center 向你推送智能体工作的实时状态,让你无需时刻盯着窗口也能掌握进度。

这是什么

这是一个为 DeepSeek Harness 提供原生 macOS 通知的 Host 插件,由开发者 ihodorchenko 维护。它运行在 Host 进程中(即桌面应用背后的 Node 运行时),监听持久化的 session/event 流,在特定事件发生时调用 osascript 向系统发送通知。插件不会向会话日志写入任何内容,也不会与模型交互,仅做事件分发与消息渲染。

核心功能

插件在以下时刻会触发通知:

  • 回合完成:显示 Turn finished 或 Ход завершён
  • 回合失败:显示 Turn failed 并附带错误信息
  • 达到 token 限制:显示 Token limit reached
  • 需要审批:显示 Approval needed · <tool>
  • 需要用户回答:当智能体调用 ask_user_question 或 exit_plan_mode 时,显示 Your answer is needed · <question>

用户取消的回合(aborted)、分叉或中断的回合不会发出通知。子会话会被忽略,只有当前可见会话的通知才会被触发。通知正文会携带会话标题;若标题尚未生成,则使用工作区文件夹名称。

安装与启用

从 GitHub 安装

在 DSH 中使用插件管理器安装该 bundle:

git+https://github.com/ihodorchenko/dsh-macos-notifications.git

该 bundle 自带 dsh.bundle.patch、本地化元数据和图标。

从本地 checkout 安装

将本地 checkout 目录的绝对路径传给 install_bundle,或使用 link:<绝对路径>:

install_bundle ./path/to/dsh-macos-notifications

不使用插件管理器

将以下行直接写入 $DSH_HOME/profiles/desktop/cordis.patch.yml(或你的配置文件):

- insert:
    - id: macos-notifications
      name: 'file:///absolute/path/to/dsh-macos-notifications/index.js'
      config:
        language: ru

保存文件后,HMR 会自动重载插件配置,无需重启应用。若写入格式有误,系统会拒绝该配置并保持原有配置继续运行。

配置说明

配置项为可选,插件会合并默认值与用户配置。默认配置如下:

字段 默认值 说明
language auto 可选 en、ru 或 auto(跟随主机语言)
sound Glass 任意 macOS 声音名称,或 null 以静默显示
notifyOnTurnEnd true 回合完成、失败或阻塞时通知
notifyOnApproval true 需要审批时通知
notifyOnQuestion true 智能体提问时通知

示例配置:

- id: macos-notifications
  name: dsh-macos-notifications
  config:
    language: ru
    sound: Ping
    notifyOnTurnEnd: true
    notifyOnApproval: true
    notifyOnQuestion: true

使用注意事项

  • 插件以当前 DSH 进程的权限运行,需确保该进程拥有向系统发送通知的权限。
  • 首次通知会触发系统弹窗,要求允许通知权限(通常授予 Script Editor 或系统显示的进程)。
  • 若通知未出现,请前往 系统设置 → 通知,为 Script Editor(或系统提示的进程)开启通知。
  • file: 路径安装方式不会被 HMR 监听文件变化,修改 index.js 后需要触摸 cordis.patch.yml 或重启应用,模块才会重新加载。
  • 移动或删除本地 checkout 会导致 file: 或 link: 安装失效,请从新路径重新安装。

总结

dsh-macos-notifications 通过原生 macOS 通知中心,让 DeepSeek Harness 的智能体工作状态可见可控。你可以在后台运行任务时,通过系统通知及时获知回合完成、失败、审批请求或提问,减少对窗口的持续关注。插件本身是开源项目,使用前建议阅读源码与许可证。

  • 插件目录页:https://www.skillhub.cn/plugins/ihodorchenko/dsh-macos-notifications
  • GitHub 仓库:https://github.com/ihodorchenko/dsh-macos-notifications
羽毛球分组比赛记分
小程序二维码

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

小夜