@nathapp/nax 0.48.0 → 0.48.1
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 +32 -4
- package/package.json +1 -1
- package/src/cli/generate.ts +42 -1
package/dist/nax.js
CHANGED
|
@@ -22210,7 +22210,7 @@ var package_default;
|
|
|
22210
22210
|
var init_package = __esm(() => {
|
|
22211
22211
|
package_default = {
|
|
22212
22212
|
name: "@nathapp/nax",
|
|
22213
|
-
version: "0.48.
|
|
22213
|
+
version: "0.48.1",
|
|
22214
22214
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
22215
22215
|
type: "module",
|
|
22216
22216
|
bin: {
|
|
@@ -22283,8 +22283,8 @@ var init_version = __esm(() => {
|
|
|
22283
22283
|
NAX_VERSION = package_default.version;
|
|
22284
22284
|
NAX_COMMIT = (() => {
|
|
22285
22285
|
try {
|
|
22286
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
22287
|
-
return "
|
|
22286
|
+
if (/^[0-9a-f]{6,10}$/.test("ae560e9"))
|
|
22287
|
+
return "ae560e9";
|
|
22288
22288
|
} catch {}
|
|
22289
22289
|
try {
|
|
22290
22290
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|
|
@@ -68843,7 +68843,13 @@ async function generateCommand(options) {
|
|
|
68843
68843
|
const suffix = dryRun ? " (dry run)" : "";
|
|
68844
68844
|
console.log(source_default.green(`\u2713 ${agent} \u2192 ${result.outputFile} (${result.content.length} bytes${suffix})`));
|
|
68845
68845
|
} else {
|
|
68846
|
-
|
|
68846
|
+
let configAgents = config2?.generate?.agents;
|
|
68847
|
+
const misplacedAgents = config2?.autoMode?.generate;
|
|
68848
|
+
if (!configAgents && misplacedAgents?.agents && misplacedAgents.agents.length > 0) {
|
|
68849
|
+
console.warn(source_default.yellow('\u26A0 Warning: "generate.agents" is nested under "autoMode" in your config \u2014 it should be at the top level.'));
|
|
68850
|
+
console.warn(source_default.yellow(' Move it to: { "generate": { "agents": [...] } }'));
|
|
68851
|
+
configAgents = misplacedAgents.agents;
|
|
68852
|
+
}
|
|
68847
68853
|
const agentFilter = configAgents && configAgents.length > 0 ? configAgents : null;
|
|
68848
68854
|
if (agentFilter) {
|
|
68849
68855
|
console.log(source_default.blue(`\u2192 Generating configs for: ${agentFilter.join(", ")} (from config)...`));
|
|
@@ -68867,6 +68873,28 @@ async function generateCommand(options) {
|
|
|
68867
68873
|
\u2717 ${errorCount} generation(s) failed`));
|
|
68868
68874
|
process.exit(1);
|
|
68869
68875
|
}
|
|
68876
|
+
const packages = await discoverPackages(workdir);
|
|
68877
|
+
if (packages.length > 0) {
|
|
68878
|
+
console.log(source_default.blue(`
|
|
68879
|
+
\u2192 Discovered ${packages.length} package(s) with nax/context.md \u2014 generating CLAUDE.md...`));
|
|
68880
|
+
let pkgErrorCount = 0;
|
|
68881
|
+
for (const pkgDir of packages) {
|
|
68882
|
+
const result = await generateForPackage(pkgDir, config2, dryRun);
|
|
68883
|
+
if (result.error) {
|
|
68884
|
+
console.error(source_default.red(`\u2717 ${pkgDir}: ${result.error}`));
|
|
68885
|
+
pkgErrorCount++;
|
|
68886
|
+
} else {
|
|
68887
|
+
const suffix = dryRun ? " (dry run)" : "";
|
|
68888
|
+
const rel = pkgDir.startsWith(workdir) ? pkgDir.slice(workdir.length + 1) : pkgDir;
|
|
68889
|
+
console.log(source_default.green(`\u2713 ${rel}/${result.outputFile} (${result.content.length} bytes${suffix})`));
|
|
68890
|
+
}
|
|
68891
|
+
}
|
|
68892
|
+
if (pkgErrorCount > 0) {
|
|
68893
|
+
console.error(source_default.red(`
|
|
68894
|
+
\u2717 ${pkgErrorCount} package generation(s) failed`));
|
|
68895
|
+
process.exit(1);
|
|
68896
|
+
}
|
|
68897
|
+
}
|
|
68870
68898
|
}
|
|
68871
68899
|
if (!dryRun) {
|
|
68872
68900
|
console.log(source_default.green(`
|
package/package.json
CHANGED
package/src/cli/generate.ts
CHANGED
|
@@ -157,7 +157,24 @@ export async function generateCommand(options: GenerateCommandOptions): Promise<
|
|
|
157
157
|
console.log(chalk.green(`✓ ${agent} → ${result.outputFile} (${result.content.length} bytes${suffix})`));
|
|
158
158
|
} else {
|
|
159
159
|
// No --agent flag: use config.generate.agents filter, or generate all
|
|
160
|
-
|
|
160
|
+
let configAgents = config?.generate?.agents;
|
|
161
|
+
|
|
162
|
+
// Detect misplaced generate config (autoMode.generate.agents) and warn
|
|
163
|
+
const misplacedAgents = (config?.autoMode as unknown as Record<string, unknown> | undefined)?.generate as
|
|
164
|
+
| { agents?: string[] }
|
|
165
|
+
| undefined;
|
|
166
|
+
if (!configAgents && misplacedAgents?.agents && misplacedAgents.agents.length > 0) {
|
|
167
|
+
console.warn(
|
|
168
|
+
chalk.yellow(
|
|
169
|
+
'⚠ Warning: "generate.agents" is nested under "autoMode" in your config — it should be at the top level.',
|
|
170
|
+
),
|
|
171
|
+
);
|
|
172
|
+
console.warn(chalk.yellow(' Move it to: { "generate": { "agents": [...] } }'));
|
|
173
|
+
configAgents = misplacedAgents.agents as Array<
|
|
174
|
+
"claude" | "codex" | "opencode" | "cursor" | "windsurf" | "aider" | "gemini"
|
|
175
|
+
>;
|
|
176
|
+
}
|
|
177
|
+
|
|
161
178
|
const agentFilter = configAgents && configAgents.length > 0 ? configAgents : null;
|
|
162
179
|
|
|
163
180
|
if (agentFilter) {
|
|
@@ -187,6 +204,30 @@ export async function generateCommand(options: GenerateCommandOptions): Promise<
|
|
|
187
204
|
console.error(chalk.red(`\n✗ ${errorCount} generation(s) failed`));
|
|
188
205
|
process.exit(1);
|
|
189
206
|
}
|
|
207
|
+
|
|
208
|
+
// Auto-generate per-package CLAUDE.md when packages with nax/context.md are discovered
|
|
209
|
+
const packages = await discoverPackages(workdir);
|
|
210
|
+
if (packages.length > 0) {
|
|
211
|
+
console.log(
|
|
212
|
+
chalk.blue(`\n→ Discovered ${packages.length} package(s) with nax/context.md — generating CLAUDE.md...`),
|
|
213
|
+
);
|
|
214
|
+
let pkgErrorCount = 0;
|
|
215
|
+
for (const pkgDir of packages) {
|
|
216
|
+
const result = await generateForPackage(pkgDir, config, dryRun);
|
|
217
|
+
if (result.error) {
|
|
218
|
+
console.error(chalk.red(`✗ ${pkgDir}: ${result.error}`));
|
|
219
|
+
pkgErrorCount++;
|
|
220
|
+
} else {
|
|
221
|
+
const suffix = dryRun ? " (dry run)" : "";
|
|
222
|
+
const rel = pkgDir.startsWith(workdir) ? pkgDir.slice(workdir.length + 1) : pkgDir;
|
|
223
|
+
console.log(chalk.green(`✓ ${rel}/${result.outputFile} (${result.content.length} bytes${suffix})`));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (pkgErrorCount > 0) {
|
|
227
|
+
console.error(chalk.red(`\n✗ ${pkgErrorCount} package generation(s) failed`));
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
190
231
|
}
|
|
191
232
|
|
|
192
233
|
if (!dryRun) {
|