orchestrix-yuri 4.2.1 → 4.2.2
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 +11 -5
- package/package.json +1 -1
package/lib/gateway/router.js
CHANGED
|
@@ -619,7 +619,12 @@ class Router {
|
|
|
619
619
|
const tmx = require('./engine/tmux-utils');
|
|
620
620
|
if (devSession && tmx.hasSession(devSession)) {
|
|
621
621
|
const windowNames = ['Architect', 'SM', 'Dev', 'QA'];
|
|
622
|
-
//
|
|
622
|
+
// Detect active agent: an agent showing the Command table or
|
|
623
|
+
// "How can I assist" is IDLE (waiting). A window WITHOUT these
|
|
624
|
+
// patterns is actively executing a task.
|
|
625
|
+
const idlePatterns = /Command.*Description|How can I assist|assist you today/i;
|
|
626
|
+
|
|
627
|
+
// Pass 1: find window with spinner (definitely working)
|
|
623
628
|
for (let w = 0; w < 4; w++) {
|
|
624
629
|
const pane = tmx.capturePane(devSession, w, 10);
|
|
625
630
|
if (/●|⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏/.test(pane)) {
|
|
@@ -628,12 +633,13 @@ class Router {
|
|
|
628
633
|
break;
|
|
629
634
|
}
|
|
630
635
|
}
|
|
631
|
-
|
|
636
|
+
|
|
637
|
+
// Pass 2: find window that is NOT idle (no Command table)
|
|
632
638
|
if (!currentAgent) {
|
|
633
639
|
for (let w = 0; w < 4; w++) {
|
|
634
|
-
const pane = tmx.capturePane(devSession, w,
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
640
|
+
const pane = tmx.capturePane(devSession, w, 15);
|
|
641
|
+
const hasContent = pane.split('\n').filter((l) => l.trim()).length > 2;
|
|
642
|
+
if (hasContent && !idlePatterns.test(pane)) {
|
|
637
643
|
currentAgent = windowNames[w];
|
|
638
644
|
currentWindow = w;
|
|
639
645
|
break;
|