feat(voice): in-browser ElevenLabs widget + APP 8 modal + KB content packs#205
feat(voice): in-browser ElevenLabs widget + APP 8 modal + KB content packs#205
Conversation
… + KB packs Ships the production voice surface for Olivia (contractor onboarding) and Sarah/Tannika (claims intake) WITHOUT requiring a Twilio account. Both agents are already created + published live in the ElevenLabs dashboard — this PR adds the website-side surface so callers can talk to them in-browser. ## What's new - <VoiceWidget agent="olivia|sarah" /> three-phase widget: idle → APP 8 consent → live (or declined). Lazy-loads the EL widget script ONLY after consent grant. - <VoiceConsentModal> APP 8 cross-border-disclosure gate with the canonical CONSENT_UTTERANCE wording, version-pinned. - POST /api/voice/widget-consent logs consent to compliance_events with consentMethod='web_widget'. Never blocks UX on logging. - /contractor/apply mounts Olivia widget; /claim mounts Sarah widget. Both gated behind NEXT_PUBLIC_VOICE_WIDGET_ENABLED (default off). - VOICE_WIDGET added to feature-flags.ts registry. - 7 markdown KB content packs in docs/voice-knowledge-base/ for manual upload to EL Convai > Knowledge Base. ## Why widget instead of Twilio Phill is not signed up to Twilio. The widget approach: - Costs nothing extra (already paying for EL voice) - Works in any modern browser via mic permission - APP 8 consent runs as a React modal, identical wording to TwiML - Twilio scaffolding remains in repo for future use ## Activation Set NEXT_PUBLIC_VOICE_WIDGET_ENABLED=true in Vercel project settings, redeploy. To roll back: flip env var to false. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 30 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ DR Managed Agent CI/CD Pipeline — PASSEDDuration: 0.0s Managed Agent CI/CD pipeline skipped — ANTHROPIC_API_KEY not configured. Manual review required before merging. Full pipeline outputPowered by Anthropic Managed Agents (Research Preview) |
❌ Smoke tests FAILED — do not mergePreview URL: https://disaster-recovery-pd1y3q1fi-unite-group.vercel.app
|
#207) Adds 15 characterisation tests covering compliance event writer and observability primitives, taking the project from 15 to ~30 vitest tests (DR-791, halfway to the 40-test goal). Compliance (10 tests in events.test.ts): - ENABLED-path write behaviour with isolated module re-imports - entityIdentifier (raw email PII) is SHA-256 hashed before persist - breach_suspected + data_deletion_request event types resolve - amountCents + amountCurrency optional fields surface in the call - occurredAt falls back to a current Date when not provided - consentMethod 'web_widget' (PR #205) recognised; type-level exhaustiveness probe on ComplianceConsentMethod and ComplianceEventType via @ts-expect-error. Observability (5 tests in new observability.test.ts): - requestLogger returns info/warn/error + string requestId - requestId is unique per call when no header is supplied - bound context (requestId + route) lands in the structured log line - captureException tolerates Error/string/undefined/object/null/number - captureException does not crash with PII-shaped extras (redaction is a separate, layered concern per .claude/rules/privacy.md §3). Prisma is mocked via vi.mock — no real DB calls. No new runtime deps. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Ships the production voice surface for Olivia (contractor onboarding) and Sarah/Tannika (claims intake) — without requiring a Twilio account. Both agents are already published live in the ElevenLabs dashboard; this PR adds the website-side surface.
What's new
Components
API
Wiring
Knowledge base content packs
`docs/voice-knowledge-base/` — 7 markdown files designed for manual upload to EL Convai → Knowledge Base:
All KB content is PUBLIC class per privacy.md §1 — no rates, no contractor identities, no client PII, no internal SOPs.
Why widget instead of Twilio
Phill is not signed up to Twilio. The widget approach:
Activation
```
Vercel project settings → environment → production
NEXT_PUBLIC_VOICE_WIDGET_ENABLED=true
```
Then redeploy. Rollback = flip the env var to false (no code change, no redeploy).
Manual deploy step (one-time, post-merge)
Upload the 7 KB markdown files to ElevenLabs Convai → Agents → Knowledge Base for Olivia and Tannika. See `docs/voice-knowledge-base/README.md` for the click-by-click instructions.
Test plan
Out of scope
🤖 Generated with Claude Code