@yemi33/minions 0.1.264 → 0.1.265

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,9 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.264 (2026-04-03)
3
+ ## 0.1.265 (2026-04-03)
4
+
5
+ ### Features
6
+ - CC streaming shows tool use activity during multi-turn responses
4
7
 
5
8
  ### Fixes
6
9
  - clean up remaining evaluate references in comments and log messages
@@ -217,6 +217,9 @@ async function _ccDoSend(message, skipUserMsg) {
217
217
  streamedText = evt.text;
218
218
  streamDiv.innerHTML = renderMd(streamedText);
219
219
  if (msgs.scrollHeight - msgs.scrollTop - msgs.clientHeight < 150) msgs.scrollTop = msgs.scrollHeight;
220
+ } else if (evt.type === 'tool') {
221
+ streamDiv.innerHTML = '<span style="color:var(--blue);font-size:11px">\uD83D\uDD27 Using ' + escHtml(evt.name) + '...</span>';
222
+ if (msgs.scrollHeight - msgs.scrollTop - msgs.clientHeight < 150) msgs.scrollTop = msgs.scrollHeight;
220
223
  } else if (evt.type === 'done') {
221
224
  // Replace streaming div with a proper ccAddMessage
222
225
  streamDiv.remove();
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.265",
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"