dsh-agy-link 0.6.37 → 0.6.38

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.38 (2026-11-19)
4
+
5
+ ### English
6
+
7
+ - **Fix(host): a missing OS opener no longer kills the DSH process (fixes #129, merges PR #132).** `executeOpenInSystem()` called `spawn('xdg-open', …)` with no `error` listener. A missing (ENOENT) or non-executable (EACCES) opener is reported **asynchronously**, so the surrounding try/catch never saw it and Node raised an `uncaughtException` — on a headless Linux host every "open in app" click exited the server (systemd restarted it four times). New `spawnDetachedOpener()` attaches the listener before the first tick on every platform branch, so a launch failure is contained instead of fatal; a synchronous throw still reports `{ ok: false, error }`. On headless hosts the click is now a silent no-op rather than a crash — an explicit "no desktop session" message would need a logger in the route, tracked but not bundled here.
8
+ - **Fix(quota): a shared Gemini pool is no longer misfiled as a dedicated Argon pool (fixes #130, merges PR #131).** Since agy 1.5.12 the plain `Gemini Models` group describes itself as "Models within this group: Gemini 4 Neon, … Gemini 4 Argon, …", and both `summaryHasArgonGroup()` and the summary→family mapping treated any `description` containing "argon" as proof of a dedicated pool. The shared pool was then written to the `argon` family, `google` lost its weekly numbers, a phantom `Argon` row appeared, and `noteDedicatedGroup('argon')` skewed selection and cooldown release. Dedicated-pool detection now accepts only the **group display name** or a **bucket id/name** containing "argon"; description-only mentions are ignored, while real Argon groups (`Gemini 4 Argon`, `argon-weekly`) are still recognised and the folded-into-Gemini case is unchanged.
9
+
10
+ ### 中文
11
+
12
+ - **修复(host):缺失的系统打开器不再杀死 DSH 进程(修复 #129,合并 PR #132)。** `executeOpenInSystem()` 直接 `spawn('xdg-open', …)` 且没有 `error` 监听。可执行文件缺失(ENOENT)或不可执行(EACCES)是**异步**通过 `error` 事件上报的,外层 try/catch 捕获不到,Node 于是抛 `uncaughtException`——在 headless Linux 上每次点「打开」都会让服务退出(systemd 连着重启了四次)。新增 `spawnDetachedOpener()`,在所有平台分支的第一个 tick 之前挂好监听,启动失败被收敛而不是致命;同步抛错仍返回 `{ ok: false, error }`。headless 主机上现在表现为静默无操作而非崩溃;若要在 UI 上明确提示「没有桌面会话」,需要路由层具备 logger,已记录但不在本次捆绑。
13
+ - **修复(额度):共享 Gemini 池不再被误判为独立 Argon 池(修复 #130,合并 PR #131)。** agy 1.5.12 起普通 `Gemini Models` 组的 description 会枚举成员(「Models within this group: Gemini 4 Neon, … Gemini 4 Argon, …」),而 `summaryHasArgonGroup()` 与 summary→family 映射都把「description 含 argon」当作独立池证据。结果共享池被写进 `argon` 族、`google` 丢掉 weekly 数字、面板多出假的 `Argon` 行,`noteDedicatedGroup('argon')` 还会影响选号与 cooldown 释放。现在独立池只由**组 displayName** 或 **bucket id/name** 含 "argon" 认定;description-only 的提及被忽略,真实 Argon 组(`Gemini 4 Argon`、`argon-weekly`)仍能识别,「Argon 已并入 Gemini」的折叠场景行为不变。
14
+
3
15
  ## 0.6.37 (2026-11-19)
4
16
 
5
17
  ### English
package/dist/index.js CHANGED
@@ -39189,7 +39189,7 @@ function mergeFallbackFamilyQuota(prev, fallback) {
39189
39189
  */
39190
39190
  function summaryHasArgonGroup(groups) {
39191
39191
  return groups.some((group) => {
39192
- const fields = [group.displayName, group.description];
39192
+ const fields = [group.displayName];
39193
39193
  for (const bucket of group.buckets ?? []) fields.push(bucket.bucketId, bucket.displayName);
39194
39194
  return fields.some((value) => typeof value === "string" && value.toLowerCase().includes("argon"));
39195
39195
  });
@@ -39319,7 +39319,7 @@ function ingestSummaryGroups(summaryGroups, now, familyQuotas, stale5hFamilies)
39319
39319
  const dName = (group.displayName || "").toLowerCase();
39320
39320
  const desc = (group.description || "").toLowerCase();
39321
39321
  const hasArgonBucket = Array.isArray(group.buckets) && group.buckets.some((b) => (b.bucketId || "").toLowerCase().includes("argon") || (b.displayName || "").toLowerCase().includes("argon"));
39322
- const isArgon = dName.includes("argon") || desc.includes("argon") || hasArgonBucket;
39322
+ const isArgon = dName.includes("argon") || hasArgonBucket;
39323
39323
  const isGoogle = !isArgon && (dName.includes("gemini") || desc.includes("gemini"));
39324
39324
  const is3P = dName.includes("claude") || dName.includes("gpt") || desc.includes("claude") || desc.includes("gpt");
39325
39325
  const targetFamilies = isArgon ? ["argon"] : isGoogle ? ["google"] : is3P ? ["anthropic", "openai"] : [];
@@ -42471,21 +42471,52 @@ function handleMediaRequest(req, res, opts = {}) {
42471
42471
  res.end("failed to read media: " + String(err));
42472
42472
  }
42473
42473
  }
42474
+ /**
42475
+ * Launch one detached OS opener without letting a launch failure kill the host.
42476
+ *
42477
+ * `spawn()` reports a missing (ENOENT) or non-executable (EACCES) target
42478
+ * asynchronously as an `error` event, so a surrounding try/catch never sees it:
42479
+ * with no listener Node raises an `uncaughtException` and the whole dsh process
42480
+ * exits. On a headless Linux host every "open in app" click therefore killed the
42481
+ * server (systemd then restarted it), because `xdg-open` is not installed.
42482
+ *
42483
+ * The listener is the entire point of this helper: it turns a launch failure
42484
+ * into a silent no-op instead of a process-killing exception. A synchronous
42485
+ * throw still reports `false` so callers can answer with an error.
42486
+ *
42487
+ * @param command executable path or PATH name.
42488
+ * @param args argv (never a shell string).
42489
+ * @param spawnImpl injection seam for tests.
42490
+ * @returns true when the child was started, false when spawn threw synchronously.
42491
+ */
42492
+ function spawnDetachedOpener(command, args, spawnImpl = spawn) {
42493
+ try {
42494
+ const child = spawnImpl(command, [...args], {
42495
+ detached: true,
42496
+ stdio: "ignore"
42497
+ });
42498
+ child.on("error", () => {});
42499
+ child.unref();
42500
+ return true;
42501
+ } catch {
42502
+ return false;
42503
+ }
42504
+ }
42474
42505
  function executeOpenInSystem(targetPath, reveal = false) {
42475
42506
  try {
42476
42507
  if (process.platform === "darwin") {
42477
- spawn("open", reveal ? ["-R", targetPath] : [targetPath], {
42478
- detached: true,
42479
- stdio: "ignore"
42480
- }).unref();
42508
+ if (!spawnDetachedOpener("open", reveal ? ["-R", targetPath] : [targetPath])) return {
42509
+ ok: false,
42510
+ error: "failed to launch the system opener"
42511
+ };
42481
42512
  return { ok: true };
42482
42513
  }
42483
42514
  if (process.platform === "win32") {
42484
42515
  if (reveal) {
42485
- spawn("explorer.exe", [`/select,${targetPath}`], {
42486
- detached: true,
42487
- stdio: "ignore"
42488
- }).unref();
42516
+ if (!spawnDetachedOpener("explorer.exe", [`/select,${targetPath}`])) return {
42517
+ ok: false,
42518
+ error: "failed to launch explorer.exe"
42519
+ };
42489
42520
  return { ok: true };
42490
42521
  }
42491
42522
  try {
@@ -42517,30 +42548,19 @@ function executeOpenInSystem(targetPath, reveal = false) {
42517
42548
  ".py",
42518
42549
  ".gd",
42519
42550
  ".log"
42520
- ].includes(ext)) try {
42521
- spawn("notepad.exe", [targetPath], {
42522
- detached: true,
42523
- stdio: "ignore"
42524
- }).unref();
42525
- return { ok: true };
42526
- } catch {}
42527
- try {
42528
- spawn("explorer.exe", [`/select,${targetPath}`], {
42529
- detached: true,
42530
- stdio: "ignore"
42531
- }).unref();
42532
- return { ok: true };
42533
- } catch (err) {
42534
- return {
42535
- ok: false,
42536
- error: String(err)
42537
- };
42551
+ ].includes(ext)) {
42552
+ if (spawnDetachedOpener("notepad.exe", [targetPath])) return { ok: true };
42538
42553
  }
42554
+ if (!spawnDetachedOpener("explorer.exe", [`/select,${targetPath}`])) return {
42555
+ ok: false,
42556
+ error: "failed to launch explorer.exe"
42557
+ };
42558
+ return { ok: true };
42539
42559
  }
42540
- spawn("xdg-open", [targetPath], {
42541
- detached: true,
42542
- stdio: "ignore"
42543
- }).unref();
42560
+ if (!spawnDetachedOpener("xdg-open", [targetPath])) return {
42561
+ ok: false,
42562
+ error: "failed to launch xdg-open"
42563
+ };
42544
42564
  return { ok: true };
42545
42565
  } catch (err) {
42546
42566
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agy-link",
3
- "version": "0.6.37",
3
+ "version": "0.6.38",
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",