@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/runner.d.mts
CHANGED
|
@@ -1,51 +1,6 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
1
|
import * as Schema from "effect/Schema";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly _tag: "AutExecutionError";
|
|
6
|
-
} & Readonly<A>;
|
|
7
|
-
export declare class AutExecutionError extends AutExecutionError_base<{
|
|
8
|
-
cause: unknown;
|
|
9
|
-
message?: string;
|
|
10
|
-
}> {}
|
|
11
|
-
declare const DatasetError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
12
|
-
readonly _tag: "DatasetError";
|
|
13
|
-
} & Readonly<A>;
|
|
14
|
-
export declare class DatasetError extends DatasetError_base<{
|
|
15
|
-
cause: unknown;
|
|
16
|
-
message?: string;
|
|
17
|
-
}> {}
|
|
18
|
-
declare const ReportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
19
|
-
readonly _tag: "ReportError";
|
|
20
|
-
} & Readonly<A>;
|
|
21
|
-
export declare class ReportError extends ReportError_base<{
|
|
22
|
-
cause: unknown;
|
|
23
|
-
message?: string;
|
|
24
|
-
}> {}
|
|
25
|
-
declare const ScoringError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
26
|
-
readonly _tag: "ScoringError";
|
|
27
|
-
} & Readonly<A>;
|
|
28
|
-
export declare class ScoringError extends ScoringError_base<{
|
|
29
|
-
cause: unknown;
|
|
30
|
-
message?: string;
|
|
31
|
-
}> {}
|
|
32
|
-
declare const CheckpointExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
33
|
-
readonly _tag: "CheckpointExecutionError";
|
|
34
|
-
} & Readonly<A>;
|
|
35
|
-
export declare class CheckpointExecutionError extends CheckpointExecutionError_base<{
|
|
36
|
-
step: number;
|
|
37
|
-
name: string;
|
|
38
|
-
message: string;
|
|
39
|
-
cause: unknown;
|
|
40
|
-
}> {}
|
|
41
|
-
declare const CancelledError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
42
|
-
readonly _tag: "CancelledError";
|
|
43
|
-
} & Readonly<A>;
|
|
44
|
-
/** The run was cancelled (Ctrl+C); the run stops and is finalized as cancelled. */
|
|
45
|
-
export declare class CancelledError extends CancelledError_base<{
|
|
46
|
-
message: string;
|
|
47
|
-
}> {}
|
|
48
|
-
//#endregion
|
|
2
|
+
import { AssistantBlock, EntryRecord, MessageRecord, ModelRef, Origin, StopReason, Transcript, Transcript as Transcript$1, TreeRecord, TreeRecord as TreeRecord$1, Usage, UserBlock } from "@leostera/atxf";
|
|
3
|
+
import { Effect } from "effect";
|
|
49
4
|
//#region ../core/src/identity.d.ts
|
|
50
5
|
declare const ResourceKindSchema: Schema.Literal<["run", "artifact"]>;
|
|
51
6
|
type ResourceKind = typeof ResourceKindSchema.Type;
|
|
@@ -106,66 +61,276 @@ type Dataset = {
|
|
|
106
61
|
readonly source: DatasetSource;
|
|
107
62
|
};
|
|
108
63
|
//#endregion
|
|
109
|
-
//#region ../core/src/
|
|
64
|
+
//#region ../core/src/usage.d.ts
|
|
110
65
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
66
|
+
* Token usage as an adapter reports it: ATXF's buckets, each optional.
|
|
67
|
+
* The buckets are disjoint: `input` excludes cached tokens, which are
|
|
68
|
+
* `cacheRead` (read from a prompt cache) and `cacheWrite` (written to one);
|
|
69
|
+
* `output` includes `reasoning`. Convert your provider's conventions: one
|
|
70
|
+
* that counts cached tokens inside its prompt tokens reports
|
|
71
|
+
* `input: promptTokens - cachedTokens, cacheRead: cachedTokens`.
|
|
113
72
|
*/
|
|
114
|
-
type
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
73
|
+
type UsageInput = {
|
|
74
|
+
input?: number;
|
|
75
|
+
output?: number;
|
|
76
|
+
cacheRead?: number;
|
|
77
|
+
cacheWrite?: number;
|
|
78
|
+
reasoning?: number;
|
|
79
|
+
/** The provider's total; used only when no bucket is reported. */
|
|
80
|
+
total?: number;
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region ../core/src/agent-transcript.d.ts
|
|
84
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
85
|
+
/** An ATXF tree record to append: `id`, `time` and `parentId` are filled in when absent. */
|
|
86
|
+
type RecordInput = DistributiveOmit<TreeRecord, 'id' | 'time' | 'parentId' | 'hash'> & {
|
|
87
|
+
id?: string;
|
|
88
|
+
time?: string;
|
|
89
|
+
parentId?: string | null;
|
|
90
|
+
};
|
|
91
|
+
/** An assistant message: what the model said and the tools it called. */
|
|
92
|
+
type AssistantInput = {
|
|
93
|
+
/** Text, or ATXF blocks: `text`, `reasoning`, `tool_call` and `image`. */
|
|
94
|
+
content: string | AssistantBlock[];
|
|
95
|
+
/** `provider/id` (`openai/gpt-5`), or an ATXF model reference. */
|
|
96
|
+
model?: string | ModelRef;
|
|
97
|
+
/** This response's usage, in ATXF's buckets. */
|
|
98
|
+
usage?: UsageInput;
|
|
99
|
+
stop?: StopReason;
|
|
100
|
+
error?: {
|
|
101
|
+
message: string;
|
|
102
|
+
code?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Where an adapter records what its agent did, as an ATXF transcript
|
|
107
|
+
* (https://atxf.leostera.dev). Each method appends one record and returns
|
|
108
|
+
* its ID. EvalKit writes each scripted user message itself, unless the
|
|
109
|
+
* adapter writes it (or imports a transcript holding it) first.
|
|
110
|
+
*/
|
|
111
|
+
type TranscriptWriter = {
|
|
112
|
+
/** A message the agent received. */
|
|
113
|
+
user(content: string | UserBlock[], options?: {
|
|
114
|
+
origin?: Origin;
|
|
115
|
+
}): string;
|
|
116
|
+
assistant(message: AssistantInput): string;
|
|
117
|
+
/**
|
|
118
|
+
* A tool call's result. A string is the result's text; any other
|
|
119
|
+
* JSON-convertible value is kept as is in `details.result` and shown as
|
|
120
|
+
* JSON.
|
|
121
|
+
*/
|
|
122
|
+
toolResult(callId: string, result: unknown, options?: {
|
|
123
|
+
name?: string;
|
|
124
|
+
isError?: boolean;
|
|
125
|
+
}): string;
|
|
126
|
+
/** Any other ATXF tree record, such as `reasoning` settings, a compaction or a sub-agent link. */
|
|
127
|
+
append(record: RecordInput): string;
|
|
128
|
+
/**
|
|
129
|
+
* Appends an ATXF transcript's records that were not imported before (by
|
|
130
|
+
* ID), keeping their IDs and native records: for agents whose sessions
|
|
131
|
+
* ATXF converts (`pi.toAtxf(await readFile(sessionFile, 'utf8'))`, from `@leostera/atxf/pi`). Import the whole session
|
|
132
|
+
* after each turn; a user message matching the one EvalKit is about to
|
|
133
|
+
* write stands for it.
|
|
134
|
+
*/
|
|
135
|
+
import(transcript: Transcript): void;
|
|
136
|
+
/**
|
|
137
|
+
* Marks a turn's start or end, as the agent saw it: `turn('start')`
|
|
138
|
+
* returns a turn ID to pass to `turn('end', { turnId, outcome })`.
|
|
139
|
+
*/
|
|
140
|
+
turn(phase: 'start' | 'end', options?: {
|
|
141
|
+
turnId?: string;
|
|
142
|
+
outcome?: 'succeeded' | 'failed' | 'interrupted';
|
|
143
|
+
error?: {
|
|
144
|
+
message: string;
|
|
145
|
+
code?: string;
|
|
146
|
+
};
|
|
147
|
+
}): string;
|
|
148
|
+
/**
|
|
149
|
+
* Keeps a sub-agent's ATXF transcript with the run, in
|
|
150
|
+
* `transcripts/<id>.atxf.jsonl`, linked from this one by an `agent_link`
|
|
151
|
+
* record with its `transcriptId` (append one, or import a session that
|
|
152
|
+
* has it). Its steps and tokens count toward the run's limits. Pass the
|
|
153
|
+
* whole transcript again as it grows; it replaces the one kept.
|
|
154
|
+
*/
|
|
155
|
+
subagent(transcript: Transcript): void;
|
|
154
156
|
};
|
|
155
157
|
type TurnToolCall = {
|
|
156
158
|
name: string;
|
|
157
159
|
arguments?: unknown;
|
|
158
|
-
/** When given,
|
|
160
|
+
/** When given, the call's result is recorded after it. */
|
|
159
161
|
result?: unknown;
|
|
160
162
|
id?: string;
|
|
161
163
|
};
|
|
162
|
-
/** What `send()` may return instead of
|
|
164
|
+
/** What `send()` may return instead of writing to the transcript. A string is the reply. */
|
|
163
165
|
type TurnResult = string | {
|
|
166
|
+
/** Text, or a JSON value (recorded as its JSON text). */
|
|
164
167
|
reply?: unknown;
|
|
165
168
|
toolCalls?: readonly TurnToolCall[];
|
|
166
|
-
usage?:
|
|
167
|
-
/** The model that answered
|
|
168
|
-
model?: string;
|
|
169
|
+
usage?: UsageInput;
|
|
170
|
+
/** The model that answered. */
|
|
171
|
+
model?: string | ModelRef;
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region ../core/src/isolation.d.ts
|
|
175
|
+
/**
|
|
176
|
+
* Where a run's processes run, and the shell adapters and scorers use to
|
|
177
|
+
* run them (RFD0009). Types and constructors only: the runner implements
|
|
178
|
+
* them.
|
|
179
|
+
*/
|
|
180
|
+
/** Commands run on the host, in the run's workspace. The default. */
|
|
181
|
+
type NoIsolation = {
|
|
182
|
+
kind: 'none';
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* What a run's container can reach: nothing, only the project's fixtures,
|
|
186
|
+
* or whatever the container runtime allows by default.
|
|
187
|
+
*/
|
|
188
|
+
type ContainerNetwork = 'none' | 'fixtures' | 'full';
|
|
189
|
+
/** A host path mounted read-only into every run's container. */
|
|
190
|
+
type ContainerMount = {
|
|
191
|
+
host: string;
|
|
192
|
+
path: string;
|
|
193
|
+
};
|
|
194
|
+
/** One container per run, from `image`, with the candidate workspace at `/workspace`. */
|
|
195
|
+
type ContainerIsolation = {
|
|
196
|
+
kind: 'container';
|
|
197
|
+
/** An image reference (`node:22`), or a Dockerfile path relative to the project (`./evals/Dockerfile`). */
|
|
198
|
+
image: string;
|
|
199
|
+
network: ContainerNetwork;
|
|
200
|
+
/** The `docker`-compatible command to run: `docker` (the default) or `podman`. */
|
|
201
|
+
runtime: string;
|
|
202
|
+
/** Names of host environment variables passed into the container; nothing else is. */
|
|
203
|
+
env: readonly string[];
|
|
204
|
+
mounts: readonly ContainerMount[];
|
|
205
|
+
};
|
|
206
|
+
/** macOS only: each run's processes run under a generated `sandbox-exec` profile. */
|
|
207
|
+
type SandboxExecIsolation = {
|
|
208
|
+
kind: 'sandbox-exec';
|
|
209
|
+
/** Host paths the run may read and write besides its workspace, such as a cache (`~/.npm`). */
|
|
210
|
+
allow: readonly string[];
|
|
211
|
+
/** Host paths the run may only read, such as a toolchain or an agent CLI's install. */
|
|
212
|
+
read: readonly string[];
|
|
213
|
+
/** More host paths the run may not touch, such as a fixture's state; `allow` and `read` still win inside them. */
|
|
214
|
+
deny: readonly string[];
|
|
215
|
+
/**
|
|
216
|
+
* Names of host environment variables the run gets, besides `PATH`,
|
|
217
|
+
* `HOME`, `TMPDIR`, `USER`, `LANG` and `TERM`; undefined passes the whole
|
|
218
|
+
* environment. A command's own `env` is added on top.
|
|
219
|
+
*/
|
|
220
|
+
env?: readonly string[];
|
|
221
|
+
};
|
|
222
|
+
type Isolation = NoIsolation | ContainerIsolation | SandboxExecIsolation;
|
|
223
|
+
/**
|
|
224
|
+
* A service runs reach, such as a fake store or API, started on the host
|
|
225
|
+
* before the first run that needs it and stopped after the invocation's
|
|
226
|
+
* last.
|
|
227
|
+
*/
|
|
228
|
+
type Fixture = {
|
|
229
|
+
/** The command that starts it, run with `sh -c` in the project root. */
|
|
230
|
+
start: string;
|
|
231
|
+
/** A URL polled until it answers, or a command that must exit 0. */
|
|
232
|
+
ready?: string;
|
|
233
|
+
/** A command run before the fixture is stopped. */
|
|
234
|
+
stop?: string;
|
|
235
|
+
/** The port it listens on; taken from `ready` when that is a URL with one. */
|
|
236
|
+
port?: number;
|
|
237
|
+
};
|
|
238
|
+
/** A fixture as one run reaches it. */
|
|
239
|
+
type FixtureAddress = {
|
|
240
|
+
/** Where the run reaches it: `http://localhost:8787`, or `http://fixtures.<name>:8787` from a container. */
|
|
241
|
+
url: string;
|
|
242
|
+
};
|
|
243
|
+
/** A process's exit: a signal shows as 128 plus its number, a timeout as 124. */
|
|
244
|
+
type ShellExit = {
|
|
245
|
+
exitCode: number;
|
|
246
|
+
/** The signal that stopped it, if one did. */
|
|
247
|
+
signal?: string;
|
|
248
|
+
/** True when `timeoutMs` passed and the process was stopped. */
|
|
249
|
+
timedOut?: true;
|
|
250
|
+
};
|
|
251
|
+
type ShellResult = ShellExit & {
|
|
252
|
+
stdout: string;
|
|
253
|
+
stderr: string;
|
|
254
|
+
};
|
|
255
|
+
type ShellOptions = {
|
|
256
|
+
/** Relative to the workspace. */
|
|
257
|
+
cwd?: string;
|
|
258
|
+
/** Added to the environment the process gets. */
|
|
259
|
+
env?: Readonly<Record<string, string>>;
|
|
260
|
+
/** Stops the process when aborted. Default: the run's signal. */
|
|
261
|
+
signal?: AbortSignal;
|
|
262
|
+
/** Stops the process after this many milliseconds. */
|
|
263
|
+
timeoutMs?: number;
|
|
264
|
+
/** Written to the process's standard input, which is then closed. */
|
|
265
|
+
input?: string;
|
|
266
|
+
};
|
|
267
|
+
/** A process started with `spawn`. Its output is always read, so it never blocks on a full pipe. */
|
|
268
|
+
type ShellProcess = {
|
|
269
|
+
/** Its process ID where it runs (inside the container, for container isolation). */
|
|
270
|
+
readonly pid: number | undefined;
|
|
271
|
+
/** Its standard output so far: the last megabyte. */
|
|
272
|
+
stdout(): string;
|
|
273
|
+
stderr(): string;
|
|
274
|
+
/** Calls `listener` with each chunk of output as it arrives; returns a function that stops. */
|
|
275
|
+
onOutput(listener: (chunk: string, stream: 'stdout' | 'stderr') => void): () => void;
|
|
276
|
+
/** Resolves when it exits. */
|
|
277
|
+
wait(): Promise<ShellExit>;
|
|
278
|
+
/** Signals it and the processes it started. Default `SIGTERM`. */
|
|
279
|
+
kill(signal?: string): Promise<void>;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* The run's shell: commands, long-lived processes and files, wherever the
|
|
283
|
+
* run's isolation puts them. One per run, shared by the adapter and the
|
|
284
|
+
* run's scorers; processes it started are stopped when the run ends. A
|
|
285
|
+
* string command runs with `sh -c`; an array runs as it is.
|
|
286
|
+
*/
|
|
287
|
+
type Shell = {
|
|
288
|
+
readonly isolation: Isolation['kind'];
|
|
289
|
+
/** The workspace as commands see it: its host path, or `/workspace` in a container. */
|
|
290
|
+
readonly root: string;
|
|
291
|
+
/**
|
|
292
|
+
* The run's private directory, outside the workspace, as commands see it
|
|
293
|
+
* (`/evalkit-home` in a container): for an agent CLI's config and session
|
|
294
|
+
* files. It is never snapshotted, and is removed with the run.
|
|
295
|
+
*/
|
|
296
|
+
readonly home: string;
|
|
297
|
+
exec(command: string | readonly string[], options?: ShellOptions): Promise<ShellResult>;
|
|
298
|
+
spawn(command: string | readonly string[], options?: Omit<ShellOptions, 'timeoutMs'>): ShellProcess;
|
|
299
|
+
/** Relative to the workspace, or absolute inside `root` or `home`. */
|
|
300
|
+
readFile(path: string): Promise<string>;
|
|
301
|
+
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
302
|
+
/** A directory's entries, relative to the workspace; directories end with `/`. */
|
|
303
|
+
list(path?: string): Promise<string[]>;
|
|
304
|
+
};
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region ../core/src/limits.d.ts
|
|
307
|
+
/** What a run may use before EvalKit stops it. */
|
|
308
|
+
type Limits = {
|
|
309
|
+
/** Assistant messages, one per model call, sub-agents included. */
|
|
310
|
+
steps?: number;
|
|
311
|
+
/** The `tokens` metric: uncached input, cache writes and output. Cache reads do not count. */
|
|
312
|
+
tokens?: number;
|
|
313
|
+
/** Milliseconds from the session's start to the end of its last turn; scoring is not counted. */
|
|
314
|
+
time?: number;
|
|
315
|
+
};
|
|
316
|
+
type LimitKind = keyof Limits;
|
|
317
|
+
/** Limits as written in config and scenarios: `time` may be a duration such as `'20m'`. */
|
|
318
|
+
type LimitsInput = {
|
|
319
|
+
steps?: number;
|
|
320
|
+
tokens?: number;
|
|
321
|
+
/** Milliseconds, or `'90s'`, `'20m'`, `'1h'`. */
|
|
322
|
+
time?: number | string;
|
|
323
|
+
};
|
|
324
|
+
/** Which limit a run hit, its value, and how much was used. */
|
|
325
|
+
type LimitReached = {
|
|
326
|
+
limit: LimitKind;
|
|
327
|
+
value: number;
|
|
328
|
+
used: number;
|
|
329
|
+
};
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region ../core/src/transcript.d.ts
|
|
332
|
+
type AssistantMessage = MessageRecord & {
|
|
333
|
+
role: 'assistant';
|
|
169
334
|
};
|
|
170
335
|
//#endregion
|
|
171
336
|
//#region ../core/src/judge.d.ts
|
|
@@ -324,9 +489,10 @@ type EvalCatalogEntry = {
|
|
|
324
489
|
/** Runs started each time the scenario runs (`repeat`). */
|
|
325
490
|
repeat: number;
|
|
326
491
|
policy: {
|
|
327
|
-
timeoutMs?: number;
|
|
328
492
|
failfast?: boolean;
|
|
329
493
|
};
|
|
494
|
+
/** The scenario's own limits; the project's, a cell's and `--limit` may add to them. */
|
|
495
|
+
limits?: Limits;
|
|
330
496
|
transcript: EvalCatalogStep[];
|
|
331
497
|
scorers: EvalCatalogScorer[];
|
|
332
498
|
metadata?: JsonValue;
|
|
@@ -360,6 +526,15 @@ type EvalMatrixDefinition = {
|
|
|
360
526
|
cases?: readonly JsonObject[];
|
|
361
527
|
/** Partial patterns over declared dimensions; matching cells are never run. */
|
|
362
528
|
exclude?: readonly JsonObject[];
|
|
529
|
+
/**
|
|
530
|
+
* Limits to compare, as axes: `{ steps: [40, 80] }`. Each becomes the axis
|
|
531
|
+
* `limits.steps`, so cells show it and `-a limits.steps=80` selects it.
|
|
532
|
+
*/
|
|
533
|
+
limits?: Readonly<{
|
|
534
|
+
steps?: readonly number[];
|
|
535
|
+
tokens?: readonly number[];
|
|
536
|
+
time?: readonly (number | string)[];
|
|
537
|
+
}>;
|
|
363
538
|
};
|
|
364
539
|
type EvalMatrix = EvalMatrixDefinition & {
|
|
365
540
|
kind: 'matrix';
|
|
@@ -376,26 +551,6 @@ type AttachmentLimits = {
|
|
|
376
551
|
maxRunBytes?: number;
|
|
377
552
|
};
|
|
378
553
|
//#endregion
|
|
379
|
-
//#region ../core/src/usage.d.ts
|
|
380
|
-
/**
|
|
381
|
-
* Token usage an agent reports for one turn. EvalKit never measures or infers
|
|
382
|
-
* it; adapters copy it from their provider.
|
|
383
|
-
*/
|
|
384
|
-
type Usage = {
|
|
385
|
-
/**
|
|
386
|
-
* Every input token the model read this turn: the prompt, history and tool
|
|
387
|
-
* results, **including** tokens read from or written to a prompt cache.
|
|
388
|
-
* (Some providers report cached tokens separately; add them in.)
|
|
389
|
-
*/
|
|
390
|
-
inputTokens?: number;
|
|
391
|
-
/** Every token the model produced, including reasoning tokens. */
|
|
392
|
-
outputTokens?: number;
|
|
393
|
-
/** Of `inputTokens`, how many were read from a prompt cache. Informational. */
|
|
394
|
-
cachedInputTokens?: number;
|
|
395
|
-
/** The provider's own total; used only when input and output are not reported. */
|
|
396
|
-
totalTokens?: number;
|
|
397
|
-
};
|
|
398
|
-
//#endregion
|
|
399
554
|
//#region ../core/src/index.d.ts
|
|
400
555
|
type JsonPrimitive = boolean | number | string | null;
|
|
401
556
|
type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
@@ -426,47 +581,6 @@ type RecordedError = {
|
|
|
426
581
|
message: string;
|
|
427
582
|
stack?: string;
|
|
428
583
|
};
|
|
429
|
-
type AutEvent = {
|
|
430
|
-
kind: 'started';
|
|
431
|
-
timestamp: string;
|
|
432
|
-
} | {
|
|
433
|
-
kind: 'message';
|
|
434
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
435
|
-
content: JsonValue;
|
|
436
|
-
timestamp: string;
|
|
437
|
-
} | {
|
|
438
|
-
kind: 'tool-call';
|
|
439
|
-
id: string;
|
|
440
|
-
name: string;
|
|
441
|
-
arguments: JsonValue;
|
|
442
|
-
timestamp: string;
|
|
443
|
-
} | {
|
|
444
|
-
kind: 'tool-result';
|
|
445
|
-
id: string;
|
|
446
|
-
name?: string;
|
|
447
|
-
result: JsonValue;
|
|
448
|
-
timestamp: string;
|
|
449
|
-
} | {
|
|
450
|
-
kind: 'turn-started';
|
|
451
|
-
turn: number;
|
|
452
|
-
timestamp: string;
|
|
453
|
-
} | {
|
|
454
|
-
kind: 'turn-completed';
|
|
455
|
-
turn: number;
|
|
456
|
-
timestamp: string;
|
|
457
|
-
latencyMs?: number;
|
|
458
|
-
usage?: Usage;
|
|
459
|
-
/** The model that answered this turn, when the agent knows it. */
|
|
460
|
-
model?: string;
|
|
461
|
-
} | {
|
|
462
|
-
kind: 'completed';
|
|
463
|
-
output?: JsonValue;
|
|
464
|
-
timestamp: string;
|
|
465
|
-
} | {
|
|
466
|
-
kind: 'error';
|
|
467
|
-
error: RecordedError;
|
|
468
|
-
timestamp: string;
|
|
469
|
-
};
|
|
470
584
|
type RunnerEvent = {
|
|
471
585
|
kind: 'run-started';
|
|
472
586
|
timestamp: string;
|
|
@@ -515,7 +629,10 @@ type RunnerEvent = {
|
|
|
515
629
|
scorer: string;
|
|
516
630
|
error: RecordedError;
|
|
517
631
|
timestamp: string;
|
|
518
|
-
} | {
|
|
632
|
+
} | ({
|
|
633
|
+
kind: 'limit-reached';
|
|
634
|
+
timestamp: string;
|
|
635
|
+
} & LimitReached) | {
|
|
519
636
|
kind: 'run-completed';
|
|
520
637
|
timestamp: string;
|
|
521
638
|
} | {
|
|
@@ -523,11 +640,9 @@ type RunnerEvent = {
|
|
|
523
640
|
error: RecordedError;
|
|
524
641
|
timestamp: string;
|
|
525
642
|
};
|
|
526
|
-
type
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
source: 'runner';
|
|
530
|
-
});
|
|
643
|
+
type RunEvent = RunnerEvent & {
|
|
644
|
+
at: string | null;
|
|
645
|
+
};
|
|
531
646
|
type WorkspaceView = {
|
|
532
647
|
/** Absolute path to this run-scoped workspace. Do not persist it in reports. */
|
|
533
648
|
root: string;
|
|
@@ -545,6 +660,20 @@ type AutContext = {
|
|
|
545
660
|
runtime?: AgentRuntimeName;
|
|
546
661
|
/** Values of the scenario's candidate datasets, by dataset ID. */
|
|
547
662
|
data: JsonObject;
|
|
663
|
+
/**
|
|
664
|
+
* Aborts when the run hits a limit or is cancelled. Pass it to model calls
|
|
665
|
+
* and tool processes so they stop with the run.
|
|
666
|
+
*/
|
|
667
|
+
signal: AbortSignal;
|
|
668
|
+
/** The limits in force for this run; see `limits` in the config. */
|
|
669
|
+
limits: Limits;
|
|
670
|
+
/**
|
|
671
|
+
* The run's shell: run the agent and its tools through it, so they run
|
|
672
|
+
* where the project's `isolation` puts them. Scorers get the same one.
|
|
673
|
+
*/
|
|
674
|
+
shell: Shell;
|
|
675
|
+
/** The project's fixtures, as this run reaches them, by name. */
|
|
676
|
+
fixtures: Readonly<Record<string, FixtureAddress>>;
|
|
548
677
|
/** Contains only resources visible to the AUT/model. */
|
|
549
678
|
workspace: CandidateWorkspace;
|
|
550
679
|
/** Private evaluator capability for trusted AUT adapters; never expose this to the model. */
|
|
@@ -557,8 +686,11 @@ type AutAdapter<TMessage = string> = {
|
|
|
557
686
|
start(options: {
|
|
558
687
|
context: AutContext;
|
|
559
688
|
runtime?: AgentRuntime;
|
|
560
|
-
/**
|
|
561
|
-
|
|
689
|
+
/**
|
|
690
|
+
* Where to record what the agent does, as ATXF. Optional: returning a
|
|
691
|
+
* turn result from `send` is enough for most agents.
|
|
692
|
+
*/
|
|
693
|
+
transcript: TranscriptWriter;
|
|
562
694
|
/**
|
|
563
695
|
* Saves a file with the run's results, such as the agent's raw log,
|
|
564
696
|
* whether or not its sandbox is kept. `name` is a relative path of
|
|
@@ -598,19 +730,15 @@ type AgentStep = {
|
|
|
598
730
|
kind: 'agent';
|
|
599
731
|
expectation: JsonObject;
|
|
600
732
|
};
|
|
733
|
+
/** One user step and what the agent did in answer to it. */
|
|
601
734
|
type TurnView = {
|
|
602
735
|
userStepIndex: number;
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
assistantMessages: readonly (Extract<AutEvent, {
|
|
607
|
-
kind: 'message';
|
|
608
|
-
}> & {
|
|
609
|
-
role: 'assistant';
|
|
610
|
-
source: 'aut';
|
|
611
|
-
})[];
|
|
736
|
+
/** The transcript records of this turn, on the active path, in order. */
|
|
737
|
+
records: readonly TreeRecord$1[];
|
|
738
|
+
assistantMessages: readonly AssistantMessage[];
|
|
612
739
|
toolCalls: readonly {
|
|
613
|
-
|
|
740
|
+
/** The assistant message holding the call. */
|
|
741
|
+
messageId: string;
|
|
614
742
|
id: string;
|
|
615
743
|
name: string;
|
|
616
744
|
arguments: JsonValue;
|
|
@@ -635,7 +763,7 @@ type TranscriptStep = UserStep | AgentStep | ScoringRule | ExpectToolCallStep;
|
|
|
635
763
|
*/
|
|
636
764
|
type JudgeRunInfo = {
|
|
637
765
|
agent?: AutIdentity;
|
|
638
|
-
/** The model the judge reported using
|
|
766
|
+
/** The model the judge reported using, as `provider/id`. */
|
|
639
767
|
model?: string;
|
|
640
768
|
/** Tokens the judge used: never counted in the agent's `tokens`. */
|
|
641
769
|
usage?: Usage;
|
|
@@ -645,8 +773,8 @@ type JudgeRunInfo = {
|
|
|
645
773
|
reply?: JsonValue;
|
|
646
774
|
/** 2 when its first reply was not in the format asked for and it was asked again. */
|
|
647
775
|
attempts?: number;
|
|
648
|
-
/**
|
|
649
|
-
|
|
776
|
+
/** The judge's own session, as ATXF; never part of the agent's transcript. */
|
|
777
|
+
transcript?: Transcript$1;
|
|
650
778
|
};
|
|
651
779
|
/** A scorer's "does not apply" result; see `skip()`. */
|
|
652
780
|
type SkippedScore = {
|
|
@@ -697,14 +825,21 @@ type ArtifactView = {
|
|
|
697
825
|
};
|
|
698
826
|
type ScoringContext = {
|
|
699
827
|
context: AutContext;
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
828
|
+
/**
|
|
829
|
+
* What the agent did, as an ATXF transcript: all of it for final scorers,
|
|
830
|
+
* up to this step for checkpoints. `messages(ctx)`, `toolCalls(ctx)` and
|
|
831
|
+
* `lastReply(ctx)` read it.
|
|
832
|
+
*/
|
|
833
|
+
transcript: Transcript$1;
|
|
834
|
+
/** Sub-agent transcripts the agent kept, by transcript ID. */
|
|
835
|
+
subagents: Readonly<Record<string, Transcript$1>>;
|
|
836
|
+
/** EvalKit's events so far: steps, checkpoints and scorers. */
|
|
837
|
+
runEvents: readonly RunEvent[];
|
|
703
838
|
artifacts: ArtifactView;
|
|
704
839
|
/** Most recent completed turn; absent if no user message has been sent. */
|
|
705
840
|
turn?: TurnView;
|
|
706
|
-
/**
|
|
707
|
-
output?:
|
|
841
|
+
/** The text of the last assistant message of `turn`. */
|
|
842
|
+
output?: string;
|
|
708
843
|
/** Values of all the scenario's datasets (candidate and evaluator), by dataset ID. */
|
|
709
844
|
data: JsonObject;
|
|
710
845
|
/**
|
|
@@ -811,7 +946,6 @@ type MetricResult = {
|
|
|
811
946
|
error?: RecordedError;
|
|
812
947
|
};
|
|
813
948
|
type EvalPolicy = {
|
|
814
|
-
timeoutMs?: number;
|
|
815
949
|
/** Stop later transcript steps after a failed checkpoint assertion. Default false. */
|
|
816
950
|
failfast?: boolean;
|
|
817
951
|
};
|
|
@@ -831,6 +965,11 @@ type EvalDefinition<TAgent extends AutAdapter = AutAdapter> = {
|
|
|
831
965
|
* under identical conditions, to see how often it passes. Default 1.
|
|
832
966
|
*/
|
|
833
967
|
repeat?: number;
|
|
968
|
+
/**
|
|
969
|
+
* What each run may use before EvalKit stops it: `{ steps: 40, time: '20m' }`.
|
|
970
|
+
* Over the project's `limits`; a matrix cell's and `--limit` come after.
|
|
971
|
+
*/
|
|
972
|
+
limits?: LimitsInput;
|
|
834
973
|
/** Any JSON-convertible object; converted when the eval is defined. */
|
|
835
974
|
metadata?: Record<string, unknown>;
|
|
836
975
|
workspace?: EvalWorkspace;
|
|
@@ -859,9 +998,11 @@ type EvalSuiteMetadata = {
|
|
|
859
998
|
};
|
|
860
999
|
/**
|
|
861
1000
|
* How a run ended: `passed` or `failed` by its scores, `errored` when it could
|
|
862
|
-
* not finish (the agent, a dataset or EvalKit failed), `cancelled` by Ctrl+C
|
|
1001
|
+
* not finish (the agent, a dataset or EvalKit failed), `cancelled` by Ctrl+C,
|
|
1002
|
+
* `limited` when it hit one of its limits (graded by scorers that support
|
|
1003
|
+
* partial work, and never a pass).
|
|
863
1004
|
*/
|
|
864
|
-
type RunStatus = 'running' | 'passed' | 'failed' | 'errored' | 'cancelled';
|
|
1005
|
+
type RunStatus = 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'limited';
|
|
865
1006
|
/** Runs launched together as repeats of one configuration (`repeat`). */
|
|
866
1007
|
type Batch = {
|
|
867
1008
|
id: string;
|
|
@@ -903,7 +1044,7 @@ type RunProcess = {
|
|
|
903
1044
|
hostname: string;
|
|
904
1045
|
};
|
|
905
1046
|
type RunMetadata = {
|
|
906
|
-
schemaVersion:
|
|
1047
|
+
schemaVersion: 7;
|
|
907
1048
|
runId: string;
|
|
908
1049
|
runUri: ResourceUri<'run'>;
|
|
909
1050
|
evalId: string;
|
|
@@ -924,6 +1065,18 @@ type RunMetadata = {
|
|
|
924
1065
|
workspaceIgnore?: string[];
|
|
925
1066
|
/** The datasets this run used, with content digests. */
|
|
926
1067
|
datasets?: RunDataset[];
|
|
1068
|
+
/** The limits in force. */
|
|
1069
|
+
limits?: Limits;
|
|
1070
|
+
/** Where its processes ran; absent for runs on the host. */
|
|
1071
|
+
isolation?: RunIsolation;
|
|
1072
|
+
};
|
|
1073
|
+
/** A run's isolation as its manifest records it: no host paths, no environment. */
|
|
1074
|
+
type RunIsolation = {
|
|
1075
|
+
kind: 'container';
|
|
1076
|
+
image: string;
|
|
1077
|
+
network: ContainerNetwork;
|
|
1078
|
+
} | {
|
|
1079
|
+
kind: 'sandbox-exec';
|
|
927
1080
|
};
|
|
928
1081
|
type RunDataset = {
|
|
929
1082
|
id: string;
|
|
@@ -949,8 +1102,9 @@ type CheckpointResult = {
|
|
|
949
1102
|
judge?: JudgeRunInfo;
|
|
950
1103
|
durationMs?: number;
|
|
951
1104
|
error?: RecordedError;
|
|
1105
|
+
/** The tool call it matched: the assistant message holding it, and the call's ID. */
|
|
952
1106
|
matchedToolCall?: {
|
|
953
|
-
|
|
1107
|
+
messageId: string;
|
|
954
1108
|
id: string;
|
|
955
1109
|
};
|
|
956
1110
|
};
|
|
@@ -958,13 +1112,17 @@ type CheckpointResult = {
|
|
|
958
1112
|
* Metrics EvalKit records for every run; scenario metrics may not reuse
|
|
959
1113
|
* these names.
|
|
960
1114
|
*
|
|
961
|
-
* - `agent time` (ms): from the
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
* - `
|
|
1115
|
+
* - `agent time` (ms): from the session's start to the end of its last turn.
|
|
1116
|
+
* - `tokens`: uncached input, cache writes and output, summed over the
|
|
1117
|
+
* transcript (`uncachedTokens`). Absent when nothing reported usage.
|
|
1118
|
+
* - `cached tokens`: input tokens read from a prompt cache.
|
|
1119
|
+
* - `output tokens`: output, reasoning included.
|
|
1120
|
+
* - `cache hit rate`: the share of input tokens read from a cache, 0 to 1.
|
|
1121
|
+
* - `steps`: assistant messages, one per model call.
|
|
1122
|
+
* - `tool calls`: tool calls in the transcript.
|
|
1123
|
+
* - `judge tokens`: `tokens` over the judges' transcripts, never the agent's.
|
|
966
1124
|
*/
|
|
967
|
-
declare const BUILT_IN_METRICS: readonly ['agent time', 'tokens', 'tool calls', 'judge tokens'];
|
|
1125
|
+
declare const BUILT_IN_METRICS: readonly ['agent time', 'tokens', 'cached tokens', 'output tokens', 'cache hit rate', 'steps', 'tool calls', 'judge tokens'];
|
|
968
1126
|
type BuiltInMetricName = (typeof BUILT_IN_METRICS)[number];
|
|
969
1127
|
/** A built-in metric's name (suggested by editors), or a scenario's own. */
|
|
970
1128
|
type MetricName = BuiltInMetricName | (string & {});
|
|
@@ -998,10 +1156,17 @@ type RunSummary = {
|
|
|
998
1156
|
artifacts?: ArtifactEntry[];
|
|
999
1157
|
attachments?: AttachmentEntry[];
|
|
1000
1158
|
error?: RecordedError;
|
|
1159
|
+
/** The limit a `limited` run hit. */
|
|
1160
|
+
limit?: LimitReached;
|
|
1001
1161
|
};
|
|
1002
1162
|
type RunWriter = {
|
|
1003
1163
|
readonly location: string;
|
|
1004
|
-
|
|
1164
|
+
/** Appends one of EvalKit's events to `run-events.jsonl`. */
|
|
1165
|
+
appendEvent(event: RunEvent): Promise<void>;
|
|
1166
|
+
/** Appends an ATXF record (the header first) to `transcript.atxf.jsonl`. */
|
|
1167
|
+
appendTranscript(line: Transcript$1['header'] | Transcript$1['records'][number]): Promise<void>;
|
|
1168
|
+
/** Writes a sub-agent's whole transcript (JSONL), replacing the one kept. */
|
|
1169
|
+
writeSubagent(id: string, text: string): Promise<void>;
|
|
1005
1170
|
writeScores(scoring: RunScoring): Promise<void>;
|
|
1006
1171
|
/** Writes a file below this run's artifact root. */
|
|
1007
1172
|
writeArtifact(path: string, data: Uint8Array): Promise<void>;
|
|
@@ -1023,8 +1188,86 @@ type RunResult = {
|
|
|
1023
1188
|
durationMs?: number;
|
|
1024
1189
|
scoring?: RunScoring;
|
|
1025
1190
|
error?: RecordedError;
|
|
1191
|
+
/** The limit a `limited` run hit. */
|
|
1192
|
+
limit?: LimitReached;
|
|
1026
1193
|
};
|
|
1027
1194
|
//#endregion
|
|
1195
|
+
//#region ../runner/src/errors.d.ts
|
|
1196
|
+
declare const AutExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1197
|
+
readonly _tag: "AutExecutionError";
|
|
1198
|
+
} & Readonly<A>;
|
|
1199
|
+
export declare class AutExecutionError extends AutExecutionError_base<{
|
|
1200
|
+
cause: unknown;
|
|
1201
|
+
message?: string;
|
|
1202
|
+
}> {}
|
|
1203
|
+
declare const DatasetError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1204
|
+
readonly _tag: "DatasetError";
|
|
1205
|
+
} & Readonly<A>;
|
|
1206
|
+
export declare class DatasetError extends DatasetError_base<{
|
|
1207
|
+
cause: unknown;
|
|
1208
|
+
message?: string;
|
|
1209
|
+
}> {}
|
|
1210
|
+
declare const ReportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1211
|
+
readonly _tag: "ReportError";
|
|
1212
|
+
} & Readonly<A>;
|
|
1213
|
+
export declare class ReportError extends ReportError_base<{
|
|
1214
|
+
cause: unknown;
|
|
1215
|
+
message?: string;
|
|
1216
|
+
}> {}
|
|
1217
|
+
declare const ScoringError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1218
|
+
readonly _tag: "ScoringError";
|
|
1219
|
+
} & Readonly<A>;
|
|
1220
|
+
export declare class ScoringError extends ScoringError_base<{
|
|
1221
|
+
cause: unknown;
|
|
1222
|
+
message?: string;
|
|
1223
|
+
}> {}
|
|
1224
|
+
declare const CheckpointExecutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1225
|
+
readonly _tag: "CheckpointExecutionError";
|
|
1226
|
+
} & Readonly<A>;
|
|
1227
|
+
export declare class CheckpointExecutionError extends CheckpointExecutionError_base<{
|
|
1228
|
+
step: number;
|
|
1229
|
+
name: string;
|
|
1230
|
+
message: string;
|
|
1231
|
+
cause: unknown;
|
|
1232
|
+
}> {}
|
|
1233
|
+
declare const CancelledError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1234
|
+
readonly _tag: "CancelledError";
|
|
1235
|
+
} & Readonly<A>;
|
|
1236
|
+
/** The run was cancelled (Ctrl+C); the run stops and is finalized as cancelled. */
|
|
1237
|
+
export declare class CancelledError extends CancelledError_base<{
|
|
1238
|
+
message: string;
|
|
1239
|
+
}> {}
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region ../runner/src/shell/fixtures.d.ts
|
|
1242
|
+
type FixtureSet = {
|
|
1243
|
+
/** Starts every fixture, once; later calls wait for the same start. Throws when one never becomes ready. */
|
|
1244
|
+
ensure(): Promise<void>;
|
|
1245
|
+
/** True once `ensure` was called. */
|
|
1246
|
+
readonly started: boolean;
|
|
1247
|
+
/** The fixtures as a run with this isolation reaches them. */
|
|
1248
|
+
addresses(isolation: Isolation): Record<string, FixtureAddress>;
|
|
1249
|
+
/** The internal network containers share with the fixtures' proxies, created on first use. */
|
|
1250
|
+
network(runtime: string): Promise<string>;
|
|
1251
|
+
/** Each fixture's output so far. */
|
|
1252
|
+
logs(): Array<{
|
|
1253
|
+
name: string;
|
|
1254
|
+
content: string;
|
|
1255
|
+
}>;
|
|
1256
|
+
/** Runs each `stop` command, then stops the fixtures, their proxies and network. */
|
|
1257
|
+
stop(): Promise<void>;
|
|
1258
|
+
};
|
|
1259
|
+
/**
|
|
1260
|
+
* The project's fixtures for one invocation: started on the host, in the
|
|
1261
|
+
* project root, the first time a run needs them, and stopped after its last.
|
|
1262
|
+
*/
|
|
1263
|
+
export declare function fixtureSet(fixtures: Readonly<Record<string, Fixture>>, options: {
|
|
1264
|
+
root: string;
|
|
1265
|
+
}): FixtureSet;
|
|
1266
|
+
//#endregion
|
|
1267
|
+
//#region ../runner/src/shell/container-shell.d.ts
|
|
1268
|
+
/** Removes a run's kept container, if there is one; true when it removed one. */
|
|
1269
|
+
export declare function removeRunContainer(runId: string, runtime?: string): Promise<boolean>;
|
|
1270
|
+
//#endregion
|
|
1028
1271
|
//#region ../runner/src/local-report-store.d.ts
|
|
1029
1272
|
/** Persists each run as a local tree rooted below `rootDirectory`. */
|
|
1030
1273
|
export declare function localReportStore(rootDirectory: string): ReportStore;
|
|
@@ -1046,7 +1289,7 @@ export declare function staticDatasetFile(dataset: Dataset, root: string, file:
|
|
|
1046
1289
|
//#endregion
|
|
1047
1290
|
//#region ../runner/src/local-report-reader.d.ts
|
|
1048
1291
|
export declare const readRunManifest: (root: string, runId: string) => Promise<{
|
|
1049
|
-
readonly schemaVersion:
|
|
1292
|
+
readonly schemaVersion: 7;
|
|
1050
1293
|
readonly runUri: string;
|
|
1051
1294
|
readonly evalId: string;
|
|
1052
1295
|
readonly suiteId?: string | undefined;
|
|
@@ -1094,10 +1337,22 @@ export declare const readRunManifest: (root: string, runId: string) => Promise<{
|
|
|
1094
1337
|
readonly source: "computed" | "static";
|
|
1095
1338
|
readonly digest: string;
|
|
1096
1339
|
}[] | undefined;
|
|
1097
|
-
readonly
|
|
1340
|
+
readonly limits?: {
|
|
1341
|
+
readonly steps?: number | undefined;
|
|
1342
|
+
readonly tokens?: number | undefined;
|
|
1343
|
+
readonly time?: number | undefined;
|
|
1344
|
+
} | undefined;
|
|
1345
|
+
readonly isolation?: {
|
|
1346
|
+
readonly kind: "container";
|
|
1347
|
+
readonly image: string;
|
|
1348
|
+
readonly network: "fixtures" | "full" | "none";
|
|
1349
|
+
} | {
|
|
1350
|
+
readonly kind: "sandbox-exec";
|
|
1351
|
+
} | undefined;
|
|
1352
|
+
readonly status?: "cancelled" | "errored" | "failed" | "limited" | "passed" | "running" | undefined;
|
|
1098
1353
|
}>;
|
|
1099
1354
|
export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
1100
|
-
readonly status: "cancelled" | "errored" | "failed" | "passed" | "running";
|
|
1355
|
+
readonly status: "cancelled" | "errored" | "failed" | "limited" | "passed" | "running";
|
|
1101
1356
|
readonly endedAt: string;
|
|
1102
1357
|
readonly durationMs?: number | undefined;
|
|
1103
1358
|
readonly scoring?: {
|
|
@@ -1132,15 +1387,25 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1132
1387
|
} | undefined;
|
|
1133
1388
|
readonly model?: string | undefined;
|
|
1134
1389
|
readonly usage?: {
|
|
1135
|
-
readonly
|
|
1136
|
-
readonly
|
|
1137
|
-
readonly
|
|
1138
|
-
readonly
|
|
1390
|
+
readonly input: number;
|
|
1391
|
+
readonly output: number;
|
|
1392
|
+
readonly cacheRead?: number | undefined;
|
|
1393
|
+
readonly cacheWrite?: number | undefined;
|
|
1394
|
+
readonly reasoning?: number | undefined;
|
|
1395
|
+
readonly total?: number | undefined;
|
|
1396
|
+
readonly cost?: {
|
|
1397
|
+
readonly currency?: string | undefined;
|
|
1398
|
+
readonly input?: number | undefined;
|
|
1399
|
+
readonly output?: number | undefined;
|
|
1400
|
+
readonly cacheRead?: number | undefined;
|
|
1401
|
+
readonly cacheWrite?: number | undefined;
|
|
1402
|
+
readonly total: number;
|
|
1403
|
+
} | undefined;
|
|
1139
1404
|
} | undefined;
|
|
1140
1405
|
readonly prompt?: string | undefined;
|
|
1141
1406
|
readonly reply?: JsonValue | undefined;
|
|
1142
1407
|
readonly attempts?: number | undefined;
|
|
1143
|
-
readonly
|
|
1408
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1144
1409
|
} | undefined;
|
|
1145
1410
|
readonly durationMs: number;
|
|
1146
1411
|
readonly error?: {
|
|
@@ -1195,15 +1460,25 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1195
1460
|
} | undefined;
|
|
1196
1461
|
readonly model?: string | undefined;
|
|
1197
1462
|
readonly usage?: {
|
|
1198
|
-
readonly
|
|
1199
|
-
readonly
|
|
1200
|
-
readonly
|
|
1201
|
-
readonly
|
|
1463
|
+
readonly input: number;
|
|
1464
|
+
readonly output: number;
|
|
1465
|
+
readonly cacheRead?: number | undefined;
|
|
1466
|
+
readonly cacheWrite?: number | undefined;
|
|
1467
|
+
readonly reasoning?: number | undefined;
|
|
1468
|
+
readonly total?: number | undefined;
|
|
1469
|
+
readonly cost?: {
|
|
1470
|
+
readonly currency?: string | undefined;
|
|
1471
|
+
readonly input?: number | undefined;
|
|
1472
|
+
readonly output?: number | undefined;
|
|
1473
|
+
readonly cacheRead?: number | undefined;
|
|
1474
|
+
readonly cacheWrite?: number | undefined;
|
|
1475
|
+
readonly total: number;
|
|
1476
|
+
} | undefined;
|
|
1202
1477
|
} | undefined;
|
|
1203
1478
|
readonly prompt?: string | undefined;
|
|
1204
1479
|
readonly reply?: JsonValue | undefined;
|
|
1205
1480
|
readonly attempts?: number | undefined;
|
|
1206
|
-
readonly
|
|
1481
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1207
1482
|
} | undefined;
|
|
1208
1483
|
readonly durationMs?: number | undefined;
|
|
1209
1484
|
readonly error?: {
|
|
@@ -1212,7 +1487,7 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1212
1487
|
readonly stack?: string | undefined;
|
|
1213
1488
|
} | undefined;
|
|
1214
1489
|
readonly matchedToolCall?: {
|
|
1215
|
-
readonly
|
|
1490
|
+
readonly messageId: string;
|
|
1216
1491
|
readonly id: string;
|
|
1217
1492
|
} | undefined;
|
|
1218
1493
|
}[] | undefined;
|
|
@@ -1235,6 +1510,11 @@ export declare const readRunSummary: (root: string, runId: string) => Promise<{
|
|
|
1235
1510
|
readonly message: string;
|
|
1236
1511
|
readonly stack?: string | undefined;
|
|
1237
1512
|
} | undefined;
|
|
1513
|
+
readonly limit?: {
|
|
1514
|
+
readonly limit: "steps" | "time" | "tokens";
|
|
1515
|
+
readonly value: number;
|
|
1516
|
+
readonly used: number;
|
|
1517
|
+
} | undefined;
|
|
1238
1518
|
}>;
|
|
1239
1519
|
export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
1240
1520
|
readonly results: {
|
|
@@ -1268,15 +1548,25 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1268
1548
|
} | undefined;
|
|
1269
1549
|
readonly model?: string | undefined;
|
|
1270
1550
|
readonly usage?: {
|
|
1271
|
-
readonly
|
|
1272
|
-
readonly
|
|
1273
|
-
readonly
|
|
1274
|
-
readonly
|
|
1551
|
+
readonly input: number;
|
|
1552
|
+
readonly output: number;
|
|
1553
|
+
readonly cacheRead?: number | undefined;
|
|
1554
|
+
readonly cacheWrite?: number | undefined;
|
|
1555
|
+
readonly reasoning?: number | undefined;
|
|
1556
|
+
readonly total?: number | undefined;
|
|
1557
|
+
readonly cost?: {
|
|
1558
|
+
readonly currency?: string | undefined;
|
|
1559
|
+
readonly input?: number | undefined;
|
|
1560
|
+
readonly output?: number | undefined;
|
|
1561
|
+
readonly cacheRead?: number | undefined;
|
|
1562
|
+
readonly cacheWrite?: number | undefined;
|
|
1563
|
+
readonly total: number;
|
|
1564
|
+
} | undefined;
|
|
1275
1565
|
} | undefined;
|
|
1276
1566
|
readonly prompt?: string | undefined;
|
|
1277
1567
|
readonly reply?: JsonValue | undefined;
|
|
1278
1568
|
readonly attempts?: number | undefined;
|
|
1279
|
-
readonly
|
|
1569
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1280
1570
|
} | undefined;
|
|
1281
1571
|
readonly durationMs: number;
|
|
1282
1572
|
readonly error?: {
|
|
@@ -1331,15 +1621,25 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1331
1621
|
} | undefined;
|
|
1332
1622
|
readonly model?: string | undefined;
|
|
1333
1623
|
readonly usage?: {
|
|
1334
|
-
readonly
|
|
1335
|
-
readonly
|
|
1336
|
-
readonly
|
|
1337
|
-
readonly
|
|
1624
|
+
readonly input: number;
|
|
1625
|
+
readonly output: number;
|
|
1626
|
+
readonly cacheRead?: number | undefined;
|
|
1627
|
+
readonly cacheWrite?: number | undefined;
|
|
1628
|
+
readonly reasoning?: number | undefined;
|
|
1629
|
+
readonly total?: number | undefined;
|
|
1630
|
+
readonly cost?: {
|
|
1631
|
+
readonly currency?: string | undefined;
|
|
1632
|
+
readonly input?: number | undefined;
|
|
1633
|
+
readonly output?: number | undefined;
|
|
1634
|
+
readonly cacheRead?: number | undefined;
|
|
1635
|
+
readonly cacheWrite?: number | undefined;
|
|
1636
|
+
readonly total: number;
|
|
1637
|
+
} | undefined;
|
|
1338
1638
|
} | undefined;
|
|
1339
1639
|
readonly prompt?: string | undefined;
|
|
1340
1640
|
readonly reply?: JsonValue | undefined;
|
|
1341
1641
|
readonly attempts?: number | undefined;
|
|
1342
|
-
readonly
|
|
1642
|
+
readonly transcript?: Transcript$1 | undefined;
|
|
1343
1643
|
} | undefined;
|
|
1344
1644
|
readonly durationMs?: number | undefined;
|
|
1345
1645
|
readonly error?: {
|
|
@@ -1348,7 +1648,7 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1348
1648
|
readonly stack?: string | undefined;
|
|
1349
1649
|
} | undefined;
|
|
1350
1650
|
readonly matchedToolCall?: {
|
|
1351
|
-
readonly
|
|
1651
|
+
readonly messageId: string;
|
|
1352
1652
|
readonly id: string;
|
|
1353
1653
|
} | undefined;
|
|
1354
1654
|
}[] | undefined;
|
|
@@ -1356,7 +1656,15 @@ export declare const readRunScoring: (root: string, runId: string) => Promise<{
|
|
|
1356
1656
|
readonly overall?: number | undefined;
|
|
1357
1657
|
readonly passed: boolean;
|
|
1358
1658
|
}>;
|
|
1359
|
-
|
|
1659
|
+
/** EvalKit's events for a run, in order. */
|
|
1660
|
+
export declare function readRunEvents(root: string, runId: string): Promise<RunEvent[]>;
|
|
1661
|
+
/** A run's sub-agent transcripts, by transcript ID; none when it kept none. */
|
|
1662
|
+
export declare function readRunSubagents(root: string, runId: string): Promise<Record<string, Transcript$1>>;
|
|
1663
|
+
/**
|
|
1664
|
+
* The agent's ATXF transcript for a run. A running run's last line may be
|
|
1665
|
+
* half written; it is left out until it is complete.
|
|
1666
|
+
*/
|
|
1667
|
+
export declare function readRunTranscript(root: string, runId: string): Promise<Transcript$1>;
|
|
1360
1668
|
/**
|
|
1361
1669
|
* True when a run's owning process is known to be gone: it ran on this host
|
|
1362
1670
|
* and its PID no longer exists. Runs from other hosts are never judged.
|
|
@@ -1364,12 +1672,16 @@ export declare function readRunEvents(root: string, runId: string): Promise<Traj
|
|
|
1364
1672
|
export declare function ownerIsGone(owner: RunProcess | undefined): boolean;
|
|
1365
1673
|
//#endregion
|
|
1366
1674
|
//#region ../runner/src/matrix.d.ts
|
|
1367
|
-
/**
|
|
1675
|
+
/**
|
|
1676
|
+
* Cells and runs; a run that errored counts as failed, one stopped at a
|
|
1677
|
+
* limit as limited, a cancelled one as none of them.
|
|
1678
|
+
*/
|
|
1368
1679
|
type MatrixSummary = {
|
|
1369
1680
|
cells: number;
|
|
1370
1681
|
runs: number;
|
|
1371
1682
|
passed: number;
|
|
1372
1683
|
failed: number;
|
|
1684
|
+
limited: number;
|
|
1373
1685
|
cancelled: number;
|
|
1374
1686
|
};
|
|
1375
1687
|
/** Bounded workers pull cells from the iterator; no Cartesian job array is allocated. */
|
|
@@ -1391,6 +1703,13 @@ type UpgradeReport = {
|
|
|
1391
1703
|
batches: number;
|
|
1392
1704
|
/** Old runs left alone because they are still running. */
|
|
1393
1705
|
running: string[];
|
|
1706
|
+
/** Version 6 runs whose trajectory became an ATXF transcript (or would). */
|
|
1707
|
+
transcripts: number;
|
|
1708
|
+
/** Runs that could not be converted, left as they were, with why. */
|
|
1709
|
+
failed: Array<{
|
|
1710
|
+
runId: string;
|
|
1711
|
+
reason: string;
|
|
1712
|
+
}>;
|
|
1394
1713
|
};
|
|
1395
1714
|
/**
|
|
1396
1715
|
* Rewrites results from report schema versions 2 to 5 into version 6, in
|
|
@@ -1403,7 +1722,8 @@ type UpgradeReport = {
|
|
|
1403
1722
|
* old run is removed only after its new runs exist, and one replaced under
|
|
1404
1723
|
* the same ID is set aside first, so a crash at any point leaves the old run
|
|
1405
1724
|
* or complete new ones, and re-running finishes the job. Version 6 runs are
|
|
1406
|
-
* left alone.
|
|
1725
|
+
* left alone. Then every version 6 run is converted to version 7, its
|
|
1726
|
+
* trajectory into an ATXF transcript (RFD0009).
|
|
1407
1727
|
*/
|
|
1408
1728
|
export declare function upgradeReports(root: string, options?: {
|
|
1409
1729
|
dryRun?: boolean;
|
|
@@ -1423,6 +1743,10 @@ export type RunEvalOptions = {
|
|
|
1423
1743
|
repeat?: number;
|
|
1424
1744
|
/** Parameters made available to the AUT, and to judges, for this invocation. */
|
|
1425
1745
|
parameters?: JsonObject;
|
|
1746
|
+
/** Where each run's processes run, through `context.shell`. Default `none()`: on the host. */
|
|
1747
|
+
isolation?: Isolation;
|
|
1748
|
+
/** The project's fixtures, shared by an invocation's runs; started by the first run. */
|
|
1749
|
+
fixtures?: FixtureSet;
|
|
1426
1750
|
/** The agent for judges that name none (`judge` in evalkit.config.ts). */
|
|
1427
1751
|
judge?: AutAdapter;
|
|
1428
1752
|
/** Matrix provenance recorded in every run's manifest. */
|
|
@@ -1456,12 +1780,29 @@ export type RunEvalOptions = {
|
|
|
1456
1780
|
*/
|
|
1457
1781
|
signal?: AbortSignal;
|
|
1458
1782
|
/**
|
|
1459
|
-
*
|
|
1460
|
-
*
|
|
1783
|
+
* What each run may use before EvalKit stops it. `base` is the project's
|
|
1784
|
+
* limits; the scenario's own come after it, then a matrix cell's
|
|
1785
|
+
* `limits.<kind>` parameters, then `override` (`--limit`), kind by kind.
|
|
1461
1786
|
*/
|
|
1462
|
-
|
|
1787
|
+
limits?: {
|
|
1788
|
+
base?: Limits;
|
|
1789
|
+
override?: Limits;
|
|
1790
|
+
};
|
|
1791
|
+
/**
|
|
1792
|
+
* Observes every transcript record and run event once recorded, for live
|
|
1793
|
+
* progress. It must not throw; an error it throws is ignored.
|
|
1794
|
+
*/
|
|
1795
|
+
onUpdate?: (run: RunRef, update: RunUpdate) => void;
|
|
1463
1796
|
now?: () => Date;
|
|
1464
1797
|
};
|
|
1798
|
+
/** A record appended to a run's transcript, or one of EvalKit's events. */
|
|
1799
|
+
export type RunUpdate = {
|
|
1800
|
+
kind: 'record';
|
|
1801
|
+
record: EntryRecord;
|
|
1802
|
+
} | {
|
|
1803
|
+
kind: 'event';
|
|
1804
|
+
event: RunEvent;
|
|
1805
|
+
};
|
|
1465
1806
|
/** Identifies the run an observed event belongs to. */
|
|
1466
1807
|
export type RunRef = {
|
|
1467
1808
|
runId: string;
|
|
@@ -1477,5 +1818,5 @@ export type RunRef = {
|
|
|
1477
1818
|
*/
|
|
1478
1819
|
export declare function runEval(definition: EvalDefinition, options: RunEvalOptions): Effect.Effect<RunResult[], unknown>;
|
|
1479
1820
|
//#endregion
|
|
1480
|
-
export type { DatasetFileEntry, MatrixSummary, UpgradeReport };
|
|
1821
|
+
export type { DatasetFileEntry, FixtureSet, MatrixSummary, UpgradeReport };
|
|
1481
1822
|
//# sourceMappingURL=runner.d.mts.map
|