UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

32 lines • 1.77 kB
import { type ChannelFetch } from '../http.js'; import type { ChannelAdapter } from '../types.js'; export interface WhatsappCloudOptions { /** The business phone number's id (WhatsApp Manager → API setup) — not the number itself. */ phoneNumberId: string; /** A system-user (or temporary) access token with `whatsapp_business_messaging`. */ accessToken: string; /** The Meta app's secret: `X-Hub-Signature-256` is an HMAC of the raw body under it. */ appSecret: string; /** The "Verify token" typed into the app's webhook settings, echoed by the subscription check. */ verifyToken: string; /** Graph API version. Default `'v23.0'`. */ graphVersion?: string; /** The adapter's name — the dedupe prefix and the decision's `via`. Default `'whatsapp'`. */ name?: string; /** Per-request timeout. Default 20 s. */ timeoutMs?: number; fetch?: ChannelFetch; } /** * WhatsApp through Meta's [Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api). * Route both `GET` (the subscription check) and `POST` (messages) to the same handler, and subscribe * the app to the `messages` field. * * Verifies `X-Hub-Signature-256` over the raw body; reads text, interactive button/list replies, * template quick replies and media (image, audio, video, document, sticker — downloaded through the * Graph API media endpoint) addressed to `phoneNumberId` (status updates are ignored); sends text, * interactive reply buttons (at most 3, 20-character titles, with a footer) and files (image, * document, audio, video — by link, or uploaded first when given as bytes). */ export declare function whatsappCloud(options: WhatsappCloudOptions): ChannelAdapter; //# sourceMappingURL=whatsapp_cloud.d.ts.map