clawborrator-cli 0.0.24 → 0.0.25

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.
@@ -6920,7 +6920,7 @@ var GREEN = "\x1B[32m";
6920
6920
  function ts() {
6921
6921
  return (/* @__PURE__ */ new Date()).toLocaleTimeString();
6922
6922
  }
6923
- 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)").action(async (ref) => {
6923
+ 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)").action(async (ref, opts) => {
6924
6924
  const cfg = loadConfig();
6925
6925
  if (!cfg.pat) {
6926
6926
  console.error("error: not logged in. run `claw login`.");
@@ -6973,6 +6973,27 @@ var sessionAttach = new Command("attach").description("open a TUI on a session \
6973
6973
  process.exit(2);
6974
6974
  }
6975
6975
  }
6976
+ const limitArg = String(opts.limit ?? "50").toLowerCase();
6977
+ const historyLimit = limitArg === "all" ? 5e3 : limitArg === "0" ? 0 : Math.max(0, parseInt(limitArg, 10) || 0);
6978
+ if (historyLimit > 0) {
6979
+ const kindsParam = opts.opMessages === false ? "&kinds=event" : "";
6980
+ try {
6981
+ const tl = await api.get(`/api/v1/sessions/${encodeURIComponent(sessionId)}/timeline?limit=${historyLimit}${kindsParam}`);
6982
+ if (tl.items.length > 0) {
6983
+ console.log(`${DIM2}\u2500\u2500\u2500 history (${tl.items.length} item${tl.items.length === 1 ? "" : "s"}) \u2500\u2500\u2500${RESET2}`);
6984
+ for (const item of tl.items) {
6985
+ if (item.kind === "event") {
6986
+ renderEvent(item.event, myLogin);
6987
+ } else {
6988
+ console.log(`${DIM2}[${shortTs(item.ts)}]${RESET2} ${GREEN}@${item.authorLogin}${RESET2} ${item.text}`);
6989
+ }
6990
+ }
6991
+ console.log(`${DIM2}\u2500\u2500\u2500 live \u2500\u2500\u2500${RESET2}`);
6992
+ }
6993
+ } catch (e) {
6994
+ console.error(`${DIM2}(history fetch failed: ${e?.message ?? String(e)} \u2014 continuing live)${RESET2}`);
6995
+ }
6996
+ }
6976
6997
  const wsUrl = cfg.hubUrl.replace(/^http/i, "ws") + "/cli";
6977
6998
  const ws = new wrapper_default(wsUrl, {
6978
6999
  headers: { Authorization: `Bearer ${cfg.pat}` }
@@ -7763,7 +7784,7 @@ var webhookCmd = new Command("webhook").description("manage webhook subscription
7763
7784
 
7764
7785
  // src/index.ts
7765
7786
  var program2 = new Command();
7766
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.24");
7787
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.25");
7767
7788
  program2.addCommand(loginCmd);
7768
7789
  program2.addCommand(logoutCmd);
7769
7790
  program2.addCommand(whoamiCmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
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",