Add an optional Eve agent as a first-class template app (apps/agent)#757
Open
broomva wants to merge 1 commit into
Open
Add an optional Eve agent as a first-class template app (apps/agent)#757broomva wants to merge 1 commit into
broomva wants to merge 1 commit into
Conversation
Adds `apps/agent`, a durable backend AI agent built with Eve, as an optional first-class app in the monorepo. Implements the first ask from the agent-tier design proposal (vercel#754). Highlights: - Graceful degradation: with an AI Gateway credential the agent routes to a real model through the Vercel AI Gateway; without one it answers from a deterministic offline fixture, so `bun run dev`/`build` and `eve eval` stay green with zero API keys and CI runs provider-free. - Monorepo-native tool: `count-pages` reuses @repo/database's generated client and validated keys, degrading politely when the DB is unreachable. - Provider-free smoke eval, engines pinned to Node >=24 on the agent package only, exact `eve` pin, `.output`/`.eve` build artifacts ignored. Refs vercel#754. Docs companion in vercel#756.
Contributor
|
@broomva is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
apps/agent— an optional durable backend AI agent built with Eve (Vercel's Apache-2.0 agent framework) — as a first-class template app. This implements the first staged ask from the agent-tier design proposal in #754, and pairs with the Eve add-on guide in #756.A monorepo is where an agent shines: its tools reuse the same workspace packages, Prisma schema, and validated env keys the apps already use.
count-pagesdemonstrates this by countingPagerecords through@repo/database.Why it fits next-forge
AI_GATEWAY_API_KEY, or the Vercel OIDC token on a deployment) it routes to a real model through the AI Gateway; without one it answers from a deterministic offline fixture. So adding the agent never breaks the firstbun run devfor the other apps, and CI runs provider-free.count-pagesreturns a disabled result naming the env var to set when the database is unreachable, instead of throwing.@repo/*workspace imports, per-app.env.example, exactevepin.What's included
apps/agent/agent/agent.tsmockModelfallbackapps/agent/agent/instructions.mdapps/agent/agent/channels/eve.tsapps/agent/agent/tools/count-pages.ts@repo/databaseapps/agent/evals/{evals.config,smoke.eval}.tsdocs/content/docs/apps/agent.mdxREADME.md,turbo.json,.gitignore.output/**build output; ignore.eve/.output/.workflow-dataDesign decisions (open to maintainer direction)
server-onlyworkaround, not a@repo/databasechange (yet).@repo/database's index carries aserver-onlyguard that only the Next.js runtime satisfies — Eve agents run on Nitro. The tool imports@repo/database/generated/client+@repo/database/keysdirectly to dodge it. The cohesive fix (a guard-free/serversubpath on@repo/database, item 2 of Add Eve (durable AI agents) to the stack — an agent tier for next-forge #754) would let the tool import the package root — kept out of this PR to minimize surface; happy to add it if you'd prefer.engines.node >= 24on the agent package only (Eve requires Node 24+); root stays>=18. A root bump is deferred pending your call in Add Eve (durable AI agents) to the stack — an agent tier for next-forge #754.ai@^7on the agent — Eve peer-requiresai@7;packages/aiusesai@6. They coexist via nested resolution (verified under bun); the agent declares its ownai@7.mockModel— the offline fixture is deterministic, soeve eval --strictpasses with zero API keys.modelContextWindowTokensis set on the mock path (the fixture has no gateway catalog entry).Test plan
Dogfooded on a stock scaffold under bun (no upstream CI — review is the gate):
bun install(clean, agent added to workspace)bun run build --filter=agent(turbo builds@repo/database→ agent) — 2 successfuleve eval --strict— smoke gates 3/3, provider-freetsc --noEmit(agent) — cleanultracite check— 307 files, no fixescurl /eve/v1/sessionsmoke —actions.requested(count-pages)→action.result(disabled: true)→ reply citesDATABASE_URL, withmodelId: next-forge/offline-fallbackconfirming the offline fallbackRefs #754 · docs companion #756