@generativereality/agentherder 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +35 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { consola } from "consola";
10
10
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "fs";
11
11
  //#region package.json
12
12
  var name = "@generativereality/agentherder";
13
- var version = "0.1.2";
13
+ var version = "0.1.3";
14
14
  var description = "Agent session manager for AI coding tools. Terminal tabs as the UI, no tmux.";
15
15
  var package_default = {
16
16
  name,
@@ -534,6 +534,7 @@ async function openSession(opts) {
534
534
  const extraFlags = config.claude.flags.join(" ");
535
535
  const cmd = `cd ${JSON.stringify(dir)} && ${claudeCmd} --name ${JSON.stringify(tabName)}${extraFlags ? " " + extraFlags : ""}\n`;
536
536
  await adapter.sendInput(blockId, cmd);
537
+ await new Promise((r) => setTimeout(r, 2e3));
537
538
  adapter.closeSocket();
538
539
  return tabId;
539
540
  }
@@ -707,7 +708,7 @@ const closeCommand = define({
707
708
  const { tabsById, tabNames } = await adapter.getAllData();
708
709
  const matches = adapter.resolveTab(query, tabsById, tabNames);
709
710
  if (!matches.length) {
710
- consola.error(`No tab matching '${query}'`);
711
+ consola.error(`No tab matching '${query}' (tabs in workspaces with no open window are not visible — open that workspace first)`);
711
712
  process.exit(1);
712
713
  }
713
714
  if (matches.length > 1) {
@@ -766,11 +767,11 @@ const renameCommand = define({
766
767
  //#region src/commands/scrollback.ts
767
768
  const scrollbackCommand = define({
768
769
  name: "scrollback",
769
- description: "Show terminal output for a block (default: last 50 lines)",
770
+ description: "Show terminal output for a tab or block (default: last 50 lines)",
770
771
  args: {
771
- block: {
772
+ target: {
772
773
  type: "positional",
773
- description: "Block ID prefix"
774
+ description: "Tab name, tab ID prefix, or block ID prefix"
774
775
  },
775
776
  lines: {
776
777
  type: "number",
@@ -782,22 +783,39 @@ const scrollbackCommand = define({
782
783
  const query = ctx.positionals[1];
783
784
  const lines = ctx.values.lines ?? 50;
784
785
  if (!query) {
785
- consola.error("Block ID is required");
786
+ consola.error("Tab name or block ID is required");
786
787
  process.exit(1);
787
788
  }
788
789
  const adapter = requireWaveAdapter();
789
- const blocks = adapter.blocksList();
790
- const matches = adapter.resolveBlock(query, blocks);
791
- if (!matches.length) {
792
- consola.error(`No block matching '${query}'`);
793
- process.exit(1);
794
- }
795
- if (matches.length > 1) {
796
- consola.error(`Multiple blocks match '${query}':`);
797
- for (const b of matches) consola.log(` ${b.blockid}`);
790
+ const { tabsById, tabNames } = await adapter.getAllData();
791
+ const tabMatches = adapter.resolveTab(query, tabsById, tabNames);
792
+ let blockId;
793
+ if (tabMatches.length === 1) {
794
+ const blocks = (tabsById.get(tabMatches[0]) ?? []).filter((b) => b.view === "term");
795
+ if (!blocks.length) {
796
+ consola.error(`Tab "${tabNames.get(tabMatches[0])}" has no terminal block`);
797
+ process.exit(1);
798
+ }
799
+ blockId = blocks[0].blockid;
800
+ } else if (tabMatches.length > 1) {
801
+ consola.error(`Multiple tabs match '${query}':`);
802
+ for (const tid of tabMatches) consola.log(` "${tabNames.get(tid)}" [${tid.slice(0, 8)}]`);
798
803
  process.exit(1);
804
+ } else {
805
+ const allBlocks = adapter.blocksList();
806
+ const blockMatches = adapter.resolveBlock(query, allBlocks);
807
+ if (!blockMatches.length) {
808
+ consola.error(`No tab or block matching '${query}' (tabs in workspaces with no open window are not visible — open that workspace first)`);
809
+ process.exit(1);
810
+ }
811
+ if (blockMatches.length > 1) {
812
+ consola.error(`Multiple blocks match '${query}':`);
813
+ for (const b of blockMatches) consola.log(` ${b.blockid}`);
814
+ process.exit(1);
815
+ }
816
+ blockId = blockMatches[0].blockid;
799
817
  }
800
- process.stdout.write(adapter.scrollback(matches[0].blockid, lines));
818
+ process.stdout.write(adapter.scrollback(blockId, lines));
801
819
  }
802
820
  });
803
821
  //#endregion
@@ -861,7 +879,7 @@ const sendCommand = define({
861
879
  const allBlocks = adapter.blocksList();
862
880
  const blockMatches = adapter.resolveBlock(query, allBlocks);
863
881
  if (!blockMatches.length) {
864
- consola.error(`No tab or block matching '${query}'`);
882
+ consola.error(`No tab or block matching '${query}' (tabs in workspaces with no open window are not visible — open that workspace first)`);
865
883
  process.exit(1);
866
884
  }
867
885
  if (blockMatches.length > 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@generativereality/agentherder",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Agent session manager for AI coding tools. Terminal tabs as the UI, no tmux.",
5
5
  "type": "module",
6
6
  "bin": {