chore(ai-sdk): widen optional peer to support AI SDK v7
Closed
YB
4mo ago+193+193+012345678901234567890123456789-170-170-012345678901234567890123456789
Summary
- Widen the optional
aipeer from>=5.0.108 <7.0.0to>=5.0.108 <8.0.0so consumers can use AI SDK v7 (still supports v5 and v6). - Develop/test against
ai@7.0.47and@ai-sdk/openai@4.0.27. - No change to StackOne tool conversion or execution behavior.
toAISDK()still returns the same tool shape (inputSchemaviajsonSchema(),description, optionalexecute/execution).
Code tweaks (typing only)
- Accept AI SDK’s second
executeoptions argument (ignored) so tools type-check against v7ToolExecutionOptions(requiredcontext). - Tests pass
context: undefinedwhen callingexecutedirectly.
Docs / examples
- Replace stale
maxStepswithstopWhen: stepCountIs(...)(works across v5–v7; v7 keepsstepCountIsas an alias ofisStepCount). - Note that AI SDK v7 requires Node.js 22+ (package
enginesstays>=20.19.6becauseaiis optional).
Test plan
-
pnpm build -
pnpm vitest run src/tool.test.ts src/tool.test-d.ts src/tool-optional-ai.test.ts src/toolsets.test.ts - CI green
- Spot-check an example with
OPENAI_API_KEY+STACKONE_API_KEYif desired