claude-tmux 1.0.6 → 1.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -23,17 +23,8 @@ function sleep(ms) {
23
23
  return new Promise(resolve => setTimeout(resolve, ms));
24
24
  }
25
25
  function isBusy(output) {
26
- // Claude shows these patterns when actively working
27
- const busyPatterns = [
28
- 'ctrl+c to interrupt',
29
- 'esc to interrupt',
30
- ];
31
- for (const pattern of busyPatterns) {
32
- if (output.includes(pattern)) {
33
- return true;
34
- }
35
- }
36
- return false;
26
+ // Claude shows "(ctrl+c to interrupt" when actively working
27
+ return output.includes('(ctrl+c to interrupt');
37
28
  }
38
29
  function isDone(output) {
39
30
  // Claude shows "✻ [verb] for [duration]" when task completes
@@ -62,17 +53,16 @@ async function waitForIdle(session) {
62
53
  const timeout = 600000; // 10 minutes
63
54
  const lines = 100; // Capture more lines to catch done signal
64
55
  const startTime = Date.now();
65
- let lastOutput = "";
66
56
  let idleCount = 0;
57
+ let output = "";
67
58
  // Initial delay to let Claude start working
68
59
  await sleep(5000);
69
60
  while (Date.now() - startTime < timeout) {
70
61
  await sleep(2000);
71
62
  try {
72
- const output = runTmux(`capture-pane -t "${session}" -p -S -${lines}`);
63
+ output = runTmux(`capture-pane -t "${session}" -p -S -${lines}`);
73
64
  // If busy, reset idle count and continue polling
74
65
  if (isBusy(output)) {
75
- lastOutput = output;
76
66
  idleCount = 0;
77
67
  continue;
78
68
  }
@@ -86,17 +76,16 @@ async function waitForIdle(session) {
86
76
  if (idleCount >= 2) {
87
77
  return filterUIChrome(output);
88
78
  }
89
- lastOutput = output;
90
79
  }
91
80
  catch (e) {
92
81
  return `Error: ${e.message}`;
93
82
  }
94
83
  }
95
- return `Timeout after 10 minutes. Session still running.\n\n${filterUIChrome(lastOutput)}`;
84
+ return `Timeout after 10 minutes. Session still running.\n\n${filterUIChrome(output)}`;
96
85
  }
97
86
  const server = new McpServer({
98
87
  name: "claude-tmux",
99
- version: "1.0.6",
88
+ version: "1.0.8",
100
89
  }, {
101
90
  instructions: `# claude-tmux: Autonomous Claude Agents
102
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-tmux",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "MCP server for orchestrating multiple Claude Code instances via tmux",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",