cicy-desktop 2.1.319 → 2.1.321

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.319",
3
+ "version": "2.1.321",
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.581",
148
- "cicy-code-darwin-arm64": "2.3.581",
149
- "cicy-code-linux-x64": "2.3.581",
150
- "cicy-code-linux-arm64": "2.3.581",
147
+ "cicy-code-darwin-x64": "2.3.589",
148
+ "cicy-code-darwin-arm64": "2.3.589",
149
+ "cicy-code-linux-x64": "2.3.589",
150
+ "cicy-code-linux-arm64": "2.3.589",
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",
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env bash
2
+ # Push a locally built CiCy Desktop installer to every Windows node and install
3
+ # it there — no CDN, no auto-update wait.
4
+ #
5
+ # scripts/deploy-exe-fleet.sh [path/to/CiCy Desktop Setup X.Y.Z.exe] [node...]
6
+ #
7
+ # Per node (ssh alias from ~/.ssh/config, e.g. xs-1001 — frp via ws-hub):
8
+ # 1. scp the exe into the node's ~/projects (= C:\ of its Windows host)
9
+ # 2. ssh -L tunnel to the node's cicy-code :8008, ask it for connected
10
+ # cicy-desktop clients (agent-desktop clients)
11
+ # 3. agent-desktop exec-file a tiny .bat on each Windows client that runs the
12
+ # installer silently (/S). The installer closes the running desktop and
13
+ # relaunches it; the client's ack may time out — that's expected.
14
+ #
15
+ # Env: NODES="xs-1001 xs-1002" to override discovery; LOCAL_PORT_BASE=18100.
16
+ set -uo pipefail
17
+ cd "$(dirname "$0")/.."
18
+
19
+ EXE=${1:-}
20
+ if [ -z "$EXE" ]; then
21
+ EXE=$(ls -t ../cicy-desktop-win/dist/CiCy\ Desktop\ Setup\ *.exe 2>/dev/null | head -1)
22
+ fi
23
+ [ -f "$EXE" ] || { echo "installer not found: '$EXE'" >&2; exit 1; }
24
+ shift || true
25
+ VER=$(basename "$EXE" | sed -E 's/.*Setup ([0-9.]+)\.exe/\1/')
26
+ REMOTE_NAME="CiCy-Desktop-Setup-$VER.exe"
27
+ WIN_PATH="C:\\$REMOTE_NAME"
28
+
29
+ if [ $# -gt 0 ]; then NODES="$*"; fi
30
+ if [ -z "${NODES:-}" ]; then
31
+ # every xs-* alias in ~/.ssh/config (Windows hosts); mac-local etc. are not exe targets
32
+ NODES=$(awk '/^Host xs-/{print $2}' ~/.ssh/config | sort -V)
33
+ fi
34
+ PORT=${LOCAL_PORT_BASE:-18100}
35
+ SCRATCH=$(mktemp -d)
36
+ trap 'rm -rf "$SCRATCH"' EXIT
37
+
38
+ cat > "$SCRATCH/install.bat" <<EOF
39
+ @echo off
40
+ if not exist "$WIN_PATH" (echo missing $WIN_PATH & exit /b 2)
41
+ start "" "$WIN_PATH" /S
42
+ echo started installer $VER
43
+ EOF
44
+
45
+ echo "installer: $EXE ($VER) -> $WIN_PATH"
46
+ echo "nodes: $(echo $NODES | tr '\n' ' ')"
47
+ ok=(); skipped=(); failed=()
48
+ for n in $NODES; do
49
+ echo "== $n"
50
+ if ! timeout 20 ssh -n -o ConnectTimeout=10 -o BatchMode=yes "$n" true 2>/dev/null; then
51
+ echo " offline, skipped"; skipped+=("$n"); continue
52
+ fi
53
+ if ! timeout 600 scp -q -o ConnectTimeout=15 "$EXE" "$n:projects/$REMOTE_NAME"; then
54
+ echo " scp failed"; failed+=("$n(scp)"); continue
55
+ fi
56
+ echo " copied to $WIN_PATH"
57
+ TOKEN=$(timeout 30 ssh -n "$n" 'python3 -c "import json;print(json.load(open(\"/home/cicy/cicy-ai/global.json\")).get(\"api_token\",\"\"))"' 2>/dev/null | tail -1)
58
+ if [ -z "$TOKEN" ]; then echo " no api token"; failed+=("$n(token)"); continue; fi
59
+ PORT=$((PORT+1))
60
+ ssh -f -N -o ExitOnForwardFailure=yes -o ConnectTimeout=15 -L "$PORT:127.0.0.1:8008" "$n" 2>/dev/null || { echo " tunnel failed"; failed+=("$n(tunnel)"); continue; }
61
+ sleep 1
62
+ CLIENTS=$(CICY_API_PORT=$PORT CICY_API_TOKEN="$TOKEN" timeout 40 agent-desktop clients --json 2>/dev/null \
63
+ | python3 -c 'import sys,json
64
+ try:
65
+ d=json.load(sys.stdin)
66
+ except Exception:
67
+ sys.exit(0)
68
+ rows=d if isinstance(d,list) else (d.get("clients") or d.get("data") or [])
69
+ for c in rows:
70
+ if not isinstance(c,dict): continue
71
+ cid=c.get("client_id") or c.get("clientId") or c.get("id")
72
+ plat=str(c.get("platform") or "")
73
+ if cid and (plat.startswith("win") or not plat): print(cid)' )
74
+ if [ -z "$CLIENTS" ]; then
75
+ echo " no cicy-desktop client connected on $n (exe left at $WIN_PATH)"; failed+=("$n(no-desktop)")
76
+ else
77
+ for c in $CLIENTS; do
78
+ printf " install on %s ... " "$c"
79
+ out=$(CICY_API_PORT=$PORT CICY_API_TOKEN="$TOKEN" timeout 45 agent-desktop exec-file "$SCRATCH/install.bat" --client "$c" 2>&1 | tail -1)
80
+ echo "${out:-sent}"
81
+ done
82
+ ok+=("$n")
83
+ fi
84
+ pkill -f -- "-L $PORT:127.0.0.1:8008 $n" 2>/dev/null
85
+ done
86
+ echo
87
+ echo "installed/sent: ${ok[*]:-none}"
88
+ echo "skipped (offline): ${skipped[*]:-none}"
89
+ echo "failed: ${failed[*]:-none}"
@@ -316,6 +316,21 @@ contextBridge.exposeInMainWorld("cicy", {
316
316
  cloud: {
317
317
  fetch: (url, opts) => logInvoke("cloud:fetch", { url, ...(opts || {}) }),
318
318
  },
319
+ // CiCy Hub — email sign-in, then every cicy-code instance of that account.
320
+ hub: {
321
+ status: () => logInvoke("hub:status"),
322
+ loginStart: (email) => logInvoke("hub:login-start", email),
323
+ loginCode: (code) => logInvoke("hub:login-code", code),
324
+ cancel: () => logInvoke("hub:cancel"),
325
+ instances: () => logInvoke("hub:instances"),
326
+ open: (id, title, port) => logInvoke("hub:open", { id, title, port }),
327
+ logout: () => logInvoke("hub:logout"),
328
+ onComplete: (cb) => {
329
+ const handler = (_e, payload) => cb(payload);
330
+ ipcRenderer.on("hub:complete", handler);
331
+ return () => ipcRenderer.removeListener("hub:complete", handler);
332
+ },
333
+ },
319
334
 
320
335
  // Homepage window state. onFullscreen fires (bool) whenever the user
321
336
  // enter/leaves macOS native fullscreen — renderer toggles a data-attr