Unverified 提交 54b7a22d authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Upgrade to AI SDK v6 (#2102)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Modernizes AI integration across the app. > > - Upgrade `ai` to v6 and all `@ai-sdk/*` providers to v3/v4; add `@ai-sdk/mcp`, remove `@openrouter/ai-sdk-provider` > - Migrate from `LanguageModelV2` to `LanguageModel`/`LanguageModelV3`; refactor fallback model to v3 streaming API > - Switch OpenRouter to `createOpenAICompatible` (`https://openrouter.ai/api/v1`) > - Replace experimental MCP with `@ai-sdk/mcp` (`createMCPClient`); update tool execution to `ToolExecutionOptions` and sanitize tool keys > - Update AI message envelope to `ai@v6` and types (`AiMessagesJsonV6`); adjust DB schema and parsing utilities > - Update chat/local-agent handlers to v6 stream parts (reasoning/tool parts), persist `aiMessagesJson`, and wire MCP tools into `ToolSet` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fc966595cbd9c6ff7d261497f00bfe79d0fff9e3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Upgrade the app to AI SDK v6 to modernize model integrations, MCP tooling, and streaming. This improves stability, unifies types on v3, and removes the OpenRouter provider in favor of an OpenAI-compatible setup. - **Dependencies** - Upgraded ai to 6.0.14 and all @ai-sdk providers to v3/v4. - Added @ai-sdk/mcp; removed @openrouter/ai-sdk-provider. - Pinned @ai-sdk/provider to 3.0.2. - Updated transitive deps (e.g., google-auth-library, gaxios) for Node >=18. - **Refactors** - Moved from LanguageModelV2 to v3 and standardized on ai’s LanguageModel. - Rebuilt fallback model to v3 spec with safer stream retries. - Switched MCP client to createMCPClient and updated tool execution to ToolExecutionOptions. - Replaced OpenRouter integration with createOpenAICompatible (baseURL https://openrouter.ai/api/v1). - Updated AI messages envelope to "ai@v6"; older "ai@v5" envelopes are ignored. <sup>Written for commit fc966595cbd9c6ff7d261497f00bfe79d0fff9e3. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 da46d808
...@@ -9,15 +9,16 @@ ...@@ -9,15 +9,16 @@
"version": "0.33.0-beta.1", "version": "0.33.0-beta.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ai-sdk/amazon-bedrock": "^3.0.15", "@ai-sdk/amazon-bedrock": "^4.0.9",
"@ai-sdk/anthropic": "^2.0.4", "@ai-sdk/anthropic": "^3.0.7",
"@ai-sdk/azure": "^2.0.17", "@ai-sdk/azure": "^3.0.7",
"@ai-sdk/google": "^2.0.6", "@ai-sdk/google": "^3.0.5",
"@ai-sdk/google-vertex": "3.0.16", "@ai-sdk/google-vertex": "4.0.8",
"@ai-sdk/openai": "2.0.15", "@ai-sdk/mcp": "^1.0.5",
"@ai-sdk/openai-compatible": "^1.0.8", "@ai-sdk/openai": "3.0.7",
"@ai-sdk/provider-utils": "^3.0.3", "@ai-sdk/openai-compatible": "^2.0.4",
"@ai-sdk/xai": "^2.0.16", "@ai-sdk/provider-utils": "^4.0.4",
"@ai-sdk/xai": "^3.0.10",
"@babel/parser": "^7.28.5", "@babel/parser": "^7.28.5",
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
"@dyad-sh/supabase-management-js": "v1.0.1", "@dyad-sh/supabase-management-js": "v1.0.1",
...@@ -26,7 +27,6 @@ ...@@ -26,7 +27,6 @@
"@monaco-editor/react": "^4.7.0-rc.0", "@monaco-editor/react": "^4.7.0-rc.0",
"@neondatabase/api-client": "^2.1.0", "@neondatabase/api-client": "^2.1.0",
"@neondatabase/serverless": "^1.0.1", "@neondatabase/serverless": "^1.0.1",
"@openrouter/ai-sdk-provider": "^1.1.2",
"@radix-ui/react-accordion": "^1.2.4", "@radix-ui/react-accordion": "^1.2.4",
"@radix-ui/react-alert-dialog": "^1.1.13", "@radix-ui/react-alert-dialog": "^1.1.13",
"@radix-ui/react-checkbox": "^1.3.2", "@radix-ui/react-checkbox": "^1.3.2",
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@vercel/sdk": "^1.18.0", "@vercel/sdk": "^1.18.0",
"@vitejs/plugin-react": "^4.3.4", "@vitejs/plugin-react": "^4.3.4",
"ai": "^5.0.15", "ai": "^6.0.14",
"better-sqlite3": "^12.4.1", "better-sqlite3": "^12.4.1",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
...@@ -146,14 +146,14 @@ ...@@ -146,14 +146,14 @@
} }
}, },
"node_modules/@ai-sdk/amazon-bedrock": { "node_modules/@ai-sdk/amazon-bedrock": {
"version": "3.0.18", "version": "4.0.9",
"resolved": "https://registry.npmjs.org/@ai-sdk/amazon-bedrock/-/amazon-bedrock-3.0.18.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/amazon-bedrock/-/amazon-bedrock-4.0.9.tgz",
"integrity": "sha512-cWi/3mQtzygm2AplILsoh20tOSOJA7MLo9O8U8ENf601lpKzWYccRhBkeprZxHcvu687OwSQb4KtMjSmMzg4Jw==", "integrity": "sha512-ObpdX+ws91P0Z0e4D3/HeGypFjmsa8UlZY1rA32iGb94GeNuyndOshpmHEzqgssQy9AGiVs26IJWYn7RmO3beg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/anthropic": "2.0.14", "@ai-sdk/anthropic": "3.0.7",
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.8", "@ai-sdk/provider-utils": "4.0.4",
"@smithy/eventstream-codec": "^4.0.1", "@smithy/eventstream-codec": "^4.0.1",
"@smithy/util-utf8": "^4.0.0", "@smithy/util-utf8": "^4.0.0",
"aws4fetch": "^1.0.20" "aws4fetch": "^1.0.20"
...@@ -162,212 +162,147 @@ ...@@ -162,212 +162,147 @@
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/anthropic": { "node_modules/@ai-sdk/anthropic": {
"version": "2.0.14", "version": "3.0.7",
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-2.0.14.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-3.0.7.tgz",
"integrity": "sha512-TTVzYsTO6gwKk5qpqb3bx1G1F/gpvRZDhRumTZsN0obZo2pmTLZhGoLVQSj8pm6S9ofBFMwR0lIjbCq2xMKfdw==", "integrity": "sha512-WFE56yxgjecd77f8pNj1TkusfCKh34E4h+0J0qVOKDNFXuOsZiAb6dIG9Q3PUrwY1MuiMQLD/9ir0s+dVcVfeA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.8" "@ai-sdk/provider-utils": "4.0.4"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/azure": { "node_modules/@ai-sdk/azure": {
"version": "2.0.27", "version": "3.0.7",
"resolved": "https://registry.npmjs.org/@ai-sdk/azure/-/azure-2.0.27.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/azure/-/azure-3.0.7.tgz",
"integrity": "sha512-kVEkLQIIahzuBRPaUlHpZlOiVNr2Zp0cMKyjCpbb/agUt5x5OjtOEMOraHavd5i0PAvuZa4vYtTtI4rSP9ywcw==", "integrity": "sha512-TuoW5wIe8EXMlcLbBy8f19JLN8qJXR+4sej2SPhkeZONIoWMUgkxDjCnRUlFb5WFNYMqWmlnTzpMEJUgnwqAvw==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/openai": "2.0.27",
"@ai-sdk/provider": "2.0.0",
"@ai-sdk/provider-utils": "3.0.8"
},
"engines": {
"node": ">=18"
},
"peerDependencies": {
"zod": "^3.25.76 || ^4"
}
},
"node_modules/@ai-sdk/azure/node_modules/@ai-sdk/openai": {
"version": "2.0.27",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-2.0.27.tgz",
"integrity": "sha512-5fUFBlE9qGFgezVIVkzQk87qZYkxsn5PsedtCFPoGxHK6c2QVYHuD1UcrVIKt0elr043Vx17Xo/gS5oJAR5YEQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/openai": "3.0.7",
"@ai-sdk/provider-utils": "3.0.8" "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "4.0.4"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/gateway": { "node_modules/@ai-sdk/gateway": {
"version": "1.0.20", "version": "3.0.9",
"resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-1.0.20.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-3.0.9.tgz",
"integrity": "sha512-2K0kGnHyLfT1v2+3xXbLqohfWBJ/vmIh1FTWnrvZfvuUuBdOi2DMgnSQzkLvFVLyM8mhOcx+ZwU6IOOsuyOv/w==", "integrity": "sha512-EA5dZIukimwoJ9HIPuuREotAqaTItpdc/yImzVF0XGNg7B0YRJmYI8Uq3aCMr87vjr1YB1cWUfnrTt6OJ9eHiQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.8" "@ai-sdk/provider-utils": "4.0.4",
"@vercel/oidc": "3.1.0"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/google": { "node_modules/@ai-sdk/google": {
"version": "2.0.13", "version": "3.0.5",
"resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-2.0.13.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-3.0.5.tgz",
"integrity": "sha512-5WauM+IrqbllWT4uXZVrfTnPCSKTtkHGNsD2CYD0JgGfeIOpa285UYCYUi0Z4RtcovwnZitvQABq465FfeLwzA==", "integrity": "sha512-+aaq8HEdEqJdXt/7ULHlc4oRL9RGdSNfJ8ptF/q1lWvuvH+Rz0c8zVk9DELCjQYxreuFgEMdtLtMD6cejNKjJg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.8" "@ai-sdk/provider-utils": "4.0.4"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/google-vertex": { "node_modules/@ai-sdk/google-vertex": {
"version": "3.0.16", "version": "4.0.8",
"resolved": "https://registry.npmjs.org/@ai-sdk/google-vertex/-/google-vertex-3.0.16.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/google-vertex/-/google-vertex-4.0.8.tgz",
"integrity": "sha512-tStlnOCRGRqKKJSCOtXhijX4r9kYVK2v+Vs7miJnfvr3sZfO8nRS0xnNhfgu17xuNi5LMMufeCYURTz4lKxzUQ==", "integrity": "sha512-HFtkf9gtqTDHRMYcUK9EBQUn48Ynn1JbLRcBpqA4thQV+Am102Ay4HcVLLKO5RU85UQg8Q43rP0TlpXmHv/aqA==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/anthropic": "2.0.9",
"@ai-sdk/google": "2.0.11",
"@ai-sdk/provider": "2.0.0",
"@ai-sdk/provider-utils": "3.0.7",
"google-auth-library": "^9.15.0"
},
"engines": {
"node": ">=18"
},
"peerDependencies": {
"zod": "^3.25.76 || ^4"
}
},
"node_modules/@ai-sdk/google-vertex/node_modules/@ai-sdk/anthropic": {
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-2.0.9.tgz",
"integrity": "sha512-1kQgL2A3PeqfEcHHmqy4NxRc8rbgLS71bHBuvDFfDz3VAAyndkilPMCLNDSP2mJVGAej2EMWJ1sShRAxzn70jA==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "2.0.0",
"@ai-sdk/provider-utils": "3.0.7"
},
"engines": {
"node": ">=18"
},
"peerDependencies": {
"zod": "^3.25.76 || ^4"
}
},
"node_modules/@ai-sdk/google-vertex/node_modules/@ai-sdk/google": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-2.0.11.tgz",
"integrity": "sha512-dnVIgSz1DZD/0gVau6ifYN3HZFN15HZwC9VjevTFfvrfSfbEvpXj5x/k/zk/0XuQrlQ5g8JiwJtxc9bx24x2xw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/anthropic": "3.0.7",
"@ai-sdk/provider-utils": "3.0.7" "@ai-sdk/google": "3.0.5",
"@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "4.0.4",
"google-auth-library": "^10.5.0"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/google-vertex/node_modules/@ai-sdk/provider-utils": { "node_modules/@ai-sdk/mcp": {
"version": "3.0.7", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-3.0.7.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/mcp/-/mcp-1.0.5.tgz",
"integrity": "sha512-o3BS5/t8KnBL3ubP8k3w77AByOypLm+pkIL/DCw0qKkhDbvhCy+L3hRTGPikpdb8WHcylAeKsjgwOxhj4cqTUA==", "integrity": "sha512-ViLrt9ybjtwSubMBhnV3Wjaq+ZITx1UlFU5mnLAgWj2HAxoEIwpZGRAqdD/ojJlV950wEM/OCha/1rtGdUy/bw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@standard-schema/spec": "^1.0.0", "@ai-sdk/provider-utils": "4.0.4",
"eventsource-parser": "^3.0.5" "pkce-challenge": "^5.0.0"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/openai": { "node_modules/@ai-sdk/openai": {
"version": "2.0.15", "version": "3.0.7",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-2.0.15.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-3.0.7.tgz",
"integrity": "sha512-/IUyQ9ck4uUTtGojvQamcUWpNWkwpL/P1F6LYRxpQGj07H00oJEBH/VUizrIq0ZvW/vkuK6c6X4UJS9PrdYyxA==", "integrity": "sha512-CBoYn1U59Lop8yBL9KuVjHCKc/B06q9Qo0SasRwHoyMEq+X4I8LQZu3a8Ck1jwwcZTTxfyiExB70LtIRSynBDA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.3" "@ai-sdk/provider-utils": "4.0.4"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/openai-compatible": { "node_modules/@ai-sdk/openai-compatible": {
"version": "1.0.15", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai-compatible/-/openai-compatible-1.0.15.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/openai-compatible/-/openai-compatible-2.0.4.tgz",
"integrity": "sha512-i4TzohCxuFzBSdRNPa9eNFW6AYDZ5itbxz+rJa2kpNTMYqHgqKPGzet3X6eLIUVntA10icrqhWT+hUhxXZIS9Q==", "integrity": "sha512-kzsXyybJKM3wtUtGZkNbvmpDwqpsvg/hTjlPZe3s/bCx3enVdAlRtXD853nnj6mZjteNCDLoR2OgVLuDpyRN5Q==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "2.0.0",
"@ai-sdk/provider-utils": "3.0.8"
},
"engines": {
"node": ">=18"
},
"peerDependencies": {
"zod": "^3.25.76 || ^4"
}
},
"node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-3.0.3.tgz",
"integrity": "sha512-kAxIw1nYmFW1g5TvE54ZB3eNtgZna0RnLjPUp1ltz1+t9xkXJIuDT4atrwfau9IbS0BOef38wqrI8CjFfQrxhw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@standard-schema/spec": "^1.0.0", "@ai-sdk/provider-utils": "4.0.4"
"eventsource-parser": "^3.0.3",
"zod-to-json-schema": "^3.24.1"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/provider": { "node_modules/@ai-sdk/provider": {
"version": "2.0.0", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.2.tgz",
"integrity": "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==", "integrity": "sha512-HrEmNt/BH/hkQ7zpi2o6N3k1ZR1QTb7z85WYhYygiTxOQuaml4CMtHCWRbric5WPU+RNsYI7r1EpyVQMKO1pYw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"json-schema": "^0.4.0" "json-schema": "^0.4.0"
...@@ -377,37 +312,37 @@ ...@@ -377,37 +312,37 @@
} }
}, },
"node_modules/@ai-sdk/provider-utils": { "node_modules/@ai-sdk/provider-utils": {
"version": "3.0.8", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-3.0.8.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-4.0.4.tgz",
"integrity": "sha512-cDj1iigu7MW2tgAQeBzOiLhjHOUM9vENsgh4oAVitek0d//WdgfPCsKO3euP7m7LyO/j9a1vr/So+BGNdpFXYw==", "integrity": "sha512-VxhX0B/dWGbpNHxrKCWUAJKXIXV015J4e7qYjdIU9lLWeptk0KMLGcqkB4wFxff5Njqur8dt8wRi1MN9lZtDqg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@standard-schema/spec": "^1.0.0", "@standard-schema/spec": "^1.1.0",
"eventsource-parser": "^3.0.5" "eventsource-parser": "^3.0.6"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@ai-sdk/xai": { "node_modules/@ai-sdk/xai": {
"version": "2.0.16", "version": "3.0.10",
"resolved": "https://registry.npmjs.org/@ai-sdk/xai/-/xai-2.0.16.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/xai/-/xai-3.0.10.tgz",
"integrity": "sha512-t/Ohnn5OExgXZe+yhlpqOFZoixIXpaSBycWnvWfJ7JrpiNdg4WZEjWH+298zUXvqAT5wZvM93h1Ba4TkoYSyZg==", "integrity": "sha512-36Uf1/aALU1pZkyiCh6DkOqcy7GNmFXg3PRDyWT2K/w4cgRh8cEAOy4P9o47KM35F2PAHPGIqv5y2K791yWBdg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/openai-compatible": "1.0.15", "@ai-sdk/openai-compatible": "2.0.4",
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.8" "@ai-sdk/provider-utils": "4.0.4"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/@aws-crypto/crc32": { "node_modules/@aws-crypto/crc32": {
...@@ -5006,19 +4941,6 @@ ...@@ -5006,19 +4941,6 @@
"@octokit/openapi-types": "^12.11.0" "@octokit/openapi-types": "^12.11.0"
} }
}, },
"node_modules/@openrouter/ai-sdk-provider": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@openrouter/ai-sdk-provider/-/ai-sdk-provider-1.2.0.tgz",
"integrity": "sha512-stuIwq7Yb7DNmk3GuCtz+oS3nZOY4TXEV3V5KsknDGQN7Fpu3KRMQVWRc1J073xKdf0FC9EHOctSyzsACmp5Ag==",
"license": "Apache-2.0",
"engines": {
"node": ">=18"
},
"peerDependencies": {
"ai": "^5.0.0",
"zod": "^3.24.1 || ^v4"
}
},
"node_modules/@opentelemetry/api": { "node_modules/@opentelemetry/api": {
"version": "1.9.0", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
...@@ -5147,6 +5069,16 @@ ...@@ -5147,6 +5069,16 @@
"devOptional": true, "devOptional": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"license": "MIT",
"optional": true,
"engines": {
"node": ">=14"
}
},
"node_modules/@playwright/test": { "node_modules/@playwright/test": {
"version": "1.55.0", "version": "1.55.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz",
...@@ -6704,9 +6636,9 @@ ...@@ -6704,9 +6636,9 @@
} }
}, },
"node_modules/@standard-schema/spec": { "node_modules/@standard-schema/spec": {
"version": "1.0.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
"integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@swc/helpers": { "node_modules/@swc/helpers": {
...@@ -7801,6 +7733,15 @@ ...@@ -7801,6 +7733,15 @@
"integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
"license": "ISC" "license": "ISC"
}, },
"node_modules/@vercel/oidc": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.1.0.tgz",
"integrity": "sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w==",
"license": "Apache-2.0",
"engines": {
"node": ">= 20"
}
},
"node_modules/@vercel/sdk": { "node_modules/@vercel/sdk": {
"version": "1.18.0", "version": "1.18.0",
"resolved": "https://registry.npmjs.org/@vercel/sdk/-/sdk-1.18.0.tgz", "resolved": "https://registry.npmjs.org/@vercel/sdk/-/sdk-1.18.0.tgz",
...@@ -8306,21 +8247,21 @@ ...@@ -8306,21 +8247,21 @@
} }
}, },
"node_modules/ai": { "node_modules/ai": {
"version": "5.0.38", "version": "6.0.14",
"resolved": "https://registry.npmjs.org/ai/-/ai-5.0.38.tgz", "resolved": "https://registry.npmjs.org/ai/-/ai-6.0.14.tgz",
"integrity": "sha512-ocJURGbEXt1DNqurqavs43kBS2tTzWR71nMTWB1UKDswvjrgOLnibLDF/z7SeRV4DGWt8Kc5LWRXfNlBKkht0A==", "integrity": "sha512-OaEJFeQ3gb45eZtC/lSNKqAxmsrqWxC8wLmIVXFYAMvPXE3lb96zIdS3swYArR4uXOVt6N7H/XZSyQz/Dl+HTw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/gateway": "1.0.20", "@ai-sdk/gateway": "3.0.9",
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "3.0.2",
"@ai-sdk/provider-utils": "3.0.8", "@ai-sdk/provider-utils": "4.0.4",
"@opentelemetry/api": "1.9.0" "@opentelemetry/api": "1.9.0"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.25.76 || ^4" "zod": "^3.25.76 || ^4.1.8"
} }
}, },
"node_modules/ajv": { "node_modules/ajv": {
...@@ -9853,6 +9794,15 @@ ...@@ -9853,6 +9794,15 @@
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
"license": "MIT",
"engines": {
"node": ">= 12"
}
},
"node_modules/data-view-buffer": { "node_modules/data-view-buffer": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
...@@ -12545,6 +12495,38 @@ ...@@ -12545,6 +12495,38 @@
} }
} }
}, },
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"license": "MIT",
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/fetch-blob/node_modules/web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/fflate": { "node_modules/fflate": {
"version": "0.8.2", "version": "0.8.2",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
...@@ -12822,6 +12804,18 @@ ...@@ -12822,6 +12804,18 @@
"node": ">= 12.20" "node": ">= 12.20"
} }
}, },
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"license": "MIT",
"dependencies": {
"fetch-blob": "^3.1.2"
},
"engines": {
"node": ">=12.20.0"
}
},
"node_modules/forwarded": { "node_modules/forwarded": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
...@@ -13006,46 +13000,146 @@ ...@@ -13006,46 +13000,146 @@
"optional": true "optional": true
}, },
"node_modules/gaxios": { "node_modules/gaxios": {
"version": "6.7.1", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.3.tgz",
"integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", "integrity": "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"extend": "^3.0.2", "extend": "^3.0.2",
"https-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.1",
"is-stream": "^2.0.0", "node-fetch": "^3.3.2",
"node-fetch": "^2.6.9", "rimraf": "^5.0.1"
"uuid": "^9.0.1"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=18"
} }
}, },
"node_modules/gaxios/node_modules/uuid": { "node_modules/gaxios/node_modules/brace-expansion": {
"version": "9.0.1", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"funding": [ "license": "MIT",
"https://github.com/sponsors/broofa", "dependencies": {
"https://github.com/sponsors/ctavan" "balanced-match": "^1.0.0"
], }
},
"node_modules/gaxios/node_modules/glob": {
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
"integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
"license": "ISC",
"dependencies": {
"foreground-child": "^3.1.0",
"jackspeak": "^3.1.2",
"minimatch": "^9.0.4",
"minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0",
"path-scurry": "^1.11.1"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/gaxios/node_modules/jackspeak": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
"integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/cliui": "^8.0.2"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"optionalDependencies": {
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/gaxios/node_modules/lru-cache": {
"version": "10.4.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
"license": "ISC"
},
"node_modules/gaxios/node_modules/minimatch": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/gaxios/node_modules/node-fetch": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
"license": "MIT", "license": "MIT",
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/gaxios/node_modules/path-scurry": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^10.2.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
},
"engines": {
"node": ">=16 || 14 >=14.18"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/gaxios/node_modules/rimraf": {
"version": "5.0.10",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz",
"integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==",
"license": "ISC",
"dependencies": {
"glob": "^10.3.7"
},
"bin": { "bin": {
"uuid": "dist/bin/uuid" "rimraf": "dist/esm/bin.mjs"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/gcp-metadata": { "node_modules/gcp-metadata": {
"version": "6.1.1", "version": "8.1.2",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz",
"integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", "integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"gaxios": "^6.1.1", "gaxios": "^7.0.0",
"google-logging-utils": "^0.0.2", "google-logging-utils": "^1.0.0",
"json-bigint": "^1.0.0" "json-bigint": "^1.0.0"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=18"
} }
}, },
"node_modules/geist": { "node_modules/geist": {
...@@ -13459,26 +13553,27 @@ ...@@ -13459,26 +13553,27 @@
} }
}, },
"node_modules/google-auth-library": { "node_modules/google-auth-library": {
"version": "9.15.1", "version": "10.5.0",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz",
"integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", "integrity": "sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"base64-js": "^1.3.0", "base64-js": "^1.3.0",
"ecdsa-sig-formatter": "^1.0.11", "ecdsa-sig-formatter": "^1.0.11",
"gaxios": "^6.1.1", "gaxios": "^7.0.0",
"gcp-metadata": "^6.1.0", "gcp-metadata": "^8.0.0",
"gtoken": "^7.0.0", "google-logging-utils": "^1.0.0",
"gtoken": "^8.0.0",
"jws": "^4.0.0" "jws": "^4.0.0"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=18"
} }
}, },
"node_modules/google-logging-utils": { "node_modules/google-logging-utils": {
"version": "0.0.2", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz",
"integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", "integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": ">=14" "node": ">=14"
...@@ -13536,16 +13631,16 @@ ...@@ -13536,16 +13631,16 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/gtoken": { "node_modules/gtoken": {
"version": "7.1.0", "version": "8.0.0",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz",
"integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"gaxios": "^6.0.0", "gaxios": "^7.0.0",
"jws": "^4.0.0" "jws": "^4.0.0"
}, },
"engines": { "engines": {
"node": ">=14.0.0" "node": ">=18"
} }
}, },
"node_modules/happy-dom": { "node_modules/happy-dom": {
...@@ -14883,12 +14978,12 @@ ...@@ -14883,12 +14978,12 @@
} }
}, },
"node_modules/jws": { "node_modules/jws": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jwa": "^2.0.0", "jwa": "^2.0.1",
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
}, },
......
...@@ -85,15 +85,16 @@ ...@@ -85,15 +85,16 @@
"vitest": "^3.1.1" "vitest": "^3.1.1"
}, },
"dependencies": { "dependencies": {
"@ai-sdk/amazon-bedrock": "^3.0.15", "@ai-sdk/amazon-bedrock": "^4.0.9",
"@ai-sdk/anthropic": "^2.0.4", "@ai-sdk/anthropic": "^3.0.7",
"@ai-sdk/azure": "^2.0.17", "@ai-sdk/azure": "^3.0.7",
"@ai-sdk/google": "^2.0.6", "@ai-sdk/google": "^3.0.5",
"@ai-sdk/google-vertex": "3.0.16", "@ai-sdk/google-vertex": "4.0.8",
"@ai-sdk/openai": "2.0.15", "@ai-sdk/mcp": "^1.0.5",
"@ai-sdk/openai-compatible": "^1.0.8", "@ai-sdk/openai": "3.0.7",
"@ai-sdk/provider-utils": "^3.0.3", "@ai-sdk/openai-compatible": "^2.0.4",
"@ai-sdk/xai": "^2.0.16", "@ai-sdk/provider-utils": "^4.0.4",
"@ai-sdk/xai": "^3.0.10",
"@babel/parser": "^7.28.5", "@babel/parser": "^7.28.5",
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
"@dyad-sh/supabase-management-js": "v1.0.1", "@dyad-sh/supabase-management-js": "v1.0.1",
...@@ -102,7 +103,6 @@ ...@@ -102,7 +103,6 @@
"@monaco-editor/react": "^4.7.0-rc.0", "@monaco-editor/react": "^4.7.0-rc.0",
"@neondatabase/api-client": "^2.1.0", "@neondatabase/api-client": "^2.1.0",
"@neondatabase/serverless": "^1.0.1", "@neondatabase/serverless": "^1.0.1",
"@openrouter/ai-sdk-provider": "^1.1.2",
"@radix-ui/react-accordion": "^1.2.4", "@radix-ui/react-accordion": "^1.2.4",
"@radix-ui/react-alert-dialog": "^1.1.13", "@radix-ui/react-alert-dialog": "^1.1.13",
"@radix-ui/react-checkbox": "^1.3.2", "@radix-ui/react-checkbox": "^1.3.2",
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@vercel/sdk": "^1.18.0", "@vercel/sdk": "^1.18.0",
"@vitejs/plugin-react": "^4.3.4", "@vitejs/plugin-react": "^4.3.4",
"ai": "^5.0.15", "ai": "^6.0.14",
"better-sqlite3": "^12.4.1", "better-sqlite3": "^12.4.1",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
......
...@@ -3,9 +3,9 @@ import { integer, sqliteTable, text, unique } from "drizzle-orm/sqlite-core"; ...@@ -3,9 +3,9 @@ import { integer, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
import { relations } from "drizzle-orm"; import { relations } from "drizzle-orm";
import type { ModelMessage } from "ai"; import type { ModelMessage } from "ai";
export const AI_MESSAGES_SDK_VERSION = "ai@v5" as const; export const AI_MESSAGES_SDK_VERSION = "ai@v6" as const;
export type AiMessagesJsonV5 = { export type AiMessagesJsonV6 = {
messages: ModelMessage[]; messages: ModelMessage[];
sdkVersion: typeof AI_MESSAGES_SDK_VERSION; sdkVersion: typeof AI_MESSAGES_SDK_VERSION;
}; };
...@@ -94,7 +94,7 @@ export const messages = sqliteTable("messages", { ...@@ -94,7 +94,7 @@ export const messages = sqliteTable("messages", {
// AI SDK messages (v5 envelope) for preserving tool calls/results in agent mode // AI SDK messages (v5 envelope) for preserving tool calls/results in agent mode
aiMessagesJson: text("ai_messages_json", { aiMessagesJson: text("ai_messages_json", {
mode: "json", mode: "json",
}).$type<AiMessagesJsonV5 | null>(), }).$type<AiMessagesJsonV6 | null>(),
createdAt: integer("created_at", { mode: "timestamp" }) createdAt: integer("created_at", { mode: "timestamp" })
.notNull() .notNull()
.default(sql`(unixepoch())`), .default(sql`(unixepoch())`),
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
TextStreamPart, TextStreamPart,
stepCountIs, stepCountIs,
hasToolCall, hasToolCall,
type ToolExecutionOptions,
} from "ai"; } from "ai";
import { db } from "../../db"; import { db } from "../../db";
...@@ -1705,13 +1706,12 @@ async function getMcpTools(event: IpcMainInvokeEvent): Promise<ToolSet> { ...@@ -1705,13 +1706,12 @@ async function getMcpTools(event: IpcMainInvokeEvent): Promise<ToolSet> {
for (const s of servers) { for (const s of servers) {
const client = await mcpManager.getClient(s.id); const client = await mcpManager.getClient(s.id);
const toolSet = await client.tools(); const toolSet = await client.tools();
for (const [name, tool] of Object.entries(toolSet)) { for (const [name, mcpTool] of Object.entries(toolSet)) {
const key = `${String(s.name || "").replace(/[^a-zA-Z0-9_-]/g, "-")}__${String(name).replace(/[^a-zA-Z0-9_-]/g, "-")}`; const key = `${String(s.name || "").replace(/[^a-zA-Z0-9_-]/g, "-")}__${String(name).replace(/[^a-zA-Z0-9_-]/g, "-")}`;
const original = tool;
mcpToolSet[key] = { mcpToolSet[key] = {
description: original?.description, description: mcpTool.description,
inputSchema: original?.inputSchema, inputSchema: mcpTool.inputSchema,
execute: async (args: any, execCtx: any) => { execute: async (args: unknown, execCtx: ToolExecutionOptions) => {
const inputPreview = const inputPreview =
typeof args === "string" typeof args === "string"
? args ? args
...@@ -1722,12 +1722,12 @@ async function getMcpTools(event: IpcMainInvokeEvent): Promise<ToolSet> { ...@@ -1722,12 +1722,12 @@ async function getMcpTools(event: IpcMainInvokeEvent): Promise<ToolSet> {
serverId: s.id, serverId: s.id,
serverName: s.name, serverName: s.name,
toolName: name, toolName: name,
toolDescription: original?.description, toolDescription: mcpTool.description,
inputPreview, inputPreview,
}); });
if (!ok) throw new Error(`User declined running tool ${key}`); if (!ok) throw new Error(`User declined running tool ${key}`);
const res = await original.execute?.(args, execCtx); const res = await mcpTool.execute(args, execCtx);
return typeof res === "string" ? res : JSON.stringify(res); return typeof res === "string" ? res : JSON.stringify(res);
}, },
......
...@@ -89,9 +89,9 @@ export function registerMcpHandlers() { ...@@ -89,9 +89,9 @@ export function registerMcpHandlers() {
const client = await mcpManager.getClient(serverId); const client = await mcpManager.getClient(serverId);
const remoteTools = await client.tools(); const remoteTools = await client.tools();
const tools = await Promise.all( const tools = await Promise.all(
Object.entries(remoteTools).map(async ([name, tool]) => ({ Object.entries(remoteTools).map(async ([name, mcpTool]) => ({
name, name,
description: tool.description ?? null, description: mcpTool.description ?? null,
consent: await getStoredConsent(serverId, name), consent: await getStoredConsent(serverId, name),
})), })),
); );
......
import { AI_MESSAGES_SDK_VERSION, AiMessagesJsonV5 } from "@/db/schema"; import { AI_MESSAGES_SDK_VERSION, AiMessagesJsonV6 } from "@/db/schema";
import type { ModelMessage } from "ai"; import type { ModelMessage } from "ai";
import log from "electron-log"; import log from "electron-log";
...@@ -13,12 +13,12 @@ export const MAX_AI_MESSAGES_SIZE = 1_000_000; ...@@ -13,12 +13,12 @@ export const MAX_AI_MESSAGES_SIZE = 1_000_000;
*/ */
export function getAiMessagesJsonIfWithinLimit( export function getAiMessagesJsonIfWithinLimit(
aiMessages: ModelMessage[], aiMessages: ModelMessage[],
): AiMessagesJsonV5 | undefined { ): AiMessagesJsonV6 | undefined {
if (!aiMessages || aiMessages.length === 0) { if (!aiMessages || aiMessages.length === 0) {
return undefined; return undefined;
} }
const payload: AiMessagesJsonV5 = { const payload: AiMessagesJsonV6 = {
messages: aiMessages, messages: aiMessages,
sdkVersion: AI_MESSAGES_SDK_VERSION, sdkVersion: AI_MESSAGES_SDK_VERSION,
}; };
...@@ -39,7 +39,7 @@ export type DbMessageForParsing = { ...@@ -39,7 +39,7 @@ export type DbMessageForParsing = {
id: number; id: number;
role: string; role: string;
content: string; content: string;
aiMessagesJson: AiMessagesJsonV5 | ModelMessage[] | null; aiMessagesJson: AiMessagesJsonV6 | ModelMessage[] | null;
}; };
/** /**
...@@ -61,19 +61,18 @@ export function parseAiMessagesJson(msg: DbMessageForParsing): ModelMessage[] { ...@@ -61,19 +61,18 @@ export function parseAiMessagesJson(msg: DbMessageForParsing): ModelMessage[] {
return parsed; return parsed;
} }
// Current shape: { messages: ModelMessage[]; sdkVersion: "ai@v5" }
if ( if (
parsed && parsed &&
typeof parsed === "object" && typeof parsed === "object" &&
"sdkVersion" in parsed && "sdkVersion" in parsed &&
(parsed as AiMessagesJsonV5).sdkVersion === AI_MESSAGES_SDK_VERSION && (parsed as AiMessagesJsonV6).sdkVersion === AI_MESSAGES_SDK_VERSION &&
"messages" in parsed && "messages" in parsed &&
Array.isArray((parsed as AiMessagesJsonV5).messages) && Array.isArray((parsed as AiMessagesJsonV6).messages) &&
(parsed as AiMessagesJsonV5).messages.every( (parsed as AiMessagesJsonV6).messages.every(
(m: ModelMessage) => m && typeof m.role === "string", (m: ModelMessage) => m && typeof m.role === "string",
) )
) { ) {
return (parsed as AiMessagesJsonV5).messages; return (parsed as AiMessagesJsonV6).messages;
} }
} }
......
import { import type {
LanguageModelV2, LanguageModelV3,
LanguageModelV2CallOptions, LanguageModelV3CallOptions,
LanguageModelV2StreamPart, LanguageModelV3StreamPart,
} from "@ai-sdk/provider"; } from "@ai-sdk/provider";
import type { LanguageModel } from "ai";
// Types // Types
interface FallbackSettings { interface FallbackSettings {
models: Array<LanguageModelV2>; models: Array<LanguageModel>;
} }
interface RetryState { interface RetryState {
...@@ -17,7 +18,7 @@ interface RetryState { ...@@ -17,7 +18,7 @@ interface RetryState {
} }
interface StreamResult { interface StreamResult {
stream: ReadableStream<LanguageModelV2StreamPart>; stream: ReadableStream<LanguageModelV3StreamPart>;
request?: { body?: unknown }; request?: { body?: unknown };
response?: { headers?: Record<string, string> }; response?: { headers?: Record<string, string> };
} }
...@@ -87,12 +88,12 @@ export function defaultShouldRetryThisError(error: any): boolean { ...@@ -87,12 +88,12 @@ export function defaultShouldRetryThisError(error: any): boolean {
} }
} }
export function createFallback(settings: FallbackSettings): FallbackModel { export function createFallback(settings: FallbackSettings): LanguageModel {
return new FallbackModel(settings); return new FallbackModel(settings);
} }
export class FallbackModel implements LanguageModelV2 { class FallbackModel implements LanguageModelV3 {
readonly specificationVersion = "v2"; readonly specificationVersion = "v3" as const;
private readonly settings: FallbackSettings; private readonly settings: FallbackSettings;
private currentModelIndex: number = 0; private currentModelIndex: number = 0;
private lastModelReset: number = Date.now(); private lastModelReset: number = Date.now();
...@@ -114,24 +115,32 @@ export class FallbackModel implements LanguageModelV2 { ...@@ -114,24 +115,32 @@ export class FallbackModel implements LanguageModelV2 {
} }
get modelId(): string { get modelId(): string {
return this.getCurrentModel().modelId; return this.getUnderlyingModel().modelId;
} }
get provider(): string { get provider(): string {
return this.getCurrentModel().provider; return this.getUnderlyingModel().provider;
} }
get supportedUrls(): get supportedUrls():
| Record<string, RegExp[]> | Record<string, RegExp[]>
| PromiseLike<Record<string, RegExp[]>> { | PromiseLike<Record<string, RegExp[]>> {
return this.getCurrentModel().supportedUrls; return this.getUnderlyingModel().supportedUrls;
} }
private getCurrentModel(): LanguageModelV2 { private getUnderlyingModel(): LanguageModelV3 {
const model = this.settings.models[this.currentModelIndex]; const model = this.settings.models[this.currentModelIndex];
if (!model) { if (!model) {
throw new Error(`Model at index ${this.currentModelIndex} not found`); throw new Error(`Model at index ${this.currentModelIndex} not found`);
} }
// The model is either a string (GatewayModelId) or LanguageModelV2/V3
// In this fallback context, we only support actual model instances
if (typeof model === "string") {
throw new Error("String model IDs are not supported in fallback model");
}
if (model.specificationVersion !== "v3") {
throw new Error("Model is not a v3 model");
}
return model; return model;
} }
...@@ -214,11 +223,11 @@ export class FallbackModel implements LanguageModelV2 { ...@@ -214,11 +223,11 @@ export class FallbackModel implements LanguageModelV2 {
throw new Error("doGenerate is not supported for fallback model"); throw new Error("doGenerate is not supported for fallback model");
} }
async doStream(options: LanguageModelV2CallOptions): Promise<StreamResult> { async doStream(options: LanguageModelV3CallOptions): Promise<StreamResult> {
this.checkAndResetModel(); this.checkAndResetModel();
return this.retry(async (retryState) => { return this.retry(async (retryState) => {
const result = await this.getCurrentModel().doStream(options); const result = await this.getUnderlyingModel().doStream(options);
// Create a wrapped stream that handles errors gracefully // Create a wrapped stream that handles errors gracefully
const wrappedStream = this.createWrappedStream( const wrappedStream = this.createWrappedStream(
...@@ -235,21 +244,21 @@ export class FallbackModel implements LanguageModelV2 { ...@@ -235,21 +244,21 @@ export class FallbackModel implements LanguageModelV2 {
} }
private createWrappedStream( private createWrappedStream(
originalStream: ReadableStream<LanguageModelV2StreamPart>, originalStream: ReadableStream<LanguageModelV3StreamPart>,
options: LanguageModelV2CallOptions, options: LanguageModelV3CallOptions,
retryState: RetryState, retryState: RetryState,
): ReadableStream<LanguageModelV2StreamPart> { ): ReadableStream<LanguageModelV3StreamPart> {
let hasStreamedContent = false; let hasStreamedContent = false;
// eslint-disable-next-line @typescript-eslint/no-this-alias // eslint-disable-next-line @typescript-eslint/no-this-alias
const fallbackModel = this; const fallbackModel = this;
return new ReadableStream<LanguageModelV2StreamPart>({ return new ReadableStream<LanguageModelV3StreamPart>({
async start(controller) { async start(controller) {
let reader: ReadableStreamDefaultReader<LanguageModelV2StreamPart> | null = let reader: ReadableStreamDefaultReader<LanguageModelV3StreamPart> | null =
null; null;
const processStream = async ( const processStream = async (
stream: ReadableStream<LanguageModelV2StreamPart>, stream: ReadableStream<LanguageModelV3StreamPart>,
): Promise<void> => { ): Promise<void> => {
reader = stream.getReader(); reader = stream.getReader();
...@@ -322,7 +331,7 @@ export class FallbackModel implements LanguageModelV2 { ...@@ -322,7 +331,7 @@ export class FallbackModel implements LanguageModelV2 {
try { try {
// Create a new stream with the next model // Create a new stream with the next model
const nextResult = await fallbackModel const nextResult = await fallbackModel
.getCurrentModel() .getUnderlyingModel()
.doStream(options); .doStream(options);
await processStream(nextResult.stream); await processStream(nextResult.stream);
} catch (nextError) { } catch (nextError) {
......
...@@ -4,8 +4,7 @@ import { createAnthropic } from "@ai-sdk/anthropic"; ...@@ -4,8 +4,7 @@ import { createAnthropic } from "@ai-sdk/anthropic";
import { createXai } from "@ai-sdk/xai"; import { createXai } from "@ai-sdk/xai";
import { createVertex as createGoogleVertex } from "@ai-sdk/google-vertex"; import { createVertex as createGoogleVertex } from "@ai-sdk/google-vertex";
import { createAzure } from "@ai-sdk/azure"; import { createAzure } from "@ai-sdk/azure";
import { LanguageModelV2 } from "@ai-sdk/provider"; import type { LanguageModel } from "ai";
import { createOpenRouter } from "@openrouter/ai-sdk-provider";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock"; import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock";
import type { import type {
...@@ -48,7 +47,7 @@ const AUTO_MODELS = [ ...@@ -48,7 +47,7 @@ const AUTO_MODELS = [
]; ];
export interface ModelClient { export interface ModelClient {
model: LanguageModelV2; model: LanguageModel;
builtinProviderId?: string; builtinProviderId?: string;
} }
...@@ -280,7 +279,11 @@ function getRegularModelClient( ...@@ -280,7 +279,11 @@ function getRegularModelClient(
}; };
} }
case "openrouter": { case "openrouter": {
const provider = createOpenRouter({ apiKey }); const provider = createOpenAICompatible({
name: "openrouter",
baseURL: "https://openrouter.ai/api/v1",
apiKey,
});
return { return {
modelClient: { modelClient: {
model: provider(model.name), model: provider(model.name),
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
import log from "electron-log"; import log from "electron-log";
import { getExtraProviderOptions } from "./thinking_utils"; import { getExtraProviderOptions } from "./thinking_utils";
import type { UserSettings } from "../../lib/schemas"; import type { UserSettings } from "../../lib/schemas";
import { LanguageModelV2 } from "@ai-sdk/provider"; import type { LanguageModel } from "ai";
const logger = log.scope("llm_engine_provider"); const logger = log.scope("llm_engine_provider");
...@@ -50,10 +50,7 @@ export interface DyadEngineProvider { ...@@ -50,10 +50,7 @@ export interface DyadEngineProvider {
/** /**
Creates a model for text generation. Creates a model for text generation.
*/ */
( (modelId: ExampleChatModelId, settings?: ExampleChatSettings): LanguageModel;
modelId: ExampleChatModelId,
settings?: ExampleChatSettings,
): LanguageModelV2;
/** /**
Creates a chat model for text generation. Creates a chat model for text generation.
...@@ -61,7 +58,7 @@ Creates a chat model for text generation. ...@@ -61,7 +58,7 @@ Creates a chat model for text generation.
chatModel( chatModel(
modelId: ExampleChatModelId, modelId: ExampleChatModelId,
settings?: ExampleChatSettings, settings?: ExampleChatSettings,
): LanguageModelV2; ): LanguageModel;
} }
export function createDyadEngine( export function createDyadEngine(
......
import { db } from "../../db"; import { db } from "../../db";
import { mcpServers } from "../../db/schema"; import { mcpServers } from "../../db/schema";
import { experimental_createMCPClient, experimental_MCPClient } from "ai"; import { createMCPClient, type MCPClient } from "@ai-sdk/mcp";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
...@@ -13,9 +13,9 @@ class McpManager { ...@@ -13,9 +13,9 @@ class McpManager {
return this._instance; return this._instance;
} }
private clients = new Map<number, experimental_MCPClient>(); private clients = new Map<number, MCPClient>();
async getClient(serverId: number): Promise<experimental_MCPClient> { async getClient(serverId: number): Promise<MCPClient> {
const existing = this.clients.get(serverId); const existing = this.clients.get(serverId);
if (existing) return existing; if (existing) return existing;
const server = await db const server = await db
...@@ -40,7 +40,7 @@ class McpManager { ...@@ -40,7 +40,7 @@ class McpManager {
} else { } else {
throw new Error(`Unsupported MCP transport: ${s.transport}`); throw new Error(`Unsupported MCP transport: ${s.transport}`);
} }
const client = await experimental_createMCPClient({ const client = await createMCPClient({
transport, transport,
}); });
this.clients.set(serverId, client); this.clients.set(serverId, client);
......
import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import type { FetchFunction } from "@ai-sdk/provider-utils"; import type { FetchFunction } from "@ai-sdk/provider-utils";
import { withoutTrailingSlash } from "@ai-sdk/provider-utils"; import { withoutTrailingSlash } from "@ai-sdk/provider-utils";
import type { LanguageModelV2 } from "@ai-sdk/provider"; import type { LanguageModel } from "ai";
type OllamaChatModelId = string; type OllamaChatModelId = string;
...@@ -19,7 +19,7 @@ export interface OllamaProviderOptions { ...@@ -19,7 +19,7 @@ export interface OllamaProviderOptions {
export interface OllamaChatSettings {} export interface OllamaChatSettings {}
export interface OllamaProvider { export interface OllamaProvider {
(modelId: OllamaChatModelId, settings?: OllamaChatSettings): LanguageModelV2; (modelId: OllamaChatModelId, settings?: OllamaChatSettings): LanguageModel;
} }
export function createOllamaProvider( export function createOllamaProvider(
......
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
*/ */
import { IpcMainInvokeEvent } from "electron"; import { IpcMainInvokeEvent } from "electron";
import { streamText, ToolSet, stepCountIs, ModelMessage } from "ai"; import {
streamText,
ToolSet,
stepCountIs,
ModelMessage,
type ToolExecutionOptions,
} from "ai";
import log from "electron-log"; import log from "electron-log";
import { db } from "@/db"; import { db } from "@/db";
import { chats, messages } from "@/db/schema"; import { chats, messages } from "@/db/schema";
...@@ -466,14 +472,13 @@ async function getMcpTools( ...@@ -466,14 +472,13 @@ async function getMcpTools(
const client = await mcpManager.getClient(s.id); const client = await mcpManager.getClient(s.id);
const toolSet = await client.tools(); const toolSet = await client.tools();
for (const [name, tool] of Object.entries(toolSet)) { for (const [name, mcpTool] of Object.entries(toolSet)) {
const key = `${sanitizeMcpName(s.name || "")}__${sanitizeMcpName(name)}`; const key = `${sanitizeMcpName(s.name || "")}__${sanitizeMcpName(name)}`;
const original = tool;
mcpToolSet[key] = { mcpToolSet[key] = {
description: original?.description, description: mcpTool.description,
inputSchema: original?.inputSchema, inputSchema: mcpTool.inputSchema,
execute: async (args: any, execCtx: any) => { execute: async (args: unknown, execCtx: ToolExecutionOptions) => {
try { try {
const inputPreview = const inputPreview =
typeof args === "string" typeof args === "string"
...@@ -486,7 +491,7 @@ async function getMcpTools( ...@@ -486,7 +491,7 @@ async function getMcpTools(
serverId: s.id, serverId: s.id,
serverName: s.name, serverName: s.name,
toolName: name, toolName: name,
toolDescription: original?.description, toolDescription: mcpTool.description,
inputPreview, inputPreview,
}); });
...@@ -499,7 +504,7 @@ async function getMcpTools( ...@@ -499,7 +504,7 @@ async function getMcpTools(
`<dyad-mcp-tool-call server="${serverName}" tool="${toolName}">\n${content}\n</dyad-mcp-tool-call>`, `<dyad-mcp-tool-call server="${serverName}" tool="${toolName}">\n${content}\n</dyad-mcp-tool-call>`,
); );
const res = await original.execute?.(args, execCtx); const res = await mcpTool.execute(args, execCtx);
const resultStr = const resultStr =
typeof res === "string" ? res : JSON.stringify(res); typeof res === "string" ? res : JSON.stringify(res);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论