cicy-desktop 2.1.261 → 2.1.263
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.
|
|
3
|
+
"version": "2.1.263",
|
|
4
4
|
"description": "CiCy - AI-powered operating system browser",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -139,10 +139,10 @@
|
|
|
139
139
|
"//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 着无害。",
|
|
140
140
|
"optionalDependencies": {
|
|
141
141
|
"electron": "41.0.3",
|
|
142
|
-
"cicy-code-darwin-x64": "2.3.
|
|
143
|
-
"cicy-code-darwin-arm64": "2.3.
|
|
144
|
-
"cicy-code-linux-x64": "2.3.
|
|
145
|
-
"cicy-code-linux-arm64": "2.3.
|
|
142
|
+
"cicy-code-darwin-x64": "2.3.342",
|
|
143
|
+
"cicy-code-darwin-arm64": "2.3.342",
|
|
144
|
+
"cicy-code-linux-x64": "2.3.342",
|
|
145
|
+
"cicy-code-linux-arm64": "2.3.342",
|
|
146
146
|
"cicy-code-windows-x64": "2.3.193",
|
|
147
147
|
"cicy-mihomo-darwin-x64": "1.10.4",
|
|
148
148
|
"cicy-mihomo-darwin-arm64": "1.10.4",
|
package/src/sidecar/docker.js
CHANGED
|
@@ -35,7 +35,7 @@ const DOCKER_DESKTOP_MIRROR = process.env.CICY_DOCKER_DESKTOP_MIRROR
|
|
|
35
35
|
const PASS_ENV = [
|
|
36
36
|
"CICY_TEAM_TOKEN", "CICY_CODE_VERSION", "NPM_REGISTRY", "CICY_NPM_REGISTRY",
|
|
37
37
|
"CICY_AGENTS", "ENABLE_CDN", "CICY_CLOUDFLARED_TOKEN",
|
|
38
|
-
"CICY_CLOUD_EMAIL", "CICY_CLOUD_TEAM_ID",
|
|
38
|
+
"CICY_CLOUD_EMAIL", "CICY_CLOUD_TEAM_ID", "CICY_CFT",
|
|
39
39
|
];
|
|
40
40
|
|
|
41
41
|
// Resolve the docker CLI. CRITICAL on Windows: right after Docker Desktop
|
|
@@ -675,7 +675,7 @@ async function runContainer({ port = 8008, container = "cicy-code-docker", volum
|
|
|
675
675
|
// Without this, Desktop starts a healthy cicy-code that never registers the
|
|
676
676
|
// requested Cloud account/team even though the variables exist on Windows.
|
|
677
677
|
const inheritedCloudEnv = {};
|
|
678
|
-
for (const key of ["CICY_CLOUD_EMAIL", "CICY_CLOUD_TEAM_ID"]) {
|
|
678
|
+
for (const key of ["CICY_CLOUD_EMAIL", "CICY_CLOUD_TEAM_ID", "CICY_CFT"]) {
|
|
679
679
|
if (process.env[key]) inheritedCloudEnv[key] = process.env[key];
|
|
680
680
|
}
|
|
681
681
|
const envArgs = Object.entries({ ...inheritedCloudEnv, ...(env || {}) })
|
|
@@ -36,6 +36,33 @@ const managerByHost = new Map(); // shell webContents.id -> TabManager
|
|
|
36
36
|
|
|
37
37
|
function stripVol(u) { try { const x = new URL(u); return x.origin + x.pathname; } catch (e) { return u || ""; } }
|
|
38
38
|
|
|
39
|
+
const INSTANCE_HOST_RE = /^(team-[a-z0-9][a-z0-9-]{0,30}-[0-9]+-[0-9a-f]{8})\.cicy-ai\.com$/;
|
|
40
|
+
|
|
41
|
+
// Keep the fixed Instance authentication shuttle in the current team tab.
|
|
42
|
+
// This is deliberately narrower than trusting *.cicy-ai.com: only the exact
|
|
43
|
+
// Instance → Cloud connect route and Cloud → same Instance one-time grant route
|
|
44
|
+
// are allowed to cross origins. Every other profile-0 cross-origin navigation
|
|
45
|
+
// still gets moved to the hard-sandboxed browser profile below.
|
|
46
|
+
function isInstanceAuthNavigation(currentUrl, targetUrl) {
|
|
47
|
+
let current; let target;
|
|
48
|
+
try { current = new URL(currentUrl); target = new URL(targetUrl); } catch (e) { return false; }
|
|
49
|
+
if (current.protocol !== "https:" || target.protocol !== "https:") return false;
|
|
50
|
+
|
|
51
|
+
const currentInstance = current.hostname.match(INSTANCE_HOST_RE);
|
|
52
|
+
if (currentInstance && target.hostname === "cicy-ai.com") {
|
|
53
|
+
return target.pathname === "/instance-connect"
|
|
54
|
+
&& target.searchParams.get("slug") === currentInstance[1];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const targetInstance = target.hostname.match(INSTANCE_HOST_RE);
|
|
58
|
+
if (current.hostname === "cicy-ai.com" && targetInstance) {
|
|
59
|
+
const grant = target.searchParams.get("grant") || "";
|
|
60
|
+
return target.pathname === "/_proxy/login"
|
|
61
|
+
&& /^[A-Za-z0-9_-]{40,64}$/.test(grant);
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
39
66
|
// 团队 tab 的 webContentsId 状态表:openTab 时记入、对应 webContents destroy 时删除
|
|
40
67
|
// (打开/关闭都更新)。刷新窗口据此按 wcId 强制 reload(reloadIgnoringCache),避开
|
|
41
68
|
// "tab 打开后 URL 漂移(登录跳转 / token / 重定向)→ 按 URL 匹配失败"的 bug。
|
|
@@ -383,7 +410,10 @@ class TabManager {
|
|
|
383
410
|
let tgt; try { tgt = new URL(u); } catch { return; }
|
|
384
411
|
if (tgt.protocol === "about:") return;
|
|
385
412
|
let curOrigin = ""; try { curOrigin = new URL(wc.getURL()).origin; } catch {}
|
|
386
|
-
if (tgt.origin !== curOrigin
|
|
413
|
+
if (tgt.origin !== curOrigin && !(tab.team && isInstanceAuthNavigation(wc.getURL(), u))) {
|
|
414
|
+
e.preventDefault();
|
|
415
|
+
openTab(1, u);
|
|
416
|
+
}
|
|
387
417
|
} catch (err) {}
|
|
388
418
|
});
|
|
389
419
|
}
|