@leostera/evalkit 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +70 -6
  2. package/README.md +10 -8
  3. package/dist/cli.mjs +1227 -258
  4. package/dist/dashboard/assets/index-CTJpd8q8.js +34 -0
  5. package/dist/dashboard/assets/index-YAabTN3X.css +2 -0
  6. package/dist/dashboard/index.html +2 -2
  7. package/dist/files-C-U0-PWW.mjs +0 -2
  8. package/dist/index-db-vbqEGFaU.mjs +0 -2
  9. package/dist/index.d.mts +1346 -2
  10. package/dist/index.d.mts.map +1 -1
  11. package/dist/index.mjs +2 -4
  12. package/dist/runner.d.mts +809 -11
  13. package/dist/runner.d.mts.map +1 -1
  14. package/dist/runner.mjs +2 -2
  15. package/dist/share-worker.d.mts +76 -1
  16. package/dist/share-worker.d.mts.map +1 -1
  17. package/dist/share-worker.mjs +0 -2
  18. package/dist/share.d.mts +149 -6
  19. package/dist/share.d.mts.map +1 -1
  20. package/dist/share.mjs +1 -1
  21. package/dist/skills/evalkit/SKILL.md +32 -0
  22. package/dist/skills/evalkit-agents/SKILL.md +16 -0
  23. package/dist/skills/evalkit-datasets/SKILL.md +17 -0
  24. package/dist/skills/evalkit-evals/SKILL.md +19 -0
  25. package/dist/skills/evalkit-judges/SKILL.md +17 -0
  26. package/dist/skills/evalkit-matrices/SKILL.md +14 -0
  27. package/dist/skills/evalkit-results/SKILL.md +14 -0
  28. package/dist/{src-DoPs9Yug.mjs → src-CKqOzeBi.mjs} +448 -116
  29. package/dist/{src-ButXPY8P.mjs → src-CZPufWN_.mjs} +419 -94
  30. package/dist/{src-DzZueFn3.mjs → src-CZnDXP1K.mjs} +46 -10
  31. package/package.json +3 -2
  32. package/dist/cli.mjs.map +0 -1
  33. package/dist/dashboard/assets/index-D9NtA46z.css +0 -2
  34. package/dist/dashboard/assets/index-DrBwLKJD.js +0 -30
  35. package/dist/files-C-U0-PWW.mjs.map +0 -1
  36. package/dist/index-db-HdZXelOS.d.mts +0 -142
  37. package/dist/index-db-HdZXelOS.d.mts.map +0 -1
  38. package/dist/index-db-vbqEGFaU.mjs.map +0 -1
  39. package/dist/index-lOw0fmak.d.mts +0 -1028
  40. package/dist/index-lOw0fmak.d.mts.map +0 -1
  41. package/dist/index.mjs.map +0 -1
  42. package/dist/share-worker.mjs.map +0 -1
  43. package/dist/src-ButXPY8P.mjs.map +0 -1
  44. package/dist/src-DoPs9Yug.mjs.map +0 -1
  45. package/dist/src-DzZueFn3.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,4 +1,1348 @@
1
- import { $ as TrajectoryEvent, $t as canonicalParameters, A as FixtureContext, At as JsonValueSchema, B as ReportStore, Bt as TrialManifestSchema, C as EvalRegistryMetadata, Ct as registerEvals, D as ExpectToolCallStep, Dt as ArtifactEntrySchema, E as EvaluatorWorkspace, Et as ApiErrorSchema, F as JsonValue, Ft as RunSourceSchema, G as RunStatus, Gt as EvalkitConfig, H as RunMetadata, Ht as TrialScoringSchema, I as JudgeRule, It as RunStatusSchema, J as RunnerEvent, Jt as defineConfig, K as RunSummary, Kt as ShareConfig, L as JudgeRunInfo, Lt as RunSummarySchema, M as InlineFixture, Mt as RecordedErrorSchema, N as JsonObject, Nt as RunManifestSchema, O as FileFixture, Ot as AutIdentitySchema, P as JsonPrimitive, Pt as RunMetadataSchema, Q as ScoringRule, Qt as defineEvalMatrix, R as PredicateScorer, Rt as ScoreResultSchema, S as EvalRegistry, St as recordError, T as EvalSuiteMetadata, Tt as parseTrajectoryJsonl, U as RunResult, Ut as TrialSummarySchema, V as RunCatalog, Vt as TrialMetadataSchema, W as RunSource, Wt as UsageSchema, X as ScoreValue, Xt as EvalMatrixCell, Y as ScoreResult, Yt as EvalMatrix, Z as ScoringContext, Zt as MatrixSelection, _ as EvalCatalogEntry, _t as expectToolCall, a as AggregateScoring, an as UuidSchema, at as TrialWriter, b as EvalPolicy, bt as judge, c as AutAdapter, cn as resourceUri, ct as UserStep, d as AutIdentity, dt as authoringId, en as ResourceKind, et as TranscriptStep, f as AutSession, ft as defineAgent, g as DynamicFixture, gt as dynamic, h as DirectoryFixture, ht as directory, i as AgentStep, in as Uuid, it as TrialSummary, j as FixtureVisibility, jt as JudgeRunInfoSchema, k as Fixture, kt as CheckpointResultSchema, l as AutContext, ln as resourceUriSchema, lt as WorkspaceView, m as CheckpointResult, mt as defineSuite, n as AgentRuntimeName, nn as ResourceUri, nt as TrialResult, o as ArtifactEntry, on as authorId, ot as TurnView, p as CandidateWorkspace, pt as defineEval, q as RunWriter, qt as ShareHeaders, r as AgentRuntimes, rn as ResourceUriSchema, rt as TrialScoring, s as ArtifactView, sn as parseResourceUri, st as Usage, t as AgentRuntime, tn as ResourceKindSchema, tt as TrialMetadata, u as AutEvent, un as resourceUuid, ut as agent, v as EvalCatalogFixture, vt as file, w as EvalSuite, wt as user, x as EvalRegistration, xt as predicate, y as EvalDefinition, yt as inlineFile, z as RecordedError, zt as TrajectoryEventSchema } from "./index-lOw0fmak.mjs";
1
+ import * as Schema from "effect/Schema";
2
+ //#region ../core/src/identity.d.ts
3
+ export declare const ResourceKindSchema: Schema.Literal<["run", "trial", "artifact"]>;
4
+ export type ResourceKind = typeof ResourceKindSchema.Type;
5
+ /** Human-authored project-local identifier; never a generated resource URI. */
6
+ export declare function authorId(value: string): string;
7
+ /** RFC 4122 textual UUID. EvalKit accepts v4/v7 and other valid UUID versions. */
8
+ export declare const UuidSchema: Schema.filter<typeof Schema.String>;
9
+ export type Uuid = typeof UuidSchema.Type;
10
+ export type ResourceUri<TKind extends ResourceKind = ResourceKind> = `evalkit:${TKind}:${string}`;
11
+ export declare const ResourceUriSchema: Schema.filter<typeof Schema.String>;
12
+ export declare function resourceUriSchema<TKind extends ResourceKind>(kind: TKind): Schema.filter<typeof Schema.String>;
13
+ export declare function resourceUri<TKind extends ResourceKind>(kind: TKind, uuid: Uuid): ResourceUri<TKind>;
14
+ export declare function parseResourceUri<TKind extends ResourceKind>(value: string, expectedKind?: TKind): {
15
+ kind: TKind;
16
+ uuid: Uuid;
17
+ uri: ResourceUri<TKind>;
18
+ };
19
+ export declare function resourceUuid(value: string, expectedKind?: ResourceKind): Uuid;
20
+ //#endregion
21
+ //#region ../core/src/dataset.d.ts
22
+ /** Who can see a dataset: the agent (and scorers), or only scorers. */
23
+ export type DatasetVisibility = 'candidate' | 'evaluator';
24
+ /** Inline text or bytes, or a file relative to the project root. */
25
+ export type DatasetFileSource = string | Uint8Array | {
26
+ file: string;
27
+ };
28
+ /**
29
+ * Files for the trial workspace: a directory relative to the project root, or
30
+ * a map from workspace path (below the dataset's mount) to its content.
31
+ */
32
+ export type DatasetFiles = string | Readonly<Record<string, DatasetFileSource>>;
33
+ /** What one trial receives from a dataset. */
34
+ export type DatasetContent = {
35
+ files?: DatasetFiles;
36
+ /** Any JSON-convertible value; converted once when the trial starts. */
37
+ value?: unknown;
38
+ };
39
+ export type DatasetLoadContext = {
40
+ /** The project root; relative paths in returned content resolve against it. */
41
+ root: string;
42
+ signal: AbortSignal;
43
+ };
44
+ export type DatasetTrialContext = {
45
+ evalId: string;
46
+ runId: string;
47
+ trialId: string;
48
+ trialIndex: number;
49
+ /** Per-trial random seed, so repeated trials can choose different data. */
50
+ seed: number;
51
+ /** The matrix cell's parameters, or `{}`. */
52
+ parameters: JsonObject;
53
+ signal: AbortSignal;
54
+ };
55
+ type DatasetCommon = {
56
+ id: string;
57
+ name?: string;
58
+ /** Default `candidate`. */
59
+ visibility?: DatasetVisibility;
60
+ /** Workspace directory for the dataset's files. Default: the dataset ID. `.` is the workspace root. */
61
+ mount?: string;
62
+ };
63
+ export type StaticDatasetDefinition = DatasetCommon & {
64
+ files?: DatasetFiles;
65
+ /** An inline value. Exclusive with `valueFile`. */
66
+ value?: unknown;
67
+ /** A `.json` file, or a `.jsonl` file read as an array of objects, relative to the project root. */
68
+ valueFile?: string;
69
+ onLoad?: never;
70
+ onRun?: never;
71
+ };
72
+ export type ComputedDatasetDefinition<TLoaded extends DatasetContent> = DatasetCommon & {
73
+ /** Once per process; the successful result is cached and shared by every trial. */
74
+ onLoad: (load: DatasetLoadContext) => TLoaded | Promise<TLoaded>;
75
+ /** Once per trial; defaults to using the loaded content as is. */
76
+ onRun?: (loaded: TLoaded, trial: DatasetTrialContext) => DatasetContent | Promise<DatasetContent>;
77
+ files?: never;
78
+ value?: never;
79
+ valueFile?: never;
80
+ };
81
+ export type DatasetSource = {
82
+ kind: 'static';
83
+ files?: DatasetFiles;
84
+ value?: unknown;
85
+ valueFile?: string;
86
+ } | {
87
+ kind: 'computed';
88
+ onLoad: (load: DatasetLoadContext) => DatasetContent | Promise<DatasetContent>;
89
+ onRun?: (loaded: DatasetContent, trial: DatasetTrialContext) => DatasetContent | Promise<DatasetContent>;
90
+ };
91
+ /** A checked dataset, as returned by `defineDataset`. Evals accept only these. */
92
+ export type Dataset = {
93
+ readonly kind: 'dataset';
94
+ readonly id: string;
95
+ readonly name?: string;
96
+ readonly visibility: DatasetVisibility;
97
+ /** Normalized relative POSIX path; `.` is the workspace root. */
98
+ readonly mount: string;
99
+ readonly source: DatasetSource;
100
+ };
101
+ /** Normalizes a relative POSIX path and rejects absolute or escaping ones. */
102
+ export declare function relativeDatasetPath(value: string, label: string): string;
103
+ /**
104
+ * Declares named data that scenarios use: files placed in each trial's
105
+ * workspace, a value for the agent and scorers, or both. Static datasets give
106
+ * `files`, `value` or `valueFile`; computed datasets give `onLoad` (cached per
107
+ * process) and optionally `onRun` (per trial).
108
+ */
109
+ export declare function defineDataset<TLoaded extends DatasetContent>(definition: StaticDatasetDefinition | ComputedDatasetDefinition<TLoaded>): Dataset;
110
+ export declare function isDataset(value: unknown): value is Dataset;
111
+ //#endregion
112
+ //#region ../core/src/aut-events.d.ts
113
+ /**
114
+ * Events as adapters emit them. Payloads accept any JSON-convertible value and
115
+ * timestamps are optional; EvalKit converts them once into `AutEvent`s.
116
+ */
117
+ export type AutEventInput = {
118
+ kind: 'started';
119
+ timestamp?: string;
120
+ } | {
121
+ kind: 'message';
122
+ role: 'system' | 'user' | 'assistant' | 'tool';
123
+ content: unknown;
124
+ timestamp?: string;
125
+ } | {
126
+ kind: 'tool-call';
127
+ id: string;
128
+ name: string;
129
+ arguments?: unknown;
130
+ timestamp?: string;
131
+ } | {
132
+ kind: 'tool-result';
133
+ id: string;
134
+ name?: string;
135
+ result?: unknown;
136
+ timestamp?: string;
137
+ } | {
138
+ kind: 'turn-started';
139
+ turn: number;
140
+ timestamp?: string;
141
+ } | {
142
+ kind: 'turn-completed';
143
+ turn: number;
144
+ timestamp?: string;
145
+ latencyMs?: number;
146
+ usage?: Usage;
147
+ } | {
148
+ kind: 'completed';
149
+ output?: unknown;
150
+ timestamp?: string;
151
+ } | {
152
+ kind: 'error';
153
+ error: RecordedError;
154
+ timestamp?: string;
155
+ };
156
+ export type TurnToolCall = {
157
+ name: string;
158
+ arguments?: unknown;
159
+ /** When given, a `tool-result` event is recorded after the call. */
160
+ result?: unknown;
161
+ id?: string;
162
+ };
163
+ /** What `send()` may return instead of (or as well as) emitting events. A string is the reply. */
164
+ export type TurnResult = string | {
165
+ reply?: unknown;
166
+ toolCalls?: readonly TurnToolCall[];
167
+ usage?: Usage;
168
+ };
169
+ /** Converts an adapter event into a recorded `AutEvent`. */
170
+ export declare function normalizeAutEvent(input: AutEventInput, now: () => Date): AutEvent;
171
+ /**
172
+ * The events a returned turn result stands for: each tool call (and its
173
+ * result), then the reply, then the usage as a `turn-completed` event.
174
+ */
175
+ export declare function turnResultEvents(result: TurnResult, turn: number, now: () => Date): AutEvent[];
176
+ //#endregion
177
+ //#region ../core/src/catalog.d.ts
178
+ /**
179
+ * What the dashboard's Library shows about each definition. Only definition
180
+ * data: names, kinds, settings, shapes and where it was defined. Never source
181
+ * code, and never dataset values (evaluator data must not reach the agent's
182
+ * side or a shared report), only their shape.
183
+ */
184
+ export type CatalogOptions = {
185
+ /** Project root; definition sites are reported relative to it, never absolute. */
186
+ root?: string;
187
+ };
188
+ export type EvalCatalogAgent = {
189
+ name?: string;
190
+ kind: string;
191
+ id?: string;
192
+ version?: string;
193
+ runtimes: Array<{
194
+ name: AgentRuntimeName;
195
+ kind: string;
196
+ }>;
197
+ /** `file:line` of its `defineAgent` call, relative to the project. */
198
+ definedAt?: string;
199
+ };
200
+ /** A value's shape, without its content. */
201
+ export type ValueShape = {
202
+ type: 'array';
203
+ items: number;
204
+ } | {
205
+ type: 'object';
206
+ keys: string[];
207
+ } | {
208
+ type: 'string' | 'number' | 'boolean' | 'null';
209
+ };
210
+ export type EvalCatalogDataset = {
211
+ id: string;
212
+ name?: string;
213
+ visibility: DatasetVisibility;
214
+ source: 'static' | 'computed';
215
+ mount: string;
216
+ /** Static datasets: a directory relative to the project, or the workspace paths of inline files. */
217
+ files?: {
218
+ directory: string;
219
+ } | {
220
+ paths: string[];
221
+ };
222
+ /** Static datasets: the inline value's shape, or the value file's path. */
223
+ value?: {
224
+ shape: ValueShape;
225
+ } | {
226
+ file: string;
227
+ };
228
+ /** Computed datasets: which hooks are defined. */
229
+ hooks?: {
230
+ onLoad: true;
231
+ onRun: boolean;
232
+ };
233
+ definedAt?: string;
234
+ };
235
+ export type EvalCatalogScorer = {
236
+ name: string;
237
+ kind: ScoringRule['kind'];
238
+ passAt?: number;
239
+ supportsPartial?: boolean;
240
+ /** Judges only. */
241
+ rubric?: string;
242
+ definedAt?: string;
243
+ };
244
+ export type EvalCatalogStep = {
245
+ kind: 'user';
246
+ message: string;
247
+ } | {
248
+ kind: 'agent';
249
+ expectation: JsonValue;
250
+ } | {
251
+ kind: 'expect-tool-call';
252
+ name: string;
253
+ arguments?: JsonValue;
254
+ } |
255
+ /** A predicate or judge checked at this point of the conversation. */
256
+ {
257
+ kind: 'checkpoint';
258
+ scorer: EvalCatalogScorer;
259
+ };
260
+ export type EvalCatalogEntry = {
261
+ id: string;
262
+ path: string;
263
+ name?: string;
264
+ suiteId?: string;
265
+ agent: EvalCatalogAgent;
266
+ /** The separate agent that runs judge rules, if any. */
267
+ judgeAgent?: EvalCatalogAgent;
268
+ datasets: EvalCatalogDataset[];
269
+ trialCount: number;
270
+ policy: {
271
+ trials: number;
272
+ timeoutMs?: number;
273
+ failfast?: boolean;
274
+ };
275
+ transcript: EvalCatalogStep[];
276
+ scorers: EvalCatalogScorer[];
277
+ metadata?: JsonValue;
278
+ /** `file:line` of its `defineEval` call, relative to the project. */
279
+ definedAt?: string;
280
+ };
281
+ export declare function catalogEntry(evaluation: EvalDefinition, suite: EvalSuite | undefined, options?: CatalogOptions): EvalCatalogEntry;
282
+ //#endregion
283
+ //#region ../core/src/canonical-json.d.ts
284
+ /** Canonical JSON: keys sorted recursively, array order preserved. Rejects non-JSON inputs. */
285
+ export declare function canonicalParameters(value: JsonValue): string;
286
+ //#endregion
287
+ //#region ../core/src/matrix.d.ts
288
+ type MatrixSelection = {
289
+ /** Base eval IDs. Unknown values fail before dispatch. */
290
+ evals?: readonly string[];
291
+ /** Select existing dimension values, rather than overwriting every cell with the same value. */
292
+ parameters?: Readonly<Record<string, readonly JsonValue[]>>;
293
+ /** Overrides for non-dimension execution settings (e.g. maxTokens). */
294
+ overrides?: JsonObject;
295
+ };
296
+ type EvalMatrixCell = {
297
+ matrixId: string;
298
+ /** Stable canonical key including matrix, base eval and effective parameters. */
299
+ key: string;
300
+ eval: EvalDefinition;
301
+ parameters: JsonObject;
302
+ };
303
+ type EvalMatrixDefinition = {
304
+ id: string;
305
+ name?: string;
306
+ evals: readonly EvalDefinition[];
307
+ parameters: Readonly<Record<string, readonly JsonValue[]>>;
308
+ defaults?: JsonObject;
309
+ /** Complete correlated assignments, crossed with independent parameters. */
310
+ cases?: readonly JsonObject[];
311
+ /** Partial patterns over declared dimensions; matching cells are never run. */
312
+ exclude?: readonly JsonObject[];
313
+ };
314
+ type EvalMatrix = EvalMatrixDefinition & {
315
+ kind: 'matrix';
316
+ count(selection?: MatrixSelection): number;
317
+ cells(selection?: MatrixSelection): IterableIterator<EvalMatrixCell>;
318
+ };
319
+ export declare function defineEvalMatrix<const T extends EvalMatrixDefinition>(definition: T): EvalMatrix & T;
320
+ //#endregion
321
+ //#region ../core/src/config.d.ts
322
+ type EvalkitConfig = {
323
+ /** Where scenarios are discovered. Default `scenarios`. Paths are relative to evalkit.config.js/ts. */
324
+ testDir?: string;
325
+ include?: readonly string[];
326
+ exclude?: readonly string[];
327
+ discovery?: {
328
+ /** Each directory directly below `testDir` is a suite. Default true. */
329
+ suites?: boolean;
330
+ };
331
+ /** Explicit definitions are an alternative to discovery (e.g. hosted registries). */
332
+ evals?: readonly EvalDefinition[];
333
+ registry?: EvalRegistry;
334
+ /** Applied to every discovered eval. Values are forwarded, never provider-interpreted. */
335
+ matrix?: Omit<EvalMatrixDefinition, 'evals' | 'id'> & {
336
+ id?: string;
337
+ };
338
+ execution?: {
339
+ concurrency?: number;
340
+ trials?: number;
341
+ maxCells?: number;
342
+ };
343
+ reportDir?: string;
344
+ sandboxDir?: string;
345
+ share?: ShareConfig;
346
+ };
347
+ /** HTTP header names and values. */
348
+ type ShareHeaders = Record<string, string>;
349
+ type ShareConfig = {
350
+ /** Where `evalkit share` uploads results. `EVALKIT_SHARE_URL` overrides it. */
351
+ url: string;
352
+ /**
353
+ * Extra headers for every request to the share server, e.g. credentials for
354
+ * an auth proxy in front of it. A function is called once per `evalkit share`
355
+ * (it may run a command to fetch a token). Values are never printed.
356
+ */
357
+ headers?: ShareHeaders | (() => ShareHeaders | Promise<ShareHeaders>);
358
+ };
359
+ /** Pure, typed project configuration. Loading/discovery belongs to the CLI. */
360
+ export declare function defineConfig<const T extends EvalkitConfig>(configuration: T): T;
361
+ //#endregion
362
+ //#region ../core/src/json.d.ts
363
+ /** A value that cannot be stored in a report, with the path of the offending part. */
364
+ export declare class NotJsonError extends Error {
365
+ readonly path: string;
366
+ readonly reason: string;
367
+ readonly name = "NotJsonError";
368
+ constructor(path: string, reason: string);
369
+ }
370
+ /**
371
+ * Converts an author-supplied value to JSON once, where it enters EvalKit.
372
+ * Honours `toJSON()` (so `Date` becomes an ISO string) and drops `undefined`
373
+ * object fields. Rejects functions, symbols, bigints, non-finite numbers and
374
+ * cycles, naming the path of the bad value.
375
+ */
376
+ export declare function toJson(value: unknown, path?: string): JsonValue;
377
+ /** `toJson` for values that must be objects, such as metadata. */
378
+ export declare function toJsonObject(value: unknown, path: string): {
379
+ [key: string]: JsonValue;
380
+ };
381
+ //#endregion
382
+ //#region ../core/src/definition-site.d.ts
383
+ /**
384
+ * Where an agent, dataset, judge or scenario was defined: the file and line of
385
+ * the call to its `define…` helper, read from the call stack the way test
386
+ * runners locate tests. Best effort: absent when the stack has no file frame
387
+ * (some bundlers, Workers). Kept off the object's own enumerable keys so it
388
+ * never changes equality, JSON or spreading.
389
+ */
390
+ type DefinitionSite = {
391
+ file: string;
392
+ line: number;
393
+ };
394
+ export declare function definitionSite(value: unknown): DefinitionSite | undefined;
395
+ //#endregion
396
+ //#region ../core/src/schema.d.ts
397
+ /** Runtime schemas for serialized EvalKit report and API boundaries. */
398
+ export declare const RunStatusSchema: Schema.Literal<["running", "completed", "failed", "cancelled"]>;
399
+ export declare const RecordedErrorSchema: Schema.Struct<{
400
+ name: typeof Schema.String;
401
+ message: typeof Schema.String;
402
+ stack: Schema.optional<typeof Schema.String>;
403
+ }>;
404
+ export declare const AutIdentitySchema: Schema.Struct<{
405
+ name: Schema.optional<typeof Schema.String>;
406
+ kind: typeof Schema.String;
407
+ id: typeof Schema.String;
408
+ version: Schema.optional<typeof Schema.String>;
409
+ }>;
410
+ export declare const JsonValueSchema: Schema.Schema<JsonValue>;
411
+ export declare const RunSourceSchema: Schema.Struct<{
412
+ repo: typeof Schema.String;
413
+ project: typeof Schema.String;
414
+ commit: typeof Schema.String;
415
+ ref: Schema.optional<typeof Schema.String>;
416
+ committedAt: Schema.optional<typeof Schema.String>;
417
+ dirty: typeof Schema.Boolean;
418
+ ci: Schema.optional<Schema.Struct<{
419
+ provider: typeof Schema.String;
420
+ pipeline: Schema.optional<typeof Schema.String>;
421
+ job: Schema.optional<typeof Schema.String>;
422
+ url: Schema.optional<typeof Schema.String>;
423
+ }>>;
424
+ }>;
425
+ export declare const RunMetadataSchema: Schema.Struct<{
426
+ schemaVersion: Schema.Literal<[2, 3, 4, 5]>;
427
+ runUri: Schema.filter<typeof Schema.String>;
428
+ evalId: typeof Schema.String;
429
+ suiteId: Schema.optional<typeof Schema.String>;
430
+ parameters: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Schema<JsonValue, JsonValue, never>>>;
431
+ matrix: Schema.optional<Schema.Struct<{
432
+ id: typeof Schema.String;
433
+ cellKey: typeof Schema.String;
434
+ }>>;
435
+ aut: Schema.optional<Schema.Struct<{
436
+ name: Schema.optional<typeof Schema.String>;
437
+ kind: typeof Schema.String;
438
+ id: typeof Schema.String;
439
+ version: Schema.optional<typeof Schema.String>;
440
+ }>>;
441
+ startedAt: typeof Schema.String;
442
+ source: Schema.optional<Schema.Struct<{
443
+ repo: typeof Schema.String;
444
+ project: typeof Schema.String;
445
+ commit: typeof Schema.String;
446
+ ref: Schema.optional<typeof Schema.String>;
447
+ committedAt: Schema.optional<typeof Schema.String>;
448
+ dirty: typeof Schema.Boolean;
449
+ ci: Schema.optional<Schema.Struct<{
450
+ provider: typeof Schema.String;
451
+ pipeline: Schema.optional<typeof Schema.String>;
452
+ job: Schema.optional<typeof Schema.String>;
453
+ url: Schema.optional<typeof Schema.String>;
454
+ }>>;
455
+ }>>;
456
+ process: Schema.optional<Schema.Struct<{
457
+ pid: typeof Schema.Number;
458
+ hostname: typeof Schema.String;
459
+ }>>;
460
+ }>;
461
+ export declare const TrialMetadataSchema: Schema.Struct<{
462
+ schemaVersion: Schema.Literal<[2, 3, 4, 5]>;
463
+ runUri: Schema.filter<typeof Schema.String>;
464
+ trialUri: Schema.filter<typeof Schema.String>;
465
+ trialIndex: typeof Schema.Number;
466
+ evalId: typeof Schema.String;
467
+ parameters: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Schema<JsonValue, JsonValue, never>>>;
468
+ matrix: Schema.optional<Schema.Struct<{
469
+ id: typeof Schema.String;
470
+ cellKey: typeof Schema.String;
471
+ }>>;
472
+ aut: Schema.optional<Schema.Struct<{
473
+ name: Schema.optional<typeof Schema.String>;
474
+ kind: typeof Schema.String;
475
+ id: typeof Schema.String;
476
+ version: Schema.optional<typeof Schema.String>;
477
+ }>>;
478
+ startedAt: typeof Schema.String;
479
+ datasets: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
480
+ id: typeof Schema.String;
481
+ visibility: Schema.Literal<["candidate", "evaluator"]>;
482
+ source: Schema.Literal<["static", "computed"]>;
483
+ digest: typeof Schema.String;
484
+ }>>>>;
485
+ }>;
486
+ /** On-disk manifests include a lifecycle status; older finalized manifests may still say running. */
487
+ export declare const RunManifestSchema: Schema.Struct<{
488
+ schemaVersion: Schema.Literal<[2, 3, 4, 5]>;
489
+ runUri: Schema.filter<typeof Schema.String>;
490
+ evalId: typeof Schema.String;
491
+ suiteId: Schema.optional<typeof Schema.String>;
492
+ parameters: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Schema<JsonValue, JsonValue, never>>>;
493
+ matrix: Schema.optional<Schema.Struct<{
494
+ id: typeof Schema.String;
495
+ cellKey: typeof Schema.String;
496
+ }>>;
497
+ aut: Schema.optional<Schema.Struct<{
498
+ name: Schema.optional<typeof Schema.String>;
499
+ kind: typeof Schema.String;
500
+ id: typeof Schema.String;
501
+ version: Schema.optional<typeof Schema.String>;
502
+ }>>;
503
+ startedAt: typeof Schema.String;
504
+ source: Schema.optional<Schema.Struct<{
505
+ repo: typeof Schema.String;
506
+ project: typeof Schema.String;
507
+ commit: typeof Schema.String;
508
+ ref: Schema.optional<typeof Schema.String>;
509
+ committedAt: Schema.optional<typeof Schema.String>;
510
+ dirty: typeof Schema.Boolean;
511
+ ci: Schema.optional<Schema.Struct<{
512
+ provider: typeof Schema.String;
513
+ pipeline: Schema.optional<typeof Schema.String>;
514
+ job: Schema.optional<typeof Schema.String>;
515
+ url: Schema.optional<typeof Schema.String>;
516
+ }>>;
517
+ }>>;
518
+ process: Schema.optional<Schema.Struct<{
519
+ pid: typeof Schema.Number;
520
+ hostname: typeof Schema.String;
521
+ }>>;
522
+ status: Schema.optional<Schema.Literal<["running", "completed", "failed", "cancelled"]>>;
523
+ }>;
524
+ export declare const TrialManifestSchema: Schema.Struct<{
525
+ schemaVersion: Schema.Literal<[2, 3, 4, 5]>;
526
+ runUri: Schema.filter<typeof Schema.String>;
527
+ trialUri: Schema.filter<typeof Schema.String>;
528
+ trialIndex: typeof Schema.Number;
529
+ evalId: typeof Schema.String;
530
+ parameters: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Schema<JsonValue, JsonValue, never>>>;
531
+ matrix: Schema.optional<Schema.Struct<{
532
+ id: typeof Schema.String;
533
+ cellKey: typeof Schema.String;
534
+ }>>;
535
+ aut: Schema.optional<Schema.Struct<{
536
+ name: Schema.optional<typeof Schema.String>;
537
+ kind: typeof Schema.String;
538
+ id: typeof Schema.String;
539
+ version: Schema.optional<typeof Schema.String>;
540
+ }>>;
541
+ startedAt: typeof Schema.String;
542
+ datasets: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
543
+ id: typeof Schema.String;
544
+ visibility: Schema.Literal<["candidate", "evaluator"]>;
545
+ source: Schema.Literal<["static", "computed"]>;
546
+ digest: typeof Schema.String;
547
+ }>>>>;
548
+ status: Schema.optional<Schema.Literal<["running", "completed", "failed", "cancelled"]>>;
549
+ }>;
550
+ export declare const UsageSchema: Schema.Struct<{
551
+ inputTokens: Schema.optional<typeof Schema.Number>;
552
+ outputTokens: Schema.optional<typeof Schema.Number>;
553
+ totalTokens: Schema.optional<typeof Schema.Number>;
554
+ }>;
555
+ export declare const JudgeRunInfoSchema: Schema.Struct<{
556
+ agent: Schema.optional<Schema.Struct<{
557
+ id: typeof Schema.String;
558
+ kind: typeof Schema.String;
559
+ name: Schema.optional<typeof Schema.String>;
560
+ version: Schema.optional<typeof Schema.String>;
561
+ }>>;
562
+ usage: Schema.optional<Schema.Struct<{
563
+ inputTokens: Schema.optional<typeof Schema.Number>;
564
+ outputTokens: Schema.optional<typeof Schema.Number>;
565
+ totalTokens: Schema.optional<typeof Schema.Number>;
566
+ }>>;
567
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
568
+ }>;
569
+ export declare const ScoreResultSchema: Schema.Struct<{
570
+ name: typeof Schema.String;
571
+ kind: Schema.Literal<["predicate", "judge"]>;
572
+ value: Schema.optional<typeof Schema.Number>;
573
+ passed: Schema.optional<typeof Schema.Boolean>;
574
+ explanation: Schema.optional<typeof Schema.String>;
575
+ evidence: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
576
+ judge: Schema.optional<Schema.Struct<{
577
+ agent: Schema.optional<Schema.Struct<{
578
+ id: typeof Schema.String;
579
+ kind: typeof Schema.String;
580
+ name: Schema.optional<typeof Schema.String>;
581
+ version: Schema.optional<typeof Schema.String>;
582
+ }>>;
583
+ usage: Schema.optional<Schema.Struct<{
584
+ inputTokens: Schema.optional<typeof Schema.Number>;
585
+ outputTokens: Schema.optional<typeof Schema.Number>;
586
+ totalTokens: Schema.optional<typeof Schema.Number>;
587
+ }>>;
588
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
589
+ }>>;
590
+ durationMs: typeof Schema.Number;
591
+ error: Schema.optional<Schema.Struct<{
592
+ name: typeof Schema.String;
593
+ message: typeof Schema.String;
594
+ stack: Schema.optional<typeof Schema.String>;
595
+ }>>;
596
+ skipped: Schema.optional<Schema.Literal<[true]>>;
597
+ }>;
598
+ export declare const CheckpointResultSchema: Schema.Struct<{
599
+ step: typeof Schema.Number;
600
+ kind: Schema.Literal<["predicate", "judge", "expect-tool-call"]>;
601
+ name: typeof Schema.String;
602
+ status: Schema.Literal<["passed", "failed", "error", "skipped"]>;
603
+ value: Schema.optional<typeof Schema.Number>;
604
+ passed: Schema.optional<typeof Schema.Boolean>;
605
+ explanation: Schema.optional<typeof Schema.String>;
606
+ evidence: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
607
+ judge: Schema.optional<Schema.Struct<{
608
+ agent: Schema.optional<Schema.Struct<{
609
+ id: typeof Schema.String;
610
+ kind: typeof Schema.String;
611
+ name: Schema.optional<typeof Schema.String>;
612
+ version: Schema.optional<typeof Schema.String>;
613
+ }>>;
614
+ usage: Schema.optional<Schema.Struct<{
615
+ inputTokens: Schema.optional<typeof Schema.Number>;
616
+ outputTokens: Schema.optional<typeof Schema.Number>;
617
+ totalTokens: Schema.optional<typeof Schema.Number>;
618
+ }>>;
619
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
620
+ }>>;
621
+ durationMs: Schema.optional<typeof Schema.Number>;
622
+ error: Schema.optional<Schema.Struct<{
623
+ name: typeof Schema.String;
624
+ message: typeof Schema.String;
625
+ stack: Schema.optional<typeof Schema.String>;
626
+ }>>;
627
+ matchedToolCall: Schema.optional<Schema.Struct<{
628
+ eventIndex: typeof Schema.Number;
629
+ id: typeof Schema.String;
630
+ }>>;
631
+ }>;
632
+ export declare const TrialScoringSchema: Schema.Struct<{
633
+ results: Schema.mutable<Schema.Array$<Schema.Struct<{
634
+ name: typeof Schema.String;
635
+ kind: Schema.Literal<["predicate", "judge"]>;
636
+ value: Schema.optional<typeof Schema.Number>;
637
+ passed: Schema.optional<typeof Schema.Boolean>;
638
+ explanation: Schema.optional<typeof Schema.String>;
639
+ evidence: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
640
+ judge: Schema.optional<Schema.Struct<{
641
+ agent: Schema.optional<Schema.Struct<{
642
+ id: typeof Schema.String;
643
+ kind: typeof Schema.String;
644
+ name: Schema.optional<typeof Schema.String>;
645
+ version: Schema.optional<typeof Schema.String>;
646
+ }>>;
647
+ usage: Schema.optional<Schema.Struct<{
648
+ inputTokens: Schema.optional<typeof Schema.Number>;
649
+ outputTokens: Schema.optional<typeof Schema.Number>;
650
+ totalTokens: Schema.optional<typeof Schema.Number>;
651
+ }>>;
652
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
653
+ }>>;
654
+ durationMs: typeof Schema.Number;
655
+ error: Schema.optional<Schema.Struct<{
656
+ name: typeof Schema.String;
657
+ message: typeof Schema.String;
658
+ stack: Schema.optional<typeof Schema.String>;
659
+ }>>;
660
+ skipped: Schema.optional<Schema.Literal<[true]>>;
661
+ }>>>;
662
+ checkpoints: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
663
+ step: typeof Schema.Number;
664
+ kind: Schema.Literal<["predicate", "judge", "expect-tool-call"]>;
665
+ name: typeof Schema.String;
666
+ status: Schema.Literal<["passed", "failed", "error", "skipped"]>;
667
+ value: Schema.optional<typeof Schema.Number>;
668
+ passed: Schema.optional<typeof Schema.Boolean>;
669
+ explanation: Schema.optional<typeof Schema.String>;
670
+ evidence: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
671
+ judge: Schema.optional<Schema.Struct<{
672
+ agent: Schema.optional<Schema.Struct<{
673
+ id: typeof Schema.String;
674
+ kind: typeof Schema.String;
675
+ name: Schema.optional<typeof Schema.String>;
676
+ version: Schema.optional<typeof Schema.String>;
677
+ }>>;
678
+ usage: Schema.optional<Schema.Struct<{
679
+ inputTokens: Schema.optional<typeof Schema.Number>;
680
+ outputTokens: Schema.optional<typeof Schema.Number>;
681
+ totalTokens: Schema.optional<typeof Schema.Number>;
682
+ }>>;
683
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
684
+ }>>;
685
+ durationMs: Schema.optional<typeof Schema.Number>;
686
+ error: Schema.optional<Schema.Struct<{
687
+ name: typeof Schema.String;
688
+ message: typeof Schema.String;
689
+ stack: Schema.optional<typeof Schema.String>;
690
+ }>>;
691
+ matchedToolCall: Schema.optional<Schema.Struct<{
692
+ eventIndex: typeof Schema.Number;
693
+ id: typeof Schema.String;
694
+ }>>;
695
+ }>>>>;
696
+ skippedScorers: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
697
+ overall: Schema.optional<typeof Schema.Number>;
698
+ passed: typeof Schema.Boolean;
699
+ }>;
700
+ export declare const ArtifactEntrySchema: Schema.Struct<{
701
+ path: typeof Schema.String;
702
+ kind: Schema.Literal<["file", "directory"]>;
703
+ size: Schema.optional<typeof Schema.Number>;
704
+ }>;
705
+ export declare const TrialSummarySchema: Schema.Struct<{
706
+ status: Schema.Literal<["running", "completed", "failed", "cancelled"]>;
707
+ endedAt: typeof Schema.String;
708
+ durationMs: Schema.optional<typeof Schema.Number>;
709
+ scoring: Schema.optional<Schema.Struct<{
710
+ results: Schema.mutable<Schema.Array$<Schema.Struct<{
711
+ name: typeof Schema.String;
712
+ kind: Schema.Literal<["predicate", "judge"]>;
713
+ value: Schema.optional<typeof Schema.Number>;
714
+ passed: Schema.optional<typeof Schema.Boolean>;
715
+ explanation: Schema.optional<typeof Schema.String>;
716
+ evidence: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
717
+ judge: Schema.optional<Schema.Struct<{
718
+ agent: Schema.optional<Schema.Struct<{
719
+ id: typeof Schema.String;
720
+ kind: typeof Schema.String;
721
+ name: Schema.optional<typeof Schema.String>;
722
+ version: Schema.optional<typeof Schema.String>;
723
+ }>>;
724
+ usage: Schema.optional<Schema.Struct<{
725
+ inputTokens: Schema.optional<typeof Schema.Number>;
726
+ outputTokens: Schema.optional<typeof Schema.Number>;
727
+ totalTokens: Schema.optional<typeof Schema.Number>;
728
+ }>>;
729
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
730
+ }>>;
731
+ durationMs: typeof Schema.Number;
732
+ error: Schema.optional<Schema.Struct<{
733
+ name: typeof Schema.String;
734
+ message: typeof Schema.String;
735
+ stack: Schema.optional<typeof Schema.String>;
736
+ }>>;
737
+ skipped: Schema.optional<Schema.Literal<[true]>>;
738
+ }>>>;
739
+ checkpoints: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
740
+ step: typeof Schema.Number;
741
+ kind: Schema.Literal<["predicate", "judge", "expect-tool-call"]>;
742
+ name: typeof Schema.String;
743
+ status: Schema.Literal<["passed", "failed", "error", "skipped"]>;
744
+ value: Schema.optional<typeof Schema.Number>;
745
+ passed: Schema.optional<typeof Schema.Boolean>;
746
+ explanation: Schema.optional<typeof Schema.String>;
747
+ evidence: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
748
+ judge: Schema.optional<Schema.Struct<{
749
+ agent: Schema.optional<Schema.Struct<{
750
+ id: typeof Schema.String;
751
+ kind: typeof Schema.String;
752
+ name: Schema.optional<typeof Schema.String>;
753
+ version: Schema.optional<typeof Schema.String>;
754
+ }>>;
755
+ usage: Schema.optional<Schema.Struct<{
756
+ inputTokens: Schema.optional<typeof Schema.Number>;
757
+ outputTokens: Schema.optional<typeof Schema.Number>;
758
+ totalTokens: Schema.optional<typeof Schema.Number>;
759
+ }>>;
760
+ events: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<JsonValue, JsonValue, never>>>>;
761
+ }>>;
762
+ durationMs: Schema.optional<typeof Schema.Number>;
763
+ error: Schema.optional<Schema.Struct<{
764
+ name: typeof Schema.String;
765
+ message: typeof Schema.String;
766
+ stack: Schema.optional<typeof Schema.String>;
767
+ }>>;
768
+ matchedToolCall: Schema.optional<Schema.Struct<{
769
+ eventIndex: typeof Schema.Number;
770
+ id: typeof Schema.String;
771
+ }>>;
772
+ }>>>>;
773
+ skippedScorers: Schema.optional<Schema.mutable<Schema.Array$<typeof Schema.String>>>;
774
+ overall: Schema.optional<typeof Schema.Number>;
775
+ passed: typeof Schema.Boolean;
776
+ }>>;
777
+ artifacts: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
778
+ path: typeof Schema.String;
779
+ kind: Schema.Literal<["file", "directory"]>;
780
+ size: Schema.optional<typeof Schema.Number>;
781
+ }>>>>;
782
+ error: Schema.optional<Schema.Struct<{
783
+ name: typeof Schema.String;
784
+ message: typeof Schema.String;
785
+ stack: Schema.optional<typeof Schema.String>;
786
+ }>>;
787
+ }>;
788
+ export declare const RunSummarySchema: Schema.Struct<{
789
+ status: Schema.Literal<["running", "completed", "failed", "cancelled"]>;
790
+ endedAt: typeof Schema.String;
791
+ durationMs: Schema.optional<typeof Schema.Number>;
792
+ trialCount: typeof Schema.Number;
793
+ passed: typeof Schema.Number;
794
+ failed: typeof Schema.Number;
795
+ cancelled: Schema.optional<typeof Schema.Number>;
796
+ error: Schema.optional<Schema.Struct<{
797
+ name: typeof Schema.String;
798
+ message: typeof Schema.String;
799
+ stack: Schema.optional<typeof Schema.String>;
800
+ }>>;
801
+ }>;
802
+ export declare const TrajectoryEventSchema: Schema.Schema<TrajectoryEvent>;
803
+ export declare const ApiErrorSchema: Schema.Struct<{
804
+ error: typeof Schema.String;
805
+ message: typeof Schema.String;
806
+ }>;
807
+ //#endregion
808
+ //#region ../core/src/trajectory.d.ts
809
+ /** Decode one private report's JSONL trajectory; reject malformed/non-event lines with their line number. */
810
+ export declare function parseTrajectoryJsonl(contents: string): TrajectoryEvent[];
811
+ //#endregion
812
+ //#region ../core/src/index.d.ts
813
+ export type JsonPrimitive = boolean | number | string | null;
814
+ export type JsonValue = JsonPrimitive | JsonValue[] | {
815
+ [key: string]: JsonValue;
816
+ };
817
+ export type JsonObject = {
818
+ [key: string]: JsonValue;
819
+ };
820
+ export type AutIdentity = {
821
+ /** Human-readable logical agent name shown in catalogs and dashboards. */
822
+ name?: string;
823
+ kind: string;
824
+ id: string;
825
+ version?: string;
826
+ };
827
+ export type AgentRuntimeName = 'local' | 'sandbox' | 'remote';
828
+ /**
829
+ * A serializable runtime requirement for an AUT. Concrete runtime packages own
830
+ * the interpretation of `kind` and `configuration`.
831
+ */
832
+ export type AgentRuntime = {
833
+ kind: string;
834
+ configuration?: JsonObject;
835
+ };
836
+ export type AgentRuntimes = Partial<Record<AgentRuntimeName, AgentRuntime>>;
837
+ export type Usage = {
838
+ inputTokens?: number;
839
+ outputTokens?: number;
840
+ totalTokens?: number;
841
+ };
842
+ export type RecordedError = {
843
+ name: string;
844
+ message: string;
845
+ stack?: string;
846
+ };
847
+ export type AutEvent = {
848
+ kind: 'started';
849
+ timestamp: string;
850
+ } | {
851
+ kind: 'message';
852
+ role: 'system' | 'user' | 'assistant' | 'tool';
853
+ content: JsonValue;
854
+ timestamp: string;
855
+ } | {
856
+ kind: 'tool-call';
857
+ id: string;
858
+ name: string;
859
+ arguments: JsonValue;
860
+ timestamp: string;
861
+ } | {
862
+ kind: 'tool-result';
863
+ id: string;
864
+ name?: string;
865
+ result: JsonValue;
866
+ timestamp: string;
867
+ } | {
868
+ kind: 'turn-started';
869
+ turn: number;
870
+ timestamp: string;
871
+ } | {
872
+ kind: 'turn-completed';
873
+ turn: number;
874
+ timestamp: string;
875
+ latencyMs?: number;
876
+ usage?: Usage;
877
+ } | {
878
+ kind: 'completed';
879
+ output?: JsonValue;
880
+ timestamp: string;
881
+ } | {
882
+ kind: 'error';
883
+ error: RecordedError;
884
+ timestamp: string;
885
+ };
886
+ export type RunnerEvent = {
887
+ kind: 'trial-started';
888
+ timestamp: string;
889
+ } | {
890
+ kind: 'transcript-step-started';
891
+ step: number;
892
+ /** The user message sent at this step; absent for checkpoints. */
893
+ message?: string;
894
+ timestamp: string;
895
+ } | {
896
+ kind: 'transcript-step-completed';
897
+ step: number;
898
+ timestamp: string;
899
+ } | {
900
+ kind: 'transcript-step-skipped';
901
+ step: number;
902
+ timestamp: string;
903
+ } | {
904
+ kind: 'checkpoint-started';
905
+ step: number;
906
+ name: string;
907
+ timestamp: string;
908
+ } | {
909
+ kind: 'checkpoint-completed';
910
+ step: number;
911
+ status: 'passed' | 'failed' | 'skipped';
912
+ timestamp: string;
913
+ } | {
914
+ kind: 'checkpoint-error';
915
+ step: number;
916
+ error: RecordedError;
917
+ timestamp: string;
918
+ } | {
919
+ kind: 'scorer-started';
920
+ scorer: string;
921
+ timestamp: string;
922
+ } | {
923
+ kind: 'scorer-completed';
924
+ scorer: string;
925
+ /** Absent when the scorer returned `skip()`. */
926
+ value?: number;
927
+ skipped?: true;
928
+ timestamp: string;
929
+ } | {
930
+ kind: 'scorer-failed';
931
+ scorer: string;
932
+ error: RecordedError;
933
+ timestamp: string;
934
+ } | {
935
+ kind: 'trial-completed';
936
+ timestamp: string;
937
+ } | {
938
+ kind: 'error';
939
+ error: RecordedError;
940
+ timestamp: string;
941
+ };
942
+ export type TrajectoryEvent = (AutEvent & {
943
+ source: 'aut';
944
+ }) | (RunnerEvent & {
945
+ source: 'runner';
946
+ });
947
+ export type WorkspaceView = {
948
+ /** Absolute path to this trial-scoped workspace. Do not persist it in reports. */
949
+ root: string;
950
+ };
951
+ export type CandidateWorkspace = WorkspaceView;
952
+ export type EvaluatorWorkspace = WorkspaceView;
953
+ export type AutContext = {
954
+ runId: string;
955
+ evalId: string;
956
+ trialId: string;
957
+ trialIndex: number;
958
+ metadata: JsonObject;
959
+ /** Run-time parameters supplied by the eval definition or CLI invocation. */
960
+ parameters?: JsonObject;
961
+ runtime?: AgentRuntimeName;
962
+ /** Values of the scenario's candidate datasets, by dataset ID. */
963
+ data: JsonObject;
964
+ /** Contains only resources visible to the AUT/model. */
965
+ workspace: CandidateWorkspace;
966
+ /** Private evaluator capability for trusted AUT adapters; never expose this to the model. */
967
+ evaluatorWorkspace: EvaluatorWorkspace;
968
+ };
969
+ export type AutAdapter<TMessage = string> = {
970
+ readonly identity?: AutIdentity;
971
+ /** Available execution environments for this AUT. Default: `{ local: { kind: 'in-process' } }`. */
972
+ readonly runtimes?: AgentRuntimes;
973
+ start(options: {
974
+ context: AutContext;
975
+ runtime?: AgentRuntime;
976
+ /** Optional: stream events as they happen. Returning a turn result from `send` is enough for most agents. */
977
+ onEvent: (event: AutEventInput) => void | Promise<void>;
978
+ }): Promise<AutSession<TMessage>>;
979
+ };
980
+ export type AutSession<TMessage = string> = {
981
+ /**
982
+ * Resolves once the AUT has completed the turn initiated by this message.
983
+ * It may return the turn's reply and tool calls instead of emitting events.
984
+ */
985
+ send(message: TMessage): Promise<void | TurnResult>;
986
+ /** Optional; defaults to doing nothing. */
987
+ close?(): Promise<void>;
988
+ };
989
+ /** Used when an agent declares no runtimes. */
990
+ export declare const DEFAULT_AGENT_RUNTIMES: AgentRuntimes;
991
+ /** The runtimes an agent can run in, applying the default. */
992
+ export declare function agentRuntimes(agent: AutAdapter<any>): AgentRuntimes;
993
+ /**
994
+ * Defines an Agent Under Test without coupling it to a runtime or transport.
995
+ * It preserves the adapter's concrete type for application-specific helpers.
996
+ */
997
+ export declare function defineAgent<const T extends AutAdapter>(agent: T): T;
998
+ export type UserStep = {
999
+ kind: 'user';
1000
+ message: string;
1001
+ };
1002
+ export type AgentStep = {
1003
+ kind: 'agent';
1004
+ expectation: JsonObject;
1005
+ };
1006
+ export type TurnView = {
1007
+ userStepIndex: number;
1008
+ events: readonly (AutEvent & {
1009
+ source: 'aut';
1010
+ })[];
1011
+ assistantMessages: readonly (Extract<AutEvent, {
1012
+ kind: 'message';
1013
+ }> & {
1014
+ role: 'assistant';
1015
+ source: 'aut';
1016
+ })[];
1017
+ toolCalls: readonly {
1018
+ eventIndex: number;
1019
+ id: string;
1020
+ name: string;
1021
+ arguments: JsonValue;
1022
+ resultObservation: 'observed' | 'absent' | 'ambiguous';
1023
+ result?: JsonValue;
1024
+ }[];
1025
+ lastAssistantText?: string;
1026
+ };
1027
+ export type ExpectToolCallStep = {
1028
+ kind: 'expect-tool-call';
1029
+ name: string;
1030
+ expected: {
1031
+ name: string;
1032
+ arguments?: JsonValue;
1033
+ };
1034
+ };
1035
+ export type TranscriptStep = UserStep | AgentStep | ScoringRule | ExpectToolCallStep;
1036
+ /** Observes a tool call in the preceding turn; never invokes a tool. */
1037
+ export declare function expectToolCall(expected: ExpectToolCallStep['expected']): ExpectToolCallStep;
1038
+ export declare function user(message: string): UserStep;
1039
+ export declare function agent(expectation: JsonObject): AgentStep;
1040
+ export type JudgeRunInfo = {
1041
+ agent?: AutIdentity;
1042
+ usage?: Usage;
1043
+ /** Judge-agent observations; never attributed to the AUT trajectory. */
1044
+ events?: JsonValue[];
1045
+ };
1046
+ /** A scorer's "does not apply" result; see `skip()`. */
1047
+ export type SkippedScore = {
1048
+ skipped: true;
1049
+ reason: string;
1050
+ };
1051
+ export type ScoreValue = number | SkippedScore | {
1052
+ value: number;
1053
+ passed?: boolean;
1054
+ explanation?: string;
1055
+ /** Any JSON-convertible value. */
1056
+ evidence?: unknown;
1057
+ /** Judge-agent evidence, never inferred from AUT usage. */
1058
+ judge?: JudgeRunInfo;
1059
+ };
1060
+ /**
1061
+ * Marks a scorer as not applicable to this trial. A skipped result neither
1062
+ * passes nor fails the trial and is left out of score averages.
1063
+ */
1064
+ export declare function skip(reason: string): SkippedScore;
1065
+ export type ScoreResult = {
1066
+ name: string;
1067
+ kind: 'predicate' | 'judge';
1068
+ value?: number;
1069
+ passed?: boolean;
1070
+ explanation?: string;
1071
+ evidence?: JsonValue;
1072
+ judge?: JudgeRunInfo;
1073
+ durationMs: number;
1074
+ error?: RecordedError;
1075
+ /** The scorer returned `skip()`; `explanation` holds the reason and there is no value. */
1076
+ skipped?: true;
1077
+ };
1078
+ export type ArtifactView = {
1079
+ candidate: CandidateWorkspace;
1080
+ evaluator: EvaluatorWorkspace;
1081
+ };
1082
+ export type ScoringContext = {
1083
+ context: AutContext;
1084
+ trajectory: {
1085
+ events: readonly TrajectoryEvent[];
1086
+ };
1087
+ artifacts: ArtifactView;
1088
+ /** Most recent completed turn; absent if no user message has been sent. */
1089
+ turn?: TurnView;
1090
+ /** Content of the last assistant message of `turn`. */
1091
+ output?: JsonValue;
1092
+ /** Values of all the scenario's datasets (candidate and evaluator), by dataset ID. */
1093
+ data: JsonObject;
1094
+ };
1095
+ export type PredicateScorer = {
1096
+ kind: 'predicate';
1097
+ name: string;
1098
+ supportsPartial?: boolean;
1099
+ /** A numeric result passes when it is at least this value. Default: only 1 passes. */
1100
+ passAt?: number;
1101
+ run(context: ScoringContext): boolean | ScoreValue | Promise<boolean | ScoreValue>;
1102
+ };
1103
+ export type JudgeRule = {
1104
+ kind: 'judge';
1105
+ name: string;
1106
+ rubric: string;
1107
+ /** Run even when the scenario stopped early or execution failed. */
1108
+ supportsPartial?: boolean;
1109
+ };
1110
+ export type ScoringRule = PredicateScorer | JudgeRule;
1111
+ export declare function predicate(name: string, run: PredicateScorer['run'], options?: Pick<PredicateScorer, 'supportsPartial' | 'passAt'>): PredicateScorer;
1112
+ export declare function judge(name: string, options: Pick<JudgeRule, 'rubric' | 'supportsPartial'>): JudgeRule;
1113
+ export type EvalPolicy = {
1114
+ timeoutMs?: number;
1115
+ /** Stop later transcript steps after a failed checkpoint assertion. Default false. */
1116
+ failfast?: boolean;
1117
+ /** Number of independent trials requested by local and hosted runners. */
1118
+ trials?: number;
1119
+ };
1120
+ export type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
1121
+ id: string;
1122
+ name?: string;
1123
+ agent: TAgent;
1124
+ /** Separate judge agent; its model and tools are never inherited from the AUT. */
1125
+ judge?: AutAdapter;
1126
+ /** Data and files the scenario uses; each trial gets its own copy. */
1127
+ datasets?: readonly Dataset[];
1128
+ transcript: TranscriptStep[];
1129
+ scoring: ScoringRule[];
1130
+ policy?: EvalPolicy;
1131
+ /** Any JSON-convertible object; converted when the eval is defined. */
1132
+ metadata?: Record<string, unknown>;
1133
+ };
1134
+ export declare function defineEval<const T extends EvalDefinition>(definition: T): T;
1135
+ export type EvalSuite<TEvals extends readonly EvalDefinition[] = readonly EvalDefinition[]> = {
1136
+ id: string;
1137
+ name?: string;
1138
+ evals: TEvals;
1139
+ };
1140
+ export declare function defineSuite<const TSuite extends EvalSuite>(suite: TSuite): TSuite;
1141
+ export type EvalRegistration = EvalDefinition | EvalSuite | EvalMatrix;
1142
+ export declare function authoringId(value: {
1143
+ id: string;
1144
+ }): string;
1145
+ export type EvalRegistry = {
1146
+ /** All registered evals, flattened from standalone entries and suites. */
1147
+ evals: readonly EvalDefinition[];
1148
+ suites: readonly EvalSuite[];
1149
+ matrices: readonly EvalMatrix[];
1150
+ get(uri: string): EvalDefinition | undefined;
1151
+ getSuite(uri: string): EvalSuite | undefined;
1152
+ metadata(): EvalRegistryMetadata[];
1153
+ suiteMetadata(): EvalSuiteMetadata[];
1154
+ /** Definition data for the dashboard; pass the project root to include where each thing is defined. */
1155
+ catalog(options?: CatalogOptions): EvalCatalogEntry[];
1156
+ };
1157
+ export type EvalRegistryMetadata = {
1158
+ id: string;
1159
+ name?: string;
1160
+ suiteId?: string;
1161
+ };
1162
+ export type EvalSuiteMetadata = {
1163
+ id: string;
1164
+ name?: string;
1165
+ evalIds: string[];
1166
+ };
1167
+ /**
1168
+ * Creates an explicit, statically imported eval registry. A suite is a
1169
+ * path-like grouping of evals; nesting is presentation derived from its ID.
1170
+ */
1171
+ export declare function registerEvals<const TRegistrations extends readonly EvalRegistration[]>(registrations: TRegistrations): EvalRegistry;
1172
+ export type RunStatus = 'running' | 'completed' | 'failed' | 'cancelled';
1173
+ /**
1174
+ * Where a run's eval code came from: the repository, eval project and commit.
1175
+ * Results are tagged with it; they are never stored in the repository itself.
1176
+ */
1177
+ export type RunSource = {
1178
+ /** Normalized repository key, e.g. `gitlab.example.com/group/repo`. */
1179
+ repo: string;
1180
+ /** Eval project directory relative to the repository root; `""` at the root. */
1181
+ project: string;
1182
+ /** Full commit SHA. */
1183
+ commit: string;
1184
+ ref?: string;
1185
+ committedAt?: string;
1186
+ /** True when the working tree had uncommitted changes at run time. */
1187
+ dirty: boolean;
1188
+ ci?: {
1189
+ provider: string;
1190
+ pipeline?: string;
1191
+ job?: string;
1192
+ url?: string;
1193
+ };
1194
+ };
1195
+ /** The project's evals and suites when a run started; written beside its manifest. */
1196
+ export type RunCatalog = {
1197
+ catalog: EvalCatalogEntry[];
1198
+ evals: EvalRegistryMetadata[];
1199
+ suites: EvalSuiteMetadata[];
1200
+ };
1201
+ /** The process that owns a running run, so readers can tell an interrupted run from a live one. */
1202
+ export type RunProcess = {
1203
+ pid: number;
1204
+ hostname: string;
1205
+ };
1206
+ export type RunMetadata = {
1207
+ schemaVersion: 2 | 3 | 4 | 5;
1208
+ runId: string;
1209
+ runUri: ResourceUri<'run'>;
1210
+ evalId: string;
1211
+ suiteId?: string;
1212
+ parameters?: JsonObject;
1213
+ matrix?: {
1214
+ id: string;
1215
+ cellKey: string;
1216
+ };
1217
+ aut?: AutIdentity;
1218
+ startedAt: string;
1219
+ /** Present from schema version 4 when the run's commit could be determined. */
1220
+ source?: RunSource;
1221
+ /** From schema version 5. */
1222
+ process?: RunProcess;
1223
+ };
1224
+ export type TrialMetadata = {
1225
+ schemaVersion: 2 | 3 | 4 | 5;
1226
+ runId: string;
1227
+ runUri: ResourceUri<'run'>;
1228
+ trialId: string;
1229
+ trialUri: ResourceUri<'trial'>;
1230
+ trialIndex: number;
1231
+ evalId: string;
1232
+ parameters?: JsonObject;
1233
+ matrix?: {
1234
+ id: string;
1235
+ cellKey: string;
1236
+ };
1237
+ aut?: AutIdentity;
1238
+ startedAt: string;
1239
+ /** From schema version 5: the datasets this trial used, with content digests. */
1240
+ datasets?: TrialDataset[];
1241
+ };
1242
+ export type TrialDataset = {
1243
+ id: string;
1244
+ visibility: DatasetVisibility;
1245
+ source: 'static' | 'computed';
1246
+ /** SHA-256 of the trial's content: file paths and bytes, and the canonical value. */
1247
+ digest: string;
1248
+ };
1249
+ export type CheckpointResult = {
1250
+ step: number;
1251
+ kind: 'predicate' | 'judge' | 'expect-tool-call';
1252
+ name: string;
1253
+ status: 'passed' | 'failed' | 'error' | 'skipped';
1254
+ value?: number;
1255
+ passed?: boolean;
1256
+ explanation?: string;
1257
+ evidence?: JsonValue;
1258
+ judge?: JudgeRunInfo;
1259
+ durationMs?: number;
1260
+ error?: RecordedError;
1261
+ matchedToolCall?: {
1262
+ eventIndex: number;
1263
+ id: string;
1264
+ };
1265
+ };
1266
+ export type TrialScoring = {
1267
+ results: ScoreResult[];
1268
+ checkpoints?: CheckpointResult[];
1269
+ skippedScorers?: string[];
1270
+ overall?: number;
1271
+ passed: boolean;
1272
+ };
1273
+ export type ArtifactEntry = {
1274
+ /** Path relative to this trial's artifact root. */
1275
+ path: string;
1276
+ kind: 'file' | 'directory';
1277
+ size?: number;
1278
+ };
1279
+ export type TrialSummary = {
1280
+ status: RunStatus;
1281
+ endedAt: string;
1282
+ durationMs?: number;
1283
+ scoring?: TrialScoring;
1284
+ artifacts?: ArtifactEntry[];
1285
+ error?: RecordedError;
1286
+ };
1287
+ export type RunSummary = {
1288
+ status: RunStatus;
1289
+ endedAt: string;
1290
+ durationMs?: number;
1291
+ trialCount: number;
1292
+ passed: number;
1293
+ failed: number;
1294
+ /** Trials stopped by cancellation; counted neither as passed nor failed. */
1295
+ cancelled?: number;
1296
+ error?: RecordedError;
1297
+ };
1298
+ export type TrialWriter = {
1299
+ appendEvent(event: TrajectoryEvent): Promise<void>;
1300
+ writeScores(scoring: TrialScoring): Promise<void>;
1301
+ /** Writes a file below this trial's artifact root. */
1302
+ writeArtifact(path: string, data: Uint8Array): Promise<void>;
1303
+ finalize(summary: TrialSummary): Promise<void>;
1304
+ };
1305
+ export type RunWriter = {
1306
+ readonly location: string;
1307
+ startTrial(metadata: TrialMetadata): Promise<TrialWriter>;
1308
+ finalize(summary: RunSummary): Promise<void>;
1309
+ };
1310
+ export type ReportStore = {
1311
+ startRun(metadata: RunMetadata, context?: {
1312
+ catalog?: RunCatalog;
1313
+ }): Promise<RunWriter>;
1314
+ };
1315
+ export type TrialResult = {
1316
+ runId: string;
1317
+ runUri: ResourceUri<'run'>;
1318
+ trialId: string;
1319
+ trialUri: ResourceUri<'trial'>;
1320
+ trialIndex: number;
1321
+ evalId: string;
1322
+ status: RunStatus;
1323
+ reportLocation: string;
1324
+ durationMs?: number;
1325
+ scoring?: TrialScoring;
1326
+ error?: RecordedError;
1327
+ };
1328
+ export type AggregateScoring = {
1329
+ passed: number;
1330
+ failed: number;
1331
+ cancelled?: number;
1332
+ passRate: number;
1333
+ overall?: number;
1334
+ };
1335
+ export type RunResult = TrialResult & {
1336
+ runId: string;
1337
+ trialCount?: number;
1338
+ passed?: number;
1339
+ failed?: number;
1340
+ aggregateScoring?: AggregateScoring;
1341
+ /** Present for an aggregate multi-trial run. */
1342
+ trials?: TrialResult[];
1343
+ };
1344
+ export declare function recordError(error: unknown): RecordedError;
1345
+ //#endregion
2
1346
  //#region ../agents/src/index.d.ts
3
1347
  type PiAutOptions = {
4
1348
  command?: string;
@@ -8,5 +1352,5 @@ type PiAutOptions = {
8
1352
  /** A local, one-prompt-per-turn AUT backed by Pi's non-interactive print mode. */
9
1353
  export declare function piAgent(options?: PiAutOptions): AutAdapter;
10
1354
  //#endregion
11
- export { AgentRuntime, AgentRuntimeName, AgentRuntimes, AgentStep, AggregateScoring, ApiErrorSchema, ArtifactEntry, ArtifactEntrySchema, ArtifactView, AutAdapter, AutContext, AutEvent, AutIdentity, AutIdentitySchema, AutSession, CandidateWorkspace, CheckpointResult, CheckpointResultSchema, DirectoryFixture, DynamicFixture, EvalCatalogEntry, EvalCatalogFixture, EvalDefinition, type EvalMatrix, type EvalMatrixCell, EvalPolicy, EvalRegistration, EvalRegistry, EvalRegistryMetadata, EvalSuite, EvalSuiteMetadata, type EvalkitConfig, EvaluatorWorkspace, ExpectToolCallStep, FileFixture, Fixture, FixtureContext, FixtureVisibility, InlineFixture, JsonObject, JsonPrimitive, JsonValue, JsonValueSchema, JudgeRule, JudgeRunInfo, JudgeRunInfoSchema, type MatrixSelection, PredicateScorer, RecordedError, RecordedErrorSchema, ReportStore, ResourceKind, ResourceKindSchema, ResourceUri, ResourceUriSchema, RunCatalog, RunManifestSchema, RunMetadata, RunMetadataSchema, RunResult, RunSource, RunSourceSchema, RunStatus, RunStatusSchema, RunSummary, RunSummarySchema, RunWriter, RunnerEvent, ScoreResult, ScoreResultSchema, ScoreValue, ScoringContext, ScoringRule, type ShareConfig, type ShareHeaders, TrajectoryEvent, TrajectoryEventSchema, TranscriptStep, TrialManifestSchema, TrialMetadata, TrialMetadataSchema, TrialResult, TrialScoring, TrialScoringSchema, TrialSummary, TrialSummarySchema, TrialWriter, TurnView, Usage, UsageSchema, UserStep, Uuid, UuidSchema, WorkspaceView, agent, authorId, authoringId, canonicalParameters, defineAgent, defineConfig, defineEval, defineEvalMatrix, defineSuite, directory, dynamic, expectToolCall, file, inlineFile, judge, parseResourceUri, parseTrajectoryJsonl, predicate, recordError, registerEvals, resourceUri, resourceUriSchema, resourceUuid, user };
1355
+ export type { DefinitionSite, EvalMatrix, EvalMatrixCell, EvalkitConfig, MatrixSelection, ShareConfig, ShareHeaders };
12
1356
  //# sourceMappingURL=index.d.mts.map