前言¶
用 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/status 從 running 變爲 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.json的engines要求); - 帶 Web/desktop profile 的 DeepSeek Harness,用於提供
@deepseek-ai/cordispeer 依賴。
安裝¶
插件以標準 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 / 幻方無官方從屬關係,僅作爲瀏覽入口參考。