-
Notifications
You must be signed in to change notification settings - Fork 407
feat: add ACP adapter for local and remote agents #1347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
cmpadden
wants to merge
1
commit into
main
Choose a base branch
from
feat/acp-adapter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "eve": patch | ||
| --- | ||
|
|
||
| Launch local or deployed eve applications as stable ACP v1 agents with `eve acp [url]`, including streamed messages, tool activity, human input, cancellation, and concurrent sessions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| title: "Use eve through ACP" | ||
| description: "Launch a local eve agent from Zed and other Agent Client Protocol clients." | ||
| --- | ||
|
|
||
| Agent Client Protocol (ACP) clients can launch an authored eve application as a local subprocess. eve serves stable ACP v1 over stdio while its normal development server remains the execution runtime. | ||
|
|
||
| ```sh | ||
| eve acp | ||
| ``` | ||
|
|
||
| Without a URL, the client starts one process from the eve application root. It supervises a local development server, and closing the ACP connection stops that owned server. To bridge ACP to a deployed eve agent, pass its URL: | ||
|
|
||
| ```sh | ||
| eve acp https://agent.example.com | ||
| ``` | ||
|
|
||
| ## Configure Zed | ||
|
|
||
| Open the eve application root as the Zed workspace. In **Agent Settings → External Agents**, add a custom agent: | ||
|
|
||
| ```json | ||
| { | ||
| "agent_servers": { | ||
| "eve-local": { | ||
| "type": "custom", | ||
| "command": "pnpm", | ||
| "args": ["exec", "eve", "acp"], | ||
| "env": {} | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Use an absolute command path if Zed cannot find `pnpm` in its environment. The workspace must be the same directory as the eve application root; eve rejects a different `session/new.cwd` instead of running the wrong application. | ||
|
|
||
| Disable Zed project MCP servers for this agent. The initial eve adapter does not accept client-provided MCP servers. | ||
|
|
||
| ## Supported behavior | ||
|
|
||
| ACP clients receive: | ||
|
|
||
| - streamed assistant text and reasoning; | ||
| - tool-call requests and results; | ||
| - one-time tool approval and denial requests; | ||
| - fixed-choice and freeform questions when the client supports ACP form elicitation; | ||
| - cooperative turn cancellation; | ||
| - independent concurrent ACP sessions; | ||
| - session closure and process cleanup. | ||
|
|
||
| Development rebuilds retain normal eve semantics. In-flight work stays pinned to its generation, and the next turn uses the newest successful generation. | ||
|
|
||
| ## Security and capability limits | ||
|
|
||
| ACP mode does not give the agent access to the editor's host filesystem or terminal. `session/new.cwd` identifies the eve application being launched; it is not mounted into the agent sandbox. | ||
|
|
||
| The initial adapter does not support: | ||
|
|
||
| - a deployed ACP HTTP or WebSocket endpoint;\n- ACP authentication (remote bridges use the deployed eve agent's existing HTTP authentication); | ||
| - ACP v2; | ||
| - client filesystem or terminal methods; | ||
| - client-provided MCP servers; | ||
| - images, audio, files, or embedded resources in prompts; | ||
| - session loading, listing, resumption, or durable ACP IDs across process restarts; | ||
| - ACP model or mode configuration. | ||
|
|
||
| The agent continues to use the connections, tools, credentials, and sandbox policy authored in the eve application. Prompt text and ACP metadata never establish an authenticated end-user principal. | ||
|
|
||
| ## Diagnose a connection | ||
|
|
||
| ACP reserves stdout for newline-delimited JSON-RPC. eve sends compilation output, server logs, and diagnostics to stderr so they cannot corrupt the protocol stream. | ||
|
|
||
| For a quick headless smoke test, run an ACP client such as `acpx` from the application root. `acpx` launches the ACP process itself; do not start `eve acp` separately. | ||
|
|
||
| ```sh | ||
| npx acpx@latest \ | ||
| --agent 'pnpm exec eve acp' \ | ||
| exec 'Reply with exactly: ACP works' | ||
| ``` | ||
|
|
||
| When testing from the eve source checkout, use an authored fixture rather than the monorepo root, which does not provide an `eve` executable: | ||
|
|
||
| ```sh | ||
| cd apps/fixtures/weather-agent | ||
| npx acpx@latest --agent 'pnpm exec eve acp' exec 'Reply with exactly: ACP works' | ||
| ``` | ||
|
|
||
| If startup fails, inspect the ACP client's logs together with eve's stderr. A non-empty client MCP configuration, a mismatched working directory, and unsupported prompt content produce explicit protocol errors before model work begins. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| "dynamic-workflows", | ||
| "remote-agents", | ||
| "dev-tui", | ||
| "acp", | ||
| "frontend", | ||
| "client" | ||
| ] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/eve/scripts/vendor-compiled/@agentclientprotocol/sdk.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { mkdir, readFile, writeFile } from "node:fs/promises"; | ||
| import { dirname, join } from "node:path"; | ||
|
|
||
| const DECLARATIONS = [ | ||
| ["acp.d.ts", "index.d.ts"], | ||
| ["jsonrpc.d.ts", "jsonrpc.d.ts"], | ||
| ["stream.d.ts", "stream.d.ts"], | ||
| ["schema/guards.gen.d.ts", "schema/guards.gen.d.ts"], | ||
| ["schema/index.d.ts", "schema/index.d.ts"], | ||
| ["schema/types.gen.d.ts", "schema/types.gen.d.ts"], | ||
| ]; | ||
|
|
||
| /** Vendor the stable ACP v1 SDK without adding it to eve's runtime dependencies. */ | ||
| export default { | ||
| packageName: "@agentclientprotocol/sdk", | ||
| compiledPath: "@agentclientprotocol/sdk", | ||
| bundling: "standalone", | ||
| copyDeclarations: async ({ destinationRoot, packageInfo }) => { | ||
| const sourceRoot = join(packageInfo.packageRoot, "dist"); | ||
| for (const [sourceFile, destinationFile] of DECLARATIONS) { | ||
| const destinationPath = join(destinationRoot, destinationFile); | ||
| await mkdir(dirname(destinationPath), { recursive: true }); | ||
| await writeFile(destinationPath, await readFile(join(sourceRoot, sourceFile)), "utf8"); | ||
| } | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A literal
\nescape sequence in the markdown source merges two bullet list items into one broken bullet