agentv 4.3.3 → 4.3.4

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.
@@ -24,7 +24,7 @@ import {
24
24
  validateFileReferences,
25
25
  validateTargetsFile,
26
26
  writeArtifactsFromResults
27
- } from "./chunk-EW4COQU2.js";
27
+ } from "./chunk-WICUFOIA.js";
28
28
  import {
29
29
  DEFAULT_CATEGORY,
30
30
  PASS_THRESHOLD,
@@ -4218,7 +4218,7 @@ var evalRunCommand = command({
4218
4218
  },
4219
4219
  handler: async (args) => {
4220
4220
  if (args.evalPaths.length === 0 && process.stdin.isTTY) {
4221
- const { launchInteractiveWizard } = await import("./interactive-6BO4RY6U.js");
4221
+ const { launchInteractiveWizard } = await import("./interactive-GVBU4GSC.js");
4222
4222
  await launchInteractiveWizard();
4223
4223
  return;
4224
4224
  }
@@ -6255,7 +6255,16 @@ function loadStudioConfig(agentvDir) {
6255
6255
  if (!parsed || typeof parsed !== "object") {
6256
6256
  return { ...DEFAULTS };
6257
6257
  }
6258
- const threshold = typeof parsed.pass_threshold === "number" ? parsed.pass_threshold : DEFAULTS.pass_threshold;
6258
+ const studio = parsed.studio;
6259
+ let threshold = DEFAULTS.pass_threshold;
6260
+ if (studio && typeof studio === "object" && !Array.isArray(studio)) {
6261
+ const studioThreshold = studio.pass_threshold;
6262
+ if (typeof studioThreshold === "number") {
6263
+ threshold = studioThreshold;
6264
+ }
6265
+ } else if (typeof parsed.pass_threshold === "number") {
6266
+ threshold = parsed.pass_threshold;
6267
+ }
6259
6268
  return {
6260
6269
  pass_threshold: Math.min(1, Math.max(0, threshold))
6261
6270
  };
@@ -6265,7 +6274,18 @@ function saveStudioConfig(agentvDir, config) {
6265
6274
  mkdirSync2(agentvDir, { recursive: true });
6266
6275
  }
6267
6276
  const configPath = path9.join(agentvDir, "config.yaml");
6268
- const yamlStr = stringifyYaml2(config);
6277
+ let existing = {};
6278
+ if (existsSync7(configPath)) {
6279
+ const raw = readFileSync8(configPath, "utf-8");
6280
+ const parsed = parseYaml(raw);
6281
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
6282
+ existing = parsed;
6283
+ }
6284
+ }
6285
+ const { pass_threshold: _, ...rest } = existing;
6286
+ existing = rest;
6287
+ existing.studio = { ...config };
6288
+ const yamlStr = stringifyYaml2(existing);
6269
6289
  writeFileSync3(configPath, yamlStr, "utf-8");
6270
6290
  }
6271
6291
 
@@ -8042,7 +8062,7 @@ function isYamlFile(filePath) {
8042
8062
  }
8043
8063
 
8044
8064
  // src/commands/validate/index.ts
8045
- async function runValidateCommand(paths) {
8065
+ async function runValidateCommand(paths, maxWarnings) {
8046
8066
  if (paths.length === 0) {
8047
8067
  console.error("Error: No paths specified. Usage: agentv validate <paths...>");
8048
8068
  process.exit(1);
@@ -8053,6 +8073,18 @@ async function runValidateCommand(paths) {
8053
8073
  if (summary.invalidFiles > 0) {
8054
8074
  process.exit(1);
8055
8075
  }
8076
+ if (maxWarnings !== void 0) {
8077
+ const warningCount = summary.results.reduce(
8078
+ (count, r) => count + r.errors.filter((e) => e.severity === "warning").length,
8079
+ 0
8080
+ );
8081
+ if (warningCount > maxWarnings) {
8082
+ console.error(
8083
+ `Found ${warningCount} warning${warningCount === 1 ? "" : "s"} (max allowed: ${maxWarnings})`
8084
+ );
8085
+ process.exit(1);
8086
+ }
8087
+ }
8056
8088
  }
8057
8089
  var validateCommand = command({
8058
8090
  name: "validate",
@@ -8062,11 +8094,16 @@ var validateCommand = command({
8062
8094
  type: string,
8063
8095
  displayName: "paths",
8064
8096
  description: "Files or directories to validate"
8097
+ }),
8098
+ maxWarnings: option({
8099
+ type: optional(number),
8100
+ long: "max-warnings",
8101
+ description: "Maximum number of warnings allowed before failing (e.g., --max-warnings 0)"
8065
8102
  })
8066
8103
  },
8067
- handler: async ({ paths }) => {
8104
+ handler: async ({ paths, maxWarnings }) => {
8068
8105
  try {
8069
- await runValidateCommand(paths);
8106
+ await runValidateCommand(paths, maxWarnings);
8070
8107
  } catch (error) {
8071
8108
  console.error(`Error: ${error.message}`);
8072
8109
  process.exit(1);
@@ -8414,4 +8451,4 @@ export {
8414
8451
  preprocessArgv,
8415
8452
  runCli
8416
8453
  };
8417
- //# sourceMappingURL=chunk-5DDVNHOS.js.map
8454
+ //# sourceMappingURL=chunk-TCJKPOU7.js.map