cicy-desktop 2.1.256 → 2.1.258

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.
@@ -9,6 +9,10 @@ on:
9
9
  permissions:
10
10
  contents: write
11
11
 
12
+ concurrency:
13
+ group: cicy-desktop-release-linux
14
+ cancel-in-progress: true
15
+
12
16
  jobs:
13
17
  build-linux-app:
14
18
  runs-on: ubuntu-latest
@@ -60,23 +64,14 @@ jobs:
60
64
  # hook (scripts/build-homepage.cjs) right before `npm run build:linux` below,
61
65
  # so the AppImage can never ship a stale homepage. No explicit step needed.
62
66
 
63
- - name: Build Linux app (deb + AppImage)
67
+ - name: Build Linux AppImage
64
68
  shell: bash
65
69
  env:
66
70
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67
71
  CICY_OBFUSCATE: "1" # 发版混淆 JS(prebuild 主进程 + Vite 渲染层),仅 release CI
68
72
  run: |
69
73
  set -euo pipefail
70
- npm run build:linux -- --publish always
71
-
72
- - name: Upload Linux artifacts
73
- uses: actions/upload-artifact@v4
74
- with:
75
- name: cicy-desktop-linux
76
- path: |
77
- dist/*.deb
78
- dist/*.AppImage
79
- dist/latest-linux.yml
74
+ npm run build:linux -- --x64 --config.linux.target=AppImage --publish always
80
75
 
81
76
  # AppImage + 版本指针传到 OSS —— app-updater 现已全走 OSS(不碰 GitHub),linux 也要在
82
77
  # OSS 上有 versioned AppImage(CiCy-Desktop-<ver>.AppImage)和自己的指针 linux-latest-version.txt。
@@ -9,6 +9,10 @@ on:
9
9
  permissions:
10
10
  contents: write
11
11
 
12
+ concurrency:
13
+ group: cicy-desktop-release-macos
14
+ cancel-in-progress: true
15
+
12
16
  jobs:
13
17
  build-mac-app:
14
18
  runs-on: macos-latest
@@ -97,7 +101,7 @@ jobs:
97
101
  done
98
102
  iconutil -c icns build/icon.iconset -o build/logo.icns || { echo "::warning::iconutil failed"; exit 0; }
99
103
 
100
- - name: Build macOS app (dmg + zip, unsigned)
104
+ - name: Build macOS app directories (unsigned)
101
105
  # CSC_IDENTITY_AUTO_DISCOVERY=false stops electron-builder from probing the
102
106
  # runner keychain for a cert it does not have; combined with
103
107
  # build.mac.identity=null in package.json this produces a clean unsigned
@@ -111,27 +115,16 @@ jobs:
111
115
  run: |
112
116
  set -euo pipefail
113
117
  rm -rf dist
114
- # Build BOTH arches: --arm64 (Apple Silicon) AND --x64 (Intel). The runner
115
- # is arm64 and electron-builder cross-builds x64, so Intel Macs get a NATIVE
116
- # dmg instead of being forced onto the slow `npx` electron path (the repo had
117
- # only arm64 dmgs, so x86_64 Macs had no installer). cicy-code sidecar is
118
- # already built for darwin amd64 + arm64 above.
118
+ # Build BOTH native app directories, then package only the PKGs consumed by
119
+ # the updater/download page. Avoiding dmg/zip saves macOS runner time and
120
+ # duplicate release storage.
119
121
  if [ -f build/logo.icns ]; then
120
- npm run build:mac -- --arm64 --x64 --config.mac.icon=build/logo.icns --publish always
122
+ npm run build:mac -- --dir --arm64 --x64 --config.mac.icon=build/logo.icns --publish never
121
123
  else
122
124
  echo "::warning::build/logo.icns missing — using default Electron icon"
123
- npm run build:mac -- --arm64 --x64 --publish always
125
+ npm run build:mac -- --dir --arm64 --x64 --publish never
124
126
  fi
125
127
 
126
- - name: Upload macOS artifacts
127
- uses: actions/upload-artifact@v4
128
- with:
129
- name: cicy-desktop-mac
130
- path: |
131
- dist/*.dmg
132
- dist/*.zip
133
- if-no-files-found: error
134
-
135
128
  - name: Resolve release version
136
129
  id: meta
137
130
  shell: bash
@@ -140,7 +133,7 @@ jobs:
140
133
  echo "version=${version}" >> "$GITHUB_OUTPUT"
141
134
  echo "tag=v${version}" >> "$GITHUB_OUTPUT"
142
135
 
143
- - name: Create GitHub release (idempotent)
136
+ - name: Ensure draft GitHub release exists
144
137
  shell: bash
145
138
  env:
146
139
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -150,30 +143,10 @@ jobs:
150
143
  --title "CiCy Desktop v${{ steps.meta.outputs.version }}" \
151
144
  --target "$GITHUB_SHA" \
152
145
  --generate-notes \
153
- --latest \
146
+ --draft \
154
147
  2>/dev/null || echo "release already exists, continuing"
155
148
 
156
- - name: Publish macOS assets (dmg + zip + latest-mac.yml)
157
- shell: bash
158
- env:
159
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160
- CSC_IDENTITY_AUTO_DISCOVERY: "false"
161
- run: |
162
- gh release upload "${{ steps.meta.outputs.tag }}" dist/*.dmg dist/*.zip \
163
- --repo "$GITHUB_REPOSITORY" --clobber
164
- # Also upload latest-mac.yml generated by --publish always into dist/
165
- if ls dist/latest-mac.yml 2>/dev/null; then
166
- gh release upload "${{ steps.meta.outputs.tag }}" dist/latest-mac.yml \
167
- --repo "$GITHUB_REPOSITORY" --clobber
168
- fi
169
-
170
- # Lightweight app installer (~150MB): prebuilt ad-hoc-signed .app + install.command.
171
- # No Apple cert (installer strips quarantine + re-ad-hoc-signs locally). Docker is
172
- # NOT bundled — the app downloads + reuses it at runtime (keeps this small). For a
173
- # fully-offline install, drop the docker base disk + cicy-code image next to
174
- # install.command in a docker/ subdir and it'll stage them instead.
175
- - name: Build app installer bundles (.app + installer, no docker)
176
- continue-on-error: true # extra artifact — never fail the dmg/zip release
149
+ - name: Build and publish PKG installers
177
150
  shell: bash
178
151
  env:
179
152
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -189,15 +162,8 @@ jobs:
189
162
  bin="$(find "$d/Contents/MacOS" -maxdepth 1 -type f | head -1)"
190
163
  if lipo -archs "$bin" 2>/dev/null | grep -qw "$WANT"; then APP="$d"; break; fi
191
164
  done < <(find dist -maxdepth 2 -type d -name "*.app" -print0)
192
- [ -n "$APP" ] || { echo "::warning::no $ARCH .app found, skipping"; continue; }
193
- echo "app installer $ARCH ← $APP"
194
- B="appbundle-$ARCH"; rm -rf "$B"; mkdir -p "$B"
195
- cp -R "$APP" "$B/CiCy Desktop.app"
196
- cp scripts/mac-allinone/install.command "$B/"; chmod +x "$B/install.command"
197
- OUT="cicy-desktop-app-$VER-$ARCH.tar.gz"
198
- tar -czf "$OUT" -C "$B" .
199
- gh release upload "${{ steps.meta.outputs.tag }}" "$OUT" --repo "$GITHUB_REPOSITORY" --clobber
200
- echo "uploaded $OUT ($(du -h "$OUT" | cut -f1))"
165
+ [ -n "$APP" ] || { echo "::error::no $ARCH .app found"; exit 1; }
166
+ echo "pkg $ARCH ← $APP"
201
167
 
202
168
  # Native .pkg installer (right-click Open once; the postinstall ad-hoc-signs
203
169
  # + de-quarantines the installed app so it opens with no Apple cert).
@@ -215,13 +181,11 @@ jobs:
215
181
  pkgbuild --analyze --root "$ROOT" "$PLIST"
216
182
  /usr/libexec/PlistBuddy -c "Set :0:BundleIsRelocatable false" "$PLIST" 2>/dev/null \
217
183
  || plutil -replace 0.BundleIsRelocatable -bool NO "$PLIST" || true
218
- if pkgbuild --root "$ROOT" --component-plist "$PLIST" --scripts "$SCR" \
219
- --identifier com.cicy.desktop --version "$VER" --install-location / "$PKG"; then
220
- gh release upload "${{ steps.meta.outputs.tag }}" "$PKG" --repo "$GITHUB_REPOSITORY" --clobber
221
- echo "uploaded $PKG ($(du -h "$PKG" | cut -f1))"
222
- else
223
- echo "::warning::pkgbuild failed for $ARCH (other arch unaffected)"
224
- fi
184
+ pkgbuild --root "$ROOT" --component-plist "$PLIST" --scripts "$SCR" \
185
+ --identifier com.cicy.desktop --version "$VER" --install-location / "$PKG"
186
+ gh release upload "${{ steps.meta.outputs.tag }}" "$PKG" \
187
+ --repo "$GITHUB_REPOSITORY" --clobber
188
+ echo "uploaded $PKG ($(du -h "$PKG" | cut -f1))"
225
189
  done
226
190
 
227
191
  # Publish the .pkg installers to OSS (CN-fast). GitHub release downloads stall from
@@ -10,6 +10,10 @@ on:
10
10
  - 'v*'
11
11
  workflow_dispatch: {}
12
12
 
13
+ concurrency:
14
+ group: cicy-desktop-release-npm
15
+ cancel-in-progress: true
16
+
13
17
  jobs:
14
18
  publish:
15
19
  runs-on: ubuntu-latest
@@ -9,6 +9,10 @@ on:
9
9
  permissions:
10
10
  contents: write
11
11
 
12
+ concurrency:
13
+ group: cicy-desktop-release-windows
14
+ cancel-in-progress: true
15
+
12
16
  jobs:
13
17
  build-windows-exe:
14
18
  runs-on: windows-latest
@@ -93,13 +97,6 @@ jobs:
93
97
  npm run build:win -- --publish always
94
98
  }
95
99
 
96
- - name: Upload EXE artifact
97
- uses: actions/upload-artifact@v4
98
- with:
99
- name: cicy-desktop-windows-exe
100
- path: dist/*.exe
101
- if-no-files-found: error
102
-
103
100
  # 推 exe 到 OSS。三件事(不再是"永远一个版本"):
104
101
  # 1) 带版本号的永久副本 releases/cicy-desktop-<version>.exe — 历史 / 指定版本 / 回滚
105
102
  # 2) latest 指针 releases/cicy-desktop-latest.exe — 只前进:本次版本 < 已发布版本(更旧的
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.256",
3
+ "version": "2.1.258",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
package/src/main.js CHANGED
@@ -1317,17 +1317,17 @@ electronApp.whenReady().then(async () => {
1317
1317
  }
1318
1318
 
1319
1319
  const profileStore = require("./profiles/profile-store");
1320
- const electronProfiles = (() => {
1320
+ const electronProfiles = () => {
1321
1321
  let rows = [];
1322
1322
  try { rows = profileStore.listProfiles("electron"); } catch {}
1323
1323
  // Profile 0 is the resident CiCy system window and must not be exposed in
1324
1324
  // the macOS title/top-bar launcher. Profile 9 is Chrome's source template.
1325
1325
  rows = rows.filter((p) => ![0, 9].includes(Number(p.accountIdx)));
1326
1326
  return rows;
1327
- })();
1328
- const chromeProfiles = (() => {
1327
+ };
1328
+ const chromeProfiles = () => {
1329
1329
  try { return profileStore.listProfiles("chrome"); } catch { return []; }
1330
- })();
1330
+ };
1331
1331
  const showProfileError = (kind, e) => {
1332
1332
  dialog.showMessageBox({
1333
1333
  type: "error",
@@ -1336,16 +1336,17 @@ electronApp.whenReady().then(async () => {
1336
1336
  buttons: ["OK"],
1337
1337
  });
1338
1338
  };
1339
- const openElectronProfile = async (accountIdx) => {
1339
+ const openElectronProfile = async (accountIdx, url) => {
1340
1340
  try {
1341
1341
  const tabs = require("./tools/tab-browser-tools");
1342
- await tabs.openTab(accountIdx, undefined, { activate: true });
1342
+ await tabs.openTab(accountIdx, url, { activate: true });
1343
1343
  const m = tabs.ensureManager(accountIdx);
1344
1344
  if (m.win.isMinimized()) m.win.restore();
1345
1345
  m.win.show();
1346
1346
  m.win.focus();
1347
1347
  } catch (e) { showProfileError("Electron", e); }
1348
1348
  };
1349
+ const openCicyAi = () => openElectronProfile(1, "https://cicy-ai.com");
1349
1350
  const openChromeProfile = async (accountIdx) => {
1350
1351
  try {
1351
1352
  await require("./tools/chrome-tools").launchOrActivateProfile({
@@ -1359,8 +1360,49 @@ electronApp.whenReady().then(async () => {
1359
1360
  catch (e) { showProfileError("Chrome", e); }
1360
1361
  };
1361
1362
 
1362
- const menuTemplate = [
1363
- ...(process.platform === "darwin" ? [{ role: "appMenu" }] : []),
1363
+ let installApplicationMenu = () => {};
1364
+ const addProfileFromMenu = async (kind) => {
1365
+ try {
1366
+ const result = await executeTool(kind === "Electron" ? "electron_add_profile" : "chrome_add_profile", {});
1367
+ const text = result && result.content && result.content[0] && result.content[0].text;
1368
+ let data = {};
1369
+ try { data = JSON.parse(text || "{}"); } catch {}
1370
+ if (result && result.isError) throw new Error(data.error || text || "unknown error");
1371
+ const accountIdx = Number(data.accountIdx ?? (data.created && data.created.accountIdx));
1372
+ installApplicationMenu(); // the new profile appears immediately in the native menu
1373
+ if (Number.isFinite(accountIdx)) {
1374
+ if (kind === "Electron") await openElectronProfile(accountIdx);
1375
+ else await openChromeProfile(accountIdx);
1376
+ }
1377
+ } catch (e) {
1378
+ dialog.showMessageBox({
1379
+ type: "error",
1380
+ message: `新增 ${kind} Profile 失败`,
1381
+ detail: String((e && e.message) || e),
1382
+ buttons: ["OK"],
1383
+ });
1384
+ }
1385
+ };
1386
+
1387
+ installApplicationMenu = () => {
1388
+ const electronRows = electronProfiles();
1389
+ const chromeRows = chromeProfiles();
1390
+ const menuTemplate = [
1391
+ ...(process.platform === "darwin" ? [{
1392
+ label: electronApp.name,
1393
+ submenu: [
1394
+ { role: "about" },
1395
+ { label: "打开 cicy-ai.com", click: openCicyAi },
1396
+ { type: "separator" },
1397
+ { role: "services" },
1398
+ { type: "separator" },
1399
+ { role: "hide" },
1400
+ { role: "hideOthers" },
1401
+ { role: "unhide" },
1402
+ { type: "separator" },
1403
+ { role: "quit" },
1404
+ ],
1405
+ }] : []),
1364
1406
  {
1365
1407
  label: i18n.t("menu.file"),
1366
1408
  submenu: [
@@ -1398,17 +1440,22 @@ electronApp.whenReady().then(async () => {
1398
1440
  },
1399
1441
  {
1400
1442
  label: "Electron",
1401
- submenu: electronProfiles.map((p) => ({
1402
- label: `Profile ${p.accountIdx}${p.name ? ` · ${p.name}` : ""}`,
1403
- click: () => openElectronProfile(Number(p.accountIdx)),
1404
- })),
1443
+ submenu: [
1444
+ { label: "新增 Profile", click: () => addProfileFromMenu("Electron") },
1445
+ ...(electronRows.length ? [{ type: "separator" }] : []),
1446
+ ...electronRows.map((p) => ({
1447
+ label: `Profile ${p.accountIdx}${p.name ? ` · ${p.name}` : ""}`,
1448
+ click: () => openElectronProfile(Number(p.accountIdx)),
1449
+ })),
1450
+ ],
1405
1451
  },
1406
1452
  {
1407
1453
  label: "Chrome",
1408
1454
  submenu: [
1455
+ { label: "新增 Profile", click: () => addProfileFromMenu("Chrome") },
1409
1456
  { label: "原生 Chrome", click: openNativeChrome },
1410
- { type: "separator" },
1411
- ...chromeProfiles.map((p) => ({
1457
+ ...(chromeRows.length ? [{ type: "separator" }] : []),
1458
+ ...chromeRows.map((p) => ({
1412
1459
  label: `Profile ${p.accountIdx}${p.gmail ? ` · ${p.gmail}` : p.note ? ` · ${p.note}` : ""}`,
1413
1460
  click: () => openChromeProfile(Number(p.accountIdx)),
1414
1461
  })),
@@ -1423,8 +1470,16 @@ electronApp.whenReady().then(async () => {
1423
1470
  : [{ label: i18n.t("menu.close"), role: "close" }]),
1424
1471
  ],
1425
1472
  },
1426
- ];
1427
- Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate));
1473
+ ...(process.platform !== "darwin" ? [{
1474
+ label: i18n.t("menu.help"),
1475
+ submenu: [
1476
+ { label: "打开 cicy-ai.com", click: openCicyAi },
1477
+ ],
1478
+ }] : []),
1479
+ ];
1480
+ Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate));
1481
+ };
1482
+ installApplicationMenu();
1428
1483
 
1429
1484
  // Always open the homepage unless launched at login with --hidden.
1430
1485
  const hidden = process.argv.includes("--hidden");