Conversation
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.
commit: |
Contributor
There was a problem hiding this comment.
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
JSONSchema7andTooltypes from the mainaipackage instead of internal packages - Updates peer dependency range to
>=5.0.0 <7.0.0to 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.
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@ai-sdk/providerand@ai-sdk/provider-utilsinternal packagesJSONSchema7andTooltypes directly from the mainaipackageai >=5.0.108 <7.0.0Why
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
src/tool.tsJSONSchema7fromaiinstead of@ai-sdk/provider, use dynamic peerDependencies for error messagessrc/types.tsToolfromaiinstead of@ai-sdk/provider-utilstsdown.config.ts@ai-sdk/provider-utilsfrom dts resolvepackage.jsonpnpm-workspace.yaml>=5.0.108 <7.0.0Test Plan