mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
b01ed548d7
* build: declare typescript (catalog:) in every package that runs tsc Twenty packages invoke tsc in their build/typecheck scripts without declaring a typescript dependency, resolving whatever tsc pnpm happens to leave reachable. That broke locally after the TypeScript 6 upgrade (#2700): base.json now uses the TS6-only 'types': ['*'] wildcard, and worktrees carrying pre-upgrade node_modules/.bin/tsc shims (orphaned typescript@5.9.3 bins that pnpm never refreshes for an undeclared dependency) fail with TS2688 'Cannot find type definition file for *'. Declaring 'typescript': 'catalog:' (the convention nest already follows) makes pnpm own each package's tsc bin, so version upgrades refresh the shims and this staleness class cannot recur. Packages without tsc in their scripts are left unchanged. Full pnpm build: 27/27 tasks green. * Address review: drop duplicate zod devDep; regenerate lockfile minimally - packages/world listed zod in both dependencies and devDependencies (pre-existing on main, surfaced by the devDependencies sort) — keep the runtime dependency only. - Regenerate pnpm-lock.yaml from a pristine main baseline with --lockfile-only (a clean-main run produces zero diff, so main has no drift). Remaining non-typescript changes are mechanical consequences of the change itself: typescript is an (optional) peer of several tooling dependencies, so declaring it in 20 importers creates new peer-resolution snapshot variants and prunes the now-orphaned old ones; plus one radix-ui 1.6.1->1.6.2 refresh in docs caused by its floating 'latest' specifier. - Validated: pnpm install --frozen-lockfile succeeds; full build 27/27.
@workflow/ai
Workflow SDK compatible helper library for the AI SDK.
Installation
npm install @workflow/ai
AI SDK Compatibility
This package supports both AI SDK v5 and AI SDK v6. The ai package is a peer dependency, so you control which version to use:
# For AI SDK v6 (recommended, latest)
npm install ai
# For AI SDK v5
npm install ai@5
Version Differences
| Feature | AI SDK v5 | AI SDK v6 |
|---|---|---|
| Model interface | LanguageModelV2 |
LanguageModelV3 |
| Provider package | @ai-sdk/provider@2.x |
@ai-sdk/provider@3.x |
Both versions work seamlessly with @workflow/ai - the package handles the differences internally through a compatibility layer.
Provider Packages
If you use the provider wrappers (e.g., @workflow/ai/anthropic, @workflow/ai/openai), install the corresponding provider packages:
# Example: Using Anthropic with AI SDK v6
npm install ai @ai-sdk/anthropic
# Example: Using OpenAI with AI SDK v5
npm install ai@5 @ai-sdk/openai@2
Documentation
For usage examples and full documentation, see the API reference.