@nathapp/nax 0.69.4 → 0.69.5
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 +100 -14
- package/package.json +1 -1
package/dist/nax.js
CHANGED
|
@@ -34389,17 +34389,18 @@ function acSentinelToFinding(sentinel, _output) {
|
|
|
34389
34389
|
}
|
|
34390
34390
|
|
|
34391
34391
|
// src/findings/adapters/typecheck.ts
|
|
34392
|
-
function
|
|
34392
|
+
function genericTypecheckDiagnosticToFinding(d, workdir, tool) {
|
|
34393
34393
|
return {
|
|
34394
34394
|
source: "typecheck",
|
|
34395
|
-
tool
|
|
34395
|
+
tool,
|
|
34396
34396
|
severity: "error",
|
|
34397
34397
|
category: "type-error",
|
|
34398
34398
|
rule: d.code ? `TS${d.code}` : undefined,
|
|
34399
34399
|
file: rebaseToWorkdir(d.file, workdir, workdir),
|
|
34400
34400
|
line: d.line,
|
|
34401
34401
|
column: d.column,
|
|
34402
|
-
message: d.message
|
|
34402
|
+
message: d.message,
|
|
34403
|
+
fixTarget: "source"
|
|
34403
34404
|
};
|
|
34404
34405
|
}
|
|
34405
34406
|
var init_typecheck = __esm(() => {
|
|
@@ -38911,7 +38912,7 @@ function makeAutofixImplementerStrategy(story, config2, sink, opts = {}) {
|
|
|
38911
38912
|
const claimsAdversarial = opts.includeAdversarialReview === true;
|
|
38912
38913
|
return {
|
|
38913
38914
|
name: "autofix-implementer",
|
|
38914
|
-
appliesTo: (f) => f.fixTarget === "source" && IMPLEMENTER_SOURCES.has(f.source) || claimsAdversarial && f.source === "adversarial-review",
|
|
38915
|
+
appliesTo: (f) => (f.fixTarget === "source" || f.fixTarget == null) && IMPLEMENTER_SOURCES.has(f.source) || claimsAdversarial && f.source === "adversarial-review",
|
|
38915
38916
|
fixOp: implementerRectifyOp,
|
|
38916
38917
|
buildInput: (findings, _prior, _cycleCtx) => ({
|
|
38917
38918
|
failedChecks: findingsToFailedChecks(findings),
|
|
@@ -39392,7 +39393,15 @@ var init_lint_check = __esm(() => {
|
|
|
39392
39393
|
return { success: true, status: "passed", findings: [], durationMs: Date.now() - start };
|
|
39393
39394
|
}
|
|
39394
39395
|
const parsed = deps.parseLintOutput(result.output, "auto", { workdir: input.workdir });
|
|
39395
|
-
|
|
39396
|
+
const parsedFindings = parsed?.findings ?? [];
|
|
39397
|
+
const sentinel = {
|
|
39398
|
+
source: "lint",
|
|
39399
|
+
severity: "error",
|
|
39400
|
+
category: "lint-failure",
|
|
39401
|
+
message: `lint failed (no structured findings parsed), please run the lint check command: ${command}`
|
|
39402
|
+
};
|
|
39403
|
+
const findings = parsedFindings.length > 0 ? parsedFindings : [sentinel];
|
|
39404
|
+
return { success: false, findings, durationMs: Date.now() - start };
|
|
39396
39405
|
}
|
|
39397
39406
|
};
|
|
39398
39407
|
});
|
|
@@ -39583,6 +39592,11 @@ function strategiesFor(format) {
|
|
|
39583
39592
|
return [];
|
|
39584
39593
|
return [tscStrategy, typecheckTextBlockStrategy];
|
|
39585
39594
|
}
|
|
39595
|
+
function toolForFormat(format) {
|
|
39596
|
+
if (format === "tsc")
|
|
39597
|
+
return "tsc";
|
|
39598
|
+
return;
|
|
39599
|
+
}
|
|
39586
39600
|
function parseTypecheckOutput(output, format = "auto", opts) {
|
|
39587
39601
|
if (!output.trim())
|
|
39588
39602
|
return null;
|
|
@@ -39590,7 +39604,8 @@ function parseTypecheckOutput(output, format = "auto", opts) {
|
|
|
39590
39604
|
const parsed = strategy.parse(output);
|
|
39591
39605
|
if (parsed && parsed.diagnostics.length > 0) {
|
|
39592
39606
|
if (opts) {
|
|
39593
|
-
const
|
|
39607
|
+
const tool = toolForFormat(parsed.format);
|
|
39608
|
+
const findings = parsed.diagnostics.map((d) => genericTypecheckDiagnosticToFinding(d, opts.workdir, tool));
|
|
39594
39609
|
return { ...parsed, findings };
|
|
39595
39610
|
}
|
|
39596
39611
|
return parsed;
|
|
@@ -39648,7 +39663,16 @@ var init_typecheck_check = __esm(() => {
|
|
|
39648
39663
|
return { success: true, status: "passed", findings: [], durationMs: Date.now() - start };
|
|
39649
39664
|
}
|
|
39650
39665
|
const parsed = deps.parseTypecheckOutput(result.output, "auto", { workdir: input.workdir });
|
|
39651
|
-
|
|
39666
|
+
const parsedFindings = parsed?.findings ?? [];
|
|
39667
|
+
const sentinel = {
|
|
39668
|
+
source: "typecheck",
|
|
39669
|
+
severity: "error",
|
|
39670
|
+
category: "typecheck-failure",
|
|
39671
|
+
fixTarget: "source",
|
|
39672
|
+
message: `typecheck failed (no structured findings parsed), please run the typecheck command: ${command}`
|
|
39673
|
+
};
|
|
39674
|
+
const findings = parsedFindings.length > 0 ? parsedFindings : [sentinel];
|
|
39675
|
+
return { success: false, findings, durationMs: Date.now() - start };
|
|
39652
39676
|
}
|
|
39653
39677
|
};
|
|
39654
39678
|
});
|
|
@@ -40467,6 +40491,67 @@ var init_text_block2 = __esm(() => {
|
|
|
40467
40491
|
};
|
|
40468
40492
|
});
|
|
40469
40493
|
|
|
40494
|
+
// src/review/lint-parsing/strategies/ruff-annotated.ts
|
|
40495
|
+
function parseRuffAnnotated(output) {
|
|
40496
|
+
if (!output.trim())
|
|
40497
|
+
return null;
|
|
40498
|
+
const lines = output.split(/\r?\n/);
|
|
40499
|
+
let hasArrow = false;
|
|
40500
|
+
for (const line of lines) {
|
|
40501
|
+
if (ARROW_RE.test(line)) {
|
|
40502
|
+
hasArrow = true;
|
|
40503
|
+
break;
|
|
40504
|
+
}
|
|
40505
|
+
}
|
|
40506
|
+
if (!hasArrow)
|
|
40507
|
+
return null;
|
|
40508
|
+
const diagnostics = [];
|
|
40509
|
+
let i = 0;
|
|
40510
|
+
while (i < lines.length) {
|
|
40511
|
+
const arrowMatch = ARROW_RE.exec(lines[i]);
|
|
40512
|
+
if (!arrowMatch || !SOURCE_EXT_RE2.test(arrowMatch[1])) {
|
|
40513
|
+
i++;
|
|
40514
|
+
continue;
|
|
40515
|
+
}
|
|
40516
|
+
const file3 = arrowMatch[1];
|
|
40517
|
+
const line = Number.parseInt(arrowMatch[2], 10);
|
|
40518
|
+
const col = arrowMatch[3] ? Number.parseInt(arrowMatch[3], 10) : undefined;
|
|
40519
|
+
const messageLines = [];
|
|
40520
|
+
let j = i - 1;
|
|
40521
|
+
while (j >= 0) {
|
|
40522
|
+
const l = lines[j]?.trim() ?? "";
|
|
40523
|
+
if (!l || ARROW_RE.test(lines[j] ?? "") || CONTEXT_LINE_RE.test(lines[j] ?? ""))
|
|
40524
|
+
break;
|
|
40525
|
+
messageLines.unshift(lines[j] ?? "");
|
|
40526
|
+
j--;
|
|
40527
|
+
}
|
|
40528
|
+
const contextLines = [lines[i]];
|
|
40529
|
+
let k = i + 1;
|
|
40530
|
+
while (k < lines.length && CONTEXT_LINE_RE.test(lines[k])) {
|
|
40531
|
+
contextLines.push(lines[k]);
|
|
40532
|
+
k++;
|
|
40533
|
+
}
|
|
40534
|
+
const raw = [...messageLines, ...contextLines].join(`
|
|
40535
|
+
`);
|
|
40536
|
+
const message = (messageLines[messageLines.length - 1] ?? file3).trim();
|
|
40537
|
+
diagnostics.push({ file: file3, line, column: col, message, raw });
|
|
40538
|
+
i = k;
|
|
40539
|
+
}
|
|
40540
|
+
if (diagnostics.length === 0)
|
|
40541
|
+
return null;
|
|
40542
|
+
return { diagnostics, format: "ruff-annotated" };
|
|
40543
|
+
}
|
|
40544
|
+
var ARROW_RE, CONTEXT_LINE_RE, ruffAnnotatedStrategy;
|
|
40545
|
+
var init_ruff_annotated = __esm(() => {
|
|
40546
|
+
init_text_block2();
|
|
40547
|
+
ARROW_RE = /^\s+-->\s+(.+?):(\d+)(?::(\d+))?$/;
|
|
40548
|
+
CONTEXT_LINE_RE = /^\s*\d*\s*\|/;
|
|
40549
|
+
ruffAnnotatedStrategy = {
|
|
40550
|
+
name: "ruff-annotated",
|
|
40551
|
+
parse: parseRuffAnnotated
|
|
40552
|
+
};
|
|
40553
|
+
});
|
|
40554
|
+
|
|
40470
40555
|
// src/review/lint-parsing/parse.ts
|
|
40471
40556
|
function strategiesFor2(format) {
|
|
40472
40557
|
if (format === "eslint-json")
|
|
@@ -40474,12 +40559,12 @@ function strategiesFor2(format) {
|
|
|
40474
40559
|
if (format === "biome-json")
|
|
40475
40560
|
return [biomeJsonStrategy];
|
|
40476
40561
|
if (format === "text")
|
|
40477
|
-
return [textBlockStrategy];
|
|
40562
|
+
return [ruffAnnotatedStrategy, textBlockStrategy];
|
|
40478
40563
|
if (format === "none")
|
|
40479
40564
|
return [];
|
|
40480
|
-
return [eslintJsonStrategy, biomeJsonStrategy, textBlockStrategy];
|
|
40565
|
+
return [eslintJsonStrategy, biomeJsonStrategy, ruffAnnotatedStrategy, textBlockStrategy];
|
|
40481
40566
|
}
|
|
40482
|
-
function
|
|
40567
|
+
function toolForFormat2(format) {
|
|
40483
40568
|
if (format === "biome-json")
|
|
40484
40569
|
return "biome";
|
|
40485
40570
|
if (format === "eslint-json")
|
|
@@ -40493,7 +40578,7 @@ function parseLintOutput(output, format = "auto", opts) {
|
|
|
40493
40578
|
const parsed = strategy.parse(output);
|
|
40494
40579
|
if (parsed && parsed.diagnostics.length > 0) {
|
|
40495
40580
|
if (opts) {
|
|
40496
|
-
const tool =
|
|
40581
|
+
const tool = toolForFormat2(parsed.format);
|
|
40497
40582
|
const findings = parsed.diagnostics.map((d) => lintDiagnosticToFinding(d, opts.workdir, tool));
|
|
40498
40583
|
return { ...parsed, findings };
|
|
40499
40584
|
}
|
|
@@ -40513,6 +40598,7 @@ var init_parse4 = __esm(() => {
|
|
|
40513
40598
|
init_findings();
|
|
40514
40599
|
init_biome_json();
|
|
40515
40600
|
init_eslint_json();
|
|
40601
|
+
init_ruff_annotated();
|
|
40516
40602
|
init_text_block2();
|
|
40517
40603
|
});
|
|
40518
40604
|
|
|
@@ -59572,7 +59658,7 @@ var package_default;
|
|
|
59572
59658
|
var init_package = __esm(() => {
|
|
59573
59659
|
package_default = {
|
|
59574
59660
|
name: "@nathapp/nax",
|
|
59575
|
-
version: "0.69.
|
|
59661
|
+
version: "0.69.5",
|
|
59576
59662
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
59577
59663
|
type: "module",
|
|
59578
59664
|
bin: {
|
|
@@ -59667,8 +59753,8 @@ var init_version = __esm(() => {
|
|
|
59667
59753
|
NAX_VERSION = package_default.version;
|
|
59668
59754
|
NAX_COMMIT = (() => {
|
|
59669
59755
|
try {
|
|
59670
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
59671
|
-
return "
|
|
59756
|
+
if (/^[0-9a-f]{6,10}$/.test("f09a75e2"))
|
|
59757
|
+
return "f09a75e2";
|
|
59672
59758
|
} catch {}
|
|
59673
59759
|
try {
|
|
59674
59760
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|