前言¶
DeepSeek Harness (DSH) 在執行任務時,經常需要人工介入,例如權限確認、交互式詢問或計劃審查。當終端或瀏覽器標籤頁處於後臺時,這些事件很容易被忽略。dsh-notify 旨在解決這一痛點,通過監聽 DSH 的事件總線,在特定時刻觸發原生桌面通知,確保你不會錯過任何需要關注的環節。
核心功能¶
該插件監聽 DSH 的運行狀態,並在以下事件發生時發出通知:
* 權限請求:需要確認的權限或沙盒升級。
* 交互詢問:ask_user_question 提示或計劃審查等待輸入。
* 回合/會話結束:Agent 回覆完畢並等待下一輪輸入。
* 目標狀態:目標完成或被阻塞。
* 錯誤:會話遇到錯誤。
* 工作流結束:tool_workflow 運行結束。
通知渠道¶
支持多種通知方式,可根據平臺或需求選擇:
* auto:默認自動選擇(macOS 使用 osascript,Windows 使用 PowerShell,其他使用 notify-send)。
* osascript / notify-send / powershell:強制指定系統通知。
* bell:終端響鈴(無依賴回退方案)。
* custom:執行自定義命令(支持 {title}, {body}, {app} 佔位符)。
* none:關閉通知。
安裝與配置¶
- 安裝插件到指定 Profile(以
web爲例):
dsh plugin --profile web add git+https://github.com/knownothing114/dsh-notify.git
- 驗證
dsh.profile.bundles中是否包含dsh-notify。如果未自動包含,需手動添加到~/.dsh/profiles/web/package.json。 - 重啓 DSH Web 服務以加載插件。
配置文件位於 ~/.dsh/profiles/web/cordis.patch.yml。可以通過覆蓋 id: dsh-notify 的 config 來修改設置:
- id: dsh-notify
config:
channel: auto
appName: dsh
sound: true
minIntervalMs: 3000
rootsOnly: true
verbose: false
customCommand: ""
triggers:
approval: true
question: true
turnComplete: true
goal: true
error: true
workflow: true
enabled: true
- rootsOnly:用於過濾子代理的噪音,僅對根會話發出通知。
- minIntervalMs:防止通知過於頻繁,設置最小間隔。
Web 界面配置¶
在 web Profile 下,插件會在設置中註冊一個“通知”選項卡。你可以通過圖形界面開啓/關閉主開關、調整渠道、音效、觸發器等。配置變更會熱加載,無需重啓,但首次安裝或升級後需要重啓。
卸載¶
dsh plugin --profile web remove dsh-notify
同時需要從 Profile 的 package.json 中移除 dsh-notify 條目並重啓。
技術細節¶
- 零依賴:除
@deepseek-ai/dsh-settings和@deepseek-ai/schemastery外無額外運行時依賴。 - 純觀察者:插件不參與決策,僅監聽事件並轉發
next(),確保權限鏈路行爲與未安裝插件時一致。 - 跨平臺:支持
web、headless和custom任意 Profile。