import type { MemoryCore } from "../agent-contract/memory-core.js"; export interface StdioServerOptions { core: MemoryCore; /** Default: `process.stdin`. Testable via a custom readable. */ stdin?: NodeJS.ReadableStream; /** Default: `process.stdout`. */ stdout?: NodeJS.WritableStream; /** Print diagnostics to stderr (default on). */ logToStderr?: boolean; /** Enable strict param validation. */ strict?: boolean; } export interface StdioServerHandle { readonly connected: boolean; /** Close the subscription + stop processing lines. Idempotent. */ close: () => Promise; /** Resolve once stdin ends. */ done: Promise; /** * Send a JSON-RPC request **from the bridge to the client** and wait * for the matching response. Used by the host LLM bridge to ask the * adapter (e.g. the Hermes Python provider) to run a fallback LLM * call using the agent's own model. * * IDs use the `"srv-N"` prefix so they cannot collide with the * client's numeric request IDs. */ serverRequest(method: string, params?: unknown, options?: { timeoutMs?: number; }): Promise; } export declare function startStdioServer(options: StdioServerOptions): StdioServerHandle; export interface StdioClient { request(method: string, params?: unknown): Promise; close(): void; notifications: AsyncIterable<{ method: string; params: unknown; }>; } export declare function createStdioClient(reader: NodeJS.ReadableStream, writer: NodeJS.WritableStream): StdioClient; /** Convenience: await both the core's shutdown AND stdin ending. */ export declare function waitForShutdown(core: MemoryCore, handle: StdioServerHandle): Promise; //# sourceMappingURL=stdio.d.ts.map