/**
 * JSON-RPC 2.0 envelope schemas for RPC dispatch and SAES transport.
 *
 * Params are object-only following MCP (no positional arrays); per-action
 * spec.input narrows further. Result is the full JSON-RPC valid value
 * space per spec §5 ("determined by the method invoked"): object, array,
 * string, number, boolean, or null — the per-action spec.output is the
 * actual contract. The envelope-level loose-object-only constraint
 * inherited from MCP would reject any action with `output: z.null()` /
 * `z.string()` / etc. on the wire, so we relax it here while keeping
 * MCP-superset shape on params + _meta.
 *
 * MCP `_meta` types (`JsonrpcMcpMeta`, `JsonrpcRequestParamsMeta`) are
 * exported as building blocks for per-action schemas but are NOT validated
 * at the envelope level — `_meta` content validation belongs in per-action
 * schemas where it produces the correct error code (`invalid_params`, not
 * `invalid_request`).
 *
 * @source https://github.com/modelcontextprotocol/typescript-sdk
 * @see https://www.jsonrpc.org/specification
 * @module
 */
import { z } from 'zod';
export declare const JSONRPC_VERSION = "2.0";
/** A uniquely identifying id for a request in JSON-RPC. Like MCP, excludes null. */
export declare const JsonrpcRequestId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
export type JsonrpcRequestId = z.infer<typeof JsonrpcRequestId>;
/** A JSON-RPC method name. */
export declare const JsonrpcMethod: z.ZodString;
export type JsonrpcMethod = z.infer<typeof JsonrpcMethod>;
/** A progress token, used to associate progress notifications with the original request. */
export declare const JsonrpcProgressToken: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
export type JsonrpcProgressToken = z.infer<typeof JsonrpcProgressToken>;
/** MCP metadata object — loose to allow additional properties and `.extend`. */
export declare const JsonrpcMcpMeta: z.ZodObject<{}, z.core.$loose>;
export type JsonrpcMcpMeta = z.infer<typeof JsonrpcMcpMeta>;
/** Request params metadata — extends MCP meta with optional progress token. */
export declare const JsonrpcRequestParamsMeta: z.ZodObject<{
    progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
}, z.core.$loose>;
export type JsonrpcRequestParamsMeta = z.infer<typeof JsonrpcRequestParamsMeta>;
/** Request params — loose object. Per-action schemas validate `_meta` content. */
export declare const JsonrpcRequestParams: z.ZodObject<{}, z.core.$loose>;
export type JsonrpcRequestParams = z.infer<typeof JsonrpcRequestParams>;
/** Notification params — loose object. Per-action schemas validate `_meta` content. */
export declare const JsonrpcNotificationParams: z.ZodObject<{}, z.core.$loose>;
export type JsonrpcNotificationParams = z.infer<typeof JsonrpcNotificationParams>;
/**
 * Result — any JSON value per JSON-RPC 2.0 §5. Per-action `spec.output`
 * is the actual contract; the envelope only asserts presence + JSON-ness.
 *
 * `z.json()` is required (not implicitly optional like `z.unknown()` /
 * `z.any()`, which would let an error envelope `{jsonrpc, id, error}`
 * parse successfully against the success envelope and break union
 * discrimination).
 */
export declare const JsonrpcResult: z.ZodJSONSchema;
export type JsonrpcResult = z.infer<typeof JsonrpcResult>;
/** A request that expects a response. */
export declare const JsonrpcRequest: z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>;
export type JsonrpcRequest = z.infer<typeof JsonrpcRequest>;
/** A notification which does not expect a response. */
export declare const JsonrpcNotification: z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>;
export type JsonrpcNotification = z.infer<typeof JsonrpcNotification>;
/** A successful (non-error) response to a request. */
export declare const JsonrpcResponse: z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    result: z.ZodJSONSchema;
}, z.core.$loose>;
export type JsonrpcResponse = z.infer<typeof JsonrpcResponse>;
export declare const JSONRPC_PARSE_ERROR = -32700;
export declare const JSONRPC_INVALID_REQUEST = -32600;
export declare const JSONRPC_METHOD_NOT_FOUND = -32601;
export declare const JSONRPC_INVALID_PARAMS = -32602;
export declare const JSONRPC_INTERNAL_ERROR = -32603;
/** Start of the server-defined error code range (-32000). */
export declare const JSONRPC_SERVER_ERROR_START = -32000;
/** End of the server-defined error code range (-32099). */
export declare const JSONRPC_SERVER_ERROR_END = -32099;
/** A server-defined error code in the -32000 to -32099 range. */
export declare const JsonrpcServerErrorCode: z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">;
export type JsonrpcServerErrorCode = z.infer<typeof JsonrpcServerErrorCode>;
/**
 * A valid JSON-RPC error code — one of the 5 standard codes or
 * a server-defined code in the -32000 to -32099 range.
 */
export declare const JsonrpcErrorCode: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
export type JsonrpcErrorCode = z.infer<typeof JsonrpcErrorCode>;
/** Error object within a JSON-RPC error response. */
export declare const JsonrpcErrorObject: z.ZodObject<{
    code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
    message: z.ZodString;
    data: z.ZodOptional<z.ZodUnknown>;
}, z.core.$loose>;
export type JsonrpcErrorObject = z.infer<typeof JsonrpcErrorObject>;
/** A response that indicates an error occurred. */
export declare const JsonrpcErrorResponse: z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
    error: z.ZodObject<{
        code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
        message: z.ZodString;
        data: z.ZodOptional<z.ZodUnknown>;
    }, z.core.$loose>;
}, z.core.$loose>;
export type JsonrpcErrorResponse = z.infer<typeof JsonrpcErrorResponse>;
/** A successful response or an error response. */
export declare const JsonrpcResponseOrError: z.ZodUnion<readonly [z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    result: z.ZodJSONSchema;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
    error: z.ZodObject<{
        code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
        message: z.ZodString;
        data: z.ZodOptional<z.ZodUnknown>;
    }, z.core.$loose>;
}, z.core.$loose>]>;
export type JsonrpcResponseOrError = z.infer<typeof JsonrpcResponseOrError>;
/** Any valid JSON-RPC message (request, notification, response, or error response). */
export declare const JsonrpcMessage: z.ZodUnion<readonly [z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    result: z.ZodJSONSchema;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
    error: z.ZodObject<{
        code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
        message: z.ZodString;
        data: z.ZodOptional<z.ZodUnknown>;
    }, z.core.$loose>;
}, z.core.$loose>]>;
export type JsonrpcMessage = z.infer<typeof JsonrpcMessage>;
/** Messages a client can send to a server (request or notification). */
export declare const JsonrpcMessageFromClientToServer: z.ZodUnion<readonly [z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>]>;
export type JsonrpcMessageFromClientToServer = z.infer<typeof JsonrpcMessageFromClientToServer>;
/** Messages a server can send to a client (notification, response, or error response). */
export declare const JsonrpcMessageFromServerToClient: z.ZodUnion<readonly [z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    method: z.ZodString;
    params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    result: z.ZodJSONSchema;
}, z.core.$loose>, z.ZodObject<{
    jsonrpc: z.ZodLiteral<"2.0">;
    id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
    error: z.ZodObject<{
        code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
        message: z.ZodString;
        data: z.ZodOptional<z.ZodUnknown>;
    }, z.core.$loose>;
}, z.core.$loose>]>;
export type JsonrpcMessageFromServerToClient = z.infer<typeof JsonrpcMessageFromServerToClient>;
//# sourceMappingURL=jsonrpc.d.ts.map