agentv 3.2.0 → 3.2.2

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.
@@ -12,7 +12,7 @@ import {
12
12
  validateEvalFile,
13
13
  validateFileReferences,
14
14
  validateTargetsFile
15
- } from "./chunk-PCQA43SA.js";
15
+ } from "./chunk-IUNL3OJU.js";
16
16
  import {
17
17
  createBuiltinRegistry,
18
18
  createProvider,
@@ -30,7 +30,7 @@ import {
30
30
  toSnakeCaseDeep as toSnakeCaseDeep2,
31
31
  transpileEvalYamlFile,
32
32
  trimBaselineResult
33
- } from "./chunk-OR4WXZAF.js";
33
+ } from "./chunk-QHH6QXNY.js";
34
34
  import {
35
35
  __commonJS,
36
36
  __esm,
@@ -4177,7 +4177,7 @@ var evalRunCommand = command({
4177
4177
  },
4178
4178
  handler: async (args) => {
4179
4179
  if (args.evalPaths.length === 0 && process.stdin.isTTY) {
4180
- const { launchInteractiveWizard } = await import("./interactive-DLHPNSZ7.js");
4180
+ const { launchInteractiveWizard } = await import("./interactive-LMQO2QAX.js");
4181
4181
  await launchInteractiveWizard();
4182
4182
  return;
4183
4183
  }
@@ -6146,4 +6146,4 @@ export {
6146
6146
  preprocessArgv,
6147
6147
  runCli
6148
6148
  };
6149
- //# sourceMappingURL=chunk-FTPA72PY.js.map
6149
+ //# sourceMappingURL=chunk-LNRX7YV5.js.map
@@ -7332,11 +7332,12 @@ import { cp as cp2, mkdir as mkdir12, readFile as readFile12, readdir as readdir
7332
7332
  import path40 from "node:path";
7333
7333
  import { promisify as promisify5 } from "node:util";
7334
7334
  import { execFile as execFile2 } from "node:child_process";
7335
+ import { existsSync as existsSync3 } from "node:fs";
7335
7336
  import path41 from "node:path";
7336
7337
  import { promisify as promisify6 } from "node:util";
7337
7338
  import { readdir as readdir5, stat as stat6 } from "node:fs/promises";
7338
7339
  import path42 from "node:path";
7339
- import { existsSync as existsSync3 } from "node:fs";
7340
+ import { existsSync as existsSync4 } from "node:fs";
7340
7341
  import path44 from "node:path";
7341
7342
  import { mkdir as mkdir14, readFile as readFile13, writeFile as writeFile8 } from "node:fs/promises";
7342
7343
  import path45 from "node:path";
@@ -21261,6 +21262,44 @@ var RepoManager = class {
21261
21262
  constructor(verbose = false) {
21262
21263
  this.verbose = verbose;
21263
21264
  }
21265
+ /**
21266
+ * Validate that all local repo source paths exist before attempting materialization.
21267
+ * Returns an array of validation errors (empty if all paths are valid).
21268
+ */
21269
+ static validateLocalPaths(repos) {
21270
+ const errors = [];
21271
+ for (const repo of repos) {
21272
+ if (repo.source.type !== "local") continue;
21273
+ const sourcePath = repo.source.path;
21274
+ if (!sourcePath || sourcePath.trim() === "") {
21275
+ errors.push({
21276
+ repoPath: repo.path,
21277
+ resolvedSourcePath: sourcePath ?? "",
21278
+ reason: "empty_path"
21279
+ });
21280
+ } else if (!existsSync3(sourcePath)) {
21281
+ errors.push({
21282
+ repoPath: repo.path,
21283
+ resolvedSourcePath: sourcePath,
21284
+ reason: "not_found"
21285
+ });
21286
+ }
21287
+ }
21288
+ return errors;
21289
+ }
21290
+ /**
21291
+ * Format validation errors into a human-readable warning message.
21292
+ */
21293
+ static formatValidationErrors(errors) {
21294
+ const lines = errors.map((e) => {
21295
+ if (e.reason === "empty_path") {
21296
+ return ` - repo "${e.repoPath}": local source path is empty (check that the env var is set)`;
21297
+ }
21298
+ return ` - repo "${e.repoPath}": local source path not found: ${e.resolvedSourcePath}`;
21299
+ });
21300
+ return `Local repo path validation failed:
21301
+ ${lines.join("\n")}`;
21302
+ }
21264
21303
  async runGit(args, opts) {
21265
21304
  const startedAt = Date.now();
21266
21305
  if (this.verbose) {
@@ -21673,6 +21712,28 @@ async function runEvaluation(options) {
21673
21712
  console.log(`[setup] ${message}`);
21674
21713
  }
21675
21714
  };
21715
+ const allRepos = /* @__PURE__ */ new Map();
21716
+ for (const ec of filteredEvalCases) {
21717
+ if (ec.workspace?.repos) {
21718
+ for (const repo of ec.workspace.repos) {
21719
+ const key = `${repo.path}::${repo.source.type === "local" ? repo.source.path : ""}`;
21720
+ if (!allRepos.has(key)) {
21721
+ allRepos.set(key, repo);
21722
+ }
21723
+ }
21724
+ }
21725
+ }
21726
+ if (allRepos.size > 0) {
21727
+ const localPathErrors = RepoManager.validateLocalPaths([...allRepos.values()]);
21728
+ if (localPathErrors.length > 0) {
21729
+ const message = RepoManager.formatValidationErrors(localPathErrors);
21730
+ console.warn(`Warning: ${message}`);
21731
+ const invalidLocalRepoPaths = new Set(localPathErrors.map((e) => e.repoPath));
21732
+ if (suiteWorkspace?.repos?.some((r) => invalidLocalRepoPaths.has(r.path))) {
21733
+ throw new Error(message);
21734
+ }
21735
+ }
21736
+ }
21676
21737
  const isPerTestIsolation = suiteWorkspace?.isolation === "per_test";
21677
21738
  const cliWorkspacePath = workspacePath ?? legacyWorkspacePath;
21678
21739
  const yamlWorkspacePath = suiteWorkspace?.path;
@@ -22357,6 +22418,23 @@ async function runEvalCase(options) {
22357
22418
  workspacePath = getWorkspacePath(evalRunId, evalCase.id);
22358
22419
  await mkdir13(workspacePath, { recursive: true });
22359
22420
  }
22421
+ if (evalCase.workspace?.repos?.length && workspacePath) {
22422
+ const localPathErrors = RepoManager.validateLocalPaths(evalCase.workspace.repos);
22423
+ if (localPathErrors.length > 0) {
22424
+ const message = RepoManager.formatValidationErrors(localPathErrors);
22425
+ console.warn(`Warning: test=${evalCase.id} ${message}`);
22426
+ return buildErrorResult(
22427
+ evalCase,
22428
+ target.name,
22429
+ nowFn(),
22430
+ new Error(message),
22431
+ promptInputs,
22432
+ provider,
22433
+ "repo_setup",
22434
+ "local_path_not_found"
22435
+ );
22436
+ }
22437
+ }
22360
22438
  if (evalCase.workspace?.repos?.length && workspacePath) {
22361
22439
  const perCaseRepoManager = new RepoManager(setupDebug);
22362
22440
  try {
@@ -23473,7 +23551,7 @@ async function discoverDefaultTarget(repoRoot) {
23473
23551
  for (const dir of chain) {
23474
23552
  for (const candidate of TARGET_FILE_CANDIDATES) {
23475
23553
  const targetsPath = path44.join(dir, candidate);
23476
- if (!existsSync3(targetsPath)) continue;
23554
+ if (!existsSync4(targetsPath)) continue;
23477
23555
  try {
23478
23556
  const definitions = await readTargetDefinitions(targetsPath);
23479
23557
  const defaultTarget = definitions.find((d) => d.name === "default");
@@ -23490,7 +23568,7 @@ async function loadEnvHierarchy(repoRoot, startPath) {
23490
23568
  const envFiles = [];
23491
23569
  for (const dir of chain) {
23492
23570
  const envPath = path44.join(dir, ".env");
23493
- if (existsSync3(envPath)) envFiles.push(envPath);
23571
+ if (existsSync4(envPath)) envFiles.push(envPath);
23494
23572
  }
23495
23573
  for (let i = 0; i < envFiles.length; i++) {
23496
23574
  try {
@@ -23565,12 +23643,12 @@ var CONFIG_FILE_NAMES = [
23565
23643
  ".agentv/config.js"
23566
23644
  ];
23567
23645
  async function loadTsConfig(projectRoot) {
23568
- const { existsSync: existsSync4 } = await import("node:fs");
23646
+ const { existsSync: existsSync5 } = await import("node:fs");
23569
23647
  const { pathToFileURL } = await import("node:url");
23570
23648
  const { join: join2 } = await import("node:path");
23571
23649
  for (const fileName of CONFIG_FILE_NAMES) {
23572
23650
  const filePath = join2(projectRoot, fileName);
23573
- if (!existsSync4(filePath)) {
23651
+ if (!existsSync5(filePath)) {
23574
23652
  continue;
23575
23653
  }
23576
23654
  try {
@@ -24299,4 +24377,4 @@ export {
24299
24377
  OtelStreamingObserver,
24300
24378
  createAgentKernel
24301
24379
  };
24302
- //# sourceMappingURL=chunk-OR4WXZAF.js.map
24380
+ //# sourceMappingURL=chunk-QHH6QXNY.js.map