agentgui 1.0.647 → 1.0.649
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/claude-runner.js +4 -5
- package/package.json +1 -1
- package/server.js +7 -1
- package/static/js/client.js +9 -0
package/lib/claude-runner.js
CHANGED
|
@@ -609,9 +609,9 @@ registry.register({
|
|
|
609
609
|
name: 'Claude Code',
|
|
610
610
|
command: 'claude',
|
|
611
611
|
protocol: 'direct',
|
|
612
|
-
supportsStdin:
|
|
613
|
-
closeStdin: false, //
|
|
614
|
-
useJsonRpcStdin:
|
|
612
|
+
supportsStdin: false, // prompt passed as positional arg, not stdin
|
|
613
|
+
closeStdin: false, // keep stdin open for JSON-RPC steering commands
|
|
614
|
+
useJsonRpcStdin: false,
|
|
615
615
|
supportedFeatures: ['streaming', 'resume', 'system-prompt', 'permissions-skip', 'steering'],
|
|
616
616
|
spawnEnv: { MAX_THINKING_TOKENS: '0' },
|
|
617
617
|
|
|
@@ -633,8 +633,7 @@ registry.register({
|
|
|
633
633
|
if (model) flags.push('--model', model);
|
|
634
634
|
if (resumeSessionId) flags.push('--resume', resumeSessionId);
|
|
635
635
|
if (systemPrompt) flags.push('--append-system-prompt', systemPrompt);
|
|
636
|
-
|
|
637
|
-
// This allows stdin to stay open for receiving JSON-RPC steering commands
|
|
636
|
+
flags.push(prompt); // positional arg - stdin stays open separately for steering
|
|
638
637
|
|
|
639
638
|
return flags;
|
|
640
639
|
},
|
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', () => {
|