dsh-interconnect 0.11.22 → 0.11.24
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 +23 -3
- package/dsh.plugin.json +1 -1
- package/lib/index.js +2 -4
- package/lib/interconnect/index.js +2 -4
- package/lib/interconnect/index.js.map +2 -2
- package/lib/tool-interconnect/index.js +2 -4
- package/lib/tool-interconnect/index.js.map +2 -2
- package/lib/types/interconnect/index.d.ts +16 -0
- package/lib/types/interconnect/index.d.ts.map +1 -1
- package/lib/types/interconnect/types.d.ts +21 -11
- package/lib/types/interconnect/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
跨实例消息互通与事件通知插件,用于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH)。
|
|
4
4
|
让一个 DSH 实例能向同一个实例、另一台机器、或另一台机器上的别的 DSH 实例发送消息、探测活性,并在实例之间双向推送事件。
|
|
5
5
|
|
|
6
|
+
> **项目状态(2026-09-16)**:本仓库是该插件的**树外(out-of-tree)主源**。并入 DSH monorepo 的计划(PR #3243)已按「保持树外」的评审意见关闭;插件继续经 npm 分发(`dsh-interconnect`),并由团队内部的插件集合仓以 git submodule 引用本仓库。
|
|
7
|
+
|
|
6
8
|
## 包含三个插件
|
|
7
9
|
|
|
8
10
|
**`interconnect`** —— host 服务(`ctx.interconnect`):
|
|
@@ -237,9 +239,27 @@ dsh plugin --profile <name> add file:/path/to/dsh-interconnect
|
|
|
237
239
|
|
|
238
240
|
registry 上的 tarball 自带 `lib/*.js` 与 `lib/types/**/*.d.ts`,安装时不跑构建。
|
|
239
241
|
|
|
240
|
-
`dsh plugin add` 会把仓库识别为 bundle 并追加进 profile 的 `dsh.profile.bundles
|
|
241
|
-
|
|
242
|
-
`
|
|
242
|
+
`dsh plugin add` 会把仓库识别为 bundle 并追加进 profile 的 `dsh.profile.bundles`。这次改动
|
|
243
|
+
落在**组合层**:`@deepseek-ai/dsh-base` 插入的 `hmr` 行监听 profile 的 `package.json`,
|
|
244
|
+
manifest 一变就重读 `dsh.profile.bundles` 并重算 patch 层,所以新增的行会在几秒内插进
|
|
245
|
+
运行中的树并激活,**不需要重启**。已实测:安装前 `GET /interconnect/link` 返回 404,安装后
|
|
246
|
+
6 秒内同一请求返回 403(插件 fail-closed 的应答)。
|
|
247
|
+
|
|
248
|
+
插件**代码**的更新属于另一层,必须重启该实例:hmr 的模块监听根在 base 里是空的
|
|
249
|
+
(`root: []`)且跳过 `node_modules`,已经导入的模块不会重载。升级已装插件、或在 `file:`
|
|
250
|
+
安装下重建 `lib/`,都落在这一类。没有 `profileContext` 的启动方式(`hmr` 行被禁用)也只能靠
|
|
251
|
+
重启。
|
|
252
|
+
|
|
253
|
+
两端实例用相同的 `DSH_INTERCONNECT_TOKEN` 作为共享密钥,任选一种来源:继承的进程环境变量、
|
|
254
|
+
`$DSH_HOME/.env`、或 `$DSH_HOME/.credentials.yaml` 的 `refs` 段(该 provider 由
|
|
255
|
+
`@deepseek-ai/dsh-base` 挂载;优先级为 继承的环境 > credentials 文档 > 调用目录的 `.env` >
|
|
256
|
+
`$DSH_HOME/.env`):
|
|
257
|
+
|
|
258
|
+
```yaml
|
|
259
|
+
version: 1
|
|
260
|
+
refs:
|
|
261
|
+
DSH_INTERCONNECT_TOKEN: <两端相同的共享密钥>
|
|
262
|
+
```
|
|
243
263
|
|
|
244
264
|
## 开发
|
|
245
265
|
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.11.
|
|
4
|
+
"version": "0.11.24",
|
|
5
5
|
"entry": {
|
|
6
6
|
"name": "dsh-interconnect/interconnect",
|
|
7
7
|
"inject": ["agents", "credentials"]
|
package/lib/index.js
CHANGED
|
@@ -831,7 +831,6 @@ function assertNever(value) {
|
|
|
831
831
|
throw new Error(`interconnect: unhandled variant ${JSON.stringify(value)}`);
|
|
832
832
|
}
|
|
833
833
|
var INTERCONNECT_TOKEN_REF = "DSH_INTERCONNECT_TOKEN";
|
|
834
|
-
var PLUGIN_SOURCE = "dsh-interconnect";
|
|
835
834
|
var MAX_LINK_FRAME_BYTES = 1024 * 1024;
|
|
836
835
|
var DEFAULT_INSTANCE_ID = "dsh";
|
|
837
836
|
var DEFAULT_REQUEST_TIMEOUT_MS = 1e4;
|
|
@@ -1440,8 +1439,7 @@ var InterconnectService = class extends Service {
|
|
|
1440
1439
|
})();
|
|
1441
1440
|
const message = createUserMessage({
|
|
1442
1441
|
source: {
|
|
1443
|
-
kind: "plugin",
|
|
1444
|
-
plugin: PLUGIN_SOURCE,
|
|
1442
|
+
kind: "plugin:dsh-interconnect",
|
|
1445
1443
|
form: "notice",
|
|
1446
1444
|
summary: boundContextSummary(
|
|
1447
1445
|
sender === void 0 ? `interconnect handoff delivered on instance ${this.instanceId}` : `interconnect handoff from ${sender.instanceId} (session ${sender.sessionId}) delivered on instance ${this.instanceId}`
|
|
@@ -1735,7 +1733,7 @@ function timingSafeEqual(a, b) {
|
|
|
1735
1733
|
return constantTimeEqual(createHash("sha256").update(a, "utf8").digest(), createHash("sha256").update(b, "utf8").digest());
|
|
1736
1734
|
}
|
|
1737
1735
|
function linkUrl(origin) {
|
|
1738
|
-
const url = new URL(
|
|
1736
|
+
const url = new URL(LINK_CHANNEL, origin);
|
|
1739
1737
|
if (url.protocol === "http:") url.protocol = "ws:";
|
|
1740
1738
|
else if (url.protocol === "https:") url.protocol = "wss:";
|
|
1741
1739
|
if (url.protocol !== "ws:" && url.protocol !== "wss:") {
|
|
@@ -831,7 +831,6 @@ function assertNever(value) {
|
|
|
831
831
|
throw new Error(`interconnect: unhandled variant ${JSON.stringify(value)}`);
|
|
832
832
|
}
|
|
833
833
|
var INTERCONNECT_TOKEN_REF = "DSH_INTERCONNECT_TOKEN";
|
|
834
|
-
var PLUGIN_SOURCE = "dsh-interconnect";
|
|
835
834
|
var MAX_LINK_FRAME_BYTES = 1024 * 1024;
|
|
836
835
|
var DEFAULT_INSTANCE_ID = "dsh";
|
|
837
836
|
var DEFAULT_REQUEST_TIMEOUT_MS = 1e4;
|
|
@@ -1440,8 +1439,7 @@ var InterconnectService = class extends Service {
|
|
|
1440
1439
|
})();
|
|
1441
1440
|
const message = createUserMessage({
|
|
1442
1441
|
source: {
|
|
1443
|
-
kind: "plugin",
|
|
1444
|
-
plugin: PLUGIN_SOURCE,
|
|
1442
|
+
kind: "plugin:dsh-interconnect",
|
|
1445
1443
|
form: "notice",
|
|
1446
1444
|
summary: boundContextSummary(
|
|
1447
1445
|
sender === void 0 ? `interconnect handoff delivered on instance ${this.instanceId}` : `interconnect handoff from ${sender.instanceId} (session ${sender.sessionId}) delivered on instance ${this.instanceId}`
|
|
@@ -1735,7 +1733,7 @@ function timingSafeEqual(a, b) {
|
|
|
1735
1733
|
return constantTimeEqual(createHash("sha256").update(a, "utf8").digest(), createHash("sha256").update(b, "utf8").digest());
|
|
1736
1734
|
}
|
|
1737
1735
|
function linkUrl(origin) {
|
|
1738
|
-
const url = new URL(
|
|
1736
|
+
const url = new URL(LINK_CHANNEL, origin);
|
|
1739
1737
|
if (url.protocol === "http:") url.protocol = "ws:";
|
|
1740
1738
|
else if (url.protocol === "https:") url.protocol = "wss:";
|
|
1741
1739
|
if (url.protocol !== "ws:" && url.protocol !== "wss:") {
|