## 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>