/**
 * JSON-RPC dispatcher for MailxService.
 * Maps mailxapi action names to MailxService method calls.
 * Used by msger's bidirectional IPC (Phase 3) and can also
 * serve as a stdio JSON-RPC interface for testing.
 */
type ServiceLike = Record<string, (...args: any[]) => any>;
export interface RpcRequest {
    _action: string;
    _cbid: string;
    [key: string]: any;
}
export interface RpcResponse {
    _cbid: string;
    result?: any;
    error?: string;
}
export interface RpcEvent {
    _event: string;
    [key: string]: any;
}
export declare function setDebugEvalSink(fn: (id: string, result: any, error?: string) => void): void;
/** Dispatch an incoming mailxapi call to the appropriate MailxService method */
export declare function dispatch(svc: ServiceLike, req: RpcRequest): Promise<RpcResponse>;
export {};
//# sourceMappingURL=jsonrpc.d.ts.map