Skip to content

Commit 731122b

Browse files
authored
fix(acp): use newer acp package (#3317)
1 parent f903673 commit 731122b

File tree

9 files changed

+18
-15
lines changed

9 files changed

+18
-15
lines changed

bun.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
"dependencies": {
171171
"@actions/core": "1.11.1",
172172
"@actions/github": "6.0.1",
173+
"@agentclientprotocol/sdk": "0.4.9",
173174
"@clack/prompts": "1.0.0-alpha.1",
174175
"@hono/standard-validator": "0.1.5",
175176
"@hono/zod-validator": "catalog:",
@@ -182,7 +183,6 @@
182183
"@opencode-ai/sdk": "workspace:*",
183184
"@parcel/watcher": "2.5.1",
184185
"@standard-schema/spec": "1.0.0",
185-
"@zed-industries/agent-client-protocol": "0.4.5",
186186
"@zip.js/zip.js": "2.7.62",
187187
"ai": "catalog:",
188188
"chokidar": "4.0.3",
@@ -373,6 +373,8 @@
373373

374374
"@adobe/css-tools": ["@adobe/css-tools@4.4.4", "", {}, "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg=="],
375375

376+
"@agentclientprotocol/sdk": ["@agentclientprotocol/sdk@0.4.9", "", { "dependencies": { "zod": "^3.0.0" } }, "sha512-ExwH828LaTGoTTjxuw49l+fwOLA+Yx0+qkWn1TcHMOsY5mVI9CUfkj7ZDhv2klgZ7mJeT+lxX/Dn/KINv1AkNQ=="],
377+
376378
"@ai-sdk/amazon-bedrock": ["@ai-sdk/amazon-bedrock@2.2.10", "", { "dependencies": { "@ai-sdk/provider": "1.1.3", "@ai-sdk/provider-utils": "2.2.8", "@smithy/eventstream-codec": "^4.0.1", "@smithy/util-utf8": "^4.0.0", "aws4fetch": "^1.0.20" }, "peerDependencies": { "zod": "^3.0.0" } }, "sha512-icLGO7Q0NinnHIPgT+y1QjHVwH4HwV+brWbvM+FfCG2Afpa89PyKa3Ret91kGjZpBgM/xnj1B7K5eM+rRlsXQA=="],
377379

378380
"@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.0", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-uyyaO4KhxoIKZztREqLPh+6/K3ZJx/rp72JKoUEL9/kC+vfQTThUfPnY/bUryUpcnawx8IY/tSoYNOi/8PCv7w=="],
@@ -1381,8 +1383,6 @@
13811383

13821384
"@vitejs/plugin-react": ["@vitejs/plugin-react@4.7.0", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA=="],
13831385

1384-
"@zed-industries/agent-client-protocol": ["@zed-industries/agent-client-protocol@0.4.5", "", { "dependencies": { "zod": "^3.0.0" } }, "sha512-OwHKfu5AiKul/GSJilHg36+kOSV9eOl2eYnjR6tenAQDdraSnt22WFk0SDFTeuAANz1Gxkv+DTf7Hq32rvX7FQ=="],
1385-
13861386
"@zip.js/zip.js": ["@zip.js/zip.js@2.7.62", "", {}, "sha512-OaLvZ8j4gCkLn048ypkZu29KX30r8/OfFF2w4Jo5WXFr+J04J+lzJ5TKZBVgFXhlvSkqNFQdfnY1Q8TMTCyBVA=="],
13871387

13881388
"abbrev": ["abbrev@2.0.0", "", {}, "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ=="],
@@ -3379,6 +3379,8 @@
33793379

33803380
"@actions/github/@octokit/request-error": ["@octokit/request-error@5.1.1", "", { "dependencies": { "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g=="],
33813381

3382+
"@agentclientprotocol/sdk/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
3383+
33823384
"@ai-sdk/amazon-bedrock/@ai-sdk/provider": ["@ai-sdk/provider@1.1.3", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg=="],
33833385

33843386
"@ai-sdk/amazon-bedrock/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@2.2.8", "", { "dependencies": { "@ai-sdk/provider": "1.1.3", "nanoid": "^3.3.8", "secure-json-parse": "^2.7.0" }, "peerDependencies": { "zod": "^3.23.8" } }, "sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA=="],
@@ -3553,8 +3555,6 @@
35533555

35543556
"@vinxi/server-components/magicast": ["magicast@0.2.11", "", { "dependencies": { "@babel/parser": "^7.22.16", "@babel/types": "^7.22.17", "recast": "^0.23.4" } }, "sha512-6saXbRDA1HMkqbsvHOU6HBjCVgZT460qheRkLhJQHWAbhXoWESI3Kn/dGGXyKs15FFKR85jsUqFx2sMK0wy/5g=="],
35553557

3556-
"@zed-industries/agent-client-protocol/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
3557-
35583558
"accepts/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
35593559

35603560
"ai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.1", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.3", "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-/iP1sKc6UdJgGH98OCly7sWJKv+J9G47PnTjIj40IJMUQKwDrUMyf7zOOfRtPwSuNifYhSoJQ4s1WltI65gJ/g=="],

packages/opencode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"dependencies": {
3636
"@actions/core": "1.11.1",
3737
"@actions/github": "6.0.1",
38+
"@agentclientprotocol/sdk": "0.4.9",
3839
"@clack/prompts": "1.0.0-alpha.1",
3940
"@hono/standard-validator": "0.1.5",
4041
"@hono/zod-validator": "catalog:",
@@ -47,7 +48,6 @@
4748
"@opencode-ai/sdk": "workspace:*",
4849
"@parcel/watcher": "2.5.1",
4950
"@standard-schema/spec": "1.0.0",
50-
"@zed-industries/agent-client-protocol": "0.4.5",
5151
"@zip.js/zip.js": "2.7.62",
5252
"ai": "catalog:",
5353
"chokidar": "4.0.3",

packages/opencode/src/acp/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The implementation follows a clean separation of concerns:
88

99
### Core Components
1010

11-
- **`agent.ts`** - Implements the `Agent` interface from `@zed-industries/agent-client-protocol`
11+
- **`agent.ts`** - Implements the `Agent` interface from `@agentclientprotocol/sdk`
1212
- Handles initialization and capability negotiation
1313
- Manages session lifecycle (`session/new`, `session/load`)
1414
- Processes prompts and returns responses
@@ -130,7 +130,7 @@ echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":
130130

131131
### Why the Official Library?
132132

133-
We use `@zed-industries/agent-client-protocol` instead of implementing JSON-RPC ourselves because:
133+
We use `@agentclientprotocol/sdk` instead of implementing JSON-RPC ourselves because:
134134

135135
- Ensures protocol compliance
136136
- Handles edge cases and future protocol versions
@@ -160,5 +160,5 @@ ACP sessions map cleanly to opencode's internal session model:
160160
## References
161161

162162
- [ACP Specification](https://agentclientprotocol.com/)
163-
- [TypeScript Library](https://github.com/zed-industries/agent-client-protocol/tree/main/typescript)
164-
- [Protocol Examples](https://github.com/zed-industries/agent-client-protocol/tree/main/typescript/examples)
163+
- [TypeScript Library](https://github.com/agentclientprotocol/typescript-sdk)
164+
- [Protocol Examples](https://github.com/agentclientprotocol/typescript-sdk/tree/main/src/examples)

packages/opencode/src/acp/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
NewSessionResponse,
1313
PromptRequest,
1414
PromptResponse,
15-
} from "@zed-industries/agent-client-protocol"
15+
} from "@agentclientprotocol/sdk"
1616
import { Log } from "../util/log"
1717
import { ACPSessionManager } from "./session"
1818
import type { ACPConfig } from "./types"

packages/opencode/src/acp/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
WaitForTerminalExitResponse,
1818
WriteTextFileRequest,
1919
WriteTextFileResponse,
20-
} from "@zed-industries/agent-client-protocol"
20+
} from "@agentclientprotocol/sdk"
2121
import { Log } from "../util/log"
2222

2323
export class ACPClient implements Client {

packages/opencode/src/acp/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AgentSideConnection, ndJsonStream } from "@zed-industries/agent-client-protocol"
1+
import { AgentSideConnection, ndJsonStream } from "@agentclientprotocol/sdk"
22
import { Log } from "../util/log"
33
import { Instance } from "../project/instance"
44
import { OpenCodeAgent } from "./agent"

packages/opencode/src/acp/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { McpServer } from "@zed-industries/agent-client-protocol"
1+
import type { McpServer } from "@agentclientprotocol/sdk"
22
import { Identifier } from "../id/id"
33
import { Session } from "../session"
44
import type { ACPSessionState } from "./types"

packages/opencode/src/acp/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { McpServer } from "@zed-industries/agent-client-protocol"
1+
import type { McpServer } from "@agentclientprotocol/sdk"
22

33
export interface ACPSessionState {
44
id: string

packages/sdk/js/src/gen/types.gen.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ export type FileNode = {
970970
}
971971

972972
export type FileContent = {
973+
type: "text"
973974
content: string
974975
diff?: string
975976
patch?: {
@@ -986,6 +987,8 @@ export type FileContent = {
986987
}>
987988
index?: string
988989
}
990+
encoding?: "base64"
991+
mimeType?: string
989992
}
990993

991994
export type File = {

0 commit comments

Comments
 (0)