@yemi33/minions 0.1.267 → 0.1.269

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.267 (2026-04-03)
3
+ ## 0.1.269 (2026-04-03)
4
4
 
5
5
  ### Features
6
6
  - CC streaming shows cumulative tool list with loading dots
7
7
 
8
8
  ### Fixes
9
+ - streaming CC was popping user messages from _ccMessages
10
+ - process remaining SSE buffer after stream ends + fallback finalization
9
11
  - Thinking... indicator shows alongside tool calls until text arrives
10
12
  - use safeJson instead of JSON.parse(safeRead()) in trigger-verify handler
11
13
 
@@ -242,7 +242,7 @@ async function _ccDoSend(message, skipUserMsg) {
242
242
  } else if (evt.type === 'done') {
243
243
  // Replace streaming div with a proper ccAddMessage
244
244
  streamDiv.remove();
245
- _ccMessages.pop(); // remove the placeholder we pushed
245
+ // placeholder was added with skipSave=true — nothing to pop
246
246
  const ccElapsed = Math.round((Date.now() - ccStartTime) / 1000);
247
247
  const rendered = renderMd(evt.text || streamedText || '');
248
248
  ccAddMessage('assistant', rendered + '<div style="font-size:9px;color:var(--muted);margin-top:6px;display:flex;justify-content:flex-end;padding-right:30px">' + ccElapsed + 's</div>');
@@ -252,12 +252,43 @@ async function _ccDoSend(message, skipUserMsg) {
252
252
  }
253
253
  } else if (evt.type === 'error') {
254
254
  streamDiv.remove();
255
- _ccMessages.pop();
255
+ // placeholder was skipSave — no pop needed
256
256
  ccAddMessage('assistant', '<span style="color:var(--red)">' + escHtml(evt.error) + '</span>');
257
257
  }
258
258
  } catch { /* incomplete JSON */ }
259
259
  }
260
260
  }
261
+ // Process any remaining buffered data after stream ends
262
+ if (buf.trim()) {
263
+ for (const line of buf.split('\n')) {
264
+ if (!line.startsWith('data: ')) continue;
265
+ try {
266
+ const evt = JSON.parse(line.slice(6));
267
+ if (evt.type === 'done') {
268
+ streamDiv.remove();
269
+ // placeholder was skipSave — no pop needed
270
+ const ccElapsed = Math.round((Date.now() - ccStartTime) / 1000);
271
+ const rendered = renderMd(evt.text || streamedText || '');
272
+ ccAddMessage('assistant', rendered + '<div style="font-size:9px;color:var(--muted);margin-top:6px;display:flex;justify-content:flex-end;padding-right:30px">' + ccElapsed + 's</div>');
273
+ if (evt.sessionId) { _ccSessionId = evt.sessionId; ccSaveState(); ccUpdateSessionIndicator(); }
274
+ if (evt.actions && evt.actions.length > 0) {
275
+ for (const action of evt.actions) { await ccExecuteAction(action); }
276
+ }
277
+ } else if (evt.type === 'chunk') {
278
+ streamedText = evt.text;
279
+ updateStreamDiv();
280
+ }
281
+ } catch {}
282
+ }
283
+ }
284
+ // If stream ended without a 'done' event, finalize with whatever we have
285
+ if (streamDiv.parentNode) {
286
+ streamDiv.remove();
287
+ if (streamedText) {
288
+ const ccElapsed = Math.round((Date.now() - ccStartTime) / 1000);
289
+ ccAddMessage('assistant', renderMd(streamedText) + '<div style="font-size:9px;color:var(--muted);margin-top:6px;display:flex;justify-content:flex-end;padding-right:30px">' + ccElapsed + 's</div>');
290
+ }
291
+ }
261
292
  } catch (e) {
262
293
  clearInterval(ccTimer);
263
294
  try { thinking.remove(); } catch { /* may already be removed */ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.267",
3
+ "version": "0.1.269",
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"