@toolpack-sdk/agents 2.1.0 → 2.2.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.
@@ -0,0 +1,343 @@
1
+ import { B as BaseAgent } from './base-agent-DPdK4Pnl.cjs';
2
+
3
+ /**
4
+ * Eval primitives — shared types across EvalDataset, EvalRunner, EvalScorer, and EvalReport.
5
+ */
6
+ /**
7
+ * A single eval case: an input fed to the agent and the expected output used
8
+ * for scoring.
9
+ */
10
+ interface EvalCase {
11
+ /** Unique identifier for this case. */
12
+ id: string;
13
+ /** The input passed to `agent.invokeAgent()`. */
14
+ input: {
15
+ message: string;
16
+ intent?: string;
17
+ conversationId?: string;
18
+ context?: Record<string, unknown>;
19
+ };
20
+ /**
21
+ * The expected output used by scorers.
22
+ * Exact-match and contains scorers compare `actualOutput` against this.
23
+ * LLM-judge scorers use it as the reference answer.
24
+ */
25
+ expectedOutput: string;
26
+ /** Optional free-form metadata (e.g. tags, difficulty, source). */
27
+ metadata?: Record<string, unknown>;
28
+ }
29
+ /**
30
+ * The actual output produced by running a single eval case against an agent.
31
+ */
32
+ interface EvalCaseResult {
33
+ /** The eval case that was run. */
34
+ evalCase: EvalCase;
35
+ /** The output produced by the agent. */
36
+ actualOutput: string;
37
+ /** Wall-clock duration in milliseconds. */
38
+ durationMs: number;
39
+ /** Error message if the agent threw, otherwise undefined. */
40
+ error?: string;
41
+ }
42
+ /**
43
+ * The result of running an entire dataset through an agent.
44
+ */
45
+ interface EvalRun {
46
+ /** Identifier for this run (e.g. "v1.2", "pr-456"). */
47
+ runId: string;
48
+ /** ISO timestamp of when the run started. */
49
+ startedAt: string;
50
+ /** ISO timestamp of when the run completed. */
51
+ completedAt: string;
52
+ /** Total wall-clock duration in milliseconds. */
53
+ totalDurationMs: number;
54
+ /** Per-case results, in dataset order. */
55
+ results: EvalCaseResult[];
56
+ }
57
+ /** The verdict for a single scored case. */
58
+ type EvalVerdict = 'pass' | 'fail';
59
+ /**
60
+ * A scored result — wraps an EvalCaseResult with a pass/fail verdict and
61
+ * an optional explanation.
62
+ */
63
+ interface EvalScoredResult {
64
+ /** The underlying case result. */
65
+ caseResult: EvalCaseResult;
66
+ /** Pass or fail. */
67
+ verdict: EvalVerdict;
68
+ /**
69
+ * Optional human-readable explanation of the verdict.
70
+ * Populated by LLMJudgeScorer; optional for other scorers.
71
+ */
72
+ explanation?: string;
73
+ }
74
+ /**
75
+ * A fully scored run — an EvalRun annotated with per-case verdicts and
76
+ * aggregate pass/fail counts.
77
+ */
78
+ interface EvalScoredRun {
79
+ /** The original run. */
80
+ run: EvalRun;
81
+ /** Scored results, in run order. */
82
+ scoredResults: EvalScoredResult[];
83
+ /** Number of passing cases. */
84
+ passCount: number;
85
+ /** Number of failing cases. */
86
+ failCount: number;
87
+ /** Pass rate as a fraction between 0 and 1. */
88
+ passRate: number;
89
+ }
90
+ /**
91
+ * A regression entry — a case that passed in the baseline but fails in the
92
+ * candidate.
93
+ */
94
+ interface EvalRegression {
95
+ caseId: string;
96
+ baselineOutput: string;
97
+ candidateOutput: string;
98
+ }
99
+ /**
100
+ * An improvement entry — a case that failed in the baseline but passes in the
101
+ * candidate.
102
+ */
103
+ interface EvalImprovement {
104
+ caseId: string;
105
+ baselineOutput: string;
106
+ candidateOutput: string;
107
+ }
108
+ /**
109
+ * Comparison report between a baseline scored run and a candidate scored run.
110
+ */
111
+ interface EvalReport {
112
+ baselineRunId: string;
113
+ candidateRunId: string;
114
+ baselinePassRate: number;
115
+ candidatePassRate: number;
116
+ /** Δ pass rate (candidate − baseline). Positive = improvement. */
117
+ delta: number;
118
+ regressions: EvalRegression[];
119
+ improvements: EvalImprovement[];
120
+ /** Cases that passed in both runs. */
121
+ stablePasses: string[];
122
+ /** Cases that failed in both runs. */
123
+ stableFails: string[];
124
+ }
125
+
126
+ /**
127
+ * A collection of eval cases that can be loaded from / saved to JSON.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const dataset = new EvalDataset([
132
+ * {
133
+ * id: 'q1',
134
+ * input: { message: 'What is 2 + 2?' },
135
+ * expectedOutput: '4',
136
+ * },
137
+ * ]);
138
+ *
139
+ * dataset.save('./evals/math.json');
140
+ *
141
+ * const loaded = EvalDataset.load('./evals/math.json');
142
+ * ```
143
+ */
144
+ declare class EvalDataset {
145
+ private _cases;
146
+ constructor(cases?: EvalCase[]);
147
+ /** All cases in the dataset. */
148
+ get cases(): EvalCase[];
149
+ /** Number of cases. */
150
+ get size(): number;
151
+ /**
152
+ * Get a case by ID.
153
+ * Returns `undefined` if not found.
154
+ */
155
+ get(id: string): EvalCase | undefined;
156
+ /**
157
+ * Add one or more cases.
158
+ * Throws if a case with the same ID already exists.
159
+ */
160
+ add(...cases: EvalCase[]): this;
161
+ /**
162
+ * Remove a case by ID.
163
+ * Returns `true` if removed, `false` if not found.
164
+ */
165
+ remove(id: string): boolean;
166
+ /**
167
+ * Filter cases by a predicate. Returns a new EvalDataset.
168
+ */
169
+ filter(predicate: (c: EvalCase) => boolean): EvalDataset;
170
+ /**
171
+ * Serialize to a plain array (suitable for `JSON.stringify`).
172
+ */
173
+ toJSON(): EvalCase[];
174
+ /**
175
+ * Save cases to a JSON file.
176
+ *
177
+ * @param filePath Absolute or relative path to the output file.
178
+ */
179
+ save(filePath: string): void;
180
+ /**
181
+ * Load cases from a JSON file.
182
+ * The file must contain a JSON array of `EvalCase` objects.
183
+ *
184
+ * @param filePath Absolute or relative path to the JSON file.
185
+ */
186
+ static load(filePath: string): EvalDataset;
187
+ /**
188
+ * Create an `EvalDataset` from a plain array (e.g. from a database query).
189
+ */
190
+ static from(cases: EvalCase[]): EvalDataset;
191
+ }
192
+
193
+ interface EvalRunnerOptions {
194
+ /**
195
+ * Identifier for this run — use something meaningful like a version or PR number.
196
+ * Defaults to a timestamp string.
197
+ */
198
+ runId?: string;
199
+ /**
200
+ * Concurrency limit — how many cases to run in parallel.
201
+ * Defaults to 1 (sequential) to avoid overwhelming the provider.
202
+ */
203
+ concurrency?: number;
204
+ }
205
+ /**
206
+ * Runs an agent against every case in an `EvalDataset` and collects the
207
+ * results into an `EvalRun`.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * const runner = new EvalRunner(agent);
212
+ * const run = await runner.run(dataset, { runId: 'v1.2' });
213
+ *
214
+ * console.log(`${run.results.length} cases run in ${run.totalDurationMs}ms`);
215
+ * ```
216
+ */
217
+ declare class EvalRunner {
218
+ private agent;
219
+ constructor(agent: BaseAgent);
220
+ /**
221
+ * Run all cases in the dataset and return an `EvalRun`.
222
+ */
223
+ run(dataset: EvalDataset, options?: EvalRunnerOptions): Promise<EvalRun>;
224
+ }
225
+
226
+ /**
227
+ * A scorer evaluates each `EvalCaseResult` in a run and produces a
228
+ * pass/fail verdict with an optional explanation.
229
+ *
230
+ * Implement this interface to create custom scoring logic.
231
+ */
232
+ interface EvalScorer {
233
+ score(run: EvalRun): Promise<EvalScoredRun>;
234
+ }
235
+ /**
236
+ * Passes a case when `actualOutput` exactly equals `expectedOutput`.
237
+ * Optionally case-insensitive and/or trimmed.
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * const scorer = new ExactMatchScorer({ trim: true, caseInsensitive: true });
242
+ * const scored = await scorer.score(run);
243
+ * ```
244
+ */
245
+ declare class ExactMatchScorer implements EvalScorer {
246
+ private trim;
247
+ private caseInsensitive;
248
+ constructor(options?: {
249
+ trim?: boolean;
250
+ caseInsensitive?: boolean;
251
+ });
252
+ score(run: EvalRun): Promise<EvalScoredRun>;
253
+ }
254
+ /**
255
+ * Passes a case when `actualOutput` contains `expectedOutput` as a substring.
256
+ * Optionally case-insensitive.
257
+ *
258
+ * @example
259
+ * ```ts
260
+ * const scorer = new ContainsScorer({ caseInsensitive: true });
261
+ * const scored = await scorer.score(run);
262
+ * ```
263
+ */
264
+ declare class ContainsScorer implements EvalScorer {
265
+ private caseInsensitive;
266
+ constructor(options?: {
267
+ caseInsensitive?: boolean;
268
+ });
269
+ score(run: EvalRun): Promise<EvalScoredRun>;
270
+ }
271
+ interface LLMJudgeScorerOptions {
272
+ /**
273
+ * Custom judge prompt template.
274
+ * Use `{{question}}`, `{{expected}}`, and `{{actual}}` as placeholders.
275
+ * Must instruct the LLM to respond with only "pass" or "fail" on the first line,
276
+ * optionally followed by an explanation.
277
+ */
278
+ promptTemplate?: string;
279
+ }
280
+ /**
281
+ * Uses an LLM agent as a judge to score each case.
282
+ * The judge is prompted with the question, expected answer, and actual answer.
283
+ *
284
+ * @example
285
+ * ```ts
286
+ * const judgeAgent = new MyAgent({ toolpack });
287
+ * const scorer = new LLMJudgeScorer(judgeAgent);
288
+ * const scored = await scorer.score(run);
289
+ * ```
290
+ */
291
+ declare class LLMJudgeScorer implements EvalScorer {
292
+ private judgeAgent;
293
+ private promptTemplate;
294
+ constructor(judgeAgent: BaseAgent, options?: LLMJudgeScorerOptions);
295
+ score(run: EvalRun): Promise<EvalScoredRun>;
296
+ }
297
+ /**
298
+ * Wraps a user-supplied scoring function.
299
+ *
300
+ * @example
301
+ * ```ts
302
+ * const scorer = new CustomScorer(async (result) => {
303
+ * const pass = result.actualOutput.includes('Paris');
304
+ * return { verdict: pass ? 'pass' : 'fail' };
305
+ * });
306
+ * ```
307
+ */
308
+ declare class CustomScorer implements EvalScorer {
309
+ private fn;
310
+ constructor(fn: (result: EvalCaseResult) => Promise<{
311
+ verdict: EvalVerdict;
312
+ explanation?: string;
313
+ }>);
314
+ score(run: EvalRun): Promise<EvalScoredRun>;
315
+ }
316
+
317
+ /**
318
+ * Compares two scored runs and produces a regression/improvement report.
319
+ *
320
+ * @example
321
+ * ```ts
322
+ * const report = compareEvalRuns(baselineScoredRun, candidateScoredRun);
323
+ *
324
+ * if (report.regressions.length > 0) {
325
+ * console.error('Regressions detected:', report.regressions);
326
+ * process.exit(1);
327
+ * }
328
+ *
329
+ * console.log(`Pass rate: ${report.baselinePassRate} → ${report.candidatePassRate} (Δ${report.delta > 0 ? '+' : ''}${report.delta.toFixed(2)})`);
330
+ * ```
331
+ */
332
+ declare function compareEvalRuns(baseline: EvalScoredRun, candidate: EvalScoredRun): EvalReport;
333
+ /**
334
+ * Format an `EvalReport` as a human-readable summary string.
335
+ *
336
+ * @example
337
+ * ```ts
338
+ * console.log(formatEvalReport(report));
339
+ * ```
340
+ */
341
+ declare function formatEvalReport(report: EvalReport): string;
342
+
343
+ export { ContainsScorer as C, type EvalCase as E, LLMJudgeScorer as L, CustomScorer as a, type EvalCaseResult as b, EvalDataset as c, type EvalImprovement as d, type EvalRegression as e, type EvalReport as f, type EvalRun as g, EvalRunner as h, type EvalRunnerOptions as i, type EvalScoredResult as j, type EvalScoredRun as k, type EvalScorer as l, type EvalVerdict as m, ExactMatchScorer as n, type LLMJudgeScorerOptions as o, compareEvalRuns as p, formatEvalReport as q };
@@ -0,0 +1,343 @@
1
+ import { B as BaseAgent } from './base-agent-nU8pr4nu.js';
2
+
3
+ /**
4
+ * Eval primitives — shared types across EvalDataset, EvalRunner, EvalScorer, and EvalReport.
5
+ */
6
+ /**
7
+ * A single eval case: an input fed to the agent and the expected output used
8
+ * for scoring.
9
+ */
10
+ interface EvalCase {
11
+ /** Unique identifier for this case. */
12
+ id: string;
13
+ /** The input passed to `agent.invokeAgent()`. */
14
+ input: {
15
+ message: string;
16
+ intent?: string;
17
+ conversationId?: string;
18
+ context?: Record<string, unknown>;
19
+ };
20
+ /**
21
+ * The expected output used by scorers.
22
+ * Exact-match and contains scorers compare `actualOutput` against this.
23
+ * LLM-judge scorers use it as the reference answer.
24
+ */
25
+ expectedOutput: string;
26
+ /** Optional free-form metadata (e.g. tags, difficulty, source). */
27
+ metadata?: Record<string, unknown>;
28
+ }
29
+ /**
30
+ * The actual output produced by running a single eval case against an agent.
31
+ */
32
+ interface EvalCaseResult {
33
+ /** The eval case that was run. */
34
+ evalCase: EvalCase;
35
+ /** The output produced by the agent. */
36
+ actualOutput: string;
37
+ /** Wall-clock duration in milliseconds. */
38
+ durationMs: number;
39
+ /** Error message if the agent threw, otherwise undefined. */
40
+ error?: string;
41
+ }
42
+ /**
43
+ * The result of running an entire dataset through an agent.
44
+ */
45
+ interface EvalRun {
46
+ /** Identifier for this run (e.g. "v1.2", "pr-456"). */
47
+ runId: string;
48
+ /** ISO timestamp of when the run started. */
49
+ startedAt: string;
50
+ /** ISO timestamp of when the run completed. */
51
+ completedAt: string;
52
+ /** Total wall-clock duration in milliseconds. */
53
+ totalDurationMs: number;
54
+ /** Per-case results, in dataset order. */
55
+ results: EvalCaseResult[];
56
+ }
57
+ /** The verdict for a single scored case. */
58
+ type EvalVerdict = 'pass' | 'fail';
59
+ /**
60
+ * A scored result — wraps an EvalCaseResult with a pass/fail verdict and
61
+ * an optional explanation.
62
+ */
63
+ interface EvalScoredResult {
64
+ /** The underlying case result. */
65
+ caseResult: EvalCaseResult;
66
+ /** Pass or fail. */
67
+ verdict: EvalVerdict;
68
+ /**
69
+ * Optional human-readable explanation of the verdict.
70
+ * Populated by LLMJudgeScorer; optional for other scorers.
71
+ */
72
+ explanation?: string;
73
+ }
74
+ /**
75
+ * A fully scored run — an EvalRun annotated with per-case verdicts and
76
+ * aggregate pass/fail counts.
77
+ */
78
+ interface EvalScoredRun {
79
+ /** The original run. */
80
+ run: EvalRun;
81
+ /** Scored results, in run order. */
82
+ scoredResults: EvalScoredResult[];
83
+ /** Number of passing cases. */
84
+ passCount: number;
85
+ /** Number of failing cases. */
86
+ failCount: number;
87
+ /** Pass rate as a fraction between 0 and 1. */
88
+ passRate: number;
89
+ }
90
+ /**
91
+ * A regression entry — a case that passed in the baseline but fails in the
92
+ * candidate.
93
+ */
94
+ interface EvalRegression {
95
+ caseId: string;
96
+ baselineOutput: string;
97
+ candidateOutput: string;
98
+ }
99
+ /**
100
+ * An improvement entry — a case that failed in the baseline but passes in the
101
+ * candidate.
102
+ */
103
+ interface EvalImprovement {
104
+ caseId: string;
105
+ baselineOutput: string;
106
+ candidateOutput: string;
107
+ }
108
+ /**
109
+ * Comparison report between a baseline scored run and a candidate scored run.
110
+ */
111
+ interface EvalReport {
112
+ baselineRunId: string;
113
+ candidateRunId: string;
114
+ baselinePassRate: number;
115
+ candidatePassRate: number;
116
+ /** Δ pass rate (candidate − baseline). Positive = improvement. */
117
+ delta: number;
118
+ regressions: EvalRegression[];
119
+ improvements: EvalImprovement[];
120
+ /** Cases that passed in both runs. */
121
+ stablePasses: string[];
122
+ /** Cases that failed in both runs. */
123
+ stableFails: string[];
124
+ }
125
+
126
+ /**
127
+ * A collection of eval cases that can be loaded from / saved to JSON.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const dataset = new EvalDataset([
132
+ * {
133
+ * id: 'q1',
134
+ * input: { message: 'What is 2 + 2?' },
135
+ * expectedOutput: '4',
136
+ * },
137
+ * ]);
138
+ *
139
+ * dataset.save('./evals/math.json');
140
+ *
141
+ * const loaded = EvalDataset.load('./evals/math.json');
142
+ * ```
143
+ */
144
+ declare class EvalDataset {
145
+ private _cases;
146
+ constructor(cases?: EvalCase[]);
147
+ /** All cases in the dataset. */
148
+ get cases(): EvalCase[];
149
+ /** Number of cases. */
150
+ get size(): number;
151
+ /**
152
+ * Get a case by ID.
153
+ * Returns `undefined` if not found.
154
+ */
155
+ get(id: string): EvalCase | undefined;
156
+ /**
157
+ * Add one or more cases.
158
+ * Throws if a case with the same ID already exists.
159
+ */
160
+ add(...cases: EvalCase[]): this;
161
+ /**
162
+ * Remove a case by ID.
163
+ * Returns `true` if removed, `false` if not found.
164
+ */
165
+ remove(id: string): boolean;
166
+ /**
167
+ * Filter cases by a predicate. Returns a new EvalDataset.
168
+ */
169
+ filter(predicate: (c: EvalCase) => boolean): EvalDataset;
170
+ /**
171
+ * Serialize to a plain array (suitable for `JSON.stringify`).
172
+ */
173
+ toJSON(): EvalCase[];
174
+ /**
175
+ * Save cases to a JSON file.
176
+ *
177
+ * @param filePath Absolute or relative path to the output file.
178
+ */
179
+ save(filePath: string): void;
180
+ /**
181
+ * Load cases from a JSON file.
182
+ * The file must contain a JSON array of `EvalCase` objects.
183
+ *
184
+ * @param filePath Absolute or relative path to the JSON file.
185
+ */
186
+ static load(filePath: string): EvalDataset;
187
+ /**
188
+ * Create an `EvalDataset` from a plain array (e.g. from a database query).
189
+ */
190
+ static from(cases: EvalCase[]): EvalDataset;
191
+ }
192
+
193
+ interface EvalRunnerOptions {
194
+ /**
195
+ * Identifier for this run — use something meaningful like a version or PR number.
196
+ * Defaults to a timestamp string.
197
+ */
198
+ runId?: string;
199
+ /**
200
+ * Concurrency limit — how many cases to run in parallel.
201
+ * Defaults to 1 (sequential) to avoid overwhelming the provider.
202
+ */
203
+ concurrency?: number;
204
+ }
205
+ /**
206
+ * Runs an agent against every case in an `EvalDataset` and collects the
207
+ * results into an `EvalRun`.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * const runner = new EvalRunner(agent);
212
+ * const run = await runner.run(dataset, { runId: 'v1.2' });
213
+ *
214
+ * console.log(`${run.results.length} cases run in ${run.totalDurationMs}ms`);
215
+ * ```
216
+ */
217
+ declare class EvalRunner {
218
+ private agent;
219
+ constructor(agent: BaseAgent);
220
+ /**
221
+ * Run all cases in the dataset and return an `EvalRun`.
222
+ */
223
+ run(dataset: EvalDataset, options?: EvalRunnerOptions): Promise<EvalRun>;
224
+ }
225
+
226
+ /**
227
+ * A scorer evaluates each `EvalCaseResult` in a run and produces a
228
+ * pass/fail verdict with an optional explanation.
229
+ *
230
+ * Implement this interface to create custom scoring logic.
231
+ */
232
+ interface EvalScorer {
233
+ score(run: EvalRun): Promise<EvalScoredRun>;
234
+ }
235
+ /**
236
+ * Passes a case when `actualOutput` exactly equals `expectedOutput`.
237
+ * Optionally case-insensitive and/or trimmed.
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * const scorer = new ExactMatchScorer({ trim: true, caseInsensitive: true });
242
+ * const scored = await scorer.score(run);
243
+ * ```
244
+ */
245
+ declare class ExactMatchScorer implements EvalScorer {
246
+ private trim;
247
+ private caseInsensitive;
248
+ constructor(options?: {
249
+ trim?: boolean;
250
+ caseInsensitive?: boolean;
251
+ });
252
+ score(run: EvalRun): Promise<EvalScoredRun>;
253
+ }
254
+ /**
255
+ * Passes a case when `actualOutput` contains `expectedOutput` as a substring.
256
+ * Optionally case-insensitive.
257
+ *
258
+ * @example
259
+ * ```ts
260
+ * const scorer = new ContainsScorer({ caseInsensitive: true });
261
+ * const scored = await scorer.score(run);
262
+ * ```
263
+ */
264
+ declare class ContainsScorer implements EvalScorer {
265
+ private caseInsensitive;
266
+ constructor(options?: {
267
+ caseInsensitive?: boolean;
268
+ });
269
+ score(run: EvalRun): Promise<EvalScoredRun>;
270
+ }
271
+ interface LLMJudgeScorerOptions {
272
+ /**
273
+ * Custom judge prompt template.
274
+ * Use `{{question}}`, `{{expected}}`, and `{{actual}}` as placeholders.
275
+ * Must instruct the LLM to respond with only "pass" or "fail" on the first line,
276
+ * optionally followed by an explanation.
277
+ */
278
+ promptTemplate?: string;
279
+ }
280
+ /**
281
+ * Uses an LLM agent as a judge to score each case.
282
+ * The judge is prompted with the question, expected answer, and actual answer.
283
+ *
284
+ * @example
285
+ * ```ts
286
+ * const judgeAgent = new MyAgent({ toolpack });
287
+ * const scorer = new LLMJudgeScorer(judgeAgent);
288
+ * const scored = await scorer.score(run);
289
+ * ```
290
+ */
291
+ declare class LLMJudgeScorer implements EvalScorer {
292
+ private judgeAgent;
293
+ private promptTemplate;
294
+ constructor(judgeAgent: BaseAgent, options?: LLMJudgeScorerOptions);
295
+ score(run: EvalRun): Promise<EvalScoredRun>;
296
+ }
297
+ /**
298
+ * Wraps a user-supplied scoring function.
299
+ *
300
+ * @example
301
+ * ```ts
302
+ * const scorer = new CustomScorer(async (result) => {
303
+ * const pass = result.actualOutput.includes('Paris');
304
+ * return { verdict: pass ? 'pass' : 'fail' };
305
+ * });
306
+ * ```
307
+ */
308
+ declare class CustomScorer implements EvalScorer {
309
+ private fn;
310
+ constructor(fn: (result: EvalCaseResult) => Promise<{
311
+ verdict: EvalVerdict;
312
+ explanation?: string;
313
+ }>);
314
+ score(run: EvalRun): Promise<EvalScoredRun>;
315
+ }
316
+
317
+ /**
318
+ * Compares two scored runs and produces a regression/improvement report.
319
+ *
320
+ * @example
321
+ * ```ts
322
+ * const report = compareEvalRuns(baselineScoredRun, candidateScoredRun);
323
+ *
324
+ * if (report.regressions.length > 0) {
325
+ * console.error('Regressions detected:', report.regressions);
326
+ * process.exit(1);
327
+ * }
328
+ *
329
+ * console.log(`Pass rate: ${report.baselinePassRate} → ${report.candidatePassRate} (Δ${report.delta > 0 ? '+' : ''}${report.delta.toFixed(2)})`);
330
+ * ```
331
+ */
332
+ declare function compareEvalRuns(baseline: EvalScoredRun, candidate: EvalScoredRun): EvalReport;
333
+ /**
334
+ * Format an `EvalReport` as a human-readable summary string.
335
+ *
336
+ * @example
337
+ * ```ts
338
+ * console.log(formatEvalReport(report));
339
+ * ```
340
+ */
341
+ declare function formatEvalReport(report: EvalReport): string;
342
+
343
+ export { ContainsScorer as C, type EvalCase as E, LLMJudgeScorer as L, CustomScorer as a, type EvalCaseResult as b, EvalDataset as c, type EvalImprovement as d, type EvalRegression as e, type EvalReport as f, type EvalRun as g, EvalRunner as h, type EvalRunnerOptions as i, type EvalScoredResult as j, type EvalScoredRun as k, type EvalScorer as l, type EvalVerdict as m, ExactMatchScorer as n, type LLMJudgeScorerOptions as o, compareEvalRuns as p, formatEvalReport as q };