Skip to content

Commit 6595492

Browse files
authored
chore: bump version to 0.12.2 (#35)
1 parent a32d347 commit 6595492

12 files changed

Lines changed: 366 additions & 212 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Learn more about the protocol itself at <https://agentclientprotocol.com>.
1414
<!-- `$ printf 'go get github.com/coder/acp-go-sdk@v%s\n' "$(cat schema/version)"` as bash -->
1515

1616
```bash
17-
go get github.com/coder/acp-go-sdk@v0.12.0
17+
go get github.com/coder/acp-go-sdk@v0.12.2
1818
```
1919

2020
## Get Started

acp_test.go

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
195203
func (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-
347348
func (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+
370375
func (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+
386395
func (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

12451254
func (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+
12471260
func (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+
12631280
func (agentNoExtensions) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error) {
12641281
return SetSessionConfigOptionResponse{}, nil
12651282
}

agent_gen.go

Lines changed: 4 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client_gen.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/agent/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ func (a *exampleAgent) ListSessions(ctx context.Context, params acp.ListSessions
5151
return acp.ListSessionsResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionList)
5252
}
5353

54-
// UnstableResumeSession implements acp.AgentExperimental.
55-
func (a *exampleAgent) UnstableResumeSession(ctx context.Context, params acp.UnstableResumeSessionRequest) (acp.UnstableResumeSessionResponse, error) {
56-
return acp.UnstableResumeSessionResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionResume)
54+
// ResumeSession implements acp.Agent.
55+
func (a *exampleAgent) ResumeSession(ctx context.Context, params acp.ResumeSessionRequest) (acp.ResumeSessionResponse, error) {
56+
return acp.ResumeSessionResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionResume)
5757
}
5858

5959
// SetSessionConfigOption implements acp.Agent.
@@ -136,9 +136,9 @@ func (a *exampleAgent) UnstableSetProviders(ctx context.Context, params acp.Unst
136136
return acp.UnstableSetProvidersResponse{}, acp.NewMethodNotFound(acp.AgentMethodProvidersSet)
137137
}
138138

139-
// UnstableCloseSession implements acp.AgentExperimental.
140-
func (a *exampleAgent) UnstableCloseSession(ctx context.Context, params acp.UnstableCloseSessionRequest) (acp.UnstableCloseSessionResponse, error) {
141-
return acp.UnstableCloseSessionResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionClose)
139+
// CloseSession implements acp.Agent.
140+
func (a *exampleAgent) CloseSession(ctx context.Context, params acp.CloseSessionRequest) (acp.CloseSessionResponse, error) {
141+
return acp.CloseSessionResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionClose)
142142
}
143143

144144
// Implement acp.AgentConnAware to receive the connection after construction.

example_agent_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ func (a *agentExample) ListSessions(ctx context.Context, params ListSessionsRequ
2222
return ListSessionsResponse{}, nil
2323
}
2424

25+
// ResumeSession implements Agent.
26+
func (a *agentExample) ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error) {
27+
return ResumeSessionResponse{}, nil
28+
}
29+
30+
// CloseSession implements Agent.
31+
func (a *agentExample) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error) {
32+
return CloseSessionResponse{}, nil
33+
}
34+
2535
// SetSessionConfigOption implements Agent.
2636
func (a *agentExample) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error) {
2737
return SetSessionConfigOptionResponse{}, nil

schema/meta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"authenticate": "authenticate",
44
"initialize": "initialize",
55
"session_cancel": "session/cancel",
6+
"session_close": "session/close",
67
"session_list": "session/list",
78
"session_load": "session/load",
89
"session_new": "session/new",
910
"session_prompt": "session/prompt",
11+
"session_resume": "session/resume",
1012
"session_set_config_option": "session/set_config_option",
1113
"session_set_mode": "session/set_mode"
1214
},

0 commit comments

Comments
 (0)