cicy-desktop 2.1.342 → 2.1.358

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.
Files changed (48) hide show
  1. package/package.json +1 -1
  2. package/scripts/build-homepage.cjs +16 -1
  3. package/src/app-updater.js +30 -0
  4. package/src/backends/homepage-preload.js +3 -1
  5. package/src/backends/homepage-react/assets/index-Buyk0RlW.js +655 -0
  6. package/src/backends/homepage-react/assets/index-CVk0uc2g.css +1 -0
  7. package/src/backends/homepage-react/index.html +5 -3
  8. package/src/backends/homepage-react/panel/facebook-matrix.html +305 -87
  9. package/src/backends/homepage-react/panel/ipcheck.html +112 -0
  10. package/src/backends/homepage-react/panel/matrix.html +595 -0
  11. package/src/backends/homepage-react/panel/telegram-matrix.html +96 -22
  12. package/src/backends/homepage-react/panel/tiktok-matrix.html +599 -0
  13. package/src/backends/hub-client.js +108 -2
  14. package/src/backends/sidecar-ipc.js +33 -6
  15. package/src/main.js +67 -11
  16. package/src/sidecar/host-mihomo.js +47 -2
  17. package/src/tabbrowser/facebook-identity.js +12 -1
  18. package/src/tabbrowser/facebook-matrix.html +305 -87
  19. package/src/tabbrowser/fb-login.js +115 -0
  20. package/src/tabbrowser/newtab-protocol.js +6 -1
  21. package/src/tabbrowser/panel-cells.js +14 -1
  22. package/src/tabbrowser/telegram-matrix.html +96 -22
  23. package/src/tabbrowser/telegram-web-preferences.js +5 -1
  24. package/src/tabbrowser/tiktok-matrix.html +305 -87
  25. package/src/tools/tab-browser-tools.js +21 -100
  26. package/src/tray.js +22 -0
  27. package/test/bootstrap-failure-reporting.test.js +1 -1
  28. package/test/facebook-identity.test.js +3 -1
  29. package/test/facebook-matrix.test.js +2 -1
  30. package/test/telegram-matrix.test.js +2 -2
  31. package/test/tiktok-matrix.test.js +2 -1
  32. package/tools/arm-fblogin.js +32 -0
  33. package/tools/wsd-ws +114 -0
  34. package/workers/render/index.html +3 -1
  35. package/workers/render/package.json +2 -3
  36. package/workers/render/public/panel/facebook-matrix.html +305 -87
  37. package/workers/render/public/panel/ipcheck.html +112 -0
  38. package/workers/render/public/panel/matrix.html +595 -0
  39. package/workers/render/public/panel/telegram-matrix.html +96 -22
  40. package/workers/render/public/panel/tiktok-matrix.html +599 -0
  41. package/workers/render/src/App.css +4 -0
  42. package/workers/render/src/App.jsx +917 -52
  43. package/workers/render/stamp-panel-version.mjs +16 -0
  44. package/workers/render/worker.js +1 -1
  45. package/src/backends/homepage-react/assets/index-C6Zrdgc0.css +0 -1
  46. package/src/backends/homepage-react/assets/index-OG6JB73F.js +0 -411
  47. package/src/tabbrowser/cicy-code-tab-restore.js +0 -10
  48. package/test/cicy-code-tab-restore.test.js +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.342",
3
+ "version": "2.1.358",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -39,6 +39,7 @@ const PANEL_PAGES = [
39
39
  "telegram-matrix.html",
40
40
  "redroid-matrix.html",
41
41
  "facebook-matrix.html",
42
+ "tiktok-matrix.html",
42
43
  "split-panel.html",
43
44
  ];
44
45
  fs.rmSync(PANEL_OUT, { recursive: true, force: true });
@@ -46,7 +47,21 @@ fs.mkdirSync(PANEL_OUT, { recursive: true });
46
47
  for (const page of PANEL_PAGES) {
47
48
  fs.copyFileSync(path.join(PANEL_SRC, page), path.join(PANEL_OUT, page));
48
49
  }
49
- console.log(`[build-homepage] panel pages synced: ${PANEL_PAGES.join(", ")}`);
50
+ // 兼容已发布的 v2.1.355:那一版把三个矩阵 preset 全解析成 preset=matrix,
51
+ // 而面板 tab 的地址就是 `/panel/<preset>`,所以它只会去请求 /panel/matrix。
52
+ // 合并页已被 f5b6e3a 回退删掉,这个地址要是不存在,机器上「矩阵」菜单点开
53
+ // 拿到的是 SPA 首页 —— 全队面板直接点空(实测 2026-09-11)。
54
+ // 在下一个版本铺开之前,这里放一份 Telegram 矩阵页顶上,菜单行为和回退前一致。
55
+ // 等车队都升到含 f5b6e3a 的版本后,这段可以删。
56
+ fs.copyFileSync(path.join(PANEL_SRC, "telegram-matrix.html"), path.join(PANEL_OUT, "matrix.html"));
57
+ // ipcheck.html 只在 homepage-react/panel 下手工维护(src/tabbrowser 里没有),
58
+ // 但上面 rmSync 会把整个 PANEL_OUT 清空 —— 不显式保住它,每次构建都会被删,
59
+ // 格子头那个 🌐 按钮点开就是 SPA 首页(实测 2026-09-11)。
60
+ {
61
+ const extra = path.join(__dirname, "..", "src", "backends", "homepage-react", "panel", "ipcheck.html");
62
+ if (fs.existsSync(extra)) fs.copyFileSync(extra, path.join(PANEL_OUT, "ipcheck.html"));
63
+ }
64
+ console.log(`[build-homepage] panel pages synced: ${PANEL_PAGES.join(", ")} (+ matrix.html 兼容 v2.1.355)`);
50
65
 
51
66
  // 1) build the SPA from source (install deps on a cold runner)
52
67
  if (!fs.existsSync(path.join(RENDER, "node_modules"))) {
@@ -291,6 +291,26 @@ function broadcast(patch) {
291
291
  }
292
292
  function getState() { return _state; }
293
293
 
294
+ function cmpVer(a, b) {
295
+ const x = String(a).split(".").map(Number), y = String(b).split(".").map(Number);
296
+ for (let i = 0; i < 3; i++) { if ((x[i] || 0) !== (y[i] || 0)) return (x[i] || 0) - (y[i] || 0); }
297
+ return 0;
298
+ }
299
+ // 只认更新器自己命名的 cicy-desktop-<x.y.z>.exe / .dmg / .AppImage,别的文件一律不碰;
300
+ // 版本 >= 当前的保留(可能正在下载或刚装完还没重启)。
301
+ function cleanupOldInstallers() {
302
+ const cur = app.getVersion();
303
+ let dir = ""; try { dir = app.getPath("downloads"); } catch { return; }
304
+ let names = []; try { names = fs.readdirSync(dir); } catch { return; }
305
+ let n = 0;
306
+ for (const f of names) {
307
+ const m = f.match(/^cicy-desktop-(\d+\.\d+\.\d+)\.(exe|dmg|AppImage)$/i);
308
+ if (!m || cmpVer(m[1], cur) >= 0) continue;
309
+ try { fs.unlinkSync(path.join(dir, f)); n++; } catch {}
310
+ }
311
+ if (n) log.info(`[app-updater] removed ${n} old installer(s) from ${dir}`);
312
+ }
313
+
294
314
  function init(mainWin) {
295
315
  _win = mainWin;
296
316
  _state.current = app.getVersion();
@@ -298,6 +318,10 @@ function init(mainWin) {
298
318
  // Running the version we last tried to install = that attempt worked; forget
299
319
  // it so a future update to the same number is never wrongly blocked.
300
320
  try { if (readAutoTry().version === _state.current) clearAutoTry(); } catch {}
321
+ // 清掉 Downloads 里旧版本的安装包。每次自动更新都往 Downloads 下一个 125MB 的
322
+ // cicy-desktop-<ver>.exe,装完从不删:实测 2026-09-12 全队 18 台堆了 56.8GB,
323
+ // xs-3008 的 C 盘直接写满,新版下到 92% 报 ENOSPC 装不上。只删比当前运行版本低的。
324
+ setTimeout(() => { try { cleanupOldInstallers(); } catch {} }, 5_000);
301
325
  setTimeout(() => check().catch(() => {}), 15_000); // 启动后探一次
302
326
  setInterval(() => check().catch(() => {}), 30 * 60 * 1000); // 每 30 分钟
303
327
  }
@@ -404,6 +428,12 @@ function installWindows(installer) {
404
428
  const dir = path.join(process.env.LOCALAPPDATA || os.homedir(), "cicy-desktop");
405
429
  fs.mkdirSync(dir, { recursive: true });
406
430
  const vbs = path.join(dir, "update-install.vbs");
431
+ // Stand the 1-min watchdog DOWN for the install window: it would otherwise see
432
+ // the app gone (installer closed it), relaunch it, lock the exe, fail the
433
+ // replace, and leave the version unchanged — the exact loop that made a node
434
+ // "总被关". The watchdog skips its relaunch while this flag is < 180s old;
435
+ // mtime-expiry is the fail-safe so a crashed install can't wedge it forever.
436
+ try { fs.writeFileSync(path.join(dir, "updating.flag"), String(Date.now())); } catch { /* best effort */ }
407
437
  // VBS escapes a double quote by doubling it. cmd waits for the installer (no
408
438
  // `start` on that leg), then the pause lets Windows release the replaced
409
439
  // files before the new exe runs hidden.
@@ -331,7 +331,9 @@ contextBridge.exposeInMainWorld("cicy", {
331
331
  loginCode: (code) => logInvoke("hub:login-code", code),
332
332
  cancel: () => logInvoke("hub:cancel"),
333
333
  instances: () => logInvoke("hub:instances"),
334
- open: (id, title, port) => logInvoke("hub:open", { id, title, port }),
334
+ // `next` = a path (+ hash route) inside the node's UI, e.g. "/#/project/x".
335
+ open: (id, title, port, next) => logInvoke("hub:open", { id, title, port, next }),
336
+ projects: (id) => logInvoke("hub:projects", { id }),
335
337
  logout: () => logInvoke("hub:logout"),
336
338
  onComplete: (cb) => {
337
339
  const handler = (_e, payload) => cb(payload);