agentv 4.25.4-next.1 → 4.25.6-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.
@@ -176,7 +176,7 @@ async function findRepoRoot(start) {
176
176
  // package.json
177
177
  var package_default = {
178
178
  name: "agentv",
179
- version: "4.25.4-next.1",
179
+ version: "4.25.6-next.1",
180
180
  description: "CLI entry point for AgentV",
181
181
  type: "module",
182
182
  repository: {
@@ -284,7 +284,7 @@ async function discoverTargetsFile(options) {
284
284
  }
285
285
 
286
286
  // src/commands/eval/run-eval.ts
287
- import { constants as constants4, existsSync as existsSync3, mkdirSync } from "node:fs";
287
+ import { constants as constants4, existsSync as existsSync4, mkdirSync } from "node:fs";
288
288
  import { access as access5, readFile as readFile8 } from "node:fs/promises";
289
289
  import path15 from "node:path";
290
290
  import { pathToFileURL } from "node:url";
@@ -297,7 +297,10 @@ import { spawn } from "node:child_process";
297
297
  import { existsSync } from "node:fs";
298
298
  import { get } from "node:https";
299
299
  import { basename, dirname, join, win32 } from "node:path";
300
- var NPM_REGISTRY_URL = "https://registry.npmjs.org/agentv/latest";
300
+ var NPM_REGISTRY_BASE = "https://registry.npmjs.org/agentv/";
301
+ function getDistTagForVersion(version) {
302
+ return version.includes("-") ? "next" : "latest";
303
+ }
301
304
  function detectPackageManagerFromPath(scriptPath) {
302
305
  if (scriptPath.includes(".bun")) {
303
306
  return "bun";
@@ -341,9 +344,9 @@ function runCommand(cmd, args) {
341
344
  child.on("close", (code) => resolve({ exitCode: code ?? 1, stdout }));
342
345
  });
343
346
  }
344
- function fetchLatestVersion() {
347
+ function fetchLatestVersion(distTag = "latest") {
345
348
  return new Promise((resolve) => {
346
- const req = get(NPM_REGISTRY_URL, { timeout: 5e3 }, (res) => {
349
+ const req = get(`${NPM_REGISTRY_BASE}${distTag}`, { timeout: 5e3 }, (res) => {
347
350
  if (res.statusCode !== 200) {
348
351
  res.resume();
349
352
  resolve(null);
@@ -404,7 +407,7 @@ function resolvePackageManagerCommand(pm, args, options) {
404
407
  async function performSelfUpdate(options) {
405
408
  const pm = options?.pm ?? detectPackageManager();
406
409
  const currentVersion = options?.currentVersion ?? "unknown";
407
- const versionSpec = options?.versionRange ?? "latest";
410
+ const versionSpec = options?.versionRange ?? getDistTagForVersion(currentVersion === "unknown" ? "" : currentVersion);
408
411
  const scope = options?.scope ?? detectInstallScope();
409
412
  const args = getInstallArgs(pm, versionSpec, scope);
410
413
  const command = resolvePackageManagerCommand(pm, args);
@@ -2470,6 +2473,7 @@ async function loadNonErrorResults(jsonlPath) {
2470
2473
  }
2471
2474
 
2472
2475
  // src/commands/eval/run-cache.ts
2476
+ import { existsSync as existsSync3 } from "node:fs";
2473
2477
  import { mkdir as mkdir6, readFile, writeFile as writeFile5 } from "node:fs/promises";
2474
2478
  import path13 from "node:path";
2475
2479
  var CACHE_FILENAME = "cache.json";
@@ -2490,6 +2494,12 @@ async function loadRunCache(cwd) {
2490
2494
  return void 0;
2491
2495
  }
2492
2496
  }
2497
+ async function resolveCachedRunDir(cwd) {
2498
+ const cache = await loadRunCache(cwd);
2499
+ if (!cache?.lastRunDir) return void 0;
2500
+ if (!existsSync3(cache.lastRunDir)) return void 0;
2501
+ return cache.lastRunDir;
2502
+ }
2493
2503
  async function saveRunCache(cwd, resultPath) {
2494
2504
  if (path13.basename(resultPath) !== RESULT_INDEX_FILENAME) {
2495
2505
  return;
@@ -5362,13 +5372,22 @@ async function runEvalCommand(input) {
5362
5372
  console.log(`Skipping ${completedIds.length} already-completed test(s).`);
5363
5373
  }
5364
5374
  }
5375
+ if (options.resume && !options.retryErrors && !options.outputDir && !options.artifacts) {
5376
+ const cachedDir = await resolveCachedRunDir(cwd);
5377
+ if (cachedDir) {
5378
+ options = { ...options, outputDir: cachedDir };
5379
+ const flagLabel = options.rerunFailed ? "rerun-failed" : "resume";
5380
+ const displayDir = path15.relative(cwd, cachedDir) || cachedDir;
5381
+ console.log(`Auto-detected last run dir for --${flagLabel}: ${displayDir}`);
5382
+ }
5383
+ }
5365
5384
  let resumeSkipKeys;
5366
5385
  let isResumeAppend = false;
5367
5386
  if (options.resume && !options.retryErrors) {
5368
5387
  const explicitResumeDir = options.outputDir ?? options.artifacts;
5369
5388
  if (explicitResumeDir) {
5370
5389
  const resumeIndexPath = path15.join(path15.resolve(explicitResumeDir), "index.jsonl");
5371
- if (existsSync3(resumeIndexPath)) {
5390
+ if (existsSync4(resumeIndexPath)) {
5372
5391
  const content = await readFile8(resumeIndexPath, "utf8");
5373
5392
  const existingResults = parseJsonlResults(content);
5374
5393
  resumeSkipKeys = /* @__PURE__ */ new Set();
@@ -5387,7 +5406,7 @@ async function runEvalCommand(input) {
5387
5406
  }
5388
5407
  } else {
5389
5408
  console.warn(
5390
- "Warning: --resume requires --output <dir> to identify the run directory. Ignoring --resume."
5409
+ "Warning: --resume requires --output <dir> (or a cached last run) to identify the run directory. Ignoring --resume."
5391
5410
  );
5392
5411
  }
5393
5412
  }
@@ -6002,6 +6021,7 @@ export {
6002
6021
  loadManifestResults,
6003
6022
  loadLightweightResults,
6004
6023
  HtmlWriter,
6024
+ getDistTagForVersion,
6005
6025
  detectPackageManager,
6006
6026
  detectInstallScope,
6007
6027
  fetchLatestVersion,
@@ -6042,4 +6062,4 @@ export {
6042
6062
  getCategories,
6043
6063
  filterByCategory
6044
6064
  };
6045
- //# sourceMappingURL=chunk-WNT323IP.js.map
6065
+ //# sourceMappingURL=chunk-5RGZVQIE.js.map