DSH 插件:將 DSH 事件轉發至 YierPet 的哨兵

在 DeepSeek Harness (DSH) 的插件生態中,需要將 DSH 的運行狀態同步到桌面環境。dsh-yierpet-sentinel 插件解決了這個問題。它監聽 DSH 的 session/event 事件流,並將這些事件轉發給本地運行的桌寵 YierPet,通過氣泡、動畫和提示音來反饋狀態。

插件定位

  • 名稱:wusai2333/dsh-yierpet-sentinel
  • 維護者:wusai2333
  • 分類:聯網工具
  • 核心價值:以 fire-and-forget 模式轉發 DSH 生命週期事件到 YierPet,絕不阻塞 DSH 進程。

工作原理

該插件通過監聽 DSH 內置寵物消費的同一條 session/event 事件流,將不同類型的事件轉發到 YierPet 的本地監聽端點。它採用 fire-and-forget 模式,設定 1 秒超時,任何錯誤均靜默處理,不會影響主進程。

支持轉發的 DSH 事件包括:
* turn/start
* tool/result
* approval/asked
* llm/retry
* turn/end (completed/error)
* session/disposed

前置條件與安裝

安裝前,確保本地已運行 YierPet,且它將監聽 URL 寫入 ~/.yierpet/endpoint。如果 YierPet 未運行,插件會直接跳過。

  1. 安裝插件:
    dsh plugin --profile web add github:wusai2333/dsh-yierpet-sentinel
  1. 重啓 dsh 使配置生效。如果使用 TUI 界面,需同樣裝進 dsh-tui profile:
    dsh plugin --profile dsh-tui add github:wusai2333/dsh-yierpet-sentinel
  1. 驗證插件已組合:
    dsh --profile web --dump-config | grep yierpet

驗證與測試

安裝完成後,可以通過以下命令進行驗證:

  • 自檢邏輯:
    node --test test.js
  • YierPet 側測試:
    printf '{"text":"dsh 接入測試"}' | ~/.yierpet/hook.sh dsh Stop

注意事項

  • 1 秒超時:轉發請求有 1 秒的超時限制。
  • 錯誤處理:所有錯誤均靜默處理,不會中斷 DSH 運行。
  • 不阻塞:插件設計爲絕不阻塞 DSH 進程。
  • 會話隔離:子 agent 會話通常不打擾,除非涉及審批事件(此時會觸發 approval/asked)。主回合的 Stop 事件已覆蓋用戶可見的完成時刻。

  • 卸載:如需移除,執行:

    dsh plugin --profile web remove dsh-yierpet-sentinel

總結

該插件爲 DSH 用戶提供了與桌面寵物的集成能力。通過監聽事件流並 fire-and-forget 轉發,它在不增加系統負擔的前提下,將 CLI 狀態反饋到桌面環境。

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

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

小夜