The Open Framework for Building Agents
feat(eve): move computer use into the eve/computer-use extension (#3877)
Rui52a18ac620c4
diff --git a/.changeset/eve-computer-use-extension.md b/.changeset/eve-computer-use-extension.mdnew file mode 100644index 000000000..9443e58a1--- /dev/null+++ b/.changeset/eve-computer-use-extension.md@@ -0,0 +1,7 @@+---+"eve": minor+---++Computer use moves out of `eve/extensions/code` into its own built-in extension, `eve/computer-use`. Mounting the code extension no longer adds `computer_use`, so agents without a desktop stop sending its schema on every request. Agents that use computer use should mount `eve/computer-use` next to the code extension; mounted as `agent/extensions/computer-use.ts`, the tool is named `computer-use__computer_use`.++The sandbox helpers are now exported from `eve/computer-use/sandbox` and the tool from `eve/computer-use/tools`. The old `eve/extensions/code/sandbox` and `eve/extensions/code/tools` exports still work but are deprecated.diff --git a/.github/workflows/e2e-local.yml b/.github/workflows/e2e-local.ymlindex aea5eeca9..977280aab 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 (its lockfile entries included) never+ # PRs confined to packages/eve-code or packages/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/|pnpm-lock\.yaml$)'; then+ if ! git diff --name-only HEAD^1 HEAD | grep -qvE '^(packages/eve-(code|computer-use)/|pnpm-lock\.yaml$)'; thenecho "relevant=false" >> "$GITHUB_OUTPUT"exit 0fidiff --git a/.github/workflows/e2e-postgres.yml b/.github/workflows/e2e-postgres.ymlindex e69d02fea..56b934b9f 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 (its lockfile entries included) never+ # PRs confined to packages/eve-code or packages/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/|pnpm-lock\.yaml$)'; then+ if ! git diff --name-only HEAD^1 HEAD | grep -qvE '^(packages/eve-(code|computer-use)/|pnpm-lock\.yaml$)'; thenecho "relevant=false" >> "$GITHUB_OUTPUT"exit 0fidiff --git a/.gitignore b/.gitignoreindex b8d702588..5986af508 100644--- a/.gitignore+++ b/.gitignore@@ -27,6 +27,7 @@ apps/benchmarks/evals/*/.eve-authoring-bootstrap.jsonpackages/eve/.workflow-vitest/packages/eve/.generated/packages/eve/src/extensions/code/extension/+packages/eve/src/computer-use/extension/playwright-report/test-results/diff --git a/packages/eve-code/AGENTS.md b/packages/eve-code/AGENTS.mdindex 9048bad83..0519ef13a 100644--- a/packages/eve-code/AGENTS.md+++ b/packages/eve-code/AGENTS.md@@ -1,6 +1,6 @@# @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, computer use, 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, 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.Before writing code, read the installed eve package docs for extensions, hooks, tools, skills, subagents, and sandboxes as applicable.@@ -12,7 +12,7 @@ Before writing code, read the installed eve package docs for extensions, hooks,- Use real `git`, `gh`, and `vc` CLIs rather than bespoke repository lifecycle tools.- Keep `apply_patch` as the only extension-owned file editing primitive.- Keep shared implementation under `extension/lib/`; filesystem paths define contribution names.-- Preserve the computer-use sandbox exports in `extension/lib/sandbox.ts`.+- Computer use lives in `@eve/computer-use` (`eve/computer-use`). Keep the deprecated computer-use re-exports in `extension/lib/sandbox.ts` until they are removed; do not add computer-use code here.## Build and publishdiff --git a/packages/eve-code/README.md b/packages/eve-code/README.mdindex 780e709be..6713f4a0b 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`, computer use, `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`, `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.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`, `computer_use`, `gh`, and `grep`+- `eve/extensions/code/tools`: `apply_patch`, `gh`, and `grep`- `eve/extensions/code/prwatch`: PR-watch primitives for consumer-owned workflow tools## Mount@@ -29,35 +29,26 @@ The read-only worker subagent defaults to `openai/gpt-5.6-terra-fast` with `xhig## Sandbox bootstrap-Install CLI tooling and computer-use assets in the environment's `prepare` callback, then start the desktop and driver after `open()` in `defineSandbox()`. Computer use requires an apt-based Linux image with root or passwordless sudo; it cannot run on the `just-bash` provider.+Install CLI tooling in the environment's `prepare` callback:```ts// agent/sandbox.tsimport { defineSandbox } from "eve/sandbox";import { VercelSandbox } from "eve/sandbox/vercel";-import {- installCodeTooling,- installComputerUse,- startComputerUse,-} from "eve/extensions/code/sandbox";+import { installCodeTooling } from "eve/extensions/code/sandbox";export const environment = VercelSandbox.environment({prepare: async (sandbox) => {await installCodeTooling(sandbox, { vercel: true });- await installComputerUse(sandbox);},});-export default defineSandbox(async () => {- const sandbox = await environment.open();- await startComputerUse(sandbox);- return sandbox;-});+export default defineSandbox(() => environment.open());```eve derives the prepared environment generation from the sandbox file and environment options, not from imported helpers, so upgrading eve alone does not rebuild an existing prepared artifact.-Mounting the extension exposes `computer_use` but does not install or start its driver. The prepared artifact captures files, not running processes; the `defineSandbox()` selector starts the driver once for each new durable sandbox. If the driver exits or the provider resumes only filesystem state, call `startComputerUse` again before using the tool; resuming a sandbox does not rerun the selector. Stop recordings with `record_stop` to finalize the MP4 at the returned sandbox path. A five-minute watchdog also finalizes forgotten recordings, and the driver attempts finalization on `SIGINT` or `SIGTERM`; abrupt VM termination cannot guarantee a finalized MP4.+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`.diff --git a/packages/eve-code/agent/instructions.md b/packages/eve-code/agent/instructions.mdindex e0571f406..091662244 100644--- a/packages/eve-code/agent/instructions.md+++ b/packages/eve-code/agent/instructions.md@@ -1,3 +1,3 @@Complete the requested task in the local benchmark filesystem. Work in `/app`; `/workspace` refers to the same task workspace.-Use the mounted coding tools to inspect and edit files. Verify your changes locally and finish without requesting human input. Do not publish changes or use external GitHub or Vercel integrations. Computer use is not provisioned in this terminal-only benchmark.+Use the mounted coding tools to inspect and edit files. Verify your changes locally and finish without requesting human input. Do not publish changes or use external GitHub or Vercel integrations.diff --git a/packages/eve-code/extension/lib/sandbox.ts b/packages/eve-code/extension/lib/sandbox.tsindex 4c4ead4f5..6f7e55ae7 100644--- a/packages/eve-code/extension/lib/sandbox.ts+++ b/packages/eve-code/extension/lib/sandbox.ts@@ -87,11 +87,12 @@ export {type BrokeredCredentialOptions,} from "./credentials.ts";+/** @deprecated Import from `eve/computer-use/sandbox` and mount `eve/computer-use`. */export {COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse,-} from "./computer-use-sandbox.ts";+} from "eve/computer-use/sandbox";export {executeGitHubShell,diff --git a/packages/eve-code/test/scenario/tool-input-schemas.test.ts b/packages/eve-code/test/scenario/tool-input-schemas.test.tsindex ab082ac17..5c9476bfd 100644--- a/packages/eve-code/test/scenario/tool-input-schemas.test.ts+++ b/packages/eve-code/test/scenario/tool-input-schemas.test.ts@@ -13,7 +13,7 @@ test("every extension tool advertises an object-root input schema without root uconst files = (await readdir(toolsDir)).filter((file) => file.endsWith(".ts") && !file.endsWith(".test.ts"),);- assert.ok(files.length >= 4, `found ${files.join(", ")}`);+ assert.ok(files.length >= 3, `found ${files.join(", ")}`);for (const file of files) {const tool = (await import(new URL(file, toolsDir).href)).default as { inputSchema: z.ZodType };const schema = z.toJSONSchema(tool.inputSchema, { io: "input" });diff --git a/packages/eve-computer-use/AGENTS.md b/packages/eve-computer-use/AGENTS.mdnew file mode 100644index 000000000..26554dfb1--- /dev/null+++ b/packages/eve-computer-use/AGENTS.md@@ -0,0 +1,15 @@+# @eve/computer-use Extension Package++This private package is the source of the `eve/computer-use` extension. It contributes the `computer_use` tool and the sandbox helpers that install and start the desktop and driver.++Before writing code, read the installed eve package docs for extensions, tools, and sandboxes as applicable.++## Boundaries++- Keep this extension free of coding tools; those belong in `@eve/code`.+- Keep shared implementation under `extension/lib/`; filesystem paths define contribution names.+- Keep the sandbox exports in `extension/lib/sandbox.ts`; `@eve/code` re-exports them for compatibility.++## Build and publish++The eve build copies `extension/` into `packages/eve/src/computer-use/extension` and compiles it into the `eve` package; public entry points are declared in `packages/eve/package.json` and `packages/eve/src/computer-use/`. 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/scenario/`, outside the discovered extension tree. Run typecheck, the scenario tests, eve's build, lint, and package-scoped formatting before completion.diff --git a/packages/eve-computer-use/README.md b/packages/eve-computer-use/README.mdnew file mode 100644index 000000000..bddcf4ec1--- /dev/null+++ b/packages/eve-computer-use/README.md@@ -0,0 +1,57 @@+# eve/computer-use++`eve/computer-use` is an eve extension for computer use. It contributes the `computer_use` tool, which drives a Linux desktop inside the sandbox, plus the helpers that install and start that desktop.++It ships inside the `eve` package. This private `@eve/computer-use` workspace package is its source of truth: eve's build copies `extension/` into `packages/eve/src/computer-use/extension` and publishes it with these entry points:++- `eve/computer-use`: the extension+- `eve/computer-use/sandbox`: `installComputerUse`, `startComputerUse`, and `COMPUTER_USE_REVALIDATION_KEY`+- `eve/computer-use/tools`: `computer_use`++## Mount++The extension has no config:++```ts+// agent/extensions/computer-use.ts+export { default } from "eve/computer-use";+```++Mount it only for agents whose sandbox runs the desktop. The tool schema is large, so agents that never use a desktop should leave it out.++## Sandbox bootstrap++Install the desktop and driver in the environment's `prepare` callback, then start them after `open()` in `defineSandbox()`. Computer use requires an apt-based Linux image with root or passwordless sudo; it cannot run on the `just-bash` provider.++```ts+// agent/sandbox.ts+import { defineSandbox } from "eve/sandbox";+import { VercelSandbox } from "eve/sandbox/vercel";+import { installComputerUse, startComputerUse } from "eve/computer-use/sandbox";++export const environment = VercelSandbox.environment({+ prepare: async (sandbox) => {+ await installComputerUse(sandbox);+ },+});++export default defineSandbox(async () => {+ const sandbox = await environment.open();+ await startComputerUse(sandbox);+ return sandbox;+});+```++Mounting the extension exposes `computer_use` but does not install or start its driver. The prepared artifact captures files, not running processes; the `defineSandbox()` selector starts the driver once for each new durable sandbox. If the driver exits or the provider resumes only filesystem state, call `startComputerUse` again before using the tool; resuming a sandbox does not rerun the selector. Stop recordings with `record_stop` to finalize the MP4 at the returned sandbox path. A five-minute watchdog also finalizes forgotten recordings, and the driver attempts finalization on `SIGINT` or `SIGTERM`; abrupt VM termination cannot guarantee a finalized MP4.++## Develop in this workspace++Rebuild eve after editing `extension/`:++```sh+pnpm --filter eve build+pnpm --filter @eve/computer-use typecheck+pnpm --filter @eve/computer-use test:scenario+pnpm exec oxlint packages/eve-computer-use+pnpm exec oxfmt --check packages/eve-computer-use+```diff --git a/packages/eve-computer-use/extension/extension.ts b/packages/eve-computer-use/extension/extension.tsnew file mode 100644index 000000000..eb45471fd--- /dev/null+++ b/packages/eve-computer-use/extension/extension.ts@@ -0,0 +1,3 @@+import { defineExtension } from "eve/extension";++export default defineExtension();diff --git a/packages/eve-computer-use/extension/lib/command-failure.ts b/packages/eve-computer-use/extension/lib/command-failure.tsnew file mode 100644index 000000000..d43f58f1e--- /dev/null+++ b/packages/eve-computer-use/extension/lib/command-failure.ts@@ -0,0 +1,22 @@+const MAX_STREAM_CHARS = 8_000;++type CommandOutput = {+ readonly stderr: string;+ readonly stdout: string;+};++function boundedStream(name: "stderr" | "stdout", output: string): string | undefined {+ const trimmed = output.trim();+ if (!trimmed) return undefined;+ if (trimmed.length <= MAX_STREAM_CHARS) return `${name}:\n${trimmed}`;+ return `${name} (last ${MAX_STREAM_CHARS} characters):\n${trimmed.slice(-MAX_STREAM_CHARS)}`;+}++/** Preserve useful output from failed sandbox commands without flooding build logs. */+export function commandFailureDetail(result: CommandOutput): string {+ const streams = [boundedStream("stdout", result.stdout), boundedStream("stderr", result.stderr)];+ return (+ streams.filter((stream): stream is string => stream !== undefined).join("\n") ||+ "no command output"+ );+}diff --git a/packages/eve-code/extension/lib/computer-use-driver-source.ts b/packages/eve-computer-use/extension/lib/computer-use-driver-source.tssimilarity index 100%rename from packages/eve-code/extension/lib/computer-use-driver-source.tsrename to packages/eve-computer-use/extension/lib/computer-use-driver-source.tsdiff --git a/packages/eve-code/extension/lib/computer-use-sandbox.ts b/packages/eve-computer-use/extension/lib/computer-use-sandbox.tssimilarity index 100%rename from packages/eve-code/extension/lib/computer-use-sandbox.tsrename to packages/eve-computer-use/extension/lib/computer-use-sandbox.tsdiff --git a/packages/eve-code/extension/lib/computer-use.ts b/packages/eve-computer-use/extension/lib/computer-use.tssimilarity index 100%rename from packages/eve-code/extension/lib/computer-use.tsrename to packages/eve-computer-use/extension/lib/computer-use.tsdiff --git a/packages/eve-computer-use/extension/lib/sandbox.ts b/packages/eve-computer-use/extension/lib/sandbox.tsnew file mode 100644index 000000000..369523874--- /dev/null+++ b/packages/eve-computer-use/extension/lib/sandbox.ts@@ -0,0 +1,5 @@+export {+ COMPUTER_USE_REVALIDATION_KEY,+ installComputerUse,+ startComputerUse,+} from "./computer-use-sandbox.ts";diff --git a/packages/eve-computer-use/extension/lib/shell.ts b/packages/eve-computer-use/extension/lib/shell.tsnew file mode 100644index 000000000..aef41c372--- /dev/null+++ b/packages/eve-computer-use/extension/lib/shell.ts@@ -0,0 +1,3 @@+export function shellQuote(value: string): string {+ return `'${value.replaceAll("'", `'"'"'`)}'`;+}diff --git a/packages/eve-code/extension/tools/computer_use.ts b/packages/eve-computer-use/extension/tools/computer_use.tssimilarity index 100%rename from packages/eve-code/extension/tools/computer_use.tsrename to packages/eve-computer-use/extension/tools/computer_use.tsdiff --git a/packages/eve-computer-use/package.json b/packages/eve-computer-use/package.jsonnew file mode 100644index 000000000..8cfac5a70--- /dev/null+++ b/packages/eve-computer-use/package.json@@ -0,0 +1,32 @@+{+ "name": "@eve/computer-use",+ "version": "0.0.0",+ "private": true,+ "description": "Source of the eve/computer-use extension: computer use in a Linux sandbox desktop, with the driver install and start helpers.",+ "type": "module",+ "exports": {+ "./package.json": "./package.json"+ },+ "scripts": {+ "test:scenario": "node --test \"test/scenario/*.test.ts\"",+ "typecheck": "tsc"+ },+ "dependencies": {+ "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-code/test/scenario/computer-use-driver-source.test.ts b/packages/eve-computer-use/test/scenario/computer-use-driver-source.test.tssimilarity index 100%rename from packages/eve-code/test/scenario/computer-use-driver-source.test.tsrename to packages/eve-computer-use/test/scenario/computer-use-driver-source.test.tsdiff --git a/packages/eve-code/test/scenario/computer-use-lifecycle.test.ts b/packages/eve-computer-use/test/scenario/computer-use-lifecycle.test.tssimilarity index 100%rename from packages/eve-code/test/scenario/computer-use-lifecycle.test.tsrename to packages/eve-computer-use/test/scenario/computer-use-lifecycle.test.tsdiff --git a/packages/eve-code/test/scenario/computer-use-natural-typing.test.ts b/packages/eve-computer-use/test/scenario/computer-use-natural-typing.test.tssimilarity index 100%rename from packages/eve-code/test/scenario/computer-use-natural-typing.test.tsrename to packages/eve-computer-use/test/scenario/computer-use-natural-typing.test.tsdiff --git a/packages/eve-code/test/scenario/computer-use-pointer-motion.test.ts b/packages/eve-computer-use/test/scenario/computer-use-pointer-motion.test.tssimilarity index 100%rename from packages/eve-code/test/scenario/computer-use-pointer-motion.test.tsrename to packages/eve-computer-use/test/scenario/computer-use-pointer-motion.test.tsdiff --git a/packages/eve-code/test/scenario/computer-use.test.ts b/packages/eve-computer-use/test/scenario/computer-use.test.tssimilarity index 100%rename from packages/eve-code/test/scenario/computer-use.test.tsrename to packages/eve-computer-use/test/scenario/computer-use.test.tsdiff --git a/packages/eve-computer-use/test/scenario/tool-input-schemas.test.ts b/packages/eve-computer-use/test/scenario/tool-input-schemas.test.tsnew file mode 100644index 000000000..f4235c9ed--- /dev/null+++ b/packages/eve-computer-use/test/scenario/tool-input-schemas.test.ts@@ -0,0 +1,24 @@+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";++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 computer-use tool must serialize to an object root.+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(", ")}`);+ for (const file of files) {+ const tool = (await import(new URL(file, toolsDir).href)).default as { inputSchema: z.ZodType };+ 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}`);+ }+});diff --git a/packages/eve-computer-use/tsconfig.json b/packages/eve-computer-use/tsconfig.jsonnew file mode 100644index 000000000..a9e8fe768--- /dev/null+++ b/packages/eve-computer-use/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-computer-use/turbo.json b/packages/eve-computer-use/turbo.jsonnew file mode 100644index 000000000..ab35cec4d--- /dev/null+++ b/packages/eve-computer-use/turbo.json@@ -0,0 +1,8 @@+{+ "extends": ["//"],+ "tasks": {+ "test:scenario": {+ "dependsOn": ["^build"]+ }+ }+}diff --git a/packages/eve/package.json b/packages/eve/package.jsonindex d369fcac0..31beeabd3 100644--- a/packages/eve/package.json+++ b/packages/eve/package.json@@ -368,6 +368,24 @@"import": "./dist/src/extensions/code/extension/lib/prwatch.js","default": "./dist/src/extensions/code/extension/lib/prwatch.js"},+ "./computer-use": {+ "eve-source": "./dist/src/computer-use/extension/extension.js",+ "types": "./dist/src/computer-use/extension/extension.d.ts",+ "import": "./dist/src/computer-use/extension/extension.js",+ "default": "./dist/src/computer-use/extension/extension.js"+ },+ "./computer-use/tools": {+ "eve-source": "./dist/src/computer-use/tools.js",+ "types": "./dist/src/computer-use/tools.d.ts",+ "import": "./dist/src/computer-use/tools.js",+ "default": "./dist/src/computer-use/tools.js"+ },+ "./computer-use/sandbox": {+ "eve-source": "./dist/src/computer-use/extension/lib/sandbox.js",+ "types": "./dist/src/computer-use/extension/lib/sandbox.d.ts",+ "import": "./dist/src/computer-use/extension/lib/sandbox.js",+ "default": "./dist/src/computer-use/extension/lib/sandbox.js"+ },"./extension": {"types": "./dist/src/public/extension/index.d.ts","import": "./dist/src/public/extension/index.js",@@ -618,6 +636,9 @@},"./extensions/code": {"dist": "./dist/src/extensions/code/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.mjsindex 65e287cab..fd8dfa0ff 100644--- a/packages/eve/scripts/copy-runtime-assets.mjs+++ b/packages/eve/scripts/copy-runtime-assets.mjs@@ -9,7 +9,7 @@ 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"];+const extensionAssetDirs = ["src/extensions/code/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-code-extension.mjs b/packages/eve/scripts/sync-extensions.mjssimilarity index 53%rename from packages/eve/scripts/sync-code-extension.mjsrename to packages/eve/scripts/sync-extensions.mjsindex 245dd5433..86969c426 100644--- a/packages/eve/scripts/sync-code-extension.mjs+++ b/packages/eve/scripts/sync-extensions.mjs@@ -1,9 +1,10 @@/**- * Copies the private `@eve/code` extension tree into `src/extensions/code/extension`- * so eve compiles and ships it as the `eve/extensions/code` built-in extension.- * `@eve/code` stays the source of truth; the copy is gitignored. eve cannot- * depend on `@eve/code` (which depends on eve), so the sibling workspace path is- * read directly and declared as a turbo input in `turbo.json`.+ * 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+ * 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`.*/import { cp, mkdir, readFile, readdir, rm } from "node:fs/promises";import { dirname, join, relative } from "node:path";@@ -12,21 +13,35 @@ import { fileURLToPath, pathToFileURL } from "node:url";import { acquireLock, releaseLock } from "./vendor-compiled/_shared.mjs";const packageRoot = fileURLToPath(new URL("..", import.meta.url));-const source = join(packageRoot, "..", "eve-code", "extension");-export const codeExtensionTarget = join(packageRoot, "src", "extensions", "code", "extension");+export const builtInExtensions = [+ {+ name: "code",+ source: join(packageRoot, "..", "eve-code", "extension"),+ target: join(packageRoot, "src", "extensions", "code", "extension"),+ },+ {+ name: "computer-use",+ source: join(packageRoot, "..", "eve-computer-use", "extension"),+ target: join(packageRoot, "src", "computer-use", "extension"),+ },+];// Turbo runs several eve tasks at once and each one syncs; rewriting an// identical tree would delete files a peer task is already compiling or testing.-export async function syncCodeExtension() {- const lockPath = join(packageRoot, ".generated", "code-extension.lock");+export async function syncExtensions() {+ for (const extension of builtInExtensions) await syncExtension(extension);+}++async function syncExtension({ name, source, target }) {+ const lockPath = join(packageRoot, ".generated", `${name}-extension.lock`);await mkdir(dirname(lockPath), { recursive: true });await acquireLock(lockPath);try {- if (await sameTree(source, codeExtensionTarget)) return;- await rm(codeExtensionTarget, { recursive: true, force: true });- await mkdir(dirname(codeExtensionTarget), { recursive: true });- await cp(source, codeExtensionTarget, { recursive: true });+ if (await sameTree(source, target)) return;+ await rm(target, { recursive: true, force: true });+ await mkdir(dirname(target), { recursive: true });+ await cp(source, target, { recursive: true });} finally {await releaseLock(lockPath);}@@ -53,5 +68,5 @@ async function listFiles(root) {}if (import.meta.url === pathToFileURL(process.argv[1]).href) {- await syncCodeExtension();+ await syncExtensions();}diff --git a/packages/eve/scripts/vendor-compiled.mjs b/packages/eve/scripts/vendor-compiled.mjsindex 3d0023d37..937dc7785 100644--- a/packages/eve/scripts/vendor-compiled.mjs+++ b/packages/eve/scripts/vendor-compiled.mjs@@ -16,7 +16,7 @@ import { fileURLToPath } from "node:url";import { resolveNitroRolldownVersion } from "./nitro-rolldown.mjs";import { collectFilesRecursively, runVendor } from "./vendor-compiled/_shared.mjs";import { MODULES } from "./vendor-compiled/index.mjs";-import { syncCodeExtension } from "./sync-code-extension.mjs";+import { syncExtensions } from "./sync-extensions.mjs";const here = dirname(fileURLToPath(import.meta.url));const require = createRequire(import.meta.url);@@ -35,7 +35,7 @@ const scriptFiles = [...(await collectFilesRecursively(vendorCompiledDir, [".mjs", ".d.ts"])),];-await syncCodeExtension();+await syncExtensions();await runVendor({packageRoot,diff --git a/packages/eve/src/computer-use/tools.ts b/packages/eve/src/computer-use/tools.tsnew file mode 100644index 000000000..404727f3e--- /dev/null+++ b/packages/eve/src/computer-use/tools.ts@@ -0,0 +1 @@+export { default as computer_use } from "./extension/tools/computer_use.ts";diff --git a/packages/eve/src/extensions/code/tools.ts b/packages/eve/src/extensions/code/tools.tsindex ebdd80732..130eb0c71 100644--- a/packages/eve/src/extensions/code/tools.ts+++ b/packages/eve/src/extensions/code/tools.ts@@ -1,4 +1,5 @@export { default as apply_patch } from "./extension/tools/apply_patch.ts";-export { default as computer_use } from "./extension/tools/computer_use.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";export { default as grep } from "./extension/tools/grep.ts";diff --git a/packages/eve/src/internal/structural-tests/file-length.test.ts b/packages/eve/src/internal/structural-tests/file-length.test.tsindex 956458de3..c92db586b 100644--- a/packages/eve/src/internal/structural-tests/file-length.test.ts+++ b/packages/eve/src/internal/structural-tests/file-length.test.ts@@ -27,8 +27,8 @@ const LONG_SOURCE_FILE_ALLOWLIST = new Set<string>([]);const SKIP_DIRS = new Set(["node_modules", "dist", "build", "coverage"]);-// Generated copy of `@eve/code` (see scripts/sync-code-extension.mjs); its source lives outside eve.-const GENERATED_SOURCE_PREFIXES = ["extensions/code/extension/"];+// Generated copies of `@eve/code` and `@eve/computer-use` (see scripts/sync-extensions.mjs); their source lives outside eve.+const GENERATED_SOURCE_PREFIXES = ["extensions/code/extension/", "computer-use/extension/"];describe("source file structure", () => {it("keeps production source files below the line-count cap", async () => {diff --git a/packages/eve/turbo.json b/packages/eve/turbo.jsonindex 1fdfd28a2..e13cb781d 100644--- a/packages/eve/turbo.json+++ b/packages/eve/turbo.json@@ -3,13 +3,25 @@"tasks": {"build": {"dependsOn": ["$TURBO_EXTENDS$"],- "inputs": ["$TURBO_EXTENDS$", "$TURBO_ROOT$/packages/eve-code/extension/**"]+ "inputs": [+ "$TURBO_EXTENDS$",+ "$TURBO_ROOT$/packages/eve-code/extension/**",+ "$TURBO_ROOT$/packages/eve-computer-use/extension/**"+ ]},"build:types": {- "inputs": ["$TURBO_EXTENDS$", "$TURBO_ROOT$/packages/eve-code/extension/**"]+ "inputs": [+ "$TURBO_EXTENDS$",+ "$TURBO_ROOT$/packages/eve-code/extension/**",+ "$TURBO_ROOT$/packages/eve-computer-use/extension/**"+ ]},"typecheck": {- "inputs": ["$TURBO_EXTENDS$", "$TURBO_ROOT$/packages/eve-code/extension/**"]+ "inputs": [+ "$TURBO_EXTENDS$",+ "$TURBO_ROOT$/packages/eve-code/extension/**",+ "$TURBO_ROOT$/packages/eve-computer-use/extension/**"+ ]}}}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 69d3a0dc0..75cf07f36 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1905,6 +1905,25 @@ importers:specifier: npm:[email protected]version: [email protected]+ packages/eve-computer-use:+ dependencies:+ 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]+ version: [email protected]+packages/eve-self-modification:dependencies:eve: