cicy-desktop 2.1.173 → 2.1.175

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.173",
3
+ "version": "2.1.175",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -137,7 +137,7 @@
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
143
  "cicy-code-darwin-x64": "2.3.21",
@@ -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) {
@@ -247,10 +247,18 @@ Drop files here for CiCy agents to read; files agents write to Share show up her
247
247
 
248
248
  function shareMountArg() {
249
249
  try {
250
- const share = path.join(os.homedir(), "Desktop", "Share");
250
+ // 主人: Share 真实目录放 ~/cicy-ai/Share —— 不能用 ~/Desktop:macOS TCC 挡着 colima(VM)
251
+ // 访问 Desktop/Documents/Downloads,docker 建挂载源时报 'mkdir …/Desktop: operation not
252
+ // permitted' → 容器起不来。~/cicy-ai 非 TCC、colima 能挂。再在 Desktop 放个软链(桌面可见;
253
+ // 失败无所谓,真实目录已可用)。
254
+ const share = path.join(os.homedir(), "cicy-ai", "Share");
251
255
  fs.mkdirSync(share, { recursive: true });
252
256
  const readme = path.join(share, "readme.md");
253
257
  if (!fs.existsSync(readme)) { try { fs.writeFileSync(readme, SHARE_README); } catch {} }
258
+ try {
259
+ const link = path.join(os.homedir(), "Desktop", "Share");
260
+ if (!fs.existsSync(link)) fs.symlinkSync(share, link);
261
+ } catch {}
254
262
  return `-v '${share}':/home/cicy/cicy-ai/Share`;
255
263
  } catch { return ""; }
256
264
  }
@@ -266,9 +274,19 @@ async function runContainer({ port = 8009, container = "cicy-code-docker-8009",
266
274
  // docker-only 后 mihomo 只在容器里,这些口不暴露则主机系统 Chrome 的代理 127.0.0.1:(20000+N)
267
275
  // 连不上。默认 20001-20032(32 个 profile),CICY_CHROME_PROXY_PORTS 可调。
268
276
  const CHROME_PROXY_PORTS = process.env.CICY_CHROME_PROXY_PORTS || "20001-20032";
269
- const cmd = `run -d --name ${container} --restart unless-stopped ${PLATFORM_FLAG} ` +
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}`;
271
- await dk(cmd, { timeout: 90000 });
277
+ const mk = (s) => `run -d --name ${container} --restart unless-stopped ${PLATFORM_FLAG} ` +
278
+ `-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 ${s} ${envArgs} ${IMAGE}`;
279
+ const share = shareMountArg();
280
+ try {
281
+ await dk(mk(share), { timeout: 90000 });
282
+ } catch (e) {
283
+ if (!share) throw e;
284
+ // 兜底: 带 Share 启动失败(如 macOS TCC 挡 colima 访问挂载源)→ 去掉 Share 重试,保证容器
285
+ // 一定能起(Share 只是附加共享目录,不该挡住整个服务). 主人: '容器起不来' 的修复.
286
+ console.warn(`[colima] 带 Share 启动失败,去掉 Share 重试: ${e.message}`);
287
+ try { await dk(`rm -f ${container}`, { timeout: 20000 }); } catch {}
288
+ await dk(mk(""), { timeout: 90000 });
289
+ }
272
290
  return { started: true };
273
291
  }
274
292
 
@@ -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) {