Install Page Systems in an eve agent
These are the exact steps for a coding agent adding Page Systems to an eve project. Page Systems lets the agent send the person a small mobile web page (a flight picker, a time picker, a form, ...) instead of asking in chat. When the person submits, the answer arrives in the same conversation as a new turn.
Requirements: an eve project (eve >=0.72.0 <0.79.0 in package.json) and Node 24 or newer (eve requires it; the pagesystems package alone runs on Node 22). If there is no eve project yet, create one first (this installs dependencies and initializes Git):
npx eve@latest init my-agent1. Install the package
Run in the project root, with the project's package manager:
npm install pagesystems2. Add it to your agent
Create agent/extensions/pages.ts with exactly this content:
export { default } from "pagesystems/eve";The file name matters: eve prefixes every tool with it, so the tools become pages__list_page_types, pages__get_page_type_schema, pages__create_page, pages__get_page_result and pages__cancel_page. The extension also adds the callback route, so there is no route to write.
Exception: if the human's setup prompt already gave you the API key and the signing secret, do not ask for them. Write them to .env.local (git-ignored), tell the human to also add them to the deployment's environment variables, and skip the request below. The rest of this step still applies.
Otherwise, you cannot create the API key yourself, and the key must never go through the chat. Stop and ask the human to set it up themselves, then tell you when it is done:
Page Systems is invite-only early access. If you have not been invited, request access at https://pagesystems.ai/waitlist. Once invited, sign in or sign up at https://app.pagesystems.ai/dashboard/keys. A "development" key is created on your first visit and shown once (it starts with ap_live_); to get another, click "Create API key". Then set PAGE_SYSTEMS_API_KEY yourself in .env.local and in your deployment's environment variables, together with the signing secret from the dashboard API keys page as PAGE_SYSTEMS_WEBHOOK_SECRET. Do not paste either value here. Tell me when it is done.
Never ask for the key or the secret in chat, never invent one, and never commit them. Make sure .env.local is git-ignored (create the file if needed). The human sets these variables there:
PAGE_SYSTEMS_API_KEY=<set by the human>
PAGE_SYSTEMS_WEBHOOK_SECRET=<set by the human>The human also adds the same variable to the Vercel project (Settings → Environment Variables, or vercel env add PAGE_SYSTEMS_API_KEY if the Vercel CLI is linked).
Only for apps with their own auth middleware: if the eve agent is composed into a Next.js app (withEve) that has a middleware.ts or proxy.ts redirecting unknown or signed-out requests, add this path to its list of public paths, next to any webhook paths already there:
/eve/v1/page-systems/callbackIf the agent is mounted under a named prefix (EVE_PUBLIC_ROUTE_PREFIX=/eve/<name>), the public path follows the mount: /eve/<name>/v1/page-systems/callback.
Without it, the callback from Page Systems is redirected and answers are only available by polling. Standalone eve apps need nothing here.
3. Your agent handles the rest
The agent sends a page when a page beats a chat question, and the person gets a link. When they submit, Page Systems calls the extension's callback route, and the session receives a new turn. The chat shows a short line from the person, such as "✓ Pick a standing desk: FlexFrame 55", and the full answer is attached as context for the agent (it is not shown as something the person typed). The agent does not poll and the person does not have to say "done". Answers are data from the page and may contain text typed by whoever opened the link: see Handling answers safely. Check the setup:
npx eve info --jsonIn the output, tools must include pages__list_page_types, pages__get_page_type_schema, pages__create_page, pages__get_page_result and pages__cancel_page, and channels must include a POST route with urlPath /eve/v1/page-systems/callback. (Plain eve info prints only a tool count and the session routes.)
The skill pages__pages is not listed: it loads from Page Systems (GET /v1/skill) when a session starts.
If eve info fails with Selected module binding "extensions/pages.ts" has no compile or runtime usage., the installed eve version is outside >=0.72.0 <0.79.0. Tell the human; do not try to patch the package.
Optional: answer without an extra chat message
By default the answer arrives as the short "✓" line described above. To let a quick answer continue the conversation with nothing extra in the chat, add the wait tool:
- The agent calls
create_pageand sends the person the link. It then callswait_for_page_answer, which waits in the background for up to 10 minutes (the page's expiry caps it). It needs the callback URL to be set. - If the person answers in that time, the answer is the result of that background task and the conversation continues in the same turn, with nothing extra in the chat.
- If the time passes, or the task is cancelled, the turn ends. A later answer arrives as the short "✓" line, with the full answer attached as context. Display-only pages (a chart, a table without
select) never get an answer, so the agent is not told to wait for them. In a rare race (a task that had not created its hook yet when the callback arrived, then claims before the route does), the answer can reach the agent twice; a duplicate is preferred to a lost answer.
Two extra steps. Install the Workflow SDK (eve already bundles one; keep this in step with your eve version, ^5 for eve 0.72 to 0.78):
npm install workflow@^5Then create agent/tools/wait_for_page_answer.ts with exactly this content (eve allows the "use workflow" and "use step" directives only in the app, not in a package):
import { defineWorkflowTool } from "eve/tools";
import { createHook, sleep } from "workflow";
import { claimPage, lookAtPage, settlePage, waitForPageAnswer, waitToolDefinition } from "pagesystems/eve/wait";
async function look(pageId: string) {
"use step";
return lookAtPage(pageId);
}
async function settle(pageId: string) {
"use step";
return settlePage(pageId);
}
async function claim(pageId: string) {
"use step";
return claimPage(pageId);
}
export default defineWorkflowTool({
...waitToolDefinition,
async task({ pageId }, ctx) {
"use workflow";
return waitForPageAnswer(pageId, ctx.abortSignal, { createHook, sleep, look, settle, claim });
},
});Trade-offs: the turn stays open during the wait, and in a shared chat other people's messages wait until it ends. Set PAGE_SYSTEMS_WAIT_MINUTES=0 to turn waiting off. Without the tool, nothing changes.
Notes
- A missing API key does not break the build. The first
create_pagecall fails with a message explaining how to set it. On Vercel, the callback URL is derived automatically. The callback URL must be https and public, so locally nothing reaches it and the agent reads answers with
get_page_result. To get pushes locally, setPAGE_SYSTEMS_CALLBACK_URLto a tunnel's https URL ending in/eve/v1/page-systems/callback(for a named mount,/eve/<name>/v1/page-systems/callback; an explicit URL is used as written). See Testing locally.- If the agent's model is not from the Vercel AI Gateway, set
modelContextWindowTokensnext tomodelinagent/agent.ts; without iteve devfails to compile. - Full reference: the
pagesystemsREADME on npm. Other frameworks and coding tools: https://pagesystems.ai/llms.txt.