@vercel/agent-eval 1.1.0 → 1.2.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.
Files changed (61) hide show
  1. package/dist/lib/agents/claude-code/agent.d.ts +30 -0
  2. package/dist/lib/agents/claude-code/agent.d.ts.map +1 -0
  3. package/dist/lib/agents/claude-code/agent.js +80 -0
  4. package/dist/lib/agents/claude-code/agent.js.map +1 -0
  5. package/dist/lib/agents/claude-code/run.mjs +217 -0
  6. package/dist/lib/agents/codex/agent.d.ts +61 -0
  7. package/dist/lib/agents/codex/agent.d.ts.map +1 -0
  8. package/dist/lib/agents/codex/agent.js +221 -0
  9. package/dist/lib/agents/codex/agent.js.map +1 -0
  10. package/dist/lib/agents/codex/run.mjs +365 -0
  11. package/dist/lib/agents/cursor/agent.d.ts +32 -0
  12. package/dist/lib/agents/cursor/agent.d.ts.map +1 -0
  13. package/dist/lib/agents/cursor/agent.js +86 -0
  14. package/dist/lib/agents/cursor/agent.js.map +1 -0
  15. package/dist/lib/agents/cursor/run.mjs +183 -0
  16. package/dist/lib/agents/eval-helper.mjs +222 -0
  17. package/dist/lib/agents/gemini/agent.d.ts +27 -0
  18. package/dist/lib/agents/gemini/agent.d.ts.map +1 -0
  19. package/dist/lib/agents/gemini/agent.js +69 -0
  20. package/dist/lib/agents/gemini/agent.js.map +1 -0
  21. package/dist/lib/agents/gemini/run.mjs +180 -0
  22. package/dist/lib/agents/index.js +5 -5
  23. package/dist/lib/agents/index.js.map +1 -1
  24. package/dist/lib/agents/opencode/agent.d.ts +68 -0
  25. package/dist/lib/agents/opencode/agent.d.ts.map +1 -0
  26. package/dist/lib/agents/opencode/agent.js +165 -0
  27. package/dist/lib/agents/opencode/agent.js.map +1 -0
  28. package/dist/lib/agents/opencode/run.mjs +308 -0
  29. package/dist/lib/agents/plugin/contract.d.ts +157 -0
  30. package/dist/lib/agents/plugin/contract.d.ts.map +1 -0
  31. package/dist/lib/agents/plugin/contract.js +22 -0
  32. package/dist/lib/agents/plugin/contract.js.map +1 -0
  33. package/dist/lib/agents/plugin/orchestrator.d.ts +22 -0
  34. package/dist/lib/agents/plugin/orchestrator.d.ts.map +1 -0
  35. package/dist/lib/agents/plugin/orchestrator.js +286 -0
  36. package/dist/lib/agents/plugin/orchestrator.js.map +1 -0
  37. package/dist/lib/agents/shared.d.ts +7 -1
  38. package/dist/lib/agents/shared.d.ts.map +1 -1
  39. package/dist/lib/agents/shared.js +30 -3
  40. package/dist/lib/agents/shared.js.map +1 -1
  41. package/package.json +2 -2
  42. package/dist/lib/agents/claude-code.d.ts +0 -23
  43. package/dist/lib/agents/claude-code.d.ts.map +0 -1
  44. package/dist/lib/agents/claude-code.js +0 -300
  45. package/dist/lib/agents/claude-code.js.map +0 -1
  46. package/dist/lib/agents/codex.d.ts +0 -23
  47. package/dist/lib/agents/codex.d.ts.map +0 -1
  48. package/dist/lib/agents/codex.js +0 -364
  49. package/dist/lib/agents/codex.js.map +0 -1
  50. package/dist/lib/agents/cursor.d.ts +0 -10
  51. package/dist/lib/agents/cursor.d.ts.map +0 -1
  52. package/dist/lib/agents/cursor.js +0 -207
  53. package/dist/lib/agents/cursor.js.map +0 -1
  54. package/dist/lib/agents/gemini.d.ts +0 -10
  55. package/dist/lib/agents/gemini.d.ts.map +0 -1
  56. package/dist/lib/agents/gemini.js +0 -208
  57. package/dist/lib/agents/gemini.js.map +0 -1
  58. package/dist/lib/agents/opencode.d.ts +0 -46
  59. package/dist/lib/agents/opencode.d.ts.map +0 -1
  60. package/dist/lib/agents/opencode.js +0 -365
  61. package/dist/lib/agents/opencode.js.map +0 -1
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Generic agent orchestrator.
3
+ *
4
+ * `runWithDefinition` is the single host-side run() that every agent shares. It
5
+ * reproduces the exact flow the old per-agent adapters had (claude-code.ts is the
6
+ * reference), but the agent-specific parts — install, config, auth env, and CLI
7
+ * invocation/transcript-capture — come from the {@link AgentDefinition} and the
8
+ * agent's in-sandbox `run.mjs`.
9
+ *
10
+ * Everything that is agent-AGNOSTIC stays here (and in shared.ts): sandbox
11
+ * lifecycle, the git baseline, the neutral-workspace relocation, validation,
12
+ * generated-file capture, transcript o11y parsing, and abort/timeout handling.
13
+ * None of that can move into the sandbox — it IS the host↔sandbox control plane.
14
+ */
15
+ import type { AgentRunOptions, AgentRunResult } from '../types.js';
16
+ import type { AgentDefinition } from './contract.js';
17
+ /**
18
+ * The shared host-side run(). Each agent's createXxxAgent() wires this up with its
19
+ * definition; the public Agent interface is unchanged, so runner.ts is untouched.
20
+ */
21
+ export declare function runWithDefinition(def: AgentDefinition, fixturePath: string, options: AgentRunOptions): Promise<AgentRunResult>;
22
+ //# sourceMappingURL=orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../../src/lib/agents/plugin/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAoBnE,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,eAAe,CAAC;AA2GlF;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,eAAe,EACpB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAiMzB"}
@@ -0,0 +1,286 @@
1
+ /**
2
+ * Generic agent orchestrator.
3
+ *
4
+ * `runWithDefinition` is the single host-side run() that every agent shares. It
5
+ * reproduces the exact flow the old per-agent adapters had (claude-code.ts is the
6
+ * reference), but the agent-specific parts — install, config, auth env, and CLI
7
+ * invocation/transcript-capture — come from the {@link AgentDefinition} and the
8
+ * agent's in-sandbox `run.mjs`.
9
+ *
10
+ * Everything that is agent-AGNOSTIC stays here (and in shared.ts): sandbox
11
+ * lifecycle, the git baseline, the neutral-workspace relocation, validation,
12
+ * generated-file capture, transcript o11y parsing, and abort/timeout handling.
13
+ * None of that can move into the sandbox — it IS the host↔sandbox control plane.
14
+ */
15
+ import { readFileSync } from 'node:fs';
16
+ import { fileURLToPath } from 'node:url';
17
+ import { createSandbox, collectLocalFiles, splitTestFiles, verifyNoTestFiles, } from '../../sandbox.js';
18
+ import { runValidation, captureGeneratedFiles, createVitestConfig, initGitAndCommit, injectTranscriptContext, prepareNeutralWorkspace, EVAL_HELPER_PATH, JUDGE_TRANSCRIPT_FILE, JUDGE_CONFIG_PATH, } from '../shared.js';
19
+ /** Well-known paths inside the sandbox for the runner + its result file. */
20
+ const RUNNER_PATH = '__agent_eval__/run.mjs';
21
+ const RESULT_PATH = '__agent_eval__/agent-result.json';
22
+ /**
23
+ * Host-disk path to the in-sandbox eval helper, resolved next to the compiled
24
+ * output (dist/lib/agents/eval-helper.mjs) and in src during dev. Shipped into the
25
+ * sandbox at {@link EVAL_HELPER_PATH} before validation so EVAL.ts judge matchers
26
+ * can re-invoke the agent in this sandbox.
27
+ */
28
+ const EVAL_HELPER_DISK_PATH = fileURLToPath(new URL('../eval-helper.mjs', import.meta.url));
29
+ /**
30
+ * Run all install steps for an agent, reproducing the old per-step error wording.
31
+ * Throws on final failure so the caller's catch turns it into an error result.
32
+ */
33
+ async function runInstallSteps(sandbox, def, options) {
34
+ for (const step of def.install(options)) {
35
+ const exec = () => step.kind === 'shell'
36
+ ? sandbox.runShell(step.script ?? '')
37
+ : sandbox.runCommand(step.cmd ?? '', step.args ?? []);
38
+ let result = await exec();
39
+ // Optional single retry (the project `npm install` flakes occasionally).
40
+ if (result.exitCode !== 0 && step.retryOnce) {
41
+ result = await exec();
42
+ }
43
+ if (result.exitCode !== 0) {
44
+ // Match the old messages verbatim:
45
+ // last10 → `${prefix} (exit code N):\n<last 10 lines of stdout+stderr>`
46
+ // stderr → `${prefix}: <stderr>`
47
+ if (step.errorBody === 'last10') {
48
+ const body = (result.stdout + result.stderr).trim().split('\n').slice(-10).join('\n');
49
+ throw new Error(`${step.errorPrefix} (exit code ${result.exitCode}):\n${body}`);
50
+ }
51
+ throw new Error(`${step.errorPrefix}: ${result.stderr}`);
52
+ }
53
+ }
54
+ }
55
+ /** Write the agent's config files into the sandbox (codex TOML, opencode.json, …). */
56
+ async function writeConfigFiles(sandbox, def, options) {
57
+ for (const cf of def.configFiles(options)) {
58
+ if (cf.viaShell) {
59
+ // Absolute `~` paths writeFiles can't target (codex heredoc).
60
+ await sandbox.runShell(cf.viaShell);
61
+ }
62
+ else if (cf.path) {
63
+ await sandbox.writeFiles({ [cf.path]: cf.content ?? '' });
64
+ }
65
+ }
66
+ }
67
+ /**
68
+ * Read the RunnerResult the in-sandbox run.mjs produced.
69
+ *
70
+ * Source of truth = the result file. If that can't be read, fall back to the
71
+ * `__AGENT_RESULT__` status line on stdout. If NEITHER is parseable, the runner
72
+ * itself crashed (couldn't spawn node, fs error, …) — throw with the tail so the
73
+ * caller's catch produces a structured error result (mirrors the old CLI-crash path).
74
+ */
75
+ async function readRunnerResult(sandbox, resultPath, nodeResult) {
76
+ // 1. Preferred: the result file.
77
+ try {
78
+ const raw = await sandbox.readFile(resultPath);
79
+ if (raw && raw.trim())
80
+ return JSON.parse(raw);
81
+ }
82
+ catch {
83
+ // fall through to the marker line
84
+ }
85
+ const combined = `${nodeResult.stdout || ''}\n${nodeResult.stderr || ''}`;
86
+ // 2. Fallback: the compact status line (no transcript — it can be huge).
87
+ const markerLine = combined.split('\n').find((l) => l.startsWith('__AGENT_RESULT__'));
88
+ if (markerLine) {
89
+ try {
90
+ const status = JSON.parse(markerLine.slice('__AGENT_RESULT__'.length).trim());
91
+ return {
92
+ ok: !!status.ok,
93
+ output: combined,
94
+ transcript: null,
95
+ observedModel: status.observedModel ?? null,
96
+ error: status.error ?? null,
97
+ agentExitCode: status.agentExitCode ?? -1,
98
+ };
99
+ }
100
+ catch {
101
+ // fall through to the throw
102
+ }
103
+ }
104
+ // 3. Runner crashed — surface the last lines (old "CLI crash" behavior).
105
+ const tail = combined.trim().split('\n').slice(-5).join('\n');
106
+ throw new Error(tail || `agent runner exited with code ${nodeResult.exitCode}`);
107
+ }
108
+ /**
109
+ * The shared host-side run(). Each agent's createXxxAgent() wires this up with its
110
+ * definition; the public Agent interface is unchanged, so runner.ts is untouched.
111
+ */
112
+ export async function runWithDefinition(def, fixturePath, options) {
113
+ const startTime = Date.now();
114
+ let sandbox = null;
115
+ let agentOutput = '';
116
+ let transcript;
117
+ let observedModel;
118
+ let aborted = false;
119
+ let sandboxStopped = false;
120
+ // --- abort wiring (identical to the old adapter) ---------------------------
121
+ const abortHandler = () => {
122
+ aborted = true;
123
+ if (sandbox && !sandboxStopped) {
124
+ sandboxStopped = true;
125
+ sandbox.stop().catch(() => { });
126
+ }
127
+ };
128
+ if (options.signal) {
129
+ if (options.signal.aborted) {
130
+ return { success: false, output: '', error: 'Aborted before start', duration: 0 };
131
+ }
132
+ options.signal.addEventListener('abort', abortHandler);
133
+ }
134
+ try {
135
+ // 1. Collect fixture files; hold test files back until validation.
136
+ const allFiles = await collectLocalFiles(fixturePath);
137
+ const { workspaceFiles, testFiles } = splitTestFiles(allFiles);
138
+ if (aborted) {
139
+ return { success: false, output: '', error: 'Aborted', duration: Date.now() - startTime };
140
+ }
141
+ // 2. Create the sandbox.
142
+ sandbox = await createSandbox({
143
+ timeout: options.timeout,
144
+ runtime: 'node24',
145
+ backend: options.sandbox,
146
+ });
147
+ if (aborted) {
148
+ return {
149
+ success: false,
150
+ output: '',
151
+ error: 'Aborted',
152
+ duration: Date.now() - startTime,
153
+ sandboxId: sandbox.sandboxId,
154
+ };
155
+ }
156
+ // 3. Upload workspace, establish the git baseline, run user setup, relocate to
157
+ // the neutral workspace. (All agent-agnostic; unchanged shared helpers.)
158
+ await sandbox.uploadFiles(workspaceFiles);
159
+ await initGitAndCommit(sandbox);
160
+ if (options.setup) {
161
+ await options.setup(sandbox);
162
+ }
163
+ const neutralWorkspace = await prepareNeutralWorkspace(sandbox);
164
+ // 4. SETUP from the definition: install (project deps + CLI) then config files.
165
+ await runInstallSteps(sandbox, def, options);
166
+ await writeConfigFiles(sandbox, def, options);
167
+ // 5. Guard: no stray test files leaked into the workspace before the agent runs.
168
+ await verifyNoTestFiles(sandbox);
169
+ // 6. Ship the agent's in-sandbox runner. We read run.mjs from disk on the host
170
+ // (next to the compiled definition) and write it into the sandbox.
171
+ const runnerSource = readFileSync(def.runnerPath, 'utf8');
172
+ await sandbox.writeFiles({ [RUNNER_PATH]: runnerSource });
173
+ // 7. INVOKE the runner. Auth + neutral env are set on the node process (merged,
174
+ // neutral overrides — same precedence as the old adapter). The apiKey rides
175
+ // in env only, never in the argv JSON.
176
+ const input = {
177
+ prompt: options.prompt,
178
+ model: options.model,
179
+ modelPolicy: options.modelPolicy,
180
+ webResearch: options.webResearch,
181
+ agentOptions: options.agentOptions,
182
+ cwd: sandbox.getWorkingDirectory(), // post-relocation cwd; transcript paths use it
183
+ resultPath: RESULT_PATH,
184
+ // Optional host-computed values (e.g. codex's resolved model/effort/verbosity
185
+ // that must match the TOML config). Omitted entirely for agents without it.
186
+ extra: def.runnerExtra?.(options),
187
+ };
188
+ const runEnv = { ...def.authEnv(options), ...neutralWorkspace.env };
189
+ const nodeResult = await sandbox.runCommand('node', [RUNNER_PATH, JSON.stringify(input)], { env: runEnv });
190
+ // 8. Read the runner's result (file → marker → throw-on-crash).
191
+ const runnerResult = await readRunnerResult(sandbox, RESULT_PATH, nodeResult);
192
+ agentOutput = runnerResult.output;
193
+ transcript = runnerResult.transcript ?? undefined;
194
+ observedModel = runnerResult.observedModel ?? undefined;
195
+ if (aborted) {
196
+ return {
197
+ success: false,
198
+ output: agentOutput,
199
+ transcript,
200
+ error: 'Aborted',
201
+ duration: Date.now() - startTime,
202
+ sandboxId: sandbox.sandboxId,
203
+ };
204
+ }
205
+ // 9. Agent CLI failed (non-zero exit). Return a failed result, NOT a throw —
206
+ // mirrors the old non-zero-exit path exactly.
207
+ if (!runnerResult.ok) {
208
+ return {
209
+ success: false,
210
+ output: agentOutput,
211
+ transcript,
212
+ error: runnerResult.error ?? `${def.displayName} exited with code ${runnerResult.agentExitCode}`,
213
+ duration: Date.now() - startTime,
214
+ sandboxId: sandbox.sandboxId,
215
+ observedModel,
216
+ };
217
+ }
218
+ // 10. VALIDATION (unchanged shared helpers; parseTranscript runs host-side here).
219
+ // The auth env is reused for the eval process so EVAL.ts judge matchers can
220
+ // re-invoke the agent in-sandbox (the vitest process inherits it to children).
221
+ const validationEnv = { ...def.authEnv(options), ...neutralWorkspace.env };
222
+ if (options.validation !== 'none') {
223
+ await sandbox.uploadFiles(testFiles);
224
+ await createVitestConfig(sandbox);
225
+ await injectTranscriptContext(sandbox, transcript, def.o11yAgentName, options.model);
226
+ // Judge runtime: ship the eval helper, materialize the raw transcript as a
227
+ // file the judge agent can read by path, and record the judge config (same
228
+ // agent/model + host-computed extra the codegen run used).
229
+ await sandbox.writeFiles({
230
+ [EVAL_HELPER_PATH]: readFileSync(EVAL_HELPER_DISK_PATH, 'utf8'),
231
+ [JUDGE_TRANSCRIPT_FILE]: transcript ?? '',
232
+ [JUDGE_CONFIG_PATH]: JSON.stringify({
233
+ model: options.model ?? null,
234
+ extra: def.runnerExtra?.(options) ?? null,
235
+ }),
236
+ });
237
+ }
238
+ const validationResults = await runValidation(sandbox, options.scripts ?? [], options.validation, validationEnv);
239
+ // 11. Capture generated/deleted files (git diff).
240
+ const { generatedFiles, deletedFiles } = await captureGeneratedFiles(sandbox);
241
+ return {
242
+ success: validationResults.allPassed,
243
+ output: agentOutput,
244
+ transcript,
245
+ duration: Date.now() - startTime,
246
+ testResult: validationResults.test,
247
+ scriptsResults: validationResults.scripts,
248
+ sandboxId: sandbox.sandboxId,
249
+ generatedFiles,
250
+ deletedFiles,
251
+ observedModel,
252
+ };
253
+ }
254
+ catch (error) {
255
+ // Abort wins over a generic error (same as the old adapter).
256
+ if (aborted) {
257
+ return {
258
+ success: false,
259
+ output: agentOutput,
260
+ transcript,
261
+ error: 'Aborted',
262
+ duration: Date.now() - startTime,
263
+ sandboxId: sandbox?.sandboxId,
264
+ };
265
+ }
266
+ return {
267
+ success: false,
268
+ output: agentOutput,
269
+ transcript,
270
+ error: error instanceof Error ? error.message : String(error),
271
+ duration: Date.now() - startTime,
272
+ sandboxId: sandbox?.sandboxId,
273
+ observedModel,
274
+ };
275
+ }
276
+ finally {
277
+ if (options.signal) {
278
+ options.signal.removeEventListener('abort', abortHandler);
279
+ }
280
+ if (sandbox && !sandboxStopped) {
281
+ sandboxStopped = true;
282
+ await sandbox.stop();
283
+ }
284
+ }
285
+ }
286
+ //# sourceMappingURL=orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../../src/lib/agents/plugin/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,iBAAiB,GAElB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAStB,4EAA4E;AAC5E,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAC7C,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5F;;;GAGG;AACH,KAAK,UAAU,eAAe,CAAC,OAAmB,EAAE,GAAoB,EAAE,OAAwB;IAChG,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,C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,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;gBAChC,SAAS,EAAE,OAAO,EAAE,SAAS;aAC9B,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,WAAW;YACnB,UAAU;YACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC7D,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;YAChC,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,aAAa;SACd,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/B,cAAc,GAAG,IAAI,CAAC;YACtB,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -15,6 +15,12 @@ type AnySandbox = SandboxManager | DockerSandboxManager;
15
15
  export declare const TRANSCRIPT_CONTEXT_DIR = "__agent_eval__";
16
16
  /** Path to the results file inside the sandbox. */
17
17
  export declare const TRANSCRIPT_CONTEXT_PATH = "__agent_eval__/results.json";
18
+ /** The in-sandbox eval helper, aliased to `@vercel/agent-eval/eval` for EVAL.ts. */
19
+ export declare const EVAL_HELPER_PATH = "__agent_eval__/eval-helper.mjs";
20
+ /** Raw transcript materialized as a file so the judge agent can read it by path. */
21
+ export declare const JUDGE_TRANSCRIPT_FILE = "__agent_eval__/transcript.txt";
22
+ /** Judge config (`{ model, extra }`) — the same agent/model the codegen used. */
23
+ export declare const JUDGE_CONFIG_PATH = "__agent_eval__/judge-config.json";
18
24
  /**
19
25
  * Combined validation results.
20
26
  */
@@ -30,7 +36,7 @@ export interface NeutralWorkspace {
30
36
  /**
31
37
  * Run validation scripts in the sandbox.
32
38
  */
33
- export declare function runValidation(sandbox: AnySandbox, scripts: string[], validation?: ValidationMode): Promise<ValidationResults>;
39
+ export declare function runValidation(sandbox: AnySandbox, scripts: string[], validation?: ValidationMode, env?: Record<string, string>): Promise<ValidationResults>;
34
40
  export declare function prepareNeutralWorkspace(sandbox: AnySandbox): Promise<NeutralWorkspace>;
35
41
  export declare function initGitAndCommit(sandbox: AnySandbox): Promise<void>;
36
42
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,6CAA6C;AAC7C,KAAK,UAAU,GAAG,cAAc,GAAG,oBAAoB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD,mDAAmD;AACnD,eAAO,MAAM,uBAAuB,gCAA2C,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAgCD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,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,EAAE,CAAA;CAAE,CAAC,CAmC7E;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B3E;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;;CAEnB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;CAEhB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
@@ -10,6 +10,15 @@ import { parseTranscript } from '../o11y/index.js';
10
10
  export const TRANSCRIPT_CONTEXT_DIR = '__agent_eval__';
11
11
  /** Path to the results file inside the sandbox. */
12
12
  export const TRANSCRIPT_CONTEXT_PATH = `${TRANSCRIPT_CONTEXT_DIR}/results.json`;
13
+ // ── Agentic-judge runtime, shipped into the sandbox before validation ──────────
14
+ // These paths are mirrored as literals in eval-helper.mjs (a zero-dep file that
15
+ // cannot import this module). Keep the two in sync.
16
+ /** The in-sandbox eval helper, aliased to `@vercel/agent-eval/eval` for EVAL.ts. */
17
+ export const EVAL_HELPER_PATH = `${TRANSCRIPT_CONTEXT_DIR}/eval-helper.mjs`;
18
+ /** Raw transcript materialized as a file so the judge agent can read it by path. */
19
+ export const JUDGE_TRANSCRIPT_FILE = `${TRANSCRIPT_CONTEXT_DIR}/transcript.txt`;
20
+ /** Judge config (`{ model, extra }`) — the same agent/model the codegen used. */
21
+ export const JUDGE_CONFIG_PATH = `${TRANSCRIPT_CONTEXT_DIR}/judge-config.json`;
13
22
  /**
14
23
  * Detect which eval file exists in the sandbox (EVAL.ts or EVAL.tsx).
15
24
  * Case-sensitive: Only matches exact uppercase filenames.
@@ -40,7 +49,11 @@ async function detectEvalFile(sandbox) {
40
49
  /**
41
50
  * Run validation scripts in the sandbox.
42
51
  */
43
- export async function runValidation(sandbox, scripts, validation = 'vitest') {
52
+ export async function runValidation(sandbox, scripts, validation = 'vitest',
53
+ // Auth/neutral env for the eval process. EVAL.ts judge matchers re-invoke the
54
+ // agent CLI in-sandbox, which needs the same credentials the codegen run used —
55
+ // so the vitest process must carry them (it inherits them to its child spawns).
56
+ env) {
44
57
  const results = {
45
58
  allPassed: true,
46
59
  scripts: {},
@@ -49,7 +62,7 @@ export async function runValidation(sandbox, scripts, validation = 'vitest') {
49
62
  // Detect which eval file exists (EVAL.ts or EVAL.tsx)
50
63
  const evalFile = await detectEvalFile(sandbox);
51
64
  // Always run vitest for the eval file (explicitly specify the file)
52
- const testResult = await sandbox.runCommand('npx', ['vitest', 'run', evalFile]);
65
+ const testResult = await sandbox.runCommand('npx', ['vitest', 'run', evalFile], env ? { env } : undefined);
53
66
  results.test = {
54
67
  success: testResult.exitCode === 0,
55
68
  output: testResult.stdout + testResult.stderr,
@@ -95,7 +108,9 @@ export async function prepareNeutralWorkspace(sandbox) {
95
108
  }
96
109
  export async function initGitAndCommit(sandbox) {
97
110
  await sandbox.writeFiles({
98
- ".gitignore": "node_modules/\n",
111
+ // `__agent_eval__/` holds framework scaffolding only (the runner, transcript,
112
+ // judge I/O) — never agent output — so keep it out of the captured git diff.
113
+ ".gitignore": "node_modules/\n__agent_eval__/\n",
99
114
  });
100
115
  // init a git repo and set user and name since those are needed. Commit everything to have a clean diff with HEAD to capture
101
116
  // the generated files
@@ -145,6 +160,10 @@ export async function captureGeneratedFiles(sandbox) {
145
160
  export async function createVitestConfig(sandbox) {
146
161
  // Detect which eval file exists
147
162
  const evalFile = await detectEvalFile(sandbox);
163
+ // Absolute path to the shipped eval helper. It is BOTH the source of the
164
+ // `environment`/`transcript` exports (aliased to `@vercel/agent-eval/eval`) and
165
+ // the setup file that registers the judge matchers via expect.extend.
166
+ const helperPath = `${sandbox.getWorkingDirectory()}/${EVAL_HELPER_PATH}`;
148
167
  await sandbox.writeFiles({
149
168
  'vitest.config.ts': `
150
169
  import { defineConfig } from 'vitest/config';
@@ -152,6 +171,14 @@ export default defineConfig({
152
171
  test: {
153
172
  include: ['${evalFile}'],
154
173
  globals: false,
174
+ // Agentic judge matchers spawn a full agent run in-sandbox; give them room.
175
+ // The sandbox-level timeout is the real bound.
176
+ testTimeout: 900000,
177
+ hookTimeout: 900000,
178
+ setupFiles: ['${helperPath}'],
179
+ },
180
+ resolve: {
181
+ alias: { '@vercel/agent-eval/eval': '${helperPath}' },
155
182
  },
156
183
  });
157
184
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/lib/agents/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEvD,mDAAmD;AACnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,sBAAsB,eAAe,CAAC;AAgBhF;;;;GAIG;AACH,KAAK,UAAU,cAAc,CAAC,OAAmB;IAC/C,IAAI,CAAC;QACH,iEAAiE;QACjE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,QAAQ,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAE/D,sDAAsD;YACtD,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,EA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YAClD,CAAC,CAAC,IAAI,CAAC;QAET,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,UAAU,EAAE,OAAO,IAAI,IAAI;SAClC,CAAC;QAEF,MAAM,OAAO,CAAC,UAAU,CAAC;YACvB,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SAC5D,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,8DAA8D;IAChE,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,8BAA8B;IACvC,aAAa,EAAE,iCAAiC;IAChD,YAAY,EAAE,oBAAoB;CAC1B,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,YAAY,EAAE,mBAAmB;CACzB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,2BAA2B;IACpC,YAAY,EAAE,gBAAgB;CACtB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE,gBAAgB;CACtB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE,gBAAgB;CACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/agent-eval",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Framework for testing AI coding agents in isolated sandboxes",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dist"
17
17
  ],
18
18
  "scripts": {
19
- "build": "tsc",
19
+ "build": "tsc && node scripts/copy-runners.mjs",
20
20
  "test": "vitest run",
21
21
  "test:watch": "vitest",
22
22
  "test:docker": "SANDBOX_BACKEND=docker vitest run src/lib/docker-sandbox.test.ts",
@@ -1,23 +0,0 @@
1
- /**
2
- * Claude Code agent implementation.
3
- * Uses Vercel AI Gateway for model access.
4
- */
5
- import type { Agent, AgentRunOptions } from './types.js';
6
- export declare function extractObservedModelFromClaudeTranscript(transcript: string | undefined): string | undefined;
7
- /**
8
- * Build the Claude Code CLI argument list.
9
- *
10
- * Exported for tests because the argument order is regression-sensitive:
11
- * `--allowedTools` is variadic, so its tools MUST be passed as a single
12
- * comma-separated value. Passing them as separate tokens makes the CLI
13
- * consume the trailing positional prompt as another tool name, which broke
14
- * every run when #141 used the space-separated form.
15
- */
16
- export declare function buildClaudeCodeCliArgs(options: AgentRunOptions): string[];
17
- /**
18
- * Create Claude Code agent with specified authentication method.
19
- */
20
- export declare function createClaudeCodeAgent({ useVercelAiGateway }: {
21
- useVercelAiGateway: boolean;
22
- }): Agent;
23
- //# sourceMappingURL=claude-code.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/claude-code.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAC;AAsDzE,wBAAgB,wCAAwC,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAiB3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,EAAE,CAezE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,kBAAkB,EAAE,EAAE;IAAE,kBAAkB,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAqPpG"}