Understand the @vercel/agent-eval-playground architecture
mainThe playground is designed as a lightweight, filesystem-driven Next.js application with the following characteristics:
- Filesystem as Source of Truth: It uses no database; all data is read directly from the filesystem via Server Components (
lib/data.ts). - Server-Side Data Fetching: It uses Server Components for all data fetching and contains no API routes. All data is read server-side, meaning there is no client-side fetching.
- Client Interactivity: Client Components are used sparingly, only for interactive elements like
ComparePagedropdowns orTranscriptViewercollapsibles. - Dynamic Data: All pages use
force-dynamicto ensure that data can change between requests as new results are written to the filesystem.
How it works internally:
The CLI (bin.mjs) resolves the bundled next binary, sets RESULTS_DIR and EVALS_DIR as environment variables, and spawns next dev from the package directory.