@@ -116,8 +116,10 @@ type agentFuncs struct {
116116 AuthenticateFunc func (context.Context , AuthenticateRequest ) (AuthenticateResponse , error )
117117 PromptFunc func (context.Context , PromptRequest ) (PromptResponse , error )
118118 CancelFunc func (context.Context , CancelNotification ) error
119+ CloseSessionFunc func (context.Context , CloseSessionRequest ) (CloseSessionResponse , error )
119120 SetSessionModeFunc func (ctx context.Context , params SetSessionModeRequest ) (SetSessionModeResponse , error )
120121 ListSessionsFunc func (context.Context , ListSessionsRequest ) (ListSessionsResponse , error )
122+ ResumeSessionFunc func (context.Context , ResumeSessionRequest ) (ResumeSessionResponse , error )
121123 SetSessionConfigOptionFunc func (context.Context , SetSessionConfigOptionRequest ) (SetSessionConfigOptionResponse , error )
122124 // Unstable (schema/meta.unstable.json)
123125 UnstableDidChangeDocumentFunc func (context.Context , UnstableDidChangeDocumentNotification ) error
@@ -134,9 +136,7 @@ type agentFuncs struct {
134136 UnstableDisableProvidersFunc func (context.Context , UnstableDisableProvidersRequest ) (UnstableDisableProvidersResponse , error )
135137 UnstableListProvidersFunc func (context.Context , UnstableListProvidersRequest ) (UnstableListProvidersResponse , error )
136138 UnstableSetProvidersFunc func (context.Context , UnstableSetProvidersRequest ) (UnstableSetProvidersResponse , error )
137- UnstableCloseSessionFunc func (context.Context , UnstableCloseSessionRequest ) (UnstableCloseSessionResponse , error )
138139 UnstableForkSessionFunc func (context.Context , UnstableForkSessionRequest ) (UnstableForkSessionResponse , error )
139- UnstableResumeSessionFunc func (context.Context , UnstableResumeSessionRequest ) (UnstableResumeSessionResponse , error )
140140 UnstableSetSessionModelFunc func (context.Context , UnstableSetSessionModelRequest ) (UnstableSetSessionModelResponse , error )
141141
142142 HandleExtensionMethodFunc func (context.Context , string , json.RawMessage ) (any , error )
@@ -191,6 +191,14 @@ func (a agentFuncs) Cancel(ctx context.Context, n CancelNotification) error {
191191 return nil
192192}
193193
194+ // CloseSession implements Agent.
195+ func (a agentFuncs ) CloseSession (ctx context.Context , params CloseSessionRequest ) (CloseSessionResponse , error ) {
196+ if a .CloseSessionFunc != nil {
197+ return a .CloseSessionFunc (ctx , params )
198+ }
199+ return CloseSessionResponse {}, nil
200+ }
201+
194202// SetSessionMode implements Agent.
195203func (a agentFuncs ) SetSessionMode (ctx context.Context , params SetSessionModeRequest ) (SetSessionModeResponse , error ) {
196204 if a .SetSessionModeFunc != nil {
@@ -215,12 +223,12 @@ func (a agentFuncs) ListSessions(ctx context.Context, params ListSessionsRequest
215223 return ListSessionsResponse {}, nil
216224}
217225
218- // UnstableResumeSession implements AgentExperimental .
219- func (a agentFuncs ) UnstableResumeSession (ctx context.Context , params UnstableResumeSessionRequest ) (UnstableResumeSessionResponse , error ) {
220- if a .UnstableResumeSessionFunc != nil {
221- return a .UnstableResumeSessionFunc (ctx , params )
226+ // ResumeSession implements Agent .
227+ func (a agentFuncs ) ResumeSession (ctx context.Context , params ResumeSessionRequest ) (ResumeSessionResponse , error ) {
228+ if a .ResumeSessionFunc != nil {
229+ return a .ResumeSessionFunc (ctx , params )
222230 }
223- return UnstableResumeSessionResponse {}, nil
231+ return ResumeSessionResponse {}, nil
224232}
225233
226234// SetSessionConfigOption implements Agent.
@@ -337,13 +345,6 @@ func (a agentFuncs) UnstableSetProviders(ctx context.Context, params UnstableSet
337345 return UnstableSetProvidersResponse {}, nil
338346}
339347
340- func (a agentFuncs ) UnstableCloseSession (ctx context.Context , params UnstableCloseSessionRequest ) (UnstableCloseSessionResponse , error ) {
341- if a .UnstableCloseSessionFunc != nil {
342- return a .UnstableCloseSessionFunc (ctx , params )
343- }
344- return UnstableCloseSessionResponse {}, nil
345- }
346-
347348func (a agentFuncs ) HandleExtensionMethod (ctx context.Context , method string , params json.RawMessage ) (any , error ) {
348349 if a .HandleExtensionMethodFunc != nil {
349350 return a .HandleExtensionMethodFunc (ctx , method , params )
@@ -367,6 +368,10 @@ func (a *forkOnlyUnstableAgent) Cancel(context.Context, CancelNotification) erro
367368 return nil
368369}
369370
371+ func (a * forkOnlyUnstableAgent ) CloseSession (context.Context , CloseSessionRequest ) (CloseSessionResponse , error ) {
372+ return CloseSessionResponse {}, nil
373+ }
374+
370375func (a * forkOnlyUnstableAgent ) NewSession (context.Context , NewSessionRequest ) (NewSessionResponse , error ) {
371376 return NewSessionResponse {}, nil
372377}
@@ -383,6 +388,10 @@ func (a *forkOnlyUnstableAgent) ListSessions(context.Context, ListSessionsReques
383388 return ListSessionsResponse {}, nil
384389}
385390
391+ func (a * forkOnlyUnstableAgent ) ResumeSession (context.Context , ResumeSessionRequest ) (ResumeSessionResponse , error ) {
392+ return ResumeSessionResponse {}, nil
393+ }
394+
386395func (a * forkOnlyUnstableAgent ) SetSessionConfigOption (context.Context , SetSessionConfigOptionRequest ) (SetSessionConfigOptionResponse , error ) {
387396 return SetSessionConfigOptionResponse {}, nil
388397}
@@ -1244,6 +1253,10 @@ func (agentNoExtensions) Initialize(ctx context.Context, params InitializeReques
12441253
12451254func (agentNoExtensions ) Cancel (ctx context.Context , params CancelNotification ) error { return nil }
12461255
1256+ func (agentNoExtensions ) CloseSession (ctx context.Context , params CloseSessionRequest ) (CloseSessionResponse , error ) {
1257+ return CloseSessionResponse {}, nil
1258+ }
1259+
12471260func (agentNoExtensions ) NewSession (ctx context.Context , params NewSessionRequest ) (NewSessionResponse , error ) {
12481261 return NewSessionResponse {}, nil
12491262}
@@ -1260,6 +1273,10 @@ func (agentNoExtensions) ListSessions(ctx context.Context, params ListSessionsRe
12601273 return ListSessionsResponse {}, nil
12611274}
12621275
1276+ func (agentNoExtensions ) ResumeSession (ctx context.Context , params ResumeSessionRequest ) (ResumeSessionResponse , error ) {
1277+ return ResumeSessionResponse {}, nil
1278+ }
1279+
12631280func (agentNoExtensions ) SetSessionConfigOption (ctx context.Context , params SetSessionConfigOptionRequest ) (SetSessionConfigOptionResponse , error ) {
12641281 return SetSessionConfigOptionResponse {}, nil
12651282}
0 commit comments