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.
- package/package.json +1 -1
- package/scripts/build-homepage.cjs +16 -1
- package/src/app-updater.js +30 -0
- package/src/backends/homepage-preload.js +3 -1
- package/src/backends/homepage-react/assets/index-Buyk0RlW.js +655 -0
- package/src/backends/homepage-react/assets/index-CVk0uc2g.css +1 -0
- package/src/backends/homepage-react/index.html +5 -3
- package/src/backends/homepage-react/panel/facebook-matrix.html +305 -87
- package/src/backends/homepage-react/panel/ipcheck.html +112 -0
- package/src/backends/homepage-react/panel/matrix.html +595 -0
- package/src/backends/homepage-react/panel/telegram-matrix.html +96 -22
- package/src/backends/homepage-react/panel/tiktok-matrix.html +599 -0
- package/src/backends/hub-client.js +108 -2
- package/src/backends/sidecar-ipc.js +33 -6
- package/src/main.js +67 -11
- package/src/sidecar/host-mihomo.js +47 -2
- package/src/tabbrowser/facebook-identity.js +12 -1
- package/src/tabbrowser/facebook-matrix.html +305 -87
- package/src/tabbrowser/fb-login.js +115 -0
- package/src/tabbrowser/newtab-protocol.js +6 -1
- package/src/tabbrowser/panel-cells.js +14 -1
- package/src/tabbrowser/telegram-matrix.html +96 -22
- package/src/tabbrowser/telegram-web-preferences.js +5 -1
- package/src/tabbrowser/tiktok-matrix.html +305 -87
- package/src/tools/tab-browser-tools.js +21 -100
- package/src/tray.js +22 -0
- package/test/bootstrap-failure-reporting.test.js +1 -1
- package/test/facebook-identity.test.js +3 -1
- package/test/facebook-matrix.test.js +2 -1
- package/test/telegram-matrix.test.js +2 -2
- package/test/tiktok-matrix.test.js +2 -1
- package/tools/arm-fblogin.js +32 -0
- package/tools/wsd-ws +114 -0
- package/workers/render/index.html +3 -1
- package/workers/render/package.json +2 -3
- package/workers/render/public/panel/facebook-matrix.html +305 -87
- package/workers/render/public/panel/ipcheck.html +112 -0
- package/workers/render/public/panel/matrix.html +595 -0
- package/workers/render/public/panel/telegram-matrix.html +96 -22
- package/workers/render/public/panel/tiktok-matrix.html +599 -0
- package/workers/render/src/App.css +4 -0
- package/workers/render/src/App.jsx +917 -52
- package/workers/render/stamp-panel-version.mjs +16 -0
- package/workers/render/worker.js +1 -1
- package/src/backends/homepage-react/assets/index-C6Zrdgc0.css +0 -1
- package/src/backends/homepage-react/assets/index-OG6JB73F.js +0 -411
- package/src/tabbrowser/cicy-code-tab-restore.js +0 -10
- package/test/cicy-code-tab-restore.test.js +0 -21
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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"))) {
|
package/src/app-updater.js
CHANGED
|
@@ -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
|
-
|
|
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);
|