cicy-desktop 2.1.276 → 2.1.277
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.277",
|
|
4
4
|
"description": "CiCy - AI-powered operating system browser",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -143,10 +143,10 @@
|
|
|
143
143
|
"//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 着无害。",
|
|
144
144
|
"optionalDependencies": {
|
|
145
145
|
"electron": "41.0.3",
|
|
146
|
-
"cicy-code-darwin-x64": "2.3.
|
|
147
|
-
"cicy-code-darwin-arm64": "2.3.
|
|
148
|
-
"cicy-code-linux-x64": "2.3.
|
|
149
|
-
"cicy-code-linux-arm64": "2.3.
|
|
146
|
+
"cicy-code-darwin-x64": "2.3.563",
|
|
147
|
+
"cicy-code-darwin-arm64": "2.3.563",
|
|
148
|
+
"cicy-code-linux-x64": "2.3.563",
|
|
149
|
+
"cicy-code-linux-arm64": "2.3.563",
|
|
150
150
|
"cicy-code-windows-x64": "2.3.193",
|
|
151
151
|
"cicy-mihomo-darwin-x64": "1.10.4",
|
|
152
152
|
"cicy-mihomo-darwin-arm64": "1.10.4",
|
package/src/sidecar/docker.js
CHANGED
|
@@ -17,6 +17,7 @@ const http = require("http");
|
|
|
17
17
|
const fs = require("fs");
|
|
18
18
|
const os = require("os");
|
|
19
19
|
const path = require("path");
|
|
20
|
+
const { classifyWslPrerequisites } = require("./wsl-prerequisites");
|
|
20
21
|
|
|
21
22
|
const IMAGE = process.env.CICY_DOCKER_IMAGE || "cicybot/cicy-code:latest";
|
|
22
23
|
// Image tarball on Aliyun OSS (oss-cn-shanghai, public-read) — CN-domestic and
|
|
@@ -660,7 +661,12 @@ async function dismEnableFeature(feature, label, { emit } = {}) {
|
|
|
660
661
|
// features are verified-enabled (a Windows reboot is then needed before Docker
|
|
661
662
|
// can use WSL2), or { failed } if a feature couldn't be enabled.
|
|
662
663
|
async function ensureWsl({ emit } = {}) {
|
|
663
|
-
|
|
664
|
+
const executableMissing = await wslMissing();
|
|
665
|
+
const subsystemEnabled = await featureEnabled("Microsoft-Windows-Subsystem-Linux");
|
|
666
|
+
const vmPlatformEnabled = await featureEnabled("VirtualMachinePlatform");
|
|
667
|
+
const state = classifyWslPrerequisites({ executableMissing, subsystemEnabled, vmPlatformEnabled });
|
|
668
|
+
if (state.ready) return { ok: true };
|
|
669
|
+
|
|
664
670
|
emit && emit({ phase: "install-docker", status: "running", message: "Docker 需要 WSL2 后端,开始启用所需的 Windows 功能…" });
|
|
665
671
|
const a = await dismEnableFeature("Microsoft-Windows-Subsystem-Linux", "启用 WSL 功能 1/2 · Linux 子系统", { emit });
|
|
666
672
|
const b = await dismEnableFeature("VirtualMachinePlatform", "启用 WSL 功能 2/2 · 虚拟机平台", { emit });
|
|
@@ -668,10 +674,12 @@ async function ensureWsl({ emit } = {}) {
|
|
|
668
674
|
emit && emit({ phase: "done", status: "error", message: "WSL 功能未能全部启用——请点「重试」" });
|
|
669
675
|
return { ok: false, needsReboot: false, failed: true };
|
|
670
676
|
}
|
|
671
|
-
// Best-effort: also pull the WSL2 kernel/plumbing
|
|
672
|
-
//
|
|
673
|
-
|
|
674
|
-
|
|
677
|
+
// Best-effort: also pull the WSL2 kernel/plumbing when the executable itself
|
|
678
|
+
// is missing. Feature-only repairs must stop here and wait for reboot.
|
|
679
|
+
if (state.installWsl) {
|
|
680
|
+
await launchElevated("wsl", ["--install", "--no-distribution"], { emit }).catch(() => {});
|
|
681
|
+
}
|
|
682
|
+
emit && emit({ phase: "install-docker", status: "running", message: "WSL2 功能已启用 ✓,请【重启 Windows】;重启后回来点「重试」继续。" });
|
|
675
683
|
return { ok: false, needsReboot: true };
|
|
676
684
|
}
|
|
677
685
|
|
|
@@ -929,11 +929,10 @@ async function _bootstrap({ onProgress, port = 8008, container = "cicy-code-dock
|
|
|
929
929
|
|
|
930
930
|
// 1) WSL2 platform
|
|
931
931
|
begin("ensure-wsl");
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
} else done(true);
|
|
932
|
+
const w = await docker.ensureWsl({ emit });
|
|
933
|
+
if (w.needsReboot) { fail("wsl_reboot_required"); emit({ phase: "done", status: "reboot", message: "WSL2 所需功能已启用——请【重启 Windows】后回来点「重试」继续。" }); finish(false, "wsl_reboot_required"); return { ok: false, reason: "wsl_reboot_required" }; }
|
|
934
|
+
if (!w.ok) { fail("wsl_enable_failed"); finish(false, "wsl_enable_failed"); return { ok: false, reason: "wsl_enable_failed" }; }
|
|
935
|
+
done(true);
|
|
937
936
|
|
|
938
937
|
// 2) Ubuntu distro
|
|
939
938
|
begin("ensure-distro");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2026 CiCy AI
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
function classifyWslPrerequisites({ executableMissing, subsystemEnabled, vmPlatformEnabled }) {
|
|
5
|
+
const featuresReady = subsystemEnabled && vmPlatformEnabled;
|
|
6
|
+
const ready = !executableMissing && featuresReady;
|
|
7
|
+
return {
|
|
8
|
+
ready,
|
|
9
|
+
enableFeatures: !featuresReady,
|
|
10
|
+
installWsl: executableMissing,
|
|
11
|
+
needsReboot: !ready,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = { classifyWslPrerequisites };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const test = require("node:test");
|
|
2
|
+
const assert = require("node:assert/strict");
|
|
3
|
+
|
|
4
|
+
const { classifyWslPrerequisites } = require("../src/sidecar/wsl-prerequisites");
|
|
5
|
+
|
|
6
|
+
test("requires feature enablement and reboot when wsl.exe exists but Windows features are disabled", () => {
|
|
7
|
+
assert.deepEqual(
|
|
8
|
+
classifyWslPrerequisites({
|
|
9
|
+
executableMissing: false,
|
|
10
|
+
subsystemEnabled: false,
|
|
11
|
+
vmPlatformEnabled: false,
|
|
12
|
+
}),
|
|
13
|
+
{ ready: false, enableFeatures: true, installWsl: false, needsReboot: true },
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("is ready only when wsl.exe and both Windows features are available", () => {
|
|
18
|
+
assert.deepEqual(
|
|
19
|
+
classifyWslPrerequisites({
|
|
20
|
+
executableMissing: false,
|
|
21
|
+
subsystemEnabled: true,
|
|
22
|
+
vmPlatformEnabled: true,
|
|
23
|
+
}),
|
|
24
|
+
{ ready: true, enableFeatures: false, installWsl: false, needsReboot: false },
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("installs WSL and enables features when wsl.exe is missing", () => {
|
|
29
|
+
assert.deepEqual(
|
|
30
|
+
classifyWslPrerequisites({
|
|
31
|
+
executableMissing: true,
|
|
32
|
+
subsystemEnabled: false,
|
|
33
|
+
vmPlatformEnabled: false,
|
|
34
|
+
}),
|
|
35
|
+
{ ready: false, enableFeatures: true, installWsl: true, needsReboot: true },
|
|
36
|
+
);
|
|
37
|
+
});
|