前言¶
Herdr 是一个终端工作区管理器,它默认只识别内置检测器(如 opencode, claude, codex 等)识别到的 Agent。dsh/cc-tui 不在默认列表中,因此 Herdr 中的 DSH 面板会显示为普通终端进程,没有状态,也不支持面板跳转和 --wait。
dsh-herdr-site 插件通过 Herdr 的官方自定义集成协议,将 dsh 的 agent 状态(working/idle/blocked)上报给 Herdr,使其能够像识别其他 Agent 一样管理 DSH 面板。
这是什么¶
dsh-herdr-site 是一个 DSH 插件,由 WuJiaoJue 维护。它负责将 dsh/cc-tui 的 agent 状态同步给 Herdr,使 Herdr 能够识别 DSH 面板并提供面板跳转和 --wait 支持。
核心功能¶
- 状态上报:将 agent 状态(working/idle/blocked)通过 Herdr 的
pane report-agent/pane release-agent协议上报。 - 面板跳转与等待:启用 Herdr 的面板跳转功能以及
--wait支持。 - 多 Profile 支持:兼容
cc-tui和dsh-tui两个 profile。 - 协议集成:使用 Herdr 官方的自定义集成协议。
- 会话事件处理:处理会话事件流(
ask_user_question工具调用与结果)。 - 阻塞消息:支持可选的
blockMessage,用于显示 Agent 等待的具体原因。
安装与启用¶
安装该插件需要先有一个工作正常的 DSH 安装,并带有 dsh-cc-tui 或 dsh-base profile。
从 npm 安装(推荐,预构建,无需审批):
dsh plugin --profile cc-tui add dsh-herdr-site
从 GitHub 安装:
dsh plugin --profile cc-tui add github:WuJiaoJue/dsh-herdr-site
验证安装:
dsh --profile cc-tui --dump-config | grep -A2 herdr-site
典型用法¶
安装完成后,DSH 面板在 Herdr 中将显示正确状态。若需自定义阻塞时的提示信息,可在配置文件中设置 blockMessage。
配置示例(在 cordis.patch.yml 中):
# 在 profile 的 cordis.patch.yml 中,或作为 --patch 覆盖
- id: herdr-site
config:
blockMessage: '模型等待你的回答'
适用场景与注意¶
- 进程识别:Herdr 的自动进程检测机制仍无法直接将 dsh 进程识别为 Agent(这需要 Herdr 内置检测器更新)。该插件通过自定义集成协议解决了这一问题,提供了正确的状态、面板跳转和等待功能。
- dsh-tui 限制:
dsh-tuiprofile 不包含ask_user_question工具,因此该 profile 下blocked状态永远不会触发(working/idle状态不受影响)。 - 标签固定:上报给 Herdr 的 Agent 标签固定为
cc-tui。 - Session ID:可选的
--agent-session-id引用功能尚未连接,因此 Herdr 的 pane/agent API 无法直接暴露关联的 dsh session id。 - 前置条件:插件依赖于宿主 profile 提供的包(如
@deepseek-ai/cordis,dsh-session,dsh-agent),需确保宿主环境安装正确。
短结尾¶
通过将状态报告给 Herdr,该插件将 DSH 体验从普通终端提升为可管理的 Agent 面板。更多详情请参阅 目录 或 GitHub。