cicy-desktop 2.1.228 → 2.1.229
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
|
|
@@ -153,6 +153,25 @@ jobs:
|
|
|
153
153
|
Write-Host "Skip latest: building $version < published $cur (older build — not clobbering newer latest)"
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
# 4) Prune —— releases/ 下带版本号的 exe 只保留最新 2 个,更旧的删掉(省 OSS 空间)。
|
|
157
|
+
# 只匹配 cicy-desktop-<semver>.exe;latest / win-latest 指针不含 semver、永远保留。
|
|
158
|
+
# 非致命:prune 失败只告警,不影响发版。
|
|
159
|
+
try {
|
|
160
|
+
$listing = & $oss ls "$base/cicy-desktop-" -s 2>$null
|
|
161
|
+
$verExes = @()
|
|
162
|
+
foreach ($line in $listing) {
|
|
163
|
+
if ($line -match 'cicy-desktop-(\d+\.\d+\.\d+)\.exe$') {
|
|
164
|
+
$verExes += [PSCustomObject]@{ Key = $line.Trim(); Ver = [version]$matches[1] }
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
$toDelete = @($verExes | Sort-Object Ver -Descending | Select-Object -Skip 2)
|
|
168
|
+
foreach ($o in $toDelete) {
|
|
169
|
+
Write-Host "Pruning old EXE: $($o.Key)"
|
|
170
|
+
& $oss rm "$($o.Key)" -f 2>$null
|
|
171
|
+
}
|
|
172
|
+
Write-Host "Prune done: kept newest 2 of $($verExes.Count) versioned exe(s), deleted $($toDelete.Count)"
|
|
173
|
+
} catch { Write-Host "::warning::OSS prune skipped: $_" }
|
|
174
|
+
|
|
156
175
|
# 3) 保留策略 — 只留最近 $KEEP 个版本化 exe(~130MB/个),旧的删掉,避免 OSS 无限膨胀。
|
|
157
176
|
# latest.exe / latest-version.txt 不在此列(名字不匹配 X.Y.Z),永远保留。
|
|
158
177
|
$KEEP = 2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cicy-desktop",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.229",
|
|
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",
|
|
@@ -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');
|