chat 4.29.0 → 4.31.0

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 (43) hide show
  1. package/README.md +31 -5
  2. package/dist/adapters/index.d.ts +594 -0
  3. package/dist/adapters/index.js +751 -0
  4. package/dist/ai/index.d.ts +3 -3
  5. package/dist/{chat-D9UYaaNO.d.ts → chat-BjhJs_sP.d.ts} +10 -8
  6. package/dist/{chunk-V25FKIIL.js → chunk-LNXHNIFE.js} +2 -0
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.js +15 -10
  9. package/dist/{jsx-runtime-CFq1K_Ve.d.ts → jsx-runtime-CzthIo1o.d.ts} +6 -1
  10. package/dist/jsx-runtime.d.ts +1 -1
  11. package/dist/jsx-runtime.js +1 -1
  12. package/docs/adapters.mdx +140 -127
  13. package/docs/ai/index.mdx +6 -0
  14. package/docs/api/cards.mdx +8 -1
  15. package/docs/api/message.mdx +5 -1
  16. package/docs/cards.mdx +9 -1
  17. package/docs/concurrency.mdx +1 -1
  18. package/docs/contributing/building.mdx +6 -0
  19. package/docs/conversation-history.mdx +1 -1
  20. package/docs/create-chat-sdk.mdx +143 -0
  21. package/docs/error-handling.mdx +1 -1
  22. package/docs/getting-started.mdx +7 -3
  23. package/docs/index.mdx +3 -1
  24. package/docs/meta.json +5 -1
  25. package/docs/platform-adapters.mdx +148 -0
  26. package/docs/slack-primitives.mdx +320 -0
  27. package/docs/slash-commands.mdx +6 -1
  28. package/docs/streaming.mdx +1 -1
  29. package/docs/teams-primitives.mdx +255 -0
  30. package/docs/testing.mdx +1 -1
  31. package/docs/threads-messages-channels.mdx +2 -2
  32. package/docs/usage.mdx +3 -3
  33. package/package.json +24 -5
  34. package/resources/guides/create-a-discord-support-bot-with-nuxt-and-redis.md +5 -1
  35. package/resources/guides/how-to-build-a-slack-bot-with-next-js-and-redis.md +5 -1
  36. package/resources/guides/human-in-the-loop-with-chat-sdk-and-workflow-sdk.md +176 -0
  37. package/resources/guides/liveblocks-chat-sdk-ai-sdk.md +165 -0
  38. package/resources/guides/run-and-track-deploys-from-slack.md +7 -5
  39. package/resources/guides/ship-a-github-code-review-bot-with-hono-and-redis.md +5 -1
  40. package/resources/guides/slack-bot-vercel-blob.md +254 -0
  41. package/resources/guides/triage-form-submissions-with-chat-sdk.md +3 -1
  42. package/resources/templates.json +5 -0
  43. /package/docs/{state.mdx → state-adapters.mdx} +0 -0
@@ -0,0 +1,751 @@
1
+ // src/adapters/index.ts
2
+ var env = (key, description, options = {}) => ({
3
+ ...options.aliases ? { aliases: options.aliases } : {},
4
+ description,
5
+ key,
6
+ secret: options.secret ?? false
7
+ });
8
+ var urlEnv = (key, description, options = {}) => env(key, description, options);
9
+ var secretEnv = (key, description, options = {}) => env(key, description, { ...options, secret: true });
10
+ var redisUrlEnv = urlEnv(
11
+ "REDIS_URL",
12
+ "Redis connection URL used when a client is not provided."
13
+ );
14
+ var postgresUrlEnv = urlEnv(
15
+ "POSTGRES_URL",
16
+ "Postgres connection URL used when a client is not provided.",
17
+ { aliases: ["DATABASE_URL"] }
18
+ );
19
+ var ADAPTERS = {
20
+ agentphone: {
21
+ description: "Unified SMS, MMS, iMessage, and voice adapter for Chat SDK with HMAC-verified webhooks, iMessage reactions, and voice call transcripts via AgentPhone.",
22
+ env: {
23
+ config: ["apiUrl", "userName"],
24
+ optional: [
25
+ secretEnv(
26
+ "AGENTPHONE_WEBHOOK_SECRET",
27
+ "Webhook signing secret for HMAC-SHA256 verification."
28
+ )
29
+ ],
30
+ required: [
31
+ secretEnv("AGENTPHONE_API_KEY", "AgentPhone API key."),
32
+ env("AGENTPHONE_AGENT_ID", "Agent ID used to send messages.")
33
+ ]
34
+ },
35
+ factoryExport: "createAgentPhoneAdapter",
36
+ group: "vendor-official",
37
+ name: "AgentPhone",
38
+ packageName: "@agentphone/chat-sdk-adapter",
39
+ peerDeps: [],
40
+ slug: "agentphone",
41
+ type: "platform"
42
+ },
43
+ discord: {
44
+ description: "Create Discord bots with slash commands, threads, and rich embeds.",
45
+ env: {
46
+ optional: [
47
+ env(
48
+ "DISCORD_MENTION_ROLE_IDS",
49
+ "Comma-separated role IDs that should trigger mention handlers."
50
+ ),
51
+ urlEnv("DISCORD_API_URL", "Override the Discord API base URL.")
52
+ ],
53
+ required: [
54
+ secretEnv("DISCORD_BOT_TOKEN", "Discord bot token."),
55
+ env("DISCORD_PUBLIC_KEY", "Application public key."),
56
+ env("DISCORD_APPLICATION_ID", "Discord application ID.")
57
+ ]
58
+ },
59
+ factoryExport: "createDiscordAdapter",
60
+ group: "official",
61
+ name: "Discord",
62
+ packageName: "@chat-adapter/discord",
63
+ peerDeps: ["discord-api-types", "discord-interactions", "discord.js"],
64
+ slug: "discord",
65
+ type: "platform"
66
+ },
67
+ github: {
68
+ description: "Build bots that respond to pull request and issue comment threads.",
69
+ env: {
70
+ credentialModes: [
71
+ {
72
+ label: "Personal access token",
73
+ vars: [secretEnv("GITHUB_TOKEN", "Personal access token.")]
74
+ },
75
+ {
76
+ label: "GitHub App",
77
+ vars: [
78
+ env("GITHUB_APP_ID", "GitHub App ID."),
79
+ secretEnv("GITHUB_PRIVATE_KEY", "GitHub App private key.")
80
+ ]
81
+ }
82
+ ],
83
+ optional: [
84
+ env(
85
+ "GITHUB_INSTALLATION_ID",
86
+ "Installation ID for single-installation app deployments."
87
+ ),
88
+ env("GITHUB_BOT_USERNAME", "Bot username for mention detection."),
89
+ urlEnv("GITHUB_API_URL", "Override the GitHub API base URL.")
90
+ ],
91
+ required: [secretEnv("GITHUB_WEBHOOK_SECRET", "Webhook signing secret.")]
92
+ },
93
+ factoryExport: "createGitHubAdapter",
94
+ group: "official",
95
+ name: "GitHub",
96
+ packageName: "@chat-adapter/github",
97
+ peerDeps: ["@octokit/auth-app", "@octokit/rest"],
98
+ slug: "github",
99
+ type: "platform"
100
+ },
101
+ gchat: {
102
+ description: "Integrate with Google Chat spaces for team collaboration and automated workflows.",
103
+ env: {
104
+ credentialModes: [
105
+ {
106
+ label: "Service account credentials",
107
+ vars: [
108
+ secretEnv(
109
+ "GOOGLE_CHAT_CREDENTIALS",
110
+ "Service account credentials JSON or path."
111
+ )
112
+ ]
113
+ },
114
+ {
115
+ label: "Application Default Credentials",
116
+ vars: [
117
+ env(
118
+ "GOOGLE_CHAT_USE_ADC",
119
+ "Set to true to use Application Default Credentials."
120
+ )
121
+ ]
122
+ }
123
+ ],
124
+ optional: [
125
+ env("GOOGLE_CHAT_PUBSUB_TOPIC", "Pub/Sub topic for Workspace Events."),
126
+ env(
127
+ "GOOGLE_CHAT_IMPERSONATE_USER",
128
+ "User email for domain-wide delegation."
129
+ ),
130
+ env(
131
+ "GOOGLE_CHAT_PROJECT_NUMBER",
132
+ "Google Cloud project number for signature validation."
133
+ ),
134
+ env(
135
+ "GOOGLE_CHAT_PUBSUB_AUDIENCE",
136
+ "Audience used for Workspace Events push verification."
137
+ ),
138
+ env(
139
+ "GOOGLE_CHAT_DISABLE_SIGNATURE_VERIFICATION",
140
+ "Set to true to disable signature verification for local fixtures."
141
+ ),
142
+ urlEnv("GOOGLE_CHAT_API_URL", "Override the Google Chat API URL.")
143
+ ]
144
+ },
145
+ factoryExport: "createGoogleChatAdapter",
146
+ group: "official",
147
+ name: "Google Chat",
148
+ packageName: "@chat-adapter/gchat",
149
+ peerDeps: ["@googleapis/chat", "@googleapis/workspaceevents"],
150
+ slug: "gchat",
151
+ type: "platform"
152
+ },
153
+ ioredis: {
154
+ description: "Redis state adapter using ioredis with cluster and sentinel support.",
155
+ env: {
156
+ config: ["url or client", "keyPrefix"],
157
+ notes: "Either a Redis URL or an existing ioredis client is required."
158
+ },
159
+ factoryExport: "createIoRedisState",
160
+ group: "official",
161
+ name: "ioredis",
162
+ packageName: "@chat-adapter/state-ioredis",
163
+ peerDeps: ["ioredis"],
164
+ slug: "ioredis",
165
+ type: "state"
166
+ },
167
+ kapso: {
168
+ description: "Kapso-first WhatsApp adapter for Chat SDK with signed Kapso webhooks, WhatsApp replies, buttons, media, reactions, and conversation history.",
169
+ env: {
170
+ config: [
171
+ "client",
172
+ "verifyWebhookSignatures",
173
+ "appSecret",
174
+ "webhookVerifyToken",
175
+ "historyFields",
176
+ "cacheSize",
177
+ "logger",
178
+ "debug"
179
+ ],
180
+ optional: [
181
+ env(
182
+ "KAPSO_PHONE_NUMBER_ID",
183
+ "WhatsApp phone number ID connected in Kapso."
184
+ ),
185
+ secretEnv(
186
+ "KAPSO_WEBHOOK_SECRET",
187
+ "Secret used to verify Kapso webhook deliveries."
188
+ ),
189
+ urlEnv("KAPSO_BASE_URL", "Kapso proxy URL."),
190
+ env("KAPSO_BOT_USERNAME", "Bot display name.")
191
+ ],
192
+ required: [
193
+ secretEnv(
194
+ "KAPSO_API_KEY",
195
+ "Kapso API key used for sends, history, contacts, conversations, and media."
196
+ )
197
+ ]
198
+ },
199
+ factoryExport: "createKapsoAdapter",
200
+ group: "vendor-official",
201
+ name: "Kapso",
202
+ packageName: "@kapso/chat-adapter",
203
+ peerDeps: [],
204
+ slug: "kapso",
205
+ type: "platform"
206
+ },
207
+ lark: {
208
+ description: "Lark / Feishu adapter for Chat SDK with native cardkit streaming, interactive cards, and reactions.",
209
+ env: {
210
+ optional: [env("LARK_BOT_USERNAME", "Bot display name.")],
211
+ required: [
212
+ env("LARK_APP_ID", "Lark app ID."),
213
+ secretEnv("LARK_APP_SECRET", "Lark app secret.")
214
+ ]
215
+ },
216
+ factoryExport: "createLarkAdapter",
217
+ group: "vendor-official",
218
+ name: "Lark / Feishu",
219
+ packageName: "@larksuite/vercel-chat-adapter",
220
+ peerDeps: [],
221
+ slug: "lark",
222
+ type: "platform"
223
+ },
224
+ linear: {
225
+ description: "Automate Linear issue comment threads with bot responses and workflows.",
226
+ env: {
227
+ credentialModes: [
228
+ {
229
+ label: "Personal API key",
230
+ vars: [secretEnv("LINEAR_API_KEY", "Personal API key.")]
231
+ },
232
+ {
233
+ label: "Access token",
234
+ vars: [
235
+ secretEnv(
236
+ "LINEAR_ACCESS_TOKEN",
237
+ "Pre-obtained OAuth access token."
238
+ )
239
+ ]
240
+ },
241
+ {
242
+ label: "Client credentials",
243
+ vars: [
244
+ env(
245
+ "LINEAR_CLIENT_CREDENTIALS_CLIENT_ID",
246
+ "Client credentials OAuth client ID."
247
+ ),
248
+ secretEnv(
249
+ "LINEAR_CLIENT_CREDENTIALS_CLIENT_SECRET",
250
+ "Client credentials OAuth client secret."
251
+ )
252
+ ]
253
+ },
254
+ {
255
+ label: "OAuth app",
256
+ vars: [
257
+ env("LINEAR_CLIENT_ID", "OAuth client ID."),
258
+ secretEnv("LINEAR_CLIENT_SECRET", "OAuth client secret.")
259
+ ]
260
+ }
261
+ ],
262
+ optional: [
263
+ env(
264
+ "LINEAR_CLIENT_CREDENTIALS_SCOPES",
265
+ "Space-delimited scopes for client-credentials auth."
266
+ ),
267
+ secretEnv(
268
+ "LINEAR_ENCRYPTION_KEY",
269
+ "AES-256-GCM key for encrypting stored OAuth tokens."
270
+ ),
271
+ env("LINEAR_BOT_USERNAME", "Bot display name."),
272
+ urlEnv("LINEAR_API_URL", "Override the Linear API URL.")
273
+ ],
274
+ required: [secretEnv("LINEAR_WEBHOOK_SECRET", "Webhook signing secret.")]
275
+ },
276
+ factoryExport: "createLinearAdapter",
277
+ group: "official",
278
+ name: "Linear",
279
+ packageName: "@chat-adapter/linear",
280
+ peerDeps: ["@linear/sdk"],
281
+ slug: "linear",
282
+ type: "platform"
283
+ },
284
+ liveblocks: {
285
+ description: "Liveblocks Comments adapter for building conversational bots on top of Liveblocks rooms, threads, and comments.",
286
+ env: {
287
+ config: ["botUserId", "botUserName", "resolveUsers", "resolveGroupsInfo"],
288
+ required: [
289
+ secretEnv("LIVEBLOCKS_SECRET_KEY", "Liveblocks secret key."),
290
+ secretEnv(
291
+ "LIVEBLOCKS_WEBHOOK_SECRET",
292
+ "Liveblocks webhook signing secret."
293
+ )
294
+ ]
295
+ },
296
+ factoryExport: "createLiveblocksAdapter",
297
+ group: "vendor-official",
298
+ name: "Liveblocks",
299
+ packageName: "@liveblocks/chat-sdk-adapter",
300
+ peerDeps: [],
301
+ slug: "liveblocks",
302
+ type: "platform"
303
+ },
304
+ matrix: {
305
+ description: "Matrix adapter for Chat SDK, built and maintained by Beeper.",
306
+ env: {
307
+ config: [
308
+ "recoveryKey",
309
+ "commandPrefix",
310
+ "roomAllowlist",
311
+ "inviteAutoJoin",
312
+ "e2ee",
313
+ "persistence"
314
+ ],
315
+ credentialModes: [
316
+ {
317
+ label: "Access token",
318
+ vars: [
319
+ urlEnv("MATRIX_BASE_URL", "Matrix homeserver base URL."),
320
+ secretEnv("MATRIX_ACCESS_TOKEN", "Matrix access token.")
321
+ ]
322
+ },
323
+ {
324
+ label: "Username and password",
325
+ vars: [
326
+ urlEnv("MATRIX_BASE_URL", "Matrix homeserver base URL."),
327
+ env("MATRIX_USERNAME", "Matrix username."),
328
+ secretEnv("MATRIX_PASSWORD", "Matrix password.")
329
+ ]
330
+ }
331
+ ],
332
+ optional: [
333
+ env("MATRIX_USER_ID", "User ID hint."),
334
+ env("MATRIX_DEVICE_ID", "Explicit device ID override."),
335
+ secretEnv(
336
+ "MATRIX_RECOVERY_KEY",
337
+ "Enables E2EE and key-backup bootstrap."
338
+ ),
339
+ env("MATRIX_BOT_USERNAME", "Mention-detection username."),
340
+ env("MATRIX_COMMAND_PREFIX", "Slash command prefix."),
341
+ env("MATRIX_INVITE_AUTOJOIN", "Enable invite auto-join."),
342
+ env(
343
+ "MATRIX_INVITE_AUTOJOIN_ALLOWLIST",
344
+ "Comma-separated Matrix user IDs allowed to invite the bot."
345
+ ),
346
+ env("MATRIX_SDK_LOG_LEVEL", "Matrix SDK log level.")
347
+ ]
348
+ },
349
+ factoryExport: "createMatrixAdapter",
350
+ group: "vendor-official",
351
+ name: "Beeper Matrix",
352
+ packageName: "@beeper/chat-adapter-matrix",
353
+ peerDeps: [],
354
+ slug: "matrix",
355
+ type: "platform"
356
+ },
357
+ memory: {
358
+ description: "In-memory state adapter for development and testing environments.",
359
+ env: {
360
+ notes: "No environment variables are required. State is kept in the current process."
361
+ },
362
+ factoryExport: "createMemoryState",
363
+ group: "official",
364
+ name: "Memory",
365
+ packageName: "@chat-adapter/state-memory",
366
+ peerDeps: [],
367
+ slug: "memory",
368
+ type: "state"
369
+ },
370
+ messenger: {
371
+ description: "Build bots for Facebook Messenger with support for templates, buttons, reactions, and postbacks.",
372
+ env: {
373
+ config: ["apiVersion", "userName"],
374
+ required: [
375
+ secretEnv(
376
+ "FACEBOOK_APP_SECRET",
377
+ "App secret for webhook signature verification."
378
+ ),
379
+ secretEnv(
380
+ "FACEBOOK_PAGE_ACCESS_TOKEN",
381
+ "Page access token for the Send API."
382
+ ),
383
+ secretEnv("FACEBOOK_VERIFY_TOKEN", "Webhook verification token.")
384
+ ]
385
+ },
386
+ factoryExport: "createMessengerAdapter",
387
+ group: "official",
388
+ name: "Messenger",
389
+ packageName: "@chat-adapter/messenger",
390
+ peerDeps: [],
391
+ slug: "messenger",
392
+ type: "platform"
393
+ },
394
+ postgres: {
395
+ description: "Production state adapter using PostgreSQL for persistence and distributed locking.",
396
+ env: {
397
+ config: ["client", "keyPrefix", "schemaName"],
398
+ credentialModes: [
399
+ {
400
+ label: "Connection URL",
401
+ vars: [postgresUrlEnv]
402
+ },
403
+ {
404
+ label: "Existing client",
405
+ vars: []
406
+ }
407
+ ]
408
+ },
409
+ factoryExport: "createPostgresState",
410
+ group: "official",
411
+ name: "PostgreSQL",
412
+ packageName: "@chat-adapter/state-pg",
413
+ peerDeps: ["pg"],
414
+ slug: "postgres",
415
+ type: "state"
416
+ },
417
+ redis: {
418
+ description: "Production-ready state adapter using Redis for persistence and distributed locking.",
419
+ env: {
420
+ config: ["client", "keyPrefix"],
421
+ credentialModes: [
422
+ {
423
+ label: "Connection URL",
424
+ vars: [redisUrlEnv]
425
+ },
426
+ {
427
+ label: "Existing client",
428
+ vars: []
429
+ }
430
+ ]
431
+ },
432
+ factoryExport: "createRedisState",
433
+ group: "official",
434
+ name: "Redis",
435
+ packageName: "@chat-adapter/state-redis",
436
+ peerDeps: ["redis"],
437
+ slug: "redis",
438
+ type: "state"
439
+ },
440
+ resend: {
441
+ description: "Bidirectional email adapter for Chat SDK with threading, rich HTML emails, and attachment support via Resend.",
442
+ env: {
443
+ config: ["fromAddress", "fromName"],
444
+ required: [
445
+ secretEnv("RESEND_API_KEY", "Resend API key."),
446
+ secretEnv("RESEND_WEBHOOK_SECRET", "Resend webhook signing secret.")
447
+ ]
448
+ },
449
+ factoryExport: "createResendAdapter",
450
+ group: "vendor-official",
451
+ name: "Resend",
452
+ packageName: "@resend/chat-sdk-adapter",
453
+ peerDeps: ["@chat-adapter/shared"],
454
+ slug: "resend",
455
+ type: "platform"
456
+ },
457
+ sendblue: {
458
+ description: "iMessage, SMS, and RCS adapter for Chat SDK, built and maintained by Sendblue.",
459
+ env: {
460
+ config: ["webhookSecretHeader", "allowedServices"],
461
+ optional: [
462
+ secretEnv(
463
+ "SENDBLUE_WEBHOOK_SECRET",
464
+ "Shared secret for webhook verification."
465
+ ),
466
+ urlEnv(
467
+ "SENDBLUE_STATUS_CALLBACK_URL",
468
+ "Status callback URL for outbound delivery events."
469
+ )
470
+ ],
471
+ required: [
472
+ secretEnv("SENDBLUE_API_KEY", "Sendblue API key ID."),
473
+ secretEnv("SENDBLUE_API_SECRET", "Sendblue API secret key."),
474
+ env("SENDBLUE_FROM_NUMBER", "Sendblue sender number in E.164 format.")
475
+ ]
476
+ },
477
+ factoryExport: "createSendblueAdapter",
478
+ group: "vendor-official",
479
+ name: "Sendblue",
480
+ packageName: "chat-adapter-sendblue",
481
+ peerDeps: [],
482
+ slug: "sendblue",
483
+ type: "platform"
484
+ },
485
+ slack: {
486
+ description: "Build bots for Slack workspaces with full support for threads, reactions, and interactive messages.",
487
+ env: {
488
+ credentialModes: [
489
+ {
490
+ label: "Single workspace bot token",
491
+ vars: [
492
+ secretEnv("SLACK_BOT_TOKEN", "Slack bot token."),
493
+ secretEnv(
494
+ "SLACK_SIGNING_SECRET",
495
+ "Slack signing secret for webhook verification."
496
+ )
497
+ ]
498
+ },
499
+ {
500
+ label: "Multi-workspace OAuth",
501
+ vars: [
502
+ env("SLACK_CLIENT_ID", "Slack app client ID."),
503
+ secretEnv("SLACK_CLIENT_SECRET", "Slack app client secret."),
504
+ secretEnv(
505
+ "SLACK_SIGNING_SECRET",
506
+ "Slack signing secret for webhook verification."
507
+ )
508
+ ]
509
+ }
510
+ ],
511
+ optional: [
512
+ secretEnv("SLACK_APP_TOKEN", "Slack app-level token for Socket Mode."),
513
+ secretEnv(
514
+ "SLACK_ENCRYPTION_KEY",
515
+ "AES-256-GCM key for encrypting stored OAuth tokens."
516
+ ),
517
+ urlEnv("SLACK_API_URL", "Override the Slack API base URL."),
518
+ secretEnv(
519
+ "SLACK_SOCKET_FORWARDING_SECRET",
520
+ "Secret used to authenticate forwarded Socket Mode events."
521
+ )
522
+ ]
523
+ },
524
+ factoryExport: "createSlackAdapter",
525
+ group: "official",
526
+ name: "Slack",
527
+ packageName: "@chat-adapter/slack",
528
+ peerDeps: ["@slack/socket-mode", "@slack/web-api"],
529
+ slug: "slack",
530
+ type: "platform"
531
+ },
532
+ teams: {
533
+ description: "Deploy bots to Microsoft Teams with adaptive cards, mentions, and conversation threading.",
534
+ env: {
535
+ credentialModes: [
536
+ {
537
+ label: "Bot Framework client secret",
538
+ vars: [
539
+ env("TEAMS_APP_ID", "Azure Bot App ID."),
540
+ secretEnv("TEAMS_APP_PASSWORD", "Azure Bot App password.")
541
+ ]
542
+ }
543
+ ],
544
+ optional: [
545
+ env(
546
+ "TEAMS_APP_TENANT_ID",
547
+ "Azure AD tenant ID for single-tenant apps."
548
+ ),
549
+ urlEnv(
550
+ "TEAMS_API_URL",
551
+ "Override the Teams API base URL for sovereign clouds."
552
+ )
553
+ ]
554
+ },
555
+ factoryExport: "createTeamsAdapter",
556
+ group: "official",
557
+ name: "Microsoft Teams",
558
+ packageName: "@chat-adapter/teams",
559
+ peerDeps: [
560
+ "@microsoft/teams.api",
561
+ "@microsoft/teams.apps",
562
+ "@microsoft/teams.cards",
563
+ "@microsoft/teams.graph-endpoints"
564
+ ],
565
+ slug: "teams",
566
+ type: "platform"
567
+ },
568
+ telegram: {
569
+ description: "Connect to Telegram with support for groups, channels, and inline keyboards.",
570
+ env: {
571
+ optional: [
572
+ secretEnv(
573
+ "TELEGRAM_WEBHOOK_SECRET_TOKEN",
574
+ "Optional webhook secret token."
575
+ ),
576
+ env("TELEGRAM_BOT_USERNAME", "Bot username for mention detection."),
577
+ urlEnv("TELEGRAM_API_BASE_URL", "Override the Telegram API base URL.")
578
+ ],
579
+ required: [secretEnv("TELEGRAM_BOT_TOKEN", "Telegram bot token.")]
580
+ },
581
+ factoryExport: "createTelegramAdapter",
582
+ group: "official",
583
+ name: "Telegram",
584
+ packageName: "@chat-adapter/telegram",
585
+ peerDeps: [],
586
+ slug: "telegram",
587
+ type: "platform"
588
+ },
589
+ twilio: {
590
+ description: "Build SMS and MMS bots with Twilio Messaging webhooks and the Messages API.",
591
+ env: {
592
+ config: ["webhookUrl", "webhookVerifier", "statusCallbackUrl", "apiUrl"],
593
+ credentialModes: [
594
+ {
595
+ label: "Account credentials",
596
+ vars: [
597
+ env("TWILIO_ACCOUNT_SID", "Twilio Account SID."),
598
+ secretEnv("TWILIO_AUTH_TOKEN", "Twilio Auth Token.")
599
+ ]
600
+ }
601
+ ],
602
+ optional: [
603
+ env("TWILIO_PHONE_NUMBER", "Default sender phone number for openDM."),
604
+ env(
605
+ "TWILIO_MESSAGING_SERVICE_SID",
606
+ "Default Messaging Service SID for openDM."
607
+ )
608
+ ]
609
+ },
610
+ factoryExport: "createTwilioAdapter",
611
+ group: "official",
612
+ name: "Twilio",
613
+ packageName: "@chat-adapter/twilio",
614
+ peerDeps: [],
615
+ slug: "twilio",
616
+ type: "platform"
617
+ },
618
+ velt: {
619
+ description: "Velt Comments adapter for building bots that read and respond in Velt comment threads on documents, text editors, and canvases.",
620
+ env: {
621
+ config: [
622
+ "botUserId",
623
+ "botUserName",
624
+ "webhookVersion",
625
+ "resolveUsers",
626
+ "selfHostingConfig"
627
+ ],
628
+ optional: [
629
+ secretEnv(
630
+ "VELT_AUTH_TOKEN",
631
+ "Velt auth token used instead of generated bot-user tokens."
632
+ ),
633
+ env(
634
+ "VELT_ORGANIZATION_ID",
635
+ "Default organization ID for generated tokens and webhook fallback."
636
+ )
637
+ ],
638
+ required: [
639
+ secretEnv("VELT_API_KEY", "Velt API key for REST API calls."),
640
+ secretEnv("VELT_WEBHOOK_SECRET", "Velt webhook signing secret.")
641
+ ]
642
+ },
643
+ factoryExport: "createVeltAdapter",
644
+ group: "vendor-official",
645
+ name: "Velt",
646
+ packageName: "@veltdev/chat-sdk-adapter",
647
+ peerDeps: [],
648
+ slug: "velt",
649
+ type: "platform"
650
+ },
651
+ web: {
652
+ description: "Serve a browser chat UI from the same bot using the AI SDK useChat protocol \u2014 works out of the box with @ai-sdk/react and ai-elements.",
653
+ env: {
654
+ config: ["userName", "getUser", "persistMessageHistory", "threadIdFor"],
655
+ notes: "The Web adapter delegates browser request authentication to the getUser config function."
656
+ },
657
+ factoryExport: "createWebAdapter",
658
+ group: "official",
659
+ name: "Web",
660
+ packageName: "@chat-adapter/web",
661
+ peerDeps: [],
662
+ slug: "web",
663
+ type: "platform"
664
+ },
665
+ whatsapp: {
666
+ description: "Connect to WhatsApp Business Cloud for customer messaging and automated conversations.",
667
+ env: {
668
+ optional: [
669
+ env("WHATSAPP_BOT_USERNAME", "Bot display name."),
670
+ urlEnv("WHATSAPP_API_URL", "Override the WhatsApp Graph API URL.")
671
+ ],
672
+ required: [
673
+ secretEnv("WHATSAPP_ACCESS_TOKEN", "Meta access token."),
674
+ secretEnv(
675
+ "WHATSAPP_APP_SECRET",
676
+ "App secret for webhook verification."
677
+ ),
678
+ env("WHATSAPP_PHONE_NUMBER_ID", "Bot phone number ID."),
679
+ secretEnv("WHATSAPP_VERIFY_TOKEN", "Webhook verification token.")
680
+ ]
681
+ },
682
+ factoryExport: "createWhatsAppAdapter",
683
+ group: "official",
684
+ name: "WhatsApp Business Cloud",
685
+ packageName: "@chat-adapter/whatsapp",
686
+ peerDeps: [],
687
+ slug: "whatsapp",
688
+ type: "platform"
689
+ },
690
+ zernio: {
691
+ description: "Unified social media DM adapter covering Instagram, Facebook, Telegram, WhatsApp, X/Twitter, Bluesky, and Reddit through a single integration.",
692
+ env: {
693
+ optional: [
694
+ secretEnv(
695
+ "ZERNIO_WEBHOOK_SECRET",
696
+ "HMAC-SHA256 secret for verifying inbound webhooks."
697
+ ),
698
+ urlEnv("ZERNIO_API_BASE_URL", "Override the Zernio API base URL."),
699
+ env("ZERNIO_BOT_NAME", "Bot display name.")
700
+ ],
701
+ required: [secretEnv("ZERNIO_API_KEY", "Zernio API key.")]
702
+ },
703
+ factoryExport: "createZernioAdapter",
704
+ group: "vendor-official",
705
+ name: "Zernio",
706
+ packageName: "@zernio/chat-sdk-adapter",
707
+ peerDeps: [],
708
+ slug: "zernio",
709
+ type: "platform"
710
+ }
711
+ };
712
+ var ADAPTER_NAMES = Object.keys(ADAPTERS).sort();
713
+ var listPlatformAdapters = () => ADAPTER_NAMES.map((slug) => ADAPTERS[slug]).filter(
714
+ (adapter) => adapter.type === "platform"
715
+ );
716
+ var listStateAdapters = () => ADAPTER_NAMES.map((slug) => ADAPTERS[slug]).filter(
717
+ (adapter) => adapter.type === "state"
718
+ );
719
+ var isAdapterSlug = (slug) => Object.hasOwn(ADAPTERS, slug);
720
+ function getAdapter(slug) {
721
+ return ADAPTERS[slug];
722
+ }
723
+ var listEnvVars = (slug) => {
724
+ const adapter = getAdapter(slug);
725
+ if (!adapter) {
726
+ return [];
727
+ }
728
+ const all = [
729
+ ...adapter.env.required ?? [],
730
+ ...(adapter.env.credentialModes ?? []).flatMap((mode) => mode.vars),
731
+ ...adapter.env.optional ?? []
732
+ ];
733
+ const byKey = /* @__PURE__ */ new Map();
734
+ for (const envVar of all) {
735
+ if (!byKey.has(envVar.key)) {
736
+ byKey.set(envVar.key, envVar);
737
+ }
738
+ }
739
+ return [...byKey.values()];
740
+ };
741
+ var getSecretEnvVars = (slug) => listEnvVars(slug).filter((envVar) => envVar.secret);
742
+ export {
743
+ ADAPTERS,
744
+ ADAPTER_NAMES,
745
+ getAdapter,
746
+ getSecretEnvVars,
747
+ isAdapterSlug,
748
+ listEnvVars,
749
+ listPlatformAdapters,
750
+ listStateAdapters
751
+ };