clawborrator-cli 0.0.17 → 0.0.18

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.
@@ -7581,19 +7581,29 @@ var peersCmd = new Command("peers").description("list your sessions reachable fo
7581
7581
  console.log(`${dot} ${p.routingName.padEnd(20)} ${p.online ? "online" : "offline"}${where}`);
7582
7582
  }
7583
7583
  });
7584
- var routeCmd = new Command("route").description("send a one-shot prompt to a peer session").argument("<peer>", "@routingName (e.g. @foo)").argument("<prompt>", "text to send (quote it to keep spaces)").option("--mode <mode>", "ask | tell (default ask)", "ask").action(async (peer, prompt, opts) => {
7584
+ var routeCmd = new Command("route").description("send a one-shot prompt to a peer session; ask mode (default) blocks for the reply, tell mode is fire-and-forget").argument("<peer>", "routingName (e.g. @foo, foo, @owner/foo)").argument("<prompt>", "text to send (quote it to keep spaces)").option("--mode <mode>", "ask | tell", "ask").action(async (peer, prompt, opts) => {
7585
7585
  const mode = opts.mode === "tell" ? "tell" : "ask";
7586
7586
  const out = await api.post(
7587
7587
  `/api/v1/peers/${encodeURIComponent(peer)}/route`,
7588
7588
  { prompt, mode }
7589
7589
  );
7590
- console.log(`\u2713 routed to ${peer}`);
7591
- console.log(` chatId: ${out.chatId}`);
7592
- console.log(` sessionId: ${out.sessionId}`);
7593
- console.log(` mode: ${mode}`);
7594
- if (mode === "ask") {
7595
- console.log(" (reply correlation arrives in channel Phase D \u2014 for now poll `claw session attach` to watch)");
7590
+ console.log(`\u2713 routed to ${peer} (chatId ${out.chatId.slice(0, 8)}\u2026)`);
7591
+ if (mode === "tell") {
7592
+ console.log(" mode: tell (fire-and-forget). Watch the reply in `claw session attach` if needed.");
7593
+ return;
7594
+ }
7595
+ if (out.ok && out.reply !== void 0) {
7596
+ console.log("");
7597
+ console.log(out.reply);
7598
+ return;
7596
7599
  }
7600
+ if (out.timedOut) {
7601
+ console.error(`error: ${out.error}`);
7602
+ console.error(" (the peer may still answer later \u2014 `claw session events " + peer + "` will show it if it lands)");
7603
+ process.exit(2);
7604
+ }
7605
+ console.error(`error: ${out.error ?? "no reply"}`);
7606
+ process.exit(2);
7597
7607
  });
7598
7608
  var probeCmd = new Command("probe").description("fan-out the same prompt to many peers in parallel").argument("<prompt>", "text to send (quote it)").option("--peers <csv>", "comma-separated routing names; default = all online peers").action(async (prompt, opts) => {
7599
7609
  const peerList = opts.peers ? opts.peers.split(",").map((s) => s.trim()).filter(Boolean) : null;
@@ -7657,7 +7667,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
7657
7667
 
7658
7668
  // src/index.ts
7659
7669
  var program2 = new Command();
7660
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.17");
7670
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.18");
7661
7671
  program2.addCommand(loginCmd);
7662
7672
  program2.addCommand(logoutCmd);
7663
7673
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
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",