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/durable-tomodeloutput-property.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@github-tools/eve-extension': patch
---

Register `toModelOutput` as a direct `defineTool` property so eve 0.44+ can stamp a durable descriptor. Agents on eve 0.46.1 no longer lose the whole GitHub toolset when a formatter like `getFileContent` fails descriptor validation. Requires `eve` `>=0.44.0`.
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Ten presets (`code-review`, `issue-triage`, `repo-explorer`, `ci-ops`, `security

- **TypeScript**: Strict mode, ESNext target, `verbatimModuleSyntax: true`
- **ESLint**: `typescript-eslint` flat config for SDK; `@nuxt/eslint` with stylistic rules for apps (no trailing commas, 1tbs brace style)
- **Peer deps**: `ai` and `zod` are peer deps of the SDK; `workflow` and `@workflow/ai` are optional peer deps for the workflow subpath
- **Peer deps**: `ai` and `zod` are peer deps of the SDK; `workflow` and `@workflow/ai` are optional peer deps for the workflow subpath; `@github-tools/eve-extension` requires `eve` `>=0.44`

### Code style — no slop

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/1.getting-started/2.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ What you install next depends on the [framework](/frameworks/ai-sdk) you build o
| Framework | Import path | Peer dependencies |
|---|---|---|
| [AI SDK](/frameworks/ai-sdk) | `@github-tools/sdk` | `ai` (v6 or v7), `zod` |
| [eve extension](/frameworks/eve-extension) | `@github-tools/eve-extension` | `eve` (**`ai` v7** transitively) |
| [eve extension](/frameworks/eve-extension) | `@github-tools/eve-extension` | `eve` (`>=0.44`, **`ai` v7** transitively) |
| [eve (direct import, deprecated)](/deprecated/eve) | `@github-tools/sdk/eve` | `eve`, `ai` **v7**, `zod` |
| [Vercel Workflow](/frameworks/vercel-workflow) | `@github-tools/sdk/workflow` | `workflow`, `@ai-sdk/workflow`, `ai`, `zod` |
| [Chat SDK](/frameworks/chat-sdk) | `@github-tools/sdk` | `chat`, `@chat-adapter/github`, `ai`, `zod` |
Expand All @@ -86,7 +86,7 @@ bun add ai zod

### Optional: eve extension (recommended for eve agents)

For [eve](https://eve.dev) filesystem-first agents, install `@github-tools/eve-extension` and its `eve` peer (which itself requires **`ai` v7**):
For [eve](https://eve.dev) filesystem-first agents, install `@github-tools/eve-extension` and its `eve` `>=0.44` peer (which itself requires **`ai` v7**):

:::code-group
```bash [pnpm]
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/2.frameworks/1.eve-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ bun add @github-tools/eve-extension
```
:::

`eve` is a required peer dependency (which itself requires **`ai` v7**):
`eve` is a required peer dependency (`>=0.44`, which itself requires **`ai` v7**):

:::code-group
```bash [pnpm]
Expand Down Expand Up @@ -208,7 +208,7 @@ export default githubExtension({

## Durable multi-turn sessions

The extension registers each tool with an **authored inline** `execute` and `toModelOutput` that only close over a serializable tool `name`, then rebuilds session options from the extension config on every call via `@github-tools/sdk/eve-runtime`. Tools resolve on `step.started` so registration stays fresh across durable steps. That pattern survives multi-turn eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51), [#99](https://github.com/vercel-labs/github-tools/issues/99)). Prefer this mount over the deprecated [`createGithubTools`](/deprecated/eve) / [`connectGithubTools`](/deprecated/eve) paths for Slack / multi-turn durable agents — those register tools from inside `node_modules` and are skipped on replay. Author `overrides.toModelOutput` inline in the agent; a function imported from a library will not get a durable descriptor.
The extension registers each tool with an **authored inline** `execute` and `toModelOutput` as **direct** `defineTool` properties that only close over a serializable tool `name`, then rebuilds session options from the extension config on every call via `@github-tools/sdk/eve-runtime`. Tools resolve on `step.started` so registration stays fresh across durable steps. That pattern survives multi-turn eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51), [#99](https://github.com/vercel-labs/github-tools/issues/99)). A spread or library-function `toModelOutput` has no durable descriptor: on eve 0.44+ the resolver discards the **entire** GitHub toolset. Prefer this mount over the deprecated [`createGithubTools`](/deprecated/eve) / [`connectGithubTools`](/deprecated/eve) paths for Slack / multi-turn durable agents — those register tools from inside `node_modules` and are skipped on replay. Author `overrides.toModelOutput` inline in the agent; a function imported from a library will not get a durable descriptor.

Object-shaped execute results include `rateLimit` (`remaining`, `limit`, `reset`, `resource`). `toModelOutput` strips it so the model never sees the remaining count; `toolResultFrom` and channels still do. See [Rate-limit metadata](/api/reference#rate-limit-metadata).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bun add @github-tools/eve-extension @vercel/connect eve
```
:::

`eve` is a required peer (itself requiring **`ai` v7**). See [Install optional workflow dependencies](/frameworks/eve-extension#install) for the full peer chart.
`eve` `>=0.44` is a required peer (itself requiring **`ai` v7**). See [Install optional workflow dependencies](/frameworks/eve-extension#install) for the full peer chart.

## Set up the connector

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/skills/github-tools-agents/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function run(messages: ModelMessage[], token: string) {

### eve extension (recommended for eve agents)

Requires `eve` (transitively **`ai` v7**). Mount from `@github-tools/eve-extension` under `agent/extensions/`.
Requires `eve` `>=0.44` (transitively **`ai` v7**). Mount from `@github-tools/eve-extension` under `agent/extensions/`.

```ts
// agent/extensions/github.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use `@github-tools/eve-extension` when the user builds an [eve](https://eve.dev)
pnpm add @github-tools/eve-extension eve
```

- **`ai` v7** required (transitive `eve` peer)
- **`ai` v7** required (transitive `eve` `>=0.44` peer)
- `GITHUB_TOKEN`, explicit `token`, or a Vercel Connect `connector`

## Mount under `agent/extensions/`
Expand Down Expand Up @@ -55,7 +55,7 @@ export default githubExtension({
})
```

Built-in `toModelOutput` formatters are applied via an inline callback that only closes over the tool name. That callback also strips `rateLimit` from the model-facing payload. Author `overrides.toModelOutput` inline in the agent — a library function will not get a durable descriptor on eve 0.44+. Execute failures return `{ error }` so the model still receives a `tool_result`.
Built-in `toModelOutput` formatters are a direct `defineTool` property whose callback only closes over the tool name (a spread ternary is not stamped). That callback also strips `rateLimit` from the model-facing payload. Author `overrides.toModelOutput` inline in the agent — a library function will not get a durable descriptor on eve 0.44+, and the resolver then drops every `github__*` tool. Execute failures return `{ error }` so the model still receives a `tool_result`. Requires `eve` `>=0.44`.

## Approval

Expand Down
2 changes: 1 addition & 1 deletion examples/eve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@github-tools/eve-extension": "workspace:*",
"@vercel/connect": "^0.6.1",
"ai": "^7.0.58",
"eve": "^0.40.0",
"eve": "^0.46.1",
"zod": "^4.3.6"
}
}
4 changes: 2 additions & 2 deletions packages/github-tools-eve-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This is **the recommended way** to add GitHub tools to an eve agent. The legacy
pnpm add @github-tools/eve-extension
```

`eve` is a required peer dependency; `@vercel/connect` is optional (install it only when using `connector`):
`eve` `>=0.44` is a required peer dependency; `@vercel/connect` is optional (install it only when using `connector`):

```sh
pnpm add eve
Expand All @@ -43,7 +43,7 @@ export default githubExtension({

> `code-review` pairs cleanly with a Connect `connector`. `maintainer` and `repo-explorer` include gist tools, and GitHub only grants gist access to user access tokens, never the installation tokens Connect mints, so gist calls 403 over Connect. Write tools already require approval via `always()` by default, so a plain `{ someTool: true }` is a no-op, use a predicate (as above) when you actually want to narrow or loosen the default.

Tools are registered with **inline** `execute` and `toModelOutput` handlers in the extension package so they survive multi-turn durable eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51), [#99](https://github.com/vercel-labs/github-tools/issues/99)). `toModelOutput` strips `rateLimit` from the model-facing payload; the execute result still carries it for hooks and channels. Do not use the deprecated `@github-tools/sdk/connect/eve` one-liner for durable Slack/multi-turn agents.
Tools are registered with **inline** `execute` and `toModelOutput` as direct `defineTool` properties so they survive multi-turn durable eve Workflow replay (see [#51](https://github.com/vercel-labs/github-tools/issues/51), [#99](https://github.com/vercel-labs/github-tools/issues/99)). A spread or imported `toModelOutput` has no durable descriptor: on eve 0.44+ the resolver discards every GitHub tool. `toModelOutput` strips `rateLimit` from the model-facing payload; the execute result still carries it for hooks and channels. Do not use the deprecated `@github-tools/sdk/connect/eve` one-liner for durable Slack/multi-turn agents.

`connector` also accepts a `() => string | Promise<string>` resolver, so the same config can pick a connector dynamically (e.g. by environment):

Expand Down
11 changes: 6 additions & 5 deletions packages/github-tools-eve-extension/extension/tools/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import extension from '../extension'
/**
* Rebuild options from extension config on every call.
* Durable `execute` / `toModelOutput` only close over a serializable tool `name`
* (#51, #99); reading config here avoids a module-level store that races across
* concurrent sessions.
* (#51, #99). `toModelOutput` must be a direct `defineTool` property — a spread
* ternary is invisible to eve's stamp, and 0.44+ then drops the whole toolset.
*/
function buildSessionOptions(): EveGithubToolsOptions {
const {
Expand Down Expand Up @@ -110,9 +110,10 @@ export default defineDynamic({
...(override?.approval !== undefined && !skipApproval && {
approval: mapEveApprovalValue(override.approval),
}),
...(override?.toModelOutput !== undefined
? { toModelOutput: override.toModelOutput }
: { toModelOutput: (output: unknown) => formatGithubEveToolOutput(name, output) }),
toModelOutput: (output: unknown) => {
const custom = buildSessionOptions().overrides?.[name]?.toModelOutput
return custom ? custom(output) : formatGithubEveToolOutput(name, output)
},
...(override?.outputSchema !== undefined && {
outputSchema: override.outputSchema,
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/github-tools-eve-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"peerDependencies": {
"@vercel/connect": ">=0.3.2",
"eve": "*"
"eve": ">=0.44.0"
},
"peerDependenciesMeta": {
"@vercel/connect": {
Expand All @@ -67,7 +67,7 @@
"@types/node": "^26.1.2",
"@vercel/connect": "^0.6.1",
"eslint": "^10.8.0",
"eve": "^0.40.0",
"eve": "^0.46.1",
"typescript": "^6.0.3",
"typescript-eslint": "^8.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/github-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@vercel/connect": "^0.6.1",
"ai": "^7.0.58",
"eslint": "^10.8.0",
"eve": "^0.40.0",
"eve": "~0.40.0",
"tsdown": "^0.22.14",
"typescript": "^6.0.3",
"typescript-eslint": "^8.65.0",
Expand Down
Loading
Loading