import type { JSONRPCRequest, JSONRPCError, JSONRPCNotification } from "./types.js";
export interface ParseResult {
    success: true;
    request: JSONRPCRequest | JSONRPCNotification;
    isNotification: boolean;
}
export interface ParseError {
    success: false;
    error: JSONRPCError;
    id: string | number | null;
}
export declare function parseMessage(line: string): ParseResult | ParseError;
export declare function formatSuccessResponse(id: string | number | null, result: unknown): string;
export declare function formatErrorResponse(id: string | number | null, error: JSONRPCError): string;
