import type { JsonValue } from "@earendil-works/chord"; import Type, { type Static } from "typebox"; export declare const PROTOCOL_VERSION: 8; declare const ServerIdSchema: Type.TString; export type ServerId = Static; export declare function isServerId(value: unknown): value is ServerId; declare const ProtocolErrorSchema: Type.TObject<{ readonly code: Type.TString; readonly message: Type.TString; }>; export type ProtocolErrorCode = string; export type ProtocolError = Static; /** Must be the first frame sent by a client. */ declare const ClientHelloSchema: Type.TObject<{ readonly type: Type.TLiteral<"hello">; readonly version: Type.TInteger; }>; export type ClientHello = Static; /** A session call, fenced to one logical server, durable session, and live attachment. */ declare const SessionTargetSchema: Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>; export type SessionTarget = Static; declare const RpcTargetSchema: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; }>, Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>]>; export type RpcTarget = Static; declare const RequestEnvelopeSchema: Type.TObject<{ readonly type: Type.TLiteral<"request">; readonly id: Type.TString; readonly target: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; }>, Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>]>; readonly call: Type.TUnsafe; }>; declare const CancelEnvelopeSchema: Type.TObject<{ readonly type: Type.TLiteral<"cancel">; readonly id: Type.TString; readonly target: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; }>, Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>]>; }>; export type RequestEnvelope = Static; export type CancelEnvelope = Static; export declare const ClientMessageSchema: Type.TUnion<[Type.TObject<{ readonly type: Type.TLiteral<"hello">; readonly version: Type.TInteger; }>, Type.TObject<{ readonly type: Type.TLiteral<"request">; readonly id: Type.TString; readonly target: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; }>, Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>]>; readonly call: Type.TUnsafe; }>, Type.TObject<{ readonly type: Type.TLiteral<"cancel">; readonly id: Type.TString; readonly target: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; }>, Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>]>; }>]>; export type ClientMessage = Static; declare const ServerHelloSchema: Type.TObject<{ readonly type: Type.TLiteral<"hello">; readonly version: Type.TLiteral<8>; readonly serverId: Type.TString; }>; declare const ServerHelloErrorSchema: Type.TObject<{ readonly type: Type.TLiteral<"hello_error">; readonly error: Type.TObject<{ readonly code: Type.TString; readonly message: Type.TString; }>; }>; declare const ResponseEnvelopeSchema: Type.TUnion<[Type.TObject<{ readonly type: Type.TLiteral<"response">; readonly id: Type.TString; readonly ok: Type.TLiteral; readonly result: Type.TOptional>; }>, Type.TObject<{ readonly type: Type.TLiteral<"response">; readonly id: Type.TString; readonly ok: Type.TLiteral; readonly error: Type.TObject<{ readonly code: Type.TString; readonly message: Type.TString; }>; }>]>; declare const ServiceEventEnvelopeSchema: Type.TObject<{ readonly type: Type.TLiteral<"service_update">; readonly subscriptionId: Type.TString; readonly update: Type.TUnsafe; }>; /** Out-of-band update to this presentation's selected Session route. */ declare const AttachmentEnvelopeSchema: Type.TObject<{ readonly type: Type.TLiteral<"attachment">; readonly attachment: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>, Type.TNull]>; }>; export declare const ServerMessageSchema: Type.TUnion<[Type.TObject<{ readonly type: Type.TLiteral<"hello">; readonly version: Type.TLiteral<8>; readonly serverId: Type.TString; }>, Type.TObject<{ readonly type: Type.TLiteral<"hello_error">; readonly error: Type.TObject<{ readonly code: Type.TString; readonly message: Type.TString; }>; }>, Type.TUnion<[Type.TObject<{ readonly type: Type.TLiteral<"response">; readonly id: Type.TString; readonly ok: Type.TLiteral; readonly result: Type.TOptional>; }>, Type.TObject<{ readonly type: Type.TLiteral<"response">; readonly id: Type.TString; readonly ok: Type.TLiteral; readonly error: Type.TObject<{ readonly code: Type.TString; readonly message: Type.TString; }>; }>]>, Type.TObject<{ readonly type: Type.TLiteral<"service_update">; readonly subscriptionId: Type.TString; readonly update: Type.TUnsafe; }>, Type.TObject<{ readonly type: Type.TLiteral<"attachment">; readonly attachment: Type.TUnion<[Type.TObject<{ readonly serverId: Type.TString; readonly sessionId: Type.TString; readonly attachmentId: Type.TString; }>, Type.TNull]>; }>]>; export type ServerHello = Static; export type ServerHelloError = Static; export type ResponseEnvelope = Static; export type ServiceEventEnvelope = Static; export type AttachmentEnvelope = Static; export type ServerMessage = Static; export {}; //# sourceMappingURL=protocol.d.ts.map