@yemi33/minions 0.1.259 → 0.1.261

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,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.259 (2026-04-03)
3
+ ## 0.1.261 (2026-04-03)
4
+
5
+ ### Features
6
+ - real-time token streaming for CC via partial JSON extraction
4
7
 
5
8
  ### Fixes
9
+ - streaming CC message bubble matches ccAddMessage styling
6
10
  - CC stream clears ccInFlight on client disconnect + defensive thinking.remove
7
11
  - remove last evaluate references — eval loop now creates review items
8
12
 
@@ -194,7 +194,8 @@ async function _ccDoSend(message, skipUserMsg) {
194
194
  clearInterval(ccTimer);
195
195
  try { thinking.remove(); } catch { /* may already be removed */ }
196
196
  const streamDiv = document.createElement('div');
197
- streamDiv.className = 'cc-msg assistant';
197
+ streamDiv.className = 'cc-msg-assistant';
198
+ streamDiv.style.cssText = 'padding:8px 12px;border-radius:8px;font-size:12px;line-height:1.6;max-width:95%;background:var(--surface2);color:var(--text);align-self:flex-start;border:1px solid var(--border);position:relative';
198
199
  streamDiv.innerHTML = '<span style="color:var(--muted);font-size:11px">Thinking...</span>';
199
200
  document.getElementById('cc-messages').appendChild(streamDiv);
200
201
  let streamedText = '';
package/engine/llm.js CHANGED
@@ -139,6 +139,7 @@ function callLLMStreaming(promptText, sysPromptText, { timeout = 120000, label =
139
139
  let stderr = '';
140
140
  let lineBuf = '';
141
141
 
142
+ let lastTextSent = '';
142
143
  proc.stdout.on('data', d => {
143
144
  const chunk = d.toString();
144
145
  stdout += chunk;
@@ -153,11 +154,26 @@ function callLLMStreaming(promptText, sysPromptText, { timeout = 120000, label =
153
154
  const obj = JSON.parse(trimmed);
154
155
  if (obj.type === 'assistant' && obj.message?.content) {
155
156
  for (const block of obj.message.content) {
156
- if (block.type === 'text' && block.text) onChunk(block.text);
157
+ if (block.type === 'text' && block.text && block.text !== lastTextSent) {
158
+ lastTextSent = block.text;
159
+ onChunk(block.text);
160
+ }
157
161
  }
158
162
  }
159
163
  } catch { /* incomplete JSON or non-JSON line */ }
160
164
  }
165
+ // Also try to extract partial text from incomplete line buffer (real-time streaming)
166
+ // Claude CLI writes large JSON objects incrementally — extract "text":"..." as it grows
167
+ try {
168
+ const textMatch = lineBuf.match(/"text"\s*:\s*"((?:[^"\\]|\\.)*)$/);
169
+ if (textMatch && textMatch[1].length > 20 && textMatch[1] !== lastTextSent) {
170
+ // Unescape basic JSON escapes for display
171
+ const partial = textMatch[1].replace(/\\n/g, '\n').replace(/\\"/g, '"').replace(/\\\\/g, '\\');
172
+ if (partial.length > lastTextSent.length) {
173
+ onChunk(partial);
174
+ }
175
+ }
176
+ } catch { /* best-effort partial extraction */ }
161
177
  });
162
178
  proc.stderr.on('data', d => { stderr += d.toString(); });
163
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.259",
3
+ "version": "0.1.261",
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"