cicy-desktop 2.1.233 → 2.1.235

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.233",
3
+ "version": "2.1.235",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -144,11 +144,11 @@
144
144
  "//optionalDependencies": "(2026-06 回调): mac/linux 改回 native cicy-code(:8008,colima 在 16G mac 上压垮内存)→ 重新内置 cicy-code-<plat> / cicy-mihomo-<plat>,localbin.fromBundle 零网络 seed(npm 仅作更新通道,带 npmmirror→npmjs 回退)。这些由 scripts/sync-runtime-deps.cjs 在 tag-push 时同步到最新版。npm 的 os/cpu 字段保证每个平台只装自己那份。Windows 仍走 docker(WSL :8009),它那份 cicy-code-windows 用不到但 bundle 着无害。",
145
145
  "optionalDependencies": {
146
146
  "electron": "41.0.3",
147
- "cicy-code-darwin-x64": "2.3.189",
148
- "cicy-code-darwin-arm64": "2.3.189",
149
- "cicy-code-linux-x64": "2.3.189",
150
- "cicy-code-linux-arm64": "2.3.189",
151
- "cicy-code-windows-x64": "2.3.189",
147
+ "cicy-code-darwin-x64": "2.3.190",
148
+ "cicy-code-darwin-arm64": "2.3.190",
149
+ "cicy-code-linux-x64": "2.3.190",
150
+ "cicy-code-linux-arm64": "2.3.190",
151
+ "cicy-code-windows-x64": "2.3.190",
152
152
  "cicy-mihomo-darwin-x64": "1.10.4",
153
153
  "cicy-mihomo-darwin-arm64": "1.10.4",
154
154
  "cicy-mihomo-linux-x64": "1.10.4",
@@ -543,6 +543,20 @@ function projectsMountArg() {
543
543
  } catch (e) { log.warn(`[wsl-docker] projects mount setup failed: ${e.message}`); return ""; }
544
544
  }
545
545
 
546
+ // 把 Windows 的每个盘都挂进容器 —— **动态枚举,不写死盘符**:`ls /mnt` 拿 WSL 已自动挂载的
547
+ // 单字母目录(c/d/e…,有几个挂几个),逐盘 `-v /mnt/<x>:/mnt/<x>`。逐盘而非整挂 /mnt,是为了
548
+ // 避开 /mnt/wsl 等非盘目录。USB/可移动盘 WSL 默认不自动挂进 /mnt,天然不在此列(主人:不用管 usb)。
549
+ async function allDrivesMountArg() {
550
+ try {
551
+ const { stdout } = await wslRun("ls -1 /mnt 2>/dev/null", { timeout: 10000 });
552
+ const drives = String(stdout || "")
553
+ .split(/\r?\n/)
554
+ .map((s) => s.trim())
555
+ .filter((s) => /^[a-z]$/i.test(s)); // 只取单字母盘符,排除 wsl 等
556
+ return drives.map((d) => `-v /mnt/${d}:/mnt/${d}`).join(" ");
557
+ } catch (e) { log.warn(`[wsl-docker] enumerate drives failed: ${e.message}`); return ""; }
558
+ }
559
+
546
560
  // extraPorts → additional `-p 127.0.0.1:<p>:<p>` mappings (host=container, loopback
547
561
  // only). For container-internal agent services the user wants reachable from
548
562
  // Windows. Each adds one docker-proxy, so keep the list small. 8008/主端口自动排除。
@@ -581,7 +595,8 @@ async function runContainer({ port = 8008, container = "cicy-code-docker", volum
581
595
  // 只发布 :8008(单端口,1 个 docker-proxy)。EXTRA_PORTS 那段 18000-19999(2000 个端口)
582
596
  // 已删——docker 默认每端口起一个 userland-proxy 进程 → 2000 进程,docker run 卡死/吃内存/
583
597
  // 偶发失败(实测)。容器内 agent 服务需要从 Windows 直达时再按需单独暴露。
584
- const cmd = `docker run -d --name ${container} --restart unless-stopped --dns 223.5.5.5 --dns 8.8.8.8 ${publishArgs(port, extraPorts)} -e CICY_PUBLIC=1 -v ${volume}:/home/cicy ${projectsMountArg()} ${envArgs} ${IMAGE}`;
598
+ const drivesArg = await allDrivesMountArg(); // 动态:有几个盘挂几个
599
+ const cmd = `docker run -d --name ${container} --restart unless-stopped --dns 223.5.5.5 --dns 8.8.8.8 ${publishArgs(port, extraPorts)} -e CICY_PUBLIC=1 -v ${volume}:/home/cicy ${projectsMountArg()} ${drivesArg} ${envArgs} ${IMAGE}`;
585
600
  emit && emit({ phase: "container", status: "running", message: `$ ${cmd.length > 220 ? cmd.slice(0, 220) + " …" : cmd}` });
586
601
  await wslRun(cmd, { timeout: 60000 }); // 失败时 err.stderr 带 docker 真错误 → _bootstrap 的 errTail 显示
587
602
  ensureDesktopShortcut(volume, port).catch(() => {});
@@ -238,13 +238,17 @@ class TabManager {
238
238
  wc.on("page-title-updated", (_e, title) => { if (!tab.fixedTitle) { tab.title = title; this.pushState(); } });
239
239
  wc.on("page-favicon-updated", (_e, favs) => { tab.favicon = (favs && favs[0]) || ""; this.pushState(); });
240
240
  wc.on("did-start-loading", () => { tab.loading = true; this.pushState(); });
241
- wc.on("did-stop-loading", () => { tab.loading = false; this.pushState(); });
241
+ wc.on("did-stop-loading", () => { tab.loading = false; try { const cu = wc.getURL(); if (cu && !cu.startsWith("about:blank")) tab.url = cu; } catch (e) {} this.pushState(); });
242
242
  // Re-sync fullscreen state after each (re)load: the SPA resets data-fullscreen
243
243
  // to "0" on mount, so a homepage reload while the window is fullscreen would
244
244
  // otherwise re-show the 34px traffic-light gutter (blank top strip).
245
245
  wc.on("did-finish-load", () => { try { wc.send("window:fullscreen", !!this.win.isFullScreen()); } catch (e) {} });
246
- wc.on("did-navigate", (_e, u) => { tab.url = u; tab.favicon = ""; this.pushState(); });
247
- wc.on("did-navigate-in-page", (_e, u) => { tab.url = u; this.pushState(); });
246
+ // **绝不把 about:blank 记进 tab.url**。这些 tab 从不真的停在 about:blank —— 但新建时会先
247
+ // 短暂经过 about:blank,导航事件的 u 偶尔就是 about:blank(或 about:blank#hash,SPA 在空白页
248
+ // 上先改了 hash)。若写进去,地址栏/tab 就显示 about:blank#teams,且任何「按 tab.url 重新导航」
249
+ // 的 reload(reloadTabByUrl)会真把页面导到 about:blank#teams。忽略它,保留上一个真实 URL。
250
+ wc.on("did-navigate", (_e, u) => { if (u && !u.startsWith("about:blank")) tab.url = u; tab.favicon = ""; this.pushState(); });
251
+ wc.on("did-navigate-in-page", (_e, u) => { if (u && !u.startsWith("about:blank")) tab.url = u; this.pushState(); });
248
252
  // popups / window.open → open as a tab. 安全(防"点链接 = 静默 RCE"):在 profile 0
249
253
  // (系统/特权 profile,tab 带 electronRPC 桥)里被点开的链接 —— 典型是 agent gotty
250
254
  // 打印的网址 —— 一律改到 profile 1 打开。profile 1 是硬沙箱(contextIsolation on /