Skip to content

MaelstromResponseMessageSchema

const MaelstromResponseMessageSchema: ZodObject<{ requestId: ZodPipe<ZodString, ZodTransform<MessageId, string>>; response: ZodObject<{ executionPlan: ZodArray<ZodObject<{ action: ZodPipe<ZodString, ZodTransform<ActionName, string>>; instanceId: ZodPipe<ZodString, ZodTransform<InstanceId, string>>; params: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; }, $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">; rationale: ZodString; requestId: ZodPipe<ZodString, ZodTransform<MessageId, string>>; type: ZodLiteral<"maelstrom_response">; userMessage: ZodString; }, $strip>; sessionId: ZodOptional<ZodPipe<ZodString, ZodTransform<SessionId, string>>>; type: ZodLiteral<"engine.maelstrom.response">; }, $strip>

Defined in: packages/protocol/src/lib/envelope.ts:235

Wire-format Zod parser for MaelstromResponseMessage. Validates the discriminator, the branded requestId, the optional sessionId, and the inner MaelstromResponse payload in one pass.