Skip to content

Commit 21da10e

Browse files
committed
upgrade goose sdk and tui to be compatible with the latest agentclientprotocol/sdk package
1 parent 77542db commit 21da10e

8 files changed

Lines changed: 31 additions & 37 deletions

File tree

ui/goose2/src/shared/api/acpApi.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ export async function listProviders(): Promise<AcpProvider[]> {
3434

3535
export async function listSessions(): Promise<AcpSessionInfo[]> {
3636
const client = await getClient();
37-
// GooseClient.unstable_listSessions doesn't work with SDK 0.19 (renamed to listSessions).
38-
// Bypass GooseClient and call the connection directly. Fix when ui/acp is updated.
39-
// biome-ignore lint/suspicious/noExplicitAny: SDK doesn't expose conn property
40-
const conn = (client as any).conn;
41-
const response = await conn.listSessions({});
37+
const response = await client.listSessions({});
4238
return response.sessions.map(
4339
(info: {
4440
sessionId: string;
45-
title?: string;
46-
updatedAt?: string;
47-
_meta?: Record<string, unknown>;
41+
title?: string | null;
42+
updatedAt?: string | null;
43+
_meta?: Record<string, unknown> | null;
4844
}) => ({
4945
sessionId: info.sessionId,
5046
title: info.title ?? null,

ui/goose2/src/test/mocks/goose-sdk.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ export class GooseClient {
22
closed = Promise.resolve();
33

44
async initialize(..._args: unknown[]): Promise<void> {}
5+
6+
async listSessions(..._args: unknown[]): Promise<{ sessions: unknown[] }> {
7+
return { sessions: [] };
8+
}
59
}

ui/pnpm-lock.yaml

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

ui/sdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aaif/goose-sdk",
3-
"version": "0.17.0",
3+
"version": "0.18.0",
44
"description": "Agent Client Protocol (ACP) SDK for Goose AI agent",
55
"license": "Apache-2.0",
66
"repository": {
@@ -43,7 +43,7 @@
4343
"zod": "^3.25.76"
4444
},
4545
"peerDependencies": {
46-
"@agentclientprotocol/sdk": "*"
46+
"@agentclientprotocol/sdk": "^0.19.0"
4747
},
4848
"optionalDependencies": {
4949
"@aaif/goose-binary-darwin-arm64": "workspace:*",
@@ -53,7 +53,7 @@
5353
"@aaif/goose-binary-win32-x64": "workspace:*"
5454
},
5555
"devDependencies": {
56-
"@agentclientprotocol/sdk": "^0.14.1",
56+
"@agentclientprotocol/sdk": "^0.19.0",
5757
"@hey-api/openapi-ts": "^0.92.3",
5858
"@types/node": "^20.0.0",
5959
"prettier": "^3.8.1",

ui/sdk/src/goose-client.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@ export class GooseClient {
9292
return this.conn.unstable_forkSession(params);
9393
}
9494

95-
unstable_listSessions(
96-
params: ListSessionsRequest,
97-
): Promise<ListSessionsResponse> {
98-
return this.conn.unstable_listSessions(params);
95+
listSessions(params: ListSessionsRequest): Promise<ListSessionsResponse> {
96+
return this.conn.listSessions(params);
9997
}
10098

10199
unstable_resumeSession(

ui/text/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aaif/goose",
3-
"version": "0.17.0",
3+
"version": "0.18.0",
44
"description": "Goose - an open-source AI agent",
55
"license": "Apache-2.0",
66
"repository": {
@@ -28,7 +28,7 @@
2828
},
2929
"dependencies": {
3030
"@aaif/goose-sdk": "workspace:*",
31-
"@agentclientprotocol/sdk": "^0.14.1",
31+
"@agentclientprotocol/sdk": "^0.19.0",
3232
"@inkjs/ui": "^2.0.0",
3333
"ink": "^6.8.0",
3434
"ink-multiline-input": "^0.1.0",

ui/text/src/configure.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,15 @@ export default function ConfigureScreen({
432432
}
433433
await client.goose.GooseConfigUpsert({ key: "GOOSE_PROVIDER", value: provider.name });
434434
await client.goose.GooseConfigUpsert({ key: "GOOSE_MODEL", value: model });
435-
await client.goose.GooseSessionProviderUpdate({
435+
await client.setSessionConfigOption({
436436
sessionId,
437-
provider: provider.name,
438-
model,
437+
configId: "provider",
438+
value: provider.name,
439+
});
440+
await client.setSessionConfigOption({
441+
sessionId,
442+
configId: "model",
443+
value: model,
439444
});
440445
onComplete();
441446
} catch (e: unknown) {

ui/text/src/tui.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {
1414
ToolCall,
1515
ToolCallUpdate,
1616
} from "@agentclientprotocol/sdk";
17-
import { ndJsonStream } from "@agentclientprotocol/sdk";
17+
import { PROTOCOL_VERSION, ndJsonStream } from "@agentclientprotocol/sdk";
1818
import { GooseClient } from "@aaif/goose-sdk";
1919
import { resolveGooseBinary } from "@aaif/goose-sdk/node";
2020
import Onboarding from "./onboarding.js";
@@ -841,7 +841,7 @@ function App({
841841

842842
setStatus("handshaking…");
843843
await client.initialize({
844-
protocolVersion: 0,
844+
protocolVersion: PROTOCOL_VERSION,
845845
clientInfo: { name: "goose-text", version: "0.1.0" },
846846
clientCapabilities: {},
847847
});
@@ -1255,7 +1255,7 @@ async function runTextMode(serverConnection: Stream | string, prompt: string) {
12551255
);
12561256

12571257
await client.initialize({
1258-
protocolVersion: 0,
1258+
protocolVersion: PROTOCOL_VERSION,
12591259
clientInfo: { name: "goose-text", version: "0.1.0" },
12601260
clientCapabilities: {},
12611261
});

0 commit comments

Comments
 (0)