Broad SEO/AEO pass across the docs site, adapter READMEs and AGENTS.md
files, and npm package metadata so Chat SDK content shows up better in
search engines, in LLM-driven package recommendations, and in
IDE/coding-agent context.
**Docs site**
- Adds a `## Resources` section to the Getting Started and AI overview
pages and to the Slack, Discord, GitHub, Liveblocks, and Sendblue
adapter pages, each linking to applicable guides/templates with
descriptions sourced from `resources-edge-config.json` and a cross-link
back to the central `/resources` hub.
**Adapter packages**
- Mirrors the same Resources sections into the Slack, Discord, and
GitHub READMEs (so they surface on npm) and into their AGENTS.md files
(so coding agents see them alongside the API notes).
- Expands `keywords` on every published adapter and state package — adds
`chat-sdk`, `chatbot`, `ai-agent`, `ai-sdk`, `vercel`, plus
platform-specific terms like `slack-bot`, `block-kit`, `slash-commands`,
`github-app`, `whatsapp-business`, `state-adapter`.
**Resources registry**
- Registers four new entries in `resources-edge-config.json`
(Human-in-the-Loop guide, Liveblocks AI agent guide, Slack + Vercel Blob
guide, Durable iMessage Agent template) and runs `pnpm sync-resources`
so the bundled `chat` package guides, `templates.json`, and
`skills/chat/SKILL.md` all pick them up.
- Fixes the synced Slack AI agent guide to import `toAiMessages` from
`chat/ai` instead of the deprecated `chat` re-export path (the upstream
KB source has also been updated, so future syncs will preserve this).
**Drive-by fixes**
- Resend adapter doc quick start: corrects `MemoryStateAdapter` class
import to the `createMemoryState()` factory (matching every other
adapter doc).
- Zalo adapter doc: drops the "community adapter" callout that
duplicated frontmatter.
**Tooling / CI**
- Adds `tsx` as a root devDependency so `pnpm sync-resources` works out
of the box (it previously relied on `npx tsx`, which hung when not
pre-cached).
- Loosens the CI changeset gate to also skip `packages/chat/resources/`
(generated data), matching the existing `*.md` carve-out.
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
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>
## Summary
Rename the public native client getter on the GitHub, Linear, and Slack
adapters so it matches the underlying SDK class instead of the generic
`.client`. The previous `.client` getter is preserved as a `@deprecated`
alias on all three adapters, so existing code keeps working without
changes.
- `bot.getAdapter("github").client` is now
`bot.getAdapter("github").octokit` (returns `Octokit`)
- `bot.getAdapter("linear").client` is now
`bot.getAdapter("linear").linearClient` (returns `LinearClient` from
`@linear/sdk`)
- `bot.getAdapter("slack").client` is now
`bot.getAdapter("slack").webClient` (returns `WebClient` from
`@slack/web-api`)
Each new getter has TSDoc covering single- vs multi-tenant resolution
rules and when calling outside a webhook handler throws. Focused unit
tests assert that the new getter returns the underlying SDK instance,
that single-tenant calls return the same instance, that the deprecated
`.client` alias points at the new getter, that multi-tenant mode without
webhook context throws on both getters, and that inside a webhook
context the getter resolves to the per-tenant client.
Commits are split for review:
1. `feat(adapter-github): rename adapter.client to adapter.octokit`
2. `feat(adapter-linear): rename adapter.client to adapter.linearClient`
3. `docs: use .octokit / .linearClient in chat-sdk.dev examples`
4. `chore: changeset for adapter native client getter rename`
5. `fix: hoist regex literals in new client-getter tests to module
scope`
6. `feat(adapter-slack): rename adapter.client to adapter.webClient`
7. `docs: include slack .webClient in chat-sdk.dev examples`
8. `chore: include adapter-slack in native client getter rename
changeset`
9. `test(adapter-github,adapter-linear): cover with-context resolution
on the new client getters`
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
## Summary
Refreshes the adapter docs end-to-end so every adapter — official,
vendor-official, and community — now ships hand-authored MDX, lives
under a clean URL structure, and renders on a polished
sidebar/right-rail layout dedicated to `/adapters` (the shared `/docs`
chrome is untouched).
```mermaid
flowchart LR
subgraph Before
direction TB
OB[official] --> CB[community<br/>incl. 5 vendor pages]
end
subgraph After
direction TB
OA[official] --> VA[vendor-official<br/>5 pages] --> CA[community]
end
Before -.-> After
```
### Content & routing
- **New `/adapters/vendor-official/<slug>` route** for vendor-maintained
adapters (Beeper Matrix, Photon iMessage, Liveblocks, Resend, Zernio).
Sidebar gets a third labelled group ("Vendor-Official Adapters") between
Official and Community, with a top divider matching the existing
Community treatment.
- **All 13 vendor-official + community adapters migrated** from runtime
README fetching to hand-authored MDX with rich `features:` matrices and
full body content (install, quick start, configuration, auth,
gateway/streaming, troubleshooting). README fetch stays as a fallback
for any future community adapter that hasn't been migrated yet, gated by
a new `mdxBody: true` frontmatter flag.
- **Messenger filter pages removed** (`/adapters/for/<messenger>` + the
"Browse by messenger" chip row on `/adapters`). Existing URLs
308-redirect to `/adapters`.
- **Permanent redirects** from
`/adapters/community/{matrix,imessage,resend,zernio,liveblocks}` to
their new `/adapters/vendor-official/...` paths.
- **Fixed** `/docs/adapters` and `/docs/state` so the bare pages are
accessible again — the previous catch-all redirect (`:slug*`) was
swallowing them. Switched to `:slug+` so subpath URLs still 308 while
the bare pages render.
### Visual polish
- **Adapter-only sidebar variant** (`AdaptersDocsLayout` +
`AdaptersSidebar`) with uppercase eyebrow separators, tighter rows, and
a thin themed scrollbar utility class. The shared `/docs` sidebar is
untouched.
- **Restyled `AdapterHero`**: drops the badges row + packageName, sits
the title inline with the logo, larger 17 px tagline, horizontal divider
beneath the block.
- **Restyled `PackageInstall`** as a tabbed dark single-line snippet
with a `$` prompt prefix and a copy button — replaces the previous
multi-line `CodeBlock` layout.
- **New "Deploy your chat app on Vercel" upsell card** (`<Upsell />`)
replaces the old `EditSource / ScrollTop / Feedback / CopyPage` footer
cluster on every adapter detail page.
- **Listing & messenger pages**: align the H1 to a tighter `text-4xl
sm:text-[44px]`, and the section headers to `text-base font-medium
tracking-tight` with a one-line muted lede.
### Tooling & tests
- Added `mdxBody: true` opt-in to the adapter frontmatter schema
(`source.config.ts`), and updated both detail-page handlers
(`community/[slug]` and the new `vendor-official/[slug]`) to render the
MDX body when present, falling back to README fetch otherwise.
- Refactored both detail-page handlers to flatten the body-render
branches into a `renderBody()` helper, removing the nested ternaries
that were tripping `lint/style/noNestedTernary`.
- New test file
[`packages/integration-tests/src/docs-adapters.test.ts`](https://github.com/vercel/chat/blob/docs/refresh-adapters/packages/integration-tests/src/docs-adapters.test.ts)
— **220 new assertions** covering:
- Adapter MDX frontmatter completeness, slug ↔ filename consistency, and
`type ∈ {platform, state}`.
- Vendor-official invariants: exactly the expected slugs,
`vendorOfficial: true`, `community: true`, `author`, `mdxBody: true`,
`<FeatureSupport />` rendered.
- Community invariants: `community: true` (never vendor-official),
`mdxBody: true`, `<FeatureSupport />`.
- Official invariants: never flagged, `packageName` always under
`@chat-adapter/*`.
- `adapters.json` ↔ MDX sync on `packageName` / `type` / `community` /
`vendorOfficial`.
- Extended `VALID_DOC_PACKAGES` so `docs-content.test.ts` accepts the
new vendor-official + community packages, plus `@chat-adapter/web`,
`@chat-adapter/web/react`, and `@chat-adapter/messenger`.
### Per-package AGENTS.md
- Added `AGENTS.md` to every official adapter and state adapter (14
packages), each tailored to that adapter's surface — overview, directory
layout, build/test commands, public exports, thread ID format, webhook
flow, authentication, format conversion, cards/streaming, platform
quirks, testing approach, coding conventions, and release rules.
- Added a one-line `CLAUDE.md` (`@AGENTS.md`) beside each so Claude Code
picks up the same instructions through its built-in resolver — same
convention as the root.
### Web adapter copy
- Cleaned up the Web adapter tagline (removed inline backticks) and
dropped the now-redundant "v1 scope" section from the body.
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
* add .nvmrc file
* follow up
* make support of Node >= 20 explicit
* update default Node version for contributing to the repo to 24
* run build-and-test CI job for both Node 20 and 24
* add changeset for package.json change
* chore: changed class function access to protected
* chore: format
* chore: added changeset
* chore(changeset): drop unchanged shared package, expand description
* refactor(adapters): keep internal state private, only protected for extension surface
Narrow scope of #475: caches, polling/runtime state, and one-shot warning
flags stay private. Methods and shared helpers (logger, formatConverter,
chat, config) remain protected as the documented extension surface.
Also fixes a typecheck failure where gchat's oauth2Client (now private)
no longer requires a portable type for the emitted .d.ts.
* test(adapters): add subclass extensibility tests
Each adapter now has a compile-time test that subclasses can access the
documented protected surface. If any of these members revert to private,
the test file fails to type-check.
* style: apply ultracite formatting to subclass tests
* style(slack): mark static cache TTL constants as readonly
These three protected static cache TTLs are configuration constants, not
mutable state. Marking them readonly prevents subclasses (the new extension
surface from this PR) from mutating values shared across every instance
in-process.
* test(adapters): document intent of subclass extensibility tests
Mirrors the inline comment from the Telegram subclass test across the other
nine adapter tests so future readers immediately understand these blocks are
type-only sentinels — they fail at typecheck (not vitest) if a member reverts
to private.
* docs(adapters): document subclassing for adapter customization
Adds a "Customizing an adapter via subclassing" section to the Adapters page
that walks through extending an official adapter to override a protected hook
(using the issue #433 Telegram processUpdate scenario as the canonical
example) and clarifies that private members are intentionally off-limits.
* refactor(linear): expose accessTokenExpiry to subclasses
The surrounding refreshClientCredentialsToken and ensureValidToken methods
are now protected, but accessTokenExpiry was kept private — meaning a
subclass overriding either method couldn't read or update the expiry without
calling super. Flipping it to protected lets subclasses fully reimplement
the token-refresh flow.
* chore(changeset): bump adapters from patch to minor
This PR adds a new, additive capability — subclassing official adapters to
override protected hooks. Per CONTRIBUTING.md, additive backward-compatible
features warrant a minor bump rather than a patch.
* docs(adapters): clarify subclassing surface stability
Correct the parenthetical describing what stays `private` (credentials are
now `protected`) and add a callout warning that the `protected` extension
surface is intentionally broader than the public API but not yet fully
stable, so subclass authors know to pin versions and prefer overriding
the smallest hook.
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
* 1
* w
* 3f
* x
* ln
* gh
* sl
* t1
* u
* t2
* t3
* t4
* t5
* d
* d2
* cs
* fx
* cl
* docs: clean up subject + .client docs and restructure nav
- subject.mdx: simplify prose, drop redundant platform lists, link to MessageSubject API and getAdapter
- api/message.mdx: add MessageSubject TypeTable
- api/chat.mdx: expand getAdapter with Direct client access content
- adapters.mdx: add Parent subject and Native client rows to feature matrix
- usage.mdx: mention .client under Accessing adapters
- adapter-github/-linear READMEs: add Direct API client section
- meta.json: split Features into Messaging + Interactivity, move error-handling to Usage
- title case across messaging-cluster page titles
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
* feat: add chat.getUser() for cross-platform user lookups
Add UserInfo type and optional getUser() method to the Adapter interface.
Implement on Slack (extends existing lookupUser with email/avatar),
Discord, Google Chat, GitHub, Linear, and Telegram adapters.
Add "Who Am I" button to the example app demonstrating the feature.
Update docs with getUser API reference and usage examples.
* fix(chat): improve getUser across slack and gchat adapters
- slack: return null from lookupUser on failure instead of fallback
object, removing the isBot === undefined sentinel in getUser
- slack: use image_192 instead of image_72 for better avatar quality
- gchat: cache avatarUrl from webhook sender payload
- gchat: return avatarUrl in getUser response
- gchat: fix tests to use current cache format with isBot field
- docs: document null return, fix example to use message.author
* chore: fix lint
* docs(chat): include Microsoft Teams in getUser supported adapters list
* feat(adapter-teams): add getUser() support (#404)
* feat(adapter-teams): add getUser() via Microsoft Graph API
- Cache aadObjectId from activity.from during webhook handling
- Implement getUser() using Graph GET /users/{user-id} endpoint
- Requires User.Read.All application permission
- Returns null gracefully when user hasn't interacted or Graph call fails
* docs: add getUser() section to Teams adapter README
* chore: apply ultracite formatting to adapter-teams getUser
* fix(chat): cover all 7 adapters in getUser inference and document per-platform constraints
---------
Co-authored-by: dancer <josh@afterima.ge>
* feat: add apiUrl config option to all platform adapters
Add a consistent `apiUrl` option across all 8 adapters for custom API
endpoint configuration (e.g. GovSlack, GitHub Enterprise, GCC-High
Teams). Includes env var fallbacks and unit tests for each adapter.
* add changeset for adapter apiUrl feature
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
* feat(github): add support for issue comment threads
Handle issue_comment webhooks on plain issues, not just PRs.
Issue threads use the format github:owner/repo:issue:42.
* fix(github): propagate threadType in GitHubRawMessage for issue threads
parseMessage and other methods now correctly produce issue-format thread
IDs when the raw message originated from a plain issue, not a PR.
---------
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
* fix(github): accumulate stream before posting, log fallback edit errors
The GitHub adapter relied on chat-sdk's default fallbackStream which
posts a placeholder then edits it every 500ms. GitHub returns 422 on
these edits because body is empty during TTFT, and rapid edits risk
secondary rate limits.
Add stream() to GitHubAdapter that accumulates the full text before
posting once. Also log fallbackStream edit errors instead of silently
swallowing them.
* test: add tests for GitHub adapter stream() and fallbackStream logging
* style: format with biome
* refactor: use Logger instead of console.warn in fallbackStream
Plumb the Chat logger into ThreadImpl so fallbackStream uses the
structured logger instead of raw console.warn.
* test: simplify fallbackStream logging test
Reuse mockLogger from mock-adapter.ts and rely on createMockAdapter's
default editMessage mock instead of re-specifying the resolved value.
* test: use vi.mocked, drop redundant stream=undefined
* chore: add changeset
* refactor: extract accumulateStream utility, deduplicate GitHub and WhatsApp adapters
* Revert "refactor: extract accumulateStream utility, deduplicate GitHub and WhatsApp adapters"
This reverts commit 0a3ca3cc9a.
* feat: add LinkPreview to Message for URL and embedded message support
Add `links: LinkPreview[]` to `Message` so handlers can access URLs
shared in messages. Each LinkPreview contains the URL and optional
unfurl metadata (title, description, siteName, imageUrl).
On Slack, links are extracted from rich_text block elements (falling
back to <url> patterns in text). Links pointing to other Slack messages
(*.slack.com/archives/{channel}/p{ts}) include a `fetchMessage()`
callback that retrieves and parses the linked message.
`toAiMessages()` now appends link metadata to message content
automatically, labeling embedded message links distinctly so AI models
understand the context.
- Add LinkPreview interface to core types
- Add links field to Message, MessageData, SerializedMessage
- Extract links in Slack adapter (blocks + text fallback)
- Provide fetchMessage for Slack message URLs
- Set links: [] in all other adapters
- Include link metadata in toAiMessages() output
- Document LinkPreview in message API docs
- Document toAiMessages() in streaming and handling-events docs
- Add toAiMessages to API overview
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove redundant links: [] from adapters for backwards compatibility
The Message constructor already defaults links to [] when not provided,
so adapters that don't support link extraction don't need to pass it
explicitly. This makes the change backwards-compatible for third-party
adapters — they get an empty links array without any code changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: avoid polynomial regex in Slack link extraction
Replace `[^>|]+` pattern (which backtracks on `|`) with `[^>]+`
and a programmatic indexOf split. This prevents ReDoS on untrusted
message text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add attachment support and mention tests to toAiMessages
toAiMessages now includes image and text-file attachments as multipart
content compatible with AI SDK's UserContent type:
- Images → ImagePart (via fetchData base64 or URL fallback)
- Text files (text/*, application/json, etc.) → FilePart
- Video/audio → warns via onUnsupportedAttachment callback
- Other file types → silently skipped
The function is now async to support fetchData() calls for inlining
attachment data as base64 data URIs. When fetchData fails, falls back
to the attachment URL.
Also adds mention rendering tests verifying that @mentions appear as
@name (not Slack's <@U123> syntax) in toAiMessages output, both in
plain messages and with links/includeNames enabled.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: make AiMessage types structurally compatible with AI SDK
Use a discriminated union (AiUserMessage | AiAssistantMessage) so
AiMessage[] is directly assignable to ModelMessage[] without casts.
Match DataContent type (string | Uint8Array | ArrayBuffer | Buffer)
for image/file parts to ensure structural compatibility.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(example): pass image attachments to AI via toAiMessages
The onNewMention handler was passing message.text directly to the AI
agent, dropping any image attachments. Now uses toAiMessages([message])
which includes images via fetchData as base64 inline data, enabling
the AI to actually see uploaded images.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: pass image data as Buffer, not data URI
The AI SDK expects DataContent (Buffer/Uint8Array/base64 string) for
image and file parts, not data URIs. Passing `data:image/png;base64,...`
caused "Could not process image" errors from the API. Now passes the
raw Buffer from fetchData() directly, with mediaType set separately.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: require fetchData for attachments, no URL fallback
Slack's url_private requires Bearer token auth that AI providers can't
provide. Remove URL fallback — attachments are only included when
fetchData() succeeds (which handles auth internally). Log errors
instead of silently falling through.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: add temporary logging to toAiMessages image handling
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use data URIs for image/file attachments in toAiMessages
The AI SDK's convertToLanguageModelV2DataContent parses data: URIs
to extract both the base64 content and media type. Raw base64 strings
lose the media type (returns mediaType: void 0), and raw Buffers may
not serialize correctly across network boundaries. Data URIs are the
most reliable format.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: log fetched image size to diagnose API rejection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: log prompt structure to diagnose image rejection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use FilePart instead of ImagePart for image attachments
The AI SDK's ImagePart with data URI strings doesn't work correctly
through the AI Gateway. Use FilePart (type: "file") with data URI
in the data field instead — this matches the working pattern used by
other projects and handles image data correctly across all providers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: comprehensive logging at every decision point in toAiMessages
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: log data prefix to verify content format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: log token capture and detect HTML responses from Slack file fetch
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: improve Slack file fetch error message and remove debug logging
When Slack returns an HTML login page instead of file data (typically
due to missing "files:read" OAuth scope), the error message now
explicitly tells the user what scope to add. Also removes all
temporary debug logging from toAiMessages and createAttachment.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add transform support
* changeset
* address-feedback
* lint
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Initial marketplace draft
* Update language
* Add logos to cards
* Redesign cards
* Update adapter-card.tsx
* Update adapter-card.tsx
* Migrate marketplace to adapters
* Update meta.json
* Split adapters into new three groups
* Add iMessage
* Move adapter docs to READMEs
* Cleanup docs
* Add more logos, implement shadcn ui components
* Update adapters.json
* Add Streamdown
* Fetch vercel readmes from workspace
* Update readme-content.tsx
* Upgrade Streamdown
* Update global.css
* Update adapters.json
* Update adapters.json
* Add links to docs
* List upcoming official adapters
* Update adapters.json
* Fix adapters links
* Fix typo
* Misc fixes
* Update adapters.json
* Update adapters.json
* Migrate new info
* Update pnpm-lock.yaml
* Update adapter-card.tsx
* Add postgres to adapters page
* Update adapter-card.tsx
* Migrate postgres docs
* Add pg to valid README imports
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Move feature matrices from docs to package READMEs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove packages tables from adapter/state docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Genericize adapter/state doc descriptions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: improve adapters page accessibility and empty state handling
* Add custom adapter building section to SKILL.md
* Use currentColor for GitHub, Linear, and Memory icons
* Use GitHub API for README fetch, add heading to fallback state
Use the GitHub REST API instead of raw.githubusercontent.com to
automatically resolve the repo's default branch, so community
adapters using master or other branch names work correctly.
* Update adapters-grid.tsx
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>