dsh-agy-link 0.4.88 → 0.4.90

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,33 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.90 (2026-10-29)
4
+
5
+ ### English
6
+
7
+ - **Fix(config): parse boolean env/plugin values case-insensitively (`TRUE`, `Yes`, `on`, …).**
8
+ - `asBool()` only accepted the exact strings `true`/`1`, so `DSH_AGY_MCP_BRIDGE=TRUE` (or `Yes`/`on`) was silently ignored and fell back to the default — a common footgun for boolean env vars. It now trims + lowercases and accepts `true/1/yes/on` and `false/0/no/off`; anything else still falls back. Adds a regression test.
9
+
10
+ ### 中文
11
+
12
+ - **修复(config):布尔型 env/配置值大小写不敏感(`TRUE`、`Yes`、`on` 等)。**
13
+ - `asBool()` 之前只认精确的 `true`/`1`,于是 `DSH_AGY_MCP_BRIDGE=TRUE`(或 `Yes`/`on`)被静默忽略、回落到默认值——布尔环境变量的常见坑。现 trim+小写后接受 `true/1/yes/on` 与 `false/0/no/off`,其它仍回落。补充回归测试。
14
+
15
+ **Full Changelog**: https://github.com/amlyczz/dsh-agy-link/compare/v0.4.89...v0.4.90
16
+
17
+ ## 0.4.89 (2026-10-29)
18
+
19
+ ### English
20
+
21
+ - **Fix(sessions): use a unique temp file for the atomic store write (multi-process safety).**
22
+ - `SessionStore.persist()` wrote through a deterministic `".sessions.json.tmp"`. Web + headless host processes share one store, so two concurrent persists could interleave into the same temp file and race the rename — corrupting the store or failing a writer with `ENOENT`. Extracted `src/common/atomic-write.ts` (`writeFileAtomicSync`) which uses a per-write unique temp name (`<file>.<pid>.<seq>.<rand>.tmp`) and cleans it up on failure; sessions now uses it. Adds unit tests for uniqueness, no-residue, and failure cleanup.
23
+
24
+ ### 中文
25
+
26
+ - **修复(sessions):原子写改用每次唯一的临时文件(多进程安全)。**
27
+ - `SessionStore.persist()` 之前用固定的 `".sessions.json.tmp"`。Web 与 headless 宿主进程共享同一个 store,并发写会写进同一个临时文件并竞争 rename——导致文件损坏或某个写入者 `ENOENT`。抽出 `src/common/atomic-write.ts`(`writeFileAtomicSync`),临时名每次唯一(`<file>.<pid>.<seq>.<rand>.tmp`),失败时清理;sessions 改用它。补充单测:唯一性、无残留、失败清理。
28
+
29
+ **Full Changelog**: https://github.com/amlyczz/dsh-agy-link/compare/v0.4.88...v0.4.89
30
+
3
31
  ## 0.4.88 (2026-10-29)
4
32
 
5
33
  ### English
package/dist/index.js CHANGED
@@ -451,7 +451,11 @@ function asMcpConfigScope(v) {
451
451
  }
452
452
  function asBool(v) {
453
453
  if (typeof v === "boolean") return v;
454
- if (typeof v === "string") return v === "true" || v === "1";
454
+ if (typeof v === "string") {
455
+ const s = v.trim().toLowerCase();
456
+ if (s === "true" || s === "1" || s === "yes" || s === "on") return true;
457
+ if (s === "false" || s === "0" || s === "no" || s === "off") return false;
458
+ }
455
459
  }
456
460
  function asNum(v) {
457
461
  if (typeof v === "number" && Number.isFinite(v)) return v;
@@ -29454,6 +29458,27 @@ function readAgyRunLogText(homeDir, before) {
29454
29458
  return parts.join("\n");
29455
29459
  }
29456
29460
  //#endregion
29461
+ //#region src/common/atomic-write.ts
29462
+ let seq = 0;
29463
+ /** Unique temp path beside `file` (same directory, so rename stays atomic). */
29464
+ function atomicTmpPath(file) {
29465
+ const rand = Math.random().toString(36).slice(2, 8);
29466
+ return file + "." + process.pid + "." + (seq++).toString(36) + "." + rand + ".tmp";
29467
+ }
29468
+ /** Write `data` to `file` atomically; on any failure remove the temp file. */
29469
+ function writeFileAtomicSync(file, data) {
29470
+ const tmp = atomicTmpPath(file);
29471
+ try {
29472
+ writeFileSync(tmp, data, "utf8");
29473
+ renameSync(tmp, file);
29474
+ } catch (err) {
29475
+ try {
29476
+ if (existsSync(tmp)) unlinkSync(tmp);
29477
+ } catch {}
29478
+ throw err;
29479
+ }
29480
+ }
29481
+ //#endregion
29457
29482
  //#region src/host/sessions.ts
29458
29483
  var SessionStore = class {
29459
29484
  file;
@@ -29540,19 +29565,13 @@ var SessionStore = class {
29540
29565
  const b = this.data[key];
29541
29566
  if (b !== void 0) merged[key] = b;
29542
29567
  }
29543
- const tmp = join(dirname(this.file), "." + require$$basename(this.file) + ".tmp");
29544
- writeFileSync(tmp, JSON.stringify(merged, null, 2), "utf8");
29545
- renameSync(tmp, this.file);
29568
+ writeFileAtomicSync(this.file, JSON.stringify(merged, null, 2));
29546
29569
  this.data = merged;
29547
29570
  this.dirty.clear();
29548
29571
  this.removed.clear();
29549
29572
  } catch {}
29550
29573
  }
29551
29574
  };
29552
- function require$$basename(p) {
29553
- const i = Math.max(p.lastIndexOf("/"), p.lastIndexOf("\\"));
29554
- return i >= 0 ? p.slice(i + 1) : p;
29555
- }
29556
29575
  //#endregion
29557
29576
  //#region src/host/agy-db.ts
29558
29577
  const execFileAsync = promisify(execFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.4.88",
3
+ "version": "0.4.90",
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",