@castlemilk/omega 0.6.15 → 0.6.16

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 (50) hide show
  1. package/dist/cli.js +313 -21
  2. package/dist/server/dist/app.js +2 -2
  3. package/dist/server/dist/app.js.map +1 -1
  4. package/dist/server/dist/routes/benchmarks.d.ts +4 -0
  5. package/dist/server/dist/routes/benchmarks.d.ts.map +1 -0
  6. package/dist/server/dist/routes/benchmarks.js +131 -0
  7. package/dist/server/dist/routes/benchmarks.js.map +1 -0
  8. package/dist/server/dist/routes/prompt-versions.d.ts.map +1 -1
  9. package/dist/server/dist/routes/prompt-versions.js +15 -19
  10. package/dist/server/dist/routes/prompt-versions.js.map +1 -1
  11. package/dist/server/node_modules/@grpc/proto-loader/build/bin/proto-loader-gen-types.js +0 -0
  12. package/dist/server/node_modules/@omega/agent/dist/index.d.ts +1 -1
  13. package/dist/server/node_modules/@omega/agent/dist/index.d.ts.map +1 -1
  14. package/dist/server/node_modules/@omega/agent/dist/index.js +1 -1
  15. package/dist/server/node_modules/@omega/agent/dist/index.js.map +1 -1
  16. package/dist/server/node_modules/@omega/agent/dist/prompts.d.ts +1 -1
  17. package/dist/server/node_modules/@omega/agent/dist/prompts.d.ts.map +1 -1
  18. package/dist/server/node_modules/@omega/agent/dist/prompts.js +23 -13
  19. package/dist/server/node_modules/@omega/agent/dist/prompts.js.map +1 -1
  20. package/dist/server/node_modules/@omega/db/generated/client/libquery_engine-darwin-arm64.dylib.node +0 -0
  21. package/dist/server/node_modules/mime/cli.js +0 -0
  22. package/dist/server/node_modules/mime/src/build.js +0 -0
  23. package/dist/server/node_modules/wrap-ansi/index.js +0 -0
  24. package/dist/server/pglite-data/base/5/1247 +0 -0
  25. package/dist/server/pglite-data/base/5/1249 +0 -0
  26. package/dist/server/pglite-data/base/5/1259 +0 -0
  27. package/dist/server/pglite-data/base/5/16394 +0 -0
  28. package/dist/server/pglite-data/base/5/16404 +0 -0
  29. package/dist/server/pglite-data/base/5/16406 +0 -0
  30. package/dist/server/pglite-data/base/5/16421 +0 -0
  31. package/dist/server/pglite-data/base/5/16510 +0 -0
  32. package/dist/server/pglite-data/base/5/2604 +0 -0
  33. package/dist/server/pglite-data/base/5/2606 +0 -0
  34. package/dist/server/pglite-data/base/5/2610 +0 -0
  35. package/dist/server/pglite-data/base/5/2620 +0 -0
  36. package/dist/server/pglite-data/base/5/2662 +0 -0
  37. package/dist/server/pglite-data/base/5/2663 +0 -0
  38. package/dist/server/pglite-data/base/5/pg_internal.init +0 -0
  39. package/dist/server/pglite-data/global/pg_control +0 -0
  40. package/dist/server/pglite-data/pg_wal/000000010000000000000001 +0 -0
  41. package/dist/server/pglite-data/pg_xact/0000 +0 -0
  42. package/dist/server/pglite-data/postmaster.pid +1 -1
  43. package/dist/server/src/app.ts +2 -2
  44. package/dist/server/src/routes/benchmarks.ts +152 -0
  45. package/dist/server/src/routes/prompt-versions.ts +15 -20
  46. package/dist/web/dist/assets/index-B_XBuJZF.js +40 -0
  47. package/dist/web/dist/assets/index-CL9S3Jj5.js +40 -0
  48. package/dist/web/dist/assets/index-bU-GzLxD.css +1 -0
  49. package/dist/web/dist/index.html +2 -2
  50. package/package.json +14 -13
package/dist/cli.js CHANGED
@@ -1128,6 +1128,28 @@ function basePackage() {
1128
1128
  }
1129
1129
  };
1130
1130
  }
1131
+ function simpleTask(id, name, title, description, files, complexity = "simple") {
1132
+ return {
1133
+ id,
1134
+ name,
1135
+ title,
1136
+ description,
1137
+ complexity,
1138
+ setup: async (projectPath) => {
1139
+ await writeJson(projectPath, "package.json", basePackage());
1140
+ for (const [file, content] of Object.entries(files)) {
1141
+ await writeFile2(projectPath, file, content);
1142
+ }
1143
+ if (!files["lint.js"])
1144
+ await writeFile2(projectPath, "lint.js", `console.log('lint ok');
1145
+ `);
1146
+ if (!files["build.js"])
1147
+ await writeFile2(projectPath, "build.js", `console.log('build ok');
1148
+ `);
1149
+ },
1150
+ evaluate: (ctx) => Promise.resolve(validate(ctx))
1151
+ };
1152
+ }
1131
1153
  var TASKS = [
1132
1154
  {
1133
1155
  id: "greet-function",
@@ -1220,6 +1242,257 @@ console.log('constant test passed');
1220
1242
  },
1221
1243
  evaluate: (ctx) => Promise.resolve(validate(ctx))
1222
1244
  },
1245
+ simpleTask("sum-function", "Add a sum function", "Add math.js with a sum function", "Create math.js that exports sum(a, b) returning the numeric sum of the two arguments.", {
1246
+ "test.js": `import { sum } from './math.js';
1247
+ import assert from 'node:assert';
1248
+ assert.strictEqual(sum(2, 3), 5);
1249
+ assert.strictEqual(sum(-1, 1), 0);
1250
+ console.log('sum test passed');
1251
+ `
1252
+ }),
1253
+ simpleTask("reverse-string", "Add reverse string function", "Add string.js with reverse function", "Create string.js that exports reverse(str) returning the input string reversed.", {
1254
+ "test.js": `import { reverse } from './string.js';
1255
+ import assert from 'node:assert';
1256
+ assert.strictEqual(reverse('abc'), 'cba');
1257
+ assert.strictEqual(reverse('Hello'), 'olleH');
1258
+ console.log('reverse test passed');
1259
+ `
1260
+ }),
1261
+ simpleTask("is-even", "Add isEven helper", "Add helpers.js with isEven function", "Create helpers.js that exports isEven(n) returning true when n is divisible by 2.", {
1262
+ "test.js": `import { isEven } from './helpers.js';
1263
+ import assert from 'node:assert';
1264
+ assert.strictEqual(isEven(4), true);
1265
+ assert.strictEqual(isEven(3), false);
1266
+ console.log('isEven test passed');
1267
+ `
1268
+ }),
1269
+ simpleTask("uppercase-first", "Uppercase first letter", "Add capitalize.js with capitalize function", "Create capitalize.js that exports capitalize(str) returning the string with the first character upper-cased.", {
1270
+ "test.js": `import { capitalize } from './capitalize.js';
1271
+ import assert from 'node:assert';
1272
+ assert.strictEqual(capitalize('hello'), 'Hello');
1273
+ assert.strictEqual(capitalize(''), '');
1274
+ console.log('capitalize test passed');
1275
+ `
1276
+ }),
1277
+ simpleTask("remove-console-log", "Remove debug console.log", "Clean up debug logging", "Remove the console.log call from src/main.js so the linter passes. Do not change the exported function behavior.", {
1278
+ "src/main.js": `export function run() { console.log('debug'); return 'ok'; }
1279
+ `,
1280
+ "test.js": `import { run } from './src/main.js';
1281
+ import assert from 'node:assert';
1282
+ assert.strictEqual(run(), 'ok');
1283
+ console.log('run test passed');
1284
+ `,
1285
+ "lint.js": `import fs from 'node:fs/promises';
1286
+ const code = await fs.readFile('./src/main.js', 'utf-8');
1287
+ if (code.includes('console.log')) { console.error('lint failed: console.log found'); process.exit(1); }
1288
+ console.log('lint ok');
1289
+ `
1290
+ }),
1291
+ simpleTask("fix-indentation", "Fix indentation", "Normalize indentation in src/code.js", "Convert the mixed tabs/spaces indentation in src/code.js to two spaces so the lint script passes. Keep behavior.", {
1292
+ "src/code.js": `export function add(a, b) {
1293
+ return a + b;
1294
+ }
1295
+ `,
1296
+ "test.js": `import { add } from './src/code.js';
1297
+ import assert from 'node:assert';
1298
+ assert.strictEqual(add(1, 2), 3);
1299
+ console.log('add test passed');
1300
+ `,
1301
+ "lint.js": `import fs from 'node:fs/promises';
1302
+ const code = await fs.readFile('./src/code.js', 'utf-8');
1303
+ if (code.includes('\\t')) { console.error('lint failed: tabs found'); process.exit(1); }
1304
+ console.log('lint ok');
1305
+ `
1306
+ }),
1307
+ simpleTask("arrow-function", "Convert to arrow function", "Refactor src/math.js to use arrow function", "Rewrite src/math.js so double is defined as a const arrow function. Do not change behavior.", {
1308
+ "src/math.js": `export function double(n) { return n * 2; }
1309
+ `,
1310
+ "test.js": `import fs from 'node:fs/promises';
1311
+ import { double } from './src/math.js';
1312
+ import assert from 'node:assert';
1313
+ const code = await fs.readFile('./src/math.js', 'utf-8');
1314
+ assert.strictEqual(double(5), 10);
1315
+ if (!code.includes('=>')) { console.error('lint failed: not arrow function'); process.exit(1); }
1316
+ console.log('arrow test passed');
1317
+ `
1318
+ }),
1319
+ simpleTask("default-export", "Add a default export", "Make greet the default export", "Update greet.js so the greet function is the default export instead of a named export. Update the test accordingly.", {
1320
+ "greet.js": `export function greet(name) { return 'Hello, ' + name + '!'; }
1321
+ `,
1322
+ "test.js": `import greet from './greet.js';
1323
+ import assert from 'node:assert';
1324
+ assert.strictEqual(greet('World'), 'Hello, World!');
1325
+ console.log('default export test passed');
1326
+ `
1327
+ }),
1328
+ simpleTask("update-env", "Update environment variable default", "Set PORT in .env", "Create or update .env so it contains PORT=3000.", {
1329
+ "test.js": `import { readFile } from 'node:fs/promises';
1330
+ const env = await readFile('./.env', 'utf-8');
1331
+ if (!env.includes('PORT=3000')) { console.error('PORT=3000 not found'); process.exit(1); }
1332
+ console.log('env test passed');
1333
+ `
1334
+ }),
1335
+ simpleTask("add-package-script", "Add package script", "Add a format script to package.json", "Edit package.json to add a format script with value prettier --write .. Do not remove existing scripts.", {
1336
+ "test.js": `import { readFile } from 'node:fs/promises';
1337
+ const pkg = JSON.parse(await readFile('./package.json', 'utf-8'));
1338
+ if (pkg.scripts?.format !== 'prettier --write .') { console.error('format script missing'); process.exit(1); }
1339
+ console.log('package script test passed');
1340
+ `
1341
+ }),
1342
+ simpleTask("update-readme", "Update README heading", "Fix the README title", "Update README.md so the first line is # Omega Synthetic Bench instead of # Old Title.", {
1343
+ "README.md": `# Old Title
1344
+
1345
+ This is a sample project.
1346
+ `,
1347
+ "test.js": `import { readFile } from 'node:fs/promises';
1348
+ const readme = await readFile('./README.md', 'utf-8');
1349
+ if (!readme.startsWith('# Omega Synthetic Bench')) { console.error('README heading wrong'); process.exit(1); }
1350
+ console.log('readme test passed');
1351
+ `
1352
+ }),
1353
+ simpleTask("rename-variable", "Rename a variable", "Rename x to value", "In src/calc.js, rename the parameter x to value everywhere. Do not change behavior.", {
1354
+ "src/calc.js": `export function calc(x) { return x * 2; }
1355
+ `,
1356
+ "test.js": `import { calc } from './src/calc.js';
1357
+ import assert from 'node:assert';
1358
+ assert.strictEqual(calc(4), 8);
1359
+ console.log('rename test passed');
1360
+ `,
1361
+ "lint.js": `import fs from 'node:fs/promises';
1362
+ const code = await fs.readFile('./src/calc.js', 'utf-8');
1363
+ if (code.includes('(x)') || code.includes(' x ')) { console.error('old variable name found'); process.exit(1); }
1364
+ console.log('lint ok');
1365
+ `
1366
+ }),
1367
+ simpleTask("add-input-validation", "Add input validation", "Validate input in divide function", "Update src/divide.js so divide(a, b) throws an error when b is 0.", {
1368
+ "src/divide.js": `export function divide(a, b) { return a / b; }
1369
+ `,
1370
+ "test.js": `import { divide } from './src/divide.js';
1371
+ import assert from 'node:assert';
1372
+ assert.strictEqual(divide(10, 2), 5);
1373
+ try { divide(1, 0); console.error('should throw'); process.exit(1); } catch { }
1374
+ console.log('divide test passed');
1375
+ `
1376
+ }),
1377
+ simpleTask("handle-empty-array", "Handle empty array", "Make sumAll handle empty arrays", "Update src/sumAll.js so sumAll([]) returns 0 instead of throwing.", {
1378
+ "src/sumAll.js": `export function sumAll(numbers) { return numbers.reduce((a, b) => a + b); }
1379
+ `,
1380
+ "test.js": `import { sumAll } from './src/sumAll.js';
1381
+ import assert from 'node:assert';
1382
+ assert.strictEqual(sumAll([1, 2, 3]), 6);
1383
+ assert.strictEqual(sumAll([]), 0);
1384
+ console.log('sumAll test passed');
1385
+ `
1386
+ }),
1387
+ simpleTask("add-unit-test", "Add a unit test", "Write a test for multiply", "Create src/multiply.js exporting multiply(a, b). Then create test.js that asserts multiply(3, 4) === 12.", {
1388
+ "src/multiply.js": `export function multiply(a, b) { return a * b; }
1389
+ `,
1390
+ "test.js": `// replace with proper tests
1391
+ `,
1392
+ "lint.js": `import fs from 'node:fs/promises';
1393
+ const test = await fs.readFile('./test.js', 'utf-8');
1394
+ if (!test.includes('multiply')) { console.error('test does not cover multiply'); process.exit(1); }
1395
+ console.log('lint ok');
1396
+ `
1397
+ }),
1398
+ simpleTask("create-module-index", "Create module index", "Export all helpers from index.js", "Create src/index.js that re-exports foo from ./foo.js and bar from ./bar.js.", {
1399
+ "src/foo.js": `export const foo = 'foo';
1400
+ `,
1401
+ "src/bar.js": `export const bar = 'bar';
1402
+ `,
1403
+ "test.js": `import { foo, bar } from './src/index.js';
1404
+ import assert from 'node:assert';
1405
+ assert.strictEqual(foo, 'foo');
1406
+ assert.strictEqual(bar, 'bar');
1407
+ console.log('index test passed');
1408
+ `
1409
+ }),
1410
+ simpleTask("add-async-function", "Add async fetch wrapper", "Create fetchText function", "Create src/fetch.js exporting fetchText(url) that returns a Promise resolving to the string fetched: <url>.", {
1411
+ "test.js": `import { fetchText } from './src/fetch.js';
1412
+ import assert from 'node:assert';
1413
+ const result = await fetchText('https://example.com');
1414
+ assert.strictEqual(result, 'fetched: https://example.com');
1415
+ console.log('fetch test passed');
1416
+ `
1417
+ }),
1418
+ simpleTask("add-try-catch", "Wrap parsing in try/catch", "Make safeParse not throw", "Update src/parse.js so safeParse(str) returns null when JSON parsing fails instead of throwing.", {
1419
+ "src/parse.js": `export function safeParse(str) { return JSON.parse(str); }
1420
+ `,
1421
+ "test.js": `import { safeParse } from './src/parse.js';
1422
+ import assert from 'node:assert';
1423
+ assert.deepStrictEqual(safeParse('{"a":1}'), { a: 1 });
1424
+ assert.strictEqual(safeParse('not json'), null);
1425
+ console.log('safeParse test passed');
1426
+ `
1427
+ }),
1428
+ simpleTask("timeout-promise", "Add delay helper", "Create sleep(ms) helper", "Create src/time.js exporting sleep(ms) that returns a Promise resolving after ms milliseconds.", {
1429
+ "test.js": `import { sleep } from './src/time.js';
1430
+ const start = Date.now();
1431
+ await sleep(50);
1432
+ if (Date.now() - start < 40) { console.error('sleep too short'); process.exit(1); }
1433
+ console.log('sleep test passed');
1434
+ `
1435
+ }),
1436
+ simpleTask("read-test-path", "Create file at path from test", "Create lib/helpers.js with capitalize function", "Create a file that exports a capitalize(str) function. Read the existing test to find the exact import path and expected output.", {
1437
+ "test.js": `import { capitalize } from './lib/helpers.js';
1438
+ import assert from 'node:assert';
1439
+ assert.strictEqual(capitalize('hello'), 'Hello');
1440
+ console.log('capitalize test passed');
1441
+ `
1442
+ }, "medium"),
1443
+ simpleTask("add-cli-args-parser", "Add CLI argument parser", "Create parseArgs function", "Create src/args.js exporting parseArgs(argv) that returns an object from --key value pairs.", {
1444
+ "test.js": `import { parseArgs } from './src/args.js';
1445
+ import assert from 'node:assert';
1446
+ assert.deepStrictEqual(parseArgs(['--name', 'x', '--count', '2']), { name: 'x', count: '2' });
1447
+ console.log('args test passed');
1448
+ `
1449
+ }, "medium"),
1450
+ simpleTask("create-middleware", "Create logging middleware", "Add logger middleware", "Create src/middleware.js exporting logger(req, next) that calls next(), increments req.logCount and returns the result.", {
1451
+ "test.js": `import { logger } from './src/middleware.js';
1452
+ import assert from 'node:assert';
1453
+ const req = { logCount: 0 };
1454
+ const result = logger(req, () => 'done');
1455
+ assert.strictEqual(result, 'done');
1456
+ assert.strictEqual(req.logCount, 1);
1457
+ console.log('middleware test passed');
1458
+ `
1459
+ }, "medium"),
1460
+ simpleTask("add-throttle", "Add throttle helper", "Create throttle function", "Create src/throttle.js exporting throttle(fn, ms) that returns a throttled function (only calls fn at most once per ms).", {
1461
+ "test.js": `import { throttle } from './src/throttle.js';
1462
+ let calls = 0;
1463
+ const fn = throttle(() => calls++, 100);
1464
+ fn(); fn(); fn();
1465
+ assert.strictEqual(calls, 1);
1466
+ console.log('throttle test passed');
1467
+ `
1468
+ }, "medium"),
1469
+ simpleTask("memoize-function", "Add memoize helper", "Create memoize function", "Create src/memoize.js exporting memoize(fn) that caches results by first argument.", {
1470
+ "test.js": `import { memoize } from './src/memoize.js';
1471
+ let calls = 0;
1472
+ const fn = memoize((n) => { calls++; return n * 2; });
1473
+ assert.strictEqual(fn(3), 6);
1474
+ assert.strictEqual(fn(3), 6);
1475
+ assert.strictEqual(calls, 1);
1476
+ console.log('memoize test passed');
1477
+ `
1478
+ }, "medium"),
1479
+ simpleTask("fix-race-condition", "Fix a race condition", "Make counter increment atomic", "Update src/counter.js so increment() returns a Promise and uses a local variable correctly. Keep the async interface.", {
1480
+ "src/counter.js": `let count = 0;
1481
+ export async function increment() {
1482
+ const current = count;
1483
+ await Promise.resolve();
1484
+ count = current + 1;
1485
+ return count;
1486
+ }
1487
+ `,
1488
+ "test.js": `import { increment } from './src/counter.js';
1489
+ import assert from 'node:assert';
1490
+ await Promise.all([increment(), increment(), increment()]);
1491
+ const final = await increment();
1492
+ assert.strictEqual(final, 4);
1493
+ console.log('counter test passed');
1494
+ `
1495
+ }, "medium"),
1223
1496
  {
1224
1497
  id: "noop-validation",
1225
1498
  name: "Run validation on a clean project",
@@ -1393,11 +1666,14 @@ function buildOptimisePrompt(report, failedResult, traceFlowText) {
1393
1666
  lines.push("");
1394
1667
  }
1395
1668
  lines.push("## Instructions");
1396
- lines.push("Analyse the failures above and edit `packages/agent/src/prompts.ts` (and optionally `packages/agent/src/planner.ts`) to improve the Omega agent.");
1669
+ lines.push("Analyse the failures above and edit ONLY `packages/agent/src/prompts.ts` to improve the Omega agent.");
1670
+ lines.push("Your goal is to change the system prompt text so the agent avoids the observed failures.");
1397
1671
  lines.push("Rules:");
1398
- lines.push("- Keep changes minimal and targeted.");
1672
+ lines.push("- ONLY edit `packages/agent/src/prompts.ts`. Do NOT edit any other files, including schema files, migrations, or unrelated code.");
1673
+ lines.push("- Keep changes minimal and targeted to the failure pattern.");
1674
+ lines.push("- Use edit_file with an exact old_string from the file. Read the file first if needed.");
1399
1675
  lines.push("- Do not break existing tool signatures or system behaviour.");
1400
- lines.push("- Run `pnpm lint` and `pnpm test` after edits.");
1676
+ lines.push("- After editing, run `pnpm lint` and `pnpm test` to verify.");
1401
1677
  lines.push("- Finish with a summary of what changed and why it should help.");
1402
1678
  return lines.join("\n");
1403
1679
  }
@@ -1669,26 +1945,34 @@ Available tools:
1669
1945
  - run_command: Run a single simple command. No pipes (|), &&, ;, redirects, or globs. Prefer pnpm/npm/node. Arguments: { "command": "pnpm lint" }
1670
1946
  - think: Record a reasoning step. Arguments: { "thought": "..." }
1671
1947
  - finish: Mark the task complete. Arguments: { "summary": "what was done", "success": true }. Use summary, not message.
1672
- - publish: Run build/test/publish validation. Only after your edits pass validation. Arguments: { "version": "optional" }
1948
+ - publish: Run lint/test/build validation in one step. This is the preferred validation tool. Arguments: { "version": "optional" }
1673
1949
 
1674
1950
  Rules:
1675
1951
  1. Read the task, then use think to plan.
1676
1952
  2. Use edit_file for small changes; write_file only when creating a file or rewriting most of it.
1677
1953
  3. ALWAYS read a file with read_file before using edit_file on it. Do NOT read a file before write_file when creating a new file.
1678
1954
  4. Before creating JavaScript files, read package.json to check whether "type" is "module" and use ESM (export) or CommonJS (module.exports) accordingly.
1679
- 5. You MUST run validation (pnpm lint, pnpm test, or the project's validation command) after every edit using publish or run_command.
1680
- 6. Do NOT call finish until validation passes. If validation fails, fix the issue and re-run validation.
1681
- 7. Do not expose secrets or run destructive commands.
1682
- 8. Finish only when the task is done. Always include summary and success.
1683
- 9. Do not repeat the same tool call with the same arguments. If something fails, change your approach.
1684
- 10. Do not ask the user for clarification. Do not say "No task was provided". Use the Task and Description above to proceed.
1955
+ 5. Immediately after making any edit, call publish to run validation. Do not read more files, do not think, and do not call finish before validating.
1956
+ 6. If validation fails, fix the issue and call publish again. Repeat until validation passes.
1957
+ 7. Do NOT call finish until validation passes. If you call finish without validation, the task will fail.
1958
+ 8. Do not expose secrets or run destructive commands.
1959
+ 9. Finish only when the task is done. Always include summary and success.
1960
+ 10. Do not repeat the same tool call with the same arguments. If something fails, change your approach.
1961
+ 11. Do not ask the user for clarification. Do not say "No task was provided". Use the Task and Description above to proceed.
1962
+ 12. You have a limited number of steps. If you spend too many steps reading or planning without validating, the task will fail.
1685
1963
 
1686
1964
  Example tool call sequence for "Add a greet function":
1687
1965
  1. think: { "thought": "I need to create greet.js and export a greet function." }
1688
- 2. write_file: { "path": "greet.js", "content": "export function greet(name) { return 'Hello, ' + name + '!'; }
1689
- " }
1966
+ 2. write_file: { "path": "greet.js", "content": "export function greet(name) { return 'Hello, ' + name + '!'; }\\n" }
1690
1967
  3. publish: { }
1691
- 4. finish: { "summary": "Created greet.js with greet(name) function and verified it passes tests.", "success": true }`;
1968
+ 4. finish: { "summary": "Created greet.js with greet(name) function and verified it passes tests.", "success": true }
1969
+
1970
+ Example tool call sequence for "Fix a lint warning":
1971
+ 1. think: { "thought": "The linter flags var. I need to read src/index.js and replace var with const or let." }
1972
+ 2. read_file: { "path": "src/index.js" }
1973
+ 3. edit_file: { "path": "src/index.js", "old_string": "var greeting = 'Hello';", "new_string": "const greeting = 'Hello';" }
1974
+ 4. publish: { }
1975
+ 5. finish: { "summary": "Replaced var with const and verified lint passes.", "success": true }`;
1692
1976
  var TEXT_TOOLS_SYSTEM_PROMPT = loadPromptFromEnv("OMEGA_TEXT_TOOLS_PROMPT") ?? `You are Omega, an autonomous software engineering agent running inside a project repository.
1693
1977
 
1694
1978
  You MUST respond with a single JSON object containing a "tool_calls" array. Do not output markdown, explanations, or reasoning outside the JSON.
@@ -1708,8 +1992,9 @@ Rules:
1708
1992
  - Use edit_file for small changes; write_file only for new files or large rewrites.
1709
1993
  - ALWAYS read a file with read_file before using edit_file on it. Do NOT read a file before write_file when creating a new file.
1710
1994
  - Before creating JavaScript files, read package.json to check whether "type" is "module" and use ESM (export) or CommonJS (module.exports) accordingly.
1711
- - You MUST run validation (pnpm lint, pnpm test, or the project's validation command) after every edit using publish or run_command.
1712
- - Do NOT call finish until validation passes. If validation fails, fix the issue and re-run validation.
1995
+ - Immediately after making any edit, call publish to run validation. Do not read more files or call finish before validating.
1996
+ - If validation fails, fix the issue and call publish again.
1997
+ - Do NOT call finish until validation passes.
1713
1998
  - Do not expose secrets or run destructive commands.
1714
1999
  - Finish only when done. Use summary, not message.
1715
2000
  - Do not repeat the same tool call with the same arguments.
@@ -1718,8 +2003,7 @@ Rules:
1718
2003
  Example response for "Add a greet function":
1719
2004
  { "tool_calls": [
1720
2005
  { "id": "1", "name": "think", "arguments": { "thought": "Create greet.js with greet(name)." } },
1721
- { "id": "2", "name": "write_file", "arguments": { "path": "greet.js", "content": "export function greet(name) { return 'Hello, ' + name + '!'; }
1722
- " } },
2006
+ { "id": "2", "name": "write_file", "arguments": { "path": "greet.js", "content": "export function greet(name) { return 'Hello, ' + name + '!'; }\\n" } },
1723
2007
  { "id": "3", "name": "publish", "arguments": {} },
1724
2008
  { "id": "4", "name": "finish", "arguments": { "summary": "Created greet.js and verified tests pass.", "success": true } }
1725
2009
  ] }`;
@@ -1935,7 +2219,10 @@ var loopCmd = new Command8("loop").description("Run a self-improve benchmark loo
1935
2219
  for (let i = 1; i <= maxIterations; i++) {
1936
2220
  console.log(`
1937
2221
  === Iteration ${String(i)}/${String(maxIterations)} ===`);
1938
- const beforeVersion = await savePromptVersion(apiUrl, `loop-before-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`);
2222
+ const beforeVersion = await savePromptVersion(
2223
+ apiUrl,
2224
+ `loop-before-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`
2225
+ );
1939
2226
  if (beforeVersion) {
1940
2227
  console.log(`Saved before-loop prompt version: ${beforeVersion.name} (${beforeVersion.id})`);
1941
2228
  }
@@ -1972,8 +2259,10 @@ Running ${String(tasks.length)} benchmark tasks...`);
1972
2259
  body: JSON.stringify({ provider: opts.provider, model: opts.model })
1973
2260
  });
1974
2261
  }
1975
- console.log(`
1976
- Created self-improve task ${task.id}${opts.provider ? ` (provider: ${opts.provider})` : ""}${opts.model ? ` (model: ${opts.model})` : ""}`);
2262
+ console.log(
2263
+ `
2264
+ Created self-improve task ${task.id}${opts.provider ? ` (provider: ${opts.provider})` : ""}${opts.model ? ` (model: ${opts.model})` : ""}`
2265
+ );
1977
2266
  console.log("Running agent...");
1978
2267
  await runTask(apiUrl, task.id);
1979
2268
  const finished = await waitForTask(apiUrl, task.id, timeoutMs * 5);
@@ -1981,7 +2270,10 @@ Created self-improve task ${task.id}${opts.provider ? ` (provider: ${opts.provid
1981
2270
  if (finished.error) {
1982
2271
  console.error(`Agent error: ${finished.error}`);
1983
2272
  }
1984
- const afterVersion = await savePromptVersion(apiUrl, `loop-after-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`);
2273
+ const afterVersion = await savePromptVersion(
2274
+ apiUrl,
2275
+ `loop-after-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`
2276
+ );
1985
2277
  if (afterVersion) {
1986
2278
  console.log(`Saved after-loop prompt version: ${afterVersion.name} (${afterVersion.id})`);
1987
2279
  }
@@ -7,7 +7,7 @@ import { providerRoutes } from './routes/providers.js';
7
7
  import { routerRoutes } from './routes/router.js';
8
8
  import { metricsRoutes } from './routes/metrics.js';
9
9
  import { promptVersionRoutes } from './routes/prompt-versions.js';
10
- import { reportRoutes } from './routes/reports.js';
10
+ import { benchmarkRoutes } from './routes/benchmarks.js';
11
11
  export const app = express();
12
12
  app.use(cors());
13
13
  app.use(express.json());
@@ -17,7 +17,7 @@ app.use('/providers', providerRoutes(prisma));
17
17
  app.use('/router', routerRoutes(prisma));
18
18
  app.use('/metrics', metricsRoutes(prisma));
19
19
  app.use('/prompt-versions', promptVersionRoutes(prisma));
20
- app.use('/reports', reportRoutes());
20
+ app.use('/benchmarks', benchmarkRoutes(prisma));
21
21
  app.use((err, _req, res, _next) => {
22
22
  console.error(err);
23
23
  const message = err instanceof Error ? err.message : 'Internal error';
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,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GAAY,EAAE,IAAqB,EAAE,GAAqB,EAAE,KAA2B,EAAE,EAAE;IAClG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACtE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Router } from 'express';
2
+ import type { PrismaClient } from '@omega/db';
3
+ export declare function benchmarkRoutes(_prisma: PrismaClient): Router;
4
+ //# sourceMappingURL=benchmarks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"benchmarks.d.ts","sourceRoot":"","sources":["../../src/routes/benchmarks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAyD9C,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CA6F7D"}
@@ -0,0 +1,131 @@
1
+ import { Router } from 'express';
2
+ import fs from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { spawn } from 'node:child_process';
6
+ import { z } from 'zod';
7
+ import { asyncHandler } from '../lib/async-handler.js';
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const root = path.resolve(__filename, '..', '..', '..', '..');
10
+ const reportsDir = path.join(root, '.omega', 'reports');
11
+ const statusFile = path.join(root, '.omega', 'bench-run-status.json');
12
+ const runSchema = z.object({
13
+ suite: z.enum(['synthetic', 'deep-swe']).optional(),
14
+ nTasks: z.number().int().positive().optional(),
15
+ provider: z.string().optional(),
16
+ model: z.string().optional(),
17
+ timeout: z.number().int().positive().optional(),
18
+ });
19
+ async function readStatus() {
20
+ try {
21
+ const raw = await fs.readFile(statusFile, 'utf-8');
22
+ return JSON.parse(raw);
23
+ }
24
+ catch {
25
+ return { running: false };
26
+ }
27
+ }
28
+ async function writeStatus(status) {
29
+ await fs.mkdir(path.dirname(statusFile), { recursive: true });
30
+ await fs.writeFile(statusFile, JSON.stringify(status, null, 2), 'utf-8');
31
+ }
32
+ function isReportFile(name, prefix) {
33
+ return name.startsWith(prefix) && name.endsWith('.json');
34
+ }
35
+ async function listReports(prefix) {
36
+ try {
37
+ const files = await fs.readdir(reportsDir);
38
+ return files
39
+ .filter((f) => isReportFile(f, prefix))
40
+ .sort()
41
+ .reverse();
42
+ }
43
+ catch {
44
+ return [];
45
+ }
46
+ }
47
+ export function benchmarkRoutes(_prisma) {
48
+ const r = Router();
49
+ r.get('/reports', asyncHandler(async (_req, res) => {
50
+ const [benchmark, ab] = await Promise.all([
51
+ listReports('benchmark-'),
52
+ listReports('ab-'),
53
+ ]);
54
+ res.json({ benchmark, ab });
55
+ }));
56
+ r.get('/reports/:file', asyncHandler(async (req, res) => {
57
+ const file = req.params.file;
58
+ if (!isReportFile(file, 'benchmark-') && !isReportFile(file, 'ab-')) {
59
+ res.status(400).json({ error: 'Invalid report file' });
60
+ return;
61
+ }
62
+ const filePath = path.join(reportsDir, file);
63
+ const resolved = path.resolve(filePath);
64
+ const resolvedReportsDir = path.resolve(reportsDir);
65
+ if (!resolved.startsWith(resolvedReportsDir + path.sep) && resolved !== resolvedReportsDir) {
66
+ res.status(400).json({ error: 'Invalid report path' });
67
+ return;
68
+ }
69
+ try {
70
+ const raw = await fs.readFile(filePath, 'utf-8');
71
+ const data = JSON.parse(raw);
72
+ res.json(data);
73
+ }
74
+ catch {
75
+ res.status(404).json({ error: 'Report not found' });
76
+ }
77
+ }));
78
+ r.post('/run', asyncHandler(async (req, res) => {
79
+ const body = runSchema.parse(req.body);
80
+ const status = await readStatus();
81
+ if (status.running) {
82
+ res.status(409).json({ error: 'Benchmark run already in progress', pid: status.pid });
83
+ return;
84
+ }
85
+ const args = ['apps/cli/dist/index.js', 'bench', 'run'];
86
+ if (body.suite) {
87
+ args.push('--suite', body.suite);
88
+ }
89
+ if (body.nTasks) {
90
+ args.push('--n-tasks', String(body.nTasks));
91
+ }
92
+ if (body.timeout) {
93
+ args.push('--timeout', String(body.timeout));
94
+ }
95
+ if (body.provider) {
96
+ args.push('--provider', body.provider);
97
+ }
98
+ if (body.model) {
99
+ args.push('--model', body.model);
100
+ }
101
+ const child = spawn('node', args, {
102
+ cwd: root,
103
+ detached: true,
104
+ stdio: ['ignore', 'pipe', 'pipe'],
105
+ });
106
+ let output = '';
107
+ child.stdout.on('data', (chunk) => {
108
+ output += chunk.toString();
109
+ });
110
+ child.stderr.on('data', (chunk) => {
111
+ output += chunk.toString();
112
+ });
113
+ child.on('exit', () => {
114
+ void (async () => {
115
+ const current = await readStatus();
116
+ if (current.pid === child.pid) {
117
+ await writeStatus({ running: false, output });
118
+ }
119
+ })();
120
+ });
121
+ child.unref();
122
+ await writeStatus({ running: true, pid: child.pid, output: '' });
123
+ res.status(202).json({ pid: child.pid, status: 'started' });
124
+ }));
125
+ r.get('/run-status', asyncHandler(async (_req, res) => {
126
+ const status = await readStatus();
127
+ res.json(status);
128
+ }));
129
+ return r;
130
+ }
131
+ //# sourceMappingURL=benchmarks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"benchmarks.js","sourceRoot":"","sources":["../../src/routes/benchmarks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,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AAG,MAAM,UAAU,EAAE,CAAC;QAClC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC,CAAC;IAEJ,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-versions.d.ts","sourceRoot":"","sources":["../../src/routes/prompt-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAc9C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA8BhE"}
1
+ {"version":3,"file":"prompt-versions.d.ts","sourceRoot":"","sources":["../../src/routes/prompt-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAa9C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA0BhE"}