Skip to content

AgentEventMessageSchema

const AgentEventMessageSchema: ZodObject<{ event: ZodDiscriminatedUnion<[ZodObject<{ inputId: ZodPipe<ZodString, ZodTransform<MessageId, string>>; text: ZodString; type: ZodLiteral<"placeholder">; version: ZodLiteral<1>; }, $strip>, ZodObject<{ ack: ZodString; disposition: ZodEnum<{ agent: "agent"; amend: "amend"; answer: "answer"; independent: "independent"; noise: "noise"; supersede: "supersede"; ui_only: "ui_only"; }>; inputId: ZodPipe<ZodString, ZodTransform<MessageId, string>>; runId: ZodNullable<ZodPipe<ZodString, ZodTransform<RunId, string>>>; type: ZodLiteral<"accepted">; version: ZodLiteral<1>; }, $strip>, ZodObject<{ delta: ZodString; runId: ZodPipe<ZodString, ZodTransform<RunId, string>>; turnId: ZodString; type: ZodLiteral<"message">; version: ZodLiteral<1>; }, $strip>], "type">; id: ZodPipe<ZodString, ZodTransform<MessageId, string>>; sessionId: ZodPipe<ZodString, ZodTransform<SessionId, string>>; type: ZodLiteral<"engine.agent.event">; }, $strip>

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

Wire-format Zod parser for AgentEventMessage. Validates the discriminator, the branded id / sessionId, and the inner AgentEvent, including its version.