Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nine-crickets-sail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@github-tools/sdk": patch
---

Document `@github-tools/eve-extension` — a mountable eve extension distribution for the GitHub tools, built on top of the existing `@github-tools/sdk/eve` subpath. See `packages/github-tools-eve-extension` and the `examples/eve-extension-agent` starter.
1 change: 1 addition & 0 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
scopes: |
sdk
chat
eve
deps
types: |
breaking
Expand Down
24 changes: 24 additions & 0 deletions apps/docs/content/docs/2.frameworks/1.eve.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ links:

[eve](https://eve.dev) is Vercel's filesystem-first agent framework: an agent is a folder with instructions, a model config, and tools. With `@github-tools/sdk/eve`, that folder becomes a **complete GitHub agent in 3 files** — all 42 tools registered from a single file, with durable human-in-the-loop approval that actually pauses the session until a person approves.

::callout{icon="i-custom:eve"}
There are two ways to add the tools to an eve agent: importing `@github-tools/sdk/eve` directly (below), or mounting them as an [eve extension](#eve-extension) via `@github-tools/eve-extension`. Both are supported today — the extension is the direction this integration is moving toward and will become the recommended way to add GitHub tools to an eve agent.
::

::prompt
---
description: Add GitHub tools to an eve agent
Expand Down Expand Up @@ -216,6 +220,26 @@ export default connectGithubTools('github/my-connector', {

See [Vercel Connect](/guide/vercel-connect#eve-agent) for the connector setup checklist and multi-tenant scoping.

## eve extension

`@github-tools/eve-extension` packages the same tools as a mountable [eve extension](https://eve.dev/docs/extensions) instead of importing `@github-tools/sdk/eve` directly into `agent/tools/`. **This is the recommended direction going forward** — the direct `@github-tools/sdk/eve` import above keeps working and isn't going away, but new agents should prefer the extension:

```ts [agent/extensions/github.ts]
import githubExtension from '@github-tools/eve-extension'

export default githubExtension({
connector: 'github/my-connector', // or token: process.env.GITHUB_TOKEN
preset: 'maintainer',
requireApproval: {
mergePullRequest: true,
},
})
```

Tools are exposed to the model as `<namespace>__<toolName>`, where `<namespace>` comes from the mount file's name — `agent/extensions/github.ts` yields `github__listPullRequests`, `github__createIssue`, and so on. Not yet published to npm; see [`examples/eve-extension-agent`](https://github.com/vercel-labs/github-tools/tree/main/examples/eve-extension-agent) and [`packages/github-tools-eve-extension`](https://github.com/vercel-labs/github-tools/tree/main/packages/github-tools-eve-extension) to build and consume it from the workspace.

Once published, this extension will become the primary, recommended way to add GitHub tools to an eve agent; `@github-tools/sdk/eve` remains supported for direct imports.

## External references

- [How to build a GitHub agent with eve and GitHub Tools](https://vercel.com/kb/guide/github-agent-eve)
Expand Down
6 changes: 6 additions & 0 deletions examples/eve-extension-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
node_modules
.eve
.output
.vercel
.env*
68 changes: 68 additions & 0 deletions examples/eve-extension-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# GitHub eve Extension Agent

Minimal [eve](https://eve.dev) agent mounting `@github-tools/eve-extension` with the
`code-review` preset and a [Vercel Connect](https://vercel.com/docs/connect) connector.

## Setup

### 1. Link the Connect connector

The connector `github/test-github-tools` must be linked to your Vercel project and installed on
the GitHub org/repos you want the agent to access.

### 2. Pull the OIDC token for local dev

```bash
pnpm install
cd examples/eve-extension-agent
vercel link # select the github-tools-docs project (or your linked project)
vercel env pull
```

This writes `VERCEL_OIDC_TOKEN` into `.env`. Re-run `vercel env pull` when the token expires.

Requires Node 24+ and `ai` v7 (peer of `eve` v0.19+).

## Run

From the example directory:

```bash
pnpm dev
# or: npx eve dev
```

From the monorepo root:

```bash
pnpm dev:eve-extension-agent
```

## Project structure

```
agent/
agent.ts # eve agent config
instructions.md # system prompt
extensions/
github.ts # GitHub tools via @github-tools/eve-extension
```

## Customize

Swap the preset or configure approval:

```ts
import githubExtension from '@github-tools/eve-extension'

export default githubExtension({
connector: 'github/test-github-tools',
preset: ['code-review', 'issue-triage'],
requireApproval: {
mergePullRequest: true,
addPullRequestComment: 'once',
},
})
```

See the [@github-tools/eve-extension README](../../packages/github-tools-eve-extension/README.md).
5 changes: 5 additions & 0 deletions examples/eve-extension-agent/agent/agent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineAgent } from 'eve'

export default defineAgent({
model: 'anthropic/claude-sonnet-5',
})
9 changes: 9 additions & 0 deletions examples/eve-extension-agent/agent/extensions/github.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import githubExtension from '@github-tools/eve-extension'

export default githubExtension({
connector: 'github/test-github-tools',
preset: 'code-review',
requireApproval: {
addPullRequestComment: ({ toolInput }: { toolInput?: { owner?: string } }) => toolInput?.owner !== 'vercel-labs',
},
})
3 changes: 3 additions & 0 deletions examples/eve-extension-agent/agent/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You are a GitHub code-review assistant.

Use the GitHub tools (mounted as `github__*`) to inspect pull requests, read changed files, and post review comments. Be concise and actionable. Ask before merging or closing anything destructive.
17 changes: 17 additions & 0 deletions examples/eve-extension-agent/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@github-tools/eve-extension-agent",
"private": true,
"type": "module",
"engines": {
"node": "24.x"
},
"scripts": {
"dev": "eve dev"
},
"dependencies": {
"@github-tools/eve-extension": "workspace:*",
"ai": "^7.0.0",
"eve": "^0.26.2",
"zod": "^4.3.6"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dev": "turbo run --filter=@github-tools/chat dev",
"dev:pr-review-agent": "pnpm --filter @github-tools/pr-review-agent dev",
"dev:eve-agent": "pnpm --filter @github-tools/eve-agent dev",
"dev:eve-extension-agent": "pnpm --filter @github-tools/eve-extension-agent dev",
"docs:dev": "pnpm --filter @github-tools/docs dev",
"docs:build": "pnpm --filter @github-tools/docs build",
"docs:generate": "pnpm --filter @github-tools/docs generate",
Expand Down
56 changes: 56 additions & 0 deletions packages/github-tools-eve-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# @github-tools/eve-extension

GitHub tools for [eve](https://eve.dev), packaged as a mountable
[eve extension](https://eve.dev/docs/extensions).

This is the direction the eve integration is moving toward and will become the recommended way
to add GitHub tools to an eve agent. The direct `@github-tools/sdk/eve` import remains supported
in the meantime.

See the runnable consumer at [`examples/eve-extension-agent`](../../examples/eve-extension-agent).

## Structure

```
extension/
extension.ts # defineExtension() config schema (token, connector, preset, requireApproval, ...)
tools/
github.ts # defineDynamic() returning buildEveToolMap(...) filtered by preset
```

## Build

```sh
pnpm --filter @github-tools/eve-extension build # runs `eve extension build`
```

## Mount it

```ts
// agent/extensions/github.ts
import githubExtension from '@github-tools/eve-extension'

export default githubExtension({
connector: 'github/my-connector', // or token: process.env.GITHUB_TOKEN
preset: 'maintainer',
requireApproval: {
mergePullRequest: true,
addPullRequestComment: ({ toolInput }) => toolInput?.owner !== 'vercel-labs',
},
})
```

Tools are exposed to the model as `<namespace>__<toolName>`, where `<namespace>` comes from the
mount file's name (`extensions/github.ts` → `github__listPullRequests`, `github__createIssue`, ...).

## Config schema (`extension/extension.ts`)

| Field | Type | Notes |
|---|---|---|
| `token` | `string?` | Falls back to `GITHUB_TOKEN` when omitted and `connector` is not set |
| `connector` | `string?` | Vercel Connect connector name; takes priority over `token` |
| `connect` | `record?` | Passed through to `getToken` when `connector` is set |
| `preset` | preset name or array | `code-review`, `issue-triage`, `ci-ops`, `repo-explorer`, `maintainer` |
| `requireApproval` | `boolean \| record` | Global or per-tool; per-tool values may be predicate functions |
| `overrides` | `record` | Per-tool `description` / `approval` / `toModelOutput` / `outputSchema` |
| `author` / `committer` / `coAuthors` | commit identity | Attribution for commit-creating tools |
29 changes: 29 additions & 0 deletions packages/github-tools-eve-extension/extension/extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { defineExtension } from 'eve/extension'
import { z } from 'zod'

const presetNameSchema = z.enum(['code-review', 'issue-triage', 'ci-ops', 'repo-explorer', 'maintainer'])

const commitIdentitySchema = z.object({
name: z.string(),
email: z.string(),
})

export default defineExtension({
config: z.object({
/** GitHub PAT. Falls back to `GITHUB_TOKEN` when omitted and `connector` is not set. */
token: z.string().optional(),
/** Vercel Connect connector name (e.g. `github/my-connector`). Takes priority over `token`. */
connector: z.string().optional(),
/** Vercel Connect token params passed through to `getToken` when `connector` is set. */
connect: z.record(z.string(), z.unknown()).optional(),
/** Restrict tools to a preset (or array of presets). Omit for all 42 tools. */
preset: z.union([presetNameSchema, z.array(presetNameSchema)]).optional(),
/** Global boolean or per-tool approval config — may hold predicate functions. */
requireApproval: z.union([z.boolean(), z.record(z.string(), z.unknown())]).optional(),
/** Per-tool overrides (description, approval, toModelOutput, outputSchema). */
overrides: z.record(z.string(), z.unknown()).optional(),
author: commitIdentitySchema.optional(),
committer: commitIdentitySchema.optional(),
coAuthors: z.array(commitIdentitySchema).optional(),
}),
})
26 changes: 26 additions & 0 deletions packages/github-tools-eve-extension/extension/tools/github.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { connectGithubToken } from '@github-tools/sdk/connect'
import { buildEveToolMap, type EveApprovalConfig, type EveToolOverrides } from '@github-tools/sdk/eve'
import { defineDynamic } from 'eve/tools'
import extension from '../extension'

export default defineDynamic({
events: {
'session.started': async () => {
const { token, connector, connect, preset, requireApproval, overrides, author, committer, coAuthors } = extension.config

const resolvedToken = connector
? connectGithubToken(connector, { preset, params: connect })
: token

return buildEveToolMap({
token: resolvedToken,
preset,
requireApproval: requireApproval as EveApprovalConfig | undefined,
overrides: overrides as EveToolOverrides | undefined,
author,
committer,
coAuthors,
})
},
},
})
52 changes: 52 additions & 0 deletions packages/github-tools-eve-extension/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@github-tools/eve-extension",
"version": "0.0.0",
"private": true,
"description": "GitHub tools for eve, distributed as a mountable eve extension (https://eve.dev/docs/extensions)",
"type": "module",
"engines": {
"node": "24.x"
},
"eve": {
"extension": {
"source": "./extension",
"dist": "./dist/extension"
}
},
"files": [
"dist"
],
"scripts": {
"build": "eve extension build",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@github-tools/sdk": "workspace:*",
"zod": "^4.3.6"
},
"peerDependencies": {
"@vercel/connect": ">=0.3.2",
"eve": "*"
},
"peerDependenciesMeta": {
"@vercel/connect": {
"optional": true
}
},
"devDependencies": {
"@types/node": "^25.6.0",
"@vercel/connect": "^0.4.2",
"eve": "^0.26.2",
"typescript": "^6.0.3"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"./tools": {
"types": "./dist/tools/index.d.ts",
"default": "./dist/tools/index.mjs"
}
}
}
19 changes: 19 additions & 0 deletions packages/github-tools-eve-extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"resolveJsonModule": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"lib": ["ESNext"],
"types": ["node"]
},
"include": ["extension"],
"exclude": ["dist", "node_modules"]
}
2 changes: 2 additions & 0 deletions packages/github-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ connectGithubTools('github/my-connector', {

[eve](https://eve.dev) is Vercel's filesystem-first agent framework. The `@github-tools/sdk/eve` subpath registers all GitHub tools via `defineDynamic` — one file, zero CLI.

> A mountable [eve extension](https://eve.dev/docs/extensions), `@github-tools/eve-extension`, is also available and is the direction this integration is moving toward — it will become the recommended way to add GitHub tools to an eve agent. The direct import below remains supported. See [`packages/github-tools-eve-extension`](../github-tools-eve-extension) and [`examples/eve-extension-agent`](../../examples/eve-extension-agent).

```sh
pnpm add @github-tools/sdk eve ai zod
```
Expand Down
Loading
Loading