cicy-desktop 2.1.100 → 2.1.101

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.100",
3
+ "version": "2.1.101",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -28,9 +28,30 @@ const DOCKER_DESKTOP_MIRROR = process.env.CICY_DOCKER_DESKTOP_MIRROR
28
28
  // CICY_* env vars forwarded into the container (team onboarding, version pin…).
29
29
  const PASS_ENV = ["CICY_TEAM_TOKEN", "CICY_CODE_VERSION", "NPM_REGISTRY", "CICY_NPM_REGISTRY", "CICY_AGENTS", "ENABLE_CDN", "CICY_CLOUDFLARED_TOKEN"];
30
30
 
31
+ // Resolve the docker CLI. CRITICAL on Windows: right after Docker Desktop
32
+ // installs, it adds `...\Docker\resources\bin` to the SYSTEM PATH — but the
33
+ // ALREADY-RUNNING cicy-desktop process keeps its stale PATH, so a bare
34
+ // `execFile("docker", …)` ENOENTs and dockerOk() stays false forever (the
35
+ // "已安装但起不来 / 卡在正在启动" bug). Probe the known absolute install paths
36
+ // first; only fall back to PATH (and never cache that fallback, so a later
37
+ // install is picked up).
38
+ let _dockerBin = null;
39
+ function dockerBin() {
40
+ if (_dockerBin) return _dockerBin;
41
+ if (process.platform === "win32") {
42
+ const cands = [
43
+ path.join(process.env["ProgramFiles"] || "C:\\Program Files", "Docker", "Docker", "resources", "bin", "docker.exe"),
44
+ path.join(process.env["ProgramW6432"] || "", "Docker", "Docker", "resources", "bin", "docker.exe"),
45
+ path.join(process.env["LOCALAPPDATA"] || "", "Docker", "Docker", "resources", "bin", "docker.exe"),
46
+ ].filter((c) => c && !c.startsWith("Docker"));
47
+ for (const c of cands) { try { if (fs.existsSync(c)) { _dockerBin = c; return c; } } catch {} }
48
+ }
49
+ return "docker"; // PATH fallback (mac/linux, or before Docker is installed)
50
+ }
51
+
31
52
  function run(args, { timeout = 30000 } = {}) {
32
53
  return new Promise((resolve, reject) => {
33
- execFile("docker", args, { timeout, windowsHide: true }, (err, stdout, stderr) => {
54
+ execFile(dockerBin(), args, { timeout, windowsHide: true }, (err, stdout, stderr) => {
34
55
  if (err) { err.stdout = String(stdout || ""); err.stderr = String(stderr || ""); return reject(err); }
35
56
  resolve({ stdout: String(stdout), stderr: String(stderr) });
36
57
  });