cicy-desktop 2.1.279 → 2.1.280
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.280",
|
|
4
4
|
"description": "CiCy - AI-powered operating system browser",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -144,10 +144,10 @@
|
|
|
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.
|
|
147
|
+
"cicy-code-darwin-x64": "2.3.568",
|
|
148
|
+
"cicy-code-darwin-arm64": "2.3.568",
|
|
149
|
+
"cicy-code-linux-x64": "2.3.568",
|
|
150
|
+
"cicy-code-linux-arm64": "2.3.568",
|
|
151
151
|
"cicy-code-windows-x64": "2.3.193",
|
|
152
152
|
"cicy-mihomo-darwin-x64": "1.10.4",
|
|
153
153
|
"cicy-mihomo-darwin-arm64": "1.10.4",
|
|
@@ -24,7 +24,16 @@
|
|
|
24
24
|
// webview gets the awaited promise
|
|
25
25
|
|
|
26
26
|
const { contextBridge, ipcRenderer } = require("electron");
|
|
27
|
-
|
|
27
|
+
// NOTE: this preload runs in sandboxed renderers (<webview>, trusted popups),
|
|
28
|
+
// where `require` only resolves Electron built-ins — a relative require of
|
|
29
|
+
// ../tabbrowser/tab-theme aborts the whole preload. Keep the helper inline and
|
|
30
|
+
// in sync with src/tabbrowser/tab-theme.js (covered by test/webview-preload.test.js).
|
|
31
|
+
function normalizeCicyTheme(theme) {
|
|
32
|
+
return theme === "light" || theme === "dark" ? theme : null;
|
|
33
|
+
}
|
|
34
|
+
function resolveReportedCicyTheme(documentTheme, savedTheme) {
|
|
35
|
+
return normalizeCicyTheme(documentTheme) || normalizeCicyTheme(savedTheme) || "light";
|
|
36
|
+
}
|
|
28
37
|
|
|
29
38
|
// cicy-code owns the theme preference (`cicy_theme`) and publishes the applied
|
|
30
39
|
// value on <html data-theme>. Report that contract to the owning tab window so
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const test = require("node:test");
|
|
2
|
+
const assert = require("node:assert/strict");
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
|
|
6
|
+
// webview-preload.js runs in sandboxed renderers where only Electron built-ins
|
|
7
|
+
// can be required; any relative require silently kills the whole preload.
|
|
8
|
+
test("webview-preload only requires electron (sandboxed preload)", () => {
|
|
9
|
+
const src = fs.readFileSync(path.join(__dirname, "..", "src", "backends", "webview-preload.js"), "utf8");
|
|
10
|
+
const requires = [...src.matchAll(/require\(\s*["']([^"']+)["']\s*\)/g)].map((m) => m[1]);
|
|
11
|
+
assert.ok(requires.length > 0);
|
|
12
|
+
for (const r of requires) assert.equal(r, "electron", `unexpected require("${r}") in sandboxed preload`);
|
|
13
|
+
assert.ok(src.includes("function resolveReportedCicyTheme("), "theme helper must be inlined");
|
|
14
|
+
});
|