cicy-desktop 2.1.228 → 2.1.230
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.
|
@@ -254,3 +254,15 @@ jobs:
|
|
|
254
254
|
done
|
|
255
255
|
printf '%s' "$VER" > mac-latest-version.txt
|
|
256
256
|
"$OSS" cp mac-latest-version.txt "$BASE/mac-latest-version.txt" -f --acl public-read || true
|
|
257
|
+
|
|
258
|
+
# Prune —— 版本化 pkg 只保留最新 2 个版本(每版含 x64+arm64),更旧的删掉(省 OSS)。
|
|
259
|
+
# 只匹配 cicy-desktop-<semver>-<arch>.pkg;mac-<arch>-latest.pkg 指针不含 semver、永远保留。非致命。
|
|
260
|
+
allvers=$("$OSS" ls "$BASE/cicy-desktop-" -s 2>/dev/null | grep -oE 'cicy-desktop-[0-9]+\.[0-9]+\.[0-9]+-(x64|arm64)\.pkg' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -uV || true)
|
|
261
|
+
keep=$(echo "$allvers" | tail -2)
|
|
262
|
+
for v in $allvers; do
|
|
263
|
+
echo "$keep" | grep -qx "$v" && continue
|
|
264
|
+
for ARCH in x64 arm64; do
|
|
265
|
+
"$OSS" rm "$BASE/cicy-desktop-$v-$ARCH.pkg" -f 2>/dev/null || true
|
|
266
|
+
done
|
|
267
|
+
echo "Pruned old mac pkg version: $v"
|
|
268
|
+
done
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cicy-desktop",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.230",
|
|
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.
|
|
148
|
-
"cicy-code-darwin-arm64": "2.3.
|
|
149
|
-
"cicy-code-linux-x64": "2.3.
|
|
150
|
-
"cicy-code-linux-arm64": "2.3.
|
|
151
|
-
"cicy-code-windows-x64": "2.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",
|
|
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",
|
package/src/app-updater.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// → 下完「ready」→ 用户点安装 → 拉起原生安装器并退出 app。
|
|
7
7
|
//
|
|
8
8
|
// 源(分网络 + 分平台):
|
|
9
|
-
// 版本清单 CN → OSS releases/latest-version.txt;非 CN → GitHub releases/latest
|
|
9
|
+
// 版本清单 CN → OSS releases/{win,mac}-latest-version.txt(按平台);非 CN → GitHub releases/latest
|
|
10
10
|
// Windows → OSS cicy-desktop-<ver>.exe (GitHub 不发 win 包)
|
|
11
11
|
// macOS → GitHub cicy-desktop-<ver>-<arch>.pkg (CN 经 ghproxy 兜底)
|
|
12
12
|
// Linux → GitHub CiCy-Desktop-<ver>.AppImage (CN 经 ghproxy 兜底)
|
|
@@ -88,8 +88,14 @@ function headOk(url, redirects = 0) {
|
|
|
88
88
|
// ── 最新版本号 ────────────────────────────────────────────────────────────────
|
|
89
89
|
async function fetchLatestVersion(network) {
|
|
90
90
|
if (network === "cn") {
|
|
91
|
-
// CN:OSS 版本清单(纯文本 "2.1.200")
|
|
92
|
-
|
|
91
|
+
// CN:OSS 版本清单(纯文本 "2.1.200")。**按平台读各自的指针** —— win 和 mac 是两条独立
|
|
92
|
+
// CI、分别构建上传、版本可能不同步;都读裸名 latest-version.txt(只由 Windows CI 写)会让
|
|
93
|
+
// mac 客户端拿到 Windows 的版本号 → 去下不存在的 mac 包 → 404。win→win-、mac→mac-,
|
|
94
|
+
// linux 没有独立 OSS 指针、沿用裸名(与 win 同 tag 同步发布,且 linux 实际走 GitHub 下载)。
|
|
95
|
+
const file = process.platform === "win32" ? "win-latest-version.txt"
|
|
96
|
+
: process.platform === "darwin" ? "mac-latest-version.txt"
|
|
97
|
+
: "latest-version.txt";
|
|
98
|
+
return (await getText(`${OSS_RELEASES_BASE}/${file}`)).trim().replace(/^v/, "");
|
|
93
99
|
}
|
|
94
100
|
// 非 CN:GitHub releases/latest 的 tag_name。
|
|
95
101
|
const j = JSON.parse(await getText(`https://api.github.com/repos/${REPO}/releases/latest`));
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
//
|
|
2
|
-
// new tab's URL is a clean "
|
|
1
|
+
// cicyui://newtab — the tab browser's start page, served via a custom scheme so a
|
|
2
|
+
// new tab's URL is a clean "cicyui://newtab" instead of a giant inline data: URL
|
|
3
3
|
// (url 不要那串 data: 天书). Chrome's chrome://newtab analog.
|
|
4
|
+
//
|
|
5
|
+
// SINGLE SOURCE: the page itself is served by cicy-code at http://127.0.0.1:PORT/
|
|
6
|
+
// newtab?profile=N — this handler just FETCHES that and returns it, so the logo /
|
|
7
|
+
// layout / profile pill live in exactly ONE place (cicy-code's /newtab handler)
|
|
8
|
+
// and both the Electron tab browser and Chrome's start tab render the same thing.
|
|
9
|
+
// If cicy-code is momentarily unreachable we fall back to a minimal inline page so
|
|
10
|
+
// a fresh tab is never blank.
|
|
4
11
|
const { protocol, session } = require("electron");
|
|
5
12
|
const _handled = new WeakSet(); // sessions that already have the cicyui handler
|
|
6
13
|
|
|
@@ -9,10 +16,24 @@ const _handled = new WeakSet(); // sessions that already have the cicyui handler
|
|
|
9
16
|
// cicy://… gets dispatched externally (open-url) and the page never renders.
|
|
10
17
|
// A dedicated scheme avoids that collision.
|
|
11
18
|
const NEWTAB_URL = "cicyui://newtab";
|
|
19
|
+
const CICY_PORT = Number(process.env.CICY_CODE_PORT || 8008);
|
|
12
20
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
// accountIdxFromPartition pulls N out of "persist:sandbox-N" (default session /
|
|
22
|
+
// system profile → "").
|
|
23
|
+
function accountIdxFromPartition(partition) {
|
|
24
|
+
const m = /sandbox-(\d+)/.exec(partition || "");
|
|
25
|
+
return m ? m[1] : "";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// startPageHtml is the OFFLINE FALLBACK only — a minimal, self-contained page for
|
|
29
|
+
// when cicy-code (:CICY_PORT) can't be reached. The real page comes from
|
|
30
|
+
// cicy-code /newtab (see handlerFor). Kept exported for tab-browser.html's inline
|
|
31
|
+
// start page.
|
|
32
|
+
function startPageHtml(profile) {
|
|
33
|
+
const pill = profile
|
|
34
|
+
? `<div style="display:inline-block;margin:14px 0 0;padding:4px 12px;border-radius:999px;background:rgba(139,92,246,.18);border:1px solid rgba(139,92,246,.35);color:#c4b5fd;font-size:13px;font-weight:600;font-family:ui-monospace,Menlo,Consolas,monospace">Profile #${profile}</div>`
|
|
35
|
+
: "";
|
|
36
|
+
return `<!doctype html><meta charset=utf-8><title>起始页</title><style>html,body{height:100%;margin:0;display:flex;align-items:center;justify-content:center;background:#202124;color:#e8eaed;font-family:-apple-system,sans-serif}.w{text-align:center}.l{width:56px;height:56px;margin:0 auto 16px}.l svg{width:100%;height:100%;display:block}h1{font-size:16px;margin:0 0 6px}p{color:#9aa0a6;font-size:13px;margin:0}</style><div class=w><div class=l><svg viewBox="0 0 96 96" fill="#fff"><path d="M48 11L39.5 33.3L16 29.5L31 48L16 66.5L39.5 62.7L48 85L56.5 62.7L80 66.5L65 48L80 29.5L56.5 33.3Z"/></svg></div><h1>CiCy Browser</h1><p>新标签页</p>${pill}</div>`;
|
|
16
37
|
}
|
|
17
38
|
|
|
18
39
|
// MUST be called BEFORE app 'ready' (registerSchemesAsPrivileged requirement).
|
|
@@ -26,29 +47,37 @@ function registerScheme() {
|
|
|
26
47
|
|
|
27
48
|
// Register the cicyui handler on a given session. protocol.handle on the global
|
|
28
49
|
// (default) session does NOT cover persist:sandbox-N partition sessions — the
|
|
29
|
-
// tab BrowserViews run in those — so each partition session needs its own.
|
|
30
|
-
|
|
50
|
+
// tab BrowserViews run in those — so each partition session needs its own. The
|
|
51
|
+
// partition string lets us tell cicy-code which profile this is (Profile #N).
|
|
52
|
+
function handlerFor(ses, partition) {
|
|
31
53
|
if (!ses || _handled.has(ses)) return;
|
|
54
|
+
const profile = accountIdxFromPartition(partition);
|
|
32
55
|
try {
|
|
33
|
-
ses.protocol.handle("cicyui", (request) => {
|
|
56
|
+
ses.protocol.handle("cicyui", async (request) => {
|
|
34
57
|
let host = "";
|
|
35
58
|
try { host = new URL(request.url).hostname; } catch (e) {}
|
|
36
|
-
if (host
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
if (host !== "newtab") return new Response("not found", { status: 404 });
|
|
60
|
+
// Fetch the single-source page from cicy-code; fall back to the inline page.
|
|
61
|
+
try {
|
|
62
|
+
const up = await fetch(`http://127.0.0.1:${CICY_PORT}/newtab?profile=${encodeURIComponent(profile)}`);
|
|
63
|
+
if (up.ok) {
|
|
64
|
+
const body = await up.text();
|
|
65
|
+
return new Response(body, { headers: { "content-type": "text/html; charset=utf-8" } });
|
|
66
|
+
}
|
|
67
|
+
} catch (e) {}
|
|
68
|
+
return new Response(startPageHtml(profile), { headers: { "content-type": "text/html; charset=utf-8" } });
|
|
40
69
|
});
|
|
41
70
|
_handled.add(ses);
|
|
42
71
|
} catch (e) {}
|
|
43
72
|
}
|
|
44
73
|
|
|
45
74
|
// MUST be called AFTER app 'ready' — default session (homepage etc.).
|
|
46
|
-
function installHandler() { handlerFor(session.defaultSession); }
|
|
75
|
+
function installHandler() { handlerFor(session.defaultSession, ""); }
|
|
47
76
|
|
|
48
77
|
// Per-partition session for the tab-browser sandboxes — call before a tab in
|
|
49
78
|
// that partition loads cicyui://newtab.
|
|
50
79
|
function ensureForPartition(partition) {
|
|
51
|
-
try { handlerFor(session.fromPartition(partition)); } catch (e) {}
|
|
80
|
+
try { handlerFor(session.fromPartition(partition), partition); } catch (e) {}
|
|
52
81
|
}
|
|
53
82
|
|
|
54
83
|
module.exports = { NEWTAB_URL, registerScheme, installHandler, ensureForPartition, startPageHtml };
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
const HOME = Q.get('home') || '';
|
|
50
50
|
// Built-in start page (a real page, not about:blank) for new tabs.
|
|
51
51
|
const START = 'data:text/html;charset=utf-8,' + encodeURIComponent(
|
|
52
|
-
`<!doctype html><meta charset=utf-8><style>html,body{height:100%;margin:0;display:flex;align-items:center;justify-content:center;background:#202124;color:#e8eaed;font-family:-apple-system,sans-serif}.w{text-align:center}.l{width:54px;height:54px;border-radius:16px;margin:0 auto 16px;background:linear-gradient(135deg,#3b82f6,#8b5cf6);display:flex;align-items:center;justify-content:center;color:#fff
|
|
52
|
+
`<!doctype html><meta charset=utf-8><style>html,body{height:100%;margin:0;display:flex;align-items:center;justify-content:center;background:#202124;color:#e8eaed;font-family:-apple-system,sans-serif}.w{text-align:center}.l{width:54px;height:54px;border-radius:16px;margin:0 auto 16px;background:linear-gradient(135deg,#3b82f6,#8b5cf6);display:flex;align-items:center;justify-content:center;color:#fff}h1{font-size:16px;margin-bottom:6px}p{color:#9aa0a6;font-size:13px}</style><div class=w><div class=l><svg viewBox="0 0 96 96" width="34" height="34" fill="#fff"><path d="M48 11L39.5 33.3L16 29.5L31 48L16 66.5L39.5 62.7L48 85L56.5 62.7L80 66.5L65 48L80 29.5L56.5 33.3Z"/></svg></div><h1>CiCy Browser</h1><p>profile sandbox-${ACCT}</p></div>`);
|
|
53
53
|
|
|
54
54
|
const tabsEl = document.getElementById('tabs');
|
|
55
55
|
const viewsEl = document.getElementById('views');
|