Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

feat(eve): move GitHub work into the eve/extensions/git extension (#4439)

Rui2cc43caed374
diff --git a/.changeset/eve-git-extension.md b/.changeset/eve-git-extension.md
new file mode 100644
index 000000000..5cd14b10e
--- /dev/null
+++ b/.changeset/eve-git-extension.md
@@ -0,0 +1,9 @@
+---
+"eve": minor
+---
+
+GitHub work moves out of `eve/extensions/code` into a new built-in extension, `eve/extensions/git`. The code extension used to tell every agent that "GitHub credentials are not available to ordinary `bash`" and to route GitHub work through its `gh` tool, which only works with Connect-brokered `github` config. Agents whose shell already has `gh` credentials were steered to a tool that could not authenticate.
+
+`git({})` adds the GitHub instructions and a `git__pr` skill that commits, pushes, and opens a draft with the shell's `gh pr create --draft`. `git({ github })` adds the Connect-brokered `git__gh` tool and switches `git__pr` to the signed-commit workflow. The tool and sandbox helpers are exported from `eve/extensions/git/tools` and `eve/extensions/git/sandbox`.
+
+Deprecated: `code({ github })`. While it is set, the code extension still contributes `code__gh`, its GitHub instructions, and the signed-commit `code__pr` skill. Without it, `code({})` no longer contributes `code__gh`, `code__pr`, or any GitHub instructions; mount `eve/extensions/git` for the pull request skill. `gh` from `eve/extensions/code/tools` and the GitHub shell helpers from `eve/extensions/code/sandbox` still work but are deprecated.
diff --git a/.github/workflows/e2e-local.yml b/.github/workflows/e2e-local.yml
index 977280aab..9f794f20a 100644
--- a/.github/workflows/e2e-local.yml
+++ b/.github/workflows/e2e-local.yml
@@ -36,9 +36,9 @@ jobs:
fi
# HEAD is the PR merge commit; HEAD^1 is the base branch tip, so
# this diff is exactly the PR's changed files.
- # PRs confined to packages/eve-code or packages/eve-computer-use (lockfile included) never
+ # PRs confined to packages/eve-code, eve-git, or eve-computer-use (lockfile included) never
# exercise the framework e2e fixtures; skip the whole matrix for them.
- if ! git diff --name-only HEAD^1 HEAD | grep -qvE '^(packages/eve-(code|computer-use)/|pnpm-lock\.yaml$)'; then
+ if ! git diff --name-only HEAD^1 HEAD | grep -qvE '^(packages/eve-(code|git|computer-use)/|pnpm-lock\.yaml$)'; then
echo "relevant=false" >> "$GITHUB_OUTPUT"
exit 0
fi
diff --git a/.github/workflows/e2e-postgres.yml b/.github/workflows/e2e-postgres.yml
index 56b934b9f..8abd0d2ff 100644
--- a/.github/workflows/e2e-postgres.yml
+++ b/.github/workflows/e2e-postgres.yml
@@ -34,9 +34,9 @@ jobs:
fi
# HEAD is the PR merge commit; HEAD^1 is the base branch tip, so
# this diff is exactly the PR's changed files.
- # PRs confined to packages/eve-code or packages/eve-computer-use (lockfile included) never
+ # PRs confined to packages/eve-code, eve-git, or eve-computer-use (lockfile included) never
# exercise the framework e2e fixtures; skip the whole matrix for them.
- if ! git diff --name-only HEAD^1 HEAD | grep -qvE '^(packages/eve-(code|computer-use)/|pnpm-lock\.yaml$)'; then
+ if ! git diff --name-only HEAD^1 HEAD | grep -qvE '^(packages/eve-(code|git|computer-use)/|pnpm-lock\.yaml$)'; then
echo "relevant=false" >> "$GITHUB_OUTPUT"
exit 0
fi
diff --git a/.gitignore b/.gitignore
index 5986af508..7e0ed0c21 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ apps/benchmarks/evals/*/.eve-authoring-bootstrap.json
packages/eve/.workflow-vitest/
packages/eve/.generated/
packages/eve/src/extensions/code/extension/
+packages/eve/src/extensions/git/extension/
packages/eve/src/computer-use/extension/
playwright-report/
test-results/
diff --git a/docs/code-extension.mdx b/docs/code-extension.mdx
index b5a8e0382..1a5a2c138 100644
--- a/docs/code-extension.mdx
+++ b/docs/code-extension.mdx
@@ -3,7 +3,7 @@ title: "Code Extension"
description: "Mount eve's coding extension, eve-code, and see its latest benchmark results against other coding agent harnesses."
---
-`eve/extensions/code` (eve-code) turns an eve agent into a coding agent. It ships inside the `eve` package, so you mount it without installing anything else. The extension contributes file-editing and search tools, an authenticated GitHub CLI tool, coding skills, a read-only worker subagent, and sandbox bootstrap helpers.
+`eve/extensions/code` (eve-code) turns an eve agent into a coding agent. It ships inside the `eve` package, so you mount it without installing anything else. The extension contributes file-editing and search tools, coding skills, a read-only worker subagent, and sandbox bootstrap helpers. GitHub and pull request work lives in the companion [`eve/extensions/git`](#publish-with-the-git-extension) extension.
## Benchmark results
@@ -50,15 +50,12 @@ import code from "eve/extensions/code";
export default code({});
```
-`code({})` mounts the extension without GitHub or Vercel authentication. Add the options below when the agent needs them.
+`code({})` mounts the extension without Vercel authentication. Add the options below when the agent needs them.
## Configure the extension
| Option | Required | Effect |
| ------------------------------ | ------------- | ---------------------------------------------------------------------------------------------- |
-| `github.connector` | With `github` | Connector that mints a GitHub token |
-| `github.org` | With `github` | Organization whose repositories the `gh` tool can access |
-| `github.broker` | With `github` | `broker(sandbox, rules)` callback that installs, then removes, the GitHub credential rules |
| `vercel.connector` | With `vercel` | Connector that requests an app-subject Vercel token |
| `vercel.delivery` | No | `"firewall"` (default) or `"command"` |
| `broker` | No | `broker(sandbox, rules)` callback that merges Vercel credential rules into your network policy |
@@ -79,9 +76,33 @@ export default code({
With firewall delivery, Vercel tokens never enter sandbox processes. Firewall delivery without a top-level `broker` requires a sandbox provider that exposes `setNetworkPolicy()`, and fails otherwise. Set `vercel.delivery: "command"` for providers without a mutable network policy.
+To use a personal access token or another credential provider, omit the connector and call `authenticateGitHub` or `authenticateVercel` from `eve/extensions/code/sandbox` in your own sandbox lifecycle. These helpers authenticate commands you run yourself; they do not configure the `gh` tool.
+
+## Publish with the git extension
+
+`eve/extensions/git` contributes the GitHub instructions and the `pr` skill. Mount it next to the code extension when the agent should open pull requests:
+
+```ts title="agent/extensions/git.ts"
+import git from "eve/extensions/git";
+
+export default git({});
+```
+
+`git({})` assumes the agent's shell already has GitHub credentials. The agent uses the `gh` and `git` CLIs in `bash`, and `git__pr` commits, pushes, and opens a draft with `gh pr create --draft`. No tool is added.
+
+Configure `github` to broker GitHub access through Connect instead. The extension then adds the authenticated `git__gh` tool, tells the agent to use it for every authenticated GitHub operation, and switches `git__pr` to `gh-signed-commit` for repositories that require verified signatures.
+
+| Option | Required | Effect |
+| ------------------ | ------------- | ------------------------------------------------------------------------------------------ |
+| `github.connector` | With `github` | Connector that mints a GitHub token |
+| `github.org` | With `github` | Organization whose repositories the `gh` tool can access |
+| `github.broker` | With `github` | `broker(sandbox, rules)` callback that installs, then removes, the GitHub credential rules |
+
The `gh` tool requests a token scoped to exactly one repository in `github.org` for each invocation. The sandbox process receives a placeholder `GH_TOKEN`, and the firewall exchanges it on matching GitHub requests. Your `github.broker` callback receives the header-transform rules for the command, then `null` to remove the lease. The callback must preserve your other network rules. GitHub authentication has no command-delivery option.
-To use a personal access token or another credential provider, omit the connector and call `authenticateGitHub` or `authenticateVercel` from `eve/extensions/code/sandbox` in your own sandbox lifecycle. These helpers authenticate commands you run yourself; they do not configure the `gh` tool.
+### Migrate from `code({ github })`
+
+`code({ github })` is deprecated. While it is set, the code extension still contributes `code__gh`, its GitHub instructions, and the signed-commit `code__pr` skill. Without it, the code extension contributes no GitHub tool, instructions, or pull request skill. Move the `github` option to `git({ github })`, and import `gh` and the GitHub sandbox helpers from `eve/extensions/git/tools` and `eve/extensions/git/sandbox`.
## Prepare the sandbox
@@ -101,7 +122,7 @@ export const environment = VercelSandbox.environment({
export default defineSandbox(() => environment.open());
```
-Preparation installs `gh`, wrappers for `gh`, `vc`, and `gh-signed-commit`, and TypeScript diagnostics. For repositories that require verified signatures, stage your changes and commit with `gh-signed-commit`.
+Preparation installs `gh`, wrappers for `gh`, `vc`, and `gh-signed-commit`, and TypeScript diagnostics. With the git extension's `github` configured, repositories that require verified signatures can use `gh-signed-commit` through the `gh` tool after staging changes.
eve derives the prepared environment generation from the sandbox file and environment options, not from imported helpers. Upgrading eve alone does not rebuild an existing prepared environment.
diff --git a/packages/eve-code/AGENTS.md b/packages/eve-code/AGENTS.md
index 0519ef13a..b56bb60a6 100644
--- a/packages/eve-code/AGENTS.md
+++ b/packages/eve-code/AGENTS.md
@@ -1,12 +1,13 @@
# @eve/code Extension Package
-This private package is the source of the `eve/extensions/code` extension for CLI-based coding work. It contributes one patch editing primitive, an authenticated `gh` tool, sandbox `grep`, shared PR-watch primitives, investigation and PR skills, instruction fragments, a read-only worker subagent, Connect-backed authentication hooks, and consumer sandbox helpers. Durable `prwatch` / `prwatch_delete` wrappers currently live beside e0's consumer mount because eve workflow directives are application-only.
+This private package is the source of the `eve/extensions/code` extension for CLI-based coding work. It contributes one patch editing primitive, sandbox `grep`, shared PR-watch primitives, investigation and review skills, instruction fragments, a read-only worker subagent, Connect-backed authentication hooks, and consumer sandbox helpers. Durable `prwatch` / `prwatch_delete` wrappers currently live beside e0's consumer mount because eve workflow directives are application-only.
Before writing code, read the installed eve package docs for extensions, hooks, tools, skills, subagents, and sandboxes as applicable.
## Boundaries
-- Connector UIDs and GitHub organization names enter through extension config. The authentication hook resolves Vercel app tokens before each turn; the `gh` tool leases a repository-scoped GitHub token per invocation.
+- Connector UIDs enter through extension config. The authentication hook resolves Vercel app tokens before each turn.
+- GitHub instructions, the `pr` skill, and the `gh` tool belong to `@eve/git` (`eve/extensions/git`). The deprecated `github` config keeps `code__gh`, `code__pr`, and the GitHub instructions through `extension/lib/github-compat.ts`, which imports `eve/extensions/git/sandbox`; add no other GitHub or pull request content here.
- Consumers with non-Connect credentials may call `authenticateGitHub` or `authenticateVercel` directly from their sandbox lifecycle.
- Broker credentials without placing them in model-authored URLs or arguments.
- Use real `git`, `gh`, and `vc` CLIs rather than bespoke repository lifecycle tools.
diff --git a/packages/eve-code/README.md b/packages/eve-code/README.md
index 6713f4a0b..9f9f1539c 100644
--- a/packages/eve-code/README.md
+++ b/packages/eve-code/README.md
@@ -1,12 +1,12 @@
# eve/extensions/code
-`eve/extensions/code` is an eve extension for coding work. It contributes `apply_patch`, `gh`, `grep`, investigation and PR skills, a read-only worker subagent, sandbox tooling, and shared PR-watch primitives. Vercel credentials are brokered before each turn; GitHub credentials are scoped to one repository and leased for each `gh` tool invocation. Because eve workflow directives are application-only, consumers own their `prwatch` / `prwatch_delete` workflow tools.
+`eve/extensions/code` is an eve extension for coding work. It contributes `apply_patch`, `grep`, investigation and review skills, a read-only worker subagent, sandbox tooling, and shared PR-watch primitives. Vercel credentials are brokered before each turn. GitHub instructions, the `pr` skill, and the authenticated `gh` tool live in [`eve/extensions/git`](../eve-git/README.md). Because eve workflow directives are application-only, consumers own their `prwatch` / `prwatch_delete` workflow tools.
It ships inside the `eve` package. This private `@eve/code` workspace package is its source of truth: eve's build copies `extension/` into `packages/eve/src/extensions/code/extension` and publishes it with these entry points:
- `eve/extensions/code`: the extension
- `eve/extensions/code/sandbox`: sandbox bootstrap and credential helpers
-- `eve/extensions/code/tools`: `apply_patch`, `gh`, and `grep`
+- `eve/extensions/code/tools`: `apply_patch` and `grep` (`gh` is a deprecated re-export)
- `eve/extensions/code/prwatch`: PR-watch primitives for consumer-owned workflow tools
## Mount
@@ -23,7 +23,7 @@ export default code({
Both connectors are optional; `code({})` mounts without either. The Vercel connector requests an app-subject token. Firewall delivery is the default and keeps tokens outside sandbox processes; without a consumer `broker`, it requires a sandbox provider that exposes `setNetworkPolicy()` and fails otherwise. Use `delivery: "command"` on the Vercel connector for providers without mutable network policy. A top-level `broker(sandbox, rules)` callback lets the consumer merge Vercel credential rules into its own network policy.
-To enable the authenticated `gh` tool, configure `github` with `connector`, `org`, and a required `broker(sandbox, rules)` callback. The tool requests a token for exactly one repository in that organization. The callback installs the supplied GitHub header-transform rules for the command, then receives `null` to remove the lease. It must preserve the consumer's other network rules. GitHub authentication has no command-delivery option on this tool; sandbox processes receive a placeholder token, not the real credential.
+The `github` option is deprecated; configure it on `eve/extensions/git` instead. While it is set here, this extension still contributes `code__gh`, its GitHub instructions, and the signed-commit `code__pr` skill. Without it, this extension contributes no GitHub tool, instructions, or pull request skill.
The read-only worker subagent defaults to `openai/gpt-5.6-terra-fast` with `xhigh` reasoning. Set `worker: { model, reasoning, openaiReasoningEffort? }` to choose another model; `openaiReasoningEffort` is passed to OpenAI models as `reasoningEffort`.
@@ -50,7 +50,7 @@ eve derives the prepared environment generation from the sandbox file and enviro
Computer use lives in `eve/computer-use`. Mount it next to this extension when the sandbox has a desktop. `installComputerUse`, `startComputerUse`, and `COMPUTER_USE_REVALIDATION_KEY` are still re-exported from `eve/extensions/code/sandbox`, and `computer_use` from `eve/extensions/code/tools`, but both are deprecated.
-Preparation ensures `gh`, installs wrappers for `gh`, `vc`, and `gh-signed-commit`, and installs TypeScript diagnostics. For repositories requiring verified signatures, stage the intended changes and use `gh-signed-commit`.
+Preparation ensures `gh`, installs wrappers for `gh`, `vc`, and `gh-signed-commit`, and installs TypeScript diagnostics. With `eve/extensions/git` configured for `github`, repositories requiring verified signatures use `gh-signed-commit` through its `gh` tool.
## Non-Connect escape hatch
diff --git a/packages/eve-code/extension/extension.ts b/packages/eve-code/extension/extension.ts
index 3153c9735..a813a9824 100644
--- a/packages/eve-code/extension/extension.ts
+++ b/packages/eve-code/extension/extension.ts
@@ -2,25 +2,16 @@ import { defineExtension } from "eve/extension";
import type { SandboxSession } from "eve/sandbox";
import { z } from "zod";
+import type { GitHubConfig } from "eve/extensions/git/sandbox";
+
export type CredentialPolicyBroker = (
sandbox: SandboxSession,
rules: Record<string, Record<string, string>>,
) => Promise<void>;
-export interface GitHubLeaseRule {
- readonly match?: {
- readonly headers?: readonly {
- readonly key?: { readonly exact: string };
- readonly value?: { readonly exact?: string; readonly regex?: string };
- }[];
- };
- readonly transform: readonly { readonly headers: Readonly<Record<string, string>> }[];
-}
+export type { GitHubLeaseRule } from "eve/extensions/git/sandbox";
-export type GitHubLeaseBroker = (
- sandbox: SandboxSession,
- rules: Readonly<Record<string, readonly GitHubLeaseRule[]>> | null,
-) => Promise<void>;
+export type GitHubLeaseBroker = GitHubConfig["broker"];
const fn = <T>() => z.custom<T>((value) => typeof value === "function");
const delivery = z.enum(["firewall", "command"]).default("firewall");
@@ -29,6 +20,11 @@ const openaiReasoningEffort = z.enum(["none", "minimal", "low", "medium", "high"
export default defineExtension({
config: z.object({
+ /**
+ * @deprecated Mount `eve/extensions/git` with this `github` config instead.
+ * While set, this extension still contributes the authenticated `gh` tool,
+ * its instructions, and the signed-commit `pr` skill.
+ */
github: z
.object({
connector: z.string().min(1),
diff --git a/packages/eve-code/extension/instructions.md b/packages/eve-code/extension/instructions.md
index 5beabc361..0d6b33182 100644
--- a/packages/eve-code/extension/instructions.md
+++ b/packages/eve-code/extension/instructions.md
@@ -49,20 +49,10 @@ Required steps, in order:
# Repository work
-GitHub credentials are not available to ordinary `bash`. Use the `gh` tool for every authenticated GitHub operation. The full `gh` CLI surface is available. Declare exactly one repository in the configured organization with write-capable access. Authenticated commands run without an approval prompt; describe the intended GitHub-side result accurately in `description`. Connect mints the real token for only the declared repository. The sandbox process receives only a placeholder `GH_TOKEN`, and the firewall exchanges it on matching GitHub requests. GitHub rejects access outside the token's server-side repository scope. Never put credentials in URLs or commands. If access is denied, report it plainly and stop.
-
-Pass commands as simple argv with ordinary quoting. Do not use environment assignments, pipes, redirects, substitutions, or other shell syntax. Commands without an explicit repository may use normal `gh` context, but their token remains scoped to the declared repository. An explicit `-R`, `--repo`, `--repo=`, or repository argument to `gh repo clone`, `view`, or `fork` must match the declaration.
-
-Determine the repositories needed to complete the task through source discovery and investigation, even when the requester does not name them. Do not ask the requester to enumerate repositories that can be discovered, and never default to the current agent's repository. The agent may select additional repositories as the work reveals them. Each authenticated command declares exactly one target repository and mints a credential lease for that repository at the moment it is needed, so cross-repository work uses separate scoped commands and leases.
-
-Clone with `gh repo clone owner/name`. Use authenticated `git fetch`, `git pull`, `git push`, and `git ls-remote` through the `gh` tool too. Local `git status`, `diff`, `add`, `commit`, and `rebase` remain ordinary `bash` commands because they need no GitHub credential. Immediately after entering a checkout and before planning or editing, read its root `AGENTS.md`; use root `CLAUDE.md` only when `AGENTS.md` is absent. Before touching any path, read the nearest nested `AGENTS.md`, falling back to `CLAUDE.md` only when that directory has no `AGENTS.md`.
+Immediately after entering a checkout and before planning or editing, read its root `AGENTS.md`; use root `CLAUDE.md` only when `AGENTS.md` is absent. Before touching any path, read the nearest nested `AGENTS.md`, falling back to `CLAUDE.md` only when that directory has no `AGENTS.md`.
Do not rebase before work by default. Rebase only when the requester explicitly asks for it or when an explicitly requested publication or delivery outcome requires a current base. Inspect the worktree first and preserve pre-existing changes.
-Use GitHub CLI commands through the `gh` tool for issues, pull requests, reviews, Actions, CI, authentication status, configuration, aliases, extensions, and API requests. Common commands include `gh pr create --draft`, `gh pr checks`, `gh run rerun --failed`, and `gh pr review`, but they are not restrictions.
-
-Repositories that require verified signatures reject ordinary sandbox commits. Stage the intended changes explicitly, run `gh-signed-commit --repo owner/name --branch <branch> -m <headline>` through the `gh` tool, then create the draft pull request through the same tool.
-
Use apply_patch for authored edits. Formatters and generators may write their own output. Never rewrite files through shell or Python when a focused patch is sufficient. Write small hunks against current file contents. If a hunk misses, re-read that file and rewrite only the failed hunk.
Use `grep` for sandbox content search. Start with `files_with_matches` and a narrow path or glob.
@@ -73,8 +63,6 @@ Make the smallest coherent change. Run focused validation first, then broader ch
Be mindful of loading large files into your context window.
-Load the pr skill before publishing. Create one pull request per request unless the requester asks otherwise.
-
## Destructive actions
Before deleting, overwriting, or making data difficult to recover, confirm scope and resolve the exact target with read-only checks. Never use a home directory, repository root, workspace root, unresolved variable, broad glob, or command substitution as a recursive destructive target. Prefer recoverable operations and stop when target or authority is unclear.
diff --git a/packages/eve-code/extension/instructions/github.ts b/packages/eve-code/extension/instructions/github.ts
new file mode 100644
index 000000000..b6b1b546e
--- /dev/null
+++ b/packages/eve-code/extension/instructions/github.ts
@@ -0,0 +1,14 @@
+import { githubInstructions } from "eve/extensions/git/sandbox";
+import { defineDynamic, defineInstructions } from "eve/instructions";
+
+import { deprecatedGitHubConfigured } from "../lib/github-compat.ts";
+
+/** @deprecated Mount `eve/extensions/git` with `github` config. */
+export default defineDynamic({
+ events: {
+ "session.started": () =>
+ deprecatedGitHubConfigured()
+ ? defineInstructions({ content: githubInstructions(true) })
+ : null,
+ },
+});
diff --git a/packages/eve-code/extension/lib/github-compat.ts b/packages/eve-code/extension/lib/github-compat.ts
new file mode 100644
index 000000000..170d74cf5
--- /dev/null
+++ b/packages/eve-code/extension/lib/github-compat.ts
@@ -0,0 +1,15 @@
+/**
+ * Deprecated `code({ github })` support. GitHub moved to `eve/extensions/git`;
+ * these contributions resolve only while the deprecated `github` config is set,
+ * so `code({})` contributes no GitHub tool, instructions, or pull request skill.
+ */
+import { defineGhTool } from "eve/extensions/git/sandbox";
+
+import extension from "../extension.ts";
+
+export function deprecatedGitHubConfigured(): boolean {
+ return extension.config.github !== undefined;
+}
+
+/** @deprecated Mount `eve/extensions/git` with `github` config, or import `gh` from `eve/extensions/git/tools`. */
+export const gh = defineGhTool(() => extension.config.github);
diff --git a/packages/eve-code/extension/lib/sandbox.ts b/packages/eve-code/extension/lib/sandbox.ts
index 6f7e55ae7..ac744f962 100644
--- a/packages/eve-code/extension/lib/sandbox.ts
+++ b/packages/eve-code/extension/lib/sandbox.ts
@@ -94,10 +94,11 @@ export {
startComputerUse,
} from "eve/computer-use/sandbox";
+/** @deprecated Import from `eve/extensions/git/sandbox`. */
export {
executeGitHubShell,
githubShellApproval,
type GitHubLeaseRule,
type GitHubShellInput,
type GitHubShellOutput,
-} from "./github-shell.ts";
+} from "eve/extensions/git/sandbox";
diff --git a/packages/eve-code/extension/lib/tooling.ts b/packages/eve-code/extension/lib/tooling.ts
index ccc3105d1..66cb431d8 100644
--- a/packages/eve-code/extension/lib/tooling.ts
+++ b/packages/eve-code/extension/lib/tooling.ts
@@ -1,6 +1,10 @@
import type { SandboxSession } from "eve/sandbox";
-import { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION } from "./signed-commit.ts";
+import {
+ GH_SIGNED_COMMIT_SOURCE,
+ GH_SIGNED_COMMIT_VERSION,
+ GITHUB_TOOLING_PATHS,
+} from "eve/extensions/git/sandbox";
import { shellQuote } from "./shell.ts";
export { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION };
@@ -16,11 +20,11 @@ export function toolingPaths(sandbox: Pick<SandboxSession, "resolvePath">) {
root,
trustedRoot,
env: `${root}/env`,
- ghReal: `${trustedRoot}/gh`,
+ ghReal: GITHUB_TOOLING_PATHS.ghReal,
ghWrapper: `${root}/gh`,
vercelWrapper: `${root}/vercel`,
signedCommit: `${root}/gh-signed-commit`,
- trustedSignedCommit: `${trustedRoot}/gh-signed-commit`,
+ trustedSignedCommit: GITHUB_TOOLING_PATHS.trustedSignedCommit,
typescriptRoot: `${trustedRoot}/typescript`,
typescriptModule: TYPESCRIPT_MODULE,
workerSource: `${root}/diagnostics.cjs`,
diff --git a/packages/eve-code/extension/skills/pr.ts b/packages/eve-code/extension/skills/pr.ts
new file mode 100644
index 000000000..464c4471c
--- /dev/null
+++ b/packages/eve-code/extension/skills/pr.ts
@@ -0,0 +1,14 @@
+import { prSkillDescription, prSkillMarkdown } from "eve/extensions/git/sandbox";
+import { defineDynamic, defineSkill } from "eve/skills";
+
+import { deprecatedGitHubConfigured } from "../lib/github-compat.ts";
+
+/** @deprecated Mount `eve/extensions/git`, which contributes the same skill as `git__pr`. */
+export default defineDynamic({
+ events: {
+ "session.started": () =>
+ deprecatedGitHubConfigured()
+ ? defineSkill({ description: prSkillDescription(true), markdown: prSkillMarkdown(true) })
+ : null,
+ },
+});
diff --git a/packages/eve-code/extension/skills/pr/SKILL.md b/packages/eve-code/extension/skills/pr/SKILL.md
deleted file mode 100644
index 941b56917..000000000
--- a/packages/eve-code/extension/skills/pr/SKILL.md
+++ /dev/null
@@ -1,53 +0,0 @@
----
-name: pr
-description: Prepare and publish a draft pull request with a signed commit, motivation-led description, testable hypothesis, and validation evidence.
----
-
-# Publish a proposal
-
-Fetch the current base immediately before publication. Rebase onto it, or replay only the intended diff onto a clean checkout when local commits are unavailable. Stop on conflicts, stale refs, unexpected paths, or unrelated reversions.
-
-Stage only the intended changes. Repositories that require verified commits must use:
-
-```sh
-gh-signed-commit --repo owner/name --branch <branch> --base <base> -m "<headline>" [-b "<body>"]
-```
-
-The command commits only staged changes and synchronizes the checkout to the signed remote commit. Then write the PR body to a file and create one draft:
-
-```sh
-gh pr create --draft --title "<title>" --body-file <path> --base <base> --head <branch>
-```
-
-Use a specific title that names the behavior or problem. Never use placeholders such as `prepare changes`. Keep secrets, private context, credentials, and requester identity out of public metadata.
-
-Write directly and top-down. Start with impact, then explain the essential decisions and why this shape tests the hypothesis. Prefer simple English and brief context over a wall of generated prose. Include truthful reproduction and validation evidence.
-
-A useful description answers:
-
-1. Why the change is necessary.
-2. Why this approach is the smallest sound solution.
-3. Which entry points and data flows change.
-4. What evidence verifies the expected outcome.
-
-Prefer this shape unless the repository has a required template:
-
-```markdown
-[One-line summary of what changed and why]
-
-**Why**
-
-[Observed problem, evidence, and impact]
-
-**Approach**
-
-Because [cause], changing [mechanism] should [expected outcome].
-
-**Validation**
-
-[Focused checks and results]
-
-**Relevant context**
-
-[Only the implementation or data-flow details reviewers need]
-```
diff --git a/packages/eve-code/extension/tools/gh.ts b/packages/eve-code/extension/tools/gh.ts
index 574147dd7..e13a4cf15 100644
--- a/packages/eve-code/extension/tools/gh.ts
+++ b/packages/eve-code/extension/tools/gh.ts
@@ -1,30 +1,10 @@
-import { defineTool } from "eve/tools";
-import { z } from "zod";
+import { defineDynamic } from "eve/tools";
-import extension from "../extension.ts";
-import {
- executeGitHubShell,
- githubShellApproval,
- type GitHubShellInput,
-} from "../lib/github-shell.ts";
+import { deprecatedGitHubConfigured, gh } from "../lib/github-compat.ts";
-import { githubShellInputSchema } from "../lib/github-shell-schema.ts";
-
-export default defineTool({
- description:
- "Run one authenticated GitHub command in the sandbox. The full gh CLI surface is available. Commands run without an approval prompt; description records the GitHub-side result the command intends to produce. Declare exactly one repository in the configured GitHub organization: Connect mints the real token for only that repository, and the sandbox process receives only a placeholder GH_TOKEN that the firewall exchanges on matching GitHub requests. GitHub rejects access outside the token's server-side repository scope; commands that explicitly name another repository with -R, --repo, --repo=, or a repository argument to gh repo clone, view, or fork are denied before minting. Use simple argv quoting only, never environment assignments, pipes, redirects, substitutions, or other shell syntax. gh alias and extension commands may execute local code, but remain sandboxed. Use git here only for authenticated fetch, pull, push, or ls-remote against a strictly validated origin, and use gh-signed-commit only with --repo. Use ordinary bash for local git status, diff, add, commit, and rebase.",
- approval: ({ toolInput }) => githubShellApproval(toolInput as GitHubShellInput | undefined),
- inputSchema: githubShellInputSchema,
- outputSchema: z.object({
- exitCode: z.number().int(),
- stderr: z.string(),
- stdout: z.string(),
- truncated: z.boolean(),
- }),
- execute(input, ctx) {
- return executeGitHubShell(input, extension.config.github, {
- getSandbox: () => ctx.getSandbox(),
- sessionId: ctx.session.id,
- });
+/** @deprecated Mount `eve/extensions/git` with `github` config. */
+export default defineDynamic({
+ events: {
+ "session.started": () => (deprecatedGitHubConfigured() ? gh : null),
},
});
diff --git a/packages/eve-code/test/integration/github-compat.test.ts b/packages/eve-code/test/integration/github-compat.test.ts
new file mode 100644
index 000000000..4e07e92c8
--- /dev/null
+++ b/packages/eve-code/test/integration/github-compat.test.ts
@@ -0,0 +1,50 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import type { SkillDefinition } from "eve/skills";
+
+import extension from "../../extension/extension.ts";
+import instructions from "../../extension/instructions/github.ts";
+import pr from "../../extension/skills/pr.ts";
+import gh from "../../extension/tools/gh.ts";
+
+const context = {
+ model: null,
+ session: { id: "github-compat-test", auth: { current: null, initiator: null } },
+ channel: {},
+ messages: [],
+};
+
+async function resolve() {
+ const instructionHandler = instructions.events["session.started"];
+ const skillHandler = pr.events["session.started"];
+ const toolHandler = gh.events["session.started"];
+ assert.ok(instructionHandler && skillHandler && toolHandler);
+ return {
+ guidance: await instructionHandler({}, context),
+ skill: (await skillHandler({}, context)) as SkillDefinition | null,
+ tool: await toolHandler({}, context),
+ };
+}
+
+test("code({}) contributes no GitHub tool, instructions, or pr skill", async () => {
+ extension({});
+ const { guidance, skill, tool } = await resolve();
+ assert.equal(tool, null);
+ assert.equal(guidance, null);
+ assert.equal(skill, null);
+});
+
+test("deprecated code({ github }) keeps the gh tool, GitHub instructions, and signed-commit pr skill", async () => {
+ extension({ github: { connector: "github/acme-bot", org: "acme", broker: async () => {} } });
+ const { guidance, skill, tool } = await resolve();
+ assert.ok(tool && "execute" in tool);
+ assert.ok(guidance && "content" in guidance);
+ assert.match(
+ guidance.content ?? "",
+ /Use the `gh` tool for every authenticated GitHub operation/u,
+ );
+ assert.match(guidance.content ?? "", /Load the pr skill before publishing/u);
+ assert.ok(skill);
+ assert.match(skill.markdown, /gh-signed-commit/u);
+ assert.match(skill.markdown, /gh pr create --draft/u);
+});
diff --git a/packages/eve-code/test/scenario/instructions-policy.test.ts b/packages/eve-code/test/scenario/instructions-policy.test.ts
index 9c9522984..c2cf93dfc 100644
--- a/packages/eve-code/test/scenario/instructions-policy.test.ts
+++ b/packages/eve-code/test/scenario/instructions-policy.test.ts
@@ -4,8 +4,9 @@ import test from "node:test";
const content = readFileSync(new URL("../../extension/instructions.md", import.meta.url), "utf8");
-test("routes authenticated GitHub operations through the scoped gh tool", () => {
- assert.match(content, /GitHub credentials are not available to ordinary `bash`/u);
- assert.match(content, /Use the `gh` tool for every authenticated GitHub operation/u);
- assert.match(content, /sandbox process receives only a placeholder `GH_TOKEN`/u);
+test("static instructions carry no GitHub or pull request workflow", () => {
+ assert.doesNotMatch(
+ content,
+ /GitHub credentials|`gh` tool|pr skill|gh-signed-commit|gh pr create/u,
+ );
});
diff --git a/packages/eve-code/test/scenario/tool-input-schemas.test.ts b/packages/eve-code/test/scenario/tool-input-schemas.test.ts
index 5c9476bfd..227fe350d 100644
--- a/packages/eve-code/test/scenario/tool-input-schemas.test.ts
+++ b/packages/eve-code/test/scenario/tool-input-schemas.test.ts
@@ -5,20 +5,37 @@ import test from "node:test";
import { z } from "zod";
+import extension from "../../extension/extension.ts";
+
const toolsDir = new URL("../../extension/tools/", import.meta.url);
// Claude rejects the whole model request when any advertised tool's input schema has a root
// union, even if that tool is never called. Every eve-code tool must serialize to an object root.
+// Dynamic tools are resolved with every optional capability configured so none is skipped.
test("every extension tool advertises an object-root input schema without root unions", async () => {
const files = (await readdir(toolsDir)).filter(
(file) => file.endsWith(".ts") && !file.endsWith(".test.ts"),
);
assert.ok(files.length >= 3, `found ${files.join(", ")}`);
+ extension({ github: { connector: "github/acme-bot", org: "acme", broker: async () => {} } });
for (const file of files) {
- const tool = (await import(new URL(file, toolsDir).href)).default as { inputSchema: z.ZodType };
+ const tool = await resolveTool((await import(new URL(file, toolsDir).href)).default);
const schema = z.toJSONSchema(tool.inputSchema, { io: "input" });
assert.equal(schema.type, "object", basename(file));
for (const keyword of ["oneOf", "anyOf", "allOf"])
assert.equal(keyword in schema, false, `${basename(file)} has root ${keyword}`);
}
});
+
+type ToolModule =
+ | { readonly inputSchema: z.ZodType }
+ | { readonly events: { readonly "session.started"?: (...args: never[]) => unknown } };
+
+async function resolveTool(definition: ToolModule): Promise<{ inputSchema: z.ZodType }> {
+ if ("inputSchema" in definition) return definition;
+ const handler = definition.events["session.started"] as (() => unknown) | undefined;
+ assert.ok(handler, "dynamic tool must resolve at session.started");
+ const tool = (await handler()) as { inputSchema: z.ZodType } | null;
+ assert.ok(tool, "dynamic tool resolved to null with every capability configured");
+ return tool;
+}
diff --git a/packages/eve-code/test/scenario/worker-manifest.test.ts b/packages/eve-code/test/scenario/worker-manifest.test.ts
index b09a52351..60bd7df00 100644
--- a/packages/eve-code/test/scenario/worker-manifest.test.ts
+++ b/packages/eve-code/test/scenario/worker-manifest.test.ts
@@ -59,6 +59,8 @@ test("built worker keeps explicit read tools without shell or write capabilities
diagnostics.filter((item) => item.severity === "error"),
[],
);
+ assert.ok(manifest.dynamicSkills.some((entry) => entry.slug === "code__pr"));
+ assert.ok(manifest.dynamicInstructions.some((entry) => entry.slug === "code__github"));
const worker = manifest.subagents.find((item) => item.name === "code__worker");
assert.ok(worker);
assert.equal(worker.configResolver, undefined);
diff --git a/packages/eve-git/.gitignore b/packages/eve-git/.gitignore
new file mode 100644
index 000000000..fff71c684
--- /dev/null
+++ b/packages/eve-git/.gitignore
@@ -0,0 +1,9 @@
+node_modules
+.env*
+.eve
+.vercel
+.output
+.nitro
+dist
+.DS_Store
+*.tsbuildinfo
diff --git a/packages/eve-git/AGENTS.md b/packages/eve-git/AGENTS.md
new file mode 100644
index 000000000..df582a568
--- /dev/null
+++ b/packages/eve-git/AGENTS.md
@@ -0,0 +1,16 @@
+# @eve/git Extension Package
+
+This private package is the source of the `eve/extensions/git` extension. It owns everything GitHub-facing: the pull request skill, GitHub instructions, and, with `github` config, the Connect-brokered `gh` tool and signed-commit workflow.
+
+Before writing code, read the installed eve package docs for extensions, tools, skills, instructions, and sandboxes as applicable.
+
+## Boundaries
+
+- Without `github` config, contribute no tools: agents use the `gh` and `git` CLIs from their own shell. Never tell them shell credentials are unavailable.
+- With `github` config, the `gh` tool leases a repository-scoped GitHub token per invocation. Broker credentials without placing them in model-authored URLs or arguments.
+- Keep GitHub and pull request content here, not in `@eve/code`. `@eve/code` imports `extension/lib/sandbox.ts` helpers for its deprecated `code({ github })` path.
+- Keep shared implementation under `extension/lib/`; filesystem paths define contribution names.
+
+## Build and publish
+
+The eve build copies `extension/` into `packages/eve/src/extensions/git/extension` and compiles it into the `eve` package; public entry points are declared in `packages/eve/package.json` and `packages/eve/src/extensions/git/`. Do not publish this package or add it as an eve dependency (it depends on eve). Import only public `eve/*` APIs from `extension/`; third-party imports are bundled into eve's dist. Keep tests under `test/unit/`, `test/integration/`, and `test/scenario/`, outside the discovered extension tree. Run typecheck, all three test tiers, eve's build, lint, and package-scoped formatting before completion.
diff --git a/packages/eve-git/README.md b/packages/eve-git/README.md
new file mode 100644
index 000000000..ad9735962
--- /dev/null
+++ b/packages/eve-git/README.md
@@ -0,0 +1,30 @@
+# eve/extensions/git
+
+`eve/extensions/git` is an eve extension for GitHub work. It contributes GitHub instructions and a `pr` skill and, with `github` config, an authenticated `gh` tool with signed commits.
+
+It ships inside the `eve` package. This private `@eve/git` workspace package is its source of truth: eve's build copies `extension/` into `packages/eve/src/extensions/git/extension` and publishes it with these entry points:
+
+- `eve/extensions/git`: the extension
+- `eve/extensions/git/tools`: the `gh` tool, for agents that mount it directly
+- `eve/extensions/git/sandbox`: GitHub shell execution, signed-commit, and guidance helpers
+
+## Mount
+
+```ts
+// agent/extensions/git.ts
+import git from "eve/extensions/git";
+
+export default git({});
+```
+
+`git({})` assumes the agent's shell has GitHub credentials. The instructions point the agent at the `gh` and `git` CLIs in `bash`, and `git__pr` commits, pushes, and opens a draft with `gh pr create --draft`. No tool is contributed.
+
+To broker GitHub access through Connect instead, configure `github` with `connector`, `org`, and a required `broker(sandbox, rules)` callback. The extension then contributes `git__gh`, which requests a token for exactly one repository in that organization per command. The callback installs the supplied GitHub header-transform rules for the command, then receives `null` to remove the lease. It must preserve the consumer's other network rules. Sandbox processes receive a placeholder token, not the real credential. `git__pr` switches to `gh-signed-commit` for repositories that require verified signatures. Install the executables with `installCodeTooling` from `eve/extensions/code/sandbox`.
+
+## Validate
+
+```sh
+pnpm --filter @eve/git typecheck
+pnpm --filter @eve/git test
+pnpm --filter @eve/git test:scenario
+```
diff --git a/packages/eve-git/extension/extension.ts b/packages/eve-git/extension/extension.ts
new file mode 100644
index 000000000..691a92ac3
--- /dev/null
+++ b/packages/eve-git/extension/extension.ts
@@ -0,0 +1,26 @@
+import { defineExtension } from "eve/extension";
+import { z } from "zod";
+
+import type { GitHubConfig } from "./lib/github-shell.ts";
+
+export type { GitHubLeaseRule } from "./lib/github-shell.ts";
+export type GitHubLeaseBroker = GitHubConfig["broker"];
+
+const fn = <T>() => z.custom<T>((value) => typeof value === "function");
+
+export default defineExtension({
+ config: z.object({
+ /**
+ * Connect-brokered GitHub access. When set, the extension contributes the
+ * authenticated `gh` tool and the signed-commit pull request workflow.
+ * Without it, agents use the `gh` and `git` CLIs from their own shell.
+ */
+ github: z
+ .object({
+ connector: z.string().min(1),
+ org: z.string().min(1),
+ broker: fn<GitHubLeaseBroker>(),
+ })
+ .optional(),
+ }),
+});
diff --git a/packages/eve-git/extension/instructions/github.ts b/packages/eve-git/extension/instructions/github.ts
new file mode 100644
index 000000000..03c27ec4c
--- /dev/null
+++ b/packages/eve-git/extension/instructions/github.ts
@@ -0,0 +1,11 @@
+import { defineDynamic, defineInstructions } from "eve/instructions";
+
+import extension from "../extension.ts";
+import { githubInstructions } from "../lib/github-guidance.ts";
+
+export default defineDynamic({
+ events: {
+ "session.started": () =>
+ defineInstructions({ content: githubInstructions(extension.config.github !== undefined) }),
+ },
+});
diff --git a/packages/eve-git/extension/lib/gh-tool.ts b/packages/eve-git/extension/lib/gh-tool.ts
new file mode 100644
index 000000000..25fc4dcb9
--- /dev/null
+++ b/packages/eve-git/extension/lib/gh-tool.ts
@@ -0,0 +1,37 @@
+import { defineTool } from "eve/tools";
+import { z } from "zod";
+
+import {
+ executeGitHubShell,
+ githubShellApproval,
+ type GitHubConfig,
+ type GitHubShellInput,
+} from "./github-shell.ts";
+import { githubShellInputSchema } from "./github-shell-schema.ts";
+
+export const GH_TOOL_DESCRIPTION =
+ "Run one authenticated GitHub command in the sandbox. The full gh CLI surface is available. Commands run without an approval prompt; description records the GitHub-side result the command intends to produce. Declare exactly one repository in the configured GitHub organization: Connect mints the real token for only that repository, and the sandbox process receives only a placeholder GH_TOKEN that the firewall exchanges on matching GitHub requests. GitHub rejects access outside the token's server-side repository scope; commands that explicitly name another repository with -R, --repo, --repo=, or a repository argument to gh repo clone, view, or fork are denied before minting. Use simple argv quoting only, never environment assignments, pipes, redirects, substitutions, or other shell syntax. gh alias and extension commands may execute local code, but remain sandboxed. Use git here only for authenticated fetch, pull, push, or ls-remote against a strictly validated origin, and use gh-signed-commit only with --repo. Use ordinary bash for local git status, diff, add, commit, and rebase.";
+
+/** The Connect-brokered `gh` tool, bound to one extension's GitHub config. */
+export function defineGhTool(
+ github: () => GitHubConfig | undefined,
+ description = GH_TOOL_DESCRIPTION,
+) {
+ return defineTool({
+ description,
+ approval: ({ toolInput }) => githubShellApproval(toolInput as GitHubShellInput | undefined),
+ inputSchema: githubShellInputSchema,
+ outputSchema: z.object({
+ exitCode: z.number().int(),
+ stderr: z.string(),
+ stdout: z.string(),
+ truncated: z.boolean(),
+ }),
+ execute(input, ctx) {
+ return executeGitHubShell(input, github(), {
+ getSandbox: () => ctx.getSandbox(),
+ sessionId: ctx.session.id,
+ });
+ },
+ });
+}
diff --git a/packages/eve-git/extension/lib/github-guidance.ts b/packages/eve-git/extension/lib/github-guidance.ts
new file mode 100644
index 000000000..bcad5bc37
--- /dev/null
+++ b/packages/eve-git/extension/lib/github-guidance.ts
@@ -0,0 +1,90 @@
+const PUBLISHING = `Load the pr skill before publishing. Create one pull request per request unless the requester asks otherwise.`;
+
+/** Agents without `github` config reach GitHub with their own shell credentials. */
+const SHELL_INSTRUCTIONS = `# GitHub
+
+Use the \`gh\` and \`git\` CLIs in \`bash\` for GitHub operations: cloning, fetching, pushing, issues, pull requests, reviews, and CI. They authenticate with the credentials already configured in the shell. Never put credentials in URLs or commands. If access is denied, report it plainly and stop.
+`;
+
+/** Holds only when the Connect-brokered `gh` tool can authenticate, which requires `github` config. */
+const CONNECT_INSTRUCTIONS = `# GitHub
+
+GitHub credentials are not available to ordinary \`bash\`. Use the \`gh\` tool for every authenticated GitHub operation. The full \`gh\` CLI surface is available. Declare exactly one repository in the configured organization with write-capable access. Authenticated commands run without an approval prompt; describe the intended GitHub-side result accurately in \`description\`. Connect mints the real token for only the declared repository. The sandbox process receives only a placeholder \`GH_TOKEN\`, and the firewall exchanges it on matching GitHub requests. GitHub rejects access outside the token's server-side repository scope. Never put credentials in URLs or commands. If access is denied, report it plainly and stop.
+
+Pass commands as simple argv with ordinary quoting. Do not use environment assignments, pipes, redirects, substitutions, or other shell syntax. Commands without an explicit repository may use normal \`gh\` context, but their token remains scoped to the declared repository. An explicit \`-R\`, \`--repo\`, \`--repo=\`, or repository argument to \`gh repo clone\`, \`view\`, or \`fork\` must match the declaration.
+
+Determine the repositories needed to complete the task through source discovery and investigation, even when the requester does not name them. Do not ask the requester to enumerate repositories that can be discovered, and never default to the current agent's repository. The agent may select additional repositories as the work reveals them. Each authenticated command declares exactly one target repository and mints a credential lease for that repository at the moment it is needed, so cross-repository work uses separate scoped commands and leases.
+
+Clone with \`gh repo clone owner/name\`. Use authenticated \`git fetch\`, \`git pull\`, \`git push\`, and \`git ls-remote\` through the \`gh\` tool too. Local \`git status\`, \`diff\`, \`add\`, \`commit\`, and \`rebase\` remain ordinary \`bash\` commands because they need no GitHub credential.
+
+Use GitHub CLI commands through the \`gh\` tool for issues, pull requests, reviews, Actions, CI, authentication status, configuration, aliases, extensions, and API requests. Common commands include \`gh pr create --draft\`, \`gh pr checks\`, \`gh run rerun --failed\`, and \`gh pr review\`, but they are not restrictions.
+
+Repositories that require verified signatures reject ordinary sandbox commits. Stage the intended changes explicitly, run \`gh-signed-commit --repo owner/name --branch <branch> -m <headline>\` through the \`gh\` tool, then create the draft pull request through the same tool.
+`;
+
+export function githubInstructions(github: boolean): string {
+ return `${github ? CONNECT_INSTRUCTIONS : SHELL_INSTRUCTIONS}\n${PUBLISHING}\n`;
+}
+
+/** `gh-signed-commit` authenticates through the `gh` tool's credential lease. */
+const SIGNED_COMMIT = `Stage only the intended changes. Repositories that require verified commits must use:
+
+\`\`\`sh
+gh-signed-commit --repo owner/name --branch <branch> --base <base> -m "<headline>" [-b "<body>"]
+\`\`\`
+
+The command commits only staged changes and synchronizes the checkout to the signed remote commit. Then write the PR body to a file and create one draft:`;
+
+const PLAIN_COMMIT = `Stage only the intended changes, commit them, and push the branch. Then write the PR body to a file and create one draft:`;
+
+export function prSkillDescription(github: boolean): string {
+ return github
+ ? "Prepare and publish a draft pull request with a signed commit, motivation-led description, testable hypothesis, and validation evidence."
+ : "Prepare and publish a draft pull request with a motivation-led description, testable hypothesis, and validation evidence.";
+}
+
+export function prSkillMarkdown(github: boolean): string {
+ return `# Publish a proposal
+
+Fetch the current base immediately before publication. Rebase onto it, or replay only the intended diff onto a clean checkout when local commits are unavailable. Stop on conflicts, stale refs, unexpected paths, or unrelated reversions.
+
+${github ? SIGNED_COMMIT : PLAIN_COMMIT}
+
+\`\`\`sh
+gh pr create --draft --title "<title>" --body-file <path> --base <base> --head <branch>
+\`\`\`
+
+Use a specific title that names the behavior or problem. Never use placeholders such as \`prepare changes\`. Keep secrets, private context, credentials, and requester identity out of public metadata.
+
+Write directly and top-down. Start with impact, then explain the essential decisions and why this shape tests the hypothesis. Prefer simple English and brief context over a wall of generated prose. Include truthful reproduction and validation evidence.
+
+A useful description answers:
+
+1. Why the change is necessary.
+2. Why this approach is the smallest sound solution.
+3. Which entry points and data flows change.
+4. What evidence verifies the expected outcome.
+
+Prefer this shape unless the repository has a required template:
+
+\`\`\`markdown
+[One-line summary of what changed and why]
+
+**Why**
+
+[Observed problem, evidence, and impact]
+
+**Approach**
+
+Because [cause], changing [mechanism] should [expected outcome].
+
+**Validation**
+
+[Focused checks and results]
+
+**Relevant context**
+
+[Only the implementation or data-flow details reviewers need]
+\`\`\`
+`;
+}
diff --git a/packages/eve-code/extension/lib/github-shell-schema.ts b/packages/eve-git/extension/lib/github-shell-schema.ts
similarity index 100%
rename from packages/eve-code/extension/lib/github-shell-schema.ts
rename to packages/eve-git/extension/lib/github-shell-schema.ts
diff --git a/packages/eve-code/extension/lib/github-shell.ts b/packages/eve-git/extension/lib/github-shell.ts
similarity index 97%
rename from packages/eve-code/extension/lib/github-shell.ts
rename to packages/eve-git/extension/lib/github-shell.ts
index ab2165f8b..e972a2258 100644
--- a/packages/eve-code/extension/lib/github-shell.ts
+++ b/packages/eve-git/extension/lib/github-shell.ts
@@ -4,7 +4,7 @@ import type { SandboxSession } from "eve/sandbox";
import { validateRepositoryRoot } from "./repository-root.ts";
import { shellQuote } from "./shell.ts";
-import { toolingPaths } from "./tooling.ts";
+import { GITHUB_TOOLING_PATHS } from "./tooling.ts";
export interface GitHubPermission {
readonly access: "write";
@@ -26,7 +26,7 @@ export interface GitHubShellOutput {
readonly truncated: boolean;
}
-interface GitHubConfig {
+export interface GitHubConfig {
readonly broker: (
sandbox: SandboxSession,
rules: Readonly<Record<string, readonly GitHubLeaseRule[]>> | null,
@@ -97,7 +97,7 @@ export async function executeGitHubShell(
if (!token)
throw new Error(`Connect returned an empty token for ${JSON.stringify(config.connector)}.`);
- const executable = executablePath(argv[0]!, sandbox);
+ const executable = executablePath(argv[0]!);
const executionArguments = remoteRepository
? [
"-c",
@@ -390,9 +390,9 @@ function repositoryNames(repositories: readonly string[], configuredOrg: string)
return [...names];
}
-function executablePath(executable: string, sandbox: Pick<SandboxSession, "resolvePath">): string {
- if (executable === "gh") return toolingPaths(sandbox).ghReal;
- if (executable === "gh-signed-commit") return toolingPaths(sandbox).trustedSignedCommit;
+function executablePath(executable: string): string {
+ if (executable === "gh") return GITHUB_TOOLING_PATHS.ghReal;
+ if (executable === "gh-signed-commit") return GITHUB_TOOLING_PATHS.trustedSignedCommit;
return "git";
}
diff --git a/packages/eve-git/extension/lib/repository-root.ts b/packages/eve-git/extension/lib/repository-root.ts
new file mode 100644
index 000000000..625b000fa
--- /dev/null
+++ b/packages/eve-git/extension/lib/repository-root.ts
@@ -0,0 +1,38 @@
+import type { SandboxSession } from "eve/sandbox";
+
+import { shellQuote } from "./shell.ts";
+
+type RootSandbox = Pick<SandboxSession, "resolvePath" | "run">;
+
+const MAX_ERROR_DETAIL_CHARS = 2_000;
+
+/** A workspace directory that must also be the top of a git work tree. */
+export async function validateRepositoryRoot(sandbox: RootSandbox, root: string): Promise<string> {
+ if (!root.startsWith("/")) throw new Error("root must be an absolute sandbox path");
+ const workspace = await realPath(sandbox, sandbox.resolvePath(""), "sandbox workspace");
+ const resolved = await realPath(sandbox, root, "root");
+ const inside =
+ workspace === "/" || resolved === workspace || resolved.startsWith(`${workspace}/`);
+ if (!inside) throw new Error(`root resolves outside the workspace ${workspace}: ${resolved}`);
+ const top = await sandbox.run({
+ command: `git -C ${shellQuote(resolved)} rev-parse --show-toplevel`,
+ });
+ if (top.exitCode !== 0 || top.stdout.trim() !== resolved) {
+ throw new Error(`root is not a git work tree root: ${root}`);
+ }
+ return resolved;
+}
+
+/** NUL-delimited output keeps paths that contain newlines unambiguous. */
+async function realPath(sandbox: RootSandbox, path: string, label: string): Promise<string> {
+ const result = await sandbox.run({ command: `realpath -e -z -- ${shellQuote(path)}` });
+ if (result.exitCode !== 0) {
+ const detail = result.stderr.trim() || result.stdout.trim() || "no command output";
+ throw new Error(`${label} could not be resolved: ${detail.slice(0, MAX_ERROR_DETAIL_CHARS)}`);
+ }
+ const real = result.stdout.endsWith("\0") ? result.stdout.slice(0, -1) : result.stdout;
+ if (real.length === 0 || real.includes("\0")) {
+ throw new Error(`${label} returned an invalid realpath`);
+ }
+ return real;
+}
diff --git a/packages/eve-git/extension/lib/sandbox.ts b/packages/eve-git/extension/lib/sandbox.ts
new file mode 100644
index 000000000..f35705adf
--- /dev/null
+++ b/packages/eve-git/extension/lib/sandbox.ts
@@ -0,0 +1,13 @@
+/** Consumer-facing helpers exported as `eve/extensions/git/sandbox`. */
+export {
+ executeGitHubShell,
+ githubShellApproval,
+ type GitHubConfig,
+ type GitHubLeaseRule,
+ type GitHubShellInput,
+ type GitHubShellOutput,
+} from "./github-shell.ts";
+export { GH_SIGNED_COMMIT_SOURCE, GH_SIGNED_COMMIT_VERSION } from "./signed-commit.ts";
+export { GITHUB_TOOLING_PATHS } from "./tooling.ts";
+export { defineGhTool, GH_TOOL_DESCRIPTION } from "./gh-tool.ts";
+export { githubInstructions, prSkillDescription, prSkillMarkdown } from "./github-guidance.ts";
diff --git a/packages/eve-git/extension/lib/shell.ts b/packages/eve-git/extension/lib/shell.ts
new file mode 100644
index 000000000..aef41c372
--- /dev/null
+++ b/packages/eve-git/extension/lib/shell.ts
@@ -0,0 +1,3 @@
+export function shellQuote(value: string): string {
+ return `'${value.replaceAll("'", `'"'"'`)}'`;
+}
diff --git a/packages/eve-code/extension/lib/signed-commit.ts b/packages/eve-git/extension/lib/signed-commit.ts
similarity index 100%
rename from packages/eve-code/extension/lib/signed-commit.ts
rename to packages/eve-git/extension/lib/signed-commit.ts
diff --git a/packages/eve-git/extension/lib/tooling.ts b/packages/eve-git/extension/lib/tooling.ts
new file mode 100644
index 000000000..d6417646a
--- /dev/null
+++ b/packages/eve-git/extension/lib/tooling.ts
@@ -0,0 +1,10 @@
+/**
+ * Trusted sandbox locations of the GitHub executables. The code extension's
+ * `installCodeTooling` installs them here; the `gh` tool executes only these.
+ */
+const TRUSTED_TOOLING_ROOT = "/usr/local/lib/eve-code";
+
+export const GITHUB_TOOLING_PATHS = {
+ ghReal: `${TRUSTED_TOOLING_ROOT}/gh`,
+ trustedSignedCommit: `${TRUSTED_TOOLING_ROOT}/gh-signed-commit`,
+} as const;
diff --git a/packages/eve-git/extension/skills/pr.ts b/packages/eve-git/extension/skills/pr.ts
new file mode 100644
index 000000000..8fbccc332
--- /dev/null
+++ b/packages/eve-git/extension/skills/pr.ts
@@ -0,0 +1,16 @@
+import { defineDynamic, defineSkill } from "eve/skills";
+
+import extension from "../extension.ts";
+import { prSkillDescription, prSkillMarkdown } from "../lib/github-guidance.ts";
+
+export default defineDynamic({
+ events: {
+ "session.started": () => {
+ const github = extension.config.github !== undefined;
+ return defineSkill({
+ description: prSkillDescription(github),
+ markdown: prSkillMarkdown(github),
+ });
+ },
+ },
+});
diff --git a/packages/eve-git/extension/tools/gh.ts b/packages/eve-git/extension/tools/gh.ts
new file mode 100644
index 000000000..a7426a6a5
--- /dev/null
+++ b/packages/eve-git/extension/tools/gh.ts
@@ -0,0 +1,12 @@
+import { defineDynamic } from "eve/tools";
+
+import extension from "../extension.ts";
+import { defineGhTool } from "../lib/gh-tool.ts";
+
+/** Present only with `github` config; otherwise agents use `gh` from their own shell. */
+export default defineDynamic({
+ events: {
+ "session.started": () =>
+ extension.config.github === undefined ? null : defineGhTool(() => extension.config.github),
+ },
+});
diff --git a/packages/eve-git/package.json b/packages/eve-git/package.json
new file mode 100644
index 000000000..a1a131cbd
--- /dev/null
+++ b/packages/eve-git/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "@eve/git",
+ "version": "0.0.0",
+ "private": true,
+ "description": "Source of the eve/extensions/git extension: GitHub pull request workflow, with optional Connect-brokered gh access and signed commits.",
+ "type": "module",
+ "exports": {
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "test": "pnpm run test:unit && pnpm run test:integration",
+ "test:unit": "node --test \"test/unit/*.test.ts\"",
+ "test:integration": "node --test \"test/integration/*.test.ts\"",
+ "test:scenario": "node --test \"test/scenario/*.test.ts\"",
+ "typecheck": "tsc"
+ },
+ "dependencies": {
+ "@vercel/connect": "catalog:",
+ "eve": "workspace:*",
+ "zod": "catalog:"
+ },
+ "devDependencies": {
+ "@types/node": "catalog:",
+ "typescript": "catalog:",
+ "typescript-compiler": "npm:[email protected]"
+ },
+ "engines": {
+ "node": ">=24"
+ },
+ "eve": {
+ "extension": {
+ "source": "./extension",
+ "dist": "./dist/extension"
+ }
+ }
+}
diff --git a/packages/eve-git/test/integration/github-guidance.test.ts b/packages/eve-git/test/integration/github-guidance.test.ts
new file mode 100644
index 000000000..b0d589364
--- /dev/null
+++ b/packages/eve-git/test/integration/github-guidance.test.ts
@@ -0,0 +1,54 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import type { SkillDefinition } from "eve/skills";
+
+import extension from "../../extension/extension.ts";
+import instructions from "../../extension/instructions/github.ts";
+import pr from "../../extension/skills/pr.ts";
+import gh from "../../extension/tools/gh.ts";
+
+const context = {
+ model: null,
+ session: { id: "guidance-test", auth: { current: null, initiator: null } },
+ channel: {},
+ messages: [],
+};
+
+async function resolve() {
+ const instructionHandler = instructions.events["session.started"];
+ const skillHandler = pr.events["session.started"];
+ const toolHandler = gh.events["session.started"];
+ assert.ok(instructionHandler && skillHandler && toolHandler);
+ const guidance = await instructionHandler({}, context);
+ assert.ok(guidance && "content" in guidance);
+ return {
+ content: guidance.content ?? "",
+ skill: (await skillHandler({}, context)) as SkillDefinition,
+ tool: await toolHandler({}, context),
+ };
+}
+
+test("without github config, GitHub goes through the shell's gh and git", async () => {
+ extension({});
+ const { content, skill, tool } = await resolve();
+ assert.equal(tool, null);
+ assert.match(content, /Use the `gh` and `git` CLIs in `bash`/u);
+ assert.doesNotMatch(content, /not available to ordinary `bash`|`gh` tool/u);
+ assert.match(content, /Load the pr skill before publishing/u);
+ assert.doesNotMatch(skill.markdown, /gh-signed-commit|gh`? tool/u);
+ assert.doesNotMatch(skill.description, /signed commit/u);
+ assert.match(skill.markdown, /commit them, and push the branch/u);
+ assert.match(skill.markdown, /gh pr create --draft/u);
+});
+
+test("with github config, GitHub goes through the brokered gh tool and signed commits", async () => {
+ extension({ github: { connector: "github/acme-bot", org: "acme", broker: async () => {} } });
+ const { content, skill, tool } = await resolve();
+ assert.ok(tool && "execute" in tool);
+ assert.match(content, /GitHub credentials are not available to ordinary `bash`/u);
+ assert.match(content, /Use the `gh` tool for every authenticated GitHub operation/u);
+ assert.match(content, /Load the pr skill before publishing/u);
+ assert.match(skill.markdown, /gh-signed-commit/u);
+ assert.match(skill.description, /signed commit/u);
+ assert.match(skill.markdown, /gh pr create --draft/u);
+});
diff --git a/packages/eve-code/test/integration/github-shell.test.ts b/packages/eve-git/test/integration/github-shell.test.ts
similarity index 100%
rename from packages/eve-code/test/integration/github-shell.test.ts
rename to packages/eve-git/test/integration/github-shell.test.ts
diff --git a/packages/eve-git/test/scenario/manifest.test.ts b/packages/eve-git/test/scenario/manifest.test.ts
new file mode 100644
index 000000000..2619b07dc
--- /dev/null
+++ b/packages/eve-git/test/scenario/manifest.test.ts
@@ -0,0 +1,69 @@
+import assert from "node:assert/strict";
+import { cp, mkdir, mkdtemp, rm, symlink, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { fileURLToPath } from "node:url";
+import test from "node:test";
+
+import type { CompilerDiagnostic } from "../../../eve/dist/src/compiler/diagnostics.js";
+import { compileAgentManifest } from "../../../eve/dist/src/compiler/normalize-manifest.js";
+import { discoverAgent } from "../../../eve/dist/src/discover/discover-agent.js";
+import {
+ buildExtensionPackage,
+ tryReadExtensionBuildConfig,
+} from "../../../eve/dist/src/internal/nitro/host/build-extension.js";
+
+const packageRoot = fileURLToPath(new URL("../../", import.meta.url));
+
+test("built extension mounts as git with only session-resolved GitHub contributions", async () => {
+ const root = await mkdtemp(join(tmpdir(), "eve-git-manifest-"));
+ try {
+ const extensionRoot = join(root, "extension-package");
+ await mkdir(extensionRoot);
+ for (const path of ["package.json", "tsconfig.json", "extension"]) {
+ await cp(join(packageRoot, path), join(extensionRoot, path), { recursive: true });
+ }
+ await symlink(join(packageRoot, "node_modules"), join(extensionRoot, "node_modules"), "dir");
+ const config = await tryReadExtensionBuildConfig(extensionRoot);
+ assert.ok(config);
+ await buildExtensionPackage(extensionRoot, config);
+ // Consume only the distribution, so source discovery cannot hide a packaging regression.
+ await rm(join(extensionRoot, "extension"), { recursive: true });
+
+ const appRoot = join(root, "consumer");
+ await mkdir(join(appRoot, "agent", "extensions"), { recursive: true });
+ await mkdir(join(appRoot, "node_modules"));
+ await symlink(
+ join(packageRoot, "node_modules", "eve"),
+ join(appRoot, "node_modules", "eve"),
+ "dir",
+ );
+ await symlink(extensionRoot, join(appRoot, "node_modules", "eve-git"), "dir");
+ await writeFile(
+ join(appRoot, "package.json"),
+ JSON.stringify({ name: "git-manifest-consumer", type: "module" }),
+ );
+ await writeFile(
+ join(appRoot, "agent", "extensions", "git.ts"),
+ 'import git from "eve-git";\nexport default git({});\n',
+ );
+ await writeFile(join(appRoot, "agent", "instructions.md"), "Publish changes.\n");
+ const discovered = await discoverAgent({ appRoot, agentRoot: join(appRoot, "agent") });
+ assert.deepEqual(
+ discovered.diagnostics.filter((item) => item.severity === "error"),
+ [],
+ );
+ const diagnostics: CompilerDiagnostic[] = [];
+ const manifest = await compileAgentManifest(discovered.manifest, { diagnostics });
+ assert.deepEqual(
+ diagnostics.filter((item) => item.severity === "error"),
+ [],
+ );
+ assert.ok(manifest.dynamicSkills.some((entry) => entry.slug === "git__pr"));
+ assert.ok(manifest.dynamicInstructions.some((entry) => entry.slug === "git__github"));
+ assert.ok(manifest.dynamicTools.some((entry) => entry.slug === "git__gh"));
+ assert.ok(!manifest.tools.some((tool) => tool.name.startsWith("git__")));
+ } finally {
+ await rm(root, { recursive: true, force: true });
+ }
+});
diff --git a/packages/eve-git/test/scenario/tool-input-schemas.test.ts b/packages/eve-git/test/scenario/tool-input-schemas.test.ts
new file mode 100644
index 000000000..cb2d87921
--- /dev/null
+++ b/packages/eve-git/test/scenario/tool-input-schemas.test.ts
@@ -0,0 +1,41 @@
+import assert from "node:assert/strict";
+import { readdir } from "node:fs/promises";
+import { basename } from "node:path";
+import test from "node:test";
+
+import { z } from "zod";
+
+import extension from "../../extension/extension.ts";
+
+const toolsDir = new URL("../../extension/tools/", import.meta.url);
+
+// Claude rejects the whole model request when any advertised tool's input schema has a root
+// union, even if that tool is never called. Every eve-git tool must serialize to an object root.
+// Dynamic tools are resolved with every optional capability configured so none is skipped.
+test("every extension tool advertises an object-root input schema without root unions", async () => {
+ const files = (await readdir(toolsDir)).filter(
+ (file) => file.endsWith(".ts") && !file.endsWith(".test.ts"),
+ );
+ assert.ok(files.length >= 1, `found ${files.join(", ")}`);
+ extension({ github: { connector: "github/acme-bot", org: "acme", broker: async () => {} } });
+ for (const file of files) {
+ const tool = await resolveTool((await import(new URL(file, toolsDir).href)).default);
+ const schema = z.toJSONSchema(tool.inputSchema, { io: "input" });
+ assert.equal(schema.type, "object", basename(file));
+ for (const keyword of ["oneOf", "anyOf", "allOf"])
+ assert.equal(keyword in schema, false, `${basename(file)} has root ${keyword}`);
+ }
+});
+
+type ToolModule =
+ | { readonly inputSchema: z.ZodType }
+ | { readonly events: { readonly "session.started"?: (...args: never[]) => unknown } };
+
+async function resolveTool(definition: ToolModule): Promise<{ inputSchema: z.ZodType }> {
+ if ("inputSchema" in definition) return definition;
+ const handler = definition.events["session.started"] as (() => unknown) | undefined;
+ assert.ok(handler, "dynamic tool must resolve at session.started");
+ const tool = (await handler()) as { inputSchema: z.ZodType } | null;
+ assert.ok(tool, "dynamic tool resolved to null with every capability configured");
+ return tool;
+}
diff --git a/packages/eve-code/test/unit/gh-schema.test.ts b/packages/eve-git/test/unit/gh-schema.test.ts
similarity index 100%
rename from packages/eve-code/test/unit/gh-schema.test.ts
rename to packages/eve-git/test/unit/gh-schema.test.ts
diff --git a/packages/eve-git/tsconfig.json b/packages/eve-git/tsconfig.json
new file mode 100644
index 000000000..a9e8fe768
--- /dev/null
+++ b/packages/eve-git/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "target": "ES2023",
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "rewriteRelativeImportExtensions": true,
+ "types": ["node"],
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "noEmit": true
+ },
+ "include": ["extension/**/*.ts", "test/**/*.ts"]
+}
diff --git a/packages/eve-git/turbo.json b/packages/eve-git/turbo.json
new file mode 100644
index 000000000..d77ff0acd
--- /dev/null
+++ b/packages/eve-git/turbo.json
@@ -0,0 +1,11 @@
+{
+ "extends": ["//"],
+ "tasks": {
+ "test:integration": {
+ "dependsOn": ["eve#build"]
+ },
+ "test:scenario": {
+ "dependsOn": ["^build"]
+ }
+ }
+}
diff --git a/packages/eve/package.json b/packages/eve/package.json
index 59b810313..59a8d3a1c 100644
--- a/packages/eve/package.json
+++ b/packages/eve/package.json
@@ -376,6 +376,24 @@
"import": "./dist/src/extensions/code/extension/lib/prwatch.js",
"default": "./dist/src/extensions/code/extension/lib/prwatch.js"
},
+ "./extensions/git": {
+ "eve-source": "./dist/src/extensions/git/extension/extension.js",
+ "types": "./dist/src/extensions/git/extension/extension.d.ts",
+ "import": "./dist/src/extensions/git/extension/extension.js",
+ "default": "./dist/src/extensions/git/extension/extension.js"
+ },
+ "./extensions/git/tools": {
+ "eve-source": "./dist/src/extensions/git/tools.js",
+ "types": "./dist/src/extensions/git/tools.d.ts",
+ "import": "./dist/src/extensions/git/tools.js",
+ "default": "./dist/src/extensions/git/tools.js"
+ },
+ "./extensions/git/sandbox": {
+ "eve-source": "./dist/src/extensions/git/extension/lib/sandbox.js",
+ "types": "./dist/src/extensions/git/extension/lib/sandbox.d.ts",
+ "import": "./dist/src/extensions/git/extension/lib/sandbox.js",
+ "default": "./dist/src/extensions/git/extension/lib/sandbox.js"
+ },
"./computer-use": {
"eve-source": "./dist/src/computer-use/extension/extension.js",
"types": "./dist/src/computer-use/extension/extension.d.ts",
@@ -678,6 +696,9 @@
"./extensions/code": {
"dist": "./dist/src/extensions/code/extension"
},
+ "./extensions/git": {
+ "dist": "./dist/src/extensions/git/extension"
+ },
"./computer-use": {
"dist": "./dist/src/computer-use/extension"
}
diff --git a/packages/eve/scripts/copy-runtime-assets.mjs b/packages/eve/scripts/copy-runtime-assets.mjs
index fd8dfa0ff..b3383882c 100644
--- a/packages/eve/scripts/copy-runtime-assets.mjs
+++ b/packages/eve/scripts/copy-runtime-assets.mjs
@@ -9,7 +9,11 @@ const packageRoot = fileURLToPath(new URL("..", import.meta.url));
const runtimeAssetDirs = ["src/cli/commands/agent-prompt"];
// Built-in extension trees are discovered from dist, so their instructions and
// skills must ship beside the compiled modules.
-const extensionAssetDirs = ["src/extensions/code/extension", "src/computer-use/extension"];
+const extensionAssetDirs = [
+ "src/extensions/code/extension",
+ "src/extensions/git/extension",
+ "src/computer-use/extension",
+];
// Hand-written declaration files are tsc inputs, not outputs. The ambient
// `workflow` module types are referenced from `eve/tools` and exported as
// `eve/workflow-modules`, so they ship beside the emitted declarations.
diff --git a/packages/eve/scripts/sync-extensions.mjs b/packages/eve/scripts/sync-extensions.mjs
index 86969c426..7a13a3b19 100644
--- a/packages/eve/scripts/sync-extensions.mjs
+++ b/packages/eve/scripts/sync-extensions.mjs
@@ -1,7 +1,8 @@
/**
* Copies the private extension packages into eve's `src/`
* so eve compiles and ships them as built-in extensions: `@eve/code` becomes
- * `eve/extensions/code` and `@eve/computer-use` becomes `eve/computer-use`. The
+ * `eve/extensions/code`, `@eve/git` becomes `eve/extensions/git`, and
+ * `@eve/computer-use` becomes `eve/computer-use`. The
* packages stay the source of truth; the copies are gitignored. eve cannot
* depend on them (they depend on eve), so the sibling workspace paths are read
* directly and declared as turbo inputs in `turbo.json`.
@@ -20,6 +21,11 @@ export const builtInExtensions = [
source: join(packageRoot, "..", "eve-code", "extension"),
target: join(packageRoot, "src", "extensions", "code", "extension"),
},
+ {
+ name: "git",
+ source: join(packageRoot, "..", "eve-git", "extension"),
+ target: join(packageRoot, "src", "extensions", "git", "extension"),
+ },
{
name: "computer-use",
source: join(packageRoot, "..", "eve-computer-use", "extension"),
diff --git a/packages/eve/src/extensions/code/tools.ts b/packages/eve/src/extensions/code/tools.ts
index 130eb0c71..ad46c6d20 100644
--- a/packages/eve/src/extensions/code/tools.ts
+++ b/packages/eve/src/extensions/code/tools.ts
@@ -1,5 +1,6 @@
export { default as apply_patch } from "./extension/tools/apply_patch.ts";
/** @deprecated Import from `eve/computer-use/tools` and mount `eve/computer-use`. */
export { computer_use } from "../../computer-use/tools.ts";
-export { default as gh } from "./extension/tools/gh.ts";
+/** @deprecated Import from `eve/extensions/git/tools` and mount `eve/extensions/git`. */
+export { gh } from "./extension/lib/github-compat.ts";
export { default as grep } from "./extension/tools/grep.ts";
diff --git a/packages/eve/src/extensions/git/tools.ts b/packages/eve/src/extensions/git/tools.ts
new file mode 100644
index 000000000..6b94d7c84
--- /dev/null
+++ b/packages/eve/src/extensions/git/tools.ts
@@ -0,0 +1,5 @@
+import { defineGhTool } from "./extension/lib/gh-tool.ts";
+import extension from "./extension/extension.ts";
+
+/** The Connect-brokered `gh` tool, bound to the `eve/extensions/git` mount's `github` config. */
+export const gh = defineGhTool(() => extension.config.github);
diff --git a/packages/eve/turbo.json b/packages/eve/turbo.json
index e13cb781d..897635025 100644
--- a/packages/eve/turbo.json
+++ b/packages/eve/turbo.json
@@ -6,6 +6,7 @@
"inputs": [
"$TURBO_EXTENDS$",
"$TURBO_ROOT$/packages/eve-code/extension/**",
+ "$TURBO_ROOT$/packages/eve-git/extension/**",
"$TURBO_ROOT$/packages/eve-computer-use/extension/**"
]
},
@@ -13,6 +14,7 @@
"inputs": [
"$TURBO_EXTENDS$",
"$TURBO_ROOT$/packages/eve-code/extension/**",
+ "$TURBO_ROOT$/packages/eve-git/extension/**",
"$TURBO_ROOT$/packages/eve-computer-use/extension/**"
]
},
@@ -20,6 +22,7 @@
"inputs": [
"$TURBO_EXTENDS$",
"$TURBO_ROOT$/packages/eve-code/extension/**",
+ "$TURBO_ROOT$/packages/eve-git/extension/**",
"$TURBO_ROOT$/packages/eve-computer-use/extension/**"
]
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6c777a3e3..06a8cc75c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1980,6 +1980,28 @@ importers:
specifier: npm:[email protected]
+ packages/eve-git:
+ dependencies:
+ '@vercel/connect':
+ specifier: 'catalog:'
+ eve:
+ specifier: workspace:*
+ version: link:../eve
+ zod:
+ specifier: 'catalog:'
+ version: 4.5.4
+ devDependencies:
+ '@types/node':
+ specifier: 'catalog:'
+ version: 24.13.3
+ typescript:
+ specifier: 'catalog:'
+ version: 7.0.2
+ typescript-compiler:
+ specifier: npm:[email protected]
+
packages/eve-self-modification:
dependencies:
eve:
@@ -21227,6 +21249,17 @@ snapshots:
ai: 7.0.128([email protected])
+ dependencies:
+ '@vercel/oidc': 3.8.9
+ optionalDependencies:
+ '@ai-sdk/mcp': 2.0.67([email protected])
+ '@auth/core': 0.41.2
+ '@modelcontextprotocol/sdk': 1.30.0(@cfworker/[email protected])([email protected])([email protected])
+ ai: 7.0.128([email protected])
+ eve: link:packages/eve
+
'@vercel/[email protected]': {}