histoire
Version:
A fast story book powered by Vite
19 lines • 1.41 kB
TypeScript
import type { CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, RequestPermissionRequest, RequestPermissionResponse, SessionNotification } from '@agentclientprotocol/sdk';
import type { launchAgentProcess } from './agent-process.js';
/** Client-owned ACP callbacks; each request receives the agent's cancellation signal. */
export interface AgentClientHandlers {
/** Mediates agent-owned tool authorization; client does not edit source files. */
permission: (params: RequestPermissionRequest, signal?: AbortSignal) => Promise<RequestPermissionResponse>;
/** Asks the user for structured input or to visit a link. */
elicitation: (params: CreateElicitationRequest, signal?: AbortSignal) => Promise<CreateElicitationResponse>;
/** Agent finished a link elicitation out of band. */
elicitationComplete: (params: CompleteElicitationNotification) => void;
/** Receives reply/diff notifications. */
update: (params: SessionNotification) => void;
}
/** Connects official ACP SDK v1 with only supported, client-owned callbacks. */
export declare function connectAgentClient(process: ReturnType<typeof launchAgentProcess>, handlers: AgentClientHandlers): {
connection: import("@agentclientprotocol/sdk").ClientConnection;
initialize: () => Promise<import("@agentclientprotocol/sdk").InitializeResponse>;
};
//# sourceMappingURL=client.d.ts.map