Merged via squash. Prepared head SHA: fcabdf7c31e33bbbd3ef82bdee92755eb0f62c82 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
24 lines
696 B
TypeScript
24 lines
696 B
TypeScript
import type { AgentSideConnection } from "@agentclientprotocol/sdk";
|
|
import { vi } from "vitest";
|
|
import type { GatewayClient } from "../gateway/client.js";
|
|
|
|
export type TestAcpConnection = AgentSideConnection & {
|
|
__sessionUpdateMock: ReturnType<typeof vi.fn>;
|
|
};
|
|
|
|
export function createAcpConnection(): TestAcpConnection {
|
|
const sessionUpdate = vi.fn(async () => {});
|
|
return {
|
|
sessionUpdate,
|
|
__sessionUpdateMock: sessionUpdate,
|
|
} as unknown as TestAcpConnection;
|
|
}
|
|
|
|
export function createAcpGateway(
|
|
request: GatewayClient["request"] = vi.fn(async () => ({ ok: true })) as GatewayClient["request"],
|
|
): GatewayClient {
|
|
return {
|
|
request,
|
|
} as unknown as GatewayClient;
|
|
}
|