@nathapp/nax 0.56.0 → 0.56.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 +62 -12
- package/package.json +1 -1
package/dist/nax.js
CHANGED
|
@@ -18275,7 +18275,7 @@ var init_schemas3 = __esm(() => {
|
|
|
18275
18275
|
maxIterations: exports_external.number().int().positive({ message: "maxIterations must be > 0" }),
|
|
18276
18276
|
iterationDelayMs: exports_external.number().int().nonnegative(),
|
|
18277
18277
|
costLimit: exports_external.number().positive({ message: "costLimit must be > 0" }),
|
|
18278
|
-
sessionTimeoutSeconds: exports_external.number().int().positive({ message: "sessionTimeoutSeconds must be > 0" }),
|
|
18278
|
+
sessionTimeoutSeconds: exports_external.number().int().positive({ message: "sessionTimeoutSeconds must be > 0" }).default(3600),
|
|
18279
18279
|
verificationTimeoutSeconds: exports_external.number().int().min(1).max(3600).default(300),
|
|
18280
18280
|
maxStoriesPerFeature: exports_external.number().int().positive(),
|
|
18281
18281
|
rectification: RectificationConfigSchema,
|
|
@@ -18472,9 +18472,9 @@ var init_schemas3 = __esm(() => {
|
|
|
18472
18472
|
});
|
|
18473
18473
|
StorySizeGateConfigSchema = exports_external.object({
|
|
18474
18474
|
enabled: exports_external.boolean().default(true),
|
|
18475
|
-
maxAcCount: exports_external.number().int().min(1).max(50).default(
|
|
18476
|
-
maxDescriptionLength: exports_external.number().int().min(100).max(1e4).default(
|
|
18477
|
-
maxBulletPoints: exports_external.number().int().min(1).max(100).default(
|
|
18475
|
+
maxAcCount: exports_external.number().int().min(1).max(50).default(10),
|
|
18476
|
+
maxDescriptionLength: exports_external.number().int().min(100).max(1e4).default(3000),
|
|
18477
|
+
maxBulletPoints: exports_external.number().int().min(1).max(100).default(12),
|
|
18478
18478
|
action: exports_external.enum(["block", "warn", "skip"]).default("block"),
|
|
18479
18479
|
maxReplanAttempts: exports_external.number().int().min(1).default(3)
|
|
18480
18480
|
});
|
|
@@ -22056,7 +22056,7 @@ var package_default;
|
|
|
22056
22056
|
var init_package = __esm(() => {
|
|
22057
22057
|
package_default = {
|
|
22058
22058
|
name: "@nathapp/nax",
|
|
22059
|
-
version: "0.56.
|
|
22059
|
+
version: "0.56.1",
|
|
22060
22060
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
22061
22061
|
type: "module",
|
|
22062
22062
|
bin: {
|
|
@@ -22135,8 +22135,8 @@ var init_version = __esm(() => {
|
|
|
22135
22135
|
NAX_VERSION = package_default.version;
|
|
22136
22136
|
NAX_COMMIT = (() => {
|
|
22137
22137
|
try {
|
|
22138
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
22139
|
-
return "
|
|
22138
|
+
if (/^[0-9a-f]{6,10}$/.test("bfe07f9f"))
|
|
22139
|
+
return "bfe07f9f";
|
|
22140
22140
|
} catch {}
|
|
22141
22141
|
try {
|
|
22142
22142
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|
|
@@ -23500,6 +23500,11 @@ class WebhookInteractionPlugin {
|
|
|
23500
23500
|
serverStartPromise = null;
|
|
23501
23501
|
pendingResponses = new Map;
|
|
23502
23502
|
receiveCallbacks = new Map;
|
|
23503
|
+
get callbackServerPort() {
|
|
23504
|
+
if (!this.server)
|
|
23505
|
+
return null;
|
|
23506
|
+
return this.server.port;
|
|
23507
|
+
}
|
|
23503
23508
|
async init(config2) {
|
|
23504
23509
|
const cfg = WebhookConfigSchema.parse(config2);
|
|
23505
23510
|
this.config = {
|
|
@@ -23675,7 +23680,9 @@ var init_webhook = __esm(() => {
|
|
|
23675
23680
|
init_bun_deps();
|
|
23676
23681
|
WebhookConfigSchema = exports_external.object({
|
|
23677
23682
|
url: exports_external.string().url().optional(),
|
|
23678
|
-
callbackPort: exports_external.number().int().
|
|
23683
|
+
callbackPort: exports_external.number().int().refine((p) => p === 0 || p >= 1024 && p <= 65535, {
|
|
23684
|
+
message: "Port must be 0 (auto-assign) or between 1024 and 65535"
|
|
23685
|
+
}).optional(),
|
|
23679
23686
|
secret: exports_external.string().optional(),
|
|
23680
23687
|
maxPayloadBytes: exports_external.number().int().positive().optional()
|
|
23681
23688
|
});
|
|
@@ -28788,11 +28795,26 @@ function shouldRetryRectification(state, config2) {
|
|
|
28788
28795
|
return true;
|
|
28789
28796
|
}
|
|
28790
28797
|
function buildEscalationPreamble(attempt, config2) {
|
|
28798
|
+
const logger = getSafeLogger();
|
|
28791
28799
|
const rethinkAt = Math.min(config2.rethinkAtAttempt ?? 2, config2.maxRetries);
|
|
28792
28800
|
const urgencyAt = Math.min(config2.urgencyAtAttempt ?? 3, config2.maxRetries);
|
|
28793
28801
|
if (attempt < rethinkAt)
|
|
28794
28802
|
return "";
|
|
28795
28803
|
const isUrgent = attempt >= urgencyAt;
|
|
28804
|
+
if (isUrgent) {
|
|
28805
|
+
logger?.info("rectification", "Progressive prompt escalation: urgency + rethink injected", {
|
|
28806
|
+
attempt,
|
|
28807
|
+
urgencyAtAttempt: urgencyAt,
|
|
28808
|
+
rethinkAtAttempt: rethinkAt,
|
|
28809
|
+
maxRetries: config2.maxRetries
|
|
28810
|
+
});
|
|
28811
|
+
} else {
|
|
28812
|
+
logger?.info("rectification", "Progressive prompt escalation: rethink injected", {
|
|
28813
|
+
attempt,
|
|
28814
|
+
rethinkAtAttempt: rethinkAt,
|
|
28815
|
+
maxRetries: config2.maxRetries
|
|
28816
|
+
});
|
|
28817
|
+
}
|
|
28796
28818
|
const rethinkSection = `## \u26A0\uFE0F Previous Attempt Did Not Fix the Failures
|
|
28797
28819
|
|
|
28798
28820
|
Your previous fix attempt (attempt ${attempt}) did not resolve all failures. **Step back and reconsider your approach.**
|
|
@@ -28934,7 +28956,9 @@ ${testCommands}
|
|
|
28934
28956
|
- When running tests, run ONLY the failing test files shown above \u2014 NEVER run \`bun test\` without a file filter.
|
|
28935
28957
|
`;
|
|
28936
28958
|
}
|
|
28937
|
-
var init_rectification = () => {
|
|
28959
|
+
var init_rectification = __esm(() => {
|
|
28960
|
+
init_logger2();
|
|
28961
|
+
});
|
|
28938
28962
|
|
|
28939
28963
|
// src/verification/index.ts
|
|
28940
28964
|
var init_verification = __esm(() => {
|
|
@@ -30552,6 +30576,10 @@ Category: ${tddResult.failureCategory ?? "unknown"}`,
|
|
|
30552
30576
|
});
|
|
30553
30577
|
}
|
|
30554
30578
|
}
|
|
30579
|
+
return {
|
|
30580
|
+
action: "pause",
|
|
30581
|
+
reason: tddResult.reviewReason || `Human review needed: ${tddResult.failureCategory ?? "unknown"}`
|
|
30582
|
+
};
|
|
30555
30583
|
}
|
|
30556
30584
|
return routeTddFailure(tddResult.failureCategory, isLiteMode, ctx, tddResult.reviewReason);
|
|
30557
30585
|
}
|
|
@@ -69868,12 +69896,34 @@ async function planDecomposeCommand(workdir, config2, options) {
|
|
|
69868
69896
|
if (debateResult.outcome !== "failed" && debateResult.output) {
|
|
69869
69897
|
rawResponse = debateResult.output;
|
|
69870
69898
|
} else {
|
|
69871
|
-
rawResponse = await adapter.complete(prompt, {
|
|
69899
|
+
rawResponse = await adapter.complete(prompt, {
|
|
69900
|
+
jsonMode: true,
|
|
69901
|
+
workdir,
|
|
69902
|
+
sessionRole: "decompose",
|
|
69903
|
+
featureName: options.feature,
|
|
69904
|
+
storyId: options.storyId
|
|
69905
|
+
});
|
|
69872
69906
|
}
|
|
69873
69907
|
} else {
|
|
69874
|
-
rawResponse = await adapter.complete(prompt, {
|
|
69908
|
+
rawResponse = await adapter.complete(prompt, {
|
|
69909
|
+
jsonMode: true,
|
|
69910
|
+
workdir,
|
|
69911
|
+
sessionRole: "decompose",
|
|
69912
|
+
featureName: options.feature,
|
|
69913
|
+
storyId: options.storyId
|
|
69914
|
+
});
|
|
69915
|
+
}
|
|
69916
|
+
const jsonMatch = rawResponse.match(/```(?:json)?\s*([\s\S]*?)\s*```/);
|
|
69917
|
+
const cleanedResponse = jsonMatch ? jsonMatch[1] : rawResponse;
|
|
69918
|
+
let parsed;
|
|
69919
|
+
try {
|
|
69920
|
+
parsed = JSON.parse(cleanedResponse.trim());
|
|
69921
|
+
} catch (err) {
|
|
69922
|
+
throw new NaxError(`Failed to parse decompose response as JSON: ${err.message}
|
|
69923
|
+
|
|
69924
|
+
Response (first 500 chars):
|
|
69925
|
+
${rawResponse.slice(0, 500)}`, "DECOMPOSE_PARSE_FAILED", { stage: "decompose", storyId: options.storyId });
|
|
69875
69926
|
}
|
|
69876
|
-
const parsed = JSON.parse(rawResponse);
|
|
69877
69927
|
const subStories = parsed.subStories;
|
|
69878
69928
|
const maxAcCount = config2?.precheck?.storySizeGate?.maxAcCount ?? Number.POSITIVE_INFINITY;
|
|
69879
69929
|
for (const sub of subStories) {
|