nex-code 0.4.41 → 0.5.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.
- package/README.md +237 -1522
- package/dist/benchmark.js +535 -436
- package/dist/nex-code.js +838 -739
- package/dist/skills/autoresearch.js +11 -11
- package/package.json +10 -4
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* - No iteration cap by default — runs until stopped
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const { execSync, spawn } = require("child_process");
|
|
17
|
+
const { execSync, execFileSync, spawn } = require("child_process");
|
|
18
18
|
const fs = require("fs");
|
|
19
19
|
const path = require("path");
|
|
20
|
+
const { T: _T } = require("../theme");
|
|
20
21
|
|
|
21
22
|
// Lazy-load agent to reset read guards between experiments
|
|
22
23
|
function resetReadGuards() {
|
|
@@ -473,7 +474,7 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
473
474
|
// Check if branch already exists
|
|
474
475
|
let branchExists = false;
|
|
475
476
|
try {
|
|
476
|
-
|
|
477
|
+
execFileSync("git", ["rev-parse", "--verify", branchName], {
|
|
477
478
|
cwd: process.cwd(),
|
|
478
479
|
stdio: ["pipe", "pipe", "pipe"],
|
|
479
480
|
});
|
|
@@ -492,7 +493,7 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
492
493
|
} catch {
|
|
493
494
|
// Ignore stash errors (nothing to stash)
|
|
494
495
|
}
|
|
495
|
-
|
|
496
|
+
execFileSync("git", ["checkout", branchName], {
|
|
496
497
|
cwd: process.cwd(),
|
|
497
498
|
stdio: ["pipe", "pipe", "pipe"],
|
|
498
499
|
});
|
|
@@ -504,7 +505,7 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
504
505
|
}
|
|
505
506
|
|
|
506
507
|
const sourceBranch = gitBranch() || "unknown";
|
|
507
|
-
|
|
508
|
+
execFileSync("git", ["checkout", "-b", branchName], {
|
|
508
509
|
cwd: process.cwd(),
|
|
509
510
|
stdio: ["pipe", "pipe", "pipe"],
|
|
510
511
|
});
|
|
@@ -554,8 +555,7 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
554
555
|
}).trim();
|
|
555
556
|
|
|
556
557
|
if (hasChanges) {
|
|
557
|
-
|
|
558
|
-
`git commit -m "autoresearch: checkpoint before: ${(args.message || "experiment").replace(/"/g, '\\"')}"`,
|
|
558
|
+
execFileSync("git", ["commit", "-m", `autoresearch: checkpoint before: ${args.message || "experiment"}`],
|
|
559
559
|
{ cwd: process.cwd(), stdio: "pipe" },
|
|
560
560
|
);
|
|
561
561
|
}
|
|
@@ -960,7 +960,7 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
960
960
|
args.metric < sessionBaselineScore
|
|
961
961
|
) {
|
|
962
962
|
console.log(
|
|
963
|
-
|
|
963
|
+
`${_T.red} ⚠ Score ${args.metric} < baseline ${sessionBaselineScore} — overriding kept=true to kept=false${_T.reset}`,
|
|
964
964
|
);
|
|
965
965
|
args.kept = false;
|
|
966
966
|
args.status = "discard";
|
|
@@ -995,8 +995,8 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
995
995
|
const keptCount = experiments.filter((e) => e.kept).length;
|
|
996
996
|
const revertedCount = experiments.filter((e) => !e.kept).length;
|
|
997
997
|
const statusIcon = args.kept
|
|
998
|
-
?
|
|
999
|
-
:
|
|
998
|
+
? `${_T.green}✔ KEPT${_T.reset}`
|
|
999
|
+
: `${_T.red}✘ REVERTED${_T.reset}`;
|
|
1000
1000
|
const delta =
|
|
1001
1001
|
prev != null && typeof args.metric === "number"
|
|
1002
1002
|
? ` (${args.metric > prev ? "+" : ""}${(args.metric - prev).toFixed(1)} pts)`
|
|
@@ -1086,7 +1086,7 @@ Use ar_run_experiment with output_file to redirect, then ar_extract_metric to re
|
|
|
1086
1086
|
|
|
1087
1087
|
const expNum = experiments.length + 1;
|
|
1088
1088
|
console.log(
|
|
1089
|
-
|
|
1089
|
+
`${_T.yellow} ↩ Reverted${_T.reset} ${currentHash.slice(0, 7)} → ${newHash.slice(0, 7)}${args.reason ? ` (${args.reason})` : ""}`,
|
|
1090
1090
|
);
|
|
1091
1091
|
|
|
1092
1092
|
return JSON.stringify({
|
|
@@ -1288,7 +1288,7 @@ function _runWatchTest(testCommand, changedFile) {
|
|
|
1288
1288
|
} catch {
|
|
1289
1289
|
// Agent not in active conversation — just log
|
|
1290
1290
|
process.stderr.write(
|
|
1291
|
-
`\n
|
|
1291
|
+
`\n${_T.yellow}⚠ Watch: tests failed after ${changedFile} changed${_T.reset}\n`,
|
|
1292
1292
|
);
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nex-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first — OpenAI, Anthropic, and Gemini when you need them.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nex-code": "./dist/nex-code.js"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"start": "node dist/nex-code.js",
|
|
19
19
|
"build": "node scripts/build.js",
|
|
20
20
|
"dev": "node scripts/build.js --dev",
|
|
21
|
-
"test": "jest --forceExit",
|
|
21
|
+
"test": "jest --forceExit --maxWorkers=50%",
|
|
22
22
|
"test:orchestrator": "jest tests/orchestrator.test.js --forceExit",
|
|
23
23
|
"coverage": "jest --coverage --forceExit",
|
|
24
24
|
"test:watch": "jest --watch",
|
|
@@ -30,7 +30,11 @@
|
|
|
30
30
|
"improve": "node scripts/improve.js",
|
|
31
31
|
"extract-examples": "node scripts/extract-examples.js",
|
|
32
32
|
"benchmark:realworld": "node scripts/benchmark-realworld.js",
|
|
33
|
-
"
|
|
33
|
+
"benchmark:reallife": "node scripts/benchmark-reallife.js",
|
|
34
|
+
"benchmark:report": "node scripts/benchmark-reallife-report.js",
|
|
35
|
+
"improve:reallife": "node scripts/improve-reallife.js",
|
|
36
|
+
"benchmark:gate": "node scripts/benchmark-gate.js",
|
|
37
|
+
"release": "bash scripts/release.sh"
|
|
34
38
|
},
|
|
35
39
|
"keywords": [
|
|
36
40
|
"ai",
|
|
@@ -69,7 +73,9 @@
|
|
|
69
73
|
"license": "MIT",
|
|
70
74
|
"dependencies": {
|
|
71
75
|
"axios": "^1.7.0",
|
|
72
|
-
"dotenv": "^16.4.0"
|
|
76
|
+
"dotenv": "^16.4.0",
|
|
77
|
+
"pixelmatch": "^7.1.0",
|
|
78
|
+
"pngjs": "^7.0.0"
|
|
73
79
|
},
|
|
74
80
|
"devDependencies": {
|
|
75
81
|
"esbuild": "^0.27.3",
|