agentv 4.29.2-next.1 → 4.30.0

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 (25) hide show
  1. package/dist/{artifact-writer-RQXU4LZV.js → artifact-writer-JJLJUUUY.js} +4 -4
  2. package/dist/{chunk-62SD2XKL.js → chunk-B2YJVU72.js} +9 -8
  3. package/dist/chunk-B2YJVU72.js.map +1 -0
  4. package/dist/{chunk-7SGY7PPE.js → chunk-J4AMO3MD.js} +15 -29
  5. package/dist/chunk-J4AMO3MD.js.map +1 -0
  6. package/dist/{chunk-VTOY4SMC.js → chunk-L3FMZXCD.js} +130 -37
  7. package/dist/chunk-L3FMZXCD.js.map +1 -0
  8. package/dist/{chunk-VZMGBDJD.js → chunk-LUZRCQNH.js} +2 -2
  9. package/dist/{chunk-OS67VZUO.js → chunk-YFVD6FC6.js} +3 -3
  10. package/dist/cli.js +5 -5
  11. package/dist/{dist-HLU6WIYL.js → dist-GYCHDLTZ.js} +3 -3
  12. package/dist/index.js +5 -5
  13. package/dist/{interactive-SOVRCWPF.js → interactive-DIQOOZX4.js} +5 -5
  14. package/dist/skills/agentv-eval-writer/references/eval-schema.json +12 -0
  15. package/dist/{ts-eval-loader-EMSGL2BQ-P5RV35TE.js → ts-eval-loader-JL5DGTJL-U5LTKGOE.js} +2 -2
  16. package/package.json +1 -1
  17. package/dist/chunk-62SD2XKL.js.map +0 -1
  18. package/dist/chunk-7SGY7PPE.js.map +0 -1
  19. package/dist/chunk-VTOY4SMC.js.map +0 -1
  20. /package/dist/{artifact-writer-RQXU4LZV.js.map → artifact-writer-JJLJUUUY.js.map} +0 -0
  21. /package/dist/{chunk-VZMGBDJD.js.map → chunk-LUZRCQNH.js.map} +0 -0
  22. /package/dist/{chunk-OS67VZUO.js.map → chunk-YFVD6FC6.js.map} +0 -0
  23. /package/dist/{dist-HLU6WIYL.js.map → dist-GYCHDLTZ.js.map} +0 -0
  24. /package/dist/{interactive-SOVRCWPF.js.map → interactive-DIQOOZX4.js.map} +0 -0
  25. /package/dist/{ts-eval-loader-EMSGL2BQ-P5RV35TE.js.map → ts-eval-loader-JL5DGTJL-U5LTKGOE.js.map} +0 -0
@@ -45,7 +45,7 @@ import {
45
45
  validateFileReferences,
46
46
  validateTargetsFile,
47
47
  validateWorkspacePaths
48
- } from "./chunk-62SD2XKL.js";
48
+ } from "./chunk-B2YJVU72.js";
49
49
  import {
50
50
  RESULT_INDEX_FILENAME,
51
51
  aggregateRunDir,
@@ -53,7 +53,7 @@ import {
53
53
  resolveRunManifestPath,
54
54
  toSnakeCaseDeep as toSnakeCaseDeep2,
55
55
  writeArtifactsFromResults
56
- } from "./chunk-OS67VZUO.js";
56
+ } from "./chunk-YFVD6FC6.js";
57
57
  import {
58
58
  DEFAULT_CATEGORY,
59
59
  addProject,
@@ -73,7 +73,7 @@ import {
73
73
  toTranscriptJsonLines,
74
74
  transpileEvalYamlFile,
75
75
  trimBaselineResult
76
- } from "./chunk-VZMGBDJD.js";
76
+ } from "./chunk-LUZRCQNH.js";
77
77
  import {
78
78
  DEFAULT_THRESHOLD,
79
79
  createBuiltinRegistry,
@@ -103,7 +103,7 @@ import {
103
103
  runStartsWithAssertion,
104
104
  toCamelCaseDeep,
105
105
  toSnakeCaseDeep
106
- } from "./chunk-VTOY4SMC.js";
106
+ } from "./chunk-L3FMZXCD.js";
107
107
  import {
108
108
  __commonJS,
109
109
  __require,
@@ -4053,7 +4053,7 @@ var evalRunCommand = command({
4053
4053
  },
4054
4054
  handler: async (args) => {
4055
4055
  if (args.evalPaths.length === 0 && process.stdin.isTTY) {
4056
- const { launchInteractiveWizard } = await import("./interactive-SOVRCWPF.js");
4056
+ const { launchInteractiveWizard } = await import("./interactive-DIQOOZX4.js");
4057
4057
  await launchInteractiveWizard();
4058
4058
  return;
4059
4059
  }
@@ -5210,7 +5210,8 @@ async function buildAgentvTests(options) {
5210
5210
  );
5211
5211
  }
5212
5212
  for (const prompt of promptSelection) {
5213
- const renderedInput = renderPrompt(prompt, effectiveVars, testOptions);
5213
+ const importedVars = testOptions.disableVarExpansion ? void 0 : effectiveVars;
5214
+ const templatedInput = buildPromptTemplate(prompt, testOptions);
5214
5215
  const promptSuffix = promptSelection.length > 1 ? `--${sanitizeName(prompt.key || prompt.label)}` : "";
5215
5216
  const metadata = buildPromptfooMetadata(rawTest, effectiveVars, prompt, effectiveTargets);
5216
5217
  const execution = buildCaseExecution({
@@ -5221,7 +5222,8 @@ async function buildAgentvTests(options) {
5221
5222
  const test = {
5222
5223
  id: `${explicitId ?? baseId}${promptSuffix}`,
5223
5224
  ...typeof rawTest.description === "string" ? { criteria: rawTest.description } : {},
5224
- input: renderedInput,
5225
+ input: templatedInput,
5226
+ ...importedVars && Object.keys(importedVars).length > 0 ? { vars: importedVars } : {},
5225
5227
  ...convertedCaseAssertions.length > 0 ? { assertions: convertedCaseAssertions } : {},
5226
5228
  ...metadata ? { metadata } : {},
5227
5229
  ...execution ? { execution } : {}
@@ -5320,40 +5322,24 @@ function filterProviders(providers, rawFilter) {
5320
5322
  }
5321
5323
  return matched.map((provider) => provider.targetName);
5322
5324
  }
5323
- function renderPrompt(prompt, vars, testOptions) {
5325
+ function buildPromptTemplate(prompt, testOptions) {
5324
5326
  const prefix = testOptions.prefix ?? "";
5325
5327
  const suffix = testOptions.suffix ?? "";
5326
5328
  if (typeof prompt.content === "string") {
5327
- return `${prefix}${renderTemplate(prompt.content, vars)}${suffix}`;
5329
+ return `${prefix}${preserveTemplate(prompt.content)}${suffix}`;
5328
5330
  }
5329
5331
  return prompt.content.map((message, index, allMessages) => ({
5330
5332
  role: message.role,
5331
- content: `${index === 0 ? prefix : ""}${renderTemplate(message.content, vars)}${index === allMessages.length - 1 ? suffix : ""}`
5333
+ content: `${index === 0 ? prefix : ""}${preserveTemplate(message.content)}${index === allMessages.length - 1 ? suffix : ""}`
5332
5334
  }));
5333
5335
  }
5334
- function renderTemplate(template, vars) {
5336
+ function preserveTemplate(template) {
5335
5337
  if (template.includes("{%") || template.includes("{#") || /\{\{[^}]*\|/.test(template)) {
5336
5338
  throw new Error(
5337
5339
  `Unsupported Nunjucks syntax in prompt '${template.slice(0, 80)}'. Use simple {{var}} templates or migrate manually`
5338
5340
  );
5339
5341
  }
5340
- return template.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (_match, expression) => {
5341
- const value = lookupPath(vars, expression.trim());
5342
- if (value === void 0) {
5343
- return "";
5344
- }
5345
- if (typeof value === "string") return value;
5346
- return JSON.stringify(value);
5347
- });
5348
- }
5349
- function lookupPath(value, expression) {
5350
- if (!expression) return void 0;
5351
- return expression.split(".").reduce((current, part) => {
5352
- if (!current || typeof current !== "object" || Array.isArray(current)) {
5353
- return void 0;
5354
- }
5355
- return current[part];
5356
- }, value);
5342
+ return template;
5357
5343
  }
5358
5344
  function buildPromptfooMetadata(rawTest, vars, prompt, effectiveTargets) {
5359
5345
  const rawMetadata = isJsonObject(rawTest.metadata) ? rawTest.metadata : void 0;
@@ -13597,4 +13583,4 @@ export {
13597
13583
  preprocessArgv,
13598
13584
  runCli
13599
13585
  };
13600
- //# sourceMappingURL=chunk-7SGY7PPE.js.map
13586
+ //# sourceMappingURL=chunk-J4AMO3MD.js.map