dsh-macos-notify:DSH 窗口失焦时的回合完成通知与未读点

前言

在 DeepSeek Harness(DSH)里跑长回合时,你常会切到别的应用等结果。官方界面能显示会话状态,但窗口不在前台时,完成、失败或 token 用尽往往要等到你手动切回来才发现。社区插件 @apodemakeles/dsh-macos-notify(仓库 apodemakeles/dsh-macos-notify)针对 macOS 桌面场景:在 harness 窗口未获得焦点时弹出系统通知,并在侧边栏会话行上留下未读完成点。下面介绍它的能力、安装方式与使用注意。

这是什么

@apodemakeles/dsh-macos-notify 是 DSH 的客户端类插件,维护者为 apodemakeles,当前发布版本为 v0.1.2(自 GitHub 分发)。npm 上未带 scope 的包名 dsh-macos-notify 属于其他项目,安装时需使用 @apodemakeles scope 或 README 中的 github:apodemakeles/dsh-macos-notify 来源。

插件不发起网络请求:会话名称与回合结束原因留在本机处理。

核心功能

系统通知(仅窗口失焦)

仅在 harness 窗口不在前台(document.hasFocus() === false)时触发浏览器 / Electron 的 Notification API。点击通知会聚焦窗口并打开对应会话。

turn/end reason 通知行为
completed、max-tokens、blocked 标题为会话名,正文为本地化「已完成」类文案
error 标题为会话名,正文为本地化「失败」类文案
aborted、interrupted、未知原因 静默
subagent 会话 静默

未读完成点

窗口失焦期间完成的回合,会在会话行左侧显示小圆点:成功为绿色,失败为红色。即使该会话仍停留在主视图也会出现。点击该行、开始新的运行,或点击系统通知后清除。若官方 UI 已显示后台完成状态点,插件不会重复叠加。

启动或重连后不会对历史回放:首次 projection 取值只用于建立基线。

设置项

Settings → Notifications 提供总开关(默认开启)、权限状态,以及请求权限 / 发送测试通知按钮。开关保存在浏览器 localStorage 中。

安装与启用

插件以当前 DSH 进程权限运行;安装前请自行查看 GitHub 源码 与 MIT 许可证。

桌面应用(desktop profile)

desktop profile 由 Electron 应用管理,不能使用 dsh plugin --profile desktop。需按应用插件管理器相同方式添加依赖并写入 bundle:

DSH_HOME=${DSH_HOME:-$HOME/.dsh}
PROFILE="$DSH_HOME/profiles/desktop"

pnpm --dir "$PROFILE" add github:apodemakeles/dsh-macos-notify

在 $PROFILE/package.json 的 dsh.profile.bundles 中加入包名:

{ "dsh": { "profile": { "bundles": [
  "@deepseek-ai/dsh-base",
  "@deepseek-ai/dsh-web-app",
  "@apodemakeles/dsh-macos-notify"
] } } }

重启应用后,在 Plugins → Installed 应能看到插件,Settings → Notifications 会出现开关。

Web profile

dsh plugin --profile web add github:apodemakeles/dsh-macos-notify

执行后需重启 dsh web。

Release 压缩包

每个 GitHub Release 提供 apodemakeles-dsh-macos-notify-<version>.tgz,例如:

dsh plugin --profile web add file:/path/to/apodemakeles-dsh-macos-notify-0.1.2.tgz

典型用法

  1. 按上文完成安装并重启 DSH。
  2. 打开 Settings → Notifications,确认总开关为开;首次使用可点 Request permission 或 Send a test notification,在 系统设置 → 通知 中允许 DeepSeek Harness。
  3. 保持 harness 在后台,等待某会话回合以 completed 或 error 等可通知原因结束,应收到系统通知;侧边栏对应行出现绿点或红点。
  4. 点击通知或会话行,未读点应清除。

若启用了 macOS 专注模式且未将 DeepSeek Harness 加入允许列表,通知可能被「延迟送达」静默;应用内未读点不依赖专注模式。

实现要点与兼容性

  • Host:注册 turn-notify session projection,折叠 turn/start 与 turn/end.reason,向客户端暴露 { turn, reason }。
  • Client:监听会话列表与 projection,经总开关、subagent 过滤、原因映射与焦点门控后展示通知;未读点通过官方 sidebar.session.row.leading 插槽渲染,且仅在官方状态点为 idle 时显示。

兼容范围(见 package.json engines):

  • DSH >=0.2.0-rc.1 <0.3.0;README 记载在桌面应用 0.2.1-rc.2 与 CLI 0.2.0-rc.1 上做过测试。
  • 系统通知依赖 macOS 与 Notification API;未读点为跨平台 UI 行为。
  • Node >=22。

结尾

@apodemakeles/dsh-macos-notify 解决的是「人不在 harness 前台时如何得知回合已结束」:macOS 系统通知加上会话行未读点,逻辑本地、可关总开关。社区目录页:SkillHub - dsh-macos-notify;源码与详细说明:GitHub - apodemakeles/dsh-macos-notify。

羽毛球分组比赛记分
小程序二维码

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

Xiaoye