@param {string | null} evalName null means all evals
(evalName)
| 70 | |
| 71 | /** @param {string | null} evalName null means all evals */ |
| 72 | function writeExperiments(evalName) { |
| 73 | fs.rmSync(EXPERIMENTS_DIR, { recursive: true, force: true }) |
| 74 | fs.mkdirSync(EXPERIMENTS_DIR, { recursive: true }) |
| 75 | |
| 76 | const evalsField = evalName ? `\n evals: '${evalName}',` : '' |
| 77 | for (const v of VARIANTS) { |
| 78 | const body = `import type { ExperimentConfig } from '@vercel/agent-eval' |
| 79 | ${v.imports} |
| 80 | |
| 81 | const config: ExperimentConfig = { |
| 82 | agent: 'claude-code', |
| 83 | model: 'claude-opus-4-6',${evalsField} |
| 84 | scripts: ['build'], |
| 85 | runs: 1, |
| 86 | earlyExit: true, |
| 87 | timeout: 720, |
| 88 | sandbox: 'auto', |
| 89 | setup: async (sandbox) => { |
| 90 | ${v.setup} |
| 91 | }, |
| 92 | } |
| 93 | |
| 94 | export default config |
| 95 | ` |
| 96 | fs.writeFileSync(path.join(EXPERIMENTS_DIR, `${v.suffix}.ts`), body) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | function listEvals() { |
| 101 | return fs |