clawborrator-cli 0.0.11 → 0.0.12
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-bundled/claw.cjs +35 -12
- package/package.json +1 -1
package/dist-bundled/claw.cjs
CHANGED
|
@@ -6948,7 +6948,7 @@ var sessionAttach = new Command("attach").description("open a TUI on a session \
|
|
|
6948
6948
|
printInbound(msg);
|
|
6949
6949
|
if (msg.type === "subscribed") {
|
|
6950
6950
|
mySubscription = true;
|
|
6951
|
-
console.log(`${DIM}attached as ${BOLD}${msg.role}${RESET}${DIM}. type for op-
|
|
6951
|
+
console.log(`${DIM}attached as ${BOLD}${msg.role}${RESET}${DIM}. type for prompt \xB7 /m <text> for op-msg \xB7 /y /n on permissions \xB7 /q to quit${RESET}`);
|
|
6952
6952
|
}
|
|
6953
6953
|
});
|
|
6954
6954
|
ws.on("close", (code, reason) => {
|
|
@@ -6986,10 +6986,20 @@ var sessionAttach = new Command("attach").description("open a TUI on a session \
|
|
|
6986
6986
|
ws.send(JSON.stringify(approval));
|
|
6987
6987
|
return;
|
|
6988
6988
|
}
|
|
6989
|
+
if (text === "/m" || text.startsWith("/m ")) {
|
|
6990
|
+
const opText = text.slice(2).trim();
|
|
6991
|
+
if (!opText) {
|
|
6992
|
+
console.log(`${DIM}usage: /m <text> (sends as op-message; bare text is a prompt)${RESET}`);
|
|
6993
|
+
return;
|
|
6994
|
+
}
|
|
6995
|
+
const out2 = { type: "op_message", sessionId, text: opText };
|
|
6996
|
+
ws.send(JSON.stringify(out2));
|
|
6997
|
+
return;
|
|
6998
|
+
}
|
|
6989
6999
|
if (text === "/p" || text.startsWith("/p ")) {
|
|
6990
7000
|
const promptText = text.slice(2).trim();
|
|
6991
7001
|
if (!promptText) {
|
|
6992
|
-
console.log(`${DIM}usage: /p <text
|
|
7002
|
+
console.log(`${DIM}usage: /p <text> (or just type \u2014 bare text is a prompt now)${RESET}`);
|
|
6993
7003
|
return;
|
|
6994
7004
|
}
|
|
6995
7005
|
const out2 = { type: "prompt", sessionId, text: promptText };
|
|
@@ -6998,11 +7008,12 @@ var sessionAttach = new Command("attach").description("open a TUI on a session \
|
|
|
6998
7008
|
return;
|
|
6999
7009
|
}
|
|
7000
7010
|
if (text.startsWith("/")) {
|
|
7001
|
-
console.log(`${DIM}unknown slash-command: ${text} (try /
|
|
7011
|
+
console.log(`${DIM}unknown slash-command: ${text} (try /m /y /n /q)${RESET}`);
|
|
7002
7012
|
return;
|
|
7003
7013
|
}
|
|
7004
|
-
const out = { type: "
|
|
7014
|
+
const out = { type: "prompt", sessionId, text };
|
|
7005
7015
|
ws.send(JSON.stringify(out));
|
|
7016
|
+
console.log(`${DIM}[${ts()}]${RESET} ${AMBER}\u2192 prompt${RESET} ${text}`);
|
|
7006
7017
|
});
|
|
7007
7018
|
process.on("SIGINT", () => {
|
|
7008
7019
|
ws.close(1e3, "sigint");
|
|
@@ -7314,18 +7325,19 @@ var sessionArchive = new Command("archive").description("soft-delete a session (
|
|
|
7314
7325
|
console.log(`\u2713 archived ${r.sessionId} at ${r.archivedAt}`);
|
|
7315
7326
|
}
|
|
7316
7327
|
});
|
|
7317
|
-
var sessionPrune = new Command("prune").description("
|
|
7328
|
+
var sessionPrune = new Command("prune").description("hard-delete duplicate session rows that share a routing name. The live (or most-recently-seen) row is kept; the rest are removed along with their events / op-messages / shares (FK cascade). Use --dry-run first if unsure.").option("--dry-run", "show what would be deleted without writing").option("--routing <name>", "narrow to a single routing name (e.g. @driver)").action(async (opts) => {
|
|
7318
7329
|
const body = { dryRun: !!opts.dryRun };
|
|
7319
7330
|
if (opts.routing) body.routingName = opts.routing.startsWith("@") ? opts.routing : "@" + opts.routing;
|
|
7320
7331
|
const r = await api.post(`/api/v1/sessions/prune`, body);
|
|
7321
|
-
if (r.
|
|
7332
|
+
if (r.deleted.length === 0) {
|
|
7322
7333
|
console.log("nothing to prune (no routing-name duplicates).");
|
|
7323
7334
|
return;
|
|
7324
7335
|
}
|
|
7325
|
-
const verb = r.dryRun ? "would
|
|
7326
|
-
console.log(`${verb} ${r.
|
|
7327
|
-
for (const
|
|
7328
|
-
|
|
7336
|
+
const verb = r.dryRun ? "would delete" : "deleted";
|
|
7337
|
+
console.log(`${verb} ${r.deleted.length} duplicate${r.deleted.length === 1 ? "" : "s"}:`);
|
|
7338
|
+
for (const d of r.deleted) {
|
|
7339
|
+
const tag = d.wasArchived ? " [was archived]" : "";
|
|
7340
|
+
console.log(` \u2717 ${d.routingName.padEnd(20)} ${d.sessionId} (last seen ${d.lastSeenAt})${tag}`);
|
|
7329
7341
|
}
|
|
7330
7342
|
console.log(`keeping:`);
|
|
7331
7343
|
for (const k of r.kept) {
|
|
@@ -7333,6 +7345,17 @@ var sessionPrune = new Command("prune").description("archive duplicate session r
|
|
|
7333
7345
|
}
|
|
7334
7346
|
if (r.dryRun) console.log("\n(--dry-run \u2014 re-run without it to apply)");
|
|
7335
7347
|
});
|
|
7348
|
+
var sessionDelete = new Command("delete").description("hard-delete a single session \u2014 cascades events / op-messages / shares. Irreversible. Use `archive` for the soft form (auto-resurrects on reconnect).").argument("<ref>", "session UUID or @routingName").option("--hard", "required: confirm you want a permanent delete (no soft form is offered without this flag)").action(async (ref, opts) => {
|
|
7349
|
+
if (!opts.hard) {
|
|
7350
|
+
console.error("error: hard delete requires --hard. Did you mean `claw session archive <ref>`?");
|
|
7351
|
+
process.exit(2);
|
|
7352
|
+
}
|
|
7353
|
+
const id = await resolveSessionId(ref);
|
|
7354
|
+
const r = await api.delete(
|
|
7355
|
+
`/api/v1/sessions/${encodeURIComponent(id)}?hard=true`
|
|
7356
|
+
);
|
|
7357
|
+
console.log(`\u2717 deleted ${r.sessionId} (events / op-messages / shares cascaded).`);
|
|
7358
|
+
});
|
|
7336
7359
|
var sessionPrompt = new Command("prompt").description("send a one-shot prompt to a session's live Claude (lands in the same inbox as cross-session route prompts; receiving Claude must be polling `await_routed_prompt`)").argument("<ref>", "session UUID or @routingName").argument("<text>", "prompt text \u2014 quote multi-word").action(async (ref, text) => {
|
|
7337
7360
|
const id = await resolveSessionId(ref);
|
|
7338
7361
|
const cfg = loadConfig();
|
|
@@ -7374,7 +7397,7 @@ var sessionPrompt = new Command("prompt").description("send a one-shot prompt to
|
|
|
7374
7397
|
});
|
|
7375
7398
|
});
|
|
7376
7399
|
});
|
|
7377
|
-
var sessionCmd = new Command("session").description("manage Claude Code sessions registered with this hub").addCommand(sessionList).addCommand(sessionInfo).addCommand(sessionAttach).addCommand(sessionEvents).addCommand(sessionMessages).addCommand(sessionArchive).addCommand(sessionPrune).addCommand(sessionPrompt);
|
|
7400
|
+
var sessionCmd = new Command("session").description("manage Claude Code sessions registered with this hub").addCommand(sessionList).addCommand(sessionInfo).addCommand(sessionAttach).addCommand(sessionEvents).addCommand(sessionMessages).addCommand(sessionArchive).addCommand(sessionPrune).addCommand(sessionPrompt).addCommand(sessionDelete);
|
|
7378
7401
|
|
|
7379
7402
|
// src/commands/token.ts
|
|
7380
7403
|
var import_node_fs2 = require("node:fs");
|
|
@@ -7582,7 +7605,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
|
|
|
7582
7605
|
|
|
7583
7606
|
// src/index.ts
|
|
7584
7607
|
var program2 = new Command();
|
|
7585
|
-
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.
|
|
7608
|
+
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.12");
|
|
7586
7609
|
program2.addCommand(loginCmd);
|
|
7587
7610
|
program2.addCommand(logoutCmd);
|
|
7588
7611
|
program2.addCommand(whoamiCmd);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawborrator-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "claw — command-line client for clawborrator hub_v1. Manages PATs, channel tokens, sessions, cross-session routing, and webhooks; ships an inline TUI for live multi-operator session attach.",
|
|
6
6
|
"license": "MIT",
|