前言¶
用 DeepSeek Harness(dsh)跑長任務時,窗口往往要一直盯着,等模型寫完、工具跑完才知道結果。Web GUI 在後臺標籤頁裏時,更難察覺一輪對話已經結束。dsh-win-toast-notify 在 Host 側監聽會話事件,在每一輪 turn/end 時通過 Windows 自帶的 WinRT 通知 API 彈出原生 Toast,帶上結束原因、會話標題、回覆摘要和用時,便於你暫時移開視線繼續做別的事。
這是什麼¶
dsh-win-toast-notify 是社區維護的 DSH 插件(維護者 monika2333,GitHub:monika2333/dsh-win-toast-notify),歸類爲客戶端相關能力:不改動 Client 界面,只在 Windows 10/11 上於 Host 進程內投遞系統通知。它不寫入事件流、不碰 fork/resume/replay,屬於只讀觀察者。
核心功能¶
- 訂閱 durable 的
session/event,在turn/end時觸發 Toast。 - 通知正文大致爲三行:第一行爲結束原因與會話標題;第二行爲該輪助手回覆的純文本預覽;第三行爲來源前綴(默認
DeepSeek Harness)與本輪耗時。 - 默認跳過子智能體會話,避免一次 fan-out 彈出多條通知。
- 通過
powershell.exe -EncodedCommand調用Windows.UI.Notifications,避免中文、引號、換行破壞命令行。 - 非 Windows 平臺插件會加載但不執行任何操作。
README 中的 Toast 示例:
任務完成 · Fix the login redirect
Updated the middleware and added two regression tests; all 41 tests pass.
DeepSeek Harness · 用時 4 分 12 秒
環境與依賴¶
- Windows 10 或 11。
- 使用內置 WinRT 通知 API(經 Windows PowerShell),無需原生模塊、編譯或額外安裝腳本。
- Harness 需能發出帶
turn/end的session/eventfeed(文檔寫明需 dsh 0.2.x)。 - 系統須允許對應應用顯示通知;專注助手 / 請勿打擾會與其它通知一樣抑制 Toast。
安裝與啓用¶
在已安裝 dsh 的環境中執行官方文檔給出的命令:
dsh plugin add dsh-win-toast-notify
也可在 dsh-market 插件瀏覽器中安裝。若當前構建不會熱加載插件行,安裝後需重啓 Harness。
插件以 npm 包形式發佈,當前資料中的版本爲 0.1.0,許可證 MIT;運行環境要求 Node >=22(見倉庫 package.json)。
哪些結束原因會通知¶
Host 監聽 turn/end,默認行爲如下:
turn/end reason |
默認是否通知 |
|---|---|
completed |
是 — 文案「任務完成」 |
error |
是 — 「任務出錯」 |
blocked |
是 — 「任務受阻」 |
max-tokens |
是 — 「輸出達到上限」 |
interrupted |
是 — 「任務被中斷」 |
aborted(用戶按 Stop) |
否 |
forked |
否 |
配置¶
在 profile patch 中編輯該插件行的 config,或在插件設置卡片中修改,然後按需重啓:
- id: dsh-win-toast-notify
name: dsh-win-toast-notify
config:
enabled: true # master switch
reasons: [completed, error] # which end reasons notify
includeSubagents: false # also notify child sessions
previewChars: 160 # length of the reply preview
sound: true # play the default notification sound
titlePrefix: DeepSeek Harness # third line prefix
showSessionTitle: true # fall back to the working-directory name when off
appId: '' # override the toast's AppUserModelID (empty = auto)
powershell: '' # override the notifier executable
可按需只保留關心的 reasons,打開 includeSubagents 以包含子會話,或調整 previewChars、sound、titlePrefix 等。
工作原理摘要¶
- 只讀觀察:內存中僅保留回合開始時間與最後一段助手文本,不追加事件、不寫文件。
- 僅 Host:無 Client 模塊;Web GUI 在後臺標籤或已關閉時仍可收到 Toast。
- 應用標識:若存在桌面版 Start 菜單快捷方式,Toast 掛在
com.deepseek.dsh下,顯示爲 DeepSeek Harness;純dsh web或 CLI 安裝若未註冊該 AUMID,系統可能靜默丟棄,插件會回退到 Windows PowerShell 的 AUMID(通知中心裏可能顯示爲 PowerShell)。 - 進程模型:通知子進程不脫離 Host,約一秒內退出,避免與 Job 對象一起被回收導致通知丟失。
預覽內容爲純文本:Markdown 代碼塊、鏈接、強調與行內代碼會被剝掉。
適用場景與注意¶
適合在 Windows 上長時間用 Harness 寫代碼、跑工具鏈,又需要離開主窗口的場景。插件與當前 dsh Host 同權限運行;安裝前建議閱讀 GitHub 倉庫 源碼與 MIT 許可證。DSH 生態以「一切皆插件」爲思路,SkillHub 目錄頁 等爲社區站點,與 DeepSeek / 幻方無官方從屬關係。
侷限:僅 Windows;回退 AUMID 時 Toast 歸屬 PowerShell;非 Windows 無效果。
結尾¶
dsh-win-toast-notify 把「一輪 Harness 任務結束」變成系統級 Toast,減少盯着終端或瀏覽器標籤的必要。安裝命令爲 dsh plugin add dsh-win-toast-notify。詳情與問題反饋見目錄頁 https://www.skillhub.cn/plugins/monika2333/dsh-win-toast-notify 與 https://github.com/monika2333/dsh-win-toast-notify 。