@nathapp/nax 0.54.10 → 0.54.12

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/nax.js +34 -9
  2. package/package.json +1 -1
package/dist/nax.js CHANGED
@@ -22370,7 +22370,7 @@ var package_default;
22370
22370
  var init_package = __esm(() => {
22371
22371
  package_default = {
22372
22372
  name: "@nathapp/nax",
22373
- version: "0.54.10",
22373
+ version: "0.54.12",
22374
22374
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
22375
22375
  type: "module",
22376
22376
  bin: {
@@ -22449,8 +22449,8 @@ var init_version = __esm(() => {
22449
22449
  NAX_VERSION = package_default.version;
22450
22450
  NAX_COMMIT = (() => {
22451
22451
  try {
22452
- if (/^[0-9a-f]{6,10}$/.test("cf3ead2"))
22453
- return "cf3ead2";
22452
+ if (/^[0-9a-f]{6,10}$/.test("cbd14dd"))
22453
+ return "cbd14dd";
22454
22454
  } catch {}
22455
22455
  try {
22456
22456
  const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
@@ -35228,6 +35228,25 @@ ${missing.join(`
35228
35228
  validateStoryId(storyId);
35229
35229
  const worktreePath = join50(projectRoot, ".nax-wt", storyId);
35230
35230
  const branchName = `nax/${storyId}`;
35231
+ try {
35232
+ const pruneProc = _managerDeps.spawn(["git", "worktree", "prune"], {
35233
+ cwd: projectRoot,
35234
+ stdout: "pipe",
35235
+ stderr: "pipe"
35236
+ });
35237
+ await pruneProc.exited;
35238
+ } catch {}
35239
+ try {
35240
+ await this.remove(projectRoot, storyId);
35241
+ } catch {}
35242
+ try {
35243
+ const branchProc = _managerDeps.spawn(["git", "branch", "-D", branchName], {
35244
+ cwd: projectRoot,
35245
+ stdout: "pipe",
35246
+ stderr: "pipe"
35247
+ });
35248
+ await branchProc.exited;
35249
+ } catch {}
35231
35250
  try {
35232
35251
  const proc = _managerDeps.spawn(["git", "worktree", "add", worktreePath, "-b", branchName], {
35233
35252
  cwd: projectRoot,
@@ -35244,9 +35263,6 @@ ${missing.join(`
35244
35263
  if (error48.message.includes("not a git repository")) {
35245
35264
  throw new Error(`Not a git repository: ${projectRoot}`);
35246
35265
  }
35247
- if (error48.message.includes("already exists")) {
35248
- throw new Error(`Worktree for story ${storyId} already exists at ${worktreePath}`);
35249
- }
35250
35266
  throw error48;
35251
35267
  }
35252
35268
  throw new Error(`Failed to create worktree: ${String(error48)}`);
@@ -35674,12 +35690,21 @@ import path16 from "path";
35674
35690
  async function runParallelBatch(options) {
35675
35691
  const { stories, ctx, prd } = options;
35676
35692
  const { workdir, config: config2, maxConcurrency, pipelineContext, eventEmitter, agentGetFn, hooks, pluginRegistry } = ctx;
35693
+ const logger = getSafeLogger();
35677
35694
  const worktreeManager = await _parallelBatchDeps.createWorktreeManager();
35678
35695
  const worktreePaths = new Map;
35679
35696
  const storyStartTimes = new Map;
35680
35697
  for (const story of stories) {
35681
35698
  storyStartTimes.set(story.id, Date.now());
35682
- await worktreeManager.create(workdir, story.id);
35699
+ try {
35700
+ await worktreeManager.create(workdir, story.id);
35701
+ } catch (error48) {
35702
+ logger?.error("parallel-batch", "Failed to create worktree for story", {
35703
+ storyId: story.id,
35704
+ error: error48 instanceof Error ? error48.message : String(error48)
35705
+ });
35706
+ throw error48;
35707
+ }
35683
35708
  worktreePaths.set(story.id, path16.join(workdir, ".nax-wt", story.id));
35684
35709
  }
35685
35710
  const workerResult = await _parallelBatchDeps.executeParallelBatch(stories, workdir, config2, pipelineContext, worktreePaths, maxConcurrency, eventEmitter);
@@ -35719,8 +35744,8 @@ async function runParallelBatch(options) {
35719
35744
  });
35720
35745
  mergeConflicts.push({ story, rectified: rectResult.success, cost: rectResult.cost });
35721
35746
  } catch (err) {
35722
- const logger = getSafeLogger();
35723
- logger?.warn("[parallel-batch]", "rectification failed for story", {
35747
+ const logger2 = getSafeLogger();
35748
+ logger2?.warn("[parallel-batch]", "rectification failed for story", {
35724
35749
  storyId: story.id,
35725
35750
  error: err.message
35726
35751
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nax",
3
- "version": "0.54.10",
3
+ "version": "0.54.12",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {