feat(FN-3713): migrate WhatsApp plugin to Baileys pairing flow

- Add Baileys-based connection/auth modules and pairing route support for QR, pair code, status, and logout
- Refactor plugin entrypoint and split reply/auth/connection logic into focused modules
- Update plugin metadata/docs/settings schema to pairing-era configuration and remove legacy webhook key usage
- Add targeted tests for auth state, connection handling, reply flow, and updated schema expectations

Fusion-Task-Id: FN-3713
This commit is contained in:
Fusion
2026-05-07 18:26:08 -07:00
committed by gsxdsm
parent 2e3be32f1b
commit ef7efd0c96
18 changed files with 1438 additions and 408 deletions

View File

@@ -71,7 +71,7 @@ Expected outcome: You have a terminal view of installed plugins for scripting/re
Expected outcome: Plugin is registered and appears with an initial state (typically `installed` then `started` when enabled/loaded).
> WhatsApp Chat plugin note: You must configure Meta WhatsApp Cloud credentials (`verifyToken`, `appSecret`, `accessToken`, `phoneNumberId`) and point Meta webhooks at `/api/plugins/fusion-plugin-whatsapp-chat/webhook`. Only configured/allowed senders will receive agent replies, and message IDs are deduplicated for webhook retry safety.
> WhatsApp Chat plugin note: Pair it directly to WhatsApp Web (multi-device) via QR (`/api/plugins/fusion-plugin-whatsapp-chat/qr`) or pairing code (`/api/plugins/fusion-plugin-whatsapp-chat/pair-code`). No public webhook endpoint or Meta Cloud credentials are required. Keep `allowedSenders` populated (empty list blocks all inbound messages), and use `/logout` to force re-pairing.
### Install from local path (dashboard)