/** * ACP-compatible front door for the unified runner. * * Implements the minimal Agent Client Protocol (ACP) local-agent lifecycle over * newline-delimited JSON-RPC on stdio: `initialize`, `authenticate`, * `session/new`, and `session/prompt`. A `session/prompt` runs the unified * injected runner and streams the final answer back as `session/update` * notifications before returning the prompt * turn's stop reason. * * The runner and input/output streams are injectable for deterministic * testing. */ import type { Readable, Writable } from "node:stream"; export declare const ACP_PROTOCOL_VERSION = 1; export type AcpRunnerInput = { prompt: string; sessionId: string; requestId: string; }; export type AcpRunnerResult = { finalOutput: string; runId: string; status: "succeeded" | "failed" | "skipped"; evidence: string[]; }; export type AcpRunner = (input: AcpRunnerInput) => Promise; export type AcpAgentOptions = { runner: AcpRunner; input?: Readable; output?: Writable; protocolVersion?: number; }; /** * Run the ACP agent loop until the input stream ends. Resolves when input * closes. Each line is one JSON-RPC message. */ export declare function runAcpAgent(options: AcpAgentOptions): Promise;