Skip to content

feat(react-headless): add Vercel AI SDK adapter - #936

Merged
vishxrad merged 3 commits into
mainfrom
visharad/vercel-ai-sdk-adapter
Aug 6, 2026
Merged

feat(react-headless): add Vercel AI SDK adapter#936
vishxrad merged 3 commits into
mainfrom
visharad/vercel-ai-sdk-adapter

Conversation

@vishxrad

@vishxrad vishxrad commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add vercelAIAdapter() for Vercel AI SDK v6 UIMessage streams returned by toUIMessageStreamResponse()
  • add vercelAIMessageFormat for UIMessage request/history conversion, including tool results and multi-step ordering
  • export both APIs from @openuidev/react-headless (and therefore @openuidev/react-ui)
  • keep ai@^6 as an optional, lazily loaded peer dependency
  • document setup and the currently unsupported UIMessage chunk types

Why react-headless

react-headless already owns the frontend stream adapters and message formats. Keeping this integration there avoids a template-local parser, while react-ui continues to expose it through its existing re-export.

Validation

  • pnpm --filter @openuidev/react-headless run test — 138 tests passed
  • pnpm --filter @openuidev/react-headless run ci
  • pnpm --filter @openuidev/react-headless run build
  • pnpm --filter @openuidev/react-headless run check:publint
  • pnpm --filter @openuidev/react-headless run check:attw
  • pnpm --filter @openuidev/react-ui run build
  • pnpm --filter @openuidev/docs exec fumadocs-mdx
  • smoke-tested public exports from both built packages

The package standalone typecheck still reports its existing missing Node process typings in unchanged store files; the new files have no TypeScript diagnostics.

Related

Supports the CLI backend-framework work in TH-2051. Once this package change is released, #785 can replace its template-local implementation with these shared exports.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openui-docs Ready Ready Preview Aug 6, 2026 5:03am

Request Review

@vishxrad
vishxrad marked this pull request as ready for review August 5, 2026 13:57
@vishxrad
vishxrad merged commit 2ece87c into main Aug 6, 2026
4 checks passed
@vishxrad
vishxrad deleted the visharad/vercel-ai-sdk-adapter branch August 6, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants