/** * `ak-render mcp`: the compiler as a Model Context Protocol server over stdio. * * The tools mirror the CLI so an agent follows the same loop either way: * `catalog` → `describe` → `validate` → `render`. `render` writes the HTML to a * file and returns only a summary, because the point of the compiler is to keep * presentation bytes out of the model's context. * * The transport is newline-delimited JSON-RPC 2.0 on stdin/stdout, implemented * without an SDK so the package keeps its single runtime dependency. Protocol * routing and tool contracts are shared with the Streamable HTTP transport; * this module only frames lines and runs the local tools. Nothing here touches * the network. */ import type { Interface } from 'node:readline'; import { type McpContext } from './mcp-local-tools.js'; import { type JsonRpcResponse } from './mcp-protocol.js'; /** * Answer one JSON-RPC message. Returns `undefined` for notifications and for * responses sent to us, which need no reply. */ export declare function handleMcpMessage(message: unknown, context: McpContext): JsonRpcResponse | undefined; /** Answer one line of the stdio transport, or return `undefined` for no reply. */ export declare function handleMcpLine(line: string, context: McpContext): string | undefined; /** Serve MCP on stdin/stdout until stdin closes. Logs go to stderr only. */ export declare function serveMcp(context?: McpContext): Interface; export type { McpContext }; //# sourceMappingURL=mcp-stdio-transport.d.ts.map