import type { ClientCapabilities, ConnectMcpRequest, ConnectMcpResponse, CreateTerminalRequest, CreateTerminalResponse, DisconnectMcpRequest, DisconnectMcpResponse, KillTerminalRequest, KillTerminalResponse, MessageMcpRequest, MessageMcpResponse, ReadTextFileRequest, ReadTextFileResponse, ReleaseTerminalRequest, ReleaseTerminalResponse, TerminalOutputRequest, TerminalOutputResponse, WaitForTerminalExitRequest, WaitForTerminalExitResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk"; export interface AcpSessionContext { readonly sessionId: string; readonly cwd: string; readonly label?: string; readonly runId?: string; } export interface FsHandlers { readTextFile?(params: ReadTextFileRequest, ctx: AcpSessionContext): Promise | ReadTextFileResponse; writeTextFile?(params: WriteTextFileRequest, ctx: AcpSessionContext): Promise | WriteTextFileResponse | void; } export interface TerminalHandlers { createTerminal(params: CreateTerminalRequest, ctx: AcpSessionContext): Promise | CreateTerminalResponse; terminalOutput(params: TerminalOutputRequest, ctx: AcpSessionContext): Promise | TerminalOutputResponse; waitForTerminalExit(params: WaitForTerminalExitRequest, ctx: AcpSessionContext): Promise | WaitForTerminalExitResponse; killTerminal(params: KillTerminalRequest, ctx: AcpSessionContext): Promise | KillTerminalResponse | void; releaseTerminal(params: ReleaseTerminalRequest, ctx: AcpSessionContext): Promise | ReleaseTerminalResponse | void; } export interface McpHandlers { connect(params: ConnectMcpRequest, ctx: AcpSessionContext): Promise | ConnectMcpResponse; message(params: MessageMcpRequest, ctx: AcpSessionContext): Promise | MessageMcpResponse; disconnect(params: DisconnectMcpRequest, ctx: AcpSessionContext): Promise | DisconnectMcpResponse | void; } export interface ClientHandlers { fs?: FsHandlers; terminal?: TerminalHandlers; mcp?: McpHandlers; } export interface ClientCapabilityOptions { /** Advertise unstable ACP elicitation support only when this connection has a runner-wide * responder. Initialize capabilities are fixed for the connection lifetime, so a later * session-scoped responder alone cannot truthfully light this up. */ elicitation?: boolean; /** Which auth method TYPES this client can actually complete. Advertising a gate the host * cannot service would invite the agent to offer a method the host can't finish. FIXED for * the connection lifetime (same discipline as `elicitation`); derived once at runner * construction, never per-session. Unset (or all-false) => the `auth` key is omitted entirely, * which the ACP spec treats as "unsupported" — the default-OFF, zero-behavior-change baseline. */ auth?: { terminal?: boolean; gateway?: boolean; }; /** Backend-declared namespaced vendor-extension advertisement (`Backend.clientCapabilityMeta`), * folded into the top-level `_meta`. Same fixed-for-the-connection discipline as `elicitation` * and `auth`: it is a property of the client build, not of any one session. */ meta?: Readonly>; } /** The client capability advertisement: fs/terminal derived solely from registered consumer * handlers, plus the capabilities this client supports natively regardless of handlers — * boolean session config options (SessionHandle drives the catalog programmatically and * handles `type: "boolean"` entries, e.g. codex-acp's Fast-mode toggle) — plus the connecting * backend's declared vendor-extension `_meta` (`options.meta`). The installed ACP SDK * has no ClientCapabilities field for MCP-over-ACP; support is declared by sending * `mcpServers[{ type: "acp" }]` on session/new and then gated against handlers at that site. */ export declare function clientCapabilitiesFor(handlers: ClientHandlers | undefined, options?: ClientCapabilityOptions): ClientCapabilities; /** Fail-fast validation for JavaScript consumers bypassing the grouped handler types. */ export declare function validateClientHandlers(handlers: ClientHandlers | undefined): void; export declare function hasFullMcpHandlers(mcp: McpHandlers | undefined): mcp is McpHandlers; //# sourceMappingURL=client-handlers.d.ts.map