@vitest-evals/core 0.13.0 → 0.14.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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { J as JsonValue } from './workspace-BNgjyW7W.mjs';
2
- export { C as CollectReportWorkspaceOptions, a as JsonObjectSchema, d as JsonPrimitive, b as JsonPrimitiveSchema, c as JsonValueSchema, R as REPORT_WORKSPACE_SCHEMA_VERSION, t as ReportCase, q as ReportCaseSchema, u as ReportRun, r as ReportRunSchema, v as ReportWorkspace, w as ReportWorkspaceInput, s as ReportWorkspaceSchema, i as VitestJsonAssertion, V as VitestJsonAssertionSchema, j as VitestJsonFile, e as VitestJsonFileSchema, k as VitestJsonLocation, f as VitestJsonLocationSchema, l as VitestJsonReport, g as VitestJsonReportSchema, m as VitestJsonStatus, h as VitestJsonStatusSchema, n as collectReportWorkspace, o as parseReportWorkspace, p as parseVitestJsonReport } from './workspace-BNgjyW7W.mjs';
1
+ import { J as JsonValue } from './workspace-DSZKph1P.mjs';
2
+ export { C as CollectReportWorkspaceOptions, a as JsonObjectSchema, d as JsonPrimitive, b as JsonPrimitiveSchema, c as JsonValueSchema, R as REPORT_WORKSPACE_SCHEMA_VERSION, t as ReportCase, q as ReportCaseSchema, u as ReportRun, r as ReportRunSchema, v as ReportWorkspace, w as ReportWorkspaceInput, s as ReportWorkspaceSchema, i as VitestJsonAssertion, V as VitestJsonAssertionSchema, j as VitestJsonFile, e as VitestJsonFileSchema, k as VitestJsonLocation, f as VitestJsonLocationSchema, l as VitestJsonReport, g as VitestJsonReportSchema, m as VitestJsonStatus, h as VitestJsonStatusSchema, n as collectReportWorkspace, o as parseReportWorkspace, p as parseVitestJsonReport } from './workspace-DSZKph1P.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /** Well-known OpenTelemetry GenAI operation names. */
@@ -85,15 +85,212 @@ type NormalizedSpanAttributes = OpenTelemetrySemanticAttributes & {
85
85
  [key: string]: JsonValue | undefined;
86
86
  };
87
87
 
88
+ /** Normalized error object captured in a tool result or trace span. */
89
+ declare const NormalizedErrorSchema: z.ZodObject<{
90
+ message: z.ZodString;
91
+ type: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
88
93
  /** Normalized error attached to tool calls and spans. */
89
- type NormalizedError = {
90
- /** Human-readable failure message. */
91
- message: string;
92
- /** Optional provider or runtime error type. */
93
- type?: string;
94
- /** Extra JSON-safe error metadata. */
95
- [key: string]: JsonValue | undefined;
94
+ type NormalizedError = z.infer<typeof NormalizedErrorSchema>;
95
+
96
+ /** Tool-call event captured in a harness transcript. */
97
+ declare const TranscriptToolCallEventSchema: z.ZodObject<{
98
+ type: z.ZodLiteral<"tool_call">;
99
+ id: z.ZodString;
100
+ name: z.ZodString;
101
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
102
+ startedAt: z.ZodOptional<z.ZodString>;
103
+ finishedAt: z.ZodOptional<z.ZodString>;
104
+ durationMs: z.ZodOptional<z.ZodNumber>;
105
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
106
+ }, z.core.$strict>;
107
+ /** Message event captured in a harness transcript. */
108
+ declare const TranscriptMessageEventSchema: z.ZodObject<{
109
+ type: z.ZodLiteral<"message">;
110
+ role: z.ZodEnum<{
111
+ system: "system";
112
+ user: "user";
113
+ assistant: "assistant";
114
+ }>;
115
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
116
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
117
+ }, z.core.$strict>;
118
+ /** Tool-result event captured in a harness transcript. */
119
+ declare const TranscriptToolResultEventSchema: z.ZodObject<{
120
+ type: z.ZodLiteral<"tool_result">;
121
+ toolCallId: z.ZodString;
122
+ name: z.ZodOptional<z.ZodString>;
123
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
124
+ error: z.ZodOptional<z.ZodObject<{
125
+ message: z.ZodString;
126
+ type: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
128
+ startedAt: z.ZodOptional<z.ZodString>;
129
+ finishedAt: z.ZodOptional<z.ZodString>;
130
+ durationMs: z.ZodOptional<z.ZodNumber>;
131
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
132
+ }, z.core.$strict>;
133
+ /** Transcript event captured in a harness session. */
134
+ declare const TranscriptEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
135
+ type: z.ZodLiteral<"message">;
136
+ role: z.ZodEnum<{
137
+ system: "system";
138
+ user: "user";
139
+ assistant: "assistant";
140
+ }>;
141
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
142
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ type: z.ZodLiteral<"tool_call">;
145
+ id: z.ZodString;
146
+ name: z.ZodString;
147
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
148
+ startedAt: z.ZodOptional<z.ZodString>;
149
+ finishedAt: z.ZodOptional<z.ZodString>;
150
+ durationMs: z.ZodOptional<z.ZodNumber>;
151
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
152
+ }, z.core.$strict>, z.ZodObject<{
153
+ type: z.ZodLiteral<"tool_result">;
154
+ toolCallId: z.ZodString;
155
+ name: z.ZodOptional<z.ZodString>;
156
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
157
+ error: z.ZodOptional<z.ZodObject<{
158
+ message: z.ZodString;
159
+ type: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
161
+ startedAt: z.ZodOptional<z.ZodString>;
162
+ finishedAt: z.ZodOptional<z.ZodString>;
163
+ durationMs: z.ZodOptional<z.ZodNumber>;
164
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
165
+ }, z.core.$strict>], "type">;
166
+ /** Message event captured in a harness transcript. */
167
+ type TranscriptMessageEvent = {
168
+ /** Transcript event discriminator. */
169
+ type: "message";
170
+ /** Message role. Tool activity is represented by separate tool events. */
171
+ role: "system" | "user" | "assistant";
172
+ /** JSON-safe message content. */
173
+ content?: JsonValue;
174
+ /** Extra JSON-safe message metadata. */
175
+ metadata?: Record<string, JsonValue>;
96
176
  };
177
+ /** Tool-call event captured in a harness transcript. */
178
+ type TranscriptToolCallEvent = {
179
+ /** Transcript event discriminator. */
180
+ type: "tool_call";
181
+ /** Transcript-local id used to link a result event. */
182
+ id: string;
183
+ /** Tool name as exposed to the agent or application runtime. */
184
+ name: string;
185
+ /** JSON-safe tool arguments after provider/runtime normalization. */
186
+ arguments?: Record<string, JsonValue>;
187
+ /** ISO timestamp for the start of tool execution. */
188
+ startedAt?: string;
189
+ /** ISO timestamp for the end of tool execution. */
190
+ finishedAt?: string;
191
+ /** Tool execution duration in milliseconds. */
192
+ durationMs?: number;
193
+ /** Extra JSON-safe tool metadata for reporters and custom judges. */
194
+ metadata?: Record<string, JsonValue>;
195
+ };
196
+ /** Tool-result event captured in a harness transcript. */
197
+ type TranscriptToolResultEvent = {
198
+ /** Transcript event discriminator. */
199
+ type: "tool_result";
200
+ /** Tool-call id this result responds to. */
201
+ toolCallId: string;
202
+ /** Tool name when available from the provider or runtime. */
203
+ name?: string;
204
+ /** JSON-safe tool result content. */
205
+ content?: JsonValue;
206
+ /** Normalized tool error when execution failed. */
207
+ error?: NormalizedError;
208
+ /** ISO timestamp for the start of tool execution. */
209
+ startedAt?: string;
210
+ /** ISO timestamp for the end of tool execution. */
211
+ finishedAt?: string;
212
+ /** Tool execution duration in milliseconds. */
213
+ durationMs?: number;
214
+ /** Extra JSON-safe tool-result metadata. */
215
+ metadata?: Record<string, JsonValue>;
216
+ };
217
+ /** Transcript event captured in a harness session. */
218
+ type TranscriptEvent = TranscriptMessageEvent | TranscriptToolCallEvent | TranscriptToolResultEvent;
219
+ /** Text part accepted in AI SDK-style message content arrays. */
220
+ type TranscriptMessageTextPart = {
221
+ /** Content part discriminator. */
222
+ type: "text";
223
+ /** Message text for this ordered content part. */
224
+ text: string;
225
+ /** Extra JSON-safe metadata for this content part. */
226
+ metadata?: Record<string, JsonValue>;
227
+ };
228
+ /** Tool-call part accepted in AI SDK-style assistant message content arrays. */
229
+ type TranscriptMessageToolCallPart = Omit<TranscriptToolCallEvent, "type" | "id" | "name" | "arguments"> & {
230
+ /** Content part discriminator. */
231
+ type: "tool-call";
232
+ /** Tool-call id from the message transport. */
233
+ toolCallId: string;
234
+ /** Tool name from the message transport. */
235
+ toolName: string;
236
+ /** JSON-safe tool input from the message transport. */
237
+ input?: JsonValue;
238
+ };
239
+ /** Tool-result part accepted in AI SDK-style tool message content arrays. */
240
+ type TranscriptMessageToolResultPart = Omit<TranscriptToolResultEvent, "type" | "toolCallId" | "name" | "content"> & {
241
+ /** Content part discriminator. */
242
+ type: "tool-result";
243
+ /** Tool-call id this result responds to. */
244
+ toolCallId: string;
245
+ /** Tool name from the message transport. */
246
+ toolName?: string;
247
+ /** JSON-safe tool output from the message transport. */
248
+ output?: JsonValue;
249
+ };
250
+ /** Ordered content part accepted in AI SDK-style message content arrays. */
251
+ type TranscriptMessageContentPart = TranscriptMessageTextPart | TranscriptMessageToolCallPart | TranscriptMessageToolResultPart;
252
+ /** System/user message content accepted at harness input boundaries. */
253
+ type TranscriptMessageContentInput = JsonValue;
254
+ type TranscriptMessageToolCallBase = Omit<TranscriptToolCallEvent, "type" | "id" | "name" | "arguments"> & {
255
+ /** Tool-call id when the message transport exposes one. */
256
+ id?: string;
257
+ /** JSON-safe tool arguments in the harness message contract. */
258
+ arguments?: Record<string, JsonValue>;
259
+ };
260
+ /** Message-transport tool call accepted at harness input boundaries. */
261
+ type TranscriptMessageToolCall = TranscriptMessageToolCallBase & {
262
+ /** Tool name in the harness message contract. */
263
+ name: string;
264
+ };
265
+ type TranscriptTopLevelToolMessage = Omit<TranscriptToolResultEvent, "type" | "toolCallId" | "content"> & {
266
+ role: "tool";
267
+ toolCallId: string;
268
+ content?: JsonValue | TranscriptMessageToolResultPart[];
269
+ };
270
+ /** Message-style transport accepted at harness input boundaries. */
271
+ type TranscriptMessageInput = {
272
+ role: "system" | "user";
273
+ content?: TranscriptMessageContentInput;
274
+ metadata?: Record<string, JsonValue>;
275
+ } | {
276
+ role: "assistant";
277
+ content?: JsonValue | (TranscriptMessageTextPart | TranscriptMessageToolCallPart)[];
278
+ toolCalls?: TranscriptMessageToolCall[];
279
+ metadata?: Record<string, JsonValue>;
280
+ } | TranscriptTopLevelToolMessage | {
281
+ role: "tool";
282
+ content: TranscriptMessageToolResultPart[];
283
+ metadata?: Record<string, JsonValue>;
284
+ };
285
+ /** Converts message-transport inputs into normalized transcript events. */
286
+ declare function messagesToTranscriptEvents(messages: readonly TranscriptMessageInput[]): TranscriptEvent[];
287
+ /** Returns true for normalized message transcript events. */
288
+ declare function isMessageEvent(event: TranscriptEvent): event is TranscriptMessageEvent;
289
+ /** Returns true for normalized tool-call transcript events. */
290
+ declare function isToolCallEvent(event: TranscriptEvent): event is TranscriptToolCallEvent;
291
+ /** Returns true for normalized tool-result transcript events. */
292
+ declare function isToolResultEvent(event: TranscriptEvent): event is TranscriptToolResultEvent;
293
+
97
294
  /** Usage values normalized by vitest-evals harnesses. */
98
295
  declare const UsageSummarySchema: z.ZodObject<{
99
296
  provider: z.ZodOptional<z.ZodString>;
@@ -139,61 +336,71 @@ type TimingSummary = {
139
336
  /** Extra JSON-safe timing metadata. */
140
337
  metadata?: Record<string, JsonValue>;
141
338
  };
142
- /** Normalized error object captured in a tool call or trace span. */
143
- declare const NormalizedErrorSchema: z.ZodObject<{
144
- message: z.ZodString;
145
- type: z.ZodOptional<z.ZodString>;
146
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
147
- /** Normalized tool call captured in a harness session. */
148
- declare const ToolCallRecordSchema: z.ZodObject<{
149
- id: z.ZodOptional<z.ZodString>;
339
+ /** Tool call observed in a normalized session, with result status when known. */
340
+ declare const ToolCallSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
341
+ name: z.ZodString;
342
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
343
+ status: z.ZodLiteral<"pending">;
344
+ }, z.core.$strict>, z.ZodObject<{
150
345
  name: z.ZodString;
151
346
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
347
+ status: z.ZodLiteral<"ok">;
152
348
  result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
153
- error: z.ZodOptional<z.ZodObject<{
349
+ }, z.core.$strict>, z.ZodObject<{
350
+ name: z.ZodString;
351
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
352
+ status: z.ZodLiteral<"error">;
353
+ error: z.ZodObject<{
154
354
  message: z.ZodString;
155
355
  type: z.ZodOptional<z.ZodString>;
156
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
157
- startedAt: z.ZodOptional<z.ZodString>;
158
- finishedAt: z.ZodOptional<z.ZodString>;
159
- durationMs: z.ZodOptional<z.ZodNumber>;
160
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
161
- }, z.core.$strict>;
162
- /** Normalized tool call captured in a harness session. */
163
- type ToolCallRecord = {
164
- /** Provider or runtime tool-call id when one is available. */
165
- id?: string;
356
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
357
+ }, z.core.$strict>], "status">;
358
+ type ToolCallBase = {
166
359
  /** Tool name as exposed to the agent or application runtime. */
167
360
  name: string;
168
361
  /** JSON-safe tool arguments after provider/runtime normalization. */
169
362
  arguments?: Record<string, JsonValue>;
170
- /** JSON-safe tool result returned by the application tool. */
171
- result?: JsonValue;
172
- /** Normalized tool error when execution failed. */
173
- error?: NormalizedError;
174
- /** ISO timestamp for the start of tool execution. */
175
- startedAt?: string;
176
- /** ISO timestamp for the end of tool execution. */
177
- finishedAt?: string;
178
- /** Tool execution duration in milliseconds. */
179
- durationMs?: number;
180
- /** Extra JSON-safe tool metadata for reporters and custom judges. */
181
- metadata?: Record<string, JsonValue>;
182
363
  };
183
- /** Normalized transcript message captured in a harness session. */
184
- declare const NormalizedMessageSchema: z.ZodObject<{
185
- role: z.ZodEnum<{
186
- system: "system";
187
- user: "user";
188
- assistant: "assistant";
189
- tool: "tool";
190
- }>;
191
- content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
192
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
193
- id: z.ZodOptional<z.ZodString>;
364
+ /** Tool call observed in a normalized session, with result status when known. */
365
+ type ToolCall = (ToolCallBase & {
366
+ /** Lifecycle status for a tool call without a matching result event. */
367
+ status: "pending";
368
+ }) | (ToolCallBase & {
369
+ /** Lifecycle status for a tool call with a successful result event. */
370
+ status: "ok";
371
+ /** JSON-safe tool result content when execution produced content. */
372
+ result?: JsonValue;
373
+ }) | (ToolCallBase & {
374
+ /** Lifecycle status for a tool call with an error result event. */
375
+ status: "error";
376
+ /** Normalized tool error captured by the result event. */
377
+ error: NormalizedError;
378
+ });
379
+ /** Normalized transcript produced by an application harness. */
380
+ declare const NormalizedSessionSchema: z.ZodObject<{
381
+ events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
382
+ type: z.ZodLiteral<"message">;
383
+ role: z.ZodEnum<{
384
+ system: "system";
385
+ user: "user";
386
+ assistant: "assistant";
387
+ }>;
388
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
389
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
390
+ }, z.core.$strict>, z.ZodObject<{
391
+ type: z.ZodLiteral<"tool_call">;
392
+ id: z.ZodString;
194
393
  name: z.ZodString;
195
394
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
196
- result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
395
+ startedAt: z.ZodOptional<z.ZodString>;
396
+ finishedAt: z.ZodOptional<z.ZodString>;
397
+ durationMs: z.ZodOptional<z.ZodNumber>;
398
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
399
+ }, z.core.$strict>, z.ZodObject<{
400
+ type: z.ZodLiteral<"tool_result">;
401
+ toolCallId: z.ZodString;
402
+ name: z.ZodOptional<z.ZodString>;
403
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
197
404
  error: z.ZodOptional<z.ZodObject<{
198
405
  message: z.ZodString;
199
406
  type: z.ZodOptional<z.ZodString>;
@@ -202,54 +409,15 @@ declare const NormalizedMessageSchema: z.ZodObject<{
202
409
  finishedAt: z.ZodOptional<z.ZodString>;
203
410
  durationMs: z.ZodOptional<z.ZodNumber>;
204
411
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
205
- }, z.core.$strict>>>;
206
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
207
- }, z.core.$strict>;
208
- /** Normalized transcript message captured in a harness session. */
209
- type NormalizedMessage = {
210
- /** Transcript role for the normalized message. */
211
- role: "system" | "user" | "assistant" | "tool";
212
- /** JSON-safe message content. */
213
- content?: JsonValue;
214
- /** Tool calls associated with this message. */
215
- toolCalls?: ToolCallRecord[];
216
- /** Extra JSON-safe message metadata. */
217
- metadata?: Record<string, JsonValue>;
218
- };
219
- /** Normalized transcript produced by an application harness. */
220
- declare const NormalizedSessionSchema: z.ZodObject<{
221
- messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
222
- role: z.ZodEnum<{
223
- system: "system";
224
- user: "user";
225
- assistant: "assistant";
226
- tool: "tool";
227
- }>;
228
- content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
229
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
- id: z.ZodOptional<z.ZodString>;
231
- name: z.ZodString;
232
- arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
233
- result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
234
- error: z.ZodOptional<z.ZodObject<{
235
- message: z.ZodString;
236
- type: z.ZodOptional<z.ZodString>;
237
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
238
- startedAt: z.ZodOptional<z.ZodString>;
239
- finishedAt: z.ZodOptional<z.ZodString>;
240
- durationMs: z.ZodOptional<z.ZodNumber>;
241
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
242
- }, z.core.$strict>>>;
243
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
244
- }, z.core.$strict>>>;
412
+ }, z.core.$strict>], "type">>;
245
413
  provider: z.ZodOptional<z.ZodString>;
246
414
  model: z.ZodOptional<z.ZodString>;
247
415
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
248
416
  }, z.core.$strict>;
249
417
  /** Normalized transcript produced by an application harness. */
250
418
  type NormalizedSession = {
251
- /** Ordered normalized transcript messages. */
252
- messages: NormalizedMessage[];
419
+ /** Ordered normalized transcript events. */
420
+ events: TranscriptEvent[];
253
421
  /** Provider that produced the session when known. */
254
422
  provider?: string;
255
423
  /** Model that produced the session when known. */
@@ -282,8 +450,8 @@ declare const NormalizedSpanSchema: z.ZodObject<{
282
450
  name: z.ZodString;
283
451
  kind: z.ZodOptional<z.ZodEnum<{
284
452
  custom: "custom";
285
- model: "model";
286
453
  tool: "tool";
454
+ model: "model";
287
455
  run: "run";
288
456
  agent: "agent";
289
457
  guardrail: "guardrail";
@@ -342,15 +510,15 @@ declare const NormalizedTraceSchema: z.ZodObject<{
342
510
  finishedAt: z.ZodOptional<z.ZodString>;
343
511
  durationMs: z.ZodOptional<z.ZodNumber>;
344
512
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
345
- spans: z.ZodDefault<z.ZodArray<z.ZodObject<{
513
+ spans: z.ZodArray<z.ZodObject<{
346
514
  id: z.ZodOptional<z.ZodString>;
347
515
  traceId: z.ZodOptional<z.ZodString>;
348
516
  parentId: z.ZodOptional<z.ZodString>;
349
517
  name: z.ZodString;
350
518
  kind: z.ZodOptional<z.ZodEnum<{
351
519
  custom: "custom";
352
- model: "model";
353
520
  tool: "tool";
521
+ model: "model";
354
522
  run: "run";
355
523
  agent: "agent";
356
524
  guardrail: "guardrail";
@@ -373,7 +541,7 @@ declare const NormalizedTraceSchema: z.ZodObject<{
373
541
  timestamp: z.ZodOptional<z.ZodString>;
374
542
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
375
543
  }, z.core.$strict>>>;
376
- }, z.core.$strict>>>;
544
+ }, z.core.$strict>>;
377
545
  }, z.core.$strict>;
378
546
  /** Normalized trace captured during a harness run. */
379
547
  type NormalizedTrace = {
@@ -396,30 +564,38 @@ type NormalizedTrace = {
396
564
  declare const HarnessRunSchema: z.ZodObject<{
397
565
  output: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
398
566
  session: z.ZodObject<{
399
- messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
567
+ events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
568
+ type: z.ZodLiteral<"message">;
400
569
  role: z.ZodEnum<{
401
570
  system: "system";
402
571
  user: "user";
403
572
  assistant: "assistant";
404
- tool: "tool";
405
573
  }>;
406
574
  content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
407
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
408
- id: z.ZodOptional<z.ZodString>;
409
- name: z.ZodString;
410
- arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
411
- result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
412
- error: z.ZodOptional<z.ZodObject<{
413
- message: z.ZodString;
414
- type: z.ZodOptional<z.ZodString>;
415
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
416
- startedAt: z.ZodOptional<z.ZodString>;
417
- finishedAt: z.ZodOptional<z.ZodString>;
418
- durationMs: z.ZodOptional<z.ZodNumber>;
419
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
420
- }, z.core.$strict>>>;
421
575
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
422
- }, z.core.$strict>>>;
576
+ }, z.core.$strict>, z.ZodObject<{
577
+ type: z.ZodLiteral<"tool_call">;
578
+ id: z.ZodString;
579
+ name: z.ZodString;
580
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
581
+ startedAt: z.ZodOptional<z.ZodString>;
582
+ finishedAt: z.ZodOptional<z.ZodString>;
583
+ durationMs: z.ZodOptional<z.ZodNumber>;
584
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
585
+ }, z.core.$strict>, z.ZodObject<{
586
+ type: z.ZodLiteral<"tool_result">;
587
+ toolCallId: z.ZodString;
588
+ name: z.ZodOptional<z.ZodString>;
589
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
590
+ error: z.ZodOptional<z.ZodObject<{
591
+ message: z.ZodString;
592
+ type: z.ZodOptional<z.ZodString>;
593
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
594
+ startedAt: z.ZodOptional<z.ZodString>;
595
+ finishedAt: z.ZodOptional<z.ZodString>;
596
+ durationMs: z.ZodOptional<z.ZodNumber>;
597
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
598
+ }, z.core.$strict>], "type">>;
423
599
  provider: z.ZodOptional<z.ZodString>;
424
600
  model: z.ZodOptional<z.ZodString>;
425
601
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
@@ -447,15 +623,15 @@ declare const HarnessRunSchema: z.ZodObject<{
447
623
  finishedAt: z.ZodOptional<z.ZodString>;
448
624
  durationMs: z.ZodOptional<z.ZodNumber>;
449
625
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
450
- spans: z.ZodDefault<z.ZodArray<z.ZodObject<{
626
+ spans: z.ZodArray<z.ZodObject<{
451
627
  id: z.ZodOptional<z.ZodString>;
452
628
  traceId: z.ZodOptional<z.ZodString>;
453
629
  parentId: z.ZodOptional<z.ZodString>;
454
630
  name: z.ZodString;
455
631
  kind: z.ZodOptional<z.ZodEnum<{
456
632
  custom: "custom";
457
- model: "model";
458
633
  tool: "tool";
634
+ model: "model";
459
635
  run: "run";
460
636
  agent: "agent";
461
637
  guardrail: "guardrail";
@@ -478,9 +654,9 @@ declare const HarnessRunSchema: z.ZodObject<{
478
654
  timestamp: z.ZodOptional<z.ZodString>;
479
655
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
480
656
  }, z.core.$strict>>>;
481
- }, z.core.$strict>>>;
657
+ }, z.core.$strict>>;
482
658
  }, z.core.$strict>>>;
483
- errors: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
659
+ errors: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
484
660
  }, z.core.$strict>;
485
661
  type OutputField<TOutput extends JsonValue | undefined> = undefined extends TOutput ? {
486
662
  output?: TOutput;
@@ -495,9 +671,9 @@ type OutputField<TOutput extends JsonValue | undefined> = undefined extends TOut
495
671
  * const run: HarnessRun<{ status: "approved" }> = {
496
672
  * output: { status: "approved" },
497
673
  * session: {
498
- * messages: [
499
- * { role: "user", content: "Refund invoice inv_123" },
500
- * { role: "assistant", content: { status: "approved" } },
674
+ * events: [
675
+ * { type: "message", role: "user", content: "Refund invoice inv_123" },
676
+ * { type: "message", role: "assistant", content: { status: "approved" } },
501
677
  * ],
502
678
  * },
503
679
  * usage: { totalTokens: 260 },
@@ -526,22 +702,26 @@ type HarnessRunError = Error & {
526
702
  };
527
703
 
528
704
  /**
529
- * Flattens every recorded tool call from a normalized session.
705
+ * Returns every tool call observed in a normalized run or session.
706
+ *
707
+ * Tool results are joined from matching `tool_result` transcript events when
708
+ * the transcript contains a result for the call.
530
709
  *
531
- * @param session - Normalized session produced by a harness run.
710
+ * @param source - Normalized run or session produced by a harness.
532
711
  *
533
712
  * @example
534
713
  * ```ts
535
- * const names = toolCalls(result.session).map((call) => call.name);
714
+ * const names = toolCalls(result).map((call) => call.name);
536
715
  *
537
716
  * expect(names).toEqual(["lookupInvoice", "createRefund"]);
538
717
  * ```
539
718
  */
540
- declare function toolCalls(session: NormalizedSession): ToolCallRecord[];
719
+ declare function toolCalls(run: HarnessRun): ToolCall[];
720
+ declare function toolCalls(session: NormalizedSession): ToolCall[];
541
721
  /**
542
- * Flattens every recorded span from a normalized harness run.
722
+ * Flattens every recorded span from a normalized harness run or trace list.
543
723
  *
544
- * @param run - Normalized harness run produced by a harness.
724
+ * @param source - Normalized run or trace list produced by a harness.
545
725
  *
546
726
  * @example
547
727
  * ```ts
@@ -549,94 +729,104 @@ declare function toolCalls(session: NormalizedSession): ToolCallRecord[];
549
729
  * ```
550
730
  */
551
731
  declare function spans(run: HarnessRun): NormalizedSpan[];
732
+ declare function spans(traces: readonly NormalizedTrace[] | undefined): NormalizedSpan[];
552
733
  /**
553
734
  * Alias for `spans(...)` for consumers that prefer trace-oriented naming.
554
735
  *
555
- * @param run - Normalized harness run produced by a harness.
736
+ * @param source - Normalized run or trace list produced by a harness.
556
737
  */
557
738
  declare function traceSpans(run: HarnessRun): NormalizedSpan[];
739
+ declare function traceSpans(traces: readonly NormalizedTrace[] | undefined): NormalizedSpan[];
558
740
  /**
559
- * Returns spans of one coarse operation kind from a normalized run.
741
+ * Returns spans of one coarse operation kind from a normalized run or trace list.
560
742
  *
561
- * @param run - Normalized harness run produced by a harness.
743
+ * @param source - Normalized run or trace list produced by a harness.
562
744
  * @param kind - Span kind to keep.
563
745
  */
564
746
  declare function spansByKind(run: HarnessRun, kind: NonNullable<NormalizedSpan["kind"]>): NormalizedSpan[];
747
+ declare function spansByKind(traces: readonly NormalizedTrace[] | undefined, kind: NonNullable<NormalizedSpan["kind"]>): NormalizedSpan[];
565
748
  /**
566
749
  * Returns every span that explicitly failed or carries a normalized error.
567
750
  *
568
- * @param run - Normalized harness run produced by a harness.
751
+ * @param source - Normalized run or trace list produced by a harness.
569
752
  */
570
753
  declare function failedSpans(run: HarnessRun): NormalizedSpan[];
754
+ declare function failedSpans(traces: readonly NormalizedTrace[] | undefined): NormalizedSpan[];
571
755
  /**
572
- * Filters normalized session messages by role.
756
+ * Filters normalized session message events by role.
573
757
  *
574
- * @param session - Normalized session produced by a harness run.
758
+ * @param source - Normalized run or session produced by a harness.
575
759
  * @param role - Message role to keep.
576
760
  *
577
761
  * @example
578
762
  * ```ts
579
- * const assistantText = messagesByRole(result.session, "assistant")
763
+ * const assistantText = messagesByRole(result, "assistant")
580
764
  * .map((message) => message.content)
581
765
  * .join("\n");
582
766
  * ```
583
767
  */
584
- declare function messagesByRole(session: NormalizedSession, role: NormalizedMessage["role"]): NormalizedMessage[];
768
+ declare function messagesByRole(run: HarnessRun, role: TranscriptMessageEvent["role"]): TranscriptMessageEvent[];
769
+ declare function messagesByRole(session: NormalizedSession, role: TranscriptMessageEvent["role"]): TranscriptMessageEvent[];
585
770
  /**
586
- * Returns every normalized system message from a session.
771
+ * Returns every normalized system message event from a session.
587
772
  *
588
- * @param session - Normalized session produced by a harness run.
773
+ * @param source - Normalized run or session produced by a harness.
589
774
  *
590
775
  * @example
591
776
  * ```ts
592
- * const systemPrompts = systemMessages(result.session);
777
+ * const systemPrompts = systemMessages(result);
593
778
  * ```
594
779
  */
595
- declare function systemMessages(session: NormalizedSession): NormalizedMessage[];
780
+ declare function systemMessages(run: HarnessRun): TranscriptMessageEvent[];
781
+ declare function systemMessages(session: NormalizedSession): TranscriptMessageEvent[];
596
782
  /**
597
- * Returns every normalized user message from a session.
783
+ * Returns every normalized user message event from a session.
598
784
  *
599
- * @param session - Normalized session produced by a harness run.
785
+ * @param source - Normalized run or session produced by a harness.
600
786
  *
601
787
  * @example
602
788
  * ```ts
603
- * const firstPrompt = userMessages(result.session)[0]?.content;
789
+ * const firstPrompt = userMessages(result)[0]?.content;
604
790
  * ```
605
791
  */
606
- declare function userMessages(session: NormalizedSession): NormalizedMessage[];
792
+ declare function userMessages(run: HarnessRun): TranscriptMessageEvent[];
793
+ declare function userMessages(session: NormalizedSession): TranscriptMessageEvent[];
607
794
  /**
608
- * Returns every normalized assistant message from a session.
795
+ * Returns every normalized assistant message event from a session.
609
796
  *
610
- * @param session - Normalized session produced by a harness run.
797
+ * @param source - Normalized run or session produced by a harness.
611
798
  *
612
799
  * @example
613
800
  * ```ts
614
- * const finalAnswer = assistantMessages(session).at(-1)?.content;
801
+ * const finalAnswer = assistantMessages(result).at(-1)?.content;
615
802
  * ```
616
803
  */
617
- declare function assistantMessages(session: NormalizedSession): NormalizedMessage[];
804
+ declare function assistantMessages(run: HarnessRun): TranscriptMessageEvent[];
805
+ declare function assistantMessages(session: NormalizedSession): TranscriptMessageEvent[];
618
806
  /**
619
807
  * Returns the latest assistant message content, ignoring empty text messages.
620
808
  *
621
- * @param session - Normalized session produced by a harness run.
809
+ * @param source - Normalized run or session produced by a harness.
622
810
  *
623
811
  * @example
624
812
  * ```ts
625
- * const finalAnswer = latestAssistantMessageContent(result.session);
813
+ * const finalAnswer = latestAssistantMessageContent(result);
626
814
  * ```
627
815
  */
816
+ declare function latestAssistantMessageContent(run: HarnessRun): JsonValue | undefined;
628
817
  declare function latestAssistantMessageContent(session: NormalizedSession): JsonValue | undefined;
629
818
  /**
630
- * Returns every normalized tool message from a session.
819
+ * Returns every normalized tool-result event from a session.
631
820
  *
632
- * @param session - Normalized session produced by a harness run.
821
+ * @param source - Normalized run or session produced by a harness.
633
822
  *
634
823
  * @example
635
824
  * ```ts
636
- * const toolOutputs = toolMessages(session).map((message) => message.content);
825
+ * const toolOutputs = toolMessages(result).map((message) => message.content);
637
826
  * ```
638
827
  */
639
- declare function toolMessages(session: NormalizedSession): NormalizedMessage[];
828
+ declare function toolMessages(run: HarnessRun): TranscriptToolResultEvent[];
829
+ declare function toolMessages(session: NormalizedSession): TranscriptToolResultEvent[];
640
830
 
641
831
  /** Harness metadata stored by vitest-evals on Vitest task metadata. */
642
832
  declare const HarnessMetaSchema: z.ZodObject<{
@@ -644,30 +834,38 @@ declare const HarnessMetaSchema: z.ZodObject<{
644
834
  run: z.ZodOptional<z.ZodObject<{
645
835
  output: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
646
836
  session: z.ZodObject<{
647
- messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
837
+ events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
838
+ type: z.ZodLiteral<"message">;
648
839
  role: z.ZodEnum<{
649
840
  system: "system";
650
841
  user: "user";
651
842
  assistant: "assistant";
652
- tool: "tool";
653
843
  }>;
654
844
  content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
655
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
656
- id: z.ZodOptional<z.ZodString>;
657
- name: z.ZodString;
658
- arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
659
- result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
660
- error: z.ZodOptional<z.ZodObject<{
661
- message: z.ZodString;
662
- type: z.ZodOptional<z.ZodString>;
663
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
664
- startedAt: z.ZodOptional<z.ZodString>;
665
- finishedAt: z.ZodOptional<z.ZodString>;
666
- durationMs: z.ZodOptional<z.ZodNumber>;
667
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
668
- }, z.core.$strict>>>;
669
845
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
670
- }, z.core.$strict>>>;
846
+ }, z.core.$strict>, z.ZodObject<{
847
+ type: z.ZodLiteral<"tool_call">;
848
+ id: z.ZodString;
849
+ name: z.ZodString;
850
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
851
+ startedAt: z.ZodOptional<z.ZodString>;
852
+ finishedAt: z.ZodOptional<z.ZodString>;
853
+ durationMs: z.ZodOptional<z.ZodNumber>;
854
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
855
+ }, z.core.$strict>, z.ZodObject<{
856
+ type: z.ZodLiteral<"tool_result">;
857
+ toolCallId: z.ZodString;
858
+ name: z.ZodOptional<z.ZodString>;
859
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
860
+ error: z.ZodOptional<z.ZodObject<{
861
+ message: z.ZodString;
862
+ type: z.ZodOptional<z.ZodString>;
863
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
864
+ startedAt: z.ZodOptional<z.ZodString>;
865
+ finishedAt: z.ZodOptional<z.ZodString>;
866
+ durationMs: z.ZodOptional<z.ZodNumber>;
867
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
868
+ }, z.core.$strict>], "type">>;
671
869
  provider: z.ZodOptional<z.ZodString>;
672
870
  model: z.ZodOptional<z.ZodString>;
673
871
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
@@ -695,15 +893,15 @@ declare const HarnessMetaSchema: z.ZodObject<{
695
893
  finishedAt: z.ZodOptional<z.ZodString>;
696
894
  durationMs: z.ZodOptional<z.ZodNumber>;
697
895
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
698
- spans: z.ZodDefault<z.ZodArray<z.ZodObject<{
896
+ spans: z.ZodArray<z.ZodObject<{
699
897
  id: z.ZodOptional<z.ZodString>;
700
898
  traceId: z.ZodOptional<z.ZodString>;
701
899
  parentId: z.ZodOptional<z.ZodString>;
702
900
  name: z.ZodString;
703
901
  kind: z.ZodOptional<z.ZodEnum<{
704
902
  custom: "custom";
705
- model: "model";
706
903
  tool: "tool";
904
+ model: "model";
707
905
  run: "run";
708
906
  agent: "agent";
709
907
  guardrail: "guardrail";
@@ -726,9 +924,9 @@ declare const HarnessMetaSchema: z.ZodObject<{
726
924
  timestamp: z.ZodOptional<z.ZodString>;
727
925
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
728
926
  }, z.core.$strict>>>;
729
- }, z.core.$strict>>>;
927
+ }, z.core.$strict>>;
730
928
  }, z.core.$strict>>>;
731
- errors: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
929
+ errors: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
732
930
  }, z.core.$strict>>;
733
931
  }, z.core.$strict>;
734
932
  /** Harness metadata stored by vitest-evals on Vitest task metadata. */
@@ -751,20 +949,24 @@ declare const EvalMetaSchema: z.ZodObject<{
751
949
  avgScore: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
752
950
  output: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
753
951
  thresholdFailed: z.ZodOptional<z.ZodBoolean>;
754
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
755
- id: z.ZodOptional<z.ZodString>;
952
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
756
953
  name: z.ZodString;
757
954
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
955
+ status: z.ZodLiteral<"pending">;
956
+ }, z.core.$strict>, z.ZodObject<{
957
+ name: z.ZodString;
958
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
959
+ status: z.ZodLiteral<"ok">;
758
960
  result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
759
- error: z.ZodOptional<z.ZodObject<{
961
+ }, z.core.$strict>, z.ZodObject<{
962
+ name: z.ZodString;
963
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
964
+ status: z.ZodLiteral<"error">;
965
+ error: z.ZodObject<{
760
966
  message: z.ZodString;
761
967
  type: z.ZodOptional<z.ZodString>;
762
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
763
- startedAt: z.ZodOptional<z.ZodString>;
764
- finishedAt: z.ZodOptional<z.ZodString>;
765
- durationMs: z.ZodOptional<z.ZodNumber>;
766
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
767
- }, z.core.$strict>>>;
968
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
969
+ }, z.core.$strict>], "status">>>;
768
970
  }, z.core.$strict>;
769
971
  /** Eval metadata stored by vitest-evals on Vitest task metadata. */
770
972
  type EvalMeta = z.infer<typeof EvalMetaSchema>;
@@ -779,50 +981,62 @@ declare const EvalTaskMetaSchema: z.ZodObject<{
779
981
  avgScore: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
780
982
  output: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
781
983
  thresholdFailed: z.ZodOptional<z.ZodBoolean>;
782
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
783
- id: z.ZodOptional<z.ZodString>;
984
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
784
985
  name: z.ZodString;
785
986
  arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
987
+ status: z.ZodLiteral<"pending">;
988
+ }, z.core.$strict>, z.ZodObject<{
989
+ name: z.ZodString;
990
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
991
+ status: z.ZodLiteral<"ok">;
786
992
  result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
787
- error: z.ZodOptional<z.ZodObject<{
993
+ }, z.core.$strict>, z.ZodObject<{
994
+ name: z.ZodString;
995
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
996
+ status: z.ZodLiteral<"error">;
997
+ error: z.ZodObject<{
788
998
  message: z.ZodString;
789
999
  type: z.ZodOptional<z.ZodString>;
790
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
791
- startedAt: z.ZodOptional<z.ZodString>;
792
- finishedAt: z.ZodOptional<z.ZodString>;
793
- durationMs: z.ZodOptional<z.ZodNumber>;
794
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
795
- }, z.core.$strict>>>;
1000
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
1001
+ }, z.core.$strict>], "status">>>;
796
1002
  }, z.core.$strict>>;
797
1003
  harness: z.ZodOptional<z.ZodObject<{
798
1004
  name: z.ZodOptional<z.ZodString>;
799
1005
  run: z.ZodOptional<z.ZodObject<{
800
1006
  output: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
801
1007
  session: z.ZodObject<{
802
- messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
1008
+ events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1009
+ type: z.ZodLiteral<"message">;
803
1010
  role: z.ZodEnum<{
804
1011
  system: "system";
805
1012
  user: "user";
806
1013
  assistant: "assistant";
807
- tool: "tool";
808
1014
  }>;
809
1015
  content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
810
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
811
- id: z.ZodOptional<z.ZodString>;
812
- name: z.ZodString;
813
- arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
814
- result: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
815
- error: z.ZodOptional<z.ZodObject<{
816
- message: z.ZodString;
817
- type: z.ZodOptional<z.ZodString>;
818
- }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
819
- startedAt: z.ZodOptional<z.ZodString>;
820
- finishedAt: z.ZodOptional<z.ZodString>;
821
- durationMs: z.ZodOptional<z.ZodNumber>;
822
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
823
- }, z.core.$strict>>>;
824
1016
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
825
- }, z.core.$strict>>>;
1017
+ }, z.core.$strict>, z.ZodObject<{
1018
+ type: z.ZodLiteral<"tool_call">;
1019
+ id: z.ZodString;
1020
+ name: z.ZodString;
1021
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
1022
+ startedAt: z.ZodOptional<z.ZodString>;
1023
+ finishedAt: z.ZodOptional<z.ZodString>;
1024
+ durationMs: z.ZodOptional<z.ZodNumber>;
1025
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
1026
+ }, z.core.$strict>, z.ZodObject<{
1027
+ type: z.ZodLiteral<"tool_result">;
1028
+ toolCallId: z.ZodString;
1029
+ name: z.ZodOptional<z.ZodString>;
1030
+ content: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1031
+ error: z.ZodOptional<z.ZodObject<{
1032
+ message: z.ZodString;
1033
+ type: z.ZodOptional<z.ZodString>;
1034
+ }, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
1035
+ startedAt: z.ZodOptional<z.ZodString>;
1036
+ finishedAt: z.ZodOptional<z.ZodString>;
1037
+ durationMs: z.ZodOptional<z.ZodNumber>;
1038
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
1039
+ }, z.core.$strict>], "type">>;
826
1040
  provider: z.ZodOptional<z.ZodString>;
827
1041
  model: z.ZodOptional<z.ZodString>;
828
1042
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
@@ -850,15 +1064,15 @@ declare const EvalTaskMetaSchema: z.ZodObject<{
850
1064
  finishedAt: z.ZodOptional<z.ZodString>;
851
1065
  durationMs: z.ZodOptional<z.ZodNumber>;
852
1066
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
853
- spans: z.ZodDefault<z.ZodArray<z.ZodObject<{
1067
+ spans: z.ZodArray<z.ZodObject<{
854
1068
  id: z.ZodOptional<z.ZodString>;
855
1069
  traceId: z.ZodOptional<z.ZodString>;
856
1070
  parentId: z.ZodOptional<z.ZodString>;
857
1071
  name: z.ZodString;
858
1072
  kind: z.ZodOptional<z.ZodEnum<{
859
1073
  custom: "custom";
860
- model: "model";
861
1074
  tool: "tool";
1075
+ model: "model";
862
1076
  run: "run";
863
1077
  agent: "agent";
864
1078
  guardrail: "guardrail";
@@ -881,9 +1095,9 @@ declare const EvalTaskMetaSchema: z.ZodObject<{
881
1095
  timestamp: z.ZodOptional<z.ZodString>;
882
1096
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
883
1097
  }, z.core.$strict>>>;
884
- }, z.core.$strict>>>;
1098
+ }, z.core.$strict>>;
885
1099
  }, z.core.$strict>>>;
886
- errors: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
1100
+ errors: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
887
1101
  }, z.core.$strict>>;
888
1102
  }, z.core.$strict>>;
889
1103
  }, z.core.$strict>;
@@ -892,4 +1106,4 @@ type EvalTaskMeta = z.infer<typeof EvalTaskMetaSchema>;
892
1106
  /** Reads eval metadata from an arbitrary Vitest assertion meta value. */
893
1107
  declare function readEvalTaskMeta(input: unknown): EvalTaskMeta | undefined;
894
1108
 
895
- export { type EvalMeta, EvalMetaSchema, type EvalScore, EvalScoreSchema, type EvalTaskMeta, EvalTaskMetaSchema, type GenAiOperationName, type GenAiOutputType, type GenAiProviderName, type GenAiSemanticAttributeKey, type GenAiSemanticAttributes, type GenAiTokenType, type GenAiToolType, type HarnessMeta, HarnessMetaSchema, type HarnessRun, type HarnessRunError, HarnessRunSchema, JsonValue, type NormalizedError, NormalizedErrorSchema, type NormalizedMessage, NormalizedMessageSchema, type NormalizedSession, NormalizedSessionSchema, type NormalizedSpan, type NormalizedSpanAttributeKey, type NormalizedSpanAttributes, NormalizedSpanAttributesSchema, type NormalizedSpanEvent, NormalizedSpanEventSchema, NormalizedSpanSchema, type NormalizedTrace, NormalizedTraceSchema, type OpenTelemetrySemanticAttributeKey, type OpenTelemetrySemanticAttributes, type TimingSummary, TimingSummarySchema, type ToolCallRecord, ToolCallRecordSchema, type UsageSummary, UsageSummarySchema, assistantMessages, failedSpans, latestAssistantMessageContent, messagesByRole, readEvalTaskMeta, spans, spansByKind, systemMessages, toolCalls, toolMessages, traceSpans, userMessages };
1109
+ export { type EvalMeta, EvalMetaSchema, type EvalScore, EvalScoreSchema, type EvalTaskMeta, EvalTaskMetaSchema, type GenAiOperationName, type GenAiOutputType, type GenAiProviderName, type GenAiSemanticAttributeKey, type GenAiSemanticAttributes, type GenAiTokenType, type GenAiToolType, type HarnessMeta, HarnessMetaSchema, type HarnessRun, type HarnessRunError, HarnessRunSchema, JsonValue, type NormalizedError, NormalizedErrorSchema, type NormalizedSession, NormalizedSessionSchema, type NormalizedSpan, type NormalizedSpanAttributeKey, type NormalizedSpanAttributes, NormalizedSpanAttributesSchema, type NormalizedSpanEvent, NormalizedSpanEventSchema, NormalizedSpanSchema, type NormalizedTrace, NormalizedTraceSchema, type OpenTelemetrySemanticAttributeKey, type OpenTelemetrySemanticAttributes, type TimingSummary, TimingSummarySchema, type ToolCall, ToolCallSchema, type TranscriptEvent, TranscriptEventSchema, type TranscriptMessageContentPart, type TranscriptMessageEvent, TranscriptMessageEventSchema, type TranscriptMessageInput, type TranscriptMessageTextPart, type TranscriptMessageToolCall, type TranscriptMessageToolCallPart, type TranscriptMessageToolResultPart, type TranscriptToolCallEvent, TranscriptToolCallEventSchema, type TranscriptToolResultEvent, TranscriptToolResultEventSchema, type UsageSummary, UsageSummarySchema, assistantMessages, failedSpans, isMessageEvent, isToolCallEvent, isToolResultEvent, latestAssistantMessageContent, messagesByRole, messagesToTranscriptEvents, readEvalTaskMeta, spans, spansByKind, systemMessages, toolCalls, toolMessages, traceSpans, userMessages };