@vellumai/assistant 0.4.11 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/ARCHITECTURE.md +401 -385
  2. package/package.json +1 -1
  3. package/src/__tests__/guardian-verify-setup-skill-regression.test.ts +75 -61
  4. package/src/__tests__/registry.test.ts +235 -187
  5. package/src/__tests__/secure-keys.test.ts +27 -0
  6. package/src/__tests__/session-agent-loop.test.ts +521 -256
  7. package/src/__tests__/session-surfaces-task-progress.test.ts +1 -0
  8. package/src/__tests__/session-tool-setup-app-refresh.test.ts +1 -0
  9. package/src/__tests__/session-tool-setup-memory-scope.test.ts +1 -0
  10. package/src/__tests__/session-tool-setup-side-effect-flag.test.ts +1 -0
  11. package/src/__tests__/skills.test.ts +334 -276
  12. package/src/__tests__/slack-skill.test.ts +124 -0
  13. package/src/__tests__/starter-task-flow.test.ts +7 -17
  14. package/src/agent/loop.ts +10 -3
  15. package/src/config/bundled-skills/chatgpt-import/tools/chatgpt-import.ts +449 -0
  16. package/src/config/bundled-skills/doordash/SKILL.md +171 -0
  17. package/src/config/bundled-skills/doordash/__tests__/doordash-client.test.ts +203 -0
  18. package/src/config/bundled-skills/doordash/__tests__/doordash-session.test.ts +164 -0
  19. package/src/config/bundled-skills/doordash/doordash-cli.ts +1193 -0
  20. package/src/config/bundled-skills/doordash/doordash-entry.ts +22 -0
  21. package/src/config/bundled-skills/doordash/lib/cart-queries.ts +787 -0
  22. package/src/config/bundled-skills/doordash/lib/client.ts +1071 -0
  23. package/src/config/bundled-skills/doordash/lib/order-queries.ts +85 -0
  24. package/src/config/bundled-skills/doordash/lib/queries.ts +28 -0
  25. package/src/config/bundled-skills/doordash/lib/query-extractor.ts +94 -0
  26. package/src/config/bundled-skills/doordash/lib/search-queries.ts +203 -0
  27. package/src/config/bundled-skills/doordash/lib/session.ts +93 -0
  28. package/src/config/bundled-skills/doordash/lib/shared/errors.ts +61 -0
  29. package/src/config/bundled-skills/doordash/lib/shared/ipc.ts +32 -0
  30. package/src/config/bundled-skills/doordash/lib/shared/network-recorder.ts +380 -0
  31. package/src/config/bundled-skills/doordash/lib/shared/platform.ts +35 -0
  32. package/src/config/bundled-skills/doordash/lib/shared/recording-store.ts +43 -0
  33. package/src/config/bundled-skills/doordash/lib/shared/recording-types.ts +49 -0
  34. package/src/config/bundled-skills/doordash/lib/shared/truncate.ts +6 -0
  35. package/src/config/bundled-skills/doordash/lib/store-queries.ts +246 -0
  36. package/src/config/bundled-skills/doordash/lib/types.ts +367 -0
  37. package/src/config/bundled-skills/google-calendar/SKILL.md +4 -5
  38. package/src/config/bundled-skills/google-oauth-setup/SKILL.md +41 -41
  39. package/src/config/bundled-skills/messaging/SKILL.md +59 -42
  40. package/src/config/bundled-skills/messaging/TOOLS.json +14 -92
  41. package/src/config/bundled-skills/messaging/tools/gmail-archive-by-query.ts +5 -1
  42. package/src/config/bundled-skills/messaging/tools/gmail-batch-archive.ts +11 -2
  43. package/src/config/bundled-skills/messaging/tools/gmail-outreach-scan.ts +8 -1
  44. package/src/config/bundled-skills/messaging/tools/gmail-sender-digest.ts +12 -4
  45. package/src/config/bundled-skills/messaging/tools/gmail-unsubscribe.ts +5 -1
  46. package/src/config/bundled-skills/messaging/tools/messaging-archive-by-sender.ts +5 -1
  47. package/src/config/bundled-skills/messaging/tools/messaging-sender-digest.ts +5 -2
  48. package/src/config/bundled-skills/notion/SKILL.md +240 -0
  49. package/src/config/bundled-skills/notion-oauth-setup/SKILL.md +127 -0
  50. package/src/config/bundled-skills/oauth-setup/SKILL.md +144 -0
  51. package/src/config/bundled-skills/phone-calls/SKILL.md +76 -45
  52. package/src/config/bundled-skills/skills-catalog/SKILL.md +32 -29
  53. package/src/config/bundled-skills/slack/SKILL.md +49 -0
  54. package/src/config/bundled-skills/slack/TOOLS.json +167 -0
  55. package/src/config/bundled-skills/slack/tools/shared.ts +23 -0
  56. package/src/config/bundled-skills/{messaging → slack}/tools/slack-add-reaction.ts +2 -5
  57. package/src/config/bundled-skills/slack/tools/slack-channel-details.ts +33 -0
  58. package/src/config/bundled-skills/slack/tools/slack-configure-channels.ts +75 -0
  59. package/src/config/bundled-skills/{messaging → slack}/tools/slack-delete-message.ts +2 -5
  60. package/src/config/bundled-skills/{messaging → slack}/tools/slack-leave-channel.ts +2 -5
  61. package/src/config/bundled-skills/slack/tools/slack-scan-digest.ts +193 -0
  62. package/src/config/{vellum-skills → bundled-skills}/sms-setup/SKILL.md +29 -22
  63. package/src/config/{vellum-skills → bundled-skills}/telegram-setup/SKILL.md +17 -14
  64. package/src/config/{vellum-skills → bundled-skills}/twilio-setup/SKILL.md +20 -5
  65. package/src/config/bundled-tool-registry.ts +292 -267
  66. package/src/config/schema.ts +1 -1
  67. package/src/daemon/handlers/skills.ts +334 -234
  68. package/src/daemon/ipc-contract/messages.ts +2 -0
  69. package/src/daemon/ipc-contract/surfaces.ts +2 -0
  70. package/src/daemon/lifecycle.ts +358 -221
  71. package/src/daemon/response-tier.ts +2 -0
  72. package/src/daemon/server.ts +453 -193
  73. package/src/daemon/session-agent-loop-handlers.ts +43 -2
  74. package/src/daemon/session-agent-loop.ts +3 -0
  75. package/src/daemon/session-lifecycle.ts +3 -0
  76. package/src/daemon/session-process.ts +1 -0
  77. package/src/daemon/session-surfaces.ts +22 -20
  78. package/src/daemon/session-tool-setup.ts +1 -0
  79. package/src/daemon/session.ts +5 -2
  80. package/src/messaging/outreach-classifier.ts +12 -5
  81. package/src/messaging/provider-types.ts +5 -0
  82. package/src/messaging/provider.ts +1 -1
  83. package/src/messaging/providers/gmail/adapter.ts +11 -5
  84. package/src/messaging/providers/gmail/client.ts +2 -0
  85. package/src/messaging/providers/slack/adapter.ts +1 -0
  86. package/src/messaging/providers/slack/client.ts +8 -0
  87. package/src/messaging/providers/slack/types.ts +5 -0
  88. package/src/runtime/http-errors.ts +33 -20
  89. package/src/runtime/http-server.ts +706 -291
  90. package/src/runtime/http-types.ts +26 -16
  91. package/src/runtime/routes/secret-routes.ts +57 -2
  92. package/src/runtime/routes/surface-action-routes.ts +66 -0
  93. package/src/runtime/routes/trust-rules-routes.ts +140 -0
  94. package/src/security/keychain-to-encrypted-migration.ts +59 -0
  95. package/src/security/secure-keys.ts +17 -0
  96. package/src/skills/frontmatter.ts +9 -7
  97. package/src/tools/apps/executors.ts +2 -1
  98. package/src/tools/tool-manifest.ts +44 -42
  99. package/src/tools/types.ts +9 -0
  100. package/src/__tests__/skill-mirror-parity.test.ts +0 -176
  101. package/src/config/vellum-skills/catalog.json +0 -63
  102. package/src/config/vellum-skills/chatgpt-import/tools/chatgpt-import.ts +0 -295
  103. package/src/skills/vellum-catalog-remote.ts +0 -166
  104. package/src/tools/skills/vellum-catalog.ts +0 -168
  105. /package/src/config/{vellum-skills → bundled-skills}/chatgpt-import/SKILL.md +0 -0
  106. /package/src/config/{vellum-skills → bundled-skills}/chatgpt-import/TOOLS.json +0 -0
  107. /package/src/config/{vellum-skills → bundled-skills}/deploy-fullstack-vercel/SKILL.md +0 -0
  108. /package/src/config/{vellum-skills → bundled-skills}/document-writer/SKILL.md +0 -0
  109. /package/src/config/{vellum-skills → bundled-skills}/guardian-verify-setup/SKILL.md +0 -0
  110. /package/src/config/{vellum-skills → bundled-skills}/slack-oauth-setup/SKILL.md +0 -0
  111. /package/src/config/{vellum-skills → bundled-skills}/trusted-contacts/SKILL.md +0 -0
@@ -2,7 +2,7 @@
2
2
  name: "SMS Setup"
3
3
  description: "Set up and troubleshoot SMS messaging with guided Twilio configuration, compliance, and verification"
4
4
  user-invocable: true
5
- metadata: {"vellum": {"emoji": "\ud83d\udce8"}}
5
+ metadata: { "vellum": { "emoji": "\ud83d\udce8" } }
6
6
  ---
7
7
 
8
8
  You are helping your user set up SMS messaging. This skill orchestrates Twilio setup, SMS-specific compliance, and end-to-end testing through a conversational flow.
@@ -30,7 +30,7 @@ If SMS baseline is not ready (missing credentials, phone number, or ingress), lo
30
30
  skill_load skill=twilio-setup
31
31
  ```
32
32
 
33
- Tell the user: *"SMS needs Twilio configured first. I've loaded the Twilio setup guide — let's walk through it."*
33
+ Tell the user: _"SMS needs Twilio configured first. I've loaded the Twilio setup guide — let's walk through it."_
34
34
 
35
35
  After twilio-setup completes, re-check readiness by calling the config endpoint again:
36
36
 
@@ -53,6 +53,7 @@ curl -s "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/twilio/sms/compliance" \
53
53
  ```
54
54
 
55
55
  Examine the compliance results:
56
+
56
57
  - If all checks pass, proceed to Step 4.
57
58
  - If compliance issues are found (e.g., toll-free verification needed), guide the user through the compliance flow.
58
59
 
@@ -71,18 +72,18 @@ The response includes a `compliance` object with `numberType`, `tollfreePhoneNum
71
72
 
72
73
  **Step 3b: Collect user information.** Collect the following from the user (assume individual/sole proprietor by default):
73
74
 
74
- | Field | `verificationParams` key | Notes |
75
- |---|---|---|
76
- | Name | `businessName` | Can be personal name |
77
- | Business type | `businessType` | Use `SOLE_PROPRIETOR` for individuals. Valid values: `PRIVATE_PROFIT`, `PUBLIC_PROFIT`, `SOLE_PROPRIETOR`, `NON_PROFIT`, `GOVERNMENT` |
78
- | Website | `businessWebsite` | LinkedIn or personal site is fine |
79
- | Notification email | `notificationEmail` | Where Twilio sends status updates |
80
- | Use case category | `useCaseCategories` | Array, e.g. `["ACCOUNT_NOTIFICATIONS"]` |
81
- | Use case summary | `useCaseSummary` | Plain English description |
82
- | Message volume | `messageVolume` | Must be one of: `10`, `100`, `1,000`, `10,000`, `100,000`, `250,000`, `500,000`, `750,000`, `1,000,000`, `5,000,000`, `10,000,000+` |
83
- | Sample message | `productionMessageSample` | A realistic example message |
84
- | Opt-in type | `optInType` | `VERBAL`, `WEB_FORM`, `PAPER_FORM`, `VIA_TEXT`, `MOBILE_QR_CODE` |
85
- | Opt-in image URL | `optInImageUrls` | Array of URLs showing opt-in mechanism (can be website URL) |
75
+ | Field | `verificationParams` key | Notes |
76
+ | ------------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
77
+ | Name | `businessName` | Can be personal name |
78
+ | Business type | `businessType` | Use `SOLE_PROPRIETOR` for individuals. Valid values: `PRIVATE_PROFIT`, `PUBLIC_PROFIT`, `SOLE_PROPRIETOR`, `NON_PROFIT`, `GOVERNMENT` |
79
+ | Website | `businessWebsite` | LinkedIn or personal site is fine |
80
+ | Notification email | `notificationEmail` | Where Twilio sends status updates |
81
+ | Use case category | `useCaseCategories` | Array, e.g. `["ACCOUNT_NOTIFICATIONS"]` |
82
+ | Use case summary | `useCaseSummary` | Plain English description |
83
+ | Message volume | `messageVolume` | Must be one of: `10`, `100`, `1,000`, `10,000`, `100,000`, `250,000`, `500,000`, `750,000`, `1,000,000`, `5,000,000`, `10,000,000+` |
84
+ | Sample message | `productionMessageSample` | A realistic example message |
85
+ | Opt-in type | `optInType` | `VERBAL`, `WEB_FORM`, `PAPER_FORM`, `VIA_TEXT`, `MOBILE_QR_CODE` |
86
+ | Opt-in image URL | `optInImageUrls` | Array of URLs showing opt-in mechanism (can be website URL) |
86
87
 
87
88
  The `tollfreePhoneNumberSid` is returned by the compliance status response in the `compliance` object. Use `compliance.tollfreePhoneNumberSid` from the Step 3a response as the value for `tollfreePhoneNumberSid` when submitting. Do NOT ask for EIN, business registration number, or business registration authority. Explain that Twilio labels some fields as "business" fields even for individual submitters.
88
89
 
@@ -140,6 +141,7 @@ curl -s -X DELETE "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/twilio/sms/complia
140
141
  After deletion, return to Step 3b to collect information and resubmit. Warn the user that deleting resets their position in the review queue.
141
142
 
142
143
  **Common errors:**
144
+
143
145
  - `"Customer profiles submitted with verifications must be either ISV Starters or Secondary Customer Profiles"` — The number is linked to a Primary Customer Profile in Trust Hub, which blocks toll-free verification. Tell the user and suggest they resolve the profile assignment in the Twilio Console.
144
146
  - Missing required fields — The endpoint validates and reports which fields are missing.
145
147
  - Invalid enum values — The endpoint validates `optInType`, `messageVolume`, and `useCaseCategories` and reports valid values.
@@ -152,19 +154,19 @@ After deletion, return to Step 3b to collect information and resubmit. Warn the
152
154
 
153
155
  Now link the user's phone number as the trusted SMS guardian. Tell the user: "Now let's verify your guardian identity for SMS. This links your phone number as the trusted guardian for SMS messaging."
154
156
 
155
- Install and load the **guardian-verify-setup** skill to handle the verification flow:
157
+ Load the **guardian-verify-setup** skill to handle the verification flow:
156
158
 
157
- - Call `vellum_skills_catalog` with `action: "install"` and `skill_id: "guardian-verify-setup"`.
158
- - Then call `skill_load` with `skill: "guardian-verify-setup"`.
159
+ - Call `skill_load` with `skill_id: "guardian-verify-setup"` to load the dependency skill.
159
160
 
160
161
  When invoking the skill, indicate the channel is `sms`. The guardian-verify-setup skill manages the full outbound verification flow, including:
162
+
161
163
  - Collecting the user's phone number as the destination (accepts any common format -- the API normalizes to E.164)
162
164
  - Starting the outbound verification session via the gateway endpoint `POST /v1/integrations/guardian/outbound/start` with `channel: "sms"`
163
165
  - Sending a 6-digit code to the phone number that the user must reply with from the SMS channel
164
166
  - Checking guardian status to confirm the binding was created
165
167
  - Handling resend, cancel, and error cases
166
168
 
167
- Tell the user: *"I've loaded the guardian verification guide. It will walk you through linking your phone number as the trusted SMS guardian."*
169
+ Tell the user: _"I've loaded the guardian verification guide. It will walk you through linking your phone number as the trusted SMS guardian."_
168
170
 
169
171
  **Note:** Guardian verification is optional but recommended. If the user declines or wants to skip, proceed to Step 4 without blocking.
170
172
 
@@ -172,7 +174,7 @@ Tell the user: *"I've loaded the guardian verification guide. It will walk you t
172
174
 
173
175
  Run a test SMS to verify end-to-end delivery:
174
176
 
175
- Tell the user: *"Let's send a test SMS to verify everything works. What phone number should I send the test to?"*
177
+ Tell the user: _"Let's send a test SMS to verify everything works. What phone number should I send the test to?"_
176
178
 
177
179
  **Important:** If toll-free verification is pending (not yet approved), inform the user that test messages may be silently dropped by carriers even though Twilio accepts them. Offer to attempt the test anyway, but set expectations.
178
180
 
@@ -189,7 +191,8 @@ curl -s -X POST "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/twilio/sms/test" \
189
191
  ```
190
192
 
191
193
  Report the result honestly:
192
- - If the send succeeds: *"The message was accepted by Twilio. Note: 'accepted' means Twilio received it for delivery, not that it reached the handset yet. Delivery can take a few seconds to a few minutes. If verification is still pending, carriers may silently drop the message."*
194
+
195
+ - If the send succeeds: _"The message was accepted by Twilio. Note: 'accepted' means Twilio received it for delivery, not that it reached the handset yet. Delivery can take a few seconds to a few minutes. If verification is still pending, carriers may silently drop the message."_
193
196
  - If the send fails: report the error and suggest troubleshooting steps
194
197
 
195
198
  ### SMS Diagnostics
@@ -209,7 +212,8 @@ This runs a comprehensive health diagnostic, checking channel readiness, complia
209
212
  After completing (or skipping) the test, present a clear summary:
210
213
 
211
214
  **If everything passed:**
212
- *"SMS is ready! Here's your setup status:"*
215
+ _"SMS is ready! Here's your setup status:"_
216
+
213
217
  - Twilio credentials: configured
214
218
  - Phone number: {number}
215
219
  - Ingress: configured
@@ -217,17 +221,20 @@ After completing (or skipping) the test, present a clear summary:
217
221
  - Test send: {result}
218
222
 
219
223
  **If there are blockers:**
220
- *"SMS setup is partially complete. Here's what still needs attention:"*
224
+ _"SMS setup is partially complete. Here's what still needs attention:"_
225
+
221
226
  - List each blocker with the specific next action
222
227
 
223
228
  ## Troubleshooting
224
229
 
225
230
  If the user returns to this skill after initial setup:
231
+
226
232
  1. Always start with Step 1 (readiness check) to assess current state
227
233
  2. Skip steps that are already complete
228
234
  3. Focus on the specific issue the user is experiencing
229
235
 
230
236
  Common issues:
237
+
231
238
  - **"Messages not delivering"** — Check compliance status (toll-free verification), verify the number isn't flagged
232
239
  - **"Twilio error on send"** — Check credentials, phone number assignment, and ingress
233
240
  - **"Trial account limitations"** — Explain that trial accounts can only send to verified numbers
@@ -3,7 +3,7 @@ name: "Telegram Setup"
3
3
  description: "Connect a Telegram bot to the Vellum Assistant gateway with automated webhook registration and credential storage"
4
4
  user-invocable: true
5
5
  includes: ["public-ingress"]
6
- metadata: {"vellum": {"emoji": "\ud83e\udd16"}}
6
+ metadata: { "vellum": { "emoji": "\ud83e\udd16" } }
7
7
  ---
8
8
 
9
9
  You are helping your user connect a Telegram bot to the Vellum Assistant gateway. Telegram webhooks are received exclusively by the gateway (the public ingress boundary) — they never hit the assistant runtime directly. When this skill is invoked, walk through each step below using only existing tools.
@@ -28,6 +28,7 @@ Before beginning setup, verify these conditions are met:
28
28
  ### Step 1: Collect the Bot Token Securely
29
29
 
30
30
  Collect the bot token through the secure credential prompt:
31
+
31
32
  - Call `credential_store` with `action: "prompt"`, `service: "telegram"`, `field: "bot_token"`, `label: "Telegram Bot Token"`, `description: "Enter the bot token you received from @BotFather"`, and `placeholder: "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"`.
32
33
 
33
34
  The token is collected securely via a system-level prompt and is never exposed in plaintext chat.
@@ -44,6 +45,7 @@ curl -sf -X POST "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/telegram/setup" \
44
45
  ```
45
46
 
46
47
  This endpoint automatically:
48
+
47
49
  - Retrieves the bot token from secure storage
48
50
  - Validates the token by calling the Telegram `getMe` API
49
51
  - Stores the bot token with bot username metadata
@@ -65,12 +67,12 @@ If the webhook secret changes (e.g., secret rotation), the gateway's credential
65
67
 
66
68
  Now link the user's Telegram account as the trusted guardian for this bot. Tell the user: "Now let's verify your guardian identity. This links your Telegram account as the trusted guardian for this bot."
67
69
 
68
- Install and load the **guardian-verify-setup** skill to handle the verification flow:
70
+ Load the **guardian-verify-setup** skill to handle the verification flow:
69
71
 
70
- - Call `vellum_skills_catalog` with `action: "install"` and `skill_id: "guardian-verify-setup"`.
71
- - Then call `skill_load` with `skill: "guardian-verify-setup"`.
72
+ - Call `skill_load` with `skill_id: "guardian-verify-setup"` to load the dependency skill.
72
73
 
73
74
  The guardian-verify-setup skill manages the full outbound verification flow for Telegram, including:
75
+
74
76
  - Collecting the user's Telegram chat ID or @handle as the destination
75
77
  - Starting the outbound verification session via the gateway endpoint `POST /v1/integrations/guardian/outbound/start` with `channel: "telegram"`
76
78
  - Handling the bootstrap deep-link flow when the user provides an @handle (the response includes a `telegramBootstrapUrl` that the user must click before receiving the code)
@@ -78,7 +80,7 @@ The guardian-verify-setup skill manages the full outbound verification flow for
78
80
  - Checking guardian status to confirm the binding was created
79
81
  - Handling resend, cancel, and error cases
80
82
 
81
- Tell the user: *"I've loaded the guardian verification guide. It will walk you through linking your Telegram account as the trusted guardian."*
83
+ Tell the user: _"I've loaded the guardian verification guide. It will walk you through linking your Telegram account as the trusted guardian."_
82
84
 
83
85
  After the guardian-verify-setup skill completes (or the user skips), continue to Step 5.
84
86
 
@@ -111,6 +113,7 @@ If the binding is absent and the user said they completed the verification:
111
113
  ### Step 7: Report Success
112
114
 
113
115
  Summarize what was done:
116
+
114
117
  - Bot verified and credentials stored securely
115
118
  - Webhook registration: handled automatically by the gateway
116
119
  - Bot commands registered: /new
@@ -136,17 +139,17 @@ These limitations apply to all Telegram bots regardless of configuration. Future
136
139
 
137
140
  The following steps are now **automated** by the gateway and CLI:
138
141
 
139
- | Step | Status | Details |
140
- |------|--------|---------|
141
- | Webhook registration | Automated | The gateway reconciles the webhook URL on startup and when credentials change |
142
+ | Step | Status | Details |
143
+ | --------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------- |
144
+ | Webhook registration | Automated | The gateway reconciles the webhook URL on startup and when credentials change |
142
145
  | Routing configuration | Automated (single-assistant) | The CLI sets `GATEWAY_UNMAPPED_POLICY=default` and `GATEWAY_DEFAULT_ASSISTANT_ID` automatically |
143
- | Credential detection | Automated | The gateway watches the credential vault for changes |
146
+ | Credential detection | Automated | The gateway watches the credential vault for changes |
144
147
 
145
148
  The following steps still require **manual** action:
146
149
 
147
- | Step | Details |
148
- |------|---------|
149
- | Bot token from @BotFather | User must create a bot and provide the token via secure prompt |
150
+ | Step | Details |
151
+ | ------------------------------------------ | -------------------------------------------------------------------------------------------------- |
152
+ | Bot token from @BotFather | User must create a bot and provide the token via secure prompt |
150
153
  | Bot configuration and command registration | Configured via the setup skill (Step 2 above) using the `/v1/integrations/telegram/setup` endpoint |
151
- | Guardian verification | Handled via the guardian-verify-setup skill using the outbound verification flow (Step 4 above) |
152
- | Multi-assistant routing | Requires manual `GATEWAY_ASSISTANT_ROUTING_JSON` configuration |
154
+ | Guardian verification | Handled via the guardian-verify-setup skill using the outbound verification flow (Step 4 above) |
155
+ | Multi-assistant routing | Requires manual `GATEWAY_ASSISTANT_ROUTING_JSON` configuration |
@@ -3,7 +3,7 @@ name: "Twilio Setup"
3
3
  description: "Configure Twilio credentials and phone numbers for voice calls and SMS messaging"
4
4
  user-invocable: true
5
5
  includes: ["public-ingress"]
6
- metadata: {"vellum": {"emoji": "\ud83d\udcf1"}}
6
+ metadata: { "vellum": { "emoji": "\ud83d\udcf1" } }
7
7
  ---
8
8
 
9
9
  You are helping your user configure Twilio for voice calls and SMS messaging. Twilio is the shared telephony provider for both the **phone-calls** and **SMS messaging** capabilities. When this skill is invoked, walk through each step below using the Twilio HTTP control-plane endpoints and existing tools.
@@ -30,6 +30,7 @@ For voice call setup after Twilio is configured, use `phone-calls` + `call_start
30
30
  ## Overview
31
31
 
32
32
  This skill manages the full Twilio lifecycle:
33
+
33
34
  - **Credential storage** — Account SID and Auth Token
34
35
  - **Phone number provisioning** — Buy a new number directly from Twilio
35
36
  - **Phone number assignment** — Assign an existing Twilio number to the assistant
@@ -42,16 +43,19 @@ All operations go through the Twilio HTTP control-plane endpoints on the gateway
42
43
  In a multi-assistant environment (multiple assistants sharing the same daemon), some actions are **assistant-scoped** while others are **global** (shared across all assistants):
43
44
 
44
45
  **Global actions** (ignore `assistantId` — credentials are shared across all assistants):
46
+
45
47
  - `POST /v1/integrations/twilio/credentials` — Stores Account SID and Auth Token in global secure storage (`credential:twilio:*` keys). All assistants share the same Twilio account credentials.
46
48
  - `DELETE /v1/integrations/twilio/credentials` — Removes the globally stored Account SID and Auth Token. This affects all assistants.
47
49
 
48
50
  **Assistant-scoped actions** (use `assistantId` query parameter to scope phone number configuration per assistant):
51
+
49
52
  - `GET /v1/integrations/twilio/config` — Returns the phone number assigned to the specified assistant.
50
53
  - `POST /v1/integrations/twilio/numbers/assign` — Assigns a phone number to a specific assistant via the per-assistant mapping.
51
54
  - `POST /v1/integrations/twilio/numbers/provision` — Provisions a new number and assigns it to the specified assistant.
52
55
  - `GET /v1/integrations/twilio/numbers` — Lists all phone numbers on the shared Twilio account (uses global credentials).
53
56
 
54
57
  Include `assistantId` as a query parameter in assistant-scoped requests whenever:
58
+
55
59
  - Multiple assistants share the same Twilio account but use different phone numbers
56
60
  - You want to ensure configuration changes only affect a specific assistant
57
61
  - The user has explicitly selected or referenced a particular assistant
@@ -69,6 +73,7 @@ curl -s "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/twilio/config" \
69
73
  ```
70
74
 
71
75
  The response includes:
76
+
72
77
  - `hasCredentials` — whether Account SID and Auth Token are stored
73
78
  - `phoneNumber` — the currently assigned phone number (if any)
74
79
 
@@ -124,6 +129,7 @@ curl -s -X POST "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/twilio/numbers/provi
124
129
  The endpoint provisions the number via the Twilio API, automatically assigns it to the assistant (persisting to both secure storage and config), and configures Twilio webhooks (voice, status callback, SMS) if a public ingress URL is available. The response includes the new `phoneNumber`. No separate assign call is needed.
125
130
 
126
131
  **Webhook auto-configuration:** When `ingress.publicBaseUrl` is configured, the endpoint automatically sets the following webhooks on the Twilio phone number:
132
+
127
133
  - Voice webhook: `{publicBaseUrl}/webhooks/twilio/voice`
128
134
  - Voice status callback: `{publicBaseUrl}/webhooks/twilio/status`
129
135
  - SMS webhook: `{publicBaseUrl}/webhooks/twilio/sms`
@@ -192,6 +198,7 @@ skill_load skill=public-ingress
192
198
  ```
193
199
 
194
200
  **Twilio webhook endpoints (auto-configured on provision/assign):**
201
+
195
202
  - Voice webhook: `{publicBaseUrl}/webhooks/twilio/voice`
196
203
  - Voice status callback: `{publicBaseUrl}/webhooks/twilio/status`
197
204
  - ConversationRelay WebSocket: `{publicBaseUrl}/webhooks/twilio/relay` (wss://)
@@ -210,6 +217,7 @@ curl -s "$INTERNAL_GATEWAY_BASE_URL/v1/integrations/twilio/config" \
210
217
  ```
211
218
 
212
219
  Confirm:
220
+
213
221
  - `hasCredentials` is `true`
214
222
  - `phoneNumber` is set to the expected number
215
223
 
@@ -219,12 +227,12 @@ Tell the user: **"Twilio is configured. Your assistant's phone number is {phoneN
219
227
 
220
228
  Now link the user's phone number as the trusted guardian for SMS and/or voice channels. Tell the user: "Now let's verify your guardian identity. This links your phone number as the trusted guardian for messaging and calls."
221
229
 
222
- Install and load the **guardian-verify-setup** skill to handle the verification flow:
230
+ Load the **guardian-verify-setup** skill to handle the verification flow:
223
231
 
224
- - Call `vellum_skills_catalog` with `action: "install"` and `skill_id: "guardian-verify-setup"`.
225
- - Then call `skill_load` with `skill: "guardian-verify-setup"`.
232
+ - Call `skill_load` with `skill_id: "guardian-verify-setup"` to load the dependency skill.
226
233
 
227
234
  The guardian-verify-setup skill manages the full outbound verification flow for **one channel at a time** (sms, voice, or telegram). Each invocation handles:
235
+
228
236
  - Collecting the user's phone number as the destination (accepts any common format -- the API normalizes to E.164)
229
237
  - Starting the outbound verification session via the gateway endpoint `POST /v1/integrations/guardian/outbound/start`
230
238
  - For **SMS**: sending a 6-digit code to the phone number that the user must reply with from the SMS channel
@@ -234,13 +242,14 @@ The guardian-verify-setup skill manages the full outbound verification flow for
234
242
 
235
243
  **If the user wants to verify both SMS and voice**, load the skill twice -- once for SMS and once for voice. Each channel requires its own separate verification session.
236
244
 
237
- Tell the user: *"I've loaded the guardian verification guide. It will walk you through linking your phone number as the trusted guardian. We'll verify one channel at a time."*
245
+ Tell the user: _"I've loaded the guardian verification guide. It will walk you through linking your phone number as the trusted guardian. We'll verify one channel at a time."_
238
246
 
239
247
  After the guardian-verify-setup skill completes verification for a channel, load it again for the next channel if needed. Once all desired channels are verified (or the user skips), continue to Step 6.
240
248
 
241
249
  **Note:** Guardian verification is optional but recommended. If the user declines or wants to skip, proceed to Step 6 without blocking.
242
250
 
243
251
  To re-check guardian status later, query the channel(s) that were verified:
252
+
244
253
  ```bash
245
254
  TOKEN=$(cat ~/.vellum/http-token)
246
255
  # Check SMS guardian status
@@ -258,6 +267,7 @@ Check the status for whichever channel(s) the user actually verified (SMS, voice
258
267
  Now that Twilio is configured, the user can enable the features that depend on it:
259
268
 
260
269
  **For voice calls:**
270
+
261
271
  ```bash
262
272
  vellum config set calls.enabled true
263
273
  ```
@@ -282,22 +292,27 @@ This removes the stored Account SID and Auth Token. Phone number assignments are
282
292
  ## Troubleshooting
283
293
 
284
294
  ### "Twilio credentials not configured"
295
+
285
296
  Run Steps 2 and 3 to store credentials and assign a phone number.
286
297
 
287
298
  ### "No phone number assigned"
299
+
288
300
  Run Step 3 to provision or assign a phone number.
289
301
 
290
302
  ### Phone number provisioning fails
303
+
291
304
  - Verify Twilio credentials are correct
292
305
  - On trial accounts, you may already have a free number — check "Active Numbers" in the Console
293
306
  - Ensure the Twilio account has sufficient balance for paid accounts
294
307
 
295
308
  ### Calls/SMS fail after setup
309
+
296
310
  - Verify public ingress is running (`ingress.publicBaseUrl` must be set)
297
311
  - For calls, ensure `calls.enabled` is `true`
298
312
  - On trial accounts, outbound calls and SMS can only reach verified numbers
299
313
 
300
314
  ### "Number not found" when assigning
315
+
301
316
  - The number must be owned by the same Twilio account
302
317
  - Use the list numbers endpoint to see available numbers
303
318
  - Ensure the number is in E.164 format (`+` followed by country code and number)