claude-tmux 1.0.15 → 1.0.16
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 +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { writeFileSync } from "fs";
|
|
|
8
8
|
const SESSION_PREFIX = "claude-";
|
|
9
9
|
const TIMEOUT_MS = 900000; // 15 minutes
|
|
10
10
|
const POLL_INTERVAL_MS = 2000; // 2 seconds
|
|
11
|
-
const INITIAL_DELAY_MS =
|
|
11
|
+
const INITIAL_DELAY_MS = 10000; // 10 seconds
|
|
12
12
|
const CAPTURE_LINES = 100;
|
|
13
13
|
const IDLE_THRESHOLD = 5; // consecutive idle polls
|
|
14
14
|
function runTmux(args) {
|
|
@@ -43,8 +43,9 @@ function isBusy(output) {
|
|
|
43
43
|
}
|
|
44
44
|
function isDone(output) {
|
|
45
45
|
// Claude shows "✻ [verb] for [duration]" when task completes
|
|
46
|
-
// e.g., "✻ Baked for 1m 35s", "✻
|
|
47
|
-
|
|
46
|
+
// e.g., "✻ Baked for 1m 35s", "✻ Sautéed for 2m 10s"
|
|
47
|
+
// Use \S+ instead of \w+ to support Unicode characters like é
|
|
48
|
+
return /✻\s+\S+\s+for\s+\d+[ms]/.test(output);
|
|
48
49
|
}
|
|
49
50
|
function filterUIChrome(output) {
|
|
50
51
|
const lines = output.split('\n');
|
|
@@ -128,10 +129,10 @@ server.tool("spawn", "Start a Claude Code instance in a tmux session.", {
|
|
|
128
129
|
}
|
|
129
130
|
const tempFile = `/tmp/claude-prompt-${session}.txt`;
|
|
130
131
|
writeFileSync(tempFile, prompt);
|
|
131
|
-
runTmux(`send-keys -t "${session}" 'claude --dangerously-skip-permissions
|
|
132
|
+
runTmux(`send-keys -t "${session}" 'cat ${tempFile} | claude --dangerously-skip-permissions && rm ${tempFile}' Enter`);
|
|
132
133
|
return response(`Started ${session}`);
|
|
133
134
|
});
|
|
134
|
-
server.tool("read", "Wait for a session to finish and return output.", {
|
|
135
|
+
server.tool("read", "Wait for a Claude session to finish working and return the terminal output. You can continue other work while waiting.", {
|
|
135
136
|
name: z.string().describe("Session name (as provided to spawn)"),
|
|
136
137
|
}, async ({ name }) => {
|
|
137
138
|
const session = sessionName(name);
|