import { AgentSideConnection } from '@agentclientprotocol/sdk'; import { a as AcpHandle } from '../types-DUWAu0g6.js'; /** * AIP-44 ACP server — exposes an AIP-9 operator to ACP-speaking clients. * * Thin wrapper around `@agentclientprotocol/sdk`'s `AgentSideConnection`. * Hosts the connection, maps incoming `session/prompt` requests onto an * `onPrompt` handler, and bridges `session/update` notifications to the * caller's audit emitter via the per-session context. */ interface AcpServerOptions { /** AIP-44 manifest describing the server's role + capabilities. */ handle: AcpHandle; /** Output bytes go here (client stdin / WS write side). */ output: WritableStream; /** Input bytes come from here (client stdout / WS read side). */ input: ReadableStream; /** Hook invoked when a client calls `session/prompt`. */ onPrompt?: (params: unknown, ctx: AcpServerSessionContext) => Promise; /** Hook invoked on `session/cancel`. */ onCancel?: (sessionId: string) => Promise; } interface AcpServerSessionContext { readonly sessionId: string; /** Push a `session/update` notification to the connected client. */ sendUpdate(update: unknown): Promise; /** Aborts when the client sends `session/cancel`. */ readonly signal: AbortSignal; } interface AcpServer { readonly connection: AgentSideConnection; close(): Promise; } declare function createAcpServer(options: AcpServerOptions): AcpServer; export { type AcpServer, type AcpServerOptions, type AcpServerSessionContext, createAcpServer };