@kortyx/agent 0.27.0 → 0.29.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,2279 @@
1
+ import { GetProviderFn, ProviderModelRef } from '@kortyx/providers';
2
+ import { z } from 'zod';
3
+ import { KortyxError, FailureDescriptor } from '@kortyx/core/errors';
4
+ import { FinalizedChatMessage, StreamChunk } from '@kortyx/stream';
5
+ import { WorkflowDefinition, ExecutionLimits, TokenUsage, ExecutionLimitReached } from '@kortyx/core';
6
+ import { PendingRequestRecord, PendingRequestStore, CheckpointSummary, CheckpointId, SessionCheckpointRecord, RollbackSessionCheckpointResult, ForkSessionCheckpointResult, WorkflowRegistry, FrameworkAdapter, ExecutionRuntimeConfig } from '@kortyx/runtime';
7
+ import { KortyxTelemetryConfig, EnsureWorkflowTopologyRequest } from '@kortyx/hooks';
8
+ import { C as ChatMessage } from './chat-message-D4EsFcr1.js';
9
+
10
+ type ChatResponseStatus = "completed" | "failed" | "cancelled" | "interrupted";
11
+ type ChatResponseFinalized = {
12
+ sessionId: string;
13
+ runId: string;
14
+ clientTurnId: string;
15
+ status: ChatResponseStatus;
16
+ message: FinalizedChatMessage;
17
+ checkpointId?: string;
18
+ };
19
+ type ChatLifecyclePhase = "turn-accepted" | "response-finalized" | "forked" | "rolled-back";
20
+ declare class ChatLifecycleHookError extends KortyxError {
21
+ readonly phase: ChatLifecyclePhase;
22
+ constructor(phase: ChatLifecyclePhase, cause: unknown);
23
+ }
24
+
25
+ type ExecutableWorkflow = WorkflowDefinition & {
26
+ inputSchema: z.ZodType;
27
+ outputSchema: z.ZodType<Record<string, unknown>>;
28
+ };
29
+ /** Serializable identity of a waiting request. Treat tokens as private credentials. */
30
+ type ResumeHandle = {
31
+ token: string;
32
+ requestId: string;
33
+ sessionId: string;
34
+ runId: string;
35
+ };
36
+ type ResumeResponse = {
37
+ type: "text";
38
+ text: string;
39
+ } | {
40
+ type: "select";
41
+ ids: string[];
42
+ } | {
43
+ type: "value";
44
+ value: unknown;
45
+ } | {
46
+ type: "cancel";
47
+ };
48
+ type ExecutionInterrupt = {
49
+ workflow: string;
50
+ node: string;
51
+ input: PendingRequestRecord["schema"] & {
52
+ options: Array<{
53
+ id: string;
54
+ label: string;
55
+ description?: string | undefined;
56
+ }>;
57
+ };
58
+ };
59
+ type ExecutionInfo = {
60
+ runId: string;
61
+ sessionId: string;
62
+ checkpointId?: string;
63
+ usage?: TokenUsage;
64
+ };
65
+ type ExecutionResult<T = Record<string, unknown>> = ExecutionInfo & ({
66
+ status: "completed";
67
+ data: T;
68
+ } | {
69
+ status: "suspended";
70
+ reason?: "limit_reached";
71
+ limit?: ExecutionLimitReached;
72
+ interrupt: ExecutionInterrupt;
73
+ resume: ResumeHandle;
74
+ } | {
75
+ status: "cancelled";
76
+ reason: string;
77
+ } | {
78
+ status: "failed";
79
+ error: Pick<FailureDescriptor, "code" | "message"> & Partial<FailureDescriptor>;
80
+ });
81
+ type ExecuteOptions<W extends ExecutableWorkflow> = {
82
+ limits?: ExecutionLimits;
83
+ abortSignal?: AbortSignal;
84
+ workflow: W;
85
+ input: z.input<W["inputSchema"]>;
86
+ sessionId?: string;
87
+ context?: Record<string, unknown>;
88
+ };
89
+ type ResumeOptions<W extends ExecutableWorkflow> = {
90
+ limits?: ExecutionLimits;
91
+ abortSignal?: AbortSignal;
92
+ workflow: W;
93
+ resume: ResumeHandle;
94
+ response: ResumeResponse;
95
+ };
96
+ /** The command was rejected before starting work or claiming an interrupt. */
97
+ declare class ExecutionRequestError extends KortyxError {
98
+ name: string;
99
+ constructor(code: string, message: string, cause?: unknown);
100
+ }
101
+
102
+ declare const scopeSchema: z.ZodObject<{
103
+ sessionId: z.ZodOptional<z.ZodString>;
104
+ runId: z.ZodOptional<z.ZodString>;
105
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
106
+ }, z.core.$strict>;
107
+ type InterruptScope = z.input<typeof scopeSchema>;
108
+ type ListInterruptsOptions = InterruptScope & {
109
+ status?: "pending";
110
+ afterResponseCompleted?: boolean;
111
+ };
112
+ type PendingInterrupt = {
113
+ id: string;
114
+ status: "pending";
115
+ runId: string;
116
+ sessionId: string;
117
+ workflow: string;
118
+ node: string;
119
+ createdAt: string;
120
+ expiresAt: string;
121
+ afterResponseCompleted: boolean;
122
+ input: Omit<PendingRequestRecord["schema"], "meta"> & {
123
+ options: Array<{
124
+ id: string;
125
+ label: string;
126
+ description?: string;
127
+ }>;
128
+ };
129
+ };
130
+ type ResumableInterrupt = PendingInterrupt & {
131
+ resume: ResumeHandle;
132
+ };
133
+ declare function createInterruptDiscovery(store: PendingRequestStore): {
134
+ listInterrupts(options: ListInterruptsOptions): Promise<PendingInterrupt[]>;
135
+ getInterrupt(id: string, scope: InterruptScope): Promise<ResumableInterrupt | null>;
136
+ };
137
+
138
+ /** Produces the topology-only, deterministic Contract A snapshot. */
139
+ declare const projectWorkflowTopology: (args: {
140
+ workflow: WorkflowDefinition;
141
+ environment: string;
142
+ service: NonNullable<KortyxTelemetryConfig["service"]>;
143
+ knownWorkflowIds?: readonly string[] | undefined;
144
+ }) => EnsureWorkflowTopologyRequest;
145
+
146
+ interface AgentProcessOptions {
147
+ executionSignal?: AbortSignal | undefined;
148
+ onExecution?: ((completion: Promise<void>) => void) | undefined;
149
+ clientTurnId?: string | undefined;
150
+ continueOnDisconnect?: boolean | undefined;
151
+ onResponseFinalized?: ((event: ChatResponseFinalized) => void | Promise<void>) | undefined;
152
+ limits?: ExecutionLimits | undefined;
153
+ abortSignal?: AbortSignal | undefined;
154
+ sessionId?: string | undefined;
155
+ workflowId?: string | undefined;
156
+ context?: Record<string, unknown> | undefined;
157
+ }
158
+ type AgentTopologySnapshot = ReturnType<typeof projectWorkflowTopology>;
159
+ interface AgentProjectTopologyOptions {
160
+ environment: string;
161
+ service: AgentTopologySnapshot["service"];
162
+ }
163
+ interface CreateAgentArgs {
164
+ limits?: ExecutionLimits | undefined;
165
+ getProvider?: GetProviderFn | undefined;
166
+ workflows?: WorkflowDefinition[];
167
+ workflowsDir?: string;
168
+ workflowRegistry?: WorkflowRegistry;
169
+ defaultWorkflowId?: string;
170
+ frameworkAdapter?: FrameworkAdapter;
171
+ telemetry?: ExecutionRuntimeConfig["telemetry"];
172
+ }
173
+ interface Agent extends ReturnType<typeof createInterruptDiscovery> {
174
+ execute<W extends ExecutableWorkflow>(args: ExecuteOptions<W>): Promise<ExecutionResult<z.output<W["outputSchema"]>>>;
175
+ execute(args: {
176
+ limits?: ExecutionLimits;
177
+ abortSignal?: AbortSignal;
178
+ workflow: string;
179
+ input: unknown;
180
+ sessionId?: string;
181
+ context?: Record<string, unknown>;
182
+ }): Promise<ExecutionResult>;
183
+ resume<W extends ExecutableWorkflow>(args: ResumeOptions<W>): Promise<ExecutionResult<z.output<W["outputSchema"]>>>;
184
+ resume(args: {
185
+ limits?: ExecutionLimits;
186
+ abortSignal?: AbortSignal;
187
+ workflow: string;
188
+ resume: ResumeHandle;
189
+ response: ResumeResponse;
190
+ }): Promise<ExecutionResult>;
191
+ projectTopology?: (options: AgentProjectTopologyOptions) => Promise<AgentTopologySnapshot[]>;
192
+ streamChat: (messages: ChatMessage[], options?: AgentProcessOptions) => Promise<AsyncIterable<StreamChunk>>;
193
+ listCheckpoints: (sessionId: string) => Promise<CheckpointSummary[]>;
194
+ getCheckpoint: (id: CheckpointId) => Promise<SessionCheckpointRecord | null>;
195
+ rollbackTo: (id: CheckpointId) => Promise<RollbackSessionCheckpointResult>;
196
+ fork: (id: CheckpointId, options?: {
197
+ newSessionId?: string;
198
+ }) => Promise<ForkSessionCheckpointResult>;
199
+ }
200
+ declare function createAgent(args: CreateAgentArgs): Agent;
201
+
202
+ type EvalJson = null | boolean | number | string | readonly EvalJson[] | {
203
+ readonly [key: string]: EvalJson;
204
+ };
205
+ type EvalHandlerRef = {
206
+ using: string;
207
+ params?: EvalJson;
208
+ };
209
+ type EvalCriterion = string | {
210
+ id: string;
211
+ text: string;
212
+ };
213
+ type EvalOutputExpectation = {
214
+ schemaId: string;
215
+ schemaVersion?: string;
216
+ };
217
+ type EvalExpectation = {
218
+ type: "answer" | "interrupt";
219
+ schemaId?: string;
220
+ schemaVersion?: string;
221
+ /** Required completed structured output contracts in this step; other outputs are allowed. */
222
+ outputs?: readonly EvalOutputExpectation[];
223
+ criteria?: readonly EvalCriterion[];
224
+ reference?: EvalJson;
225
+ };
226
+ type EvalStep = ({
227
+ message: string;
228
+ resume?: never;
229
+ } | {
230
+ resume: ResumeResponse | EvalHandlerRef;
231
+ message?: never;
232
+ }) & {
233
+ expect: EvalExpectation;
234
+ };
235
+ type EvalCase<Params = EvalJson> = {
236
+ id: string;
237
+ name?: string;
238
+ params?: Params;
239
+ workflowId?: string;
240
+ steps: readonly EvalStep[];
241
+ };
242
+ type EvalSuite<Params = EvalJson> = {
243
+ id: string;
244
+ name?: string;
245
+ cases: readonly EvalCase<Params>[];
246
+ };
247
+ type EvalInterrupt = {
248
+ requestId: string;
249
+ kind: "text" | "choice" | "multi-choice" | "custom";
250
+ question?: string;
251
+ schemaId?: string;
252
+ schemaVersion?: string;
253
+ options: readonly {
254
+ id: string;
255
+ label: string;
256
+ description?: string;
257
+ }[];
258
+ request?: EvalJson;
259
+ };
260
+ /** Public output and emitted execution evidence; private runtime state is excluded. */
261
+ type EvalObservation = {
262
+ type: "answer" | "interrupt" | "error" | "cancelled";
263
+ text: string;
264
+ structured: readonly EvalJson[];
265
+ /** Ordered public stream events. Adjacent text deltas from the same source are joined. */
266
+ events?: readonly EvalJson[];
267
+ interrupt?: EvalInterrupt;
268
+ runId?: string;
269
+ checkpointId?: string;
270
+ };
271
+ type EvalCommand = {
272
+ type: "message";
273
+ message: string;
274
+ } | {
275
+ type: "resume";
276
+ response: ResumeResponse;
277
+ } | {
278
+ type: "cancel";
279
+ };
280
+ /** continuation is process-private and is never copied to results or progress events. */
281
+ type EvalExecution = {
282
+ observation: EvalObservation;
283
+ continuation?: unknown;
284
+ };
285
+ type EvalStatus = "passed" | "failed" | "error" | "cancelled";
286
+ /** Execution can finish before Studio has evaluated its semantic criteria. */
287
+ type EvalExecutionStatus = EvalStatus | "ungraded";
288
+ type EvalJudgeIdentity = {
289
+ id: string;
290
+ version: string;
291
+ location?: "app" | "studio" | undefined;
292
+ };
293
+ type EvalPhase = "params" | "setup" | "execute" | "responder" | "reference" | "grading" | "cleanup" | "reporting";
294
+ type EvalIssue = {
295
+ phase: EvalPhase;
296
+ code: string;
297
+ message: string;
298
+ };
299
+ type EvalVerdict = {
300
+ passed: boolean;
301
+ reason: string;
302
+ evidence: readonly string[];
303
+ };
304
+ type EvalCriterionResult = EvalVerdict & {
305
+ id: string;
306
+ text: string;
307
+ };
308
+ type EvalJudgeUsage = z.infer<typeof EvalJudgeUsageSchema>;
309
+ type EvalStepResult = {
310
+ judgeCalls?: number;
311
+ judgeUsage?: EvalJudgeUsage[];
312
+ index: number;
313
+ input: {
314
+ message: string;
315
+ } | {
316
+ resume: ResumeResponse;
317
+ };
318
+ expectation: EvalExpectation;
319
+ observation: EvalObservation;
320
+ reference?: EvalJson;
321
+ status: EvalExecutionStatus;
322
+ reason?: string;
323
+ criteria: EvalCriterionResult[];
324
+ };
325
+ type EvalCaseResult = {
326
+ caseId: string;
327
+ repetition: number;
328
+ sessionId: string;
329
+ status: EvalExecutionStatus;
330
+ durationMs: number;
331
+ steps: EvalStepResult[];
332
+ errors: EvalIssue[];
333
+ };
334
+ type EvalRunResult = {
335
+ id: string;
336
+ suiteId: string;
337
+ suiteRevision: string;
338
+ suite: EvalSuite;
339
+ judge?: EvalJudgeIdentity;
340
+ startedAt: string;
341
+ durationMs: number;
342
+ status: EvalExecutionStatus;
343
+ counts: Record<EvalStatus, number> & {
344
+ ungraded?: number;
345
+ };
346
+ cases: EvalCaseResult[];
347
+ errors: EvalIssue[];
348
+ };
349
+ type EvalGradeInput = {
350
+ /** Trusted provider billing evidence, independent of the generated verdict. */
351
+ onUsage?: (usage: EvalJudgeUsage) => void;
352
+ criterion: {
353
+ id: string;
354
+ text: string;
355
+ };
356
+ input: EvalStepResult["input"];
357
+ observation: EvalObservation;
358
+ reference?: EvalJson;
359
+ conversation: readonly EvalStepResult[];
360
+ signal: AbortSignal;
361
+ };
362
+ type EvalJudge = {
363
+ id: string;
364
+ version: string;
365
+ location?: "app" | "studio";
366
+ grade: (input: EvalGradeInput) => Promise<EvalVerdict> | EvalVerdict;
367
+ };
368
+ type EvalJudgeOptions = {
369
+ model: ProviderModelRef;
370
+ id?: string;
371
+ version?: string;
372
+ };
373
+ type StudioEvalJudgeOptions = {
374
+ /** Studio API origin, not the browser Studio URL. */
375
+ url: string;
376
+ apiKey: string;
377
+ environment: string;
378
+ allowInsecureHttp?: boolean;
379
+ /** Optional deadline for initial judge discovery. */
380
+ signal?: AbortSignal;
381
+ };
382
+ type EvalSetupContext<Params> = {
383
+ suiteId: string;
384
+ case: EvalCase;
385
+ repetition: number;
386
+ sessionId: string;
387
+ params: Params;
388
+ signal: AbortSignal;
389
+ };
390
+ type EvalContext<Params, Prepared> = EvalSetupContext<Params> & {
391
+ prepared: Prepared;
392
+ };
393
+ type EvalResponder<Params, Prepared> = ((input: EvalContext<Params, Prepared> & {
394
+ interrupt: EvalInterrupt;
395
+ args?: EvalJson;
396
+ }) => ResumeResponse | Promise<ResumeResponse>) | {
397
+ schemaId: string;
398
+ schemaVersion?: string;
399
+ respond: (input: EvalContext<Params, Prepared> & {
400
+ interrupt: EvalInterrupt;
401
+ args?: EvalJson;
402
+ }) => ResumeResponse | Promise<ResumeResponse>;
403
+ };
404
+ type EvalDefaults = {
405
+ repetitions?: number;
406
+ concurrency?: number;
407
+ caseTimeoutMs?: number;
408
+ cleanupTimeoutMs?: number;
409
+ };
410
+ type CreateEvalsOptions<Params = EvalJson | undefined, Prepared = undefined> = {
411
+ agent: Pick<Agent, "streamChat">;
412
+ suites: readonly EvalSuite[];
413
+ paramsSchema?: z.ZodType<Params>;
414
+ setup?: (input: EvalSetupContext<Params>) => Prepared | Promise<Prepared>;
415
+ execute?: (input: EvalContext<Params, NoInfer<Prepared>> & {
416
+ command: EvalCommand;
417
+ continuation?: unknown;
418
+ history: readonly ChatMessage[];
419
+ run: (options?: {
420
+ context?: Record<string, unknown>;
421
+ messages?: ChatMessage[];
422
+ }) => Promise<EvalExecution>;
423
+ }) => EvalExecution | Promise<EvalExecution>;
424
+ teardown?: (input: EvalContext<Params, NoInfer<Prepared>> & {
425
+ result: EvalCaseResult;
426
+ }) => void | Promise<void>;
427
+ responders?: Record<string, EvalResponder<Params, NoInfer<Prepared>>>;
428
+ references?: Record<string, (input: EvalContext<Params, NoInfer<Prepared>> & {
429
+ observation: EvalObservation;
430
+ args?: EvalJson;
431
+ }) => EvalJson | Promise<EvalJson>>;
432
+ judge?: EvalJudge;
433
+ defaults?: EvalDefaults;
434
+ };
435
+ type EvalProgress = {
436
+ type: "run-started";
437
+ caseIds: string[];
438
+ repetitions: number;
439
+ concurrency: number;
440
+ } | {
441
+ type: "case-progress";
442
+ caseId: string;
443
+ repetition: number;
444
+ phase: EvalPhase;
445
+ stepIndex?: number;
446
+ } | {
447
+ type: "case-started";
448
+ caseId: string;
449
+ repetition: number;
450
+ sessionId: string;
451
+ } | {
452
+ type: "step-completed";
453
+ caseId: string;
454
+ repetition: number;
455
+ step: EvalStepResult;
456
+ } | {
457
+ type: "case-completed";
458
+ result: EvalCaseResult;
459
+ };
460
+ type EvalRunOptions = {
461
+ /** Studio captures execution without invoking the code judge. Local runs default to app. */
462
+ grading?: "app" | "studio";
463
+ /** Selected identity pinned by the Studio server when enqueuing a run. */
464
+ judgeIdentity?: EvalJudgeIdentity;
465
+ suiteId: string;
466
+ caseIds?: readonly string[];
467
+ repetitions?: number;
468
+ concurrency?: number;
469
+ signal?: AbortSignal;
470
+ onProgress?: (event: EvalProgress) => void | Promise<void>;
471
+ /** Include live run totals and case phases; off for legacy progress consumers. */
472
+ includeActivity?: boolean;
473
+ };
474
+
475
+ declare const EvalResumeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
476
+ type: z.ZodLiteral<"text">;
477
+ text: z.ZodString;
478
+ }, z.core.$strict>, z.ZodObject<{
479
+ type: z.ZodLiteral<"select">;
480
+ ids: z.ZodArray<z.ZodString>;
481
+ }, z.core.$strict>, z.ZodObject<{
482
+ type: z.ZodLiteral<"value">;
483
+ value: z.ZodJSONSchema;
484
+ }, z.core.$strict>, z.ZodObject<{
485
+ type: z.ZodLiteral<"cancel">;
486
+ }, z.core.$strict>], "type">;
487
+ declare const EvalSuiteSchema: z.ZodObject<{
488
+ id: z.ZodString;
489
+ name: z.ZodOptional<z.ZodString>;
490
+ cases: z.ZodArray<z.ZodObject<{
491
+ id: z.ZodString;
492
+ name: z.ZodOptional<z.ZodString>;
493
+ params: z.ZodOptional<z.ZodJSONSchema>;
494
+ workflowId: z.ZodOptional<z.ZodString>;
495
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
496
+ message: z.ZodString;
497
+ expect: z.ZodObject<{
498
+ type: z.ZodEnum<{
499
+ interrupt: "interrupt";
500
+ answer: "answer";
501
+ }>;
502
+ schemaId: z.ZodOptional<z.ZodString>;
503
+ schemaVersion: z.ZodOptional<z.ZodString>;
504
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
505
+ schemaId: z.ZodString;
506
+ schemaVersion: z.ZodOptional<z.ZodString>;
507
+ }, z.core.$strict>>>;
508
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
509
+ id: z.ZodString;
510
+ text: z.ZodString;
511
+ }, z.core.$strict>]>>>;
512
+ reference: z.ZodOptional<z.ZodJSONSchema>;
513
+ }, z.core.$strict>;
514
+ }, z.core.$strict>, z.ZodObject<{
515
+ resume: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
516
+ type: z.ZodLiteral<"text">;
517
+ text: z.ZodString;
518
+ }, z.core.$strict>, z.ZodObject<{
519
+ type: z.ZodLiteral<"select">;
520
+ ids: z.ZodArray<z.ZodString>;
521
+ }, z.core.$strict>, z.ZodObject<{
522
+ type: z.ZodLiteral<"value">;
523
+ value: z.ZodJSONSchema;
524
+ }, z.core.$strict>, z.ZodObject<{
525
+ type: z.ZodLiteral<"cancel">;
526
+ }, z.core.$strict>], "type">, z.ZodObject<{
527
+ using: z.ZodString;
528
+ params: z.ZodOptional<z.ZodJSONSchema>;
529
+ }, z.core.$strict>]>;
530
+ expect: z.ZodObject<{
531
+ type: z.ZodEnum<{
532
+ interrupt: "interrupt";
533
+ answer: "answer";
534
+ }>;
535
+ schemaId: z.ZodOptional<z.ZodString>;
536
+ schemaVersion: z.ZodOptional<z.ZodString>;
537
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
538
+ schemaId: z.ZodString;
539
+ schemaVersion: z.ZodOptional<z.ZodString>;
540
+ }, z.core.$strict>>>;
541
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
542
+ id: z.ZodString;
543
+ text: z.ZodString;
544
+ }, z.core.$strict>]>>>;
545
+ reference: z.ZodOptional<z.ZodJSONSchema>;
546
+ }, z.core.$strict>;
547
+ }, z.core.$strict>]>>;
548
+ }, z.core.$strict>>;
549
+ }, z.core.$strict>;
550
+ declare const EvalVerdictSchema: z.ZodObject<{
551
+ passed: z.ZodBoolean;
552
+ reason: z.ZodString;
553
+ evidence: z.ZodArray<z.ZodString>;
554
+ }, z.core.$strict>;
555
+ declare const EvalObservationSchema: z.ZodObject<{
556
+ type: z.ZodEnum<{
557
+ cancelled: "cancelled";
558
+ interrupt: "interrupt";
559
+ error: "error";
560
+ answer: "answer";
561
+ }>;
562
+ text: z.ZodString;
563
+ structured: z.ZodArray<z.ZodJSONSchema>;
564
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
565
+ runId: z.ZodOptional<z.ZodString>;
566
+ checkpointId: z.ZodOptional<z.ZodString>;
567
+ interrupt: z.ZodOptional<z.ZodObject<{
568
+ requestId: z.ZodString;
569
+ kind: z.ZodEnum<{
570
+ text: "text";
571
+ custom: "custom";
572
+ "multi-choice": "multi-choice";
573
+ choice: "choice";
574
+ }>;
575
+ question: z.ZodOptional<z.ZodString>;
576
+ schemaId: z.ZodOptional<z.ZodString>;
577
+ schemaVersion: z.ZodOptional<z.ZodString>;
578
+ options: z.ZodArray<z.ZodObject<{
579
+ id: z.ZodString;
580
+ label: z.ZodString;
581
+ description: z.ZodOptional<z.ZodString>;
582
+ }, z.core.$strict>>;
583
+ request: z.ZodOptional<z.ZodJSONSchema>;
584
+ }, z.core.$strict>>;
585
+ }, z.core.$strict>;
586
+ /** Billing evidence only: no prompts, provider raw responses, or credentials. */
587
+ declare const EvalJudgeUsageSchema: z.ZodObject<{
588
+ provider: z.ZodString;
589
+ model: z.ZodString;
590
+ occurredAt: z.ZodISODateTime;
591
+ usage: z.ZodOptional<z.ZodObject<{
592
+ input: z.ZodOptional<z.ZodNumber>;
593
+ output: z.ZodOptional<z.ZodNumber>;
594
+ total: z.ZodOptional<z.ZodNumber>;
595
+ reasoning: z.ZodOptional<z.ZodNumber>;
596
+ cacheRead: z.ZodOptional<z.ZodNumber>;
597
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
598
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
599
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
600
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
601
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
602
+ }, z.core.$strict>>;
603
+ pricingContext: z.ZodOptional<z.ZodObject<{
604
+ serviceTier: z.ZodOptional<z.ZodString>;
605
+ inferenceGeo: z.ZodOptional<z.ZodString>;
606
+ speed: z.ZodOptional<z.ZodString>;
607
+ }, z.core.$strict>>;
608
+ pricing: z.ZodOptional<z.ZodObject<{
609
+ source: z.ZodLiteral<"provider">;
610
+ currency: z.ZodLiteral<"USD">;
611
+ actualCostMicros: z.ZodNumber;
612
+ }, z.core.$strict>>;
613
+ }, z.core.$strict>;
614
+ declare const EvalStepResultSchema: z.ZodObject<{
615
+ index: z.ZodNumber;
616
+ input: z.ZodUnion<readonly [z.ZodObject<{
617
+ message: z.ZodString;
618
+ }, z.core.$strict>, z.ZodObject<{
619
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
620
+ type: z.ZodLiteral<"text">;
621
+ text: z.ZodString;
622
+ }, z.core.$strict>, z.ZodObject<{
623
+ type: z.ZodLiteral<"select">;
624
+ ids: z.ZodArray<z.ZodString>;
625
+ }, z.core.$strict>, z.ZodObject<{
626
+ type: z.ZodLiteral<"value">;
627
+ value: z.ZodJSONSchema;
628
+ }, z.core.$strict>, z.ZodObject<{
629
+ type: z.ZodLiteral<"cancel">;
630
+ }, z.core.$strict>], "type">;
631
+ }, z.core.$strict>]>;
632
+ expectation: z.ZodObject<{
633
+ type: z.ZodEnum<{
634
+ interrupt: "interrupt";
635
+ answer: "answer";
636
+ }>;
637
+ schemaId: z.ZodOptional<z.ZodString>;
638
+ schemaVersion: z.ZodOptional<z.ZodString>;
639
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
640
+ schemaId: z.ZodString;
641
+ schemaVersion: z.ZodOptional<z.ZodString>;
642
+ }, z.core.$strict>>>;
643
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
644
+ id: z.ZodString;
645
+ text: z.ZodString;
646
+ }, z.core.$strict>]>>>;
647
+ reference: z.ZodOptional<z.ZodJSONSchema>;
648
+ }, z.core.$strict>;
649
+ observation: z.ZodObject<{
650
+ type: z.ZodEnum<{
651
+ cancelled: "cancelled";
652
+ interrupt: "interrupt";
653
+ error: "error";
654
+ answer: "answer";
655
+ }>;
656
+ text: z.ZodString;
657
+ structured: z.ZodArray<z.ZodJSONSchema>;
658
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
659
+ runId: z.ZodOptional<z.ZodString>;
660
+ checkpointId: z.ZodOptional<z.ZodString>;
661
+ interrupt: z.ZodOptional<z.ZodObject<{
662
+ requestId: z.ZodString;
663
+ kind: z.ZodEnum<{
664
+ text: "text";
665
+ custom: "custom";
666
+ "multi-choice": "multi-choice";
667
+ choice: "choice";
668
+ }>;
669
+ question: z.ZodOptional<z.ZodString>;
670
+ schemaId: z.ZodOptional<z.ZodString>;
671
+ schemaVersion: z.ZodOptional<z.ZodString>;
672
+ options: z.ZodArray<z.ZodObject<{
673
+ id: z.ZodString;
674
+ label: z.ZodString;
675
+ description: z.ZodOptional<z.ZodString>;
676
+ }, z.core.$strict>>;
677
+ request: z.ZodOptional<z.ZodJSONSchema>;
678
+ }, z.core.$strict>>;
679
+ }, z.core.$strict>;
680
+ reference: z.ZodOptional<z.ZodJSONSchema>;
681
+ status: z.ZodEnum<{
682
+ cancelled: "cancelled";
683
+ failed: "failed";
684
+ error: "error";
685
+ passed: "passed";
686
+ ungraded: "ungraded";
687
+ }>;
688
+ reason: z.ZodOptional<z.ZodString>;
689
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
690
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
691
+ provider: z.ZodString;
692
+ model: z.ZodString;
693
+ occurredAt: z.ZodISODateTime;
694
+ usage: z.ZodOptional<z.ZodObject<{
695
+ input: z.ZodOptional<z.ZodNumber>;
696
+ output: z.ZodOptional<z.ZodNumber>;
697
+ total: z.ZodOptional<z.ZodNumber>;
698
+ reasoning: z.ZodOptional<z.ZodNumber>;
699
+ cacheRead: z.ZodOptional<z.ZodNumber>;
700
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
701
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
702
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
703
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
704
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
705
+ }, z.core.$strict>>;
706
+ pricingContext: z.ZodOptional<z.ZodObject<{
707
+ serviceTier: z.ZodOptional<z.ZodString>;
708
+ inferenceGeo: z.ZodOptional<z.ZodString>;
709
+ speed: z.ZodOptional<z.ZodString>;
710
+ }, z.core.$strict>>;
711
+ pricing: z.ZodOptional<z.ZodObject<{
712
+ source: z.ZodLiteral<"provider">;
713
+ currency: z.ZodLiteral<"USD">;
714
+ actualCostMicros: z.ZodNumber;
715
+ }, z.core.$strict>>;
716
+ }, z.core.$strict>>>;
717
+ criteria: z.ZodArray<z.ZodObject<{
718
+ passed: z.ZodBoolean;
719
+ reason: z.ZodString;
720
+ evidence: z.ZodArray<z.ZodString>;
721
+ id: z.ZodString;
722
+ text: z.ZodString;
723
+ }, z.core.$strict>>;
724
+ }, z.core.$strict>;
725
+ declare const EvalCaseResultSchema: z.ZodObject<{
726
+ caseId: z.ZodString;
727
+ repetition: z.ZodNumber;
728
+ sessionId: z.ZodString;
729
+ status: z.ZodEnum<{
730
+ cancelled: "cancelled";
731
+ failed: "failed";
732
+ error: "error";
733
+ passed: "passed";
734
+ ungraded: "ungraded";
735
+ }>;
736
+ durationMs: z.ZodNumber;
737
+ steps: z.ZodArray<z.ZodObject<{
738
+ index: z.ZodNumber;
739
+ input: z.ZodUnion<readonly [z.ZodObject<{
740
+ message: z.ZodString;
741
+ }, z.core.$strict>, z.ZodObject<{
742
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
743
+ type: z.ZodLiteral<"text">;
744
+ text: z.ZodString;
745
+ }, z.core.$strict>, z.ZodObject<{
746
+ type: z.ZodLiteral<"select">;
747
+ ids: z.ZodArray<z.ZodString>;
748
+ }, z.core.$strict>, z.ZodObject<{
749
+ type: z.ZodLiteral<"value">;
750
+ value: z.ZodJSONSchema;
751
+ }, z.core.$strict>, z.ZodObject<{
752
+ type: z.ZodLiteral<"cancel">;
753
+ }, z.core.$strict>], "type">;
754
+ }, z.core.$strict>]>;
755
+ expectation: z.ZodObject<{
756
+ type: z.ZodEnum<{
757
+ interrupt: "interrupt";
758
+ answer: "answer";
759
+ }>;
760
+ schemaId: z.ZodOptional<z.ZodString>;
761
+ schemaVersion: z.ZodOptional<z.ZodString>;
762
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
763
+ schemaId: z.ZodString;
764
+ schemaVersion: z.ZodOptional<z.ZodString>;
765
+ }, z.core.$strict>>>;
766
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
767
+ id: z.ZodString;
768
+ text: z.ZodString;
769
+ }, z.core.$strict>]>>>;
770
+ reference: z.ZodOptional<z.ZodJSONSchema>;
771
+ }, z.core.$strict>;
772
+ observation: z.ZodObject<{
773
+ type: z.ZodEnum<{
774
+ cancelled: "cancelled";
775
+ interrupt: "interrupt";
776
+ error: "error";
777
+ answer: "answer";
778
+ }>;
779
+ text: z.ZodString;
780
+ structured: z.ZodArray<z.ZodJSONSchema>;
781
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
782
+ runId: z.ZodOptional<z.ZodString>;
783
+ checkpointId: z.ZodOptional<z.ZodString>;
784
+ interrupt: z.ZodOptional<z.ZodObject<{
785
+ requestId: z.ZodString;
786
+ kind: z.ZodEnum<{
787
+ text: "text";
788
+ custom: "custom";
789
+ "multi-choice": "multi-choice";
790
+ choice: "choice";
791
+ }>;
792
+ question: z.ZodOptional<z.ZodString>;
793
+ schemaId: z.ZodOptional<z.ZodString>;
794
+ schemaVersion: z.ZodOptional<z.ZodString>;
795
+ options: z.ZodArray<z.ZodObject<{
796
+ id: z.ZodString;
797
+ label: z.ZodString;
798
+ description: z.ZodOptional<z.ZodString>;
799
+ }, z.core.$strict>>;
800
+ request: z.ZodOptional<z.ZodJSONSchema>;
801
+ }, z.core.$strict>>;
802
+ }, z.core.$strict>;
803
+ reference: z.ZodOptional<z.ZodJSONSchema>;
804
+ status: z.ZodEnum<{
805
+ cancelled: "cancelled";
806
+ failed: "failed";
807
+ error: "error";
808
+ passed: "passed";
809
+ ungraded: "ungraded";
810
+ }>;
811
+ reason: z.ZodOptional<z.ZodString>;
812
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
813
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
814
+ provider: z.ZodString;
815
+ model: z.ZodString;
816
+ occurredAt: z.ZodISODateTime;
817
+ usage: z.ZodOptional<z.ZodObject<{
818
+ input: z.ZodOptional<z.ZodNumber>;
819
+ output: z.ZodOptional<z.ZodNumber>;
820
+ total: z.ZodOptional<z.ZodNumber>;
821
+ reasoning: z.ZodOptional<z.ZodNumber>;
822
+ cacheRead: z.ZodOptional<z.ZodNumber>;
823
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
824
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
825
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
826
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
827
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
828
+ }, z.core.$strict>>;
829
+ pricingContext: z.ZodOptional<z.ZodObject<{
830
+ serviceTier: z.ZodOptional<z.ZodString>;
831
+ inferenceGeo: z.ZodOptional<z.ZodString>;
832
+ speed: z.ZodOptional<z.ZodString>;
833
+ }, z.core.$strict>>;
834
+ pricing: z.ZodOptional<z.ZodObject<{
835
+ source: z.ZodLiteral<"provider">;
836
+ currency: z.ZodLiteral<"USD">;
837
+ actualCostMicros: z.ZodNumber;
838
+ }, z.core.$strict>>;
839
+ }, z.core.$strict>>>;
840
+ criteria: z.ZodArray<z.ZodObject<{
841
+ passed: z.ZodBoolean;
842
+ reason: z.ZodString;
843
+ evidence: z.ZodArray<z.ZodString>;
844
+ id: z.ZodString;
845
+ text: z.ZodString;
846
+ }, z.core.$strict>>;
847
+ }, z.core.$strict>>;
848
+ errors: z.ZodArray<z.ZodObject<{
849
+ phase: z.ZodEnum<{
850
+ params: "params";
851
+ execute: "execute";
852
+ setup: "setup";
853
+ responder: "responder";
854
+ reference: "reference";
855
+ grading: "grading";
856
+ cleanup: "cleanup";
857
+ reporting: "reporting";
858
+ }>;
859
+ code: z.ZodString;
860
+ message: z.ZodString;
861
+ }, z.core.$strict>>;
862
+ }, z.core.$strict>;
863
+ declare const EvalJudgeIdentitySchema: z.ZodObject<{
864
+ id: z.ZodString;
865
+ version: z.ZodString;
866
+ location: z.ZodOptional<z.ZodEnum<{
867
+ app: "app";
868
+ studio: "studio";
869
+ }>>;
870
+ }, z.core.$strict>;
871
+ declare const StudioEvalJudgeRequestSchema: z.ZodObject<{
872
+ environment: z.ZodString;
873
+ judge: z.ZodObject<{
874
+ id: z.ZodString;
875
+ version: z.ZodString;
876
+ location: z.ZodOptional<z.ZodEnum<{
877
+ app: "app";
878
+ studio: "studio";
879
+ }>>;
880
+ }, z.core.$strict>;
881
+ criterion: z.ZodObject<{
882
+ id: z.ZodString;
883
+ text: z.ZodString;
884
+ }, z.core.$strict>;
885
+ input: z.ZodUnion<readonly [z.ZodObject<{
886
+ message: z.ZodString;
887
+ }, z.core.$strict>, z.ZodObject<{
888
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
889
+ type: z.ZodLiteral<"text">;
890
+ text: z.ZodString;
891
+ }, z.core.$strict>, z.ZodObject<{
892
+ type: z.ZodLiteral<"select">;
893
+ ids: z.ZodArray<z.ZodString>;
894
+ }, z.core.$strict>, z.ZodObject<{
895
+ type: z.ZodLiteral<"value">;
896
+ value: z.ZodJSONSchema;
897
+ }, z.core.$strict>, z.ZodObject<{
898
+ type: z.ZodLiteral<"cancel">;
899
+ }, z.core.$strict>], "type">;
900
+ }, z.core.$strict>]>;
901
+ observation: z.ZodObject<{
902
+ type: z.ZodEnum<{
903
+ cancelled: "cancelled";
904
+ interrupt: "interrupt";
905
+ error: "error";
906
+ answer: "answer";
907
+ }>;
908
+ text: z.ZodString;
909
+ structured: z.ZodArray<z.ZodJSONSchema>;
910
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
911
+ runId: z.ZodOptional<z.ZodString>;
912
+ checkpointId: z.ZodOptional<z.ZodString>;
913
+ interrupt: z.ZodOptional<z.ZodObject<{
914
+ requestId: z.ZodString;
915
+ kind: z.ZodEnum<{
916
+ text: "text";
917
+ custom: "custom";
918
+ "multi-choice": "multi-choice";
919
+ choice: "choice";
920
+ }>;
921
+ question: z.ZodOptional<z.ZodString>;
922
+ schemaId: z.ZodOptional<z.ZodString>;
923
+ schemaVersion: z.ZodOptional<z.ZodString>;
924
+ options: z.ZodArray<z.ZodObject<{
925
+ id: z.ZodString;
926
+ label: z.ZodString;
927
+ description: z.ZodOptional<z.ZodString>;
928
+ }, z.core.$strict>>;
929
+ request: z.ZodOptional<z.ZodJSONSchema>;
930
+ }, z.core.$strict>>;
931
+ }, z.core.$strict>;
932
+ reference: z.ZodOptional<z.ZodJSONSchema>;
933
+ conversation: z.ZodArray<z.ZodObject<{
934
+ index: z.ZodNumber;
935
+ input: z.ZodUnion<readonly [z.ZodObject<{
936
+ message: z.ZodString;
937
+ }, z.core.$strict>, z.ZodObject<{
938
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
939
+ type: z.ZodLiteral<"text">;
940
+ text: z.ZodString;
941
+ }, z.core.$strict>, z.ZodObject<{
942
+ type: z.ZodLiteral<"select">;
943
+ ids: z.ZodArray<z.ZodString>;
944
+ }, z.core.$strict>, z.ZodObject<{
945
+ type: z.ZodLiteral<"value">;
946
+ value: z.ZodJSONSchema;
947
+ }, z.core.$strict>, z.ZodObject<{
948
+ type: z.ZodLiteral<"cancel">;
949
+ }, z.core.$strict>], "type">;
950
+ }, z.core.$strict>]>;
951
+ expectation: z.ZodObject<{
952
+ type: z.ZodEnum<{
953
+ interrupt: "interrupt";
954
+ answer: "answer";
955
+ }>;
956
+ schemaId: z.ZodOptional<z.ZodString>;
957
+ schemaVersion: z.ZodOptional<z.ZodString>;
958
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
959
+ schemaId: z.ZodString;
960
+ schemaVersion: z.ZodOptional<z.ZodString>;
961
+ }, z.core.$strict>>>;
962
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
963
+ id: z.ZodString;
964
+ text: z.ZodString;
965
+ }, z.core.$strict>]>>>;
966
+ reference: z.ZodOptional<z.ZodJSONSchema>;
967
+ }, z.core.$strict>;
968
+ observation: z.ZodObject<{
969
+ type: z.ZodEnum<{
970
+ cancelled: "cancelled";
971
+ interrupt: "interrupt";
972
+ error: "error";
973
+ answer: "answer";
974
+ }>;
975
+ text: z.ZodString;
976
+ structured: z.ZodArray<z.ZodJSONSchema>;
977
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
978
+ runId: z.ZodOptional<z.ZodString>;
979
+ checkpointId: z.ZodOptional<z.ZodString>;
980
+ interrupt: z.ZodOptional<z.ZodObject<{
981
+ requestId: z.ZodString;
982
+ kind: z.ZodEnum<{
983
+ text: "text";
984
+ custom: "custom";
985
+ "multi-choice": "multi-choice";
986
+ choice: "choice";
987
+ }>;
988
+ question: z.ZodOptional<z.ZodString>;
989
+ schemaId: z.ZodOptional<z.ZodString>;
990
+ schemaVersion: z.ZodOptional<z.ZodString>;
991
+ options: z.ZodArray<z.ZodObject<{
992
+ id: z.ZodString;
993
+ label: z.ZodString;
994
+ description: z.ZodOptional<z.ZodString>;
995
+ }, z.core.$strict>>;
996
+ request: z.ZodOptional<z.ZodJSONSchema>;
997
+ }, z.core.$strict>>;
998
+ }, z.core.$strict>;
999
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1000
+ status: z.ZodEnum<{
1001
+ cancelled: "cancelled";
1002
+ failed: "failed";
1003
+ error: "error";
1004
+ passed: "passed";
1005
+ ungraded: "ungraded";
1006
+ }>;
1007
+ reason: z.ZodOptional<z.ZodString>;
1008
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
1009
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1010
+ provider: z.ZodString;
1011
+ model: z.ZodString;
1012
+ occurredAt: z.ZodISODateTime;
1013
+ usage: z.ZodOptional<z.ZodObject<{
1014
+ input: z.ZodOptional<z.ZodNumber>;
1015
+ output: z.ZodOptional<z.ZodNumber>;
1016
+ total: z.ZodOptional<z.ZodNumber>;
1017
+ reasoning: z.ZodOptional<z.ZodNumber>;
1018
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1019
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1020
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1021
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1022
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1023
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1024
+ }, z.core.$strict>>;
1025
+ pricingContext: z.ZodOptional<z.ZodObject<{
1026
+ serviceTier: z.ZodOptional<z.ZodString>;
1027
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1028
+ speed: z.ZodOptional<z.ZodString>;
1029
+ }, z.core.$strict>>;
1030
+ pricing: z.ZodOptional<z.ZodObject<{
1031
+ source: z.ZodLiteral<"provider">;
1032
+ currency: z.ZodLiteral<"USD">;
1033
+ actualCostMicros: z.ZodNumber;
1034
+ }, z.core.$strict>>;
1035
+ }, z.core.$strict>>>;
1036
+ criteria: z.ZodArray<z.ZodObject<{
1037
+ passed: z.ZodBoolean;
1038
+ reason: z.ZodString;
1039
+ evidence: z.ZodArray<z.ZodString>;
1040
+ id: z.ZodString;
1041
+ text: z.ZodString;
1042
+ }, z.core.$strict>>;
1043
+ }, z.core.$strict>>;
1044
+ }, z.core.$strict>;
1045
+ declare const StudioEvalJudgeResponseSchema: z.ZodObject<{
1046
+ judge: z.ZodObject<{
1047
+ id: z.ZodString;
1048
+ version: z.ZodString;
1049
+ location: z.ZodOptional<z.ZodEnum<{
1050
+ app: "app";
1051
+ studio: "studio";
1052
+ }>>;
1053
+ }, z.core.$strict>;
1054
+ verdict: z.ZodObject<{
1055
+ passed: z.ZodBoolean;
1056
+ reason: z.ZodString;
1057
+ evidence: z.ZodArray<z.ZodString>;
1058
+ }, z.core.$strict>;
1059
+ usage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1060
+ provider: z.ZodString;
1061
+ model: z.ZodString;
1062
+ occurredAt: z.ZodISODateTime;
1063
+ usage: z.ZodOptional<z.ZodObject<{
1064
+ input: z.ZodOptional<z.ZodNumber>;
1065
+ output: z.ZodOptional<z.ZodNumber>;
1066
+ total: z.ZodOptional<z.ZodNumber>;
1067
+ reasoning: z.ZodOptional<z.ZodNumber>;
1068
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1069
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1070
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1071
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1072
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1073
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1074
+ }, z.core.$strict>>;
1075
+ pricingContext: z.ZodOptional<z.ZodObject<{
1076
+ serviceTier: z.ZodOptional<z.ZodString>;
1077
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1078
+ speed: z.ZodOptional<z.ZodString>;
1079
+ }, z.core.$strict>>;
1080
+ pricing: z.ZodOptional<z.ZodObject<{
1081
+ source: z.ZodLiteral<"provider">;
1082
+ currency: z.ZodLiteral<"USD">;
1083
+ actualCostMicros: z.ZodNumber;
1084
+ }, z.core.$strict>>;
1085
+ }, z.core.$strict>>>;
1086
+ }, z.core.$strict>;
1087
+ declare const EvalRunResultSchema: z.ZodObject<{
1088
+ id: z.ZodUUID;
1089
+ suiteId: z.ZodString;
1090
+ suiteRevision: z.ZodString;
1091
+ suite: z.ZodObject<{
1092
+ id: z.ZodString;
1093
+ name: z.ZodOptional<z.ZodString>;
1094
+ cases: z.ZodArray<z.ZodObject<{
1095
+ id: z.ZodString;
1096
+ name: z.ZodOptional<z.ZodString>;
1097
+ params: z.ZodOptional<z.ZodJSONSchema>;
1098
+ workflowId: z.ZodOptional<z.ZodString>;
1099
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1100
+ message: z.ZodString;
1101
+ expect: z.ZodObject<{
1102
+ type: z.ZodEnum<{
1103
+ interrupt: "interrupt";
1104
+ answer: "answer";
1105
+ }>;
1106
+ schemaId: z.ZodOptional<z.ZodString>;
1107
+ schemaVersion: z.ZodOptional<z.ZodString>;
1108
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1109
+ schemaId: z.ZodString;
1110
+ schemaVersion: z.ZodOptional<z.ZodString>;
1111
+ }, z.core.$strict>>>;
1112
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1113
+ id: z.ZodString;
1114
+ text: z.ZodString;
1115
+ }, z.core.$strict>]>>>;
1116
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1117
+ }, z.core.$strict>;
1118
+ }, z.core.$strict>, z.ZodObject<{
1119
+ resume: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
1120
+ type: z.ZodLiteral<"text">;
1121
+ text: z.ZodString;
1122
+ }, z.core.$strict>, z.ZodObject<{
1123
+ type: z.ZodLiteral<"select">;
1124
+ ids: z.ZodArray<z.ZodString>;
1125
+ }, z.core.$strict>, z.ZodObject<{
1126
+ type: z.ZodLiteral<"value">;
1127
+ value: z.ZodJSONSchema;
1128
+ }, z.core.$strict>, z.ZodObject<{
1129
+ type: z.ZodLiteral<"cancel">;
1130
+ }, z.core.$strict>], "type">, z.ZodObject<{
1131
+ using: z.ZodString;
1132
+ params: z.ZodOptional<z.ZodJSONSchema>;
1133
+ }, z.core.$strict>]>;
1134
+ expect: z.ZodObject<{
1135
+ type: z.ZodEnum<{
1136
+ interrupt: "interrupt";
1137
+ answer: "answer";
1138
+ }>;
1139
+ schemaId: z.ZodOptional<z.ZodString>;
1140
+ schemaVersion: z.ZodOptional<z.ZodString>;
1141
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1142
+ schemaId: z.ZodString;
1143
+ schemaVersion: z.ZodOptional<z.ZodString>;
1144
+ }, z.core.$strict>>>;
1145
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1146
+ id: z.ZodString;
1147
+ text: z.ZodString;
1148
+ }, z.core.$strict>]>>>;
1149
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1150
+ }, z.core.$strict>;
1151
+ }, z.core.$strict>]>>;
1152
+ }, z.core.$strict>>;
1153
+ }, z.core.$strict>;
1154
+ judge: z.ZodOptional<z.ZodObject<{
1155
+ id: z.ZodString;
1156
+ version: z.ZodString;
1157
+ location: z.ZodOptional<z.ZodEnum<{
1158
+ app: "app";
1159
+ studio: "studio";
1160
+ }>>;
1161
+ }, z.core.$strict>>;
1162
+ startedAt: z.ZodISODateTime;
1163
+ durationMs: z.ZodNumber;
1164
+ status: z.ZodEnum<{
1165
+ cancelled: "cancelled";
1166
+ failed: "failed";
1167
+ error: "error";
1168
+ passed: "passed";
1169
+ ungraded: "ungraded";
1170
+ }>;
1171
+ counts: z.ZodObject<{
1172
+ passed: z.ZodNumber;
1173
+ failed: z.ZodNumber;
1174
+ error: z.ZodNumber;
1175
+ cancelled: z.ZodNumber;
1176
+ ungraded: z.ZodOptional<z.ZodNumber>;
1177
+ }, z.core.$strict>;
1178
+ cases: z.ZodArray<z.ZodObject<{
1179
+ caseId: z.ZodString;
1180
+ repetition: z.ZodNumber;
1181
+ sessionId: z.ZodString;
1182
+ status: z.ZodEnum<{
1183
+ cancelled: "cancelled";
1184
+ failed: "failed";
1185
+ error: "error";
1186
+ passed: "passed";
1187
+ ungraded: "ungraded";
1188
+ }>;
1189
+ durationMs: z.ZodNumber;
1190
+ steps: z.ZodArray<z.ZodObject<{
1191
+ index: z.ZodNumber;
1192
+ input: z.ZodUnion<readonly [z.ZodObject<{
1193
+ message: z.ZodString;
1194
+ }, z.core.$strict>, z.ZodObject<{
1195
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
1196
+ type: z.ZodLiteral<"text">;
1197
+ text: z.ZodString;
1198
+ }, z.core.$strict>, z.ZodObject<{
1199
+ type: z.ZodLiteral<"select">;
1200
+ ids: z.ZodArray<z.ZodString>;
1201
+ }, z.core.$strict>, z.ZodObject<{
1202
+ type: z.ZodLiteral<"value">;
1203
+ value: z.ZodJSONSchema;
1204
+ }, z.core.$strict>, z.ZodObject<{
1205
+ type: z.ZodLiteral<"cancel">;
1206
+ }, z.core.$strict>], "type">;
1207
+ }, z.core.$strict>]>;
1208
+ expectation: z.ZodObject<{
1209
+ type: z.ZodEnum<{
1210
+ interrupt: "interrupt";
1211
+ answer: "answer";
1212
+ }>;
1213
+ schemaId: z.ZodOptional<z.ZodString>;
1214
+ schemaVersion: z.ZodOptional<z.ZodString>;
1215
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1216
+ schemaId: z.ZodString;
1217
+ schemaVersion: z.ZodOptional<z.ZodString>;
1218
+ }, z.core.$strict>>>;
1219
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1220
+ id: z.ZodString;
1221
+ text: z.ZodString;
1222
+ }, z.core.$strict>]>>>;
1223
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1224
+ }, z.core.$strict>;
1225
+ observation: z.ZodObject<{
1226
+ type: z.ZodEnum<{
1227
+ cancelled: "cancelled";
1228
+ interrupt: "interrupt";
1229
+ error: "error";
1230
+ answer: "answer";
1231
+ }>;
1232
+ text: z.ZodString;
1233
+ structured: z.ZodArray<z.ZodJSONSchema>;
1234
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
1235
+ runId: z.ZodOptional<z.ZodString>;
1236
+ checkpointId: z.ZodOptional<z.ZodString>;
1237
+ interrupt: z.ZodOptional<z.ZodObject<{
1238
+ requestId: z.ZodString;
1239
+ kind: z.ZodEnum<{
1240
+ text: "text";
1241
+ custom: "custom";
1242
+ "multi-choice": "multi-choice";
1243
+ choice: "choice";
1244
+ }>;
1245
+ question: z.ZodOptional<z.ZodString>;
1246
+ schemaId: z.ZodOptional<z.ZodString>;
1247
+ schemaVersion: z.ZodOptional<z.ZodString>;
1248
+ options: z.ZodArray<z.ZodObject<{
1249
+ id: z.ZodString;
1250
+ label: z.ZodString;
1251
+ description: z.ZodOptional<z.ZodString>;
1252
+ }, z.core.$strict>>;
1253
+ request: z.ZodOptional<z.ZodJSONSchema>;
1254
+ }, z.core.$strict>>;
1255
+ }, z.core.$strict>;
1256
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1257
+ status: z.ZodEnum<{
1258
+ cancelled: "cancelled";
1259
+ failed: "failed";
1260
+ error: "error";
1261
+ passed: "passed";
1262
+ ungraded: "ungraded";
1263
+ }>;
1264
+ reason: z.ZodOptional<z.ZodString>;
1265
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
1266
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1267
+ provider: z.ZodString;
1268
+ model: z.ZodString;
1269
+ occurredAt: z.ZodISODateTime;
1270
+ usage: z.ZodOptional<z.ZodObject<{
1271
+ input: z.ZodOptional<z.ZodNumber>;
1272
+ output: z.ZodOptional<z.ZodNumber>;
1273
+ total: z.ZodOptional<z.ZodNumber>;
1274
+ reasoning: z.ZodOptional<z.ZodNumber>;
1275
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1276
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1277
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1278
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1279
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1280
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1281
+ }, z.core.$strict>>;
1282
+ pricingContext: z.ZodOptional<z.ZodObject<{
1283
+ serviceTier: z.ZodOptional<z.ZodString>;
1284
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1285
+ speed: z.ZodOptional<z.ZodString>;
1286
+ }, z.core.$strict>>;
1287
+ pricing: z.ZodOptional<z.ZodObject<{
1288
+ source: z.ZodLiteral<"provider">;
1289
+ currency: z.ZodLiteral<"USD">;
1290
+ actualCostMicros: z.ZodNumber;
1291
+ }, z.core.$strict>>;
1292
+ }, z.core.$strict>>>;
1293
+ criteria: z.ZodArray<z.ZodObject<{
1294
+ passed: z.ZodBoolean;
1295
+ reason: z.ZodString;
1296
+ evidence: z.ZodArray<z.ZodString>;
1297
+ id: z.ZodString;
1298
+ text: z.ZodString;
1299
+ }, z.core.$strict>>;
1300
+ }, z.core.$strict>>;
1301
+ errors: z.ZodArray<z.ZodObject<{
1302
+ phase: z.ZodEnum<{
1303
+ params: "params";
1304
+ execute: "execute";
1305
+ setup: "setup";
1306
+ responder: "responder";
1307
+ reference: "reference";
1308
+ grading: "grading";
1309
+ cleanup: "cleanup";
1310
+ reporting: "reporting";
1311
+ }>;
1312
+ code: z.ZodString;
1313
+ message: z.ZodString;
1314
+ }, z.core.$strict>>;
1315
+ }, z.core.$strict>>;
1316
+ errors: z.ZodArray<z.ZodObject<{
1317
+ phase: z.ZodEnum<{
1318
+ params: "params";
1319
+ execute: "execute";
1320
+ setup: "setup";
1321
+ responder: "responder";
1322
+ reference: "reference";
1323
+ grading: "grading";
1324
+ cleanup: "cleanup";
1325
+ reporting: "reporting";
1326
+ }>;
1327
+ code: z.ZodString;
1328
+ message: z.ZodString;
1329
+ }, z.core.$strict>>;
1330
+ }, z.core.$strict>;
1331
+ declare const EvalManifestSchema: z.ZodObject<{
1332
+ schemaVersion: z.ZodLiteral<1>;
1333
+ studioJudging: z.ZodOptional<z.ZodLiteral<true>>;
1334
+ suites: z.ZodArray<z.ZodObject<{
1335
+ id: z.ZodString;
1336
+ name: z.ZodOptional<z.ZodString>;
1337
+ cases: z.ZodArray<z.ZodObject<{
1338
+ id: z.ZodString;
1339
+ name: z.ZodOptional<z.ZodString>;
1340
+ params: z.ZodOptional<z.ZodJSONSchema>;
1341
+ workflowId: z.ZodOptional<z.ZodString>;
1342
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1343
+ message: z.ZodString;
1344
+ expect: z.ZodObject<{
1345
+ type: z.ZodEnum<{
1346
+ interrupt: "interrupt";
1347
+ answer: "answer";
1348
+ }>;
1349
+ schemaId: z.ZodOptional<z.ZodString>;
1350
+ schemaVersion: z.ZodOptional<z.ZodString>;
1351
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1352
+ schemaId: z.ZodString;
1353
+ schemaVersion: z.ZodOptional<z.ZodString>;
1354
+ }, z.core.$strict>>>;
1355
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1356
+ id: z.ZodString;
1357
+ text: z.ZodString;
1358
+ }, z.core.$strict>]>>>;
1359
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1360
+ }, z.core.$strict>;
1361
+ }, z.core.$strict>, z.ZodObject<{
1362
+ resume: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
1363
+ type: z.ZodLiteral<"text">;
1364
+ text: z.ZodString;
1365
+ }, z.core.$strict>, z.ZodObject<{
1366
+ type: z.ZodLiteral<"select">;
1367
+ ids: z.ZodArray<z.ZodString>;
1368
+ }, z.core.$strict>, z.ZodObject<{
1369
+ type: z.ZodLiteral<"value">;
1370
+ value: z.ZodJSONSchema;
1371
+ }, z.core.$strict>, z.ZodObject<{
1372
+ type: z.ZodLiteral<"cancel">;
1373
+ }, z.core.$strict>], "type">, z.ZodObject<{
1374
+ using: z.ZodString;
1375
+ params: z.ZodOptional<z.ZodJSONSchema>;
1376
+ }, z.core.$strict>]>;
1377
+ expect: z.ZodObject<{
1378
+ type: z.ZodEnum<{
1379
+ interrupt: "interrupt";
1380
+ answer: "answer";
1381
+ }>;
1382
+ schemaId: z.ZodOptional<z.ZodString>;
1383
+ schemaVersion: z.ZodOptional<z.ZodString>;
1384
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1385
+ schemaId: z.ZodString;
1386
+ schemaVersion: z.ZodOptional<z.ZodString>;
1387
+ }, z.core.$strict>>>;
1388
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1389
+ id: z.ZodString;
1390
+ text: z.ZodString;
1391
+ }, z.core.$strict>]>>>;
1392
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1393
+ }, z.core.$strict>;
1394
+ }, z.core.$strict>]>>;
1395
+ }, z.core.$strict>>;
1396
+ }, z.core.$strict>>;
1397
+ responders: z.ZodArray<z.ZodObject<{
1398
+ name: z.ZodString;
1399
+ schemaId: z.ZodOptional<z.ZodString>;
1400
+ schemaVersion: z.ZodOptional<z.ZodString>;
1401
+ }, z.core.$strict>>;
1402
+ references: z.ZodArray<z.ZodString>;
1403
+ paramsSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1404
+ judge: z.ZodOptional<z.ZodObject<{
1405
+ id: z.ZodString;
1406
+ version: z.ZodString;
1407
+ location: z.ZodOptional<z.ZodEnum<{
1408
+ app: "app";
1409
+ studio: "studio";
1410
+ }>>;
1411
+ }, z.core.$strict>>;
1412
+ }, z.core.$strict>;
1413
+ declare const EvalProgressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1414
+ type: z.ZodLiteral<"run-started">;
1415
+ caseIds: z.ZodArray<z.ZodString>;
1416
+ repetitions: z.ZodNumber;
1417
+ concurrency: z.ZodNumber;
1418
+ }, z.core.$strict>, z.ZodObject<{
1419
+ type: z.ZodLiteral<"case-progress">;
1420
+ caseId: z.ZodString;
1421
+ repetition: z.ZodNumber;
1422
+ phase: z.ZodEnum<{
1423
+ params: "params";
1424
+ execute: "execute";
1425
+ setup: "setup";
1426
+ responder: "responder";
1427
+ reference: "reference";
1428
+ grading: "grading";
1429
+ cleanup: "cleanup";
1430
+ reporting: "reporting";
1431
+ }>;
1432
+ stepIndex: z.ZodOptional<z.ZodNumber>;
1433
+ }, z.core.$strict>, z.ZodObject<{
1434
+ type: z.ZodLiteral<"case-started">;
1435
+ caseId: z.ZodString;
1436
+ repetition: z.ZodNumber;
1437
+ sessionId: z.ZodString;
1438
+ }, z.core.$strict>, z.ZodObject<{
1439
+ type: z.ZodLiteral<"step-completed">;
1440
+ caseId: z.ZodString;
1441
+ repetition: z.ZodNumber;
1442
+ step: z.ZodObject<{
1443
+ index: z.ZodNumber;
1444
+ input: z.ZodUnion<readonly [z.ZodObject<{
1445
+ message: z.ZodString;
1446
+ }, z.core.$strict>, z.ZodObject<{
1447
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
1448
+ type: z.ZodLiteral<"text">;
1449
+ text: z.ZodString;
1450
+ }, z.core.$strict>, z.ZodObject<{
1451
+ type: z.ZodLiteral<"select">;
1452
+ ids: z.ZodArray<z.ZodString>;
1453
+ }, z.core.$strict>, z.ZodObject<{
1454
+ type: z.ZodLiteral<"value">;
1455
+ value: z.ZodJSONSchema;
1456
+ }, z.core.$strict>, z.ZodObject<{
1457
+ type: z.ZodLiteral<"cancel">;
1458
+ }, z.core.$strict>], "type">;
1459
+ }, z.core.$strict>]>;
1460
+ expectation: z.ZodObject<{
1461
+ type: z.ZodEnum<{
1462
+ interrupt: "interrupt";
1463
+ answer: "answer";
1464
+ }>;
1465
+ schemaId: z.ZodOptional<z.ZodString>;
1466
+ schemaVersion: z.ZodOptional<z.ZodString>;
1467
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1468
+ schemaId: z.ZodString;
1469
+ schemaVersion: z.ZodOptional<z.ZodString>;
1470
+ }, z.core.$strict>>>;
1471
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1472
+ id: z.ZodString;
1473
+ text: z.ZodString;
1474
+ }, z.core.$strict>]>>>;
1475
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1476
+ }, z.core.$strict>;
1477
+ observation: z.ZodObject<{
1478
+ type: z.ZodEnum<{
1479
+ cancelled: "cancelled";
1480
+ interrupt: "interrupt";
1481
+ error: "error";
1482
+ answer: "answer";
1483
+ }>;
1484
+ text: z.ZodString;
1485
+ structured: z.ZodArray<z.ZodJSONSchema>;
1486
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
1487
+ runId: z.ZodOptional<z.ZodString>;
1488
+ checkpointId: z.ZodOptional<z.ZodString>;
1489
+ interrupt: z.ZodOptional<z.ZodObject<{
1490
+ requestId: z.ZodString;
1491
+ kind: z.ZodEnum<{
1492
+ text: "text";
1493
+ custom: "custom";
1494
+ "multi-choice": "multi-choice";
1495
+ choice: "choice";
1496
+ }>;
1497
+ question: z.ZodOptional<z.ZodString>;
1498
+ schemaId: z.ZodOptional<z.ZodString>;
1499
+ schemaVersion: z.ZodOptional<z.ZodString>;
1500
+ options: z.ZodArray<z.ZodObject<{
1501
+ id: z.ZodString;
1502
+ label: z.ZodString;
1503
+ description: z.ZodOptional<z.ZodString>;
1504
+ }, z.core.$strict>>;
1505
+ request: z.ZodOptional<z.ZodJSONSchema>;
1506
+ }, z.core.$strict>>;
1507
+ }, z.core.$strict>;
1508
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1509
+ status: z.ZodEnum<{
1510
+ cancelled: "cancelled";
1511
+ failed: "failed";
1512
+ error: "error";
1513
+ passed: "passed";
1514
+ ungraded: "ungraded";
1515
+ }>;
1516
+ reason: z.ZodOptional<z.ZodString>;
1517
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
1518
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1519
+ provider: z.ZodString;
1520
+ model: z.ZodString;
1521
+ occurredAt: z.ZodISODateTime;
1522
+ usage: z.ZodOptional<z.ZodObject<{
1523
+ input: z.ZodOptional<z.ZodNumber>;
1524
+ output: z.ZodOptional<z.ZodNumber>;
1525
+ total: z.ZodOptional<z.ZodNumber>;
1526
+ reasoning: z.ZodOptional<z.ZodNumber>;
1527
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1528
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1529
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1530
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1531
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1532
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1533
+ }, z.core.$strict>>;
1534
+ pricingContext: z.ZodOptional<z.ZodObject<{
1535
+ serviceTier: z.ZodOptional<z.ZodString>;
1536
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1537
+ speed: z.ZodOptional<z.ZodString>;
1538
+ }, z.core.$strict>>;
1539
+ pricing: z.ZodOptional<z.ZodObject<{
1540
+ source: z.ZodLiteral<"provider">;
1541
+ currency: z.ZodLiteral<"USD">;
1542
+ actualCostMicros: z.ZodNumber;
1543
+ }, z.core.$strict>>;
1544
+ }, z.core.$strict>>>;
1545
+ criteria: z.ZodArray<z.ZodObject<{
1546
+ passed: z.ZodBoolean;
1547
+ reason: z.ZodString;
1548
+ evidence: z.ZodArray<z.ZodString>;
1549
+ id: z.ZodString;
1550
+ text: z.ZodString;
1551
+ }, z.core.$strict>>;
1552
+ }, z.core.$strict>;
1553
+ }, z.core.$strict>, z.ZodObject<{
1554
+ type: z.ZodLiteral<"case-completed">;
1555
+ result: z.ZodObject<{
1556
+ caseId: z.ZodString;
1557
+ repetition: z.ZodNumber;
1558
+ sessionId: z.ZodString;
1559
+ status: z.ZodEnum<{
1560
+ cancelled: "cancelled";
1561
+ failed: "failed";
1562
+ error: "error";
1563
+ passed: "passed";
1564
+ ungraded: "ungraded";
1565
+ }>;
1566
+ durationMs: z.ZodNumber;
1567
+ steps: z.ZodArray<z.ZodObject<{
1568
+ index: z.ZodNumber;
1569
+ input: z.ZodUnion<readonly [z.ZodObject<{
1570
+ message: z.ZodString;
1571
+ }, z.core.$strict>, z.ZodObject<{
1572
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
1573
+ type: z.ZodLiteral<"text">;
1574
+ text: z.ZodString;
1575
+ }, z.core.$strict>, z.ZodObject<{
1576
+ type: z.ZodLiteral<"select">;
1577
+ ids: z.ZodArray<z.ZodString>;
1578
+ }, z.core.$strict>, z.ZodObject<{
1579
+ type: z.ZodLiteral<"value">;
1580
+ value: z.ZodJSONSchema;
1581
+ }, z.core.$strict>, z.ZodObject<{
1582
+ type: z.ZodLiteral<"cancel">;
1583
+ }, z.core.$strict>], "type">;
1584
+ }, z.core.$strict>]>;
1585
+ expectation: z.ZodObject<{
1586
+ type: z.ZodEnum<{
1587
+ interrupt: "interrupt";
1588
+ answer: "answer";
1589
+ }>;
1590
+ schemaId: z.ZodOptional<z.ZodString>;
1591
+ schemaVersion: z.ZodOptional<z.ZodString>;
1592
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1593
+ schemaId: z.ZodString;
1594
+ schemaVersion: z.ZodOptional<z.ZodString>;
1595
+ }, z.core.$strict>>>;
1596
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1597
+ id: z.ZodString;
1598
+ text: z.ZodString;
1599
+ }, z.core.$strict>]>>>;
1600
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1601
+ }, z.core.$strict>;
1602
+ observation: z.ZodObject<{
1603
+ type: z.ZodEnum<{
1604
+ cancelled: "cancelled";
1605
+ interrupt: "interrupt";
1606
+ error: "error";
1607
+ answer: "answer";
1608
+ }>;
1609
+ text: z.ZodString;
1610
+ structured: z.ZodArray<z.ZodJSONSchema>;
1611
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
1612
+ runId: z.ZodOptional<z.ZodString>;
1613
+ checkpointId: z.ZodOptional<z.ZodString>;
1614
+ interrupt: z.ZodOptional<z.ZodObject<{
1615
+ requestId: z.ZodString;
1616
+ kind: z.ZodEnum<{
1617
+ text: "text";
1618
+ custom: "custom";
1619
+ "multi-choice": "multi-choice";
1620
+ choice: "choice";
1621
+ }>;
1622
+ question: z.ZodOptional<z.ZodString>;
1623
+ schemaId: z.ZodOptional<z.ZodString>;
1624
+ schemaVersion: z.ZodOptional<z.ZodString>;
1625
+ options: z.ZodArray<z.ZodObject<{
1626
+ id: z.ZodString;
1627
+ label: z.ZodString;
1628
+ description: z.ZodOptional<z.ZodString>;
1629
+ }, z.core.$strict>>;
1630
+ request: z.ZodOptional<z.ZodJSONSchema>;
1631
+ }, z.core.$strict>>;
1632
+ }, z.core.$strict>;
1633
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1634
+ status: z.ZodEnum<{
1635
+ cancelled: "cancelled";
1636
+ failed: "failed";
1637
+ error: "error";
1638
+ passed: "passed";
1639
+ ungraded: "ungraded";
1640
+ }>;
1641
+ reason: z.ZodOptional<z.ZodString>;
1642
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
1643
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1644
+ provider: z.ZodString;
1645
+ model: z.ZodString;
1646
+ occurredAt: z.ZodISODateTime;
1647
+ usage: z.ZodOptional<z.ZodObject<{
1648
+ input: z.ZodOptional<z.ZodNumber>;
1649
+ output: z.ZodOptional<z.ZodNumber>;
1650
+ total: z.ZodOptional<z.ZodNumber>;
1651
+ reasoning: z.ZodOptional<z.ZodNumber>;
1652
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1653
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1654
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1655
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1656
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1657
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1658
+ }, z.core.$strict>>;
1659
+ pricingContext: z.ZodOptional<z.ZodObject<{
1660
+ serviceTier: z.ZodOptional<z.ZodString>;
1661
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1662
+ speed: z.ZodOptional<z.ZodString>;
1663
+ }, z.core.$strict>>;
1664
+ pricing: z.ZodOptional<z.ZodObject<{
1665
+ source: z.ZodLiteral<"provider">;
1666
+ currency: z.ZodLiteral<"USD">;
1667
+ actualCostMicros: z.ZodNumber;
1668
+ }, z.core.$strict>>;
1669
+ }, z.core.$strict>>>;
1670
+ criteria: z.ZodArray<z.ZodObject<{
1671
+ passed: z.ZodBoolean;
1672
+ reason: z.ZodString;
1673
+ evidence: z.ZodArray<z.ZodString>;
1674
+ id: z.ZodString;
1675
+ text: z.ZodString;
1676
+ }, z.core.$strict>>;
1677
+ }, z.core.$strict>>;
1678
+ errors: z.ZodArray<z.ZodObject<{
1679
+ phase: z.ZodEnum<{
1680
+ params: "params";
1681
+ execute: "execute";
1682
+ setup: "setup";
1683
+ responder: "responder";
1684
+ reference: "reference";
1685
+ grading: "grading";
1686
+ cleanup: "cleanup";
1687
+ reporting: "reporting";
1688
+ }>;
1689
+ code: z.ZodString;
1690
+ message: z.ZodString;
1691
+ }, z.core.$strict>>;
1692
+ }, z.core.$strict>;
1693
+ }, z.core.$strict>], "type">;
1694
+ declare const EvalRemoteRunRequestSchema: z.ZodObject<{
1695
+ suiteId: z.ZodString;
1696
+ suiteRevision: z.ZodString;
1697
+ grading: z.ZodOptional<z.ZodEnum<{
1698
+ app: "app";
1699
+ studio: "studio";
1700
+ }>>;
1701
+ judge: z.ZodOptional<z.ZodObject<{
1702
+ id: z.ZodString;
1703
+ version: z.ZodString;
1704
+ location: z.ZodOptional<z.ZodEnum<{
1705
+ app: "app";
1706
+ studio: "studio";
1707
+ }>>;
1708
+ }, z.core.$strict>>;
1709
+ caseIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1710
+ repetitions: z.ZodDefault<z.ZodNumber>;
1711
+ concurrency: z.ZodDefault<z.ZodNumber>;
1712
+ }, z.core.$strict>;
1713
+ declare const StudioEvalStartRequestSchema: z.ZodObject<{
1714
+ suiteId: z.ZodString;
1715
+ suiteRevision: z.ZodString;
1716
+ caseIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1717
+ repetitions: z.ZodDefault<z.ZodNumber>;
1718
+ concurrency: z.ZodDefault<z.ZodNumber>;
1719
+ targetId: z.ZodString;
1720
+ judge: z.ZodDefault<z.ZodEnum<{
1721
+ app: "app";
1722
+ studio: "studio";
1723
+ }>>;
1724
+ }, z.core.$strict>;
1725
+ declare const EvalWireEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1726
+ type: z.ZodLiteral<"progress">;
1727
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
1728
+ type: z.ZodLiteral<"run-started">;
1729
+ caseIds: z.ZodArray<z.ZodString>;
1730
+ repetitions: z.ZodNumber;
1731
+ concurrency: z.ZodNumber;
1732
+ }, z.core.$strict>, z.ZodObject<{
1733
+ type: z.ZodLiteral<"case-progress">;
1734
+ caseId: z.ZodString;
1735
+ repetition: z.ZodNumber;
1736
+ phase: z.ZodEnum<{
1737
+ params: "params";
1738
+ execute: "execute";
1739
+ setup: "setup";
1740
+ responder: "responder";
1741
+ reference: "reference";
1742
+ grading: "grading";
1743
+ cleanup: "cleanup";
1744
+ reporting: "reporting";
1745
+ }>;
1746
+ stepIndex: z.ZodOptional<z.ZodNumber>;
1747
+ }, z.core.$strict>, z.ZodObject<{
1748
+ type: z.ZodLiteral<"case-started">;
1749
+ caseId: z.ZodString;
1750
+ repetition: z.ZodNumber;
1751
+ sessionId: z.ZodString;
1752
+ }, z.core.$strict>, z.ZodObject<{
1753
+ type: z.ZodLiteral<"step-completed">;
1754
+ caseId: z.ZodString;
1755
+ repetition: z.ZodNumber;
1756
+ step: z.ZodObject<{
1757
+ index: z.ZodNumber;
1758
+ input: z.ZodUnion<readonly [z.ZodObject<{
1759
+ message: z.ZodString;
1760
+ }, z.core.$strict>, z.ZodObject<{
1761
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
1762
+ type: z.ZodLiteral<"text">;
1763
+ text: z.ZodString;
1764
+ }, z.core.$strict>, z.ZodObject<{
1765
+ type: z.ZodLiteral<"select">;
1766
+ ids: z.ZodArray<z.ZodString>;
1767
+ }, z.core.$strict>, z.ZodObject<{
1768
+ type: z.ZodLiteral<"value">;
1769
+ value: z.ZodJSONSchema;
1770
+ }, z.core.$strict>, z.ZodObject<{
1771
+ type: z.ZodLiteral<"cancel">;
1772
+ }, z.core.$strict>], "type">;
1773
+ }, z.core.$strict>]>;
1774
+ expectation: z.ZodObject<{
1775
+ type: z.ZodEnum<{
1776
+ interrupt: "interrupt";
1777
+ answer: "answer";
1778
+ }>;
1779
+ schemaId: z.ZodOptional<z.ZodString>;
1780
+ schemaVersion: z.ZodOptional<z.ZodString>;
1781
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1782
+ schemaId: z.ZodString;
1783
+ schemaVersion: z.ZodOptional<z.ZodString>;
1784
+ }, z.core.$strict>>>;
1785
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1786
+ id: z.ZodString;
1787
+ text: z.ZodString;
1788
+ }, z.core.$strict>]>>>;
1789
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1790
+ }, z.core.$strict>;
1791
+ observation: z.ZodObject<{
1792
+ type: z.ZodEnum<{
1793
+ cancelled: "cancelled";
1794
+ interrupt: "interrupt";
1795
+ error: "error";
1796
+ answer: "answer";
1797
+ }>;
1798
+ text: z.ZodString;
1799
+ structured: z.ZodArray<z.ZodJSONSchema>;
1800
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
1801
+ runId: z.ZodOptional<z.ZodString>;
1802
+ checkpointId: z.ZodOptional<z.ZodString>;
1803
+ interrupt: z.ZodOptional<z.ZodObject<{
1804
+ requestId: z.ZodString;
1805
+ kind: z.ZodEnum<{
1806
+ text: "text";
1807
+ custom: "custom";
1808
+ "multi-choice": "multi-choice";
1809
+ choice: "choice";
1810
+ }>;
1811
+ question: z.ZodOptional<z.ZodString>;
1812
+ schemaId: z.ZodOptional<z.ZodString>;
1813
+ schemaVersion: z.ZodOptional<z.ZodString>;
1814
+ options: z.ZodArray<z.ZodObject<{
1815
+ id: z.ZodString;
1816
+ label: z.ZodString;
1817
+ description: z.ZodOptional<z.ZodString>;
1818
+ }, z.core.$strict>>;
1819
+ request: z.ZodOptional<z.ZodJSONSchema>;
1820
+ }, z.core.$strict>>;
1821
+ }, z.core.$strict>;
1822
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1823
+ status: z.ZodEnum<{
1824
+ cancelled: "cancelled";
1825
+ failed: "failed";
1826
+ error: "error";
1827
+ passed: "passed";
1828
+ ungraded: "ungraded";
1829
+ }>;
1830
+ reason: z.ZodOptional<z.ZodString>;
1831
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
1832
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1833
+ provider: z.ZodString;
1834
+ model: z.ZodString;
1835
+ occurredAt: z.ZodISODateTime;
1836
+ usage: z.ZodOptional<z.ZodObject<{
1837
+ input: z.ZodOptional<z.ZodNumber>;
1838
+ output: z.ZodOptional<z.ZodNumber>;
1839
+ total: z.ZodOptional<z.ZodNumber>;
1840
+ reasoning: z.ZodOptional<z.ZodNumber>;
1841
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1842
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1843
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1844
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1845
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1846
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1847
+ }, z.core.$strict>>;
1848
+ pricingContext: z.ZodOptional<z.ZodObject<{
1849
+ serviceTier: z.ZodOptional<z.ZodString>;
1850
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1851
+ speed: z.ZodOptional<z.ZodString>;
1852
+ }, z.core.$strict>>;
1853
+ pricing: z.ZodOptional<z.ZodObject<{
1854
+ source: z.ZodLiteral<"provider">;
1855
+ currency: z.ZodLiteral<"USD">;
1856
+ actualCostMicros: z.ZodNumber;
1857
+ }, z.core.$strict>>;
1858
+ }, z.core.$strict>>>;
1859
+ criteria: z.ZodArray<z.ZodObject<{
1860
+ passed: z.ZodBoolean;
1861
+ reason: z.ZodString;
1862
+ evidence: z.ZodArray<z.ZodString>;
1863
+ id: z.ZodString;
1864
+ text: z.ZodString;
1865
+ }, z.core.$strict>>;
1866
+ }, z.core.$strict>;
1867
+ }, z.core.$strict>, z.ZodObject<{
1868
+ type: z.ZodLiteral<"case-completed">;
1869
+ result: z.ZodObject<{
1870
+ caseId: z.ZodString;
1871
+ repetition: z.ZodNumber;
1872
+ sessionId: z.ZodString;
1873
+ status: z.ZodEnum<{
1874
+ cancelled: "cancelled";
1875
+ failed: "failed";
1876
+ error: "error";
1877
+ passed: "passed";
1878
+ ungraded: "ungraded";
1879
+ }>;
1880
+ durationMs: z.ZodNumber;
1881
+ steps: z.ZodArray<z.ZodObject<{
1882
+ index: z.ZodNumber;
1883
+ input: z.ZodUnion<readonly [z.ZodObject<{
1884
+ message: z.ZodString;
1885
+ }, z.core.$strict>, z.ZodObject<{
1886
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
1887
+ type: z.ZodLiteral<"text">;
1888
+ text: z.ZodString;
1889
+ }, z.core.$strict>, z.ZodObject<{
1890
+ type: z.ZodLiteral<"select">;
1891
+ ids: z.ZodArray<z.ZodString>;
1892
+ }, z.core.$strict>, z.ZodObject<{
1893
+ type: z.ZodLiteral<"value">;
1894
+ value: z.ZodJSONSchema;
1895
+ }, z.core.$strict>, z.ZodObject<{
1896
+ type: z.ZodLiteral<"cancel">;
1897
+ }, z.core.$strict>], "type">;
1898
+ }, z.core.$strict>]>;
1899
+ expectation: z.ZodObject<{
1900
+ type: z.ZodEnum<{
1901
+ interrupt: "interrupt";
1902
+ answer: "answer";
1903
+ }>;
1904
+ schemaId: z.ZodOptional<z.ZodString>;
1905
+ schemaVersion: z.ZodOptional<z.ZodString>;
1906
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1907
+ schemaId: z.ZodString;
1908
+ schemaVersion: z.ZodOptional<z.ZodString>;
1909
+ }, z.core.$strict>>>;
1910
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1911
+ id: z.ZodString;
1912
+ text: z.ZodString;
1913
+ }, z.core.$strict>]>>>;
1914
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1915
+ }, z.core.$strict>;
1916
+ observation: z.ZodObject<{
1917
+ type: z.ZodEnum<{
1918
+ cancelled: "cancelled";
1919
+ interrupt: "interrupt";
1920
+ error: "error";
1921
+ answer: "answer";
1922
+ }>;
1923
+ text: z.ZodString;
1924
+ structured: z.ZodArray<z.ZodJSONSchema>;
1925
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
1926
+ runId: z.ZodOptional<z.ZodString>;
1927
+ checkpointId: z.ZodOptional<z.ZodString>;
1928
+ interrupt: z.ZodOptional<z.ZodObject<{
1929
+ requestId: z.ZodString;
1930
+ kind: z.ZodEnum<{
1931
+ text: "text";
1932
+ custom: "custom";
1933
+ "multi-choice": "multi-choice";
1934
+ choice: "choice";
1935
+ }>;
1936
+ question: z.ZodOptional<z.ZodString>;
1937
+ schemaId: z.ZodOptional<z.ZodString>;
1938
+ schemaVersion: z.ZodOptional<z.ZodString>;
1939
+ options: z.ZodArray<z.ZodObject<{
1940
+ id: z.ZodString;
1941
+ label: z.ZodString;
1942
+ description: z.ZodOptional<z.ZodString>;
1943
+ }, z.core.$strict>>;
1944
+ request: z.ZodOptional<z.ZodJSONSchema>;
1945
+ }, z.core.$strict>>;
1946
+ }, z.core.$strict>;
1947
+ reference: z.ZodOptional<z.ZodJSONSchema>;
1948
+ status: z.ZodEnum<{
1949
+ cancelled: "cancelled";
1950
+ failed: "failed";
1951
+ error: "error";
1952
+ passed: "passed";
1953
+ ungraded: "ungraded";
1954
+ }>;
1955
+ reason: z.ZodOptional<z.ZodString>;
1956
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
1957
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1958
+ provider: z.ZodString;
1959
+ model: z.ZodString;
1960
+ occurredAt: z.ZodISODateTime;
1961
+ usage: z.ZodOptional<z.ZodObject<{
1962
+ input: z.ZodOptional<z.ZodNumber>;
1963
+ output: z.ZodOptional<z.ZodNumber>;
1964
+ total: z.ZodOptional<z.ZodNumber>;
1965
+ reasoning: z.ZodOptional<z.ZodNumber>;
1966
+ cacheRead: z.ZodOptional<z.ZodNumber>;
1967
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
1968
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
1969
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
1970
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
1971
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
1972
+ }, z.core.$strict>>;
1973
+ pricingContext: z.ZodOptional<z.ZodObject<{
1974
+ serviceTier: z.ZodOptional<z.ZodString>;
1975
+ inferenceGeo: z.ZodOptional<z.ZodString>;
1976
+ speed: z.ZodOptional<z.ZodString>;
1977
+ }, z.core.$strict>>;
1978
+ pricing: z.ZodOptional<z.ZodObject<{
1979
+ source: z.ZodLiteral<"provider">;
1980
+ currency: z.ZodLiteral<"USD">;
1981
+ actualCostMicros: z.ZodNumber;
1982
+ }, z.core.$strict>>;
1983
+ }, z.core.$strict>>>;
1984
+ criteria: z.ZodArray<z.ZodObject<{
1985
+ passed: z.ZodBoolean;
1986
+ reason: z.ZodString;
1987
+ evidence: z.ZodArray<z.ZodString>;
1988
+ id: z.ZodString;
1989
+ text: z.ZodString;
1990
+ }, z.core.$strict>>;
1991
+ }, z.core.$strict>>;
1992
+ errors: z.ZodArray<z.ZodObject<{
1993
+ phase: z.ZodEnum<{
1994
+ params: "params";
1995
+ execute: "execute";
1996
+ setup: "setup";
1997
+ responder: "responder";
1998
+ reference: "reference";
1999
+ grading: "grading";
2000
+ cleanup: "cleanup";
2001
+ reporting: "reporting";
2002
+ }>;
2003
+ code: z.ZodString;
2004
+ message: z.ZodString;
2005
+ }, z.core.$strict>>;
2006
+ }, z.core.$strict>;
2007
+ }, z.core.$strict>], "type">;
2008
+ }, z.core.$strict>, z.ZodObject<{
2009
+ type: z.ZodLiteral<"result">;
2010
+ result: z.ZodObject<{
2011
+ id: z.ZodUUID;
2012
+ suiteId: z.ZodString;
2013
+ suiteRevision: z.ZodString;
2014
+ suite: z.ZodObject<{
2015
+ id: z.ZodString;
2016
+ name: z.ZodOptional<z.ZodString>;
2017
+ cases: z.ZodArray<z.ZodObject<{
2018
+ id: z.ZodString;
2019
+ name: z.ZodOptional<z.ZodString>;
2020
+ params: z.ZodOptional<z.ZodJSONSchema>;
2021
+ workflowId: z.ZodOptional<z.ZodString>;
2022
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2023
+ message: z.ZodString;
2024
+ expect: z.ZodObject<{
2025
+ type: z.ZodEnum<{
2026
+ interrupt: "interrupt";
2027
+ answer: "answer";
2028
+ }>;
2029
+ schemaId: z.ZodOptional<z.ZodString>;
2030
+ schemaVersion: z.ZodOptional<z.ZodString>;
2031
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2032
+ schemaId: z.ZodString;
2033
+ schemaVersion: z.ZodOptional<z.ZodString>;
2034
+ }, z.core.$strict>>>;
2035
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
2036
+ id: z.ZodString;
2037
+ text: z.ZodString;
2038
+ }, z.core.$strict>]>>>;
2039
+ reference: z.ZodOptional<z.ZodJSONSchema>;
2040
+ }, z.core.$strict>;
2041
+ }, z.core.$strict>, z.ZodObject<{
2042
+ resume: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
2043
+ type: z.ZodLiteral<"text">;
2044
+ text: z.ZodString;
2045
+ }, z.core.$strict>, z.ZodObject<{
2046
+ type: z.ZodLiteral<"select">;
2047
+ ids: z.ZodArray<z.ZodString>;
2048
+ }, z.core.$strict>, z.ZodObject<{
2049
+ type: z.ZodLiteral<"value">;
2050
+ value: z.ZodJSONSchema;
2051
+ }, z.core.$strict>, z.ZodObject<{
2052
+ type: z.ZodLiteral<"cancel">;
2053
+ }, z.core.$strict>], "type">, z.ZodObject<{
2054
+ using: z.ZodString;
2055
+ params: z.ZodOptional<z.ZodJSONSchema>;
2056
+ }, z.core.$strict>]>;
2057
+ expect: z.ZodObject<{
2058
+ type: z.ZodEnum<{
2059
+ interrupt: "interrupt";
2060
+ answer: "answer";
2061
+ }>;
2062
+ schemaId: z.ZodOptional<z.ZodString>;
2063
+ schemaVersion: z.ZodOptional<z.ZodString>;
2064
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2065
+ schemaId: z.ZodString;
2066
+ schemaVersion: z.ZodOptional<z.ZodString>;
2067
+ }, z.core.$strict>>>;
2068
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
2069
+ id: z.ZodString;
2070
+ text: z.ZodString;
2071
+ }, z.core.$strict>]>>>;
2072
+ reference: z.ZodOptional<z.ZodJSONSchema>;
2073
+ }, z.core.$strict>;
2074
+ }, z.core.$strict>]>>;
2075
+ }, z.core.$strict>>;
2076
+ }, z.core.$strict>;
2077
+ judge: z.ZodOptional<z.ZodObject<{
2078
+ id: z.ZodString;
2079
+ version: z.ZodString;
2080
+ location: z.ZodOptional<z.ZodEnum<{
2081
+ app: "app";
2082
+ studio: "studio";
2083
+ }>>;
2084
+ }, z.core.$strict>>;
2085
+ startedAt: z.ZodISODateTime;
2086
+ durationMs: z.ZodNumber;
2087
+ status: z.ZodEnum<{
2088
+ cancelled: "cancelled";
2089
+ failed: "failed";
2090
+ error: "error";
2091
+ passed: "passed";
2092
+ ungraded: "ungraded";
2093
+ }>;
2094
+ counts: z.ZodObject<{
2095
+ passed: z.ZodNumber;
2096
+ failed: z.ZodNumber;
2097
+ error: z.ZodNumber;
2098
+ cancelled: z.ZodNumber;
2099
+ ungraded: z.ZodOptional<z.ZodNumber>;
2100
+ }, z.core.$strict>;
2101
+ cases: z.ZodArray<z.ZodObject<{
2102
+ caseId: z.ZodString;
2103
+ repetition: z.ZodNumber;
2104
+ sessionId: z.ZodString;
2105
+ status: z.ZodEnum<{
2106
+ cancelled: "cancelled";
2107
+ failed: "failed";
2108
+ error: "error";
2109
+ passed: "passed";
2110
+ ungraded: "ungraded";
2111
+ }>;
2112
+ durationMs: z.ZodNumber;
2113
+ steps: z.ZodArray<z.ZodObject<{
2114
+ index: z.ZodNumber;
2115
+ input: z.ZodUnion<readonly [z.ZodObject<{
2116
+ message: z.ZodString;
2117
+ }, z.core.$strict>, z.ZodObject<{
2118
+ resume: z.ZodDiscriminatedUnion<[z.ZodObject<{
2119
+ type: z.ZodLiteral<"text">;
2120
+ text: z.ZodString;
2121
+ }, z.core.$strict>, z.ZodObject<{
2122
+ type: z.ZodLiteral<"select">;
2123
+ ids: z.ZodArray<z.ZodString>;
2124
+ }, z.core.$strict>, z.ZodObject<{
2125
+ type: z.ZodLiteral<"value">;
2126
+ value: z.ZodJSONSchema;
2127
+ }, z.core.$strict>, z.ZodObject<{
2128
+ type: z.ZodLiteral<"cancel">;
2129
+ }, z.core.$strict>], "type">;
2130
+ }, z.core.$strict>]>;
2131
+ expectation: z.ZodObject<{
2132
+ type: z.ZodEnum<{
2133
+ interrupt: "interrupt";
2134
+ answer: "answer";
2135
+ }>;
2136
+ schemaId: z.ZodOptional<z.ZodString>;
2137
+ schemaVersion: z.ZodOptional<z.ZodString>;
2138
+ outputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2139
+ schemaId: z.ZodString;
2140
+ schemaVersion: z.ZodOptional<z.ZodString>;
2141
+ }, z.core.$strict>>>;
2142
+ criteria: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
2143
+ id: z.ZodString;
2144
+ text: z.ZodString;
2145
+ }, z.core.$strict>]>>>;
2146
+ reference: z.ZodOptional<z.ZodJSONSchema>;
2147
+ }, z.core.$strict>;
2148
+ observation: z.ZodObject<{
2149
+ type: z.ZodEnum<{
2150
+ cancelled: "cancelled";
2151
+ interrupt: "interrupt";
2152
+ error: "error";
2153
+ answer: "answer";
2154
+ }>;
2155
+ text: z.ZodString;
2156
+ structured: z.ZodArray<z.ZodJSONSchema>;
2157
+ events: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
2158
+ runId: z.ZodOptional<z.ZodString>;
2159
+ checkpointId: z.ZodOptional<z.ZodString>;
2160
+ interrupt: z.ZodOptional<z.ZodObject<{
2161
+ requestId: z.ZodString;
2162
+ kind: z.ZodEnum<{
2163
+ text: "text";
2164
+ custom: "custom";
2165
+ "multi-choice": "multi-choice";
2166
+ choice: "choice";
2167
+ }>;
2168
+ question: z.ZodOptional<z.ZodString>;
2169
+ schemaId: z.ZodOptional<z.ZodString>;
2170
+ schemaVersion: z.ZodOptional<z.ZodString>;
2171
+ options: z.ZodArray<z.ZodObject<{
2172
+ id: z.ZodString;
2173
+ label: z.ZodString;
2174
+ description: z.ZodOptional<z.ZodString>;
2175
+ }, z.core.$strict>>;
2176
+ request: z.ZodOptional<z.ZodJSONSchema>;
2177
+ }, z.core.$strict>>;
2178
+ }, z.core.$strict>;
2179
+ reference: z.ZodOptional<z.ZodJSONSchema>;
2180
+ status: z.ZodEnum<{
2181
+ cancelled: "cancelled";
2182
+ failed: "failed";
2183
+ error: "error";
2184
+ passed: "passed";
2185
+ ungraded: "ungraded";
2186
+ }>;
2187
+ reason: z.ZodOptional<z.ZodString>;
2188
+ judgeCalls: z.ZodOptional<z.ZodNumber>;
2189
+ judgeUsage: z.ZodOptional<z.ZodArray<z.ZodObject<{
2190
+ provider: z.ZodString;
2191
+ model: z.ZodString;
2192
+ occurredAt: z.ZodISODateTime;
2193
+ usage: z.ZodOptional<z.ZodObject<{
2194
+ input: z.ZodOptional<z.ZodNumber>;
2195
+ output: z.ZodOptional<z.ZodNumber>;
2196
+ total: z.ZodOptional<z.ZodNumber>;
2197
+ reasoning: z.ZodOptional<z.ZodNumber>;
2198
+ cacheRead: z.ZodOptional<z.ZodNumber>;
2199
+ cacheWrite: z.ZodOptional<z.ZodNumber>;
2200
+ cacheWrite1h: z.ZodOptional<z.ZodNumber>;
2201
+ outputIncludesReasoning: z.ZodOptional<z.ZodBoolean>;
2202
+ inputIncludesCacheRead: z.ZodOptional<z.ZodBoolean>;
2203
+ inputIncludesCacheWrite: z.ZodOptional<z.ZodBoolean>;
2204
+ }, z.core.$strict>>;
2205
+ pricingContext: z.ZodOptional<z.ZodObject<{
2206
+ serviceTier: z.ZodOptional<z.ZodString>;
2207
+ inferenceGeo: z.ZodOptional<z.ZodString>;
2208
+ speed: z.ZodOptional<z.ZodString>;
2209
+ }, z.core.$strict>>;
2210
+ pricing: z.ZodOptional<z.ZodObject<{
2211
+ source: z.ZodLiteral<"provider">;
2212
+ currency: z.ZodLiteral<"USD">;
2213
+ actualCostMicros: z.ZodNumber;
2214
+ }, z.core.$strict>>;
2215
+ }, z.core.$strict>>>;
2216
+ criteria: z.ZodArray<z.ZodObject<{
2217
+ passed: z.ZodBoolean;
2218
+ reason: z.ZodString;
2219
+ evidence: z.ZodArray<z.ZodString>;
2220
+ id: z.ZodString;
2221
+ text: z.ZodString;
2222
+ }, z.core.$strict>>;
2223
+ }, z.core.$strict>>;
2224
+ errors: z.ZodArray<z.ZodObject<{
2225
+ phase: z.ZodEnum<{
2226
+ params: "params";
2227
+ execute: "execute";
2228
+ setup: "setup";
2229
+ responder: "responder";
2230
+ reference: "reference";
2231
+ grading: "grading";
2232
+ cleanup: "cleanup";
2233
+ reporting: "reporting";
2234
+ }>;
2235
+ code: z.ZodString;
2236
+ message: z.ZodString;
2237
+ }, z.core.$strict>>;
2238
+ }, z.core.$strict>>;
2239
+ errors: z.ZodArray<z.ZodObject<{
2240
+ phase: z.ZodEnum<{
2241
+ params: "params";
2242
+ execute: "execute";
2243
+ setup: "setup";
2244
+ responder: "responder";
2245
+ reference: "reference";
2246
+ grading: "grading";
2247
+ cleanup: "cleanup";
2248
+ reporting: "reporting";
2249
+ }>;
2250
+ code: z.ZodString;
2251
+ message: z.ZodString;
2252
+ }, z.core.$strict>>;
2253
+ }, z.core.$strict>;
2254
+ }, z.core.$strict>, z.ZodObject<{
2255
+ type: z.ZodLiteral<"error">;
2256
+ message: z.ZodString;
2257
+ }, z.core.$strict>], "type">;
2258
+ type EvalManifest = z.infer<typeof EvalManifestSchema>;
2259
+ type EvalRemoteRunRequest = z.infer<typeof EvalRemoteRunRequestSchema>;
2260
+ type EvalWireEvent = z.infer<typeof EvalWireEventSchema>;
2261
+ declare class EvalConfigurationError extends Error {
2262
+ name: string;
2263
+ }
2264
+ declare function parseEvalSuite(value: unknown): EvalSuite;
2265
+
2266
+ type DefinedSuite<Params> = Omit<EvalSuite<Params>, "cases"> & {
2267
+ cases: readonly (Omit<EvalCase<Params>, "params"> & (undefined extends Params ? {
2268
+ params?: Exclude<Params, undefined>;
2269
+ } : {
2270
+ params: Params;
2271
+ }))[];
2272
+ };
2273
+ /** Author a suite with typed case parameters. Runtime validation belongs to createEvals. */
2274
+ declare function defineSuite<Params = EvalJson | undefined>(suite: DefinedSuite<Params>): DefinedSuite<Params>;
2275
+
2276
+ /** Discover and pin the Studio backend's judge; grading never runs in the browser. */
2277
+ declare function createStudioEvalJudge(options: StudioEvalJudgeOptions): Promise<EvalJudge>;
2278
+
2279
+ export { StudioEvalStartRequestSchema as $, type EvalOutputExpectation as A, type EvalPhase as B, type CreateEvalsOptions as C, type EvalProgress as D, type EvalCase as E, EvalProgressSchema as F, type EvalRemoteRunRequest as G, EvalRemoteRunRequestSchema as H, type EvalResponder as I, EvalResumeResponseSchema as J, type EvalRunOptions as K, type EvalRunResult as L, EvalRunResultSchema as M, type EvalSetupContext as N, type EvalStatus as O, type EvalStep as P, type EvalStepResult as Q, EvalStepResultSchema as R, type EvalSuite as S, EvalSuiteSchema as T, type EvalVerdict as U, EvalVerdictSchema as V, type EvalWireEvent as W, EvalWireEventSchema as X, type StudioEvalJudgeOptions as Y, StudioEvalJudgeRequestSchema as Z, StudioEvalJudgeResponseSchema as _, type EvalCaseResult as a, createStudioEvalJudge as a0, defineSuite as a1, parseEvalSuite as a2, type ChatLifecyclePhase as a3, ChatLifecycleHookError as a4, type Agent as a5, type ChatResponseFinalized as a6, type AgentProcessOptions as a7, type AgentProjectTopologyOptions as a8, type ChatResponseStatus as a9, type CreateAgentArgs as aa, type ExecutableWorkflow as ab, type ExecuteOptions as ac, type ExecutionInfo as ad, type ExecutionInterrupt as ae, ExecutionRequestError as af, type ExecutionResult as ag, type InterruptScope as ah, type ListInterruptsOptions as ai, type PendingInterrupt as aj, type ResumableInterrupt as ak, type ResumeHandle as al, type ResumeOptions as am, type ResumeResponse as an, createAgent as ao, projectWorkflowTopology as ap, EvalCaseResultSchema as b, type EvalCommand as c, EvalConfigurationError as d, type EvalContext as e, type EvalCriterion as f, type EvalCriterionResult as g, type EvalDefaults as h, type EvalExecution as i, type EvalExecutionStatus as j, type EvalExpectation as k, type EvalGradeInput as l, type EvalHandlerRef as m, type EvalInterrupt as n, type EvalIssue as o, type EvalJson as p, type EvalJudge as q, type EvalJudgeIdentity as r, EvalJudgeIdentitySchema as s, type EvalJudgeOptions as t, type EvalJudgeUsage as u, EvalJudgeUsageSchema as v, type EvalManifest as w, EvalManifestSchema as x, type EvalObservation as y, EvalObservationSchema as z };