agentgui 1.0.646 → 1.0.648
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/lib/tool-manager.js +1 -0
- package/package.json +1 -1
- package/server.js +7 -1
- package/static/js/client.js +9 -0
package/lib/tool-manager.js
CHANGED
|
@@ -10,6 +10,7 @@ const TOOLS = [
|
|
|
10
10
|
{ id: 'cli-gemini', name: 'Gemini CLI', pkg: '@google/gemini-cli', category: 'cli' },
|
|
11
11
|
{ id: 'cli-kilo', name: 'Kilo Code', pkg: '@kilocode/cli', category: 'cli' },
|
|
12
12
|
{ id: 'cli-codex', name: 'Codex CLI', pkg: '@openai/codex', category: 'cli' },
|
|
13
|
+
{ id: 'cli-agent-browser', name: 'Agent Browser', pkg: 'agent-browser', category: 'cli' },
|
|
13
14
|
{ id: 'gm-cc', name: 'GM Claude', pkg: 'gm-cc', installPkg: 'gm-cc@latest', pluginId: 'gm-cc', category: 'plugin', frameWork: 'claude' },
|
|
14
15
|
{ id: 'gm-oc', name: 'GM OpenCode', pkg: 'gm-oc', installPkg: 'gm-oc@latest', pluginId: 'gm', category: 'plugin', frameWork: 'opencode' },
|
|
15
16
|
{ id: 'gm-gc', name: 'GM Gemini', pkg: 'gm-gc', installPkg: 'gm-gc@latest', pluginId: 'gm', category: 'plugin', frameWork: 'gemini' },
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -8,6 +8,7 @@ import { fileURLToPath } from 'url';
|
|
|
8
8
|
import { WebSocketServer } from 'ws';
|
|
9
9
|
import { execSync, spawn } from 'child_process';
|
|
10
10
|
import { createRequire } from 'module';
|
|
11
|
+
const PKG_VERSION = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version;
|
|
11
12
|
import { OAuth2Client } from 'google-auth-library';
|
|
12
13
|
import express from 'express';
|
|
13
14
|
import Busboy from 'busboy';
|
|
@@ -2898,6 +2899,11 @@ const server = http.createServer(async (req, res) => {
|
|
|
2898
2899
|
return;
|
|
2899
2900
|
}
|
|
2900
2901
|
|
|
2902
|
+
if (pathOnly === '/api/version' && req.method === 'GET') {
|
|
2903
|
+
sendJSON(req, res, 200, { version: PKG_VERSION });
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2901
2907
|
if (pathOnly === '/api/stt' && req.method === 'POST') {
|
|
2902
2908
|
try {
|
|
2903
2909
|
const chunks = [];
|
|
@@ -3536,7 +3542,7 @@ function serveFile(filePath, res, req) {
|
|
|
3536
3542
|
fs.readFile(filePath, (err, data) => {
|
|
3537
3543
|
if (err) { res.writeHead(500); res.end('Server error'); return; }
|
|
3538
3544
|
let content = data.toString();
|
|
3539
|
-
const baseTag = `<script>window.__BASE_URL='${BASE_URL}';</script>`;
|
|
3545
|
+
const baseTag = `<script>window.__BASE_URL='${BASE_URL}';window.__SERVER_VERSION='${PKG_VERSION}';</script>`;
|
|
3540
3546
|
content = content.replace('<head>', `<head>\n <base href="${BASE_URL}/">\n ` + baseTag);
|
|
3541
3547
|
content = content.replace(/(href|src)="vendor\//g, `$1="${BASE_URL}/vendor/`);
|
|
3542
3548
|
content = content.replace(/(src)="\/gm\/js\//g, `$1="${BASE_URL}/js/`);
|
package/static/js/client.js
CHANGED
|
@@ -159,6 +159,15 @@ class AgentGUIClient {
|
|
|
159
159
|
this.updateSendButtonState();
|
|
160
160
|
this.enablePromptArea();
|
|
161
161
|
this.emit('ws:connected');
|
|
162
|
+
// Check if server was updated while client was loaded - reload if version changed
|
|
163
|
+
if (window.__SERVER_VERSION) {
|
|
164
|
+
fetch((window.__BASE_URL || '') + '/api/version').then(r => r.json()).then(d => {
|
|
165
|
+
if (d.version && d.version !== window.__SERVER_VERSION) {
|
|
166
|
+
console.log(`Server updated ${window.__SERVER_VERSION} → ${d.version}, reloading`);
|
|
167
|
+
window.location.reload();
|
|
168
|
+
}
|
|
169
|
+
}).catch(() => {});
|
|
170
|
+
}
|
|
162
171
|
});
|
|
163
172
|
|
|
164
173
|
this.wsManager.on('disconnected', () => {
|