cicy-desktop 2.1.32 → 2.1.34

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/README.md CHANGED
@@ -45,7 +45,41 @@ cicy-rpc open_window url=https://example.com
45
45
  cicy-rpc --json get_window_info win_id=1
46
46
  ```
47
47
 
48
- ## Quick start
48
+ ## Run (end users, no clone)
49
+
50
+ First run launches the Electron app and drops a desktop shortcut (Windows
51
+ `.lnk` / macOS `.app` / Linux `.desktop`, all with the CiCy icon); double-click
52
+ it afterwards.
53
+
54
+ **CN needs the electron mirror.** A fresh machine has no cached electron
55
+ binary, so electron's postinstall would hit GitHub releases and fail. Point
56
+ `ELECTRON_MIRROR` + the npm registry at npmmirror.
57
+
58
+ ### Windows — global install (NOT npx)
59
+
60
+ npx's libnpmexec lock false-positives as `ECOMPROMISED` / "Lock compromised" on
61
+ Windows boxes with realtime antivirus (Defender touches `node_modules` mtimes
62
+ mid-install → the lock heartbeat aborts). `npm i -g` has no such lock, so
63
+ Windows installs globally and launches the global bin:
64
+
65
+ ```cmd
66
+ cmd /c "set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/&& npm i -g cicy-desktop --registry=https://registry.npmmirror.com&& cicy-desktop"
67
+ ```
68
+
69
+ Re-run the same line to update. The generated `.lnk` runs the global
70
+ `cicy-desktop` bin (no npx).
71
+
72
+ ### macOS / Linux — npx
73
+
74
+ npx's lock works fine here:
75
+
76
+ ```bash
77
+ ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm_config_registry=https://registry.npmmirror.com npx -y cicy-desktop
78
+ ```
79
+
80
+ Outside CN (or once electron is cached) a plain `npx -y cicy-desktop` is enough.
81
+
82
+ ## Quick start (development)
49
83
 
50
84
  ### 1. Install
51
85
 
package/bin/cicy-desktop CHANGED
@@ -13,6 +13,11 @@ const GLOBAL_CONFIG_FILE = path.join(HOME, "global.json");
13
13
  const STATE_FILE = path.join(HOME, ".cicy-cluster.json");
14
14
  const LOGS_DIR = path.join(HOME, "logs");
15
15
  const PACKAGE_ROOT = path.join(__dirname, "..");
16
+ // CN defaults: a fresh machine has no cached electron binary, so npx's electron
17
+ // postinstall would hit GitHub releases and fail (ECOMPROMISED). Mirror it +
18
+ // the npm registry to npmmirror (overridable via the same-named env vars).
19
+ const ELECTRON_MIRROR = process.env.ELECTRON_MIRROR || "https://npmmirror.com/mirrors/electron/";
20
+ const NPM_REGISTRY = process.env.CICY_NPM_REGISTRY || process.env.npm_config_registry || "https://registry.npmmirror.com";
16
21
  const MASTER_ENTRY = path.join(PACKAGE_ROOT, "src", "master", "master-main.js");
17
22
 
18
23
  // Resolve the electron binary to spawn. Prefers the project-local copy
@@ -375,8 +380,13 @@ function ensureMacDesktopApp() {
375
380
  const nodeDir = nodeBinDir();
376
381
  // do shell script needs node on PATH (GUI launch has a minimal PATH); the
377
382
  // trailing & + nohup + </dev/null lets the shell return so the applet quits.
383
+ // ELECTRON_MIRROR + npmmirror: a fresh CN machine has no cached electron
384
+ // binary, so npx's electron postinstall would try GitHub releases and fail
385
+ // (ECOMPROMISED / lock-compromised). Point it at npmmirror's electron mirror.
386
+ // Harmless elsewhere — only consulted when electron actually (re)downloads.
378
387
  const ascript =
379
388
  `do shell script "export PATH=\\"${nodeDir}:/usr/local/bin:/opt/homebrew/bin:$PATH\\" ; ` +
389
+ `export ELECTRON_MIRROR=\\"${ELECTRON_MIRROR}\\" ; export npm_config_registry=\\"${NPM_REGISTRY}\\" ; ` +
380
390
  `nohup npx -y cicy-desktop > /tmp/cicy-desktop.log 2>&1 < /dev/null &"`;
381
391
  const tmp = path.join(os.tmpdir(), `cicy-launch-${process.pid}.applescript`);
382
392
  fs.writeFileSync(tmp, ascript);
@@ -402,7 +412,7 @@ function ensureLinuxDesktopEntry() {
402
412
  `[Desktop Entry]
403
413
  Type=Application
404
414
  Name=CiCy Desktop
405
- Exec=sh -c 'export PATH="${nodeBinDir()}:$PATH"; exec npx -y cicy-desktop'
415
+ Exec=sh -c 'export PATH="${nodeBinDir()}:$PATH"; export ELECTRON_MIRROR="${ELECTRON_MIRROR}"; export npm_config_registry="${NPM_REGISTRY}"; exec npx -y cicy-desktop'
406
416
  Icon=${icon}
407
417
  Terminal=false
408
418
  Categories=Development;
@@ -414,6 +424,13 @@ Categories=Development;
414
424
  function ensureWindowsShortcut() {
415
425
  // A .cmd is icon-less; a proper .lnk with the CiCy icon is written via a
416
426
  // throwaway PowerShell script (WScript.Shell CreateShortcut + IconLocation).
427
+ //
428
+ // The shortcut runs the GLOBALLY-installed `cicy-desktop` bin, NOT
429
+ // `npx cicy-desktop`. npx's libnpmexec lock false-positives as
430
+ // "ECOMPROMISED / Lock compromised" on Windows boxes with realtime
431
+ // antivirus (Defender touches node_modules mtimes mid-install → the lock
432
+ // heartbeat aborts). `npm i -g` has no such lock, so Windows installs +
433
+ // launches via the global bin (see README "Run via npx" / install one-liner).
417
434
  const ico = path.join(PACKAGE_ROOT, "build", "icon.ico");
418
435
  const lnk = path.join(DESKTOP_DIR, "CiCy Desktop.lnk");
419
436
  const nodeDir = nodeBinDir();
@@ -422,7 +439,7 @@ function ensureWindowsShortcut() {
422
439
  `$ws = New-Object -ComObject WScript.Shell
423
440
  $s = $ws.CreateShortcut('${lnk.replace(/'/g, "''")}')
424
441
  $s.TargetPath = 'cmd.exe'
425
- $s.Arguments = '/c set PATH=${nodeDir};%PATH% && npx -y cicy-desktop'
442
+ $s.Arguments = '/c set PATH=${nodeDir};%APPDATA%\\npm;%PATH%&& cicy-desktop'
426
443
  $s.IconLocation = '${ico.replace(/'/g, "''")}'
427
444
  $s.Save()
428
445
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.32",
3
+ "version": "2.1.34",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {