agentgui 1.0.566 → 1.0.568

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.566",
3
+ "version": "1.0.568",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -730,11 +730,13 @@ class AgentGUIClient {
730
730
  return;
731
731
  }
732
732
 
733
- // Show stop, steer, and inject buttons when streaming starts for current conversation
733
+ // Show stop, steer, queue, and inject buttons when streaming starts for current conversation
734
734
  if (this.ui.stopButton) this.ui.stopButton.classList.add('visible');
735
735
  if (this.ui.injectButton) this.ui.injectButton.classList.add('visible');
736
736
  if (this.ui.steerButton) this.ui.steerButton.classList.add('visible');
737
+ if (this.ui.queueButton) this.ui.queueButton.classList.add('visible');
737
738
  if (this.ui.sendButton) this.ui.sendButton.style.display = 'none';
739
+ this.ensurePromptAreaAlwaysEnabled();
738
740
 
739
741
  this.state.streamingConversations.set(data.conversationId, true);
740
742
  this.state.currentSession = {
@@ -863,9 +865,9 @@ class AgentGUIClient {
863
865
  this.startChunkPolling(data.conversationId);
864
866
 
865
867
  // Show queue/steer UI when streaming starts (for busy prompt)
866
- this.fetchAndRenderQueue(data.conversationId);
868
+ this.showStreamingPromptButtons();
867
869
 
868
- this.disableControls();
870
+ // IMMUTABLE: Prompt area remains enabled - user can queue/steer messages
869
871
  this.emit('streaming:start', data);
870
872
  }
871
873
 
@@ -2668,7 +2670,9 @@ class AgentGUIClient {
2668
2670
  }
2669
2671
  const element = this.renderer.renderBlock(chunk.block, chunk);
2670
2672
  if (!element) return;
2673
+ // Ensure CSS classes are always applied for styling consistency
2671
2674
  element.classList.add('block-loaded');
2675
+ element.classList.add(`block-type-${chunk.block.type}`);
2672
2676
  blockFrag.appendChild(element);
2673
2677
  });
2674
2678
 
@@ -2747,7 +2751,7 @@ class AgentGUIClient {
2747
2751
 
2748
2752
  this.chunkPollState.lastFetchTimestamp = lastChunkTime;
2749
2753
  this.startChunkPolling(conversationId);
2750
- this.disableControls();
2754
+ // IMMUTABLE: Prompt remains enabled - syncPromptState will set correct state
2751
2755
  this.syncPromptState(conversationId);
2752
2756
  } else {
2753
2757
  this.syncPromptState(conversationId);
@@ -2770,6 +2774,25 @@ class AgentGUIClient {
2770
2774
  if (this.ui.messageInput) {
2771
2775
  this.ui.messageInput.disabled = false;
2772
2776
  }
2777
+
2778
+ this.updateBusyPromptArea(conversationId);
2779
+ }
2780
+
2781
+ updateBusyPromptArea(conversationId) {
2782
+ const isStreaming = this.state.streamingConversations.has(conversationId);
2783
+ const isConnected = this.wsManager?.isConnected;
2784
+
2785
+ const injectBtn = document.getElementById('injectBtn');
2786
+ const steerBtn = document.getElementById('steerBtn');
2787
+ const stopBtn = document.getElementById('stopBtn');
2788
+
2789
+ if (injectBtn) injectBtn.style.display = isStreaming ? 'flex' : 'none';
2790
+ if (steerBtn) steerBtn.style.display = isStreaming ? 'flex' : 'none';
2791
+ if (stopBtn) stopBtn.style.display = isStreaming ? 'flex' : 'none';
2792
+
2793
+ if (injectBtn) injectBtn.disabled = !isConnected;
2794
+ if (steerBtn) steerBtn.disabled = !isConnected;
2795
+ if (stopBtn) stopBtn.disabled = !isConnected;
2773
2796
  }
2774
2797
 
2775
2798
  removeScrollUpDetection() {
@@ -3040,6 +3063,13 @@ class AgentGUIClient {
3040
3063
  if (this.ui.sendButton) {
3041
3064
  this.ui.sendButton.disabled = !this.wsManager.isConnected;
3042
3065
  }
3066
+ // Also disable queue/steer buttons if disconnected
3067
+ if (this.ui.injectButton && this.ui.injectButton.classList.contains('visible')) {
3068
+ this.ui.injectButton.disabled = !this.wsManager.isConnected;
3069
+ }
3070
+ if (this.ui.steerButton && this.ui.steerButton.classList.contains('visible')) {
3071
+ this.ui.steerButton.disabled = !this.wsManager.isConnected;
3072
+ }
3043
3073
  }
3044
3074
 
3045
3075
  /**
@@ -3061,6 +3091,29 @@ class AgentGUIClient {
3061
3091
  if (injectBtn) injectBtn.disabled = false;
3062
3092
  }
3063
3093
 
3094
+ /**
3095
+ * Show queue/steer buttons when streaming (busy prompt state)
3096
+ */
3097
+ showStreamingPromptButtons() {
3098
+ if (this.ui.injectButton) {
3099
+ this.ui.injectButton.classList.add('visible');
3100
+ this.ui.injectButton.disabled = !this.wsManager.isConnected;
3101
+ }
3102
+ if (this.ui.steerButton) {
3103
+ this.ui.steerButton.classList.add('visible');
3104
+ this.ui.steerButton.disabled = !this.wsManager.isConnected;
3105
+ }
3106
+ }
3107
+
3108
+ /**
3109
+ * Ensure prompt area is always enabled and shows queue/steer when agent streaming
3110
+ */
3111
+ ensurePromptAreaAlwaysEnabled() {
3112
+ if (this.ui.messageInput) {
3113
+ this.ui.messageInput.disabled = false;
3114
+ }
3115
+ }
3116
+
3064
3117
  /**
3065
3118
  * Cleanup resources
3066
3119
  */