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/discord@4.29.0 ### Minor Changes -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -b9b17cd: handle slash commands and button interactions in Discord gateway-only mode - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/gchat@4.29.0 ### Minor Changes -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/github@4.29.0 ### Minor Changes -2f108bd: Rename the typed native client getter on the Slack, GitHub, and Linear adapters to match the underlying SDK class. - `bot.getAdapter("slack").client` is now `bot.getAdapter("slack").webClient` (returns `WebClient` from `@slack/web-api`). - `bot.getAdapter("github").client` is now `bot.getAdapter("github").octokit` (returns `Octokit`). - `bot.getAdapter("linear").client` is now `bot.getAdapter("linear").linearClient` (returns `LinearClient`). The previous `.client` getter is kept as a deprecated alias on all three adapters, so existing code continues to work without changes. -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/linear@4.29.0 ### Minor Changes -2f108bd: Rename the typed native client getter on the Slack, GitHub, and Linear adapters to match the underlying SDK class. - `bot.getAdapter("slack").client` is now `bot.getAdapter("slack").webClient` (returns `WebClient` from `@slack/web-api`). - `bot.getAdapter("github").client` is now `bot.getAdapter("github").octokit` (returns `Octokit`). - `bot.getAdapter("linear").client` is now `bot.getAdapter("linear").linearClient` (returns `LinearClient`). The previous `.client` getter is kept as a deprecated alias on all three adapters, so existing code continues to work without changes. -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/messenger@4.29.0 ### Minor Changes -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/shared@4.29.0 ### Minor Changes -add2730: support typed Telegram attachment uploads ### Patch Changes -e60bc8c: chore: set supported Node versions in engines - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [b75eedb] - chat@4.29.0 ## @chat-adapter/slack@4.29.0 ### Minor Changes -2f108bd: Rename the typed native client getter on the Slack, GitHub, and Linear adapters to match the underlying SDK class. - `bot.getAdapter("slack").client` is now `bot.getAdapter("slack").webClient` (returns `WebClient` from `@slack/web-api`). - `bot.getAdapter("github").client` is now `bot.getAdapter("github").octokit` (returns `Octokit`). - `bot.getAdapter("linear").client` is now `bot.getAdapter("linear").linearClient` (returns `LinearClient`). The previous `.client` getter is kept as a deprecated alias on all three adapters, so existing code continues to work without changes. -c46fdb6: Add support for external `installationProvider` and Enterprise Grid org-wide installs. - New optional `installationProvider` config: `{ getInstallation(installationId, isEnterpriseInstall) => Promise<SlackInstallation | null> }`. When set, the adapter resolves bot tokens for incoming events, slash commands, and interactive payloads through the provider instead of the internal `StateAdapter` — useful for hosted token-management systems (e.g. Vercel Connect). The provider is read-only; OAuth callback writes (`setInstallation`, `handleOAuthCallback`) and the `getInstallation`/`deleteInstallation` public methods continue to use internal state, so callers using a provider should manage their own writes. - Enterprise Grid org-wide installs (`is_enterprise_install: true`) are now keyed on `enterprise_id` instead of `team_id` across event_callback, slash command, and interactive payload paths. Multi-workspace deployments using the internal `StateAdapter` for org-wide installs must repopulate installations under the `enterprise_id` key — previously, org-wide events would fall through to a `team_id` lookup that did not match what the OAuth flow had stored. -fdebde7: feat(slack): expose direct `WebClient` access via `adapter.client` `bot.getAdapter("slack").client` now returns a typed `WebClient` from `@slack/web-api`, matching the existing pattern on the Linear and GitHub adapters. The returned client is bound to the bot token for the current request context (multi-workspace) or the configured default token (single-workspace). Use it for any Web API call not covered by the SDK's high-level methods, e.g. `adapter.client.pins.add(...)` or `adapter.client.usergroups.list(...)`. Resolution order: 1. The token from the current `requestContext` — set during webhook handling, or by `adapter.withBotToken(token, fn)`. 2. The default `botToken`, when configured as a static string or a synchronous resolver function. Throws `AuthenticationError` outside of any context in multi-workspace mode, or when `botToken` is configured as an async resolver function. For async tokens, await the token first and bind it explicitly with `adapter.withBotToken(token, () => adapter.client...)`. Also fixes `createSlackAdapter()` silently dropping the `apiUrl` config field. -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. -0f0c203: fix(slack): prefer `webhookVerifier` over `signingSecret` and `SLACK_SIGNING_SECRET` When a `webhookVerifier` is configured, it now takes precedence over both the `signingSecret` config field and the `SLACK_SIGNING_SECRET` env var. Previously, a configured `signingSecret` (or env var) would shadow the verifier. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/teams@4.29.0 ### Minor Changes -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/telegram@4.29.0 ### Minor Changes -add2730: support typed Telegram attachment uploads -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -711babe: Handle `video_note` (round video messages) in `extractAttachments`. Previously these messages were silently dropped; now they are returned as `video` attachments with `width`/`height` set to the clip's `length`. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/web@4.29.0 ### Minor Changes -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). -716e934: Add first-class Vue and Svelte support via new subpath exports `@chat-adapter/web/vue` and `@chat-adapter/web/svelte`. Each exports a `useChat()` factory preconfigured with `DefaultChatTransport`, returning a framework-reactive `Chat` instance from `@ai-sdk/vue` / `@ai-sdk/svelte` respectively. Note: unlike the React subpath which wraps `@ai-sdk/react`'s `useChat` hook and returns destructurable helpers, the Vue and Svelte wrappers return a `Chat` class instance — access `chat.messages`, `chat.sendMessage()`, `chat.status`, and `chat.stop()` directly on the object. ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## @chat-adapter/whatsapp@4.29.0 ### Minor Changes -2ffed48: Adapter internals are now `protected` rather than `private`, so consumers can subclass an adapter to override or extend its behavior (e.g. handling additional Telegram update types by overriding `processUpdate`). ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [add2730] - Updated dependencies [b75eedb] - chat@4.29.0 - @chat-adapter/shared@4.29.0 ## chat@4.29.0 ### Minor Changes -ac8a207: Add `chat/ai` subpath as the home for AI utilities, including `createChatTools` for the Vercel AI SDK and `toAiMessages` for converting chat history into AI SDK prompts. `createChatTools` exposes Chat SDK operations as ready-to-use AI SDK tools so an agent can read messages, post replies, send DMs, react, edit, delete, and manage thread subscriptions across every adapter the supplied `Chat` instance has registered. Write operations require user approval by default and can be toggled globally or per-tool via `requireApproval`. Three presets (`reader`, `messenger`, `moderator`) scope the toolset, and tools can also be cherry-picked from the same subpath. `toAiMessages` (and the `AiMessage` / `AiMessagePart` / `ToAiMessagesOptions` types) now ship from `chat/ai` alongside the tools — keeping the optional `ai` and `zod` peer dependencies out of bundles that don't use them. The previous `chat` re-exports continue to work, but are marked `@deprecated` so editors surface a hint pointing at `chat/ai`; existing code keeps compiling, and migrating is a single import-path change. -b75eedb: add burst concurrency strategy ### Patch Changes -e60bc8c: chore: set supported Node versions in engines ## @chat-adapter/state-ioredis@4.29.0 ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [b75eedb] - chat@4.29.0 ## @chat-adapter/state-memory@4.29.0 ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [b75eedb] - chat@4.29.0 ## @chat-adapter/state-pg@4.29.0 ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [b75eedb] - chat@4.29.0 ## @chat-adapter/state-redis@4.29.0 ### Patch Changes -e60bc8c: chore: set supported Node versions in engines -06fb8e5: Align package shapes with the new `konsistent` conventions. All changes are backwards-compatible — previous type names are kept as deprecated aliases. - `@chat-adapter/gchat`, `@chat-adapter/slack`: moved `*AdapterConfig` (and related sub-types) into a `./types` module; the public re-exports from `index.ts` are unchanged. - `@chat-adapter/slack`: `createSlackAdapter` now accepts `SlackAdapterConfig` directly instead of `Partial<SlackAdapterConfig>`. Every field on the config was already optional, so no call sites need to change. - `@chat-adapter/messenger`: `MessengerAdapterConfig` fields are now optional (the factory still falls back to `FACEBOOK_*` env vars), and `logger` / `userName` live on `MessengerAdapterConfig` directly. The factory signature is now `createMessengerAdapter(config?: MessengerAdapterConfig)`. - `@chat-adapter/web`: renamed `WebAdapterOptions` to `WebAdapterConfig`; the old name is exported as a deprecated alias. - `@chat-adapter/whatsapp`: every field on `WhatsAppAdapterConfig` is optional (the factory still falls back to `WHATSAPP_*` env vars). `createWhatsAppAdapter` is now typed `(config?: WhatsAppAdapterConfig) => WhatsAppAdapter`. - `@chat-adapter/state-memory`: added an empty `MemoryStateAdapterOptions` type so the package matches every other state adapter; `createMemoryState` now accepts an optional argument of that type. - `@chat-adapter/state-ioredis`, `@chat-adapter/state-redis`, `@chat-adapter/state-pg`: the URL- and client-based option shapes were split into named interfaces (`*StateAdapterUrlOptions` / `*StateAdapterClientOptions`) and unified under `*StateAdapterOptions`. The factories now take the union type directly. Old names — `RedisStateClientOptions`, `CreateRedisStateOptions`, `PostgresStateClientOptions`, `CreatePostgresStateOptions`, `IoRedisStateClientOptions` — are kept as deprecated aliases. - Updated dependencies [ac8a207] - Updated dependencies [e60bc8c] - Updated dependencies [b75eedb] - chat@4.29.0 ## @chat-adapter/tests@4.29.0 ### Patch Changes -0adf3ad: Add `@chat-adapter/tests` — Vitest factories, matchers, and setup utilities for Chat SDK adapter and bot authors. - **Factories**: `createMockAdapter`, `createMockChatInstance`, `createMockState` (with working in-memory subscriptions/locks/KV/queues), `createTestMessage`, `mockLogger`/`createMockLogger`. - **Matchers**: `toHavePosted(threadId, textPattern?)`, `toHaveDispatched(handler)`, `toBeSubscribedTo(threadId)`. - **Setup file**: `@chat-adapter/tests/setup` registers all matchers via `expect.extend` — drop into `vitest.config.ts` `setupFiles`. `chat` and `vitest` are peer dependencies. Adapter-specific helpers (e.g. signed Slack webhook builders) belong in each adapter's own `/testing` subpath, not in this kit. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/linear
Linear adapter for Chat SDK. Respond to @mentions in issue comment threads and Linear app-actor agent sessions.
The Linear adapter treats issue comments as messages and issues as threads.
Installation
pnpm add @chat-adapter/linear
Usage
The adapter auto-detects credentials from LINEAR_API_KEY, LINEAR_ACCESS_TOKEN, LINEAR_CLIENT_CREDENTIALS_CLIENT_ID/LINEAR_CLIENT_CREDENTIALS_CLIENT_SECRET, or LINEAR_CLIENT_ID/LINEAR_CLIENT_SECRET, plus LINEAR_WEBHOOK_SECRET and LINEAR_BOT_USERNAME:
import { Chat } from "chat";
import { createLinearAdapter } from "@chat-adapter/linear";
const bot = new Chat({
userName: "my-bot",
adapters: {
linear: createLinearAdapter(),
},
});
bot.onNewMention(async (thread, message) => {
await thread.post("Hello from Linear!");
});
By default, the adapter runs in mode: "comments" and treats Comment webhooks as the inbound message source. For Linear app-actor installs, set mode: "agent-sessions" so inbound handling is driven by AgentSessionEvent.
Authentication
Option A: Personal API key
Best for personal projects, testing, or single-workspace bots. Actions are attributed to you as an individual.
- Go to Settings > Security & Access
- Under Personal API keys, click Create key
- Select Only select permissions and enable Create issues, Create comments
- Choose team access
- Click Create and set
LINEAR_API_KEY
createLinearAdapter({
apiKey: process.env.LINEAR_API_KEY!,
});
Option B: Pre-obtained OAuth access token
Use this when your app already manages the OAuth flow and you just want the adapter to operate with a single workspace token.
createLinearAdapter({
accessToken: process.env.LINEAR_ACCESS_TOKEN!,
});
Option C: Multi-tenant OAuth installs
Use top-level clientId / clientSecret for Slack-style multi-tenant installs. Each Linear workspace installation is stored separately, webhook requests resolve the correct workspace token by organizationId, and withInstallation() lets you target a specific organization outside webhook handling.
- Go to Settings > API > Applications
- Create an OAuth2 application with your bot's name and icon
- Note the Client ID and Client Secret
const adapter = createLinearAdapter({
clientId: process.env.LINEAR_CLIENT_ID!,
clientSecret: process.env.LINEAR_CLIENT_SECRET!,
mode: "agent-sessions",
});
Example callback route:
await bot.initialize();
const { organizationId } = await adapter.handleOAuthCallback(request, {
redirectUri: process.env.LINEAR_REDIRECT_URI!,
});
Example background job:
await adapter.withInstallation("org-id", async () => {
await adapter.postMessage("linear:issue-id", "Hello from a background job");
});
Option D: Single-tenant client credentials
If you want app identity without multi-tenant installs, use the explicit clientCredentials config. The adapter fetches and refreshes the token automatically.
createLinearAdapter({
clientCredentials: {
clientId: process.env.LINEAR_CLIENT_CREDENTIALS_CLIENT_ID!,
clientSecret: process.env.LINEAR_CLIENT_CREDENTIALS_CLIENT_SECRET!,
scopes: ["read", "write", "comments:create", "issues:create"],
},
mode: "agent-sessions",
});
Token encryption
For multi-tenant OAuth installs, pass a base64-encoded 32-byte key as encryptionKey (or set LINEAR_ENCRYPTION_KEY) to encrypt stored access and refresh tokens at rest using AES-256-GCM:
openssl rand -base64 32
When encryptionKey is set, setInstallation() encrypts tokens before writing them to the configured state adapter and getInstallation() decrypts them transparently. Existing plaintext records continue to work, so you can roll the key in without flushing installs. Without an encryptionKey, tokens are stored in plaintext (the previous default).
Making the bot @-mentionable (optional)
To make the bot appear in Linear's @ mention dropdown as an Agent:
- In your OAuth app settings, enable Agent session events under webhooks
- Have a workspace admin install the app with
actor=appand theapp:mentionablescope:
https://linear.app/oauth/authorize?
client_id=your_client_id&
redirect_uri=https://your-domain.com/callback&
response_type=code&
scope=read,write,comments:create,issues:create,app:mentionable&
actor=app
If you use single-tenant client credentials, request the same scopes there:
createLinearAdapter({
clientCredentials: {
clientId: process.env.LINEAR_CLIENT_CREDENTIALS_CLIENT_ID!,
clientSecret: process.env.LINEAR_CLIENT_CREDENTIALS_CLIENT_SECRET!,
scopes: [
"read",
"write",
"comments:create",
"issues:create",
"app:mentionable",
],
},
});
Once installed with actor=app, set mode: "agent-sessions" so the adapter treats AgentSessionEvent as the entrypoint for mentions:
onNewMentionfires from the session-created eventthread.startTyping()sends an ephemeral Linearthoughtthread.post(stream)uses agent activities and session plan updates- Session threads are append-only, so
sent.edit()/sent.delete()are not supported there
See the Linear Agents docs for full details.
Direct API client
For anything beyond the unified SDK, access the underlying LinearClient via .linearClient:
const linear = bot.getAdapter("linear").linearClient;
const issue = await linear.issue("ENG-123");
const project = await issue.project;
API key, access token, and single-tenant client-credentials modes return the same client anywhere. Multi-tenant OAuth mode requires webhook handler context to resolve the per-org token — calling .linearClient outside a handler throws.
The previous
.clientgetter still works as a deprecated alias for.linearClient.
Webhook setup
Note: Webhook management requires workspace admin access. If you don't see the API settings page, ask a workspace admin to create the webhook for you.
- Go to Settings > API and click Create webhook
- Fill in:
- Label: A descriptive name (e.g., "Chat Bot")
- URL:
https://your-domain.com/api/webhooks/linear
- Copy the Signing secret as
LINEAR_WEBHOOK_SECRET - Under Data change events, select:
- Comments (required for
mode: "comments") - Agent session events (required for
mode: "agent-sessions") - Issues (recommended)
- Emoji reactions (optional)
- Comments (required for
- Under Team selection, choose All public teams or a specific team
- Click Create webhook
Thread model
Linear has four thread variants:
| Type | Description | Thread ID format |
|---|---|---|
| Issue-level | Top-level comments on an issue | linear:{issueId} |
| Comment thread | Replies nested under a specific comment | linear:{issueId}:c:{commentId} |
| Agent session on issue | App-actor session attached to an issue | linear:{issueId}:s:{agentSessionId} |
| Agent session on comment thread | App-actor session attached to a comment thread | linear:{issueId}:c:{commentId}:s:{agentSessionId} |
When a user writes a comment, the bot replies within the same comment thread.
Reactions
| SDK emoji | Linear emoji |
|---|---|
thumbs_up |
thumbs_up |
thumbs_down |
thumbs_down |
heart |
heart |
fire |
fire |
rocket |
rocket |
eyes |
eyes |
sparkles |
sparkles |
wave |
wave |
Configuration
All options are auto-detected from environment variables when not provided.
| Option | Required | Description |
|---|---|---|
apiKey |
No* | Personal API key. Auto-detected from LINEAR_API_KEY |
accessToken |
No* | Pre-obtained OAuth access token. Auto-detected from LINEAR_ACCESS_TOKEN |
clientId |
No* | Multi-tenant OAuth app client ID. Auto-detected from LINEAR_CLIENT_ID |
clientSecret |
No* | Multi-tenant OAuth app client secret. Auto-detected from LINEAR_CLIENT_SECRET |
encryptionKey |
No | AES-256-GCM key for encrypting stored OAuth tokens. Auto-detected from LINEAR_ENCRYPTION_KEY |
clientCredentials |
No* | Single-tenant client credentials config |
clientCredentials.scopes |
No | Scopes for client credentials auth. Defaults to ["read", "write", "comments:create", "issues:create"] |
mode |
No | Inbound webhook handling mode. "comments" by default, or "agent-sessions" for app-actor installs |
webhookSecret |
No** | Webhook signing secret. Auto-detected from LINEAR_WEBHOOK_SECRET |
userName |
No | Bot display name. Auto-detected from LINEAR_BOT_USERNAME (default: "linear-bot") |
apiUrl |
No | Override the Linear GraphQL API base URL. Auto-detected from LINEAR_API_URL |
logger |
No | Logger instance (defaults to ConsoleLogger("info")) |
*One of apiKey, accessToken, top-level clientId/clientSecret, or clientCredentials is required (via config or env vars).
**webhookSecret is required — either via config or LINEAR_WEBHOOK_SECRET env var.
Environment variables
# API Key auth
LINEAR_API_KEY=lin_api_xxxxxxxxxxxx
# OR pre-obtained access token
LINEAR_ACCESS_TOKEN=lin_oauth_xxxxxxxxxxxx
# OR single-tenant client credentials auth
LINEAR_CLIENT_CREDENTIALS_CLIENT_ID=your-client-id
LINEAR_CLIENT_CREDENTIALS_CLIENT_SECRET=your-client-secret
# Optional, comma-separated
LINEAR_CLIENT_CREDENTIALS_SCOPES=read,write,comments:create,issues:create
# OR multi-tenant OAuth installs
LINEAR_CLIENT_ID=your-client-id
LINEAR_CLIENT_SECRET=your-client-secret
LINEAR_REDIRECT_URI=https://your-domain.com/api/linear/install/callback
# Optional: encrypt stored OAuth tokens at rest
LINEAR_ENCRYPTION_KEY=...
# Optional: inbound webhook mode
# comments | agent-sessions
LINEAR_MODE=comments
# Required
LINEAR_WEBHOOK_SECRET=your-webhook-secret
# Optional: override the Linear GraphQL API base URL
LINEAR_API_URL=...
Features
Messaging
| Feature | Supported |
|---|---|
| Post message | Yes |
| Edit message | Partial |
| Delete message | Partial |
| File uploads | No |
| Streaming | Agent sessions / Post+Edit fallback |
Rich content
| Feature | Supported |
|---|---|
| Card format | Markdown |
| Buttons | No |
| Link buttons | No |
| Select menus | No |
| Tables | GFM |
| Fields | Yes |
| Images in cards | No |
| Modals | No |
Conversations
| Feature | Supported |
|---|---|
| Slash commands | No |
| Mentions | Yes |
| Add reactions | Yes |
| Remove reactions | Partial |
| Typing indicator | Agent sessions only |
| DMs | No |
| Ephemeral messages | No |
Message history
| Feature | Supported |
|---|---|
| Fetch messages | Yes |
| Fetch single message | No |
| Fetch thread info | Yes |
| Fetch channel messages | No |
| List threads | No |
| Fetch channel info | No |
| Post channel message | No |
Limitations
- Comment threads are still comment-based — typing indicators and native streaming only exist for app-actor agent sessions
- Agent session threads are append-only —
editMessageanddeleteMessagework for normal comments, but not for session activities - No DMs — Linear doesn't have direct messages
- No modals — Linear doesn't support interactive modals
- Action buttons — Rendered as text; use link buttons for clickable actions
- Remove reaction — Requires reaction ID lookup (not directly supported)
Troubleshooting
"Invalid signature" error
- Verify
LINEAR_WEBHOOK_SECRETmatches the secret from your webhook configuration - The webhook secret is shown only once at creation — regenerate if lost
Bot not responding to mentions
- Verify webhook events are configured with Comments resource type
- For app-actor mode, also enable Agent session events
- Check that the webhook URL is correct and accessible
- Ensure the
userNameconfig matches how users mention the bot - If using app-actor installs, ensure the app was installed with
actor=appandapp:mentionable - Linear may auto-disable webhooks after repeated failures
"Webhook expired" error
- Webhook timestamp is too old (> 5 minutes)
- Usually indicates a delivery delay or clock skew
- Check that your server time is synchronized
License
MIT