@leostera/evalkit 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -1
- package/dist/cli.mjs +182 -73
- package/dist/dashboard/assets/index-CFJzcw3o.css +2 -0
- package/dist/dashboard/assets/{index-DNR4shrM.js → index-DgoX2x_M.js} +34 -32
- package/dist/dashboard/index.html +2 -2
- package/dist/{index-db-B1FeXzmS.mjs → index-db-DI7xKMSX.mjs} +237 -47
- package/dist/index.d.mts +837 -220
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +241 -52
- package/dist/runner.d.mts +568 -227
- package/dist/runner.d.mts.map +1 -1
- package/dist/runner.mjs +2 -2
- package/dist/share-worker.d.mts +1 -1
- package/dist/share-worker.d.mts.map +1 -1
- package/dist/share-worker.mjs +1 -1
- package/dist/share.d.mts +9 -6
- package/dist/share.d.mts.map +1 -1
- package/dist/share.mjs +2 -2
- package/dist/skills/evalkit/SKILL.md +2 -2
- package/dist/skills/evalkit-agents/SKILL.md +3 -3
- package/dist/skills/evalkit-datasets/SKILL.md +1 -1
- package/dist/skills/evalkit-evals/SKILL.md +1 -1
- package/dist/skills/evalkit-judges/SKILL.md +1 -1
- package/dist/skills/evalkit-results/SKILL.md +1 -1
- package/dist/{src-Bccv9igQ.mjs → src-CXzbHAKN.mjs} +1 -1
- package/dist/{src-B14fXAGp.mjs → src-D6Ax2t9b.mjs} +379 -206
- package/dist/src-Dc3GXacB.mjs +3637 -0
- package/dist/upgrade-rMsGzUEJ.mjs +230 -0
- package/dist/upgrade-transcript-C8DUykLd.mjs +402 -0
- package/package.json +2 -1
- package/dist/dashboard/assets/index-TPYprg75.css +0 -2
- package/dist/src-BfSQKOJP.mjs +0 -1877
- package/dist/upgrade-G-uFPJKg.mjs +0 -111
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
+
import { AssistantBlock, AssistantBlock as AssistantBlock$1, EntryRecord, EntryRecord as EntryRecord$1, MessageRecord, MessageRecord as MessageRecord$1, ModelContext, ModelContext as ModelContext$1, ModelRef, ModelRef as ModelRef$1, Origin, StopReason, ToolCallBlock, ToolCallBlock as ToolCallBlock$1, Transcript, Transcript as Transcript$1, TranscriptHeader, TreeRecord, TreeRecord as TreeRecord$1, Usage, UserBlock, UserBlock as UserBlock$1, UserContent, UserContent as UserContent$1 } from "@leostera/atxf";
|
|
2
3
|
//#region ../core/src/identity.d.ts
|
|
3
4
|
export declare const ResourceKindSchema: Schema.Literal<["run", "artifact"]>;
|
|
4
5
|
export type ResourceKind = typeof ResourceKindSchema.Type;
|
|
@@ -109,74 +110,379 @@ export declare function relativeDatasetPath(value: string, label: string): strin
|
|
|
109
110
|
export declare function defineDataset<TLoaded extends DatasetContent>(definition: StaticDatasetDefinition | ComputedDatasetDefinition<TLoaded>): Dataset;
|
|
110
111
|
export declare function isDataset(value: unknown): value is Dataset;
|
|
111
112
|
//#endregion
|
|
112
|
-
//#region ../core/src/
|
|
113
|
+
//#region ../core/src/usage.d.ts
|
|
113
114
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
115
|
+
* Token usage as an adapter reports it: ATXF's buckets, each optional.
|
|
116
|
+
* The buckets are disjoint: `input` excludes cached tokens, which are
|
|
117
|
+
* `cacheRead` (read from a prompt cache) and `cacheWrite` (written to one);
|
|
118
|
+
* `output` includes `reasoning`. Convert your provider's conventions: one
|
|
119
|
+
* that counts cached tokens inside its prompt tokens reports
|
|
120
|
+
* `input: promptTokens - cachedTokens, cacheRead: cachedTokens`.
|
|
116
121
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
122
|
+
type UsageInput = {
|
|
123
|
+
input?: number;
|
|
124
|
+
output?: number;
|
|
125
|
+
cacheRead?: number;
|
|
126
|
+
cacheWrite?: number;
|
|
127
|
+
reasoning?: number;
|
|
128
|
+
/** The provider's total; used only when no bucket is reported. */
|
|
129
|
+
total?: number;
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region ../core/src/agent-transcript.d.ts
|
|
133
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
134
|
+
/** An ATXF tree record to append: `id`, `time` and `parentId` are filled in when absent. */
|
|
135
|
+
export type RecordInput = DistributiveOmit<TreeRecord$1, 'id' | 'time' | 'parentId' | 'hash'> & {
|
|
136
|
+
id?: string;
|
|
137
|
+
time?: string;
|
|
138
|
+
parentId?: string | null;
|
|
139
|
+
};
|
|
140
|
+
/** An assistant message: what the model said and the tools it called. */
|
|
141
|
+
export type AssistantInput = {
|
|
142
|
+
/** Text, or ATXF blocks: `text`, `reasoning`, `tool_call` and `image`. */
|
|
143
|
+
content: string | AssistantBlock$1[];
|
|
144
|
+
/** `provider/id` (`openai/gpt-5`), or an ATXF model reference. */
|
|
145
|
+
model?: string | ModelRef$1;
|
|
146
|
+
/** This response's usage, in ATXF's buckets. */
|
|
147
|
+
usage?: UsageInput;
|
|
148
|
+
stop?: StopReason;
|
|
149
|
+
error?: {
|
|
150
|
+
message: string;
|
|
151
|
+
code?: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Where an adapter records what its agent did, as an ATXF transcript
|
|
156
|
+
* (https://atxf.leostera.dev). Each method appends one record and returns
|
|
157
|
+
* its ID. EvalKit writes each scripted user message itself, unless the
|
|
158
|
+
* adapter writes it (or imports a transcript holding it) first.
|
|
159
|
+
*/
|
|
160
|
+
export type TranscriptWriter = {
|
|
161
|
+
/** A message the agent received. */
|
|
162
|
+
user(content: string | UserBlock$1[], options?: {
|
|
163
|
+
origin?: Origin;
|
|
164
|
+
}): string;
|
|
165
|
+
assistant(message: AssistantInput): string;
|
|
166
|
+
/**
|
|
167
|
+
* A tool call's result. A string is the result's text; any other
|
|
168
|
+
* JSON-convertible value is kept as is in `details.result` and shown as
|
|
169
|
+
* JSON.
|
|
170
|
+
*/
|
|
171
|
+
toolResult(callId: string, result: unknown, options?: {
|
|
172
|
+
name?: string;
|
|
173
|
+
isError?: boolean;
|
|
174
|
+
}): string;
|
|
175
|
+
/** Any other ATXF tree record, such as `reasoning` settings, a compaction or a sub-agent link. */
|
|
176
|
+
append(record: RecordInput): string;
|
|
177
|
+
/**
|
|
178
|
+
* Appends an ATXF transcript's records that were not imported before (by
|
|
179
|
+
* ID), keeping their IDs and native records: for agents whose sessions
|
|
180
|
+
* ATXF converts (`pi.toAtxf(await readFile(sessionFile, 'utf8'))`, from `@leostera/atxf/pi`). Import the whole session
|
|
181
|
+
* after each turn; a user message matching the one EvalKit is about to
|
|
182
|
+
* write stands for it.
|
|
183
|
+
*/
|
|
184
|
+
import(transcript: Transcript$1): void;
|
|
185
|
+
/**
|
|
186
|
+
* Marks a turn's start or end, as the agent saw it: `turn('start')`
|
|
187
|
+
* returns a turn ID to pass to `turn('end', { turnId, outcome })`.
|
|
188
|
+
*/
|
|
189
|
+
turn(phase: 'start' | 'end', options?: {
|
|
190
|
+
turnId?: string;
|
|
191
|
+
outcome?: 'succeeded' | 'failed' | 'interrupted';
|
|
192
|
+
error?: {
|
|
193
|
+
message: string;
|
|
194
|
+
code?: string;
|
|
195
|
+
};
|
|
196
|
+
}): string;
|
|
197
|
+
/**
|
|
198
|
+
* Keeps a sub-agent's ATXF transcript with the run, in
|
|
199
|
+
* `transcripts/<id>.atxf.jsonl`, linked from this one by an `agent_link`
|
|
200
|
+
* record with its `transcriptId` (append one, or import a session that
|
|
201
|
+
* has it). Its steps and tokens count toward the run's limits. Pass the
|
|
202
|
+
* whole transcript again as it grows; it replaces the one kept.
|
|
203
|
+
*/
|
|
204
|
+
subagent(transcript: Transcript$1): void;
|
|
157
205
|
};
|
|
158
206
|
export type TurnToolCall = {
|
|
159
207
|
name: string;
|
|
160
208
|
arguments?: unknown;
|
|
161
|
-
/** When given,
|
|
209
|
+
/** When given, the call's result is recorded after it. */
|
|
162
210
|
result?: unknown;
|
|
163
211
|
id?: string;
|
|
164
212
|
};
|
|
165
|
-
/** What `send()` may return instead of
|
|
213
|
+
/** What `send()` may return instead of writing to the transcript. A string is the reply. */
|
|
166
214
|
export type TurnResult = string | {
|
|
215
|
+
/** Text, or a JSON value (recorded as its JSON text). */
|
|
167
216
|
reply?: unknown;
|
|
168
217
|
toolCalls?: readonly TurnToolCall[];
|
|
169
|
-
usage?:
|
|
170
|
-
/** The model that answered
|
|
171
|
-
model?: string;
|
|
218
|
+
usage?: UsageInput;
|
|
219
|
+
/** The model that answered. */
|
|
220
|
+
model?: string | ModelRef$1;
|
|
221
|
+
};
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region ../core/src/isolation.d.ts
|
|
224
|
+
/**
|
|
225
|
+
* Where a run's processes run, and the shell adapters and scorers use to
|
|
226
|
+
* run them (RFD0009). Types and constructors only: the runner implements
|
|
227
|
+
* them.
|
|
228
|
+
*/
|
|
229
|
+
/** Commands run on the host, in the run's workspace. The default. */
|
|
230
|
+
export type NoIsolation = {
|
|
231
|
+
kind: 'none';
|
|
172
232
|
};
|
|
173
|
-
/** Converts an adapter event into a recorded `AutEvent`. */
|
|
174
|
-
export declare function normalizeAutEvent(input: AutEventInput, now: () => Date): AutEvent;
|
|
175
233
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
234
|
+
* What a run's container can reach: nothing, only the project's fixtures,
|
|
235
|
+
* or whatever the container runtime allows by default.
|
|
178
236
|
*/
|
|
179
|
-
export
|
|
237
|
+
export type ContainerNetwork = 'none' | 'fixtures' | 'full';
|
|
238
|
+
/** A host path mounted read-only into every run's container. */
|
|
239
|
+
export type ContainerMount = {
|
|
240
|
+
host: string;
|
|
241
|
+
path: string;
|
|
242
|
+
};
|
|
243
|
+
/** One container per run, from `image`, with the candidate workspace at `/workspace`. */
|
|
244
|
+
export type ContainerIsolation = {
|
|
245
|
+
kind: 'container';
|
|
246
|
+
/** An image reference (`node:22`), or a Dockerfile path relative to the project (`./evals/Dockerfile`). */
|
|
247
|
+
image: string;
|
|
248
|
+
network: ContainerNetwork;
|
|
249
|
+
/** The `docker`-compatible command to run: `docker` (the default) or `podman`. */
|
|
250
|
+
runtime: string;
|
|
251
|
+
/** Names of host environment variables passed into the container; nothing else is. */
|
|
252
|
+
env: readonly string[];
|
|
253
|
+
mounts: readonly ContainerMount[];
|
|
254
|
+
};
|
|
255
|
+
/** macOS only: each run's processes run under a generated `sandbox-exec` profile. */
|
|
256
|
+
export type SandboxExecIsolation = {
|
|
257
|
+
kind: 'sandbox-exec';
|
|
258
|
+
/** Host paths the run may read and write besides its workspace, such as a cache (`~/.npm`). */
|
|
259
|
+
allow: readonly string[];
|
|
260
|
+
/** Host paths the run may only read, such as a toolchain or an agent CLI's install. */
|
|
261
|
+
read: readonly string[];
|
|
262
|
+
/** More host paths the run may not touch, such as a fixture's state; `allow` and `read` still win inside them. */
|
|
263
|
+
deny: readonly string[];
|
|
264
|
+
/**
|
|
265
|
+
* Names of host environment variables the run gets, besides `PATH`,
|
|
266
|
+
* `HOME`, `TMPDIR`, `USER`, `LANG` and `TERM`; undefined passes the whole
|
|
267
|
+
* environment. A command's own `env` is added on top.
|
|
268
|
+
*/
|
|
269
|
+
env?: readonly string[];
|
|
270
|
+
};
|
|
271
|
+
export type SandboxExecOptions = {
|
|
272
|
+
allow?: readonly string[];
|
|
273
|
+
read?: readonly string[];
|
|
274
|
+
deny?: readonly string[];
|
|
275
|
+
env?: readonly string[];
|
|
276
|
+
};
|
|
277
|
+
export type Isolation = NoIsolation | ContainerIsolation | SandboxExecIsolation;
|
|
278
|
+
export type ContainerOptions = {
|
|
279
|
+
image: string;
|
|
280
|
+
/** Default `'none'`. */
|
|
281
|
+
network?: ContainerNetwork;
|
|
282
|
+
runtime?: string;
|
|
283
|
+
env?: readonly string[];
|
|
284
|
+
/** `{ host, path }`, or `'host:path'`. */
|
|
285
|
+
mounts?: readonly (ContainerMount | string)[];
|
|
286
|
+
};
|
|
287
|
+
/** No isolation: commands run on the host in the run's workspace. */
|
|
288
|
+
export declare function none(): NoIsolation;
|
|
289
|
+
/**
|
|
290
|
+
* Container isolation through the `docker` CLI, or a compatible one such as
|
|
291
|
+
* podman's: a container per run, the candidate workspace mounted at
|
|
292
|
+
* `/workspace`, the evaluator workspace never mounted, and its own process
|
|
293
|
+
* table, so a `pkill` reaches only that run.
|
|
294
|
+
*/
|
|
295
|
+
export declare function container(options: ContainerOptions): ContainerIsolation;
|
|
296
|
+
/**
|
|
297
|
+
* macOS `sandbox-exec` isolation, for projects that cannot use containers:
|
|
298
|
+
* the run cannot read or write the project, the home directory or other
|
|
299
|
+
* runs' workspaces, except its own workspace and `allow`, and can signal
|
|
300
|
+
* only processes it started.
|
|
301
|
+
*/
|
|
302
|
+
export declare function sandboxExec(options?: SandboxExecOptions): SandboxExecIsolation;
|
|
303
|
+
/**
|
|
304
|
+
* A service runs reach, such as a fake store or API, started on the host
|
|
305
|
+
* before the first run that needs it and stopped after the invocation's
|
|
306
|
+
* last.
|
|
307
|
+
*/
|
|
308
|
+
export type Fixture = {
|
|
309
|
+
/** The command that starts it, run with `sh -c` in the project root. */
|
|
310
|
+
start: string;
|
|
311
|
+
/** A URL polled until it answers, or a command that must exit 0. */
|
|
312
|
+
ready?: string;
|
|
313
|
+
/** A command run before the fixture is stopped. */
|
|
314
|
+
stop?: string;
|
|
315
|
+
/** The port it listens on; taken from `ready` when that is a URL with one. */
|
|
316
|
+
port?: number;
|
|
317
|
+
};
|
|
318
|
+
/** A fixture as one run reaches it. */
|
|
319
|
+
export type FixtureAddress = {
|
|
320
|
+
/** Where the run reaches it: `http://localhost:8787`, or `http://fixtures.<name>:8787` from a container. */
|
|
321
|
+
url: string;
|
|
322
|
+
};
|
|
323
|
+
/** A process's exit: a signal shows as 128 plus its number, a timeout as 124. */
|
|
324
|
+
export type ShellExit = {
|
|
325
|
+
exitCode: number;
|
|
326
|
+
/** The signal that stopped it, if one did. */
|
|
327
|
+
signal?: string;
|
|
328
|
+
/** True when `timeoutMs` passed and the process was stopped. */
|
|
329
|
+
timedOut?: true;
|
|
330
|
+
};
|
|
331
|
+
export type ShellResult = ShellExit & {
|
|
332
|
+
stdout: string;
|
|
333
|
+
stderr: string;
|
|
334
|
+
};
|
|
335
|
+
export type ShellOptions = {
|
|
336
|
+
/** Relative to the workspace. */
|
|
337
|
+
cwd?: string;
|
|
338
|
+
/** Added to the environment the process gets. */
|
|
339
|
+
env?: Readonly<Record<string, string>>;
|
|
340
|
+
/** Stops the process when aborted. Default: the run's signal. */
|
|
341
|
+
signal?: AbortSignal;
|
|
342
|
+
/** Stops the process after this many milliseconds. */
|
|
343
|
+
timeoutMs?: number;
|
|
344
|
+
/** Written to the process's standard input, which is then closed. */
|
|
345
|
+
input?: string;
|
|
346
|
+
};
|
|
347
|
+
/** A process started with `spawn`. Its output is always read, so it never blocks on a full pipe. */
|
|
348
|
+
export type ShellProcess = {
|
|
349
|
+
/** Its process ID where it runs (inside the container, for container isolation). */
|
|
350
|
+
readonly pid: number | undefined;
|
|
351
|
+
/** Its standard output so far: the last megabyte. */
|
|
352
|
+
stdout(): string;
|
|
353
|
+
stderr(): string;
|
|
354
|
+
/** Calls `listener` with each chunk of output as it arrives; returns a function that stops. */
|
|
355
|
+
onOutput(listener: (chunk: string, stream: 'stdout' | 'stderr') => void): () => void;
|
|
356
|
+
/** Resolves when it exits. */
|
|
357
|
+
wait(): Promise<ShellExit>;
|
|
358
|
+
/** Signals it and the processes it started. Default `SIGTERM`. */
|
|
359
|
+
kill(signal?: string): Promise<void>;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* The run's shell: commands, long-lived processes and files, wherever the
|
|
363
|
+
* run's isolation puts them. One per run, shared by the adapter and the
|
|
364
|
+
* run's scorers; processes it started are stopped when the run ends. A
|
|
365
|
+
* string command runs with `sh -c`; an array runs as it is.
|
|
366
|
+
*/
|
|
367
|
+
export type Shell = {
|
|
368
|
+
readonly isolation: Isolation['kind'];
|
|
369
|
+
/** The workspace as commands see it: its host path, or `/workspace` in a container. */
|
|
370
|
+
readonly root: string;
|
|
371
|
+
/**
|
|
372
|
+
* The run's private directory, outside the workspace, as commands see it
|
|
373
|
+
* (`/evalkit-home` in a container): for an agent CLI's config and session
|
|
374
|
+
* files. It is never snapshotted, and is removed with the run.
|
|
375
|
+
*/
|
|
376
|
+
readonly home: string;
|
|
377
|
+
exec(command: string | readonly string[], options?: ShellOptions): Promise<ShellResult>;
|
|
378
|
+
spawn(command: string | readonly string[], options?: Omit<ShellOptions, 'timeoutMs'>): ShellProcess;
|
|
379
|
+
/** Relative to the workspace, or absolute inside `root` or `home`. */
|
|
380
|
+
readFile(path: string): Promise<string>;
|
|
381
|
+
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
382
|
+
/** A directory's entries, relative to the workspace; directories end with `/`. */
|
|
383
|
+
list(path?: string): Promise<string[]>;
|
|
384
|
+
};
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region ../core/src/limits.d.ts
|
|
387
|
+
/** What a run may use before EvalKit stops it. */
|
|
388
|
+
type Limits = {
|
|
389
|
+
/** Assistant messages, one per model call, sub-agents included. */
|
|
390
|
+
steps?: number;
|
|
391
|
+
/** The `tokens` metric: uncached input, cache writes and output. Cache reads do not count. */
|
|
392
|
+
tokens?: number;
|
|
393
|
+
/** Milliseconds from the session's start to the end of its last turn; scoring is not counted. */
|
|
394
|
+
time?: number;
|
|
395
|
+
};
|
|
396
|
+
type LimitKind = keyof Limits;
|
|
397
|
+
declare const LIMIT_KINDS: readonly LimitKind[];
|
|
398
|
+
/** Limits as written in config and scenarios: `time` may be a duration such as `'20m'`. */
|
|
399
|
+
type LimitsInput = {
|
|
400
|
+
steps?: number;
|
|
401
|
+
tokens?: number;
|
|
402
|
+
/** Milliseconds, or `'90s'`, `'20m'`, `'1h'`. */
|
|
403
|
+
time?: number | string;
|
|
404
|
+
};
|
|
405
|
+
/** Which limit a run hit, its value, and how much was used. */
|
|
406
|
+
type LimitReached = {
|
|
407
|
+
limit: LimitKind;
|
|
408
|
+
value: number;
|
|
409
|
+
used: number;
|
|
410
|
+
};
|
|
411
|
+
/** `'20m'` → 1_200_000. A number is milliseconds. */
|
|
412
|
+
declare function parseDuration(value: number | string, owner: string): number;
|
|
413
|
+
/** Checks and normalizes limits; `owner` names where they were written. */
|
|
414
|
+
declare function parseLimits(input: LimitsInput | undefined, owner: string): Limits;
|
|
415
|
+
/** Later layers win, kind by kind: config, then scenario, then matrix cell, then the command line. */
|
|
416
|
+
declare function resolveLimits(...layers: readonly Limits[]): Limits;
|
|
417
|
+
/** A matrix's `limits` axes are parameters named `limits.<kind>`. */
|
|
418
|
+
declare const LIMIT_PARAMETER_PREFIX = "limits.";
|
|
419
|
+
/** The limits a matrix cell's `limits.<kind>` parameters set. */
|
|
420
|
+
declare function limitsFromParameters(parameters: Readonly<Record<string, unknown>> | undefined): Limits;
|
|
421
|
+
/** `steps=80` or `time=1h`, from `--limit`. */
|
|
422
|
+
declare function parseLimitFlag(flag: string): Limits;
|
|
423
|
+
/** `40 steps`, `2,000,000 tokens`, `20m`. */
|
|
424
|
+
declare function formatLimit(kind: LimitKind, value: number): string;
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region ../core/src/transcript.d.ts
|
|
427
|
+
/** The ATXF version EvalKit writes. */
|
|
428
|
+
declare const ATXF_VERSION = "0.1";
|
|
429
|
+
declare function isTreeRecord(record: EntryRecord$1): record is TreeRecord$1;
|
|
430
|
+
type AssistantMessage = MessageRecord$1 & {
|
|
431
|
+
role: 'assistant';
|
|
432
|
+
};
|
|
433
|
+
type ToolMessage = MessageRecord$1 & {
|
|
434
|
+
role: 'tool';
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* The records from the transcript's root to its active leaf, in order: what
|
|
438
|
+
* the session is now, without abandoned branches (ATXF §4).
|
|
439
|
+
*/
|
|
440
|
+
declare function activePath(transcript: Transcript$1): TreeRecord$1[];
|
|
441
|
+
/** Messages on the active path, optionally of one role. */
|
|
442
|
+
declare function transcriptMessages(transcript: Transcript$1, role?: MessageRecord$1['role']): MessageRecord$1[];
|
|
443
|
+
/** A tool call and, when the transcript has it, its result. */
|
|
444
|
+
type PairedToolCall = {
|
|
445
|
+
/** The assistant message holding the call. */
|
|
446
|
+
message: AssistantMessage;
|
|
447
|
+
call: ToolCallBlock$1;
|
|
448
|
+
result?: ToolMessage;
|
|
449
|
+
};
|
|
450
|
+
/** A tool call as scorers see it: its name, arguments and what it returned. */
|
|
451
|
+
type ToolCall = {
|
|
452
|
+
id: string;
|
|
453
|
+
name: string;
|
|
454
|
+
/** Its arguments; `{}` when the agent recorded raw `input` instead. */
|
|
455
|
+
arguments: Record<string, unknown>;
|
|
456
|
+
/** Raw input for tools that take text rather than JSON arguments. */
|
|
457
|
+
input?: string;
|
|
458
|
+
/** What the tool returned (JSON the adapter recorded, else the result's text); undefined before a result. */
|
|
459
|
+
result?: unknown;
|
|
460
|
+
/** The tool reported an error. */
|
|
461
|
+
isError: boolean;
|
|
462
|
+
/** The assistant message holding the call. */
|
|
463
|
+
messageId: string;
|
|
464
|
+
/** The tool result message, when there is one. */
|
|
465
|
+
resultId?: string;
|
|
466
|
+
};
|
|
467
|
+
/** Every tool call on the active path, in order, with its result. */
|
|
468
|
+
declare function transcriptToolCalls(transcript: Transcript$1, name?: string): ToolCall[];
|
|
469
|
+
/** Tool calls among `records`, each paired with the first result for it. */
|
|
470
|
+
declare function callsIn(records: readonly TreeRecord$1[]): PairedToolCall[];
|
|
471
|
+
/** The text of a message's content: text blocks joined, other blocks left out. */
|
|
472
|
+
declare function contentText(content: UserContent$1 | AssistantBlock$1[]): string;
|
|
473
|
+
/** The text of the last assistant message on the active path, or `''`. */
|
|
474
|
+
declare function transcriptReply(transcript: Transcript$1): string;
|
|
475
|
+
/**
|
|
476
|
+
* A tool result's value: the JSON an adapter returned (kept in
|
|
477
|
+
* `details.result`), else the result's text.
|
|
478
|
+
*/
|
|
479
|
+
declare function toolResultValue(result: ToolMessage): unknown;
|
|
480
|
+
/** `provider/id`, or `id` when the provider is unknown. */
|
|
481
|
+
declare function modelName(model: ModelRef$1 | undefined): string | undefined;
|
|
482
|
+
/** `openai/gpt-5` → `{ provider: 'openai', id: 'gpt-5' }`; without a provider, `unknown`. */
|
|
483
|
+
declare function parseModel(model: string | ModelRef$1): ModelRef$1;
|
|
484
|
+
/** The transcript, empty: what scorers see before the agent recorded anything. */
|
|
485
|
+
declare function emptyTranscript(header: Transcript$1['header']): Transcript$1;
|
|
180
486
|
//#endregion
|
|
181
487
|
//#region ../core/src/judge.d.ts
|
|
182
488
|
/**
|
|
@@ -370,9 +676,10 @@ export type EvalCatalogEntry = {
|
|
|
370
676
|
/** Runs started each time the scenario runs (`repeat`). */
|
|
371
677
|
repeat: number;
|
|
372
678
|
policy: {
|
|
373
|
-
timeoutMs?: number;
|
|
374
679
|
failfast?: boolean;
|
|
375
680
|
};
|
|
681
|
+
/** The scenario's own limits; the project's, a cell's and `--limit` may add to them. */
|
|
682
|
+
limits?: Limits;
|
|
376
683
|
transcript: EvalCatalogStep[];
|
|
377
684
|
scorers: EvalCatalogScorer[];
|
|
378
685
|
metadata?: JsonValue;
|
|
@@ -411,13 +718,22 @@ type EvalMatrixDefinition = {
|
|
|
411
718
|
cases?: readonly JsonObject[];
|
|
412
719
|
/** Partial patterns over declared dimensions; matching cells are never run. */
|
|
413
720
|
exclude?: readonly JsonObject[];
|
|
721
|
+
/**
|
|
722
|
+
* Limits to compare, as axes: `{ steps: [40, 80] }`. Each becomes the axis
|
|
723
|
+
* `limits.steps`, so cells show it and `-a limits.steps=80` selects it.
|
|
724
|
+
*/
|
|
725
|
+
limits?: Readonly<{
|
|
726
|
+
steps?: readonly number[];
|
|
727
|
+
tokens?: readonly number[];
|
|
728
|
+
time?: readonly (number | string)[];
|
|
729
|
+
}>;
|
|
414
730
|
};
|
|
415
731
|
type EvalMatrix = EvalMatrixDefinition & {
|
|
416
732
|
kind: 'matrix';
|
|
417
733
|
count(selection?: MatrixSelection): number;
|
|
418
734
|
cells(selection?: MatrixSelection): IterableIterator<EvalMatrixCell>;
|
|
419
735
|
};
|
|
420
|
-
export declare function defineEvalMatrix<const T extends EvalMatrixDefinition>(
|
|
736
|
+
export declare function defineEvalMatrix<const T extends EvalMatrixDefinition>(input: T): EvalMatrix & T;
|
|
421
737
|
//#endregion
|
|
422
738
|
//#region ../core/src/config.d.ts
|
|
423
739
|
type EvalkitConfig = {
|
|
@@ -441,6 +757,24 @@ type EvalkitConfig = {
|
|
|
441
757
|
repeat?: number;
|
|
442
758
|
maxCells?: number;
|
|
443
759
|
};
|
|
760
|
+
/**
|
|
761
|
+
* What each run may use before EvalKit stops it: `{ steps: 40, tokens:
|
|
762
|
+
* 2_000_000, time: '20m' }`. A scenario's `limits`, a matrix cell's and
|
|
763
|
+
* `--limit` override these, kind by kind.
|
|
764
|
+
*/
|
|
765
|
+
limits?: LimitsInput;
|
|
766
|
+
/**
|
|
767
|
+
* Where each run's processes run: `none()` (the default, on the host),
|
|
768
|
+
* `container({ image, network })` or `sandboxExec({ allow })`. Adapters
|
|
769
|
+
* and scorers run commands through `context.shell`, which puts them there.
|
|
770
|
+
*/
|
|
771
|
+
isolation?: Isolation;
|
|
772
|
+
/**
|
|
773
|
+
* Services runs reach, by name: started on the host before the first run
|
|
774
|
+
* that needs them and stopped after the invocation's last. Each run finds
|
|
775
|
+
* them in `context.fixtures`.
|
|
776
|
+
*/
|
|
777
|
+
fixtures?: Readonly<Record<string, Fixture>>;
|
|
444
778
|
reportDir?: string;
|
|
445
779
|
/** The candidate files saved with each run's results. */
|
|
446
780
|
artifacts?: {
|
|
@@ -495,32 +829,6 @@ type ShareConfig = {
|
|
|
495
829
|
/** Pure, typed project configuration. Loading/discovery belongs to the CLI. */
|
|
496
830
|
export declare function defineConfig<const T extends EvalkitConfig>(configuration: T): T;
|
|
497
831
|
//#endregion
|
|
498
|
-
//#region ../core/src/usage.d.ts
|
|
499
|
-
/**
|
|
500
|
-
* Token usage an agent reports for one turn. EvalKit never measures or infers
|
|
501
|
-
* it; adapters copy it from their provider.
|
|
502
|
-
*/
|
|
503
|
-
type Usage = {
|
|
504
|
-
/**
|
|
505
|
-
* Every input token the model read this turn: the prompt, history and tool
|
|
506
|
-
* results, **including** tokens read from or written to a prompt cache.
|
|
507
|
-
* (Some providers report cached tokens separately; add them in.)
|
|
508
|
-
*/
|
|
509
|
-
inputTokens?: number;
|
|
510
|
-
/** Every token the model produced, including reasoning tokens. */
|
|
511
|
-
outputTokens?: number;
|
|
512
|
-
/** Of `inputTokens`, how many were read from a prompt cache. Informational. */
|
|
513
|
-
cachedInputTokens?: number;
|
|
514
|
-
/** The provider's own total; used only when input and output are not reported. */
|
|
515
|
-
totalTokens?: number;
|
|
516
|
-
};
|
|
517
|
-
/**
|
|
518
|
-
* The tokens a turn counts toward the `tokens` metric: `inputTokens +
|
|
519
|
-
* outputTokens` (cached input included), or `totalTokens` when neither is
|
|
520
|
-
* reported. Undefined when the turn reported no usage.
|
|
521
|
-
*/
|
|
522
|
-
export declare function turnTokens(usage: Usage | undefined): number | undefined;
|
|
523
|
-
//#endregion
|
|
524
832
|
//#region ../core/src/json.d.ts
|
|
525
833
|
/** A value that cannot be stored in a report, with the path of the offending part. */
|
|
526
834
|
export declare class NotJsonError extends Error {
|
|
@@ -557,9 +865,9 @@ export declare function definitionSite(value: unknown): DefinitionSite | undefin
|
|
|
557
865
|
//#endregion
|
|
558
866
|
//#region ../core/src/schema.d.ts
|
|
559
867
|
/** Runtime schemas for serialized EvalKit report and API boundaries. */
|
|
560
|
-
export declare const RunStatusSchema: Schema.Literal<["running", "passed", "failed", "errored", "cancelled"]>;
|
|
868
|
+
export declare const RunStatusSchema: Schema.Literal<["running", "passed", "failed", "errored", "cancelled", "limited"]>;
|
|
561
869
|
/** The report schema version this EvalKit writes and reads. */
|
|
562
|
-
export declare const REPORT_SCHEMA_VERSION =
|
|
870
|
+
export declare const REPORT_SCHEMA_VERSION = 7;
|
|
563
871
|
export declare const RecordedErrorSchema: Schema.Struct<{
|
|
564
872
|
name: typeof Schema.String;
|
|
565
873
|
message: typeof Schema.String;
|
|
@@ -597,8 +905,25 @@ export declare const RunDatasetSchema: Schema.Struct<{
|
|
|
597
905
|
source: Schema.Literal<["static", "computed"]>;
|
|
598
906
|
digest: typeof Schema.String;
|
|
599
907
|
}>;
|
|
908
|
+
export declare const LimitsSchema: Schema.Struct<{
|
|
909
|
+
steps: Schema.optional<typeof Schema.Number>;
|
|
910
|
+
tokens: Schema.optional<typeof Schema.Number>;
|
|
911
|
+
time: Schema.optional<typeof Schema.Number>;
|
|
912
|
+
}>;
|
|
913
|
+
export declare const LimitReachedSchema: Schema.Struct<{
|
|
914
|
+
limit: Schema.Literal<["steps", "tokens", "time"]>;
|
|
915
|
+
value: typeof Schema.Number;
|
|
916
|
+
used: typeof Schema.Number;
|
|
917
|
+
}>;
|
|
918
|
+
export declare const RunIsolationSchema: Schema.Union<[Schema.Struct<{
|
|
919
|
+
kind: Schema.Literal<["container"]>;
|
|
920
|
+
image: typeof Schema.String;
|
|
921
|
+
network: Schema.Literal<["none", "fixtures", "full"]>;
|
|
922
|
+
}>, Schema.Struct<{
|
|
923
|
+
kind: Schema.Literal<["sandbox-exec"]>;
|
|
924
|
+
}>]>;
|
|
600
925
|
export declare const RunMetadataSchema: Schema.Struct<{
|
|
601
|
-
schemaVersion: Schema.Literal<[
|
|
926
|
+
schemaVersion: Schema.Literal<[7]>;
|
|
602
927
|
runUri: Schema.filter<typeof Schema.String>;
|
|
603
928
|
evalId: typeof Schema.String;
|
|
604
929
|
suiteId: Schema.optional<typeof Schema.String>;
|
|
@@ -645,10 +970,22 @@ export declare const RunMetadataSchema: Schema.Struct<{
|
|
|
645
970
|
source: Schema.Literal<["static", "computed"]>;
|
|
646
971
|
digest: typeof Schema.String;
|
|
647
972
|
}>>>>;
|
|
973
|
+
limits: Schema.optional<Schema.Struct<{
|
|
974
|
+
steps: Schema.optional<typeof Schema.Number>;
|
|
975
|
+
tokens: Schema.optional<typeof Schema.Number>;
|
|
976
|
+
time: Schema.optional<typeof Schema.Number>;
|
|
977
|
+
}>>;
|
|
978
|
+
isolation: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
979
|
+
kind: Schema.Literal<["container"]>;
|
|
980
|
+
image: typeof Schema.String;
|
|
981
|
+
network: Schema.Literal<["none", "fixtures", "full"]>;
|
|
982
|
+
}>, Schema.Struct<{
|
|
983
|
+
kind: Schema.Literal<["sandbox-exec"]>;
|
|
984
|
+
}>]>>;
|
|
648
985
|
}>;
|
|
649
986
|
/** On-disk manifests include a lifecycle status. */
|
|
650
987
|
export declare const RunManifestSchema: Schema.Struct<{
|
|
651
|
-
schemaVersion: Schema.Literal<[
|
|
988
|
+
schemaVersion: Schema.Literal<[7]>;
|
|
652
989
|
runUri: Schema.filter<typeof Schema.String>;
|
|
653
990
|
evalId: typeof Schema.String;
|
|
654
991
|
suiteId: Schema.optional<typeof Schema.String>;
|
|
@@ -694,14 +1031,42 @@ export declare const RunManifestSchema: Schema.Struct<{
|
|
|
694
1031
|
source: Schema.Literal<["static", "computed"]>;
|
|
695
1032
|
digest: typeof Schema.String;
|
|
696
1033
|
}>>>>;
|
|
697
|
-
|
|
1034
|
+
limits: Schema.optional<Schema.Struct<{
|
|
1035
|
+
steps: Schema.optional<typeof Schema.Number>;
|
|
1036
|
+
tokens: Schema.optional<typeof Schema.Number>;
|
|
1037
|
+
time: Schema.optional<typeof Schema.Number>;
|
|
1038
|
+
}>>;
|
|
1039
|
+
isolation: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
1040
|
+
kind: Schema.Literal<["container"]>;
|
|
1041
|
+
image: typeof Schema.String;
|
|
1042
|
+
network: Schema.Literal<["none", "fixtures", "full"]>;
|
|
1043
|
+
}>, Schema.Struct<{
|
|
1044
|
+
kind: Schema.Literal<["sandbox-exec"]>;
|
|
1045
|
+
}>]>>;
|
|
1046
|
+
status: Schema.optional<Schema.Literal<["running", "passed", "failed", "errored", "cancelled", "limited"]>>;
|
|
698
1047
|
}>;
|
|
1048
|
+
/** ATXF usage: disjoint buckets, `input` without cached tokens. */
|
|
699
1049
|
export declare const UsageSchema: Schema.Struct<{
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
1050
|
+
input: typeof Schema.Number;
|
|
1051
|
+
output: typeof Schema.Number;
|
|
1052
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1053
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1054
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1055
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1056
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1057
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1058
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1059
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1060
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1061
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1062
|
+
total: typeof Schema.Number;
|
|
1063
|
+
}>>;
|
|
704
1064
|
}>;
|
|
1065
|
+
/**
|
|
1066
|
+
* An ATXF transcript in JSON (`{ header, records }`). Its records are checked
|
|
1067
|
+
* by the ATXF validator where they are written, not here.
|
|
1068
|
+
*/
|
|
1069
|
+
export declare const TranscriptSchema: Schema.declare<Transcript, Transcript, readonly [], never>;
|
|
705
1070
|
export declare const JudgeRunInfoSchema: Schema.Struct<{
|
|
706
1071
|
agent: Schema.optional<Schema.Struct<{
|
|
707
1072
|
id: typeof Schema.String;
|
|
@@ -711,15 +1076,26 @@ export declare const JudgeRunInfoSchema: Schema.Struct<{
|
|
|
711
1076
|
}>>;
|
|
712
1077
|
model: Schema.optional<typeof Schema.String>;
|
|
713
1078
|
usage: Schema.optional<Schema.Struct<{
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
1079
|
+
input: typeof Schema.Number;
|
|
1080
|
+
output: typeof Schema.Number;
|
|
1081
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1082
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1083
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1084
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1085
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1086
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1087
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1088
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1089
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1090
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1091
|
+
total: typeof Schema.Number;
|
|
1092
|
+
}>>;
|
|
718
1093
|
}>>;
|
|
719
1094
|
prompt: Schema.optional<typeof Schema.String>;
|
|
720
1095
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
721
1096
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
722
|
-
|
|
1097
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1098
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
723
1099
|
}>;
|
|
724
1100
|
export declare const ScoreResultSchema: Schema.Struct<{
|
|
725
1101
|
passAt: Schema.optional<typeof Schema.Number>;
|
|
@@ -752,15 +1128,26 @@ export declare const ScoreResultSchema: Schema.Struct<{
|
|
|
752
1128
|
}>>;
|
|
753
1129
|
model: Schema.optional<typeof Schema.String>;
|
|
754
1130
|
usage: Schema.optional<Schema.Struct<{
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
1131
|
+
input: typeof Schema.Number;
|
|
1132
|
+
output: typeof Schema.Number;
|
|
1133
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1134
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1135
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1136
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1137
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1138
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1139
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1140
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1141
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1142
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1143
|
+
total: typeof Schema.Number;
|
|
1144
|
+
}>>;
|
|
759
1145
|
}>>;
|
|
760
1146
|
prompt: Schema.optional<typeof Schema.String>;
|
|
761
1147
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
762
1148
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
763
|
-
|
|
1149
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1150
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
764
1151
|
}>>;
|
|
765
1152
|
durationMs: typeof Schema.Number;
|
|
766
1153
|
error: Schema.optional<Schema.Struct<{
|
|
@@ -803,15 +1190,26 @@ export declare const CheckpointResultSchema: Schema.Struct<{
|
|
|
803
1190
|
}>>;
|
|
804
1191
|
model: Schema.optional<typeof Schema.String>;
|
|
805
1192
|
usage: Schema.optional<Schema.Struct<{
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1193
|
+
input: typeof Schema.Number;
|
|
1194
|
+
output: typeof Schema.Number;
|
|
1195
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1196
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1197
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1198
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1199
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1200
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1201
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1202
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1203
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1204
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1205
|
+
total: typeof Schema.Number;
|
|
1206
|
+
}>>;
|
|
810
1207
|
}>>;
|
|
811
1208
|
prompt: Schema.optional<typeof Schema.String>;
|
|
812
1209
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
813
1210
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
814
|
-
|
|
1211
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1212
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
815
1213
|
}>>;
|
|
816
1214
|
durationMs: Schema.optional<typeof Schema.Number>;
|
|
817
1215
|
error: Schema.optional<Schema.Struct<{
|
|
@@ -820,7 +1218,7 @@ export declare const CheckpointResultSchema: Schema.Struct<{
|
|
|
820
1218
|
stack: Schema.optional<typeof Schema.String>;
|
|
821
1219
|
}>>;
|
|
822
1220
|
matchedToolCall: Schema.optional<Schema.Struct<{
|
|
823
|
-
|
|
1221
|
+
messageId: typeof Schema.String;
|
|
824
1222
|
id: typeof Schema.String;
|
|
825
1223
|
}>>;
|
|
826
1224
|
}>;
|
|
@@ -868,15 +1266,26 @@ export declare const RunScoringSchema: Schema.Struct<{
|
|
|
868
1266
|
}>>;
|
|
869
1267
|
model: Schema.optional<typeof Schema.String>;
|
|
870
1268
|
usage: Schema.optional<Schema.Struct<{
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1269
|
+
input: typeof Schema.Number;
|
|
1270
|
+
output: typeof Schema.Number;
|
|
1271
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1272
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1273
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1274
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1275
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1276
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1277
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1278
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1279
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1280
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1281
|
+
total: typeof Schema.Number;
|
|
1282
|
+
}>>;
|
|
875
1283
|
}>>;
|
|
876
1284
|
prompt: Schema.optional<typeof Schema.String>;
|
|
877
1285
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
878
1286
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
879
|
-
|
|
1287
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1288
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
880
1289
|
}>>;
|
|
881
1290
|
durationMs: typeof Schema.Number;
|
|
882
1291
|
error: Schema.optional<Schema.Struct<{
|
|
@@ -931,15 +1340,26 @@ export declare const RunScoringSchema: Schema.Struct<{
|
|
|
931
1340
|
}>>;
|
|
932
1341
|
model: Schema.optional<typeof Schema.String>;
|
|
933
1342
|
usage: Schema.optional<Schema.Struct<{
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1343
|
+
input: typeof Schema.Number;
|
|
1344
|
+
output: typeof Schema.Number;
|
|
1345
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1346
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1347
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1348
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1349
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1350
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1351
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1352
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1353
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1354
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1355
|
+
total: typeof Schema.Number;
|
|
1356
|
+
}>>;
|
|
938
1357
|
}>>;
|
|
939
1358
|
prompt: Schema.optional<typeof Schema.String>;
|
|
940
1359
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
941
1360
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
942
|
-
|
|
1361
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1362
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
943
1363
|
}>>;
|
|
944
1364
|
durationMs: Schema.optional<typeof Schema.Number>;
|
|
945
1365
|
error: Schema.optional<Schema.Struct<{
|
|
@@ -948,7 +1368,7 @@ export declare const RunScoringSchema: Schema.Struct<{
|
|
|
948
1368
|
stack: Schema.optional<typeof Schema.String>;
|
|
949
1369
|
}>>;
|
|
950
1370
|
matchedToolCall: Schema.optional<Schema.Struct<{
|
|
951
|
-
|
|
1371
|
+
messageId: typeof Schema.String;
|
|
952
1372
|
id: typeof Schema.String;
|
|
953
1373
|
}>>;
|
|
954
1374
|
}>>>>;
|
|
@@ -967,7 +1387,7 @@ export declare const AttachmentEntrySchema: Schema.Struct<{
|
|
|
967
1387
|
truncatedFrom: Schema.optional<typeof Schema.Number>;
|
|
968
1388
|
}>;
|
|
969
1389
|
export declare const RunSummarySchema: Schema.Struct<{
|
|
970
|
-
status: Schema.Literal<["running", "passed", "failed", "errored", "cancelled"]>;
|
|
1390
|
+
status: Schema.Literal<["running", "passed", "failed", "errored", "cancelled", "limited"]>;
|
|
971
1391
|
endedAt: typeof Schema.String;
|
|
972
1392
|
durationMs: Schema.optional<typeof Schema.Number>;
|
|
973
1393
|
scoring: Schema.optional<Schema.Struct<{
|
|
@@ -1002,15 +1422,26 @@ export declare const RunSummarySchema: Schema.Struct<{
|
|
|
1002
1422
|
}>>;
|
|
1003
1423
|
model: Schema.optional<typeof Schema.String>;
|
|
1004
1424
|
usage: Schema.optional<Schema.Struct<{
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1425
|
+
input: typeof Schema.Number;
|
|
1426
|
+
output: typeof Schema.Number;
|
|
1427
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1428
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1429
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1430
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1431
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1432
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1433
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1434
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1435
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1436
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1437
|
+
total: typeof Schema.Number;
|
|
1438
|
+
}>>;
|
|
1009
1439
|
}>>;
|
|
1010
1440
|
prompt: Schema.optional<typeof Schema.String>;
|
|
1011
1441
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
1012
1442
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
1013
|
-
|
|
1443
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1444
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
1014
1445
|
}>>;
|
|
1015
1446
|
durationMs: typeof Schema.Number;
|
|
1016
1447
|
error: Schema.optional<Schema.Struct<{
|
|
@@ -1065,15 +1496,26 @@ export declare const RunSummarySchema: Schema.Struct<{
|
|
|
1065
1496
|
}>>;
|
|
1066
1497
|
model: Schema.optional<typeof Schema.String>;
|
|
1067
1498
|
usage: Schema.optional<Schema.Struct<{
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1499
|
+
input: typeof Schema.Number;
|
|
1500
|
+
output: typeof Schema.Number;
|
|
1501
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1502
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1503
|
+
reasoning: Schema.optional<typeof Schema.Number>;
|
|
1504
|
+
total: Schema.optional<typeof Schema.Number>;
|
|
1505
|
+
cost: Schema.optional<Schema.Struct<{
|
|
1506
|
+
currency: Schema.optional<typeof Schema.String>;
|
|
1507
|
+
input: Schema.optional<typeof Schema.Number>;
|
|
1508
|
+
output: Schema.optional<typeof Schema.Number>;
|
|
1509
|
+
cacheRead: Schema.optional<typeof Schema.Number>;
|
|
1510
|
+
cacheWrite: Schema.optional<typeof Schema.Number>;
|
|
1511
|
+
total: typeof Schema.Number;
|
|
1512
|
+
}>>;
|
|
1072
1513
|
}>>;
|
|
1073
1514
|
prompt: Schema.optional<typeof Schema.String>;
|
|
1074
1515
|
reply: Schema.optional<Schema.Schema<JsonValue, JsonValue, never>>;
|
|
1075
1516
|
attempts: Schema.optional<typeof Schema.Number>;
|
|
1076
|
-
|
|
1517
|
+
/** The judge's own session, an ATXF transcript (checked when written). */
|
|
1518
|
+
transcript: Schema.optional<Schema.declare<Transcript, Transcript, readonly [], never>>;
|
|
1077
1519
|
}>>;
|
|
1078
1520
|
durationMs: Schema.optional<typeof Schema.Number>;
|
|
1079
1521
|
error: Schema.optional<Schema.Struct<{
|
|
@@ -1082,7 +1524,7 @@ export declare const RunSummarySchema: Schema.Struct<{
|
|
|
1082
1524
|
stack: Schema.optional<typeof Schema.String>;
|
|
1083
1525
|
}>>;
|
|
1084
1526
|
matchedToolCall: Schema.optional<Schema.Struct<{
|
|
1085
|
-
|
|
1527
|
+
messageId: typeof Schema.String;
|
|
1086
1528
|
id: typeof Schema.String;
|
|
1087
1529
|
}>>;
|
|
1088
1530
|
}>>>>;
|
|
@@ -1105,17 +1547,18 @@ export declare const RunSummarySchema: Schema.Struct<{
|
|
|
1105
1547
|
message: typeof Schema.String;
|
|
1106
1548
|
stack: Schema.optional<typeof Schema.String>;
|
|
1107
1549
|
}>>;
|
|
1550
|
+
limit: Schema.optional<Schema.Struct<{
|
|
1551
|
+
limit: Schema.Literal<["steps", "tokens", "time"]>;
|
|
1552
|
+
value: typeof Schema.Number;
|
|
1553
|
+
used: typeof Schema.Number;
|
|
1554
|
+
}>>;
|
|
1108
1555
|
}>;
|
|
1109
|
-
export declare const
|
|
1556
|
+
export declare const RunEventSchema: Schema.Schema<RunEvent>;
|
|
1110
1557
|
export declare const ApiErrorSchema: Schema.Struct<{
|
|
1111
1558
|
error: typeof Schema.String;
|
|
1112
1559
|
message: typeof Schema.String;
|
|
1113
1560
|
}>;
|
|
1114
1561
|
//#endregion
|
|
1115
|
-
//#region ../core/src/trajectory.d.ts
|
|
1116
|
-
/** Decode one private report's JSONL trajectory; reject malformed/non-event lines with their line number. */
|
|
1117
|
-
export declare function parseTrajectoryJsonl(contents: string): TrajectoryEvent[];
|
|
1118
|
-
//#endregion
|
|
1119
1562
|
//#region ../core/src/index.d.ts
|
|
1120
1563
|
export type JsonPrimitive = boolean | number | string | null;
|
|
1121
1564
|
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
@@ -1146,47 +1589,6 @@ export type RecordedError = {
|
|
|
1146
1589
|
message: string;
|
|
1147
1590
|
stack?: string;
|
|
1148
1591
|
};
|
|
1149
|
-
export type AutEvent = {
|
|
1150
|
-
kind: 'started';
|
|
1151
|
-
timestamp: string;
|
|
1152
|
-
} | {
|
|
1153
|
-
kind: 'message';
|
|
1154
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
1155
|
-
content: JsonValue;
|
|
1156
|
-
timestamp: string;
|
|
1157
|
-
} | {
|
|
1158
|
-
kind: 'tool-call';
|
|
1159
|
-
id: string;
|
|
1160
|
-
name: string;
|
|
1161
|
-
arguments: JsonValue;
|
|
1162
|
-
timestamp: string;
|
|
1163
|
-
} | {
|
|
1164
|
-
kind: 'tool-result';
|
|
1165
|
-
id: string;
|
|
1166
|
-
name?: string;
|
|
1167
|
-
result: JsonValue;
|
|
1168
|
-
timestamp: string;
|
|
1169
|
-
} | {
|
|
1170
|
-
kind: 'turn-started';
|
|
1171
|
-
turn: number;
|
|
1172
|
-
timestamp: string;
|
|
1173
|
-
} | {
|
|
1174
|
-
kind: 'turn-completed';
|
|
1175
|
-
turn: number;
|
|
1176
|
-
timestamp: string;
|
|
1177
|
-
latencyMs?: number;
|
|
1178
|
-
usage?: Usage;
|
|
1179
|
-
/** The model that answered this turn, when the agent knows it. */
|
|
1180
|
-
model?: string;
|
|
1181
|
-
} | {
|
|
1182
|
-
kind: 'completed';
|
|
1183
|
-
output?: JsonValue;
|
|
1184
|
-
timestamp: string;
|
|
1185
|
-
} | {
|
|
1186
|
-
kind: 'error';
|
|
1187
|
-
error: RecordedError;
|
|
1188
|
-
timestamp: string;
|
|
1189
|
-
};
|
|
1190
1592
|
export type RunnerEvent = {
|
|
1191
1593
|
kind: 'run-started';
|
|
1192
1594
|
timestamp: string;
|
|
@@ -1235,7 +1637,10 @@ export type RunnerEvent = {
|
|
|
1235
1637
|
scorer: string;
|
|
1236
1638
|
error: RecordedError;
|
|
1237
1639
|
timestamp: string;
|
|
1238
|
-
} | {
|
|
1640
|
+
} | ({
|
|
1641
|
+
kind: 'limit-reached';
|
|
1642
|
+
timestamp: string;
|
|
1643
|
+
} & LimitReached) | {
|
|
1239
1644
|
kind: 'run-completed';
|
|
1240
1645
|
timestamp: string;
|
|
1241
1646
|
} | {
|
|
@@ -1243,11 +1648,25 @@ export type RunnerEvent = {
|
|
|
1243
1648
|
error: RecordedError;
|
|
1244
1649
|
timestamp: string;
|
|
1245
1650
|
};
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1651
|
+
/**
|
|
1652
|
+
* One of EvalKit's own events in `run-events.jsonl`. `at` is the ID of the
|
|
1653
|
+
* transcript record it happened after (null before the first), which places
|
|
1654
|
+
* it in the agent's transcript.
|
|
1655
|
+
*/
|
|
1656
|
+
/**
|
|
1657
|
+
* What the dashboard shows of one run's session: the agent's transcript
|
|
1658
|
+
* (null before its first line is written) and EvalKit's events, placed in
|
|
1659
|
+
* it by `at`.
|
|
1660
|
+
*/
|
|
1661
|
+
export type RunTranscriptView = {
|
|
1662
|
+
transcript: Transcript | null;
|
|
1663
|
+
/** Sub-agent transcripts the run kept, by transcript ID. */
|
|
1664
|
+
subagents: Record<string, Transcript>;
|
|
1665
|
+
runEvents: RunEvent[];
|
|
1666
|
+
};
|
|
1667
|
+
export type RunEvent = RunnerEvent & {
|
|
1668
|
+
at: string | null;
|
|
1669
|
+
};
|
|
1251
1670
|
export type WorkspaceView = {
|
|
1252
1671
|
/** Absolute path to this run-scoped workspace. Do not persist it in reports. */
|
|
1253
1672
|
root: string;
|
|
@@ -1265,6 +1684,20 @@ export type AutContext = {
|
|
|
1265
1684
|
runtime?: AgentRuntimeName;
|
|
1266
1685
|
/** Values of the scenario's candidate datasets, by dataset ID. */
|
|
1267
1686
|
data: JsonObject;
|
|
1687
|
+
/**
|
|
1688
|
+
* Aborts when the run hits a limit or is cancelled. Pass it to model calls
|
|
1689
|
+
* and tool processes so they stop with the run.
|
|
1690
|
+
*/
|
|
1691
|
+
signal: AbortSignal;
|
|
1692
|
+
/** The limits in force for this run; see `limits` in the config. */
|
|
1693
|
+
limits: Limits;
|
|
1694
|
+
/**
|
|
1695
|
+
* The run's shell: run the agent and its tools through it, so they run
|
|
1696
|
+
* where the project's `isolation` puts them. Scorers get the same one.
|
|
1697
|
+
*/
|
|
1698
|
+
shell: Shell;
|
|
1699
|
+
/** The project's fixtures, as this run reaches them, by name. */
|
|
1700
|
+
fixtures: Readonly<Record<string, FixtureAddress>>;
|
|
1268
1701
|
/** Contains only resources visible to the AUT/model. */
|
|
1269
1702
|
workspace: CandidateWorkspace;
|
|
1270
1703
|
/** Private evaluator capability for trusted AUT adapters; never expose this to the model. */
|
|
@@ -1277,8 +1710,11 @@ export type AutAdapter<TMessage = string> = {
|
|
|
1277
1710
|
start(options: {
|
|
1278
1711
|
context: AutContext;
|
|
1279
1712
|
runtime?: AgentRuntime;
|
|
1280
|
-
/**
|
|
1281
|
-
|
|
1713
|
+
/**
|
|
1714
|
+
* Where to record what the agent does, as ATXF. Optional: returning a
|
|
1715
|
+
* turn result from `send` is enough for most agents.
|
|
1716
|
+
*/
|
|
1717
|
+
transcript: TranscriptWriter;
|
|
1282
1718
|
/**
|
|
1283
1719
|
* Saves a file with the run's results, such as the agent's raw log,
|
|
1284
1720
|
* whether or not its sandbox is kept. `name` is a relative path of
|
|
@@ -1327,19 +1763,15 @@ export type AgentStep = {
|
|
|
1327
1763
|
kind: 'agent';
|
|
1328
1764
|
expectation: JsonObject;
|
|
1329
1765
|
};
|
|
1766
|
+
/** One user step and what the agent did in answer to it. */
|
|
1330
1767
|
export type TurnView = {
|
|
1331
1768
|
userStepIndex: number;
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
assistantMessages: readonly (Extract<AutEvent, {
|
|
1336
|
-
kind: 'message';
|
|
1337
|
-
}> & {
|
|
1338
|
-
role: 'assistant';
|
|
1339
|
-
source: 'aut';
|
|
1340
|
-
})[];
|
|
1769
|
+
/** The transcript records of this turn, on the active path, in order. */
|
|
1770
|
+
records: readonly TreeRecord[];
|
|
1771
|
+
assistantMessages: readonly AssistantMessage[];
|
|
1341
1772
|
toolCalls: readonly {
|
|
1342
|
-
|
|
1773
|
+
/** The assistant message holding the call. */
|
|
1774
|
+
messageId: string;
|
|
1343
1775
|
id: string;
|
|
1344
1776
|
name: string;
|
|
1345
1777
|
arguments: JsonValue;
|
|
@@ -1372,7 +1804,7 @@ export declare function agent(expectation: JsonObject): AgentStep;
|
|
|
1372
1804
|
*/
|
|
1373
1805
|
export type JudgeRunInfo = {
|
|
1374
1806
|
agent?: AutIdentity;
|
|
1375
|
-
/** The model the judge reported using
|
|
1807
|
+
/** The model the judge reported using, as `provider/id`. */
|
|
1376
1808
|
model?: string;
|
|
1377
1809
|
/** Tokens the judge used: never counted in the agent's `tokens`. */
|
|
1378
1810
|
usage?: Usage;
|
|
@@ -1382,8 +1814,8 @@ export type JudgeRunInfo = {
|
|
|
1382
1814
|
reply?: JsonValue;
|
|
1383
1815
|
/** 2 when its first reply was not in the format asked for and it was asked again. */
|
|
1384
1816
|
attempts?: number;
|
|
1385
|
-
/**
|
|
1386
|
-
|
|
1817
|
+
/** The judge's own session, as ATXF; never part of the agent's transcript. */
|
|
1818
|
+
transcript?: Transcript;
|
|
1387
1819
|
};
|
|
1388
1820
|
/** A scorer's "does not apply" result; see `skip()`. */
|
|
1389
1821
|
export type SkippedScore = {
|
|
@@ -1439,14 +1871,21 @@ export type ArtifactView = {
|
|
|
1439
1871
|
};
|
|
1440
1872
|
export type ScoringContext = {
|
|
1441
1873
|
context: AutContext;
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1874
|
+
/**
|
|
1875
|
+
* What the agent did, as an ATXF transcript: all of it for final scorers,
|
|
1876
|
+
* up to this step for checkpoints. `messages(ctx)`, `toolCalls(ctx)` and
|
|
1877
|
+
* `lastReply(ctx)` read it.
|
|
1878
|
+
*/
|
|
1879
|
+
transcript: Transcript;
|
|
1880
|
+
/** Sub-agent transcripts the agent kept, by transcript ID. */
|
|
1881
|
+
subagents: Readonly<Record<string, Transcript>>;
|
|
1882
|
+
/** EvalKit's events so far: steps, checkpoints and scorers. */
|
|
1883
|
+
runEvents: readonly RunEvent[];
|
|
1445
1884
|
artifacts: ArtifactView;
|
|
1446
1885
|
/** Most recent completed turn; absent if no user message has been sent. */
|
|
1447
1886
|
turn?: TurnView;
|
|
1448
|
-
/**
|
|
1449
|
-
output?:
|
|
1887
|
+
/** The text of the last assistant message of `turn`. */
|
|
1888
|
+
output?: string;
|
|
1450
1889
|
/** Values of all the scenario's datasets (candidate and evaluator), by dataset ID. */
|
|
1451
1890
|
data: JsonObject;
|
|
1452
1891
|
/**
|
|
@@ -1566,7 +2005,6 @@ export declare function judge(name: string, options: Omit<JudgeRule, 'kind' | 'n
|
|
|
1566
2005
|
answer?: JudgeAnswer;
|
|
1567
2006
|
}): JudgeRule;
|
|
1568
2007
|
export type EvalPolicy = {
|
|
1569
|
-
timeoutMs?: number;
|
|
1570
2008
|
/** Stop later transcript steps after a failed checkpoint assertion. Default false. */
|
|
1571
2009
|
failfast?: boolean;
|
|
1572
2010
|
};
|
|
@@ -1586,6 +2024,11 @@ export type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
|
|
|
1586
2024
|
* under identical conditions, to see how often it passes. Default 1.
|
|
1587
2025
|
*/
|
|
1588
2026
|
repeat?: number;
|
|
2027
|
+
/**
|
|
2028
|
+
* What each run may use before EvalKit stops it: `{ steps: 40, time: '20m' }`.
|
|
2029
|
+
* Over the project's `limits`; a matrix cell's and `--limit` come after.
|
|
2030
|
+
*/
|
|
2031
|
+
limits?: LimitsInput;
|
|
1589
2032
|
/** Any JSON-convertible object; converted when the eval is defined. */
|
|
1590
2033
|
metadata?: Record<string, unknown>;
|
|
1591
2034
|
workspace?: EvalWorkspace;
|
|
@@ -1646,9 +2089,11 @@ export type EvalSuiteMetadata = {
|
|
|
1646
2089
|
export declare function registerEvals<const TRegistrations extends readonly EvalRegistration[]>(registrations: TRegistrations): EvalRegistry;
|
|
1647
2090
|
/**
|
|
1648
2091
|
* How a run ended: `passed` or `failed` by its scores, `errored` when it could
|
|
1649
|
-
* not finish (the agent, a dataset or EvalKit failed), `cancelled` by Ctrl+C
|
|
2092
|
+
* not finish (the agent, a dataset or EvalKit failed), `cancelled` by Ctrl+C,
|
|
2093
|
+
* `limited` when it hit one of its limits (graded by scorers that support
|
|
2094
|
+
* partial work, and never a pass).
|
|
1650
2095
|
*/
|
|
1651
|
-
export type RunStatus = 'running' | 'passed' | 'failed' | 'errored' | 'cancelled';
|
|
2096
|
+
export type RunStatus = 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'limited';
|
|
1652
2097
|
/** Runs launched together as repeats of one configuration (`repeat`). */
|
|
1653
2098
|
export type Batch = {
|
|
1654
2099
|
id: string;
|
|
@@ -1690,7 +2135,7 @@ export type RunProcess = {
|
|
|
1690
2135
|
hostname: string;
|
|
1691
2136
|
};
|
|
1692
2137
|
export type RunMetadata = {
|
|
1693
|
-
schemaVersion:
|
|
2138
|
+
schemaVersion: 7;
|
|
1694
2139
|
runId: string;
|
|
1695
2140
|
runUri: ResourceUri<'run'>;
|
|
1696
2141
|
evalId: string;
|
|
@@ -1711,6 +2156,18 @@ export type RunMetadata = {
|
|
|
1711
2156
|
workspaceIgnore?: string[];
|
|
1712
2157
|
/** The datasets this run used, with content digests. */
|
|
1713
2158
|
datasets?: RunDataset[];
|
|
2159
|
+
/** The limits in force. */
|
|
2160
|
+
limits?: Limits;
|
|
2161
|
+
/** Where its processes ran; absent for runs on the host. */
|
|
2162
|
+
isolation?: RunIsolation;
|
|
2163
|
+
};
|
|
2164
|
+
/** A run's isolation as its manifest records it: no host paths, no environment. */
|
|
2165
|
+
export type RunIsolation = {
|
|
2166
|
+
kind: 'container';
|
|
2167
|
+
image: string;
|
|
2168
|
+
network: ContainerNetwork;
|
|
2169
|
+
} | {
|
|
2170
|
+
kind: 'sandbox-exec';
|
|
1714
2171
|
};
|
|
1715
2172
|
export type RunDataset = {
|
|
1716
2173
|
id: string;
|
|
@@ -1736,8 +2193,9 @@ export type CheckpointResult = {
|
|
|
1736
2193
|
judge?: JudgeRunInfo;
|
|
1737
2194
|
durationMs?: number;
|
|
1738
2195
|
error?: RecordedError;
|
|
2196
|
+
/** The tool call it matched: the assistant message holding it, and the call's ID. */
|
|
1739
2197
|
matchedToolCall?: {
|
|
1740
|
-
|
|
2198
|
+
messageId: string;
|
|
1741
2199
|
id: string;
|
|
1742
2200
|
};
|
|
1743
2201
|
};
|
|
@@ -1745,13 +2203,17 @@ export type CheckpointResult = {
|
|
|
1745
2203
|
* Metrics EvalKit records for every run; scenario metrics may not reuse
|
|
1746
2204
|
* these names.
|
|
1747
2205
|
*
|
|
1748
|
-
* - `agent time` (ms): from the
|
|
1749
|
-
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1752
|
-
* - `
|
|
2206
|
+
* - `agent time` (ms): from the session's start to the end of its last turn.
|
|
2207
|
+
* - `tokens`: uncached input, cache writes and output, summed over the
|
|
2208
|
+
* transcript (`uncachedTokens`). Absent when nothing reported usage.
|
|
2209
|
+
* - `cached tokens`: input tokens read from a prompt cache.
|
|
2210
|
+
* - `output tokens`: output, reasoning included.
|
|
2211
|
+
* - `cache hit rate`: the share of input tokens read from a cache, 0 to 1.
|
|
2212
|
+
* - `steps`: assistant messages, one per model call.
|
|
2213
|
+
* - `tool calls`: tool calls in the transcript.
|
|
2214
|
+
* - `judge tokens`: `tokens` over the judges' transcripts, never the agent's.
|
|
1753
2215
|
*/
|
|
1754
|
-
export declare const BUILT_IN_METRICS: readonly ['agent time', 'tokens', 'tool calls', 'judge tokens'];
|
|
2216
|
+
export declare const BUILT_IN_METRICS: readonly ['agent time', 'tokens', 'cached tokens', 'output tokens', 'cache hit rate', 'steps', 'tool calls', 'judge tokens'];
|
|
1755
2217
|
export type BuiltInMetricName = (typeof BUILT_IN_METRICS)[number];
|
|
1756
2218
|
/** A built-in metric's name (suggested by editors), or a scenario's own. */
|
|
1757
2219
|
export type MetricName = BuiltInMetricName | (string & {});
|
|
@@ -1785,10 +2247,17 @@ export type RunSummary = {
|
|
|
1785
2247
|
artifacts?: ArtifactEntry[];
|
|
1786
2248
|
attachments?: AttachmentEntry[];
|
|
1787
2249
|
error?: RecordedError;
|
|
2250
|
+
/** The limit a `limited` run hit. */
|
|
2251
|
+
limit?: LimitReached;
|
|
1788
2252
|
};
|
|
1789
2253
|
export type RunWriter = {
|
|
1790
2254
|
readonly location: string;
|
|
1791
|
-
|
|
2255
|
+
/** Appends one of EvalKit's events to `run-events.jsonl`. */
|
|
2256
|
+
appendEvent(event: RunEvent): Promise<void>;
|
|
2257
|
+
/** Appends an ATXF record (the header first) to `transcript.atxf.jsonl`. */
|
|
2258
|
+
appendTranscript(line: Transcript['header'] | Transcript['records'][number]): Promise<void>;
|
|
2259
|
+
/** Writes a sub-agent's whole transcript (JSONL), replacing the one kept. */
|
|
2260
|
+
writeSubagent(id: string, text: string): Promise<void>;
|
|
1792
2261
|
writeScores(scoring: RunScoring): Promise<void>;
|
|
1793
2262
|
/** Writes a file below this run's artifact root. */
|
|
1794
2263
|
writeArtifact(path: string, data: Uint8Array): Promise<void>;
|
|
@@ -1810,17 +2279,165 @@ export type RunResult = {
|
|
|
1810
2279
|
durationMs?: number;
|
|
1811
2280
|
scoring?: RunScoring;
|
|
1812
2281
|
error?: RecordedError;
|
|
2282
|
+
/** The limit a `limited` run hit. */
|
|
2283
|
+
limit?: LimitReached;
|
|
1813
2284
|
};
|
|
1814
2285
|
export declare function recordError(error: unknown): RecordedError;
|
|
2286
|
+
/** Messages on the active path of what the agent did, optionally of one role. */
|
|
2287
|
+
export declare function messages(scoring: Pick<ScoringContext, 'transcript'>, role?: MessageRecord['role']): Message[];
|
|
2288
|
+
/** A message as scorers see it: who said it and its text, with the ATXF record for the rest. */
|
|
2289
|
+
export type Message = {
|
|
2290
|
+
id: string;
|
|
2291
|
+
role: MessageRecord['role'];
|
|
2292
|
+
/** Its text blocks, joined; tool calls and images are left out. */
|
|
2293
|
+
text: string;
|
|
2294
|
+
time: string;
|
|
2295
|
+
record: MessageRecord;
|
|
2296
|
+
};
|
|
2297
|
+
/** The agent's tool calls, in order, each with its result when recorded; optionally of one tool. */
|
|
2298
|
+
export declare function toolCalls(scoring: Pick<ScoringContext, 'transcript'>, name?: string): ToolCall[];
|
|
2299
|
+
/** The text of the agent's last reply, or `''`. */
|
|
2300
|
+
export declare function lastReply(scoring: Pick<ScoringContext, 'transcript'>): string;
|
|
2301
|
+
/** Everything the agent's transcript reported using; undefined when nothing reported usage. */
|
|
2302
|
+
export declare function usage(scoring: Pick<ScoringContext, 'transcript'>): Usage | undefined;
|
|
2303
|
+
/**
|
|
2304
|
+
* What the model saw at the end of the agent's transcript, rebuilt by ATXF
|
|
2305
|
+
* (compactions and context edits applied): its instructions, tools and
|
|
2306
|
+
* messages.
|
|
2307
|
+
*/
|
|
2308
|
+
export declare function modelContext(scoring: Pick<ScoringContext, 'transcript'>): ModelContext$1;
|
|
1815
2309
|
//#endregion
|
|
1816
|
-
//#region ../agents/src/
|
|
1817
|
-
|
|
2310
|
+
//#region ../agents/src/harness.d.ts
|
|
2311
|
+
/** Options every coding-agent harness takes. */
|
|
2312
|
+
type HarnessOptions = {
|
|
2313
|
+
/** The CLI to run; defaults to the harness's own name (`pi`, `codex`, …). */
|
|
1818
2314
|
command?: string;
|
|
1819
|
-
/**
|
|
1820
|
-
|
|
2315
|
+
/**
|
|
2316
|
+
* The model, in the CLI's own syntax (`--model`), or a function of the
|
|
2317
|
+
* run's parameters for a matrix: `({ model }) => String(model)`.
|
|
2318
|
+
*/
|
|
2319
|
+
model?: string | ((parameters: JsonObject) => string | undefined);
|
|
2320
|
+
/** More arguments for every turn, after EvalKit's own. */
|
|
2321
|
+
args?: readonly string[];
|
|
2322
|
+
/** Environment variables for the CLI, such as an API key or proxy settings. */
|
|
2323
|
+
env?: Readonly<Record<string, string>>;
|
|
2324
|
+
/**
|
|
2325
|
+
* Which config the CLI reads. `'private'` (the default) points it at a
|
|
2326
|
+
* new, empty config directory in the run's private home, so the person's
|
|
2327
|
+
* extensions, skills, instructions and logins never reach the agent and
|
|
2328
|
+
* every run starts the same; give it what it needs with `configFiles`
|
|
2329
|
+
* and `env`. `'user'` uses the person's own config, which isolation
|
|
2330
|
+
* usually hides: allow it with `sandboxExec({ read })`.
|
|
2331
|
+
*/
|
|
2332
|
+
config?: 'private' | 'user';
|
|
2333
|
+
/**
|
|
2334
|
+
* Files to write into the private config directory before the first
|
|
2335
|
+
* turn, by path relative to it (`'auth.json'`), such as a provider's
|
|
2336
|
+
* settings. The agent can read them, so prefer credentials it cannot
|
|
2337
|
+
* use elsewhere, or a proxy that adds them.
|
|
2338
|
+
*/
|
|
2339
|
+
configFiles?: Readonly<Record<string, string | Uint8Array>>;
|
|
2340
|
+
};
|
|
2341
|
+
/** One turn's command line. */
|
|
2342
|
+
type HarnessTurn = {
|
|
2343
|
+
/** The CLI, as configured. */
|
|
2344
|
+
command: string;
|
|
2345
|
+
/** The model for this run, if one was chosen. */
|
|
2346
|
+
model: string | undefined;
|
|
2347
|
+
/** The private config directory, or undefined with `config: 'user'`. */
|
|
2348
|
+
configDir: string | undefined;
|
|
2349
|
+
/** The run's directory for this harness's own files, as commands see it. */
|
|
2350
|
+
stateDir: string;
|
|
2351
|
+
/** The session to continue, or undefined on the first turn when the CLI picks it. */
|
|
2352
|
+
session: string | undefined;
|
|
2353
|
+
first: boolean;
|
|
2354
|
+
};
|
|
2355
|
+
/** What a harness needs to say about its CLI. */
|
|
2356
|
+
type HarnessSpec = {
|
|
2357
|
+
id: string;
|
|
2358
|
+
name: string;
|
|
2359
|
+
command: string;
|
|
2360
|
+
/** Environment variables that point the CLI at a private config directory. */
|
|
2361
|
+
configEnv(configDir: string): Record<string, string>;
|
|
2362
|
+
/** A session ID to start with, for CLIs that take one. */
|
|
2363
|
+
newSession?(): string;
|
|
2364
|
+
/** The command for one turn, starting with `turn.command`; the message goes on stdin. */
|
|
2365
|
+
argv(turn: HarnessTurn): string[];
|
|
2366
|
+
/** The session ID the CLI printed, for CLIs that pick their own. */
|
|
2367
|
+
sessionFromOutput?(stdout: string): string | undefined;
|
|
2368
|
+
/**
|
|
2369
|
+
* A shell command that copies the session's native record to `target`;
|
|
2370
|
+
* it runs where the CLI ran, with the same environment.
|
|
2371
|
+
*/
|
|
2372
|
+
saveSession(options: HarnessTurn & {
|
|
2373
|
+
session: string;
|
|
2374
|
+
target: string;
|
|
2375
|
+
}): string[];
|
|
2376
|
+
/** The native record as an ATXF transcript. */
|
|
2377
|
+
toAtxf(text: string): Transcript$1;
|
|
2378
|
+
};
|
|
2379
|
+
/**
|
|
2380
|
+
* An adapter that runs a coding-agent CLI through `context.shell`, one
|
|
2381
|
+
* non-interactive invocation per user message, continuing one session.
|
|
2382
|
+
* After each turn it imports the CLI's own session record through ATXF,
|
|
2383
|
+
* so the run's transcript has every message, tool call and token count.
|
|
2384
|
+
*/
|
|
2385
|
+
export declare function harnessAgent(spec: HarnessSpec, options: HarnessOptions): AutAdapter;
|
|
2386
|
+
//#endregion
|
|
2387
|
+
//#region ../agents/src/pi.d.ts
|
|
2388
|
+
type PiOptions = HarnessOptions & {
|
|
2389
|
+
/** False runs Pi without tools (`--no-tools`), such as for a judge. */
|
|
2390
|
+
tools?: boolean;
|
|
2391
|
+
/** Skill files or directories to load (`--skill`), as paths commands see. */
|
|
2392
|
+
skills?: readonly string[];
|
|
2393
|
+
/** Text appended to Pi's system prompt (`--append-system-prompt`). */
|
|
2394
|
+
appendSystemPrompt?: string;
|
|
2395
|
+
};
|
|
2396
|
+
/**
|
|
2397
|
+
* Pi (https://pi.dev) as the agent under test: `pi --print` with its own
|
|
2398
|
+
* tools, system prompt and context handling, one session per run. Its
|
|
2399
|
+
* session file becomes the run's transcript.
|
|
2400
|
+
*/
|
|
2401
|
+
export declare function piAgent(options?: PiOptions): AutAdapter;
|
|
2402
|
+
//#endregion
|
|
2403
|
+
//#region ../agents/src/codex.d.ts
|
|
2404
|
+
type CodexOptions = HarnessOptions;
|
|
2405
|
+
/**
|
|
2406
|
+
* Codex as the agent under test: `codex exec` with approvals and its own
|
|
2407
|
+
* sandbox off (EvalKit's isolation is the sandbox; Codex's cannot nest in
|
|
2408
|
+
* `sandboxExec()`), one session per run. Its rollout file becomes the
|
|
2409
|
+
* run's transcript.
|
|
2410
|
+
*/
|
|
2411
|
+
export declare function codexAgent(options?: CodexOptions): AutAdapter;
|
|
2412
|
+
//#endregion
|
|
2413
|
+
//#region ../agents/src/opencode.d.ts
|
|
2414
|
+
type OpencodeOptions = HarnessOptions & {
|
|
2415
|
+
/** The opencode agent to run (`--agent`), such as `build`. */
|
|
2416
|
+
agent?: string;
|
|
1821
2417
|
};
|
|
1822
|
-
/**
|
|
1823
|
-
|
|
2418
|
+
/**
|
|
2419
|
+
* opencode as the agent under test: `opencode run --standalone`, with a
|
|
2420
|
+
* private server per command and permissions auto-approved, one session
|
|
2421
|
+
* per run. Its session export becomes the run's transcript.
|
|
2422
|
+
*
|
|
2423
|
+
* With `config: 'private'`, opencode's config, data and state directories
|
|
2424
|
+
* (`XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_STATE_HOME`) are in the config
|
|
2425
|
+
* directory: put `config/opencode/opencode.json` and
|
|
2426
|
+
* `data/opencode/auth.json` in `configFiles`.
|
|
2427
|
+
*/
|
|
2428
|
+
export declare function opencodeAgent(options?: OpencodeOptions): AutAdapter;
|
|
2429
|
+
//#endregion
|
|
2430
|
+
//#region ../agents/src/claude-code.d.ts
|
|
2431
|
+
type ClaudeCodeOptions = HarnessOptions & {
|
|
2432
|
+
/** Text appended to Claude Code's system prompt (`--append-system-prompt`). */
|
|
2433
|
+
appendSystemPrompt?: string;
|
|
2434
|
+
};
|
|
2435
|
+
/**
|
|
2436
|
+
* Claude Code as the agent under test: `claude -p` with every tool allowed
|
|
2437
|
+
* (EvalKit's isolation is the sandbox), one session per run. Its session
|
|
2438
|
+
* file becomes the run's transcript.
|
|
2439
|
+
*/
|
|
2440
|
+
export declare function claudeCodeAgent(options?: ClaudeCodeOptions): AutAdapter;
|
|
1824
2441
|
//#endregion
|
|
1825
|
-
export type { AttachmentLimits, CriteriaOptions, CriterionInput, CriterionResult, DefinitionSite, EvalMatrix, EvalMatrixCell, EvalkitConfig, JudgeAnswer, JudgeChoice, JudgeCriterion, KeepSandboxes, MatrixSelection, ReachedCriterion, ShareConfig, ShareHeaders, UnreachedCriterion, Usage };
|
|
2442
|
+
export type { ATXF_VERSION, AssistantBlock, AssistantMessage, AttachmentLimits, ClaudeCodeOptions, CodexOptions, CriteriaOptions, CriterionInput, CriterionResult, DefinitionSite, EntryRecord, EvalMatrix, EvalMatrixCell, EvalkitConfig, HarnessOptions, HarnessSpec, HarnessTurn, JudgeAnswer, JudgeChoice, JudgeCriterion, KeepSandboxes, LIMIT_KINDS, LIMIT_PARAMETER_PREFIX, LimitKind, LimitReached, Limits, LimitsInput, MatrixSelection, MessageRecord, ModelContext, ModelRef, OpencodeOptions, PairedToolCall, PiOptions, ReachedCriterion, ShareConfig, ShareHeaders, ToolCall, ToolCallBlock, ToolMessage, Transcript, TranscriptHeader, TreeRecord, UnreachedCriterion, Usage, UsageInput, UserBlock, UserContent, activePath, callsIn, contentText, emptyTranscript, formatLimit, isTreeRecord, limitsFromParameters, modelName, parseDuration, parseLimitFlag, parseLimits, parseModel, resolveLimits, toolResultValue, transcriptMessages, transcriptReply, transcriptToolCalls };
|
|
1826
2443
|
//# sourceMappingURL=index.d.mts.map
|