@@ -13,6 +13,10 @@ import { ACPPromise } from "./promise"
1313
1414export interface Interface {
1515 readonly sessionUpdate : ( params : SessionNotification ) => Effect . Effect < void , ACPError . Error | RequestError >
16+ readonly extNotification : (
17+ method : string ,
18+ params : Record < string , unknown > ,
19+ ) => Effect . Effect < void , ACPError . Error | RequestError >
1620}
1721
1822export class Service extends Context . Service < Service , Interface > ( ) ( "@opencode/cli/acp/Connection" ) { }
@@ -21,24 +25,19 @@ export function make(connection: AgentConnection) {
2125 return Service . of ( {
2226 sessionUpdate : ( params ) =>
2327 ACPPromise . promise ( ( ) => connection . client . notify ( methods . client . session . update , params ) ) ,
28+ extNotification : ( method , params ) => ACPPromise . promise ( ( ) => connection . client . notify ( method , params ) ) ,
2429 } )
2530}
2631
2732export type Connection = {
28- readonly signal ?: AbortSignal
29- sessionUpdate ( params : SessionNotification ) : Promise < void >
3033 requestPermission ( params : RequestPermissionRequest , options ?: SendRequestOptions ) : Promise < RequestPermissionResponse >
31- extNotification ?( method : string , params : Record < string , unknown > ) : Promise < void >
3234}
3335
34- /** Promise view for the turn, permission, and replay code until they run as effects. */
36+ /** Promise view for permission requests until they run as effects. */
3537export function promise ( connection : AgentConnection ) : Connection {
3638 return {
37- signal : connection . signal ,
38- sessionUpdate : ( params ) => connection . client . notify ( methods . client . session . update , params ) ,
3939 requestPermission : ( params , options ) =>
4040 connection . client . request ( methods . client . session . requestPermission , params , options ) ,
41- extNotification : ( method , params ) => connection . client . notify ( method , params ) ,
4241 }
4342}
4443
0 commit comments