upgrade goose sdk and tui to be compatible with the latest agentclientprotocol/sdk package (#8667)
This commit is contained in:
@@ -3,6 +3,7 @@ import type {
|
||||
NewSessionResponse,
|
||||
LoadSessionResponse,
|
||||
PromptResponse,
|
||||
SessionInfo,
|
||||
} from "@agentclientprotocol/sdk";
|
||||
import { getClient } from "./acpConnection";
|
||||
import { perfLog } from "@/shared/lib/perfLog";
|
||||
@@ -43,24 +44,13 @@ export async function listProviders(): Promise<AcpProvider[]> {
|
||||
|
||||
export async function listSessions(): Promise<AcpSessionInfo[]> {
|
||||
const client = await getClient();
|
||||
// GooseClient.unstable_listSessions doesn't work with SDK 0.19 (renamed to listSessions).
|
||||
// Bypass GooseClient and call the connection directly. Fix when ui/acp is updated.
|
||||
// biome-ignore lint/suspicious/noExplicitAny: SDK doesn't expose conn property
|
||||
const conn = (client as any).conn;
|
||||
const response = await conn.listSessions({});
|
||||
return response.sessions.map(
|
||||
(info: {
|
||||
sessionId: string;
|
||||
title?: string;
|
||||
updatedAt?: string;
|
||||
_meta?: Record<string, unknown>;
|
||||
}) => ({
|
||||
sessionId: info.sessionId,
|
||||
title: info.title ?? null,
|
||||
updatedAt: info.updatedAt ?? null,
|
||||
messageCount: (info._meta?.messageCount as number) ?? 0,
|
||||
}),
|
||||
);
|
||||
const response = await client.listSessions({});
|
||||
return response.sessions.map((info: SessionInfo) => ({
|
||||
sessionId: info.sessionId,
|
||||
title: info.title ?? null,
|
||||
updatedAt: info.updatedAt ?? null,
|
||||
messageCount: (info._meta?.messageCount as number) ?? 0,
|
||||
}));
|
||||
}
|
||||
|
||||
export async function exportSession(sessionId: string): Promise<string> {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export class GooseClient {
|
||||
closed = Promise.resolve();
|
||||
|
||||
async initialize(..._args: unknown[]): Promise<void> {}
|
||||
}
|
||||
Reference in New Issue
Block a user