@halfwhey/claudraband 0.5.0 → 0.6.0
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/README.md +3 -3
- package/dist/bin.js +5 -5
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ Claude Code for the power user
|
|
|
17
17
|
|
|
18
18
|
It provides:
|
|
19
19
|
|
|
20
|
-
- Resumable non-interactive workflows. Essentially claude -p with session support: cband continue <session-id> 'what was the result of the research?'
|
|
21
|
-
- An
|
|
20
|
+
- Resumable non-interactive workflows. Essentially `claude -p` with session support: `cband continue <session-id> 'what was the result of the research?'`
|
|
21
|
+
- An HTTP daemon for remote or headless session control
|
|
22
22
|
- An ACP server for editor and alternate frontend integration
|
|
23
23
|
- A TypeScript library for building these workflows into your own tools
|
|
24
24
|
|
|
@@ -73,7 +73,7 @@ cband continue <session-id> --select 2
|
|
|
73
73
|
|
|
74
74
|
The daemon defaults to using `tmux` as the terminal runtime, just like the local path. Use `--connect` only when creating a new daemon-backed session; after that, tracked `continue`, `attach`, and `sessions` route through the recorded live owner automatically.
|
|
75
75
|
|
|
76
|
-
## Experimental
|
|
76
|
+
## Experimental xterm.js Backend
|
|
77
77
|
|
|
78
78
|
`--backend xterm` exists for local or daemon use, but it is experimental and slower than `tmux`. Use it when you need a headless fallback, not as the default path for long-lived interactive work. See [docs/cli.md](docs/cli.md) for current caveats and backend behavior.
|
|
79
79
|
|
package/dist/bin.js
CHANGED
|
@@ -397,6 +397,9 @@ function hasSession(name) {
|
|
|
397
397
|
function hasPane(id) {
|
|
398
398
|
return spawnSync2("bash", ["-lc", shellCommand("tmux", "display-message", "-p", "-t", id, "#{pane_id}")], { stdio: "pipe" }).status === 0;
|
|
399
399
|
}
|
|
400
|
+
function windowTarget(sessionName, windowName) {
|
|
401
|
+
return `${sessionName}:${windowName}`;
|
|
402
|
+
}
|
|
400
403
|
async function killSession(name) {
|
|
401
404
|
if (!hasSession(name))
|
|
402
405
|
return;
|
|
@@ -443,15 +446,12 @@ class Session {
|
|
|
443
446
|
throw new Error("tmuxctl: command is required");
|
|
444
447
|
}
|
|
445
448
|
const format = "#{window_id}\t#{pane_id}";
|
|
446
|
-
const
|
|
449
|
+
const target = windowTarget(name, windowName);
|
|
450
|
+
const result = hasSession(name) ? await tmux("new-window", "-P", "-F", format, "-t", name, "-n", windowName, ...workingDir ? ["-c", workingDir] : [], ...command, ";", "set-option", "-q", "-t", name, "destroy-unattached", "off", ";", "set-option", "-q", "-t", name, "status", "off", ";", "resize-window", "-t", target, "-x", String(width), "-y", String(height)) : await tmux("new-session", "-d", "-P", "-F", format, "-s", name, "-n", windowName, "-x", String(width), "-y", String(height), ...workingDir ? ["-c", workingDir] : [], ...command, ";", "set-option", "-q", "-t", name, "destroy-unattached", "off", ";", "set-option", "-q", "-t", name, "status", "off", ";", "resize-window", "-t", target, "-x", String(width), "-y", String(height));
|
|
447
451
|
const [windowId, paneId] = result.stdout.trim().split(/\s+/, 2);
|
|
448
452
|
if (!windowId || !paneId) {
|
|
449
453
|
throw new Error(`tmuxctl: failed to parse tmux target ids: ${result.stdout}`);
|
|
450
454
|
}
|
|
451
|
-
try {
|
|
452
|
-
await tmux("set-option", "-t", name, "status", "off");
|
|
453
|
-
} catch {}
|
|
454
|
-
await tmux("resize-window", "-t", windowId, "-x", String(width), "-y", String(height));
|
|
455
455
|
return new Session(name, command, windowId, paneId);
|
|
456
456
|
}
|
|
457
457
|
static async find(sessionName, windowName) {
|
package/dist/index.js
CHANGED
|
@@ -128,6 +128,9 @@ function hasSession(name) {
|
|
|
128
128
|
function hasPane(id) {
|
|
129
129
|
return spawnSync("bash", ["-lc", shellCommand("tmux", "display-message", "-p", "-t", id, "#{pane_id}")], { stdio: "pipe" }).status === 0;
|
|
130
130
|
}
|
|
131
|
+
function windowTarget(sessionName, windowName) {
|
|
132
|
+
return `${sessionName}:${windowName}`;
|
|
133
|
+
}
|
|
131
134
|
async function killSession(name) {
|
|
132
135
|
if (!hasSession(name))
|
|
133
136
|
return;
|
|
@@ -174,15 +177,12 @@ class Session {
|
|
|
174
177
|
throw new Error("tmuxctl: command is required");
|
|
175
178
|
}
|
|
176
179
|
const format = "#{window_id}\t#{pane_id}";
|
|
177
|
-
const
|
|
180
|
+
const target = windowTarget(name, windowName);
|
|
181
|
+
const result = hasSession(name) ? await tmux("new-window", "-P", "-F", format, "-t", name, "-n", windowName, ...workingDir ? ["-c", workingDir] : [], ...command, ";", "set-option", "-q", "-t", name, "destroy-unattached", "off", ";", "set-option", "-q", "-t", name, "status", "off", ";", "resize-window", "-t", target, "-x", String(width), "-y", String(height)) : await tmux("new-session", "-d", "-P", "-F", format, "-s", name, "-n", windowName, "-x", String(width), "-y", String(height), ...workingDir ? ["-c", workingDir] : [], ...command, ";", "set-option", "-q", "-t", name, "destroy-unattached", "off", ";", "set-option", "-q", "-t", name, "status", "off", ";", "resize-window", "-t", target, "-x", String(width), "-y", String(height));
|
|
178
182
|
const [windowId, paneId] = result.stdout.trim().split(/\s+/, 2);
|
|
179
183
|
if (!windowId || !paneId) {
|
|
180
184
|
throw new Error(`tmuxctl: failed to parse tmux target ids: ${result.stdout}`);
|
|
181
185
|
}
|
|
182
|
-
try {
|
|
183
|
-
await tmux("set-option", "-t", name, "status", "off");
|
|
184
|
-
} catch {}
|
|
185
|
-
await tmux("resize-window", "-t", windowId, "-x", String(width), "-y", String(height));
|
|
186
186
|
return new Session(name, command, windowId, paneId);
|
|
187
187
|
}
|
|
188
188
|
static async find(sessionName, windowName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halfwhey/claudraband",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Control the official Claude Code CLI programmatically. Use as a library, a direct CLI, an ACP server, or a persistent session daemon.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|