@nathapp/nax 0.29.0 → 0.31.0

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.
package/dist/nax.js CHANGED
@@ -19500,6 +19500,92 @@ var init_routing = __esm(() => {
19500
19500
  init_batch_route();
19501
19501
  });
19502
19502
 
19503
+ // package.json
19504
+ var package_default;
19505
+ var init_package = __esm(() => {
19506
+ package_default = {
19507
+ name: "@nathapp/nax",
19508
+ version: "0.31.0",
19509
+ description: "AI Coding Agent Orchestrator \u2014 loops until done",
19510
+ type: "module",
19511
+ bin: {
19512
+ nax: "./dist/nax.js"
19513
+ },
19514
+ scripts: {
19515
+ prepare: "git config core.hooksPath .githooks",
19516
+ dev: "bun run bin/nax.ts",
19517
+ build: 'bun build bin/nax.ts --outdir dist --target bun --define "GIT_COMMIT=\\"$(git rev-parse --short HEAD)\\""',
19518
+ typecheck: "bun x tsc --noEmit",
19519
+ lint: "bun x biome check src/ bin/",
19520
+ test: "NAX_SKIP_PRECHECK=1 bun test test/ --timeout=60000",
19521
+ "test:watch": "bun test --watch",
19522
+ "test:unit": "bun test ./test/unit/ --timeout=60000",
19523
+ "test:integration": "bun test ./test/integration/ --timeout=60000",
19524
+ "test:ui": "bun test ./test/ui/ --timeout=60000",
19525
+ prepublishOnly: "bun run build"
19526
+ },
19527
+ dependencies: {
19528
+ "@anthropic-ai/sdk": "^0.74.0",
19529
+ "@types/react": "^19.2.14",
19530
+ chalk: "^5.6.2",
19531
+ commander: "^13.1.0",
19532
+ ink: "^6.7.0",
19533
+ "ink-spinner": "^5.0.0",
19534
+ "ink-testing-library": "^4.0.0",
19535
+ react: "^19.2.4",
19536
+ zod: "^4.3.6"
19537
+ },
19538
+ devDependencies: {
19539
+ "@biomejs/biome": "^1.9.4",
19540
+ "@types/bun": "^1.3.8",
19541
+ "react-devtools-core": "^7.0.1",
19542
+ typescript: "^5.7.3"
19543
+ },
19544
+ license: "MIT",
19545
+ author: "William Khoo",
19546
+ keywords: [
19547
+ "ai",
19548
+ "agent",
19549
+ "orchestrator",
19550
+ "tdd",
19551
+ "coding"
19552
+ ],
19553
+ files: [
19554
+ "dist/",
19555
+ "src/",
19556
+ "bin/",
19557
+ "README.md",
19558
+ "CHANGELOG.md"
19559
+ ]
19560
+ };
19561
+ });
19562
+
19563
+ // src/version.ts
19564
+ var NAX_VERSION, NAX_COMMIT, NAX_BUILD_INFO;
19565
+ var init_version = __esm(() => {
19566
+ init_package();
19567
+ NAX_VERSION = package_default.version;
19568
+ NAX_COMMIT = (() => {
19569
+ try {
19570
+ if (/^[0-9a-f]{6,10}$/.test("6b2cc85"))
19571
+ return "6b2cc85";
19572
+ } catch {}
19573
+ try {
19574
+ const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
19575
+ cwd: import.meta.dir,
19576
+ stderr: "ignore"
19577
+ });
19578
+ if (result.exitCode === 0) {
19579
+ const hash2 = result.stdout.toString().trim();
19580
+ if (/^[0-9a-f]{6,10}$/.test(hash2))
19581
+ return hash2;
19582
+ }
19583
+ } catch {}
19584
+ return "dev";
19585
+ })();
19586
+ NAX_BUILD_INFO = NAX_COMMIT === "dev" ? `v${NAX_VERSION}` : `v${NAX_VERSION} (${NAX_COMMIT})`;
19587
+ });
19588
+
19503
19589
  // src/prd/types.ts
19504
19590
  function getContextFiles(story) {
19505
19591
  return story.contextFiles ?? story.relevantFiles ?? [];
@@ -19535,6 +19621,11 @@ async function loadPRD(path) {
19535
19621
  story.escalations = story.escalations ?? [];
19536
19622
  story.dependencies = story.dependencies ?? [];
19537
19623
  story.tags = story.tags ?? [];
19624
+ const rawStatus = story.status;
19625
+ if (rawStatus === "open")
19626
+ story.status = "pending";
19627
+ if (rawStatus === "done")
19628
+ story.status = "passed";
19538
19629
  story.status = story.status ?? "pending";
19539
19630
  story.acceptanceCriteria = story.acceptanceCriteria ?? [];
19540
19631
  story.storyPoints = story.storyPoints ?? 1;
@@ -23594,6 +23685,132 @@ var init_rectification_gate = __esm(() => {
23594
23685
  init_prompts();
23595
23686
  });
23596
23687
 
23688
+ // src/prompts/sections/conventions.ts
23689
+ function buildConventionsSection() {
23690
+ return `# Conventions
23691
+
23692
+ ` + `Follow existing code patterns and conventions. Write idiomatic, maintainable code.
23693
+
23694
+ ` + "When running tests, run ONLY test files related to your changes (e.g. `bun test ./test/specific.test.ts`). " + "NEVER run `bun test` without a file filter \u2014 full suite output will flood your context window and cause failures.\n\n" + "Commit your changes when done using conventional commit format (e.g. `feat:`, `fix:`, `test:`).";
23695
+ }
23696
+
23697
+ // src/prompts/sections/isolation.ts
23698
+ function buildIsolationSection(roleOrMode, mode) {
23699
+ if ((roleOrMode === "strict" || roleOrMode === "lite") && mode === undefined) {
23700
+ return buildIsolationSection("test-writer", roleOrMode);
23701
+ }
23702
+ const role = roleOrMode;
23703
+ const header = `# Isolation Rules
23704
+
23705
+ `;
23706
+ const footer = `
23707
+
23708
+ ${TEST_FILTER_RULE}`;
23709
+ if (role === "test-writer") {
23710
+ const m = mode ?? "strict";
23711
+ if (m === "strict") {
23712
+ return `${header}isolation scope: Only create or modify files in the test/ directory. Tests must fail because the feature is not yet implemented. Do NOT modify any source files in src/.${footer}`;
23713
+ }
23714
+ return `${header}isolation scope: Create test files in test/. MAY read src/ files and MAY import from src/ to ensure correct types/interfaces. May create minimal stubs in src/ if needed to make imports work, but do NOT implement real logic.${footer}`;
23715
+ }
23716
+ if (role === "implementer") {
23717
+ return `${header}isolation scope: Implement source code in src/ to make tests pass. Do not modify test files. Run tests frequently to track progress.${footer}`;
23718
+ }
23719
+ if (role === "verifier") {
23720
+ return `${header}isolation scope: Read-only inspection. Review all test results, implementation code, and acceptance criteria compliance. You MAY write a verdict file (.nax-verifier-verdict.json) and apply legitimate fixes if needed.${footer}`;
23721
+ }
23722
+ return `${header}isolation scope: Create test files in test/ directory, then implement source code in src/ to make tests pass. Both directories are in scope for this session.${footer}`;
23723
+ }
23724
+ var TEST_FILTER_RULE;
23725
+ var init_isolation2 = __esm(() => {
23726
+ TEST_FILTER_RULE = "When running tests, run ONLY test files related to your changes " + "(e.g. `bun test ./test/specific.test.ts`). NEVER run `bun test` without a file filter " + "\u2014 full suite output will flood your context window and cause failures.";
23727
+ });
23728
+
23729
+ // src/prompts/sections/role-task.ts
23730
+ function buildRoleTaskSection(roleOrVariant, variant) {
23731
+ if ((roleOrVariant === "standard" || roleOrVariant === "lite") && variant === undefined) {
23732
+ return buildRoleTaskSection("implementer", roleOrVariant);
23733
+ }
23734
+ const role = roleOrVariant;
23735
+ if (role === "implementer") {
23736
+ const v = variant ?? "standard";
23737
+ if (v === "standard") {
23738
+ return `# Role: Implementer
23739
+
23740
+ ` + `Your task: make failing tests pass.
23741
+
23742
+ ` + `Instructions:
23743
+ ` + `- Implement source code in src/ to make tests pass
23744
+ ` + `- Do NOT modify test files
23745
+ ` + `- Run tests frequently to track progress
23746
+ ` + `- When all tests are green, stage and commit ALL changed files with: git commit -m 'feat: <description>'
23747
+ ` + "- Goal: all tests green, all changes committed";
23748
+ }
23749
+ return `# Role: Implementer (Lite)
23750
+
23751
+ ` + `Your task: Write tests AND implement the feature in a single session.
23752
+
23753
+ ` + `Instructions:
23754
+ ` + `- Write tests first (test/ directory), then implement (src/ directory)
23755
+ ` + `- All tests must pass by the end
23756
+ ` + `- Use Bun test (describe/test/expect)
23757
+ ` + `- When all tests are green, stage and commit ALL changed files with: git commit -m 'feat: <description>'
23758
+ ` + "- Goal: all tests green, all criteria met, all changes committed";
23759
+ }
23760
+ if (role === "test-writer") {
23761
+ return `# Role: Test-Writer
23762
+
23763
+ ` + `Your task: Write comprehensive failing tests for the feature.
23764
+
23765
+ ` + `Instructions:
23766
+ ` + `- Create test files in test/ directory that cover acceptance criteria
23767
+ ` + `- Tests must fail initially (RED phase) \u2014 the feature is not yet implemented
23768
+ ` + `- Use Bun test (describe/test/expect)
23769
+ ` + `- Write clear test names that document expected behavior
23770
+ ` + `- Focus on behavior, not implementation details
23771
+ ` + "- Goal: comprehensive test suite ready for implementation";
23772
+ }
23773
+ if (role === "verifier") {
23774
+ return `# Role: Verifier
23775
+
23776
+ ` + `Your task: Review and verify the implementation against acceptance criteria.
23777
+
23778
+ ` + `Instructions:
23779
+ ` + `- Review all test results \u2014 verify tests pass
23780
+ ` + `- Check that implementation meets all acceptance criteria
23781
+ ` + `- Inspect code quality, error handling, and edge cases
23782
+ ` + `- Verify test modifications (if any) are legitimate fixes
23783
+ ` + `- Write a detailed verdict with reasoning
23784
+ ` + "- Goal: provide comprehensive verification and quality assurance";
23785
+ }
23786
+ return `# Role: Single-Session
23787
+
23788
+ ` + `Your task: Write tests AND implement the feature in a single focused session.
23789
+
23790
+ ` + `Instructions:
23791
+ ` + `- Phase 1: Write comprehensive tests (test/ directory)
23792
+ ` + `- Phase 2: Implement to make all tests pass (src/ directory)
23793
+ ` + `- Use Bun test (describe/test/expect)
23794
+ ` + `- Run tests frequently throughout implementation
23795
+ ` + `- When all tests are green, stage and commit ALL changed files with: git commit -m 'feat: <description>'
23796
+ ` + "- Goal: all tests passing, all changes committed, full story complete";
23797
+ }
23798
+
23799
+ // src/prompts/sections/story.ts
23800
+ function buildStorySection(story) {
23801
+ const criteria = story.acceptanceCriteria.map((c, i) => `${i + 1}. ${c}`).join(`
23802
+ `);
23803
+ return `# Story Context
23804
+
23805
+ **Story:** ${story.title}
23806
+
23807
+ **Description:**
23808
+ ${story.description}
23809
+
23810
+ **Acceptance Criteria:**
23811
+ ${criteria}`;
23812
+ }
23813
+
23597
23814
  // src/prompts/loader.ts
23598
23815
  var exports_loader = {};
23599
23816
  __export(exports_loader, {
@@ -23667,13 +23884,14 @@ ${this._constitution}`);
23667
23884
  }
23668
23885
  sections.push(await this._resolveRoleBody());
23669
23886
  if (this._story) {
23670
- sections.push(buildStoryContext2(this._story));
23887
+ sections.push(buildStorySection(this._story));
23671
23888
  }
23672
- sections.push(buildIsolationRules(this._role, this._options));
23889
+ const isolation = this._options.isolation;
23890
+ sections.push(buildIsolationSection(this._role, isolation));
23673
23891
  if (this._contextMd) {
23674
23892
  sections.push(this._contextMd);
23675
23893
  }
23676
- sections.push(CONVENTIONS_FOOTER);
23894
+ sections.push(buildConventionsSection());
23677
23895
  return sections.join(SECTION_SEP);
23678
23896
  }
23679
23897
  async _resolveRoleBody() {
@@ -23692,78 +23910,17 @@ ${this._constitution}`);
23692
23910
  }
23693
23911
  } catch {}
23694
23912
  }
23695
- return buildDefaultRoleBody(this._role, this._story?.title, this._options);
23696
- }
23697
- }
23698
- function buildDefaultRoleBody(role, title = "", options = {}) {
23699
- const variant = options.variant;
23700
- switch (role) {
23701
- case "test-writer":
23702
- return `# Test Writer \u2014 "${title}"
23703
-
23704
- Your role: Write failing tests ONLY. Do NOT implement any source code.`;
23705
- case "implementer":
23706
- if (variant === "lite") {
23707
- return `# Implementer (Lite) \u2014 "${title}"
23708
-
23709
- Your role: Write tests AND implement the feature in a single session.`;
23710
- }
23711
- return `# Implementer \u2014 "${title}"
23712
-
23713
- Your role: Make all failing tests pass.`;
23714
- case "verifier":
23715
- return `# Verifier \u2014 "${title}"
23716
-
23717
- Your role: Verify the implementation and tests.`;
23718
- case "single-session":
23719
- return `# Task \u2014 "${title}"
23720
-
23721
- Your role: Write tests AND implement the feature in a single session.`;
23722
- }
23723
- }
23724
- function buildStoryContext2(story) {
23725
- return `# Story Context
23726
-
23727
- **Story:** ${story.title}
23728
-
23729
- **Description:**
23730
- ${story.description}
23731
-
23732
- **Acceptance Criteria:**
23733
- ${story.acceptanceCriteria.map((c, i) => `${i + 1}. ${c}`).join(`
23734
- `)}`;
23735
- }
23736
- function buildIsolationRules(role, options = {}) {
23737
- const header = `# Isolation Rules
23738
-
23739
- `;
23740
- const footer = `
23741
-
23742
- ${TEST_FILTER_RULE}`;
23743
- const isolation = options.isolation;
23744
- switch (role) {
23745
- case "test-writer":
23746
- if (isolation === "lite") {
23747
- return `${header}isolation scope: Primarily create test files in the test/ directory. You MAY read source files and MAY import from source files to ensure correct types/interfaces. Stub-only src/ files are allowed (empty exports, no logic). Tests must fail for the right reasons (feature not implemented).${footer}`;
23748
- }
23749
- return `${header}isolation scope: Only create or modify files in the test/ directory. Tests must fail because the feature is not yet implemented. Do NOT modify any source files in src/.${footer}`;
23750
- case "implementer":
23751
- return `${header}isolation scope: Implement source code in src/ to make the tests pass. Do NOT modify test files. Run tests frequently to track progress.${footer}`;
23752
- case "verifier":
23753
- return `${header}isolation scope: Verify and fix only \u2014 do not change behaviour unless it violates acceptance criteria. Ensure all tests pass and all criteria are met.${footer}`;
23754
- case "single-session":
23755
- return `${header}isolation scope: Write tests first (test/ directory), then implement (src/ directory). All tests must pass by the end.${footer}`;
23913
+ const variant = this._options.variant;
23914
+ return buildRoleTaskSection(this._role, variant);
23756
23915
  }
23757
23916
  }
23758
23917
  var SECTION_SEP = `
23759
23918
 
23760
23919
  ---
23761
23920
 
23762
- `, TEST_FILTER_RULE, CONVENTIONS_FOOTER = `# Conventions
23763
-
23764
- Follow existing code patterns and conventions. Write idiomatic, maintainable code. Commit your changes when done.`;
23921
+ `;
23765
23922
  var init_builder3 = __esm(() => {
23766
- TEST_FILTER_RULE = "When running tests, run ONLY test files related to your changes (e.g. `bun test ./test/specific.test.ts`). NEVER run `bun test` without a file filter" + " \u2014 full suite output will flood your context window and cause failures.";
23923
+ init_isolation2();
23767
23924
  });
23768
23925
 
23769
23926
  // src/prompts/index.ts
@@ -23828,7 +23985,7 @@ async function runTddSession(role, agent, story, config2, workdir, modelTier, be
23828
23985
  prompt = await PromptBuilder.for("implementer", { variant: lite ? "lite" : "standard" }).withLoader(workdir, config2).story(story).context(contextMarkdown).build();
23829
23986
  break;
23830
23987
  case "verifier":
23831
- prompt = await PromptBuilder.for("verifier").withLoader(workdir, config2).story(story).build();
23988
+ prompt = await PromptBuilder.for("verifier").withLoader(workdir, config2).story(story).context(contextMarkdown).build();
23832
23989
  break;
23833
23990
  }
23834
23991
  const logger = getLogger();
@@ -26737,14 +26894,14 @@ async function checkPendingStories(prd) {
26737
26894
  message: passed ? `${pendingStories.length} pending stories found` : "no pending stories to execute"
26738
26895
  };
26739
26896
  }
26740
- async function checkOptionalCommands(config2) {
26897
+ async function checkOptionalCommands(config2, workdir) {
26741
26898
  const missing = [];
26742
- if (!config2.execution.lintCommand) {
26899
+ const hasLint = config2.quality?.commands?.lint || config2.execution?.lintCommand || await hasPackageScript(workdir, "lint");
26900
+ const hasTypecheck = config2.quality?.commands?.typecheck || config2.execution?.typecheckCommand || await hasPackageScript(workdir, "typecheck");
26901
+ if (!hasLint)
26743
26902
  missing.push("lint");
26744
- }
26745
- if (!config2.execution.typecheckCommand) {
26903
+ if (!hasTypecheck)
26746
26904
  missing.push("typecheck");
26747
- }
26748
26905
  const passed = missing.length === 0;
26749
26906
  return {
26750
26907
  name: "optional-commands-configured",
@@ -26753,6 +26910,14 @@ async function checkOptionalCommands(config2) {
26753
26910
  message: passed ? "All optional commands configured" : `Optional commands not configured: ${missing.join(", ")}`
26754
26911
  };
26755
26912
  }
26913
+ async function hasPackageScript(workdir, name) {
26914
+ try {
26915
+ const pkg = await Bun.file(`${workdir}/package.json`).json();
26916
+ return Boolean(pkg?.scripts?.[name]);
26917
+ } catch {
26918
+ return false;
26919
+ }
26920
+ }
26756
26921
  async function checkGitignoreCoversNax(workdir) {
26757
26922
  const gitignorePath = `${workdir}/.gitignore`;
26758
26923
  const exists = existsSync23(gitignorePath);
@@ -26944,7 +27109,7 @@ async function runPrecheck(config2, prd, options) {
26944
27109
  () => checkClaudeMdExists(workdir),
26945
27110
  () => checkDiskSpace(),
26946
27111
  () => checkPendingStories(prd),
26947
- () => checkOptionalCommands(config2),
27112
+ () => checkOptionalCommands(config2, workdir),
26948
27113
  () => checkGitignoreCoversNax(workdir),
26949
27114
  () => checkPromptOverrideFiles(config2, workdir)
26950
27115
  ];
@@ -27686,92 +27851,6 @@ var init_escalation = __esm(() => {
27686
27851
  init_tier_escalation();
27687
27852
  });
27688
27853
 
27689
- // package.json
27690
- var package_default;
27691
- var init_package = __esm(() => {
27692
- package_default = {
27693
- name: "@nathapp/nax",
27694
- version: "0.29.0",
27695
- description: "AI Coding Agent Orchestrator \u2014 loops until done",
27696
- type: "module",
27697
- bin: {
27698
- nax: "./dist/nax.js"
27699
- },
27700
- scripts: {
27701
- prepare: "git config core.hooksPath .githooks",
27702
- dev: "bun run bin/nax.ts",
27703
- build: 'bun build bin/nax.ts --outdir dist --target bun --define "GIT_COMMIT=\\"$(git rev-parse --short HEAD)\\""',
27704
- typecheck: "bun x tsc --noEmit",
27705
- lint: "bun x biome check src/ bin/",
27706
- test: "NAX_SKIP_PRECHECK=1 bun test test/ --timeout=60000",
27707
- "test:watch": "bun test --watch",
27708
- "test:unit": "bun test ./test/unit/ --timeout=60000",
27709
- "test:integration": "bun test ./test/integration/ --timeout=60000",
27710
- "test:ui": "bun test ./test/ui/ --timeout=60000",
27711
- prepublishOnly: "bun run build"
27712
- },
27713
- dependencies: {
27714
- "@anthropic-ai/sdk": "^0.74.0",
27715
- "@types/react": "^19.2.14",
27716
- chalk: "^5.6.2",
27717
- commander: "^13.1.0",
27718
- ink: "^6.7.0",
27719
- "ink-spinner": "^5.0.0",
27720
- "ink-testing-library": "^4.0.0",
27721
- react: "^19.2.4",
27722
- zod: "^4.3.6"
27723
- },
27724
- devDependencies: {
27725
- "@biomejs/biome": "^1.9.4",
27726
- "@types/bun": "^1.3.8",
27727
- "react-devtools-core": "^7.0.1",
27728
- typescript: "^5.7.3"
27729
- },
27730
- license: "MIT",
27731
- author: "William Khoo",
27732
- keywords: [
27733
- "ai",
27734
- "agent",
27735
- "orchestrator",
27736
- "tdd",
27737
- "coding"
27738
- ],
27739
- files: [
27740
- "dist/",
27741
- "src/",
27742
- "bin/",
27743
- "README.md",
27744
- "CHANGELOG.md"
27745
- ]
27746
- };
27747
- });
27748
-
27749
- // src/version.ts
27750
- var NAX_VERSION, NAX_COMMIT, NAX_BUILD_INFO;
27751
- var init_version = __esm(() => {
27752
- init_package();
27753
- NAX_VERSION = package_default.version;
27754
- NAX_COMMIT = (() => {
27755
- try {
27756
- if (/^[0-9a-f]{6,10}$/.test("eaa6801"))
27757
- return "eaa6801";
27758
- } catch {}
27759
- try {
27760
- const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
27761
- cwd: import.meta.dir,
27762
- stderr: "ignore"
27763
- });
27764
- if (result.exitCode === 0) {
27765
- const hash2 = result.stdout.toString().trim();
27766
- if (/^[0-9a-f]{6,10}$/.test(hash2))
27767
- return hash2;
27768
- }
27769
- } catch {}
27770
- return "dev";
27771
- })();
27772
- NAX_BUILD_INFO = NAX_COMMIT === "dev" ? `v${NAX_VERSION}` : `v${NAX_VERSION} (${NAX_COMMIT})`;
27773
- });
27774
-
27775
27854
  // src/execution/status-file.ts
27776
27855
  import { rename, unlink as unlink2 } from "fs/promises";
27777
27856
  import { resolve as resolve8 } from "path";
@@ -28322,16 +28401,14 @@ __export(exports_headless_formatter, {
28322
28401
  outputRunHeader: () => outputRunHeader,
28323
28402
  outputRunFooter: () => outputRunFooter
28324
28403
  });
28325
- import path15 from "path";
28326
28404
  async function outputRunHeader(options) {
28327
28405
  const { feature, totalStories, pendingStories, workdir, formatterMode } = options;
28328
28406
  if (formatterMode === "json") {
28329
28407
  return;
28330
28408
  }
28331
- const pkg = await Bun.file(path15.join(import.meta.dir, "..", "..", "..", "package.json")).json();
28332
28409
  console.log("");
28333
28410
  console.log(source_default.bold(source_default.blue("\u2550".repeat(60))));
28334
- console.log(source_default.bold(source_default.blue(` \u25B6 NAX v${pkg.version} \u2014 RUN STARTED`)));
28411
+ console.log(source_default.bold(source_default.blue(` \u25B6 NAX v${NAX_VERSION} \u2014 RUN STARTED`)));
28335
28412
  console.log(source_default.blue("\u2550".repeat(60)));
28336
28413
  console.log(` ${source_default.gray("Feature:")} ${source_default.cyan(feature)}`);
28337
28414
  console.log(` ${source_default.gray("Stories:")} ${source_default.cyan(`${totalStories} total, ${pendingStories} pending`)}`);
@@ -28363,6 +28440,7 @@ function outputRunFooter(options) {
28363
28440
  var init_headless_formatter = __esm(() => {
28364
28441
  init_source();
28365
28442
  init_logging();
28443
+ init_version();
28366
28444
  });
28367
28445
 
28368
28446
  // src/worktree/manager.ts
@@ -29031,7 +29109,7 @@ __export(exports_parallel_executor, {
29031
29109
  runParallelExecution: () => runParallelExecution
29032
29110
  });
29033
29111
  import * as os5 from "os";
29034
- import path16 from "path";
29112
+ import path15 from "path";
29035
29113
  async function runParallelExecution(options, initialPrd) {
29036
29114
  const logger = getSafeLogger();
29037
29115
  const {
@@ -29070,7 +29148,7 @@ async function runParallelExecution(options, initialPrd) {
29070
29148
  maxConcurrency,
29071
29149
  activeStories: readyStories.map((s) => ({
29072
29150
  storyId: s.id,
29073
- worktreePath: path16.join(workdir, ".nax-wt", s.id)
29151
+ worktreePath: path15.join(workdir, ".nax-wt", s.id)
29074
29152
  }))
29075
29153
  }
29076
29154
  });
@@ -29958,11 +30036,11 @@ var exports_acceptance_loop = {};
29958
30036
  __export(exports_acceptance_loop, {
29959
30037
  runAcceptanceLoop: () => runAcceptanceLoop
29960
30038
  });
29961
- import path17 from "path";
30039
+ import path16 from "path";
29962
30040
  async function loadSpecContent(featureDir) {
29963
30041
  if (!featureDir)
29964
30042
  return "";
29965
- const specPath = path17.join(featureDir, "spec.md");
30043
+ const specPath = path16.join(featureDir, "spec.md");
29966
30044
  const specFile = Bun.file(specPath);
29967
30045
  return await specFile.exists() ? await specFile.text() : "";
29968
30046
  }
@@ -31783,11 +31861,11 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
31783
31861
  fiber = fiber.next, id--;
31784
31862
  return fiber;
31785
31863
  }
31786
- function copyWithSetImpl(obj, path18, index, value) {
31787
- if (index >= path18.length)
31864
+ function copyWithSetImpl(obj, path17, index, value) {
31865
+ if (index >= path17.length)
31788
31866
  return value;
31789
- var key = path18[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
31790
- updated[key] = copyWithSetImpl(obj[key], path18, index + 1, value);
31867
+ var key = path17[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
31868
+ updated[key] = copyWithSetImpl(obj[key], path17, index + 1, value);
31791
31869
  return updated;
31792
31870
  }
31793
31871
  function copyWithRename(obj, oldPath, newPath) {
@@ -31807,11 +31885,11 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
31807
31885
  index + 1 === oldPath.length ? (updated[newPath[index]] = updated[oldKey], isArrayImpl(updated) ? updated.splice(oldKey, 1) : delete updated[oldKey]) : updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index + 1);
31808
31886
  return updated;
31809
31887
  }
31810
- function copyWithDeleteImpl(obj, path18, index) {
31811
- var key = path18[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
31812
- if (index + 1 === path18.length)
31888
+ function copyWithDeleteImpl(obj, path17, index) {
31889
+ var key = path17[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
31890
+ if (index + 1 === path17.length)
31813
31891
  return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
31814
- updated[key] = copyWithDeleteImpl(obj[key], path18, index + 1);
31892
+ updated[key] = copyWithDeleteImpl(obj[key], path17, index + 1);
31815
31893
  return updated;
31816
31894
  }
31817
31895
  function shouldSuspendImpl() {
@@ -41834,29 +41912,29 @@ Check the top-level render call using <` + componentName2 + ">.");
41834
41912
  var didWarnAboutNestedUpdates = false;
41835
41913
  var didWarnAboutFindNodeInStrictMode = {};
41836
41914
  var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
41837
- overrideHookState = function(fiber, id, path18, value) {
41915
+ overrideHookState = function(fiber, id, path17, value) {
41838
41916
  id = findHook(fiber, id);
41839
- id !== null && (path18 = copyWithSetImpl(id.memoizedState, path18, 0, value), id.memoizedState = path18, id.baseState = path18, fiber.memoizedProps = assign({}, fiber.memoizedProps), path18 = enqueueConcurrentRenderForLane(fiber, 2), path18 !== null && scheduleUpdateOnFiber(path18, fiber, 2));
41917
+ id !== null && (path17 = copyWithSetImpl(id.memoizedState, path17, 0, value), id.memoizedState = path17, id.baseState = path17, fiber.memoizedProps = assign({}, fiber.memoizedProps), path17 = enqueueConcurrentRenderForLane(fiber, 2), path17 !== null && scheduleUpdateOnFiber(path17, fiber, 2));
41840
41918
  };
41841
- overrideHookStateDeletePath = function(fiber, id, path18) {
41919
+ overrideHookStateDeletePath = function(fiber, id, path17) {
41842
41920
  id = findHook(fiber, id);
41843
- id !== null && (path18 = copyWithDeleteImpl(id.memoizedState, path18, 0), id.memoizedState = path18, id.baseState = path18, fiber.memoizedProps = assign({}, fiber.memoizedProps), path18 = enqueueConcurrentRenderForLane(fiber, 2), path18 !== null && scheduleUpdateOnFiber(path18, fiber, 2));
41921
+ id !== null && (path17 = copyWithDeleteImpl(id.memoizedState, path17, 0), id.memoizedState = path17, id.baseState = path17, fiber.memoizedProps = assign({}, fiber.memoizedProps), path17 = enqueueConcurrentRenderForLane(fiber, 2), path17 !== null && scheduleUpdateOnFiber(path17, fiber, 2));
41844
41922
  };
41845
41923
  overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
41846
41924
  id = findHook(fiber, id);
41847
41925
  id !== null && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), oldPath !== null && scheduleUpdateOnFiber(oldPath, fiber, 2));
41848
41926
  };
41849
- overrideProps = function(fiber, path18, value) {
41850
- fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path18, 0, value);
41927
+ overrideProps = function(fiber, path17, value) {
41928
+ fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path17, 0, value);
41851
41929
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
41852
- path18 = enqueueConcurrentRenderForLane(fiber, 2);
41853
- path18 !== null && scheduleUpdateOnFiber(path18, fiber, 2);
41930
+ path17 = enqueueConcurrentRenderForLane(fiber, 2);
41931
+ path17 !== null && scheduleUpdateOnFiber(path17, fiber, 2);
41854
41932
  };
41855
- overridePropsDeletePath = function(fiber, path18) {
41856
- fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path18, 0);
41933
+ overridePropsDeletePath = function(fiber, path17) {
41934
+ fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path17, 0);
41857
41935
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
41858
- path18 = enqueueConcurrentRenderForLane(fiber, 2);
41859
- path18 !== null && scheduleUpdateOnFiber(path18, fiber, 2);
41936
+ path17 = enqueueConcurrentRenderForLane(fiber, 2);
41937
+ path17 !== null && scheduleUpdateOnFiber(path17, fiber, 2);
41860
41938
  };
41861
41939
  overridePropsRenamePath = function(fiber, oldPath, newPath) {
41862
41940
  fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
@@ -45911,8 +45989,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
45911
45989
  }
45912
45990
  return false;
45913
45991
  }
45914
- function utils_getInObject(object2, path18) {
45915
- return path18.reduce(function(reduced, attr) {
45992
+ function utils_getInObject(object2, path17) {
45993
+ return path17.reduce(function(reduced, attr) {
45916
45994
  if (reduced) {
45917
45995
  if (utils_hasOwnProperty.call(reduced, attr)) {
45918
45996
  return reduced[attr];
@@ -45924,11 +46002,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
45924
46002
  return null;
45925
46003
  }, object2);
45926
46004
  }
45927
- function deletePathInObject(object2, path18) {
45928
- var length = path18.length;
45929
- var last = path18[length - 1];
46005
+ function deletePathInObject(object2, path17) {
46006
+ var length = path17.length;
46007
+ var last = path17[length - 1];
45930
46008
  if (object2 != null) {
45931
- var parent = utils_getInObject(object2, path18.slice(0, length - 1));
46009
+ var parent = utils_getInObject(object2, path17.slice(0, length - 1));
45932
46010
  if (parent) {
45933
46011
  if (src_isArray(parent)) {
45934
46012
  parent.splice(last, 1);
@@ -45954,11 +46032,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
45954
46032
  }
45955
46033
  }
45956
46034
  }
45957
- function utils_setInObject(object2, path18, value) {
45958
- var length = path18.length;
45959
- var last = path18[length - 1];
46035
+ function utils_setInObject(object2, path17, value) {
46036
+ var length = path17.length;
46037
+ var last = path17[length - 1];
45960
46038
  if (object2 != null) {
45961
- var parent = utils_getInObject(object2, path18.slice(0, length - 1));
46039
+ var parent = utils_getInObject(object2, path17.slice(0, length - 1));
45962
46040
  if (parent) {
45963
46041
  parent[last] = value;
45964
46042
  }
@@ -46489,8 +46567,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46489
46567
  unserializable: Symbol("unserializable")
46490
46568
  };
46491
46569
  var LEVEL_THRESHOLD = 2;
46492
- function createDehydrated(type, inspectable, data, cleaned, path18) {
46493
- cleaned.push(path18);
46570
+ function createDehydrated(type, inspectable, data, cleaned, path17) {
46571
+ cleaned.push(path17);
46494
46572
  var dehydrated = {
46495
46573
  inspectable,
46496
46574
  type,
@@ -46508,13 +46586,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46508
46586
  }
46509
46587
  return dehydrated;
46510
46588
  }
46511
- function dehydrate(data, cleaned, unserializable, path18, isPathAllowed) {
46589
+ function dehydrate(data, cleaned, unserializable, path17, isPathAllowed) {
46512
46590
  var level = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
46513
46591
  var type = getDataType(data);
46514
46592
  var isPathAllowedCheck;
46515
46593
  switch (type) {
46516
46594
  case "html_element":
46517
- cleaned.push(path18);
46595
+ cleaned.push(path17);
46518
46596
  return {
46519
46597
  inspectable: false,
46520
46598
  preview_short: formatDataForPreview(data, false),
@@ -46523,7 +46601,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46523
46601
  type
46524
46602
  };
46525
46603
  case "function":
46526
- cleaned.push(path18);
46604
+ cleaned.push(path17);
46527
46605
  return {
46528
46606
  inspectable: false,
46529
46607
  preview_short: formatDataForPreview(data, false),
@@ -46532,14 +46610,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46532
46610
  type
46533
46611
  };
46534
46612
  case "string":
46535
- isPathAllowedCheck = isPathAllowed(path18);
46613
+ isPathAllowedCheck = isPathAllowed(path17);
46536
46614
  if (isPathAllowedCheck) {
46537
46615
  return data;
46538
46616
  } else {
46539
46617
  return data.length <= 500 ? data : data.slice(0, 500) + "...";
46540
46618
  }
46541
46619
  case "bigint":
46542
- cleaned.push(path18);
46620
+ cleaned.push(path17);
46543
46621
  return {
46544
46622
  inspectable: false,
46545
46623
  preview_short: formatDataForPreview(data, false),
@@ -46548,7 +46626,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46548
46626
  type
46549
46627
  };
46550
46628
  case "symbol":
46551
- cleaned.push(path18);
46629
+ cleaned.push(path17);
46552
46630
  return {
46553
46631
  inspectable: false,
46554
46632
  preview_short: formatDataForPreview(data, false),
@@ -46557,9 +46635,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46557
46635
  type
46558
46636
  };
46559
46637
  case "react_element": {
46560
- isPathAllowedCheck = isPathAllowed(path18);
46638
+ isPathAllowedCheck = isPathAllowed(path17);
46561
46639
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46562
- cleaned.push(path18);
46640
+ cleaned.push(path17);
46563
46641
  return {
46564
46642
  inspectable: true,
46565
46643
  preview_short: formatDataForPreview(data, false),
@@ -46576,19 +46654,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46576
46654
  preview_long: formatDataForPreview(data, true),
46577
46655
  name: getDisplayNameForReactElement(data) || "Unknown"
46578
46656
  };
46579
- unserializableValue.key = dehydrate(data.key, cleaned, unserializable, path18.concat(["key"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46657
+ unserializableValue.key = dehydrate(data.key, cleaned, unserializable, path17.concat(["key"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46580
46658
  if (data.$$typeof === REACT_LEGACY_ELEMENT_TYPE) {
46581
- unserializableValue.ref = dehydrate(data.ref, cleaned, unserializable, path18.concat(["ref"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46659
+ unserializableValue.ref = dehydrate(data.ref, cleaned, unserializable, path17.concat(["ref"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46582
46660
  }
46583
- unserializableValue.props = dehydrate(data.props, cleaned, unserializable, path18.concat(["props"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46584
- unserializable.push(path18);
46661
+ unserializableValue.props = dehydrate(data.props, cleaned, unserializable, path17.concat(["props"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46662
+ unserializable.push(path17);
46585
46663
  return unserializableValue;
46586
46664
  }
46587
46665
  case "react_lazy": {
46588
- isPathAllowedCheck = isPathAllowed(path18);
46666
+ isPathAllowedCheck = isPathAllowed(path17);
46589
46667
  var payload = data._payload;
46590
46668
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46591
- cleaned.push(path18);
46669
+ cleaned.push(path17);
46592
46670
  var inspectable = payload !== null && hydration_typeof(payload) === "object" && (payload._status === 1 || payload._status === 2 || payload.status === "fulfilled" || payload.status === "rejected");
46593
46671
  return {
46594
46672
  inspectable,
@@ -46605,13 +46683,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46605
46683
  preview_long: formatDataForPreview(data, true),
46606
46684
  name: "lazy()"
46607
46685
  };
46608
- _unserializableValue._payload = dehydrate(payload, cleaned, unserializable, path18.concat(["_payload"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46609
- unserializable.push(path18);
46686
+ _unserializableValue._payload = dehydrate(payload, cleaned, unserializable, path17.concat(["_payload"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46687
+ unserializable.push(path17);
46610
46688
  return _unserializableValue;
46611
46689
  }
46612
46690
  case "array_buffer":
46613
46691
  case "data_view":
46614
- cleaned.push(path18);
46692
+ cleaned.push(path17);
46615
46693
  return {
46616
46694
  inspectable: false,
46617
46695
  preview_short: formatDataForPreview(data, false),
@@ -46621,21 +46699,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46621
46699
  type
46622
46700
  };
46623
46701
  case "array":
46624
- isPathAllowedCheck = isPathAllowed(path18);
46702
+ isPathAllowedCheck = isPathAllowed(path17);
46625
46703
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46626
- return createDehydrated(type, true, data, cleaned, path18);
46704
+ return createDehydrated(type, true, data, cleaned, path17);
46627
46705
  }
46628
46706
  var arr = [];
46629
46707
  for (var i = 0;i < data.length; i++) {
46630
- arr[i] = dehydrateKey(data, i, cleaned, unserializable, path18.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46708
+ arr[i] = dehydrateKey(data, i, cleaned, unserializable, path17.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46631
46709
  }
46632
46710
  return arr;
46633
46711
  case "html_all_collection":
46634
46712
  case "typed_array":
46635
46713
  case "iterator":
46636
- isPathAllowedCheck = isPathAllowed(path18);
46714
+ isPathAllowedCheck = isPathAllowed(path17);
46637
46715
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46638
- return createDehydrated(type, true, data, cleaned, path18);
46716
+ return createDehydrated(type, true, data, cleaned, path17);
46639
46717
  } else {
46640
46718
  var _unserializableValue2 = {
46641
46719
  unserializable: true,
@@ -46647,13 +46725,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46647
46725
  name: typeof data.constructor !== "function" || typeof data.constructor.name !== "string" || data.constructor.name === "Object" ? "" : data.constructor.name
46648
46726
  };
46649
46727
  Array.from(data).forEach(function(item, i2) {
46650
- return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable, path18.concat([i2]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46728
+ return _unserializableValue2[i2] = dehydrate(item, cleaned, unserializable, path17.concat([i2]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46651
46729
  });
46652
- unserializable.push(path18);
46730
+ unserializable.push(path17);
46653
46731
  return _unserializableValue2;
46654
46732
  }
46655
46733
  case "opaque_iterator":
46656
- cleaned.push(path18);
46734
+ cleaned.push(path17);
46657
46735
  return {
46658
46736
  inspectable: false,
46659
46737
  preview_short: formatDataForPreview(data, false),
@@ -46662,7 +46740,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46662
46740
  type
46663
46741
  };
46664
46742
  case "date":
46665
- cleaned.push(path18);
46743
+ cleaned.push(path17);
46666
46744
  return {
46667
46745
  inspectable: false,
46668
46746
  preview_short: formatDataForPreview(data, false),
@@ -46671,7 +46749,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46671
46749
  type
46672
46750
  };
46673
46751
  case "regexp":
46674
- cleaned.push(path18);
46752
+ cleaned.push(path17);
46675
46753
  return {
46676
46754
  inspectable: false,
46677
46755
  preview_short: formatDataForPreview(data, false),
@@ -46680,9 +46758,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46680
46758
  type
46681
46759
  };
46682
46760
  case "thenable":
46683
- isPathAllowedCheck = isPathAllowed(path18);
46761
+ isPathAllowedCheck = isPathAllowed(path17);
46684
46762
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46685
- cleaned.push(path18);
46763
+ cleaned.push(path17);
46686
46764
  return {
46687
46765
  inspectable: data.status === "fulfilled" || data.status === "rejected",
46688
46766
  preview_short: formatDataForPreview(data, false),
@@ -46703,8 +46781,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46703
46781
  preview_long: formatDataForPreview(data, true),
46704
46782
  name: "fulfilled Thenable"
46705
46783
  };
46706
- _unserializableValue3.value = dehydrate(data.value, cleaned, unserializable, path18.concat(["value"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46707
- unserializable.push(path18);
46784
+ _unserializableValue3.value = dehydrate(data.value, cleaned, unserializable, path17.concat(["value"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46785
+ unserializable.push(path17);
46708
46786
  return _unserializableValue3;
46709
46787
  }
46710
46788
  case "rejected": {
@@ -46715,12 +46793,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46715
46793
  preview_long: formatDataForPreview(data, true),
46716
46794
  name: "rejected Thenable"
46717
46795
  };
46718
- _unserializableValue4.reason = dehydrate(data.reason, cleaned, unserializable, path18.concat(["reason"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46719
- unserializable.push(path18);
46796
+ _unserializableValue4.reason = dehydrate(data.reason, cleaned, unserializable, path17.concat(["reason"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46797
+ unserializable.push(path17);
46720
46798
  return _unserializableValue4;
46721
46799
  }
46722
46800
  default:
46723
- cleaned.push(path18);
46801
+ cleaned.push(path17);
46724
46802
  return {
46725
46803
  inspectable: false,
46726
46804
  preview_short: formatDataForPreview(data, false),
@@ -46730,21 +46808,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46730
46808
  };
46731
46809
  }
46732
46810
  case "object":
46733
- isPathAllowedCheck = isPathAllowed(path18);
46811
+ isPathAllowedCheck = isPathAllowed(path17);
46734
46812
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46735
- return createDehydrated(type, true, data, cleaned, path18);
46813
+ return createDehydrated(type, true, data, cleaned, path17);
46736
46814
  } else {
46737
46815
  var object2 = {};
46738
46816
  getAllEnumerableKeys(data).forEach(function(key) {
46739
46817
  var name = key.toString();
46740
- object2[name] = dehydrateKey(data, key, cleaned, unserializable, path18.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46818
+ object2[name] = dehydrateKey(data, key, cleaned, unserializable, path17.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46741
46819
  });
46742
46820
  return object2;
46743
46821
  }
46744
46822
  case "class_instance": {
46745
- isPathAllowedCheck = isPathAllowed(path18);
46823
+ isPathAllowedCheck = isPathAllowed(path17);
46746
46824
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46747
- return createDehydrated(type, true, data, cleaned, path18);
46825
+ return createDehydrated(type, true, data, cleaned, path17);
46748
46826
  }
46749
46827
  var value = {
46750
46828
  unserializable: true,
@@ -46756,15 +46834,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46756
46834
  };
46757
46835
  getAllEnumerableKeys(data).forEach(function(key) {
46758
46836
  var keyAsString = key.toString();
46759
- value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path18.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46837
+ value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path17.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46760
46838
  });
46761
- unserializable.push(path18);
46839
+ unserializable.push(path17);
46762
46840
  return value;
46763
46841
  }
46764
46842
  case "error": {
46765
- isPathAllowedCheck = isPathAllowed(path18);
46843
+ isPathAllowedCheck = isPathAllowed(path17);
46766
46844
  if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) {
46767
- return createDehydrated(type, true, data, cleaned, path18);
46845
+ return createDehydrated(type, true, data, cleaned, path17);
46768
46846
  }
46769
46847
  var _value = {
46770
46848
  unserializable: true,
@@ -46774,22 +46852,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46774
46852
  preview_long: formatDataForPreview(data, true),
46775
46853
  name: data.name
46776
46854
  };
46777
- _value.message = dehydrate(data.message, cleaned, unserializable, path18.concat(["message"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46778
- _value.stack = dehydrate(data.stack, cleaned, unserializable, path18.concat(["stack"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46855
+ _value.message = dehydrate(data.message, cleaned, unserializable, path17.concat(["message"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46856
+ _value.stack = dehydrate(data.stack, cleaned, unserializable, path17.concat(["stack"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46779
46857
  if ("cause" in data) {
46780
- _value.cause = dehydrate(data.cause, cleaned, unserializable, path18.concat(["cause"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46858
+ _value.cause = dehydrate(data.cause, cleaned, unserializable, path17.concat(["cause"]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46781
46859
  }
46782
46860
  getAllEnumerableKeys(data).forEach(function(key) {
46783
46861
  var keyAsString = key.toString();
46784
- _value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path18.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46862
+ _value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path17.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1);
46785
46863
  });
46786
- unserializable.push(path18);
46864
+ unserializable.push(path17);
46787
46865
  return _value;
46788
46866
  }
46789
46867
  case "infinity":
46790
46868
  case "nan":
46791
46869
  case "undefined":
46792
- cleaned.push(path18);
46870
+ cleaned.push(path17);
46793
46871
  return {
46794
46872
  type
46795
46873
  };
@@ -46797,10 +46875,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46797
46875
  return data;
46798
46876
  }
46799
46877
  }
46800
- function dehydrateKey(parent, key, cleaned, unserializable, path18, isPathAllowed) {
46878
+ function dehydrateKey(parent, key, cleaned, unserializable, path17, isPathAllowed) {
46801
46879
  var level = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
46802
46880
  try {
46803
- return dehydrate(parent[key], cleaned, unserializable, path18, isPathAllowed, level);
46881
+ return dehydrate(parent[key], cleaned, unserializable, path17, isPathAllowed, level);
46804
46882
  } catch (error48) {
46805
46883
  var preview = "";
46806
46884
  if (hydration_typeof(error48) === "object" && error48 !== null && typeof error48.stack === "string") {
@@ -46808,7 +46886,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46808
46886
  } else if (typeof error48 === "string") {
46809
46887
  preview = error48;
46810
46888
  }
46811
- cleaned.push(path18);
46889
+ cleaned.push(path17);
46812
46890
  return {
46813
46891
  inspectable: false,
46814
46892
  preview_short: "[Exception]",
@@ -46818,8 +46896,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46818
46896
  };
46819
46897
  }
46820
46898
  }
46821
- function fillInPath(object2, data, path18, value) {
46822
- var target = getInObject(object2, path18);
46899
+ function fillInPath(object2, data, path17, value) {
46900
+ var target = getInObject(object2, path17);
46823
46901
  if (target != null) {
46824
46902
  if (!target[meta3.unserializable]) {
46825
46903
  delete target[meta3.inspectable];
@@ -46834,9 +46912,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46834
46912
  }
46835
46913
  if (value !== null && data.unserializable.length > 0) {
46836
46914
  var unserializablePath = data.unserializable[0];
46837
- var isMatch = unserializablePath.length === path18.length;
46838
- for (var i = 0;i < path18.length; i++) {
46839
- if (path18[i] !== unserializablePath[i]) {
46915
+ var isMatch = unserializablePath.length === path17.length;
46916
+ for (var i = 0;i < path17.length; i++) {
46917
+ if (path17[i] !== unserializablePath[i]) {
46840
46918
  isMatch = false;
46841
46919
  break;
46842
46920
  }
@@ -46845,13 +46923,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46845
46923
  upgradeUnserializable(value, value);
46846
46924
  }
46847
46925
  }
46848
- setInObject(object2, path18, value);
46926
+ setInObject(object2, path17, value);
46849
46927
  }
46850
46928
  function hydrate(object2, cleaned, unserializable) {
46851
- cleaned.forEach(function(path18) {
46852
- var length = path18.length;
46853
- var last = path18[length - 1];
46854
- var parent = getInObject(object2, path18.slice(0, length - 1));
46929
+ cleaned.forEach(function(path17) {
46930
+ var length = path17.length;
46931
+ var last = path17[length - 1];
46932
+ var parent = getInObject(object2, path17.slice(0, length - 1));
46855
46933
  if (!parent || !parent.hasOwnProperty(last)) {
46856
46934
  return;
46857
46935
  }
@@ -46877,10 +46955,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46877
46955
  parent[last] = replaced;
46878
46956
  }
46879
46957
  });
46880
- unserializable.forEach(function(path18) {
46881
- var length = path18.length;
46882
- var last = path18[length - 1];
46883
- var parent = getInObject(object2, path18.slice(0, length - 1));
46958
+ unserializable.forEach(function(path17) {
46959
+ var length = path17.length;
46960
+ var last = path17[length - 1];
46961
+ var parent = getInObject(object2, path17.slice(0, length - 1));
46884
46962
  if (!parent || !parent.hasOwnProperty(last)) {
46885
46963
  return;
46886
46964
  }
@@ -47001,11 +47079,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47001
47079
  return gte(version2, FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER);
47002
47080
  }
47003
47081
  function cleanForBridge(data, isPathAllowed) {
47004
- var path18 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
47082
+ var path17 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
47005
47083
  if (data !== null) {
47006
47084
  var cleanedPaths = [];
47007
47085
  var unserializablePaths = [];
47008
- var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths, path18, isPathAllowed);
47086
+ var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths, path17, isPathAllowed);
47009
47087
  return {
47010
47088
  data: cleanedData,
47011
47089
  cleaned: cleanedPaths,
@@ -47015,18 +47093,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47015
47093
  return null;
47016
47094
  }
47017
47095
  }
47018
- function copyWithDelete(obj, path18) {
47096
+ function copyWithDelete(obj, path17) {
47019
47097
  var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
47020
- var key = path18[index];
47098
+ var key = path17[index];
47021
47099
  var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj);
47022
- if (index + 1 === path18.length) {
47100
+ if (index + 1 === path17.length) {
47023
47101
  if (shared_isArray(updated)) {
47024
47102
  updated.splice(key, 1);
47025
47103
  } else {
47026
47104
  delete updated[key];
47027
47105
  }
47028
47106
  } else {
47029
- updated[key] = copyWithDelete(obj[key], path18, index + 1);
47107
+ updated[key] = copyWithDelete(obj[key], path17, index + 1);
47030
47108
  }
47031
47109
  return updated;
47032
47110
  }
@@ -47047,14 +47125,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47047
47125
  }
47048
47126
  return updated;
47049
47127
  }
47050
- function copyWithSet(obj, path18, value) {
47128
+ function copyWithSet(obj, path17, value) {
47051
47129
  var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
47052
- if (index >= path18.length) {
47130
+ if (index >= path17.length) {
47053
47131
  return value;
47054
47132
  }
47055
- var key = path18[index];
47133
+ var key = path17[index];
47056
47134
  var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj);
47057
- updated[key] = copyWithSet(obj[key], path18, value, index + 1);
47135
+ updated[key] = copyWithSet(obj[key], path17, value, index + 1);
47058
47136
  return updated;
47059
47137
  }
47060
47138
  function getEffectDurations(root) {
@@ -48382,12 +48460,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48382
48460
  }
48383
48461
  });
48384
48462
  bridge_defineProperty(_this, "overrideValueAtPath", function(_ref) {
48385
- var { id, path: path18, rendererID, type, value } = _ref;
48463
+ var { id, path: path17, rendererID, type, value } = _ref;
48386
48464
  switch (type) {
48387
48465
  case "context":
48388
48466
  _this.send("overrideContext", {
48389
48467
  id,
48390
- path: path18,
48468
+ path: path17,
48391
48469
  rendererID,
48392
48470
  wasForwarded: true,
48393
48471
  value
@@ -48396,7 +48474,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48396
48474
  case "hooks":
48397
48475
  _this.send("overrideHookState", {
48398
48476
  id,
48399
- path: path18,
48477
+ path: path17,
48400
48478
  rendererID,
48401
48479
  wasForwarded: true,
48402
48480
  value
@@ -48405,7 +48483,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48405
48483
  case "props":
48406
48484
  _this.send("overrideProps", {
48407
48485
  id,
48408
- path: path18,
48486
+ path: path17,
48409
48487
  rendererID,
48410
48488
  wasForwarded: true,
48411
48489
  value
@@ -48414,7 +48492,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48414
48492
  case "state":
48415
48493
  _this.send("overrideState", {
48416
48494
  id,
48417
- path: path18,
48495
+ path: path17,
48418
48496
  rendererID,
48419
48497
  wasForwarded: true,
48420
48498
  value
@@ -48748,12 +48826,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48748
48826
  }
48749
48827
  });
48750
48828
  agent_defineProperty(_this, "copyElementPath", function(_ref5) {
48751
- var { id, path: path18, rendererID } = _ref5;
48829
+ var { id, path: path17, rendererID } = _ref5;
48752
48830
  var renderer = _this._rendererInterfaces[rendererID];
48753
48831
  if (renderer == null) {
48754
48832
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
48755
48833
  } else {
48756
- var value = renderer.getSerializedElementValueByPath(id, path18);
48834
+ var value = renderer.getSerializedElementValueByPath(id, path17);
48757
48835
  if (value != null) {
48758
48836
  _this._bridge.send("saveToClipboard", value);
48759
48837
  } else {
@@ -48762,12 +48840,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48762
48840
  }
48763
48841
  });
48764
48842
  agent_defineProperty(_this, "deletePath", function(_ref6) {
48765
- var { hookID, id, path: path18, rendererID, type } = _ref6;
48843
+ var { hookID, id, path: path17, rendererID, type } = _ref6;
48766
48844
  var renderer = _this._rendererInterfaces[rendererID];
48767
48845
  if (renderer == null) {
48768
48846
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
48769
48847
  } else {
48770
- renderer.deletePath(type, id, hookID, path18);
48848
+ renderer.deletePath(type, id, hookID, path17);
48771
48849
  }
48772
48850
  });
48773
48851
  agent_defineProperty(_this, "getBackendVersion", function() {
@@ -48804,12 +48882,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48804
48882
  }
48805
48883
  });
48806
48884
  agent_defineProperty(_this, "inspectElement", function(_ref9) {
48807
- var { forceFullData, id, path: path18, rendererID, requestID } = _ref9;
48885
+ var { forceFullData, id, path: path17, rendererID, requestID } = _ref9;
48808
48886
  var renderer = _this._rendererInterfaces[rendererID];
48809
48887
  if (renderer == null) {
48810
48888
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
48811
48889
  } else {
48812
- _this._bridge.send("inspectedElement", renderer.inspectElement(requestID, id, path18, forceFullData));
48890
+ _this._bridge.send("inspectedElement", renderer.inspectElement(requestID, id, path17, forceFullData));
48813
48891
  if (_this._persistedSelectionMatch === null || _this._persistedSelectionMatch.id !== id) {
48814
48892
  _this._persistedSelection = null;
48815
48893
  _this._persistedSelectionMatch = null;
@@ -48843,15 +48921,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48843
48921
  }
48844
48922
  for (var rendererID in _this._rendererInterfaces) {
48845
48923
  var renderer = _this._rendererInterfaces[rendererID];
48846
- var path18 = null;
48924
+ var path17 = null;
48847
48925
  if (suspendedByPathIndex !== null && rendererPath !== null) {
48848
48926
  var suspendedByPathRendererIndex = suspendedByPathIndex - suspendedByOffset;
48849
48927
  var rendererHasRequestedSuspendedByPath = renderer.getElementAttributeByPath(id, ["suspendedBy", suspendedByPathRendererIndex]) !== undefined;
48850
48928
  if (rendererHasRequestedSuspendedByPath) {
48851
- path18 = ["suspendedBy", suspendedByPathRendererIndex].concat(rendererPath);
48929
+ path17 = ["suspendedBy", suspendedByPathRendererIndex].concat(rendererPath);
48852
48930
  }
48853
48931
  }
48854
- var inspectedRootsPayload = renderer.inspectElement(requestID, id, path18, forceFullData);
48932
+ var inspectedRootsPayload = renderer.inspectElement(requestID, id, path17, forceFullData);
48855
48933
  switch (inspectedRootsPayload.type) {
48856
48934
  case "hydrated-path":
48857
48935
  inspectedRootsPayload.path[1] += suspendedByOffset;
@@ -48945,20 +49023,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48945
49023
  }
48946
49024
  });
48947
49025
  agent_defineProperty(_this, "overrideValueAtPath", function(_ref15) {
48948
- var { hookID, id, path: path18, rendererID, type, value } = _ref15;
49026
+ var { hookID, id, path: path17, rendererID, type, value } = _ref15;
48949
49027
  var renderer = _this._rendererInterfaces[rendererID];
48950
49028
  if (renderer == null) {
48951
49029
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
48952
49030
  } else {
48953
- renderer.overrideValueAtPath(type, id, hookID, path18, value);
49031
+ renderer.overrideValueAtPath(type, id, hookID, path17, value);
48954
49032
  }
48955
49033
  });
48956
49034
  agent_defineProperty(_this, "overrideContext", function(_ref16) {
48957
- var { id, path: path18, rendererID, wasForwarded, value } = _ref16;
49035
+ var { id, path: path17, rendererID, wasForwarded, value } = _ref16;
48958
49036
  if (!wasForwarded) {
48959
49037
  _this.overrideValueAtPath({
48960
49038
  id,
48961
- path: path18,
49039
+ path: path17,
48962
49040
  rendererID,
48963
49041
  type: "context",
48964
49042
  value
@@ -48966,11 +49044,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48966
49044
  }
48967
49045
  });
48968
49046
  agent_defineProperty(_this, "overrideHookState", function(_ref17) {
48969
- var { id, hookID, path: path18, rendererID, wasForwarded, value } = _ref17;
49047
+ var { id, hookID, path: path17, rendererID, wasForwarded, value } = _ref17;
48970
49048
  if (!wasForwarded) {
48971
49049
  _this.overrideValueAtPath({
48972
49050
  id,
48973
- path: path18,
49051
+ path: path17,
48974
49052
  rendererID,
48975
49053
  type: "hooks",
48976
49054
  value
@@ -48978,11 +49056,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48978
49056
  }
48979
49057
  });
48980
49058
  agent_defineProperty(_this, "overrideProps", function(_ref18) {
48981
- var { id, path: path18, rendererID, wasForwarded, value } = _ref18;
49059
+ var { id, path: path17, rendererID, wasForwarded, value } = _ref18;
48982
49060
  if (!wasForwarded) {
48983
49061
  _this.overrideValueAtPath({
48984
49062
  id,
48985
- path: path18,
49063
+ path: path17,
48986
49064
  rendererID,
48987
49065
  type: "props",
48988
49066
  value
@@ -48990,11 +49068,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48990
49068
  }
48991
49069
  });
48992
49070
  agent_defineProperty(_this, "overrideState", function(_ref19) {
48993
- var { id, path: path18, rendererID, wasForwarded, value } = _ref19;
49071
+ var { id, path: path17, rendererID, wasForwarded, value } = _ref19;
48994
49072
  if (!wasForwarded) {
48995
49073
  _this.overrideValueAtPath({
48996
49074
  id,
48997
- path: path18,
49075
+ path: path17,
48998
49076
  rendererID,
48999
49077
  type: "state",
49000
49078
  value
@@ -49061,12 +49139,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
49061
49139
  _this._bridge.send("stopInspectingHost", selected);
49062
49140
  });
49063
49141
  agent_defineProperty(_this, "storeAsGlobal", function(_ref23) {
49064
- var { count, id, path: path18, rendererID } = _ref23;
49142
+ var { count, id, path: path17, rendererID } = _ref23;
49065
49143
  var renderer = _this._rendererInterfaces[rendererID];
49066
49144
  if (renderer == null) {
49067
49145
  console.warn('Invalid renderer id "'.concat(rendererID, '" for element "').concat(id, '"'));
49068
49146
  } else {
49069
- renderer.storeAsGlobal(id, path18, count);
49147
+ renderer.storeAsGlobal(id, path17, count);
49070
49148
  }
49071
49149
  });
49072
49150
  agent_defineProperty(_this, "updateHookSettings", function(settings) {
@@ -49083,12 +49161,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
49083
49161
  var rendererID = +rendererIDString;
49084
49162
  var renderer = _this._rendererInterfaces[rendererID];
49085
49163
  if (_this._lastSelectedRendererID === rendererID) {
49086
- var path18 = renderer.getPathForElement(_this._lastSelectedElementID);
49087
- if (path18 !== null) {
49088
- renderer.setTrackedPath(path18);
49164
+ var path17 = renderer.getPathForElement(_this._lastSelectedElementID);
49165
+ if (path17 !== null) {
49166
+ renderer.setTrackedPath(path17);
49089
49167
  _this._persistedSelection = {
49090
49168
  rendererID,
49091
- path: path18
49169
+ path: path17
49092
49170
  };
49093
49171
  }
49094
49172
  }
@@ -49163,11 +49241,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
49163
49241
  var rendererID = _this._lastSelectedRendererID;
49164
49242
  var id = _this._lastSelectedElementID;
49165
49243
  var renderer = _this._rendererInterfaces[rendererID];
49166
- var path18 = renderer != null ? renderer.getPathForElement(id) : null;
49167
- if (path18 !== null) {
49244
+ var path17 = renderer != null ? renderer.getPathForElement(id) : null;
49245
+ if (path17 !== null) {
49168
49246
  storage_sessionStorageSetItem(SESSION_STORAGE_LAST_SELECTION_KEY, JSON.stringify({
49169
49247
  rendererID,
49170
- path: path18
49248
+ path: path17
49171
49249
  }));
49172
49250
  } else {
49173
49251
  storage_sessionStorageRemoveItem(SESSION_STORAGE_LAST_SELECTION_KEY);
@@ -49890,7 +49968,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
49890
49968
  hasElementWithId: function hasElementWithId() {
49891
49969
  return false;
49892
49970
  },
49893
- inspectElement: function inspectElement(requestID, id, path18) {
49971
+ inspectElement: function inspectElement(requestID, id, path17) {
49894
49972
  return {
49895
49973
  id,
49896
49974
  responseID: requestID,
@@ -55160,9 +55238,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55160
55238
  }
55161
55239
  return null;
55162
55240
  }
55163
- function getElementAttributeByPath(id, path18) {
55241
+ function getElementAttributeByPath(id, path17) {
55164
55242
  if (isMostRecentlyInspectedElement(id)) {
55165
- return utils_getInObject(mostRecentlyInspectedElement, path18);
55243
+ return utils_getInObject(mostRecentlyInspectedElement, path17);
55166
55244
  }
55167
55245
  return;
55168
55246
  }
@@ -55865,9 +55943,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55865
55943
  function isMostRecentlyInspectedElementCurrent(id) {
55866
55944
  return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected;
55867
55945
  }
55868
- function mergeInspectedPaths(path18) {
55946
+ function mergeInspectedPaths(path17) {
55869
55947
  var current = currentlyInspectedPaths;
55870
- path18.forEach(function(key) {
55948
+ path17.forEach(function(key) {
55871
55949
  if (!current[key]) {
55872
55950
  current[key] = {};
55873
55951
  }
@@ -55875,21 +55953,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55875
55953
  });
55876
55954
  }
55877
55955
  function createIsPathAllowed(key, secondaryCategory) {
55878
- return function isPathAllowed(path18) {
55956
+ return function isPathAllowed(path17) {
55879
55957
  switch (secondaryCategory) {
55880
55958
  case "hooks":
55881
- if (path18.length === 1) {
55959
+ if (path17.length === 1) {
55882
55960
  return true;
55883
55961
  }
55884
- if (path18[path18.length - 2] === "hookSource" && path18[path18.length - 1] === "fileName") {
55962
+ if (path17[path17.length - 2] === "hookSource" && path17[path17.length - 1] === "fileName") {
55885
55963
  return true;
55886
55964
  }
55887
- if (path18[path18.length - 1] === "subHooks" || path18[path18.length - 2] === "subHooks") {
55965
+ if (path17[path17.length - 1] === "subHooks" || path17[path17.length - 2] === "subHooks") {
55888
55966
  return true;
55889
55967
  }
55890
55968
  break;
55891
55969
  case "suspendedBy":
55892
- if (path18.length < 5) {
55970
+ if (path17.length < 5) {
55893
55971
  return true;
55894
55972
  }
55895
55973
  break;
@@ -55900,8 +55978,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55900
55978
  if (!current) {
55901
55979
  return false;
55902
55980
  }
55903
- for (var i = 0;i < path18.length; i++) {
55904
- current = current[path18[i]];
55981
+ for (var i = 0;i < path17.length; i++) {
55982
+ current = current[path17[i]];
55905
55983
  if (!current) {
55906
55984
  return false;
55907
55985
  }
@@ -55955,38 +56033,38 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55955
56033
  break;
55956
56034
  }
55957
56035
  }
55958
- function storeAsGlobal(id, path18, count) {
56036
+ function storeAsGlobal(id, path17, count) {
55959
56037
  if (isMostRecentlyInspectedElement(id)) {
55960
- var value = utils_getInObject(mostRecentlyInspectedElement, path18);
56038
+ var value = utils_getInObject(mostRecentlyInspectedElement, path17);
55961
56039
  var key = "$reactTemp".concat(count);
55962
56040
  window[key] = value;
55963
56041
  console.log(key);
55964
56042
  console.log(value);
55965
56043
  }
55966
56044
  }
55967
- function getSerializedElementValueByPath(id, path18) {
56045
+ function getSerializedElementValueByPath(id, path17) {
55968
56046
  if (isMostRecentlyInspectedElement(id)) {
55969
- var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path18);
56047
+ var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path17);
55970
56048
  return serializeToString(valueToCopy);
55971
56049
  }
55972
56050
  }
55973
- function inspectElement(requestID, id, path18, forceFullData) {
55974
- if (path18 !== null) {
55975
- mergeInspectedPaths(path18);
56051
+ function inspectElement(requestID, id, path17, forceFullData) {
56052
+ if (path17 !== null) {
56053
+ mergeInspectedPaths(path17);
55976
56054
  }
55977
56055
  if (isMostRecentlyInspectedElement(id) && !forceFullData) {
55978
56056
  if (!hasElementUpdatedSinceLastInspected) {
55979
- if (path18 !== null) {
56057
+ if (path17 !== null) {
55980
56058
  var secondaryCategory = null;
55981
- if (path18[0] === "hooks" || path18[0] === "suspendedBy") {
55982
- secondaryCategory = path18[0];
56059
+ if (path17[0] === "hooks" || path17[0] === "suspendedBy") {
56060
+ secondaryCategory = path17[0];
55983
56061
  }
55984
56062
  return {
55985
56063
  id,
55986
56064
  responseID: requestID,
55987
56065
  type: "hydrated-path",
55988
- path: path18,
55989
- value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement, path18), createIsPathAllowed(null, secondaryCategory), path18)
56066
+ path: path17,
56067
+ value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement, path17), createIsPathAllowed(null, secondaryCategory), path17)
55990
56068
  };
55991
56069
  } else {
55992
56070
  return {
@@ -56182,7 +56260,7 @@ The error thrown in the component is:
56182
56260
  console.groupEnd();
56183
56261
  }
56184
56262
  }
56185
- function deletePath(type, id, hookID, path18) {
56263
+ function deletePath(type, id, hookID, path17) {
56186
56264
  var devtoolsInstance = idToDevToolsInstanceMap.get(id);
56187
56265
  if (devtoolsInstance === undefined) {
56188
56266
  console.warn('Could not find DevToolsInstance with id "'.concat(id, '"'));
@@ -56196,11 +56274,11 @@ The error thrown in the component is:
56196
56274
  var instance2 = fiber.stateNode;
56197
56275
  switch (type) {
56198
56276
  case "context":
56199
- path18 = path18.slice(1);
56277
+ path17 = path17.slice(1);
56200
56278
  switch (fiber.tag) {
56201
56279
  case ClassComponent:
56202
- if (path18.length === 0) {} else {
56203
- deletePathInObject(instance2.context, path18);
56280
+ if (path17.length === 0) {} else {
56281
+ deletePathInObject(instance2.context, path17);
56204
56282
  }
56205
56283
  instance2.forceUpdate();
56206
56284
  break;
@@ -56210,21 +56288,21 @@ The error thrown in the component is:
56210
56288
  break;
56211
56289
  case "hooks":
56212
56290
  if (typeof overrideHookStateDeletePath === "function") {
56213
- overrideHookStateDeletePath(fiber, hookID, path18);
56291
+ overrideHookStateDeletePath(fiber, hookID, path17);
56214
56292
  }
56215
56293
  break;
56216
56294
  case "props":
56217
56295
  if (instance2 === null) {
56218
56296
  if (typeof overridePropsDeletePath === "function") {
56219
- overridePropsDeletePath(fiber, path18);
56297
+ overridePropsDeletePath(fiber, path17);
56220
56298
  }
56221
56299
  } else {
56222
- fiber.pendingProps = copyWithDelete(instance2.props, path18);
56300
+ fiber.pendingProps = copyWithDelete(instance2.props, path17);
56223
56301
  instance2.forceUpdate();
56224
56302
  }
56225
56303
  break;
56226
56304
  case "state":
56227
- deletePathInObject(instance2.state, path18);
56305
+ deletePathInObject(instance2.state, path17);
56228
56306
  instance2.forceUpdate();
56229
56307
  break;
56230
56308
  }
@@ -56279,7 +56357,7 @@ The error thrown in the component is:
56279
56357
  }
56280
56358
  }
56281
56359
  }
56282
- function overrideValueAtPath(type, id, hookID, path18, value) {
56360
+ function overrideValueAtPath(type, id, hookID, path17, value) {
56283
56361
  var devtoolsInstance = idToDevToolsInstanceMap.get(id);
56284
56362
  if (devtoolsInstance === undefined) {
56285
56363
  console.warn('Could not find DevToolsInstance with id "'.concat(id, '"'));
@@ -56293,13 +56371,13 @@ The error thrown in the component is:
56293
56371
  var instance2 = fiber.stateNode;
56294
56372
  switch (type) {
56295
56373
  case "context":
56296
- path18 = path18.slice(1);
56374
+ path17 = path17.slice(1);
56297
56375
  switch (fiber.tag) {
56298
56376
  case ClassComponent:
56299
- if (path18.length === 0) {
56377
+ if (path17.length === 0) {
56300
56378
  instance2.context = value;
56301
56379
  } else {
56302
- utils_setInObject(instance2.context, path18, value);
56380
+ utils_setInObject(instance2.context, path17, value);
56303
56381
  }
56304
56382
  instance2.forceUpdate();
56305
56383
  break;
@@ -56309,18 +56387,18 @@ The error thrown in the component is:
56309
56387
  break;
56310
56388
  case "hooks":
56311
56389
  if (typeof overrideHookState === "function") {
56312
- overrideHookState(fiber, hookID, path18, value);
56390
+ overrideHookState(fiber, hookID, path17, value);
56313
56391
  }
56314
56392
  break;
56315
56393
  case "props":
56316
56394
  switch (fiber.tag) {
56317
56395
  case ClassComponent:
56318
- fiber.pendingProps = copyWithSet(instance2.props, path18, value);
56396
+ fiber.pendingProps = copyWithSet(instance2.props, path17, value);
56319
56397
  instance2.forceUpdate();
56320
56398
  break;
56321
56399
  default:
56322
56400
  if (typeof overrideProps === "function") {
56323
- overrideProps(fiber, path18, value);
56401
+ overrideProps(fiber, path17, value);
56324
56402
  }
56325
56403
  break;
56326
56404
  }
@@ -56328,7 +56406,7 @@ The error thrown in the component is:
56328
56406
  case "state":
56329
56407
  switch (fiber.tag) {
56330
56408
  case ClassComponent:
56331
- utils_setInObject(instance2.state, path18, value);
56409
+ utils_setInObject(instance2.state, path17, value);
56332
56410
  instance2.forceUpdate();
56333
56411
  break;
56334
56412
  }
@@ -56614,14 +56692,14 @@ The error thrown in the component is:
56614
56692
  var trackedPathMatchInstance = null;
56615
56693
  var trackedPathMatchDepth = -1;
56616
56694
  var mightBeOnTrackedPath = false;
56617
- function setTrackedPath(path18) {
56618
- if (path18 === null) {
56695
+ function setTrackedPath(path17) {
56696
+ if (path17 === null) {
56619
56697
  trackedPathMatchFiber = null;
56620
56698
  trackedPathMatchInstance = null;
56621
56699
  trackedPathMatchDepth = -1;
56622
56700
  mightBeOnTrackedPath = false;
56623
56701
  }
56624
- trackedPath = path18;
56702
+ trackedPath = path17;
56625
56703
  }
56626
56704
  function updateTrackedPathStateBeforeMount(fiber, fiberInstance) {
56627
56705
  if (trackedPath === null || !mightBeOnTrackedPath) {
@@ -57385,9 +57463,9 @@ The error thrown in the component is:
57385
57463
  }
57386
57464
  var currentlyInspectedElementID = null;
57387
57465
  var currentlyInspectedPaths = {};
57388
- function mergeInspectedPaths(path18) {
57466
+ function mergeInspectedPaths(path17) {
57389
57467
  var current = currentlyInspectedPaths;
57390
- path18.forEach(function(key) {
57468
+ path17.forEach(function(key) {
57391
57469
  if (!current[key]) {
57392
57470
  current[key] = {};
57393
57471
  }
@@ -57395,13 +57473,13 @@ The error thrown in the component is:
57395
57473
  });
57396
57474
  }
57397
57475
  function createIsPathAllowed(key) {
57398
- return function isPathAllowed(path18) {
57476
+ return function isPathAllowed(path17) {
57399
57477
  var current = currentlyInspectedPaths[key];
57400
57478
  if (!current) {
57401
57479
  return false;
57402
57480
  }
57403
- for (var i = 0;i < path18.length; i++) {
57404
- current = current[path18[i]];
57481
+ for (var i = 0;i < path17.length; i++) {
57482
+ current = current[path17[i]];
57405
57483
  if (!current) {
57406
57484
  return false;
57407
57485
  }
@@ -57451,24 +57529,24 @@ The error thrown in the component is:
57451
57529
  break;
57452
57530
  }
57453
57531
  }
57454
- function storeAsGlobal(id, path18, count) {
57532
+ function storeAsGlobal(id, path17, count) {
57455
57533
  var inspectedElement = inspectElementRaw(id);
57456
57534
  if (inspectedElement !== null) {
57457
- var value = utils_getInObject(inspectedElement, path18);
57535
+ var value = utils_getInObject(inspectedElement, path17);
57458
57536
  var key = "$reactTemp".concat(count);
57459
57537
  window[key] = value;
57460
57538
  console.log(key);
57461
57539
  console.log(value);
57462
57540
  }
57463
57541
  }
57464
- function getSerializedElementValueByPath(id, path18) {
57542
+ function getSerializedElementValueByPath(id, path17) {
57465
57543
  var inspectedElement = inspectElementRaw(id);
57466
57544
  if (inspectedElement !== null) {
57467
- var valueToCopy = utils_getInObject(inspectedElement, path18);
57545
+ var valueToCopy = utils_getInObject(inspectedElement, path17);
57468
57546
  return serializeToString(valueToCopy);
57469
57547
  }
57470
57548
  }
57471
- function inspectElement(requestID, id, path18, forceFullData) {
57549
+ function inspectElement(requestID, id, path17, forceFullData) {
57472
57550
  if (forceFullData || currentlyInspectedElementID !== id) {
57473
57551
  currentlyInspectedElementID = id;
57474
57552
  currentlyInspectedPaths = {};
@@ -57481,8 +57559,8 @@ The error thrown in the component is:
57481
57559
  type: "not-found"
57482
57560
  };
57483
57561
  }
57484
- if (path18 !== null) {
57485
- mergeInspectedPaths(path18);
57562
+ if (path17 !== null) {
57563
+ mergeInspectedPaths(path17);
57486
57564
  }
57487
57565
  updateSelectedElement(id);
57488
57566
  inspectedElement.context = cleanForBridge(inspectedElement.context, createIsPathAllowed("context"));
@@ -57685,10 +57763,10 @@ The error thrown in the component is:
57685
57763
  console.groupEnd();
57686
57764
  }
57687
57765
  }
57688
- function getElementAttributeByPath(id, path18) {
57766
+ function getElementAttributeByPath(id, path17) {
57689
57767
  var inspectedElement = inspectElementRaw(id);
57690
57768
  if (inspectedElement !== null) {
57691
- return utils_getInObject(inspectedElement, path18);
57769
+ return utils_getInObject(inspectedElement, path17);
57692
57770
  }
57693
57771
  return;
57694
57772
  }
@@ -57705,14 +57783,14 @@ The error thrown in the component is:
57705
57783
  }
57706
57784
  return element.type;
57707
57785
  }
57708
- function deletePath(type, id, hookID, path18) {
57786
+ function deletePath(type, id, hookID, path17) {
57709
57787
  var internalInstance = idToInternalInstanceMap.get(id);
57710
57788
  if (internalInstance != null) {
57711
57789
  var publicInstance = internalInstance._instance;
57712
57790
  if (publicInstance != null) {
57713
57791
  switch (type) {
57714
57792
  case "context":
57715
- deletePathInObject(publicInstance.context, path18);
57793
+ deletePathInObject(publicInstance.context, path17);
57716
57794
  forceUpdate(publicInstance);
57717
57795
  break;
57718
57796
  case "hooks":
@@ -57720,12 +57798,12 @@ The error thrown in the component is:
57720
57798
  case "props":
57721
57799
  var element = internalInstance._currentElement;
57722
57800
  internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, {
57723
- props: copyWithDelete(element.props, path18)
57801
+ props: copyWithDelete(element.props, path17)
57724
57802
  });
57725
57803
  forceUpdate(publicInstance);
57726
57804
  break;
57727
57805
  case "state":
57728
- deletePathInObject(publicInstance.state, path18);
57806
+ deletePathInObject(publicInstance.state, path17);
57729
57807
  forceUpdate(publicInstance);
57730
57808
  break;
57731
57809
  }
@@ -57759,14 +57837,14 @@ The error thrown in the component is:
57759
57837
  }
57760
57838
  }
57761
57839
  }
57762
- function overrideValueAtPath(type, id, hookID, path18, value) {
57840
+ function overrideValueAtPath(type, id, hookID, path17, value) {
57763
57841
  var internalInstance = idToInternalInstanceMap.get(id);
57764
57842
  if (internalInstance != null) {
57765
57843
  var publicInstance = internalInstance._instance;
57766
57844
  if (publicInstance != null) {
57767
57845
  switch (type) {
57768
57846
  case "context":
57769
- utils_setInObject(publicInstance.context, path18, value);
57847
+ utils_setInObject(publicInstance.context, path17, value);
57770
57848
  forceUpdate(publicInstance);
57771
57849
  break;
57772
57850
  case "hooks":
@@ -57774,12 +57852,12 @@ The error thrown in the component is:
57774
57852
  case "props":
57775
57853
  var element = internalInstance._currentElement;
57776
57854
  internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, {
57777
- props: copyWithSet(element.props, path18, value)
57855
+ props: copyWithSet(element.props, path17, value)
57778
57856
  });
57779
57857
  forceUpdate(publicInstance);
57780
57858
  break;
57781
57859
  case "state":
57782
- utils_setInObject(publicInstance.state, path18, value);
57860
+ utils_setInObject(publicInstance.state, path17, value);
57783
57861
  forceUpdate(publicInstance);
57784
57862
  break;
57785
57863
  }
@@ -57820,7 +57898,7 @@ The error thrown in the component is:
57820
57898
  return [];
57821
57899
  }
57822
57900
  function setTraceUpdatesEnabled(enabled) {}
57823
- function setTrackedPath(path18) {}
57901
+ function setTrackedPath(path17) {}
57824
57902
  function getOwnersList(id) {
57825
57903
  return null;
57826
57904
  }
@@ -61467,6 +61545,7 @@ function detectTestPatterns(workdir, dependencies, devDependencies) {
61467
61545
  init_schema();
61468
61546
  init_logger2();
61469
61547
  init_routing();
61548
+ init_version();
61470
61549
 
61471
61550
  // src/cli/analyze-parser.ts
61472
61551
  init_registry();
@@ -61717,11 +61796,7 @@ async function analyzeFeature(options) {
61717
61796
  if (config2 && userStories.length > config2.execution.maxStoriesPerFeature) {
61718
61797
  logger.warn("cli", `Feature has ${userStories.length} stories, exceeding recommended limit of ${config2.execution.maxStoriesPerFeature}. Consider splitting.`);
61719
61798
  }
61720
- let naxVersion = "unknown";
61721
- try {
61722
- const pkgPath = new URL("../../package.json", import.meta.url);
61723
- naxVersion = (await Bun.file(pkgPath).json()).version;
61724
- } catch {}
61799
+ const naxVersion = NAX_VERSION;
61725
61800
  const now = new Date().toISOString();
61726
61801
  const prd = {
61727
61802
  project: "nax",
@@ -62701,11 +62776,119 @@ function buildFrontmatter(story, ctx, role) {
62701
62776
  `)}
62702
62777
  `;
62703
62778
  }
62779
+ var TEMPLATE_ROLES = [
62780
+ { file: "test-writer.md", role: "test-writer" },
62781
+ { file: "implementer.md", role: "implementer", variant: "standard" },
62782
+ { file: "verifier.md", role: "verifier" },
62783
+ { file: "single-session.md", role: "single-session" }
62784
+ ];
62785
+ var TEMPLATE_HEADER = `<!--
62786
+ This file controls the role-body section of the nax prompt for this role.
62787
+ Edit the content below to customize the task instructions given to the agent.
62788
+
62789
+ NON-OVERRIDABLE SECTIONS (always injected by nax, cannot be changed here):
62790
+ - Isolation rules (scope, file access boundaries)
62791
+ - Story context (acceptance criteria, description, dependencies)
62792
+ - Conventions (project coding standards)
62793
+
62794
+ To activate overrides, add to your nax/config.json:
62795
+ { "prompts": { "overrides": { "<role>": "nax/templates/<role>.md" } } }
62796
+ -->
62797
+
62798
+ `;
62799
+ async function promptsInitCommand(options) {
62800
+ const { workdir, force = false } = options;
62801
+ const templatesDir = join18(workdir, "nax", "templates");
62802
+ mkdirSync3(templatesDir, { recursive: true });
62803
+ const existingFiles = TEMPLATE_ROLES.map((t) => t.file).filter((f) => existsSync15(join18(templatesDir, f)));
62804
+ if (existingFiles.length > 0 && !force) {
62805
+ console.warn(`[WARN] nax/templates/ already contains files: ${existingFiles.join(", ")}. No files overwritten.
62806
+ Pass --force to overwrite existing templates.`);
62807
+ return [];
62808
+ }
62809
+ const written = [];
62810
+ for (const template of TEMPLATE_ROLES) {
62811
+ const filePath = join18(templatesDir, template.file);
62812
+ const roleBody = template.role === "implementer" ? buildRoleTaskSection(template.role, template.variant) : buildRoleTaskSection(template.role);
62813
+ const content = TEMPLATE_HEADER + roleBody;
62814
+ await Bun.write(filePath, content);
62815
+ written.push(filePath);
62816
+ }
62817
+ console.log(`[OK] Written ${written.length} template files to nax/templates/:`);
62818
+ for (const filePath of written) {
62819
+ console.log(` - ${filePath.replace(`${workdir}/`, "")}`);
62820
+ }
62821
+ await autoWirePromptsConfig(workdir);
62822
+ return written;
62823
+ }
62824
+ async function autoWirePromptsConfig(workdir) {
62825
+ const configPath = join18(workdir, "nax.config.json");
62826
+ if (!existsSync15(configPath)) {
62827
+ const exampleConfig = JSON.stringify({
62828
+ prompts: {
62829
+ overrides: {
62830
+ "test-writer": "nax/templates/test-writer.md",
62831
+ implementer: "nax/templates/implementer.md",
62832
+ verifier: "nax/templates/verifier.md",
62833
+ "single-session": "nax/templates/single-session.md"
62834
+ }
62835
+ }
62836
+ }, null, 2);
62837
+ console.log(`
62838
+ No nax.config.json found. To activate overrides, create nax/config.json with:
62839
+ ${exampleConfig}`);
62840
+ return;
62841
+ }
62842
+ const configFile = Bun.file(configPath);
62843
+ const configContent = await configFile.text();
62844
+ const config2 = JSON.parse(configContent);
62845
+ if (config2.prompts?.overrides && Object.keys(config2.prompts.overrides).length > 0) {
62846
+ console.log(`[INFO] prompts.overrides already configured in nax.config.json. Skipping auto-wiring.
62847
+ ` + " To reset overrides, remove the prompts.overrides section and re-run this command.");
62848
+ return;
62849
+ }
62850
+ const overrides = {
62851
+ "test-writer": "nax/templates/test-writer.md",
62852
+ implementer: "nax/templates/implementer.md",
62853
+ verifier: "nax/templates/verifier.md",
62854
+ "single-session": "nax/templates/single-session.md"
62855
+ };
62856
+ if (!config2.prompts) {
62857
+ config2.prompts = {};
62858
+ }
62859
+ config2.prompts.overrides = overrides;
62860
+ const updatedConfig = formatConfigJson(config2);
62861
+ await Bun.write(configPath, updatedConfig);
62862
+ console.log("[OK] Auto-wired prompts.overrides in nax.config.json");
62863
+ }
62864
+ function formatConfigJson(config2) {
62865
+ const lines = ["{"];
62866
+ const keys = Object.keys(config2);
62867
+ for (let i = 0;i < keys.length; i++) {
62868
+ const key = keys[i];
62869
+ const value = config2[key];
62870
+ const isLast = i === keys.length - 1;
62871
+ if (key === "prompts" && typeof value === "object" && value !== null) {
62872
+ const promptsObj = value;
62873
+ if (promptsObj.overrides) {
62874
+ const overridesJson = JSON.stringify(promptsObj.overrides);
62875
+ lines.push(` "${key}": { "overrides": ${overridesJson} }${isLast ? "" : ","}`);
62876
+ } else {
62877
+ lines.push(` "${key}": ${JSON.stringify(value)}${isLast ? "" : ","}`);
62878
+ }
62879
+ } else {
62880
+ lines.push(` "${key}": ${JSON.stringify(value)}${isLast ? "" : ","}`);
62881
+ }
62882
+ }
62883
+ lines.push("}");
62884
+ return lines.join(`
62885
+ `);
62886
+ }
62704
62887
  async function handleThreeSessionTddPrompts(story, ctx, outputDir, logger) {
62705
62888
  const [testWriterPrompt, implementerPrompt, verifierPrompt] = await Promise.all([
62706
62889
  PromptBuilder.for("test-writer", { isolation: "strict" }).withLoader(ctx.workdir, ctx.config).story(story).context(ctx.contextMarkdown).build(),
62707
62890
  PromptBuilder.for("implementer", { variant: "standard" }).withLoader(ctx.workdir, ctx.config).story(story).context(ctx.contextMarkdown).build(),
62708
- PromptBuilder.for("verifier").withLoader(ctx.workdir, ctx.config).story(story).build()
62891
+ PromptBuilder.for("verifier").withLoader(ctx.workdir, ctx.config).story(story).context(ctx.contextMarkdown).build()
62709
62892
  ]);
62710
62893
  const sessions = [
62711
62894
  { role: "test-writer", prompt: testWriterPrompt },
@@ -69563,8 +69746,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
69563
69746
  }
69564
69747
 
69565
69748
  // node_modules/ink/build/components/ErrorOverview.js
69566
- var cleanupPath = (path18) => {
69567
- return path18?.replace(`file://${cwd()}/`, "");
69749
+ var cleanupPath = (path17) => {
69750
+ return path17?.replace(`file://${cwd()}/`, "");
69568
69751
  };
69569
69752
  var stackUtils = new import_stack_utils.default({
69570
69753
  cwd: cwd(),
@@ -72074,9 +72257,9 @@ function renderTui(props) {
72074
72257
  }
72075
72258
 
72076
72259
  // bin/nax.ts
72077
- var pkg = await Bun.file(join36(import.meta.dir, "..", "package.json")).json();
72260
+ init_version();
72078
72261
  var program2 = new Command;
72079
- program2.name("nax").description("AI Coding Agent Orchestrator \u2014 loops until done").version(pkg.version);
72262
+ program2.name("nax").description("AI Coding Agent Orchestrator \u2014 loops until done").version(NAX_VERSION);
72080
72263
  program2.command("init").description("Initialize nax in the current project").option("-d, --dir <path>", "Project directory", process.cwd()).option("-f, --force", "Force overwrite existing files", false).action(async (options) => {
72081
72264
  let workdir;
72082
72265
  try {
@@ -72627,7 +72810,7 @@ program2.command("accept").description("Override failed acceptance criteria").re
72627
72810
  process.exit(1);
72628
72811
  }
72629
72812
  });
72630
- program2.command("prompts").description("Assemble prompts for stories without executing agents").requiredOption("-f, --feature <name>", "Feature name").option("--story <id>", "Filter to a single story ID (e.g., US-003)").option("--out <dir>", "Output directory for prompt files (default: stdout)").option("-d, --dir <path>", "Project directory", process.cwd()).action(async (options) => {
72813
+ program2.command("prompts").description("Assemble or initialize prompts").option("-f, --feature <name>", "Feature name (required unless using --init)").option("--init", "Initialize default prompt templates", false).option("--force", "Overwrite existing template files", false).option("--story <id>", "Filter to a single story ID (e.g., US-003)").option("--out <dir>", "Output directory for prompt files (default: stdout)").option("-d, --dir <path>", "Project directory", process.cwd()).action(async (options) => {
72631
72814
  let workdir;
72632
72815
  try {
72633
72816
  workdir = validateDirectory(options.dir);
@@ -72635,6 +72818,22 @@ program2.command("prompts").description("Assemble prompts for stories without ex
72635
72818
  console.error(source_default.red(`Invalid directory: ${err.message}`));
72636
72819
  process.exit(1);
72637
72820
  }
72821
+ if (options.init) {
72822
+ try {
72823
+ await promptsInitCommand({
72824
+ workdir,
72825
+ force: options.force
72826
+ });
72827
+ } catch (err) {
72828
+ console.error(source_default.red(`Error: ${err.message}`));
72829
+ process.exit(1);
72830
+ }
72831
+ return;
72832
+ }
72833
+ if (!options.feature) {
72834
+ console.error(source_default.red("Error: --feature is required (unless using --init)"));
72835
+ process.exit(1);
72836
+ }
72638
72837
  const config2 = await loadConfig(workdir);
72639
72838
  try {
72640
72839
  const processedStories = await promptsCommand({