dsh-interconnect 0.10.1 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -13
- package/assets/dsh-interconnect.md +5 -5
- package/dsh.plugin.json +2 -2
- package/lib/index.js +304 -161
- package/lib/interconnect/index.js +306 -162
- package/lib/interconnect/index.js.map +3 -3
- package/lib/skill-interconnect/index.js +1 -1
- package/lib/skill-interconnect/index.js.map +2 -2
- package/lib/tool-interconnect/index.js +71 -59
- package/lib/tool-interconnect/index.js.map +2 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/interconnect/index.d.ts +64 -29
- package/lib/types/interconnect/index.d.ts.map +1 -1
- package/lib/types/interconnect/types.d.ts +9 -49
- package/lib/types/interconnect/types.d.ts.map +1 -1
- package/lib/types/skill-interconnect/index.d.ts +4 -4
- package/lib/types/skill-interconnect/index.d.ts.map +1 -1
- package/lib/types/tool-interconnect/index.d.ts +10 -7
- package/lib/types/tool-interconnect/index.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- `interconnect_send`:向对端实例的指定 session 投递消息;可选 `delivery` 选投递模式、`resume` 唤醒离线 session
|
|
19
19
|
- `interconnect_list`:列出对端实例的 live session(id + 标题 + 状态),用于在不预先知道 session id 时寻址
|
|
20
20
|
- `interconnect_ping`:探测对端实例活性与身份
|
|
21
|
-
- `interconnect_reply
|
|
21
|
+
- `interconnect_reply`:向记录过的发送方回传消息,只需文本;回信 session 是本 agent 自己的,无需再次寻址
|
|
22
22
|
|
|
23
23
|
**`skill-interconnect`** —— 配套 skill:
|
|
24
24
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
- `interconnect_send(instanceId="peer", sessionId=..., text=...)`
|
|
38
38
|
- `interconnect_ping(instanceId="peer")`
|
|
39
39
|
- `interconnect_list(instanceId="peer")`
|
|
40
|
-
- `interconnect_reply(
|
|
40
|
+
- `interconnect_reply(text=...)`(只需文本;回信 session 是本 agent 自己的,目标从记录的 sender 解析)
|
|
41
41
|
|
|
42
42
|
`instanceId` 是 `interconnect` 行 `peers` 映射里的键;真正用来拨号的 origin 由该映射的值给出(例如隧道端点 `http://127.0.0.1:13080`),**instanceId 本身从不出现在线上**,也不参与路由——origin 才是唯一的拨号依据。到**未配置 / 未联通**的对端 `send`/`ping`/`list` 返回 `unreachable`(无 HTTP 回退)。
|
|
43
43
|
|
|
@@ -55,22 +55,24 @@ session-b07326da-… [running]
|
|
|
55
55
|
只列 live session 是有意的:`send` 能到达的正好是这些。对端存在但没有运行 agent 的 session
|
|
56
56
|
不会出现在列表里,也收不到消息。
|
|
57
57
|
|
|
58
|
+
答案有行数上限(`MAX_LISTED_SESSIONS`,100 行):整帧必须待在链路的帧上限内,ws 对超限帧会
|
|
59
|
+
直接关闭链路,所以 live session 极多的对端只回答前若干行,而不是把传输打断。ping 与 list 的
|
|
60
|
+
答复还会按调用方问的 kind 校验形状,形状不符按「无答复」处理(对应 `unreachable`)。
|
|
61
|
+
|
|
58
62
|
### 回复(`reply`)
|
|
59
63
|
|
|
60
64
|
`send` 的线负载带一个 `sender` 身份(**无地址**:`instanceId` + `sessionId`),收到消息的
|
|
61
|
-
instance 会按「本地 session id → 该 sender」记下这份身份。之后那个 session
|
|
62
|
-
session
|
|
63
|
-
|
|
65
|
+
instance 会按「本地 session id → 该 sender」记下这份身份。之后那个 session 回信**只需要文本**:
|
|
66
|
+
回信 session 就是执行 `interconnect_reply` 的 agent 自己的 session,工具据此查出记录的 sender,
|
|
67
|
+
不用再次给出本地 session id、对端 instanceId 或远程 session id——回信走的是本机到那个
|
|
68
|
+
instance 的持久链接。
|
|
64
69
|
|
|
65
70
|
```text
|
|
66
71
|
# 源实例 A 指定目标 B 的 session,并带上自己的身份(无 baseUrl)
|
|
67
72
|
interconnect_send(instanceId="b", sessionId=B-sess, text="…", sender={instanceId:A, sessionId:A-sess})
|
|
68
73
|
|
|
69
|
-
# B
|
|
70
|
-
interconnect_reply(
|
|
71
|
-
```
|
|
72
|
-
# B 回传:只给本地 session id + 文本,目标从记录的 sender 解析
|
|
73
|
-
interconnect_reply(sessionId=B-sess, text="reply")
|
|
74
|
+
# B 回传:只给文本,回信 session 即执行该工具的 agent 自己的 session
|
|
75
|
+
interconnect_reply(text="reply")
|
|
74
76
|
```
|
|
75
77
|
|
|
76
78
|
- `sender` 是**自报**的,只用于 reply 归因与寻址,**不是**路由或鉴权依据——连接本身仍由
|
|
@@ -100,8 +102,7 @@ interconnect_reply(sessionId=B-sess, text="reply")
|
|
|
100
102
|
- **出站**:`interconnect_send`/`interconnect_reply`/`ping`/`list` 都发对应帧并等待匹配 `reqId`
|
|
101
103
|
的结果(受 `requestTimeoutMs` 约束)。到**未配置或未联通**的对端直接返回 `unreachable`——
|
|
102
104
|
**没有 HTTP 回退**,这是 0.9 的破坏性变化。
|
|
103
|
-
- **入站**:`msg`
|
|
104
|
-
等),结果经同一 socket 回 `msg-result`;`query` 帧回 `query-result`。
|
|
105
|
+
- **入站**:`msg` 帧携带 `send`,走 `deliver` 逻辑(sender 记录、subagent 封栏等),结果经同一 socket 回 `msg-result`;`query` 帧回 `query-result`。
|
|
105
106
|
- 心跳与指数退避重连沿用既有实现。
|
|
106
107
|
|
|
107
108
|
### 投递失败的原因
|
|
@@ -256,11 +257,16 @@ pnpm run build # esbuild → lib/
|
|
|
256
257
|
服务(有 HTTP/WS 端点),必须 host 级;`tool-interconnect` 和 `skill-interconnect`
|
|
257
258
|
也放 host,因为 `interconnect` 未做 TypeRT `@Remote`/Gateway 绑定,放进 agent preset
|
|
258
259
|
的 isolate realm 会导致工具/技能行无法 inject 到该服务。
|
|
260
|
+
- 服务只 inject `agents` 与 `credentials`;**宿主 webserver 是可选的**。有 webserver 时入站
|
|
261
|
+
升级路由注册在它上面(`webServer` 经等待式 inject fiber 接入,与组合顺序无关);没有
|
|
262
|
+
webserver 的 profile(例如 headless)里服务仍会拨号已配置对端并经这些出站链接投递,即
|
|
263
|
+
仅出站模式。`dsh.plugin.json` 的 `inject` 与之一致,只有 `agents`、`credentials`。
|
|
259
264
|
- `ws` 是运行依赖,由宿主的 node_modules 提供(构建时 external)。
|
|
260
265
|
|
|
261
266
|
## 验证
|
|
262
267
|
|
|
263
|
-
-
|
|
268
|
+
- 154/154 单测通过(服务 + 工具 + skill,含 wire 校验、畸形帧、心跳/池清理、结果帧绑定、list 上限等回归用例);
|
|
269
|
+
类型检查、构建均干净。
|
|
264
270
|
- 已在两台机器之间实测双向互通:消息投递、WebSocket 事件推流、以及 agent 经
|
|
265
271
|
`interconnect_send` 工具反向回发,均验证通过。
|
|
266
272
|
- CI(GitHub Actions):clone 公开 DSH 仓库作为 sibling,跑 `pnpm run check`。
|
|
@@ -20,9 +20,9 @@ job is only to pick the right tool and the right target.
|
|
|
20
20
|
instance/session identity is attached automatically by the tool, so you must
|
|
21
21
|
NOT pass a sender parameter.
|
|
22
22
|
- `interconnect_reply` — send a message back to the peer that this session last
|
|
23
|
-
received an interconnect message from. Pass only the
|
|
24
|
-
|
|
25
|
-
automatically
|
|
23
|
+
received an interconnect message from. Pass only the reply text: the replying
|
|
24
|
+
session is this agent's own session, and the remote target is recalled
|
|
25
|
+
automatically, so do not try to look up or pass the sender address again.
|
|
26
26
|
|
|
27
27
|
## Sender identity is automatic
|
|
28
28
|
|
|
@@ -41,8 +41,8 @@ addresses.
|
|
|
41
41
|
`interconnect_list(instanceId=...)` and choose a live session.
|
|
42
42
|
2. Call `interconnect_send(instanceId=..., sessionId=..., text=...)`.
|
|
43
43
|
3. When a message arrives on your side and you need to respond, call
|
|
44
|
-
`interconnect_reply(
|
|
45
|
-
recorded sender is used as the destination.
|
|
44
|
+
`interconnect_reply(text=...)`. The replying session is this agent's own
|
|
45
|
+
session, and the recorded sender is used as the destination.
|
|
46
46
|
|
|
47
47
|
## Delivery modes
|
|
48
48
|
|
package/dsh.plugin.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-interconnect",
|
|
3
3
|
"description": "Cross-instance message/event handoff for DeepSeek Harness (DSH): WebSocket link, model-facing tools, and companion skill.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.1",
|
|
5
5
|
"entry": {
|
|
6
6
|
"name": "dsh-interconnect/interconnect",
|
|
7
|
-
"inject": ["
|
|
7
|
+
"inject": ["agents", "credentials"]
|
|
8
8
|
}
|
|
9
9
|
}
|