orchestrix-yuri 4.7.9 → 4.7.11
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/lib/gateway/router.js +29 -16
- package/package.json +1 -1
package/lib/gateway/router.js
CHANGED
|
@@ -33,10 +33,11 @@ const META_COMMANDS = {
|
|
|
33
33
|
switch: /^\*switch\s+(.+)/i,
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
// Only explicit *status command bypasses dispatcher.
|
|
37
|
+
// All natural language ("怎么样了", "进度如何") goes through dispatcher
|
|
38
|
+
// so Claude's understanding ability decides the routing.
|
|
36
39
|
const STATUS_PATTERNS = [
|
|
37
40
|
/^\*status\b/i,
|
|
38
|
-
/进度|状态|怎么样了|到哪了/,
|
|
39
|
-
/\bstatus\b|\bprogress\b/i,
|
|
40
41
|
];
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -361,16 +362,10 @@ class Router {
|
|
|
361
362
|
case 'iterate':
|
|
362
363
|
case 'deploy':
|
|
363
364
|
return this._handlePhaseCommand(classified.action, msg);
|
|
364
|
-
case 'status':
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
|
|
368
|
-
const decisionRe = /决策|决定|确认|需要我|block|decide|should i|approve/i;
|
|
369
|
-
if (agentRe.test(msg.text) || decisionRe.test(msg.text)) {
|
|
370
|
-
return null; // → conversation handler (Claude with tmux context)
|
|
371
|
-
}
|
|
372
|
-
return this._handleStatusQuery(msg);
|
|
373
|
-
}
|
|
365
|
+
case 'status':
|
|
366
|
+
// All dispatcher-classified status queries go through Claude conversation
|
|
367
|
+
// with tmux context. Canned status card is only for explicit *status command.
|
|
368
|
+
return null; // → conversation handler (Claude with tmux context)
|
|
374
369
|
default:
|
|
375
370
|
return null;
|
|
376
371
|
}
|
|
@@ -480,8 +475,13 @@ class Router {
|
|
|
480
475
|
tmx.sendKeysWithEnter(session, matched.window, `/o ${matched.slug}`);
|
|
481
476
|
execSync('sleep 12');
|
|
482
477
|
|
|
483
|
-
//
|
|
484
|
-
|
|
478
|
+
// Clean description: strip [CONTEXT] prefix injected by dispatcher
|
|
479
|
+
let cleanDesc = description;
|
|
480
|
+
const ctxMatch = cleanDesc.match(/\[CONTEXT\].*?(?:User message:\s*)?(.+)/s);
|
|
481
|
+
if (ctxMatch) cleanDesc = ctxMatch[1].trim();
|
|
482
|
+
if (!cleanDesc) cleanDesc = description;
|
|
483
|
+
|
|
484
|
+
const safeDesc = cleanDesc.replace(/"/g, '\\"');
|
|
485
485
|
tmx.sendKeysWithEnter(session, matched.window, safeDesc);
|
|
486
486
|
|
|
487
487
|
// Set up polling via orchestrator (reuses change/small flow)
|
|
@@ -505,7 +505,20 @@ class Router {
|
|
|
505
505
|
if (this.orchestrator._timer) { clearInterval(this.orchestrator._timer); this.orchestrator._timer = null; }
|
|
506
506
|
this.orchestrator._phase = null;
|
|
507
507
|
this.orchestrator._changeContext = null;
|
|
508
|
-
|
|
508
|
+
|
|
509
|
+
// Capture agent output for a meaningful completion summary
|
|
510
|
+
let summary = `✅ **${matched.slug}** completed the task.`;
|
|
511
|
+
try {
|
|
512
|
+
const pane = tmx.capturePane(session, matched.window, 30);
|
|
513
|
+
const outputLines = pane.split('\n').filter((l) => l.trim() && !/^❯/.test(l.trim()));
|
|
514
|
+
if (outputLines.length > 0) {
|
|
515
|
+
const tail = outputLines.slice(-8).map((l) => l.trim()).join('\n');
|
|
516
|
+
summary += `\n\n📋 Output (last lines):\n${tail}`;
|
|
517
|
+
}
|
|
518
|
+
} catch { /* ok */ }
|
|
519
|
+
summary += `\n\n💡 Suggested next: review the output, then tell me what to do next (e.g., "让 dev 开始实现" or "*develop").`;
|
|
520
|
+
|
|
521
|
+
this.orchestrator.onComplete('change', summary);
|
|
509
522
|
return;
|
|
510
523
|
}
|
|
511
524
|
if (check.status !== 'stable') { this.orchestrator._stableCount = 0; this.orchestrator._lastHash = check.hash || ''; }
|
|
@@ -513,7 +526,7 @@ class Router {
|
|
|
513
526
|
}, pollInterval);
|
|
514
527
|
|
|
515
528
|
this.history.append(msg.chatId, 'user', msg.text);
|
|
516
|
-
const reply = `🎯 Direct → **${matched.slug}
|
|
529
|
+
const reply = `🎯 Direct → **${matched.slug}**\n\n"${cleanDesc.slice(0, 120)}"\n\nI'll notify you when done.`;
|
|
517
530
|
this.history.append(msg.chatId, 'assistant', reply);
|
|
518
531
|
this._updateGlobalFocus(msg, projectRoot);
|
|
519
532
|
|