MCPcopy
hub / github.com/vercel/next.js / writeExperiments

Function writeExperiments

run-evals.js:72–98  ·  view source on GitHub ↗

@param {string | null} evalName null means all evals

(evalName)

Source from the content-addressed store, hash-verified

70
71/** @param {string | null} evalName null means all evals */
72function 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
81const 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
94export default config
95`
96 fs.writeFileSync(path.join(EXPERIMENTS_DIR, `${v.suffix}.ts`), body)
97 }
98}
99
100function listEvals() {
101 return fs

Callers 1

mainFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…