agentgui 1.0.240 → 1.0.241

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.240",
3
+ "version": "1.0.241",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -632,7 +632,7 @@ class AgentGUIClient {
632
632
  </div>
633
633
  `;
634
634
  messagesEl.appendChild(streamingDiv);
635
- this.scrollToBottom();
635
+ this.scrollToBottom(true);
636
636
  }
637
637
 
638
638
  // Start polling for chunks from database
@@ -687,12 +687,12 @@ class AgentGUIClient {
687
687
  return `<div style="padding:0.5rem;background:var(--color-bg-secondary);border-radius:0.375rem;border:1px solid var(--color-border)"><div style="font-size:0.7rem;font-weight:600;text-transform:uppercase;margin-bottom:0.25rem">${this.escapeHtml(block.type)}</div>${fieldsHtml}</div>`;
688
688
  }
689
689
 
690
- scrollToBottom() {
690
+ scrollToBottom(force = false) {
691
691
  const scrollContainer = document.getElementById('output-scroll');
692
692
  if (!scrollContainer) return;
693
693
  const distFromBottom = scrollContainer.scrollHeight - scrollContainer.scrollTop - scrollContainer.clientHeight;
694
694
 
695
- if (distFromBottom > 150) {
695
+ if (!force && distFromBottom > 150) {
696
696
  this._unseenCount = (this._unseenCount || 0) + 1;
697
697
  this._showNewContentPill();
698
698
  return;
@@ -701,7 +701,7 @@ class AgentGUIClient {
701
701
  const maxScroll = scrollContainer.scrollHeight - scrollContainer.clientHeight;
702
702
  const isStreaming = this.state.streamingConversations.size > 0;
703
703
 
704
- if (!isStreaming || !this._scrollKalman || Math.abs(maxScroll - scrollContainer.scrollTop) > 2000) {
704
+ if (!isStreaming || !this._scrollKalman || Math.abs(maxScroll - scrollContainer.scrollTop) > 2000 || force) {
705
705
  scrollContainer.scrollTop = scrollContainer.scrollHeight;
706
706
  this._removeNewContentPill();
707
707
  this._scrollAnimating = false;
@@ -1275,7 +1275,7 @@ class AgentGUIClient {
1275
1275
  div.id = pendingId;
1276
1276
  div.innerHTML = `<div class="message-role">User</div><div class="message-text">${this.escapeHtml(content)}</div><div class="message-timestamp" style="opacity:0.5">Sending...</div>`;
1277
1277
  messagesEl.appendChild(div);
1278
- this.scrollToBottom();
1278
+ this.scrollToBottom(true);
1279
1279
  }
1280
1280
 
1281
1281
  _confirmOptimisticMessage(pendingId) {
@@ -42,11 +42,14 @@ class EventConsolidator {
42
42
  for (const c of chunks) {
43
43
  if (c.block?.type === 'text') {
44
44
  if (pending) {
45
- const combined = (pending.block.text || '') + '\n' + (c.block.text || '');
45
+ const pendingText = pending.block.text || '';
46
+ const newText = c.block.text || '';
47
+ const combined = pendingText + newText;
46
48
  if (combined.length <= MAX_MERGE) {
49
+ const needsSpace = pendingText.length > 0 && !pendingText.endsWith(' ') && !pendingText.endsWith('\n') && newText.length > 0 && !newText.startsWith(' ') && !newText.startsWith('\n');
47
50
  pending = {
48
51
  ...pending,
49
- block: { ...pending.block, text: combined },
52
+ block: { ...pending.block, text: needsSpace ? pendingText + ' ' + newText : combined },
50
53
  created_at: c.created_at,
51
54
  _mergedSequences: [...(pending._mergedSequences || [pending.sequence]), c.sequence]
52
55
  };