dsh-interconnect 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chinesezjc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # dsh-interconnect
2
+
3
+ 跨实例消息互通与事件通知插件,用于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH)。
4
+ 让一个 DSH 实例能向同一个实例、另一台机器、或另一台机器上的别的 DSH 实例发送消息、探测活性,并在实例之间双向推送事件。
5
+
6
+ ## 包含两个插件
7
+
8
+ **`interconnect`** —— host 服务(`ctx.interconnect`):
9
+
10
+ - `send` / `ping` HTTP 端点(`/interconnect/*`):跨实例、跨机器投递消息、探测活性
11
+ - `/interconnect/link` WebSocket 端点:双向实时事件推流,含心跳与指数退避重连
12
+ - 事件 fan-out(HTTP + WebSocket),入站事件以 `interconnect/event` 发出
13
+ - 共享密钥鉴权(`DSH_INTERCONNECT_TOKEN`,bearer,fail-closed,timing-safe 比较)
14
+
15
+ **`tool-interconnect`** —— 模型可见工具:
16
+
17
+ - `interconnect_send`:向对端实例的指定 session 投递消息
18
+ - `interconnect_ping`:探测对端实例活性与身份
19
+
20
+ ## 安装
21
+
22
+ 本仓库是一个 DSH profile bundle(根 `package.json` 声明 `dsh.bundle.patch` 指向
23
+ 根 `cordis.patch.yml`,后者 `insert` 两个插件行)。
24
+
25
+ ```bash
26
+ dsh plugin --profile <name> add file:/path/to/dsh-interconnect
27
+ ```
28
+
29
+ `dsh plugin add` 会把仓库识别为 bundle 并追加进 profile 的 `dsh.profile.bundles`。重启
30
+ web 服务使 host 侧生效。两端实例的 `.credentials.yaml`(或等价凭据源)设置相同的
31
+ `DSH_INTERCONNECT_TOKEN` 作为共享密钥。
32
+
33
+ ## 开发
34
+
35
+ 依赖 [公开的 DeepSeek Harness monorepo](https://github.com/deepseek-ai/deepseek-harness)
36
+ 作为 sibling checkout:`package.json` 的 `devDependencies` 用 `link:../dsh/...` 指向它,
37
+ 因为 `@deepseek-ai/dsh-*` 未发布到 npm,peer 依赖须由该 checkout 提供。
38
+
39
+ ```bash
40
+ ln -s /path/to/deepseek-harness ../dsh
41
+ pnpm install --config.auto-install-peers=false # peer @deepseek-ai/dsh-* 由 sibling checkout 提供
42
+ pnpm run check # typecheck + test + build
43
+ pnpm run build # esbuild → lib/
44
+ ```
45
+
46
+ ## 架构说明
47
+
48
+ - 两个插件都挂在 **host composition**:`interconnect` 是跨 session、跨机器的进程级
49
+ 服务(有 HTTP/WS 端点),必须 host 级;`tool-interconnect` 也放 host,因为
50
+ `interconnect` 未做 TypeRT `@Remote`/Gateway 绑定,放进 agent preset 的 isolate
51
+ realm 会导致工具行无法 inject 到该服务。
52
+ - `ws` 是运行依赖,由宿主的 node_modules 提供(构建时 external)。
53
+
54
+ ## 验证
55
+
56
+ - 21/21 单测通过(服务 16 + 工具 5);类型检查、构建均干净。
57
+ - 已在两台机器之间实测双向互通:消息投递、WebSocket 事件推流、以及 agent 经
58
+ `interconnect_send` 工具反向回发,均验证通过。
59
+ - CI(GitHub Actions):clone 公开 DSH 仓库作为 sibling,跑 `pnpm run check`。
60
+
61
+ ## 许可
62
+
63
+ [MIT](LICENSE),Copyright (c) 2026 Chinesezjc。
@@ -0,0 +1,12 @@
1
+ # dsh-interconnect bundle patch: mount the two host plugins under their
2
+ # subpath entries, resolved through the profile's node_modules (the healed
3
+ # mirror makes every bundle dependency resolvable to bare rows).
4
+ - insert:
5
+ - id: interconnect
6
+ name: dsh-interconnect/interconnect
7
+ config:
8
+ instanceId: dsh
9
+ requestTimeoutMs: 10000
10
+
11
+ - id: tool-interconnect
12
+ name: dsh-interconnect/tool-interconnect
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "dsh-interconnect",
3
+ "description": "Cross-instance message/event handoff for DeepSeek Harness (DSH): HTTP send/ping, WebSocket link, and event fan-out between sessions, instances, and machines.",
4
+ "version": "0.1.0",
5
+ "entry": {
6
+ "name": "dsh-interconnect/interconnect",
7
+ "inject": ["webServer", "agents", "credentials"]
8
+ }
9
+ }