@yemi33/minions 0.1.259 → 0.1.260
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 +4 -1
- package/engine/llm.js +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
|
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.
|
|
3
|
+
"version": "0.1.260",
|
|
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"
|