agentgui 1.0.812 → 1.0.814
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/CHANGELOG.md +7 -0
- package/CLAUDE.md +12 -0
- package/package.json +1 -1
- package/static/app.js +3 -785
- package/static/index.html +2 -0
- package/static/js/app-shortcuts.js +30 -0
- package/static/js/client.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### Changed
|
|
4
|
+
- Remove GMGUIApp dead code from app.js; strip 900+ lines, keep 5 live IIFEs
|
|
5
|
+
- Add app.js and app-shortcuts.js to index.html script loading (previously unreferenced)
|
|
6
|
+
- Remove unused BASE_URL declaration from app-shortcuts.js
|
|
7
|
+
- Extend window.__debug.getSyncState() with promptMachineState, toolInstallMachineStates, voiceMachineState, convListMachineState
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
### Fixed
|
|
4
11
|
- Thinking blocks now use theme-aware CSS vars for light/dark backgrounds (`--color-thinking-bg`)
|
|
5
12
|
- All code blocks (renderBlockCode, renderCodeWithHighlight, renderFileRead, renderCommand) now use CSS vars instead of hardcoded dark hex colors
|
package/CLAUDE.md
CHANGED
|
@@ -404,6 +404,16 @@ OpenAI Codex CLI uses PKCE authorization code flow against `https://auth.openai.
|
|
|
404
404
|
- **@agentclientprotocol/sdk** (`^0.4.1`) added to dependencies
|
|
405
405
|
- Full integration (replacing custom WS protocol) is optional/incremental — current WS already gives logical multiplexing via concurrent async handlers
|
|
406
406
|
|
|
407
|
+
## Theme-Aware Rendering
|
|
408
|
+
|
|
409
|
+
CSS custom properties for code/thinking blocks live in `static/css/main.css`:
|
|
410
|
+
- `--color-bg-code`, `--color-code-text`, `--color-code-border` — light values in `:root`, dark overrides in `html.dark`
|
|
411
|
+
- `--color-thinking-bg` — light value in `:root` (`#f5f3ff`), dark override in `html.dark` (`.block-thinking`) set to `#1e1a2e`
|
|
412
|
+
|
|
413
|
+
`static/js/streaming-renderer.js` uses `var(--color-bg-code)` etc. in inline styles — no hardcoded `#1e293b`/`#e2e8f0`/`#d1d5db` hex values. Remaining hardcoded hex in the renderer are **intentional semantic colors** (blue links, amber warnings, red errors, purple thinking accents) and must not be replaced with CSS vars.
|
|
414
|
+
|
|
415
|
+
`parseAndRenderMarkdown()` in `streaming-renderer.js` handles: `##`/`###` headers, `-`/`*` ul lists, `1.` ol lists, `>` blockquotes, `---` hr, inline bold/italic/code/links via `_mdInline()`. Thinking block content is rendered through this function.
|
|
416
|
+
|
|
407
417
|
## Known Gotchas
|
|
408
418
|
|
|
409
419
|
- **`agent-browser --version`** prints help, not version. Use `-V` flag.
|
|
@@ -415,3 +425,5 @@ OpenAI Codex CLI uses PKCE authorization code flow against `https://auth.openai.
|
|
|
415
425
|
- **Thinking blocks** are transient (not in DB), rendered only via `handleStreamingProgress()` in client.js. The `renderEvent` switch case for `thinking_block` is disabled to prevent double-render.
|
|
416
426
|
- **Terminal output** is base64-encoded (`encoding: 'base64'` field on message). Client decodes with `decodeURIComponent(escape(atob(data)))` pattern for multibyte safety.
|
|
417
427
|
- **HTML cache** (`_htmlCache`) is only populated when client accepts gzip. In watch mode it's never cached (always fresh).
|
|
428
|
+
- **`app.js` and `app-shortcuts.js` script loading:** Both are `<script defer>` tags loaded AFTER `agent-auth.js` in index.html. They depend on `window.wsClient`, `window.conversationManager`, and `window._escHtml` being initialized first. Defer order is guaranteed by source order — adding new defer scripts that depend on these modules requires careful ordering.
|
|
429
|
+
- **`window.__debug.getSyncState()`:** Debug API in client.js exposes internal state machine snapshots: `convMachineStates`, `toolInstallMachineStates`, `voiceMachineState`, `convListMachineState`, `promptMachineState`, `wsConnectionState`, `rendererEventQueueLength`, `rendererEventHistoryLength`. All XState v5 machines have no parallel ad-hoc state — this API is the only way to inspect full machine state at once.
|
package/package.json
CHANGED
package/static/app.js
CHANGED
|
@@ -1,785 +1,5 @@
|
|
|
1
|
-
const BASE_URL = window.__BASE_URL || '';
|
|
2
|
-
|
|
3
|
-
class ReconnectingWebSocket {
|
|
4
|
-
constructor(url, options = {}) {
|
|
5
|
-
this.url = url;
|
|
6
|
-
this.reconnectDelay = options.reconnectDelay || 1000;
|
|
7
|
-
this.maxReconnectDelay = options.maxReconnectDelay || 30000;
|
|
8
|
-
this.reconnectDecay = options.reconnectDecay || 1.5;
|
|
9
|
-
this.currentDelay = this.reconnectDelay;
|
|
10
|
-
this.ws = null;
|
|
11
|
-
this.listeners = new Map();
|
|
12
|
-
this.reconnectAttempts = 0;
|
|
13
|
-
this.maxReconnectAttempts = options.maxReconnectAttempts || Infinity;
|
|
14
|
-
this.shouldReconnect = true;
|
|
15
|
-
this.connect();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
connect() {
|
|
19
|
-
this.ws = new WebSocket(this.url);
|
|
20
|
-
|
|
21
|
-
this.ws.onopen = (e) => {
|
|
22
|
-
this.currentDelay = this.reconnectDelay;
|
|
23
|
-
this.reconnectAttempts = 0;
|
|
24
|
-
this.emit('open', e);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
this.ws.onmessage = (e) => {
|
|
28
|
-
this.emit('message', e);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
this.ws.onerror = (e) => {
|
|
32
|
-
this.emit('error', e);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
this.ws.onclose = (e) => {
|
|
36
|
-
this.emit('close', e);
|
|
37
|
-
if (this.shouldReconnect && this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
38
|
-
setTimeout(() => {
|
|
39
|
-
this.reconnectAttempts++;
|
|
40
|
-
this.currentDelay = Math.min(
|
|
41
|
-
this.currentDelay * this.reconnectDecay,
|
|
42
|
-
this.maxReconnectDelay
|
|
43
|
-
);
|
|
44
|
-
console.log(`Attempting to reconnect (${this.reconnectAttempts})...`);
|
|
45
|
-
this.connect();
|
|
46
|
-
}, this.currentDelay);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
on(event, callback) {
|
|
52
|
-
if (!this.listeners.has(event)) {
|
|
53
|
-
this.listeners.set(event, []);
|
|
54
|
-
}
|
|
55
|
-
this.listeners.get(event).push(callback);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
emit(event, data) {
|
|
59
|
-
const callbacks = this.listeners.get(event);
|
|
60
|
-
if (callbacks) {
|
|
61
|
-
callbacks.forEach(cb => cb(data));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
send(data) {
|
|
66
|
-
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
67
|
-
this.ws.send(data);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
close() {
|
|
72
|
-
this.shouldReconnect = false;
|
|
73
|
-
if (this.ws) {
|
|
74
|
-
this.ws.close();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
class GMGUIApp {
|
|
80
|
-
constructor() {
|
|
81
|
-
this.conversations = new Map();
|
|
82
|
-
this.currentConversation = null;
|
|
83
|
-
this.agents = new Map();
|
|
84
|
-
this.selectedAgent = null;
|
|
85
|
-
this.ws = null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async init() {
|
|
89
|
-
console.log('[APP] Initializing');
|
|
90
|
-
|
|
91
|
-
this.setupEventListeners();
|
|
92
|
-
await this.fetchAgents();
|
|
93
|
-
|
|
94
|
-
const savedAgent = localStorage.getItem('gmgui-selectedAgent');
|
|
95
|
-
if (savedAgent && this.agents.has(savedAgent)) {
|
|
96
|
-
this.selectedAgent = savedAgent;
|
|
97
|
-
} else if (this.agents.size > 0) {
|
|
98
|
-
this.selectedAgent = Array.from(this.agents.keys())[0];
|
|
99
|
-
localStorage.setItem('gmgui-selectedAgent', this.selectedAgent);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
await this.fetchConversations();
|
|
103
|
-
this.connectWebSocket();
|
|
104
|
-
this.renderAll();
|
|
105
|
-
console.log('[APP] Ready');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
async fetchAgents() {
|
|
109
|
-
try {
|
|
110
|
-
const data = await window.wsClient.rpc('agent.ls');
|
|
111
|
-
for (const agent of data.agents || []) {
|
|
112
|
-
this.agents.set(agent.id, agent);
|
|
113
|
-
}
|
|
114
|
-
} catch (e) {
|
|
115
|
-
console.error('[APP] Error fetching agents:', e);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
async fetchConversations() {
|
|
120
|
-
try {
|
|
121
|
-
const data = await window.wsClient.rpc('conv.ls');
|
|
122
|
-
this.conversations.clear();
|
|
123
|
-
for (const conv of data.conversations || []) {
|
|
124
|
-
this.conversations.set(conv.id, conv);
|
|
125
|
-
}
|
|
126
|
-
console.log('[APP] Loaded', this.conversations.size, 'conversations');
|
|
127
|
-
} catch (e) {
|
|
128
|
-
console.error('[APP] Error fetching conversations:', e);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
async fetchMessages(conversationId) {
|
|
133
|
-
try {
|
|
134
|
-
const data = await window.wsClient.rpc('msg.ls', { id: conversationId });
|
|
135
|
-
return data.messages || [];
|
|
136
|
-
} catch (e) {
|
|
137
|
-
console.error('[APP] Error fetching messages:', e);
|
|
138
|
-
return [];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
connectWebSocket() {
|
|
143
|
-
const proto = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
144
|
-
this.ws = new ReconnectingWebSocket(`${proto}//${location.host}${BASE_URL}/sync`);
|
|
145
|
-
|
|
146
|
-
this.ws.on('open', () => {
|
|
147
|
-
console.log('[WS] Connected');
|
|
148
|
-
document.getElementById('connectionStatus').textContent = 'Connected';
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
this.ws.on('message', (e) => {
|
|
152
|
-
try {
|
|
153
|
-
const event = JSON.parse(e.data);
|
|
154
|
-
this.handleEvent(event);
|
|
155
|
-
} catch (err) {
|
|
156
|
-
console.error('[WS] Parse error:', err);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
this.ws.on('close', () => {
|
|
161
|
-
console.log('[WS] Disconnected, reconnecting...');
|
|
162
|
-
document.getElementById('connectionStatus').textContent = 'Reconnecting...';
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
this.ws.on('error', (err) => {
|
|
166
|
-
console.error('[WS] Error:', err);
|
|
167
|
-
document.getElementById('connectionStatus').textContent = 'Error';
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
handleEvent(event) {
|
|
172
|
-
if (event.type === 'message_created') {
|
|
173
|
-
this.handleMessageReceived(event.message);
|
|
174
|
-
} else if (event.type === 'conversations_updated') {
|
|
175
|
-
this.fetchConversations().then(() => this.renderChatHistory());
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
addMessageToDisplay(message) {
|
|
180
|
-
if (this.currentConversation && message.conversationId === this.currentConversation) {
|
|
181
|
-
const chatDiv = document.getElementById('chatMessages');
|
|
182
|
-
if (!chatDiv) return;
|
|
183
|
-
|
|
184
|
-
const msgEl = document.createElement('div');
|
|
185
|
-
msgEl.className = `message ${message.role}`;
|
|
186
|
-
|
|
187
|
-
// Try to parse content as JSON for structured display
|
|
188
|
-
let contentHtml = '';
|
|
189
|
-
try {
|
|
190
|
-
const parsed = typeof message.content === 'string' ? JSON.parse(message.content) : message.content;
|
|
191
|
-
if (parsed && parsed.type === 'claude_execution' && parsed.blocks) {
|
|
192
|
-
// Render each block with appropriate formatting
|
|
193
|
-
contentHtml = '<div class="execution-blocks">';
|
|
194
|
-
for (const block of parsed.blocks) {
|
|
195
|
-
contentHtml += this.renderMessageBlock(block);
|
|
196
|
-
}
|
|
197
|
-
contentHtml += '</div>';
|
|
198
|
-
} else {
|
|
199
|
-
throw new Error('Not a claude_execution message');
|
|
200
|
-
}
|
|
201
|
-
} catch (e) {
|
|
202
|
-
// Fallback: try to parse and beautify, or render as plain text
|
|
203
|
-
try {
|
|
204
|
-
const parsed = typeof message.content === 'string' ? JSON.parse(message.content) : message.content;
|
|
205
|
-
contentHtml = `<div class="message-content">${this.renderParameters(parsed)}</div>`;
|
|
206
|
-
} catch (parseErr) {
|
|
207
|
-
const text = typeof message.content === 'string' ? message.content : JSON.stringify(message.content);
|
|
208
|
-
contentHtml = `<div class="message-content"><pre>${this.escapeHtml(text)}</pre></div>`;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
msgEl.innerHTML = contentHtml;
|
|
213
|
-
chatDiv.appendChild(msgEl);
|
|
214
|
-
chatDiv.scrollTop = chatDiv.scrollHeight;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
renderMessageBlock(block) {
|
|
219
|
-
if (!block) return '';
|
|
220
|
-
|
|
221
|
-
let html = '<div class="message-block">';
|
|
222
|
-
|
|
223
|
-
switch (block.type) {
|
|
224
|
-
case 'text': {
|
|
225
|
-
const text = block.text || '';
|
|
226
|
-
const beautified = this.markdownToHtml(text);
|
|
227
|
-
html += `<div class="block-text">${beautified}</div>`;
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
case 'tool_use': {
|
|
232
|
-
html += `<div class="block-tool-use">`;
|
|
233
|
-
html += `<strong class="tool-name">${this.escapeHtml(block.name || 'Tool')}</strong>`;
|
|
234
|
-
const paramHtml = this.renderParameters(block.input || {});
|
|
235
|
-
html += `<div class="tool-input">${paramHtml}</div>`;
|
|
236
|
-
html += `</div>`;
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
case 'tool_result': {
|
|
241
|
-
html += `<div class="block-tool-result">`;
|
|
242
|
-
html += `<strong>Result:</strong>`;
|
|
243
|
-
let resultHtml;
|
|
244
|
-
if (typeof block.result === 'string') {
|
|
245
|
-
try {
|
|
246
|
-
const parsed = JSON.parse(block.result);
|
|
247
|
-
resultHtml = this.renderParameters(parsed);
|
|
248
|
-
} catch (e) {
|
|
249
|
-
resultHtml = `<pre>${this.escapeHtml(block.result)}</pre>`;
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
resultHtml = this.renderParameters(block.result);
|
|
253
|
-
}
|
|
254
|
-
html += `<div class="tool-result">${resultHtml}</div>`;
|
|
255
|
-
html += `</div>`;
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
case 'file_operation':
|
|
260
|
-
html += `<div class="block-file-op">`;
|
|
261
|
-
html += `<strong class="file-action">${this.escapeHtml(block.action || 'File Operation')}</strong>`;
|
|
262
|
-
html += `<div class="file-path">${this.escapeHtml(block.path || '')}</div>`;
|
|
263
|
-
if (block.content) {
|
|
264
|
-
html += `<div class="file-content"><pre>${this.escapeHtml(block.content.substring(0, 500))}</pre></div>`;
|
|
265
|
-
}
|
|
266
|
-
html += `</div>`;
|
|
267
|
-
break;
|
|
268
|
-
|
|
269
|
-
default:
|
|
270
|
-
html += `<div class="block-unknown">${this.escapeHtml(JSON.stringify(block, null, 2))}</div>`;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
html += '</div>';
|
|
274
|
-
return html;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
handleMessageReceived(message) {
|
|
278
|
-
if (message.role === 'user') {
|
|
279
|
-
document.getElementById('messageInput').value = '';
|
|
280
|
-
document.getElementById('messageInput').focus();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
async sendMessage() {
|
|
285
|
-
const input = document.getElementById('messageInput');
|
|
286
|
-
const content = input.value.trim();
|
|
287
|
-
|
|
288
|
-
if (!content || !this.currentConversation || !this.selectedAgent) return;
|
|
289
|
-
|
|
290
|
-
try {
|
|
291
|
-
await window.wsClient.rpc('msg.send', { id: this.currentConversation, content, agentId: this.selectedAgent });
|
|
292
|
-
input.value = '';
|
|
293
|
-
} catch (e) {
|
|
294
|
-
console.error('[APP] Error sending message:', e);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
async createConversation(title = 'New Conversation') {
|
|
299
|
-
if (!this.selectedAgent) {
|
|
300
|
-
console.error('[APP] No agent selected');
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
try {
|
|
305
|
-
const data = await window.wsClient.rpc('conv.new', { title, agentId: this.selectedAgent });
|
|
306
|
-
await this.fetchConversations();
|
|
307
|
-
this.renderChatHistory();
|
|
308
|
-
if (data.conversation) {
|
|
309
|
-
this.selectConversation(data.conversation.id);
|
|
310
|
-
}
|
|
311
|
-
} catch (e) {
|
|
312
|
-
console.error('[APP] Error creating conversation:', e);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
selectConversation(convId) {
|
|
317
|
-
this.currentConversation = convId;
|
|
318
|
-
document.querySelectorAll('.chat-item').forEach(el => el.classList.remove('active'));
|
|
319
|
-
const el = document.querySelector(`[data-conv-id="${convId}"]`);
|
|
320
|
-
if (el) el.classList.add('active');
|
|
321
|
-
this.renderChatMessages();
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
async renderChatMessages() {
|
|
325
|
-
const chatDiv = document.getElementById('chatMessages');
|
|
326
|
-
if (!chatDiv || !this.currentConversation) return;
|
|
327
|
-
|
|
328
|
-
chatDiv.innerHTML = '';
|
|
329
|
-
const messages = await this.fetchMessages(this.currentConversation);
|
|
330
|
-
for (const msg of messages) {
|
|
331
|
-
const msgEl = document.createElement('div');
|
|
332
|
-
msgEl.className = `message ${msg.role}`;
|
|
333
|
-
|
|
334
|
-
// Try to parse content as JSON for structured display
|
|
335
|
-
let contentHtml = '';
|
|
336
|
-
try {
|
|
337
|
-
const parsed = typeof msg.content === 'string' ? JSON.parse(msg.content) : msg.content;
|
|
338
|
-
if (parsed && parsed.type === 'claude_execution' && parsed.blocks) {
|
|
339
|
-
// Render each block with appropriate formatting
|
|
340
|
-
contentHtml = '<div class="execution-blocks">';
|
|
341
|
-
for (const block of parsed.blocks) {
|
|
342
|
-
contentHtml += this.renderMessageBlock(block);
|
|
343
|
-
}
|
|
344
|
-
contentHtml += '</div>';
|
|
345
|
-
} else {
|
|
346
|
-
throw new Error('Not a claude_execution message');
|
|
347
|
-
}
|
|
348
|
-
} catch (e) {
|
|
349
|
-
// Fallback: try to parse and beautify, or render as plain text
|
|
350
|
-
try {
|
|
351
|
-
const parsed = typeof msg.content === 'string' ? JSON.parse(msg.content) : msg.content;
|
|
352
|
-
contentHtml = `<div class="message-content">${this.renderParameters(parsed)}</div>`;
|
|
353
|
-
} catch (parseErr) {
|
|
354
|
-
const text = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
|
|
355
|
-
contentHtml = `<div class="message-content"><pre>${this.escapeHtml(text)}</pre></div>`;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
msgEl.innerHTML = contentHtml;
|
|
360
|
-
chatDiv.appendChild(msgEl);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
renderChatHistory() {
|
|
365
|
-
const list = document.getElementById('chatList');
|
|
366
|
-
if (!list) return;
|
|
367
|
-
|
|
368
|
-
list.innerHTML = '';
|
|
369
|
-
const convs = Array.from(this.conversations.values())
|
|
370
|
-
.sort((a, b) => (b.updated_at || 0) - (a.updated_at || 0));
|
|
371
|
-
|
|
372
|
-
for (const conv of convs) {
|
|
373
|
-
const el = document.createElement('div');
|
|
374
|
-
el.className = 'chat-item';
|
|
375
|
-
el.setAttribute('data-conv-id', conv.id);
|
|
376
|
-
el.innerHTML = `<div class="chat-item-title">${this.escapeHtml(conv.title || 'Untitled')}</div>`;
|
|
377
|
-
el.onclick = () => this.selectConversation(conv.id);
|
|
378
|
-
list.appendChild(el);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
renderAll() {
|
|
383
|
-
this.renderChatHistory();
|
|
384
|
-
if (this.conversations.size > 0 && !this.currentConversation) {
|
|
385
|
-
const firstConv = Array.from(this.conversations.values())[0];
|
|
386
|
-
this.selectConversation(firstConv.id);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
setupEventListeners() {
|
|
391
|
-
const sendBtn = document.getElementById('sendBtn');
|
|
392
|
-
if (sendBtn) {
|
|
393
|
-
sendBtn.onclick = () => this.sendMessage();
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
const input = document.getElementById('messageInput');
|
|
397
|
-
if (input) {
|
|
398
|
-
input.addEventListener('keypress', (e) => {
|
|
399
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
400
|
-
e.preventDefault();
|
|
401
|
-
this.sendMessage();
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
const newConvBtn = document.getElementById('newConversationBtn');
|
|
407
|
-
if (newConvBtn) {
|
|
408
|
-
newConvBtn.onclick = () => this.createConversation();
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
parseMarkdownCodeBlocks(text) {
|
|
413
|
-
const parts = [];
|
|
414
|
-
const codeBlockRegex = /```(\w+)?\n([\s\S]*?)```/g;
|
|
415
|
-
let lastIndex = 0;
|
|
416
|
-
let match;
|
|
417
|
-
|
|
418
|
-
while ((match = codeBlockRegex.exec(text)) !== null) {
|
|
419
|
-
// Add text before code block
|
|
420
|
-
if (match.index > lastIndex) {
|
|
421
|
-
parts.push({
|
|
422
|
-
type: 'text',
|
|
423
|
-
content: text.substring(lastIndex, match.index)
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// Add code block
|
|
428
|
-
const language = match[1] || 'text';
|
|
429
|
-
const code = match[2];
|
|
430
|
-
parts.push({
|
|
431
|
-
type: 'code',
|
|
432
|
-
language,
|
|
433
|
-
content: code
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
lastIndex = codeBlockRegex.lastIndex;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
// Add remaining text
|
|
440
|
-
if (lastIndex < text.length) {
|
|
441
|
-
parts.push({
|
|
442
|
-
type: 'text',
|
|
443
|
-
content: text.substring(lastIndex)
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
return parts.length > 0 ? parts : [{ type: 'text', content: text }];
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
markdownToHtml(markdown) {
|
|
451
|
-
const lines = markdown.split('\n');
|
|
452
|
-
let html = '';
|
|
453
|
-
let inList = false;
|
|
454
|
-
let listType = null;
|
|
455
|
-
let i = 0;
|
|
456
|
-
|
|
457
|
-
while (i < lines.length) {
|
|
458
|
-
const line = lines[i];
|
|
459
|
-
const trimmed = line.trim();
|
|
460
|
-
|
|
461
|
-
// Code blocks
|
|
462
|
-
if (trimmed.startsWith('```')) {
|
|
463
|
-
if (inList) {
|
|
464
|
-
html += listType === 'ul' ? '</ul>' : '</ol>';
|
|
465
|
-
inList = false;
|
|
466
|
-
}
|
|
467
|
-
const match = trimmed.match(/^```(\w*)/);
|
|
468
|
-
const lang = (match && match[1]) || 'text';
|
|
469
|
-
i++;
|
|
470
|
-
const codeLines = [];
|
|
471
|
-
while (i < lines.length && !lines[i].trim().startsWith('```')) {
|
|
472
|
-
codeLines.push(lines[i]);
|
|
473
|
-
i++;
|
|
474
|
-
}
|
|
475
|
-
const clCount = codeLines.length;
|
|
476
|
-
html += `<details class="collapsible-code"><summary class="collapsible-code-summary">${this.escapeHtml(lang)} - ${clCount} line${clCount !== 1 ? 's' : ''}</summary><div class="code-block" data-language="${this.escapeHtml(lang)}"><pre><code>${this.escapeHtml(codeLines.join('\n'))}</code></pre></div></details>`;
|
|
477
|
-
i++;
|
|
478
|
-
continue;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
// Headings
|
|
482
|
-
if (trimmed.startsWith('#')) {
|
|
483
|
-
if (inList) {
|
|
484
|
-
html += listType === 'ul' ? '</ul>' : '</ol>';
|
|
485
|
-
inList = false;
|
|
486
|
-
}
|
|
487
|
-
const match = trimmed.match(/^(#+)\s+(.*)/);
|
|
488
|
-
if (match) {
|
|
489
|
-
const level = match[1].length;
|
|
490
|
-
const text = this.escapeAndFormatInline(match[2]);
|
|
491
|
-
html += `<h${level}>${text}</h${level}>`;
|
|
492
|
-
i++;
|
|
493
|
-
continue;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
// Lists
|
|
498
|
-
if (trimmed.match(/^[-*+]\s/)) {
|
|
499
|
-
if (!inList) {
|
|
500
|
-
html += '<ul>';
|
|
501
|
-
inList = true;
|
|
502
|
-
listType = 'ul';
|
|
503
|
-
}
|
|
504
|
-
const match = trimmed.match(/^[-*+]\s+(.*)/);
|
|
505
|
-
if (match) {
|
|
506
|
-
const text = this.escapeAndFormatInline(match[1]);
|
|
507
|
-
html += `<li>${text}</li>`;
|
|
508
|
-
}
|
|
509
|
-
i++;
|
|
510
|
-
continue;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
if (trimmed.match(/^\d+\.\s/)) {
|
|
514
|
-
if (!inList || listType !== 'ol') {
|
|
515
|
-
if (inList) html += '</ul>';
|
|
516
|
-
html += '<ol>';
|
|
517
|
-
inList = true;
|
|
518
|
-
listType = 'ol';
|
|
519
|
-
}
|
|
520
|
-
const match = trimmed.match(/^\d+\.\s+(.*)/);
|
|
521
|
-
if (match) {
|
|
522
|
-
const text = this.escapeAndFormatInline(match[1]);
|
|
523
|
-
html += `<li>${text}</li>`;
|
|
524
|
-
}
|
|
525
|
-
i++;
|
|
526
|
-
continue;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
// End list if not a list item
|
|
530
|
-
if (inList && trimmed && !trimmed.match(/^[-*+]\s/) && !trimmed.match(/^\d+\.\s/)) {
|
|
531
|
-
html += listType === 'ul' ? '</ul>' : '</ol>';
|
|
532
|
-
inList = false;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
// Paragraphs
|
|
536
|
-
if (trimmed) {
|
|
537
|
-
const text = this.escapeAndFormatInline(trimmed);
|
|
538
|
-
html += `<p>${text}</p>`;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
i++;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
// Close any open list
|
|
545
|
-
if (inList) {
|
|
546
|
-
html += listType === 'ul' ? '</ul>' : '</ol>';
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
return html;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
escapeAndFormatInline(text) {
|
|
553
|
-
text = this.escapeHtml(text);
|
|
554
|
-
// Bold and italic (must be before single asterisk)
|
|
555
|
-
text = text.replace(/\*\*\*(.*?)\*\*\*/g, '<strong><em>$1</em></strong>');
|
|
556
|
-
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
|
557
|
-
text = text.replace(/\*(.*?)\*/g, '<em>$1</em>');
|
|
558
|
-
text = text.replace(/__(.*?)__/g, '<strong>$1</strong>');
|
|
559
|
-
text = text.replace(/_(.*?)_/g, '<em>$1</em>');
|
|
560
|
-
// Inline code
|
|
561
|
-
text = text.replace(/`([^`]+)`/g, '<code class="inline-code">$1</code>');
|
|
562
|
-
// Links
|
|
563
|
-
text = text.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>');
|
|
564
|
-
return text;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
renderCodeBlock(language, code) {
|
|
568
|
-
if (language === 'html') {
|
|
569
|
-
return `<div class="html-block">
|
|
570
|
-
<div class="html-header">Rendered HTML</div>
|
|
571
|
-
<div class="html-content">${code}</div>
|
|
572
|
-
</div>`;
|
|
573
|
-
} else {
|
|
574
|
-
const lcCount = code.split('\n').length;
|
|
575
|
-
return `<details class="collapsible-code"><summary class="collapsible-code-summary">${this.escapeHtml(language)} - ${lcCount} line${lcCount !== 1 ? 's' : ''}</summary><div class="code-block" data-language="${this.escapeHtml(language)}">
|
|
576
|
-
<pre><code>${this.escapeHtml(code)}</code></pre>
|
|
577
|
-
</div></details>`;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
escapeHtml(text) {
|
|
582
|
-
const div = document.createElement('div');
|
|
583
|
-
div.textContent = text;
|
|
584
|
-
return div.innerHTML;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
renderParameters(obj, depth = 0) {
|
|
588
|
-
if (obj === null || obj === undefined) {
|
|
589
|
-
return `<span style="color: var(--text-tertiary);">null</span>`;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
if (typeof obj === 'string') {
|
|
593
|
-
const isPath = obj.includes('/') || obj.includes('\\');
|
|
594
|
-
const isUrl = obj.startsWith('http://') || obj.startsWith('https://');
|
|
595
|
-
if (isPath || isUrl) {
|
|
596
|
-
return `<code style="color: var(--text-secondary); background: transparent;">${this.escapeHtml(obj)}</code>`;
|
|
597
|
-
}
|
|
598
|
-
return `<span>"${this.escapeHtml(obj)}"</span>`;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
if (typeof obj === 'number' || typeof obj === 'boolean') {
|
|
602
|
-
return `<span style="color: var(--color-info);">${obj}</span>`;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
if (Array.isArray(obj)) {
|
|
606
|
-
if (obj.length === 0) {
|
|
607
|
-
return `<span style="color: var(--text-tertiary);">[]</span>`;
|
|
608
|
-
}
|
|
609
|
-
const maxItems = depth === 0 ? 10 : 5;
|
|
610
|
-
const items = obj.slice(0, maxItems).map(item => this.renderParameters(item, depth + 1));
|
|
611
|
-
const more = obj.length > maxItems ? `<span style="color: var(--text-tertiary);">... ${obj.length - maxItems} more</span>` : '';
|
|
612
|
-
return `<span style="color: var(--text-tertiary);">[</span> ${items.join(', ')} ${more} <span style="color: var(--text-tertiary);">]</span>`;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
if (typeof obj === 'object') {
|
|
616
|
-
const keys = Object.keys(obj);
|
|
617
|
-
if (keys.length === 0) {
|
|
618
|
-
return `<span style="color: var(--text-tertiary);">{}</span>`;
|
|
619
|
-
}
|
|
620
|
-
const maxKeys = depth === 0 ? 15 : 8;
|
|
621
|
-
const pairs = keys.slice(0, maxKeys).map(key => {
|
|
622
|
-
const keyHtml = `<span style="color: var(--color-primary);">${this.escapeHtml(key)}</span>`;
|
|
623
|
-
const valHtml = this.renderParameters(obj[key], depth + 1);
|
|
624
|
-
return `${keyHtml}: ${valHtml}`;
|
|
625
|
-
});
|
|
626
|
-
const more = keys.length > maxKeys ? `<span style="color: var(--text-tertiary);">... ${keys.length - maxKeys} more</span>` : '';
|
|
627
|
-
return `<div style="margin-left: ${depth * 1.5}rem;"><span style="color: var(--text-tertiary);">{</span><br/>${pairs.map(p => ` ${p}`).join(',<br/>')}<br/>${more}<span style="color: var(--text-tertiary);">}</span></div>`;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
return `<span>${this.escapeHtml(String(obj))}</span>`;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
const app = new GMGUIApp();
|
|
635
|
-
|
|
636
|
-
function initializeApp() {
|
|
637
|
-
app.init().catch(err => {
|
|
638
|
-
console.error('[CRITICAL] Failed to initialize app:', err);
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
function sendMessage() {
|
|
643
|
-
app.sendMessage();
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
function showNewChatModal() {
|
|
647
|
-
const modal = document.getElementById('newChatModal');
|
|
648
|
-
if (modal) {
|
|
649
|
-
modal.style.display = 'flex';
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
function closeNewChatModal() {
|
|
654
|
-
const modal = document.getElementById('newChatModal');
|
|
655
|
-
if (modal) {
|
|
656
|
-
modal.style.display = 'none';
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
async function createChatInWorkspace() {
|
|
661
|
-
const title = await window.UIDialog.prompt('Enter a title for the conversation:', 'New Conversation', 'New Chat');
|
|
662
|
-
if (title) {
|
|
663
|
-
app.createConversation(title);
|
|
664
|
-
closeNewChatModal();
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
function createChatInFolder() {
|
|
669
|
-
const folderModal = document.getElementById('folderBrowserModal');
|
|
670
|
-
if (folderModal) {
|
|
671
|
-
folderModal.style.display = 'flex';
|
|
672
|
-
closeNewChatModal();
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
function closeFolderBrowser() {
|
|
677
|
-
const modal = document.getElementById('folderBrowserModal');
|
|
678
|
-
if (modal) {
|
|
679
|
-
modal.style.display = 'none';
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function confirmFolderSelection() {
|
|
684
|
-
const folderPath = document.getElementById('folderPath')?.value;
|
|
685
|
-
if (folderPath) {
|
|
686
|
-
const title = `Chat in ${folderPath}`;
|
|
687
|
-
app.createConversation(title);
|
|
688
|
-
closeFolderBrowser();
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
function browseFolders() {
|
|
693
|
-
// Placeholder for folder browsing functionality
|
|
694
|
-
console.log('Folder browsing not yet implemented');
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
function toggleSidebar() {
|
|
698
|
-
const sidebar = document.getElementById('sidebar');
|
|
699
|
-
if (sidebar) {
|
|
700
|
-
sidebar.classList.toggle('collapsed');
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
function switchTab(tab) {
|
|
705
|
-
if (tab === 'settings') {
|
|
706
|
-
const panel = document.getElementById('settingsPanel');
|
|
707
|
-
if (panel) {
|
|
708
|
-
panel.style.display = 'flex';
|
|
709
|
-
}
|
|
710
|
-
const main = document.querySelector('.main-content');
|
|
711
|
-
if (main) {
|
|
712
|
-
main.style.display = 'none';
|
|
713
|
-
}
|
|
714
|
-
} else if (tab === 'chat') {
|
|
715
|
-
const panel = document.getElementById('settingsPanel');
|
|
716
|
-
if (panel) {
|
|
717
|
-
panel.style.display = 'none';
|
|
718
|
-
}
|
|
719
|
-
const main = document.querySelector('.main-content');
|
|
720
|
-
if (main) {
|
|
721
|
-
main.style.display = 'flex';
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
function triggerFileUpload() {
|
|
727
|
-
const input = document.getElementById('fileInput');
|
|
728
|
-
if (input) {
|
|
729
|
-
input.click();
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
function handleFileUpload() {
|
|
734
|
-
console.log('File upload not yet implemented');
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
function closeScreenshotModal() {
|
|
738
|
-
const modal = document.getElementById('screenshotModal');
|
|
739
|
-
if (modal) {
|
|
740
|
-
modal.style.display = 'none';
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
function sendScreenshot() {
|
|
745
|
-
console.log('Send screenshot not yet implemented');
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
function downloadScreenshot() {
|
|
749
|
-
console.log('Download screenshot not yet implemented');
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
function showShortcutsOverlay() {
|
|
753
|
-
if (document.querySelector('.shortcuts-overlay')) return;
|
|
754
|
-
const overlay = document.createElement('div');
|
|
755
|
-
overlay.className = 'shortcuts-overlay';
|
|
756
|
-
overlay.innerHTML = `<div class="shortcuts-panel">
|
|
757
|
-
<h3>Keyboard Shortcuts</h3>
|
|
758
|
-
<table>
|
|
759
|
-
<tr><td><kbd>Ctrl</kbd>+<kbd>N</kbd></td><td>New conversation</td></tr>
|
|
760
|
-
<tr><td><kbd>Ctrl</kbd>+<kbd>B</kbd></td><td>Toggle sidebar</td></tr>
|
|
761
|
-
<tr><td><kbd>Ctrl</kbd>+<kbd>Enter</kbd></td><td>Send message</td></tr>
|
|
762
|
-
<tr><td><kbd>Escape</kbd></td><td>Cancel stream / blur input</td></tr>
|
|
763
|
-
<tr><td><kbd>?</kbd></td><td>Show this help</td></tr>
|
|
764
|
-
</table>
|
|
765
|
-
<p style="margin:1rem 0 0;font-size:0.75rem;color:#9ca3af;">Press Escape to close</p>
|
|
766
|
-
</div>`;
|
|
767
|
-
overlay.addEventListener('click', (e) => { if (e.target === overlay) overlay.remove(); });
|
|
768
|
-
document.body.appendChild(overlay);
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
document.addEventListener('keydown', (e) => {
|
|
772
|
-
if (e.key === '?' && !e.ctrlKey && !e.metaKey) {
|
|
773
|
-
const tag = document.activeElement?.tagName;
|
|
774
|
-
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return;
|
|
775
|
-
e.preventDefault();
|
|
776
|
-
showShortcutsOverlay();
|
|
777
|
-
}
|
|
778
|
-
if (e.key === 'Escape' && document.querySelector('.shortcuts-overlay')) {
|
|
779
|
-
document.querySelector('.shortcuts-overlay').remove();
|
|
780
|
-
}
|
|
781
|
-
});
|
|
782
|
-
|
|
1
|
+
const BASE_URL = window.__BASE_URL || '';
|
|
2
|
+
|
|
783
3
|
(function initSidebarSearch() {
|
|
784
4
|
const input = document.getElementById('sidebarSearchInput');
|
|
785
5
|
if (!input) return;
|
|
@@ -963,6 +183,4 @@ document.addEventListener('keydown', (e) => {
|
|
|
963
183
|
});
|
|
964
184
|
|
|
965
185
|
renderSelector();
|
|
966
|
-
})();
|
|
967
|
-
|
|
968
|
-
window.addEventListener('load', initializeApp);
|
|
186
|
+
})();
|
package/static/index.html
CHANGED
|
@@ -310,6 +310,8 @@
|
|
|
310
310
|
<script defer src="/gm/js/client.js"></script>
|
|
311
311
|
<script defer src="/gm/js/features.js"></script>
|
|
312
312
|
<script defer src="/gm/js/agent-auth.js"></script>
|
|
313
|
+
<script defer src="/gm/js/app-shortcuts.js"></script>
|
|
314
|
+
<script defer src="/gm/app.js"></script>
|
|
313
315
|
|
|
314
316
|
<script>
|
|
315
317
|
const savedTheme = localStorage.getItem('theme') || 'light';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function showShortcutsOverlay() {
|
|
2
|
+
if (document.querySelector('.shortcuts-overlay')) return;
|
|
3
|
+
const overlay = document.createElement('div');
|
|
4
|
+
overlay.className = 'shortcuts-overlay';
|
|
5
|
+
overlay.innerHTML = `<div class="shortcuts-panel">
|
|
6
|
+
<h3>Keyboard Shortcuts</h3>
|
|
7
|
+
<table>
|
|
8
|
+
<tr><td><kbd>Ctrl</kbd>+<kbd>N</kbd></td><td>New conversation</td></tr>
|
|
9
|
+
<tr><td><kbd>Ctrl</kbd>+<kbd>B</kbd></td><td>Toggle sidebar</td></tr>
|
|
10
|
+
<tr><td><kbd>Ctrl</kbd>+<kbd>Enter</kbd></td><td>Send message</td></tr>
|
|
11
|
+
<tr><td><kbd>Escape</kbd></td><td>Cancel stream / blur input</td></tr>
|
|
12
|
+
<tr><td><kbd>?</kbd></td><td>Show this help</td></tr>
|
|
13
|
+
</table>
|
|
14
|
+
<p style="margin:1rem 0 0;font-size:0.75rem;color:#9ca3af;">Press Escape to close</p>
|
|
15
|
+
</div>`;
|
|
16
|
+
overlay.addEventListener('click', (e) => { if (e.target === overlay) overlay.remove(); });
|
|
17
|
+
document.body.appendChild(overlay);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
document.addEventListener('keydown', (e) => {
|
|
21
|
+
if (e.key === '?' && !e.ctrlKey && !e.metaKey) {
|
|
22
|
+
const tag = document.activeElement?.tagName;
|
|
23
|
+
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return;
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
showShortcutsOverlay();
|
|
26
|
+
}
|
|
27
|
+
if (e.key === 'Escape' && document.querySelector('.shortcuts-overlay')) {
|
|
28
|
+
document.querySelector('.shortcuts-overlay').remove();
|
|
29
|
+
}
|
|
30
|
+
});
|
package/static/js/client.js
CHANGED
|
@@ -1997,6 +1997,10 @@ class AgentGUIClient {
|
|
|
1997
1997
|
isStreaming: self._convIsStreaming(self.state.currentConversation?.id),
|
|
1998
1998
|
streamingConversations: Array.from(self.state.streamingConversations),
|
|
1999
1999
|
convMachineStates: typeof convMachineAPI !== 'undefined' ? Object.fromEntries([...window.__convMachines].map(([k, a]) => [k, a.getSnapshot().value])) : {},
|
|
2000
|
+
toolInstallMachineStates: typeof window.__toolInstallMachines !== 'undefined' ? Object.fromEntries([...window.__toolInstallMachines].map(([k, a]) => [k, a.getSnapshot().value])) : {},
|
|
2001
|
+
voiceMachineState: typeof window.__voiceMachine !== 'undefined' ? window.__voiceMachine.getSnapshot().value : 'unknown',
|
|
2002
|
+
convListMachineState: typeof window.__convListMachine !== 'undefined' ? window.__convListMachine.getSnapshot().value : 'unknown',
|
|
2003
|
+
promptMachineState: typeof window.__promptMachine !== 'undefined' ? window.__promptMachine.getSnapshot().value : 'unknown',
|
|
2000
2004
|
wsConnectionState: self.wsManager?._wsActor?.getSnapshot().value || 'unknown',
|
|
2001
2005
|
rendererEventQueueLength: self.renderer?.eventQueue?.length || 0,
|
|
2002
2006
|
rendererEventHistoryLength: self.renderer?.eventHistory?.length || 0,
|