feat: upgrade to ai sdk 5
Closes #1556
This upgrades the project to use the latest version of the AI SDK (v5.0.89). It also upgrades provider packages to versions compatible with AI SDK 5.
Note: The ollama-ai-provider package doesn't support AI SDK 5, so I swapped it out for the ollama-ai-provider-v2 package, which is recommended in AI SDK's docs.
The point of these upgrades is to address a security advisory which, though minor, was affecting some users' ability to ship Lingo.dev in production as it failed SOC 2 checks.
Don't merge yet, please, as I am still manually testing locally. I'll provide an update here if all my manual tests do fine. cc @maxprilutskiy
@The-Best-Codes have a look - a couple of interesting comments, and some prefault vs default issues that look a bit odd to me (is "prefault" a thing? what does it do?)
@maxprilutskiy Copilot mostly doesn't have a clue what it's talking about. Zod v4 change the .default behavior. The Zod v3 .default behavior is moved to the .prefault function in Zod v4, which they recommend using for backwards compatibility:
https://zod.dev/v4/changelog#default-updates:~:text=To%20replicate%20the%20old%20behavior%2C%20Zod%20implements%20a%20new%20.prefault()%20API.%20This%20is%20short%20for%20%22pre%2Dparse%20default%22
hi @The-Best-Codes please resolve the merge conflicts. Thanks!
Just need maintainer feedback on this: lingodotdev/lingo.dev/pull/1559/#discussion_r2530204932
Also need to test the MCP server manually. Otherwise, this is read to merge.
Merge conflict nightmare :face_with_peeking_eye: I will fix those when I get a chance. Any feedback on my comment?