clawborrator-cli 0.2.9 → 0.2.11
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 +26 -11
- package/package.json +1 -1
package/dist-bundled/claw.cjs
CHANGED
|
@@ -68522,13 +68522,14 @@ function buildSessionListQs(opts) {
|
|
|
68522
68522
|
if (opts.all) qs.set("archived", "true");
|
|
68523
68523
|
return qs.toString() ? "?" + qs : "";
|
|
68524
68524
|
}
|
|
68525
|
-
function printSessionListRow(s) {
|
|
68526
|
-
const
|
|
68525
|
+
function printSessionListRow(s, onlineMachineIds) {
|
|
68526
|
+
const managedOnline = !!s.managedBy?.machineId && onlineMachineIds.has(s.managedBy.machineId);
|
|
68527
|
+
const dot = s.connected ? "\u25CF" : managedOnline ? "\u25D0" : "\u25CB";
|
|
68527
68528
|
const slug = s.routingName ?? "";
|
|
68528
68529
|
const qualified = slug ? `@${s.startedByLogin}/${slug.replace(/^@/, "")}` : "(no routing name)";
|
|
68529
68530
|
const where = s.cwd ? ` ${s.cwd}` : "";
|
|
68530
68531
|
const role = s.role.padEnd(8);
|
|
68531
|
-
const seen = s.connected ? "online" : `offline \xB7 ${fmtAgo(s.lastSeenAt)}`;
|
|
68532
|
+
const seen = s.connected ? "online" : managedOnline ? `in-flight \xB7 ${fmtAgo(s.lastSeenAt)}` : `offline \xB7 ${fmtAgo(s.lastSeenAt)}`;
|
|
68532
68533
|
const arch = s.archivedAt ? " \xB7 ARCHIVED" : "";
|
|
68533
68534
|
console.log(`${dot} ${qualified.padEnd(28)} ${role}${where} [${seen}]${arch}`);
|
|
68534
68535
|
console.log(` id: ${s.id}`);
|
|
@@ -68543,19 +68544,31 @@ function printSessionListFooter() {
|
|
|
68543
68544
|
console.log(" a splatting operator and stripped before reaching the CLI)");
|
|
68544
68545
|
}
|
|
68545
68546
|
var sessionList = new Command("list").alias("ls").description("list sessions you can see").option("--connected", "only sessions whose channel WS is currently open").option("--all", "include archived sessions").action(async (opts) => {
|
|
68546
|
-
const data = await
|
|
68547
|
-
"/api/v1/sessions" + buildSessionListQs(opts)
|
|
68547
|
+
const [data, desktops] = await Promise.all([
|
|
68548
|
+
api.get("/api/v1/sessions" + buildSessionListQs(opts)),
|
|
68549
|
+
api.get("/api/v1/desktops").catch(() => ({ items: [] }))
|
|
68550
|
+
]);
|
|
68551
|
+
const onlineMachineIds = new Set(
|
|
68552
|
+
desktops.items.filter((d) => d.online).map((d) => d.machineId)
|
|
68548
68553
|
);
|
|
68549
68554
|
if (data.items.length === 0) {
|
|
68550
68555
|
console.log("no sessions");
|
|
68551
68556
|
return;
|
|
68552
68557
|
}
|
|
68553
|
-
for (const s of data.items) printSessionListRow(s);
|
|
68558
|
+
for (const s of data.items) printSessionListRow(s, onlineMachineIds);
|
|
68554
68559
|
printSessionListFooter();
|
|
68555
68560
|
});
|
|
68556
68561
|
var sessionInfo = new Command("info").description("show metadata for a single session").argument("<ref>", "session UUID or @routingName").action(async (ref) => {
|
|
68557
68562
|
const id = await resolveSessionId(ref);
|
|
68558
|
-
const s = await
|
|
68563
|
+
const [s, desktops] = await Promise.all([
|
|
68564
|
+
api.get(`/api/v1/sessions/${encodeURIComponent(id)}`),
|
|
68565
|
+
api.get("/api/v1/desktops").catch(() => ({ items: [] }))
|
|
68566
|
+
]);
|
|
68567
|
+
const onlineMachineIds = new Set(
|
|
68568
|
+
desktops.items.filter((d) => d.online).map((d) => d.machineId)
|
|
68569
|
+
);
|
|
68570
|
+
const managedOnline = !!s.managedBy?.machineId && onlineMachineIds.has(s.managedBy.machineId);
|
|
68571
|
+
const statusLabel = s.connected ? "connected" : managedOnline ? "in-flight (daemon online, no channel)" : "offline";
|
|
68559
68572
|
console.log(`session : ${s.id}`);
|
|
68560
68573
|
console.log(`routing : ${s.routingName ?? "(none)"}`);
|
|
68561
68574
|
console.log(`owner : @${s.startedByLogin}`);
|
|
@@ -68565,7 +68578,7 @@ var sessionInfo = new Command("info").description("show metadata for a single se
|
|
|
68565
68578
|
console.log(`channel v: ${s.channelVersion ?? "?"}`);
|
|
68566
68579
|
console.log(`started : ${s.startedAt}`);
|
|
68567
68580
|
console.log(`last seen: ${s.lastSeenAt}`);
|
|
68568
|
-
console.log(`status : ${
|
|
68581
|
+
console.log(`status : ${statusLabel}${s.archivedAt ? " \xB7 ARCHIVED" : ""}`);
|
|
68569
68582
|
if (s.managedBy?.machineId) {
|
|
68570
68583
|
const ver = s.managedBy.daemonVersion ? ` (daemon ${s.managedBy.daemonVersion})` : "";
|
|
68571
68584
|
console.log(`managed : ${s.managedBy.machineId}${ver}`);
|
|
@@ -68964,10 +68977,12 @@ var probeCmd = new Command("probe").description("fan-out the same prompt to many
|
|
|
68964
68977
|
});
|
|
68965
68978
|
|
|
68966
68979
|
// src/commands/webhook.ts
|
|
68967
|
-
var webhookAdd = new Command("add").description("register a webhook subscription").requiredOption("--url <url>", "https://\u2026 target endpoint").requiredOption("--events <csv>", 'comma-separated event types (or "*" for all)').option("--
|
|
68980
|
+
var webhookAdd = new Command("add").description("register a webhook subscription").requiredOption("--url <url>", "https://\u2026 target endpoint").requiredOption("--events <csv>", 'comma-separated event types (or "*" for all)').option("--routing-name <handle>", "narrow to events for one session by routing name (e.g. @orchard-viper). Stable across managed-session restart / autoStart-respawn / kill+restart cycles, where sessionId would churn.").action(async (opts) => {
|
|
68968
68981
|
const events = opts.events.split(",").map((s) => s.trim()).filter(Boolean);
|
|
68969
68982
|
const filters = {};
|
|
68970
|
-
if (opts.
|
|
68983
|
+
if (opts.routingName) {
|
|
68984
|
+
filters.routingName = opts.routingName.startsWith("@") ? opts.routingName : "@" + opts.routingName;
|
|
68985
|
+
}
|
|
68971
68986
|
const out = await api.post("/api/v1/webhooks", {
|
|
68972
68987
|
url: opts.url,
|
|
68973
68988
|
events,
|
|
@@ -69405,7 +69420,7 @@ function fmtAgo4(iso) {
|
|
|
69405
69420
|
|
|
69406
69421
|
// src/index.ts
|
|
69407
69422
|
var program2 = new Command();
|
|
69408
|
-
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.2.
|
|
69423
|
+
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.2.11");
|
|
69409
69424
|
program2.addCommand(loginCmd);
|
|
69410
69425
|
program2.addCommand(logoutCmd);
|
|
69411
69426
|
program2.addCommand(whoamiCmd);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawborrator-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "claw — command-line client for clawborrator. Attach to remote Claude Code sessions, send prompts, resolve permission gates, route across sessions, manage public agents and webhooks. Auth via GitHub OAuth + PKCE.",
|
|
6
6
|
"license": "MIT",
|