import type { ExportedItem } from "../types.js"; import type { PolicyStore } from "../policyStore.js"; import type { InterruptHandlers } from "./interruptLoop.js"; type JsonRpcId = string | number | null; export type JsonRpcMessage = { jsonrpc?: string; id?: JsonRpcId; method?: string; params?: any; result?: any; error?: any; }; /** The transport-agnostic handler returned by createMcpHandler. */ export type McpHandler = (message: JsonRpcMessage) => Promise; export type PolicyConfig = { policyStore: PolicyStore; interruptHandlers: InterruptHandlers; }; export type McpConfig = { serverName: string; serverVersion: string; exports: ExportedItem[]; policyConfig?: PolicyConfig; }; /** * Build the lines printed at MCP server startup listing the exposed tools, * e.g. ["Tools exposed:", " add (a, b)", " main (message)"]. Callers * decide where to write them (stderr for stdio, logger for HTTP). */ export declare function mcpToolSummaryLines(config: McpConfig): string[]; export declare function createMcpHandler(config: McpConfig): McpHandler; export declare function startStdioServer(handler: McpHandler, toolSummary?: string[]): void; export {};