veryfront 0.1.877 → 0.1.878
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/esm/deno.js +1 -1
- package/esm/src/eval/agent-service/durable-run-canaries/cli-runner.d.ts +21 -0
- package/esm/src/eval/agent-service/durable-run-canaries/cli-runner.d.ts.map +1 -0
- package/esm/src/eval/agent-service/durable-run-canaries/cli-runner.js +66 -0
- package/esm/src/eval/agent-service/durable-run-canaries/environment.d.ts +14 -0
- package/esm/src/eval/agent-service/durable-run-canaries/environment.d.ts.map +1 -0
- package/esm/src/eval/agent-service/durable-run-canaries/environment.js +15 -0
- package/esm/src/eval/agent-service/durable-run-canaries/index.d.ts +5 -0
- package/esm/src/eval/agent-service/durable-run-canaries/index.d.ts.map +1 -0
- package/esm/src/eval/agent-service/durable-run-canaries/index.js +4 -0
- package/esm/src/eval/agent-service/durable-run-canaries/runner.d.ts +118 -0
- package/esm/src/eval/agent-service/durable-run-canaries/runner.d.ts.map +1 -0
- package/esm/src/eval/agent-service/durable-run-canaries/runner.js +391 -0
- package/esm/src/eval/agent-service/durable-run-canaries/validation.d.ts +12 -0
- package/esm/src/eval/agent-service/durable-run-canaries/validation.d.ts.map +1 -0
- package/esm/src/eval/agent-service/durable-run-canaries/validation.js +71 -0
- package/esm/src/eval/agent-service/live-evals/api-client.d.ts +102 -0
- package/esm/src/eval/agent-service/live-evals/api-client.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/api-client.js +313 -0
- package/esm/src/eval/agent-service/live-evals/cli-runner.d.ts +40 -0
- package/esm/src/eval/agent-service/live-evals/cli-runner.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/cli-runner.js +144 -0
- package/esm/src/eval/agent-service/live-evals/environment.d.ts +15 -0
- package/esm/src/eval/agent-service/live-evals/environment.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/environment.js +20 -0
- package/esm/src/eval/agent-service/live-evals/formatting.d.ts +15 -0
- package/esm/src/eval/agent-service/live-evals/formatting.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/formatting.js +75 -0
- package/esm/src/eval/agent-service/live-evals/index.d.ts +12 -0
- package/esm/src/eval/agent-service/live-evals/index.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/index.js +11 -0
- package/esm/src/eval/agent-service/live-evals/metadata.d.ts +34 -0
- package/esm/src/eval/agent-service/live-evals/metadata.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/metadata.js +116 -0
- package/esm/src/eval/agent-service/live-evals/performance.d.ts +19 -0
- package/esm/src/eval/agent-service/live-evals/performance.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/performance.js +22 -0
- package/esm/src/eval/agent-service/live-evals/preflight.d.ts +12 -0
- package/esm/src/eval/agent-service/live-evals/preflight.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/preflight.js +27 -0
- package/esm/src/eval/agent-service/live-evals/report.d.ts +55 -0
- package/esm/src/eval/agent-service/live-evals/report.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/report.js +79 -0
- package/esm/src/eval/agent-service/live-evals/request.d.ts +31 -0
- package/esm/src/eval/agent-service/live-evals/request.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/request.js +48 -0
- package/esm/src/eval/agent-service/live-evals/result.d.ts +56 -0
- package/esm/src/eval/agent-service/live-evals/result.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/result.js +36 -0
- package/esm/src/eval/agent-service/live-evals/runner.d.ts +135 -0
- package/esm/src/eval/agent-service/live-evals/runner.d.ts.map +1 -0
- package/esm/src/eval/agent-service/live-evals/runner.js +396 -0
- package/esm/src/eval/agent-service.d.ts +2 -0
- package/esm/src/eval/agent-service.d.ts.map +1 -1
- package/esm/src/eval/agent-service.js +2 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { mkdir, writeTextFile } from "../../../platform/compat/fs.js";
|
|
2
|
+
import { dirname, resolve } from "../../../platform/compat/path/index.js";
|
|
3
|
+
import { cwd as getProcessCwd } from "../../../platform/compat/process.js";
|
|
4
|
+
import { buildRuntimePerformanceSummary } from "./performance.js";
|
|
5
|
+
import { buildLiveEvalCaseTagSummary, buildLiveEvalRuntimeSummary, buildLiveEvalStatusSummary, resolveLiveEvalRequestedCaseIds, selectLiveEvalCases, } from "./report.js";
|
|
6
|
+
import { containsSkillLoad, countStepStartedEvents, createLiveEvalCaseSupport, hasFinished, } from "./runner.js";
|
|
7
|
+
import { getLiveEvalProjectFile } from "./api-client.js";
|
|
8
|
+
import { resolveLiveEvalEnvironment } from "./environment.js";
|
|
9
|
+
function splitCsvEnv(value) {
|
|
10
|
+
return new Set((value ?? "")
|
|
11
|
+
.split(",")
|
|
12
|
+
.map((entry) => entry.trim())
|
|
13
|
+
.filter((entry) => entry.length > 0));
|
|
14
|
+
}
|
|
15
|
+
function createTimestampedReportPath(input) {
|
|
16
|
+
return resolve(input.cwd, ".omx/logs", input.directory, `${new Date().toISOString().replaceAll(":", "-").replaceAll(".", "-")}.json`);
|
|
17
|
+
}
|
|
18
|
+
/** Run live eval cli. */
|
|
19
|
+
export async function runLiveEvalCli(input) {
|
|
20
|
+
const log = input.log ?? console.log;
|
|
21
|
+
const error = input.error ?? console.error;
|
|
22
|
+
const cwd = input.cwd ?? getProcessCwd();
|
|
23
|
+
const { endpoint, authToken, apiUrl, projectId, branchId, model } = resolveLiveEvalEnvironment(input.env);
|
|
24
|
+
const requestedRuntimeSelection = input.runtimes ?? ["framework"];
|
|
25
|
+
const runWriteEvals = input.env.AG_UI_EVAL_WRITE === "1";
|
|
26
|
+
const runExperimentalWriteEvals = input.env.AG_UI_EVAL_EXPERIMENTAL === "1";
|
|
27
|
+
const requestTimeoutMs = Number(input.env.AG_UI_EVAL_TIMEOUT_MS ?? "240000");
|
|
28
|
+
const progressLogIntervalMs = Number(input.env.AG_UI_EVAL_PROGRESS_MS ?? "15000");
|
|
29
|
+
const reportPath = input.env.AG_UI_EVAL_REPORT_PATH ??
|
|
30
|
+
createTimestampedReportPath({ cwd, directory: "ag-ui-live-evals" });
|
|
31
|
+
const requestedCaseIds = splitCsvEnv(input.env.AG_UI_EVAL_CASES);
|
|
32
|
+
const requestedCaseTags = splitCsvEnv(input.env.AG_UI_EVAL_TAGS);
|
|
33
|
+
const requestedCaseSetId = input.env.AG_UI_EVAL_CASE_SET?.trim() || null;
|
|
34
|
+
const enableLlmJudge = input.env.AG_UI_EVAL_LLM_JUDGE === "1";
|
|
35
|
+
const apiContext = {
|
|
36
|
+
apiUrl,
|
|
37
|
+
authToken,
|
|
38
|
+
projectId: projectId ?? null,
|
|
39
|
+
};
|
|
40
|
+
const createCaseSupport = input.createCaseSupport ?? createLiveEvalCaseSupport;
|
|
41
|
+
const { judgeLlm, runEval, verifyFileExists, withJudge } = createCaseSupport({
|
|
42
|
+
endpoint,
|
|
43
|
+
authToken,
|
|
44
|
+
apiUrl,
|
|
45
|
+
projectId: projectId ?? null,
|
|
46
|
+
branchId: branchId ?? null,
|
|
47
|
+
model: model ?? null,
|
|
48
|
+
requestTimeoutMs,
|
|
49
|
+
progressLogIntervalMs,
|
|
50
|
+
enableLlmJudge,
|
|
51
|
+
readProjectFile: (readerInput) => getLiveEvalProjectFile(apiContext, readerInput),
|
|
52
|
+
});
|
|
53
|
+
const { readOnlyCases, writeCases, experimentalWriteCases } = input.createCases({
|
|
54
|
+
authToken,
|
|
55
|
+
endpoint,
|
|
56
|
+
projectId: projectId ?? null,
|
|
57
|
+
branchId: branchId ?? null,
|
|
58
|
+
model: model ?? null,
|
|
59
|
+
requestTimeoutMs,
|
|
60
|
+
enableLlmJudge,
|
|
61
|
+
hasFinished,
|
|
62
|
+
containsSkillLoad,
|
|
63
|
+
countStepStartedEvents,
|
|
64
|
+
verifyFileExists,
|
|
65
|
+
withJudge,
|
|
66
|
+
judgeLlm,
|
|
67
|
+
});
|
|
68
|
+
if (authToken.length === 0) {
|
|
69
|
+
error("Missing VERYFRONT_TOKEN");
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
log(`AG-UI live evals -> ${endpoint}`);
|
|
73
|
+
log(`Veryfront API -> ${apiUrl}`);
|
|
74
|
+
log(`Project scope -> ${projectId ?? "none"}`);
|
|
75
|
+
log(`Runtime -> ${requestedRuntimeSelection.join(", ")}`);
|
|
76
|
+
log(`Write evals -> ${runWriteEvals ? "enabled" : "disabled"}`);
|
|
77
|
+
log(`Experimental evals -> ${runExperimentalWriteEvals ? "enabled" : "disabled"}`);
|
|
78
|
+
log(`Case set -> ${requestedCaseSetId ?? "none"}`);
|
|
79
|
+
log(`Case tags -> ${requestedCaseTags.size > 0 ? [...requestedCaseTags].join(", ") : "none"}`);
|
|
80
|
+
const allCases = [...readOnlyCases, ...writeCases, ...experimentalWriteCases];
|
|
81
|
+
const resolvedRequestedCaseIds = resolveLiveEvalRequestedCaseIds({
|
|
82
|
+
caseSets: input.caseSets,
|
|
83
|
+
requestedCaseIds,
|
|
84
|
+
requestedCaseSetId,
|
|
85
|
+
});
|
|
86
|
+
const cases = selectLiveEvalCases({
|
|
87
|
+
allCases,
|
|
88
|
+
readOnlyCases,
|
|
89
|
+
writeCases,
|
|
90
|
+
experimentalWriteCases,
|
|
91
|
+
requestedCaseIds: resolvedRequestedCaseIds,
|
|
92
|
+
requestedCaseTags,
|
|
93
|
+
runWriteEvals,
|
|
94
|
+
runExperimentalWriteEvals,
|
|
95
|
+
});
|
|
96
|
+
const selectedCaseTagSummary = buildLiveEvalCaseTagSummary(cases);
|
|
97
|
+
if (cases.length === 0) {
|
|
98
|
+
error("No eval cases selected.");
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
const results = [];
|
|
102
|
+
for (const runtime of requestedRuntimeSelection) {
|
|
103
|
+
log(`\n[runtime] ${runtime}`);
|
|
104
|
+
for (const testCase of cases) {
|
|
105
|
+
log(`\n[run] ${runtime} :: ${testCase.label}`);
|
|
106
|
+
const result = await runEval(testCase, runtime);
|
|
107
|
+
results.push(result);
|
|
108
|
+
log(`[${runtime}] [${result.status}] ${result.details}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const summary = buildLiveEvalStatusSummary(results);
|
|
112
|
+
const runtimeSummary = buildLiveEvalRuntimeSummary(requestedRuntimeSelection, results);
|
|
113
|
+
const runtimePerformanceSummary = buildRuntimePerformanceSummary(results);
|
|
114
|
+
log("\nSummary");
|
|
115
|
+
log(`passed: ${summary.passed}`);
|
|
116
|
+
log(`failed: ${summary.failed}`);
|
|
117
|
+
log(`skipped: ${summary.skipped}`);
|
|
118
|
+
for (const runtime of requestedRuntimeSelection) {
|
|
119
|
+
const currentRuntimeSummary = runtimeSummary[runtime];
|
|
120
|
+
log(`${runtime}: passed=${currentRuntimeSummary.passed} failed=${currentRuntimeSummary.failed} skipped=${currentRuntimeSummary.skipped}`);
|
|
121
|
+
const performance = runtimePerformanceSummary[runtime];
|
|
122
|
+
log(`${runtime}: avg=${performance.avgDurationMs}ms p50=${performance.p50DurationMs}ms p95=${performance.p95DurationMs}ms min=${performance.minDurationMs}ms max=${performance.maxDurationMs}ms`);
|
|
123
|
+
}
|
|
124
|
+
await mkdir(dirname(reportPath), { recursive: true });
|
|
125
|
+
await writeTextFile(reportPath, JSON.stringify({
|
|
126
|
+
generatedAt: new Date().toISOString(),
|
|
127
|
+
endpoint,
|
|
128
|
+
apiUrl,
|
|
129
|
+
projectId: projectId ?? null,
|
|
130
|
+
runtimes: requestedRuntimeSelection,
|
|
131
|
+
writeEvals: runWriteEvals,
|
|
132
|
+
requestedCaseIds: [...resolvedRequestedCaseIds],
|
|
133
|
+
requestedCaseTags: [...requestedCaseTags],
|
|
134
|
+
requestedCaseSetId,
|
|
135
|
+
caseMetadata: Object.fromEntries(cases.map((testCase) => [testCase.id, testCase.metadata ?? { tags: [] }])),
|
|
136
|
+
selectedCaseTagSummary,
|
|
137
|
+
results,
|
|
138
|
+
summary,
|
|
139
|
+
runtimeSummary,
|
|
140
|
+
runtimePerformanceSummary,
|
|
141
|
+
}, null, 2));
|
|
142
|
+
log(`report: ${reportPath}`);
|
|
143
|
+
return summary.failed > 0 ? 1 : 0;
|
|
144
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentServiceConfigInput } from "../../../agent/service/config.js";
|
|
2
|
+
/** Public API contract for live eval environment. */
|
|
3
|
+
export interface LiveEvalEnvironment {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
authToken: string;
|
|
6
|
+
apiUrl: string;
|
|
7
|
+
projectId: string | undefined;
|
|
8
|
+
branchId: string | undefined;
|
|
9
|
+
model: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** Default value for live eval endpoint. */
|
|
12
|
+
export declare const DEFAULT_LIVE_EVAL_ENDPOINT = "http://127.0.0.1:3001/api/ag-ui";
|
|
13
|
+
/** Resolves live eval environment. */
|
|
14
|
+
export declare function resolveLiveEvalEnvironment(env?: AgentServiceConfigInput): LiveEvalEnvironment;
|
|
15
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,kCAAkC,CAAC;AAE1C,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,4CAA4C;AAC5C,eAAO,MAAM,0BAA0B,oCAAoC,CAAC;AAE5E,sCAAsC;AACtC,wBAAgB,0BAA0B,CACxC,GAAG,GAAE,uBAA4B,GAChC,mBAAmB,CAerB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { parseAgentServiceConfig, } from "../../../agent/service/config.js";
|
|
2
|
+
/** Default value for live eval endpoint. */
|
|
3
|
+
export const DEFAULT_LIVE_EVAL_ENDPOINT = "http://127.0.0.1:3001/api/ag-ui";
|
|
4
|
+
/** Resolves live eval environment. */
|
|
5
|
+
export function resolveLiveEvalEnvironment(env = {}) {
|
|
6
|
+
return {
|
|
7
|
+
endpoint: typeof env.AG_UI_EVAL_ENDPOINT === "string"
|
|
8
|
+
? env.AG_UI_EVAL_ENDPOINT
|
|
9
|
+
: DEFAULT_LIVE_EVAL_ENDPOINT,
|
|
10
|
+
authToken: typeof env.VERYFRONT_TOKEN === "string" ? env.VERYFRONT_TOKEN : "",
|
|
11
|
+
apiUrl: typeof env.VERYFRONT_API_URL === "string"
|
|
12
|
+
? env.VERYFRONT_API_URL
|
|
13
|
+
: parseAgentServiceConfig(env).VERYFRONT_API_URL,
|
|
14
|
+
projectId: typeof env.AG_UI_EVAL_PROJECT_ID === "string"
|
|
15
|
+
? env.AG_UI_EVAL_PROJECT_ID
|
|
16
|
+
: undefined,
|
|
17
|
+
branchId: typeof env.AG_UI_EVAL_BRANCH_ID === "string" ? env.AG_UI_EVAL_BRANCH_ID : undefined,
|
|
18
|
+
model: typeof env.AG_UI_EVAL_MODEL === "string" ? env.AG_UI_EVAL_MODEL : undefined,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import type { AgUiSseProgressSnapshot as EvalProgressSnapshot } from "../../../agent/index.js";
|
|
3
|
+
/** Create plain text pdf. */
|
|
4
|
+
export declare function createPlainTextPdf(lines: string[]): Buffer;
|
|
5
|
+
/** Builds progress line. */
|
|
6
|
+
export declare function buildProgressLine(input: {
|
|
7
|
+
caseId: string;
|
|
8
|
+
startedAt: number;
|
|
9
|
+
progress: EvalProgressSnapshot;
|
|
10
|
+
}): string;
|
|
11
|
+
/** Builds failure suffix. */
|
|
12
|
+
export declare function buildFailureSuffix(progress: EvalProgressSnapshot): string;
|
|
13
|
+
/** Contains ordered subsequence helper. */
|
|
14
|
+
export declare function containsOrderedSubsequence(haystack: string[], needle: string[]): boolean;
|
|
15
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,uBAAuB,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAS/F,6BAA6B;AAC7B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CA4C1D;AAED,4BAA4B;AAC5B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC;CAChC,GAAG,MAAM,CAcT;AAED,6BAA6B;AAC7B,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAUzE;AAED,2CAA2C;AAC3C,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAAE,EAClB,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAcT"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
function escapePdfText(input) {
|
|
3
|
+
return input.replaceAll("\\", "\\\\").replaceAll("(", "\\(").replaceAll(")", "\\)");
|
|
4
|
+
}
|
|
5
|
+
/** Create plain text pdf. */
|
|
6
|
+
export function createPlainTextPdf(lines) {
|
|
7
|
+
const contentLines = [
|
|
8
|
+
"BT",
|
|
9
|
+
"/F1 18 Tf",
|
|
10
|
+
"72 720 Td",
|
|
11
|
+
`(${escapePdfText(lines[0] ?? "Untitled")}) Tj`,
|
|
12
|
+
"/F1 12 Tf",
|
|
13
|
+
...lines.slice(1).flatMap((line) => ["0 -20 Td", `(${escapePdfText(line)}) Tj`]),
|
|
14
|
+
"ET",
|
|
15
|
+
];
|
|
16
|
+
const contentStream = contentLines.join("\n");
|
|
17
|
+
const objects = [
|
|
18
|
+
"<< /Type /Catalog /Pages 2 0 R >>",
|
|
19
|
+
"<< /Type /Pages /Kids [3 0 R] /Count 1 >>",
|
|
20
|
+
"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>",
|
|
21
|
+
`<< /Length ${Buffer.byteLength(contentStream, "utf8")} >>\nstream\n${contentStream}\nendstream`,
|
|
22
|
+
"<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>",
|
|
23
|
+
];
|
|
24
|
+
let pdf = "%PDF-1.4\n";
|
|
25
|
+
const offsets = [0];
|
|
26
|
+
objects.forEach((objectBody, index) => {
|
|
27
|
+
offsets.push(Buffer.byteLength(pdf, "utf8"));
|
|
28
|
+
pdf += `${index + 1} 0 obj\n${objectBody}\nendobj\n`;
|
|
29
|
+
});
|
|
30
|
+
const xrefOffset = Buffer.byteLength(pdf, "utf8");
|
|
31
|
+
pdf += `xref\n0 ${objects.length + 1}\n`;
|
|
32
|
+
pdf += "0000000000 65535 f \n";
|
|
33
|
+
offsets.slice(1).forEach((offset) => {
|
|
34
|
+
pdf += `${offset.toString().padStart(10, "0")} 00000 n \n`;
|
|
35
|
+
});
|
|
36
|
+
pdf += `trailer\n<< /Root 1 0 R /Size ${objects.length + 1} >>\nstartxref\n${xrefOffset}\n%%EOF\n`;
|
|
37
|
+
return Buffer.from(pdf, "utf8");
|
|
38
|
+
}
|
|
39
|
+
/** Builds progress line. */
|
|
40
|
+
export function buildProgressLine(input) {
|
|
41
|
+
const elapsedSeconds = Math.max(1, Math.round((Date.now() - input.startedAt) / 1000));
|
|
42
|
+
const lastEvent = input.progress.lastEventType ?? "none";
|
|
43
|
+
const lastTool = input.progress.lastToolCallName
|
|
44
|
+
? ` tool=${input.progress.lastToolCallName}`
|
|
45
|
+
: "";
|
|
46
|
+
const toolSummary = input.progress.toolStarts.length > 0
|
|
47
|
+
? ` tools=${input.progress.toolStarts.join(",")}`
|
|
48
|
+
: "";
|
|
49
|
+
const textSummary = input.progress.textLength > 0 ? ` text=${input.progress.textLength}ch` : "";
|
|
50
|
+
return `[progress] ${input.caseId} ${elapsedSeconds}s events=${input.progress.eventCount} last=${lastEvent}${lastTool}${toolSummary}${textSummary}`;
|
|
51
|
+
}
|
|
52
|
+
/** Builds failure suffix. */
|
|
53
|
+
export function buildFailureSuffix(progress) {
|
|
54
|
+
const details = [
|
|
55
|
+
`events=${progress.eventCount}`,
|
|
56
|
+
`last=${progress.lastEventType ?? "none"}`,
|
|
57
|
+
progress.lastToolCallName ? `tool=${progress.lastToolCallName}` : null,
|
|
58
|
+
progress.toolStarts.length > 0 ? `tools=${progress.toolStarts.join(",")}` : null,
|
|
59
|
+
progress.textLength > 0 ? `text=${progress.textLength}ch` : null,
|
|
60
|
+
].filter((value) => value !== null);
|
|
61
|
+
return details.length > 0 ? ` Progress: ${details.join(" ")}` : "";
|
|
62
|
+
}
|
|
63
|
+
/** Contains ordered subsequence helper. */
|
|
64
|
+
export function containsOrderedSubsequence(haystack, needle) {
|
|
65
|
+
let cursor = 0;
|
|
66
|
+
for (const value of haystack) {
|
|
67
|
+
if (value === needle[cursor]) {
|
|
68
|
+
cursor += 1;
|
|
69
|
+
}
|
|
70
|
+
if (cursor === needle.length) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return cursor === needle.length;
|
|
75
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { type LiveEvalCliCaseFactoryInput, type LiveEvalCliCaseGroups, runLiveEvalCli, type RunLiveEvalCliInput, } from "./cli-runner.js";
|
|
2
|
+
export { DEFAULT_LIVE_EVAL_ENDPOINT, type LiveEvalEnvironment, resolveLiveEvalEnvironment, } from "./environment.js";
|
|
3
|
+
export { cancelLiveEvalInputRequest, createLiveEvalApiClient, createLiveEvalConversation, createLiveEvalProjectUploadFixture, createLiveEvalRelease, deleteLiveEvalConversation, deleteLiveEvalProjectFile, getLiveEvalProjectFile, listOpenLiveEvalInputRequests, type LiveEvalApiClient, type LiveEvalApiContext, type LiveEvalConversationInput, type LiveEvalCreateConversationInput, type LiveEvalCreateReleaseInput, type LiveEvalInputRequestInput, type LiveEvalInputRequestRecord, type LiveEvalInputResponseValues, type LiveEvalProjectFileInput, type LiveEvalProjectUploadFixtureInput, type LiveEvalRequestTimeoutInput, type LiveEvalSubmitInputResponseInput, type LiveEvalWaitForOpenInputRequestInput, submitLiveEvalInputResponse, waitForOpenLiveEvalInputRequest, } from "./api-client.js";
|
|
4
|
+
export { buildFailureSuffix, buildProgressLine, containsOrderedSubsequence, createPlainTextPdf, } from "./formatting.js";
|
|
5
|
+
export { evaluateRuntimeConfidenceEnv, printRuntimeConfidencePreflight, type RuntimeConfidencePreflightResult, } from "./preflight.js";
|
|
6
|
+
export { buildRuntimePerformanceSummary, type LiveEvalResultForPerformance, type LiveEvalRuntime, type RuntimePerformanceSummary, } from "./performance.js";
|
|
7
|
+
export { buildLiveEvalCaseMetadata, type BuildLiveEvalCaseMetadataInput, DEFAULT_LIVE_EVAL_AREA_TAG_RULES, DEFAULT_LIVE_EVAL_OPTIONAL_JUDGE_CASE_PREFIXES, type LiveEvalCaseMetadataOptions, type LiveEvalCaseSurface, type LiveEvalCaseTagRule, withLiveEvalMetadata, } from "./metadata.js";
|
|
8
|
+
export { buildLiveEvalRequestBody, type BuildLiveEvalRequestBodyInput, type LiveEvalRequestBody, } from "./request.js";
|
|
9
|
+
export { buildLiveEvalCaseTagSummary, buildLiveEvalRuntimeSummary, buildLiveEvalStatusSummary, hasEveryLiveEvalTag, type LiveEvalCaseMetadata, type LiveEvalCaseSelectionInput, type LiveEvalResultForReport, resolveLiveEvalRequestedCaseIds, selectLiveEvalCases, } from "./report.js";
|
|
10
|
+
export { createFailedEvalResult, createPassedEvalResult, createSkippedEvalResult, type LiveEvalResultRecord, } from "./result.js";
|
|
11
|
+
export { containsSkillLoad, countStepStartedEvents, createLiveEvalCaseSupport, hasFinished, type LiveEvalCase, type LiveEvalContext, type LiveEvalProjectFile, type LiveEvalProjectFileReaderInput, type LiveEvalRunnerConfig, liveEvalRunnerInternals, type PreparedLiveEvalInput, } from "./runner.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,kCAAkC,EAClC,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,oCAAoC,EACzC,2BAA2B,EAC3B,+BAA+B,GAChC,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} from "./environment.js";
|
|
3
|
+
export { cancelLiveEvalInputRequest, createLiveEvalApiClient, createLiveEvalConversation, createLiveEvalProjectUploadFixture, createLiveEvalRelease, deleteLiveEvalConversation, deleteLiveEvalProjectFile, getLiveEvalProjectFile, listOpenLiveEvalInputRequests, submitLiveEvalInputResponse, waitForOpenLiveEvalInputRequest, } from "./api-client.js";
|
|
4
|
+
export { buildFailureSuffix, buildProgressLine, containsOrderedSubsequence, createPlainTextPdf, } from "./formatting.js";
|
|
5
|
+
export { evaluateRuntimeConfidenceEnv, printRuntimeConfidencePreflight, } from "./preflight.js";
|
|
6
|
+
export { buildRuntimePerformanceSummary, } from "./performance.js";
|
|
7
|
+
export { buildLiveEvalCaseMetadata, DEFAULT_LIVE_EVAL_AREA_TAG_RULES, DEFAULT_LIVE_EVAL_OPTIONAL_JUDGE_CASE_PREFIXES, withLiveEvalMetadata, } from "./metadata.js";
|
|
8
|
+
export { buildLiveEvalRequestBody, } from "./request.js";
|
|
9
|
+
export { buildLiveEvalCaseTagSummary, buildLiveEvalRuntimeSummary, buildLiveEvalStatusSummary, hasEveryLiveEvalTag, resolveLiveEvalRequestedCaseIds, selectLiveEvalCases, } from "./report.js";
|
|
10
|
+
export { createFailedEvalResult, createPassedEvalResult, createSkippedEvalResult, } from "./result.js";
|
|
11
|
+
export { containsSkillLoad, countStepStartedEvents, createLiveEvalCaseSupport, hasFinished, liveEvalRunnerInternals, } from "./runner.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LiveEvalCaseMetadata } from "./report.js";
|
|
2
|
+
import type { LiveEvalCase } from "./runner.js";
|
|
3
|
+
/** Public API contract for live eval case surface. */
|
|
4
|
+
export type LiveEvalCaseSurface = "read-only" | "write" | "experimental";
|
|
5
|
+
/** Public API contract for live eval case tag rule. */
|
|
6
|
+
export interface LiveEvalCaseTagRule {
|
|
7
|
+
tag: string;
|
|
8
|
+
equals?: string | readonly string[];
|
|
9
|
+
startsWith?: string | readonly string[];
|
|
10
|
+
includes?: string | readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Options accepted by live eval case metadata. */
|
|
13
|
+
export interface LiveEvalCaseMetadataOptions {
|
|
14
|
+
releaseGateCaseIds?: readonly string[] | ReadonlySet<string>;
|
|
15
|
+
optionalJudgeCasePrefixes?: readonly string[];
|
|
16
|
+
areaTagRules?: readonly LiveEvalCaseTagRule[];
|
|
17
|
+
}
|
|
18
|
+
/** Input payload for build live eval case metadata. */
|
|
19
|
+
export interface BuildLiveEvalCaseMetadataInput extends LiveEvalCaseMetadataOptions {
|
|
20
|
+
caseId: string;
|
|
21
|
+
surface: LiveEvalCaseSurface;
|
|
22
|
+
requireProject: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Default value for live eval optional judge case prefixes. */
|
|
25
|
+
export declare const DEFAULT_LIVE_EVAL_OPTIONAL_JUDGE_CASE_PREFIXES: readonly string[];
|
|
26
|
+
/** Default value for live eval area tag rules. */
|
|
27
|
+
export declare const DEFAULT_LIVE_EVAL_AREA_TAG_RULES: readonly LiveEvalCaseTagRule[];
|
|
28
|
+
/** Builds live eval case metadata. */
|
|
29
|
+
export declare function buildLiveEvalCaseMetadata(input: BuildLiveEvalCaseMetadataInput): LiveEvalCaseMetadata;
|
|
30
|
+
/** Applies live eval metadata. */
|
|
31
|
+
export declare function withLiveEvalMetadata<TCase extends LiveEvalCase>(cases: readonly TCase[], surface: LiveEvalCaseSurface, options?: LiveEvalCaseMetadataOptions): Array<TCase & {
|
|
32
|
+
metadata: LiveEvalCaseMetadata;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAA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@
|
|
|
1
|
+
/** Default value for live eval optional judge case prefixes. */
|
|
2
|
+
export const DEFAULT_LIVE_EVAL_OPTIONAL_JUDGE_CASE_PREFIXES = [
|
|
3
|
+
"knowledge-",
|
|
4
|
+
"grounded-",
|
|
5
|
+
"judged-",
|
|
6
|
+
];
|
|
7
|
+
/** Default value for live eval area tag rules. */
|
|
8
|
+
export const DEFAULT_LIVE_EVAL_AREA_TAG_RULES = [
|
|
9
|
+
{ startsWith: "starter-", tag: "area:starter-routing" },
|
|
10
|
+
{ startsWith: "starter-task-", tag: "area:starter-artifact-flow" },
|
|
11
|
+
{ startsWith: "starter-", tag: "behavior:conversation-first" },
|
|
12
|
+
{ startsWith: "workflow-", tag: "area:workflow" },
|
|
13
|
+
{ startsWith: "platform-", tag: "area:platform" },
|
|
14
|
+
{ startsWith: "security-", tag: "area:security" },
|
|
15
|
+
{ startsWith: ["knowledge-", "grounded-", "judged-"], tag: "area:knowledge" },
|
|
16
|
+
{ startsWith: "tool-truthfulness", tag: "area:tool-truthfulness" },
|
|
17
|
+
{ startsWith: "degraded-", tag: "area:resilience" },
|
|
18
|
+
{ equals: "error-recovery-missing-file", tag: "area:resilience" },
|
|
19
|
+
{ includes: "deploy", tag: "area:deployment" },
|
|
20
|
+
{ includes: "sandbox", tag: "area:sandbox" },
|
|
21
|
+
{ includes: "debug", tag: "area:debugging" },
|
|
22
|
+
{ includes: "operate", tag: "area:operations" },
|
|
23
|
+
{ includes: "research", tag: "area:research" },
|
|
24
|
+
{ includes: "knowledge", tag: "area:knowledge-lifecycle" },
|
|
25
|
+
{ includes: "agent", tag: "area:agent-authoring" },
|
|
26
|
+
{ includes: "form-input", tag: "area:interactive-input" },
|
|
27
|
+
{ includes: ["invoke-agent", "delegation"], tag: "area:delegation" },
|
|
28
|
+
{ includes: ["create-page", "create-api-route", "create-skill"], tag: "area:file-generation" },
|
|
29
|
+
];
|
|
30
|
+
function toStringArray(value) {
|
|
31
|
+
if (!value) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return typeof value === "string" ? [value] : value;
|
|
35
|
+
}
|
|
36
|
+
function caseIdCollectionHas(collection, caseId) {
|
|
37
|
+
if (!collection) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if ("has" in collection) {
|
|
41
|
+
return collection.has(caseId);
|
|
42
|
+
}
|
|
43
|
+
return collection.includes(caseId);
|
|
44
|
+
}
|
|
45
|
+
function matchesTagRule(caseId, rule) {
|
|
46
|
+
for (const value of toStringArray(rule.equals)) {
|
|
47
|
+
if (caseId === value) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
for (const value of toStringArray(rule.startsWith)) {
|
|
52
|
+
if (caseId.startsWith(value)) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
for (const value of toStringArray(rule.includes)) {
|
|
57
|
+
if (caseId.includes(value)) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
function isOptionalJudgeCase(caseId, prefixes) {
|
|
64
|
+
return prefixes.some((prefix) => caseId.startsWith(prefix));
|
|
65
|
+
}
|
|
66
|
+
function buildAreaTags(caseId, rules) {
|
|
67
|
+
const tags = new Set();
|
|
68
|
+
for (const rule of rules) {
|
|
69
|
+
if (matchesTagRule(caseId, rule)) {
|
|
70
|
+
tags.add(rule.tag);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return [...tags];
|
|
74
|
+
}
|
|
75
|
+
/** Builds live eval case metadata. */
|
|
76
|
+
export function buildLiveEvalCaseMetadata(input) {
|
|
77
|
+
const optionalJudgeCasePrefixes = input.optionalJudgeCasePrefixes ??
|
|
78
|
+
DEFAULT_LIVE_EVAL_OPTIONAL_JUDGE_CASE_PREFIXES;
|
|
79
|
+
const areaTagRules = input.areaTagRules ?? DEFAULT_LIVE_EVAL_AREA_TAG_RULES;
|
|
80
|
+
const gradingTag = isOptionalJudgeCase(input.caseId, optionalJudgeCasePrefixes)
|
|
81
|
+
? "grading:deterministic-plus-optional-llm"
|
|
82
|
+
: "grading:deterministic-only";
|
|
83
|
+
const tags = new Set([
|
|
84
|
+
`surface:${input.surface}`,
|
|
85
|
+
input.requireProject ? "project:required" : "project:optional",
|
|
86
|
+
input.surface === "experimental" ? "stability:experimental" : "stability:stable",
|
|
87
|
+
gradingTag,
|
|
88
|
+
]);
|
|
89
|
+
if (input.surface !== "experimental") {
|
|
90
|
+
tags.add("gate:nightly");
|
|
91
|
+
}
|
|
92
|
+
if (gradingTag === "grading:deterministic-only" && input.surface !== "experimental") {
|
|
93
|
+
tags.add("gate:ci");
|
|
94
|
+
}
|
|
95
|
+
if (caseIdCollectionHas(input.releaseGateCaseIds, input.caseId)) {
|
|
96
|
+
tags.add("gate:release");
|
|
97
|
+
}
|
|
98
|
+
for (const tag of buildAreaTags(input.caseId, areaTagRules)) {
|
|
99
|
+
tags.add(tag);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
tags: [...tags].sort(),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** Applies live eval metadata. */
|
|
106
|
+
export function withLiveEvalMetadata(cases, surface, options = {}) {
|
|
107
|
+
return cases.map((testCase) => ({
|
|
108
|
+
...testCase,
|
|
109
|
+
metadata: buildLiveEvalCaseMetadata({
|
|
110
|
+
...options,
|
|
111
|
+
caseId: testCase.id,
|
|
112
|
+
surface,
|
|
113
|
+
requireProject: testCase.requireProject === true,
|
|
114
|
+
}),
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Public API contract for live eval runtime. */
|
|
2
|
+
export type LiveEvalRuntime = "framework";
|
|
3
|
+
/** Public API contract for live eval result for performance. */
|
|
4
|
+
export interface LiveEvalResultForPerformance {
|
|
5
|
+
runtime: LiveEvalRuntime;
|
|
6
|
+
durationMs: number;
|
|
7
|
+
}
|
|
8
|
+
/** Public API contract for runtime performance summary. */
|
|
9
|
+
export interface RuntimePerformanceSummary {
|
|
10
|
+
count: number;
|
|
11
|
+
avgDurationMs: number;
|
|
12
|
+
p50DurationMs: number;
|
|
13
|
+
p95DurationMs: number;
|
|
14
|
+
minDurationMs: number;
|
|
15
|
+
maxDurationMs: number;
|
|
16
|
+
}
|
|
17
|
+
/** Builds runtime performance summary. */
|
|
18
|
+
export declare function buildRuntimePerformanceSummary(results: LiveEvalResultForPerformance[]): Record<LiveEvalRuntime, RuntimePerformanceSummary>;
|
|
19
|
+
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/performance.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C,gEAAgE;AAChE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,eAAe,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAkBD,0CAA0C;AAC1C,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,4BAA4B,EAAE,GACtC,MAAM,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAiBpD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function calculateDurationPercentile(sortedDurations, percentile) {
|
|
2
|
+
if (sortedDurations.length === 0) {
|
|
3
|
+
return 0;
|
|
4
|
+
}
|
|
5
|
+
const index = Math.min(sortedDurations.length - 1, Math.max(0, Math.ceil((percentile / 100) * sortedDurations.length) - 1));
|
|
6
|
+
return sortedDurations[index] ?? 0;
|
|
7
|
+
}
|
|
8
|
+
/** Builds runtime performance summary. */
|
|
9
|
+
export function buildRuntimePerformanceSummary(results) {
|
|
10
|
+
const durations = results.map((result) => result.durationMs).sort((left, right) => left - right);
|
|
11
|
+
const totalDuration = durations.reduce((sum, value) => sum + value, 0);
|
|
12
|
+
return {
|
|
13
|
+
framework: {
|
|
14
|
+
count: durations.length,
|
|
15
|
+
avgDurationMs: durations.length > 0 ? Math.round(totalDuration / durations.length) : 0,
|
|
16
|
+
p50DurationMs: calculateDurationPercentile(durations, 50),
|
|
17
|
+
p95DurationMs: calculateDurationPercentile(durations, 95),
|
|
18
|
+
minDurationMs: durations[0] ?? 0,
|
|
19
|
+
maxDurationMs: durations.at(-1) ?? 0,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AgentServiceConfigInput } from "../../../agent/service/config.js";
|
|
2
|
+
/** Result returned from runtime confidence preflight. */
|
|
3
|
+
export interface RuntimeConfidencePreflightResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
resolvedApiUrl: string;
|
|
6
|
+
messages: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Evaluate runtime confidence env helper. */
|
|
9
|
+
export declare function evaluateRuntimeConfidenceEnv(env?: AgentServiceConfigInput, resolvedApiUrl?: string): RuntimeConfidencePreflightResult;
|
|
10
|
+
/** Print runtime confidence preflight helper. */
|
|
11
|
+
export declare function printRuntimeConfidencePreflight(result: RuntimeConfidencePreflightResult, output?: Pick<Console, "error" | "log">): void;
|
|
12
|
+
//# sourceMappingURL=preflight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,kCAAkC,CAAC;AAE1C,yDAAyD;AACzD,MAAM,WAAW,gCAAgC;IAC/C,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,8CAA8C;AAC9C,wBAAgB,4BAA4B,CAC1C,GAAG,GAAE,uBAA4B,EACjC,cAAc,GAAE,MAAuD,GACtE,gCAAgC,CAoBlC;AAED,iDAAiD;AACjD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,gCAAgC,EACxC,MAAM,GAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAAW,GAC/C,IAAI,CAKN"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { parseAgentServiceConfig, } from "../../../agent/service/config.js";
|
|
2
|
+
/** Evaluate runtime confidence env helper. */
|
|
3
|
+
export function evaluateRuntimeConfidenceEnv(env = {}, resolvedApiUrl = parseAgentServiceConfig(env).VERYFRONT_API_URL) {
|
|
4
|
+
const messages = [`Resolved VERYFRONT_API_URL: ${resolvedApiUrl}`];
|
|
5
|
+
let hasBlockers = false;
|
|
6
|
+
if (typeof env.VERYFRONT_TOKEN !== "string" || env.VERYFRONT_TOKEN.length === 0) {
|
|
7
|
+
hasBlockers = true;
|
|
8
|
+
messages.push("BLOCKER: VERYFRONT_TOKEN is missing");
|
|
9
|
+
}
|
|
10
|
+
if (typeof env.AG_UI_EVAL_PROJECT_ID !== "string" || env.AG_UI_EVAL_PROJECT_ID.length === 0) {
|
|
11
|
+
hasBlockers = true;
|
|
12
|
+
messages.push("BLOCKER: AG_UI_EVAL_PROJECT_ID is missing");
|
|
13
|
+
}
|
|
14
|
+
if (!hasBlockers) {
|
|
15
|
+
messages.push("Runtime-confidence preflight: PASS");
|
|
16
|
+
return { ok: true, resolvedApiUrl, messages };
|
|
17
|
+
}
|
|
18
|
+
messages.push("Runtime-confidence preflight: FAIL");
|
|
19
|
+
return { ok: false, resolvedApiUrl, messages };
|
|
20
|
+
}
|
|
21
|
+
/** Print runtime confidence preflight helper. */
|
|
22
|
+
export function printRuntimeConfidencePreflight(result, output = console) {
|
|
23
|
+
for (const message of result.messages) {
|
|
24
|
+
const writer = result.ok ? output.log : output.error;
|
|
25
|
+
writer(message);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { LiveEvalRuntime } from "./performance.js";
|
|
2
|
+
/** Public API contract for live eval case metadata. */
|
|
3
|
+
export interface LiveEvalCaseMetadata {
|
|
4
|
+
tags: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
/** Public API contract for live eval result for report. */
|
|
7
|
+
export interface LiveEvalResultForReport {
|
|
8
|
+
runtime: LiveEvalRuntime;
|
|
9
|
+
status: "pass" | "fail" | "skip";
|
|
10
|
+
}
|
|
11
|
+
/** Input payload for live eval case selection. */
|
|
12
|
+
export interface LiveEvalCaseSelectionInput<TCase extends {
|
|
13
|
+
id: string;
|
|
14
|
+
}> {
|
|
15
|
+
allCases: TCase[];
|
|
16
|
+
readOnlyCases: TCase[];
|
|
17
|
+
writeCases: TCase[];
|
|
18
|
+
experimentalWriteCases: TCase[];
|
|
19
|
+
requestedCaseIds: Set<string>;
|
|
20
|
+
requestedCaseTags?: Set<string>;
|
|
21
|
+
runWriteEvals: boolean;
|
|
22
|
+
runExperimentalWriteEvals: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Check whether every live eval tag is present. */
|
|
25
|
+
export declare function hasEveryLiveEvalTag(tags: readonly string[], requestedTags: Set<string>): boolean;
|
|
26
|
+
/** Builds live eval case tag summary. */
|
|
27
|
+
export declare function buildLiveEvalCaseTagSummary(cases: readonly {
|
|
28
|
+
metadata?: LiveEvalCaseMetadata;
|
|
29
|
+
}[]): Record<string, number>;
|
|
30
|
+
/** Select live eval cases helper. */
|
|
31
|
+
export declare function selectLiveEvalCases<TCase extends {
|
|
32
|
+
id: string;
|
|
33
|
+
metadata?: LiveEvalCaseMetadata;
|
|
34
|
+
}>(input: LiveEvalCaseSelectionInput<TCase>): TCase[];
|
|
35
|
+
/** Resolves live eval requested case IDs. */
|
|
36
|
+
export declare function resolveLiveEvalRequestedCaseIds(input: {
|
|
37
|
+
caseSets: Record<string, readonly string[]>;
|
|
38
|
+
requestedCaseIds: Set<string>;
|
|
39
|
+
requestedCaseSetId?: string | null;
|
|
40
|
+
}): Set<string>;
|
|
41
|
+
interface LiveEvalRuntimeCounts {
|
|
42
|
+
passed: number;
|
|
43
|
+
failed: number;
|
|
44
|
+
skipped: number;
|
|
45
|
+
}
|
|
46
|
+
/** Builds live eval runtime summary. */
|
|
47
|
+
export declare function buildLiveEvalRuntimeSummary(runtimes: readonly LiveEvalRuntime[], results: LiveEvalResultForReport[]): Record<LiveEvalRuntime, LiveEvalRuntimeCounts>;
|
|
48
|
+
/** Builds live eval status summary. */
|
|
49
|
+
export declare function buildLiveEvalStatusSummary(results: LiveEvalResultForReport[]): {
|
|
50
|
+
passed: number;
|
|
51
|
+
failed: number;
|
|
52
|
+
skipped: number;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../src/src/eval/agent-service/live-evals/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,uDAAuD;AACvD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AAED,2DAA2D;AAC3D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,kDAAkD;AAClD,MAAM,WAAW,0BAA0B,CAAC,KAAK,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;IACtE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,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