Switchbordswitchbord
v0.18.81

v0.18.81 — Website widget: GBCA AI replies (tawk.to replacement)

The website chat widget can now pipe visitor messages into your own GBCA AI agent — draft-for-review or full auto-send until a human takes over — plus live inbox delivery, unread badges, adaptive polling, and author labels in the visitor UI.

Added


  • Per-widget AI mode (GBCA). Each website widget now has an AI agent setting in Settings → Integrations → Channels → Website widget: Off (operators handle every message), Draft (the GBCA agent drafts a reply for operator review on every visitor message), or Auto-send (the agent replies automatically until a human operator takes over). This is the tawk.to replacement path: unlike tawk.to's built-in RAG bot, the widget pipes conversations into your own connected agent with the same draft/approval machinery used for WhatsApp.
  • Live inbox delivery for widget messages. Visitor messages now fire the workspace realtime broadcast, so operators watching the inbox see website chats appear instantly instead of on the next refresh.
  • Visitor-facing author labels. Replies in the widget show who answered — the operator's author label or the AI agent's name — instead of a generic "Team".
  • Unread badge + smarter polling. The launcher bubble shows an unread count when replies arrive while the chat is closed; the widget polls faster while open, slower when closed, and pauses entirely in hidden tabs. Enter sends, Shift+Enter adds a newline.

Security & abuse hardening


  • Widget-triggered AI runs enforce a minimum 5-second scheduling debounce regardless of workspace settings, on top of the existing per-workspace public API rate limit, so rapid-fire visitor messages coalesce into a single agent run instead of amplifying model spend.
  • Auto-send authority is re-checked against the widget's own settings at send time (fail closed), and any human operator reply in the conversation stops autonomous sends.
  • Website-widget conversations never enqueue WhatsApp/Meta dispatch anywhere in the pipeline.

Verification


  • pnpm --filter @repo/database test, pnpm --filter worker test, pnpm --filter api test, targeted apps/app vitest suites — all green.
  • pnpm --filter app exec tsc --noEmit, pnpm --filter api exec tsc --noEmit, pnpm lint, pnpm audit:i18n — all clean.
  • Independent adversarial review of the enqueue/auto-send path (workspace scoping, fail-closed gates, legacy-job isolation, flood cost analysis) with findings addressed.