anpord 0.1.19 → 0.1.21
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/dist/api-context.cjs +1 -1
- package/dist/api-context.d.cts +1 -1
- package/dist/api-context.d.mts +1 -1
- package/dist/api-context.mjs +1 -1
- package/dist/{api-mocks-C3SsliJZ.mjs → api-mocks-BYWvJp9v.mjs} +3 -3
- package/dist/{api-mocks-CAQFqUgY.d.cts → api-mocks-BenVx0e8.d.cts} +11 -11
- package/dist/{api-mocks-CAQFqUgY.d.mts → api-mocks-BenVx0e8.d.mts} +11 -11
- package/dist/{api-mocks-BjnewAya.cjs → api-mocks-CgiC7T9U.cjs} +8 -2
- package/dist/api-runtime.cjs +1 -1
- package/dist/api-runtime.d.cts +1 -1
- package/dist/api-runtime.d.mts +1 -1
- package/dist/api-runtime.mjs +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +1 -1
- package/dist/bin.cjs +4301 -228
- package/dist/bin.mjs +4305 -232
- package/dist/{client-COfGoWvI.cjs → client-BZDftC1x.cjs} +24 -2
- package/dist/{client-BucAp4c0.d.mts → client-C7iEhiDm.d.mts} +5882 -2454
- package/dist/{client-OTrC6QXZ.d.cts → client-CsGxLUZq.d.cts} +5882 -2454
- package/dist/{client-sWrfA0jZ.mjs → client-D0l3kwWV.mjs} +24 -2
- package/dist/{compiler-CPpRRAdH.cjs → compiler-Cy85vNbp.cjs} +2 -2
- package/dist/{compiler-q6rnLW2F.mjs → compiler-DSQRHvXS.mjs} +2 -2
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/{eval-turns-hf6tbL-E.mjs → eval-turns-BC-GMHD-.mjs} +3 -2
- package/dist/{eval-turns-Bv8wRQ-b.cjs → eval-turns-DcJ8_1qr.cjs} +8 -1
- package/dist/{eval-validations-D0Cz6xSg.cjs → eval-validations-CZm7vVtQ.cjs} +12 -0
- package/dist/{eval-validations-CUG2PvR_.mjs → eval-validations-DNO-qwkU.mjs} +1 -1
- package/dist/eval.cjs +1 -1
- package/dist/eval.d.cts +1 -1
- package/dist/eval.d.mts +1 -1
- package/dist/eval.mjs +1 -1
- package/dist/{evals-CSipRo7i.d.cts → evals-Dw2Ek-mx.d.cts} +131 -128
- package/dist/{evals-CSipRo7i.d.mts → evals-Dw2Ek-mx.d.mts} +131 -128
- package/dist/{evals-api-u98TxdqN.mjs → evals-api-CK3F1KoI.mjs} +164 -65
- package/dist/{evals-api-DZSr9rtP.cjs → evals-api-CNoLlXL5.cjs} +199 -64
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{runtime-B5it0Siy.cjs → runtime-Bfs2j0jW.cjs} +2 -2
- package/dist/{runtime-ChWJywJY.mjs → runtime-CYr8RbsW.mjs} +2 -2
- package/dist/source.d.cts +1 -1
- package/dist/source.d.mts +1 -1
- package/dist/{types-LW0tX4MF.d.mts → types-D-h67MVJ.d.mts} +14 -13
- package/dist/{types-DCUo5on_.d.cts → types-Dvd_z5ge.d.cts} +14 -13
- package/dist/validator-runtime.cjs +2 -2
- package/dist/validator-runtime.d.cts +1 -1
- package/dist/validator-runtime.d.mts +1 -1
- package/dist/validator-runtime.mjs +2 -2
- package/dist/validators.cjs +1 -1
- package/dist/validators.mjs +1 -1
- package/package.json +3 -1
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
import { n as EvalJudgment, r as EvalHarness$1, t as EvalJudge } from "./eval-judges-Bee_ABJt.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { n as EvalValidations } from "./eval-validations-DNO-qwkU.mjs";
|
|
3
|
+
import { i as EvalUser } from "./eval-turns-BC-GMHD-.mjs";
|
|
4
4
|
import { Context, Schema } from "effect";
|
|
5
5
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, HttpApiSecurity, OpenApi } from "@effect/platform";
|
|
6
|
-
//#region ../schema/src/domain/errors.ts
|
|
7
|
-
var NotFound = class extends Schema.TaggedError()("NotFound", { message: Schema.String }, HttpApiSchema.annotations({ status: 404 })) {};
|
|
8
|
-
var Conflict = class extends Schema.TaggedError()("Conflict", { message: Schema.String }, HttpApiSchema.annotations({ status: 409 })) {};
|
|
9
|
-
var BadRequest = class extends Schema.TaggedError()("BadRequest", { message: Schema.String }, HttpApiSchema.annotations({ status: 400 })) {};
|
|
10
|
-
var Unauthorized = class extends Schema.TaggedError()("Unauthorized", { message: Schema.String }, HttpApiSchema.annotations({ status: 401 })) {};
|
|
11
|
-
var Forbidden = class extends Schema.TaggedError()("Forbidden", { message: Schema.String }, HttpApiSchema.annotations({ status: 403 })) {};
|
|
12
|
-
Schema.TaggedError()("InternalError", { message: Schema.String }, HttpApiSchema.annotations({ status: 500 }));
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region ../schema/src/domain/eval-limits.ts
|
|
15
|
-
const PROMPT_LIMIT = 16384;
|
|
16
|
-
const VERIFY_LIMIT = 8192;
|
|
17
|
-
const NAME_LIMIT = 200;
|
|
18
|
-
const VARIABLE_VALUE_LIMIT = 2048;
|
|
19
|
-
const EvalPrompt = Schema.String.pipe(Schema.maxLength(PROMPT_LIMIT), Schema.annotations({
|
|
20
|
-
description: "What the agent is asked to do.",
|
|
21
|
-
identifier: "EvalPrompt",
|
|
22
|
-
message: () => `A prompt must be at most ${PROMPT_LIMIT} characters, because it is quoted into one sandbox command line.`
|
|
23
|
-
}));
|
|
24
|
-
const EvalVerify = Schema.String.pipe(Schema.maxLength(VERIFY_LIMIT), Schema.annotations({
|
|
25
|
-
description: "The shell command that decides whether a trial passed.",
|
|
26
|
-
identifier: "EvalVerify",
|
|
27
|
-
message: () => `A verifier must be at most ${VERIFY_LIMIT} characters, because it is quoted into one sandbox command line.`
|
|
28
|
-
}));
|
|
29
|
-
const EvalCaseName = Schema.String.pipe(Schema.maxLength(NAME_LIMIT), Schema.annotations({
|
|
30
|
-
description: "What a case is called.",
|
|
31
|
-
identifier: "EvalCaseName",
|
|
32
|
-
message: () => `A case name must be at most ${NAME_LIMIT} characters.`
|
|
33
|
-
}));
|
|
34
|
-
const EvalVariableValue = Schema.String.pipe(Schema.maxLength(VARIABLE_VALUE_LIMIT), Schema.annotations({
|
|
35
|
-
identifier: "EvalVariableValue",
|
|
36
|
-
message: () => `A variable value must be at most ${VARIABLE_VALUE_LIMIT} characters, because it is substituted into the prompt before it is quoted.`
|
|
37
|
-
}));
|
|
38
|
-
//#endregion
|
|
39
6
|
//#region ../schema/src/domain/credentials.ts
|
|
40
7
|
const CredentialScope = Schema.Literal("organization", "personal");
|
|
41
8
|
const CredentialStatus = Schema.Literal("active", "invalid");
|
|
@@ -52,9 +19,9 @@ const CredentialAuthMethod = Schema.Struct({
|
|
|
52
19
|
kind: Schema.Literal("secret", "device", "env"),
|
|
53
20
|
label: Schema.String
|
|
54
21
|
});
|
|
55
|
-
Schema.Struct({
|
|
22
|
+
const CredentialIntegration = Schema.Struct({
|
|
56
23
|
authMethods: Schema.Array(CredentialAuthMethod),
|
|
57
|
-
category: Schema.Literal("harness", "
|
|
24
|
+
category: Schema.Literal("harness", "model", "sandbox"),
|
|
58
25
|
id: Schema.String,
|
|
59
26
|
label: Schema.String
|
|
60
27
|
});
|
|
@@ -65,7 +32,7 @@ Schema.Struct({
|
|
|
65
32
|
description: "Who else in the organization has an integration connected.",
|
|
66
33
|
identifier: "IntegrationAwareness"
|
|
67
34
|
});
|
|
68
|
-
Schema.Struct({
|
|
35
|
+
const CredentialConnection = Schema.Struct({
|
|
69
36
|
authMethodId: Schema.String,
|
|
70
37
|
createdAt: Schema.DateTimeUtc,
|
|
71
38
|
id: Schema.String,
|
|
@@ -120,6 +87,57 @@ Schema.Struct({
|
|
|
120
87
|
status: Schema.Literal("pending", "complete", "failed", "expired")
|
|
121
88
|
});
|
|
122
89
|
//#endregion
|
|
90
|
+
//#region ../schema/src/domain/errors.ts
|
|
91
|
+
var NotFound = class extends Schema.TaggedError()("NotFound", { message: Schema.String }, HttpApiSchema.annotations({ status: 404 })) {};
|
|
92
|
+
var Conflict = class extends Schema.TaggedError()("Conflict", { message: Schema.String }, HttpApiSchema.annotations({ status: 409 })) {};
|
|
93
|
+
var BadRequest = class extends Schema.TaggedError()("BadRequest", { message: Schema.String }, HttpApiSchema.annotations({ status: 400 })) {};
|
|
94
|
+
var Unauthorized = class extends Schema.TaggedError()("Unauthorized", { message: Schema.String }, HttpApiSchema.annotations({ status: 401 })) {};
|
|
95
|
+
var Forbidden = class extends Schema.TaggedError()("Forbidden", { message: Schema.String }, HttpApiSchema.annotations({ status: 403 })) {};
|
|
96
|
+
Schema.TaggedError()("InternalError", { message: Schema.String }, HttpApiSchema.annotations({ status: 500 }));
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region ../schema/src/internal/authentication.ts
|
|
99
|
+
var CurrentActor = class extends Context.Tag("@anpord/schema/CurrentActor")() {};
|
|
100
|
+
HttpApiMiddleware.Tag()("@anpord/schema/Authentication", {
|
|
101
|
+
failure: Unauthorized,
|
|
102
|
+
provides: CurrentActor,
|
|
103
|
+
security: { session: HttpApiSecurity.apiKey({
|
|
104
|
+
in: "cookie",
|
|
105
|
+
key: "anpord.session_token"
|
|
106
|
+
}) }
|
|
107
|
+
});
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../schema/src/public/authentication.ts
|
|
110
|
+
var ApiKeyAuthentication = class extends HttpApiMiddleware.Tag()("@anpord/schema/ApiKeyAuthentication", {
|
|
111
|
+
failure: Unauthorized,
|
|
112
|
+
provides: CurrentActor,
|
|
113
|
+
security: { bearer: HttpApiSecurity.bearer }
|
|
114
|
+
}) {};
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region ../schema/src/domain/eval-limits.ts
|
|
117
|
+
const PROMPT_LIMIT = 16384;
|
|
118
|
+
const VERIFY_LIMIT = 8192;
|
|
119
|
+
const NAME_LIMIT = 200;
|
|
120
|
+
const VARIABLE_VALUE_LIMIT = 2048;
|
|
121
|
+
const EvalPrompt = Schema.String.pipe(Schema.maxLength(PROMPT_LIMIT), Schema.annotations({
|
|
122
|
+
description: "What the agent is asked to do.",
|
|
123
|
+
identifier: "EvalPrompt",
|
|
124
|
+
message: () => `A prompt must be at most ${PROMPT_LIMIT} characters, because it is quoted into one sandbox command line.`
|
|
125
|
+
}));
|
|
126
|
+
const EvalVerify = Schema.String.pipe(Schema.maxLength(VERIFY_LIMIT), Schema.annotations({
|
|
127
|
+
description: "The shell command that decides whether a trial passed.",
|
|
128
|
+
identifier: "EvalVerify",
|
|
129
|
+
message: () => `A verifier must be at most ${VERIFY_LIMIT} characters, because it is quoted into one sandbox command line.`
|
|
130
|
+
}));
|
|
131
|
+
const EvalCaseName = Schema.String.pipe(Schema.maxLength(NAME_LIMIT), Schema.annotations({
|
|
132
|
+
description: "What a case is called.",
|
|
133
|
+
identifier: "EvalCaseName",
|
|
134
|
+
message: () => `A case name must be at most ${NAME_LIMIT} characters.`
|
|
135
|
+
}));
|
|
136
|
+
const EvalVariableValue = Schema.String.pipe(Schema.maxLength(VARIABLE_VALUE_LIMIT), Schema.annotations({
|
|
137
|
+
identifier: "EvalVariableValue",
|
|
138
|
+
message: () => `A variable value must be at most ${VARIABLE_VALUE_LIMIT} characters, because it is substituted into the prompt before it is quoted.`
|
|
139
|
+
}));
|
|
140
|
+
//#endregion
|
|
123
141
|
//#region ../schema/src/domain/eval-trigger.ts
|
|
124
142
|
const EvalTrigger = Schema.Struct({
|
|
125
143
|
source: Schema.Literal("dashboard", "api", "cli", "ci", "mcp"),
|
|
@@ -181,10 +199,11 @@ const PROFILE_HARNESS_RULE = "The command harness needs a profile with a run com
|
|
|
181
199
|
//#endregion
|
|
182
200
|
//#region ../schema/src/domain/evals.ts
|
|
183
201
|
const EvalHarness = EvalHarness$1;
|
|
184
|
-
const EvalSandbox = Schema.Literal("daytona", "e2b", "upstash", "modal", "cloudflare", "vercel");
|
|
185
|
-
EvalSandbox.literals;
|
|
202
|
+
const EvalSandbox = Schema.Literal("daytona", "e2b", "upstash", "modal", "cloudflare", "vercel", "local");
|
|
203
|
+
const HOSTED_SANDBOXES = EvalSandbox.literals.filter((sandbox) => sandbox !== "local");
|
|
186
204
|
const EvalTrialStatus = Schema.Literal("queued", "running", "passed", "failed", "void");
|
|
187
205
|
const EvalRunStatus = Schema.Literal("running", "finished", "failed");
|
|
206
|
+
const EvalExecutor = Schema.Literal("client");
|
|
188
207
|
const EvalSource = Schema.Union(Schema.Struct({ kind: Schema.Literal("empty") }), Schema.Struct({
|
|
189
208
|
kind: Schema.Literal("repo"),
|
|
190
209
|
ref: Schema.NullOr(Schema.String),
|
|
@@ -289,7 +308,7 @@ Schema.Struct({
|
|
|
289
308
|
tasks: Schema.Array(EvalTaskRequest).pipe(Schema.minItems(1), Schema.maxItems(20)),
|
|
290
309
|
trials: Schema.Int.pipe(Schema.between(1, 10))
|
|
291
310
|
});
|
|
292
|
-
const OccurredAtMillis = Schema.NullOr(Schema.Number);
|
|
311
|
+
const OccurredAtMillis$1 = Schema.NullOr(Schema.Number);
|
|
293
312
|
const EvalUsage = Schema.Struct({
|
|
294
313
|
cacheReadTokens: Schema.Int,
|
|
295
314
|
cacheWriteTokens: Schema.Int,
|
|
@@ -305,18 +324,18 @@ const EvalJournalEntry = Schema.Union(Schema.Struct({
|
|
|
305
324
|
_tag: Schema.Literal("command"),
|
|
306
325
|
command: Schema.String,
|
|
307
326
|
exitCode: Schema.NullOr(Schema.Int),
|
|
308
|
-
finishedAtMillis: OccurredAtMillis,
|
|
327
|
+
finishedAtMillis: OccurredAtMillis$1,
|
|
309
328
|
output: Schema.String,
|
|
310
329
|
outputTruncated: Schema.optional(Schema.Boolean),
|
|
311
|
-
startedAtMillis: OccurredAtMillis
|
|
330
|
+
startedAtMillis: OccurredAtMillis$1
|
|
312
331
|
}), Schema.Struct({
|
|
313
332
|
_tag: Schema.Literal("message"),
|
|
314
|
-
finishedAtMillis: OccurredAtMillis,
|
|
333
|
+
finishedAtMillis: OccurredAtMillis$1,
|
|
315
334
|
text: Schema.String,
|
|
316
335
|
usage: Schema.optional(Schema.NullOr(EvalUsage))
|
|
317
336
|
}), Schema.Struct({
|
|
318
337
|
_tag: Schema.Literal("toolCall"),
|
|
319
|
-
finishedAtMillis: OccurredAtMillis,
|
|
338
|
+
finishedAtMillis: OccurredAtMillis$1,
|
|
320
339
|
input: Schema.optional(Schema.String),
|
|
321
340
|
name: Schema.String,
|
|
322
341
|
output: Schema.optional(Schema.String),
|
|
@@ -324,11 +343,11 @@ const EvalJournalEntry = Schema.Union(Schema.Struct({
|
|
|
324
343
|
outputTruncated: Schema.optional(Schema.Boolean),
|
|
325
344
|
inputTruncated: Schema.optional(Schema.Boolean),
|
|
326
345
|
errorTruncated: Schema.optional(Schema.Boolean),
|
|
327
|
-
startedAtMillis: Schema.optional(OccurredAtMillis),
|
|
346
|
+
startedAtMillis: Schema.optional(OccurredAtMillis$1),
|
|
328
347
|
status: Schema.NullOr(Schema.String)
|
|
329
348
|
}), Schema.Struct({
|
|
330
349
|
_tag: Schema.Literal("fileChange"),
|
|
331
|
-
finishedAtMillis: OccurredAtMillis,
|
|
350
|
+
finishedAtMillis: OccurredAtMillis$1,
|
|
332
351
|
paths: Schema.Array(Schema.String)
|
|
333
352
|
})).annotations({
|
|
334
353
|
description: "A normalized event recorded from the harness trajectory.",
|
|
@@ -475,6 +494,7 @@ const EvalRun = Schema.Struct({
|
|
|
475
494
|
cases: Schema.Array(Schema.String),
|
|
476
495
|
cells: Schema.Array(EvalCell),
|
|
477
496
|
costs: Schema.NullOr(EvalCosts),
|
|
497
|
+
executedBy: Schema.optionalWith(Schema.NullOr(EvalExecutor), { default: () => null }),
|
|
478
498
|
failure: Schema.NullOr(Schema.String),
|
|
479
499
|
finishedAt: Schema.NullOr(EvalTimestamp),
|
|
480
500
|
id: Schema.String,
|
|
@@ -529,6 +549,14 @@ const EvalCellHistoryEntry = Schema.Struct({
|
|
|
529
549
|
description: "A previous scored result for the same cell identity.",
|
|
530
550
|
identifier: "EvalCellHistoryEntry"
|
|
531
551
|
});
|
|
552
|
+
const RunSubscription = Schema.Struct({
|
|
553
|
+
expiresAtMillis: Schema.Number,
|
|
554
|
+
tag: Schema.String,
|
|
555
|
+
token: Schema.String
|
|
556
|
+
}).annotations({
|
|
557
|
+
description: "A scoped, read-only token for watching one run in real time.",
|
|
558
|
+
identifier: "RunSubscription"
|
|
559
|
+
});
|
|
532
560
|
//#endregion
|
|
533
561
|
//#region ../schema/src/domain/eval-playground.ts
|
|
534
562
|
const PlaygroundCaseView = Schema.Struct({
|
|
@@ -610,23 +638,74 @@ const ModelCatalogue = Schema.Struct({
|
|
|
610
638
|
identifier: "ModelCatalogue"
|
|
611
639
|
});
|
|
612
640
|
//#endregion
|
|
613
|
-
//#region ../schema/src/
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
641
|
+
//#region ../schema/src/domain/harness-event.ts
|
|
642
|
+
const OccurredAtMillis = Schema.optional(Schema.Number);
|
|
643
|
+
const HarnessUsage = Schema.Struct({
|
|
644
|
+
cacheReadTokens: Schema.Int,
|
|
645
|
+
cacheWriteTokens: Schema.Int,
|
|
646
|
+
costUsd: Schema.optional(Schema.Number),
|
|
647
|
+
inputTokens: Schema.Int,
|
|
648
|
+
outputTokens: Schema.Int,
|
|
649
|
+
totalTokens: Schema.Int
|
|
622
650
|
});
|
|
651
|
+
const HarnessEvent = Schema.Union(Schema.Struct({
|
|
652
|
+
_tag: Schema.Literal("Started"),
|
|
653
|
+
at: OccurredAtMillis,
|
|
654
|
+
model: Schema.String,
|
|
655
|
+
sessionId: Schema.String
|
|
656
|
+
}), Schema.Struct({
|
|
657
|
+
_tag: Schema.Literal("Message"),
|
|
658
|
+
at: OccurredAtMillis,
|
|
659
|
+
role: Schema.Literal("assistant", "user"),
|
|
660
|
+
text: Schema.String,
|
|
661
|
+
usage: Schema.optional(HarnessUsage)
|
|
662
|
+
}), Schema.Struct({
|
|
663
|
+
_tag: Schema.Literal("Command"),
|
|
664
|
+
at: OccurredAtMillis,
|
|
665
|
+
command: Schema.String,
|
|
666
|
+
exitCode: Schema.NullOr(Schema.Int),
|
|
667
|
+
output: Schema.String,
|
|
668
|
+
startedAt: Schema.optional(Schema.Number)
|
|
669
|
+
}), Schema.Struct({
|
|
670
|
+
_tag: Schema.Literal("FileChange"),
|
|
671
|
+
at: OccurredAtMillis,
|
|
672
|
+
paths: Schema.Array(Schema.String)
|
|
673
|
+
}), Schema.Struct({
|
|
674
|
+
_tag: Schema.Literal("ToolCall"),
|
|
675
|
+
at: OccurredAtMillis,
|
|
676
|
+
callId: Schema.NullOr(Schema.String),
|
|
677
|
+
input: Schema.String,
|
|
678
|
+
name: Schema.String,
|
|
679
|
+
output: Schema.optional(Schema.String),
|
|
680
|
+
error: Schema.optional(Schema.String),
|
|
681
|
+
startedAt: Schema.optional(Schema.Number),
|
|
682
|
+
status: Schema.NullOr(Schema.String)
|
|
683
|
+
}), Schema.Struct({
|
|
684
|
+
_tag: Schema.Literal("Finished"),
|
|
685
|
+
at: OccurredAtMillis,
|
|
686
|
+
reason: Schema.String
|
|
687
|
+
}));
|
|
623
688
|
//#endregion
|
|
624
|
-
//#region ../schema/src/
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
689
|
+
//#region ../schema/src/domain/trial.ts
|
|
690
|
+
const TrialStatus = Schema.Literal("queued", "running", "passed", "failed", "void");
|
|
691
|
+
Schema.decodeUnknownOption(TrialStatus);
|
|
692
|
+
const VerifyStepResult = Schema.Struct({
|
|
693
|
+
command: Schema.String,
|
|
694
|
+
exitCode: Schema.Int
|
|
695
|
+
});
|
|
696
|
+
const TrialOutcome = Schema.Struct({
|
|
697
|
+
artifacts: Schema.optional(Schema.Array(EvalArtifactMetadata)),
|
|
698
|
+
validations: Schema.optional(EvalValidations),
|
|
699
|
+
judgments: Schema.optional(Schema.Array(EvalJudgment)),
|
|
700
|
+
commandCount: Schema.Int,
|
|
701
|
+
exitCode: Schema.Int,
|
|
702
|
+
modelMs: Schema.Int,
|
|
703
|
+
passed: Schema.Boolean,
|
|
704
|
+
sandboxMs: Schema.Int,
|
|
705
|
+
status: TrialStatus,
|
|
706
|
+
verifySteps: Schema.Array(VerifyStepResult),
|
|
707
|
+
voidFields: Schema.Array(Schema.String)
|
|
708
|
+
});
|
|
630
709
|
//#endregion
|
|
631
710
|
//#region ../schema/src/public/evals-api.ts
|
|
632
711
|
const EvalRunRequest = Schema.Struct({ id: Schema.String }).annotations({
|
|
@@ -644,7 +723,7 @@ const EvalModelsRequest = Schema.Struct({
|
|
|
644
723
|
description: "Select a harness whose available models should be listed.",
|
|
645
724
|
identifier: "EvalModelsRequest"
|
|
646
725
|
});
|
|
647
|
-
const PublicEvalSandbox =
|
|
726
|
+
const PublicEvalSandbox = Schema.Literal(...HOSTED_SANDBOXES).annotations({
|
|
648
727
|
description: "The hosted sandbox a task runs in.",
|
|
649
728
|
identifier: "PublicEvalSandbox"
|
|
650
729
|
});
|
|
@@ -680,6 +759,7 @@ const PublicEvalTask = Schema.Struct({
|
|
|
680
759
|
const PublicStartEvalRequest = Schema.Struct({
|
|
681
760
|
trigger: Schema.optional(EvalTrigger),
|
|
682
761
|
cases: Schema.Array(PublicEvalCase).pipe(Schema.minItems(1), Schema.maxItems(100)),
|
|
762
|
+
executeLocally: Schema.optional(Schema.Boolean),
|
|
683
763
|
name: Schema.optional(EvalName),
|
|
684
764
|
prompt: EvalPrompt,
|
|
685
765
|
tasks: Schema.Array(PublicEvalTask).pipe(Schema.minItems(1), Schema.maxItems(20)),
|
|
@@ -688,6 +768,25 @@ const PublicStartEvalRequest = Schema.Struct({
|
|
|
688
768
|
description: `Start a grid with at most 100 total case, task, and trial combinations.`,
|
|
689
769
|
identifier: "StartEvalRequest"
|
|
690
770
|
});
|
|
691
|
-
|
|
771
|
+
const ReportedTrial = Schema.Struct({
|
|
772
|
+
caseName: EvalCaseName,
|
|
773
|
+
events: Schema.Array(HarnessEvent),
|
|
774
|
+
ordinal: Schema.Int.pipe(Schema.nonNegative()),
|
|
775
|
+
outcome: TrialOutcome,
|
|
776
|
+
sandboxId: Schema.optional(Schema.NullOr(Schema.String)),
|
|
777
|
+
taskIndex: Schema.Int.pipe(Schema.nonNegative()),
|
|
778
|
+
usage: Schema.optional(Schema.NullOr(HarnessUsage))
|
|
779
|
+
}).annotations({
|
|
780
|
+
description: "One trial a client ran and is reporting the result of.",
|
|
781
|
+
identifier: "ReportedTrial"
|
|
782
|
+
});
|
|
783
|
+
const ReportTrialRequest = Schema.Struct({
|
|
784
|
+
id: Schema.String,
|
|
785
|
+
trial: ReportedTrial
|
|
786
|
+
}).annotations({
|
|
787
|
+
description: "A trial the caller ran, named by the run it belongs to.",
|
|
788
|
+
identifier: "ReportTrialRequest"
|
|
789
|
+
});
|
|
790
|
+
var PublicEvalsGroup = class extends HttpApiGroup.make("evals").add(HttpApiEndpoint.post("list", "/evals.list").setPayload(ListEvalsRequest).addSuccess(EvalRunPage).annotate(OpenApi.Summary, "List eval runs").annotate(OpenApi.Description, "Newest first. Pass the `next` cursor from a response to read the page after it; a null `next` means there are no more.")).add(HttpApiEndpoint.post("start", "/evals.start").setPayload(PublicStartEvalRequest).addSuccess(StartedEval).annotate(OpenApi.Summary, "Start an eval run").annotate(OpenApi.Description, `Starts the grid and returns its id while trials continue in the background. ${PROFILE_HARNESS_RULE}`)).add(HttpApiEndpoint.post("reportTrial", "/evals.reportTrial").setPayload(ReportTrialRequest).addSuccess(Schema.Void).annotate(OpenApi.Summary, "Report a trial run outside the platform").annotate(OpenApi.Description, "For a run started with executeLocally. The result is recorded as reported: it was produced somewhere the platform cannot inspect, so it is marked and kept out of baselines.")).add(HttpApiEndpoint.post("finishRun", "/evals.finishRun").setPayload(EvalRunRequest).addSuccess(EvalRun).annotate(OpenApi.Summary, "Settle a run whose trials the caller ran").annotate(OpenApi.Description, "Settles the run from the trials reported so far. A run left unsettled is swept like any other abandoned work.")).add(HttpApiEndpoint.post("artifact", "/evals.artifact").setPayload(EvalArtifactRequest).addSuccess(EvalArtifact)).add(HttpApiEndpoint.post("get", "/evals.get").setPayload(EvalRunRequest).addSuccess(EvalRun).annotate(OpenApi.Summary, "Get an eval run")).add(HttpApiEndpoint.post("subscription", "/evals.subscription").setPayload(EvalRunRequest).addSuccess(RunSubscription).annotate(OpenApi.Summary, "Watch an eval run as it moves").annotate(OpenApi.Description, "Returns a read-only token scoped to this run, for following it in real time. Short-lived: request another when it expires.")).add(HttpApiEndpoint.post("cellHistory", "/evals.cellHistory").setPayload(EvalCellRequest).addSuccess(Schema.Array(EvalCellHistoryEntry)).annotate(OpenApi.Summary, "List a cell's history").annotate(OpenApi.Description, "Returns the 20 most recent results.")).add(HttpApiEndpoint.post("rerunCell", "/evals.rerunCell").setPayload(Schema.extend(EvalRunRequest, Schema.extend(EvalCellRequest, RerunCellRequest))).addSuccess(StartedEval).annotate(OpenApi.Summary, "Rerun one cell")).add(HttpApiEndpoint.post("models", "/evals.models").setPayload(EvalModelsRequest).addSuccess(ModelCatalogue).annotate(OpenApi.Summary, "List models available to the harness").annotate(OpenApi.Description, "The command harness has no catalogue of its own, so its list is empty: the model is whatever the profile's run command reads from ANPORD_MODEL.")).addError(BadRequest).addError(Conflict).addError(Forbidden).addError(NotFound).middleware(ApiKeyAuthentication).annotate(OpenApi.Title, "Evals").annotate(OpenApi.Description, "Run cases across harness, model, and sandbox combinations and compare the results with their baselines.") {};
|
|
692
791
|
//#endregion
|
|
693
|
-
export {
|
|
792
|
+
export { CredentialValues as S, Forbidden as _, EvalSandbox as a, CredentialIntegration as b, HarnessProfile as c, profileFitsHarness as d, EvalSourceFiles as f, Conflict as g, BadRequest as h, EvalRun as i, PROFILE_LIMITS as l, ApiKeyAuthentication as m, PublicStartEvalRequest as n, EvalValidator as o, EvalTrigger as p, HarnessEvent as r, EnvName as s, PublicEvalsGroup as t, ProfilePath as u, NotFound as v, CredentialScope as x, CredentialConnection as y };
|