@alpic-ai/tracks 0.13.0 → 0.16.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/dist/main.js +25 -14
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -454,15 +454,15 @@ const Prompt = Schema.Union([Schema.Struct({
|
|
|
454
454
|
description: "A prompt the agent has finished."
|
|
455
455
|
})]).annotate({ description: "One instruction to the agent and the work it did in response." });
|
|
456
456
|
const EndReason = Schema.Literals([
|
|
457
|
-
"
|
|
457
|
+
"finished",
|
|
458
458
|
"idle_timeout",
|
|
459
459
|
"time_limit",
|
|
460
460
|
"budget_exceeded",
|
|
461
|
-
"
|
|
461
|
+
"errored",
|
|
462
462
|
"canceled"
|
|
463
463
|
]).annotate({
|
|
464
464
|
identifier: "EndReason",
|
|
465
|
-
description: "Why the run ended. When `
|
|
465
|
+
description: "Why the run ended. When `errored`, `failure` explains what went wrong."
|
|
466
466
|
});
|
|
467
467
|
const FailureKind = Schema.Literals([
|
|
468
468
|
"repository_checkout_failed",
|
|
@@ -510,7 +510,7 @@ const Run = Schema.Union([
|
|
|
510
510
|
Schema.Struct({
|
|
511
511
|
...endedRunFields,
|
|
512
512
|
end_reason: EndReason.pick([
|
|
513
|
-
"
|
|
513
|
+
"finished",
|
|
514
514
|
"idle_timeout",
|
|
515
515
|
"time_limit",
|
|
516
516
|
"budget_exceeded",
|
|
@@ -522,11 +522,11 @@ const Run = Schema.Union([
|
|
|
522
522
|
}),
|
|
523
523
|
Schema.Struct({
|
|
524
524
|
...endedRunFields,
|
|
525
|
-
end_reason: Schema.Literal("
|
|
525
|
+
end_reason: Schema.Literal("errored"),
|
|
526
526
|
failure: Schema.String.annotate({ description: "What went wrong." }),
|
|
527
527
|
failure_kind: FailureKind
|
|
528
528
|
}).annotate({
|
|
529
|
-
identifier: "
|
|
529
|
+
identifier: "ErroredRun",
|
|
530
530
|
description: "A run that ended because something went wrong."
|
|
531
531
|
})
|
|
532
532
|
]).annotate({ description: "A coding agent working on your prompt in an isolated sandbox." });
|
|
@@ -772,7 +772,7 @@ var RunsApi = class extends HttpApiGroup.make("runs").add(HttpApiEndpoint.post("
|
|
|
772
772
|
error: RunNotFound
|
|
773
773
|
}).annotateMerge(OpenApi.annotations({
|
|
774
774
|
summary: "End a run",
|
|
775
|
-
description: "Ends the run with `
|
|
775
|
+
description: "Ends the run with `finished` once its current prompt finishes, then destroys its sandbox. Ending a run that has ended does nothing."
|
|
776
776
|
})), HttpApiEndpoint.post("cancel", "/runs/:id/cancel", {
|
|
777
777
|
params: { id: RunId },
|
|
778
778
|
success: Run.pipe(HttpApiSchema.status(202)),
|
|
@@ -999,12 +999,12 @@ const Execution = Schema.Struct({
|
|
|
999
999
|
running: Count.annotate({ description: "Runs not started yet or not ended." }),
|
|
1000
1000
|
judging: Count.annotate({ description: "Ended runs waiting for their evaluation results." }),
|
|
1001
1001
|
judged: Count.annotate({ description: "Runs with a verdict." }),
|
|
1002
|
-
passed: Count.annotate({ description: "Runs that
|
|
1002
|
+
passed: Count.annotate({ description: "Runs that satisfied their scenario's pass policy." })
|
|
1003
1003
|
}).annotate({ description: "How many of its slots, one per scenario, variant, agent and repetition, stand where." }),
|
|
1004
1004
|
pass_rate: Schema.OptionFromOptionalKey(Schema.Int.check(Schema.isBetween({
|
|
1005
1005
|
minimum: 0,
|
|
1006
1006
|
maximum: 100
|
|
1007
|
-
})).annotate({ description: "Runs that
|
|
1007
|
+
})).annotate({ description: "Runs that succeeded out of those with a verdict, as a whole percent. Absent until one run has a verdict." })),
|
|
1008
1008
|
cost_usd: Schema.Number.annotate({ description: "What its runs cost so far, in US dollars." })
|
|
1009
1009
|
}).annotate({
|
|
1010
1010
|
identifier: "Execution",
|
|
@@ -1017,7 +1017,7 @@ const NotEvaluatedReason = Schema.Literals([
|
|
|
1017
1017
|
"agent_failed",
|
|
1018
1018
|
"evidence_too_long",
|
|
1019
1019
|
"too_many_attempts"
|
|
1020
|
-
]).annotate({ description: "Why the run has no verdict: it never started, its scenario has no evaluations, it did not end `
|
|
1020
|
+
]).annotate({ description: "Why the run has no verdict: it never started, its scenario has no evaluations, it did not end `finished`, its agent stopped with an error such as its model provider being unreachable, what it did was too long to judge, or judging failed too many times." });
|
|
1021
1021
|
const Slot = Schema.Struct({
|
|
1022
1022
|
id: Schema.String.annotate({ description: "Unique identifier of the slot." }),
|
|
1023
1023
|
scenario_id: Schema.String,
|
|
@@ -1032,7 +1032,7 @@ const Slot = Schema.Struct({
|
|
|
1032
1032
|
"judged",
|
|
1033
1033
|
"not_evaluated"
|
|
1034
1034
|
]).annotate({ description: "`running` while its run waits to start or has not ended, `judging` while it waits for evaluation results, `judged` once they are all in, or `not_evaluated` when it never will be." }),
|
|
1035
|
-
verdict: Schema.OptionFromOptionalKey(Schema.Literals(["
|
|
1035
|
+
verdict: Schema.OptionFromOptionalKey(Schema.Literals(["succeeded", "failed"]).annotate({ description: "Whether the run satisfied its scenario's pass policy, once judged." })),
|
|
1036
1036
|
score: Schema.OptionFromOptionalKey(Schema.Number.annotate({ description: "Weighted share of evaluations passed, out of 100, once every evaluation result is in." })),
|
|
1037
1037
|
not_evaluated_reason: Schema.OptionFromOptionalKey(NotEvaluatedReason),
|
|
1038
1038
|
refusal: Schema.OptionFromOptionalKey(Schema.String.annotate({ description: "Why its run could not start." })),
|
|
@@ -1244,6 +1244,9 @@ const Secrets = Schema.Struct({
|
|
|
1244
1244
|
IDENTITY_PROVIDER_CLIENT_SECRET: Secret,
|
|
1245
1245
|
SESSION_SECRET: Secret,
|
|
1246
1246
|
VERCEL_CLIENT_SECRET: Secret,
|
|
1247
|
+
AGENTMAIL_API_KEY: Secret,
|
|
1248
|
+
BROWSER_USE_API_KEY: Secret,
|
|
1249
|
+
IPROYAL_API_TOKEN: Schema.optionalKey(Secret),
|
|
1247
1250
|
SENTRY_DSN: Schema.optionalKey(Schema.Redacted(SentryDsn))
|
|
1248
1251
|
});
|
|
1249
1252
|
const Variables = Schema.Struct({
|
|
@@ -1255,6 +1258,7 @@ const Variables = Schema.Struct({
|
|
|
1255
1258
|
FILES_ENDPOINT: Schema.optionalKey(SecureUrl),
|
|
1256
1259
|
CONNECTION_RETURN_ORIGINS: Origins.pipe(Schema.withDecodingDefaultKey(Effect.succeed(""))),
|
|
1257
1260
|
EGRESS_IPS: IpAddresses.pipe(Schema.withDecodingDefaultKey(Effect.succeed(""))),
|
|
1261
|
+
TRUSTED_PROXY_NETWORKS: Schema.fromJsonString(Schema.Array(Schema.IpNetworkFromString)).pipe(Schema.withDecodingDefaultKey(Effect.succeed("[]"))),
|
|
1258
1262
|
DATABASE_HOST: Schema.NonEmptyString,
|
|
1259
1263
|
DATABASE_PORT: Port.pipe(Schema.withDecodingDefaultKey(Effect.succeed(5432))),
|
|
1260
1264
|
DATABASE_NAME: Schema.NonEmptyString.pipe(Schema.withDecodingDefaultKey(Effect.succeed("app"))),
|
|
@@ -1329,6 +1333,11 @@ const AGENT_RUNNER_ENV = [
|
|
|
1329
1333
|
...GATEWAY_ENV,
|
|
1330
1334
|
...CONNECTIONS_ENV
|
|
1331
1335
|
];
|
|
1336
|
+
const WEB_HARNESSES_ENV = [
|
|
1337
|
+
"AGENTMAIL_API_KEY",
|
|
1338
|
+
"BROWSER_USE_API_KEY",
|
|
1339
|
+
"IPROYAL_API_TOKEN"
|
|
1340
|
+
];
|
|
1332
1341
|
const LOG_ENV = ["LOG_FORMAT", "LOG_LEVEL"];
|
|
1333
1342
|
const OBSERVABILITY_ENV = [
|
|
1334
1343
|
"SENTRY_DSN",
|
|
@@ -1342,18 +1351,20 @@ const SERVICE_ENV = [
|
|
|
1342
1351
|
"TYPESAFE_API_KEY",
|
|
1343
1352
|
"PORT",
|
|
1344
1353
|
"EGRESS_IPS",
|
|
1354
|
+
"TRUSTED_PROXY_NETWORKS",
|
|
1345
1355
|
...LOG_ENV,
|
|
1346
1356
|
...OBSERVABILITY_ENV,
|
|
1347
1357
|
...AGENT_RUNNER_ENV,
|
|
1348
1358
|
...PAYMENTS_ENV,
|
|
1349
1359
|
...IDENTITY_ENV,
|
|
1350
|
-
...TRAFFIC_ENV
|
|
1360
|
+
...TRAFFIC_ENV,
|
|
1361
|
+
...WEB_HARNESSES_ENV
|
|
1351
1362
|
];
|
|
1352
1363
|
const isDatabaseVariable = (name) => DATABASE_ENV.some((databaseName) => databaseName === name);
|
|
1353
1364
|
SERVICE_ENV.flatMap((name) => isSecret(name) && !isDatabaseVariable(name) ? [name] : []);
|
|
1354
1365
|
const readEnv = (...names) => Config.schema(Env.mapFields(Struct.pick(names)));
|
|
1355
1366
|
// package.json
|
|
1356
|
-
var version = "0.
|
|
1367
|
+
var version = "0.16.0";
|
|
1357
1368
|
// src/connections.ts
|
|
1358
1369
|
const encodeConnection = Schema.encodeEffect(Schema.fromJsonString(Connection, { space: 2 }));
|
|
1359
1370
|
const encodeConnections = Schema.encodeEffect(Schema.fromJsonString(List(Connection), { space: 2 }));
|
|
@@ -1788,7 +1799,7 @@ const follow = Command.make("follow", {
|
|
|
1788
1799
|
lastSeen = Option.orElse(yield* followOnce(lastSeen), () => lastSeen);
|
|
1789
1800
|
const run = yield* client.runs.get({ params: { id } });
|
|
1790
1801
|
if (run.status !== "ended") continue;
|
|
1791
|
-
if (run.end_reason === "
|
|
1802
|
+
if (run.end_reason === "finished" || run.end_reason === "idle_timeout") return;
|
|
1792
1803
|
return yield* new RunUnfinished({
|
|
1793
1804
|
id,
|
|
1794
1805
|
endReason: run.end_reason
|