import type { ChannelNode } from "@copilotkit/channels-ui"; /** A Cloud API send payload (the body sans messaging_product/to, which the client adds). */ export type WhatsAppOutbound = { type: "text"; text: { body: string; preview_url: boolean; }; } | { type: "image"; image: { link?: string; id?: string; caption?: string; }; } | { type: "document"; document: { link?: string; id?: string; filename?: string; caption?: string; }; } | { type: "interactive"; interactive: InteractiveButton | InteractiveList; }; interface InteractiveButton { type: "button"; body: { text: string; }; action: { buttons: Array<{ type: "reply"; reply: { id: string; title: string; }; }>; }; } interface InteractiveList { type: "list"; body: { text: string; }; action: { button: string; sections: Array<{ title?: string; rows: Array<{ id: string; title: string; description?: string; }>; }>; }; } /** * Lower `ChannelNode[]` IR to Cloud API payload(s). * * Strategy: collect (a) the prose text from text/section/header/markdown/ * fields/table/context/divider nodes, and (b) actionable controls from * `button`/`select` nodes. Then decide a single shape: * - 0 actions → a text message (image nodes emitted separately). * - 1..3 button actions → interactive `button`. * - 4..10 actions → interactive `list`. * - >10 actions → numbered text menu (degraded). * Image nodes always emit their own image payload. */ export declare function renderWhatsAppMessage(ir: ChannelNode[]): WhatsAppOutbound[]; export {}; //# sourceMappingURL=message.d.ts.map