@yemi33/minions 0.1.256 → 0.1.258

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,17 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.256 (2026-04-03)
3
+ ## 0.1.258 (2026-04-03)
4
+
5
+ ### Fixes
6
+ - remove last evaluate references — eval loop now creates review items
7
+
8
+ ## 0.1.257 (2026-04-03)
4
9
 
5
10
  ### Features
6
11
  - streaming CC responses — text appears as it arrives via SSE
7
12
 
8
13
  ### Fixes
14
+ - streaming CC handler now has full parity with non-streaming
9
15
  - remove dead 'data.actions' code from streaming CC path — caused ReferenceError
10
16
  - CC messages no longer show as "queued" after page refresh
11
17
 
package/dashboard.js CHANGED
@@ -2994,36 +2994,57 @@ What would you like to discuss or change? When you're happy, say "approve" and I
2994
2994
 
2995
2995
  res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' });
2996
2996
 
2997
- const sessionId = ccSessionValid() ? ccSession.sessionId : null;
2998
- const preamble = buildCCStatePreamble();
2999
- const prompt = preamble + '\n\n---\n\n' + body.message;
3000
-
3001
- const { callLLMStreaming, trackEngineUsage: trackUsage } = require('./engine/llm');
3002
- const result = await callLLMStreaming(prompt, CC_STATIC_SYSTEM_PROMPT, {
3003
- timeout: 900000, label: 'command-center', model: 'sonnet', maxTurns: 50,
3004
- allowedTools: 'Bash,Read,Write,Edit,Glob,Grep,WebFetch,WebSearch',
3005
- sessionId,
3006
- onChunk: (text) => {
3007
- try { res.write('data: ' + JSON.stringify({ type: 'chunk', text }) + '\n\n'); } catch {}
2997
+ try {
2998
+ // Session management — same as non-streaming path
2999
+ if (body.sessionId && body.sessionId !== ccSession.sessionId) {
3000
+ ccSession = { sessionId: null, createdAt: null, lastActiveAt: null, turnCount: 0 };
3008
3001
  }
3009
- });
3010
- trackUsage('command-center', result.usage);
3002
+ const wasResume = !!(ccSessionValid() && ccSession.sessionId);
3003
+ const sessionId = wasResume ? ccSession.sessionId : null;
3004
+ const preamble = buildCCStatePreamble();
3005
+ const prompt = preamble + '\n\n---\n\n' + body.message;
3006
+
3007
+ const { callLLMStreaming, trackEngineUsage: trackUsage } = require('./engine/llm');
3008
+ const result = await callLLMStreaming(prompt, CC_STATIC_SYSTEM_PROMPT, {
3009
+ timeout: 900000, label: 'command-center', model: 'sonnet', maxTurns: 50,
3010
+ allowedTools: 'Bash,Read,Write,Edit,Glob,Grep,WebFetch,WebSearch',
3011
+ sessionId,
3012
+ onChunk: (text) => {
3013
+ try { res.write('data: ' + JSON.stringify({ type: 'chunk', text }) + '\n\n'); } catch {}
3014
+ }
3015
+ });
3016
+ trackUsage('command-center', result.usage);
3011
3017
 
3012
- // Update session
3013
- const now = Date.now();
3014
- if (result.sessionId) {
3015
- ccSession = { sessionId: result.sessionId, createdAt: ccSession.createdAt || now, lastActiveAt: now, turnCount: (ccSession.turnCount || 0) + 1 };
3016
- safeWrite(path.join(ENGINE_DIR, 'cc-session.json'), ccSession);
3017
- }
3018
+ // Handle failure — same error reporting as non-streaming
3019
+ if (result.code !== 0 || !result.text) {
3020
+ const debugInfo = result.code !== 0 ? `(exit code ${result.code})` : '(empty response)';
3021
+ const stderrTail = (result.stderr || '').trim().split('\n').filter(Boolean).slice(-3).join(' | ');
3022
+ const retryHint = ccSession.sessionId
3023
+ ? 'Your session is still active — just send your message again to retry.'
3024
+ : 'Try clicking **New Session** and sending your message again.';
3025
+ res.write('data: ' + JSON.stringify({ type: 'done', text: `I had trouble processing that ${debugInfo}. ${stderrTail ? 'Detail: ' + stderrTail : ''}\n\n${retryHint}`, actions: [], sessionId: ccSession.sessionId }) + '\n\n');
3026
+ res.end();
3027
+ return;
3028
+ }
3018
3029
 
3019
- // Send final result with actions
3020
- const { text: displayText, actions } = parseCCActions(result.text);
3021
- res.write('data: ' + JSON.stringify({ type: 'done', text: displayText, actions, sessionId: ccSession.sessionId }) + '\n\n');
3022
- res.end();
3023
- ccInFlight = false;
3024
- ccInFlightSince = 0;
3030
+ // Update session
3031
+ const now = Date.now();
3032
+ if (result.sessionId) {
3033
+ ccSession = { sessionId: result.sessionId, createdAt: ccSession.createdAt || now, lastActiveAt: now, turnCount: (ccSession.turnCount || 0) + 1 };
3034
+ safeWrite(path.join(ENGINE_DIR, 'cc-session.json'), ccSession);
3035
+ }
3036
+
3037
+ // Send final result with actions
3038
+ const { text: displayText, actions } = parseCCActions(result.text);
3039
+ res.write('data: ' + JSON.stringify({ type: 'done', text: displayText, actions, sessionId: ccSession.sessionId, newSession: !wasResume }) + '\n\n');
3040
+ res.end();
3041
+ } finally {
3042
+ ccInFlight = false;
3043
+ ccInFlightSince = 0;
3044
+ }
3025
3045
  } catch (e) {
3026
3046
  ccInFlight = false;
3047
+ ccInFlightSince = 0;
3027
3048
  try { res.write('data: ' + JSON.stringify({ type: 'error', error: e.message }) + '\n\n'); } catch {}
3028
3049
  try { res.end(); } catch {}
3029
3050
  }
@@ -1266,8 +1266,8 @@ function runPostCompletionHooks(dispatchItem, agentId, code, stdout, config) {
1266
1266
  mutateJsonFileLocked(wiPath, (items) => {
1267
1267
  // For fix items, target the original implement parent; for implement, target self
1268
1268
  const evalTargetId = type === 'fix' ? meta.item._evalParentId : meta.item.id;
1269
- // Dedup: skip if an evaluate item already exists for this parent
1270
- const existing = items.find(i => i._evalParentId === evalTargetId && i.type === 'evaluate' && i.status === 'pending');
1269
+ // Dedup: skip if a review item already exists for this parent
1270
+ const existing = items.find(i => i._evalParentId === evalTargetId && i.type === 'review' && i.status === 'pending');
1271
1271
  if (existing) {
1272
1272
  log('info', `Eval loop: evaluate item ${existing.id} already exists for ${evalTargetId}, skipping`);
1273
1273
  return items;
@@ -1276,7 +1276,7 @@ function runPostCompletionHooks(dispatchItem, agentId, code, stdout, config) {
1276
1276
  const evalItem = {
1277
1277
  id: 'W-' + shared.uid(),
1278
1278
  title: `Evaluate: ${parentItem?.title || meta.item.title || evalTargetId}`,
1279
- type: 'evaluate',
1279
+ type: 'review',
1280
1280
  priority: meta.item.priority || 'high',
1281
1281
  status: 'pending',
1282
1282
  created: ts(),
@@ -1302,7 +1302,7 @@ function runPostCompletionHooks(dispatchItem, agentId, code, stdout, config) {
1302
1302
  }
1303
1303
 
1304
1304
  // Evaluate completion: parse verdict and handle eval→fix iteration loop
1305
- if (isSuccess && type === 'evaluate' && meta?.item?._evalParentId) {
1305
+ if (isSuccess && type === 'review' && meta?.item?._evalParentId) {
1306
1306
  try {
1307
1307
  const verdict = parseEvalVerdict(resultSummary || stdout);
1308
1308
  const evalLoop = config.engine?.evalLoop ?? shared.ENGINE_DEFAULTS.evalLoop;
@@ -481,7 +481,7 @@ function selectPlaybook(workType, item) {
481
481
  if (workType === 'review' && !item?._pr && !item?.pr_id) {
482
482
  return 'work-item';
483
483
  }
484
- const typeSpecificPlaybooks = ['explore', 'review', 'test', 'plan-to-prd', 'plan', 'ask', 'verify', 'decompose', 'evaluate', 'meeting-investigate', 'meeting-debate', 'meeting-conclude'];
484
+ const typeSpecificPlaybooks = ['explore', 'review', 'test', 'plan-to-prd', 'plan', 'ask', 'verify', 'decompose', 'meeting-investigate', 'meeting-debate', 'meeting-conclude'];
485
485
  return typeSpecificPlaybooks.includes(workType) ? workType : 'work-item';
486
486
  }
487
487
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.256",
3
+ "version": "0.1.258",
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"