wacrm/src/lib/flows
Arnas Donauskas 78b42dfba9 feat: WhatsApp interactive messages (reply buttons + lists)
Add full support for WhatsApp Cloud API interactive messages across the
inbox, automations, and a new quick-replies feature. Extends the
interactive plumbing that previously existed only for the Flows engine.

Sending
- send-message core handles `interactive` (reply buttons ≤3, list ≤10
  rows) via the existing Meta senders; validated server-side before send.
- Inbox composer gains a "+" menu → builder dialog with live WhatsApp-style
  preview + Meta char limits (button 20, list row 24, body 1024).
- Automation "Send Buttons" / "Send List" steps in the builder.
- Public v1 /messages accepts type=interactive.

Storage / round-trip
- migration 035: messages.interactive_payload JSONB + quick_replies table.
- Outbound interactive persists the structured payload (composer,
  automations, and Flows) so the thread re-renders the buttons/rows.

Receiving
- Bubble renders outbound interactive via the shared preview; inbound taps
  (button_reply/list_reply) keep the "chosen option" affordance.

Automations
- New `interactive_reply` trigger matches on tapped button/list IDs
  (exact), enabling chained multi-step menus.

Quick replies
- New account-scoped quick_replies (text or interactive snippets), managed
  in Settings and insertable from the composer; "Save as quick reply" in
  the builder.

Shared core in src/lib/whatsapp/interactive.ts + src/components/interactive/.
Includes unit tests for the validator, send-param validation, the
interactive_reply trigger match, and the new automation step/trigger
validation. typecheck + lint clean; full suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 19:03:15 +03:00
..
admin-client.ts feat(flows): foundation for interactive WhatsApp messages (PR 1/4) 2026-05-22 13:12:27 +03:00
edges.test.ts feat(flows): canvas / mind-map view (PR 2b of 3 — full editing) 2026-05-29 20:32:59 +02:00
edges.ts feat(flows): canvas / mind-map view (PR 2b of 3 — full editing) 2026-05-29 20:32:59 +02:00
engine.test.ts feat(flows): add send_media node for image / video / document sends 2026-05-29 19:11:29 +02:00
engine.ts feat(webhook,engines): account-scoped routing 2026-05-31 18:45:48 +03:00
fallback.test.ts feat(flows): runner engine + webhook integration + agent-handoff + cron sweep (PR 2/4) 2026-05-22 13:36:39 +03:00
fallback.ts feat(flows): runner engine + webhook integration + agent-handoff + cron sweep (PR 2/4) 2026-05-22 13:36:39 +03:00
layout.test.ts feat(flows): canvas / mind-map view (PR 1 of 3 — read-only) 2026-05-29 19:41:37 +02:00
layout.ts feat(flows): canvas / mind-map view (PR 1 of 3 — read-only) 2026-05-29 19:41:37 +02:00
meta-send.ts feat: WhatsApp interactive messages (reply buttons + lists) 2026-07-08 19:03:15 +03:00
templates.ts feat(flows): templates + v1.5 nodes (collect_input/condition/set_tag) + run-history viewer (PR 4/4) 2026-05-22 14:27:01 +03:00
types.ts feat(webhook,engines): account-scoped routing 2026-05-31 18:45:48 +03:00
validate.test.ts feat(flows): add send_media node for image / video / document sends 2026-05-29 19:11:29 +02:00
validate.ts feat(flows): add send_media node for image / video / document sends 2026-05-29 19:11:29 +02:00