@generativereality/agentherder 0.1.1 → 0.1.2

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 +15 -4
  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.1";
13
+ var version = "0.1.2";
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,
@@ -500,6 +500,10 @@ function ensureConfigExists() {
500
500
  async function openSession(opts) {
501
501
  const { tabName, claudeCmd, workspaceQuery } = opts;
502
502
  const dir = resolve(opts.dir.replace(/^~/, homedir()));
503
+ if (!existsSync(dir)) {
504
+ consola.error(`Directory does not exist: ${dir}`);
505
+ process.exit(1);
506
+ }
503
507
  const config = loadConfig();
504
508
  const adapter = requireWaveAdapter();
505
509
  let focusWindowId;
@@ -545,18 +549,24 @@ const newCommand = define({
545
549
  },
546
550
  dir: {
547
551
  type: "positional",
548
- description: "Working directory (default: cwd)"
552
+ description: "Working directory / repo root (default: cwd)"
549
553
  },
550
554
  workspace: {
551
555
  type: "string",
552
556
  short: "w",
553
557
  description: "Target workspace"
558
+ },
559
+ worktree: {
560
+ type: "boolean",
561
+ short: "W",
562
+ description: "Launch claude with --worktree <name> for isolated branch work"
554
563
  }
555
564
  },
556
565
  async run(ctx) {
557
566
  const name = ctx.positionals[1];
558
567
  const dir = ctx.positionals[2] ?? process.cwd();
559
568
  const workspace = ctx.values.workspace;
569
+ const useWorktree = ctx.values.worktree ?? false;
560
570
  if (!name) {
561
571
  consola.error("Tab name is required");
562
572
  process.exit(1);
@@ -564,10 +574,11 @@ const newCommand = define({
564
574
  const tabId = await openSession({
565
575
  tabName: name,
566
576
  dir,
567
- claudeCmd: "claude",
577
+ claudeCmd: useWorktree ? `claude --worktree ${JSON.stringify(name)}` : "claude",
568
578
  workspaceQuery: workspace
569
579
  });
570
- consola.success(`Tab "${name}" [${tabId.slice(0, 8)}] claude at ${dir}`);
580
+ const suffix = useWorktree ? ` (worktree: .claude/worktrees/${name})` : "";
581
+ consola.success(`Tab "${name}" [${tabId.slice(0, 8)}] → claude at ${dir}${suffix}`);
571
582
  }
572
583
  });
573
584
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@generativereality/agentherder",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Agent session manager for AI coding tools. Terminal tabs as the UI, no tmux.",
5
5
  "type": "module",
6
6
  "bin": {