import { z } from 'zod'; export declare const BRIDGE_PROTOCOL = "easyeda-mcp-pro.bridge"; export declare const BRIDGE_CLIENT_NAME = "easyeda-mcp-pro"; export declare const BRIDGE_CONTRACT_VERSION = 1; /** Supported protocol versions for the bridge pairing/handshake. */ export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly ["1.0.0"]; export declare const CURRENT_PROTOCOL_VERSION: "1.0.0"; /** * Zod schema for the initial handshake message. * Client → Server: identifies the client and its protocol version. */ export declare const BridgeHandshakeSchema: z.ZodObject<{ type: z.ZodLiteral<"handshake">; protocol: z.ZodLiteral<"easyeda-mcp-pro.bridge">; protocolVersion: z.ZodEnum<{ "1.0.0": "1.0.0"; }>; clientName: z.ZodLiteral<"easyeda-mcp-pro">; contractVersion: z.ZodDefault>; extensionVersion: z.ZodOptional; easyedaVersion: z.ZodOptional; devMode: z.ZodOptional; sessionToken: z.ZodOptional; methodListHash: z.ZodOptional; loaderVersion: z.ZodOptional; }, z.core.$strip>; /** * Server → Client: issued before handshake when the bridge requires * a pairing proof-of-possession (non-loopback + BRIDGE_TOKEN set). */ export declare const BridgePairingChallengeSchema: z.ZodObject<{ type: z.ZodLiteral<"pairing_challenge">; challenge: z.ZodString; }, z.core.$strip>; /** * Client → Server: response to a pairing challenge. * The client echoes the challenge and supplies the session token. */ export declare const BridgePairingResponseSchema: z.ZodObject<{ type: z.ZodLiteral<"pairing_response">; challenge: z.ZodString; sessionToken: z.ZodString; }, z.core.$strip>; /** * Zod schema for the hello message. * Server → Client: sent after successful handshake/pairing to announce * bridge capabilities, version info, and the method registry hash. */ export declare const BridgeHelloSchema: z.ZodObject<{ type: z.ZodLiteral<"hello">; bridgeVersion: z.ZodString; contractVersion: z.ZodLiteral<1>; supportedProtocolVersions: z.ZodArray>; easyedaVersion: z.ZodOptional; apiVersion: z.ZodOptional; capabilities: z.ZodArray; methodRegistryHash: z.ZodString; devMode: z.ZodBoolean; maxPayloadSize: z.ZodOptional; supportsChunking: z.ZodOptional; maxAggregatePayloadSize: z.ZodOptional; hotSwapEnabled: z.ZodOptional; }, z.core.$strip>; /** * Zod schema for an RPC request message. * Client → Server: invokes a named method with optional parameters. */ export declare const BridgeRequestSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"request">; method: z.ZodString; params: z.ZodOptional; timeoutMs: z.ZodOptional; traceparent: z.ZodOptional; }, z.core.$strip>; /** * Zod schema for an RPC response message. * Server → Client: carries the result or a structured error. */ export declare const BridgeResponseSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"response">; ok: z.ZodBoolean; result: z.ZodOptional; error: z.ZodOptional; message: z.ZodString; suggestion: z.ZodString; data: z.ZodOptional; easyedaVersion: z.ZodOptional; }, z.core.$strip>>; durationMs: z.ZodNumber; }, z.core.$strip>; /** * Zod schema for a heartbeat keep-alive message. * Both directions: ensures the WebSocket connection is still alive. */ export declare const BridgeHeartbeatSchema: z.ZodObject<{ type: z.ZodLiteral<"heartbeat">; timestamp: z.ZodNumber; source: z.ZodOptional>; }, z.core.$strip>; /** Inferred TypeScript type for a hello message. */ export type BridgeHello = z.infer; /** * Inferred TypeScript type for a response message with typed result. * @template TResult - The shape of the successful result payload. */ export type BridgeResponse = Omit, 'result' | 'error'> & { result?: TResult; error?: { code: string; message: string; suggestion: string; data?: unknown; easyedaVersion?: string; }; };