cicy-desktop 2.1.187 → 2.1.189

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.187",
3
+ "version": "2.1.189",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -444,16 +444,25 @@ function register({ sidecarLogPath } = {}) {
444
444
  } catch {}
445
445
  }, 500);
446
446
  const child = await sidecar.start({ logPath: sidecarLogPath, force: false, emit });
447
+ // start() 返回 null = ensureEnv 失败(node/brew/tmux 没装成,emit 已说原因)或没 spawn 成。
448
+ // **立刻报错返回**,别进 6 分钟干等(否则 child 一直是 null、break 条件永不成立,drawer 卡在
449
+ // 「进行中」、不翻 error、不出重试按钮 —— 主人实测的 bug)。
450
+ if (!child) {
451
+ clearInterval(tail);
452
+ if (await sidecar.probeExisting(PORT)) { emit({ phase: "done", status: "done", message: "cicy-code 已就绪 :8008" }); return { ok: true }; }
453
+ emit({ phase: "done", status: "error", message: "❌ 环境准备失败(见上方日志),修好后点「重试」" });
454
+ return { ok: false, error: "环境准备失败 — 见安装日志" };
455
+ }
447
456
  // Node 下载 + cicy-code 首次 brew 装依赖很慢 → 等到 ~6 分钟;子进程退出(失败)立即停手。
448
457
  let up = false;
449
458
  for (let i = 0; i < 720; i++) {
450
459
  if (await sidecar.probeExisting(PORT)) { up = true; break; }
451
- if (child && child.exitCode != null) break;
460
+ if (child.exitCode != null) break;
452
461
  await new Promise((r) => setTimeout(r, 500));
453
462
  }
454
463
  clearInterval(tail);
455
464
  if (up) { emit({ phase: "done", status: "done", message: "cicy-code 已就绪 :8008" }); return { ok: true, pid: child?.pid || null }; }
456
- if (child && child.exitCode != null) { emit({ phase: "done", status: "error", message: `cicy-code 启动失败(exit=${child.exitCode}),见上方日志` }); return { ok: false, error: `cicy-code exited (${child.exitCode}) — 见安装日志` }; }
465
+ if (child.exitCode != null) { emit({ phase: "done", status: "error", message: `cicy-code 启动失败(exit=${child.exitCode}),见上方日志` }); return { ok: false, error: `cicy-code exited (${child.exitCode}) — 见安装日志` }; }
457
466
  return { ok: true, pid: child?.pid || null, warning: "6 分钟内未就绪(可能还在装依赖,见日志)" };
458
467
  } catch (err) {
459
468
  emit({ phase: "done", status: "error", message: `启动失败:${err.message}` });
@@ -115,10 +115,11 @@ function brewInstallStream(brew, dep, env, e) {
115
115
  // 返回 { nodeBinDir, registry } 或 null(失败,drawer 已 emit 原因 + 可重试)。
116
116
  async function ensureEnv({ emit } = {}) {
117
117
  const e = emit || (() => {});
118
- // 1) 网络环境 → registry + bottle 镜像
118
+ // 1) 检查网络是否为 CN registry + bottle 镜像
119
+ e({ phase: "net", status: "running", message: `检查网络是否为 CN…` });
119
120
  const cn = process.env.CICY_NPM_REGISTRY ? true : await probeIsCN();
120
121
  const registry = process.env.CICY_NPM_REGISTRY || (cn ? "https://registry.npmmirror.com" : "https://registry.npmjs.org");
121
- e({ phase: "net", status: "running", message: `网络环境:${cn ? "国内(CN)→ npmmirror + USTC bottle 镜像" : "海外 npmjs"}` });
122
+ e({ phase: "net", status: "running", message: `网络:${cn ? "CN" : "非 CN"} registry=${registry.replace(/^https?:\/\//, "")}${cn ? " + 镜像加速" : ""}` });
122
123
 
123
124
  // 2) Node(系统 ≥20 用,否则装 Node 24)
124
125
  const nodeBinDir = await ensureNode({ emit });