dsh-agy-link 0.6.42 → 0.6.44
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 +22 -0
- package/dist/cli-image.mjs +4 -3
- package/dist/index.js +29 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.44 (2026-11-20)
|
|
4
|
+
|
|
5
|
+
### English
|
|
6
|
+
|
|
7
|
+
- **Fix(mcp-bridge): enabling the MCP bridge on the desktop build no longer steals window focus (fixes #140).** The generated `mcp_config.json` entry used `command: process.execPath`, which on the DSH desktop build is the **Electron** binary — so every time Antigravity spawned our stdio bridge it started a second Electron instance, and that window pulled focus back to DSH on each tool call. When the host really is Electron, the entry now carries `ELECTRON_RUN_AS_NODE=1`, which makes the same binary run as a plain Node process; a normal Node host gets no extra variable. The entry is built by a new `mcpServerEntry()` so the behaviour is unit-testable without spawning anything.
|
|
8
|
+
|
|
9
|
+
### 中文
|
|
10
|
+
|
|
11
|
+
- **修复(mcp-bridge):桌面端开启 MCP bridge 后不再抢走窗口焦点(修复 #140)。** 生成的 `mcp_config.json` 用 `command: process.execPath`,而在 DSH 桌面构建里那就是 **Electron** 可执行文件——于是 Antigravity 每次拉起我们的 stdio bridge 都会启动第二个 Electron 实例,其窗口在每次工具调用时把焦点抢回 DSH。现在检测到宿主确实是 Electron 时,条目会带上 `ELECTRON_RUN_AS_NODE=1`,让同一个二进制以纯 Node 模式运行;普通 Node 宿主不会多出这个变量。条目由新的 `mcpServerEntry()` 构建,因此无需真实 spawn 即可单元测试。
|
|
12
|
+
|
|
13
|
+
## 0.6.43 (2026-11-20)
|
|
14
|
+
|
|
15
|
+
### English
|
|
16
|
+
|
|
17
|
+
- **Fix(host): workspace files no longer 403 on every `/open` and `/media` request (fixes #139).** `activeCwds()` asserted a `values()` method on DSH's session service and guarded it with `typeof … === 'function'`; the real store exposes `list()`/`get(id)`, so the guard was always false and the function always returned `[]`. Every session workspace therefore fell outside the allowed roots and any file link inside it was refused with "path outside allowed workspace roots". It now reads `list()` (falling back to `values()` for hosts that publish that shape) and de-duplicates cwds; a throwing/unusable service still degrades to empty.
|
|
18
|
+
- **Fix(adapter): a DSH context message no longer looks like a user steer (fixes #138).** `detectContinuation()` only skipped trailing `source.kind === 'plugin' && form === 'snapshot'`, but DSH 0.2.2 producers each use their own kind (`time-context`, `agent-instructions`, `plugin:<name>` — dsh-llm has no catch-all `plugin` kind). Any of them after a tool result made the adapter treat the continuation as a fresh user request: it aborted the live agy run, injected "the previous turn was interrupted … respond only to the newest request", and the in-progress work was dropped. The scan now skips exactly what `isSyntheticHarnessMessage()` classifies as harness-injected (that predicate gained `agent-instructions` and the `plugin:<name>` family), while a real typed message — and any unknown boundary — still ends the scan as before.
|
|
19
|
+
|
|
20
|
+
### 中文
|
|
21
|
+
|
|
22
|
+
- **修复(host):工作区文件不再在每次 `/open` 与 `/media` 请求上 403(修复 #139)。** `activeCwds()` 对 DSH 会话服务断言了 `values()` 并用 `typeof … === 'function'` 守卫;而真实的 store 只暴露 `list()` / `get(id)`,于是守卫恒为 false、函数永远返回 `[]`。所有会话工作区因此落在白名单之外,工作区内的文件链接一律被拒并报 "path outside allowed workspace roots"。现在读取 `list()`(对只提供 `values()` 的宿主回退),并去重 cwd;抛错时仍降级为空。
|
|
23
|
+
- **修复(adapter):DSH 的上下文消息不再被误判为用户插话(修复 #138)。** `detectContinuation()` 原先只跳过末尾 `source.kind === 'plugin' && form === 'snapshot'`,但 DSH 0.2.2 的各个生产者各有自己的 kind(`time-context`、`agent-instructions`、`plugin:<name>`——dsh-llm 并没有统一的 `plugin` kind)。工具结果之后只要出现其中之一,适配器就会把续接当成新的用户请求:中止正在运行的 agy run、注入「上一轮被中断…只回应最新请求」,进行中的工作被放弃。现在扫描只跳过 `isSyntheticHarnessMessage()` 认定为宿主注入的消息(该判定新增 `agent-instructions` 与 `plugin:<name>` 家族),真实用户文本与任何未知边界仍会像以前一样终止扫描。
|
|
24
|
+
|
|
3
25
|
## 0.6.42 (2026-11-20)
|
|
4
26
|
|
|
5
27
|
### English
|
package/dist/cli-image.mjs
CHANGED
|
@@ -5798,7 +5798,8 @@ function isSyntheticHarnessMessage(m) {
|
|
|
5798
5798
|
const src = m.source;
|
|
5799
5799
|
const kind = src?.kind;
|
|
5800
5800
|
if (kind !== void 0 && kind !== "" && kind !== "user") {
|
|
5801
|
-
if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "synthetic") return true;
|
|
5801
|
+
if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "agent-instructions" || kind === "synthetic") return true;
|
|
5802
|
+
if (kind.startsWith("plugin:")) return true;
|
|
5802
5803
|
if (kind === "plugin" && src.form === "snapshot") return true;
|
|
5803
5804
|
}
|
|
5804
5805
|
const text = textOf(m).trim();
|
|
@@ -34854,8 +34855,8 @@ function toolCallIdOf(m) {
|
|
|
34854
34855
|
function detectContinuation(messages) {
|
|
34855
34856
|
let i = messages.length - 1;
|
|
34856
34857
|
while (i >= 0) {
|
|
34857
|
-
|
|
34858
|
-
if (
|
|
34858
|
+
if (messages[i].role !== "user") break;
|
|
34859
|
+
if (!isSyntheticHarnessMessage(messages[i])) break;
|
|
34859
34860
|
i--;
|
|
34860
34861
|
}
|
|
34861
34862
|
const last = messages[i];
|
package/dist/index.js
CHANGED
|
@@ -33220,7 +33220,8 @@ function isSyntheticHarnessMessage(m) {
|
|
|
33220
33220
|
const src = m.source;
|
|
33221
33221
|
const kind = src?.kind;
|
|
33222
33222
|
if (kind !== void 0 && kind !== "" && kind !== "user") {
|
|
33223
|
-
if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "synthetic") return true;
|
|
33223
|
+
if (kind === "time-context" || kind === "skill-catalog" || kind === "runtime-context" || kind === "model-selection" || kind === "system-reminder" || kind === "dsh-session-title-llm" || kind === "tool-goal" || kind === "agent-instructions" || kind === "synthetic") return true;
|
|
33224
|
+
if (kind.startsWith("plugin:")) return true;
|
|
33224
33225
|
if (kind === "plugin" && src.form === "snapshot") return true;
|
|
33225
33226
|
}
|
|
33226
33227
|
const text = textOf(m).trim();
|
|
@@ -35647,8 +35648,8 @@ function toolCallIdOf(m) {
|
|
|
35647
35648
|
function detectContinuation(messages) {
|
|
35648
35649
|
let i = messages.length - 1;
|
|
35649
35650
|
while (i >= 0) {
|
|
35650
|
-
|
|
35651
|
-
if (
|
|
35651
|
+
if (messages[i].role !== "user") break;
|
|
35652
|
+
if (!isSyntheticHarnessMessage(messages[i])) break;
|
|
35652
35653
|
i--;
|
|
35653
35654
|
}
|
|
35654
35655
|
const last = messages[i];
|
|
@@ -37338,6 +37339,28 @@ function writePrivateMcpFile(file, content) {
|
|
|
37338
37339
|
chmodSync(file, 384);
|
|
37339
37340
|
} catch {}
|
|
37340
37341
|
}
|
|
37342
|
+
/**
|
|
37343
|
+
* The `mcpServers` entry that points Antigravity at our stdio bridge.
|
|
37344
|
+
*
|
|
37345
|
+
* On the DSH desktop build `execPath` is the ELECTRON binary, so launching the
|
|
37346
|
+
* bridge that way started a second Electron instance whose window stole focus
|
|
37347
|
+
* every time a tool call spawned the server (issue #140). `ELECTRON_RUN_AS_NODE`
|
|
37348
|
+
* makes that same binary behave as a plain Node process; a real `node` binary
|
|
37349
|
+
* ignores it, so it is only added when the host actually is Electron.
|
|
37350
|
+
*/
|
|
37351
|
+
function mcpServerEntry(bridge, execPath, isElectron) {
|
|
37352
|
+
return {
|
|
37353
|
+
type: "stdio",
|
|
37354
|
+
command: execPath,
|
|
37355
|
+
args: [bridge.bridgeScript],
|
|
37356
|
+
env: {
|
|
37357
|
+
DSH_MCP_URL: bridge.url,
|
|
37358
|
+
DSH_MCP_TOKEN: bridge.token,
|
|
37359
|
+
DSH_MCP_PID: String(process.pid),
|
|
37360
|
+
...isElectron ? { ELECTRON_RUN_AS_NODE: "1" } : {}
|
|
37361
|
+
}
|
|
37362
|
+
};
|
|
37363
|
+
}
|
|
37341
37364
|
function writeMcpConfig(file, bridge) {
|
|
37342
37365
|
const key = mcpServerKey(bridge.port);
|
|
37343
37366
|
let previous = null;
|
|
@@ -37360,16 +37383,7 @@ function writeMcpConfig(file, bridge) {
|
|
|
37360
37383
|
const rawPid = (val?.env)?.DSH_MCP_PID;
|
|
37361
37384
|
if (typeof rawPid === "string" && /^\d+$/.test(rawPid) && !isPidAlive(Number(rawPid))) delete servers[existingKey];
|
|
37362
37385
|
}
|
|
37363
|
-
servers[key] =
|
|
37364
|
-
type: "stdio",
|
|
37365
|
-
command: process.execPath,
|
|
37366
|
-
args: [bridge.bridgeScript],
|
|
37367
|
-
env: {
|
|
37368
|
-
DSH_MCP_URL: bridge.url,
|
|
37369
|
-
DSH_MCP_TOKEN: bridge.token,
|
|
37370
|
-
DSH_MCP_PID: String(process.pid)
|
|
37371
|
-
}
|
|
37372
|
-
};
|
|
37386
|
+
servers[key] = mcpServerEntry(bridge, process.execPath, process.versions.electron !== void 0);
|
|
37373
37387
|
root.mcpServers = servers;
|
|
37374
37388
|
let written = false;
|
|
37375
37389
|
let writtenBytes = "";
|
|
@@ -41544,7 +41558,8 @@ function createHostServices(ctx, entryConfig = {}) {
|
|
|
41544
41558
|
const list = [];
|
|
41545
41559
|
try {
|
|
41546
41560
|
const svc = sessionsSvc();
|
|
41547
|
-
|
|
41561
|
+
const source = typeof svc?.list === "function" ? svc.list() : typeof svc?.values === "function" ? svc.values() : [];
|
|
41562
|
+
for (const s of source) {
|
|
41548
41563
|
const cwd = s?.header?.cwd;
|
|
41549
41564
|
if (cwd && !list.includes(cwd)) list.push(cwd);
|
|
41550
41565
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agy-link",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.44",
|
|
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",
|