Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Jan 5, 2026

Summary

  • Remove direct dependencies on @ai-sdk/provider and @ai-sdk/provider-utils internal packages
  • Import JSONSchema7 and Tool types directly from the main ai package
  • Update peerDependencies to accept ai >=5.0.108 <7.0.0
  • Use dynamic peerDependencies version in error messages

Why

Both AI SDK v5 and v6 export the required types from the main package, making the internal package dependencies unnecessary. This simplifies the dependency tree for consumers and allows the SDK to work with both v5 and v6 of the AI SDK.

Changes

File Change
src/tool.ts Import JSONSchema7 from ai instead of @ai-sdk/provider, use dynamic peerDependencies for error messages
src/types.ts Import Tool from ai instead of @ai-sdk/provider-utils
tsdown.config.ts Remove @ai-sdk/provider-utils from dts resolve
package.json Remove devDependencies
pnpm-workspace.yaml Remove from catalog, update peer range to >=5.0.108 <7.0.0

Test Plan

  • All existing tests pass
  • Type checking passes
  • Works with AI SDK v5 and v6

Remove direct dependencies on @ai-sdk/provider and @ai-sdk/provider-utils
internal packages. Import JSONSchema7 and Tool types directly from the
main 'ai' package instead.

This change:
- Removes @ai-sdk/provider and @ai-sdk/provider-utils from devDependencies
- Updates peerDependencies to accept ai >=5.0.0 <7.0.0
- Simplifies the dependency tree for consumers

Both AI SDK v5 and v6 export the required types from the main package,
making the internal package dependencies unnecessary.
@ryoppippi ryoppippi requested a review from a team as a code owner January 5, 2026 13:56
Copilot AI review requested due to automatic review settings January 5, 2026 13:56
@ryoppippi ryoppippi changed the title ENG-11722: feat(deps): support AI SDK v5 and v6 via unified imports feat(deps): support AI SDK v5 and v6 via unified imports [ENG-11722] Jan 5, 2026
@ryoppippi ryoppippi changed the title feat(deps): support AI SDK v5 and v6 via unified imports [ENG-11722] feat: support AI SDK v5 and v6 via unified imports [ENG-11722] Jan 5, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@269

commit: eec6fe7

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to support both AI SDK v5 and v6 by importing types from the main ai package instead of internal packages (@ai-sdk/provider and @ai-sdk/provider-utils), simplifying the dependency tree and improving compatibility.

  • Imports JSONSchema7 and Tool types from the main ai package instead of internal packages
  • Updates peer dependency range to >=5.0.0 <7.0.0 to accept both v5 and v6
  • Removes unnecessary internal package dependencies and updates the catalog accordingly

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tool.ts Changes import of JSONSchema7 from @ai-sdk/provider to ai package; includes minor formatting improvements
src/types.ts Changes import of Tool type from @ai-sdk/provider-utils to ai package
tsdown.config.ts Removes @ai-sdk/provider-utils from TypeScript declaration file resolution configuration
package.json Removes @ai-sdk/provider and @ai-sdk/provider-utils from devDependencies
pnpm-workspace.yaml Updates AI SDK dependencies in catalog to v3.x versions and changes peer dependency range to >=5.0.0 <7.0.0
pnpm-lock.yaml Updates lockfile to reflect dependency changes, upgrading to AI SDK v6.0.6 and removing internal package references
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

- Import peerDependencies from package.json to dynamically show
  supported AI SDK version range in installation error messages
- Update JSDoc comments to reference 'ai' package instead of
  @ai-sdk/provider-utils
- Simplify try-import example to use generic install hint

This ensures error messages stay in sync with peerDependencies
when the supported version range changes.
Add ai package to catalog:dev (^6.0.7) for development and testing,
separate from the peer dependency range (>=5.0.108 <7.0.0).

Also add @ai-sdk/* and ai to minimumReleaseAgeExclude since AI SDK
releases frequently and we want to stay up-to-date.
Copy link
Contributor

@glebedel glebedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryoppippi ryoppippi merged commit 043d3b8 into main Jan 5, 2026
16 checks passed
@ryoppippi ryoppippi deleted the v6 branch January 5, 2026 17:52
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.

3 participants