claude-tmux 1.0.4 → 1.0.6
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/dist/index.js +11 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64,29 +64,27 @@ async function waitForIdle(session) {
|
|
|
64
64
|
const startTime = Date.now();
|
|
65
65
|
let lastOutput = "";
|
|
66
66
|
let idleCount = 0;
|
|
67
|
-
|
|
67
|
+
// Initial delay to let Claude start working
|
|
68
|
+
await sleep(5000);
|
|
68
69
|
while (Date.now() - startTime < timeout) {
|
|
69
70
|
await sleep(2000);
|
|
70
71
|
try {
|
|
71
72
|
const output = runTmux(`capture-pane -t "${session}" -p -S -${lines}`);
|
|
72
|
-
// If busy,
|
|
73
|
+
// If busy, reset idle count and continue polling
|
|
73
74
|
if (isBusy(output)) {
|
|
74
|
-
sawBusy = true;
|
|
75
75
|
lastOutput = output;
|
|
76
76
|
idleCount = 0;
|
|
77
77
|
continue;
|
|
78
78
|
}
|
|
79
|
-
// Check for
|
|
80
|
-
if (isDone(output)
|
|
79
|
+
// Check for explicit done signal
|
|
80
|
+
if (isDone(output)) {
|
|
81
81
|
return filterUIChrome(output);
|
|
82
82
|
}
|
|
83
|
-
// Not busy
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return filterUIChrome(output);
|
|
89
|
-
}
|
|
83
|
+
// Not busy - count consecutive idle polls
|
|
84
|
+
// After 2 consecutive non-busy polls, consider done
|
|
85
|
+
idleCount++;
|
|
86
|
+
if (idleCount >= 2) {
|
|
87
|
+
return filterUIChrome(output);
|
|
90
88
|
}
|
|
91
89
|
lastOutput = output;
|
|
92
90
|
}
|
|
@@ -98,7 +96,7 @@ async function waitForIdle(session) {
|
|
|
98
96
|
}
|
|
99
97
|
const server = new McpServer({
|
|
100
98
|
name: "claude-tmux",
|
|
101
|
-
version: "1.0.
|
|
99
|
+
version: "1.0.6",
|
|
102
100
|
}, {
|
|
103
101
|
instructions: `# claude-tmux: Autonomous Claude Agents
|
|
104
102
|
|