dsh-win-notify:给 DSH 加上 DeepSeek 品牌的 Windows 系统通知

前言

用 DeepSeek Harness(DSH)跑长任务时,经常会切到别的窗口去做别的事。但有两个时刻你必须守在窗口前:一是工具操作需要人工确认,二是模型运行结束。错过前者,任务会一直停在那里等人;错过后者,你不知道它什么时候跑完。

dsh-win-notify 要解决的就是这个问题:把这两个时刻转成 Windows 系统通知,需要确认时响循环警报,跑完时响一声普通提示。下面介绍它的实现方式、安装步骤和使用注意。

这是什么

dsh-win-notify 是 DeepSeek Harness 的 Windows 11 系统通知桥接插件,由 linfunss 维护。在工具操作需要用户确认、或模型运行完成时,弹出带 DeepSeek 品牌(名称、鲸鱼图标、音效)的系统 toast 通知。整个插件零运行时依赖、零构建步骤,纯 ESM JavaScript,当前版本 1.0.0,MIT 许可证。

非 Windows 平台上它是 no-op,不会在 Linux 或 macOS 环境里报错。

两种通知场景

插件监听两类事件:

1、工具操作需要用户确认时:监听 approval/request 瀑布事件(仅旁观,不介入决策),弹出「需要确认」通知,音效为 Notification.Looping.Alarm(循环警报);

2、模型运行完成时:监听 agent/statusrunning 变为 idle(过滤子代理),弹出「运行完成」通知,音效为 Notification.Default

通知经 CreateToastNotifier(aumid) 发出。这一步是关键:Windows 会把通知归属到 AppUserModelID(AUMID)对应的应用,也就是 DeepSeek Harness,而不是 PowerShell——名称、图标、音效都正确。

品牌与自愈

要让通知带上品牌,需要两样东西:图标文件和注册好的 AppUserModelID。插件每次加载时都做两件事:

1、用纯 Node 重新生成 DeepSeek 鲸鱼图标(不依赖任何渲染库),写入 %LOCALAPPDATA%\DeepSeekHarness\deepseek.ico

2、(重新)把 AppUserModelID DeepSeekAI.DeepSeekHarness 注册到 HKCU\Software\Classes\AppUserModelId\...,带上显示名和图标 URI。

这里有个实现细节:图标直接由官方 favicon 路径数据光栅化生成,而不是走 librsvg(sharp 底层的渲染库),因为 librsvg 会把这条特定路径压扁成一条细线;icon.mjs 里的扫描线光栅化就是绕开这个缺陷的。每次加载都重新生成一遍,即「自愈」:即使图标文件或注册表项被动过,下次启动也会恢复。

环境要求

  • Windows 10/11(其他平台为 no-op);
  • Node >= 20(package.jsonengines 要求);
  • 带 Web/desktop profile 的 DeepSeek Harness,用于提供 @deepseek-ai/cordis peer 依赖。

安装

插件以标准 DSH bundle 形式分发。DSH 的理念是「一切皆插件」,插件装进 profile 的依赖里。README 给了三种方式。

方式 A:本地 clone(推荐用于开发)

先克隆仓库:

git clone https://github.com/<your-name>/dsh-win-notify.git

再在 profile 的 package.json(路径为 $DSH_HOME/profiles/<profile>/package.json)中引用本地路径:

{
  "name": "dsh-profile-web",
  "private": true,
  "dependencies": {
    "dsh-win-notify": "file:C:/path/to/dsh-win-notify"
  }
}

然后执行:

dsh plugin --profile web install

方式 B:npm

dsh plugin --profile web add dsh-win-notify

注意 README 把这种方式标注为「once published」——包发布到 npm 之后才可用。想立刻上手,用方式 A 或 C。

方式 C:git 依赖

在 profile 的 package.json 中加入 git 依赖:

"dependencies": {
  "dsh-win-notify": "github:<your-name>/dsh-win-notify"
}

然后在 profile 目录执行 pnpm install(或 dsh plugin --profile web install)。

启用

装好后,把包加入 profile 的 dsh.profile.bundles。插件自带 cordis.patch.yml,会自动插入 win-notify 行;你也可以在 profile 的 cordis.patch.yml 里手动插入:

- insert:
    - id: win-notify
      name: 'dsh-win-notify'

重启 DSH,打开「设置 → 系统 → 通知」,应该能看到 DeepSeek Harness 条目,确保开关打开。

配置

配置项全部可选,按需加在 cordis.patch.yml 同一行下:

- id: win-notify
  name: 'dsh-win-notify'
  config:
    enabled: true
    appName: DeepSeek Harness
    aumid: DeepSeekAI.DeepSeekHarness
    confirmationTitle: DeepSeek Harness · 需要确认
    completionTitle: DeepSeek Harness · 运行完成
    confirmationSound: Notification.Looping.Alarm
    completionSound: Notification.Default

各项用途可以从名字读出来:两个 Title 控制通知标题,两个 Sound 控制音效,aumid 对应前文注册的 AppUserModelID。

测试

插件自带图标测试,验证 ICO 结构、PNG 条目与鲸鱼渲染内容是否正常:

node tests/icon.test.mjs      # 或 npm test

适用场景与注意

适合在 Windows 10/11 上长期使用 DSH、经常切走窗口的开发者——尤其是会触发工具确认、且任务运行时间不可预期的场景。

几个已知限制,使用前先了解:

  • 系统通知设置须允许「DeepSeek Harness」应用;专注助手(Focus Assist)可能静音 toast;
  • Windows 可能缓存旧图标,直到通知中心刷新(重启 DSH 可清除);
  • 通知仅作提示,点击不会聚焦 Harness 窗口(未注册 ToastActivatorCLSID)。

另外提醒一点:插件安装后会以当前 dsh 进程的权限运行,具备写文件和改注册表的能力(前文提到的写图标、注册 AUMID 就是例子)。安装前建议先过一遍源码、确认许可证(本插件为 MIT),可接受再装。

结尾

dsh-win-notify 做的是一件小但具体的事:让 DSH 的两个「等人」时刻接上 Windows 系统通知,不用一直盯着窗口。零依赖、零构建的实现,想改一份自己的版本也不难。相关地址:

  • 目录页:https://www.skillhub.cn/plugins/linfunss/dsh-win-notify
  • GitHub:https://github.com/linfunss/dsh-win-notify

其中目录页是独立维护的社区站点,与 DeepSeek / 幻方无官方从属关系,仅作为浏览入口参考。

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

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

小夜