@nathapp/nax 0.75.2 → 0.75.4

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.
@@ -1,3 +1,5 @@
1
+ import { mkdir, writeFile } from "node:fs/promises";
2
+ import { dirname } from "node:path";
1
3
  import type { FinishResult } from "../types";
2
4
 
3
5
  export function resultPath(repoRoot: string): string {
@@ -5,8 +7,14 @@ export function resultPath(repoRoot: string): string {
5
7
  }
6
8
 
7
9
  export const _resultDeps: { writeText: (p: string, s: string) => Promise<void> } = {
10
+ // node:fs, not Bun.write — this module runs inside acpx's Node process, where
11
+ // the `Bun` global does not exist (see the header of `../exec.ts`). The mkdir
12
+ // is not redundant: Bun.write creates missing parent directories implicitly,
13
+ // writeFile does not, and this is the one artifact the plugin needs on disk to
14
+ // report an outcome at all.
8
15
  writeText: async (p, s) => {
9
- await Bun.write(p, s);
16
+ await mkdir(dirname(p), { recursive: true });
17
+ await writeFile(p, s, "utf8");
10
18
  },
11
19
  };
12
20
 
@@ -48,6 +48,20 @@ export interface FinishResult {
48
48
  status: "opened" | "promoted" | "already-ready" | "escalated" | "nothing-to-finish";
49
49
  url?: string;
50
50
  escalationReason?: string;
51
+ /**
52
+ * The findings behind an escalation. Persisted because the reason alone is a
53
+ * bare count ("3 finding(s) after 3 fix attempts"), and on the Telegram
54
+ * channel the composed PR comment — the only other thing carrying them — is
55
+ * never posted. Without this the findings survived only in acpx's run bundle.
56
+ */
57
+ findings?: Finding[];
58
+ /**
59
+ * Set when the escalation could not be delivered to its channel (forge
60
+ * comment failed, remote unrecognised). The result file is written before
61
+ * delivery is attempted, so an undelivered escalation is still reported
62
+ * rather than lost.
63
+ */
64
+ deliveryError?: string;
51
65
  }
52
66
  export interface RunResult {
53
67
  exitCode: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nax",
3
- "version": "0.75.2",
3
+ "version": "0.75.4",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,9 +11,10 @@
11
11
  "dev": "bun run bin/nax.ts",
12
12
  "build": "bun build bin/nax.ts --outdir dist --target bun --define \"GIT_COMMIT=\\\"$(git rev-parse --short HEAD)\\\"\"",
13
13
  "typecheck": "bun x tsc --noEmit && bun x tsc --noEmit -p tsconfig.contracts.json",
14
- "lint": "bun x biome check src/ bin/ flows/ && bun run check:no-real-global-nax && bun run check:alias-internals && bun run check:deep-relatives && bun run check:nax-error && bun run check:logger-storyid && bun run check:log-format-layering && bun run check:file-sizes",
14
+ "lint": "bun x biome check src/ bin/ flows/ && bun run check:flows-no-bun && bun run check:no-real-global-nax && bun run check:alias-internals && bun run check:deep-relatives && bun run check:nax-error && bun run check:logger-storyid && bun run check:log-format-layering && bun run check:file-sizes",
15
15
  "lint:json": "bun x biome check src/ bin/ flows/ --reporter json && bun run check:nax-error 1>&2 && bun run check:logger-storyid 1>&2",
16
16
  "lint:fix": "bun x biome check --write src/ bin/ flows/",
17
+ "check:flows-no-bun": "bun run scripts/check-flows-no-bun.ts",
17
18
  "check:no-real-global-nax": "bun run scripts/check-no-real-global-nax.ts",
18
19
  "check:alias-internals": "bun run scripts/check-alias-internals.ts",
19
20
  "check:deep-relatives": "bun run scripts/check-deep-relatives.ts",