@amd-gaia/agent-ui 0.26.0-rc.3 → 0.26.0-rc.30

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.
Files changed (60) hide show
  1. package/README.md +2 -2
  2. package/app.config.json +1 -1
  3. package/assets/tray-iconTemplate.png +0 -0
  4. package/assets/tray-iconTemplate@2x.png +0 -0
  5. package/dist/assets/AdvancedSettings-AZf0WCqG.js +1 -0
  6. package/dist/assets/AutomationsSettings-DwubSse_.js +1 -0
  7. package/dist/assets/ConnectorsPane-BAsWmgVb.css +1 -0
  8. package/dist/assets/ConnectorsPane-CfpUJvF6.js +1 -0
  9. package/dist/assets/DocumentLibrary-DudZtBqr.css +1 -0
  10. package/dist/assets/DocumentLibrary-DvDlhZCI.js +4 -0
  11. package/dist/assets/FileBrowser-CrRQXiPo.css +1 -0
  12. package/dist/assets/FileBrowser-CwyzT9Ee.js +4 -0
  13. package/dist/assets/MemoryDashboard-B4AO_CU8.css +1 -0
  14. package/dist/assets/MemoryDashboard-BTLZKTNP.js +1 -0
  15. package/dist/assets/MessagingSettings-CO_iuTcZ.js +1 -0
  16. package/dist/assets/MobileAccessModal-BPHPdrPb.js +2 -0
  17. package/dist/assets/MobileAccessModal-CX4NZmr4.css +1 -0
  18. package/dist/assets/ScheduleManager-B_r7eDEE.js +1 -0
  19. package/dist/assets/ScheduleManager-DQBnf_IN.css +1 -0
  20. package/dist/assets/{browser-KnDALPx_.js → browser-DfYHeeW3.js} +1 -1
  21. package/dist/assets/index-CC3nUEeN.js +107 -0
  22. package/dist/assets/index-DAgBH5y7.css +1 -0
  23. package/dist/assets/useT-DOuPwmY8.js +6 -0
  24. package/dist/assets/zap-BO861jhc.js +1 -0
  25. package/dist/index.html +17 -4
  26. package/dist/sw.js +1 -1
  27. package/main-safety-net.cjs +30 -3
  28. package/main.cjs +74 -220
  29. package/package.json +3 -3
  30. package/preload.cjs +0 -30
  31. package/services/agent-process-manager.cjs +3 -411
  32. package/services/appimage-launcher.cjs +183 -0
  33. package/services/auto-updater.cjs +56 -3
  34. package/services/backend-installer.cjs +207 -497
  35. package/services/renderer-gone-dialog.cjs +57 -0
  36. package/services/tray-manager.cjs +7 -14
  37. package/services/window-reveal.cjs +42 -0
  38. package/assets/tray-icon-active.png +0 -0
  39. package/assets/tray-icon-active@2x.png +0 -0
  40. package/dist/assets/AdvancedSettings-CaObX4Wa.js +0 -1
  41. package/dist/assets/ConnectorsPane-D0I07qUd.js +0 -1
  42. package/dist/assets/ConnectorsPane-DU5VkSj1.css +0 -1
  43. package/dist/assets/DocumentLibrary-CM6o8j2T.css +0 -1
  44. package/dist/assets/DocumentLibrary-CijRJVE8.js +0 -4
  45. package/dist/assets/FileBrowser-BU-MxcRT.js +0 -4
  46. package/dist/assets/FileBrowser-Cna3BsT7.css +0 -1
  47. package/dist/assets/MemoryDashboard-BPAUphrI.js +0 -1
  48. package/dist/assets/MemoryDashboard-DwrWAXi6.css +0 -1
  49. package/dist/assets/MobileAccessModal-BSC78LTu.js +0 -2
  50. package/dist/assets/MobileAccessModal-BkVDm3YG.css +0 -1
  51. package/dist/assets/ScheduleManager-Bc1GA1nB.js +0 -1
  52. package/dist/assets/ScheduleManager-CjHJ4NbD.css +0 -1
  53. package/dist/assets/api-BemWvhdJ.js +0 -4
  54. package/dist/assets/index-BbM3URRX.js +0 -83
  55. package/dist/assets/index-LLooEbjq.css +0 -1
  56. package/dist/assets/useT-DRJDft_1.js +0 -3
  57. package/dist/assets/zap-DSyPz4mM.js +0 -1
  58. package/services/deep-link-queue.cjs +0 -77
  59. package/services/deep-link.cjs +0 -230
  60. package/services/system-metrics.cjs +0 -154
@@ -27,6 +27,8 @@
27
27
  * - On `update-downloaded`, the chip offers the restart; nothing interrupts
28
28
  * - Renderer integration via IPC channel `gaia:update:status`
29
29
  * - Disabled entirely via GAIA_DISABLE_UPDATE=1 env var (CI / dev / corp)
30
+ * - macOS never downloads or installs: ad-hoc signed builds can't replace
31
+ * themselves (#7061), so a found update links to its release page
30
32
  * - Rollback: listReleases() → installVersion(tag) → pin persisted to
31
33
  * ~/.gaia/update-config.json so auto-update stays paused until resumeUpdates()
32
34
  *
@@ -291,6 +293,30 @@ function _releasesErrorMessage(err, doing) {
291
293
  }
292
294
  }
293
295
 
296
+ /**
297
+ * Whether this build can replace itself. macOS builds are ad-hoc signed, and
298
+ * Squirrel.Mac rejects any other ad-hoc build as the update (#7061), so a Mac
299
+ * update is offered as a download from its release page instead.
300
+ */
301
+ function _selfInstalls() {
302
+ return process.platform !== "darwin";
303
+ }
304
+
305
+ /** The release page for `version`, where its installers are downloaded by hand. */
306
+ function _releasePage(version) {
307
+ return `${RELEASES_PAGE}/tag/${_tagForVersion(version)}`;
308
+ }
309
+
310
+ /** The refusal for an install this build can't do itself. */
311
+ function _manualInstallError(version) {
312
+ const url = version ? _releasePage(version) : RELEASES_PAGE;
313
+ return _userError(
314
+ "manualInstall",
315
+ { url },
316
+ `GAIA can't update itself on this Mac yet. Download the new version from ${url} and install it over this one.`
317
+ );
318
+ }
319
+
294
320
  const STATES = Object.freeze({
295
321
  IDLE: "idle",
296
322
  CHECKING: "checking",
@@ -330,6 +356,11 @@ const state = {
330
356
  lastCheckError: null,
331
357
  // The update has downloaded and its backend is being fetched before the restart.
332
358
  preparing: false,
359
+ // This build can't install updates itself (macOS, #7061): an update is offered
360
+ // as a download from `downloadUrl` instead.
361
+ manualInstall: !_selfInstalls(),
362
+ // The release page of the offered update, or null.
363
+ downloadUrl: null,
333
364
  };
334
365
 
335
366
  let mainWindowRef = null;
@@ -363,6 +394,8 @@ let downloadEpoch = 0;
363
394
  const prefetching = new Map();
364
395
  // The user asked for this download, so it may install on quit with auto-update off.
365
396
  let installRequested = false;
397
+ // The user chose to restart into the update: the quit runs its installer.
398
+ let installingNow = false;
366
399
  // The file was unreadable at launch, so a pin it holds was never loaded.
367
400
  let pinUnknown = false;
368
401
  let scheduledTimeout = null;
@@ -469,9 +502,14 @@ function _refreshPreferences() {
469
502
 
470
503
  function _applyInstallPolicy() {
471
504
  if (!autoUpdaterRef) return;
472
- autoUpdaterRef.autoDownload = state.autoUpdate && !state.pinnedVersion;
505
+ const selfInstalls = _selfInstalls();
506
+ autoUpdaterRef.autoDownload = selfInstalls && state.autoUpdate && !state.pinnedVersion;
473
507
  autoUpdaterRef.autoInstallOnAppQuit =
474
- (state.autoUpdate || installRequested) && !abandonedDownload && !wizardNextInstall && !state.preparing;
508
+ selfInstalls &&
509
+ (state.autoUpdate || installRequested) &&
510
+ !abandonedDownload &&
511
+ !wizardNextInstall &&
512
+ !state.preparing;
475
513
  autoUpdaterRef.allowPrerelease = _prereleasesAllowed();
476
514
  }
477
515
 
@@ -515,6 +553,7 @@ const USER_ERROR_CODES = new Set([
515
553
  "diskSpace",
516
554
  "downloadFailed",
517
555
  "failedWith",
556
+ "manualInstall",
518
557
  "noEarlier",
519
558
  "noInstaller",
520
559
  "offline",
@@ -892,6 +931,9 @@ async function installVersion(tag) {
892
931
  `Invalid release tag "${tag}" — expected the form "vMAJOR.MINOR.PATCH" (e.g. "v0.20.0")`
893
932
  );
894
933
  }
934
+ if (!_selfInstalls()) {
935
+ throw _manualInstallError(tag.replace(/^v/, ""));
936
+ }
895
937
  if (checkInProgress) {
896
938
  throw _userError(
897
939
  "checkBusy",
@@ -1061,7 +1103,7 @@ async function setAutoUpdate(enabled) {
1061
1103
  _applyInstallPolicy();
1062
1104
  log("info", `Auto-update ${enabled ? "enabled" : "disabled"}`);
1063
1105
  // Turning it on with an update already offered means "install it".
1064
- if (enabled && !state.pinnedVersion && state.status === STATES.AVAILABLE) {
1106
+ if (enabled && _selfInstalls() && !state.pinnedVersion && state.status === STATES.AVAILABLE) {
1065
1107
  await downloadUpdate();
1066
1108
  }
1067
1109
  }
@@ -1402,6 +1444,7 @@ async function downloadUpdate() {
1402
1444
  `No update is waiting to download (status: ${state.status}) — check for updates first.`
1403
1445
  );
1404
1446
  }
1447
+ if (!_selfInstalls()) throw _manualInstallError(state.version);
1405
1448
  log("info", `User asked to install ${state.version}`);
1406
1449
  installRequested = true;
1407
1450
  _applyInstallPolicy();
@@ -1434,6 +1477,7 @@ async function restartToInstall() {
1434
1477
  }
1435
1478
  log("info", "User chose to restart — calling quitAndInstall");
1436
1479
  _recordInstallAttempt();
1480
+ installingNow = true;
1437
1481
  // Silent: the installer wizard would otherwise wait for clicks. Force-run
1438
1482
  // brings the app straight back.
1439
1483
  autoUpdaterRef.quitAndInstall(!wizardNextInstall, true);
@@ -1549,6 +1593,7 @@ function wireAutoUpdaterEvents() {
1549
1593
  status: STATES.AVAILABLE,
1550
1594
  version: info.version || null,
1551
1595
  releaseNotes,
1596
+ downloadUrl: info.version ? _releasePage(info.version) : RELEASES_PAGE,
1552
1597
  error: null,
1553
1598
  lastCheckError: null,
1554
1599
  });
@@ -1565,6 +1610,7 @@ function wireAutoUpdaterEvents() {
1565
1610
  version: null,
1566
1611
  progress: 0,
1567
1612
  releaseNotes: null,
1613
+ downloadUrl: null,
1568
1614
  error: null,
1569
1615
  lastCheckError: null,
1570
1616
  });
@@ -1883,6 +1929,12 @@ function _onBeforeQuit(event) {
1883
1929
  _recordInstallAttempt();
1884
1930
  }
1885
1931
 
1932
+ /** Whether this quit hands over to an update's installer, which replaces the app's files. */
1933
+ function installsOnQuit() {
1934
+ if (!autoUpdaterRef || state.status !== STATES.DOWNLOADED) return false;
1935
+ return installingNow || Boolean(autoUpdaterRef.autoInstallOnAppQuit);
1936
+ }
1937
+
1886
1938
  /** Tear down timers and IPC handlers. Safe to call multiple times. */
1887
1939
  function destroy() {
1888
1940
  if (initialCheckTimeout) {
@@ -1917,6 +1969,7 @@ module.exports = {
1917
1969
  setIncludePrereleases,
1918
1970
  downloadUpdate,
1919
1971
  restartToInstall,
1972
+ installsOnQuit,
1920
1973
  STATES,
1921
1974
  // For tests: init() runs it on a timer.
1922
1975
  _seedInstalledBlockmap,