在 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 未运行,插件会直接跳过。
- 安装插件:
dsh plugin --profile web add github:wusai2333/dsh-yierpet-sentinel
- 重启 dsh 使配置生效。如果使用 TUI 界面,需同样装进
dsh-tuiprofile:
dsh plugin --profile dsh-tui add github:wusai2333/dsh-yierpet-sentinel
- 验证插件已组合:
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 状态反馈到桌面环境。