@yemi33/minions 0.1.756 → 0.1.758

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 CHANGED
@@ -1,11 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.756 (2026-04-09)
3
+ ## 0.1.758 (2026-04-09)
4
4
 
5
5
  ### Features
6
6
  - show branch strategy badge on PRD group header
7
7
 
8
8
  ### Fixes
9
+ - restore full streaming state (tools + partial text) on tab switch
10
+ - restored thinking UX matches original exactly (same bubble, layout)
9
11
  - skip merged dependency branches instead of failing worktree setup
10
12
  - restore same thinking UX when switching back to processing tab
11
13
  - show thinking indicator when switching back to a processing tab
@@ -135,30 +135,38 @@ function ccSwitchTab(id) {
135
135
  for (var i = 0; i < tab.messages.length; i++) {
136
136
  ccAddMessage(tab.messages[i].role, tab.messages[i].html, true);
137
137
  }
138
- // If this tab is still processing, show the same thinking UX as during send
138
+ // If this tab is still processing, restore the full streaming UX (tools, partial text, thinking)
139
139
  if (tab._sending) {
140
140
  var dotPulse = '<span style="display:inline-flex;gap:3px;margin-left:6px;vertical-align:middle"><span style="width:4px;height:4px;background:var(--blue);border-radius:50%;animation:dotPulse 1.2s infinite"></span><span style="width:4px;height:4px;background:var(--blue);border-radius:50%;animation:dotPulse 1.2s infinite;animation-delay:0.2s"></span><span style="width:4px;height:4px;background:var(--blue);border-radius:50%;animation:dotPulse 1.2s infinite;animation-delay:0.4s"></span></span>';
141
- var elapsed = tab._sendStartedAt ? Math.floor((Date.now() - tab._sendStartedAt) / 1000) : 0;
141
+ var restoreStart = tab._sendStartedAt || Date.now();
142
142
  var phases = [[0,'Thinking...'],[3000,'Reading minions context...'],[8000,'Analyzing...'],[15000,'Using tools to dig deeper...'],[30000,'Still working (multi-turn)...'],[60000,'Deep research in progress...']];
143
- var elapsedMs = elapsed * 1000;
144
- var phaseText = 'Thinking...';
145
- for (var pi = phases.length - 1; pi >= 0; pi--) { if (elapsedMs >= phases[pi][0]) { phaseText = phases[pi][1]; break; } }
146
- var thinking = document.createElement('div');
147
- thinking.id = 'cc-restore-thinking';
148
- thinking.style.cssText = 'padding:8px 12px;border-radius:8px;font-size:11px;color:var(--muted);align-self:flex-start;background:var(--surface2);border:1px solid var(--border);position:relative;max-width:95%';
149
- thinking.innerHTML = '<div>' + dotPulse + ' <span id="cc-restore-phase">' + phaseText + '</span> <span id="cc-restore-time" style="font-size:10px;color:var(--border)">' + elapsed + 's</span>' +
150
- ' <button onclick="ccAbort()" style="font-size:9px;padding:2px 8px;background:var(--surface2);border:1px solid var(--border);border-radius:4px;color:var(--red);cursor:pointer;margin-left:6px">Stop</button></div>';
151
- el.appendChild(thinking);
143
+ function _restoreStreamHtml() {
144
+ var html = '';
145
+ var tools = tab._toolsUsed || [];
146
+ if (tools.length > 0) {
147
+ html += '<div style="margin-bottom:6px">';
148
+ tools.forEach(function(t) { html += '<div style="color:var(--blue);font-size:11px">\uD83D\uDD27 ' + escHtml(t) + '</div>'; });
149
+ html += '</div>';
150
+ }
151
+ var text = tab._streamedText || '';
152
+ if (text) html += renderMd(text);
153
+ var ms = Date.now() - restoreStart;
154
+ var label = 'Thinking...';
155
+ for (var pi = phases.length - 1; pi >= 0; pi--) { if (ms >= phases[pi][0]) { label = phases[pi][1]; break; } }
156
+ var secs = Math.floor(ms / 1000);
157
+ html += '<div style="margin-top:' + (text ? '6px' : '0') + ';display:flex;align-items:center;gap:6px"><span style="color:var(--muted);font-size:11px">' + label + '</span>' + dotPulse + '<span style="margin-left:auto;font-size:10px;color:var(--muted)">' + secs + 's</span>' +
158
+ '<button onclick="ccAbort()" style="font-size:9px;padding:2px 8px;background:var(--surface2);border:1px solid var(--border);border-radius:4px;color:var(--red);cursor:pointer;margin-left:4px">Stop</button></div>';
159
+ return html;
160
+ }
161
+ ccAddMessage('assistant', _restoreStreamHtml(), true);
162
+ var restoreDiv = el.lastElementChild;
163
+ restoreDiv.id = 'cc-restore-thinking';
152
164
  el.scrollTop = el.scrollHeight;
153
- // Live update timer and phase
154
- var restoreStart = tab._sendStartedAt || Date.now();
155
165
  var restoreInterval = setInterval(function() {
156
- var phaseEl = document.getElementById('cc-restore-phase');
157
- var timeEl = document.getElementById('cc-restore-time');
158
- if (!phaseEl || !timeEl || !tab._sending) { clearInterval(restoreInterval); var re = document.getElementById('cc-restore-thinking'); if (re) re.remove(); return; }
159
- var ms = Date.now() - restoreStart;
160
- timeEl.textContent = Math.floor(ms / 1000) + 's';
161
- for (var p = phases.length - 1; p >= 0; p--) { if (ms >= phases[p][0]) { phaseEl.textContent = phases[p][1]; break; } }
166
+ var re = document.getElementById('cc-restore-thinking');
167
+ if (!re || !tab._sending) { clearInterval(restoreInterval); if (re) re.remove(); return; }
168
+ re.innerHTML = _restoreStreamHtml();
169
+ if (el.scrollHeight - el.scrollTop - el.clientHeight < 150) el.scrollTop = el.scrollHeight;
162
170
  }, 1000);
163
171
  }
164
172
  ccRenderTabBar();
@@ -450,8 +458,10 @@ async function _ccDoSend(message, skipUserMsg) {
450
458
  ];
451
459
 
452
460
  // Streaming state — declared before try so updateStreamDiv works during fetch
461
+ // Also saved on tab for restore when switching back
453
462
  var streamedText = '';
454
463
  var toolsUsed = [];
464
+ if (activeTab) { activeTab._streamedText = ''; activeTab._toolsUsed = []; }
455
465
 
456
466
  // Get active tab's sessionId to send with request
457
467
  var activeTab = _ccActiveTab();
@@ -528,9 +538,11 @@ async function _ccDoSend(message, skipUserMsg) {
528
538
  var evt = JSON.parse(line.slice(6));
529
539
  if (evt.type === 'chunk') {
530
540
  streamedText = evt.text;
541
+ if (activeTab) activeTab._streamedText = streamedText;
531
542
  updateStreamDiv();
532
543
  } else if (evt.type === 'tool') {
533
544
  toolsUsed.push(evt.name);
545
+ if (activeTab) activeTab._toolsUsed = toolsUsed.slice();
534
546
  updateStreamDiv();
535
547
  if (msgs.scrollHeight - msgs.scrollTop - msgs.clientHeight < 150) msgs.scrollTop = msgs.scrollHeight;
536
548
  } else if (evt.type === 'done') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.756",
3
+ "version": "0.1.758",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"