Last 12 weeks ยท 392 commits
5 of 6 standards met
Summary Adds a new package that enables Chat SDK bots to communicate over iMessage. The adapter supports two modes: Remote mode โ connects to a Photon iMessage server over HTTP and Socket.IO, allowing the bot to run on any platform Local mode โ reads directly from the macOS iMessage database and sends via AppleScript (requires Full Disk Access) Additionally introduces native poll support as a new first-class message type in the core SDK, with native rendering in the iMessage remote adapter and vote callbacks via the existing pattern. Try it out A live demo is deployed for testing the remote mode: Deployed on Vercel: https://imessage-chat.vercel.app Phone number: +1 (415) 791-8488 โ everyone can test it by sending a message Example code**: https://github.com/photon-hq/vercel-chat/tree/feat/imessage-example/examples/imessage-chat Changes New package: Core SDK: Poll support () Shared utilities () Documentation โ Polls guide with JSX/function-call examples, vote callbacks, dynamic polls, and platform support โ Polls API reference with TypeTable for , , , โ Added section โ Full adapter documentation with polls section, setup instructions for both remote and local modes, features table, environment variables, and usage examples โ Updated adapters overview to include iMessage โ Added iMessage to docs navigation โ Added polls to API reference navigation Configuration โ Added and environment variables to the build config โ Added iMessage to supported platforms table and packages list Key design decisions The adapter auto-detects mode from the environment variable but also accepts explicit in config Remote mode uses Socket.IO for real-time message delivery and HTTP for API calls (post, edit, react, etc.) Local mode depends on (optional peer dependency) for database access and AppleScript sending The format converter strips rich formatting to plain text since iMessage doesn't support markdown natively Thread IDs use the format โ iMessage conversations are flat (no sub-threads), so the chat GUID (e.g., ) uniquely identifies the conversation Polls use the same pattern as card buttons for vote callbacks, with a storing the mapping from remote poll GUIDs to user-defined poll IDs DM detection uses the chat GUID format ( = DM, = group) rather than the field, which is unreliable across different server configurations Test plan [x] All new tests pass () [x] Tests cover: adapter creation, message parsing, posting, editing, reactions, typing indicators, thread fetching, message fetching, gateway listener, format conversion, poll posting, poll vote callbacks, poll metadata storage [x] Core SDK poll tests pass () [x] Both remote and local mode code paths are tested with mocked dependencies [x] E2E integration test verified against a live iMessage server (poll-integration.test.ts) [x] DM detection fix verified with real chat GUIDs from production data
Problem Two bugs in (): 1. Slack-style links broken by markdown parser LLMs frequently output `<urltext>texthttp(s)@wordnodeToMrkdwnconvertMentionsToSlack` โ the converter already preserves those correctly through the roundtrip. Tests All 179 existing tests pass. Updated mention tests to reflect new behavior and added 4 new tests for Slack-style link preprocessing.
Repository: vercel/chat. Description: A unified TypeScript SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, and more. Stars: 971, Forks: 61. Primary language: TypeScript. Languages: TypeScript (91.2%), MDX (8.6%), CSS (0.3%), JavaScript (0%). License: MIT. Homepage: https://chat-sdk.dev/ Topics: ai, chat, discord, google-chat, slack, teams, vercel. Latest release: chat@4.15.0 (2d ago). Open PRs: 19, open issues: 18. Last activity: 8h ago. Community health: 87%. Top contributors: cramforce, haydenbleasel, nandorojo, visyat, github-actions[bot], JohnPhamous, NicolasMontone, dependabot[bot], malewis5, Brycero and others.
TypeScript
Summary This PR adds Telegram polling runtime modes and fixes a crash during adapter initialization when the chat username is missing. Telegram mode support Added to config (default: ) mode behavior: Calls Uses webhook mode if a webhook URL is configured Falls back to polling on non-serverless runtimes when no webhook URL exists Stays in webhook mode on likely serverless runtimes when no webhook URL exists Never deletes webhook when auto-selecting polling mode starts polling immediately during and retains current delete-webhook defaults Kept manual lifecycle methods: / Init crash fix Fixes a reproducible crash when is missing at runtime (e.g. JS usage without ): Guarded usage in Made resilient to non-string input Preserves fallback behavior () and still prefers Documentation Updated Telegram adapter docs and README to cover: semantics (, , ) Polling examples with Auto mode usage for local polling + production webhooks Clarified initialization requirement for long-running local polling processes Tests Ran: Added/updated tests for: starts polling during initialize decision paths: no webhook URL -> polling webhook URL present -> webhook mode serverless runtime + no webhook URL -> webhook mode mode omitted defaults to undefined chat username init path no longer crashes