mirror of
https://github.com/aljazceru/opencode.git
synced 2026-02-14 20:44:30 +01:00
fix(acp): use newer acp package (#3317)
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/github": "6.0.1",
|
||||
"@agentclientprotocol/sdk": "0.4.9",
|
||||
"@clack/prompts": "1.0.0-alpha.1",
|
||||
"@hono/standard-validator": "0.1.5",
|
||||
"@hono/zod-validator": "catalog:",
|
||||
@@ -47,7 +48,6 @@
|
||||
"@opencode-ai/sdk": "workspace:*",
|
||||
"@parcel/watcher": "2.5.1",
|
||||
"@standard-schema/spec": "1.0.0",
|
||||
"@zed-industries/agent-client-protocol": "0.4.5",
|
||||
"@zip.js/zip.js": "2.7.62",
|
||||
"ai": "catalog:",
|
||||
"chokidar": "4.0.3",
|
||||
|
||||
@@ -8,7 +8,7 @@ The implementation follows a clean separation of concerns:
|
||||
|
||||
### Core Components
|
||||
|
||||
- **`agent.ts`** - Implements the `Agent` interface from `@zed-industries/agent-client-protocol`
|
||||
- **`agent.ts`** - Implements the `Agent` interface from `@agentclientprotocol/sdk`
|
||||
- Handles initialization and capability negotiation
|
||||
- Manages session lifecycle (`session/new`, `session/load`)
|
||||
- Processes prompts and returns responses
|
||||
@@ -130,7 +130,7 @@ echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":
|
||||
|
||||
### Why the Official Library?
|
||||
|
||||
We use `@zed-industries/agent-client-protocol` instead of implementing JSON-RPC ourselves because:
|
||||
We use `@agentclientprotocol/sdk` instead of implementing JSON-RPC ourselves because:
|
||||
|
||||
- Ensures protocol compliance
|
||||
- Handles edge cases and future protocol versions
|
||||
@@ -160,5 +160,5 @@ ACP sessions map cleanly to opencode's internal session model:
|
||||
## References
|
||||
|
||||
- [ACP Specification](https://agentclientprotocol.com/)
|
||||
- [TypeScript Library](https://github.com/zed-industries/agent-client-protocol/tree/main/typescript)
|
||||
- [Protocol Examples](https://github.com/zed-industries/agent-client-protocol/tree/main/typescript/examples)
|
||||
- [TypeScript Library](https://github.com/agentclientprotocol/typescript-sdk)
|
||||
- [Protocol Examples](https://github.com/agentclientprotocol/typescript-sdk/tree/main/src/examples)
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
NewSessionResponse,
|
||||
PromptRequest,
|
||||
PromptResponse,
|
||||
} from "@zed-industries/agent-client-protocol"
|
||||
} from "@agentclientprotocol/sdk"
|
||||
import { Log } from "../util/log"
|
||||
import { ACPSessionManager } from "./session"
|
||||
import type { ACPConfig } from "./types"
|
||||
|
||||
@@ -17,7 +17,7 @@ import type {
|
||||
WaitForTerminalExitResponse,
|
||||
WriteTextFileRequest,
|
||||
WriteTextFileResponse,
|
||||
} from "@zed-industries/agent-client-protocol"
|
||||
} from "@agentclientprotocol/sdk"
|
||||
import { Log } from "../util/log"
|
||||
|
||||
export class ACPClient implements Client {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AgentSideConnection, ndJsonStream } from "@zed-industries/agent-client-protocol"
|
||||
import { AgentSideConnection, ndJsonStream } from "@agentclientprotocol/sdk"
|
||||
import { Log } from "../util/log"
|
||||
import { Instance } from "../project/instance"
|
||||
import { OpenCodeAgent } from "./agent"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { McpServer } from "@zed-industries/agent-client-protocol"
|
||||
import type { McpServer } from "@agentclientprotocol/sdk"
|
||||
import { Identifier } from "../id/id"
|
||||
import { Session } from "../session"
|
||||
import type { ACPSessionState } from "./types"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { McpServer } from "@zed-industries/agent-client-protocol"
|
||||
import type { McpServer } from "@agentclientprotocol/sdk"
|
||||
|
||||
export interface ACPSessionState {
|
||||
id: string
|
||||
|
||||
@@ -970,6 +970,7 @@ export type FileNode = {
|
||||
}
|
||||
|
||||
export type FileContent = {
|
||||
type: "text"
|
||||
content: string
|
||||
diff?: string
|
||||
patch?: {
|
||||
@@ -986,6 +987,8 @@ export type FileContent = {
|
||||
}>
|
||||
index?: string
|
||||
}
|
||||
encoding?: "base64"
|
||||
mimeType?: string
|
||||
}
|
||||
|
||||
export type File = {
|
||||
|
||||
Reference in New Issue
Block a user