cicy-desktop 2.1.68 → 2.1.70

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.68",
3
+ "version": "2.1.70",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -143,7 +143,8 @@
143
143
  "cicy-mihomo-linux-x64": "1.10.4",
144
144
  "cicy-mihomo-linux-arm64": "1.10.4",
145
145
  "cicy-mihomo-windows-x64": "1.10.4",
146
- "cicy-mihomo-windows-arm64": "1.10.4"
146
+ "cicy-mihomo-windows-arm64": "1.10.4",
147
+ "cicy-msys2-windows-x64": "1.0.0"
147
148
  },
148
149
  "devDependencies": {
149
150
  "@babel/core": "^7.29.0",
@@ -154,4 +155,4 @@
154
155
  "prettier": "^3.8.1",
155
156
  "supertest": "^6.3.3"
156
157
  }
157
- }
158
+ }
@@ -28,7 +28,7 @@ const docker = require("./docker"); // ensureDownloaded/withRetry/waitUntil/prob
28
28
  // dev/联调 only — read LAZILY (not at require time) so tests/tools can set the
29
29
  // env var after loading the module.
30
30
  const devExeUrl = () => process.env.CICY_CODE_EXE_URL || "";
31
- const EXE_PKG = process.env.CICY_CODE_EXE_PKG || "cicy-code-win32-x64";
31
+ const EXE_PKG = process.env.CICY_CODE_EXE_PKG || "cicy-code-windows-x64"; // npm spam filter 403s 'win32' names
32
32
  const REGISTRY = process.env.CICY_NPM_REGISTRY || "https://registry.npmmirror.com";
33
33
  const BIN_DIR = path.join(os.homedir(), "cicy-ai", "bin");
34
34
  // npm prefix dir owned by the sidecar (isolated from the user's global npm).
@@ -30,8 +30,13 @@ const VERSIONS_JSON = path.join(RUNTIME_DIR, "versions.json");
30
30
  const REGISTRY = process.env.CICY_NPM_REGISTRY || "https://registry.npmmirror.com";
31
31
  const IS_WIN = process.platform === "win32";
32
32
 
33
+ // npm subpackage platform suffix. NOTE: Windows is "windows" not "win32" —
34
+ // npm's spam filter 403s NEW package names containing 'win32', so EVERY cicy
35
+ // subpackage (code/mihomo/msys2) is published as *-windows-*. This must match
36
+ // the published names exactly or both the bundled-dir lookup AND the npm-pull
37
+ // fallback fail (a 404 that stranded first start on Windows).
33
38
  function plat() {
34
- const osStr = IS_WIN ? "win32" : process.platform === "darwin" ? "darwin" : "linux";
39
+ const osStr = IS_WIN ? "windows" : process.platform === "darwin" ? "darwin" : "linux";
35
40
  const archStr = process.arch === "arm64" ? "arm64" : "x64";
36
41
  return `${osStr}-${archStr}`;
37
42
  }
@@ -46,8 +51,7 @@ const COMPONENTS = {
46
51
  },
47
52
  "mihomo": {
48
53
  kind: "bin",
49
- // npm spam filter 403s new names containing 'win32' → windows-* naming
50
- pkg: () => `cicy-mihomo-${plat().replace("win32", "windows")}`,
54
+ pkg: () => `cicy-mihomo-${plat()}`,
51
55
  bin: () => (IS_WIN ? "mihomo.exe" : "mihomo"),
52
56
  },
53
57
  "msys2": {
@@ -105,9 +109,17 @@ function installPayload(comp, ver, payloadDir) {
105
109
  fs.rmSync(staging, { recursive: true, force: true });
106
110
  fs.mkdirSync(staging, { recursive: true });
107
111
  if (c.kind === "dir") {
108
- cpDirSync(payloadDir, staging);
112
+ // The 118MB+ MSYS2 tree ships as a single .tar.gz inside the npm package
113
+ // (npm handles one big file far better than 10k tiny ones). Extract it;
114
+ // otherwise the payload is already an unpacked tree → copy.
115
+ const tgz = (() => { try { return fs.readdirSync(payloadDir).find((f) => /\.tar\.gz$/i.test(f)); } catch { return null; } })();
116
+ if (tgz) {
117
+ require("child_process").execFileSync("tar", ["-xzf", path.join(payloadDir, tgz), "-C", staging], { windowsHide: true });
118
+ } else {
119
+ cpDirSync(payloadDir, staging);
120
+ }
109
121
  if (!fs.existsSync(path.join(staging, c.check))) {
110
- // the tree may be nested one level (package/msys64/usr/...)
122
+ // the tree may be nested one level (package/msys64/usr/... or root/usr/...)
111
123
  const sub = fs.readdirSync(staging).find((d) =>
112
124
  fs.existsSync(path.join(staging, d, c.check)));
113
125
  if (!sub) { fs.rmSync(staging, { recursive: true, force: true }); throw new Error(`${comp}: ${c.check} missing in package`); }