feat(ai-sdk): AI SDK integration#1707
Conversation
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes — adds the new @orpc/ai-sdk package that turns oRPC procedures and contracts into AI SDK v7+ tools, alongside an aiSdkTool metadata plugin, streaming async-iterator support, multi-schema composition, docs, and tests.
- Adds
@orpc/ai-sdkpackage scaffold (package.json,tsconfig.json,.gitignore,README.md) following existing integration conventions. - Adds
implementToolFactoryandcreateToolFactoryfor building AI SDK tools from oRPC contracts/procedures. - Adds
aiSdkToolmetadata plugin so contracts/procedures can carry default AI SDK tool options. - Adds preliminary streaming support when a procedure returns an
AsyncIteratorObject. - Adds AI SDK integration docs and updates the VitePress sidebar.
- Updates
vitest.config.tscoverage excludes and refreshespnpm-lock.yamlfor AI SDK v7.
ℹ️ Nitpicks
pnpm-lock.yamlnow pulls the AI SDK v7 transitive dependency tree; no action needed beyond confirming the updated lockfile installs cleanly in CI.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/json-schema
@orpc/nest
@orpc/next
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
There was a problem hiding this comment.
ℹ️ No critical issues — minor suggestions inline.
Reviewed changes — dependency cleanup for the new @orpc/ai-sdk package since the prior review.
- Bumped the
aipeer dependency from>=7.0.0to>=7.0.31. - Removed the unused
@orpc/openapidevDependency and its test usage. - Refreshed
pnpm-lock.yamlto match the updated dependency declarations.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |

Summary
Brings the AI SDK integration (
@orpc/ai-sdk) to v2, targeting AI SDK v7+. You can now turn procedures and contracts into AI SDK Tools:createToolFactoryconverts procedures into tools;implementToolFactoryimplements procedure contracts as toolsaiSdkToolmetadata plugin attaches base AI SDK tool options to procedures/contracts, with input/output types inferred from the contractasyncIteratorObjectoutputs stream each event as a preliminary tool result$defs/$ref-awareallOfcomposition)