@agentv/core 2.11.0 → 2.11.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.
package/dist/index.cjs CHANGED
@@ -2032,9 +2032,14 @@ async function loadConfig(evalFilePath, repoRoot) {
2032
2032
  logWarning(`Invalid eval_patterns in ${configPath}, all entries must be strings`);
2033
2033
  continue;
2034
2034
  }
2035
+ const executionDefaults = parseExecutionDefaults(
2036
+ parsed.execution,
2037
+ configPath
2038
+ );
2035
2039
  return {
2036
2040
  guideline_patterns: guidelinePatterns,
2037
- eval_patterns: evalPatterns
2041
+ eval_patterns: evalPatterns,
2042
+ execution: executionDefaults
2038
2043
  };
2039
2044
  } catch (error) {
2040
2045
  logWarning(
@@ -2175,6 +2180,36 @@ function extractTotalBudgetUsd(suite) {
2175
2180
  );
2176
2181
  return void 0;
2177
2182
  }
2183
+ function parseExecutionDefaults(raw, configPath) {
2184
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
2185
+ return void 0;
2186
+ }
2187
+ const obj = raw;
2188
+ const result = {};
2189
+ if (typeof obj.verbose === "boolean") {
2190
+ result.verbose = obj.verbose;
2191
+ } else if (obj.verbose !== void 0) {
2192
+ logWarning(`Invalid execution.verbose in ${configPath}, expected boolean`);
2193
+ }
2194
+ const traceFile = obj.trace_file;
2195
+ if (typeof traceFile === "string" && traceFile.trim().length > 0) {
2196
+ result.trace_file = traceFile.trim();
2197
+ } else if (traceFile !== void 0) {
2198
+ logWarning(`Invalid execution.trace_file in ${configPath}, expected non-empty string`);
2199
+ }
2200
+ if (typeof obj.keep_workspaces === "boolean") {
2201
+ result.keep_workspaces = obj.keep_workspaces;
2202
+ } else if (obj.keep_workspaces !== void 0) {
2203
+ logWarning(`Invalid execution.keep_workspaces in ${configPath}, expected boolean`);
2204
+ }
2205
+ const otelFile = obj.otel_file;
2206
+ if (typeof otelFile === "string" && otelFile.trim().length > 0) {
2207
+ result.otel_file = otelFile.trim();
2208
+ } else if (otelFile !== void 0) {
2209
+ logWarning(`Invalid execution.otel_file in ${configPath}, expected non-empty string`);
2210
+ }
2211
+ return Object.keys(result).length > 0 ? result : void 0;
2212
+ }
2178
2213
  function logWarning(message) {
2179
2214
  console.warn(`${ANSI_YELLOW2}Warning: ${message}${ANSI_RESET2}`);
2180
2215
  }
@@ -7027,6 +7062,16 @@ var CopilotCliProvider = class {
7027
7062
  }
7028
7063
  const endTime = (/* @__PURE__ */ new Date()).toISOString();
7029
7064
  const durationMs = Date.now() - startMs;
7065
+ const rejectedCalls = completedToolCalls.filter((tc) => {
7066
+ const out = tc.output;
7067
+ return out && (out.code === "rejected" || out.code === "denied");
7068
+ });
7069
+ if (rejectedCalls.length > 0) {
7070
+ const tools = rejectedCalls.map((tc) => tc.tool).join(", ");
7071
+ throw new Error(
7072
+ `Copilot rejected ${rejectedCalls.length} tool call(s): ${tools}. Add args: ["--yolo"] to your target config or re-run with --yolo to bypass permission checks.`
7073
+ );
7074
+ }
7030
7075
  const outputMessages = [];
7031
7076
  if (completedToolCalls.length > 0) {
7032
7077
  outputMessages.push({
@@ -7059,7 +7104,7 @@ var CopilotCliProvider = class {
7059
7104
  }
7060
7105
  }
7061
7106
  buildCliArgs() {
7062
- const args = ["--acp", "--stdio", "--allow-all-tools"];
7107
+ const args = ["--acp", "--stdio", "--allow-all-tools", "--yolo"];
7063
7108
  if (this.config.model) {
7064
7109
  args.push("--model", this.config.model);
7065
7110
  }
@@ -15467,7 +15512,7 @@ var RepoManager = class {
15467
15512
  * Creates on first access, fetches updates on subsequent calls.
15468
15513
  * Returns the absolute path to the cache directory.
15469
15514
  */
15470
- async ensureCache(source) {
15515
+ async ensureCache(source, depth) {
15471
15516
  const key = cacheKey(source);
15472
15517
  const cachePath = import_node_path38.default.join(this.cacheDir, key);
15473
15518
  const lockPath = `${cachePath}.lock`;
@@ -15475,9 +15520,20 @@ var RepoManager = class {
15475
15520
  await acquireLock(lockPath);
15476
15521
  try {
15477
15522
  if ((0, import_node_fs11.existsSync)(import_node_path38.default.join(cachePath, "HEAD"))) {
15478
- await git(["fetch", "--prune"], { cwd: cachePath });
15523
+ const fetchArgs = ["fetch", "--prune"];
15524
+ if (depth) {
15525
+ fetchArgs.push("--depth", String(depth));
15526
+ }
15527
+ await git(fetchArgs, { cwd: cachePath });
15479
15528
  } else {
15480
- await git(["clone", "--mirror", "--bare", getSourceUrl(source), cachePath]);
15529
+ const cloneArgs = ["clone", "--mirror", "--bare"];
15530
+ if (depth) {
15531
+ cloneArgs.push("--depth", String(depth));
15532
+ }
15533
+ const sourceUrl = getSourceUrl(source);
15534
+ const cloneUrl = depth && source.type === "local" ? `file://${sourceUrl}` : sourceUrl;
15535
+ cloneArgs.push(cloneUrl, cachePath);
15536
+ await git(cloneArgs);
15481
15537
  }
15482
15538
  } finally {
15483
15539
  await releaseLock(lockPath);
@@ -15490,7 +15546,7 @@ var RepoManager = class {
15490
15546
  */
15491
15547
  async materialize(repo, workspacePath) {
15492
15548
  const targetDir = import_node_path38.default.join(workspacePath, repo.path);
15493
- const cachePath = await this.ensureCache(repo.source);
15549
+ const cachePath = await this.ensureCache(repo.source, repo.clone?.depth);
15494
15550
  const cloneArgs = ["clone"];
15495
15551
  if (repo.clone?.depth) {
15496
15552
  cloneArgs.push("--depth", String(repo.clone.depth));
@@ -15566,6 +15622,33 @@ var RepoManager = class {
15566
15622
  await git(["clean", "-fd"], { cwd: targetDir });
15567
15623
  }
15568
15624
  }
15625
+ /**
15626
+ * Seed the cache from a local repository, setting the remote to a given URL.
15627
+ * Useful for avoiding slow network clones when a local clone already exists.
15628
+ */
15629
+ async seedCache(localPath, remoteUrl, opts) {
15630
+ const source = { type: "git", url: remoteUrl };
15631
+ const key = cacheKey(source);
15632
+ const cachePath = import_node_path38.default.join(this.cacheDir, key);
15633
+ const lockPath = `${cachePath}.lock`;
15634
+ await (0, import_promises27.mkdir)(this.cacheDir, { recursive: true });
15635
+ await acquireLock(lockPath);
15636
+ try {
15637
+ if ((0, import_node_fs11.existsSync)(import_node_path38.default.join(cachePath, "HEAD"))) {
15638
+ if (!opts?.force) {
15639
+ throw new Error(
15640
+ `Cache already exists for ${remoteUrl} at ${cachePath}. Use force to overwrite.`
15641
+ );
15642
+ }
15643
+ await (0, import_promises27.rm)(cachePath, { recursive: true, force: true });
15644
+ }
15645
+ await git(["clone", "--mirror", "--bare", localPath, cachePath]);
15646
+ await git(["remote", "set-url", "origin", remoteUrl], { cwd: cachePath });
15647
+ } finally {
15648
+ await releaseLock(lockPath);
15649
+ }
15650
+ return cachePath;
15651
+ }
15569
15652
  /** Remove the entire cache directory. */
15570
15653
  async cleanCache() {
15571
15654
  await (0, import_promises27.rm)(this.cacheDir, { recursive: true, force: true });