fix: address acp client typing

This commit is contained in:
Peter Steinberger
2026-01-18 08:51:57 +00:00
parent 65bed815a8
commit 9241e21114
2 changed files with 11 additions and 18 deletions

View File

@@ -6,6 +6,7 @@ import {
ClientSideConnection,
PROTOCOL_VERSION,
ndJsonStream,
type RequestPermissionRequest,
type SessionNotification,
} from "@agentclientprotocol/sdk";
@@ -90,7 +91,7 @@ export async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpC
}
const input = Writable.toWeb(agent.stdin);
const output = Readable.toWeb(agent.stdout) as ReadableStream<Uint8Array>;
const output = Readable.toWeb(agent.stdout) as unknown as ReadableStream<Uint8Array>;
const stream = ndJsonStream(input, output);
const client = new ClientSideConnection(
@@ -98,7 +99,7 @@ export async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpC
sessionUpdate: async (params: SessionNotification) => {
printSessionUpdate(params);
},
requestPermission: async (params) => {
requestPermission: async (params: RequestPermissionRequest) => {
console.log("\n[permission requested]", params.toolCall?.title ?? "tool");
const allowOnce = params.options.find((option) => option.kind === "allow_once");
const fallback = params.options[0];