@yemi33/minions 0.1.281 → 0.1.282

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.282 (2026-04-03)
4
+
5
+ ### Fixes
6
+ - thinking indicator shows immediately when user sends message
7
+
3
8
  ## 0.1.281 (2026-04-03)
4
9
 
5
10
  ### Other
@@ -165,28 +165,14 @@ 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
177
  function _getThinkingPhase() {
192
178
  var elapsed = Date.now() - ccStartTime;
@@ -215,10 +201,25 @@ async function _ccDoSend(message, skipUserMsg) {
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.282",
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"