Skip to content

ChartRequestMessageSchema

const ChartRequestMessageSchema: ZodObject<{ id: ZodPipe<ZodString, ZodTransform<MessageId, string>>; request: ZodObject<{ context: ZodObject<{ chartDimensions: ZodObject<{ columns: ZodNumber; rows: ZodNumber; }, $strip>; layoutMode: ZodEnum<{ grid: "grid"; tiling: "tiling"; }>; updateReasons: ZodArray<ZodDiscriminatedUnion<[ZodObject<{ intent: …; type: …; }, $strip>, ZodObject<{ current: …; previous: …; type: …; }, $strip>, ZodObject<{ changes: …; instanceId: …; type: …; }, $strip>], "type">>; }, $strip>; instances: ZodArray<ZodObject<{ instanceId: ZodPipe<ZodString, ZodTransform<InstanceId, string>>; variant: ZodPipe<ZodString, ZodTransform<VariantName, string>>; vesselId: ZodPipe<ZodString, ZodTransform<VesselId, string>>; }, $strip>>; layout: ZodDiscriminatedUnion<[ZodObject<{ positions: ZodArray<ZodObject<{ instanceId: …; position: …; size: …; }, $strip>>; type: ZodLiteral<"grid">; }, $strip>, ZodObject<{ instances: ZodArray<ZodObject<{ instanceId: …; variant: …; vesselId: …; }, $strip>>; tree: ZodArray<ZodPipe<ZodNullable<…>, ZodTransform<…, …>>>; type: ZodLiteral<"tiling">; }, $strip>], "type">; type: ZodLiteral<"chart_request">; vessels: ZodArray<ZodObject<{ defaultVariant: ZodPipe<ZodString, ZodTransform<VariantName, string>>; description: ZodString; id: ZodPipe<ZodString, ZodTransform<VesselId, string>>; name: ZodString; variants: ZodRecord<ZodPipe<ZodString, ZodTransform<VariantName, string>>, ZodObject<{ actions: ZodArray<…>; description: ZodOptional<…>; minSize: ZodObject<…, …>; props: ZodRecord<…, …>; }, $strip>>; }, $strip>>; }, $strip>; sessionId: ZodPipe<ZodString, ZodTransform<SessionId, string>>; timestamp: ZodNumber; type: ZodLiteral<"chart_request">; }, $strip>

Defined in: packages/protocol/src/lib/engine-message.ts:128

Wire-format Zod parser for ChartRequestMessage envelopes. Validates the discriminator, all envelope-level fields (sessionId, id, timestamp), and the inner ChartRequest payload in a single pass.