mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
a5b118f1dc
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @chat-adapter/slack@4.30.0 ### Minor Changes -4c46c26: add lightweight Slack formatting primitives subpath -dbd8dc5: expose runtime-free Block Kit helpers for Slack card conversion -aba6aa9: add lightweight Slack API primitives subpath -b332a03: add lightweight Slack webhook primitives subpath -6ed4a43: add low-level Slack helpers for files, thread replies, views, interactions, and input blocks ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) -073ff92: surface Slack file upload confirmation ids in postMessage results -b63c042: fix(slack): resolve reaction user display names Slack reaction events now resolve the reacting user's display name and real name through the existing cached user lookup path. If lookup fails, the adapter falls back to the Slack user ID. -1294490: reuse low-level Slack formatting helpers in the adapter -999d268: pass the Slack bot token through native stream append and stop calls - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/telegram@4.30.0 ### Minor Changes -5461ea9: Add native Telegram private chat draft streaming with fallback streaming elsewhere. ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/twilio@4.30.0 ### Minor Changes -25ebc3b: add Twilio SMS, MMS, and voice helpers with webhook, messaging, and formatting primitives ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/whatsapp@4.30.0 ### Minor Changes -ffc43fc: Add WhatsApp typing indicator support by sending Meta's read-plus-typing payload when a recent inbound message is available. Update the default API version to v25.0. ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## chat@4.30.0 ### Minor Changes -5461ea9: Add native Telegram private chat draft streaming with fallback streaming elsewhere. ## @chat-adapter/discord@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/gchat@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) -177735a: - Fix redundant mailto link rendering in Google Chat adapter - Google Chat adapter was emitting redundant `<mailto:...|...>` tokens when rendering autolinked email addresses. This change collapses `mailto:` URLs when the visible text equals the email address, ensuring cleaner output consistent with plain text rendering in Google Chat. - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/github@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/linear@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/messenger@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/shared@4.30.0 ### Patch Changes - Updated dependencies [5461ea9] - chat@4.30.0 ## @chat-adapter/teams@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/web@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 - @chat-adapter/shared@4.30.0 ## @chat-adapter/state-ioredis@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 ## @chat-adapter/state-memory@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 ## @chat-adapter/state-pg@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 ## @chat-adapter/state-redis@4.30.0 ### Patch Changes -9b8d8c4: expand npm `keywords` for adapter and state packages to improve discoverability (adds `chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus platform-specific terms) - Updated dependencies [5461ea9] - chat@4.30.0 ## @chat-adapter/tests@4.30.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/shared
Shared utilities for Chat SDK adapters. Provides common helpers used across adapter implementations.
Installation
pnpm add @chat-adapter/shared
Utilities
Adapter helpers
extractCard(message)- extract aCardElementfrom anAdapterPostableMessageextractFiles(message)- extractFileUpload[]from anAdapterPostableMessageextractPostableAttachments(message)- extractAttachment[]from anAdapterPostableMessage
Buffer conversion
toBuffer(input)- convert various inputs (Buffer, Blob, string, URL) to BuffertoBufferSync(input)- synchronous version of toBufferbufferToDataUri(buffer, mimeType)- convert a Buffer to a data URI string
Card conversion
cardToFallbackText(card)- render aCardElementas plain text for platforms that don't support cardscreateEmojiConverter(platform)- create a function that converts emoji placeholders to platform formatmapButtonStyle(style)- map generic button styles to platform-specific variantsrenderGfmTable(headers, rows)- render a GitHub Flavored Markdown tableescapeTableCell(text)- escape pipe characters in table cells
Token encryption
AES-256-GCM helpers for encrypting OAuth tokens at rest before writing them to a state adapter. Used by @chat-adapter/slack and @chat-adapter/linear; available to any adapter that persists credentials.
encryptToken(plaintext, key)- encrypt a string and return anEncryptedTokenDataenvelope (random 12-byte IV per call)decryptToken(data, key)- decrypt an envelope back to the original stringdecodeKey(encoded)- decode a hex-64 or base64-44 encoded 32-byte key; throws on wrong lengthisEncryptedTokenData(value)- type guard for distinguishing envelopes from legacy plaintext recordsEncryptedTokenData- the envelope type ({ data, iv, tag }, all base64)
Error classes
Standardized errors for adapter implementations:
AdapterError- base error classAdapterRateLimitError- platform rate limit (includesretryAfter)AuthenticationError- expired or invalid tokensNetworkError- connection failuresPermissionError- missing scopes or permissionsResourceNotFoundError- missing channel/thread/messageValidationError- invalid config or input
License
MIT