Skip to content

chore(deps): migrate AI SDK to v7#6636

Draft
benjamincanac wants to merge 3 commits into
v4from
chore/ai-sdk-v7
Draft

chore(deps): migrate AI SDK to v7#6636
benjamincanac wants to merge 3 commits into
v4from
chore/ai-sdk-v7

Conversation

@benjamincanac

@benjamincanac benjamincanac commented Jun 25, 2026

Copy link
Copy Markdown
Member

Consolidates the AI SDK major bumps (the separate Renovate PRs) into a single migration:

package from to where
ai ^6 ^7 root devDependency, docs, playground
@ai-sdk/vue ^3 ^4 docs, playground
@ai-sdk/anthropic ^3 ^4 docs, playground
@ai-sdk/gateway ^3 ^4 docs, playground
@ai-sdk/mcp ^1 ^2 docs

Library

No code changes. src/ only consumes type exports from ai (UIMessage<M, D, U>, ChatStatus, UIDataTypes, UITools, FileUIPart, TextUIPart) plus the part.state literals, all identical in v7. The one removed UI symbol, isToolOrDynamicToolUIPart, was never used (we already use isToolUIPart).

Vue package migration (Chat class → useChat)

AI SDK 7 deprecates the @ai-sdk/vue Chat class in favor of the reactive useChat composable. Migrated every consumer so we are not shipping deprecated usage:

  • docs assistant Chat.vue, the four docs chat/sidebar examples, and the playground chat.vue + sidebar.vue
  • new Chat({...}) becomes useChat({...}), destructuring the reactive messages / status / error refs and the sendMessage / regenerate / stop methods
  • in the docs assistant the import is aliased as useAIChat to avoid colliding with our own auto-imported useChat UI-state composable
  • same migration applied to the markdown examples (chat.md, chat-prompt.md, chat-messages.md, blog post)

Server-side examples were also updated to v7 idioms: systeminstructions and stepCountIsisStepCount.

pnpm typecheck and eslint pass on the changed files.

Optional ai peer dependency

Added ai as an optional peerDependency with range ^6 || ^7. The Chat component types reference ai types in their public API, so a consumer already needs ai installed. Declaring it as an optional peer makes that relationship explicit and lets projects stay on v6 or move to v7 while resolving against a single install.

Heads up

I added a minimumReleaseAgeExclude block to pnpm-workspace.yaml because the v7 packages are newer than our supply-chain release-age gate and were otherwise blocked. If you would rather wait for them to age past the gate, drop that block and regenerate the lockfile in a few days.

Note

v7 requires Node 22+ and is ESM only (we are already ESM, so it is a CI matrix check at most).

- ai: ^6 → ^7 (root devDependency + docs)
- @ai-sdk/vue: ^3 → ^4
- @ai-sdk/anthropic: ^3 → ^4
- @ai-sdk/gateway: ^3 → ^4
- @ai-sdk/mcp: ^1 → ^2

No code changes required: the ai type surface the library consumes
(UIMessage, ChatStatus, UIDataTypes, UITools, FileUIPart, TextUIPart and
the part.state values) and the @ai-sdk/vue Chat API used by the docs are
unchanged in v7.

Adds minimumReleaseAgeExclude entries because the v7 packages are newer
than the supply-chain release-age gate.
@github-actions github-actions Bot added the v4 #4488 label Jun 25, 2026
@socket-security

socket-security Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​ai-sdk/​gateway@​4.0.0701008798100
Added@​ai-sdk/​vue@​4.0.0751007398100
Added@​ai-sdk/​anthropic@​4.0.0751008898100
Addedai@​7.0.08610010099100
Added@​ai-sdk/​mcp@​2.0.09110010098100

View full report

…peer

- playgrounds/nuxt: ai ^6 → ^7, @ai-sdk/{anthropic,gateway,vue} ^3 → ^4
- add `ai: ^6 || ^7` as an optional peerDependency so consumers on
  either major resolve against the same install
@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6636

commit: 09fda76

AI SDK 7 deprecates the @ai-sdk/vue Chat class in favor of the reactive
useChat composable. Migrate all real components, playground pages and
documentation examples:

- replace \`new Chat({...})\` with \`useChat({...})\` and destructure the
  reactive \`messages\`/\`status\`/\`error\` refs plus \`sendMessage\`/
  \`regenerate\`/\`stop\`
- in the docs assistant, alias the import as \`useAIChat\` to avoid the
  collision with the local \`useChat\` UI-state composable
- server examples: rename \`system\` to \`instructions\` and \`stepCountIs\`
  to \`isStepCount\`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant