@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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.30.0] - 2026-03-08
9
+
10
+ ### Fixed
11
+ - **Global install crash:** `bin/nax.ts`, `headless-formatter.ts`, and `cli/analyze.ts` were reading `package.json` at runtime via `import.meta.dir`-relative paths. In a global bun install, these paths resolve incorrectly, causing an ENOENT crash on launch. All three now use the static `NAX_VERSION` constant (baked in at build time).
12
+
13
+ ### Refactored
14
+ - **Prompt Builder wired to sections:** `PromptBuilder` now calls `buildRoleTaskSection()`, `buildIsolationSection()`, `buildStorySection()`, and `buildConventionsSection()` from `src/prompts/sections/` instead of duplicated inline functions. Eliminates 80+ lines of dead code.
15
+ - **Sections expanded:** `role-task.ts` and `isolation.ts` now cover all 4 roles (`implementer`, `test-writer`, `verifier`, `single-session`). Previously only covered 1–2 roles each.
16
+ - **Template stubs removed:** `src/prompts/templates/` directory deleted — all 4 stub files (`implementer.ts`, `test-writer.ts`, `verifier.ts`, `single-session.ts`) were empty and unused.
17
+
8
18
  ## [0.29.0] - 2026-03-08
9
19
 
10
20
  ### Added
package/bin/nax.ts CHANGED
@@ -54,6 +54,7 @@ import {
54
54
  planCommand,
55
55
  pluginsListCommand,
56
56
  promptsCommand,
57
+ promptsInitCommand,
57
58
  runsListCommand,
58
59
  runsShowCommand,
59
60
  } from "../src/cli";
@@ -70,12 +71,11 @@ import { loadHooksConfig } from "../src/hooks";
70
71
  import { type LogLevel, initLogger } from "../src/logger";
71
72
  import { countStories, loadPRD } from "../src/prd";
72
73
  import { PipelineEventEmitter, type StoryDisplayState, renderTui } from "../src/tui";
73
-
74
- const pkg = await Bun.file(join(import.meta.dir, "..", "package.json")).json();
74
+ import { NAX_VERSION } from "../src/version";
75
75
 
76
76
  const program = new Command();
77
77
 
78
- program.name("nax").description("AI Coding Agent Orchestrator — loops until done").version(pkg.version);
78
+ program.name("nax").description("AI Coding Agent Orchestrator — loops until done").version(NAX_VERSION);
79
79
 
80
80
  // ── init ─────────────────────────────────────────────
81
81
  program
@@ -850,8 +850,10 @@ program
850
850
  // ── prompts ──────────────────────────────────────────
851
851
  program
852
852
  .command("prompts")
853
- .description("Assemble prompts for stories without executing agents")
854
- .requiredOption("-f, --feature <name>", "Feature name")
853
+ .description("Assemble or initialize prompts")
854
+ .option("-f, --feature <name>", "Feature name (required unless using --init)")
855
+ .option("--init", "Initialize default prompt templates", false)
856
+ .option("--force", "Overwrite existing template files", false)
855
857
  .option("--story <id>", "Filter to a single story ID (e.g., US-003)")
856
858
  .option("--out <dir>", "Output directory for prompt files (default: stdout)")
857
859
  .option("-d, --dir <path>", "Project directory", process.cwd())
@@ -865,6 +867,26 @@ program
865
867
  process.exit(1);
866
868
  }
867
869
 
870
+ // Handle --init command
871
+ if (options.init) {
872
+ try {
873
+ await promptsInitCommand({
874
+ workdir,
875
+ force: options.force,
876
+ });
877
+ } catch (err) {
878
+ console.error(chalk.red(`Error: ${(err as Error).message}`));
879
+ process.exit(1);
880
+ }
881
+ return;
882
+ }
883
+
884
+ // Handle regular prompts command (requires --feature)
885
+ if (!options.feature) {
886
+ console.error(chalk.red("Error: --feature is required (unless using --init)"));
887
+ process.exit(1);
888
+ }
889
+
868
890
  // Load config
869
891
  const config = await loadConfig(workdir);
870
892