@yemi33/minions 0.1.281 → 0.1.283

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,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.283 (2026-04-03)
4
+
5
+ ### Fixes
6
+ - thinking indicator layout — text ... dots ... elapsed time right-aligned
7
+ - thinking indicator shows immediately when user sends message
8
+
3
9
  ## 0.1.281 (2026-04-03)
4
10
 
5
11
  ### Other
@@ -165,37 +165,23 @@ async function _ccDoSend(message, skipUserMsg) {
165
165
  [300000, 'Timing out soon...'],
166
166
  ];
167
167
 
168
- try {
169
- // Stream response via SSE — shows text as it arrives
170
- const res = await fetch('/api/command-center/stream', {
171
- method: 'POST', headers: { 'Content-Type': 'application/json' },
172
- body: JSON.stringify({ message }),
173
- signal: _ccAbortController ? _ccAbortController.signal : AbortSignal.timeout(960000)
174
- });
175
-
176
- if (!res.ok) {
177
- const errText = await res.text();
178
- ccAddMessage('assistant', '<span style="color:var(--red)">' + escHtml(errText || 'CC error') + '</span>' +
179
- (errText.includes('busy') ? ' <button onclick="ccNewSession()" style="margin-top:4px;padding:3px 10px;background:var(--surface2);border:1px solid var(--border);border-radius:4px;color:var(--blue);cursor:pointer;font-size:10px">Reset CC</button>' : ''));
180
- return;
181
- }
168
+ // Streaming state — declared before try so updateStreamDiv works during fetch
169
+ let streamedText = '';
170
+ let toolsUsed = [];
182
171
 
183
- // Use a temporary streaming div for live updates, then replace with ccAddMessage on completion
184
- // Add a temporary placeholder via ccAddMessage so it gets proper styling
185
- ccAddMessage('assistant', '<span style="color:var(--muted);font-size:11px">Thinking...</span>', true);
186
- const msgs = document.getElementById('cc-messages');
187
- const streamDiv = msgs.lastElementChild; // the message we just added
188
- let streamedText = '';
189
- let toolsUsed = [];
172
+ // Show thinking immediately before fetch starts
173
+ ccAddMessage('assistant', '<span style="color:var(--muted);font-size:11px">Thinking...</span>', true);
174
+ const msgs = document.getElementById('cc-messages');
175
+ const streamDiv = msgs.lastElementChild;
190
176
  const 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>';
191
- function _getThinkingPhase() {
177
+ function _getThinkingHtml() {
192
178
  var elapsed = Date.now() - ccStartTime;
193
179
  var label = 'Thinking...';
194
180
  for (var pi = phases.length - 1; pi >= 0; pi--) {
195
181
  if (elapsed >= phases[pi][0]) { label = phases[pi][1]; break; }
196
182
  }
197
183
  var secs = Math.floor(elapsed / 1000);
198
- return label + ' <span style="font-size:9px;color:var(--border)">' + secs + 's</span>';
184
+ return '<div style="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></div>';
199
185
  }
200
186
  function updateStreamDiv() {
201
187
  var html = '';
@@ -209,16 +195,31 @@ async function _ccDoSend(message, skipUserMsg) {
209
195
  if (streamedText) {
210
196
  html += renderMd(streamedText);
211
197
  }
212
- html += '<div style="margin-top:' + (streamedText ? '6px' : '0') + '"><span style="color:var(--muted);font-size:11px">' + _getThinkingPhase() + dotPulse + '</span></div>';
198
+ html += '<div style="margin-top:' + (streamedText ? '6px' : '0') + '">' + _getThinkingHtml() + '</div>';
213
199
  streamDiv.innerHTML = html;
214
200
  // Re-append queue indicators so they stay below the streaming content
215
201
  if (_ccQueue.length > 0) _renderQueueIndicator();
216
202
  if (msgs.scrollHeight - msgs.scrollTop - msgs.clientHeight < 150) msgs.scrollTop = msgs.scrollHeight;
217
203
  }
218
-
219
- // Periodically update thinking phase text + timer
204
+ // Start phase timer immediately so thinking text updates while waiting for SSE
220
205
  const phaseTimer = setInterval(updateStreamDiv, 1000);
221
206
 
207
+ try {
208
+ // Stream response via SSE — shows text as it arrives
209
+ const res = await fetch('/api/command-center/stream', {
210
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
211
+ body: JSON.stringify({ message }),
212
+ signal: _ccAbortController ? _ccAbortController.signal : AbortSignal.timeout(960000)
213
+ });
214
+
215
+ if (!res.ok) {
216
+ clearInterval(phaseTimer); streamDiv.remove();
217
+ const errText = await res.text();
218
+ ccAddMessage('assistant', '<span style="color:var(--red)">' + escHtml(errText || 'CC error') + '</span>' +
219
+ (errText.includes('busy') ? ' <button onclick="ccNewSession()" style="margin-top:4px;padding:3px 10px;background:var(--surface2);border:1px solid var(--border);border-radius:4px;color:var(--blue);cursor:pointer;font-size:10px">Reset CC</button>' : ''));
220
+ return;
221
+ }
222
+
222
223
  const reader = res.body.getReader();
223
224
  const decoder = new TextDecoder();
224
225
  let buf = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.281",
3
+ "version": "0.1.283",
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"