/** * WhatsApp pairing service — manages Baileys sessions for QR code authentication. * * This service is separate from `@elizaos/plugin-whatsapp` because the plugin * initializes during runtime startup (too late for interactive QR flow). * Once pairing succeeds, the auth state is persisted to disk so the plugin * can reconnect automatically on subsequent startups. */ /** Validate accountId to prevent path traversal. Only allows alphanumeric, dash, underscore. */ export declare function sanitizeAccountId(raw: string): string; export type WhatsAppPairingStatus = "idle" | "initializing" | "waiting_for_qr" | "connected" | "disconnected" | "timeout" | "error"; export interface WhatsAppPairingEvent { type: "whatsapp-qr" | "whatsapp-status"; accountId: string; qrDataUrl?: string; expiresInMs?: number; status?: WhatsAppPairingStatus; phoneNumber?: string; error?: string; } export interface WhatsAppPairingOptions { authDir: string; accountId: string; onEvent: (event: WhatsAppPairingEvent) => void; } export declare class WhatsAppPairingSession { private socket; private status; private options; private qrAttempts; private readonly MAX_QR_ATTEMPTS; private restartTimer; constructor(options: WhatsAppPairingOptions); start(): Promise; stop(): void; getStatus(): WhatsAppPairingStatus; private setStatus; } export declare function whatsappAuthExists(workspaceDir: string, accountId?: string): boolean; export declare function whatsappLogout(workspaceDir: string, accountId?: string): Promise; //# sourceMappingURL=whatsapp-pairing.d.ts.map