Skip to content

feat(sms): Twilio SMS integration#576

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feat/twilio-sms-integration
Feb 27, 2026
Merged

feat(sms): Twilio SMS integration#576
zbigniewsobiecki merged 1 commit intodevfrom
feat/twilio-sms-integration

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Registry/provider architecture — pluggable SmsIntegration / SmsProvider interfaces with AsyncLocalStorage scoping, mirroring the email integration pattern
  • Twilio adapter — outbound SMS via SendSms gadget; inbound webhook handler (POST /twilio/webhook/:projectId) with Twilio signature validation
  • Full credential flow — DB migration, integrationRoles.ts, tRPC verifyTwilio mutation, CLI integration-credential-* commands, dashboard 3-step wizard with copy-to-clipboard webhook URL and edit-mode pre-verification
  • Agent execution scoping — SMS provider scoped in all three agent execution paths (pm/webhook-handler, github/webhook-handler, manual-runner) and pre-execution integration validation

Changed files

Area Files
DB migration src/db/migrations/0020_sms_twilio_integration.sql, meta/_journal.json
Core SMS module src/sms/ (context, registry, integration, provider, types, twilio adapter)
Gadget src/gadgets/sms/ (SendSms, core/sendSms)
Inbound webhook src/router/adapters/twilio.ts, src/router/index.ts
Agent execution src/pm/webhook-handler.ts, src/triggers/github/webhook-handler.ts, src/triggers/shared/manual-runner.ts, src/triggers/shared/integration-validation.ts
Config / types src/config/integrationRoles.ts, src/agents/definitions/schema.ts
API src/api/routers/integrationsDiscovery.ts (verifyTwilio), src/api/routers/projects.ts
CLI src/cli/dashboard/projects/override-{rm,set,s}.ts
Repository src/db/repositories/settingsRepository.ts
Dashboard UI web/src/components/projects/twilio-wizard.tsx, web/src/components/projects/integration-form.tsx
Tests tests/unit/sms/, tests/unit/gadgets/sms/, tests/unit/router/adapters/twilio.test.ts, updated cli/db tests
Docs CLAUDE.md

Test plan

  • npm run typecheck — clean
  • npm run lint — clean
  • npm test — 206 files, 3483 tests, all passing (including 5 new SMS test files)
  • Manual: SMS tab in project settings shows wizard; credentials → verify → webhook URL appears → save persists
  • Manual: re-opening SMS tab shows all steps open, Step 2 pre-verified as "(existing integration)"
  • Manual: POST /twilio/webhook/<project-id> with valid Twilio signature returns 200 with empty <Response/>

🤖 Generated with Claude Code

Adds end-to-end SMS support via Twilio, following the same
registry/AsyncLocalStorage/credential-resolution patterns as the
email integration.

## Backend

- `src/sms/` — provider interface, registry, AsyncLocalStorage scoping,
  integration credential resolution, and Twilio adapter
- `src/gadgets/sms/SendSms` — LLMist gadget that agents call to send SMS
- `src/router/adapters/twilio.ts` — inbound webhook handler with
  Twilio signature validation (`POST /twilio/webhook/:projectId`)
- SMS provider scoped in all three agent execution paths:
  pm/webhook-handler, github/webhook-handler, manual-runner
- Pre-execution integration validation for agents that declare `sms`
  as a required integration

## Database

- Migration 0020: extends `chk_integration_category_provider` to
  include `sms/twilio`, and `chk_integration_credential_role` to
  include `account_sid`, `auth_token`, `phone_number`
- `getAllProjectIdsWithSmsIntegration()` in settingsRepository
  (mirrors email equivalent, ready for future SMS scheduler)

## API / CLI

- `integrationsDiscovery.verifyTwilio` tRPC mutation — validates
  Account SID + Auth Token against the Twilio API
- `projects.integrations.*` and `integrationCredentials.*` routers
  updated to accept `sms` category
- CLI `integration-credentials`, `integration-credential-set`,
  `integration-credential-rm` commands updated to include `sms`

## Dashboard UI

- `TwilioWizard` — 3-step accordion (credentials → verify → save)
  with inline credential creator, copy-to-clipboard webhook URL
  panel, and edit-mode pre-verification
- `IntegrationForm` — new SMS tab wired to TwilioWizard

## Tests

- Unit tests for SMS context, TwilioSmsProvider, TwilioIntegration,
  webhook handler, SendSms gadget, settingsRepository, and CLI commands
- 206 test files, all passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 01782dd into dev Feb 27, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feat/twilio-sms-integration branch February 27, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant