@nelsonlongxiang/dsh-open-a2a-net 0.5.13 → 0.5.15

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @nelsonlongxiang/dsh-open-a2a-net
2
2
 
3
+ English | [中文](README_zh.md)
4
+
5
+ [![npm](https://img.shields.io/npm/v/@nelsonlongxiang/dsh-open-a2a-net?label=npm)](https://www.npmjs.com/package/@nelsonlongxiang/dsh-open-a2a-net)
6
+
3
7
  Open A2A network plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH): turns a DSH
4
8
  deployment into one node of a decentralized agent network — no central server, no registry.
5
9
 
@@ -16,14 +20,16 @@ node** other hosts can discover and join from the web sidebar.
16
20
  ## Install
17
21
 
18
22
  ```sh
19
- npx -p @deepseek-ai/dsh dsh plugin --profile <name> add @nelsonlongxiang/dsh-open-a2a-net
23
+ dsh plugin --profile web add @nelsonlongxiang/dsh-open-a2a-net
20
24
  ```
21
25
 
26
+ Restart `dsh web`, then open the sidebar network panel (footer action).
27
+
22
28
  (As a package specifier, a local path, or a Git URL; the package runs `pnpm build` in `prepare`, so a source
23
29
  install builds on install. Note: a standalone Git install currently fails to build outside a DSH profile —
24
30
  the official `@deepseek-ai/*` npm packages lag the harness source this plugin compiles against, so install
25
- from the registry or inside a profile whose harness provides current `@deepseek-ai` peers.) Then restart the
26
- profile. The plugin composes beside the stock
31
+ from the registry or inside a profile whose harness provides current `@deepseek-ai` peers.) The plugin composes
32
+ beside the stock
27
33
  webserver row: it registers its card, state, and control routes on the shared listener and its model tools on the
28
34
  shared tool runtime.
29
35
 
package/README_zh.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
+ [![npm](https://img.shields.io/npm/v/@nelsonlongxiang/dsh-open-a2a-net?label=npm)](https://www.npmjs.com/package/@nelsonlongxiang/dsh-open-a2a-net)
6
+
5
7
  面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的开放 A2A 网络插件:把一个 DSH 部署变成去中心化 agent 网络中的一个节点——没有中心服务器,没有注册中心。
6
8
 
7
9
  每个节点在 `/.well-known/agent-card.json` 发布**带签名、会过期**的 agent 卡片,通过**种子 URL 与相互引荐**发现 peers(每张卡片列出它认识的节点),通过**区域委托**解析名字(GNUnet GNS 风格:卡片可把一个名字委托给另一个 zone),并**直连**路由到 peer 的团队、在可达半数候选间故障切换。每个主会话还可以作为**会话节点**暴露,供其他宿主从 Web 侧栏发现并加入。
@@ -13,10 +15,12 @@
13
15
  ## 安装
14
16
 
15
17
  ```sh
16
- npx -p @deepseek-ai/dsh dsh plugin --profile <name> add @nelsonlongxiang/dsh-open-a2a-net
18
+ dsh plugin --profile web add @nelsonlongxiang/dsh-open-a2a-net
17
19
  ```
18
20
 
19
- (支持包名、本地路径或 Git URL;包内 `prepare` 会在安装时执行 `pnpm build`。注意:脱离 DSH profile 的独立 Git 安装目前无法构建——官方 `@deepseek-ai/*` npm 快照落后于本插件编译所对照的 harness 源码,请从 registry 安装,或在由 harness 提供当前 `@deepseek-ai` peers 的 profile 内安装。)然后重启 profile。插件组合在标准 webserver 行旁边:在共享监听器上注册卡片、状态与控制路由,在共享工具运行时上注册模型工具。
21
+ 重启 `dsh web`,打开侧栏网络面板(底部入口)。
22
+
23
+ (支持包名、本地路径或 Git URL;包内 `prepare` 会在安装时执行 `pnpm build`。注意:脱离 DSH profile 的独立 Git 安装目前无法构建——官方 `@deepseek-ai/*` npm 快照落后于本插件编译所对照的 harness 源码,请从 registry 安装,或在由 harness 提供当前 `@deepseek-ai` peers 的 profile 内安装。)插件组合在标准 webserver 行旁边:在共享监听器上注册卡片、状态与控制路由,在共享工具运行时上注册模型工具。
20
24
 
21
25
  ## 你能得到什么
22
26
 
package/lib/index.js CHANGED
@@ -38,6 +38,7 @@ export const Config = s.object({
38
38
  dshHome: s.string().default(''),
39
39
  sessionNodes: s.boolean().default(true),
40
40
  wakeJoinedOnBoot: s.boolean().default(false),
41
+ wakeBootStaggerMs: s.number().default(3_000),
41
42
  cardTtlMs: s.number().default(172_800_000),
42
43
  flushTimeoutMs: s.number().default(300_000),
43
44
  routeTimeoutMs: s.number().default(1_800_000),
@@ -464,13 +465,31 @@ export function apply(ctx, config) {
464
465
  logger.warn('wakeJoinedOnBoot is on but no api gateway is composed; cold joined sessions stay asleep');
465
466
  return;
466
467
  }
468
+ // Serial with a configurable pause: one full log replay at a time
469
+ // keeps the decode from saturating the event loop (concurrent wakes
470
+ // of several huge logs stalled every request for tens of seconds).
471
+ // The first wake starts immediately; the re-check drops ids another
472
+ // path (wake-on-route, a manual open) already materialized.
473
+ let bootWakeChain = Promise.resolve();
474
+ let firstBootWake = true;
467
475
  for (const id of joinedSessions.list()) {
468
476
  if (liveRoots.has(id))
469
477
  continue;
470
478
  // The remount listener joins the node the moment the woken agent
471
479
  // publishes; a failed wake keeps the cold row and its intent.
472
- materialize(id)?.catch((error) => {
473
- logger.warn(`boot wake of ${id} failed: ${String(error)}`);
480
+ const pauseMs = firstBootWake ? 0 : config.wakeBootStaggerMs;
481
+ firstBootWake = false;
482
+ bootWakeChain = bootWakeChain.then(async () => {
483
+ if (pauseMs > 0)
484
+ await new Promise(resolve => setTimeout(resolve, pauseMs));
485
+ if (liveRoots.has(id))
486
+ return;
487
+ try {
488
+ await materialize(id);
489
+ }
490
+ catch (error) {
491
+ logger.warn(`boot wake of ${id} failed: ${String(error)}`);
492
+ }
474
493
  });
475
494
  }
476
495
  };
@@ -89,6 +89,15 @@ export interface Config {
89
89
  * the sidebar's wake button remain available).
90
90
  */
91
91
  readonly wakeJoinedOnBoot: boolean;
92
+ /**
93
+ * Pause between consecutive boot wakes. Each wake replays a full session
94
+ * log — the zstd decode yields the event loop only every 500ms — so
95
+ * unbounded concurrent wakes of several huge logs starve every request
96
+ * for tens of seconds after a restart. The serial queue with this pause
97
+ * keeps the preheat while capping decode saturation: the first wake
98
+ * starts immediately, and wake-on-route never waits on this queue.
99
+ */
100
+ readonly wakeBootStaggerMs: number;
92
101
  /**
93
102
  * `final` reply budget: how long an inbound direct route waits for the
94
103
  * session's next assistant message before answering with a timeout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nelsonlongxiang/dsh-open-a2a-net",
3
- "version": "0.5.13",
3
+ "version": "0.5.15",
4
4
  "description": "Open A2A network plugin for DeepSeek Harness: signed agent cards, decentralized peer/zone discovery, direct routing model tools, and joinable session nodes with a sidebar control",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",