dsh-agy-link 0.6.4 → 0.6.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.5 (2026-11-07)
4
+
5
+ ### English
6
+
7
+ - **Fix(mcp-bridge): bridged calls work again on DSH 0.2.2 — send the batch shape and unwrap its result (issue #84).** (thanks @hjwsm1989, #85)
8
+ - DSH 0.2.2 changed `tools.execute()` from a single call to a batch (`{ calls, signal, agent }`), so the 0.2.1-shaped payload made `executeToolBatch()` read `input.calls` as `undefined` and **every** bridged call died with `ToolBatchExecutionError` before dispatch (whole reverse-MCP surface, including `agent_teams_*`, unusable). The bridge now sends both shapes — 0.2.1 ignores `calls`, 0.2.2 ignores the extra fields — and `settledToolResult()` unwraps `results[0].result` (matched by call id) while passing a 0.2.1 single result through untouched.
9
+ - Hardening on merge: the PTC nested-dispatch `parent` token from #66 is restored, but only for a PTC surface (`run_code` visible), so 0.2.1 PTC keeps working while native calls never carry it (0.2.2 gates PTC on the execution source).
10
+
11
+ ### 中文
12
+
13
+ - **修复(mcp-bridge):DSH 0.2.2 下桥接调用恢复可用——发送批量形状并解包结果(issue #84)。**(感谢 @hjwsm1989,#85)
14
+ - DSH 0.2.2 把 `tools.execute()` 从单次调用改成批量(`{ calls, signal, agent }`),旧的 0.2.1 形状让 `executeToolBatch()` 读到 `undefined` 的 `input.calls`,于是**所有**桥接调用在派发前就 `ToolBatchExecutionError`(整套反向 MCP 面,含 `agent_teams_*`,全部不可用)。现同时发送两种形状(0.2.1 忽略 `calls`,0.2.2 忽略多余字段),并用 `settledToolResult()` 按 call id 解包 `results[0].result`,0.2.1 的单结果原样透传。
15
+ - 合并时加固:恢复 #66 的 PTC 嵌套派发 `parent` 令牌,但**仅在检测到 PTC 面**(可见 `run_code`)时携带,使 0.2.1 的 PTC 继续可用,而 native 调用永不携带(0.2.2 以执行源判定 PTC)。
16
+
17
+ **Full Changelog**: https://github.com/amlyczz/dsh-agy-link/compare/v0.6.4...v0.6.5
18
+
3
19
  ## 0.6.4 (2026-11-07)
4
20
 
5
21
  ### English
package/dist/index.js CHANGED
@@ -36372,6 +36372,18 @@ function resultText(result) {
36372
36372
  }
36373
36373
  }
36374
36374
  /**
36375
+ * Project one settled call out of a DSH 0.2.2 `ToolBatchResult`
36376
+ * (`{ results: [{ callId, result }] }`). A 0.2.1 single `ToolExecutionResult`
36377
+ * (no `results` array) passes through untouched, so the same bridge serves both
36378
+ * API shapes.
36379
+ */
36380
+ function settledToolResult(result, callId) {
36381
+ const results = result?.results;
36382
+ if (!Array.isArray(results) || results.length === 0) return result;
36383
+ const settled = results.find((entry) => entry?.callId === callId) ?? results[0];
36384
+ return settled?.result ?? settled;
36385
+ }
36386
+ /**
36375
36387
  * Start the loopback endpoint. Resolves once listening. The tools service
36376
36388
  * may arrive later (optional service): pass a thunk.
36377
36389
  */
@@ -36458,19 +36470,26 @@ function startMcpBridge(opts) {
36458
36470
  res.once("close", () => {
36459
36471
  if (!res.writableEnded) controller.abort();
36460
36472
  });
36473
+ const callId = "agy-mcp-" + callSeq;
36461
36474
  const isPtc = svc.schemas(agent).some((tool) => tool.name === "run_code");
36462
36475
  const result = await svc.execute({
36463
- callId: "agy-mcp-" + callSeq,
36464
- name: dshName,
36465
- arguments: parsed.arguments ?? {},
36476
+ calls: [{
36477
+ type: "tool-call",
36478
+ id: callId,
36479
+ name: dshName,
36480
+ arguments: JSON.stringify(parsed.arguments ?? {})
36481
+ }],
36466
36482
  signal: controller.signal,
36467
36483
  ...agent === void 0 ? {} : { agent },
36468
- ...isPtc ? { parent: Symbol("agy-mcp-" + callSeq) } : {}
36484
+ callId,
36485
+ name: dshName,
36486
+ arguments: parsed.arguments ?? {},
36487
+ ...isPtc ? { parent: Symbol(callId) } : {}
36469
36488
  });
36470
36489
  audit("ok caller=" + (agent === void 0 ? "none" : "agent"));
36471
36490
  sendJson(res, 200, {
36472
36491
  ok: true,
36473
- text: resultText(result)
36492
+ text: resultText(settledToolResult(result, callId))
36474
36493
  });
36475
36494
  } catch (e) {
36476
36495
  audit("failed: " + String(e).slice(0, 200));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Google Antigravity (agy CLI) models for DeepSeek Harness — stream Gemini/Claude/GPT-OSS subscriptions into DSH with thinking, tool activity, token usage and in-GUI Google OAuth login.",
5
5
  "type": "module",
6
6
  "license": "MIT",