anpord 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +56 -78
  2. package/dist/bin.cjs +211 -204
  3. package/dist/bin.mjs +211 -204
  4. package/dist/cli-runtime.cjs +2 -2
  5. package/dist/cli-runtime.d.cts +1 -1
  6. package/dist/cli-runtime.d.mts +1 -1
  7. package/dist/cli-runtime.mjs +2 -2
  8. package/dist/client-BfdjFtlV.mjs +305 -0
  9. package/dist/{client-C9m0uLCz.d.cts → client-BgRs8JvW.d.mts} +2150 -174
  10. package/dist/{client-TFCLuMv8.d.mts → client-BirFO3jz.d.cts} +2150 -174
  11. package/dist/client-C-P2I00z.cjs +346 -0
  12. package/dist/{compiler-DXlpU_In.mjs → compiler-D96wI7UP.mjs} +108 -75
  13. package/dist/{compiler-Ap8DM-JU.cjs → compiler-uwb1pkdK.cjs} +116 -83
  14. package/dist/config.cjs +1 -1
  15. package/dist/config.d.cts +1 -1
  16. package/dist/config.d.mts +1 -1
  17. package/dist/config.mjs +1 -1
  18. package/dist/{errors-C9bQUcA3.mjs → errors-B0YknR5V.mjs} +3 -19
  19. package/dist/{errors-Boum34f5.cjs → errors-BX1wry8K.cjs} +3 -19
  20. package/dist/{errors-BK3f7Rdr.d.cts → errors-aGrd21jy.d.cts} +0 -3
  21. package/dist/{errors-BK3f7Rdr.d.mts → errors-aGrd21jy.d.mts} +0 -3
  22. package/dist/eval-judges-BkmiVLLq.cjs +59 -0
  23. package/dist/eval-judges-CwTvTq7N.mjs +42 -0
  24. package/dist/eval-judges-DPPUftbh.d.cts +48 -0
  25. package/dist/eval-judges-DPPUftbh.d.mts +48 -0
  26. package/dist/eval-validations-BRdoZrTQ.mjs +113 -0
  27. package/dist/eval-validations-_MlnQ_uv.cjs +148 -0
  28. package/dist/eval.cjs +1 -1
  29. package/dist/eval.d.cts +60 -6
  30. package/dist/eval.d.mts +60 -6
  31. package/dist/eval.mjs +1 -1
  32. package/dist/evals-B6aT3xgH.d.cts +1364 -0
  33. package/dist/evals-B6aT3xgH.d.mts +1364 -0
  34. package/dist/evals-Dcc_x6jW.mjs +582 -0
  35. package/dist/evals-DouMsrsM.cjs +737 -0
  36. package/dist/index.cjs +23 -99
  37. package/dist/index.d.cts +138 -34
  38. package/dist/index.d.mts +138 -34
  39. package/dist/index.mjs +23 -99
  40. package/dist/source.d.cts +1 -1
  41. package/dist/source.d.mts +1 -1
  42. package/dist/{types-oaMF6-E1.d.mts → types-Codjaq-o.d.mts} +146 -45
  43. package/dist/{types-H9L450Iu.d.cts → types-ISsteq95.d.cts} +146 -45
  44. package/dist/validator-runtime.cjs +238 -0
  45. package/dist/validator-runtime.d.cts +9 -0
  46. package/dist/validator-runtime.d.mts +9 -0
  47. package/dist/validator-runtime.mjs +237 -0
  48. package/dist/validators.cjs +10 -0
  49. package/dist/validators.d.cts +8 -0
  50. package/dist/validators.d.mts +8 -0
  51. package/dist/validators.mjs +9 -0
  52. package/package.json +11 -1
  53. package/dist/client-5K3dMI5Q.mjs +0 -849
  54. package/dist/client-Ci0woWLW.cjs +0 -890
  55. package/dist/evals-BEgEmfiO.d.cts +0 -603
  56. package/dist/evals-BEgEmfiO.d.mts +0 -603
  57. package/dist/harness-profile-BMjsN460.mjs +0 -43
  58. package/dist/harness-profile-CDQpPLPd.cjs +0 -78
@@ -1,5 +1,6 @@
1
- import "./errors-BK3f7Rdr.mjs";
2
- import { f as EvalSource, o as EvalHarness } from "./evals-BEgEmfiO.mjs";
1
+ import "./errors-aGrd21jy.mjs";
2
+ import { t as EvalJudge } from "./eval-judges-DPPUftbh.mjs";
3
+ import { f as EvalSource, o as EvalHarness } from "./evals-B6aT3xgH.mjs";
3
4
  import { t as McpCall } from "./calls-DYqBi5FA.mjs";
4
5
  import { n as McpServerDefinition } from "./define-HK0eeSNn.mjs";
5
6
  import { t as CliCall } from "./calls-Drj_dZpu.mjs";
@@ -8,31 +9,89 @@ import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSecurity } fro
8
9
  import { Context, Schema } from "effect";
9
10
  //#region ../schema/src/public/evals-api.d.ts
10
11
  declare const PublicStartEvalRequest: Schema.Struct<{
12
+ trigger: Schema.optional<Schema.Struct<{
13
+ source: Schema.Literal<["dashboard", "api", "cli", "ci", "mcp"]>;
14
+ url: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
15
+ }>>;
11
16
  cases: Schema.filter<Schema.filter<Schema.Array$<Schema.refine<{
12
- readonly cache?: {
13
- readonly key: string;
14
- readonly path: string;
15
- } | undefined;
16
- readonly name: string;
17
- readonly prepare?: {
18
- readonly name: string;
19
- readonly source: string;
20
- } | null | undefined;
21
17
  readonly source?: {
22
18
  readonly kind: "empty";
23
19
  } | {
20
+ readonly url: string;
24
21
  readonly kind: "repo";
25
22
  readonly ref: string | null;
26
- readonly url: string;
27
23
  } | {
28
24
  readonly kind: "files";
29
25
  readonly files: {
30
26
  readonly [x: string]: string;
31
27
  };
32
28
  } | undefined;
33
- readonly validator?: {
29
+ readonly cache?: {
30
+ readonly key: string;
31
+ readonly path: string;
32
+ } | undefined;
33
+ readonly name: string;
34
+ readonly prepare?: {
35
+ readonly source: string;
34
36
  readonly name: string;
37
+ } | null | undefined;
38
+ readonly validator?: ({
35
39
  readonly source: string;
40
+ readonly name: string;
41
+ readonly capture?: boolean | undefined;
42
+ readonly manifest?: readonly {
43
+ readonly name: string;
44
+ readonly index: number;
45
+ }[] | undefined;
46
+ } & {
47
+ readonly sourceFiles?: readonly {
48
+ readonly path: string;
49
+ readonly content: string;
50
+ }[] | undefined;
51
+ }) | {
52
+ readonly name: string;
53
+ readonly kind: "judged";
54
+ readonly capture?: boolean | undefined;
55
+ readonly sourceFiles?: readonly {
56
+ readonly path: string;
57
+ readonly content: string;
58
+ }[] | undefined;
59
+ readonly checks: readonly {
60
+ readonly source: string;
61
+ readonly name: string;
62
+ readonly capture?: boolean | undefined;
63
+ readonly manifest?: readonly {
64
+ readonly name: string;
65
+ readonly index: number;
66
+ }[] | undefined;
67
+ }[];
68
+ readonly judges: readonly ({
69
+ readonly harness?: undefined;
70
+ readonly name: string;
71
+ readonly kind: "judge";
72
+ readonly provider: "openai";
73
+ readonly model: string;
74
+ readonly rubric: string;
75
+ readonly expected?: string | undefined;
76
+ readonly choices: {
77
+ readonly [x: string]: number;
78
+ };
79
+ readonly threshold: number;
80
+ readonly timeoutMs: number;
81
+ } | {
82
+ readonly harness: "codex" | "opencode" | "pi" | "fx" | "claude" | "gemini" | "qwen" | "cursor";
83
+ readonly name: string;
84
+ readonly kind: "judge";
85
+ readonly provider?: undefined;
86
+ readonly model: string;
87
+ readonly rubric: string;
88
+ readonly expected?: string | undefined;
89
+ readonly choices: {
90
+ readonly [x: string]: number;
91
+ };
92
+ readonly threshold: number;
93
+ readonly timeoutMs: number;
94
+ })[];
36
95
  } | null | undefined;
37
96
  readonly variables?: {
38
97
  readonly [x: string]: string;
@@ -58,10 +117,68 @@ declare const PublicStartEvalRequest: Schema.Struct<{
58
117
  files: Schema.Record$<typeof Schema.String, typeof Schema.String>;
59
118
  kind: Schema.Literal<["files"]>;
60
119
  }>]>>;
61
- validator: Schema.optional<Schema.NullOr<Schema.Struct<{
120
+ validator: Schema.optional<Schema.NullOr<Schema.Union<[Schema.extend<Schema.Struct<{
121
+ capture: Schema.optional<typeof Schema.Boolean>;
122
+ manifest: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
123
+ index: Schema.refine<number, typeof Schema.NonNegative>;
124
+ name: Schema.filter<typeof Schema.String>;
125
+ }>>>>>>;
62
126
  name: Schema.filter<Schema.filter<typeof Schema.String>>;
63
127
  source: Schema.filter<Schema.filter<typeof Schema.String>>;
64
- }>>>;
128
+ }>, Schema.Struct<{
129
+ sourceFiles: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
130
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
131
+ content: Schema.filter<typeof Schema.String>;
132
+ }>>>>>>;
133
+ }>>, Schema.filter<Schema.Struct<{
134
+ kind: Schema.Literal<["judged"]>;
135
+ capture: Schema.optional<typeof Schema.Boolean>;
136
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
137
+ checks: Schema.filter<Schema.Array$<Schema.Struct<{
138
+ capture: Schema.optional<typeof Schema.Boolean>;
139
+ manifest: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
140
+ index: Schema.refine<number, typeof Schema.NonNegative>;
141
+ name: Schema.filter<typeof Schema.String>;
142
+ }>>>>>>;
143
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
144
+ source: Schema.filter<Schema.filter<typeof Schema.String>>;
145
+ }>>>;
146
+ judges: Schema.filter<Schema.filter<Schema.Array$<Schema.Union<[Schema.Struct<{
147
+ provider: Schema.Literal<["openai"]>;
148
+ harness: Schema.optional<typeof Schema.Never>;
149
+ kind: Schema.Literal<["judge"]>;
150
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
151
+ model: Schema.filter<Schema.filter<typeof Schema.String>>;
152
+ rubric: Schema.filter<Schema.filter<typeof Schema.String>>;
153
+ expected: Schema.optional<Schema.filter<typeof Schema.String>>;
154
+ choices: Schema.filter<Schema.Record$<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.Number>>>;
155
+ threshold: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
156
+ default: () => number;
157
+ }>;
158
+ timeoutMs: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
159
+ default: () => number;
160
+ }>;
161
+ }>, Schema.Struct<{
162
+ provider: Schema.optional<typeof Schema.Never>;
163
+ harness: Schema.SchemaClass<"codex" | "opencode" | "pi" | "fx" | "claude" | "gemini" | "qwen" | "cursor", "codex" | "opencode" | "pi" | "fx" | "claude" | "gemini" | "qwen" | "cursor", never>;
164
+ kind: Schema.Literal<["judge"]>;
165
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
166
+ model: Schema.filter<Schema.filter<typeof Schema.String>>;
167
+ rubric: Schema.filter<Schema.filter<typeof Schema.String>>;
168
+ expected: Schema.optional<Schema.filter<typeof Schema.String>>;
169
+ choices: Schema.filter<Schema.Record$<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.Number>>>;
170
+ threshold: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
171
+ default: () => number;
172
+ }>;
173
+ timeoutMs: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
174
+ default: () => number;
175
+ }>;
176
+ }>]>>>>;
177
+ sourceFiles: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
178
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
179
+ content: Schema.filter<typeof Schema.String>;
180
+ }>>>>>>;
181
+ }>>]>>>;
65
182
  variables: Schema.optional<Schema.Record$<typeof Schema.String, Schema.refine<string, typeof Schema.String>>>;
66
183
  verify: Schema.NullOr<Schema.refine<string, typeof Schema.String>>;
67
184
  }>>>>>;
@@ -82,7 +199,7 @@ declare const PublicStartEvalRequest: Schema.Struct<{
82
199
  readonly run?: string | undefined;
83
200
  readonly systemPrompt?: string | undefined;
84
201
  } | undefined;
85
- readonly provider: "daytona" | "e2b" | "upstash" | "modal" | "cloudflare" | "vercel";
202
+ readonly sandbox?: "daytona" | "e2b" | "upstash" | "modal" | "cloudflare" | "vercel" | undefined;
86
203
  }, Schema.Struct<{
87
204
  harness: Schema.Literal<["codex", "opencode", "pi", "fx", "claude", "gemini", "qwen", "cursor", "command"]>;
88
205
  model: Schema.filter<typeof Schema.String>;
@@ -94,7 +211,7 @@ declare const PublicStartEvalRequest: Schema.Struct<{
94
211
  run: Schema.optional<typeof Schema.String>;
95
212
  systemPrompt: Schema.optional<typeof Schema.String>;
96
213
  }>>;
97
- provider: Schema.Literal<["daytona", "e2b", "upstash", "modal", "cloudflare", "vercel"]>;
214
+ sandbox: Schema.optional<Schema.Literal<["daytona", "e2b", "upstash", "modal", "cloudflare", "vercel"]>>;
98
215
  }>>>>>;
99
216
  trials: Schema.filter<typeof Schema.Int>;
100
217
  }>;
@@ -102,13 +219,7 @@ type PublicStartEvalRequest = typeof PublicStartEvalRequest.Type;
102
219
  //#endregion
103
220
  //#region src/evals/types.d.ts
104
221
  type EvalTaskRequest = PublicStartEvalRequest["tasks"][number];
105
- /**
106
- * A profile directory beside the eval file.
107
- *
108
- * `dir` resolves against the eval file. Files under `home/` and `workspace/`
109
- * are shipped into the sandbox; an optional `profile.json` names a system
110
- * prompt, env, and for the command harness the install and run steps.
111
- */
222
+ /** A profile directory beside the eval file; `dir` resolves against it. */
112
223
  interface ProfileRef {
113
224
  readonly dir: string;
114
225
  readonly name: string;
@@ -120,7 +231,7 @@ type HarnessRef = EvalHarness | {
120
231
  interface EvalTaskDefinition {
121
232
  readonly harness: HarnessRef;
122
233
  readonly model: EvalTaskRequest["model"];
123
- readonly provider: EvalTaskRequest["provider"];
234
+ readonly sandbox?: EvalTaskRequest["sandbox"];
124
235
  }
125
236
  interface CommandResult {
126
237
  readonly exitCode: number;
@@ -132,27 +243,16 @@ interface ExecOptions {
132
243
  readonly env?: Readonly<Record<string, string>>;
133
244
  readonly timeoutMs?: number;
134
245
  }
135
- /**
136
- * A directory worth keeping between runs of the same case.
137
- *
138
- * Declared on the case rather than returned by the prepare, because a restore
139
- * has to happen before the prepare runs: something that only exists once it has
140
- * finished cannot say where to look. This is the shape CI caches use for the
141
- * same reason -- actions/cache names its path and key before the step, not
142
- * after.
143
- *
144
- * The key should name everything the contents depend on, a lockfile hash above
145
- * all, because entries are write-once: a key that already holds an entry keeps
146
- * it, which is what makes two runs preparing at once safe.
147
- */
246
+ /** Entries are write-once, so the key must name everything the contents
247
+ * depend on -- a lockfile hash above all. */
148
248
  interface CaseCache {
149
249
  readonly key: string;
150
250
  /** Relative to the workspace. */
151
251
  readonly path: string;
152
252
  }
153
253
  interface PrepareContext {
154
- /** True when the runner restored a cached directory before this ran, so a
155
- * prepare can skip the work that produced it. */
254
+ /** True when the runner restored a cached directory, so a prepare can skip
255
+ * the work that produced it. */
156
256
  readonly cached: boolean;
157
257
  readonly exec: (file: string, args?: readonly string[], options?: ExecOptions) => Promise<CommandResult>;
158
258
  readonly exists: (path: string) => Promise<boolean>;
@@ -162,7 +262,7 @@ interface PrepareContext {
162
262
  type PrepareValue = Readonly<Record<string, unknown>>;
163
263
  type Prepare = (context: PrepareContext) => Promise<PrepareValue | undefined> | PrepareValue | undefined;
164
264
  interface ValidatorContext {
165
- /** The agent's final reply, empty when it said nothing. */
265
+ /** Empty when the agent said nothing. */
166
266
  readonly answer: () => Promise<string>;
167
267
  readonly cli: {
168
268
  readonly calls: (cli?: string) => Promise<readonly CliCall[]>;
@@ -174,7 +274,7 @@ interface ValidatorContext {
174
274
  };
175
275
  readonly prepared: Readonly<Record<string, unknown>>;
176
276
  readonly readText: (path: string) => Promise<string>;
177
- /** Every reply the agent made, oldest first, separated by a blank line. */
277
+ /** Every reply, oldest first, separated by a blank line. */
178
278
  readonly transcript: () => Promise<string>;
179
279
  }
180
280
  interface ValidatorResult {
@@ -184,8 +284,7 @@ interface ValidatorResult {
184
284
  type Validator = (context: ValidatorContext) => boolean | ValidatorResult | Promise<boolean | ValidatorResult>;
185
285
  type DeclaredSource = EvalSource | string;
186
286
  interface EvalCaseBase {
187
- /** What a prepare builds that is worth keeping for the next run of this
188
- * case. Restored before it runs, and saved after it succeeds. */
287
+ /** Restored before the prepare runs, saved after it succeeds. */
189
288
  readonly cache?: CaseCache;
190
289
  readonly name: string;
191
290
  readonly prepare?: Prepare | null;
@@ -193,13 +292,15 @@ interface EvalCaseBase {
193
292
  readonly variables?: Readonly<Record<string, string>>;
194
293
  }
195
294
  type EvalCaseDefinition = EvalCaseBase & ({
196
- readonly validate: Validator;
295
+ readonly validate: Validator | EvalJudge | readonly (Validator | EvalJudge)[];
197
296
  readonly verify?: never;
198
297
  } | {
199
298
  readonly validate?: never;
200
299
  readonly verify: string;
201
300
  });
202
301
  interface EvalDefinition {
302
+ readonly captureSource?: boolean;
303
+ readonly captureValidation?: boolean;
203
304
  readonly cases: readonly EvalCaseDefinition[];
204
305
  readonly cli?: readonly CliDefinition[];
205
306
  readonly mcp?: readonly McpServerDefinition[];
@@ -1,5 +1,6 @@
1
- import "./errors-BK3f7Rdr.cjs";
2
- import { f as EvalSource, o as EvalHarness } from "./evals-BEgEmfiO.cjs";
1
+ import "./errors-aGrd21jy.cjs";
2
+ import { t as EvalJudge } from "./eval-judges-DPPUftbh.cjs";
3
+ import { f as EvalSource, o as EvalHarness } from "./evals-B6aT3xgH.cjs";
3
4
  import { t as McpCall } from "./calls-DYqBi5FA.cjs";
4
5
  import { n as McpServerDefinition } from "./define-HK0eeSNn.cjs";
5
6
  import { t as CliCall } from "./calls-Drj_dZpu.cjs";
@@ -8,31 +9,89 @@ import { Schema } from "effect";
8
9
  import "@effect/platform";
9
10
  //#region ../schema/src/public/evals-api.d.ts
10
11
  declare const PublicStartEvalRequest: Schema.Struct<{
12
+ trigger: Schema.optional<Schema.Struct<{
13
+ source: Schema.Literal<["dashboard", "api", "cli", "ci", "mcp"]>;
14
+ url: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
15
+ }>>;
11
16
  cases: Schema.filter<Schema.filter<Schema.Array$<Schema.refine<{
12
- readonly cache?: {
13
- readonly key: string;
14
- readonly path: string;
15
- } | undefined;
16
- readonly name: string;
17
- readonly prepare?: {
18
- readonly name: string;
19
- readonly source: string;
20
- } | null | undefined;
21
17
  readonly source?: {
22
18
  readonly kind: "empty";
23
19
  } | {
20
+ readonly url: string;
24
21
  readonly kind: "repo";
25
22
  readonly ref: string | null;
26
- readonly url: string;
27
23
  } | {
28
24
  readonly kind: "files";
29
25
  readonly files: {
30
26
  readonly [x: string]: string;
31
27
  };
32
28
  } | undefined;
33
- readonly validator?: {
29
+ readonly cache?: {
30
+ readonly key: string;
31
+ readonly path: string;
32
+ } | undefined;
33
+ readonly name: string;
34
+ readonly prepare?: {
35
+ readonly source: string;
34
36
  readonly name: string;
37
+ } | null | undefined;
38
+ readonly validator?: ({
35
39
  readonly source: string;
40
+ readonly name: string;
41
+ readonly capture?: boolean | undefined;
42
+ readonly manifest?: readonly {
43
+ readonly name: string;
44
+ readonly index: number;
45
+ }[] | undefined;
46
+ } & {
47
+ readonly sourceFiles?: readonly {
48
+ readonly path: string;
49
+ readonly content: string;
50
+ }[] | undefined;
51
+ }) | {
52
+ readonly name: string;
53
+ readonly kind: "judged";
54
+ readonly capture?: boolean | undefined;
55
+ readonly sourceFiles?: readonly {
56
+ readonly path: string;
57
+ readonly content: string;
58
+ }[] | undefined;
59
+ readonly checks: readonly {
60
+ readonly source: string;
61
+ readonly name: string;
62
+ readonly capture?: boolean | undefined;
63
+ readonly manifest?: readonly {
64
+ readonly name: string;
65
+ readonly index: number;
66
+ }[] | undefined;
67
+ }[];
68
+ readonly judges: readonly ({
69
+ readonly harness?: undefined;
70
+ readonly name: string;
71
+ readonly kind: "judge";
72
+ readonly provider: "openai";
73
+ readonly model: string;
74
+ readonly rubric: string;
75
+ readonly expected?: string | undefined;
76
+ readonly choices: {
77
+ readonly [x: string]: number;
78
+ };
79
+ readonly threshold: number;
80
+ readonly timeoutMs: number;
81
+ } | {
82
+ readonly harness: "codex" | "opencode" | "pi" | "fx" | "claude" | "gemini" | "qwen" | "cursor";
83
+ readonly name: string;
84
+ readonly kind: "judge";
85
+ readonly provider?: undefined;
86
+ readonly model: string;
87
+ readonly rubric: string;
88
+ readonly expected?: string | undefined;
89
+ readonly choices: {
90
+ readonly [x: string]: number;
91
+ };
92
+ readonly threshold: number;
93
+ readonly timeoutMs: number;
94
+ })[];
36
95
  } | null | undefined;
37
96
  readonly variables?: {
38
97
  readonly [x: string]: string;
@@ -58,10 +117,68 @@ declare const PublicStartEvalRequest: Schema.Struct<{
58
117
  files: Schema.Record$<typeof Schema.String, typeof Schema.String>;
59
118
  kind: Schema.Literal<["files"]>;
60
119
  }>]>>;
61
- validator: Schema.optional<Schema.NullOr<Schema.Struct<{
120
+ validator: Schema.optional<Schema.NullOr<Schema.Union<[Schema.extend<Schema.Struct<{
121
+ capture: Schema.optional<typeof Schema.Boolean>;
122
+ manifest: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
123
+ index: Schema.refine<number, typeof Schema.NonNegative>;
124
+ name: Schema.filter<typeof Schema.String>;
125
+ }>>>>>>;
62
126
  name: Schema.filter<Schema.filter<typeof Schema.String>>;
63
127
  source: Schema.filter<Schema.filter<typeof Schema.String>>;
64
- }>>>;
128
+ }>, Schema.Struct<{
129
+ sourceFiles: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
130
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
131
+ content: Schema.filter<typeof Schema.String>;
132
+ }>>>>>>;
133
+ }>>, Schema.filter<Schema.Struct<{
134
+ kind: Schema.Literal<["judged"]>;
135
+ capture: Schema.optional<typeof Schema.Boolean>;
136
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
137
+ checks: Schema.filter<Schema.Array$<Schema.Struct<{
138
+ capture: Schema.optional<typeof Schema.Boolean>;
139
+ manifest: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
140
+ index: Schema.refine<number, typeof Schema.NonNegative>;
141
+ name: Schema.filter<typeof Schema.String>;
142
+ }>>>>>>;
143
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
144
+ source: Schema.filter<Schema.filter<typeof Schema.String>>;
145
+ }>>>;
146
+ judges: Schema.filter<Schema.filter<Schema.Array$<Schema.Union<[Schema.Struct<{
147
+ provider: Schema.Literal<["openai"]>;
148
+ harness: Schema.optional<typeof Schema.Never>;
149
+ kind: Schema.Literal<["judge"]>;
150
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
151
+ model: Schema.filter<Schema.filter<typeof Schema.String>>;
152
+ rubric: Schema.filter<Schema.filter<typeof Schema.String>>;
153
+ expected: Schema.optional<Schema.filter<typeof Schema.String>>;
154
+ choices: Schema.filter<Schema.Record$<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.Number>>>;
155
+ threshold: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
156
+ default: () => number;
157
+ }>;
158
+ timeoutMs: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
159
+ default: () => number;
160
+ }>;
161
+ }>, Schema.Struct<{
162
+ provider: Schema.optional<typeof Schema.Never>;
163
+ harness: Schema.SchemaClass<"codex" | "opencode" | "pi" | "fx" | "claude" | "gemini" | "qwen" | "cursor", "codex" | "opencode" | "pi" | "fx" | "claude" | "gemini" | "qwen" | "cursor", never>;
164
+ kind: Schema.Literal<["judge"]>;
165
+ name: Schema.filter<Schema.filter<typeof Schema.String>>;
166
+ model: Schema.filter<Schema.filter<typeof Schema.String>>;
167
+ rubric: Schema.filter<Schema.filter<typeof Schema.String>>;
168
+ expected: Schema.optional<Schema.filter<typeof Schema.String>>;
169
+ choices: Schema.filter<Schema.Record$<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.Number>>>;
170
+ threshold: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
171
+ default: () => number;
172
+ }>;
173
+ timeoutMs: Schema.optionalWith<Schema.filter<typeof Schema.Int>, {
174
+ default: () => number;
175
+ }>;
176
+ }>]>>>>;
177
+ sourceFiles: Schema.optional<Schema.filter<Schema.filter<Schema.filter<Schema.Array$<Schema.Struct<{
178
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
179
+ content: Schema.filter<typeof Schema.String>;
180
+ }>>>>>>;
181
+ }>>]>>>;
65
182
  variables: Schema.optional<Schema.Record$<typeof Schema.String, Schema.refine<string, typeof Schema.String>>>;
66
183
  verify: Schema.NullOr<Schema.refine<string, typeof Schema.String>>;
67
184
  }>>>>>;
@@ -82,7 +199,7 @@ declare const PublicStartEvalRequest: Schema.Struct<{
82
199
  readonly run?: string | undefined;
83
200
  readonly systemPrompt?: string | undefined;
84
201
  } | undefined;
85
- readonly provider: "daytona" | "e2b" | "upstash" | "modal" | "cloudflare" | "vercel";
202
+ readonly sandbox?: "daytona" | "e2b" | "upstash" | "modal" | "cloudflare" | "vercel" | undefined;
86
203
  }, Schema.Struct<{
87
204
  harness: Schema.Literal<["codex", "opencode", "pi", "fx", "claude", "gemini", "qwen", "cursor", "command"]>;
88
205
  model: Schema.filter<typeof Schema.String>;
@@ -94,7 +211,7 @@ declare const PublicStartEvalRequest: Schema.Struct<{
94
211
  run: Schema.optional<typeof Schema.String>;
95
212
  systemPrompt: Schema.optional<typeof Schema.String>;
96
213
  }>>;
97
- provider: Schema.Literal<["daytona", "e2b", "upstash", "modal", "cloudflare", "vercel"]>;
214
+ sandbox: Schema.optional<Schema.Literal<["daytona", "e2b", "upstash", "modal", "cloudflare", "vercel"]>>;
98
215
  }>>>>>;
99
216
  trials: Schema.filter<typeof Schema.Int>;
100
217
  }>;
@@ -102,13 +219,7 @@ type PublicStartEvalRequest = typeof PublicStartEvalRequest.Type;
102
219
  //#endregion
103
220
  //#region src/evals/types.d.ts
104
221
  type EvalTaskRequest = PublicStartEvalRequest["tasks"][number];
105
- /**
106
- * A profile directory beside the eval file.
107
- *
108
- * `dir` resolves against the eval file. Files under `home/` and `workspace/`
109
- * are shipped into the sandbox; an optional `profile.json` names a system
110
- * prompt, env, and for the command harness the install and run steps.
111
- */
222
+ /** A profile directory beside the eval file; `dir` resolves against it. */
112
223
  interface ProfileRef {
113
224
  readonly dir: string;
114
225
  readonly name: string;
@@ -120,7 +231,7 @@ type HarnessRef = EvalHarness | {
120
231
  interface EvalTaskDefinition {
121
232
  readonly harness: HarnessRef;
122
233
  readonly model: EvalTaskRequest["model"];
123
- readonly provider: EvalTaskRequest["provider"];
234
+ readonly sandbox?: EvalTaskRequest["sandbox"];
124
235
  }
125
236
  interface CommandResult {
126
237
  readonly exitCode: number;
@@ -132,27 +243,16 @@ interface ExecOptions {
132
243
  readonly env?: Readonly<Record<string, string>>;
133
244
  readonly timeoutMs?: number;
134
245
  }
135
- /**
136
- * A directory worth keeping between runs of the same case.
137
- *
138
- * Declared on the case rather than returned by the prepare, because a restore
139
- * has to happen before the prepare runs: something that only exists once it has
140
- * finished cannot say where to look. This is the shape CI caches use for the
141
- * same reason -- actions/cache names its path and key before the step, not
142
- * after.
143
- *
144
- * The key should name everything the contents depend on, a lockfile hash above
145
- * all, because entries are write-once: a key that already holds an entry keeps
146
- * it, which is what makes two runs preparing at once safe.
147
- */
246
+ /** Entries are write-once, so the key must name everything the contents
247
+ * depend on -- a lockfile hash above all. */
148
248
  interface CaseCache {
149
249
  readonly key: string;
150
250
  /** Relative to the workspace. */
151
251
  readonly path: string;
152
252
  }
153
253
  interface PrepareContext {
154
- /** True when the runner restored a cached directory before this ran, so a
155
- * prepare can skip the work that produced it. */
254
+ /** True when the runner restored a cached directory, so a prepare can skip
255
+ * the work that produced it. */
156
256
  readonly cached: boolean;
157
257
  readonly exec: (file: string, args?: readonly string[], options?: ExecOptions) => Promise<CommandResult>;
158
258
  readonly exists: (path: string) => Promise<boolean>;
@@ -162,7 +262,7 @@ interface PrepareContext {
162
262
  type PrepareValue = Readonly<Record<string, unknown>>;
163
263
  type Prepare = (context: PrepareContext) => Promise<PrepareValue | undefined> | PrepareValue | undefined;
164
264
  interface ValidatorContext {
165
- /** The agent's final reply, empty when it said nothing. */
265
+ /** Empty when the agent said nothing. */
166
266
  readonly answer: () => Promise<string>;
167
267
  readonly cli: {
168
268
  readonly calls: (cli?: string) => Promise<readonly CliCall[]>;
@@ -174,7 +274,7 @@ interface ValidatorContext {
174
274
  };
175
275
  readonly prepared: Readonly<Record<string, unknown>>;
176
276
  readonly readText: (path: string) => Promise<string>;
177
- /** Every reply the agent made, oldest first, separated by a blank line. */
277
+ /** Every reply, oldest first, separated by a blank line. */
178
278
  readonly transcript: () => Promise<string>;
179
279
  }
180
280
  interface ValidatorResult {
@@ -184,8 +284,7 @@ interface ValidatorResult {
184
284
  type Validator = (context: ValidatorContext) => boolean | ValidatorResult | Promise<boolean | ValidatorResult>;
185
285
  type DeclaredSource = EvalSource | string;
186
286
  interface EvalCaseBase {
187
- /** What a prepare builds that is worth keeping for the next run of this
188
- * case. Restored before it runs, and saved after it succeeds. */
287
+ /** Restored before the prepare runs, saved after it succeeds. */
189
288
  readonly cache?: CaseCache;
190
289
  readonly name: string;
191
290
  readonly prepare?: Prepare | null;
@@ -193,13 +292,15 @@ interface EvalCaseBase {
193
292
  readonly variables?: Readonly<Record<string, string>>;
194
293
  }
195
294
  type EvalCaseDefinition = EvalCaseBase & ({
196
- readonly validate: Validator;
295
+ readonly validate: Validator | EvalJudge | readonly (Validator | EvalJudge)[];
197
296
  readonly verify?: never;
198
297
  } | {
199
298
  readonly validate?: never;
200
299
  readonly verify: string;
201
300
  });
202
301
  interface EvalDefinition {
302
+ readonly captureSource?: boolean;
303
+ readonly captureValidation?: boolean;
203
304
  readonly cases: readonly EvalCaseDefinition[];
204
305
  readonly cli?: readonly CliDefinition[];
205
306
  readonly mcp?: readonly McpServerDefinition[];