The Open Framework for Building Agents
feat(docs): add the Sanity copilot, social media, and Kody templates (#1600)
Ben Sabic1c4efac8cb6b
diff --git a/apps/docs/app/[lang]/templates/integration-icons.tsx b/apps/docs/app/[lang]/templates/integration-icons.tsxindex 3434c3abd..1e2b6582e 100644--- a/apps/docs/app/[lang]/templates/integration-icons.tsx+++ b/apps/docs/app/[lang]/templates/integration-icons.tsx@@ -1,9 +1,11 @@import { BracesIcon } from "lucide-react";import type { ComponentType, SVGProps } from "react";import {+ githubLogo,linearLogo,notionLogo,resendLogo,+ sanityLogo,sentryLogo,slackLogo,typefullyLogo,@@ -14,10 +16,12 @@ import type { TemplateIntegration } from "@/lib/templates/data";type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;export const integrationIcons: Record<TemplateIntegration, IconComponent> = {+ GitHub: githubLogo,"HTTP API": BracesIcon,Linear: linearLogo,Notion: notionLogo,Resend: resendLogo,+ Sanity: sanityLogo,Sentry: sentryLogo,Slack: slackLogo,Typefully: typefullyLogo,diff --git a/apps/docs/lib/integrations/logos.tsx b/apps/docs/lib/integrations/logos.tsxindex 3cab8a6db..b8e6a836a 100644--- a/apps/docs/lib/integrations/logos.tsx+++ b/apps/docs/lib/integrations/logos.tsx@@ -23,6 +23,7 @@ import {SiPosthog,SiPostman,SiRazorpay,+ SiSanity,SiSentry,SiSimilarweb,SiStripe,@@ -232,6 +233,8 @@ export const postmanLogo = (props: LogoProps) => <SiPostman color="default" {...export const razorpayLogo = (props: LogoProps) => <SiRazorpay {...props} />;+export const sanityLogo = (props: LogoProps) => <SiSanity {...props} />;+export const sentryLogo = (props: LogoProps) => <SiSentry {...props} />;export const similarwebLogo = (props: LogoProps) => <SiSimilarweb {...props} />;@@ -635,6 +638,7 @@ export const logos = {posthog: posthogLogo,postman: postmanLogo,razorpay: razorpayLogo,+ sanity: sanityLogo,sentry: sentryLogo,similarweb: similarwebLogo,stripe: stripeLogo,diff --git a/apps/docs/lib/templates/generated/templates.json b/apps/docs/lib/templates/generated/templates.jsonindex 379522e25..9dbee70a9 100644--- a/apps/docs/lib/templates/generated/templates.json+++ b/apps/docs/lib/templates/generated/templates.json@@ -141,6 +141,66 @@}]},+ "kody-eve-template": {+ "sourceRevision": "8427e3c7e88a6a449dd7c79c601619ac37cf18e1",+ "files": [+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Root agent runtime configuration.\n *\n * @remarks\n * Sets the model and the session budget for Kody, the GitHub maintainer agent; the rest of the\n * agent's surface (channels, connections, tools, skills, subagents) is discovered from the\n * filesystem under `agent/`. Conversation history is compacted once it reaches 75% of the context\n * window, and the per-session output token limit caps runaway sessions. `@vercel/connect` is\n * externalized from the build as a temporary workaround until eve handles transitive Connect\n * imports from `@github-tools/sdk` without configuration.\n */\nexport default defineAgent({\n build: { externalDependencies: [\"@vercel/connect\"] },\n compaction: { thresholdPercent: 0.75 },\n limits: {\n maxOutputTokensPerSession: 20_000,\n },\n model: \"anthropic/claude-fable-5\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/agent.ts"+ },+ {+ "contents": "import { connectGitHubCredentials } from \"@vercel/connect/eve\";\nimport {\n defaultGitHubAuth,\n type GitHubComment,\n githubChannel,\n} from \"eve/channels/github\";\n\nconst BOT_NAME = \"Kody\";\n\n/**\n * Matches an `@Kody` mention on a word boundary, the same pattern the\n * channel's built-in comment gate uses. Kept in sync with {@link BOT_NAME}.\n */\nconst MENTION_PATTERN = /@kody(?=$|[^A-Za-z0-9_-])/iu;\n\n/**\n * Commenter roles allowed to start a session by mentioning the agent.\n *\n * @remarks\n * GitHub's `author_association` on the comment payload. Anything outside this\n * set (CONTRIBUTOR, FIRST_TIME_CONTRIBUTOR, NONE, MANNEQUIN) is a user the\n * repo hasn't trusted with write access, so their mentions are acknowledged\n * without dispatching.\n */\nconst TRUSTED_ASSOCIATIONS = new Set([\"COLLABORATOR\", \"MEMBER\", \"OWNER\"]);\n\n/**\n * Replicates the channel's built-in ignore rules: eve's own marker comments,\n * bot authors, and the agent's own `kody[bot]` login.\n */\nconst isIgnoredComment = (comment: GitHubComment): boolean => {\n if (comment.body.includes(\"<!-- eve:github:\")) {\n return true;\n }\n const { author } = comment;\n if (author === undefined) {\n return false;\n }\n return (\n author.type === \"Bot\" ||\n author.login.toLowerCase() === `${BOT_NAME.toLowerCase()}[bot]`\n );\n};\n\nconst isTrustedCommenter = (comment: GitHubComment): boolean => {\n const association = comment.raw.author_association;\n return (\n typeof association === \"string\" && TRUSTED_ASSOCIATIONS.has(association)\n );\n};\n\n/**\n * Task injected into the session dispatched when a pull request opens. The\n * PR's metadata and changed-file patches are already in the session's context\n * when this runs; the repo itself is checked out into the sandbox.\n */\nconst PR_SUMMARY_TASK = [\n \"A pull request was just opened. Post one comment that helps reviewers get oriented.\",\n \"Open with a short paragraph saying what the PR does and why, grounded in its title, description, and diff. Never guess at intent the diff doesn't show.\",\n \"Then add a markdown table breaking down the changed files: the file path, the kind of change (added, modified, removed, renamed), and what changed in one short phrase. For a very large PR, list the files that carry the substance and roll the rest into a final count row.\",\n \"Close with one line pointing reviewers at where to start. This comment is a summary, not a review: don't approve, request changes, or ask the author for anything.\",\n].join(\"\\n\\n\");\n\n/**\n * GitHub channel: @mentions on issues and pull requests, answered in-thread as\n * \"Kody\", plus a summary comment on every newly opened pull request.\n *\n * @remarks\n * - Credentials are brokered by Vercel Connect. The connector UID comes from\n * the `GITHUB_CONNECTOR` environment variable (falling back to\n * `github/kody-agent`); tokens are resolved per call and never exposed to\n * the model.\n * - `onComment` replaces the built-in mention gate to add an authorization\n * check: it keeps the default mention and ignore rules, then dispatches\n * only when the commenter's `author_association` marks them as trusted with\n * the repo (owner, member, or collaborator). Mentions from anyone else are\n * acknowledged without a session, so arbitrary accounts on a public repo\n * cannot drive the agent's write tools.\n * - `onPullRequest` dispatches only on the `opened` action and skips PRs\n * opened by bots (Dependabot and similar), so automated PRs don't each get\n * a summary comment. It is deliberately not gated by `author_association`:\n * summarizing outside contributors' PRs is the point, and the injected task\n * is scoped to posting a single summary comment. All other PR actions are\n * acknowledged without dispatching.\n */\nexport default githubChannel({\n botName: BOT_NAME,\n credentials: connectGitHubCredentials(\n process.env.GITHUB_CONNECTOR ?? \"github/kody-agent\"\n ),\n onComment: (ctx, comment) =>\n !isIgnoredComment(comment) &&\n MENTION_PATTERN.test(comment.body) &&\n isTrustedCommenter(comment)\n ? { auth: defaultGitHubAuth(ctx) }\n : null,\n onPullRequest: (ctx, pullRequest) =>\n pullRequest.action === \"opened\" && ctx.sender.type !== \"Bot\"\n ? { auth: defaultGitHubAuth(ctx), context: [PR_SUMMARY_TASK] }\n : null,\n});\n",+ "language": "typescript",+ "relativePath": "agent/channels/github.ts"+ },+ {+ "contents": "import { connectLinearCredentials } from \"@vercel/connect/eve\";\nimport { defaultLinearAuth, linearChannel } from \"eve/channels/linear\";\n\n/**\n * Linear channel: Agent Sessions in, Agent Activities out, via Vercel Connect.\n *\n * @remarks\n * Credentials are brokered by Vercel Connect, which supplies the app token and\n * verifies inbound webhooks by their Vercel OIDC signature. The\n * `onAgentSession` hook keeps the default created/prompted dispatch and adds\n * the requester's name and email as session context when Linear provides\n * them, so requests like \"email me a summary\" go to the right address without\n * asking.\n */\nexport default linearChannel({\n credentials: connectLinearCredentials(\n process.env.LINEAR_CONNECTOR ?? \"linear/kody-agent\"\n ),\n onAgentSession: (_ctx, event) => {\n if (event.action !== \"created\" && event.action !== \"prompted\") {\n return null;\n }\n const requester = event.agentActivity?.user ?? event.agentSession.creator;\n const context: string[] = [];\n if (requester?.email) {\n context.push(\n `The requesting user is ${requester.displayName ?? requester.name ?? \"unknown\"} (${requester.email}). When they ask for something by email, send it to that address unless they name another.`\n );\n }\n return { auth: defaultLinearAuth(event), context };\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/channels/linear.ts"+ },+ {+ "contents": "import { createRedisState } from \"@chat-adapter/state-redis\";\nimport { createResendAdapter } from \"@resend/chat-sdk-adapter\";\nimport type { Message, Thread } from \"chat\";\nimport { chatSdkChannel } from \"eve/channels/chat-sdk\";\nimport { requireEnv } from \"../lib/constants.js\";\n\n/**\n * Email channel built on the Chat SDK's Resend adapter: inbound mail in, agent replies out.\n *\n * @remarks\n * Thread state lives in Redis (`@chat-adapter/state-redis`, configured by `REDIS_URL`). The\n * adapter authenticates with `RESEND_API_KEY`, plus `RESEND_WEBHOOK_SECRET` for inbound\n * webhooks; both are read from env. Streaming is off because email has no incremental\n * rendering: each reply is delivered as one message. The sender address comes from\n * `RESEND_FROM_ADDRESS`, the same variable the system prompt and digest task use, so channel\n * replies and agent-sent mail share one identity. The destructured `bot` and `send` wire the\n * handlers below, which forward new mentions and follow-ups on subscribed threads into the\n * agent.\n */\nexport const { bot, channel, send } = chatSdkChannel({\n adapters: {\n resend: createResendAdapter({\n fromAddress: requireEnv(\"RESEND_FROM_ADDRESS\", \"[email protected]\"),\n fromName: process.env.RESEND_FROM_NAME ?? \"Kody\",\n }),\n },\n state: createRedisState(),\n streaming: false,\n userName: \"Kody Agent\",\n});\n\nbot.onNewMention(async (thread: Thread, message: Message) => {\n await thread.subscribe();\n await send(message.text, { thread });\n});\n\nbot.onSubscribedMessage(async (thread: Thread, message: Message) => {\n await send(message.text, { thread });\n});\n\nexport default channel;\n",+ "language": "typescript",+ "relativePath": "agent/channels/resend.ts"+ },+ {+ "contents": "import { defineMcpClientConnection } from \"eve/connections\";\nimport { linearAuth } from \"../lib/constants.js\";\n\n/**\n * Linear MCP connection for creating and cross-referencing issues.\n *\n * @remarks\n * Points at Linear's hosted MCP server and authenticates with the shared app-scoped\n * `linearAuth` from `agent/lib/constants.ts`, so this connection and any tool calling the\n * Linear API directly share one installation and one set of scopes. Tokens are resolved per\n * call and never exposed to the model.\n */\nexport default defineMcpClientConnection({\n auth: linearAuth,\n description: \"Linear workspace: issues, projects, cycles, and comments.\",\n url: \"https://mcp.linear.app/mcp\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/connections/linear.ts"+ },+ {+ "contents": "import { defineMcpClientConnection } from \"eve/connections\";\nimport { requireEnv } from \"../lib/constants.js\";\n\n/**\n * Resend MCP connection for outbound email (digest sends, summaries, confirmations).\n *\n * @remarks\n * Auth is a static bearer token from `RESEND_API_KEY`, the same key the Resend\n * chat-sdk adapter uses. A static token works in every session, including the\n * weekly digest's cron run, which has no signed-in user: user-scoped Vercel\n * Connect cannot resolve there (`principal_required`) and the Resend connector\n * does not issue app-scoped tokens. The key is resolved per call and never\n * exposed to the model.\n */\nexport default defineMcpClientConnection({\n auth: {\n getToken: () =>\n Promise.resolve({ token: requireEnv(\"RESEND_API_KEY\", \"re_123\") }),\n },\n description:\n \"Resend MCP: Manage emails, templates, contacts, broadcasts, automations, and more end-to-end.\",\n url: \"https://mcp.resend.com/mcp\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/connections/resend.ts"+ },+ {+ "contents": "import { defineInstructions } from \"eve/instructions\";\nimport { requireEnv } from \"./lib/constants.js\";\n\nconst fromAddress = requireEnv(\"RESEND_FROM_ADDRESS\", \"[email protected]\");\nconst fromName = process.env.RESEND_FROM_NAME ?? \"Kody\";\n\n/**\n * Kody's full system prompt, resolved once at build time.\n *\n * @remarks\n * The sending-email section injects `RESEND_FROM_ADDRESS` and\n * `RESEND_FROM_NAME` when the app is built (`eve build` / `eve dev` compile),\n * not per session, so the agent never has to ask who an email should be sent\n * from. The address is required; the name falls back to \"Kody\".\n */\nexport default defineInstructions({\n markdown: `# Identity\n\nYou are Kody, a GitHub maintainer agent for the team. You keep people on top of a GitHub repository without making them live in the issue tracker: a weekly digest email of the repo's open issues, follow-through when someone replies to act on it, help on Linear issues when delegated to, and answers when @mentioned on GitHub issues and pull requests. You do the tracker work; they stay in their inbox and their tools.\n\n# How you write\n\nWrite like a person. Never use em dashes; use a comma, a colon, or a new sentence instead. Avoid words and phrasings that sound machine-made: delve, elevate, seamless, robust, leverage, tapestry, game-changer, \"in today's fast-paced world,\" and the \"it's not X, it's Y\" construction. Don't bold words for emphasis, don't pad, and don't hype ordinary things. This applies to your messages, your emails, and everything you post to GitHub or Linear. Plain, specific, and warm.\n\n# How you work\n\n## 1. Start with the user\n\n- Call \\`get_user_preferences\\` at the start of a task and apply what it returns: standing notes like a preferred email address, how they like the digest grouped, or a default Linear team carry across sessions.\n- Load the \\`writing-quality\\` skill before drafting any prose meant for humans: digest emails, issue summaries, comments.\n\n## 2. Ground everything in the real tracker\n\n- Read before you write. Fetch the actual GitHub issues before summarizing, triaging, or acting on them. Never invent issue numbers, titles, states, or links.\n- Always cite issues by number, like #12, so a reader can refer to them when they reply and you can resolve exactly what they mean.\n- When asked to triage, label, dedupe, or close issues, load the \\`triaging-issues\\` skill first and follow its playbook.\n- When a task needs a fact the repo and its issues don't hold (a release date, an upstream bug, a claim to verify), delegate to the \\`researcher\\` subagent rather than reaching from memory. It runs with fresh context and only web tools, so pack everything into its \\`message\\`: the specific question, the context you already have, and any constraints (recency, region, source type). Use only \\`findings\\` that carry real source URLs, and surface its \\`gaps\\` to the user instead of papering over them.\n\n## 3. The weekly digest\n\nOnce a week a scheduled task has you fetch the open issues on the configured repository, compose the digest, and email it to the configured recipient. This is not an email session: you send the digest yourself with the email tools, following the task's directions for subject and sender. Load the \\`digest-format\\` skill for the digest itself: how to group the issues, summarize each in one line, cite and link every issue number, and close by inviting the reader to reply to act.\n\n## 4. Acting on email replies\n\nWhen someone replies to a digest (or any email thread with you), treat the reply as a request against the issues it references.\n\n- Work out which repository the reply is about before asking anyone. A reply usually quotes the email it answers, and the digest names its repository in the subject and body: read the quoted text and use that repo. \"#1 and #2\" mean those issue numbers on it. Only ask when the thread genuinely names no repository or names more than one.\n- Resolve each referenced issue against GitHub before acting: confirm it exists and read it. If a cited number doesn't exist on that repo, say what you checked and ask.\n- When asked to create Linear issues from GitHub issues, or to cross-reference the two trackers, load the \\`github-linear-bridging\\` skill and follow it: check whether the issue is already tracked, carry the substance over, and link both directions.\n- Confirm what you did in your reply, with links to what you created. In an email session your final message is delivered to the thread as an email for you: never use the email tools to send your reply, or the person gets it twice. The email tools are only for sending mail from other surfaces, like the weekly digest task or a summary requested from Linear.\n- If a reply is ambiguous (an issue number that doesn't exist, an assignee you can't resolve), say what you found and ask rather than guessing.\n\n## 5. Linear sessions\n\nUsers delegate issues to you or mention you in Linear. The issue's context arrives with the request; pull more with the Linear tools when you need it.\n\n- Do what's asked in the issue's terms: summarize it, dig into linked GitHub issues, add a comment, or update it.\n- When asked to send something by email (\"email me a summary of this issue\"), compose it and send it. The session usually tells you the requester's name and email address; send to that address unless they name another. Only when no address came with the session do you ask, then persist it with the preference tools so you don't ask again.\n\n## 6. GitHub mentions\n\nWhen someone @mentions you on a GitHub issue or pull request, answer in that thread.\n\n- Ground your answer in the issue or PR you were mentioned on and the surrounding repo; fetch what you need before answering.\n- Cross-reference Linear when it helps: whether an issue is already tracked there, or what its status is.\n- Keep replies short and specific. A comment thread is not the place for a report.\n\n## 7. New pull requests\n\nWhen a pull request is opened, you post a single comment for reviewers: a short paragraph on what the PR does and why, then a table breaking down the changed files. Ground it entirely in the PR's description and diff; never guess at intent the diff doesn't show. This comment is a summary, not a review: don't approve, don't request changes, and don't ask the author for anything.\n\n# Sending email\n\nWhen you send email with the email tools, always send from ${fromName} <${fromAddress}>. Never send from any other address or under any other name, and never ask who to send from.\n\n# Notes\n\n- Don't fabricate links, issue numbers, quotes, or statuses. If you can't find something, say so and ask.\n- Remember standing preferences. When a user states a durable preference (\"always group the digest by label\", \"send my summaries to [email protected]\"), persist it: call \\`get_user_preferences\\`, merge the new note into the document, and \\`save_user_preferences\\` with the full result. Don't save one-off instructions for a single task. Use \\`clear_user_preferences\\` only when the user asks to reset them. Preferences are per-user and private to that user.`,\n});\n",+ "language": "typescript",+ "relativePath": "agent/instructions.ts"+ },+ {+ "contents": "import { defineSchedule } from \"eve/schedules\";\nimport { requireEnv } from \"../lib/constants.js\";\n\nconst digestRepo = requireEnv(\"DIGEST_REPO\", \"acme/widgets\");\nconst digestEmail = requireEnv(\"DIGEST_EMAIL\", \"[email protected]\");\nconst fromAddress = requireEnv(\"RESEND_FROM_ADDRESS\", \"[email protected]\");\n\n/**\n * Weekly GitHub issues digest, composed by the agent and sent with the Resend\n * MCP connection's email tools.\n *\n * @remarks\n * - Fires every Monday at 09:00 UTC (`\"0 9 * * 1\"`); on Vercel each schedule\n * becomes a Vercel Cron Job and the expression is evaluated in UTC.\n * - Runs in markdown task mode: the agent sends the email itself through the\n * `resend` connection, which gives it control of the subject line. The\n * chat-sdk Resend channel cannot set a subject on outbound-initiated\n * threads (`@resend/chat-sdk-adapter` 0.2.2 hardcodes \"New message\"), so\n * delivery does not go through the channel; replies to the digest still\n * reach the agent through the channel's inbound webhook.\n * - The from-address line repeats the standing instruction injected by\n * `agent/instructions.ts`; the duplication is deliberate so\n * the cron session carries the constraint in its own prompt.\n * - The digest's structure and formatting rules live in the `digest-format`\n * skill; the prompt only carries what the skill cannot know (repo,\n * recipient, sender, subject, and the fetch-fresh rule).\n * - `DIGEST_REPO`, `DIGEST_EMAIL`, and `RESEND_FROM_ADDRESS` are required at\n * module load via {@link requireEnv}, so a missing value fails discovery\n * instead of producing a schedule that cannot send.\n */\nexport default defineSchedule({\n cron: \"0 9 * * 1\",\n markdown: [\n `Fetch all open issues on ${digestRepo} using the GitHub tools, compose this week's issues digest, and email it to ${digestEmail} using the Resend email tools.`,\n `Send from ${fromAddress}. Never send from any other address.`,\n \"Fetch the issues fresh in this run; never reuse counts or lists from earlier context.\",\n `Subject line: \"Weekly issues digest: ${digestRepo}\" followed by the date. The body is the digest itself, with no preamble or commentary about the task.`,\n \"Load the digest-format skill and follow it for the digest's structure: the grouping, one-line issue summaries, citations, overview, and the closing invitation to reply.\",\n ].join(\"\\n\\n\"),\n});\n",+ "language": "typescript",+ "relativePath": "agent/schedules/weekly-digest.ts"+ },+ {+ "contents": "---\ndescription: \"Playbook for triaging GitHub issues: checking for duplicates, applying the repo's existing labels, deciding whether to ask for a reproduction or close, and choosing when to act directly versus report back first. Load whenever asked to triage, label, dedupe, or close issues, whether the request came from a GitHub mention, an email reply, or a Linear delegation. Not needed for composing the weekly digest, answering general questions on a thread, or creating Linear issues.\"\n---\n# Triaging Issues\n\nHow to work through a GitHub issue (or a batch of them) when someone asks you to triage. The order matters: read, dedupe, label, then decide what the issue needs. Never comment on or change an issue you haven't read in full, including its existing comments and labels.\n\n## 1. Check for duplicates before anything else\n\nA duplicate comment or label applied to a fresh report saves everyone the most time, but only if you are right.\n\n- Search the repo's existing issues for the same symptom before writing anything. Search closed issues as well as open ones: many \"new\" bugs were already fixed or already rejected.\n- Search by the error message, the API or feature name, and a plain description of the symptom. One search is not enough; reporters describe the same bug in different words.\n- Treat it as a duplicate only when the underlying cause matches, not just the surface symptom. Two crashes with the same error text can have different roots.\n- When it is a duplicate of an open issue: comment linking the original by number, apply the repo's duplicate label if one exists, and note anything the new report adds (a new environment, a cleaner reproduction) on the original.\n- When it duplicates a closed issue that was fixed: point to the fix and the release that carries it, and ask the reporter to confirm on that version before closing.\n- When you are not sure, say so in your comment (\"this looks related to #42\") and leave both open rather than closing on a guess.\n\n## 2. Label with the repo's vocabulary, never your own\n\nEvery repo has its own label taxonomy, and an invented label is worse than none.\n\n- List the repo's existing labels first and work only from that set. Never create a label or apply a name you assume exists.\n- Read the label descriptions when they exist; \"bug\" versus \"regression\" versus \"confirmed\" often carry specific local meaning.\n- Apply the fewest labels that place the issue: usually one for type (bug, feature, question) and one for area or status when the repo has them.\n- Remove a label only when it is clearly wrong for the issue, and say why in a comment when the removal isn't obvious.\n- If the repo has almost no labels, don't compensate by inventing structure. Triage with comments instead and mention the gap when you report back.\n\n## 3. Ask for more info, or close?\n\nDefault to asking. Closing is for issues that are already resolved elsewhere, not for issues that are merely thin.\n\n- Ask the reporter for more when the report is plausible but not actionable: no version, no steps, no expected-versus-actual behavior. Apply the repo's needs-repro or needs-more-info style label if it has one.\n- Close directly only when the issue is a confirmed duplicate, already fixed in a release the reporter can upgrade to, plainly off topic for the repo, or spam. Always leave a comment saying why, with links.\n- An issue that got a request for info and no reply is a candidate to close, but only after real time has passed, and note in the closing comment that it can be reopened with the missing details.\n- Never close someone's issue because you personally judge it low value. That call belongs to the maintainers; flag it to the user instead.\n\n## 4. Asking for reproduction details\n\nThe comment asking for more info decides whether the reporter comes back. Keep it short, specific, and warm.\n\n- Open by engaging with what they reported, not with a form letter. One sentence showing you read the issue.\n- Ask for the smallest set of things that would make the issue actionable, as a short list: exact version, steps or a minimal repro, expected versus actual behavior, and environment only if it plausibly matters.\n- Ask specific questions over generic ones. \"Does this happen with X disabled?\" gets an answer; \"please provide more details\" gets silence.\n- Close with what happens next: that you or the maintainers will pick it up once the details land.\n- See `references/repro-request-structure.md` for the comment shape and worked examples.\n\n## 5. Act directly or surface to the user?\n\nWho asked, and what they asked for, sets how much you do on your own.\n\n- When someone explicitly asked you to triage, do the reversible parts directly: comment, apply and correct labels, link duplicates. Then report what you did, issue by issue, with numbers and links.\n- Closing an issue is harder to walk back socially, even though it can be reopened. Close on your own only for the clear cases in section 3; for anything debatable, recommend the close to the user with your reasoning and let them decide.\n- For a large batch, share your plan in summary before executing (\"I'd mark #3 and #7 as duplicates of #1, label #4 and #5 as bugs, and ask #9 for a repro\") when the request left room for judgment.\n- When the request came by email or from Linear, the requester can't see the repo activity as it happens, so your reply must carry the full outcome: what you changed, what you asked, what you recommend, each with its issue number and link.\n- Never take a triage action on an issue nobody asked you about, even if you notice it needs one while working. Mention it to the user instead.\n",+ "language": "markdown",+ "relativePath": "agent/skills/triaging-issues/SKILL.md"+ },+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Fresh-context web-research subagent.\n *\n * @remarks\n * The root delegates here when a task needs an outside fact: a statistic, a competitor detail,\n * a primary-source link, or a claim to verify. The researcher runs in a fresh child session and\n * inherits none of the root's skills, connections, or tools — only the framework default harness,\n * whose `web_search` and `web_fetch` cover web research with no extra wiring. It works solely\n * from what the root packs into `message` plus what it fetches, so every claim must be grounded\n * in a real source: the root weaves in only cited `findings` and surfaces `gaps` to the user.\n *\n * `description` is what the root reads to decide when to delegate; `outputSchema` makes the\n * findings a structured, cited result it can act on directly.\n *\n * @see The research methodology and output contract in this folder's `instructions.md`.\n */\nexport default defineAgent({\n description:\n \"Research a topic on the open web for facts, statistics, primary sources, and links the \" +\n \"caller doesn't already have. Runs refined searches against reliable sources and returns \" +\n \"cited findings with confidence levels, plus the gaps it couldn't verify. The caller \" +\n \"passes the question and any known context in the message.\",\n model: \"openai/gpt-5.6-terra\",\n outputSchema: {\n additionalProperties: false,\n properties: {\n findings: {\n description:\n \"One entry per verified factual claim; every entry carries at least one real source.\",\n items: {\n additionalProperties: false,\n properties: {\n claim: {\n description:\n \"A single, specific factual claim the caller can rely on.\",\n type: \"string\",\n },\n confidence: {\n description:\n \"'high' = multiple strong independent sources; 'low' = single or weaker source.\",\n enum: [\"high\", \"medium\", \"low\"],\n type: \"string\",\n },\n notes: {\n description:\n \"Caveats: date-sensitivity, scope limits, or where sources disagree.\",\n type: \"string\",\n },\n sources: {\n description:\n \"The real, fetched sources backing the claim; never empty, never invented.\",\n items: {\n additionalProperties: false,\n properties: {\n title: {\n description: \"The source's title or publication name.\",\n type: \"string\",\n },\n url: {\n description: \"The source URL, as visited.\",\n type: \"string\",\n },\n },\n required: [\"url\", \"title\"],\n type: \"object\",\n },\n minItems: 1,\n type: \"array\",\n },\n },\n required: [\"claim\", \"sources\", \"confidence\", \"notes\"],\n type: \"object\",\n },\n type: \"array\",\n },\n gaps: {\n description:\n \"What could not be found or verified; surfaced to the caller rather than guessed at.\",\n items: { type: \"string\" },\n type: \"array\",\n },\n summary: {\n description:\n \"A 1-3 sentence synthesis of what the research establishes, for the root to scan first.\",\n type: \"string\",\n },\n },\n required: [\"summary\", \"findings\", \"gaps\"],\n type: \"object\",\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/subagents/researcher/agent.ts"+ },+ {+ "contents": "import { connectGithubTools } from \"@github-tools/sdk/connect/eve\";\n\nconst githubConnector = process.env.GITHUB_CONNECTOR ?? \"github/kody-agent\";\n\n/**\n * GitHub tool set for reading and triaging issues.\n *\n * @remarks\n * Registers the GitHub Tools SDK's `maintainer` preset via Vercel Connect. Scopes are derived\n * from the preset, and tokens are minted lazily inside each tool's execute call, so nothing\n * authenticates at import or build time. The connector UID comes from the `GITHUB_CONNECTOR`\n * environment variable, the same one the GitHub channel reads; the fallback here is this\n * project's own connector UID.\n *\n * Issue-conversation writes (comments, issue create/close, labels) run without approval: they are\n * reversible actions on the configured repo, and the email surface cannot render an approval\n * prompt, so a gate there would strand the session. Higher-impact writes (merging PRs, pushing\n * files, repo creation) keep the SDK's approval-by-default.\n */\nexport default connectGithubTools(githubConnector, {\n preset: \"maintainer\",\n requireApproval: {\n addIssueComment: \"never\",\n addLabels: \"never\",\n closeIssue: \"never\",\n createIssue: \"never\",\n removeLabel: \"never\",\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/tools/github.ts"+ }+ ]+ },"marketing-team-eve-template": {"sourceRevision": "6ebc3d9164a07f31a9a6c34dd56b3d8f145a7349","files": [@@ -191,8 +251,123 @@}]},+ "sanity-copilot-eve-template": {+ "sourceRevision": "f076b80e2bb3a2ccae3dc1cfe4886d5ac88c338b",+ "files": [+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Root agent runtime configuration.\n *\n * @remarks\n * Sets the model and the session budget for the Sanity copilot; the rest of the agent's surface\n * (channels, connections, tools, skills, subagents) is discovered from the filesystem under\n * `agent/`. Conversation history is compacted once it reaches 75% of the context window, and the\n * per-session token limits cap runaway sessions. Raise them if long content work hits the caps.\n */\nexport default defineAgent({\n compaction: { thresholdPercent: 0.75 },\n limits: {\n maxInputTokensPerSession: 500_000,\n maxOutputTokensPerSession: 20_000,\n },\n model: \"anthropic/claude-sonnet-5\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/agent.ts"+ },+ {+ "contents": "import { connectSlackCredentials } from \"@vercel/connect/eve\";\nimport { slackChannel } from \"eve/channels/slack\";\n\n/**\n * Slack channel: answers @mentions and DMs, replies in threads, and renders approvals as buttons.\n *\n * @remarks\n * Credentials are brokered by Vercel Connect through {@link connectSlackCredentials}, which\n * supplies both the outbound bot token and inbound webhook verification — there are no Slack\n * secrets to manage in code. Create the connector with\n * `vercel connect create slack --name <name> --triggers`, then register this project's trigger\n * destination at `/eve/v1/slack`.\n *\n * @defaultValue The connector UID falls back to `\"slack/sanity-copilot\"` when\n * `SLACK_CONNECTOR` is unset.\n */\nexport default slackChannel({\n credentials: connectSlackCredentials(\n process.env.SLACK_CONNECTOR ?? \"slack/sanity-copilot\"\n ),\n});\n",+ "language": "typescript",+ "relativePath": "agent/channels/slack.ts"+ },+ {+ "contents": "import { connect } from \"@vercel/connect/eve\";\nimport { defineMcpClientConnection } from \"eve/connections\";\n\n/**\n * Vercel Connect connector UID for the Notion MCP server.\n *\n * @defaultValue `\"notion/sanity-copilot\"` — the UID `vercel connect create notion\n * --name sanity-copilot` produces (UIDs are `<type>/<name>`)\n * Override with the `NOTION_CONNECTOR` environment variable when your connector uses a different\n * name.\n */\nconst notionConnector = process.env.NOTION_CONNECTOR ?? \"notion/sanity-copilot\";\n\n/**\n * Bare Notion MCP tool names whose calls require human approval before running.\n *\n * @remarks\n * Add a tool's bare name here to gate it. eve hands the approval policy the qualified name,\n * `<connection>__<tool>`, where `<tool>` is exactly what the MCP server names it (e.g.\n * `notion__notion-update-pages`; Notion's own tool names carry a `notion-` prefix). Entries\n * are matched as substrings, so they gate the tool regardless of the server's naming. Page\n * creation (`notion-create-pages`) is left ungated on purpose: drafting into Notion is the\n * normal flow.\n */\nconst APPROVAL_REQUIRED_TOOLS = [\n \"notion-update-pages\",\n \"notion-move-pages\",\n \"notion-update-data-source\",\n \"notion-update-view\",\n];\n\n/**\n * Notion workspace connection (MCP) exposing search, read, and edit tools to the model.\n *\n * @remarks\n * Authorization is user-scoped via Vercel Connect: each user signs in through their own\n * browser consent flow, the per-user token is resolved before every tool call, and it is\n * never exposed to the model.\n *\n * Tools listed in {@link APPROVAL_REQUIRED_TOOLS} are gated on human approval: a gated call\n * pauses for an approve/deny decision (rendered as a Slack button) before it runs.\n *\n * @see {@link https://vercel.com/docs/connect | Vercel Connect}\n */\nexport default defineMcpClientConnection({\n approval: ({ toolName }) =>\n APPROVAL_REQUIRED_TOOLS.some((tool) => toolName.includes(tool))\n ? \"user-approval\"\n : \"not-applicable\",\n auth: connect(notionConnector),\n description: \"Notion workspace: search, read, and edit pages and databases.\",\n url: \"https://mcp.notion.com/mcp\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/connections/notion.ts"+ },+ {+ "contents": "import { connect } from \"@vercel/connect/eve\";\nimport { defineMcpClientConnection } from \"eve/connections\";\n\n/**\n * Vercel Connect connector UID for the Sanity MCP server.\n *\n * @defaultValue `\"sanity/copilot-agent\"` — the UID `vercel connect create sanity\n * --name copilot-agent` produces (UIDs are `<type>/<name>`)\n * Override with the `SANITY_CONNECTOR` environment variable when your connector uses a different\n * name.\n */\nconst sanityConnector = process.env.SANITY_CONNECTOR ?? \"sanity/copilot-agent\";\n\n/**\n * Bare Sanity MCP tool names whose calls require human approval before running.\n *\n * @remarks\n * Add a tool's bare name here to gate it. eve hands the approval policy the qualified name,\n * `<connection>__<tool>`, where `<tool>` is exactly what the MCP server names it (e.g.\n * `sanity__patch_documents`). Entries are matched as substrings, so they gate the tool\n * regardless of the server's naming.\n */\nconst APPROVAL_REQUIRED_TOOLS = [\n \"patch_documents\",\n \"publish_documents\",\n \"unpublish_documents\",\n \"discard_drafts\",\n \"version_discard\",\n \"update_dataset\",\n \"deploy_schema\",\n \"deploy_studio\",\n];\n\n/**\n * Sanity connection (MCP) exposing search, read, and edit tools to the model.\n *\n * @remarks\n * Authorization is user-scoped via Vercel Connect: each user signs in through their own\n * browser consent flow, the per-user token is resolved before every tool call, and it is\n * never exposed to the model.\n *\n * Tools listed in {@link APPROVAL_REQUIRED_TOOLS} are gated on human approval: a gated call\n * pauses for an approve/deny decision (rendered as a Slack button) before it runs.\n *\n * @see {@link https://vercel.com/docs/connect | Vercel Connect}\n */\nexport default defineMcpClientConnection({\n approval: ({ toolName }) =>\n APPROVAL_REQUIRED_TOOLS.some((tool) => toolName.includes(tool))\n ? \"user-approval\"\n : \"not-applicable\",\n auth: connect(sanityConnector),\n description:\n \"Sanity CMS: query documents with GROQ, inspect schemas, create/edit drafts, manage releases, generate media.\",\n url: \"https://mcp.sanity.io\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/connections/sanity.ts"+ },+ {+ "contents": "# Identity\n\nYou are a Sanity copilot for the team, working inside Slack. People come to you to manage their Sanity project: querying and editing content, shaping schemas, drafting new pieces, managing releases, and moving work between Sanity and Notion. You do the careful CMS work; they stay in the conversation.\n\n# How you write\n\nWrite like a person. Never use em dashes; use a comma, a colon, or a new sentence instead. Avoid words and phrasings that sound machine-made: delve, elevate, seamless, robust, leverage, tapestry, game-changer, \"in today's fast-paced world,\" and the \"it's not X, it's Y\" construction. Don't bold words for emphasis, don't pad, and don't hype ordinary things. This applies to your messages and to everything you add to Notion or Sanity. Plain, specific, and warm.\n\n# How you work\n\n## 1. Start with the user and the right skill\n\n- Call `get_user_preferences` at the start of a task and apply what it returns: standing notes like a preferred dataset, tone, or workflow carry across sessions.\n- Load the skill that matches the task before acting, not after something goes wrong:\n - `sanity-best-practices` for schemas, GROQ, releases, functions, and framework integrations.\n - `content-modeling-best-practices` when designing or refactoring content types.\n - `portable-text-conversion` / `portable-text-serialization` when moving rich text in or out of Portable Text.\n - `seo-aeo-best-practices` for metadata, structured data, and search or AI-answer readiness.\n - `content-experimentation-best-practices` for A/B tests and variants.\n - `writing-quality` before drafting or editing any prose meant for humans.\n\n## 2. Ground everything in the real project\n\n- Read before you write. Inspect the schema before creating or editing documents, and query with GROQ to see what actually exists. Never invent document IDs, field names, or content.\n- Pull briefs and source material from Notion when the user points you to them, and read them before drafting.\n- When a piece needs a fact the project's content doesn't hold (a statistic, a competitor detail, a primary-source link, or a claim to verify), delegate to the `researcher` subagent rather than reaching from memory. It runs with fresh context and only web tools, so pack everything into its `message`: the specific question, the context you already have, and any constraints (recency, region, source type). Use only `findings` that carry real source URLs, and surface its `gaps` to the user instead of papering over them.\n\n## 3. Work in drafts, publish only on approval\n\n- Create and edit Sanity content as drafts. Treat content as ready to publish only when the user explicitly says so. Don't publish, patch, or deploy speculatively.\n\n## 4. Draft in Notion when that's the destination\n\n- When the user wants a piece drafted in Notion, create it as a new page where they direct you (find the right page or database with the Notion search tools if you don't have it), then reply with the link.\n- Do the same for any long piece you're asked to write, like a longform blog post or extensive documentation, even when the user didn't name a destination: share it as a Notion page and reply with the link plus a short summary. A page is easier to read and digest than a long in-thread message.\n\n## 5. Get a fresh-eyes review before proposing a draft\n\n- On the final draft of a piece (not every revision), delegate to the `reviewer` subagent. It runs with fresh context and can't see this thread, so pack the full draft plus any voice or audience context into its `message`. It loads its own rubric and returns a verdict.\n- Address the issues it returns, then propose the draft in the thread and iterate there. Keep your own messages short; let the work speak.\n\n## 6. Store files in Blob when durable storage is wanted\n\nThis is separate from Sanity and Notion: Blob is for files, like exporting a finished piece as Markdown, saving an image, or keeping anything that should be reachable by URL.\n\n- `upload_asset` stores text or base64-encoded binary content.\n- `list_assets`, `get_asset_info`, and `download_asset` browse, inspect, and read assets back.\n- `delete_asset` permanently deletes a file. It requires the user's approval, so only call it when they explicitly ask.\n\n# Notes\n\n- Don't fabricate links, quotes, document IDs, or product details. If the content doesn't cover something, say so and ask.\n- Remember standing preferences. When a user states a durable preference (\"always write titles in sentence case\", \"our production dataset is `prod`\"), persist it: call `get_user_preferences`, merge the new note into the document, and `save_user_preferences` with the full result. Don't save one-off instructions for a single task. Use `clear_user_preferences` only when the user asks to reset them. Preferences are per-user and private to that user.\n",+ "language": "markdown",+ "relativePath": "agent/instructions.md"+ },+ {+ "contents": "import { defineSandbox } from \"eve/sandbox\";\nimport { vercel } from \"eve/sandbox/vercel\";\n\n/**\n * Agent sandbox configuration.\n *\n * @remarks\n * Pins the hosted Vercel Sandbox backend for both local development and production, so the\n * same environment runs everywhere. Running locally requires the project to be linked and\n * authenticated to Vercel.\n *\n * @see {@link https://vercel.com/docs/sandbox | Vercel Sandbox}\n */\nexport default defineSandbox({\n backend: vercel(),\n});\n",+ "language": "typescript",+ "relativePath": "agent/sandbox.ts"+ },+ {+ "contents": "---\ndescription: \"Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, Blueprints, and framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, and the App SDK. Use this skill whenever working with Sanity schemas, defineType or defineField, GROQ or defineQuery, content modeling, Presentation or preview setups, Sanity-powered frontend integrations, Sanity Functions, documentEventHandler, defineDocumentFunction, defineMediaLibraryAssetFunction, @sanity/functions, @sanity/blueprints, sanity.blueprint.ts, event-driven content automation, or when reviewing and fixing a Sanity codebase.\"\n---\n# Sanity Best Practices\n\nComprehensive best practices and integration guides for Sanity development, maintained by Sanity. Use the quick reference below to load only the one or two topic files that match the task.\n\n## When to Apply\n\nReference these guidelines when:\n- Setting up a new Sanity project or onboarding\n- Integrating Sanity with a frontend framework (Next.js, Nuxt, Astro, Remix, SvelteKit, Hydrogen)\n- Writing GROQ queries or optimizing performance\n- Designing content schemas\n- Implementing Visual Editing and live preview\n- Working with images, Portable Text, or page builders\n- Configuring Sanity Studio structure\n- Setting up TypeGen for type safety\n- Implementing localization\n- Migrating content from other systems\n- Building custom apps with the Sanity App SDK\n- Managing infrastructure with Blueprints\n- Automating content workflows with Sanity Functions\n\n## Global Rules\n\n- Let Sanity generate `_id` values for ordinary documents. Do not create deterministic UUIDs, slug-derived IDs, or legacy-system IDs when creating documents.\n- Model relationships with `reference` fields, then resolve related documents with GROQ lookups, source-key fields, or returned `_id` values from created documents.\n- Use explicit document IDs mainly for singleton documents controlled by Studio Structure, including localized singletons such as `homePage-en`.\n\n## Quick Reference\n\n### Integration Guides\n\n- `get-started` - Interactive onboarding for new Sanity projects\n- `nextjs` - Next.js App Router, Live Content API, standalone Studio\n- `nuxt` - Nuxt integration with @nuxtjs/sanity\n- `angular` - Angular integration with @sanity/client, signals, resource API\n- `astro` - Astro integration with @sanity/astro\n- `remix` - React Router / Remix integration\n- `svelte` - SvelteKit integration with @sanity/svelte-loader\n- `hydrogen` - Shopify Hydrogen with Sanity\n- `project-structure` - Standalone Studio and monorepo patterns\n- `app-sdk` - Custom applications with Sanity App SDK\n- `blueprints` - Infrastructure as Code: blueprint files, stacks, plan/deploy workflow, error recovery, CI deploys\n- `functions` - Automating content workflows with Sanity Functions\n\n### Topic Guides\n\n- `groq` - GROQ query patterns, type safety, performance optimization\n- `schema` - Schema design, field definitions, validation, deprecation patterns\n- `visual-editing` - Presentation Tool, Stega, overlays, live preview\n- `page-builder` - Page Builder arrays, block components, live editing\n- `portable-text` - Rich text rendering and custom components\n- `image` - Image schema, URL builder, hotspots, LQIP, Next.js Image\n- `studio-structure` - Desk structure, singletons, navigation\n- `typegen` - TypeGen configuration, workflow, type utilities\n- `seo` - Metadata, sitemaps, Open Graph, JSON-LD\n- `localization` - i18n patterns, document vs field-level, locale management\n- `migration` - Content import overview (see also `migration-html-import`)\n- `migration-html-import` - HTML to Portable Text with @portabletext/block-tools\n\n## How to Use\n\nStart with the single framework or topic guide that best matches the request, then read additional references only when the task crosses concerns. Use these reference files for detailed explanations and code examples:\n\n```\nreferences/groq.md\nreferences/schema.md\nreferences/nextjs.md\n```\n\nEach reference file contains:\n- Comprehensive topic or integration coverage\n- Incorrect and correct code examples\n- Decision matrices and workflow guidance\n- Framework-specific patterns where applicable\n",+ "language": "markdown",+ "relativePath": "agent/skills/sanity-best-practices/SKILL.md"+ },+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Fresh-context web-research subagent.\n *\n * @remarks\n * The root delegates here when a task needs an outside fact: a statistic, a competitor detail,\n * a primary-source link, or a claim to verify. The researcher runs in a fresh child session and\n * inherits none of the root's skills, connections, or tools — only the framework default harness,\n * whose `web_search` and `web_fetch` cover web research with no extra wiring. It works solely\n * from what the root packs into `message` plus what it fetches, so every claim must be grounded\n * in a real source: the root weaves in only cited `findings` and surfaces `gaps` to the user.\n *\n * `description` is what the root reads to decide when to delegate; `outputSchema` makes the\n * findings a structured, cited result it can act on directly.\n *\n * @see The research methodology and output contract in this folder's `instructions.md`.\n */\nexport default defineAgent({\n description:\n \"Research a topic on the open web for facts, statistics, primary sources, and links the \" +\n \"caller doesn't already have. Runs refined searches against reliable sources and returns \" +\n \"cited findings with confidence levels, plus the gaps it couldn't verify. The caller \" +\n \"passes the question and any known context in the message.\",\n model: \"openai/gpt-5.6-terra\",\n outputSchema: {\n additionalProperties: false,\n properties: {\n findings: {\n description:\n \"One entry per verified factual claim; every entry carries at least one real source.\",\n items: {\n additionalProperties: false,\n properties: {\n claim: {\n description:\n \"A single, specific factual claim the draft can rely on.\",\n type: \"string\",\n },\n confidence: {\n description:\n \"'high' = multiple strong independent sources; 'low' = single or weaker source.\",\n enum: [\"high\", \"medium\", \"low\"],\n type: \"string\",\n },\n notes: {\n description:\n \"Caveats: date-sensitivity, scope limits, or where sources disagree.\",\n type: \"string\",\n },\n sources: {\n description:\n \"The real, fetched sources backing the claim; never empty, never invented.\",\n items: {\n additionalProperties: false,\n properties: {\n title: {\n description: \"The source's title or publication name.\",\n type: \"string\",\n },\n url: {\n description: \"The source URL, as visited.\",\n type: \"string\",\n },\n },\n required: [\"url\", \"title\"],\n type: \"object\",\n },\n minItems: 1,\n type: \"array\",\n },\n },\n required: [\"claim\", \"sources\", \"confidence\", \"notes\"],\n type: \"object\",\n },\n type: \"array\",\n },\n gaps: {\n description:\n \"What could not be found or verified; surfaced to the caller rather than guessed at.\",\n items: { type: \"string\" },\n type: \"array\",\n },\n summary: {\n description:\n \"A 1-3 sentence synthesis of what the research establishes, for the root to scan first.\",\n type: \"string\",\n },\n },\n required: [\"summary\", \"findings\", \"gaps\"],\n type: \"object\",\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/subagents/researcher/agent.ts"+ },+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Fresh-context draft-review subagent.\n *\n * @remarks\n * The root delegates here for a final, unbiased pass over a finished draft before proposing it\n * to the user. The reviewer runs in a fresh child session and inherits none of the root's\n * skills, connections, or tools — it carries its own copy of the `writing-quality` skill (and\n * its own sandbox to read that skill's references), so the root passes only the draft and any\n * voice or audience context in `message`. A reviewer that never saw the sources or the drafting\n * reasoning catches the AI-tells, bloated wording, and structure misses that self-review\n * rationalizes away. The skill copy under this folder's `skills/` is duplicated from the root's\n * on purpose; keep the two in step when editing either, except where the root's copy points at\n * other root-only skills (e.g. `seo-aeo-best-practices`) — this copy states those concerns are\n * out of scope instead, since the reviewer can't load them.\n *\n * `description` is what the root reads to decide when to delegate; `outputSchema` makes the\n * verdict a structured result it can act on directly.\n *\n * @see The review rubric and verdict contract in this folder's `instructions.md`.\n */\nexport default defineAgent({\n description:\n \"Review a finished content draft with fresh context against the writing-quality rubric \" +\n \"(AI-tells, plain English, structure, web-content specs) before it goes to the user. The \" +\n \"caller passes the full draft plus any voice or audience context in the message; the \" +\n \"reviewer loads its own rubric and returns a verdict with concrete issues.\",\n model: \"anthropic/claude-fable-5\",\n outputSchema: {\n additionalProperties: false,\n properties: {\n issues: {\n description:\n \"One entry per concrete problem; empty when the verdict is 'ready'.\",\n items: {\n additionalProperties: false,\n properties: {\n fix: {\n description: \"A concrete suggested change.\",\n type: \"string\",\n },\n quote: {\n description: \"The offending excerpt, quoted from the draft.\",\n type: \"string\",\n },\n rule: {\n description: \"The rubric rule or reference the excerpt breaks.\",\n type: \"string\",\n },\n severity: { enum: [\"high\", \"medium\", \"low\"], type: \"string\" },\n },\n required: [\"severity\", \"rule\", \"quote\", \"fix\"],\n type: \"object\",\n },\n type: \"array\",\n },\n verdict: {\n description:\n \"'ready' = clean enough to send as-is; 'revise' = fix the issues first.\",\n enum: [\"ready\", \"revise\"],\n type: \"string\",\n },\n },\n required: [\"verdict\", \"issues\"],\n type: \"object\",\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/subagents/reviewer/agent.ts"+ },+ {+ "contents": "import { put } from \"@vercel/blob\";\nimport { defineTool } from \"eve/tools\";\nimport { z } from \"zod\";\nimport {\n isReservedUserPath,\n USER_PREFERENCES_PREFIX,\n} from \"#lib/user-preferences.js\";\n\n/**\n * Tool that uploads text or binary content to Vercel Blob storage.\n *\n * @remarks\n * Authorization resolves from the ambient Vercel credentials — the project's OIDC token\n * (`VERCEL_OIDC_TOKEN`, or the `x-vercel-oidc-token` request header on Vercel) — so no\n * `BLOB_READ_WRITE_TOKEN` is required and no token is passed in code. Binary content (images,\n * PDFs) is supplied base64-encoded with `isBase64: true`.\n */\nexport default defineTool({\n description:\n \"Upload text or binary content to Vercel Blob storage and return its URL. Use when the \" +\n \"user wants to save or publish an asset — an exported draft, an image — to durable storage.\",\n /**\n * Upload the content to Blob storage.\n *\n * @param input - Validated tool input.\n * @returns The asset's `url`, `downloadUrl`, stored `pathname`, and `contentType`, or\n * `success: false` with an `error` message.\n */\n async execute({\n pathname,\n content,\n contentType,\n isBase64,\n access,\n addRandomSuffix,\n allowOverwrite,\n }) {\n if (isReservedUserPath(pathname)) {\n return {\n contentType: contentType ?? \"unknown\",\n downloadUrl: \"\",\n error: `\"${USER_PREFERENCES_PREFIX}\" is reserved — use save_user_preferences instead.`,\n pathname,\n success: false,\n url: \"\",\n };\n }\n try {\n const body = isBase64 ? Buffer.from(content, \"base64\") : content;\n const blob = await put(pathname, body, {\n access: access ?? \"public\",\n addRandomSuffix: addRandomSuffix ?? false,\n allowOverwrite: allowOverwrite ?? false,\n contentType,\n });\n return {\n contentType: blob.contentType,\n downloadUrl: blob.downloadUrl,\n pathname: blob.pathname,\n success: true,\n url: blob.url,\n };\n } catch (error) {\n return {\n contentType: contentType ?? \"unknown\",\n downloadUrl: \"\",\n error: error instanceof Error ? error.message : \"Upload failed\",\n pathname,\n success: false,\n url: \"\",\n };\n }\n },\n inputSchema: z.object({\n access: z\n .enum([\"public\", \"private\"])\n .optional()\n .describe('Access level for the asset. Defaults to \"public\".'),\n addRandomSuffix: z\n .boolean()\n .optional()\n .describe(\n \"Append a random suffix to avoid pathname collisions. Defaults to false.\"\n ),\n allowOverwrite: z\n .boolean()\n .optional()\n .describe(\n \"Allow overwriting an existing blob at the same pathname. Defaults to false.\"\n ),\n content: z\n .string()\n .describe(\n \"Raw text/JSON, or base64-encoded bytes when isBase64 is true.\"\n ),\n contentType: z\n .string()\n .optional()\n .describe(\n 'MIME type, e.g. \"text/markdown\". Inferred from the extension when omitted.'\n ),\n isBase64: z\n .boolean()\n .optional()\n .describe(\n \"Set true when content is base64-encoded binary data. Defaults to false.\"\n ),\n pathname: z\n .string()\n .min(1)\n .describe(\n 'Path and filename including extension, e.g. \"drafts/launch-post.md\".'\n ),\n }),\n outputSchema: z.object({\n contentType: z.string(),\n downloadUrl: z.string(),\n error: z.string().optional(),\n pathname: z.string(),\n success: z.boolean(),\n url: z.string(),\n }),\n});\n",+ "language": "typescript",+ "relativePath": "agent/tools/upload_asset.ts"+ }+ ]+ },+ "typefully-eve-template": {+ "sourceRevision": "3627b2282a9ebfa1badd987f2b3a0c337219575f",+ "files": [+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Root agent runtime configuration.\n *\n * @remarks\n * Sets the model and the session budget for the Typefully social media agent; the rest of the agent's surface\n * (channels, connections, tools, skills, subagents) is discovered from the filesystem under\n * `agent/`. Conversation history is compacted once it reaches 75% of the context window, and the\n * per-session token limits cap runaway sessions. Raise them if long content work hits the caps.\n */\nexport default defineAgent({\n compaction: { thresholdPercent: 0.75 },\n limits: {\n maxInputTokensPerSession: 500_000,\n maxOutputTokensPerSession: 20_000,\n },\n model: \"anthropic/claude-sonnet-5\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/agent.ts"+ },+ {+ "contents": "import { connectSlackCredentials } from \"@vercel/connect/eve\";\nimport { slackChannel } from \"eve/channels/slack\";\n\n/**\n * Slack channel: answers @mentions and DMs, replies in threads, and renders approvals as buttons.\n *\n * @remarks\n * Credentials are brokered by Vercel Connect through {@link connectSlackCredentials}, which\n * supplies both the outbound bot token and inbound webhook verification — there are no Slack\n * secrets to manage in code. Create the connector with\n * `vercel connect create slack --name <name> --triggers`, then register this project's trigger\n * destination at `/eve/v1/slack`.\n *\n * @defaultValue The connector UID falls back to `\"slack/social-media-agent\"` when\n * `SLACK_CONNECTOR` is unset.\n */\nexport default slackChannel({\n credentials: connectSlackCredentials(\n process.env.SLACK_CONNECTOR ?? \"slack/social-media-agent\"\n ),\n});\n",+ "language": "typescript",+ "relativePath": "agent/channels/slack.ts"+ },+ {+ "contents": "import { connect } from \"@vercel/connect/eve\";\nimport { defineMcpClientConnection } from \"eve/connections\";\n\n/**\n * Vercel Connect connector UID for the Notion MCP server.\n *\n * @defaultValue `\"notion/social-media-agent\"` — the UID `vercel connect create notion\n * --name social-media-agent` produces (UIDs are `<type>/<name>`)\n * Override with the `NOTION_CONNECTOR` environment variable when your connector uses a different\n * name.\n */\nconst notionConnector =\n process.env.NOTION_CONNECTOR ?? \"notion/social-media-agent\";\n\n/**\n * Bare Notion MCP tool names whose calls require human approval before running.\n *\n * @remarks\n * Add a tool's bare name here to gate it. eve hands the approval policy the qualified name,\n * `<connection>__<tool>`, where `<tool>` is exactly what the MCP server names it (e.g.\n * `notion__notion-update-pages`; Notion's own tool names carry a `notion-` prefix). Entries\n * are matched as substrings, so they gate the tool regardless of the server's naming. Page\n * creation (`notion-create-pages`) is left ungated on purpose: drafting into Notion is the\n * normal flow.\n */\nconst APPROVAL_REQUIRED_TOOLS = [\n \"notion-update-pages\",\n \"notion-move-pages\",\n \"notion-update-data-source\",\n \"notion-update-view\",\n];\n\n/**\n * Notion workspace connection (MCP) exposing search, read, and edit tools to the model.\n *\n * @remarks\n * Authorization is user-scoped via Vercel Connect: each user signs in through their own\n * browser consent flow, the per-user token is resolved before every tool call, and it is\n * never exposed to the model.\n *\n * Tools listed in {@link APPROVAL_REQUIRED_TOOLS} are gated on human approval: a gated call\n * pauses for an approve/deny decision (rendered as a Slack button) before it runs.\n *\n * @see {@link https://vercel.com/docs/connect | Vercel Connect}\n */\nexport default defineMcpClientConnection({\n approval: ({ toolName }) =>\n APPROVAL_REQUIRED_TOOLS.some((tool) => toolName.includes(tool))\n ? \"user-approval\"\n : \"not-applicable\",\n auth: connect(notionConnector),\n description: \"Notion workspace: search, read, and edit pages and databases.\",\n url: \"https://mcp.notion.com/mcp\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/connections/notion.ts"+ },+ {+ "contents": "import { defineMcpClientConnection } from \"eve/connections\";\n\n/**\n * Bare Typefully tool names whose effects are irreversible. These always require\n * explicit writer approval before they run.\n */\nconst DELETE_TOOLS = [\n \"typefully_delete_draft\",\n \"typefully_delete_comment\",\n \"typefully_delete_thread\",\n];\n\n/**\n * Bare Typefully tool names that can publish or schedule a post. They are gated\n * only when the call actually publishes or schedules — i.e. when `publish_at` is\n * set — so saving a plain draft and editing copy stay friction-free.\n */\nconst PUBLISH_TOOLS = [\"typefully_create_draft\", \"typefully_edit_draft\"];\n\n/**\n * Read `requestBody.publish_at` from a tool input without trusting its shape.\n *\n * @param input - The raw input the model passed to the tool.\n * @returns The `publish_at` value when present and well-formed, otherwise `undefined`.\n */\nconst readPublishAt = (input: unknown): unknown => {\n if (typeof input !== \"object\" || input === null) {\n return;\n }\n const body = (input as { requestBody?: unknown }).requestBody;\n if (typeof body !== \"object\" || body === null) {\n return;\n }\n return (body as { publish_at?: unknown }).publish_at;\n};\n\nexport default defineMcpClientConnection({\n approval: ({ toolName, toolInput }) => {\n if (DELETE_TOOLS.some((tool) => toolName.includes(tool))) {\n return \"user-approval\";\n }\n if (PUBLISH_TOOLS.some((tool) => toolName.includes(tool))) {\n const publishAt = readPublishAt(toolInput);\n return typeof publishAt === \"string\" && publishAt.length > 0\n ? \"user-approval\"\n : \"not-applicable\";\n }\n return \"not-applicable\";\n },\n /**\n * Typefully's MCP server authenticates with a static API key. `getToken` runs on each\n * connection attempt and reads the key from the `TYPEFULLY_API_KEY` environment variable —\n * set it in the Vercel project (and `.env.local` for `pnpm dev`). eve sends the key as\n * `Authorization: Bearer <token>`. With `getToken`-only auth the connection is app-scoped:\n * one shared Typefully workspace credential across all Slack users.\n */\n auth: {\n getToken: () => {\n const token = process.env.TYPEFULLY_API_KEY;\n if (!token) {\n throw new Error(\"TYPEFULLY_API_KEY is not set.\");\n }\n return Promise.resolve({ token });\n },\n },\n description:\n \"Typefully: draft, schedule, and manage social posts across X, LinkedIn, Threads, \" +\n \"Bluesky, and Mastodon. List social sets (accounts) and their connected platforms; \" +\n \"create, edit, read, and list drafts; schedule posts and manage the publishing queue; \" +\n \"upload media; organize with tags; manage comment threads; and read post and follower analytics.\",\n url: \"https://mcp.typefully.com/mcp\",\n});\n",+ "language": "typescript",+ "relativePath": "agent/connections/typefully.ts"+ },+ {+ "contents": "# Identity\n\nYou are a social-media copilot for the team, working inside Slack. People come to you to run their social presence: drafting posts and threads, scheduling and managing the publishing queue through Typefully across X, LinkedIn, Threads, Bluesky, and Mastodon, and pulling briefs and source material from Notion. You do the careful drafting and queue work; they stay in the conversation.\n\n# How you write\n\nWrite like a person. Never use em dashes; use a comma, a colon, or a new sentence instead. Avoid words and phrasings that sound machine-made: delve, elevate, seamless, robust, leverage, tapestry, game-changer, \"in today's fast-paced world,\" and the \"it's not X, it's Y\" construction. Don't bold words for emphasis, don't pad, and don't hype ordinary things. This applies to your messages and to everything you add to Notion or Typefully. Plain, specific, and warm.\n\n# How you work\n\n## 1. Start with the user and the right skill\n\n- Call `get_user_preferences` at the start of a task and apply what it returns: standing notes like a default social set, tone, or workflow carry across sessions.\n- Load the skill that matches the task before acting, not after something goes wrong:\n - `writing-quality` before drafting, editing, or reviewing any prose meant for humans. It carries the general quality rules plus the AI-phrases and plain-English reference lists.\n - The platform style skill for wherever the post will live: `x-style`, `linkedin-style`, `threads-style`, `bluesky-style`, or `mastodon-style`. Each carries that platform's conventions, hooks, thread structure, limits, and banned words. Load one per target platform, alongside `writing-quality`, and when adapting a piece for several platforms load each target's skill in turn.\n\n## 2. Ground everything in the real accounts\n\n- Read before you write. List the user's social sets and their connected accounts, and read existing drafts before creating or editing anything. Never invent draft IDs, account names, or content.\n- Pull briefs and source material from Notion when the user points you to them, and read them before drafting.\n- When a post needs a fact you don't already have (a statistic, a competitor detail, a primary-source link, or a claim to verify), delegate to the `researcher` subagent rather than reaching from memory. It runs with fresh context and only web tools, so pack everything into its `message`: the specific question, the context you already have, and any constraints (recency, region, source type). Use only `findings` that carry real source URLs, and surface its `gaps` to the user instead of papering over them.\n\n## 3. Work in drafts, schedule only on approval\n\n- Create and edit Typefully drafts freely: plain drafting is your normal mode. Never set `publish_at` (which schedules or publishes a post) unless the user has explicitly asked to schedule or publish; propose the time in the thread and let them confirm.\n- Deleting a draft, comment, or thread is permanent, so only do it when the user explicitly asks.\n\n## 4. Draft in Notion when that's the destination\n\n- When the user wants a piece drafted in Notion, create it as a new page where they direct you (find the right page or database with the Notion search tools if you don't have it), then reply with the link.\n- Do the same for any long piece you're asked to write, like a longform blog post or an article a thread will be cut from, even when the user didn't name a destination: share it as a Notion page and reply with the link plus a short summary. A page is easier to read and digest than a long in-thread message.\n\n## 5. Check the draft before proposing it\n\n- Before proposing any social draft in the thread, run `lint_against_style` with the draft text and the target platform as the surface, and fix what it flags. Do this for each platform version when a piece targets several.\n- On the final draft of a piece (not every revision), delegate to the `reviewer` subagent. It runs with fresh context and can't see this thread, so pack the full draft plus the target platform and any voice or audience context into its `message`, including the platform norms that matter for the piece. It loads its own rubric and returns a verdict.\n- Address the issues it returns, then propose the draft in the thread and iterate there. Keep your own messages short; let the work speak.\n\n## 6. Store files in Blob when durable storage is wanted\n\nThis is separate from Typefully and Notion: Blob is for files, like exporting a finished thread as Markdown, saving an image before uploading it to a draft, or keeping anything that should be reachable by URL.\n\n- `upload_asset` stores text or base64-encoded binary content.\n- `list_assets`, `get_asset_info`, and `download_asset` browse, inspect, and read assets back.\n- `delete_asset` permanently deletes a file. It requires the user's approval, so only call it when they explicitly ask.\n\n# Notes\n\n- Don't fabricate links, quotes, statistics, handles, or draft IDs. If the source material doesn't cover something, say so and ask.\n- Remember standing preferences. When a user states a durable preference (\"always draft for the X and LinkedIn set\", \"keep threads under 8 posts\"), persist it: call `get_user_preferences`, merge the new note into the document, and `save_user_preferences` with the full result. Don't save one-off instructions for a single task. Use `clear_user_preferences` only when the user asks to reset them. Preferences are per-user and private to that user.\n",+ "language": "markdown",+ "relativePath": "agent/instructions.md"+ },+ {+ "contents": "import { defineSandbox } from \"eve/sandbox\";\nimport { vercel } from \"eve/sandbox/vercel\";\n\n/**\n * Agent sandbox configuration.\n *\n * @remarks\n * Pins the hosted Vercel Sandbox backend for both local development and production, so the\n * same environment runs everywhere. Running locally requires the project to be linked and\n * authenticated to Vercel.\n *\n * @see {@link https://vercel.com/docs/sandbox | Vercel Sandbox}\n */\nexport default defineSandbox({\n backend: vercel(),\n});\n",+ "language": "typescript",+ "relativePath": "agent/sandbox.ts"+ },+ {+ "contents": "import { defineSchedule } from \"eve/schedules\";\n\n/**\n * Weekly Typefully analytics digest.\n *\n * @remarks\n * Fires every Monday at 14:00 UTC (Vercel evaluates cron in UTC; adjust the hour for your\n * team's timezone). Task mode runs the agent on the prompt below with the full tool surface;\n * the read-only analytics tools are not approval-gated, so the session never needs to park.\n * Delivery is the `post_analytics_report` tool, which posts to the channel in the\n * `TYPEFULLY_ANALYTICS_CHANNEL` environment variable, so this schedule needs no channel\n * handoff. Trigger it in dev with `curl -X POST http://localhost:3000/eve/v1/dev/schedules/weekly-analytics`.\n *\n * @see {@link https://eve.dev/docs/schedules | eve schedules}\n */\nexport default defineSchedule({\n cron: \"0 14 * * 1\",\n markdown: [\n \"Post this week's Typefully analytics digest to the team.\",\n \"\",\n \"1. Call typefully_list_social_sets and pick the first social set to report on. Note its id and name.\",\n \"2. Call typefully_get_social_set_analytics_followers for that social set id.\",\n \"3. Call typefully_list_social_set_analytics_posts for that social set id.\",\n \"4. Build two tables from what those tools return, every cell a string:\",\n \" - A followers table: one row per account or reporting period, with the follower counts and any change figures the tool provides.\",\n \" - A posts table: one row per post, with an identifier or date, a column linking to the post (use the post URL or permalink the analytics tool returns; do not fabricate a URL), and the engagement metrics the tool provides (impressions, likes, reposts, and so on).\",\n \" Use only fields the tools actually return; do not invent metrics. If there are no posts for the period, pass an empty posts table (no rows) so the report omits it rather than showing an empty table. For followers, if the tool returns nothing, use a single row that says there is no data for the period.\",\n \"5. Call post_analytics_report with a casual summary (1-2 sentences) that includes the social set and the period, the posts table, and the followers table.\",\n \"\",\n \"Do not post anything if the analytics tools error; let the run fail instead so the problem is visible.\",\n ].join(\"\\n\"),\n});\n",+ "language": "typescript",+ "relativePath": "agent/schedules/weekly-analytics.ts"+ },+ {+ "contents": "---\ndescription: \"Use when drafting or editing a post or thread for X (Twitter): voice, hooks, length, threads, hashtags, and links.\"\n---\n\n# X (Twitter) voice & style\n\nWhen writing or editing a post for X:\n\n- Hook first. The first line decides whether anyone stops scrolling: open on the surprising claim, the number, the contradiction, or the moment. No throat-clearing, no \"A thread on…\". A hook isn't clickbait: promise only value the post actually delivers.\n- One idea per post. Free accounts cap at 280 characters. If you have more to say, write a thread, don't cram. Even when the account has Premium, the in-feed preview is still ~280, so the point has to land in the first 280 either way.\n- Plain and punchy. Short sentences. Cut every word that isn't load-bearing. Aim tight; ~240–259 characters tends to travel well. Lowercase openers are fine when they read naturally.\n- Concrete over abstract: a result, a number, a before/after. No vague inspiration.\n- Text carries on X. Add an image or native video only when it carries the point, not for its own sake. Prefer native video over a link out.\n- At most 0–2 real hashtags. 1–2 can help; 3+ tends to hurt. No hashtag walls, no emoji clutter.\n- No engagement bait (\"RT if you agree\", \"read that again\", \"let that sink in\"). The algorithm rewards genuine replies, so end on an open question or a real conversation starter instead.\n- Links suppress reach on X. When a post needs a link, put it in the first reply and say so, rather than in the main post.\n\n## Threads\n\n- The first post must stand on its own and earn the tap: it's a hook, not a table of contents.\n- One beat per post; each should be worth reading even out of context.\n- Keep them scrolling with small expansion hooks every few posts.\n- Number posts (`1/`, `2/`) only for longer threads where it aids the reader; don't force it.\n- Close with a payoff or a single clear takeaway, not \"follow me for more\".\n\n## Structure\n\n1. Hook: the surprising claim or the moment, line one.\n2. Turn: the tension, or the thing most people get wrong.\n3. Payoff: what you learned, with a concrete detail.\n4. Close: one takeaway or a genuine question.\n\n## References\n\n- `references/best-practices.md`: sourced checklist of current X tactics (hooks, length, links, hashtags, threads, cadence).\n- `references/post-specs.md`: concrete specs: character limits, hashtag norms, media, links.\n- `references/banned-words.json`: words to avoid. Read it once for awareness, then run the `lint_against_style` tool (surface `x`) on your draft before proposing it to the writer.\n\nGeneral prose quality (AI-tell phrases to avoid, plain-English word swaps) is covered by the `writing-quality` skill; apply it to every draft alongside this one.\n",+ "language": "markdown",+ "relativePath": "agent/skills/x-style/SKILL.md"+ },+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Fresh-context web-research subagent.\n *\n * @remarks\n * The root delegates here when a task needs an outside fact: a statistic, a competitor detail,\n * a primary-source link, or a claim to verify. The researcher runs in a fresh child session and\n * inherits none of the root's skills, connections, or tools — only the framework default harness,\n * whose `web_search` and `web_fetch` cover web research with no extra wiring. It works solely\n * from what the root packs into `message` plus what it fetches, so every claim must be grounded\n * in a real source: the root weaves in only cited `findings` and surfaces `gaps` to the user.\n *\n * `description` is what the root reads to decide when to delegate; `outputSchema` makes the\n * findings a structured, cited result it can act on directly.\n *\n * @see The research methodology and output contract in this folder's `instructions.md`.\n */\nexport default defineAgent({\n description:\n \"Research a topic on the open web for facts, statistics, primary sources, and links the \" +\n \"caller doesn't already have. Runs refined searches against reliable sources and returns \" +\n \"cited findings with confidence levels, plus the gaps it couldn't verify. The caller \" +\n \"passes the question and any known context in the message.\",\n model: \"openai/gpt-5.6-terra\",\n outputSchema: {\n additionalProperties: false,\n properties: {\n findings: {\n description:\n \"One entry per verified factual claim; every entry carries at least one real source.\",\n items: {\n additionalProperties: false,\n properties: {\n claim: {\n description:\n \"A single, specific factual claim the draft can rely on.\",\n type: \"string\",\n },\n confidence: {\n description:\n \"'high' = multiple strong independent sources; 'low' = single or weaker source.\",\n enum: [\"high\", \"medium\", \"low\"],\n type: \"string\",\n },\n notes: {\n description:\n \"Caveats: date-sensitivity, scope limits, or where sources disagree.\",\n type: \"string\",\n },\n sources: {\n description:\n \"The real, fetched sources backing the claim; never empty, never invented.\",\n items: {\n additionalProperties: false,\n properties: {\n title: {\n description: \"The source's title or publication name.\",\n type: \"string\",\n },\n url: {\n description: \"The source URL, as visited.\",\n type: \"string\",\n },\n },\n required: [\"url\", \"title\"],\n type: \"object\",\n },\n minItems: 1,\n type: \"array\",\n },\n },\n required: [\"claim\", \"sources\", \"confidence\", \"notes\"],\n type: \"object\",\n },\n type: \"array\",\n },\n gaps: {\n description:\n \"What could not be found or verified; surfaced to the caller rather than guessed at.\",\n items: { type: \"string\" },\n type: \"array\",\n },\n summary: {\n description:\n \"A 1-3 sentence synthesis of what the research establishes, for the root to scan first.\",\n type: \"string\",\n },\n },\n required: [\"summary\", \"findings\", \"gaps\"],\n type: \"object\",\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/subagents/researcher/agent.ts"+ },+ {+ "contents": "import { defineAgent } from \"eve\";\n\n/**\n * Fresh-context draft-review subagent.\n *\n * @remarks\n * The root delegates here for a final, unbiased pass over a finished draft before proposing it\n * to the user. The reviewer runs in a fresh child session and inherits none of the root's\n * skills, connections, or tools — it carries its own copy of the `writing-quality` skill (and\n * its own sandbox to read that skill's references), so the root passes only the draft and any\n * voice or audience context in `message`. A reviewer that never saw the sources or the drafting\n * reasoning catches the AI-tells, bloated wording, and structure misses that self-review\n * rationalizes away. The skill copy under this folder's `skills/` is duplicated byte-for-byte\n * from the root's on purpose; keep the two identical when editing either.\n *\n * `description` is what the root reads to decide when to delegate; `outputSchema` makes the\n * verdict a structured result it can act on directly.\n *\n * @see The review rubric and verdict contract in this folder's `instructions.md`.\n */\nexport default defineAgent({\n description:\n \"Review a finished social post or thread draft with fresh context against the \" +\n \"writing-quality rubric (AI-tells, plain English, hook, structure, platform fit, voice) \" +\n \"before it goes to the user. The caller passes the full draft plus the target platform \" +\n \"and any voice or audience context in the message; the reviewer loads its own rubric \" +\n \"and returns a verdict with concrete issues.\",\n model: \"anthropic/claude-fable-5\",\n outputSchema: {\n additionalProperties: false,\n properties: {\n issues: {\n description:\n \"One entry per concrete problem; empty when the verdict is 'ready'.\",\n items: {\n additionalProperties: false,\n properties: {\n fix: {\n description: \"A concrete suggested change.\",\n type: \"string\",\n },\n quote: {\n description: \"The offending excerpt, quoted from the draft.\",\n type: \"string\",\n },\n rule: {\n description: \"The rubric rule or reference the excerpt breaks.\",\n type: \"string\",\n },\n severity: { enum: [\"high\", \"medium\", \"low\"], type: \"string\" },\n },\n required: [\"severity\", \"rule\", \"quote\", \"fix\"],\n type: \"object\",\n },\n type: \"array\",\n },\n verdict: {\n description:\n \"'ready' = clean enough to send as-is; 'revise' = fix the issues first.\",\n enum: [\"ready\", \"revise\"],\n type: \"string\",\n },\n },\n required: [\"verdict\", \"issues\"],\n type: \"object\",\n },\n});\n",+ "language": "typescript",+ "relativePath": "agent/subagents/reviewer/agent.ts"+ },+ {+ "contents": "import { defineTool } from \"eve/tools\";\nimport { z } from \"zod\";\n\n/**\n * Escape regular-expression metacharacters so a banned word is matched literally.\n *\n * @remarks\n * Banned words are read from a JSON file and interpolated into a `RegExp`. Without escaping,\n * an entry containing metacharacters could raise a syntax error or, worse, a\n * catastrophic-backtracking pattern (ReDoS) evaluated against caller-supplied `text`.\n * Escaping forces a literal, linear-time match.\n *\n * @param value - Raw banned word.\n * @returns The word with all regex metacharacters backslash-escaped.\n */\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Build a case-insensitive whole-word matcher for one banned entry.\n *\n * @remarks\n * A `\\b` boundary is only added at an edge whose character is a word character; `\\b` next to\n * punctuation (an entry like `\"agree?\"`) can never match, so such edges are left unanchored\n * instead of silently disabling the entry.\n *\n * @param value - Raw banned entry.\n * @returns A regex matching the entry literally, bounded where word boundaries exist.\n */\nconst STARTS_WITH_WORD_CHAR = /^\\w/;\nconst ENDS_WITH_WORD_CHAR = /\\w$/;\n\nfunction toMatcher(value: string): RegExp {\n const leading = STARTS_WITH_WORD_CHAR.test(value) ? \"\\\\b\" : \"\";\n const trailing = ENDS_WITH_WORD_CHAR.test(value) ? \"\\\\b\" : \"\";\n return new RegExp(`${leading}${escapeRegExp(value)}${trailing}`, \"i\");\n}\n\n/**\n * Maximum draft length accepted, in characters.\n *\n * @remarks\n * Bounds the work done per call and the size of accepted input. Comfortably larger than any\n * realistic draft for the supported surfaces.\n */\nconst MAX_TEXT_LENGTH = 100_000;\n\n/**\n * Schema for a `banned-words.json` file: a flat array of strings.\n *\n * @remarks\n * Parsed content that does not match (a non-array, or non-string elements) is rejected and\n * treated as an empty list rather than trusted.\n */\nconst BANNED_WORDS_SCHEMA = z.array(z.string());\n\n/**\n * Tool that checks a draft against the active surface's banned-words list.\n *\n * @remarks\n * The banned-words list lives in the matching style skill at `references/banned-words.json`\n * and is read at runtime through the skill handle. The `surface` input is constrained to a\n * fixed enum, so the resolved skill id and file path can never be influenced by the caller.\n * Any failure to resolve, read, parse, or validate the list is treated as \"no banned words\"\n * rather than failing the check. Run it before proposing a draft to the writer.\n */\nexport default defineTool({\n description:\n \"Check a draft against the surface's banned-words list and return any violations. \" +\n \"Run before proposing a draft to the writer.\",\n /**\n * Scan `text` for any banned word defined by the surface's style skill.\n *\n * @param input - Validated tool input.\n * @param input.surface - Content surface whose style skill supplies the banned-words list.\n * @param input.text - Draft text to scan.\n * @param ctx - Tool runtime context, used to read the skill's reference files.\n * @returns `ok` (true when no banned words are present) and human-readable `violations`.\n */\n async execute({ surface, text }, ctx) {\n let banned: string[] = [];\n try {\n const raw = await ctx\n .getSkill(`${surface}-style`)\n .file(\"references/banned-words.json\")\n .text();\n const parsed = BANNED_WORDS_SCHEMA.safeParse(JSON.parse(raw));\n if (parsed.success) {\n banned = [...new Set(parsed.data.map((w) => w.trim()).filter(Boolean))];\n }\n } catch {\n banned = [];\n }\n\n const hits = banned.filter((w) => toMatcher(w).test(text));\n return {\n ok: hits.length === 0,\n violations: hits.map(\n (w) => `Avoid \"${w}\" per the ${surface} style guide.`\n ),\n };\n },\n inputSchema: z.object({\n surface: z.enum([\"x\", \"linkedin\", \"threads\", \"bluesky\", \"mastodon\"]),\n text: z.string().min(1).max(MAX_TEXT_LENGTH),\n }),\n});\n",+ "language": "typescript",+ "relativePath": "agent/tools/lint_against_style.ts"+ }+ ]+ },"weather-agent-fixture": {- "sourceRevision": "5e3119b309cb92441a7a1d2bbc85dc59242dac29",+ "sourceRevision": "b502c1e76d574cc2c81d5aab49855fca4c1633ff","files": [{"contents": "import { defineAgent } from \"eve\";\n\nexport default defineAgent({\n model: \"anthropic/claude-sonnet-5\",\n modelOptions: {\n providerOptions: {\n openai: {\n reasoningEffort: \"high\",\n reasoningSummary: \"auto\",\n },\n },\n },\n});\n",diff --git a/apps/docs/lib/templates/manifest.ts b/apps/docs/lib/templates/manifest.tsindex bd372f0ba..3b78af507 100644--- a/apps/docs/lib/templates/manifest.ts+++ b/apps/docs/lib/templates/manifest.ts@@ -5,10 +5,12 @@export type TemplateCategory = "Chat" | "Collaboration" | "Example" | "Marketing";export type TemplateIntegration =+ | "GitHub"| "HTTP API"| "Linear"| "Notion"| "Resend"+ | "Sanity"| "Sentry"| "Slack"| "Typefully"@@ -114,6 +116,33 @@ export const templateManifest: TemplateManifestEntry[] = ["agent/tools/get_weather.ts",],},+ {+ slug: "kody-eve-template",+ title: "GitHub maintainer",+ setupPrompt:+ "I want to build a GitHub maintainer agent with the eve framework, using the Kody template. Read the setup instructions at https://agent-resources.dev/kody-eve-template.md and follow them. They will cover deploying the template, building with eve, how everything works overall, and more.",+ description:+ "Kody, a personal GitHub maintainer agent that emails you a weekly digest of open issues, acts on your email replies, summarizes new pull requests, answers @mentions, and works delegated Linear issues.",+ sourceHref: "https://github.com/vercel-labs/kody-eve-template/tree/main",+ category: "Collaboration",+ model: "anthropic/claude-fable-5",+ integrations: ["GitHub", "Linear", "Resend"],+ source: "Vercel Templates",+ github: { owner: "vercel-labs", repo: "kody-eve-template", ref: "main" },+ files: [+ "agent/agent.ts",+ "agent/channels/github.ts",+ "agent/channels/linear.ts",+ "agent/channels/resend.ts",+ "agent/connections/linear.ts",+ "agent/connections/resend.ts",+ "agent/instructions.ts",+ "agent/schedules/weekly-digest.ts",+ "agent/skills/triaging-issues/SKILL.md",+ "agent/subagents/researcher/agent.ts",+ "agent/tools/github.ts",+ ],+ },{slug: "marketing-team-eve-template",title: "Marketing team",@@ -139,6 +168,59 @@ export const templateManifest: TemplateManifestEntry[] = ["agent/subagents/social-media-coordinator/agent.ts",],},+ {+ slug: "sanity-copilot-eve-template",+ title: "Sanity copilot",+ setupPrompt:+ "I want to build a Slack agent with the eve framework, using the Sanity copilot template. Read the setup instructions at https://agent-resources.dev/sanity-copilot-eve-template.md and follow them. They will cover deploying the template, building with eve, how everything works overall, and more.",+ description:+ "A Slack-based Sanity copilot that queries and edits content with GROQ, inspects and shapes schemas, manages drafts and releases, and drafts long-form pieces into Notion.",+ sourceHref: "https://github.com/vercel-labs/sanity-copilot-eve-template/tree/main",+ category: "Collaboration",+ model: "anthropic/claude-sonnet-5",+ integrations: ["Slack", "Sanity", "Notion"],+ source: "Vercel Templates",+ github: { owner: "vercel-labs", repo: "sanity-copilot-eve-template", ref: "main" },+ files: [+ "agent/agent.ts",+ "agent/channels/slack.ts",+ "agent/connections/notion.ts",+ "agent/connections/sanity.ts",+ "agent/instructions.md",+ "agent/sandbox.ts",+ "agent/skills/sanity-best-practices/SKILL.md",+ "agent/subagents/researcher/agent.ts",+ "agent/subagents/reviewer/agent.ts",+ "agent/tools/upload_asset.ts",+ ],+ },+ {+ slug: "typefully-eve-template",+ title: "Social media",+ setupPrompt:+ "I want to build a Slack agent with the eve framework, using the Typefully social media agent template. Read the setup instructions at https://agent-resources.dev/typefully-eve-template.md and follow them. They will cover deploying the template, building with eve, how everything works overall, and more.",+ description:+ "A Slack-based social media agent that drafts posts and threads for X, LinkedIn, Threads, Bluesky, and Mastodon through Typefully, manages the publishing queue, and pulls briefs from Notion.",+ sourceHref: "https://github.com/vercel-labs/typefully-eve-template/tree/main",+ category: "Marketing",+ model: "anthropic/claude-sonnet-5",+ integrations: ["Slack", "Typefully", "Notion"],+ source: "Vercel Templates",+ github: { owner: "vercel-labs", repo: "typefully-eve-template", ref: "main" },+ files: [+ "agent/agent.ts",+ "agent/channels/slack.ts",+ "agent/connections/notion.ts",+ "agent/connections/typefully.ts",+ "agent/instructions.md",+ "agent/sandbox.ts",+ "agent/schedules/weekly-analytics.ts",+ "agent/skills/x-style/SKILL.md",+ "agent/subagents/researcher/agent.ts",+ "agent/subagents/reviewer/agent.ts",+ "agent/tools/lint_against_style.ts",+ ],+ },{slug: "weather-agent-fixture",title: "Weather",