agentv 5.2.0-next.1 → 5.3.1-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.
Files changed (46) hide show
  1. package/README.md +22 -20
  2. package/dist/{artifact-writer-SN6UNL5G.js → artifact-writer-7NBCOAYC.js} +4 -4
  3. package/dist/{chunk-3X357HS4.js → chunk-ASIGJIOJ.js} +107 -31
  4. package/dist/chunk-ASIGJIOJ.js.map +1 -0
  5. package/dist/{chunk-3S6A2RKR.js → chunk-ELCJ23K4.js} +18879 -17538
  6. package/dist/chunk-ELCJ23K4.js.map +1 -0
  7. package/dist/{chunk-T4AD3H3Y.js → chunk-LKGARI3W.js} +399 -32
  8. package/dist/chunk-LKGARI3W.js.map +1 -0
  9. package/dist/{chunk-ALVZQUZP.js → chunk-LXBI3SPX.js} +142 -14
  10. package/dist/chunk-LXBI3SPX.js.map +1 -0
  11. package/dist/{chunk-46K2OET3.js → chunk-RKE7SSET.js} +2 -2
  12. package/dist/cli.js +5 -5
  13. package/dist/dashboard/assets/{index-DNgf3qJ2.js → index-CbEMiJSb.js} +1 -1
  14. package/dist/dashboard/assets/{index-r_jSJmlw.js → index-DTA6-l7q.js} +3 -3
  15. package/dist/dashboard/index.html +1 -1
  16. package/dist/{dist-DEPJOMCA.js → dist-NMXMI5SK.js} +25 -5
  17. package/dist/index.js +5 -5
  18. package/dist/{interactive-36ZNMQB2.js → interactive-BN527UV3.js} +5 -5
  19. package/dist/skills/agentv-bench/SKILL.md +15 -14
  20. package/dist/skills/agentv-bench/agents/analyzer.md +2 -2
  21. package/dist/skills/agentv-bench/agents/comparator.md +3 -3
  22. package/dist/skills/agentv-bench/agents/executor.md +1 -1
  23. package/dist/skills/agentv-bench/agents/grader.md +4 -2
  24. package/dist/skills/agentv-bench/references/autoresearch.md +9 -9
  25. package/dist/skills/agentv-bench/references/description-optimization.md +5 -6
  26. package/dist/skills/agentv-bench/references/environment-adaptation.md +6 -6
  27. package/dist/skills/agentv-bench/references/eval-yaml-spec.md +50 -56
  28. package/dist/skills/agentv-bench/references/schemas.md +44 -60
  29. package/dist/skills/agentv-bench/references/subagent-pipeline.md +20 -18
  30. package/dist/skills/agentv-eval-migrations/SKILL.md +13 -0
  31. package/dist/skills/agentv-eval-migrations/references/breaking-changes.md +138 -22
  32. package/dist/skills/agentv-eval-writer/SKILL.md +103 -63
  33. package/dist/skills/agentv-eval-writer/references/custom-evaluators.md +10 -5
  34. package/dist/skills/agentv-eval-writer/references/eval.schema.json +749 -2158
  35. package/dist/skills/agentv-eval-writer/references/rubric-evaluator.md +1 -1
  36. package/dist/{ts-eval-loader-OMG2JBHP-OP5RR7A3.js → ts-eval-loader-2RFVZHCT-7CZ3DCDD.js} +8 -4
  37. package/package.json +1 -1
  38. package/dist/chunk-3S6A2RKR.js.map +0 -1
  39. package/dist/chunk-3X357HS4.js.map +0 -1
  40. package/dist/chunk-ALVZQUZP.js.map +0 -1
  41. package/dist/chunk-T4AD3H3Y.js.map +0 -1
  42. /package/dist/{artifact-writer-SN6UNL5G.js.map → artifact-writer-7NBCOAYC.js.map} +0 -0
  43. /package/dist/{chunk-46K2OET3.js.map → chunk-RKE7SSET.js.map} +0 -0
  44. /package/dist/{dist-DEPJOMCA.js.map → dist-NMXMI5SK.js.map} +0 -0
  45. /package/dist/{interactive-36ZNMQB2.js.map → interactive-BN527UV3.js.map} +0 -0
  46. /package/dist/{ts-eval-loader-OMG2JBHP-OP5RR7A3.js.map → ts-eval-loader-2RFVZHCT-7CZ3DCDD.js.map} +0 -0
@@ -40,7 +40,7 @@ Use `@agentv/sdk` for TypeScript helper imports. Do not use `@agentv/eval` for n
40
40
 
41
41
  - Put grading criteria in `assert`, not in test-level `criteria`. Plain assertion strings become an `llm-rubric` grader.
42
42
  - Prefer plain assertion strings for semantic checks when the default rubric grader can judge them. Use `type: llm-rubric` for structured criteria, custom prompts, custom grader targets, or assertion-level transforms, and `type: script` when grading must execute code.
43
- - Write `expected_output` as a golden/reference answer the target could have produced. Do not write criteria, scoring instructions, or "the agent should..." rubric prose there.
43
+ - Put reference answers in `tests[].vars.expected_output` or `default_test.vars.expected_output`, and consume them with an explicit assertion such as `type: llm-rubric` with `value: "Matches the reference answer: {{ expected_output }}"`. Do not write criteria, scoring instructions, or "the agent should..." rubric prose as the reference answer.
44
44
  - For historical or repo-state evals, materialize the repo through a pinned `environment` setup recipe. Mentioning a SHA only in prompt prose is not enough because the agent needs an actual checkout to inspect.
45
45
 
46
46
  ## Evaluation Types
@@ -61,7 +61,12 @@ agentv convert evals.json
61
61
  agentv eval evals.json
62
62
  ```
63
63
 
64
- The converter maps `prompt` → `input`, `expected_output` → `expected_output`, and Agent Skills `assertions` AgentV `assert` (`llm-rubric` checks), and resolves `files[]` paths. The generated YAML includes TODO comments for AgentV features to add (environment setup, script graders, rubrics, required gates).
64
+ The converter maps Agent Skills prompt text into AgentV prompt/vars data,
65
+ promotes Agent Skills `expected_output` into explicit `llm-rubric` criteria or
66
+ `vars.expected_output` when it is true reference data, and maps Agent Skills
67
+ `assertions` to AgentV `assert` (`llm-rubric` checks). The generated YAML
68
+ includes TODO comments for AgentV features to add (environment setup, script
69
+ graders, rubrics, required gates).
65
70
 
66
71
  After converting, enhance the YAML with AgentV-specific capabilities shown below.
67
72
 
@@ -103,12 +108,15 @@ prompts:
103
108
 
104
109
  tests:
105
110
  - id: multi-turn-context
106
- expected_output: "Your name is Alice."
111
+ vars:
112
+ expected_output: "Your name is Alice."
107
113
  assert:
114
+ - type: llm-rubric
115
+ value: "Matches the reference answer: {{ expected_output }}"
108
116
  - Correctly recalls the user's name from earlier in the conversation
109
117
  ```
110
118
 
111
- **Guidelines:** preserve exact wording in `expected_output`; aim for 5–15 tests per transcript; pick exchanges that test different capabilities.
119
+ **Guidelines:** preserve exact wording in `vars.expected_output`; aim for 5–15 tests per transcript; pick exchanges that test different capabilities.
112
120
 
113
121
  ## Quick Start
114
122
 
@@ -123,8 +131,10 @@ tests:
123
131
  - id: greeting
124
132
  vars:
125
133
  prompt: "Say hello"
126
- expected_output: "Hello! How can I help you?"
134
+ expected_output: "Hello! How can I help you?"
127
135
  assert:
136
+ - type: llm-rubric
137
+ value: "Matches the reference answer: {{ expected_output }}"
128
138
  - Greeting is friendly and warm
129
139
  - Offers to help
130
140
  ```
@@ -140,7 +150,7 @@ tests:
140
150
  |-------|----------|-------------|
141
151
  | `id` | yes | Unique identifier |
142
152
  | `vars` | yes when the prompt needs row data | Prompt-template variables for this row |
143
- | `expected_output` | no | Gold-standard reference answer (string shorthand or full message array) |
153
+ | `vars.expected_output` | no | Conventional reference-answer var consumed by explicit graders |
144
154
  | `assert` | yes | Graders: deterministic checks, `llm-rubric` checks, script graders, or plain string rubric criteria |
145
155
  | `execution` | no | Per-case grader/default overrides such as `skip_defaults`; target selection belongs in top-level `target` or CLI `--target` |
146
156
  | `environment` | no | Per-case coding-agent testbed config (overrides suite-level) |
@@ -153,7 +163,7 @@ Use top-level `prompts` plus `tests[].vars` for the Promptfoo-compatible canonic
153
163
  input shape. Shared data defaults belong in `default_test.vars`; per-test
154
164
  `vars` override those defaults by key. AgentV renders every prompt with each
155
165
  test's merged vars, then expands the run across prompts, targets, tests, and
156
- repeat attempts.
166
+ repeat samples.
157
167
 
158
168
  ```yaml
159
169
  description: Prompt matrix example
@@ -176,15 +186,19 @@ tests:
176
186
  - id: password-reset
177
187
  vars:
178
188
  question: How do I reset my password?
179
- expected_output: Password reset guidance
189
+ expected_output: Password reset guidance
180
190
  assert:
191
+ - type: llm-rubric
192
+ value: "Matches the reference answer: {{ expected_output }}"
181
193
  - Gives correct password reset guidance
182
194
  - id: admin-access
183
195
  vars:
184
196
  audience: admins
185
197
  question: How do I revoke a user's access?
186
- expected_output: Access revocation guidance
198
+ expected_output: Access revocation guidance
187
199
  assert:
200
+ - type: llm-rubric
201
+ value: "Matches the reference answer: {{ expected_output }}"
188
202
  - Gives safe access revocation guidance
189
203
  ```
190
204
 
@@ -204,7 +218,7 @@ then render those vars from the prompt template next to the input.
204
218
  **Shorthand forms:**
205
219
  - Prompt entries can be strings, message arrays, file references, or prompt objects.
206
220
  - Put chat/system/user messages in `prompts`, not in `tests[].input`.
207
- - `expected_output` (string/object) expands to `[{role: "assistant", content: ...}]`
221
+ - `vars.expected_output` is a conventional reference-answer variable; explicit assertions decide how to grade it
208
222
  - Use these canonical field names on disk; keep the wire format `snake_case`
209
223
 
210
224
  **Message format:** `{role, content}` where role is `system`, `user`, `assistant`, or `tool`
@@ -356,12 +370,14 @@ tests:
356
370
  verification guidance was added.
357
371
 
358
372
  Decide what durable repo change should be made and explain why.
359
- expected_output: |
360
- The durable repo change is to update .agents/verification.md with the
361
- reusable verification workflow lessons. AGENTS.md already routes this
362
- class of work to .agents/verification.md, so no extra AGENTS.md edit is
363
- needed unless that routing is missing.
373
+ expected_output: |
374
+ The durable repo change is to update .agents/verification.md with the
375
+ reusable verification workflow lessons. AGENTS.md already routes this
376
+ class of work to .agents/verification.md, so no extra AGENTS.md edit is
377
+ needed unless that routing is missing.
364
378
  assert:
379
+ - type: llm-rubric
380
+ value: "Matches the reference answer: {{ expected_output }}"
365
381
  - The answer recommends updating .agents/verification.md rather than leaving the learning only in PR comments or private evidence.
366
382
  - The answer uses the pinned ./agentv checkout to verify the AGENTS.md routing.
367
383
  - The answer preserves the historical commit SHA as context.
@@ -387,9 +403,9 @@ tests:
387
403
  value: "fix"
388
404
  ```
389
405
 
390
- `expected_output` is passive reference data. It is available to graders through
391
- `{{expected_output}}` and the script stdin payload, but it does not create an
392
- implicit LLM grading call by itself.
406
+ `vars.expected_output` is passive reference data. It is available to graders
407
+ through `{{ expected_output }}` and the script stdin payload, but it does not
408
+ create an implicit LLM grading call by itself.
393
409
 
394
410
  **Common mistake:** putting rubric prose in `expected_output` instead of an
395
411
  assertion:
@@ -402,7 +418,7 @@ tests:
402
418
  - id: bad-example
403
419
  vars:
404
420
  prompt: "What is 2+2?"
405
- expected_output: The assistant should explain why the answer is 4. # reference answer field, not a grader
421
+ expected_output: The assistant should explain why the answer is 4. # reference answer var, not a grader
406
422
  ```
407
423
 
408
424
  Write this as:
@@ -415,8 +431,10 @@ tests:
415
431
  - id: good-example
416
432
  vars:
417
433
  prompt: "What is 2+2?"
418
- expected_output: "4"
434
+ expected_output: "4"
419
435
  assert:
436
+ - type: llm-rubric
437
+ value: "Matches the reference answer: {{ expected_output }}"
420
438
  - The answer is 4 and explains the arithmetic briefly
421
439
  ```
422
440
 
@@ -438,7 +456,7 @@ assert:
438
456
  weight: 5.0
439
457
  ```
440
458
 
441
- If a required grader scores below its threshold, the overall verdict is forced to `fail`.
459
+ If a required grader scores below its threshold, the overall case status is forced to `fail`.
442
460
 
443
461
  ## Environment Setup/Teardown
444
462
 
@@ -523,9 +541,10 @@ Configure via the `assert` array. Multiple graders produce a weighted average sc
523
541
  cwd: ./scripts # optional working directory
524
542
  target: {} # optional: enable LLM target proxy (max_calls: 50)
525
543
  ```
526
- Contract: stdin JSON -> stdout JSON `{score, assertions: [{text, passed, evidence?}], reasoning}`
544
+ Contract: stdin JSON -> stdout JSON `{pass, score, reason, checks?: [{text, pass, score?, reason}]}`
527
545
  Raw stdin uses snake_case and includes: `input`, `expected_output`, `output` (final answer string), `messages`, `trace`, `trace_summary`, `token_usage`, `cost_usd`, `duration_ms`, `start_time`, `end_time`, `file_changes`, `workspace_path`, `config`
528
546
  SDK handlers receive the same payload in camelCase: `expectedOutput`, `traceSummary`, `tokenUsage`, `costUsd`, `durationMs`, `startTime`, `endTime`, `fileChanges`, `workspacePath`.
547
+ `checks` is an SDK/script convenience shape; public `grading.json` artifacts normalize checks into recursive `component_results`.
529
548
  When an environment prepares a workspace directory, `workspace_path` is the absolute path to that directory (also available as `AGENTV_WORKSPACE_PATH` env var). Use this for functional grading (e.g., running `npm test` in the prepared workdir).
530
549
  For deterministic workspace checks that fit normal Vitest `expect(...)` tests, prefer a plain verifier file and the built-in adapter:
531
550
  ```yaml
@@ -567,24 +586,35 @@ Variables: `{{criteria}}`, `{{input}}`, `{{expected_output}}`, `{{output}}`, `{{
567
586
  type: llm-rubric
568
587
  weight: 0.7
569
588
  ```
570
- Use `assert-set` for Promptfoo-aligned assertion grouping. Without `threshold`, the set passes only when every nonzero-weight child assertion passes. With `threshold`, the weighted aggregate score determines the set verdict. Parent `config` is inherited by children, and child `config` keys override parent keys. Do not use `type: composite`; AgentV rejects it.
571
-
572
- ### tool-trajectory
573
- ```yaml
574
- - name: tool_check
575
- type: tool-trajectory
576
- mode: any_order # any_order | in_order | exact
577
- minimums: # for any_order
578
- knowledgeSearch: 2
579
- expected: # for in_order/exact
580
- - tool: knowledgeSearch
581
- args: { query: "search term" } # partial deep equality match
582
- - tool: documentRetrieve
583
- args: any # any arguments accepted
584
- max_duration_ms: 5000 # per-tool latency assertion
585
- - tool: summarize # omit args to skip argument checking
586
- ```
587
- `tool-trajectory` is an AgentV-specific extension over AgentV-normalized transcripts. Do not use Promptfoo `trajectory:*`, `tool-call-f1`, `skill-used`, or `trace-*` names; AgentV rejects those until their trace semantics are implemented directly.
589
+ Use `assert-set` for Promptfoo-aligned assertion grouping. Without `threshold`, the set passes only when every nonzero-weight child assertion passes. With `threshold`, the weighted aggregate score determines the set pass/fail result. Parent `config` is inherited by children, and child `config` keys override parent keys. Do not use `type: composite`; AgentV rejects it.
590
+
591
+ ### Skill And Trajectory Assertions
592
+ ```yaml
593
+ - type: skill-used
594
+ value: csv-analyzer
595
+ - type: not-skill-used
596
+ value:
597
+ pattern: "web-*"
598
+ max: 0
599
+ - type: trajectory:tool-used
600
+ value:
601
+ name: knowledgeSearch
602
+ min: 2
603
+ - type: trajectory:tool-sequence
604
+ value:
605
+ mode: exact
606
+ steps: [knowledgeSearch, documentRetrieve]
607
+ - type: trajectory:tool-args-match
608
+ value:
609
+ name: knowledgeSearch
610
+ args: { query: "search term" }
611
+ mode: partial
612
+ ```
613
+ Use Promptfoo-compatible `skill-used`, `not-skill-used`, and `trajectory:*`
614
+ assertions for new eval YAML. Do not author `skill-trigger` or
615
+ `tool-trajectory`; AgentV rejects them with migration guidance. Per-tool
616
+ latency checks from old `tool-trajectory` YAML do not have a Promptfoo
617
+ trajectory equivalent yet; use a `script` assertion for that behavior.
588
618
 
589
619
  ### field-accuracy
590
620
  ```yaml
@@ -711,24 +741,24 @@ agentv eval assert <grader-name> --agent-output "..." --agent-input "..."
711
741
  agentv import claude --session-id <uuid>
712
742
 
713
743
  # Re-run only execution errors from a previous run
714
- agentv eval <file.yaml> --retry-errors .agentv/results/default/<timestamp>/index.jsonl
744
+ agentv eval <file.yaml> --retry-errors .agentv/results/<run_id>/.internal/index.jsonl
715
745
 
716
746
  # Validate eval file
717
747
  agentv validate <file.yaml>
718
748
 
719
749
  # Compare completed runs
720
750
  agentv results compare \
721
- .agentv/results/default/<baseline-timestamp>/index.jsonl \
722
- .agentv/results/default/<candidate-timestamp>/index.jsonl
751
+ .agentv/results/<baseline-run-id>/.internal/index.jsonl \
752
+ .agentv/results/<candidate-run-id>/.internal/index.jsonl
723
753
  agentv results combine \
724
- .agentv/results/default/<baseline-timestamp> \
725
- .agentv/results/default/<candidate-timestamp> \
726
- .agentv/results/default/<third-target-timestamp> \
727
- --output .agentv/results/default/combined
728
- agentv results compare .agentv/results/default/combined/index.jsonl
754
+ .agentv/results/<baseline-run-id> \
755
+ .agentv/results/<candidate-run-id> \
756
+ .agentv/results/<third-target-run-id> \
757
+ --output .agentv/results/combined
758
+ agentv results compare .agentv/results/combined/.internal/index.jsonl
729
759
  agentv results compare \
730
- .agentv/results/default/<baseline-timestamp>/index.jsonl \
731
- .agentv/results/default/<candidate-timestamp>/index.jsonl \
760
+ .agentv/results/<baseline-run-id>/.internal/index.jsonl \
761
+ .agentv/results/<candidate-run-id>/.internal/index.jsonl \
732
762
  --json
733
763
 
734
764
  # Author assertions directly in the eval file
@@ -744,32 +774,36 @@ Use `@agentv/sdk` as the public lightweight SDK package for TypeScript/JavaScrip
744
774
 
745
775
  ### YAML-aligned eval authoring
746
776
  ```typescript
747
- import { defineEval, graders } from '@agentv/sdk';
777
+ // evals/helper-suite.eval.ts
778
+ import { graders, type EvalConfig } from '@agentv/sdk';
748
779
 
749
- export default defineEval({
780
+ const config: EvalConfig = {
750
781
  name: 'helper-suite',
751
782
  target: 'default',
752
- // The SDK helper lowers this to evaluate_options.repeat in generated YAML.
783
+ // TypeScript config loading lowers this to evaluate_options.repeat.
753
784
  repeat: {
754
785
  count: 3,
755
786
  strategy: 'pass_any',
756
787
  earlyExit: false,
757
788
  },
758
789
  threshold: 0.8,
790
+ prompts: ['{{ task }}'],
759
791
  tests: [
760
792
  {
761
793
  id: 'json-answer',
762
- input: 'Return a JSON answer with a status field.',
794
+ vars: { task: 'Return a JSON answer with a status field.' },
763
795
  assert: [
764
796
  graders.json({ name: 'valid-json', required: true }),
765
797
  graders.regex(/"status"\s*:/, { name: 'status-key' }),
766
798
  ],
767
799
  },
768
800
  ],
769
- });
801
+ };
802
+
803
+ export default config;
770
804
  ```
771
805
 
772
- The `graders` catalog returns ordinary `assert` entries such as `type: is-json`, `type: regex`, `type: llm-rubric`, and `type: script`. `defineEval()` lowers camelCase TypeScript fields such as `expectedOutput`, `inputFiles`, and `maxSteps` to canonical snake_case YAML/runtime keys.
806
+ The `graders` catalog returns ordinary `assert` entries such as `type: is-json`, `type: regex`, `type: llm-rubric`, and `type: script`. Explicit `*.eval.ts` and `*.eval.mts` files should default-export an `EvalConfig`; `defineEval(config)` is only an optional thin helper over that same shape. TypeScript config loading lowers camelCase fields such as `expectedOutput`, `inputFiles`, and `maxSteps` to canonical snake_case YAML/runtime keys.
773
807
 
774
808
  If adapting Braintrust `scores` or DeepEval metrics, write small AgentV helper factories that return `graders.*` configs:
775
809
 
@@ -794,9 +828,11 @@ import { defineAssertion } from '@agentv/sdk';
794
828
 
795
829
  export default defineAssertion(({ output, trace }) => {
796
830
  const finalOutput = output ?? '';
831
+ const pass = finalOutput.length > 0 && (trace?.eventCount ?? 0) <= 10;
797
832
  return {
798
- pass: finalOutput.length > 0 && (trace?.eventCount ?? 0) <= 10,
799
- reasoning: 'Checks content exists and is efficient',
833
+ pass,
834
+ score: pass ? 1 : 0,
835
+ reason: 'Checks content exists and is efficient',
800
836
  };
801
837
  });
802
838
  ```
@@ -812,17 +848,21 @@ import { defineScriptGrader } from '@agentv/sdk';
812
848
 
813
849
  export default defineScriptGrader(({ output, trace }) => {
814
850
  const finalOutput = output ?? '';
851
+ const hasOutput = finalOutput.length > 0;
852
+ const efficient = (trace?.eventCount ?? 0) <= 5;
815
853
  return {
816
- score: finalOutput.length > 0 && (trace?.eventCount ?? 0) <= 5 ? 1.0 : 0.5,
817
- assert: [
818
- { text: 'Output is not empty', passed: finalOutput.length > 0 },
819
- { text: 'Efficient tool usage', passed: (trace?.eventCount ?? 0) <= 5 },
854
+ pass: hasOutput && efficient,
855
+ score: hasOutput && efficient ? 1.0 : 0.5,
856
+ reason: 'Checks content exists and tool usage is bounded',
857
+ checks: [
858
+ { text: 'Output is not empty', pass: hasOutput, reason: hasOutput ? 'Output text is present' : 'Output is empty' },
859
+ { text: 'Efficient tool usage', pass: efficient, reason: efficient ? 'Trace event count is within limit' : 'Trace event count is too high' },
820
860
  ],
821
861
  };
822
862
  });
823
863
  ```
824
864
 
825
- Use `defineScriptGrader()` when the custom component is a command-backed grader with explicit score control, custom assertion-result arrays, workspace commands, or LLM calls through a grader target. `defineScriptGrader()` scripts are referenced in YAML with `type: script` and `command: [bun, run, grader.ts]`. Plain Vitest workspace verifier files can use `command: [agentv, eval, graders/check.test.ts]`.
865
+ Use `defineScriptGrader()` when the custom component is a command-backed grader with explicit score control, check arrays, workspace commands, or LLM calls through a grader target. `defineScriptGrader()` scripts are referenced in YAML with `type: script` and `command: [bun, run, grader.ts]`. Plain Vitest workspace verifier files can use `command: [agentv, eval, graders/check.test.ts]`.
826
866
 
827
867
  ### Convention-Based Discovery
828
868
 
@@ -59,13 +59,15 @@ import {
59
59
  createTargetClient,
60
60
  defineScriptGrader,
61
61
  defineEval,
62
+ type EvalConfig,
62
63
  definePromptTemplate,
63
64
  graders,
64
65
  } from '@agentv/sdk';
65
66
  ```
66
67
 
67
68
  - `defineScriptGrader(fn)` - Wraps evaluation function with stdin/stdout handling
68
- - `defineEval(definition)` - Defines a YAML-aligned `.eval.ts` suite
69
+ - `EvalConfig` - Public TypeScript eval authoring type for default-exported `*.eval.ts` and `*.eval.mts` files
70
+ - `defineEval(definition)` - Optional thin helper over the same `EvalConfig` shape
69
71
  - `graders` - Helper catalog that returns ordinary AgentV `assert` entries
70
72
  - `createTargetClient()` - Returns LLM proxy client (when `target: {}` configured)
71
73
  - `.invoke({question, systemPrompt})` - Single LLM call
@@ -81,7 +83,7 @@ For Python, the repo-local helper example in `examples/features/sdk-python/` kee
81
83
  Use helper factories for reusable Braintrust/DeepEval-inspired checks, but keep the result as AgentV `assert` entries:
82
84
 
83
85
  ```typescript
84
- import { defineEval, graders } from '@agentv/sdk';
86
+ import { graders, type EvalConfig } from '@agentv/sdk';
85
87
 
86
88
  function ragFaithfulness() {
87
89
  return graders.llmRubric(undefined, {
@@ -91,19 +93,22 @@ function ragFaithfulness() {
91
93
  });
92
94
  }
93
95
 
94
- export default defineEval({
96
+ const config: EvalConfig = {
95
97
  name: 'rag-suite',
98
+ prompts: ['{{ task }}'],
96
99
  tests: [
97
100
  {
98
101
  id: 'grounded-answer',
99
- input: 'Answer using the retrieved context.',
102
+ vars: { task: 'Answer using the retrieved context.' },
100
103
  assert: [
101
104
  graders.contains('source', { name: 'mentions-source' }),
102
105
  ragFaithfulness(),
103
106
  ],
104
107
  },
105
108
  ],
106
- });
109
+ };
110
+
111
+ export default config;
107
112
  ```
108
113
 
109
114
  The helper lowers to ordinary YAML: