import type { PlatformAdapter, SurfaceCapabilities, IngressSink, InteractionEvent, RunRenderer, ConversationStore, UserQuery } from "@copilotkit/channels-core"; import type { ChannelNode, MessageRef, ProviderActor, ThreadMessage } from "@copilotkit/channels-ui"; import type { ReplyTarget, WhatsAppAdapterOptions } from "./types.js"; import { WhatsAppClient } from "./client.js"; import type { WhatsAppOutbound } from "./render/message.js"; /** Factory mirroring `slack(opts)`. */ export declare function whatsapp(opts: WhatsAppAdapterOptions): WhatsAppAdapter; export declare class WhatsAppAdapter implements PlatformAdapter { private readonly opts; readonly platform = "whatsapp"; readonly capabilities: SurfaceCapabilities; readonly ackDeadlineMs = 5000; readonly conversationStore: ConversationStore; client: WhatsAppClient; private readonly history; private readonly server; private readonly port; private readonly commandPrefix; private readonly interruptEventNames?; private readonly waStore; private sink; constructor(opts: WhatsAppAdapterOptions); start(sink: IngressSink): Promise; stop(): Promise; private onWebhook; render(ir: ChannelNode[]): WhatsAppOutbound[]; post(target: ReplyTarget, ir: ChannelNode[]): Promise; update(ref: MessageRef, ir: ChannelNode[]): Promise; stream(target: ReplyTarget, chunks: AsyncIterable): Promise; delete(_ref: MessageRef): Promise; createRunRenderer(target: ReplyTarget): RunRenderer; decodeInteraction(raw: unknown): InteractionEvent | undefined; lookupUser(_q: UserQuery): Promise; getMessages(target: ReplyTarget): Promise; postFile(target: ReplyTarget, args: { bytes: Uint8Array; filename: string; title?: string; altText?: string; }): Promise<{ ok: boolean; fileId?: string; error?: string; }>; /** Send agent/freeform text: convert markdown to WhatsApp formatting, split to ≤bodyText chunks. */ private sendText; /** * Record an outbound message in history keyed by its WhatsApp id, so a later * quote-reply to it (the webhook sends only the quoted id) resolves to this * text. Best-effort: no id or no text → skip. Errors are swallowed so a * history write can never break a send. */ private recordOutbound; } /** Split text into chunks no longer than `max` characters. */ export declare function splitForWhatsApp(text: string, max: number): string[]; //# sourceMappingURL=adapter.d.ts.map