cicy-desktop 2.1.172 → 2.1.174

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.
@@ -53,18 +53,20 @@ jobs:
53
53
  EOF
54
54
  docker build -t cicy-wsl-base ctx
55
55
 
56
- - name: Pre-load cicy-code image into the rootfs
56
+ - name: Build WSL rootfs (Ubuntu + Docker, image NOT baked)
57
57
  run: |
58
+ # 主人: image NO LONGER baked into the rootfs. wsl-docker.bootstrap downloads +
59
+ # docker-loads cicy-code-latest.tar.gz at setup (像 mac/colima 那样) → WSL 也拿最新
60
+ # 烤制镜像,且镜像更新不必重下整个 rootfs(rootfs=Ubuntu+Docker 很少变,瘦了 ~169MB)。
58
61
  docker pull "${{ inputs.image }}"
62
+ # Still save the image so the SAME run republishes the macOS tarball (next step).
59
63
  docker save "${{ inputs.image }}" -o /tmp/cicy-image.tar
60
- # Run the base privileged, start an inner dockerd, load the image into
61
- # its /var/lib/docker (kept in the container fs, NOT a volume), then stop.
62
- cid=$(docker run -d --privileged -v /tmp/cicy-image.tar:/img.tar:ro cicy-wsl-base \
64
+ # Run the base privileged, start an inner dockerd ONCE then stop — purely to clear
65
+ # stale daemon runtime files so the FIRST dockerd in WSL2 starts clean. No image load.
66
+ cid=$(docker run -d --privileged cicy-wsl-base \
63
67
  bash -c '
64
68
  nohup dockerd >/var/log/dind.log 2>&1 &
65
69
  for i in $(seq 1 60); do docker info >/dev/null 2>&1 && break; sleep 1; done
66
- docker load -i /img.tar
67
- docker images
68
70
  pkill dockerd || true
69
71
  sleep 4
70
72
  # Drop stale daemon runtime files so the FIRST dockerd in WSL2 does
@@ -73,7 +75,7 @@ jobs:
73
75
  ')
74
76
  docker logs -f "$cid" || true
75
77
  rc=$(docker wait "$cid"); echo "inner exit=$rc"
76
- # Export the whole container filesystem (incl. /var/lib/docker) = the WSL rootfs.
78
+ # Export the container filesystem = the WSL rootfs (Ubuntu + Docker, no image).
77
79
  docker export "$cid" | gzip > cicy-wsl.tar.gz
78
80
  ls -lh cicy-wsl.tar.gz
79
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.172",
3
+ "version": "2.1.174",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -137,14 +137,14 @@
137
137
  "zod": "3.25",
138
138
  "electron-updater": "6.6.2"
139
139
  },
140
- "//optionalDependencies": "Runtime Bundle v1 (主人指令): platform binaries delivered by `npm i -g cicy-desktop` itself npm installs only the current-platform subpackage (os/cpu pinned in each), so first start seeds the runtime store with ZERO network, ZERO npx. Windows packages are named *-windows-* (npm spam filter 403s new names containing win32). cicy-msys2 added once published.",
140
+ "//optionalDependencies": "docker-only(主人): host cicy-code/mihomo 二进制不再内置 —— cicy-code + mihomo 都只在 docker 容器里跑(npm 装/镜像预装),host 永远不起,所以去掉了 cicy-code-<plat> / cicy-mihomo-<plat> 子包。只留 electron。",
141
141
  "optionalDependencies": {
142
142
  "electron": "41.0.3",
143
- "cicy-code-darwin-x64": "2.3.20",
144
- "cicy-code-darwin-arm64": "2.3.20",
145
- "cicy-code-linux-x64": "2.3.20",
146
- "cicy-code-linux-arm64": "2.3.20",
147
- "cicy-code-windows-x64": "2.3.20",
143
+ "cicy-code-darwin-x64": "2.3.21",
144
+ "cicy-code-darwin-arm64": "2.3.21",
145
+ "cicy-code-linux-x64": "2.3.21",
146
+ "cicy-code-linux-arm64": "2.3.21",
147
+ "cicy-code-windows-x64": "2.3.21",
148
148
  "cicy-mihomo-darwin-x64": "1.10.4",
149
149
  "cicy-mihomo-darwin-arm64": "1.10.4",
150
150
  "cicy-mihomo-linux-x64": "1.10.4",
@@ -126,14 +126,8 @@ async function start({ logPath, port = DEFAULT_PORT, force = false, version = nu
126
126
  }
127
127
  if (!exe) { console.warn("[cicy-code-sidecar] no cicy-code binary available"); return null; }
128
128
 
129
- // cicy-desktop ALSO owns the mihomo binary (same npm/localbin model). Seed it
130
- // into ~/.local/bin/mihomo from the bundle (zero network) BEFORE the cicy-code
131
- // daemon boots, so cicy-code's own startup finds it already present and skips
132
- // its GitHub/COS download. Best-effort — never block cicy-code on it.
133
- try {
134
- const r = await localbin.ensure({ name: "mihomo" });
135
- if (r?.exe) console.log(`[cicy-code-sidecar] mihomo ready at ${r.exe} (v${r.version || "?"})`);
136
- } catch (e) { console.warn(`[cicy-code-sidecar] mihomo seed skipped: ${e.message}`); }
129
+ // 主人: 不再 seed host mihomo —— docker-only mihomo 只在容器里跑(host 不用)。
130
+ // 内置的 cicy-mihomo-<plat> 依赖已从 package.json 移除。
137
131
 
138
132
  let stdio = ["ignore", "ignore", "ignore"];
139
133
  if (logPath) {
@@ -262,8 +262,12 @@ async function runContainer({ port = 8009, container = "cicy-code-docker-8009",
262
262
  .filter(([, v]) => v != null && v !== "")
263
263
  .map(([k, v]) => `-e ${k}='${String(v).replace(/'/g, "'\\''")}'`)
264
264
  .join(" ");
265
+ // 主人(A 方案): 映射 mihomo 的 per-Chrome-profile 监听口段(约定 20000+N)回主机回环。
266
+ // docker-only 后 mihomo 只在容器里,这些口不暴露则主机系统 Chrome 的代理 127.0.0.1:(20000+N)
267
+ // 连不上。默认 20001-20032(32 个 profile),CICY_CHROME_PROXY_PORTS 可调。
268
+ const CHROME_PROXY_PORTS = process.env.CICY_CHROME_PROXY_PORTS || "20001-20032";
265
269
  const cmd = `run -d --name ${container} --restart unless-stopped ${PLATFORM_FLAG} ` +
266
- `-p 127.0.0.1:${port}:8008 -e CICY_PUBLIC=1 -v ${volume}:/home/cicy ${shareMountArg()} ${envArgs} ${IMAGE}`;
270
+ `-p 127.0.0.1:${port}:8008 -p 127.0.0.1:${CHROME_PROXY_PORTS}:${CHROME_PROXY_PORTS} -e CICY_PUBLIC=1 -v ${volume}:/home/cicy ${shareMountArg()} ${envArgs} ${IMAGE}`;
267
271
  await dk(cmd, { timeout: 90000 });
268
272
  return { started: true };
269
273
  }
@@ -44,7 +44,6 @@ const MANIFEST = path.join(LOCAL_BIN, ".cicy-localbin.json");
44
44
  // cicy-code, so the legacy single-component callers keep working unchanged.
45
45
  const COMPONENTS = {
46
46
  "cicy-code": { pkgPrefix: "cicy-code", base: "cicy-code" },
47
- "mihomo": { pkgPrefix: "cicy-mihomo", base: "mihomo" },
48
47
  };
49
48
  const DEFAULT = "cicy-code";
50
49
  function comp(name) {
@@ -425,7 +425,10 @@ async function runContainer({ port = 8009, container = "cicy-code-docker", volum
425
425
  // bridge container → every lookup is EAI_AGAIN and cicy-code's startup `npm i`
426
426
  // crash-loops the container (:8009 never comes up). Pin public resolvers: Aliyun
427
427
  // 223.5.5.5 (CN-fast) first, Google 8.8.8.8 as the overseas fallback.
428
- const cmd = `docker run -d --name ${container} --restart unless-stopped --dns 223.5.5.5 --dns 8.8.8.8 -p 127.0.0.1:${port}:8008 -e CICY_PUBLIC=1 -v ${volume}:/home/cicy ${shareMountArg()} ${envArgs} ${IMAGE}`;
428
+ // 主人(A 方案): 映射 mihomo per-Chrome-profile 监听口段(约定 20000+N)回主机回环 —— docker-only
429
+ // 后这些口只在容器里,不暴露则主机系统 Chrome 的代理 127.0.0.1:(20000+N) 连不上. 默认 20001-20032.
430
+ const CHROME_PROXY_PORTS = process.env.CICY_CHROME_PROXY_PORTS || "20001-20032";
431
+ const cmd = `docker run -d --name ${container} --restart unless-stopped --dns 223.5.5.5 --dns 8.8.8.8 -p 127.0.0.1:${port}:8008 -p 127.0.0.1:${CHROME_PROXY_PORTS}:${CHROME_PROXY_PORTS} -e CICY_PUBLIC=1 -v ${volume}:/home/cicy ${shareMountArg()} ${envArgs} ${IMAGE}`;
429
432
  await wslRun(cmd, { timeout: 60000 });
430
433
  ensureDesktopShortcut(volume, port).catch(() => {});
431
434
  return { started: true };