agentv 4.20.0 → 4.21.0-next.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.
Files changed (27) hide show
  1. package/dist/{artifact-writer-RFXWXUOV.js → artifact-writer-E775664W.js} +4 -4
  2. package/dist/{chunk-36HXBYUY.js → chunk-27VT2KU2.js} +32 -27
  3. package/dist/chunk-27VT2KU2.js.map +1 -0
  4. package/dist/{chunk-LP4Y5D2Z.js → chunk-ERSBQAGK.js} +95 -27
  5. package/dist/chunk-ERSBQAGK.js.map +1 -0
  6. package/dist/{chunk-ZNS74WKH.js → chunk-FZUNMXBT.js} +3 -3
  7. package/dist/{chunk-PHGEGHKR.js → chunk-GPHMCZH3.js} +186 -30
  8. package/dist/chunk-GPHMCZH3.js.map +1 -0
  9. package/dist/{chunk-KJZ7PZCE.js → chunk-UDVKAK3V.js} +78 -132
  10. package/dist/{chunk-KJZ7PZCE.js.map → chunk-UDVKAK3V.js.map} +1 -1
  11. package/dist/cli.js +5 -5
  12. package/dist/{dist-GURCO6IS.js → dist-RSAA3T6F.js} +3 -3
  13. package/dist/index.js +5 -5
  14. package/dist/{interactive-GLRASSKM.js → interactive-5HLYHNUC.js} +5 -5
  15. package/dist/studio/assets/{index-KfPHd-QM.js → index-BVSHI8Eo.js} +1 -1
  16. package/dist/studio/assets/{index-BTsTcivx.js → index-SZVrc1UE.js} +20 -20
  17. package/dist/studio/index.html +1 -1
  18. package/dist/{ts-eval-loader-32COE32J-TCT4RIRT.js → ts-eval-loader-HPIPE72C-GDYGJVIA.js} +2 -2
  19. package/package.json +1 -1
  20. package/dist/chunk-36HXBYUY.js.map +0 -1
  21. package/dist/chunk-LP4Y5D2Z.js.map +0 -1
  22. package/dist/chunk-PHGEGHKR.js.map +0 -1
  23. /package/dist/{artifact-writer-RFXWXUOV.js.map → artifact-writer-E775664W.js.map} +0 -0
  24. /package/dist/{chunk-ZNS74WKH.js.map → chunk-FZUNMXBT.js.map} +0 -0
  25. /package/dist/{dist-GURCO6IS.js.map → dist-RSAA3T6F.js.map} +0 -0
  26. /package/dist/{interactive-GLRASSKM.js.map → interactive-5HLYHNUC.js.map} +0 -0
  27. /package/dist/{ts-eval-loader-32COE32J-TCT4RIRT.js.map → ts-eval-loader-HPIPE72C-GDYGJVIA.js.map} +0 -0
@@ -417,14 +417,14 @@ __export(external_exports2, {
417
417
  void: () => voidType
418
418
  });
419
419
 
420
- // ../../packages/core/dist/chunk-24ND5HZC.js
420
+ // ../../packages/core/dist/chunk-LKX4QW3G.js
421
421
  import { constants } from "node:fs";
422
422
  import { access, readFile } from "node:fs/promises";
423
423
  import path from "node:path";
424
424
  import { existsSync, readFileSync } from "node:fs";
425
425
  import { homedir } from "node:os";
426
426
  import path2 from "node:path";
427
- import { readFile as readFile2 } from "node:fs/promises";
427
+ import { readFile as readFile2, readdir, stat } from "node:fs/promises";
428
428
  import path3 from "node:path";
429
429
  import fg from "fast-glob";
430
430
  import { parse as parseYaml } from "yaml";
@@ -2254,6 +2254,63 @@ async function resolveFileReference2(ref, evalFileDir) {
2254
2254
  }
2255
2255
  return loadCasesFromFile(absolutePattern);
2256
2256
  }
2257
+ async function loadCasesFromDirectory(dirPath) {
2258
+ const entries = await readdir(dirPath, { withFileTypes: true });
2259
+ const subdirs = entries.filter((e) => e.isDirectory()).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
2260
+ const results = [];
2261
+ for (const subdir of subdirs) {
2262
+ const subdirPath = path3.join(dirPath, subdir.name);
2263
+ let caseFilePath;
2264
+ for (const filename of ["case.yaml", "case.yml"]) {
2265
+ const candidate = path3.join(subdirPath, filename);
2266
+ try {
2267
+ const s = await stat(candidate);
2268
+ if (s.isFile()) {
2269
+ caseFilePath = candidate;
2270
+ break;
2271
+ }
2272
+ } catch {
2273
+ }
2274
+ }
2275
+ if (!caseFilePath) {
2276
+ console.warn(
2277
+ `${ANSI_YELLOW}Warning: Skipping directory '${subdir.name}' \u2014 no case.yaml found${ANSI_RESET}`
2278
+ );
2279
+ continue;
2280
+ }
2281
+ let content;
2282
+ try {
2283
+ content = await readFile2(caseFilePath, "utf8");
2284
+ } catch (error) {
2285
+ const message = error instanceof Error ? error.message : String(error);
2286
+ throw new Error(`Cannot read case file: ${caseFilePath}
2287
+ ${message}`);
2288
+ }
2289
+ const raw = parseYaml(content);
2290
+ const parsed = interpolateEnv(raw, process.env);
2291
+ if (!isJsonObject(parsed)) {
2292
+ throw new Error(
2293
+ `Case file must contain a YAML object, got ${typeof parsed}: ${caseFilePath}`
2294
+ );
2295
+ }
2296
+ const caseObj = { ...parsed };
2297
+ if (caseObj.id === void 0 || caseObj.id === null) {
2298
+ caseObj.id = subdir.name;
2299
+ }
2300
+ if (!caseObj.workspace) {
2301
+ const workspaceDirPath = path3.join(subdirPath, "workspace");
2302
+ try {
2303
+ const s = await stat(workspaceDirPath);
2304
+ if (s.isDirectory()) {
2305
+ caseObj.workspace = { template: workspaceDirPath };
2306
+ }
2307
+ } catch {
2308
+ }
2309
+ }
2310
+ results.push(caseObj);
2311
+ }
2312
+ return results;
2313
+ }
2257
2314
  async function expandFileReferences(tests, evalFileDir) {
2258
2315
  const expanded = [];
2259
2316
  for (const entry of tests) {
@@ -8225,7 +8282,7 @@ var _a20;
8225
8282
  _a20 = symbol20;
8226
8283
  var defaultDownload2 = createDownload();
8227
8284
 
8228
- // ../../packages/core/dist/chunk-ELF6SQAK.js
8285
+ // ../../packages/core/dist/chunk-WCW3V6QJ.js
8229
8286
  import path46 from "node:path";
8230
8287
  import { pathToFileURL as pathToFileURL2 } from "node:url";
8231
8288
  import { existsSync as existsSync6 } from "node:fs";
@@ -8234,7 +8291,7 @@ import micromatch4 from "micromatch";
8234
8291
  import { execFile as execFile3 } from "node:child_process";
8235
8292
  import { createHash as createHash2, randomUUID as randomUUID9 } from "node:crypto";
8236
8293
  import { existsSync as existsSync5 } from "node:fs";
8237
- import { copyFile as copyFile2, mkdir as mkdir14, readdir as readdir8, stat as stat8 } from "node:fs/promises";
8294
+ import { copyFile as copyFile2, mkdir as mkdir14, readdir as readdir8, stat as stat9 } from "node:fs/promises";
8238
8295
  import path44 from "node:path";
8239
8296
  import { promisify as promisify7 } from "node:util";
8240
8297
  import micromatch3 from "micromatch";
@@ -12915,7 +12972,7 @@ var openrouter = createOpenRouter({
12915
12972
  // strict for OpenRouter API
12916
12973
  });
12917
12974
 
12918
- // ../../packages/core/dist/chunk-ELF6SQAK.js
12975
+ // ../../packages/core/dist/chunk-WCW3V6QJ.js
12919
12976
  import { spawn } from "node:child_process";
12920
12977
  import { randomUUID } from "node:crypto";
12921
12978
  import { createWriteStream } from "node:fs";
@@ -14419,10 +14476,10 @@ var RequestError = class _RequestError extends Error {
14419
14476
  }
14420
14477
  };
14421
14478
 
14422
- // ../../packages/core/dist/chunk-ELF6SQAK.js
14479
+ // ../../packages/core/dist/chunk-WCW3V6QJ.js
14423
14480
  import { exec as execCallback } from "node:child_process";
14424
14481
  import { readdirSync, statSync } from "node:fs";
14425
- import { readFile as readFile22, readdir, stat } from "node:fs/promises";
14482
+ import { readFile as readFile22, readdir as readdir2, stat as stat2 } from "node:fs/promises";
14426
14483
  import path9 from "node:path";
14427
14484
  import { promisify as promisify2 } from "node:util";
14428
14485
  import { randomUUID as randomUUID4 } from "node:crypto";
@@ -14433,7 +14490,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
14433
14490
  import { readFile as readFile4 } from "node:fs/promises";
14434
14491
  import { homedir as homedir4 } from "node:os";
14435
14492
  import path13 from "node:path";
14436
- import { readFile as readFile32, readdir as readdir2, stat as stat2 } from "node:fs/promises";
14493
+ import { readFile as readFile32, readdir as readdir22, stat as stat22 } from "node:fs/promises";
14437
14494
  import { homedir as homedir32 } from "node:os";
14438
14495
  import path12 from "node:path";
14439
14496
  import { parse as parseYaml2 } from "yaml";
@@ -14503,7 +14560,7 @@ import path35 from "node:path";
14503
14560
  import { promisify as promisify6 } from "node:util";
14504
14561
  import { readdir as readdir7, stat as stat7 } from "node:fs/promises";
14505
14562
  import path36 from "node:path";
14506
- import { readFile as readFile15 } from "node:fs/promises";
14563
+ import { readFile as readFile15, stat as stat8 } from "node:fs/promises";
14507
14564
  import path43 from "node:path";
14508
14565
  import micromatch2 from "micromatch";
14509
14566
  import { parse as parse4 } from "yaml";
@@ -16565,11 +16622,11 @@ function createFilesystemTools(workspacePath) {
16565
16622
  execute: async (input) => {
16566
16623
  try {
16567
16624
  const resolved = resolveSandboxed(workspacePath, input.path);
16568
- const stat9 = await fs.stat(resolved);
16569
- if (stat9.isDirectory()) {
16625
+ const stat10 = await fs.stat(resolved);
16626
+ if (stat10.isDirectory()) {
16570
16627
  return { error: `'${input.path}' is a directory, not a file` };
16571
16628
  }
16572
- const buffer = Buffer.alloc(Math.min(stat9.size, MAX_FILE_SIZE));
16629
+ const buffer = Buffer.alloc(Math.min(stat10.size, MAX_FILE_SIZE));
16573
16630
  const fd = await fs.open(resolved, "r");
16574
16631
  try {
16575
16632
  await fd.read(buffer, 0, buffer.length, 0);
@@ -16577,8 +16634,8 @@ function createFilesystemTools(workspacePath) {
16577
16634
  await fd.close();
16578
16635
  }
16579
16636
  const content = buffer.toString("utf-8");
16580
- const truncated = stat9.size > MAX_FILE_SIZE;
16581
- return { content, truncated, size: stat9.size };
16637
+ const truncated = stat10.size > MAX_FILE_SIZE;
16638
+ return { content, truncated, size: stat10.size };
16582
16639
  } catch (error) {
16583
16640
  return { error: error instanceof Error ? error.message : String(error) };
16584
16641
  }
@@ -16629,8 +16686,8 @@ async function searchDirectory(dirPath, workspacePath, regex, matches) {
16629
16686
  const ext = path32.extname(entry.name).toLowerCase();
16630
16687
  if (BINARY_EXTENSIONS.has(ext)) continue;
16631
16688
  try {
16632
- const stat9 = await fs.stat(fullPath);
16633
- if (stat9.size > MAX_FILE_SIZE) continue;
16689
+ const stat10 = await fs.stat(fullPath);
16690
+ if (stat10.size > MAX_FILE_SIZE) continue;
16634
16691
  const content = await fs.readFile(fullPath, "utf-8");
16635
16692
  const lines = content.split("\n");
16636
16693
  for (let i = 0; i < lines.length; i++) {
@@ -21232,7 +21289,7 @@ async function captureSnapshot(dir) {
21232
21289
  async function walkDir(rootDir, currentDir, snapshot) {
21233
21290
  let entries;
21234
21291
  try {
21235
- entries = await readdir(currentDir);
21292
+ entries = await readdir2(currentDir);
21236
21293
  } catch {
21237
21294
  return;
21238
21295
  }
@@ -21241,7 +21298,7 @@ async function walkDir(rootDir, currentDir, snapshot) {
21241
21298
  const fullPath = path9.join(currentDir, entry);
21242
21299
  let fileStat;
21243
21300
  try {
21244
- fileStat = await stat(fullPath);
21301
+ fileStat = await stat2(fullPath);
21245
21302
  } catch {
21246
21303
  continue;
21247
21304
  }
@@ -22096,7 +22153,7 @@ async function discoverCopilotSessions(opts) {
22096
22153
  const limit = opts?.limit ?? 10;
22097
22154
  let entries;
22098
22155
  try {
22099
- entries = await readdir2(sessionStateDir);
22156
+ entries = await readdir22(sessionStateDir);
22100
22157
  } catch {
22101
22158
  return [];
22102
22159
  }
@@ -22111,7 +22168,7 @@ async function discoverCopilotSessions(opts) {
22111
22168
  const cwd = String(workspace.cwd ?? "");
22112
22169
  let updatedAt;
22113
22170
  try {
22114
- const eventsStat = await stat2(eventsPath);
22171
+ const eventsStat = await stat22(eventsPath);
22115
22172
  updatedAt = eventsStat.mtime;
22116
22173
  } catch {
22117
22174
  updatedAt = /* @__PURE__ */ new Date(0);
@@ -30194,7 +30251,7 @@ async function loadTestSuite(evalFilePath, repoRoot, options) {
30194
30251
  return { tests: await loadTestsFromAgentSkills(evalFilePath) };
30195
30252
  }
30196
30253
  if (format === "typescript") {
30197
- const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-32COE32J-TCT4RIRT.js");
30254
+ const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-HPIPE72C-GDYGJVIA.js");
30198
30255
  return loadTsEvalSuite2(evalFilePath, resolveToAbsolutePath(repoRoot), options);
30199
30256
  }
30200
30257
  const { tests, parsed, suiteWorkspacePath } = await loadTestsFromYaml(
@@ -30229,7 +30286,7 @@ async function loadTests(evalFilePath, repoRoot, options) {
30229
30286
  return loadTestsFromAgentSkills(evalFilePath);
30230
30287
  }
30231
30288
  if (format === "typescript") {
30232
- const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-32COE32J-TCT4RIRT.js");
30289
+ const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-HPIPE72C-GDYGJVIA.js");
30233
30290
  const suite = await loadTsEvalSuite2(evalFilePath, resolveToAbsolutePath(repoRoot), options);
30234
30291
  return suite.tests;
30235
30292
  }
@@ -30265,7 +30322,17 @@ async function loadTestsFromYaml(evalFilePath, repoRoot, options) {
30265
30322
  let expandedTestCases;
30266
30323
  if (typeof rawTestCases === "string") {
30267
30324
  const externalPath = path43.resolve(evalFileDir, rawTestCases);
30268
- expandedTestCases = await loadCasesFromFile(externalPath);
30325
+ let isDir = false;
30326
+ try {
30327
+ const pathStat = await stat8(externalPath);
30328
+ isDir = pathStat.isDirectory();
30329
+ } catch {
30330
+ }
30331
+ if (isDir) {
30332
+ expandedTestCases = await loadCasesFromDirectory(externalPath);
30333
+ } else {
30334
+ expandedTestCases = await loadCasesFromFile(externalPath);
30335
+ }
30269
30336
  } else if (Array.isArray(rawTestCases)) {
30270
30337
  expandedTestCases = await expandFileReferences(rawTestCases, evalFileDir);
30271
30338
  } else {
@@ -31082,7 +31149,7 @@ async function runEvaluation(options) {
31082
31149
  let staticMaterialised = false;
31083
31150
  const isYamlConfiguredPath = !cliWorkspacePath && !!yamlWorkspacePath;
31084
31151
  if (useStaticWorkspace && configuredStaticPath) {
31085
- const dirExists = await stat8(configuredStaticPath).then(
31152
+ const dirExists = await stat9(configuredStaticPath).then(
31086
31153
  (s) => s.isDirectory(),
31087
31154
  () => false
31088
31155
  );
@@ -31178,7 +31245,7 @@ async function runEvaluation(options) {
31178
31245
  if (suiteWorkspaceFile && sharedWorkspacePath) {
31179
31246
  const copiedWorkspaceFile = path44.join(sharedWorkspacePath, path44.basename(suiteWorkspaceFile));
31180
31247
  try {
31181
- await stat8(copiedWorkspaceFile);
31248
+ await stat9(copiedWorkspaceFile);
31182
31249
  suiteWorkspaceFile = copiedWorkspaceFile;
31183
31250
  } catch {
31184
31251
  }
@@ -31955,7 +32022,7 @@ async function runEvalCase(options) {
31955
32022
  if (caseWorkspaceFile && workspacePath) {
31956
32023
  const copiedFile = path44.join(workspacePath, path44.basename(caseWorkspaceFile));
31957
32024
  try {
31958
- await stat8(copiedFile);
32025
+ await stat9(copiedFile);
31959
32026
  caseWorkspaceFile = copiedFile;
31960
32027
  } catch {
31961
32028
  }
@@ -33872,6 +33939,7 @@ export {
33872
33939
  resolveTargetDefinition,
33873
33940
  interpolateEnv,
33874
33941
  loadCasesFromFile,
33942
+ loadCasesFromDirectory,
33875
33943
  generateText,
33876
33944
  DEFAULT_THRESHOLD,
33877
33945
  PASS_THRESHOLD,
@@ -34001,4 +34069,4 @@ export {
34001
34069
  loadTsEvalFile,
34002
34070
  loadTsEvalSuite
34003
34071
  };
34004
- //# sourceMappingURL=chunk-LP4Y5D2Z.js.map
34072
+ //# sourceMappingURL=chunk-ERSBQAGK.js.map