agentgui 1.0.247 → 1.0.249

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.247",
3
+ "version": "1.0.249",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -516,11 +516,6 @@ class AgentGUIClient {
516
516
  this._serverProcessingEstimate = 0.7 * this._serverProcessingEstimate + 0.3 * serverTime;
517
517
  }
518
518
 
519
- // Show stop and inject buttons when streaming starts
520
- if (this.ui.stopButton) this.ui.stopButton.classList.add('visible');
521
- if (this.ui.injectButton) this.ui.injectButton.classList.add('visible');
522
- if (this.ui.sendButton) this.ui.sendButton.style.display = 'none';
523
-
524
519
  // If this streaming event is for a different conversation than what we are viewing,
525
520
  // just track the state but do not modify the DOM or start polling
526
521
  if (this.state.currentConversation?.id !== data.conversationId) {
@@ -530,6 +525,11 @@ class AgentGUIClient {
530
525
  return;
531
526
  }
532
527
 
528
+ // Show stop and inject buttons when streaming starts for current conversation
529
+ if (this.ui.stopButton) this.ui.stopButton.classList.add('visible');
530
+ if (this.ui.injectButton) this.ui.injectButton.classList.add('visible');
531
+ if (this.ui.sendButton) this.ui.sendButton.style.display = 'none';
532
+
533
533
  this.state.streamingConversations.set(data.conversationId, true);
534
534
  this.state.currentSession = {
535
535
  id: data.sessionId,
@@ -1884,10 +1884,16 @@ class AgentGUIClient {
1884
1884
  } else if (status.modelsDownloading) {
1885
1885
  this._modelDownloadProgress = status.modelsProgress || { downloading: true };
1886
1886
  this._modelDownloadInProgress = true;
1887
+ } else {
1888
+ this._modelDownloadProgress = { done: false };
1889
+ this._modelDownloadInProgress = false;
1887
1890
  }
1888
1891
  this._updateVoiceTabState();
1889
1892
  } catch (error) {
1890
1893
  console.error('Failed to check speech status:', error);
1894
+ this._modelDownloadProgress = { done: false };
1895
+ this._modelDownloadInProgress = false;
1896
+ this._updateVoiceTabState();
1891
1897
  }
1892
1898
  }
1893
1899
 
@@ -2058,6 +2064,11 @@ class AgentGUIClient {
2058
2064
  }
2059
2065
  }, 500);
2060
2066
  }
2067
+ if (window._voiceTabPendingOpen) {
2068
+ window._voiceTabPendingOpen = false;
2069
+ var voiceBtn = document.querySelector('[data-view="voice"]');
2070
+ if (voiceBtn) voiceBtn.click();
2071
+ }
2061
2072
  return;
2062
2073
  }
2063
2074
 
@@ -48,7 +48,7 @@ class ConversationManager {
48
48
  this.setupFolderBrowser();
49
49
  this.setupCloneUI();
50
50
 
51
- setInterval(() => this.loadConversations(), 30000);
51
+ this._pollInterval = setInterval(() => this.loadConversations(), 30000);
52
52
  }
53
53
 
54
54
  async loadAgents() {
@@ -189,7 +189,7 @@
189
189
  btn.addEventListener('click', function() {
190
190
  var view = btn.dataset.view;
191
191
  if (view === 'voice' && !isVoiceReady()) {
192
- showToast('Downloading voice models... please wait', 'info');
192
+ triggerVoiceModelDownload();
193
193
  return;
194
194
  }
195
195
  switchView(view);
@@ -198,11 +198,35 @@
198
198
  }
199
199
 
200
200
  function isVoiceReady() {
201
- if (window.agentGUIClient && !window.agentGUIClient._modelDownloadInProgress) {
202
- return window.agentGUIClient._modelDownloadProgress?.done === true ||
203
- window.agentGUIClient._modelDownloadProgress?.complete === true;
201
+ var client = window.agentGUIClient;
202
+ if (!client) return false;
203
+ if (client._modelDownloadInProgress) return false;
204
+ var p = client._modelDownloadProgress;
205
+ return p != null && (p.done === true || p.complete === true);
206
+ }
207
+
208
+ function triggerVoiceModelDownload() {
209
+ var client = window.agentGUIClient;
210
+ if (client && client._modelDownloadInProgress) {
211
+ showToast('Voice models downloading... please wait', 'info');
212
+ return;
204
213
  }
205
- return false;
214
+ showToast('Starting voice model download...', 'info');
215
+ fetch((window.__BASE_URL || '') + '/api/speech-status', {
216
+ method: 'POST',
217
+ headers: { 'Content-Type': 'application/json' },
218
+ body: JSON.stringify({ forceDownload: true })
219
+ }).then(function(res) { return res.json(); })
220
+ .then(function(data) {
221
+ if (data.ok) {
222
+ showToast('Downloading voice models... will auto-open when ready', 'info');
223
+ window._voiceTabPendingOpen = true;
224
+ } else {
225
+ showToast('Failed to start download: ' + (data.error || 'unknown'), 'error');
226
+ }
227
+ }).catch(function(err) {
228
+ showToast('Download request failed: ' + err.message, 'error');
229
+ });
206
230
  }
207
231
 
208
232
  window.__checkVoiceReady = isVoiceReady;
@@ -424,7 +424,9 @@ class StreamingRenderer {
424
424
  'image': 9,
425
425
  'plan': 10,
426
426
  'usage': 11,
427
- 'premature': 8
427
+ 'premature': 8,
428
+ 'tool_status': 7,
429
+ 'generic': 0
428
430
  };
429
431
  return typeColors[blockType] !== undefined ? typeColors[blockType] : 0;
430
432
  }
@@ -1501,6 +1503,8 @@ class StreamingRenderer {
1501
1503
  renderBlockGeneric(block, context) {
1502
1504
  const div = document.createElement('div');
1503
1505
  div.className = 'block-generic';
1506
+ const colorIndex = this._getBlockColorIndex('generic');
1507
+ div.style.borderLeft = `3px solid var(--block-color-${colorIndex})`;
1504
1508
 
1505
1509
  // Show key-value pairs instead of raw JSON
1506
1510
  const fieldsHtml = Object.entries(block)
@@ -1532,6 +1536,8 @@ class StreamingRenderer {
1532
1536
  renderBlockError(block, error) {
1533
1537
  const div = document.createElement('div');
1534
1538
  div.className = 'block-error';
1539
+ const colorIndex = this._getBlockColorIndex('error');
1540
+ div.style.borderLeft = `3px solid var(--block-color-${colorIndex})`;
1535
1541
 
1536
1542
  div.innerHTML = `
1537
1543
  <div style="display:flex;align-items:flex-start;gap:0.625rem">