clawborrator-cli 0.0.18 → 0.0.19

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.
@@ -7449,7 +7449,48 @@ var sessionPrompt = new Command("prompt").description("send a one-shot prompt to
7449
7449
  });
7450
7450
  });
7451
7451
  });
7452
- 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);
7452
+ var VALID_ROLES = ["viewer", "prompter", "approver"];
7453
+ var sessionShareCmd = new Command("share").description("grant another GitHub user access to a session. role defaults to prompter (viewer = read-only events; prompter = + send prompts/op-messages; approver = + resolve permission requests).").argument("<ref>", "session UUID or @routingName").argument("<login>", "GitHub login of the user to share with (with or without leading @)").option("--role <role>", `viewer | prompter | approver`, "prompter").action(async (ref, login, opts) => {
7454
+ const role = (opts.role ?? "prompter").toLowerCase();
7455
+ if (!VALID_ROLES.includes(role)) {
7456
+ console.error(`error: --role must be one of: ${VALID_ROLES.join(", ")}`);
7457
+ process.exit(2);
7458
+ }
7459
+ const id = await resolveSessionId(ref);
7460
+ const cleanLogin = login.replace(/^@/, "");
7461
+ const out = await api.post(
7462
+ `/api/v1/sessions/${encodeURIComponent(id)}/shares`,
7463
+ { login: cleanLogin, role }
7464
+ );
7465
+ console.log(`\u2713 shared ${out.sessionId.slice(0, 8)}\u2026 with @${out.login} as ${out.role}`);
7466
+ console.log(` they can now: claw session attach ${id} (or @${out.login}/<slug> from their attach)`);
7467
+ });
7468
+ var sessionSharesCmd = new Command("shares").description("list users granted access to a session via share. Owner-only view.").argument("<ref>", "session UUID or @routingName").action(async (ref) => {
7469
+ const id = await resolveSessionId(ref);
7470
+ const out = await api.get(
7471
+ `/api/v1/sessions/${encodeURIComponent(id)}/shares`
7472
+ );
7473
+ if (out.items.length === 0) {
7474
+ console.log("(no shares \u2014 only the owner has access)");
7475
+ return;
7476
+ }
7477
+ for (const s of out.items) {
7478
+ console.log(` @${s.login.padEnd(20)} ${s.role.padEnd(9)} since ${s.createdAt}`);
7479
+ }
7480
+ });
7481
+ var sessionUnshareCmd = new Command("unshare").description("revoke a user's share access to a session. Owner-only.").argument("<ref>", "session UUID or @routingName").argument("<login>", "GitHub login (with or without leading @)").action(async (ref, login) => {
7482
+ const id = await resolveSessionId(ref);
7483
+ const cleanLogin = login.replace(/^@/, "");
7484
+ const out = await api.delete(
7485
+ `/api/v1/sessions/${encodeURIComponent(id)}/shares/${encodeURIComponent(cleanLogin)}`
7486
+ );
7487
+ if (out.removed === 0) {
7488
+ console.log(`(no share to revoke \u2014 @${out.login} didn't have access)`);
7489
+ } else {
7490
+ console.log(`\u2717 revoked @${out.login}'s access to ${out.sessionId.slice(0, 8)}\u2026`);
7491
+ }
7492
+ });
7493
+ 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);
7453
7494
 
7454
7495
  // src/commands/token.ts
7455
7496
  var import_node_fs2 = require("node:fs");
@@ -7667,7 +7708,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
7667
7708
 
7668
7709
  // src/index.ts
7669
7710
  var program2 = new Command();
7670
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.18");
7711
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.19");
7671
7712
  program2.addCommand(loginCmd);
7672
7713
  program2.addCommand(logoutCmd);
7673
7714
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
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",