/** * v0.4 wire-format types. Mirrors the A2A protocol Part/Message shape per the * parent plan ("Part shape: flat, no `kind` discriminator"). * * NOTE: These are the on-wire shapes. SDK constructor helpers in envelope.ts * may accept richer input and normalize to these shapes before serialization. */ export type Role = "user" | "agent"; /** * Flat Part. Exactly one of {text, data, url, raw} MUST be present; the * presence selects the variant. mediaType is REQUIRED for data/url/raw * variants, OPTIONAL for text (defaults to "text/plain" if omitted). */ export interface Part { text?: string; data?: unknown; url?: string; raw?: Uint8Array; mediaType?: string; filename?: string; metadata?: Record; } export interface Message { messageId: string; role: Role; parts: Part[]; taskId?: string; contextId?: string; metadata?: Record; }