@amd-gaia/agent-ui 0.25.3 → 0.25.4-rc.10
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/bin/gaia-ui.cjs +2 -23
- package/dist/assets/AdvancedSettings-DXf2pogI.js +1 -0
- package/dist/assets/ConnectorsPane-CzLYXGMl.css +1 -0
- package/dist/assets/ConnectorsPane-R1yvKMNT.js +1 -0
- package/dist/assets/DocumentLibrary-CM6o8j2T.css +1 -0
- package/dist/assets/DocumentLibrary-DSOiP7Ft.js +4 -0
- package/dist/assets/FileBrowser-BlVSPjD2.js +4 -0
- package/dist/assets/FileBrowser-Cna3BsT7.css +1 -0
- package/dist/assets/MemoryDashboard-D_ZVZbS_.js +1 -0
- package/dist/assets/MemoryDashboard-DwrWAXi6.css +1 -0
- package/dist/assets/MobileAccessModal-BkVDm3YG.css +1 -0
- package/dist/assets/MobileAccessModal-CPjDeIIk.js +2 -0
- package/dist/assets/ScheduleManager-CjHJ4NbD.css +1 -0
- package/dist/assets/ScheduleManager-D1DOYVQo.js +1 -0
- package/dist/assets/api-Co-B9E0t.js +4 -0
- package/dist/assets/index-CMVmIBZ8.js +78 -0
- package/dist/assets/index-Y93uvqe7.css +1 -0
- package/dist/assets/useT-tWXlG-cT.js +3 -0
- package/dist/assets/zap-D-WCZ6dX.js +1 -0
- package/dist/icons/apple-touch-icon.png +0 -0
- package/dist/icons/icon-192.png +0 -0
- package/dist/icons/icon-512.png +0 -0
- package/dist/icons/icon-maskable-192.png +0 -0
- package/dist/icons/icon-maskable-512.png +0 -0
- package/dist/index.html +8 -3
- package/dist/manifest.json +16 -0
- package/dist/sw.js +49 -0
- package/main-safety-net.cjs +106 -8
- package/main.cjs +145 -162
- package/package.json +5 -3
- package/preload.cjs +19 -9
- package/services/agent-seeder.cjs +22 -13
- package/services/auto-updater.cjs +780 -216
- package/services/backend-installer.cjs +523 -365
- package/services/engine-install.cjs +233 -0
- package/services/index-query.cjs +7 -1
- package/services/lock-holders.cjs +200 -0
- package/services/quit-guard.cjs +36 -3
- package/services/tray-manager.cjs +12 -7
- package/dist/assets/AdvancedSettings-DERzP9Jc.js +0 -1
- package/dist/assets/ConnectorsPane-Dzu2DRTc.css +0 -1
- package/dist/assets/ConnectorsPane-s0fFxmus.js +0 -1
- package/dist/assets/DocumentLibrary-CIKp6qld.css +0 -1
- package/dist/assets/DocumentLibrary-DqapN_Tr.js +0 -4
- package/dist/assets/FileBrowser-Dil1lZJ4.css +0 -1
- package/dist/assets/FileBrowser-vAJV41RT.js +0 -4
- package/dist/assets/MemoryDashboard-CP5wVWkY.js +0 -1
- package/dist/assets/MemoryDashboard-Mo721-BI.css +0 -1
- package/dist/assets/MobileAccessModal-B31mPs50.js +0 -2
- package/dist/assets/MobileAccessModal-DuVy9F1u.css +0 -1
- package/dist/assets/ScheduleManager-D5c4gVIt.css +0 -1
- package/dist/assets/ScheduleManager-b0gTAf2R.js +0 -2
- package/dist/assets/apiBase-CS6zLsJY.js +0 -1
- package/dist/assets/index-C-EM_5yl.css +0 -1
- package/dist/assets/index-Cae5Fje-.js +0 -78
- package/dist/assets/zap-BogJn9oN.js +0 -1
- package/services/backend-installer-progress-dialog.cjs +0 -510
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as e}from"./useT-tWXlG-cT.js";var t={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};t.node;var n=e(t),r={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};r.node;var i=e(r);export{n,i as t};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.html
CHANGED
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
syncTitleBar(). With no saved preference the app follows the OS. -->
|
|
8
8
|
<meta name="theme-color" content="#1A1917" />
|
|
9
9
|
<link rel="icon" type="image/png" href="./favicon.png" />
|
|
10
|
+
<link rel="manifest" href="./manifest.json" />
|
|
11
|
+
<link rel="apple-touch-icon" href="./icons/apple-touch-icon.png" />
|
|
12
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
13
|
+
<meta name="apple-mobile-web-app-title" content="GAIA" />
|
|
10
14
|
<title>GAIA Agent UI</title>
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-CMVmIBZ8.js"></script>
|
|
12
16
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
14
|
-
<link rel="
|
|
17
|
+
<link rel="modulepreload" crossorigin href="./assets/useT-tWXlG-cT.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="./assets/api-Co-B9E0t.js">
|
|
19
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Y93uvqe7.css">
|
|
15
20
|
</head>
|
|
16
21
|
<body>
|
|
17
22
|
<div id="root"></div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "GAIA",
|
|
3
|
+
"short_name": "GAIA",
|
|
4
|
+
"description": "Chat with the GAIA agent running on your PC.",
|
|
5
|
+
"start_url": "./",
|
|
6
|
+
"scope": "./",
|
|
7
|
+
"display": "standalone",
|
|
8
|
+
"theme_color": "#1A1917",
|
|
9
|
+
"background_color": "#1A1917",
|
|
10
|
+
"icons": [
|
|
11
|
+
{ "src": "icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" },
|
|
12
|
+
{ "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" },
|
|
13
|
+
{ "src": "icons/icon-maskable-192.png", "sizes": "192x192", "type": "image/png", "purpose": "maskable" },
|
|
14
|
+
{ "src": "icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
|
|
15
|
+
]
|
|
16
|
+
}
|
package/dist/sw.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
// Service worker for the installable Agent UI. The build (vite.config.ts)
|
|
5
|
+
// stamps the build id into CACHE_NAME so every release or code change ships a new worker and a new cache.
|
|
6
|
+
//
|
|
7
|
+
// It caches only the content-hashed files under assets/, which never change
|
|
8
|
+
// once built. Pages, the API and streams always go to the network, so a phone
|
|
9
|
+
// never sees a stale UI or stale data.
|
|
10
|
+
|
|
11
|
+
const CACHE_PREFIX = 'gaia-assets-';
|
|
12
|
+
const CACHE_NAME = CACHE_PREFIX + '0.25.4rc10-4286b1702e8c226c';
|
|
13
|
+
const ASSETS_PATH = new URL('assets/', self.registration.scope).pathname;
|
|
14
|
+
|
|
15
|
+
self.addEventListener('install', () => {
|
|
16
|
+
self.skipWaiting();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
self.addEventListener('activate', (event) => {
|
|
20
|
+
event.waitUntil(
|
|
21
|
+
caches
|
|
22
|
+
.keys()
|
|
23
|
+
.then((names) =>
|
|
24
|
+
Promise.all(
|
|
25
|
+
names
|
|
26
|
+
.filter((name) => name.startsWith(CACHE_PREFIX) && name !== CACHE_NAME)
|
|
27
|
+
.map((name) => caches.delete(name)),
|
|
28
|
+
),
|
|
29
|
+
)
|
|
30
|
+
.then(() => self.clients.claim()),
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
self.addEventListener('fetch', (event) => {
|
|
35
|
+
const request = event.request;
|
|
36
|
+
if (request.method !== 'GET') return;
|
|
37
|
+
const url = new URL(request.url);
|
|
38
|
+
if (url.origin !== self.location.origin || !url.pathname.startsWith(ASSETS_PATH)) return;
|
|
39
|
+
|
|
40
|
+
event.respondWith(
|
|
41
|
+
caches.open(CACHE_NAME).then(async (cache) => {
|
|
42
|
+
const cached = await cache.match(request);
|
|
43
|
+
if (cached) return cached;
|
|
44
|
+
const response = await fetch(request);
|
|
45
|
+
if (response.ok) await cache.put(request, response.clone());
|
|
46
|
+
return response;
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
});
|
package/main-safety-net.cjs
CHANGED
|
@@ -27,21 +27,43 @@ const path = require("path");
|
|
|
27
27
|
const os = require("os");
|
|
28
28
|
|
|
29
29
|
// ── Counter helpers ───────────────────────────────────────────────────────────
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
// ~/.gaia/electron-startup-failures.json counts crashes since the last time a
|
|
31
|
+
// window was focused. At SAFE_MODE_THRESHOLD the next launch enters safe mode.
|
|
32
|
+
|
|
33
|
+
/** Crashes in a row, with no focused window between them, that make the next launch start in safe mode. */
|
|
34
|
+
const SAFE_MODE_THRESHOLD = 3;
|
|
35
|
+
|
|
36
|
+
function warn(msg) {
|
|
37
|
+
try { process.stderr.write(`[safety-net] ${msg}\n`); } catch { }
|
|
38
|
+
}
|
|
34
39
|
|
|
35
40
|
function counterPath(homedir) {
|
|
36
41
|
return path.join(homedir(), ".gaia", "electron-startup-failures.json");
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
function readCount(homedir) {
|
|
45
|
+
const p = counterPath(homedir);
|
|
46
|
+
let raw;
|
|
40
47
|
try {
|
|
41
|
-
|
|
42
|
-
} catch {
|
|
48
|
+
raw = fs.readFileSync(p, "utf8");
|
|
49
|
+
} catch (err) {
|
|
50
|
+
if (err && err.code === "ENOENT") return 0;
|
|
51
|
+
warn(`cannot read ${p}, treating the crash count as 0: ${err.message}`);
|
|
43
52
|
return 0;
|
|
44
53
|
}
|
|
54
|
+
let count;
|
|
55
|
+
try {
|
|
56
|
+
count = JSON.parse(raw).count;
|
|
57
|
+
} catch (err) {
|
|
58
|
+
warn(`${p} is not valid JSON, treating the crash count as 0: ${err.message}`);
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
if (count === undefined) return 0;
|
|
62
|
+
if (!Number.isInteger(count) || count < 0) {
|
|
63
|
+
warn(`${p} has an invalid count ${JSON.stringify(count)}, treating it as 0`);
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
return count;
|
|
45
67
|
}
|
|
46
68
|
|
|
47
69
|
function writeCount(n, homedir) {
|
|
@@ -89,6 +111,7 @@ function installSafetyNet({
|
|
|
89
111
|
homedirFn,
|
|
90
112
|
beforeQuit,
|
|
91
113
|
exitGraceMs = FATAL_EXIT_GRACE_MS,
|
|
114
|
+
holdCrashCount = () => false,
|
|
92
115
|
}) {
|
|
93
116
|
const homedir = homedirFn || (() => os.homedir());
|
|
94
117
|
|
|
@@ -171,7 +194,9 @@ function installSafetyNet({
|
|
|
171
194
|
|
|
172
195
|
// Reset counter on the first successful user interaction. Resetting at
|
|
173
196
|
// loadApp() is too early — the user may crash before their first focus.
|
|
174
|
-
appModule.on("browser-window-focus", () =>
|
|
197
|
+
appModule.on("browser-window-focus", () => {
|
|
198
|
+
if (!holdCrashCount()) writeCount(0, homedir);
|
|
199
|
+
});
|
|
175
200
|
|
|
176
201
|
// Renderer and GPU-process crashes don't fire uncaughtException — route
|
|
177
202
|
// them through fatal() so they get the same dialog + counter treatment.
|
|
@@ -202,6 +227,72 @@ function installSafetyNet({
|
|
|
202
227
|
return { fatal };
|
|
203
228
|
}
|
|
204
229
|
|
|
230
|
+
// ── Safe mode ─────────────────────────────────────────────────────────────────
|
|
231
|
+
|
|
232
|
+
const SAFE_MODE_BUTTONS = ["Try again", "Open log folder", "Quit"];
|
|
233
|
+
const SAFE_MODE_RESET = 0;
|
|
234
|
+
const SAFE_MODE_OPEN_LOGS = 1;
|
|
235
|
+
const SAFE_MODE_QUIT = 2;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Ask a user whose last launches crashed what to do, before any other start-up
|
|
239
|
+
* work runs. Must be called after app ready: before it, showMessageBoxSync
|
|
240
|
+
* does nothing on Windows.
|
|
241
|
+
*
|
|
242
|
+
* Try again deletes the crash counter and relaunches; Open log folder opens
|
|
243
|
+
* ~/.gaia and asks again; Quit exits. If the dialog itself fails, GAIA exits
|
|
244
|
+
* with code 1 rather than retry the start-up that kept crashing.
|
|
245
|
+
*
|
|
246
|
+
* @param {object} opts
|
|
247
|
+
* @param {number} opts.count - The crash count read at launch.
|
|
248
|
+
* @param {object} opts.dialogModule - Electron dialog (injected for tests).
|
|
249
|
+
* @param {object} opts.appModule - Electron app (injected for tests).
|
|
250
|
+
* @param {object} opts.shellModule - Electron shell (injected for tests).
|
|
251
|
+
* @param {Function} [opts.homedirFn] - Override for os.homedir (tests).
|
|
252
|
+
* @returns {Promise<"reset"|"quit"|"error">}
|
|
253
|
+
*/
|
|
254
|
+
async function runSafeModePrompt({ count, dialogModule, appModule, shellModule, homedirFn }) {
|
|
255
|
+
const homedir = homedirFn || (() => os.homedir());
|
|
256
|
+
const gaiaDir = path.join(homedir(), ".gaia");
|
|
257
|
+
let openFailure = "";
|
|
258
|
+
try {
|
|
259
|
+
for (;;) {
|
|
260
|
+
const choice = dialogModule.showMessageBoxSync({
|
|
261
|
+
type: "warning",
|
|
262
|
+
title: "GAIA keeps crashing",
|
|
263
|
+
message: `GAIA has crashed ${count} times in a row.`,
|
|
264
|
+
detail:
|
|
265
|
+
"Try again clears the crash count and starts GAIA normally. " +
|
|
266
|
+
`Open log folder shows the logs in ${gaiaDir} to attach to a bug report.` +
|
|
267
|
+
openFailure,
|
|
268
|
+
buttons: SAFE_MODE_BUTTONS,
|
|
269
|
+
defaultId: SAFE_MODE_RESET,
|
|
270
|
+
cancelId: SAFE_MODE_QUIT,
|
|
271
|
+
noLink: true,
|
|
272
|
+
});
|
|
273
|
+
if (choice === SAFE_MODE_RESET) {
|
|
274
|
+
fs.rmSync(counterPath(homedir), { force: true });
|
|
275
|
+
appModule.relaunch();
|
|
276
|
+
appModule.exit(0);
|
|
277
|
+
return "reset";
|
|
278
|
+
}
|
|
279
|
+
if (choice === SAFE_MODE_OPEN_LOGS) {
|
|
280
|
+
const err = await shellModule.openPath(gaiaDir);
|
|
281
|
+
openFailure = err ? `\n\nCould not open ${gaiaDir}: ${err}` : "";
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
appModule.exit(0);
|
|
285
|
+
return "quit";
|
|
286
|
+
}
|
|
287
|
+
} catch (err) {
|
|
288
|
+
const detail = (err && err.stack) || String(err);
|
|
289
|
+
warn(`safe mode failed: ${detail}`);
|
|
290
|
+
try { dialogModule.showErrorBox("GAIA could not recover", detail); } catch { } // intentional: exiting next
|
|
291
|
+
appModule.exit(1);
|
|
292
|
+
return "error";
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
205
296
|
// ── Log-tee helper ────────────────────────────────────────────────────────────
|
|
206
297
|
|
|
207
298
|
/**
|
|
@@ -226,4 +317,11 @@ function installLogTee({ stream, logPath }) {
|
|
|
226
317
|
});
|
|
227
318
|
}
|
|
228
319
|
|
|
229
|
-
module.exports = {
|
|
320
|
+
module.exports = {
|
|
321
|
+
installSafetyNet,
|
|
322
|
+
installLogTee,
|
|
323
|
+
FATAL_EXIT_GRACE_MS,
|
|
324
|
+
readCount,
|
|
325
|
+
runSafeModePrompt,
|
|
326
|
+
SAFE_MODE_THRESHOLD,
|
|
327
|
+
};
|