dsh-interconnect
Cross-instance message/event handoff plugins for DeepSeek Harness (DSH): interconnect service + model-facing tools + companion skill
What it is
Cross-instance message/event handoff plugins for DeepSeek Harness (DSH): interconnect service + model-facing tools + companion skill
How to install
Run this in the DSH web profile, then refresh the page.
$ dsh plugin --profile web add dsh-interconnect@0.15.0
DSH versions accepted
*
Author and traction
Chinesezjc · ★ 40 · Updated 2026-11-08
About this plugin
dsh-interconnect
跨实例消息互通与事件通知插件,用于 DeepSeek Harness (DSH)。 让一个 DSH 实例能向同一个实例、另一台机器、或另一台机器上的别的 DSH 实例发送消息、探测活性,并在实例之间双向推送事件。 项目状态(2026-09-16):本仓库是该插件的树外(out-of-tree)主源。并入 DSH monorepo 的计划(PR #3243)已按「保持树外」的评审意见关闭;插件继续经 npm 分发(dsh-interconnect),并由团队内部的插件集合仓以 git submodule 引用本仓库。 包含三个插件
interconnect —— host 服务(ctx.interconnect): 全走持久 WebSocket 链接:跨实例、跨机器投递消息、枚举 live session、探测活性(send/reply/ping/list 经 /interconnect/link 的 msg/query 帧) /interconnect/link WebSocket 端点:双向实时事件推流,含心跳与指数退避重连;也承载 send/reply 消息(msg/msg-result 帧)。0.9 起没有 HTTP 端点,也没有 HTTP 回退 事件 fan-out 只在 WebSocket 链路上;入站事件以 interconnect/event 发出 共享密钥鉴权(DSH_INTERCONNECT_TOKEN,bearer,fail-closed,timing-safe 比较)
tool-interconnect —— 模型可见工具: interconnect_peers:列出本实例已配置的对端及其拨号链路状态(up/down),用于在不知道 peer id 时先看有哪些可用目标,也是区分「没配这个 peer」与「配了但链路不通」的唯一入口 interconnect_doctor:只读诊断:共享 token 是否解析、宿主 webserver 是否监听、每个 peer 的 链路/最后错误/重试时间,以及可直接执行的下一步;不主动拨号 interconnect_pair:用一次性 code 交换 id 和 origin,无需手写 peers;code 用共享 token 做 HMAC、10 分钟过期,配对结果默认写入 profile 目录 interconnect_send:向对端实例的指定 session 投递消息;默认唤醒没有 live agent 的持久 session(resume: false 关闭),可选 delivery 选投递模式 interconnect_list:列出对端实例的 live session(id + 标题 + 状态),用于在不预先知道 session id 时寻址 interconnect_ping:探测对端实例活性与身份 interconnect_reply:向记录过的发送方回传消息,只需文本;回信 session 是本 agent 自己的,无需再次寻址
skill-interconnect —— 配套 skill: 向模型注册 dsh-interconnect skill,说明 peers/doctor/pair/list/ping/send/reply 的完整用法、 投递模式、resume 唤醒语义与失败处理。 明确告知模型:interconnect_send 会自动注入发送方的 instanceId 和 sessionId, 接收方凭记录的 sender 即可用 interconnect_reply 回信,不需要手工传地址。 依赖 interconnect 服务,只有传输层存在时才注册进 ctx.skills。 用法 寻址(0.9 起用 instanceId,全走持久链接)
从 0.9 起,传输只走 WebSocket 持久链接,不再有 HTTP 端点,寻址参数从 baseUrl 改为 instanceId: interconnect_send(instanceId="peer", sessionId=..., text=...) interconnect_ping(instanceId="peer") interconnect_list(instanceId="peer") interconnect_peers()(不接受参数;返回本实例配置的全部对端及其链路状态) interconnect_reply(text=...)(只需文本;回信 session 是本 agent 自己的,目标从记录的 sender 解析)
instanceId 是 interconnect 行 peers 映射里的键;真正用来拨号的 origin 由该映射的值给出(例如隧道端点 http://127.0.0.1:13080),instanceId 本身从不出现在线上,也不参与路由——origin 才是唯一的拨号依据。值也可以是字面量 self,表示拨向本实例自己的宿主 webserver(见「同一实例内两个会话互通」)。
对端没配在这里时,send/reply 返回 peer-not-configured,ping/list 则在返回 reachable: false 的同时带上 configured: false——这一支重试永远不会成功,只能去补 peers 映射。配了但链路不通是另一支:链路断或两端 token 不一致时返回 unreachable (configured: true),重连成功后就可能通(无 HTTP 回退)。
interconnect_peers 就是这两支的判据来源,输出每行一个对端:
up/down 是拨号链路当前是否可用;down 不代表对端没开——重连按指数退避自己跑,改完 网络或对端重启后无需重启本实例,链路会自己回来。 诊断(interconnect_doctor)
链路 down 时先调用 interconnect_doctor;它只读本地状态,不会拨号: token 只报告 configured / missing / error,不显示值; web server 是 self 路由的依赖,headless 下显示 not listening; peers 的 kind 区分 fixed 与 self,并带最后错误、重试次数和下次重试时间; hints 给出可直接执行的下一步;没有问题时输出 no problems found。
doctor 不替代 interconnect_ping:doctor 只读本地状态,ping 才会主动探测对端。 配对(interconnect_pair)
不想手写 peers 时,用三步交换 id 和 origin:
Similar plugins
dsh-purge
让 AI 更专注地辅助学习与动手实验:DSH 附加组件,提供状态自检、提示词与规则管理、本机备份与回滚。
dsh-unrestricted
Toggleable unrestricted mode for DeepSeek Harness: fuses execution rules into the active standard, ptc, cordis, minimal,…
dsh-univer-office
DSH × Univer integration with a bundled collaboration Gateway and Viewer: inline previews, live floating Worktree window…