dsh-agy-link 0.6.43 → 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 CHANGED
@@ -1,5 +1,15 @@
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
+
3
13
  ## 0.6.43 (2026-11-20)
4
14
 
5
15
  ### English
package/dist/index.js CHANGED
@@ -37339,6 +37339,28 @@ function writePrivateMcpFile(file, content) {
37339
37339
  chmodSync(file, 384);
37340
37340
  } catch {}
37341
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
+ }
37342
37364
  function writeMcpConfig(file, bridge) {
37343
37365
  const key = mcpServerKey(bridge.port);
37344
37366
  let previous = null;
@@ -37361,16 +37383,7 @@ function writeMcpConfig(file, bridge) {
37361
37383
  const rawPid = (val?.env)?.DSH_MCP_PID;
37362
37384
  if (typeof rawPid === "string" && /^\d+$/.test(rawPid) && !isPidAlive(Number(rawPid))) delete servers[existingKey];
37363
37385
  }
37364
- servers[key] = {
37365
- type: "stdio",
37366
- command: process.execPath,
37367
- args: [bridge.bridgeScript],
37368
- env: {
37369
- DSH_MCP_URL: bridge.url,
37370
- DSH_MCP_TOKEN: bridge.token,
37371
- DSH_MCP_PID: String(process.pid)
37372
- }
37373
- };
37386
+ servers[key] = mcpServerEntry(bridge, process.execPath, process.versions.electron !== void 0);
37374
37387
  root.mcpServers = servers;
37375
37388
  let written = false;
37376
37389
  let writtenBytes = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.43",
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",