clawborrator-cli 0.0.55 → 0.0.56
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 +93 -3
- package/package.json +1 -1
package/dist-bundled/claw.cjs
CHANGED
|
@@ -68781,7 +68781,28 @@ var sessionUnshareCmd = new Command("unshare").description("revoke a user's shar
|
|
|
68781
68781
|
console.log(`\u2717 revoked @${out.login}'s access to ${out.sessionId.slice(0, 8)}\u2026`);
|
|
68782
68782
|
}
|
|
68783
68783
|
});
|
|
68784
|
-
var
|
|
68784
|
+
var sessionKill = new Command("kill").description("kill the CC process for a managed session (keeps the session row)").argument("<ref>", "session UUID, @routingName, or @owner/slug").action(async (ref) => {
|
|
68785
|
+
const id = await resolveSessionId(ref, { destructive: true });
|
|
68786
|
+
await api.post(`/api/v1/sessions/${encodeURIComponent(id)}/kill`, {});
|
|
68787
|
+
console.log(`\u2717 killed CC process for ${id.slice(0, 8)}\u2026`);
|
|
68788
|
+
});
|
|
68789
|
+
var sessionRestart = new Command("restart").description("kill + respawn the CC process for a managed session").argument("<ref>", "session UUID, @routingName, or @owner/slug").action(async (ref) => {
|
|
68790
|
+
const id = await resolveSessionId(ref, { destructive: true });
|
|
68791
|
+
const out = await api.post(
|
|
68792
|
+
`/api/v1/sessions/${encodeURIComponent(id)}/restart`,
|
|
68793
|
+
{}
|
|
68794
|
+
);
|
|
68795
|
+
console.log(`\u21BA restarted: ${out.sessionId}`);
|
|
68796
|
+
});
|
|
68797
|
+
var sessionScreenshot = new Command("screenshot").description("print the current rendered terminal frame for a managed session").argument("<ref>", "session UUID, @routingName, or @owner/slug").action(async (ref) => {
|
|
68798
|
+
const id = await resolveSessionId(ref);
|
|
68799
|
+
const out = await api.get(
|
|
68800
|
+
`/api/v1/sessions/${encodeURIComponent(id)}/screenshot`
|
|
68801
|
+
);
|
|
68802
|
+
console.error(`(${out.cols}\xD7${out.rows} terminal \u2014 cursor at ${out.cursor?.row ?? "?"},${out.cursor?.col ?? "?"})`);
|
|
68803
|
+
process.stdout.write(out.text.endsWith("\n") ? out.text : out.text + "\n");
|
|
68804
|
+
});
|
|
68805
|
+
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).addCommand(sessionShareCmd).addCommand(sessionSharesCmd).addCommand(sessionUnshareCmd).addCommand(sessionFiles).addCommand(sessionFileRm).addCommand(sessionKill).addCommand(sessionRestart).addCommand(sessionScreenshot);
|
|
68785
68806
|
|
|
68786
68807
|
// src/commands/token.ts
|
|
68787
68808
|
var import_node_fs2 = require("node:fs");
|
|
@@ -69082,8 +69103,11 @@ var import_node_crypto2 = require("node:crypto");
|
|
|
69082
69103
|
var import_node_child_process2 = require("node:child_process");
|
|
69083
69104
|
function fmtAgo3(iso) {
|
|
69084
69105
|
if (!iso) return "never";
|
|
69085
|
-
|
|
69086
|
-
if (
|
|
69106
|
+
let s = iso;
|
|
69107
|
+
if (!/[zZ]|[+-]\d{2}:?\d{2}$/.test(s)) s = s.replace(" ", "T") + "Z";
|
|
69108
|
+
const ms = Date.now() - new Date(s).getTime();
|
|
69109
|
+
if (!Number.isFinite(ms)) return "\u2014";
|
|
69110
|
+
if (ms < 0) return "just now";
|
|
69087
69111
|
if (ms < 6e4) return Math.max(1, Math.floor(ms / 1e3)) + "s ago";
|
|
69088
69112
|
if (ms < 36e5) return Math.floor(ms / 6e4) + "m ago";
|
|
69089
69113
|
if (ms < 864e5) return Math.floor(ms / 36e5) + "h ago";
|
|
@@ -69284,6 +69308,70 @@ var appsTestOauth = new Command("test-oauth").description("walk the full SPA OAu
|
|
|
69284
69308
|
});
|
|
69285
69309
|
var appsCmd = new Command("apps").description("manage SPA app tokens (kind=app, `cw_app_\u2026`) \u2014 mint, list, revoke, and end-to-end-test the SPA OAuth+PKCE flow").addCommand(appsMint).addCommand(appsList).addCommand(appsRevoke).addCommand(appsTestOauth);
|
|
69286
69310
|
|
|
69311
|
+
// src/commands/desktop.ts
|
|
69312
|
+
var desktopList = new Command("list").alias("ls").description("list desktop daemons registered for the current user").action(async () => {
|
|
69313
|
+
const data = await api.get("/api/v1/desktops");
|
|
69314
|
+
if (data.items.length === 0) {
|
|
69315
|
+
console.log("no registered desktops");
|
|
69316
|
+
return;
|
|
69317
|
+
}
|
|
69318
|
+
for (const d of data.items) {
|
|
69319
|
+
const dot = d.online ? "\u25CF" : "\u25CB";
|
|
69320
|
+
const host = d.hostname ?? "(unknown host)";
|
|
69321
|
+
const ver = d.daemonVersion ?? "?";
|
|
69322
|
+
console.log(`${dot} ${d.machineId.slice(0, 8)} ${host.padEnd(24)} v${ver.padEnd(8)} last-seen ${fmtAgo4(d.lastSeenAt)}`);
|
|
69323
|
+
}
|
|
69324
|
+
});
|
|
69325
|
+
var desktopCreate = new Command("create-session").description("ask a desktop daemon to spawn a managed CC session in a folder").argument("<machineId>", "desktop machine id (from `claw desktop list`)").argument("<folder>", "absolute path on the desktop where CC should be spawned").option("--routing-name <name>", "optional routing name for the new session (e.g. @frontend)").action(async (machineId, folder, opts) => {
|
|
69326
|
+
const body = { folder };
|
|
69327
|
+
if (opts.routingName) body.routingName = opts.routingName;
|
|
69328
|
+
const out = await api.post(
|
|
69329
|
+
`/api/v1/desktops/${encodeURIComponent(machineId)}/sessions`,
|
|
69330
|
+
body
|
|
69331
|
+
);
|
|
69332
|
+
console.log(`\u2713 session created: ${out.sessionId}`);
|
|
69333
|
+
});
|
|
69334
|
+
var desktopCmd = new Command("desktop").description("inspect + control desktop daemons (clawborrator-supervisor)").addCommand(desktopList).addCommand(desktopCreate);
|
|
69335
|
+
function fmtAgo4(iso) {
|
|
69336
|
+
const ms = Date.now() - new Date(iso).getTime();
|
|
69337
|
+
if (ms < 6e4) return Math.max(1, Math.floor(ms / 1e3)) + "s ago";
|
|
69338
|
+
if (ms < 36e5) return Math.floor(ms / 6e4) + "m ago";
|
|
69339
|
+
if (ms < 864e5) return Math.floor(ms / 36e5) + "h ago";
|
|
69340
|
+
return Math.floor(ms / 864e5) + "d ago";
|
|
69341
|
+
}
|
|
69342
|
+
|
|
69343
|
+
// src/commands/prompt-memory.ts
|
|
69344
|
+
var promptMemoryList = new Command("list").alias("ls").description("list remembered startup-prompt answers").option("--machine-id <id>", "filter to one machine").option("--folder <path>", "filter to one folder").action(async (opts) => {
|
|
69345
|
+
const qs = new URLSearchParams();
|
|
69346
|
+
if (opts.machineId) qs.set("machineId", opts.machineId);
|
|
69347
|
+
if (opts.folder) qs.set("folder", opts.folder);
|
|
69348
|
+
const url = "/api/v1/prompt-memory" + (qs.toString() ? "?" + qs : "");
|
|
69349
|
+
const data = await api.get(url);
|
|
69350
|
+
if (data.items.length === 0) {
|
|
69351
|
+
console.log("no remembered answers");
|
|
69352
|
+
return;
|
|
69353
|
+
}
|
|
69354
|
+
for (const m of data.items) {
|
|
69355
|
+
const where = [m.machineId?.slice(0, 8) ?? "*", m.folder ?? "*"].join(" ");
|
|
69356
|
+
const printableAnswer = JSON.stringify(m.answer);
|
|
69357
|
+
console.log(`${m.id.toString().padStart(4)} ${m.category.padEnd(28)} ${printableAnswer.padEnd(8)} ${where}`);
|
|
69358
|
+
}
|
|
69359
|
+
});
|
|
69360
|
+
var promptMemorySet = new Command("set").description("set or update a remembered answer (idempotent)").requiredOption("--category <category>", "e.g. startup_trust_folder, startup_use_mcp").requiredOption("--answer <bytes>", 'literal bytes the daemon should type, e.g. "y\\n"').option("--machine-id <id>", "scope to a specific machine; omit for all-machines").option("--folder <path>", "scope to a specific folder; omit for all-folders").action(async (opts) => {
|
|
69361
|
+
const out = await api.post("/api/v1/prompt-memory", {
|
|
69362
|
+
machineId: opts.machineId ?? null,
|
|
69363
|
+
folder: opts.folder ?? null,
|
|
69364
|
+
category: opts.category,
|
|
69365
|
+
answer: opts.answer
|
|
69366
|
+
});
|
|
69367
|
+
console.log(`\u2713 remembered #${out.id}: ${out.category} \u2192 ${JSON.stringify(out.answer)}`);
|
|
69368
|
+
});
|
|
69369
|
+
var promptMemoryForget = new Command("forget").description("forget a remembered answer by id (from `claw prompt-memory list`)").argument("<id>", "memory id").action(async (id) => {
|
|
69370
|
+
await api.delete(`/api/v1/prompt-memory/${encodeURIComponent(id)}`);
|
|
69371
|
+
console.log(`\u2717 forgot memory ${id}`);
|
|
69372
|
+
});
|
|
69373
|
+
var promptMemoryCmd = new Command("prompt-memory").description("view and manage remembered CC startup-prompt answers").addCommand(promptMemoryList).addCommand(promptMemorySet).addCommand(promptMemoryForget);
|
|
69374
|
+
|
|
69287
69375
|
// src/index.ts
|
|
69288
69376
|
var program2 = new Command();
|
|
69289
69377
|
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.43");
|
|
@@ -69298,6 +69386,8 @@ program2.addCommand(probeCmd);
|
|
|
69298
69386
|
program2.addCommand(webhookCmd);
|
|
69299
69387
|
program2.addCommand(agentsCmd);
|
|
69300
69388
|
program2.addCommand(appsCmd);
|
|
69389
|
+
program2.addCommand(desktopCmd);
|
|
69390
|
+
program2.addCommand(promptMemoryCmd);
|
|
69301
69391
|
program2.parseAsync(process.argv).catch((err) => {
|
|
69302
69392
|
console.error(err.message ?? err);
|
|
69303
69393
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawborrator-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
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",
|