Skip to content

Commit 0373ea9

Browse files
authored
feat(acp): implement acp-next session slice (anomalyco#29250)
1 parent e1406e0 commit 0373ea9

4 files changed

Lines changed: 775 additions & 13 deletions

File tree

packages/opencode/src/acp-next/agent.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type AuthenticateRequest,
66
type CancelNotification,
77
type InitializeRequest,
8+
type LoadSessionRequest,
89
type NewSessionRequest,
910
type PromptRequest,
1011
} from "@agentclientprotocol/sdk"
@@ -15,8 +16,8 @@ import * as ACPNextService from "./service"
1516

1617
export function init({ sdk: _sdk }: { sdk: OpencodeClient }) {
1718
return {
18-
create: (_connection: AgentSideConnection) => {
19-
return new Agent(ACPNextService.make())
19+
create: (connection: AgentSideConnection) => {
20+
return new Agent(ACPNextService.make({ sdk: _sdk, connection }))
2021
},
2122
}
2223
}
@@ -36,6 +37,10 @@ export class Agent implements ACPAgent {
3637
return run(this.service.newSession(params))
3738
}
3839

40+
loadSession(params: LoadSessionRequest) {
41+
return run(this.service.loadSession(params))
42+
}
43+
3944
prompt(params: PromptRequest) {
4045
return run(this.service.prompt(params))
4146
}

0 commit comments

Comments
 (0)