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,396 @@
|
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
|
+
import { agUiSseEventTypes, buildAgUiSseTraceSignature as buildTraceSignature, getAgUiSseStringField as getStringField, parseAgUiSseResponse as parseSseResponse, } from "../../../agent/index.js";
|
|
3
|
+
import { buildFailureSuffix, buildProgressLine, containsOrderedSubsequence } from "./formatting.js";
|
|
4
|
+
import { buildLiveEvalRequestBody } from "./request.js";
|
|
5
|
+
import { createFailedEvalResult, createPassedEvalResult, createSkippedEvalResult, } from "./result.js";
|
|
6
|
+
function resolveFetch(config) {
|
|
7
|
+
return config.fetch ?? fetch;
|
|
8
|
+
}
|
|
9
|
+
function createLiveEvalJudgeSupport(config) {
|
|
10
|
+
async function judgeLlm(input) {
|
|
11
|
+
try {
|
|
12
|
+
const body = buildLiveEvalRequestBody({
|
|
13
|
+
testCaseId: "llm-judge",
|
|
14
|
+
prompt: `You are an eval judge. Grade the following answer.
|
|
15
|
+
|
|
16
|
+
QUESTION: ${input.question}
|
|
17
|
+
|
|
18
|
+
ANSWER: ${input.answer}
|
|
19
|
+
|
|
20
|
+
CRITERIA: ${input.criteria}
|
|
21
|
+
|
|
22
|
+
Respond with exactly one line: PASS or FAIL followed by a brief reason.
|
|
23
|
+
Example: "PASS — correctly explains the pattern with accurate details"
|
|
24
|
+
Example: "FAIL — mentions the wrong file convention"`,
|
|
25
|
+
projectId: null,
|
|
26
|
+
allowedTools: [],
|
|
27
|
+
forceRuntimeOverrides: true,
|
|
28
|
+
maxSteps: 2,
|
|
29
|
+
});
|
|
30
|
+
const response = await resolveFetch(config)(config.endpoint, {
|
|
31
|
+
method: "POST",
|
|
32
|
+
headers: {
|
|
33
|
+
"Content-Type": "application/json",
|
|
34
|
+
Authorization: `Bearer ${config.authToken}`,
|
|
35
|
+
},
|
|
36
|
+
body: JSON.stringify(body),
|
|
37
|
+
signal: AbortSignal.timeout(30_000),
|
|
38
|
+
});
|
|
39
|
+
const run = await parseSseResponse(response);
|
|
40
|
+
if (run.responseStatus !== 200) {
|
|
41
|
+
return { pass: false, reason: `judge returned HTTP ${run.responseStatus}` };
|
|
42
|
+
}
|
|
43
|
+
const line = run.text
|
|
44
|
+
.split("\n")
|
|
45
|
+
.map((value) => value.trim())
|
|
46
|
+
.find((value) => value.length > 0) ?? "";
|
|
47
|
+
if (line.toUpperCase().startsWith("PASS")) {
|
|
48
|
+
return { pass: true, reason: line };
|
|
49
|
+
}
|
|
50
|
+
return { pass: false, reason: line || "judge returned no decision" };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return {
|
|
54
|
+
pass: false,
|
|
55
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function withJudge(structuralVerify, judgeInput) {
|
|
60
|
+
return async (run) => {
|
|
61
|
+
const structuralFailure = structuralVerify(run);
|
|
62
|
+
if (structuralFailure) {
|
|
63
|
+
return structuralFailure;
|
|
64
|
+
}
|
|
65
|
+
if (!config.enableLlmJudge) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const judgment = await judgeLlm({
|
|
69
|
+
question: judgeInput.question,
|
|
70
|
+
answer: run.text,
|
|
71
|
+
criteria: judgeInput.criteria,
|
|
72
|
+
});
|
|
73
|
+
return judgment.pass ? null : `LLM judge: ${judgment.reason}`;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
judgeLlm,
|
|
78
|
+
withJudge,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function createInitialProgressSnapshot() {
|
|
82
|
+
return {
|
|
83
|
+
eventCount: 0,
|
|
84
|
+
lastEventType: null,
|
|
85
|
+
lastToolCallName: null,
|
|
86
|
+
toolStarts: [],
|
|
87
|
+
textLength: 0,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function isUnrefableTimer(value) {
|
|
91
|
+
return typeof value === "object" && value !== null && "unref" in value &&
|
|
92
|
+
typeof value.unref === "function";
|
|
93
|
+
}
|
|
94
|
+
function maybeUnrefTimer(timer) {
|
|
95
|
+
if (isUnrefableTimer(timer)) {
|
|
96
|
+
timer.unref();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function createLiveEvalProgressReporter(input) {
|
|
100
|
+
let latestProgress = createInitialProgressSnapshot();
|
|
101
|
+
const progressTimer = dntShim.setInterval(() => {
|
|
102
|
+
input.log(buildProgressLine({
|
|
103
|
+
caseId: input.caseId,
|
|
104
|
+
startedAt: input.startedAt,
|
|
105
|
+
progress: latestProgress,
|
|
106
|
+
}));
|
|
107
|
+
}, input.intervalMs);
|
|
108
|
+
maybeUnrefTimer(progressTimer);
|
|
109
|
+
return {
|
|
110
|
+
stop: () => {
|
|
111
|
+
clearInterval(progressTimer);
|
|
112
|
+
},
|
|
113
|
+
update: (snapshot) => {
|
|
114
|
+
latestProgress = snapshot;
|
|
115
|
+
},
|
|
116
|
+
getSnapshot: () => latestProgress,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function collectPreparedArtifactPaths(prepared) {
|
|
120
|
+
if (!prepared?.metadata) {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
return [
|
|
124
|
+
...new Set(Object.entries(prepared.metadata)
|
|
125
|
+
.filter(([key, value]) => key.toLowerCase().includes("path") && value.length > 0)
|
|
126
|
+
.map(([, value]) => value)),
|
|
127
|
+
].sort();
|
|
128
|
+
}
|
|
129
|
+
function extractPreparedConversationId(prepared) {
|
|
130
|
+
return typeof prepared?.metadata?.conversationId === "string" &&
|
|
131
|
+
prepared.metadata.conversationId.length > 0
|
|
132
|
+
? prepared.metadata.conversationId
|
|
133
|
+
: null;
|
|
134
|
+
}
|
|
135
|
+
function createLiveEvalRunArtifacts(input) {
|
|
136
|
+
return {
|
|
137
|
+
...(input.runId ? { runId: input.runId } : {}),
|
|
138
|
+
traceSignature: input.traceSignature,
|
|
139
|
+
toolStarts: input.run.toolStarts,
|
|
140
|
+
toolArgsPreview: input.run.toolArgs.join(" | ").slice(0, 1000),
|
|
141
|
+
textPreview: input.run.text.slice(0, 280),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function createFailedRunEvalResult(input) {
|
|
145
|
+
return createFailedEvalResult({
|
|
146
|
+
id: input.context.id,
|
|
147
|
+
label: input.context.label,
|
|
148
|
+
runtime: input.context.runtime,
|
|
149
|
+
details: input.details,
|
|
150
|
+
startedAt: input.context.startedAt,
|
|
151
|
+
...(input.context.conversationId ? { conversationId: input.context.conversationId } : {}),
|
|
152
|
+
...(input.runArtifacts.runId ? { runId: input.runArtifacts.runId } : {}),
|
|
153
|
+
...(input.context.artifactPaths?.length ? { artifactPaths: input.context.artifactPaths } : {}),
|
|
154
|
+
traceSignature: input.runArtifacts.traceSignature,
|
|
155
|
+
toolStarts: input.runArtifacts.toolStarts,
|
|
156
|
+
toolArgsPreview: input.runArtifacts.toolArgsPreview,
|
|
157
|
+
textPreview: input.runArtifacts.textPreview,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function createPassedRunEvalResult(input) {
|
|
161
|
+
return createPassedEvalResult({
|
|
162
|
+
id: input.context.id,
|
|
163
|
+
label: input.context.label,
|
|
164
|
+
runtime: input.context.runtime,
|
|
165
|
+
details: input.details,
|
|
166
|
+
startedAt: input.context.startedAt,
|
|
167
|
+
...(input.context.conversationId ? { conversationId: input.context.conversationId } : {}),
|
|
168
|
+
...(input.runArtifacts.runId ? { runId: input.runArtifacts.runId } : {}),
|
|
169
|
+
...(input.context.artifactPaths?.length ? { artifactPaths: input.context.artifactPaths } : {}),
|
|
170
|
+
traceSignature: input.runArtifacts.traceSignature,
|
|
171
|
+
toolStarts: input.runArtifacts.toolStarts,
|
|
172
|
+
toolArgsPreview: input.runArtifacts.toolArgsPreview,
|
|
173
|
+
textPreview: input.runArtifacts.textPreview,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function createStreamingFailureEvalResult(input) {
|
|
177
|
+
return createFailedEvalResult({
|
|
178
|
+
id: input.context.id,
|
|
179
|
+
label: input.context.label,
|
|
180
|
+
runtime: input.context.runtime,
|
|
181
|
+
details: `${input.details}${buildFailureSuffix(input.progress)}`,
|
|
182
|
+
startedAt: input.context.startedAt,
|
|
183
|
+
...(input.context.conversationId ? { conversationId: input.context.conversationId } : {}),
|
|
184
|
+
...(input.context.artifactPaths?.length ? { artifactPaths: input.context.artifactPaths } : {}),
|
|
185
|
+
toolStarts: input.progress.toolStarts,
|
|
186
|
+
textPreview: input.progress.textLength > 0
|
|
187
|
+
? `${input.progress.textLength} characters streamed`
|
|
188
|
+
: undefined,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function createLiveEvalResultContext(input) {
|
|
192
|
+
return {
|
|
193
|
+
id: input.testCase.id,
|
|
194
|
+
label: input.testCase.label,
|
|
195
|
+
runtime: input.runtime,
|
|
196
|
+
startedAt: input.startedAt,
|
|
197
|
+
...(input.conversationId ? { conversationId: input.conversationId } : {}),
|
|
198
|
+
...(input.artifactPaths.length > 0 ? { artifactPaths: input.artifactPaths } : {}),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function buildLiveEvalRunBody(input) {
|
|
202
|
+
const customBody = typeof input.prepared?.metadata?.customBody === "string"
|
|
203
|
+
? input.prepared.metadata.customBody
|
|
204
|
+
: null;
|
|
205
|
+
if (customBody) {
|
|
206
|
+
return JSON.parse(customBody);
|
|
207
|
+
}
|
|
208
|
+
return buildLiveEvalRequestBody({
|
|
209
|
+
testCaseId: input.testCase.id,
|
|
210
|
+
prompt: input.prepared?.prompt ?? input.testCase.prompt ?? "",
|
|
211
|
+
metadata: input.prepared?.metadata,
|
|
212
|
+
projectId: input.config.projectId && input.testCase.requireProject
|
|
213
|
+
? input.config.projectId
|
|
214
|
+
: null,
|
|
215
|
+
...(input.config.branchId ? { branchId: input.config.branchId } : {}),
|
|
216
|
+
...(input.config.model ? { model: input.config.model } : {}),
|
|
217
|
+
...(input.conversationId ? { conversationId: input.conversationId } : {}),
|
|
218
|
+
allowedTools: input.testCase.allowedTools,
|
|
219
|
+
forceRuntimeOverrides: input.testCase.forceRuntimeOverrides,
|
|
220
|
+
maxSteps: input.testCase.maxSteps,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
async function resolveCompletedLiveEvalRun(input) {
|
|
224
|
+
const traceSignature = buildTraceSignature(input.run.eventTypes);
|
|
225
|
+
const runArtifacts = createLiveEvalRunArtifacts({
|
|
226
|
+
run: input.run,
|
|
227
|
+
runId: input.runId,
|
|
228
|
+
traceSignature,
|
|
229
|
+
});
|
|
230
|
+
const failure = await input.testCase.verify(input.run, input.prepared);
|
|
231
|
+
if (!failure && input.testCase.expectedEventSubsequence) {
|
|
232
|
+
if (!containsOrderedSubsequence(input.run.eventTypes, input.testCase.expectedEventSubsequence)) {
|
|
233
|
+
return createFailedRunEvalResult({
|
|
234
|
+
context: input.context,
|
|
235
|
+
details: `Expected AG-UI event subsequence ${input.testCase.expectedEventSubsequence.join(" -> ")}, got ${traceSignature}`,
|
|
236
|
+
runArtifacts,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (failure) {
|
|
241
|
+
return createFailedRunEvalResult({
|
|
242
|
+
context: input.context,
|
|
243
|
+
details: failure,
|
|
244
|
+
runArtifacts,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return createPassedRunEvalResult({
|
|
248
|
+
context: input.context,
|
|
249
|
+
details: `OK: ${input.run.toolStarts.join(", ") || "no tools"} | ${input.run.text.slice(0, 140) || "no text"}`,
|
|
250
|
+
runArtifacts,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function extractRunId(run) {
|
|
254
|
+
for (const event of run.events) {
|
|
255
|
+
const runId = getStringField(event, "runId") ?? getStringField(event, "run_id");
|
|
256
|
+
if (runId) {
|
|
257
|
+
return runId;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
/** Check whether finished is present. */
|
|
263
|
+
export function hasFinished(run) {
|
|
264
|
+
return run.eventTypes.includes(agUiSseEventTypes.runFinished) && !run.runError;
|
|
265
|
+
}
|
|
266
|
+
/** Contains skill load helper. */
|
|
267
|
+
export function containsSkillLoad(run, skillId) {
|
|
268
|
+
return run.toolStarts.includes("load_skill") && run.toolArgs.join("").includes(skillId);
|
|
269
|
+
}
|
|
270
|
+
/** Count step started events helper. */
|
|
271
|
+
export function countStepStartedEvents(run) {
|
|
272
|
+
return run.eventTypes.filter((eventType) => eventType === agUiSseEventTypes.stepStarted).length;
|
|
273
|
+
}
|
|
274
|
+
/** Create live eval case support. */
|
|
275
|
+
export function createLiveEvalCaseSupport(config) {
|
|
276
|
+
const fetchImpl = resolveFetch(config);
|
|
277
|
+
const log = config.log ?? console.log;
|
|
278
|
+
const { judgeLlm, withJudge } = createLiveEvalJudgeSupport(config);
|
|
279
|
+
async function verifyFileExists(input) {
|
|
280
|
+
if (!config.projectId || !config.readProjectFile) {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
const file = await config.readProjectFile({
|
|
284
|
+
filePath: input.filePath,
|
|
285
|
+
requestTimeoutMs: config.requestTimeoutMs,
|
|
286
|
+
});
|
|
287
|
+
if (!file) {
|
|
288
|
+
return `${input.description ?? input.filePath}: file not found in project after task completed`;
|
|
289
|
+
}
|
|
290
|
+
if (!file.content || file.content.trim().length === 0) {
|
|
291
|
+
return `${input.description ?? input.filePath}: file exists but is empty`;
|
|
292
|
+
}
|
|
293
|
+
if (input.requiredContent) {
|
|
294
|
+
const missing = input.requiredContent.filter((keyword) => !file.content.toLowerCase().includes(keyword.toLowerCase()));
|
|
295
|
+
if (missing.length > 0) {
|
|
296
|
+
return `${input.description ?? input.filePath}: missing required content: ${missing.join(", ")}. Got: ${file.content.slice(0, 200)}`;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
async function runEval(testCase, runtime) {
|
|
302
|
+
const startedAt = Date.now();
|
|
303
|
+
if (testCase.requireProject && !config.projectId) {
|
|
304
|
+
return createSkippedEvalResult({
|
|
305
|
+
id: testCase.id,
|
|
306
|
+
label: testCase.label,
|
|
307
|
+
runtime,
|
|
308
|
+
details: "Skipped because AG_UI_EVAL_PROJECT_ID is not set.",
|
|
309
|
+
startedAt,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
const prepared = testCase.prepare
|
|
313
|
+
? await testCase.prepare({
|
|
314
|
+
apiUrl: config.apiUrl,
|
|
315
|
+
authToken: config.authToken,
|
|
316
|
+
projectId: config.projectId,
|
|
317
|
+
})
|
|
318
|
+
: null;
|
|
319
|
+
const preparedConversationId = extractPreparedConversationId(prepared);
|
|
320
|
+
const preparedArtifactPaths = collectPreparedArtifactPaths(prepared);
|
|
321
|
+
const resultContext = createLiveEvalResultContext({
|
|
322
|
+
testCase,
|
|
323
|
+
runtime,
|
|
324
|
+
startedAt,
|
|
325
|
+
conversationId: preparedConversationId,
|
|
326
|
+
artifactPaths: preparedArtifactPaths,
|
|
327
|
+
});
|
|
328
|
+
try {
|
|
329
|
+
const sidecarCleanup = prepared?.startSidecar ? await prepared.startSidecar() : undefined;
|
|
330
|
+
const progressReporter = createLiveEvalProgressReporter({
|
|
331
|
+
caseId: testCase.id,
|
|
332
|
+
startedAt,
|
|
333
|
+
intervalMs: config.progressLogIntervalMs,
|
|
334
|
+
log,
|
|
335
|
+
});
|
|
336
|
+
const body = buildLiveEvalRunBody({
|
|
337
|
+
config,
|
|
338
|
+
testCase,
|
|
339
|
+
prepared,
|
|
340
|
+
conversationId: preparedConversationId,
|
|
341
|
+
});
|
|
342
|
+
try {
|
|
343
|
+
const response = await fetchImpl(config.endpoint, {
|
|
344
|
+
method: "POST",
|
|
345
|
+
headers: {
|
|
346
|
+
"Content-Type": "application/json",
|
|
347
|
+
Authorization: `Bearer ${config.authToken}`,
|
|
348
|
+
},
|
|
349
|
+
body: JSON.stringify(body),
|
|
350
|
+
signal: AbortSignal.timeout(config.requestTimeoutMs),
|
|
351
|
+
});
|
|
352
|
+
log(`[stream] ${runtime}:${testCase.id} HTTP ${response.status}`);
|
|
353
|
+
const run = await parseSseResponse(response, {
|
|
354
|
+
onProgress: progressReporter.update,
|
|
355
|
+
});
|
|
356
|
+
return resolveCompletedLiveEvalRun({
|
|
357
|
+
testCase,
|
|
358
|
+
run,
|
|
359
|
+
prepared,
|
|
360
|
+
context: resultContext,
|
|
361
|
+
runId: extractRunId(run) ?? undefined,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
366
|
+
return createStreamingFailureEvalResult({
|
|
367
|
+
context: resultContext,
|
|
368
|
+
details: message,
|
|
369
|
+
progress: progressReporter.getSnapshot(),
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
finally {
|
|
373
|
+
progressReporter.stop();
|
|
374
|
+
await sidecarCleanup?.();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
finally {
|
|
378
|
+
await prepared?.cleanup?.();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
judgeLlm,
|
|
383
|
+
runEval,
|
|
384
|
+
verifyFileExists,
|
|
385
|
+
withJudge,
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
/** White-box helpers used by live eval runner tests. */
|
|
389
|
+
export const liveEvalRunnerInternals = {
|
|
390
|
+
collectPreparedArtifactPaths,
|
|
391
|
+
createFailedRunEvalResult,
|
|
392
|
+
createLiveEvalRunArtifacts,
|
|
393
|
+
createPassedRunEvalResult,
|
|
394
|
+
createStreamingFailureEvalResult,
|
|
395
|
+
extractRunId,
|
|
396
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
2
|
import { type AgUiSseProgressSnapshot } from "../agent/index.js";
|
|
3
3
|
import type { EvalAgentAdapter, EvalAgentAdapterContext } from "./types.js";
|
|
4
|
+
export * from "./agent-service/live-evals/index.js";
|
|
5
|
+
export * from "./agent-service/durable-run-canaries/index.js";
|
|
4
6
|
/** Default local AG-UI endpoint used by agent-service evals. */
|
|
5
7
|
export declare const DEFAULT_AGENT_SERVICE_EVAL_ENDPOINT = "http://127.0.0.1:3001/api/ag-ui";
|
|
6
8
|
/** Environment input accepted by agent-service eval helpers. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-service.d.ts","sourceRoot":"","sources":["../../../src/src/eval/agent-service.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAEL,KAAK,uBAAuB,EAK7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EAGxB,MAAM,YAAY,CAAC;AAEpB,gEAAgE;AAChE,eAAO,MAAM,mCAAmC,oCAAoC,CAAC;AAErF,gEAAgE;AAChE,MAAM,MAAM,gCAAgC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAE3F,gEAAgE;AAChE,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kEAAkE;AAClE,MAAM,WAAW,0CAA0C;IACzD,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,8BAA8B;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,C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,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjF,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC5F;AAmKD,wEAAwE;AACxE,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,gCAAqC,GACzC,2BAA2B,CAe7B;AAED,oFAAoF;AACpF,wBAAgB,mCAAmC,CACjD,GAAG,GAAE,gCAAqC,EAC1C,cAAc,SAAiD,GAC9D,0CAA0C,CAe5C;AAED,8DAA8D;AAC9D,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,qCAAqC,GAC3C,2BAA2B,CAyB7B;AAED,mGAAmG;AACnG,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,6BAA6B,GACpC,gBAAgB,CAoElB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import "../../_dnt.polyfills.js";
|
|
2
2
|
import * as dntShim from "../../_dnt.shims.js";
|
|
3
3
|
import { agUiSseEventTypes, getAgUiSseStringField, parseAgentServiceConfig, parseAgUiSseResponse, } from "../agent/index.js";
|
|
4
|
+
export * from "./agent-service/live-evals/index.js";
|
|
5
|
+
export * from "./agent-service/durable-run-canaries/index.js";
|
|
4
6
|
/** Default local AG-UI endpoint used by agent-service evals. */
|
|
5
7
|
export const DEFAULT_AGENT_SERVICE_EVAL_ENDPOINT = "http://127.0.0.1:3001/api/ag-ui";
|
|
6
8
|
function readString(value) {
|