clawborrator-cli 0.0.18 → 0.0.20

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.
@@ -6946,7 +6946,7 @@ var sessionAttach = new Command("attach").description("open a TUI on a session \
6946
6946
  return;
6947
6947
  }
6948
6948
  if (msg.type === "permission_request") {
6949
- pendingPerms.push({ requestId: msg.requestId, tool: msg.tool });
6949
+ pendingPerms.push({ requestId: msg.requestId, tool: msg.tool, sessionId: msg.sessionId });
6950
6950
  } else if (msg.type === "permission_resolved") {
6951
6951
  const i = pendingPerms.findIndex((p) => p.requestId === msg.requestId);
6952
6952
  if (i >= 0) pendingPerms.splice(i, 1);
@@ -6985,7 +6985,8 @@ var sessionAttach = new Command("attach").description("open a TUI on a session \
6985
6985
  const decision = text === "/y" || text === "/yes" ? "allow" : "deny";
6986
6986
  const approval = {
6987
6987
  type: "approval",
6988
- sessionId,
6988
+ sessionId: pending.sessionId,
6989
+ // owner of the permission, may not be `sessionId`
6989
6990
  requestId: pending.requestId,
6990
6991
  decision
6991
6992
  };
@@ -7449,7 +7450,48 @@ var sessionPrompt = new Command("prompt").description("send a one-shot prompt to
7449
7450
  });
7450
7451
  });
7451
7452
  });
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);
7453
+ var VALID_ROLES = ["viewer", "prompter", "approver"];
7454
+ 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) => {
7455
+ const role = (opts.role ?? "prompter").toLowerCase();
7456
+ if (!VALID_ROLES.includes(role)) {
7457
+ console.error(`error: --role must be one of: ${VALID_ROLES.join(", ")}`);
7458
+ process.exit(2);
7459
+ }
7460
+ const id = await resolveSessionId(ref);
7461
+ const cleanLogin = login.replace(/^@/, "");
7462
+ const out = await api.post(
7463
+ `/api/v1/sessions/${encodeURIComponent(id)}/shares`,
7464
+ { login: cleanLogin, role }
7465
+ );
7466
+ console.log(`\u2713 shared ${out.sessionId.slice(0, 8)}\u2026 with @${out.login} as ${out.role}`);
7467
+ console.log(` they can now: claw session attach ${id} (or @${out.login}/<slug> from their attach)`);
7468
+ });
7469
+ 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) => {
7470
+ const id = await resolveSessionId(ref);
7471
+ const out = await api.get(
7472
+ `/api/v1/sessions/${encodeURIComponent(id)}/shares`
7473
+ );
7474
+ if (out.items.length === 0) {
7475
+ console.log("(no shares \u2014 only the owner has access)");
7476
+ return;
7477
+ }
7478
+ for (const s of out.items) {
7479
+ console.log(` @${s.login.padEnd(20)} ${s.role.padEnd(9)} since ${s.createdAt}`);
7480
+ }
7481
+ });
7482
+ 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) => {
7483
+ const id = await resolveSessionId(ref);
7484
+ const cleanLogin = login.replace(/^@/, "");
7485
+ const out = await api.delete(
7486
+ `/api/v1/sessions/${encodeURIComponent(id)}/shares/${encodeURIComponent(cleanLogin)}`
7487
+ );
7488
+ if (out.removed === 0) {
7489
+ console.log(`(no share to revoke \u2014 @${out.login} didn't have access)`);
7490
+ } else {
7491
+ console.log(`\u2717 revoked @${out.login}'s access to ${out.sessionId.slice(0, 8)}\u2026`);
7492
+ }
7493
+ });
7494
+ 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
7495
 
7454
7496
  // src/commands/token.ts
7455
7497
  var import_node_fs2 = require("node:fs");
@@ -7667,7 +7709,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
7667
7709
 
7668
7710
  // src/index.ts
7669
7711
  var program2 = new Command();
7670
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.18");
7712
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.20");
7671
7713
  program2.addCommand(loginCmd);
7672
7714
  program2.addCommand(logoutCmd);
7673
7715
  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.20",
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",