clawborrator-cli 0.0.27 → 0.0.28

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.
@@ -67594,6 +67594,7 @@ function ts() {
67594
67594
  return (/* @__PURE__ */ new Date()).toLocaleTimeString();
67595
67595
  }
67596
67596
  var markdownEnabled = true;
67597
+ var debugMode = false;
67597
67598
  var md = new Marked();
67598
67599
  md.use(markedTerminal({
67599
67600
  width: process.stdout.columns ?? 100,
@@ -67620,8 +67621,9 @@ function emitChatLine(prefix, body) {
67620
67621
  console.log(` ${line}`);
67621
67622
  }
67622
67623
  }
67623
- var sessionAttach = new Command("attach").description("open a TUI on a session \u2014 see the chat stream, post op-messages").argument("<ref>", "session UUID or @routingName (e.g. @driver)").option("--limit <n>", 'history items to load before the live stream begins. 0 = none. "all" = up to 5000. default 50.', "50").option("--no-op-messages", "exclude op-messages from the history backlog (live ones still arrive once attached)").option("--no-markdown", "render assistant_text and reply payloads as raw text instead of formatted markdown").action(async (ref, opts) => {
67624
+ var sessionAttach = new Command("attach").description("open a TUI on a session \u2014 see the chat stream, post op-messages").argument("<ref>", "session UUID or @routingName (e.g. @driver)").option("--limit <n>", 'history items to load before the live stream begins. 0 = none. "all" = up to 5000. default 50.', "50").option("--no-op-messages", "exclude op-messages from the history backlog (live ones still arrive once attached)").option("--no-markdown", "render assistant_text and reply payloads as raw text instead of formatted markdown").option("--debug", "after every rendered event, print its full JSON payload (truncated at 2 KB) \u2014 surfaces fields the renderer normally hides (e.g., SubagentStop's last_assistant_message, PreToolUse tool_input details)").action(async (ref, opts) => {
67624
67625
  if (opts.markdown === false) markdownEnabled = false;
67626
+ if (opts.debug) debugMode = true;
67625
67627
  const cfg = loadConfig();
67626
67628
  if (!cfg.pat) {
67627
67629
  console.error("error: not logged in. run `claw login`.");
@@ -67900,14 +67902,38 @@ function previewPayload(p) {
67900
67902
  }
67901
67903
  return JSON.stringify(p).slice(0, 240);
67902
67904
  }
67905
+ function maybeDebugDump(p) {
67906
+ if (!debugMode) return;
67907
+ let json;
67908
+ try {
67909
+ json = JSON.stringify(p, null, 2);
67910
+ } catch {
67911
+ json = String(p);
67912
+ }
67913
+ const TRUNC = 2e3;
67914
+ if (json.length > TRUNC) json = json.slice(0, TRUNC) + "\n... [truncated, payload was " + json.length + " bytes]";
67915
+ for (const line of json.split("\n")) {
67916
+ console.log(` ${DIM2}${line}${RESET2}`);
67917
+ }
67918
+ }
67903
67919
  function renderEvent(ev, myLogin) {
67904
67920
  const ts2 = shortTs(ev.ts);
67905
67921
  const p = ev.payload || {};
67922
+ if (ev.kind === "chat" && ev.type === "prompt") {
67923
+ const src = String(p.source ?? "");
67924
+ if (src === "operator" && myLogin && p.authorLogin === myLogin) return;
67925
+ }
67926
+ try {
67927
+ renderEventBody(ev, ts2, p, myLogin);
67928
+ } finally {
67929
+ maybeDebugDump(p);
67930
+ }
67931
+ }
67932
+ function renderEventBody(ev, ts2, p, myLogin) {
67906
67933
  if (ev.kind === "chat") {
67907
67934
  if (ev.type === "prompt") {
67908
67935
  const text = String(p.text ?? p.prompt ?? "").trim() || JSON.stringify(p).slice(0, 200);
67909
67936
  const source = String(p.source ?? "cli");
67910
- if (source === "operator" && myLogin && p.authorLogin === myLogin) return;
67911
67937
  const label = source === "operator" ? `${BOLD2}@${String(p.authorLogin ?? "remote")} \u203A${RESET2}` : `${BOLD2}(cli) \u203A${RESET2}`;
67912
67938
  console.log(`${DIM2}[${ts2}]${RESET2} ${label} ${text}`);
67913
67939
  return;
@@ -68491,7 +68517,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
68491
68517
 
68492
68518
  // src/index.ts
68493
68519
  var program2 = new Command();
68494
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.27");
68520
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.28");
68495
68521
  program2.addCommand(loginCmd);
68496
68522
  program2.addCommand(logoutCmd);
68497
68523
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
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",