agentgui 1.0.781 → 1.0.783
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/jsonl-watcher.js +2 -2
- package/lib/ws-handlers-run.js +2 -3
- package/package.json +1 -1
- package/server.js +1 -1
- package/static/index.html +20 -4
- package/static/js/client.js +6 -12
- package/static/js/tools-manager.js +2 -2
package/lib/jsonl-watcher.js
CHANGED
|
@@ -124,8 +124,8 @@ export class JsonlWatcher {
|
|
|
124
124
|
const cwd = e.cwd || process.cwd();
|
|
125
125
|
const branch = e.gitBranch || '';
|
|
126
126
|
const base = path.basename(cwd);
|
|
127
|
-
const title = branch ?
|
|
128
|
-
const conv = this._q.createConversation('
|
|
127
|
+
const title = branch ? `${branch} @ ${base}` : base;
|
|
128
|
+
const conv = this._q.createConversation('claude-code', title, cwd);
|
|
129
129
|
this._q.setClaudeSessionId(conv.id, sid);
|
|
130
130
|
this._convMap.set(sid, conv.id);
|
|
131
131
|
this._bc({ type: 'conversation_created', conversation: conv, timestamp: Date.now() });
|
package/lib/ws-handlers-run.js
CHANGED
|
@@ -2,7 +2,7 @@ function err(code, message) { const e = new Error(message); e.code = code; throw
|
|
|
2
2
|
function need(p, key) { if (!p[key]) err(400, `Missing required param: ${key}`); return p[key]; }
|
|
3
3
|
|
|
4
4
|
function register(router, deps) {
|
|
5
|
-
const { queries, discoveredAgents, activeExecutions, activeProcessesByRunId, broadcastSync, processMessageWithStreaming } = deps;
|
|
5
|
+
const { queries, discoveredAgents, activeExecutions, activeProcessesByRunId, broadcastSync, processMessageWithStreaming, cleanupExecution } = deps;
|
|
6
6
|
|
|
7
7
|
function findAgent(id) { const a = discoveredAgents.find(x => x.id === id); if (!a) err(404, 'Agent not found'); return a; }
|
|
8
8
|
function getRunOrThrow(id) { const r = queries.getRun(id); if (!r) err(404, 'Run not found'); return r; }
|
|
@@ -15,9 +15,8 @@ function register(router, deps) {
|
|
|
15
15
|
setTimeout(() => { try { process.kill(-ex.pid, 'SIGKILL'); } catch { try { process.kill(ex.pid, 'SIGKILL'); } catch {} } }, 3000);
|
|
16
16
|
}
|
|
17
17
|
if (ex?.sessionId) queries.updateSession(ex.sessionId, { status: 'error', error: 'Cancelled by user', completed_at: Date.now() });
|
|
18
|
-
|
|
18
|
+
cleanupExecution(threadId);
|
|
19
19
|
activeProcessesByRunId.delete(runId);
|
|
20
|
-
queries.setIsStreaming(threadId, false);
|
|
21
20
|
return ex;
|
|
22
21
|
}
|
|
23
22
|
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -2627,7 +2627,7 @@ debugLog('[INIT] registerSessionHandlers completed');
|
|
|
2627
2627
|
|
|
2628
2628
|
registerRunHandlers(wsRouter, {
|
|
2629
2629
|
queries, discoveredAgents, activeExecutions, activeProcessesByRunId,
|
|
2630
|
-
broadcastSync, processMessageWithStreaming
|
|
2630
|
+
broadcastSync, processMessageWithStreaming, cleanupExecution
|
|
2631
2631
|
});
|
|
2632
2632
|
|
|
2633
2633
|
registerUtilHandlers(wsRouter, {
|
package/static/index.html
CHANGED
|
@@ -6,23 +6,39 @@
|
|
|
6
6
|
<meta name="description" content="AgentGUI - Real-time Claude Code Execution Visualization">
|
|
7
7
|
<title>AgentGUI</title>
|
|
8
8
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' rx='20' fill='%233b82f6'/%3E%3Ctext x='50' y='68' font-size='50' font-family='sans-serif' font-weight='bold' fill='white' text-anchor='middle'%3EG%3C/text%3E%3C/svg%3E">
|
|
9
|
+
<link rel="preload" href="/gm/css/main.css" as="style">
|
|
10
|
+
<link rel="preload" href="/gm/lib/xstate.umd.min.js" as="script">
|
|
11
|
+
<link rel="preload" href="/gm/lib/msgpackr.min.js" as="script">
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
<script>
|
|
13
16
|
(function(){
|
|
14
17
|
var b=(window.__BASE_URL||'');
|
|
15
|
-
|
|
18
|
+
// Critical CSS only - rippleui needed for layout
|
|
19
|
+
['vendor/rippleui.css'].forEach(function(h){
|
|
16
20
|
var l=document.createElement('link');l.rel='stylesheet';l.href=b+'/'+h;document.head.appendChild(l);
|
|
17
21
|
});
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
// Non-critical CSS - load async via media trick
|
|
23
|
+
['vendor/prism-dark.css','vendor/highlight-js.css','vendor/xterm.css'].forEach(function(h){
|
|
24
|
+
var l=document.createElement('link');l.rel='stylesheet';l.href=b+'/'+h;l.media='print';l.onload=function(){l.media='all';};document.head.appendChild(l);
|
|
20
25
|
});
|
|
26
|
+
// Vendor JS - lazy load on idle or first use
|
|
27
|
+
window._vendorLoaded = false;
|
|
28
|
+
window._loadVendorJS = function() {
|
|
29
|
+
if (window._vendorLoaded) return;
|
|
30
|
+
window._vendorLoaded = true;
|
|
31
|
+
['vendor/highlight.min.js','vendor/xterm.min.js','vendor/xterm-addon-fit.min.js'].forEach(function(s){
|
|
32
|
+
var e=document.createElement('script');e.defer=true;e.src=b+'/'+s;document.head.appendChild(e);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
if (typeof requestIdleCallback !== 'undefined') requestIdleCallback(window._loadVendorJS, { timeout: 3000 });
|
|
36
|
+
else setTimeout(window._loadVendorJS, 1500);
|
|
21
37
|
})();
|
|
22
38
|
</script>
|
|
23
39
|
|
|
24
40
|
<link rel="stylesheet" href="/gm/css/main.css">
|
|
25
|
-
<link rel="stylesheet" href="/gm/css/tools-popup.css">
|
|
41
|
+
<link rel="stylesheet" href="/gm/css/tools-popup.css" media="print" onload="this.media='all'">
|
|
26
42
|
</head>
|
|
27
43
|
<body>
|
|
28
44
|
<!-- Sidebar overlay (mobile) -->
|
package/static/js/client.js
CHANGED
|
@@ -103,28 +103,22 @@ class AgentGUIClient {
|
|
|
103
103
|
try {
|
|
104
104
|
this._dbg('Initializing AgentGUI client');
|
|
105
105
|
|
|
106
|
-
//
|
|
106
|
+
// Start WebSocket connection immediately (don't wait for UI setup)
|
|
107
|
+
const wsReady = this.config.autoConnect ? this.connectWebSocket() : Promise.resolve();
|
|
108
|
+
|
|
109
|
+
// Initialize renderer and UI in parallel with WS connection
|
|
107
110
|
this.renderer.init(this.config.outputContainerId, this.config.scrollContainerId);
|
|
108
111
|
|
|
109
|
-
// Initialize image loader
|
|
110
112
|
if (typeof ImageLoader !== 'undefined') {
|
|
111
113
|
window.imageLoader = new ImageLoader();
|
|
112
|
-
this._dbg('Image loader initialized');
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
// Setup event listeners
|
|
116
116
|
this.setupWebSocketListeners();
|
|
117
117
|
this.setupRendererListeners();
|
|
118
|
-
|
|
119
|
-
// Setup UI elements (must happen before loading data so DOM refs exist)
|
|
120
118
|
this.setupUI();
|
|
121
119
|
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
await this.connectWebSocket();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Load initial data in parallel - none of these depend on each other
|
|
120
|
+
// Wait for WS, then load data in parallel
|
|
121
|
+
await wsReady;
|
|
128
122
|
await Promise.all([
|
|
129
123
|
this.loadAgents(),
|
|
130
124
|
this.loadConversations(),
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
var tools = [];
|
|
5
5
|
var isRefreshing = false;
|
|
6
6
|
|
|
7
|
+
var hasRefreshed = false;
|
|
7
8
|
function init() {
|
|
8
9
|
if (!btn || !popup) return;
|
|
9
10
|
btn.style.display = 'flex';
|
|
10
|
-
btn.addEventListener('click', togglePopup);
|
|
11
|
+
btn.addEventListener('click', function() { if (!hasRefreshed) { hasRefreshed = true; refresh(); } togglePopup(); });
|
|
11
12
|
document.addEventListener('click', function(e) {
|
|
12
13
|
if (!btn.contains(e.target) && !popup.contains(e.target)) closePopup();
|
|
13
14
|
});
|
|
14
15
|
window.addEventListener('ws-message', onWsMessage);
|
|
15
16
|
initVoiceControls();
|
|
16
|
-
refresh();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function initVoiceControls() {
|