clawborrator-cli 0.0.40 → 0.0.42

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.
@@ -64096,16 +64096,24 @@ function base64url(buf) {
64096
64096
  }
64097
64097
  function openBrowser(url) {
64098
64098
  const platform2 = process.platform;
64099
- const cmd = platform2 === "win32" ? "cmd" : platform2 === "darwin" ? "open" : "xdg-open";
64100
- const args = platform2 === "win32" ? ["/c", "start", '""', url] : [url];
64101
64099
  try {
64102
- (0, import_node_child_process.spawn)(cmd, args, { stdio: "ignore", detached: true }).unref();
64100
+ if (platform2 === "win32") {
64101
+ (0, import_node_child_process.spawn)("cmd", ["/c", "start", '""', `"${url}"`], {
64102
+ stdio: "ignore",
64103
+ detached: true,
64104
+ windowsVerbatimArguments: true
64105
+ }).unref();
64106
+ } else {
64107
+ const cmd = platform2 === "darwin" ? "open" : "xdg-open";
64108
+ (0, import_node_child_process.spawn)(cmd, [url], { stdio: "ignore", detached: true }).unref();
64109
+ }
64103
64110
  } catch {
64104
64111
  }
64105
64112
  }
64106
64113
  function awaitCallback(server) {
64107
64114
  return new Promise((resolve3, reject) => {
64108
64115
  server.on("request", (req, res) => {
64116
+ res.setHeader("Connection", "close");
64109
64117
  const u = new URL(req.url ?? "/", "http://localhost");
64110
64118
  if (u.pathname !== "/callback") {
64111
64119
  res.statusCode = 404;
@@ -64156,15 +64164,21 @@ async function browserOAuthFlow(hubUrl) {
64156
64164
  console.log("");
64157
64165
  openBrowser(startUrl.toString());
64158
64166
  let cb;
64167
+ let timeoutHandle;
64159
64168
  try {
64160
64169
  cb = await Promise.race([
64161
64170
  awaitCallback(server),
64162
- new Promise(
64163
- (_, reject) => setTimeout(() => reject(new Error("login timed out after 5 minutes")), 5 * 60 * 1e3)
64164
- )
64171
+ new Promise((_, reject) => {
64172
+ timeoutHandle = setTimeout(
64173
+ () => reject(new Error("login timed out after 5 minutes")),
64174
+ 5 * 60 * 1e3
64175
+ );
64176
+ })
64165
64177
  ]);
64166
64178
  } finally {
64179
+ if (timeoutHandle) clearTimeout(timeoutHandle);
64167
64180
  server.close();
64181
+ server.closeAllConnections?.();
64168
64182
  }
64169
64183
  if (cb.state !== state) throw new Error("state mismatch \u2014 possible CSRF; aborting");
64170
64184
  const res = await fetch(hubUrl.replace(/\/$/, "") + "/api/v1/auth/oauth/token", {
@@ -68604,11 +68618,11 @@ function fmtAgo2(iso) {
68604
68618
  // src/commands/peers.ts
68605
68619
  var peersCmd = new Command("peers").description("list your sessions reachable for cross-session routing \u2014 own + shared").action(async () => {
68606
68620
  const data = await api.get("/api/v1/peers");
68607
- if (data.peers.length === 0) {
68621
+ if (data.items.length === 0) {
68608
68622
  console.log("no peers (no sessions registered yet)");
68609
68623
  return;
68610
68624
  }
68611
- for (const p of data.peers) {
68625
+ for (const p of data.items) {
68612
68626
  const dot = p.online ? "\u25CF" : "\u25CB";
68613
68627
  const where = p.cwd ? ` ${p.cwd}` : "";
68614
68628
  const qualifiedName = `@${p.ownerLogin}/${p.routingName.replace(/^@/, "")}`;
@@ -68702,7 +68716,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
68702
68716
 
68703
68717
  // src/index.ts
68704
68718
  var program2 = new Command();
68705
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.40");
68719
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.42");
68706
68720
  program2.addCommand(loginCmd);
68707
68721
  program2.addCommand(logoutCmd);
68708
68722
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
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",