The Open Framework for Building Agents
feat: add ACP adapter (#1347)
Colton Paddene90a8c2fa9c6
diff --git a/.changeset/bright-apes-serve-acp.md b/.changeset/bright-apes-serve-acp.mdnew file mode 100644index 000000000..474aa70c9--- /dev/null+++ b/.changeset/bright-apes-serve-acp.md@@ -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, concurrent sessions, and verified Vercel authentication.diff --git a/apps/docs/public/r/channel/photon-imessage.json b/apps/docs/public/r/channel/photon-imessage.jsonindex fca9a71df..6a9b2309b 100644--- a/apps/docs/public/r/channel/photon-imessage.json+++ b/apps/docs/public/r/channel/photon-imessage.json@@ -3,23 +3,17 @@"name": "channel/photon-imessage","title": "Photon iMessage","description": "Connect an eve agent to iMessage through Photon with guided project and phone setup.",- "dependencies": [- "@vercel/[email protected]"- ],+ "dependencies": ["@vercel/[email protected]"],"meta": {"eve": {"setup": {"command": "eve","package": "eve","bin": "eve",- "args": [- "integration",- "setup",- "photon"- ]+ "args": ["integration", "setup", "photon"]},"requires": ">=0.29.0"}},"type": "registry:item"-}\ No newline at end of file+}diff --git a/docs/guides/acp.md b/docs/guides/acp.mdnew file mode 100644index 000000000..392dc07b7--- /dev/null+++ b/docs/guides/acp.md@@ -0,0 +1,91 @@+---+title: "Use eve through ACP"+description: "Use local or deployed eve agents from 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+```++For a recognized Vercel deployment, eve verifies the exact origin and resolves a short-lived project-scoped OIDC token from the local Vercel session. If login or a Trusted Sources change is required, run `eve dev <url>` and complete `/vc:login` before launching ACP. `VERCEL_AUTOMATION_BYPASS_SECRET` remains available for deployments configured with a Protection Bypass for Automation token.++## 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;+- 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.diff --git a/docs/guides/meta.json b/docs/guides/meta.jsonindex f30738049..5ae6f4974 100644--- a/docs/guides/meta.json+++ b/docs/guides/meta.json@@ -11,6 +11,7 @@"dynamic-workflows","remote-agents","dev-tui",+ "acp","frontend","client"]diff --git a/docs/reference/cli.md b/docs/reference/cli.mdindex 971b26ded..f09d0934f 100644--- a/docs/reference/cli.md+++ b/docs/reference/cli.md@@ -15,6 +15,7 @@ The `eve` binary (`bin: eve`) runs from your app root, and every command first l| `eve start` | Serve the built `.output/` app; prints the listening URL || `eve dev` | Start the local dev server and open the terminal UI || `eve dev <url>` | Connect the UI to an existing server URL (e.g. a remote deployment) instead of booting a local server |+| `eve acp [url]` | Serve the local application or an existing eve server URL as a stable ACP v1 agent over stdio || `eve logs [logid]` | Print an `eve dev` diagnostic log (the most recent when `logid` is omitted) || `eve logs ls` | List `eve dev` diagnostic logs, most recent first || `eve traces ls` | List locally captured agent traces, most recent first |@@ -183,6 +184,8 @@ Pass a bare URL and the UI connects to that server instead of booting a local on| `--context-size <tokens>` | number | none | Model context window size, shown as a usage percentage || `--logs <mode>` | enum | `stderr` | Server/agent logs to show: `all` \| `stderr` \| `sandbox` \| `none` |+`eve acp` reserves stdin and stdout for newline-delimited JSON-RPC and sends diagnostics to stderr. Without a URL, it supervises an isolated local development server. With a URL, it bridges ACP to that server's existing eve HTTP API and accepts the same URL credentials and request headers as `eve dev <url>`. Pass `--scope <team>` when the active Vercel scope does not own the deployment; `EVE_VERCEL_SCOPE` provides the same value for managed harnesses. See [Use eve through ACP](../guides/acp) for client configuration and capability limits.+A fresh `eve init` passes `--input /model`. That bare local input starts onboarding: the TUI installs the Vercel CLI if needed, asks you to log in if needed, opens `/model`, then offers categorized registry next steps before the first prompt. Other input stays editable in the prompt.For a URL target protected by HTTP Basic auth, put the credentials in the URL. eve sends them as a Basic `Authorization` header and strips them from the server URL before connecting:diff --git a/package.json b/package.jsonindex 7beea793c..5a1c51022 100644--- a/package.json+++ b/package.json@@ -48,7 +48,7 @@"syncpack": "15.3.2","turbo": "2.9.18","typescript": "catalog:",- "vercel": "54.14.2",+ "vercel": "58.4.0","vitest": "catalog:"},"simple-git-hooks": {diff --git a/packages/eve/package.json b/packages/eve/package.jsonindex 930bf2113..0e927bfdb 100644--- a/packages/eve/package.json+++ b/packages/eve/package.json@@ -313,6 +313,7 @@"undici": "8.9.0"},"devDependencies": {+ "@agentclientprotocol/sdk": "1.3.0","@ai-sdk/anthropic": "catalog:","@ai-sdk/google": "catalog:","@ai-sdk/mcp": "catalog:",diff --git a/packages/eve/scripts/vendor-compiled/@agentclientprotocol/sdk.mjs b/packages/eve/scripts/vendor-compiled/@agentclientprotocol/sdk.mjsnew file mode 100644index 000000000..8d6f5037c--- /dev/null+++ b/packages/eve/scripts/vendor-compiled/@agentclientprotocol/sdk.mjs@@ -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");+ }+ },+};diff --git a/packages/eve/scripts/vendor-compiled/index.mjs b/packages/eve/scripts/vendor-compiled/index.mjsindex 90a35ac9b..f7548dce6 100644--- a/packages/eve/scripts/vendor-compiled/index.mjs+++ b/packages/eve/scripts/vendor-compiled/index.mjs@@ -3,6 +3,7 @@* the orchestrator passes to `runVendor`. Adding a new vendored package* means writing a new per-package file and importing it here.*/+import acpSdk from "./@agentclientprotocol/sdk.mjs";import anthropic from "./@ai-sdk/anthropic.mjs";import google from "./@ai-sdk/google.mjs";import mcp from "./@ai-sdk/mcp.mjs";@@ -49,6 +50,7 @@ import zod from "./zod.mjs";import zodValidationError from "./zod-validation-error.mjs";export const MODULES = [+ acpSdk,anthropic,chat,chatAdapterSlack,diff --git a/packages/eve/src/acp/adapter.test.ts b/packages/eve/src/acp/adapter.test.tsnew file mode 100644index 000000000..74525a93d--- /dev/null+++ b/packages/eve/src/acp/adapter.test.ts@@ -0,0 +1,588 @@+import { RequestError, type AgentContext } from "#compiled/@agentclientprotocol/sdk/index.js";+import { describe, expect, it, vi } from "vitest";++import { EveAcpAdapter } from "#acp/adapter.js";+import { ClientError } from "#client/client-error.js";+import type { SendTurnInput, SessionState } from "#client/types.js";+import type { HandleMessageStreamEvent } from "#protocol/message.js";++type TestStreamEvent<T = HandleMessageStreamEvent> = T extends unknown ? Omit<T, "meta"> : never;++class FakeClientSession {+ readonly cancel = vi.fn(async () => ({ status: "accepted" }));+ readonly reset = vi.fn(async () => ({ status: "reset" }));+ readonly sends: SendTurnInput[] = [];+ state: SessionState = { streamIndex: 0 };+ readonly #turns: Array<readonly TestStreamEvent[]>;++ constructor(turns: Array<readonly TestStreamEvent[]>) {+ this.#turns = turns;+ }++ async send(input: SendTurnInput): Promise<AsyncIterable<HandleMessageStreamEvent>> {+ this.sends.push(input);+ this.state = { ...this.state, sessionId: "eve-session" };+ const events = this.#turns.shift() ?? [];+ return (async function* () {+ for (const [index, event] of events.entries()) {+ yield {+ ...event,+ meta: { at: "2026-07-29T00:00:00.000Z", id: `event-${index}` },+ } as HandleMessageStreamEvent;+ }+ })();+ }+}++function adapterWith(turns: Array<readonly TestStreamEvent[]> = []) {+ const session = new FakeClientSession(turns);+ const adapter = new EveAcpAdapter({+ client: { session: () => session },+ eveVersion: "1.2.3",+ serverUrl: "http://127.0.0.1:2000",+ workspaceRoot: process.cwd(),+ });+ return { adapter, session };+}++function acpClient(input?: { request?: AgentContext["request"] }) {+ const notifications: Array<{ method: string; params: unknown }> = [];+ const notify = vi.fn(async (method: string, params: unknown) => {+ notifications.push({ method, params });+ });+ const request = input?.request ?? vi.fn(async () => ({}));+ return {+ client: Object.assign(Object.create(null), { notify, request }) as AgentContext,+ notifications,+ notify,+ request,+ };+}++async function createSession(adapter: EveAcpAdapter): Promise<string> {+ const result = await adapter.newSession({ cwd: process.cwd(), mcpServers: [] });+ return result.sessionId;+}++const textPrompt = (sessionId: string, text = "hello") => ({+ prompt: [{ type: "text" as const, text }],+ sessionId,+});++describe("EveAcpAdapter", () => {+ it("negotiates stable v1 without advertising workspace capabilities", () => {+ const { adapter } = adapterWith();+ expect(+ adapter.initialize({+ protocolVersion: 2,+ clientCapabilities: { fs: { readTextFile: true }, terminal: true },+ }),+ ).toEqual({+ protocolVersion: 1,+ agentCapabilities: {+ loadSession: false,+ promptCapabilities: {},+ sessionCapabilities: { close: {} },+ },+ agentInfo: { name: "eve", title: "eve", version: "1.2.3" },+ authMethods: [],+ });+ });++ it("rejects a different local cwd and client-provided MCP before creating a session", async () => {+ const { adapter } = adapterWith();+ await expect(adapter.newSession({ cwd: process.cwd(), mcpServers: [] })).resolves.toEqual({+ sessionId: expect.any(String),+ });+ await expect(+ adapter.newSession({ cwd: process.cwd(), mcpServers: [{} as never] }),+ ).rejects.toThrow("Client-provided MCP servers");+ await expect(adapter.newSession({ cwd: "/", mcpServers: [] })).rejects.toBeInstanceOf(+ RequestError,+ );+ });++ it("does not treat a remote ACP client's cwd as a deployment workspace", async () => {+ const session = new FakeClientSession([]);+ const adapter = new EveAcpAdapter({+ client: { session: () => session },+ eveVersion: "1.2.3",+ serverUrl: "https://agent.example.com",+ });++ await expect(+ adapter.newSession({ cwd: "/a/client/path-that-does-not-exist", mcpServers: [] }),+ ).resolves.toEqual({ sessionId: expect.any(String) });+ });++ it("streams message, reasoning, and tool lifecycle updates in event order", async () => {+ const events: TestStreamEvent[] = [+ {+ type: "message.appended",+ data: { messageDelta: "Hi", messageSoFar: "Hi", sequence: 1, stepIndex: 0, turnId: "t1" },+ },+ {+ type: "reasoning.appended",+ data: {+ reasoningDelta: "Think",+ reasoningSoFar: "Think",+ sequence: 2,+ stepIndex: 0,+ turnId: "t1",+ },+ },+ {+ type: "actions.requested",+ data: {+ actions: [+ { callId: "call-1", input: { city: "SF" }, kind: "tool-call", toolName: "weather" },+ ],+ sequence: 3,+ stepIndex: 0,+ turnId: "t1",+ },+ },+ {+ type: "action.result",+ data: {+ result: {+ callId: "call-1",+ kind: "tool-result",+ output: { condition: "sunny" },+ toolName: "weather",+ },+ sequence: 4,+ status: "completed",+ stepIndex: 0,+ turnId: "t1",+ },+ },+ { type: "session.waiting", data: { continuationToken: "secret", wait: "next-user-message" } },+ ];+ const { adapter, session } = adapterWith([events]);+ const sessionId = await createSession(adapter);+ const { client, notifications } = acpClient();++ await expect(+ adapter.prompt(textPrompt(sessionId), client, new AbortController().signal),+ ).resolves.toEqual({+ stopReason: "end_turn",+ });+ expect(session.sends).toEqual([{ message: [{ type: "text", text: "hello" }] }]);+ expect(notifications.map(({ params }) => (params as any).update.sessionUpdate)).toEqual([+ "agent_message_chunk",+ "agent_thought_chunk",+ "tool_call",+ "tool_call_update",+ ]);+ expect(notifications.slice(0, 2).map(({ params }) => (params as any).update.messageId)).toEqual(+ ["t1:message:0", "t1:thought:0"],+ );+ expect(JSON.stringify(notifications)).not.toContain("secret");+ });++ it("round-trips a confirmation response through the same logical prompt", async () => {+ const action = {+ callId: "call-1",+ input: { path: "x" },+ kind: "tool-call" as const,+ toolName: "write",+ };+ const { adapter, session } = adapterWith([+ [+ {+ type: "actions.requested",+ data: { actions: [action], sequence: 1, stepIndex: 0, turnId: "t1" },+ },+ {+ type: "input.requested",+ data: {+ requests: [+ {+ action,+ display: "confirmation",+ kind: "tool-approval",+ options: [+ { id: "approve", label: "Approve" },+ { id: "deny", label: "Deny" },+ ],+ prompt: "Allow write?",+ requestId: "request-1",+ },+ ],+ sequence: 2,+ stepIndex: 0,+ turnId: "t1",+ },+ },+ { type: "session.waiting", data: { continuationToken: "one", wait: "next-user-message" } },+ ],+ [{ type: "session.waiting", data: { continuationToken: "two", wait: "next-user-message" } }],+ ]);+ const request = vi.fn(async (_method: string, params: any) => ({+ outcome: { outcome: "selected", optionId: params.options[0].optionId },+ })) as AgentContext["request"];+ const { client } = acpClient({ request });+ const sessionId = await createSession(adapter);++ await expect(+ adapter.prompt(textPrompt(sessionId), client, new AbortController().signal),+ ).resolves.toEqual({+ stopReason: "end_turn",+ });+ expect(request).toHaveBeenCalledOnce();+ expect(session.sends).toHaveLength(2);+ expect(session.sends[1]).toEqual({+ inputResponses: [{ optionId: "approve", requestId: "request-1" }],+ });+ });++ it("round-trips fixed-choice and freeform questions through form elicitation", async () => {+ const action = {+ callId: "call-1",+ input: {},+ kind: "tool-call" as const,+ toolName: "ask_question",+ };+ const { adapter, session } = adapterWith([+ [+ {+ type: "input.requested",+ data: {+ requests: [+ {+ action,+ allowFreeform: false,+ display: "select",+ kind: "question",+ options: [+ { id: "sunny", label: "Sunny" },+ { id: "rainy", label: "Rainy" },+ ],+ prompt: "Weather?",+ requestId: "select-1",+ },+ {+ action,+ allowFreeform: true,+ display: "text",+ kind: "question",+ prompt: "Why?",+ requestId: "text-1",+ },+ ],+ sequence: 1,+ stepIndex: 0,+ turnId: "turn-1",+ },+ },+ { type: "session.waiting", data: { continuationToken: "one", wait: "next-user-message" } },+ ],+ [{ type: "session.waiting", data: { continuationToken: "two", wait: "next-user-message" } }],+ ]);+ adapter.initialize({+ clientCapabilities: { elicitation: { form: {} } },+ protocolVersion: 1,+ });+ const request = vi.fn(async (_method: string, params: any) => ({+ action: "accept",+ content: {+ answer: params.requestedSchema.properties.answer.oneOf ? "sunny" : "Because",+ },+ })) as AgentContext["request"];+ const sessionId = await createSession(adapter);++ await adapter.prompt(+ textPrompt(sessionId),+ acpClient({ request }).client,+ new AbortController().signal,+ );++ expect(request).toHaveBeenCalledTimes(2);+ expect(session.sends[1]).toEqual({+ inputResponses: [+ { optionId: "sunny", requestId: "select-1" },+ { requestId: "text-1", text: "Because" },+ ],+ });+ });++ it("cancels an outstanding permission request without parking the ACP prompt", async () => {+ const action = {+ callId: "call-1",+ input: {},+ kind: "tool-call" as const,+ toolName: "write",+ };+ const { adapter, session } = adapterWith([+ [+ {+ type: "input.requested",+ data: {+ requests: [+ {+ action,+ display: "confirmation",+ kind: "tool-approval",+ options: [+ { id: "approve", label: "Approve" },+ { id: "deny", label: "Deny" },+ ],+ prompt: "Allow write?",+ requestId: "request-1",+ },+ ],+ sequence: 1,+ stepIndex: 0,+ turnId: "turn-1",+ },+ },+ { type: "session.waiting", data: { continuationToken: "one", wait: "next-user-message" } },+ ],+ ]);+ let requestStarted!: () => void;+ const started = new Promise<void>((resolve) => (requestStarted = resolve));+ const request = vi.fn(+ async (_method: string, _params: unknown, options?: { cancellationSignal?: AbortSignal }) => {+ requestStarted();+ await new Promise<never>((_resolve, reject) => {+ options?.cancellationSignal?.addEventListener(+ "abort",+ () => reject(new Error("cancelled")),+ { once: true },+ );+ });+ },+ ) as AgentContext["request"];+ const sessionId = await createSession(adapter);+ const prompt = adapter.prompt(+ textPrompt(sessionId),+ acpClient({ request }).client,+ new AbortController().signal,+ );+ await started;++ await adapter.cancel(sessionId);+ await expect(prompt).resolves.toEqual({ stopReason: "cancelled" });+ expect(session.cancel).toHaveBeenCalledWith({ turnId: "turn-1" });+ expect(session.sends).toHaveLength(1);+ });++ it("does not dispatch a prompt whose JSON-RPC request is already cancelled", async () => {+ const { adapter, session } = adapterWith();+ const sessionId = await createSession(adapter);+ const controller = new AbortController();+ controller.abort();++ await expect(+ adapter.prompt(textPrompt(sessionId), acpClient().client, controller.signal),+ ).rejects.toMatchObject({ code: -32_800 });+ expect(session.sends).toHaveLength(0);+ });++ it("retries cancellation after the first eve session POST is accepted", async () => {+ let releaseSend!: () => void;+ let sendStarted!: () => void;+ const released = new Promise<void>((resolve) => (releaseSend = resolve));+ const started = new Promise<void>((resolve) => (sendStarted = resolve));+ const session = new FakeClientSession([]);+ session.send = vi.fn(async () => {+ sendStarted();+ await released;+ session.state = { sessionId: "eve-session", streamIndex: 0 };+ return (async function* () {+ yield {+ type: "turn.cancelled",+ data: { sequence: 1, turnId: "turn-1" },+ } as HandleMessageStreamEvent;+ yield {+ type: "session.waiting",+ data: { continuationToken: "next", wait: "next-user-message" },+ } as HandleMessageStreamEvent;+ })();+ });+ const adapter = new EveAcpAdapter({+ client: { session: () => session },+ eveVersion: "1.2.3",+ serverUrl: "http://127.0.0.1:2000",+ workspaceRoot: process.cwd(),+ });+ const sessionId = await createSession(adapter);+ const prompt = adapter.prompt(+ textPrompt(sessionId),+ acpClient().client,+ new AbortController().signal,+ );+ await started;++ await adapter.cancel(sessionId);+ expect(session.cancel).not.toHaveBeenCalled();+ releaseSend();++ await expect(prompt).resolves.toEqual({ stopReason: "cancelled" });+ expect(session.cancel).toHaveBeenCalledOnce();+ });++ it("requests cooperative cancellation and waits for the cancelled boundary", async () => {+ let release!: () => void;+ let observeTurn!: () => void;+ const pending = new Promise<void>((resolve) => (release = resolve));+ const turnObserved = new Promise<void>((resolve) => (observeTurn = resolve));+ const session = new FakeClientSession([]);+ session.send = vi.fn(async () => {+ session.state = { sessionId: "eve-session", streamIndex: 0 };+ return (async function* () {+ observeTurn();+ yield {+ type: "turn.started",+ data: { sequence: 0, turnId: "turn-1" },+ } as HandleMessageStreamEvent;+ await pending;+ yield {+ type: "turn.cancelled",+ data: { sequence: 1, turnId: "turn-1" },+ } as HandleMessageStreamEvent;+ yield {+ type: "session.waiting",+ data: { continuationToken: "next", wait: "next-user-message" },+ } as HandleMessageStreamEvent;+ })();+ });+ const adapter = new EveAcpAdapter({+ client: { session: () => session },+ eveVersion: "1.2.3",+ serverUrl: "http://127.0.0.1:2000",+ workspaceRoot: process.cwd(),+ });+ const sessionId = await createSession(adapter);+ const prompt = adapter.prompt(+ textPrompt(sessionId),+ acpClient().client,+ new AbortController().signal,+ );+ await turnObserved;+ await new Promise((resolve) => setTimeout(resolve, 0));++ await adapter.cancel(sessionId);+ expect(session.cancel).toHaveBeenCalledWith({ turnId: "turn-1" });+ release();+ await expect(prompt).resolves.toEqual({ stopReason: "cancelled" });+ });++ it("returns structured eve errors for HTTP failures", async () => {+ const session = new FakeClientSession([]);+ session.send = vi.fn(async () => {+ throw new ClientError(401, JSON.stringify({ error: "Unauthorized" }));+ });+ const adapter = new EveAcpAdapter({+ client: { session: () => session },+ eveVersion: "1.2.3",+ serverUrl: "https://agent.example.com",+ });+ const sessionId = await createSession(adapter);++ const error = await adapter+ .prompt(textPrompt(sessionId), acpClient().client, new AbortController().signal)+ .catch((caught: unknown) => caught);++ expect(error).toBeInstanceOf(RequestError);+ expect(error).toMatchObject({ code: -32_002, data: { httpStatus: 401 } });+ });++ it("reports rejected actions as failed tool calls", async () => {+ const { adapter } = adapterWith([+ [+ {+ type: "action.result",+ data: {+ result: {+ callId: "call-1",+ kind: "tool-result",+ output: "Denied",+ toolName: "write",+ },+ sequence: 1,+ status: "rejected",+ stepIndex: 0,+ turnId: "turn-1",+ },+ },+ { type: "session.waiting", data: { continuationToken: "next", wait: "next-user-message" } },+ ],+ ]);+ const sessionId = await createSession(adapter);+ const { client, notifications } = acpClient();++ await adapter.prompt(textPrompt(sessionId), client, new AbortController().signal);++ expect(notifications).toHaveLength(1);+ expect((notifications[0]!.params as any).update.status).toBe("failed");+ });++ it("fails unsupported authorization requests instead of ending successfully", async () => {+ const { adapter } = adapterWith([+ [+ {+ type: "authorization.required",+ data: {+ description: "Sign in",+ name: "linear",+ sequence: 1,+ stepIndex: 0,+ turnId: "turn-1",+ },+ },+ { type: "session.waiting", data: { continuationToken: "next", wait: "next-user-message" } },+ ],+ ]);+ const sessionId = await createSession(adapter);++ await expect(+ adapter.prompt(textPrompt(sessionId), acpClient().client, new AbortController().signal),+ ).rejects.toThrow("cannot be completed");+ });++ it("rejects empty and unsupported prompt content instead of dropping it", async () => {+ const { adapter } = adapterWith();+ const sessionId = await createSession(adapter);+ const signal = new AbortController().signal;+ await expect(+ adapter.prompt(+ { prompt: [{ type: "text", text: "" }], sessionId },+ acpClient().client,+ signal,+ ),+ ).rejects.toThrow("non-empty text block");+ await expect(+ adapter.prompt(+ { prompt: [{ type: "image", data: "a", mimeType: "image/png" }], sessionId },+ acpClient().client,+ signal,+ ),+ ).rejects.toThrow("not supported");+ });++ it("resets owned eve sessions when an ACP session or connection closes", async () => {+ const { adapter, session } = adapterWith();+ const first = await createSession(adapter);++ await adapter.closeSession(first);+ expect(session.reset).toHaveBeenCalledOnce();+ await expect(+ adapter.prompt(textPrompt(first), acpClient().client, new AbortController().signal),+ ).rejects.toThrow("Unknown or closed");++ await createSession(adapter);+ await adapter.close();+ expect(session.reset).toHaveBeenCalledTimes(2);+ });++ it("keeps whole-connection cleanup best-effort when reset fails", async () => {+ const { adapter, session } = adapterWith();+ await createSession(adapter);+ session.reset.mockRejectedValueOnce(new Error("server already stopped"));++ await expect(adapter.close()).resolves.toBeUndefined();+ expect(session.reset).toHaveBeenCalledOnce();+ });+});diff --git a/packages/eve/src/acp/adapter.ts b/packages/eve/src/acp/adapter.tsnew file mode 100644index 000000000..adedb416b--- /dev/null+++ b/packages/eve/src/acp/adapter.ts@@ -0,0 +1,543 @@+import { randomUUID } from "node:crypto";+import { realpath } from "node:fs/promises";++import {+ PROTOCOL_VERSION,+ RequestError,+ methods,+ type AgentContext,+ type InitializeRequest,+ type InitializeResponse,+ type NewSessionRequest,+ type NewSessionResponse,+ type PromptRequest,+ type PromptResponse,+ type SessionUpdate,+ type ToolCall,+} from "#compiled/@agentclientprotocol/sdk/index.js";+import { Client, ClientError } from "#client/index.js";+import type { ClientOptions, SendTurnInput, SessionState } from "#client/types.js";+import type { HandleMessageStreamEvent } from "#protocol/message.js";+import type { RuntimeActionRequest, RuntimeActionResult } from "#runtime/actions/types.js";+import type { InputRequest, InputResponse } from "#runtime/input/types.js";++const ANSWER_FIELD = "answer";+const ERROR_CODE_BUSY = -32_001;+const ERROR_CODE_EVE = -32_002;+const ERROR_CODE_UNSUPPORTED = -32_003;++interface ActivePrompt {+ cancelRequested: boolean;+ protocolCancelled: boolean;+ readonly outboundController: AbortController;+ readonly settled: Promise<void>;+ readonly resolveSettled: () => void;+ turnId?: string;+}++interface AdapterClientSession {+ readonly state: SessionState;+ send(input: SendTurnInput): Promise<AsyncIterable<HandleMessageStreamEvent>>;+ cancel(options?: { turnId?: string }): Promise<unknown>;+ reset(): Promise<unknown>;+}++interface AdapterClient {+ session(): AdapterClientSession;+}++interface AcpSession {+ readonly client: AdapterClientSession;+ active?: ActivePrompt;+ readonly tools: Map<string, ToolCall>;+}++/** Configuration for translating one ACP client connection to an eve server. */+export interface EveAcpAdapterOptions {+ readonly eveVersion: string;+ readonly auth?: ClientOptions["auth"];+ readonly headers?: ClientOptions["headers"];+ readonly serverUrl: string;+ /** Local workspace root to enforce; omit when connecting to a remote deployment. */+ readonly workspaceRoot?: string;+ /** @internal Test seam for the public eve client boundary. */+ readonly client?: AdapterClient;+}++/**+ * Translates stable ACP v1 sessions onto the public eve HTTP client.+ *+ * The adapter owns only process-local ACP identities. Conversation durability,+ * event cursors, cancellation, and reset behavior remain owned by+ * {@link ClientSession}.+ */+export class EveAcpAdapter {+ readonly #client: AdapterClient;+ readonly #eveVersion: string;+ readonly #workspaceRoot: string | undefined;+ #formElicitationSupported = false;+ readonly #sessions = new Map<string, AcpSession>();++ constructor(options: EveAcpAdapterOptions) {+ this.#eveVersion = options.eveVersion;+ this.#workspaceRoot = options.workspaceRoot;+ this.#client =+ options.client ??+ new Client({+ auth: options.auth,+ headers: options.headers,+ host: options.serverUrl,+ preserveCompletedSessions: true,+ redirect: "manual",+ });+ }++ initialize(params: InitializeRequest): InitializeResponse {+ this.#formElicitationSupported = params.clientCapabilities?.elicitation?.form !== undefined;+ return {+ protocolVersion: PROTOCOL_VERSION,+ agentCapabilities: {+ loadSession: false,+ promptCapabilities: {},+ sessionCapabilities: { close: {} },+ },+ agentInfo: {+ name: "eve",+ title: "eve",+ version: this.#eveVersion,+ },+ authMethods: [],+ };+ }++ async newSession(params: NewSessionRequest): Promise<NewSessionResponse> {+ if (params.mcpServers.length > 0) {+ throw unsupported("Client-provided MCP servers are not supported by eve ACP mode.");+ }+ if ((params.additionalDirectories?.length ?? 0) > 0) {+ throw unsupported("Additional workspace directories are not supported by eve ACP mode.");+ }++ if (this.#workspaceRoot !== undefined) {+ const requestedRoot = await normalizedRealpath(params.cwd, "session/new.cwd");+ const workspaceRoot = await normalizedRealpath(+ this.#workspaceRoot,+ "the eve application root",+ );+ if (requestedRoot !== workspaceRoot) {+ throw RequestError.invalidParams(+ { cwd: params.cwd, workspaceRoot },+ "ACP cwd must be the eve application root",+ );+ }+ }++ const sessionId = randomUUID();+ this.#sessions.set(sessionId, {+ client: this.#client.session(),+ tools: new Map(),+ });+ return { sessionId };+ }++ async prompt(+ params: PromptRequest,+ client: AgentContext,+ signal: AbortSignal,+ ): Promise<PromptResponse> {+ const session = this.#getSession(params.sessionId);+ if (session.active !== undefined) {+ throw new RequestError(+ ERROR_CODE_BUSY,+ `ACP session ${params.sessionId} already has an active prompt.`,+ );+ }++ const message = promptContent(params);+ session.tools.clear();+ const settled = Promise.withResolvers<void>();+ const active: ActivePrompt = {+ cancelRequested: false,+ protocolCancelled: false,+ outboundController: new AbortController(),+ settled: settled.promise,+ resolveSettled: settled.resolve,+ };+ session.active = active;+ const onProtocolCancel = () => {+ active.protocolCancelled = true;+ void this.#cancelActive(session).catch(() => undefined);+ };+ if (signal.aborted) {+ onProtocolCancel();+ } else {+ signal.addEventListener("abort", onProtocolCancel, { once: true });+ }++ try {+ if (active.protocolCancelled) {+ throw RequestError.requestCancelled({ sessionId: params.sessionId });+ }+ let input: SendTurnInput = { message };+ for (;;) {+ const response = await session.client.send(input);+ if (active.cancelRequested || active.protocolCancelled) {+ await this.#cancelActive(session);+ }++ const inputRequests: InputRequest[] = [];+ let cancelled = false;+ let failure:+ | Extract<HandleMessageStreamEvent, { type: "turn.failed" | "session.failed" }>+ | undefined;+ let unsupportedEvent: RequestError | undefined;++ for await (const event of response) {+ const turnId = "data" in event && "turnId" in event.data ? event.data.turnId : undefined;+ if (typeof turnId === "string") active.turnId = turnId;++ if (event.type === "input.requested") inputRequests.push(...event.data.requests);+ if (event.type === "authorization.required") {+ unsupportedEvent = unsupported(+ "Connection authorization cannot be completed through eve ACP mode.",+ );+ }+ if (event.type === "turn.cancelled") cancelled = true;+ if (event.type === "turn.failed" || event.type === "session.failed") failure = event;+ await this.#projectEvent(params.sessionId, session, event, client);+ }++ if (active.protocolCancelled) {+ throw RequestError.requestCancelled({ sessionId: params.sessionId });+ }+ if (cancelled || active.cancelRequested) return { stopReason: "cancelled" };+ if (failure !== undefined) throw eveFailure(failure);+ if (unsupportedEvent !== undefined) throw unsupportedEvent;+ if (inputRequests.length === 0) return { stopReason: "end_turn" };++ let inputResponses: InputResponse[];+ try {+ inputResponses = await Promise.all(+ inputRequests.map((request) =>+ this.#requestInput(params.sessionId, session, request, client, signal),+ ),+ );+ } catch (error) {+ if (active.protocolCancelled) {+ throw RequestError.requestCancelled({ sessionId: params.sessionId });+ }+ if (active.cancelRequested) return { stopReason: "cancelled" };+ throw error;+ }+ if (active.protocolCancelled) {+ throw RequestError.requestCancelled({ sessionId: params.sessionId });+ }+ if (active.cancelRequested) return { stopReason: "cancelled" };+ input = { inputResponses };+ }+ } catch (error) {+ throw acpRequestError(error);+ } finally {+ signal.removeEventListener("abort", onProtocolCancel);+ session.tools.clear();+ active.resolveSettled();+ if (session.active === active) session.active = undefined;+ }+ }++ async cancel(sessionId: string): Promise<void> {+ const session = this.#sessions.get(sessionId);+ if (session === undefined || session.active === undefined) return;+ session.active.cancelRequested = true;+ await this.#cancelActive(session);+ }++ async closeSession(sessionId: string): Promise<void> {+ const session = this.#getSession(sessionId);+ this.#sessions.delete(sessionId);+ await this.#retireSession(session);+ }++ async close(): Promise<void> {+ const sessions = [...this.#sessions.values()];+ this.#sessions.clear();+ await Promise.allSettled(sessions.map((session) => this.#retireSession(session)));+ }++ async #retireSession(session: AcpSession): Promise<void> {+ let cancellationError: unknown;+ if (session.active !== undefined) {+ const active = session.active;+ active.cancelRequested = true;+ try {+ await this.#cancelActive(session);+ } catch (error) {+ cancellationError = error;+ }+ await active.settled;+ }++ try {+ await session.client.reset();+ } catch (resetError) {+ if (cancellationError !== undefined) {+ throw new AggregateError(+ [cancellationError, resetError],+ "Could not cancel or reset the eve session",+ );+ }+ throw resetError;+ }+ if (cancellationError !== undefined) throw cancellationError;+ }++ async #cancelActive(session: AcpSession): Promise<void> {+ session.active?.outboundController.abort();+ if (session.client.state.sessionId === undefined) return;+ await session.client.cancel(+ session.active?.turnId === undefined ? undefined : { turnId: session.active.turnId },+ );+ }++ #getSession(sessionId: string): AcpSession {+ const session = this.#sessions.get(sessionId);+ if (session === undefined) {+ throw RequestError.invalidParams({ sessionId }, "Unknown or closed ACP session");+ }+ return session;+ }++ async #projectEvent(+ sessionId: string,+ session: AcpSession,+ event: HandleMessageStreamEvent,+ client: AgentContext,+ ): Promise<void> {+ switch (event.type) {+ case "message.appended":+ await notifyUpdate(client, sessionId, {+ sessionUpdate: "agent_message_chunk",+ content: { type: "text", text: event.data.messageDelta },+ messageId: `${event.data.turnId}:message:${event.data.stepIndex}`,+ });+ return;+ case "reasoning.appended":+ await notifyUpdate(client, sessionId, {+ sessionUpdate: "agent_thought_chunk",+ content: { type: "text", text: event.data.reasoningDelta },+ messageId: `${event.data.turnId}:thought:${event.data.stepIndex}`,+ });+ return;+ case "actions.requested":+ for (const action of event.data.actions) {+ const toolCall = toolCallForAction(action);+ session.tools.set(action.callId, toolCall);+ await notifyUpdate(client, sessionId, { sessionUpdate: "tool_call", ...toolCall });+ }+ return;+ case "action.result": {+ const result = event.data.result;+ const status = event.data.status !== "completed" || result.isError ? "failed" : "completed";+ await notifyUpdate(client, sessionId, {+ sessionUpdate: "tool_call_update",+ toolCallId: result.callId,+ status,+ content: [+ { type: "content", content: { type: "text", text: stringifyOutput(result.output) } },+ ],+ rawOutput: result.output,+ });+ return;+ }+ default:+ return;+ }+ }++ async #requestInput(+ sessionId: string,+ session: AcpSession,+ request: InputRequest,+ client: AgentContext,+ signal: AbortSignal,+ ): Promise<InputResponse> {+ const cancellationSignal = AbortSignal.any([signal, session.active!.outboundController.signal]);+ if (request.display === "confirmation") {+ const approveId = `${request.requestId}:approve`;+ const denyId = `${request.requestId}:deny`;+ const toolCall =+ session.tools.get(request.action.callId) ?? toolCallForAction(request.action);+ const response = await client.request(+ methods.client.session.requestPermission,+ {+ sessionId,+ toolCall,+ options: [+ { kind: "allow_once", name: "Approve", optionId: approveId },+ { kind: "reject_once", name: "Deny", optionId: denyId },+ ],+ },+ { cancellationSignal },+ );+ if (response.outcome.outcome === "cancelled") {+ this.#cancelClientInput(session);+ return { requestId: request.requestId };+ }+ if (response.outcome.optionId === approveId) {+ return { requestId: request.requestId, optionId: "approve" };+ }+ if (response.outcome.optionId === denyId) {+ return { requestId: request.requestId, optionId: "deny" };+ }+ throw RequestError.invalidParams(+ { optionId: response.outcome.optionId },+ "Unknown ACP permission option",+ );+ }++ if (!this.#formElicitationSupported) {+ throw unsupported(+ "The ACP client does not support form elicitation required by this eve question.",+ );+ }++ const property = elicitationProperty(request);+ const response = await client.request(+ methods.client.elicitation.create,+ {+ mode: "form",+ sessionId,+ message: request.prompt,+ requestedSchema: {+ type: "object",+ properties: { [ANSWER_FIELD]: property },+ required: [ANSWER_FIELD],+ },+ },+ { cancellationSignal },+ );+ if (response.action !== "accept") {+ this.#cancelClientInput(session);+ return { requestId: request.requestId };+ }+ const content = response.content as Record<string, unknown> | null | undefined;+ const answer = content?.[ANSWER_FIELD];+ if (typeof answer !== "string") {+ throw RequestError.invalidParams(+ response.content,+ "ACP elicitation response must contain a string answer",+ );+ }+ if (request.display === "select") {+ if (!request.options?.some((option) => option.id === answer)) {+ throw RequestError.invalidParams({ answer }, "Unknown eve question option");+ }+ return { requestId: request.requestId, optionId: answer };+ }+ return { requestId: request.requestId, text: answer };+ }++ #cancelClientInput(session: AcpSession): void {+ const active = session.active!;+ active.cancelRequested = true;+ active.outboundController.abort();+ }+}++async function normalizedRealpath(path: string, label: string): Promise<string> {+ try {+ return await realpath(path);+ } catch (error) {+ throw RequestError.invalidParams(+ { path },+ `Could not resolve ${label}: ${errorMessage(error)}`,+ );+ }+}++function promptContent(params: PromptRequest): Array<{ type: "text"; text: string }> {+ const content = params.prompt.map((part) => {+ if (part.type !== "text") {+ throw unsupported(`ACP prompt content type ${JSON.stringify(part.type)} is not supported.`);+ }+ return { type: "text" as const, text: part.text };+ });+ if (content.every((part) => part.text.length === 0)) {+ throw RequestError.invalidParams(+ params.prompt,+ "ACP prompt must contain at least one non-empty text block",+ );+ }+ return content;+}++function toolCallForAction(action: RuntimeActionRequest): ToolCall {+ const title =+ action.kind === "tool-call"+ ? action.toolName+ : action.kind === "load-skill"+ ? "Load skill"+ : action.name;+ return {+ toolCallId: action.callId,+ title,+ kind: "other",+ status: "pending",+ rawInput: action.input,+ };+}++function elicitationProperty(request: InputRequest) {+ if (request.display === "select" && request.allowFreeform !== true && request.options?.length) {+ return {+ type: "string" as const,+ title: request.prompt,+ oneOf: request.options.map((option) => ({+ const: option.id,+ title: option.label,+ description: option.description,+ })),+ };+ }+ if (request.display === "text" && request.allowFreeform !== false) {+ return { type: "string" as const, title: request.prompt, minLength: 1 };+ }+ throw unsupported("This eve question shape cannot be represented by ACP form elicitation.");+}++async function notifyUpdate(+ client: AgentContext,+ sessionId: string,+ update: SessionUpdate,+): Promise<void> {+ await client.notify(methods.client.session.update, { sessionId, update });+}++function stringifyOutput(output: RuntimeActionResult["output"]): string {+ return typeof output === "string" ? output : JSON.stringify(output, null, 2);+}++function unsupported(message: string): RequestError {+ return new RequestError(ERROR_CODE_UNSUPPORTED, message);+}++function eveFailure(+ event: Extract<HandleMessageStreamEvent, { type: "turn.failed" | "session.failed" }>,+): RequestError {+ return new RequestError(ERROR_CODE_EVE, event.data.message, {+ code: event.data.code,+ details: event.data.details,+ });+}++function acpRequestError(error: unknown): RequestError {+ if (error instanceof RequestError) return error;+ if (error instanceof ClientError) {+ return new RequestError(ERROR_CODE_EVE, error.message, { httpStatus: error.status });+ }+ return new RequestError(ERROR_CODE_EVE, errorMessage(error));+}++function errorMessage(error: unknown): string {+ return error instanceof Error ? error.message : String(error);+}diff --git a/packages/eve/src/acp/line-limit.test.ts b/packages/eve/src/acp/line-limit.test.tsnew file mode 100644index 000000000..a5adfb14c--- /dev/null+++ b/packages/eve/src/acp/line-limit.test.ts@@ -0,0 +1,36 @@+import { describe, expect, it } from "vitest";++import { limitAcpLineBytes } from "#acp/line-limit.js";++async function readAll(stream: ReadableStream<Uint8Array>): Promise<string> {+ const chunks: Uint8Array[] = [];+ for await (const chunk of stream) chunks.push(chunk);+ return new TextDecoder().decode(Buffer.concat(chunks));+}++describe("limitAcpLineBytes", () => {+ it("counts a line across chunks and resets at each newline", async () => {+ const input = new ReadableStream<Uint8Array>({+ start(controller) {+ controller.enqueue(new TextEncoder().encode("123"));+ controller.enqueue(new TextEncoder().encode("45\n12345\n"));+ controller.close();+ },+ });++ await expect(readAll(input.pipeThrough(limitAcpLineBytes(5)))).resolves.toBe("12345\n12345\n");+ });++ it("rejects an oversized unterminated line", async () => {+ const input = new ReadableStream<Uint8Array>({+ start(controller) {+ controller.enqueue(new TextEncoder().encode("123456"));+ controller.close();+ },+ });++ await expect(readAll(input.pipeThrough(limitAcpLineBytes(5)))).rejects.toThrow(+ "5-byte line limit",+ );+ });+});diff --git a/packages/eve/src/acp/line-limit.ts b/packages/eve/src/acp/line-limit.tsnew file mode 100644index 000000000..a6c3f3673--- /dev/null+++ b/packages/eve/src/acp/line-limit.ts@@ -0,0 +1,24 @@+export const ACP_MAX_LINE_BYTES = 10 * 1024 * 1024;++/** Rejects an ACP stdio line before the SDK's line buffer can grow without bound. */+export function limitAcpLineBytes(+ maximumBytes: number = ACP_MAX_LINE_BYTES,+): TransformStream<Uint8Array, Uint8Array> {+ let currentLineBytes = 0;+ return new TransformStream({+ transform(chunk, controller) {+ for (const byte of chunk) {+ if (byte === 0x0a) {+ currentLineBytes = 0;+ continue;+ }+ currentLineBytes += 1;+ if (currentLineBytes > maximumBytes) {+ controller.error(new Error(`ACP message exceeds the ${maximumBytes}-byte line limit.`));+ return;+ }+ }+ controller.enqueue(chunk);+ },+ });+}diff --git a/packages/eve/src/acp/server.test.ts b/packages/eve/src/acp/server.test.tsnew file mode 100644index 000000000..6524f2a86--- /dev/null+++ b/packages/eve/src/acp/server.test.ts@@ -0,0 +1,72 @@+import { PassThrough } from "node:stream";++import { describe, expect, it, vi } from "vitest";++import { ACP_MAX_LINE_BYTES } from "#acp/line-limit.js";+import { runAcpServerOnStreams } from "#acp/server.js";+import type { SendTurnInput, SessionState } from "#client/types.js";+import type { HandleMessageStreamEvent } from "#protocol/message.js";++function streams() {+ const input = new PassThrough();+ const output = new PassThrough();+ return { input, output };+}++describe("runAcpServerOnStreams", () => {+ it("terminates the connection when an ACP line exceeds the transport limit", async () => {+ const transport = streams();+ const server = runAcpServerOnStreams(+ { eveVersion: "1.2.3", serverUrl: "http://127.0.0.1:2000" },+ transport,+ );++ transport.input.end("x".repeat(ACP_MAX_LINE_BYTES + 1));++ await expect(server).resolves.toBeUndefined();+ });++ it("closes the transport and resets sessions when shutdown is requested", async () => {+ const reset = vi.fn(async () => ({ status: "reset" }));+ const client = {+ session: () => ({+ cancel: vi.fn(async () => ({ status: "accepted" })),+ reset,+ send: vi.fn(async (_input: SendTurnInput) => emptyEvents()),+ state: { streamIndex: 0 } satisfies SessionState,+ }),+ };+ const controller = new AbortController();+ const transport = streams();+ let output = "";+ let receivedSession = false;+ transport.output.on("data", (chunk: Buffer) => {+ output += chunk;+ if (output.includes('"id":2')) receivedSession = true;+ });++ const server = runAcpServerOnStreams(+ {+ client,+ eveVersion: "1.2.3",+ serverUrl: "http://127.0.0.1:2000",+ signal: controller.signal,+ },+ transport,+ );+ transport.input.write(+ '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{}}}\n',+ );+ transport.input.write(+ '{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/","mcpServers":[]}}\n',+ );++ await vi.waitFor(() => expect(receivedSession).toBe(true));+ controller.abort();++ await expect(server).resolves.toBeUndefined();+ expect(reset).toHaveBeenCalledOnce();+ });+});++async function* emptyEvents(): AsyncIterable<HandleMessageStreamEvent> {}diff --git a/packages/eve/src/acp/server.ts b/packages/eve/src/acp/server.tsnew file mode 100644index 000000000..0bd524ff7--- /dev/null+++ b/packages/eve/src/acp/server.ts@@ -0,0 +1,64 @@+import { Readable, Writable } from "node:stream";++import { agent, methods, ndJsonStream } from "#compiled/@agentclientprotocol/sdk/index.js";+import { EveAcpAdapter, type EveAcpAdapterOptions } from "#acp/adapter.js";+import type { ClientOptions } from "#client/types.js";+import { limitAcpLineBytes } from "#acp/line-limit.js";++/** Configuration for one ACP stdio connection backed by an eve server. */+export interface RunAcpServerOptions {+ readonly auth?: ClientOptions["auth"];+ readonly eveVersion: string;+ readonly headers?: ClientOptions["headers"];+ readonly serverUrl: string;+ readonly signal?: AbortSignal;+ /** Local workspace root to enforce; omit when connecting to a remote deployment. */+ readonly workspaceRoot?: string;+ /** @internal Test seam for the public eve client boundary. */+ readonly client?: EveAcpAdapterOptions["client"];+}++/** Node streams for one ACP stdio connection. */+export interface AcpServerStreams {+ readonly input: Readable;+ readonly output: Writable;+}++/** Serves one stable ACP v1 connection over process stdio until the client disconnects. */+export async function runAcpServer(options: RunAcpServerOptions): Promise<void> {+ await runAcpServerOnStreams(options, { input: process.stdin, output: process.stdout });+}++/** Serves one stable ACP v1 connection over the supplied Node streams. */+export async function runAcpServerOnStreams(+ options: RunAcpServerOptions,+ streams: AcpServerStreams,+): Promise<void> {+ const adapter = new EveAcpAdapter(options);+ const app = agent({ name: "eve" })+ .onRequest(methods.agent.initialize, ({ params }) => adapter.initialize(params))+ .onRequest(methods.agent.session.new, ({ params }) => adapter.newSession(params))+ .onRequest(methods.agent.session.prompt, ({ params, client, signal }) =>+ adapter.prompt(params, client, signal),+ )+ .onRequest(methods.agent.session.close, ({ params }) => adapter.closeSession(params.sessionId))+ .onNotification(methods.agent.session.cancel, ({ params }) => adapter.cancel(params.sessionId));++ const output = Writable.toWeb(streams.output) as WritableStream<Uint8Array>;+ const input = (Readable.toWeb(streams.input) as ReadableStream<Uint8Array>).pipeThrough(+ limitAcpLineBytes(),+ );+ const connection = app.connect(ndJsonStream(output, input));+ const close = () => connection.close();+ if (options.signal?.aborted) {+ close();+ } else {+ options.signal?.addEventListener("abort", close, { once: true });+ }+ try {+ await connection.closed;+ } finally {+ options.signal?.removeEventListener("abort", close);+ await adapter.close();+ }+}diff --git a/packages/eve/src/cli/acp/command.ts b/packages/eve/src/cli/acp/command.tsnew file mode 100644index 000000000..6a27a8b65--- /dev/null+++ b/packages/eve/src/cli/acp/command.ts@@ -0,0 +1,149 @@+import { Command } from "#compiled/commander/index.js";+import { loadDevelopmentEnvironmentFiles } from "#cli/dev/environment.js";+import {+ parseDevelopmentHeaderOption,+ resolveDevelopmentUrlTarget,+ type DevelopmentRequestHeaders,+} from "#cli/dev/url-target.js";+import { parseDevelopmentServerUrl } from "#cli/dev/url.js";+import { FORCED_EXIT_BACKSTOP_MS, installShutdownSignal } from "#cli/shutdown.js";+import type { ClientOptions } from "#client/types.js";+import type { DevelopmentServer, DevelopmentServerOptions } from "#internal/nitro/host/types.js";++export type RunAcpServer = (input: {+ readonly auth?: ClientOptions["auth"];+ readonly eveVersion: string;+ readonly headers?: ClientOptions["headers"];+ readonly serverUrl: string;+ readonly signal?: AbortSignal;+ readonly workspaceRoot?: string;+}) => Promise<void>;++export type ResolveVerifiedRemoteDevelopmentClient =+ typeof import("#setup/verified-remote-client.js").resolveVerifiedRemoteDevelopmentClient;++export interface RegisterAcpCommandOptions {+ readonly appRoot: string;+ readonly eveVersion: string;+ readonly program: Command;+ readonly resolveVerifiedRemoteDevelopmentClient?: ResolveVerifiedRemoteDevelopmentClient;+ readonly runAcpServer?: RunAcpServer;+ readonly startHost?: (appRoot: string, options?: DevelopmentServerOptions) => DevelopmentServer;+}++/** Registers the ACP stdio bridge for local and deployed eve agents. */+export function registerAcpCommand(options: RegisterAcpCommandOptions): void {+ options.program+ .command("acp")+ .description("Serve an eve agent through stable ACP v1 over stdio.")+ .argument("[url]", "Connect to an existing server URL", parseDevelopmentServerUrl)+ .option("-u, --url <url>", "Connect to an existing server URL", parseDevelopmentServerUrl)+ .option("--scope <team>", "Vercel team that owns the URL target")+ .option(+ "-H, --header <header>",+ 'Request header for a URL target, in "Name: value" form (repeatable)',+ parseDevelopmentHeaderOption,+ )+ .addHelpText(+ "after",+ "\nWithout a URL, eve supervises a local development server. You can also pass a bare URL, for example: eve acp https://example.com\nACP does not grant the agent access to the client's workspace or terminal.\n",+ )+ .action(async (positionalUrl: string | undefined, commandOptions: AcpCliOptions) => {+ const target = resolveDevelopmentUrlTarget(commandOptions, positionalUrl);+ loadDevelopmentEnvironmentFiles(options.appRoot);+ const lifecycle = installShutdownSignal({ exitAfterMs: FORCED_EXIT_BACKSTOP_MS });++ if (target !== undefined) {+ try {+ await runAcp(options, {+ headers: target.headers,+ serverUrl: target.serverUrl,+ signal: lifecycle.signal,+ vercelScope: commandOptions.scope ?? process.env.EVE_VERCEL_SCOPE,+ });+ } finally {+ lifecycle.dispose();+ }+ return;+ }++ let server: DevelopmentServer | undefined;+ let closePromise: Promise<void> | undefined;+ const closeServer = () => {+ if (server === undefined) return Promise.resolve();+ closePromise ??= server.close();+ void closePromise.catch(() => undefined);+ return closePromise;+ };+ lifecycle.signal.addEventListener("abort", () => void closeServer(), { once: true });++ try {+ const startHost = options.startHost ?? (await loadStartHost());+ server = startHost(options.appRoot, {+ existing: "reject",+ host: "127.0.0.1",+ output: "stderr",+ port: 0,+ });+ const handle = await Promise.race([+ server.start(),+ lifecycle.stopped.then(() => undefined),+ ]);+ if (handle === undefined) return;++ await runAcp(options, {+ serverUrl: handle.url,+ signal: lifecycle.signal,+ workspaceRoot: handle.appRoot,+ });+ lifecycle.requestStop();+ } finally {+ await closeServer();+ lifecycle.dispose();+ }+ });+}++interface AcpCliOptions {+ readonly header?: DevelopmentRequestHeaders;+ readonly scope?: string;+ readonly url?: string;+}++async function runAcp(+ options: RegisterAcpCommandOptions,+ input: Omit<Parameters<RunAcpServer>[0], "eveVersion"> & { readonly vercelScope?: string },+): Promise<void> {+ const run = options.runAcpServer ?? (await import("#acp/server.js")).runAcpServer;+ const { vercelScope, ...serverInput } = input;+ const staticHeaders = typeof serverInput.headers === "function" ? undefined : serverInput.headers;+ const ownsAuthorization = Object.keys(staticHeaders ?? {}).some(+ (name) => name.toLowerCase() === "authorization",+ );+ if (serverInput.workspaceRoot !== undefined || ownsAuthorization) {+ await run({ eveVersion: options.eveVersion, ...serverInput });+ return;+ }++ const resolveVerifiedRemoteDevelopmentClient =+ options.resolveVerifiedRemoteDevelopmentClient ??+ (await import("#setup/verified-remote-client.js")).resolveVerifiedRemoteDevelopmentClient;+ const { options: clientOptions } = await resolveVerifiedRemoteDevelopmentClient({+ headers: staticHeaders,+ serverUrl: serverInput.serverUrl,+ signal: serverInput.signal,+ vercelScope,+ workspaceRoot: options.appRoot,+ });+ await run({+ auth: clientOptions.auth,+ eveVersion: options.eveVersion,+ headers: clientOptions.headers,+ serverUrl: serverInput.serverUrl,+ signal: serverInput.signal,+ });+}++async function loadStartHost(): Promise<NonNullable<RegisterAcpCommandOptions["startHost"]>> {+ return (await import("#cli/dev/local-server-process.js")).createDevelopmentServer;+}diff --git a/packages/eve/src/cli/dev/command-options.ts b/packages/eve/src/cli/dev/command-options.tsnew file mode 100644index 000000000..7ef7df914--- /dev/null+++ b/packages/eve/src/cli/dev/command-options.ts@@ -0,0 +1,28 @@+import type { DevelopmentRequestHeaders } from "#cli/dev/url-target.js";+import type {+ AssistantResponseStatsMode,+ LogDisplayMode,+ TerminalPartDisplayMode,+} from "#cli/dev/tui/types.js";++export interface DevelopmentCliOptions {+ assistantResponseStats?: AssistantResponseStatsMode;+ connectionAuth?: TerminalPartDisplayMode;+ contextSize?: number;+ header?: DevelopmentRequestHeaders;+ host?: string;+ input?: string;+ logs?: LogDisplayMode;+ name?: string;+ port?: number;+ reasoning?: TerminalPartDisplayMode;+ subagents?: TerminalPartDisplayMode;+ tools?: TerminalPartDisplayMode;+ ui?: boolean;+ url?: string;+}++export interface ProductionCliOptions {+ host?: string;+ port?: number;+}diff --git a/packages/eve/src/cli/dev/local-server-process.test.ts b/packages/eve/src/cli/dev/local-server-process.test.tsindex 4fdc77d37..5538667f9 100644--- a/packages/eve/src/cli/dev/local-server-process.test.ts+++ b/packages/eve/src/cli/dev/local-server-process.test.ts@@ -54,6 +54,31 @@ describe("createDevelopmentServer", () => {expect(child.unref).toHaveBeenCalledOnce();});+ it("can route child stdout to stderr for protocol-owning parents", async () => {+ const stdout = vi.spyOn(process.stdout, "write").mockImplementation(() => true);+ const stderr = vi.spyOn(process.stderr, "write").mockImplementation(() => true);+ try {+ const server = createDevelopmentServer("/tmp/app", { output: "stderr" });+ const started = server.start();+ child.stdout.write("server output");+ child.emit("message", {+ type: "started",+ handle: { kind: "started", appRoot: "/tmp/app", url: "http://127.0.0.1:2000" },+ });+ await started;++ expect(stderr).toHaveBeenCalledWith(expect.any(Buffer));+ expect(stdout).not.toHaveBeenCalled();++ const closing = server.close();+ child.emit("exit", 0, null);+ await closing;+ } finally {+ stdout.mockRestore();+ stderr.mockRestore();+ }+ });+it("escalates when graceful cleanup misses the deadline", async () => {vi.useFakeTimers();try {diff --git a/packages/eve/src/cli/dev/local-server-process.ts b/packages/eve/src/cli/dev/local-server-process.tsindex 47511e872..c885bbdad 100644--- a/packages/eve/src/cli/dev/local-server-process.ts+++ b/packages/eve/src/cli/dev/local-server-process.ts@@ -104,7 +104,9 @@ export function createDevelopmentServer(},);child = spawned;- spawned.stdout?.on("data", (chunk: Buffer) => process.stdout.write(chunk));+ spawned.stdout?.on("data", (chunk: Buffer) =>+ (options.output === "stderr" ? process.stderr : process.stdout).write(chunk),+ );spawned.stderr?.on("data", (chunk: Buffer) => process.stderr.write(chunk));return new Promise<DevelopmentServerHandle>((resolve, reject) => {diff --git a/packages/eve/src/cli/dev/tui/remote-auth.ts b/packages/eve/src/cli/dev/tui/remote-auth.tsindex 3186dbdd3..b671db3b5 100644--- a/packages/eve/src/cli/dev/tui/remote-auth.ts+++ b/packages/eve/src/cli/dev/tui/remote-auth.ts@@ -100,9 +100,12 @@ async function selectVercelDeploymentScope(}/**- * Authenticates a remote by resolving its deployment URL to the owning Vercel- * project, updating Trusted Sources when needed and keeping the resolved- * credential in this TUI session.+ * Authenticates an interactive client for a remote Vercel deployment.+ *+ * Resolves the deployment's owning project, optionally configures Trusted+ * Sources after user approval, and returns a renewable project-scoped OIDC+ * credential. Callers must pass a TTY-backed {@link Prompter}; cancelled and+ * failed flows are returned as results rather than thrown.*/export async function runRemoteAuthFlow(input: {readonly workspaceRoot: string;diff --git a/packages/eve/src/cli/run.test.ts b/packages/eve/src/cli/run.test.tsindex 9bc5162d8..7fdf2cfde 100644--- a/packages/eve/src/cli/run.test.ts+++ b/packages/eve/src/cli/run.test.ts@@ -488,6 +488,111 @@ describe("eve dev --logs", () => {});});+describe("eve acp", () => {+ it("documents the client workspace boundary", async () => {+ const output: string[] = [];++ await runCli(["acp", "--help"], {+ error: (message) => output.push(message),+ log: (message) => output.push(message),+ });++ expect(output.join("\n")).toContain(+ "ACP does not grant the agent access to the client's workspace or terminal.",+ );+ });++ it("starts an isolated local server and hands it to the ACP stdio adapter", async () => {+ const close = vi.fn(async () => {});+ const startHost = vi.fn(() => ({+ start: async () => ({+ kind: "started" as const,+ appRoot: "/canonical/app",+ url: "http://127.0.0.1:4321/",+ }),+ close,+ }));+ const runAcpServer = vi.fn(async () => {});+ const output: string[] = [];++ await runCli(+ ["acp"],+ { error: (message) => output.push(message), log: (message) => output.push(message) },+ { runAcpServer, startHost },+ );++ expect(startHost).toHaveBeenCalledWith(expect.any(String), {+ existing: "reject",+ host: "127.0.0.1",+ output: "stderr",+ port: 0,+ });+ expect(runAcpServer).toHaveBeenCalledWith({+ eveVersion: expect.any(String),+ serverUrl: "http://127.0.0.1:4321/",+ signal: expect.any(AbortSignal),+ workspaceRoot: "/canonical/app",+ });+ expect(close).toHaveBeenCalledOnce();+ expect(output).toEqual([]);+ });++ it("resolves verified Vercel credentials for a remote ACP agent", async () => {+ const runAcpServer = vi.fn(async () => {});+ const resolveVerifiedRemoteDevelopmentClient = vi.fn(async () => ({+ options: {+ auth: { vercelOidc: { token: "oidc-token" } } as const,+ headers: { "x-vercel-protection-bypass": "bypass" },+ host: "https://agent.example.com/",+ },+ lastOidcTokenFailure: () => undefined,+ }));++ await runCli(+ ["acp", "https://agent.example.com", "--scope", "vercel-internal-playground"],+ { error: () => {}, log: () => {} },+ { resolveVerifiedRemoteDevelopmentClient, runAcpServer },+ );++ expect(resolveVerifiedRemoteDevelopmentClient).toHaveBeenCalledWith({+ headers: undefined,+ serverUrl: "https://agent.example.com/",+ signal: expect.any(AbortSignal),+ vercelScope: "vercel-internal-playground",+ workspaceRoot: expect.any(String),+ });+ expect(runAcpServer).toHaveBeenCalledWith({+ auth: { vercelOidc: { token: "oidc-token" } },+ eveVersion: expect.any(String),+ headers: { "x-vercel-protection-bypass": "bypass" },+ serverUrl: "https://agent.example.com/",+ signal: expect.any(AbortSignal),+ });+ });++ it("connects ACP to a remote agent without starting a local server", async () => {+ const startHost = vi.fn();+ const runAcpServer = vi.fn(async () => {});++ await runCli(+ ["acp", "https://user:[email protected]", "-H", "X-Tenant: acme"],+ { error: () => {}, log: () => {} },+ { runAcpServer, startHost },+ );++ expect(startHost).not.toHaveBeenCalled();+ expect(runAcpServer).toHaveBeenCalledWith({+ eveVersion: expect.any(String),+ headers: {+ Authorization: `Basic ${btoa("user:pass")}`,+ "X-Tenant": "acme",+ },+ serverUrl: "https://example.com/",+ signal: expect.any(AbortSignal),+ });+ });+});+describe("eve dev boot progress", () => {it("passes one reporter through local startup and clears the row on failure", async () => {const writes: string[] = [];@@ -553,6 +658,7 @@ describe("eve dev local server ownership", () => {existing: "attach-if-unconfigured",host: undefined,onBootProgress: expect.any(Function),+ output: undefined,port: undefined,});expect(runDevelopmentTui).toHaveBeenCalledWith(diff --git a/packages/eve/src/cli/run.ts b/packages/eve/src/cli/run.tsindex feccb8736..61491a9f2 100644--- a/packages/eve/src/cli/run.ts+++ b/packages/eve/src/cli/run.ts@@ -9,6 +9,11 @@ import { registerIntegrationCommands } from "#cli/commands/register-integration-import { registerProjectCommands } from "#cli/commands/register-project-commands.js";import { registerRegistryCommands } from "#cli/commands/register-registry-commands.js";import { resolveDevUiMode, resolveTuiDisplayOptions } from "#cli/dev/ui-options.js";+import {+ registerAcpCommand,+ type ResolveVerifiedRemoteDevelopmentClient,+ type RunAcpServer,+} from "#cli/acp/command.js";import {FORCED_EXIT_BACKSTOP_MS,installShutdownSignal,@@ -16,11 +21,8 @@ import {waitForShutdownSignal,} from "#cli/shutdown.js";import { waitForServerOrStop, waitForUiOrServer } from "#cli/dev/wait-for-ui.js";-import {- parseDevelopmentHeaderOption,- resolveDevelopmentUrlTarget,- type DevelopmentRequestHeaders,-} from "#cli/dev/url-target.js";+import { parseDevelopmentHeaderOption, resolveDevelopmentUrlTarget } from "#cli/dev/url-target.js";+import type { DevelopmentCliOptions, ProductionCliOptions } from "#cli/dev/command-options.js";import type { RunDevelopmentTuiInput } from "#cli/dev/tui/tui.js";import type { EvalCliOptions } from "#evals/cli/eval.js";import {@@ -48,11 +50,6 @@ import type {DevelopmentServerOptions,ProductionServerHandle,} from "#internal/nitro/host/types.js";-import type {- AssistantResponseStatsMode,- LogDisplayMode,- TerminalPartDisplayMode,-} from "#cli/dev/tui/types.js";export { resolveDevUiMode, resolveTuiDisplayOptions };@@ -61,28 +58,6 @@ interface CliLogger {log(message: string): void;}-interface DevelopmentCliOptions {- assistantResponseStats?: AssistantResponseStatsMode;- connectionAuth?: TerminalPartDisplayMode;- contextSize?: number;- header?: DevelopmentRequestHeaders;- host?: string;- input?: string;- logs?: LogDisplayMode;- name?: string;- port?: number;- reasoning?: TerminalPartDisplayMode;- subagents?: TerminalPartDisplayMode;- tools?: TerminalPartDisplayMode;- ui?: boolean;- url?: string;-}--interface ProductionCliOptions {- host?: string;- port?: number;-}-interface CliRuntimeDependencies {isCodingAgentLaunch(): Promise<boolean>;isActiveDevelopmentServerForApp(input: {@@ -90,6 +65,8 @@ interface CliRuntimeDependencies {readonly serverUrl: string;}): Promise<boolean>;buildHost: BuildHost;+ resolveVerifiedRemoteDevelopmentClient: ResolveVerifiedRemoteDevelopmentClient;+ runAcpServer: RunAcpServer;printApplicationInfo(logger: CliLogger,appRoot: string,@@ -298,6 +275,15 @@ function createCliProgram(logger: CliLogger, runtime: CliRuntimeOverrides): CommregisterRuntimeInvokeCommand({ appRoot, logger, program, runtime });+ registerAcpCommand({+ appRoot,+ eveVersion: packageVersion,+ program,+ resolveVerifiedRemoteDevelopmentClient: runtime.resolveVerifiedRemoteDevelopmentClient,+ runAcpServer: runtime.runAcpServer,+ startHost: runtime.startHost,+ });+program.command("dev").description("Start the eve development server or connect to an existing URL.")diff --git a/packages/eve/src/internal/nitro/host/types.ts b/packages/eve/src/internal/nitro/host/types.tsindex bb7a1bc3c..2370844be 100644--- a/packages/eve/src/internal/nitro/host/types.ts+++ b/packages/eve/src/internal/nitro/host/types.ts@@ -63,6 +63,8 @@ export interface DevelopmentServerOptions {readonly existing?: "attach-if-unconfigured" | "reject";readonly host?: string;readonly onBootProgress?: DevBootProgressReporter;+ /** Parent stream that receives a supervised development child's stdout. */+ readonly output?: "stderr" | "stdout";readonly port?: number;}diff --git a/packages/eve/src/setup/index.ts b/packages/eve/src/setup/index.tsindex 755b03eb9..994acc889 100644--- a/packages/eve/src/setup/index.ts+++ b/packages/eve/src/setup/index.ts@@ -68,6 +68,7 @@ export {} from "./project-resolution.js";export { runVercelEnvPull } from "./run-vercel-link.js";export { provisionSlackbot, reconcileSlackUid, type ProvisionSlackbotResult } from "./slackbot.js";+export { runRemoteAuthFlow } from "../cli/dev/tui/remote-auth.js";export {setupConnectionConnector,type SetupConnectionConnectorOptions,diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 4f452d949..687ffae2f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -132,8 +132,8 @@ importers:specifier: 'catalog:'version: 7.0.2vercel:- specifier: 54.14.2- version: 54.14.2(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])+ specifier: 58.4.0+ version: 58.4.0(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected])vitest:specifier: 'catalog:'version: 4.1.10(@edge-runtime/[email protected])(@opentelemetry/[email protected])(@types/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))@@ -299,7 +299,7 @@ importers:version: 0.2.4([email protected]([email protected]))([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected])'@vercel/connect':specifier: 'catalog:'- version: 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)+ version: 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)'@vercel/otel':specifier: 'catalog:'version: 2.1.3(@opentelemetry/[email protected])(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected])([email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))@@ -387,7 +387,7 @@ importers:version: 0.41.2'@vercel/connect':specifier: 'catalog:'- version: 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)+ version: 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)'@vercel/oidc':specifier: 3.8.0version: 3.8.0@@ -1213,6 +1213,9 @@ importers:specifier: 8.9.0version: 8.9.0devDependencies:+ '@agentclientprotocol/sdk':+ specifier: 1.3.0+ version: 1.3.0([email protected])'@ai-sdk/anthropic':specifier: 'catalog:'version: 4.0.18([email protected])@@ -1422,6 +1425,11 @@ packages:'@vercel/sandbox':optional: true+ '@agentclientprotocol/[email protected]':+ resolution: {integrity: sha512-i3h/efaeuMUFAO1HSfo97QZQnnvMd7wWBYtBsdL6UMZg3a78sk3Ffya5Xu7C7tYsXomXoDXJBAzQF2PcFKAhIQ==}+ peerDependencies:+ zod: ^3.25.0 || ^4.0.0+'@agentphone/[email protected]':resolution: {integrity: sha512-cal0EcWdbROsBT2cFd4TPxDM6SggdxifOkGCI/YFrmWapXSUgdA3wXTsZ3C8Z9Pcs1Zlg8ShNf2JSOqkvfHIWw==}engines: {node: '>=18'}@@ -7060,22 +7068,22 @@ packages:vue-router:optional: true- '@vercel/[email protected]':- resolution: {integrity: sha512-jgepdZh7E4ameCUSt/b28ImFd9Bz1VX71lKwD/ThtZ7nGIwi5SJ9hwyURvH60c4rNW6nKxMD/iSOlcgQOfrK3A==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-JlVAVV0IUCxgjaVRbxxVtkqJ9Q6RDncPJhJ20u+OZMTehq3Ezpqw0X+8ehymbBQhaIowIoELa0RBdu23DOisjw==}'@vercel/[email protected]':resolution: {integrity: sha512-ncQ8CRb6XoEAYJwjOTRGpACRT6h/AeY+/33gLyeVxG5BIes27OPm1jmqreF+JHjcTmGhClTP+kBpmyLfbV0xew==}engines: {node: '>=20.0.0'}- '@vercel/[email protected]':- resolution: {integrity: sha512-fLIa8cpELsSoWbcxshaqegwlTCfKnbgsDmA6uIb+oA797xvSmYkPu5a781aRYCRdghgyOZF7NCSVgtZjHjunnQ==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-TC+LhfYxW0N17cqJoYHtow6ybMRF1v6NnlRWjeeyuWAdGwdzXcKYNuD1MqheshyNOrz2Hu9LpifxmpXvLqRHiA==}- '@vercel/[email protected]':- resolution: {integrity: sha512-YbL2AosH3FaBLJZu4GYdVMkFv+5cbWwwSrRBTGN52odynQUudTUQfbc7rCzPyNQLdk2QC4w2IDYRD+nqgojhVg==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-7RmHKPiA6xTiTlSkmxM0rMhGouJIdJve7wn2WVnFAJP2KWGaAY13IK/Md1EPUYyy70TXxeuhdQC+oY063kL3eQ==}hasBin: true- '@vercel/[email protected]':- resolution: {integrity: sha512-9nsdxUpV/L+9CBVGeRw/Qby2azhi2lk01jp0aTH+Hxx2U61+mAmbi5qChHnrbEmQdx2Ih7dp4LxO3nj1Q7f/5Q==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-TaMXMiPrwcLoLxu6ExcJ8yEw8b8Qss6UZkNYF4xIq+/VdvAk0l8JCpeAwzuHgKuJqmIDrOvtfjHO2+T/MBR3dg==}'@vercel/[email protected]':resolution: {integrity: sha512-fJRRRB7734BDuXZ89yBEaA2ncYhH7bWX30mk04W80J6VAfQc+4iB8lyzAdaGpFV3/vNlkt9VZt+/uoQoWX6UsQ==}@@ -7110,21 +7118,24 @@ packages:eve:optional: true+ '@vercel/[email protected]':+ resolution: {integrity: sha512-m1Y3qT1JOUFKLXUI54hVHSkRTGrvI8LC7EPNsEE1MBME8gk8aoIB+lJWl59jd56MjTDcTc3NCzPdHIZ65grZkA==}+'@vercel/[email protected]':resolution: {integrity: sha512-VYNCgUc0nOmC4WJmWw9GkrKdfr8Zl4/rxhC5SvgacBgxiW9W/9NRttUoHHXV8xdII3MaRgkZZVX8Ikzc/Jmjag==}engines: {node: '>=14'}- '@vercel/[email protected]':- resolution: {integrity: sha512-36yzZJVU9o7/CcH1TbqeGTRwBePDaCEzv1CYfS183HdLXzsD+pOjOkTqZOBJu7h9aHpJFCCau55Ed0xOQC2jhA==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-ho0ci5sAp0GsV+B+ACQxzOkL+NpOdAo/yCFE7AuL1En9aWYBUgRUGWFQTNarmK1fReOPRjwWn85FTIu2c2GOAQ==}'@vercel/[email protected]':resolution: {integrity: sha512-WFWiRxfPzoYWYifaj4thSKvAaZZwUOqD4k5GINRIgZgCiS2E3iAJbWbIsIZmkQdTecWFHcWGA6q48CjisgpOBA==}- '@vercel/[email protected]':- resolution: {integrity: sha512-F+QRQxWWKdeztW4MKPkzXl/Ajc8j1qOffCp1tt8+YPaNiqZtxpn7FjIYRXHbfR1aepfaEkDRDD7o2qxmmaUU5w==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-roE4e063Ycl0wi8eZMpeRsLGGPAkjGaykABR+ZH+Z+0MPorH6+WB626yvZOVsRHbVVRPYa6IKDDRsehK1DN4NQ==}- '@vercel/[email protected]':- resolution: {integrity: sha512-4Uq6GVmi0ksQxIHp4FDUhgoz47uacxZm42XT04SK5gzX5v5UmZXWZPprZjkwwk/2gmP/rF2qKqJ0nu6OsI+yDw==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-MtJLWsOdpAIKpvVtZHh7r7R/3b+rnuo02KIkwWWsxxmO/C+ucEc5Mf1n9ecf96XfMIG9mAZnvEHjN7fAbeMRsw==}'@vercel/[email protected]':resolution: {integrity: sha512-8erw9uPe0dFg45THkNxmjtvMX143SkZebmjgSVbcM3XCkXu3RIiBaJMcMNG8aaS+rnTuw8+d4De9HVT0M/r3wg==}@@ -7154,8 +7165,8 @@ packages:'@vercel/[email protected]':resolution: {integrity: sha512-iTEA0vY6RBPuEzkwUTVzSHDATo1aF6bdLLspI68mQ/BTbi5UQEGjpjyzdKOVcSYApDtFU6M6vypZ1t4vIEnHvw==}- '@vercel/[email protected]':- resolution: {integrity: sha512-dA1ZWZHruRjFbLToqjcPHUyh5J7/Cl3qGFDge87ghAInuy/aXfalApzFbw61OIopGx0SSsIYi/8kbpJ+SbQ6ZQ==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-Ku2s4zykwPl3vlU835yv/VA6aoG59LlTrPrt40SrEshlPg7p5Ot62T3M+6PbWkgCRvul7zDLIgamjZemN9ypFQ==}'@vercel/[email protected]':resolution: {integrity: sha512-8DMevN/ApEnes0Mz5QbOaufmbO6VM8zyAdSVS37jSdZQyVJNK+67CXyp4ziibbx/xzGbn2rbNn1f0+QTIP6ejA==}@@ -7166,26 +7177,26 @@ packages:react-dom: ^19.2.3tailwindcss: ^4.1.17- '@vercel/[email protected]':- resolution: {integrity: sha512-vGbEwckvtr9UXKDz3qEHUE7VHJGG/9VQLuScgHytksfZyX8dzvNPgEuBKBbhPaMwua8pUCZKQqNxFM3Dul+bLA==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-ZJqx1GzD1qqMkI92jEHp04zCwbZ7tNwcgI58e7t8HiYvILwCZ4Rvq0hfjTjsk+0Zn8A369qs4eAHvCYu38uB5A==}- '@vercel/[email protected]':- resolution: {integrity: sha512-UnHFLBemE2UfvQ+w2z2zxGcvyiShQ8eMdk3ag2sV71wbyatnXwmio8HOy//B2ZIEQNEid5gW2HjWOXLtrR+E2Q==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-YFEdyL3w7Mm356IobHk6chqnAUo2lDuLj1zv7PhoofCbRetHPw+nrIFQqaIVrLPVIq4qmX7jxe4bmieHKPonWQ==}- '@vercel/[email protected]':- resolution: {integrity: sha512-h4G0GSo5omhXS1iqimIcekcW7THEAnUGd6eioDNnSqwS3L0CGEvvTPUekJDyJcybsqnKslH1XTZA40f4b9MPHg==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-Ves8S9ix8g7NGJEStTrcBAdDBF1xzQ8KkVPzvyQ7l9nPlpYhYR7WCnTdJwi9ZpaHniCGVDZ+Q/kNk4PChOVt6Q==}'@vercel/[email protected]':resolution: {integrity: sha512-gf3ELmAjcia7WNGNHAB/rFWFU0l5fJ7mTMgGC5hvcCjSIE4kp8WWuGYiTQgQ8W6GF/1FJAxa2J3BhY/yxjY8tA==}- '@vercel/[email protected]':- resolution: {integrity: sha512-6MuBn5RM2nHKfHKeBqbs3aaFJlBFDhOZgpC1ubLQG2B/EvnAfljB7FPIKCl1SwANAHisX7vQACinMedCbFdi+Q==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-nMsKdtBliVDxEEXNl2lwZBNT7DABqTn1LBSAGx6QLrk469x9hdphFijaOO3UdVXWWZQbbojw4IOcrhVtIkNNmg==}- '@vercel/[email protected]':- resolution: {integrity: sha512-KM9uBmC+a10EPJgtm0B/vfGsTaUEzxKkihTyaQ4PhSUQHJOABTv6TBpGKtwIM5P1vMLKUg9R0A2SUvkKdaALvA==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-gUXKyrwsmBJzpE5M9aNwiN8KzxgU2Y6P8VaKh2/r9vJO8558Yi2mhottr/w/1G1DoojaUKLZcQcdbipvuXIcRQ==}- '@vercel/[email protected]':- resolution: {integrity: sha512-9B7juRNydQ9MU7xT8OE254ymhVrNdcOKlXrZ4anem8YEa34KvXjLczQhZEPdvTz9JaCXpYiEEGmd/D3t2oJ+Uw==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-8m39IHTAgO5yE9xAW8lnjv01z8qQ/qm1FWqyg46qBH2GPtn0MHEME2tAbRy+XzV0Q2J/KGSwmH4xFq8FgECAfg==}'@vercel/[email protected]':resolution: {integrity: sha512-iLOW4fcsgkipfOh2Bw3wB38YDfxTlxr7+j4uFeui2OswkNT28jIitS/aMce7tS0mef1YPQ8zLIDYr3a0aahNrA==}@@ -7197,8 +7208,8 @@ packages:engines: {node: '>=20'}hasBin: true- '@vercel/[email protected]':- resolution: {integrity: sha512-n2DVzblqS43LTs4BV1iLfx8tjjrTegcSsyDgRzn70h6tQePYWjl+h0bU3X1stpITZtaYJSZYwVevuX1BJNZHHg==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-QM9btX0pYWl+abtHOhJMiBUNy0xnmCszrDbcM0nHln9FKD/4DzOxQgGEUWN78YWzfO+7qVoY3bCZg+4fElbdVw==}'@vercel/[email protected]':resolution: {integrity: sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w==}@@ -7231,11 +7242,11 @@ packages:'@vercel/[email protected]':resolution: {integrity: sha512-/0nuDFwYje0nqZnVKSd2VfJy2wOPQwbkas1qO1JQgtb0sLl+EeSCW4O9hrvq55pN50PNlAZ/APSeWHIAT9ZGHg==}- '@vercel/[email protected]':- resolution: {integrity: sha512-EPPLuXJQhIDUx08H9nG76AR2HSgBquwe3OAX5s2w20M923iaWeGGVkhX/4yZ89CJfXEZgE1Aj/mX7lVHOVIcYA==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-T9YgtINVJfZmDhXe6ULKoLC1Zr3LU3Cl4CgC+m+S1KsNDPlfGfXdr93K7aOqkMaJEDLpUH8dqrPP3/TuZXTjRw==}- '@vercel/[email protected]':- resolution: {integrity: sha512-2ay12lt3Cu6xS6qiaKNNwALRKxI1AE3rtHDfFOP+BU4qJ2U5k7JmPxlDuU+CXKY+chQClQM2orgThJWeMoeQkw==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-shBuOJNbNJ6RLclIln35xtoVZO0O2jq5hurbyaJouoAM4HkzOof7KbQ2POqaDcj9YFQpJ+nHnCxTZ2q6BMJGTw==}'@vercel/[email protected]':resolution: {integrity: sha512-2HctPb2+6Pj1DMxbPohMq574rE9OP3fUAGhwV0R4Qv1FHQIR+qti92G8FGjFMJGUSFxVlWdNwVfgHU2hZlM6Dw==}@@ -7252,14 +7263,14 @@ packages:'@vercel/[email protected]':resolution: {integrity: sha512-s0SpfV640nmQ1BsKCPMYugGrH/V+319onTo2ZILSmsy6NTBlmeN0zJU9nPcP8dBEotGqtp68NfOlOUUdrVBzkw==}- '@vercel/[email protected]':- resolution: {integrity: sha512-YI7Amyf09hHZWOqDHgJO92XcKh6Pye8rrmJFhlP6euG3o6QjoZzJj7Z2WzjSrDRGMewzEK4uz2+CbNpNS7gLog==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-e23M7pfORQyyxSUmeQ8PqEnyLJ4swhtNrnyctU5E02UCaUYFm5YAdNfdPYRP4It874H4Wyvm+LV8u7CPBrfcPA==}- '@vercel/[email protected]':- resolution: {integrity: sha512-z1X0z1NM+ISunm/scgRpuENNwcKlh7DjXn0QvKE0n10DcaYqxkBQVK8iRA9X05xSK9AzPlnB9DHdGKiXZO5buw==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-/zRJtaf3pvdxZ7+tShmIo8StdbkCSBDcY7Gy7LOwNTIxm6GU9vkS+BlCwJHkOu6qNkbcSRH6ZQIeo4vNmqzKdQ==}- '@vercel/[email protected]':- resolution: {integrity: sha512-gKhW+YlvU15Qxya7jQKByB+sqA1dWat5zx/rvxT52E3Ryg9MAIXgqD5wd1d+CoJDbdHL26gIOcksTZY5sFpplA==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-pifnr8hex/rgQ3EPyLYHYwHyf0Kwmc4Vbya9kHGk4aERFVGj44P+742S8/SDdt2guMxBriXBOMkMLq1Kaiyyeg==}'@vercel/[email protected]':resolution: {integrity: sha512-1gmIXWgueeBBwBitVl1xqOsYmVv7xr7qX1qXeqwLGZTKGG1SkkpYkDzpWZ8LIDN0PmPGCqE6lvYao3zP8iz5uw==}@@ -7293,12 +7304,37 @@ packages:vue-router:optional: true- '@vercel/[email protected]':- resolution: {integrity: sha512-+IipWidX6mL1Zck8Khw4wSXHPSgDfkapvcuWA9wSCmhnk2GL2Iuu+6vab+g8UPahv+QDUYm8Tphhadg6dICZnA==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-BwIEj/0PBys4R9eGcPcnkIararnQYwcm07iU58xk+YceOQAROJZK9ZnD4LO/LpGakt07SA4mjaQVSGYtueqzww==}'@vercel/[email protected]':resolution: {integrity: sha512-wCq90CMUB//ggnFh77NQO1xaLFsS4LigQIqKrH6ohnr9Br/KI1FhlErx62WfCOuueWaW+LVsbLOqNXIUjK8t6A==}+ '@vercel/[email protected]':+ resolution: {integrity: sha512-2JyiuiCji3h4zBAt8p1UZ316G3SRPU9/LOcHQzeEkwLqN/tXen9kDnVSYVsZ0xyx4t8FS/P+dtr+afjKr5pyXQ==}+ cpu: [arm64]+ os: [darwin]++ '@vercel/[email protected]':+ resolution: {integrity: sha512-SzxdkV2uLOqCLXSppdASzwIV7rd1D4Spw8K6y8wio2d+w7n8KWFreWhYira2hSfJrA38ltRpw9Ztt2MlWl2GcA==}+ cpu: [x64]+ os: [darwin]++ '@vercel/[email protected]':+ resolution: {integrity: sha512-aI+8zMFYGE8TyjJE44SqNcLOVpZAcuek2hu+VthZ8G/RMZskFDd0aMRAh+jWaHhBQ1yYb7QTWl3EMI7no36MPQ==}+ cpu: [arm64]+ os: [linux]++ '@vercel/[email protected]':+ resolution: {integrity: sha512-UCZIF5rA9hjHCQ8oZ4oSPhoLrH412oq3b/owB1GhN6qjbJDFp/eQhg0Ocn+UUULk/Zs5MmOUCvE7o1rYelA9uw==}+ cpu: [x64]+ os: [linux]++ '@vercel/[email protected]':+ resolution: {integrity: sha512-ykAWnf1mCcRIbcbPDQGUAug81M2ODQoPBTv3wGf5qP+BqFqkSHWCWTUSZ7lHsBDeX3fpo2kwNh0NKVNAIP+LEA==}+ cpu: [x64]+ os: [win32]+'@vgpu/[email protected]':resolution: {integrity: sha512-IgSq52apOkMN1LvqF96b7Umzw/qTysuIDKF4I7SgUZUZSKbtH+j3eqdk33zEec5iuP5mHZ42/zKg4575zNm1Bg==}@@ -13182,8 +13218,8 @@ packages:resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}- resolution: {integrity: sha512-g93rma0Z9Aa6EoTktzYnGZmQvMzm7j73BekJIMwmkdWR5uryZ+6hBCADtd3JKGAB27k+ubnG7HHsZqtscAMzIQ==}+ resolution: {integrity: sha512-JPdADikobt6zFuuCRhl6whNrCJlLPxpUmT/hNxLij70mkpeejHKDN+HeVlrdHI8snDTzRIiF3Ye8KyMIyVWA+A==}hasBin: true@@ -13483,13 +13519,13 @@ packages:resolution: {integrity: sha512-gcj8zBWU5cFsi9WUP+4bFNXAyF1iRpA3LLyS/DP5xlrNzGmPIizUeBggKa8DbDwdqaKwUcTEnChtd2grWo/x/A==}- resolution: {integrity: sha512-LqZxxBDMKuMAZzFzJnDCkFOrs9MZQZr0LvHiO/SuSZVdQaXD7xQ5UWTUxheJrQPve1qk9MG2B/yttUvJxw8egQ==}+ resolution: {integrity: sha512-bp07zRuycfTY43IjAvvTFnmnJi8ikW0VFiHwOhhYcVW/L4xQ1XY4PAd4Nuum1rsA17C39zL7x+CDhrn5AL32Rw==}engines: {node: '>=20.16.0'}hasBin: true- resolution: {integrity: sha512-wYc3VLZHRzwYrWJhkEqkhLb31TI0SOkfYZDkUhXdp3NoCnNS0FqajiQszZZjfow/VYEuc6Q5sZh9nM6kPy2NBQ==}+ resolution: {integrity: sha512-LqZxxBDMKuMAZzFzJnDCkFOrs9MZQZr0LvHiO/SuSZVdQaXD7xQ5UWTUxheJrQPve1qk9MG2B/yttUvJxw8egQ==}engines: {node: '>=20.16.0'}hasBin: true@@ -14085,6 +14121,10 @@ packages:resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==}engines: {node: '>=14.0'}+ resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==}+ engines: {node: '>=14.0'}+resolution: {integrity: sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==}engines: {node: '>=18.17'}@@ -14453,8 +14493,8 @@ packages:resolution: {integrity: sha512-oLYtZ+GJPjpKS950fw70+HavdP7ZO2Q+xMCMeCyiUKuXkJJJG1/wUjCKTagPryS1gApYjZOWW/khmdLsch8jxg==}- resolution: {integrity: sha512-XMUBq4mEYniGGIHTAIY7Egop120x6d2NLZ9wezk3032VfKRMsB3q2UYFiZduWETG/TwFSddlNJ6UI8jBskleog==}+ resolution: {integrity: sha512-bc/34wx40JAakmR5Dwqe9LUgiRGPB+a04gA3c8/q4F1peg8IAslHnqN9TfcDeXOa20PSJX372vvRmdIsfvd+zA==}engines: {node: '>= 18'}hasBin: true@@ -14973,9 +15013,6 @@ packages:resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}- resolution: {integrity: sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==}-resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}@@ -15005,6 +15042,10 @@ snapshots:optionalDependencies:'@vercel/sandbox': 2.8.0+ '@agentclientprotocol/[email protected]([email protected])':+ dependencies:+ zod: 4.4.3+'@agentphone/[email protected]([email protected]([email protected]))([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected])':dependencies:'@chat-adapter/shared': 4.34.0([email protected]([email protected]))([email protected])([email protected])@@ -16440,7 +16481,7 @@ snapshots:eve: link:packages/evezod: 4.4.3optionalDependencies:- '@vercel/connect': 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)+ '@vercel/connect': 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)transitivePeerDependencies:- '@ai-sdk/workflow'- '@workflow/ai'@@ -16453,7 +16494,7 @@ snapshots:octokit: 5.0.5zod: 4.4.3optionalDependencies:- '@vercel/connect': 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)+ '@vercel/connect': 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)eve: link:packages/eve'@google/[email protected](@modelcontextprotocol/[email protected]([email protected])([email protected]))([email protected])([email protected])':@@ -17746,7 +17787,7 @@ snapshots:'@onkernel/[email protected](@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)':dependencies:- '@vercel/connect': 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)+ '@vercel/connect': 0.4.3(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)eve: link:packages/evezod: 4.4.3transitivePeerDependencies:@@ -20740,10 +20781,11 @@ snapshots:svelte: 5.56.1(@typescript-eslint/[email protected])vue: 3.5.35([email protected])- '@vercel/[email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])':+ '@vercel/[email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])':dependencies:- '@vercel/build-utils': 13.30.0+ '@vercel/build-utils': 13.36.2'@vercel/nft': 1.10.0([email protected])([email protected])+ '@vercel/static-config': 3.4.0execa: 3.2.0fs-extra: 11.1.0get-port: 5.1.1@@ -20751,7 +20793,8 @@ snapshots:path-to-regexp: 8.3.0resolve.exports: 2.0.3rolldown: 1.0.0-rc.1(@emnapi/[email protected])(@emnapi/[email protected])- srvx: 0.8.9+ srvx: 0.11.16+ ts-morph: 12.0.0tsx: 4.21.0zod: 3.22.4transitivePeerDependencies:@@ -20769,15 +20812,15 @@ snapshots:throttleit: 2.1.0undici: 6.27.0- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:- '@vercel/python-analysis': 0.11.1+ '@vercel/python-analysis': 0.12.0cjs-module-lexer: 1.2.3es-module-lexer: 1.5.0- '@vercel/[email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])':+ '@vercel/[email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])':dependencies:- '@vercel/backends': 0.8.14(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])+ '@vercel/backends': 0.8.29(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])transitivePeerDependencies:- '@emnapi/core'- '@emnapi/runtime'@@ -20785,10 +20828,10 @@ snapshots:- rollup- supports-color- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:'@napi-rs/keyring': 1.2.0- '@vercel/cli-config': 0.2.0+ '@vercel/cli-config': 0.2.1async-listen: 3.0.0open: 8.4.0zod: 4.1.11@@ -20807,7 +20850,7 @@ snapshots:dependencies:execa: 5.1.1- '@vercel/[email protected](@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)':+ '@vercel/[email protected](@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)':dependencies:'@vercel/oidc': 3.8.1optionalDependencies:@@ -20817,11 +20860,13 @@ snapshots:ai: 7.0.38([email protected])eve: link:packages/eve+ '@vercel/[email protected]': {}+'@vercel/[email protected]': {}dependencies:- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0transitivePeerDependencies:- encoding@@ -20830,11 +20875,11 @@ snapshots:'@vercel/[email protected]': {}- '@vercel/[email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])':+ '@vercel/[email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])':dependencies:- '@vercel/cervel': 0.1.22(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])+ '@vercel/cervel': 0.1.37(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])'@vercel/nft': 1.10.0([email protected])([email protected])- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0fs-extra: 11.1.0path-to-regexp: 8.3.0@@ -20847,9 +20892,9 @@ snapshots:- rollup- supports-colordependencies:- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0transitivePeerDependencies:- encoding@@ -20895,10 +20940,10 @@ snapshots:dependencies:web-vitals: 0.2.4- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:'@sinclair/typebox': 0.25.24- '@vercel/build-utils': 13.30.0+ '@vercel/build-utils': 13.36.2esbuild: 0.27.0etag: 1.8.1fs-extra: 11.1.0@@ -20962,21 +21007,21 @@ snapshots:- vite- waku- '@vercel/[email protected]': {}+ '@vercel/[email protected]': {}dependencies:- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0transitivePeerDependencies:- encoding- rollup- supports-colordependencies:'@vercel/nft': 1.10.0([email protected])([email protected])- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0fs-extra: 11.1.0path-to-regexp: 8.3.0@@ -20992,25 +21037,25 @@ snapshots:'@vercel/static-config': 3.4.0ts-morph: 12.0.0dependencies:- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0transitivePeerDependencies:- encoding- rollup- supports-colordependencies:- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/static-config': 3.4.0transitivePeerDependencies:- encoding- rollup- supports-colordependencies:'@vercel/nft': 1.10.0([email protected])([email protected])transitivePeerDependencies:@@ -21056,13 +21101,13 @@ snapshots:- rollup- supports-colordependencies:'@edge-runtime/node-utils': 2.3.0'@edge-runtime/primitives': 4.1.0'@edge-runtime/vm': 3.2.0'@types/node': 20.11.0- '@vercel/build-utils': 13.30.0+ '@vercel/build-utils': 13.36.2'@vercel/error-utils': 2.2.0'@vercel/nft': 1.10.0([email protected])([email protected])'@vercel/static-config': 3.4.0@@ -21123,7 +21168,7 @@ snapshots:'@vercel/[email protected]': {}- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:'@bytecodealliance/preview2-shim': 0.17.6'@renovatebot/pep440': 4.2.1@@ -21133,9 +21178,9 @@ snapshots:smol-toml: 1.5.2zod: 3.22.4- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:- '@vercel/python-analysis': 0.11.1+ '@vercel/python-analysis': 0.12.0'@vercel/[email protected](@opentelemetry/[email protected])':dependencies:@@ -21170,14 +21215,15 @@ snapshots:- rollup- supports-color- '@vercel/[email protected]': {}+ '@vercel/[email protected]': {}- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:execa: 5.1.1+ get-port: 5.1.1smol-toml: 1.5.2- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:'@vercel/oidc': 3.2.0'@workflow/serde': 4.1.0-beta.2@@ -21189,7 +21235,7 @@ snapshots:tar-stream: 3.1.7undici: 7.28.0xdg-app-paths: 5.1.0- zod: 3.24.4+ zod: 4.4.3transitivePeerDependencies:- bare-abort-controller- react-native-b4a@@ -21224,10 +21270,10 @@ snapshots:svelte: 5.56.1(@typescript-eslint/[email protected])vue: 3.5.35([email protected])- '@vercel/[email protected]':+ '@vercel/[email protected]':dependencies:'@vercel/gatsby-plugin-vercel-analytics': 1.0.11- '@vercel/gatsby-plugin-vercel-builder': 2.2.19+ '@vercel/gatsby-plugin-vercel-builder': 2.2.32'@vercel/static-config': 3.4.0ts-morph: 12.0.0@@ -21237,6 +21283,21 @@ snapshots:json-schema-to-ts: 1.6.4ts-morph: 12.0.0+ '@vercel/[email protected]':+ optional: true++ '@vercel/[email protected]':+ optional: true++ '@vercel/[email protected]':+ optional: true++ '@vercel/[email protected]':+ optional: true++ '@vercel/[email protected]':+ optional: true+'@vgpu/[email protected]([email protected])':dependencies:'@vgpu/core': 0.0.7@@ -29174,16 +29235,19 @@ snapshots:dependencies:- '@vercel/sandbox': 2.1.1+ '@vercel/sandbox': 2.4.0async-retry: 1.3.3debug: 4.4.3([email protected])+ ws: 8.21.1([email protected])zod: 4.4.3transitivePeerDependencies:- bare-abort-controller+ - bufferutil- react-native-b4a- supports-color+ - utf-8-validate@@ -29628,11 +29692,9 @@ snapshots:- [email protected]: {}+ [email protected]: {}- dependencies:- cookie-es: 2.0.1+ [email protected]: {}@@ -30308,6 +30370,10 @@ snapshots:dependencies:'@fastify/busboy': 2.1.1+ dependencies:+ '@fastify/busboy': 2.1.1+@@ -30633,50 +30699,59 @@ snapshots:camelcase: 5.3.1foldline: 1.1.0- [email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected]):+ [email protected](@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])([email protected]):dependencies:- '@vercel/backends': 0.8.14(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])+ '@vercel/backends': 0.8.29(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])'@vercel/blob': 2.4.0- '@vercel/build-utils': 13.30.0- '@vercel/cli-auth': 0.3.0- '@vercel/cli-config': 0.2.0+ '@vercel/build-utils': 13.36.2+ '@vercel/cli-auth': 0.3.1+ '@vercel/cli-config': 0.2.1+ '@vercel/container': 0.1.0'@vercel/detect-agent': 1.2.3- '@vercel/elysia': 0.1.93([email protected])([email protected])- '@vercel/express': 0.1.105(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])- '@vercel/fastify': 0.1.96([email protected])([email protected])+ '@vercel/elysia': 0.1.106([email protected])([email protected])+ '@vercel/express': 0.1.120(@emnapi/[email protected])(@emnapi/[email protected])([email protected])([email protected])+ '@vercel/fastify': 0.1.109([email protected])([email protected])'@vercel/fun': 1.3.0([email protected])- '@vercel/go': 3.9.0- '@vercel/h3': 0.1.102([email protected])([email protected])- '@vercel/hono': 0.2.96([email protected])([email protected])+ '@vercel/go': 3.10.2+ '@vercel/h3': 0.1.115([email protected])([email protected])+ '@vercel/hono': 0.2.109([email protected])([email protected])'@vercel/hydrogen': 1.4.0- '@vercel/koa': 0.1.76([email protected])([email protected])- '@vercel/nestjs': 0.2.97([email protected])([email protected])- '@vercel/next': 4.19.0([email protected])([email protected])- '@vercel/node': 5.8.17([email protected])([email protected])+ '@vercel/koa': 0.1.89([email protected])([email protected])+ '@vercel/nestjs': 0.2.110([email protected])([email protected])+ '@vercel/next': 4.20.4([email protected])([email protected])+ '@vercel/node': 5.9.2([email protected])([email protected])'@vercel/prepare-flags-definitions': 0.3.0- '@vercel/python': 6.45.1+ '@vercel/python': 6.54.0'@vercel/redwood': 2.5.0([email protected])([email protected])'@vercel/remix-builder': 5.9.1([email protected])([email protected])- '@vercel/ruby': 2.4.0- '@vercel/rust': 1.3.0- '@vercel/static-build': 2.10.3+ '@vercel/ruby': 2.5.1+ '@vercel/rust': 1.4.0+ '@vercel/static-build': 2.11.12chokidar: 4.0.0esbuild: 0.27.0- form-data: 4.0.5jose: 5.9.6+ jsonc-parser: 3.3.1luxon: 3.7.2- proxy-agent: 6.4.0([email protected])- sandbox: 3.1.2([email protected])+ sandbox: 3.4.0([email protected])([email protected])smol-toml: 1.5.2+ undici: 5.29.0zod: 4.1.11+ optionalDependencies:+ '@vercel/vc-native-darwin-arm64': 58.4.0+ '@vercel/vc-native-darwin-x64': 58.4.0+ '@vercel/vc-native-linux-arm64': 58.4.0+ '@vercel/vc-native-linux-x64': 58.4.0+ '@vercel/vc-native-win32-x64': 58.4.0transitivePeerDependencies:- '@emnapi/core'- '@emnapi/runtime'- bare-abort-controller+ - bufferutil- encoding- react-native-b4a- rollup- supports-color+ - utf-8-validatedependencies:@@ -31267,8 +31342,6 @@ snapshots:- [email protected]: {}-diff --git a/research/acp-adapter-requirements.md b/research/acp-adapter-requirements.mdnew file mode 100644index 000000000..04a2a2bee--- /dev/null+++ b/research/acp-adapter-requirements.md@@ -0,0 +1,351 @@+---+issue: https://github.com/vercel/eve/issues/100+status: proposed+last_updated: "2026-07-28"+---++# ACP adapter requirements++## Purpose++Allow an Agent Client Protocol (ACP) client to launch an authored eve application or bridge to a deployed eve agent:++```sh+eve acp+eve acp https://agent.example.com+```++The adapter translates stable ACP v1 over stdio to eve's public `Client` and `ClientSession` API. Without a URL, it supervises the normal local development server; with a URL, it connects to that deployment's existing eve HTTP API. ACP is an additional client surface rather than a second agent runtime.++The first release is intended for editors, desktop agent hosts, and local protocol harnesses. It is platform-neutral: it must not contain Buzz, Nostr, editor, or provider-specific behavior.++In this document, **must**, **should**, and **may** are normative requirements.++## Outcomes++The first release must let a conforming ACP v1 client:++- initialize and discover the adapter's actual capabilities;+- create multiple independent conversation sessions;+- send text prompts and render streamed messages, reasoning, and tool activity;+- answer tool permissions and supported structured questions;+- cancel active prompts without racing a subsequent prompt;+- close sessions and terminate the owned development process cleanly.++Existing `eve dev`, `eve dev --no-ui`, and TUI behavior must remain unchanged when ACP mode is not selected.++## Non-goals++The first release does not provide:++- a deployed ACP HTTP or WebSocket endpoint;+- ACP v2 support;+- ACP Streamable HTTP or WebSocket transport;+- Buzz, Nostr, or any other platform integration;+- client filesystem or terminal access;+- mounting the client's `cwd` into an eve sandbox;+- client-provided MCP servers or dynamic MCP connection injection;+- ACP session listing, loading, resumption, or durable ACP IDs across adapter restarts;+- model selection or other ACP session configuration;+- compatibility behavior for unsupported input that silently drops or flattens data.++Remote targets and platform channels require separate requirements because their trust, identity, credential, and lifecycle boundaries differ from a local subprocess.++## External contract++### R1: CLI selection++1. `eve acp` must select ACP mode explicitly. Non-TTY detection must not enable it implicitly.+2. `eve acp` without a URL must supervise an isolated loopback local development server. `eve acp <url>` must connect to that URL through eve's public `Client` API without starting a local server.+3. URL targets must accept the same credential-bearing URL and repeatable request-header inputs as `eve dev <url>`. Credentials must use the client's existing redirect policy and never be forwarded to another origin.+4. Local ACP mode must use the same compilation, watch, generation-pinning, and runtime behavior as ordinary `eve dev`.+5. The process exit status must be nonzero for boot, configuration, authentication, or unrecoverable protocol failures.+6. The CLI help must describe ACP as a stdio agent bridge and state that it does not grant access to the client's workspace.++Example client configuration:++```json+{+ "command": "pnpm",+ "args": ["exec", "eve", "acp"]+}+```++### R2: stdio integrity++1. stdin and stdout must be reserved for newline-delimited JSON-RPC messages.+2. Every non-empty stdout line must be one complete valid JSON-RPC message. Protocol messages must never be split across lines.+3. Boot progress, compiler output, rebuild diagnostics, runtime logs, warnings, and uncaught-error detail must go to stderr.+4. Logging during boot failure, rebuild, tool execution, and shutdown must not corrupt stdout.+5. The adapter must apply a finite inbound line-size limit and reject oversized input without unbounded buffering.+6. A malformed JSON-RPC message must receive the appropriate parse or invalid-request error when an ID can be correlated. It must not crash unrelated sessions.+7. Unknown request methods must return JSON-RPC `method not found`; unknown notifications may be ignored as required by JSON-RPC.++### R3: protocol version and capabilities++1. The adapter must implement stable ACP v1 as defined by the pinned official schema used to build eve.+2. If a client requests an unsupported version, including draft v2, the adapter must negotiate according to ACP: respond with the latest version it supports rather than claiming the requested version.+3. The adapter must not advertise draft or unstable capabilities.+4. `initialize` must report the installed eve version and an eve-owned implementation name.+5. Advertised capabilities must be derived from implemented, tested behavior. Omitted capability fields must not be interpreted internally as enabled.+6. Client authentication methods, filesystem, terminal, and client-provided MCP capabilities must not be advertised.+7. Unknown extension fields must be ignored where ACP and JSON-RPC require forward compatibility; they must never implicitly enable behavior.++A compatibility test must cover a client that requests version 2 and either continues using the negotiated v1 response or disconnects cleanly.++## Session requirements++### R4: ACP session identity++1. `session/new` must allocate an opaque adapter-owned ACP session ID and one independent `ClientSession`.+2. An ACP session ID must not be an eve runtime session ID. The eve ID does not exist until the first accepted prompt and may change after terminal reset behavior.+3. Session mappings may be process-local for the first release and must be discarded when the stdio connection ends.+4. Requests naming an unknown or closed ACP session must fail before dispatching model work.+5. The adapter must permit different ACP sessions to execute concurrently.+6. Prompts within one ACP session must be single-flight. An overlapping `session/prompt` for the same session must receive a deterministic busy error; it must not be queued invisibly or start a second eve session.++### R5: workspace declaration++1. In local mode, `session/new.cwd` must be absolute and resolve, after symlink normalization, to the eve application root selected at process startup.+2. A mismatched local `cwd` must fail session creation. In URL mode, `cwd` is untrusted client metadata: it must not select an application, change the server working directory, or grant filesystem access.+3. An empty `mcpServers` collection must be accepted. A missing collection must follow the pinned ACP schema's validation behavior.+4. A non-empty `mcpServers` collection must be rejected with an actionable unsupported-capability error before allocating runtime work or spawning any supplied command.+5. Additional workspace roots, if supplied through a stable ACP extension, must be rejected unless empty.++### R6: session closure++1. The adapter should advertise stable `session/close` support because `ClientSession.reset()` provides the corresponding terminal cleanup primitive.+2. Closing an idle session must reset its eve session when one exists, remove the ACP mapping, and prevent later reuse of the ACP ID.+3. Closing a session with an active prompt must cooperatively cancel it, wait for settlement, reset it, and then remove the mapping.+4. Repeated close requests must have deterministic already-closed or unknown-session behavior and must not affect a newer session.+5. Adapter shutdown must apply equivalent cleanup to all owned sessions without treating normal process termination as an agent failure.++## Prompt requirements++### R7: accepted content++1. The first release must accept one or more ACP text content blocks and preserve their order.+2. Empty prompt content must fail before calling `ClientSession.send()`.+3. Image, audio, embedded resource, file, and unknown content blocks must fail explicitly. They must not be omitted, stringified, or replaced with placeholders.+4. Text must be passed as user content without adding editor, Buzz, ACP, or framework policy to the user's message.+5. Support for additional content may be added only with explicit size limits, conversion semantics, capability advertisement, and focused tests.++### R8: prompt lifecycle++1. `session/prompt` must call `ClientSession.send()` and consume the resulting event stream through the current logical prompt boundary.+2. The request must remain open while the eve turn is active or parked on a supported human-input request.+3. An ordinary `session.waiting` or `session.completed` boundary must return ACP `end_turn`.+4. A confirmed eve cancellation boundary must return ACP `cancelled`.+5. Token or request limits may return their matching ACP stop reasons only when the eve event stream identifies that reason unambiguously; otherwise they must remain structured failures.+6. `turn.failed`, `session.failed`, stream corruption, authentication failure, and unsupported HITL must produce JSON-RPC errors with stable eve-owned codes and structured details. They must not be reported as `end_turn`.+7. The adapter must finish consuming or deliberately cancel the current stream before accepting another prompt for the same session.+8. Stream reconnect behavior must use the public client's cursor semantics and must not duplicate ACP updates after reconnect.++## Event projection++### R9: ordering and identity++1. ACP updates must preserve the observable order of eve events.+2. Adapter-generated message and tool IDs must be stable within the ACP session and deterministic across stream reconnection for the same eve event.+3. The adapter must not expose eve-only continuation tokens, credentials, internal workflow handles, or raw adapter state in ACP metadata.+4. Unknown eve events may be omitted only when they have no ACP-visible semantic effect. Failures and terminal boundaries must never be omitted.++### R10: minimum projection++| eve event | Required ACP v1 projection |+| ------------------------------------ | ----------------------------------------------------------------------------------------- |+| `message.appended` | `agent_message_chunk`, preserving text delta order |+| `reasoning.appended` | `agent_thought_chunk` when reasoning is client-visible |+| `actions.requested` | `tool_call` with stable call ID, title, kind, pending status, and representable raw input |+| observable tool start | `tool_call_update` with `in_progress` |+| `action.result` | `tool_call_update` with completed or failed status and representable output |+| confirmation `input.requested` | `session/request_permission` |+| supported question `input.requested` | `elicitation/create` form request |+| known cumulative usage | stable ACP `usage_update` |+| `turn.cancelled` | cancellation settlement for the pending prompt |+| `turn.failed` / `session.failed` | structured failure for the pending prompt |++1. A `message.completed` event with `finishReason: "tool-calls"` must not be presented as the final conversational answer.+2. Tool output that is not valid ACP content must have a bounded textual representation and may include safe raw JSON where the schema permits it.+3. Secret-bearing authorization details must not be copied into tool output or `_meta` fields.+4. Usage must be emitted only when both the meaning and units of required counters are known. The adapter must not invent missing token counts.+5. Subagent activity may remain represented as the parent runtime tool call. Nested eve-only child streams are not required in the first release.++## Human-input requirements++### R11: permissions++1. An eve input request with `display: "confirmation"` and approve/deny options must map to `session/request_permission` associated with the corresponding tool call.+2. ACP option IDs must be adapter-owned and correlated to eve request and option IDs; client-provided IDs must not be trusted as eve IDs.+3. The adapter must offer `allow_once` and `reject_once` only. It must not offer persistent allow/deny choices because eve has no corresponding policy mutation.+4. A selected option must become the matching eve `InputResponse`; a cancelled permission must not be interpreted as approval.++### R12: elicitation++Stable ACP v1 form elicitation may represent a constrained subset of eve questions:++1. A text request with freeform input must map to one required string field.+2. A single-select request with fixed options and no freeform alternative must map to one required string enum field.+3. Returned values must map back to the original eve request and option IDs without matching on display labels alone.+4. Mixed freeform-plus-options, unsupported schemas, sensitive input, and ambiguous request shapes must fail with an actionable unsupported-HITL error.+5. The adapter must use elicitation only when the client advertises compatible form support. Otherwise the prompt must fail rather than wait forever or disguise a question as permission.+6. URL elicitation is not required for eve questions in the first release.++### R13: input batches++1. If one eve event requests multiple inputs, the adapter must preserve the batch boundary.+2. It may present compatible requests sequentially or concurrently, but it must gather the complete response set and submit it to eve in one `inputResponses` delivery.+3. Cancellation while a batch is open must cancel every outstanding ACP permission or elicitation request and must not submit a partial approval set.+4. Replayed stream events must not open duplicate client prompts for requests that already have pending or completed correlations.++## Cancellation requirements++### R14: turn cancellation++1. `session/cancel` must target only the active prompt for the named ACP session.+2. The adapter must call `ClientSession.cancel()` with the observed eve turn ID when available.+3. A cancellation received with no active prompt must be a successful no-op.+4. The pending `session/prompt` request must remain open until eve emits the cancellation settlement boundary.+5. The adapter must not accept a replacement prompt for that session until settlement, preventing a stale cancellation from reaching a newer turn.+6. Partial messages and completed side effects remain observable and must not be represented as rolled back.+7. Pending permission and elicitation requests must receive their ACP cancellation outcomes before the prompt returns `cancelled`.++### R15: JSON-RPC request cancellation++1. The adapter must handle stable `$/cancel_request` for adapter-owned outstanding requests.+2. Cancelling an active `session/prompt` request must cooperatively cancel the matching eve turn rather than merely abandoning its stream.+3. After settlement, request cancellation may return the standard JSON-RPC Request Cancelled error instead of the feature-specific `cancelled` stop reason.+4. Cancelling one request must not terminate the ACP session or affect unrelated sessions.+5. Unknown or already-settled request IDs must be harmless no-ops.++## Security requirements++### R16: trust boundaries++1. The local subprocess boundary is the ACP client authentication boundary for the first release. The adapter must not advertise ACP authentication methods.+2. Environment variables supplied by an ACP host, including platform identity variables, must not change protocol semantics or establish an eve human principal.+3. Prompt text and `_meta` values must never be treated as authenticated actor identity.+4. `cwd`, filesystem methods, terminal methods, and MCP descriptors must not expand eve sandbox or host access.+5. The adapter must use only connections, tools, credentials, and sandbox policy authored in the eve application.+6. Diagnostic errors returned over ACP must be useful without exposing secrets, authorization headers, environment values, or internal capability tokens.+7. No ACP client request may cause the adapter to execute an arbitrary client-supplied command.++## Process requirements++### R17: ownership and isolation++1. In local mode, the ACP parent process should supervise a headless local development-server child on an ephemeral loopback port.+2. The ACP parent alone must own protocol stdout. Child stdout and stderr must be redirected to the parent's stderr through bounded handling.+3. The child must never recursively start ACP mode.+4. Local mode must terminate only the server process it owns. It must not stop an independently running development server discovered on another port. URL mode must not start or stop a server.+5. Closing stdin, SIGINT, SIGTERM, or parent shutdown must cancel active adapter work and reap an owned local child process without leaving descendants.+6. Local rebuilds must retain ordinary eve generation semantics: an in-flight turn remains pinned, and the next turn uses the newest successful build.+7. A failed rebuild must be diagnostic only when the previous valid generation remains available; it must not corrupt an active ACP connection.++### R18: dependency boundary++1. ACP SDK types and runtime behavior must be wrapped behind eve-owned modules and must not become part of eve's public TypeScript API.+2. The official Apache-2.0 ACP implementation or generated schema should be the source of protocol truth; eve must not maintain ad hoc handwritten wire types.+3. Adding a new runtime dependency to `eve` should be avoided. If the SDK runtime is required, vendor the pinned stable v1 artifact through the existing compiled-dependency process with attribution.+4. Protocol schema upgrades must be deliberate and covered by compatibility tests; an upstream draft release must not silently alter the shipped wire contract.++## Quality requirements++### R19: test tiers++The implementation must include:++- unit tests for version negotiation, content conversion, event projection, ID correlation, HITL mapping, and error mapping using in-memory streams;+- integration tests for concurrent `ClientSession` handles, stream reconnection, cancellation settlement, and input-batch continuation;+- scenario tests for CLI conflicts, stdout purity, child boot failure, rebuild behavior, EOF, signals, and child reaping;+- a conformance fixture using the official ACP client SDK;+- a smoke test with at least one independent real ACP client.++Tests must not require external network services, platform credentials, or model-provider credentials unless they are placed in the existing CI-only end-to-end tier.++### R20: documentation and release++1. Public documentation must show client configuration, supported capabilities, and shutdown behavior.+2. Documentation must clearly distinguish ACP chat/tool observability from editor workspace access.+3. Unsupported MCP, filesystem, terminal, content, session-resume, and remote-target behavior must be listed explicitly.+4. Because the published `eve` package changes, implementation must include a patch changeset.++## Manual validation++Use Zed as the primary user-facing validation client. Zed co-governs ACP, launches custom ACP agents directly, and exercises initialization, sessions, streamed updates, tools, permissions, elicitation, and cancellation through a real UI.++### Configure Zed++1. Build eve and ensure `pnpm exec eve` resolves from the application being tested.+2. Open the exact eve application root as the Zed workspace. The workspace must match the application root because `session/new.cwd` is intentionally validated.+3. Open **Agent Settings → External Agents → Add Agent → Add Custom Agent**.+4. Add this entry to Zed settings:++```json+{+ "agent_servers": {+ "eve-local": {+ "type": "custom",+ "command": "pnpm",+ "args": ["exec", "eve", "acp"],+ "env": {}+ }+ }+}+```++If the GUI process cannot find `pnpm`, replace `command` with its absolute path. Disable project-level Zed MCP servers for the initial validation: Zed may forward them in `session/new`, while the first adapter intentionally rejects non-empty `mcpServers`.++### Run the Zed validation sequence++1. **Basic prompt:** Ask the agent to return a known sentence. Confirm text streams progressively and the turn ends normally.+2. **Tool lifecycle:** Use a deterministic authored tool. Confirm Zed renders one stable tool call moving through pending, running when observable, and completed or failed states.+3. **Approval:** Trigger a tool requiring confirmation. Test approve and deny in separate turns and confirm each response resumes the same logical eve prompt.+4. **Elicitation:** Trigger one fixed-choice `ask_question` and one freeform text question. Confirm Zed renders the appropriate controls and the original turn resumes with the submitted answer.+5. **Cancellation:** Start a deliberately slow turn, cancel it from Zed, and immediately submit another prompt after cancellation settles. Confirm the first returns cancelled and no stale cancellation reaches the second.+6. **Concurrent sessions:** Open two Zed agent threads and prompt both concurrently. Confirm independent history, tool IDs, and completion.+7. **Rebuild:** Change the authored agent while Zed remains connected. Confirm in-flight work stays on its pinned generation and the next turn uses the newest successful build.+8. **Close and shutdown:** Close a thread, then close Zed or terminate the ACP process. Confirm session cleanup and that the supervised development server leaves no child processes.+9. **Negative boundaries:** Separately verify that a mismatched workspace root, non-empty MCP configuration, and unsupported content fail clearly before model work while protocol stdout remains valid.++Capture Zed's ACP logs for any failure and compare them with the adapter's stderr. Neither log should contain credentials or continuation tokens.++### Use acpx for repeatable iteration++Before or alongside Zed, use `acpx` as a fast headless ACP client:++```sh+npx acpx@latest \+ --agent 'pnpm exec eve acp' \+ exec 'Reply with exactly: ACP works'+```++Run the command from the eve application root. In an eve source checkout, for example, first run `cd apps/fixtures/weather-agent`; the monorepo root does not provide an `eve` executable. `acpx` launches `pnpm exec eve acp` itself, so do not start a separate ACP process first. Use named sessions and cancellation to exercise concurrency without the editor UI:++```sh+npx acpx@latest --agent 'pnpm exec eve acp' -s first 'Start a slow task'+npx acpx@latest --agent 'pnpm exec eve acp' -s second 'Reply immediately'+npx acpx@latest --agent 'pnpm exec eve acp' -s first cancel+```++`acpx` is an additional smoke client, not the protocol oracle. Automated conformance remains pinned to the official ACP SDK and schema. The recommended validation order is:++1. official SDK conformance tests;+2. `acpx` scripted smoke tests;+3. the full Zed sequence above;+4. Buzz BYOH compatibility testing in its separate integration scope.++## Acceptance criteria++The adapter is ready when all of the following are true:++- An ACP v1 client can launch `eve acp`, initialize, create two sessions, and run them concurrently. The same client can launch `eve acp <url>` and receive equivalent ACP behavior from an authenticated deployed eve agent.+- Prompts within one session remain single-flight.+- Text, reasoning, tool calls, tool results, permissions, supported elicitation, usage, failures, and cancellation preserve order and stable IDs.+- Cancellation cannot affect a later turn and returns only after eve settles the observed turn.+- Non-empty MCP configuration, mismatched `cwd`, and unsupported content fail before model work.+- Draft v2 negotiation never causes eve to advertise v2.+- Every stdout line remains valid JSON-RPC during boot, rebuild, failure, and shutdown.+- EOF and process signals clean up all adapter-owned sessions and processes.+- No client request grants host filesystem, terminal, arbitrary process, or unauthenticated principal access.+- Existing development modes remain behaviorally unchanged.diff --git a/research/buzz-support-requirements.md b/research/buzz-support-requirements.mdnew file mode 100644index 000000000..bd3a89c1c--- /dev/null+++ b/research/buzz-support-requirements.md@@ -0,0 +1,122 @@+---+issue: https://github.com/vercel/eve/issues/100+status: proposed+last_updated: "2026-07-29"+---++# Buzz support requirements++## Purpose++Define the boundary between eve's generic Agent Client Protocol (ACP) adapter and the platform-specific work required to run an eve agent as a visible Buzz participant.++## Existing comparison++Buzz launches Goose and `buzz-agent` as local ACP subprocesses:++```text+Buzz relay -> buzz-acp -> local ACP agent -> local Buzz CLI or MCP tool -> Buzz relay+```++ACP carries prompts, streamed output, tool activity, and turn lifecycle between `buzz-acp` and the agent. It does not publish a Buzz message by itself. Buzz's current base prompt therefore tells the agent to publish with `buzz messages send`.++This works for Goose because it runs on the Buzz host and can use the host's Buzz CLI and credentials. `buzz-agent` has a similar boundary: it is a generic ACP agent whose capabilities are supplied through local MCP servers such as `buzz-dev-mcp`. In both cases, the process that acts on the prompt can reach a Buzz-capable local tool environment.++An eve agent has an additional runtime boundary:++```text+Buzz relay -> buzz-acp -> eve acp -> eve HTTP runtime -> sandboxed tools+```++`eve acp` can receive the prompt and stream a complete ACP response, but the eve runtime does not implicitly inherit the local Buzz CLI, Nostr private key, or relay access. Buzz currently observes that ACP output but does not publish it as the chat reply.++## Why eve should expose generic ACP++`eve acp` must remain a platform-neutral ACP agent surface. This is the same composability principle used by `buzz-agent`: the agent protocol and platform tools are separate contracts.++A generic adapter:++- works with Zed and other ACP clients without Buzz-specific behavior;+- supports both local eve applications and deployed agents through the same interface;+- keeps ACP session, streaming, cancellation, tool, and human-input semantics in one tested implementation;+- avoids granting every eve runtime a Nostr identity merely because one ACP client is Buzz;+- leaves relay identity, signing, threading, retries, and delivery with the platform that owns them.++Therefore eve core must not parse Buzz prompt framing, sign Nostr events, invoke the Buzz CLI automatically, or treat ACP text as a Buzz message. It should continue to implement stable ACP and project eve behavior through its public `Client` and `ClientSession` APIs.++## Required outcome++A Buzz mention processed by an eve agent must result in one correctly signed and threaded Buzz reply, without requiring Buzz-specific behavior in eve's generic ACP adapter.++The component publishing the reply must own:++- the agent's Buzz/Nostr identity;+- the relay connection and authorization;+- the harness-selected channel and reply anchor;+- retry and idempotency behavior;+- reporting publication failure as a failed turn rather than successful completion.++## Support options++### Option A: Buzz-owned ACP reply sink — preferred++Change `buzz-acp` to accumulate the final ACP agent text and publish it using the harness's existing identity and routing context.++```text+buzz-acp -> eve acp -> final ACP text+ \-----------------> signed Buzz reply+```++This makes remote and sandboxed ACP agents behave like they do in Zed, where ACP text is the client-consumed answer. It also benefits ACP agents other than eve that cannot access host-local Buzz tools.++Requirements:++1. Publish only the final conversational response, not reasoning or intermediate tool text.+2. Use the harness-selected channel and thread/reply anchor.+3. Prevent duplicate replies when a dispatch or acknowledgement is retried.+4. Preserve the existing agent-owned publish path for agents that intentionally use Buzz tools, without double-posting.+5. Surface publication failures explicitly.++This is an upstream Buzz change, not an eve core change.++### Option B: external Buzz/eve connector — viable compatibility path++Run a local connector that speaks ACP to `buzz-acp`, calls a deployed eve agent, and publishes the final response with a locally held Nostr key.++The community `eve-acp-adapter.mjs` gist demonstrates this topology: it forwards prompts to eve's HTTP session API, reads the final response, signs a Nostr event locally, and posts it to Buzz. The private key remains outside the deployed eve runtime.++A supported connector should reuse `eve acp` or eve's public client rather than duplicate its protocol translation, and must add correct threading, cancellation, failure, and idempotency semantics missing from the proof of concept.++This option requires no eve core coupling, but leaves a Buzz-specific process to package and maintain.++### Option C: give the eve runtime Buzz tools and credentials — supported only as explicit app configuration++An authored eve application may define a Buzz-specific tool and provision relay credentials to its runtime. This follows the current Goose-style agent-owned publication model.++Requirements:++1. The application owner must opt in explicitly.+2. Credentials must use a dedicated least-privilege agent identity.+3. The tool must accept structured routing input rather than infer authorization from prompt prose.+4. Network, secret exposure, duplicate delivery, and prompt-injection risks must be documented.+5. No Buzz dependency or credential forwarding may be added to `eve acp` by default.++This enables richer Buzz actions, but couples the application to Buzz and moves signing authority into the model's tool boundary. It is not the default integration architecture.++## Additional compatibility++Buzz should support the stable ACP capabilities required by an eve turn. In particular, if an eve agent asks a supported structured question, `buzz-acp` must implement ACP form elicitation or return a clear unsupported-capability failure. ACP v2 system-prompt placement may improve integration later, but it does not solve reply publication and is not required for the reply sink.++## Decision++1. Keep `eve acp` generic and stable-ACP compliant.+2. Prefer an upstream `buzz-acp` reply sink for ordinary conversational replies.+3. Use an external connector if upstream support is unavailable.+4. Allow app-authored Buzz tools as an explicit advanced integration, never as implicit ACP behavior.++## Success criteria++- The same authored eve agent works in Zed and Buzz through `eve acp` without Buzz code in eve core.+- Buzz publishes exactly one signed reply with the correct identity and thread anchor.+- The Nostr private key remains in Buzz or a dedicated local connector unless an application explicitly opts into Buzz tools.+- ACP output, cancellation, and publication failures remain observable and are not reported as successful turns.