@yemi33/minions 0.1.264 → 0.1.266

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,6 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.264 (2026-04-03)
3
+ ## 0.1.266 (2026-04-03)
4
+
5
+ ### Features
6
+ - CC streaming shows cumulative tool list with loading dots
7
+
8
+ ## 0.1.265 (2026-04-03)
9
+
10
+ ### Features
11
+ - CC streaming shows tool use activity during multi-turn responses
4
12
 
5
13
  ### Fixes
6
14
  - clean up remaining evaluate references in comments and log messages
@@ -198,6 +198,26 @@ async function _ccDoSend(message, skipUserMsg) {
198
198
  const msgs = document.getElementById('cc-messages');
199
199
  const streamDiv = msgs.lastElementChild; // the message we just added
200
200
  let streamedText = '';
201
+ let toolsUsed = [];
202
+ 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>';
203
+ function updateStreamDiv() {
204
+ var html = '';
205
+ if (toolsUsed.length > 0) {
206
+ html += '<div style="margin-bottom:' + (streamedText ? '6px' : '0') + '">';
207
+ toolsUsed.forEach(function(t, i) {
208
+ var isLast = i === toolsUsed.length - 1 && !streamedText;
209
+ html += '<div style="color:var(--blue);font-size:11px">\uD83D\uDD27 ' + escHtml(t) + (isLast ? dotPulse : '') + '</div>';
210
+ });
211
+ html += '</div>';
212
+ }
213
+ if (streamedText) {
214
+ html += renderMd(streamedText);
215
+ } else if (toolsUsed.length === 0) {
216
+ html += '<span style="color:var(--muted);font-size:11px">Thinking...' + dotPulse + '</span>';
217
+ }
218
+ streamDiv.innerHTML = html;
219
+ if (msgs.scrollHeight - msgs.scrollTop - msgs.clientHeight < 150) msgs.scrollTop = msgs.scrollHeight;
220
+ }
201
221
 
202
222
  const reader = res.body.getReader();
203
223
  const decoder = new TextDecoder();
@@ -215,7 +235,10 @@ async function _ccDoSend(message, skipUserMsg) {
215
235
  const evt = JSON.parse(line.slice(6));
216
236
  if (evt.type === 'chunk') {
217
237
  streamedText = evt.text;
218
- streamDiv.innerHTML = renderMd(streamedText);
238
+ updateStreamDiv();
239
+ } else if (evt.type === 'tool') {
240
+ toolsUsed.push(evt.name);
241
+ updateStreamDiv();
219
242
  if (msgs.scrollHeight - msgs.scrollTop - msgs.clientHeight < 150) msgs.scrollTop = msgs.scrollHeight;
220
243
  } else if (evt.type === 'done') {
221
244
  // Replace streaming div with a proper ccAddMessage
package/dashboard.js CHANGED
@@ -3013,6 +3013,9 @@ What would you like to discuss or change? When you're happy, say "approve" and I
3013
3013
  sessionId,
3014
3014
  onChunk: (text) => {
3015
3015
  try { res.write('data: ' + JSON.stringify({ type: 'chunk', text }) + '\n\n'); } catch {}
3016
+ },
3017
+ onToolUse: (name, input) => {
3018
+ try { res.write('data: ' + JSON.stringify({ type: 'tool', name, input: typeof input === 'string' ? input.slice(0, 200) : JSON.stringify(input).slice(0, 200) }) + '\n\n'); } catch {}
3016
3019
  }
3017
3020
  });
3018
3021
  trackUsage('command-center', result.usage);
package/engine/llm.js CHANGED
@@ -113,7 +113,7 @@ function isResumeSessionStillValid(result) {
113
113
  * Returns the same result object as callLLM when the process completes.
114
114
  * onChunk(text) is called for each assistant text block as it arrives.
115
115
  */
116
- function callLLMStreaming(promptText, sysPromptText, { timeout = 120000, label = 'llm', model = 'sonnet', maxTurns = 1, allowedTools = '', sessionId = null, onChunk = () => {} } = {}) {
116
+ function callLLMStreaming(promptText, sysPromptText, { timeout = 120000, label = 'llm', model = 'sonnet', maxTurns = 1, allowedTools = '', sessionId = null, onChunk = () => {}, onToolUse = null } = {}) {
117
117
  return new Promise((resolve) => {
118
118
  const id = uid();
119
119
  const tmpDir = path.join(ENGINE_DIR, 'tmp');
@@ -162,18 +162,21 @@ function callLLMStreaming(promptText, sysPromptText, { timeout = 120000, label =
162
162
  }
163
163
  } catch { /* incomplete JSON or non-JSON line */ }
164
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);
165
+ // Also emit tool_use events so the frontend can show "Using tool: Read..."
166
+ for (const line of lines) {
167
+ const trimmed = line.trim();
168
+ if (!trimmed || !trimmed.startsWith('{')) continue;
169
+ try {
170
+ const obj = JSON.parse(trimmed);
171
+ if (obj.type === 'assistant' && obj.message?.content) {
172
+ for (const block of obj.message.content) {
173
+ if (block.type === 'tool_use' && block.name && onToolUse) {
174
+ onToolUse(block.name, block.input);
175
+ }
176
+ }
174
177
  }
175
- }
176
- } catch { /* best-effort partial extraction */ }
178
+ } catch {}
179
+ }
177
180
  });
178
181
  proc.stderr.on('data', d => { stderr += d.toString(); });
179
182
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.264",
3
+ "version": "0.1.266",
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"