@nathapp/nax 0.58.2 → 0.58.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/nax.js +21 -14
  2. package/package.json +1 -1
package/dist/nax.js CHANGED
@@ -3484,7 +3484,7 @@ function parseAgentError(stderr) {
3484
3484
 
3485
3485
  // src/agents/acp/prompt-audit.ts
3486
3486
  import { mkdirSync as mkdirSync2 } from "fs";
3487
- import { isAbsolute, join } from "path";
3487
+ import { isAbsolute, join, sep } from "path";
3488
3488
  function buildAuditFilename(entry, epochMs) {
3489
3489
  const stage = entry.pipelineStage ?? entry.callType;
3490
3490
  if (entry.callType === "run" && entry.turn !== undefined) {
@@ -3515,7 +3515,10 @@ async function writePromptAudit(entry) {
3515
3515
  if (entry.auditDir) {
3516
3516
  baseDir = isAbsolute(entry.auditDir) ? entry.auditDir : join(entry.workdir, entry.auditDir);
3517
3517
  } else {
3518
- baseDir = join(entry.workdir, ".nax", "prompt-audit");
3518
+ const wtMarker = `${sep}.nax-wt${sep}`;
3519
+ const wtIdx = entry.workdir.indexOf(wtMarker);
3520
+ const projectRoot = wtIdx !== -1 ? entry.workdir.substring(0, wtIdx) : entry.workdir;
3521
+ baseDir = join(projectRoot, ".nax", "prompt-audit");
3519
3522
  }
3520
3523
  const resolvedDir = join(baseDir, entry.featureName ?? "_unknown");
3521
3524
  _promptAuditDeps.mkdirSync(resolvedDir);
@@ -18976,12 +18979,14 @@ function extractQuestion(output) {
18976
18979
  }
18977
18980
 
18978
18981
  class AcpAgentAdapter {
18982
+ naxConfig;
18979
18983
  name;
18980
18984
  displayName;
18981
18985
  binary;
18982
18986
  capabilities;
18983
18987
  _unavailableAgents;
18984
- constructor(agentName) {
18988
+ constructor(agentName, naxConfig) {
18989
+ this.naxConfig = naxConfig;
18985
18990
  const entry = resolveRegistryEntry(agentName);
18986
18991
  this.name = agentName;
18987
18992
  this.displayName = entry.displayName;
@@ -19158,12 +19163,13 @@ class AcpAgentAdapter {
19158
19163
  while (turnCount < MAX_TURNS) {
19159
19164
  turnCount++;
19160
19165
  getSafeLogger()?.debug("acp-adapter", `Session turn ${turnCount}/${MAX_TURNS}`, { sessionName });
19161
- if (options.config?.agent?.promptAudit?.enabled) {
19166
+ const _runAuditConfig = options.config ?? this.naxConfig;
19167
+ if (_runAuditConfig?.agent?.promptAudit?.enabled) {
19162
19168
  writePromptAudit({
19163
19169
  prompt: currentPrompt,
19164
19170
  sessionName,
19165
19171
  workdir: options.workdir,
19166
- auditDir: options.config.agent.promptAudit.dir,
19172
+ auditDir: _runAuditConfig.agent.promptAudit.dir,
19167
19173
  storyId: options.storyId,
19168
19174
  featureName: options.featureName,
19169
19175
  pipelineStage: options.pipelineStage ?? "run",
@@ -19291,15 +19297,16 @@ class AcpAgentAdapter {
19291
19297
  try {
19292
19298
  const completeSessionName = _options?.sessionName ?? buildSessionName(workdir ?? process.cwd(), _options?.featureName, _options?.storyId, _options?.sessionRole);
19293
19299
  session = await client.createSession({ agentName, permissionMode, sessionName: completeSessionName });
19294
- if (config2?.agent?.promptAudit?.enabled) {
19300
+ const _completeAuditConfig = config2 ?? this.naxConfig;
19301
+ if (_completeAuditConfig?.agent?.promptAudit?.enabled) {
19295
19302
  writePromptAudit({
19296
19303
  prompt,
19297
19304
  sessionName: completeSessionName,
19298
19305
  workdir: workdir ?? process.cwd(),
19299
- auditDir: config2.agent.promptAudit.dir,
19306
+ auditDir: _completeAuditConfig.agent.promptAudit.dir,
19300
19307
  storyId: _options?.storyId,
19301
19308
  featureName: _options?.featureName,
19302
- pipelineStage: "complete",
19309
+ pipelineStage: _options?.pipelineStage ?? "complete",
19303
19310
  callType: "complete"
19304
19311
  });
19305
19312
  }
@@ -20679,7 +20686,7 @@ function createAgentRegistry(config2) {
20679
20686
  if (!known)
20680
20687
  return;
20681
20688
  if (!acpCache.has(name)) {
20682
- acpCache.set(name, new AcpAgentAdapter(name));
20689
+ acpCache.set(name, new AcpAgentAdapter(name, config2));
20683
20690
  logger?.debug("agents", `Created AcpAgentAdapter for ${name}`, { name, protocol });
20684
20691
  }
20685
20692
  return acpCache.get(name);
@@ -20693,7 +20700,7 @@ function createAgentRegistry(config2) {
20693
20700
  async function getInstalledAgents2() {
20694
20701
  const agents = protocol === "acp" ? ALL_AGENTS.map((a) => {
20695
20702
  if (!acpCache.has(a.name)) {
20696
- acpCache.set(a.name, new AcpAgentAdapter(a.name));
20703
+ acpCache.set(a.name, new AcpAgentAdapter(a.name, config2));
20697
20704
  }
20698
20705
  return acpCache.get(a.name);
20699
20706
  }) : ALL_AGENTS;
@@ -20703,7 +20710,7 @@ function createAgentRegistry(config2) {
20703
20710
  async function checkAgentHealth2() {
20704
20711
  const agents = protocol === "acp" ? ALL_AGENTS.map((a) => {
20705
20712
  if (!acpCache.has(a.name)) {
20706
- acpCache.set(a.name, new AcpAgentAdapter(a.name));
20713
+ acpCache.set(a.name, new AcpAgentAdapter(a.name, config2));
20707
20714
  }
20708
20715
  return acpCache.get(a.name);
20709
20716
  }) : ALL_AGENTS;
@@ -35602,7 +35609,7 @@ var package_default;
35602
35609
  var init_package = __esm(() => {
35603
35610
  package_default = {
35604
35611
  name: "@nathapp/nax",
35605
- version: "0.58.2",
35612
+ version: "0.58.3",
35606
35613
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
35607
35614
  type: "module",
35608
35615
  bin: {
@@ -35682,8 +35689,8 @@ var init_version = __esm(() => {
35682
35689
  NAX_VERSION = package_default.version;
35683
35690
  NAX_COMMIT = (() => {
35684
35691
  try {
35685
- if (/^[0-9a-f]{6,10}$/.test("46191e3a"))
35686
- return "46191e3a";
35692
+ if (/^[0-9a-f]{6,10}$/.test("1cf117ef"))
35693
+ return "1cf117ef";
35687
35694
  } catch {}
35688
35695
  try {
35689
35696
  const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nax",
3
- "version": "0.58.2",
3
+ "version": "0.58.3",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {