From 35a4bf531bb9c7dca243cbde1ac1083e6d4a3515 Mon Sep 17 00:00:00 2001 From: me2seeks Date: Tue, 29 Sep 2026 17:44:02 +0800 Subject: [PATCH 1/2] chore(runtime): align AI SDK provider versions --- LICENSE | 8 +- .../licenses/npm/THIRD_PARTY_NOTICES.txt | 252 +--------------- package-lock.json | 270 +++++------------- package.json | 2 +- packages/cli/THIRD_PARTY_NOTICES.txt | 252 +--------------- packages/runtime/package.json | 16 +- .../src/__tests__/ai-sdk-backend.test.ts | 8 +- packages/runtime/src/model-factory.ts | 5 +- ...6.patch => @ai-sdk+code-mode+1.0.79.patch} | 210 +++++++------- patches/@ai-sdk+provider-utils+5.0.40.patch | 173 ----------- patches/@ai-sdk+provider-utils+5.0.51.patch | 32 +++ patches/README.md | 11 +- scripts/generate-third-party-notices.mjs | 3 +- scripts/release-cli-package.mjs | 5 +- scripts/smoke-release-cli-package.mjs | 2 +- 15 files changed, 262 insertions(+), 987 deletions(-) rename patches/{@maka+runtime++@ai-sdk+code-mode+1.0.56.patch => @ai-sdk+code-mode+1.0.79.patch} (78%) delete mode 100644 patches/@ai-sdk+provider-utils+5.0.40.patch create mode 100644 patches/@ai-sdk+provider-utils+5.0.51.patch diff --git a/LICENSE b/LICENSE index d5c479160ab..3cc7ab744da 100644 --- a/LICENSE +++ b/LICENSE @@ -205,11 +205,11 @@ THIRD-PARTY COMPONENTS Vercel Code Mode and run execution-budget patches -Source: https://www.npmjs.com/package/@ai-sdk/code-mode/v/1.0.56 +Source: https://www.npmjs.com/package/@ai-sdk/code-mode/v/1.0.79 https://www.npmjs.com/package/run/v/2.1.4 Repository: https://github.com/vercel/ai/tree/main/packages/code-mode https://github.com/vercel-labs/run/tree/run%402.1.4/packages/run -Dependency patches: patches/@maka+runtime++@ai-sdk+code-mode+1.0.56.patch +Dependency patches: patches/@ai-sdk+code-mode+1.0.79.patch patches/run+2.1.4.patch Readable source changes: patches/run-2.1.4-source.diff Copyright 2023 Vercel, Inc. @@ -224,11 +224,11 @@ Vercel AI SDK Source: https://www.npmjs.com/package/@ai-sdk/provider-utils/v/5.0.11 https://www.npmjs.com/package/@ai-sdk/provider/v/4.0.3 -Patched package: https://www.npmjs.com/package/@ai-sdk/provider-utils/v/5.0.40 +Patched package: https://www.npmjs.com/package/@ai-sdk/provider-utils/v/5.0.51 Repository: https://github.com/vercel/ai/tree/main/packages/provider-utils https://github.com/vercel/ai/tree/main/packages/provider Adapted declarations: @ai-sdk/provider-utils 5.0.11, @ai-sdk/provider 4.0.3 -Dependency patch: patches/@ai-sdk+provider-utils+5.0.40.patch +Dependency patch: patches/@ai-sdk+provider-utils+5.0.51.patch Copyright 2023 Vercel, Inc. License: Apache-2.0 diff --git a/apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt b/apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt index f5407db4ba8..376a6b9a9c0 100644 --- a/apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt +++ b/apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt @@ -209,7 +209,7 @@ Apache License ================================================================================ -Package: @ai-sdk/anthropic@4.0.53 +Package: @ai-sdk/anthropic@4.0.68 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/anthropic @@ -231,7 +231,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/code-mode@1.0.56 +Package: @ai-sdk/code-mode@1.0.79 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/code-mode @@ -253,7 +253,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/cohere@4.0.41 +Package: @ai-sdk/cohere@4.0.52 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/cohere @@ -275,7 +275,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/gateway@4.0.80 +Package: @ai-sdk/gateway@4.0.100 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/gateway @@ -297,7 +297,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/google@4.0.69 +Package: @ai-sdk/google@4.0.85 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/google @@ -341,7 +341,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/openai@4.0.66 +Package: @ai-sdk/openai@4.0.80 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/openai @@ -363,7 +363,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/openai-compatible@3.0.48 +Package: @ai-sdk/openai-compatible@3.0.59 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/openai-compatible @@ -385,28 +385,6 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/provider@4.0.14 -Declared license: Apache-2.0 -Selected license: Apache-2.0 -Repository: https://github.com/vercel/ai#packages/provider - ---- LICENSE --- -Copyright 2023 Vercel, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -================================================================================ - Package: @ai-sdk/provider@4.0.19 Declared license: Apache-2.0 Selected license: Apache-2.0 @@ -429,216 +407,6 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/provider-utils@5.0.40 -Declared license: Apache-2.0 -Selected license: Apache-2.0 -Repository: https://github.com/vercel/ai#packages/provider-utils - ---- VERSION-PINNED LICENSE TEXT OVERRIDE --- -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -================================================================================ - Package: @ai-sdk/provider-utils@5.0.51 Declared license: Apache-2.0 Selected license: Apache-2.0 @@ -5817,7 +5585,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================ -Package: ai@7.0.99 +Package: ai@7.0.122 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/ai @@ -15912,7 +15680,7 @@ SOFTWARE. ================================================================================ Embedded component: quickjs-emscripten (embedded runtime) -Embedded by: @ai-sdk/code-mode@1.0.56 +Embedded by: @ai-sdk/code-mode@1.0.79 Selected license: MIT Repository: https://github.com/justjake/quickjs-emscripten @@ -15942,7 +15710,7 @@ SOFTWARE. ================================================================================ Embedded component: QuickJS JavaScript engine (embedded runtime) -Embedded by: @ai-sdk/code-mode@1.0.56 +Embedded by: @ai-sdk/code-mode@1.0.79 Selected license: MIT Repository: https://github.com/bellard/quickjs diff --git a/package-lock.json b/package-lock.json index db7e7467ead..edf0d92548e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "website" ], "devDependencies": { - "@ai-sdk/provider-utils": "5.0.40", + "@ai-sdk/provider-utils": "5.0.51", "@astryxdesign/cli": "0.6.2", "@astryxdesign/core": "0.6.2", "@biomejs/biome": "2.5.13", @@ -139,13 +139,13 @@ } }, "node_modules/@ai-sdk/anthropic": { - "version": "4.0.53", - "resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-4.0.53.tgz", - "integrity": "sha512-JMxAuCFte6mFOvoaUcig3Dp2LObin0wU2Li8ncsveh7hHKW7cG3g1bFjooxn1paxeT8UUf5XMSjhxtXG9wFLig==", + "version": "4.0.68", + "resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-4.0.68.tgz", + "integrity": "sha512-7PzZEf2brum218FSdXf6gE9yz4gKkLwkoLkPwoBExWYFj/Qsbi2JetWDKnFOdV6eezOnP72pGs3T0OKUaAEcLw==", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40" + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51" }, "engines": { "node": ">=22" @@ -154,26 +154,29 @@ "zod": "^3.25.76 || ^4.1.8" } }, - "node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", + "node_modules/@ai-sdk/code-mode": { + "version": "1.0.79", + "resolved": "https://registry.npmjs.org/@ai-sdk/code-mode/-/code-mode-1.0.79.tgz", + "integrity": "sha512-Xj0HjiG8yAI8AgJW1kLW3HNc5VyVAX2z3YFkjIrZGzr9lV6bvxj8UD7VypkZ3iKNIVRUYUb3Kk/nwMdvIpdH6Q==", "license": "Apache-2.0", "dependencies": { - "json-schema": "^0.4.0" + "run": "^2.0.0" }, "engines": { - "node": ">=22" + "node": ">=22.13.0" + }, + "peerDependencies": { + "ai": "7.0.122" } }, "node_modules/@ai-sdk/cohere": { - "version": "4.0.41", - "resolved": "https://registry.npmjs.org/@ai-sdk/cohere/-/cohere-4.0.41.tgz", - "integrity": "sha512-5ZwA2gCk3R6HwNsBqoyFOedfvnkj5SxuOpDhnDxUixfDhGAUHs+Q5qN+CmIvY7itglqAFZB1ZwEEVT8ijjgCGQ==", + "version": "4.0.52", + "resolved": "https://registry.npmjs.org/@ai-sdk/cohere/-/cohere-4.0.52.tgz", + "integrity": "sha512-JVIjabzIuaebEX4lFx6CsSJFjH/PCaZfhnIHHBscXbs+MktqoqJPJIa/6tHFgK2JOdkORE7Ktlx7PmlDtGRfpw==", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40" + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51" }, "engines": { "node": ">=22" @@ -182,26 +185,31 @@ "zod": "^3.25.76 || ^4.1.8" } }, - "node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", + "node_modules/@ai-sdk/gateway": { + "version": "4.0.100", + "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-4.0.100.tgz", + "integrity": "sha512-diJXVW2D1/NUW2JSg99b8yTpN8eW9AK5ntXSW4B7NrsW5STqwcGJAAOFlfOrQBzYHJlWReyy11WefWetdx4Qsw==", "license": "Apache-2.0", "dependencies": { - "json-schema": "^0.4.0" + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51", + "@vercel/oidc": "3.2.0" }, "engines": { "node": ">=22" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" } }, "node_modules/@ai-sdk/google": { - "version": "4.0.69", - "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-4.0.69.tgz", - "integrity": "sha512-clIivD3RQwutykzKQ8CV+BXIA6EX3xcrfJyXXvAni2SlR9JVATSRbu+JFK/j25a330aZ6WiDwbGyD/u951qXOg==", + "version": "4.0.85", + "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-4.0.85.tgz", + "integrity": "sha512-gYfORjh13EkLZWKvpF3gEe2cAMEC3O9tnWniz2wuz8mHqJo08RfCjtLtP8iTka/xq4+a8lnXD4OGipDELd/GnA==", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40" + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51" }, "engines": { "node": ">=22" @@ -210,18 +218,6 @@ "zod": "^3.25.76 || ^4.1.8" } }, - "node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", - "license": "Apache-2.0", - "dependencies": { - "json-schema": "^0.4.0" - }, - "engines": { - "node": ">=22" - } - }, "node_modules/@ai-sdk/open-responses": { "version": "2.0.56", "resolved": "https://registry.npmjs.org/@ai-sdk/open-responses/-/open-responses-2.0.56.tgz", @@ -238,42 +234,14 @@ "zod": "^3.25.76 || ^4.1.8" } }, - "node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider-utils": { - "version": "5.0.51", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.51.tgz", - "integrity": "sha512-z0IsEsDx+dxlZqyCtDjMbBj16NGmxFVTgQcP3+n3EFm9ttNU6wjOgL/kgvaPwtmZM6F7JbtRuLyzr6WOfo5DMw==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/provider": "4.0.19", - "@standard-schema/spec": "^1.1.0", - "@workflow/serde": "4.1.0", - "eventsource-parser": "^3.0.8", - "undici": "^7.29.0" - }, - "engines": { - "node": ">=22" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, - "node_modules/@ai-sdk/open-responses/node_modules/undici": { - "version": "7.30.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.0.tgz", - "integrity": "sha512-dkrQXeHSaoamnItlYbmzG0wFYrM0ZwDxCIg0A7aKjTyyhh9svRzCNFEzV+Vm05/yehjCzjDZ31KXfGEjYSztDQ==", - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, "node_modules/@ai-sdk/openai": { - "version": "4.0.66", - "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-4.0.66.tgz", - "integrity": "sha512-W4GooZjROdOmf7dfjWlRWNVs+Vvr7ZwfDZbyAJRPo1bgQbpRoDd9ZcCwy/PX1X0s2G7B/dhN2RWOORsHtr0wGg==", + "version": "4.0.80", + "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-4.0.80.tgz", + "integrity": "sha512-rd3IiSqiniCSB+3E6FryRb3VfNgBErRqklp50zUqA90EovtumFglzHZfRRjBnUfw49aArKvpWwMe5/1RGZDaKg==", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40" + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51" }, "engines": { "node": ">=22" @@ -283,13 +251,13 @@ } }, "node_modules/@ai-sdk/openai-compatible": { - "version": "3.0.48", - "resolved": "https://registry.npmjs.org/@ai-sdk/openai-compatible/-/openai-compatible-3.0.48.tgz", - "integrity": "sha512-WbalnkqFWBnLOQt0w5Jba4LROZz6nacpm5FXKNiJmcZkPbOju0K/DYFtPal2kLP4DiE9q23T0GIM8Zq6/O73tw==", + "version": "3.0.59", + "resolved": "https://registry.npmjs.org/@ai-sdk/openai-compatible/-/openai-compatible-3.0.59.tgz", + "integrity": "sha512-ZRWWHhLTyVT0NSy+CnGuRAushwRRxXxpX0XMPgUjz+LTR3IP3nE155NkPhrD06yCT8fTKX+xlzF2nEg0P/LjGQ==", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40" + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51" }, "engines": { "node": ">=22" @@ -298,30 +266,6 @@ "zod": "^3.25.76 || ^4.1.8" } }, - "node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", - "license": "Apache-2.0", - "dependencies": { - "json-schema": "^0.4.0" - }, - "engines": { - "node": ">=22" - } - }, - "node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", - "license": "Apache-2.0", - "dependencies": { - "json-schema": "^0.4.0" - }, - "engines": { - "node": ">=22" - } - }, "node_modules/@ai-sdk/provider": { "version": "4.0.19", "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.19.tgz", @@ -335,12 +279,12 @@ } }, "node_modules/@ai-sdk/provider-utils": { - "version": "5.0.40", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.40.tgz", - "integrity": "sha512-zsXPwSAQ9mRJ2hvyITaLOYUyuGrBmzFhJXOg4mllGmla1PfNxZcm4GwqMiV2xQaDgcgBMdUGxXkp9xekZZNIkg==", + "version": "5.0.51", + "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.51.tgz", + "integrity": "sha512-z0IsEsDx+dxlZqyCtDjMbBj16NGmxFVTgQcP3+n3EFm9ttNU6wjOgL/kgvaPwtmZM6F7JbtRuLyzr6WOfo5DMw==", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "4.0.14", + "@ai-sdk/provider": "4.0.19", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", @@ -353,18 +297,6 @@ "zod": "^3.25.76 || ^4.1.8" } }, - "node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", - "license": "Apache-2.0", - "dependencies": { - "json-schema": "^0.4.0" - }, - "engines": { - "node": ">=22" - } - }, "node_modules/@ai-sdk/provider-utils/node_modules/undici": { "version": "7.30.0", "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.0.tgz", @@ -6404,6 +6336,23 @@ "node": ">= 6.0.0" } }, + "node_modules/ai": { + "version": "7.0.122", + "resolved": "https://registry.npmjs.org/ai/-/ai-7.0.122.tgz", + "integrity": "sha512-Un4yVROG+BMd6Q62xUxb9yV+wlTrUGeXhRtg5ltEFDV0p3lOYQaQHK9ozB6rdPdqlH3LyaszfbFdUkZ1p00nIQ==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/gateway": "4.0.100", + "@ai-sdk/provider": "4.0.19", + "@ai-sdk/provider-utils": "5.0.51" + }, + "engines": { + "node": ">=22" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" + } + }, "node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", @@ -6964,16 +6913,6 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/astro/node_modules/magic-string": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.2.3.tgz", - "integrity": "sha512-Bpb0W2TbLKOZ7vJnOUnVRGq3WL2p+ISV29M6hYPL1AFCpyKZpdr5ytiXoTSSxRVhg8YW7f65+6gbG8WG6PCa/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, "node_modules/astro/node_modules/p-limit": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-7.3.2.tgz", @@ -17328,14 +17267,14 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "@ai-sdk/anthropic": "4.0.53", - "@ai-sdk/code-mode": "1.0.56", - "@ai-sdk/cohere": "4.0.41", - "@ai-sdk/google": "4.0.69", + "@ai-sdk/anthropic": "4.0.68", + "@ai-sdk/code-mode": "1.0.79", + "@ai-sdk/cohere": "4.0.52", + "@ai-sdk/google": "4.0.85", "@ai-sdk/open-responses": "2.0.56", - "@ai-sdk/openai": "4.0.66", - "@ai-sdk/openai-compatible": "3.0.48", - "@ai-sdk/provider": "4.0.14", + "@ai-sdk/openai": "4.0.80", + "@ai-sdk/openai-compatible": "3.0.59", + "@ai-sdk/provider": "4.0.19", "@larksuiteoapi/node-sdk": "1.73.3", "@maka/core": "0.1.0", "@mozilla/readability": "^0.6.0", @@ -17345,7 +17284,7 @@ "@wecom/aibot-node-sdk": "1.0.7", "@xterm/addon-unicode11": "^0.9.0", "@xterm/headless": "^6.0.0", - "ai": "7.0.99", + "ai": "7.0.122", "ajv": "^8.20.0", "glob": "^13.0.6", "https-proxy-agent": "^9.1.0", @@ -17390,50 +17329,6 @@ "electron": "^43.4.1" } }, - "packages/runtime/node_modules/@ai-sdk/code-mode": { - "version": "1.0.56", - "resolved": "https://registry.npmjs.org/@ai-sdk/code-mode/-/code-mode-1.0.56.tgz", - "integrity": "sha512-PjTYI+VCvylQLoMv3aAD+JjdepU2lNDwkQQ/ipShk8ALWNgcAHRXXHjcKy+2h1pYoNfhScEXmd8PAP4+OEkfeQ==", - "license": "Apache-2.0", - "dependencies": { - "run": "^2.0.0" - }, - "engines": { - "node": ">=22.13.0" - }, - "peerDependencies": { - "ai": "7.0.99" - } - }, - "packages/runtime/node_modules/@ai-sdk/gateway": { - "version": "4.0.80", - "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-4.0.80.tgz", - "integrity": "sha512-6t+07o8lSthpKf64Xb1qHWR2bWvJ3Fd2oFvS9fQc45p31bi2OUqan246e/ojAmZpWCiMPjKyQ4TBr4MYytnTiQ==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40", - "@vercel/oidc": "3.2.0" - }, - "engines": { - "node": ">=22" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, - "packages/runtime/node_modules/@ai-sdk/provider": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.14.tgz", - "integrity": "sha512-yukP2tbcQQErG5gLCMBGvpvb/rM3D3KlTKG6eKKOdNHLHqtNNDEeBxdYrY/JL+O76B2ig5dXY19H/f1HFSvRiQ==", - "license": "Apache-2.0", - "dependencies": { - "json-schema": "^0.4.0" - }, - "engines": { - "node": ">=22" - } - }, "packages/runtime/node_modules/@slack/socket-mode": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@slack/socket-mode/-/socket-mode-3.0.1.tgz", @@ -17472,23 +17367,6 @@ "node": ">= 20" } }, - "packages/runtime/node_modules/ai": { - "version": "7.0.99", - "resolved": "https://registry.npmjs.org/ai/-/ai-7.0.99.tgz", - "integrity": "sha512-Ov+3j/nSajaVH5hO8C94wN9wisG5tAJ8HWsLV9d/+nlzrRGUh3oYO3Kp1fRyUNWjAWLSpGLHLPaHCdfxb307Vg==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/gateway": "4.0.80", - "@ai-sdk/provider": "4.0.14", - "@ai-sdk/provider-utils": "5.0.40" - }, - "engines": { - "node": ">=22" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, "packages/runtime/node_modules/https-proxy-agent": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-9.1.0.tgz", diff --git a/package.json b/package.json index 4f9af28e4bd..84700752448 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "smoke:windows:dist": "node scripts/windows-smoke.mjs" }, "devDependencies": { - "@ai-sdk/provider-utils": "5.0.40", + "@ai-sdk/provider-utils": "5.0.51", "@astryxdesign/cli": "0.6.2", "@astryxdesign/core": "0.6.2", "@biomejs/biome": "2.5.13", diff --git a/packages/cli/THIRD_PARTY_NOTICES.txt b/packages/cli/THIRD_PARTY_NOTICES.txt index 673dfab94e5..ee14e793450 100644 --- a/packages/cli/THIRD_PARTY_NOTICES.txt +++ b/packages/cli/THIRD_PARTY_NOTICES.txt @@ -208,7 +208,7 @@ Apache License ================================================================================ -Package: @ai-sdk/anthropic@4.0.53 +Package: @ai-sdk/anthropic@4.0.68 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/anthropic @@ -230,7 +230,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/code-mode@1.0.56 +Package: @ai-sdk/code-mode@1.0.79 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/code-mode @@ -252,7 +252,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/cohere@4.0.41 +Package: @ai-sdk/cohere@4.0.52 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/cohere @@ -274,7 +274,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/gateway@4.0.80 +Package: @ai-sdk/gateway@4.0.100 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/gateway @@ -296,7 +296,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/google@4.0.69 +Package: @ai-sdk/google@4.0.85 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/google @@ -340,7 +340,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/openai@4.0.66 +Package: @ai-sdk/openai@4.0.80 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/openai @@ -362,7 +362,7 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/openai-compatible@3.0.48 +Package: @ai-sdk/openai-compatible@3.0.59 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/openai-compatible @@ -384,28 +384,6 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/provider@4.0.14 -Declared license: Apache-2.0 -Selected license: Apache-2.0 -Repository: https://github.com/vercel/ai#packages/provider - ---- LICENSE --- -Copyright 2023 Vercel, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -================================================================================ - Package: @ai-sdk/provider@4.0.19 Declared license: Apache-2.0 Selected license: Apache-2.0 @@ -428,216 +406,6 @@ limitations under the License. ================================================================================ -Package: @ai-sdk/provider-utils@5.0.40 -Declared license: Apache-2.0 -Selected license: Apache-2.0 -Repository: https://github.com/vercel/ai#packages/provider-utils - ---- VERSION-PINNED LICENSE TEXT OVERRIDE --- -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -================================================================================ - Package: @ai-sdk/provider-utils@5.0.51 Declared license: Apache-2.0 Selected license: Apache-2.0 @@ -2418,7 +2186,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================ -Package: ai@7.0.99 +Package: ai@7.0.122 Declared license: Apache-2.0 Selected license: Apache-2.0 Repository: https://github.com/vercel/ai#packages/ai @@ -8197,7 +7965,7 @@ SOFTWARE. ================================================================================ Embedded component: quickjs-emscripten (embedded runtime) -Embedded by: @ai-sdk/code-mode@1.0.56 +Embedded by: @ai-sdk/code-mode@1.0.79 Selected license: MIT Repository: https://github.com/justjake/quickjs-emscripten @@ -8227,7 +7995,7 @@ SOFTWARE. ================================================================================ Embedded component: QuickJS JavaScript engine (embedded runtime) -Embedded by: @ai-sdk/code-mode@1.0.56 +Embedded by: @ai-sdk/code-mode@1.0.79 Selected license: MIT Repository: https://github.com/bellard/quickjs diff --git a/packages/runtime/package.json b/packages/runtime/package.json index bfe71650729..9ea7e5194e6 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -153,14 +153,14 @@ "test:dist": "node --test \"dist/**/*.test.js\"" }, "dependencies": { - "@ai-sdk/anthropic": "4.0.53", - "@ai-sdk/code-mode": "1.0.56", - "@ai-sdk/cohere": "4.0.41", - "@ai-sdk/google": "4.0.69", + "@ai-sdk/anthropic": "4.0.68", + "@ai-sdk/code-mode": "1.0.79", + "@ai-sdk/cohere": "4.0.52", + "@ai-sdk/google": "4.0.85", "@ai-sdk/open-responses": "2.0.56", - "@ai-sdk/openai": "4.0.66", - "@ai-sdk/openai-compatible": "3.0.48", - "@ai-sdk/provider": "4.0.14", + "@ai-sdk/openai": "4.0.80", + "@ai-sdk/openai-compatible": "3.0.59", + "@ai-sdk/provider": "4.0.19", "@larksuiteoapi/node-sdk": "1.73.3", "@maka/core": "0.1.0", "@mozilla/readability": "^0.6.0", @@ -170,7 +170,7 @@ "@wecom/aibot-node-sdk": "1.0.7", "@xterm/addon-unicode11": "^0.9.0", "@xterm/headless": "^6.0.0", - "ai": "7.0.99", + "ai": "7.0.122", "ajv": "^8.20.0", "glob": "^13.0.6", "https-proxy-agent": "^9.1.0", diff --git a/packages/runtime/src/__tests__/ai-sdk-backend.test.ts b/packages/runtime/src/__tests__/ai-sdk-backend.test.ts index b6cad7eabd3..6b867295ba8 100644 --- a/packages/runtime/src/__tests__/ai-sdk-backend.test.ts +++ b/packages/runtime/src/__tests__/ai-sdk-backend.test.ts @@ -13486,9 +13486,11 @@ describe('AiSdkBackend thinking persistence', () => { type: record.type ?? (typeof record.role === 'string' ? 'message' : undefined), role: record.role, text: - firstContent && typeof firstContent === 'object' && !Array.isArray(firstContent) - ? (firstContent as Record).text - : undefined, + typeof record.content === 'string' + ? record.content + : firstContent && typeof firstContent === 'object' && !Array.isArray(firstContent) + ? (firstContent as Record).text + : undefined, callId: record.call_id, name: record.name, arguments: record.arguments, diff --git a/packages/runtime/src/model-factory.ts b/packages/runtime/src/model-factory.ts index 36fa7e2b673..1344a112df1 100644 --- a/packages/runtime/src/model-factory.ts +++ b/packages/runtime/src/model-factory.ts @@ -119,9 +119,6 @@ export function getAIModel(input: ModelFactoryInput): LanguageModelV4 { finalizeBody, }) : requestFetch; - // open-responses@2.0.56 uses @ai-sdk/provider@4.0.19 while the other - // providers in this workspace still use 4.0.14. The V4 runtime contract - // is compatible; the two JSONValue declarations differ in readonlyness. return createOpenResponses({ name: connection.providerType, apiKey, @@ -130,7 +127,7 @@ export function getAIModel(input: ModelFactoryInput): LanguageModelV4 { ...(connection.providerType === 'deepseek' ? { experimental_extensions: [deepSeekWebSearchCodec] } : {}), - })(modelId) as unknown as LanguageModelV4; + })(modelId); }; switch (adapter.kind) { diff --git a/patches/@maka+runtime++@ai-sdk+code-mode+1.0.56.patch b/patches/@ai-sdk+code-mode+1.0.79.patch similarity index 78% rename from patches/@maka+runtime++@ai-sdk+code-mode+1.0.56.patch rename to patches/@ai-sdk+code-mode+1.0.79.patch index 016ec098764..6a2a66825da 100644 --- a/patches/@maka+runtime++@ai-sdk+code-mode+1.0.56.patch +++ b/patches/@ai-sdk+code-mode+1.0.79.patch @@ -1,21 +1,94 @@ -diff --git a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/src/types.ts b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/src/types.ts -index b317e9d..5beb1c2 100644 ---- a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/src/types.ts -+++ b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/src/types.ts -@@ -160,6 +160,8 @@ +diff --git a/node_modules/@ai-sdk/code-mode/dist/index.d.ts b/node_modules/@ai-sdk/code-mode/dist/index.d.ts +index f8bc0f0..27ad52b 100644 +--- a/node_modules/@ai-sdk/code-mode/dist/index.d.ts ++++ b/node_modules/@ai-sdk/code-mode/dist/index.d.ts +@@ -117,6 +117,8 @@ type CodeModeApprovalInterrupt = CodeModeInterrupt [toolName, `__codeMode.tool${index}`]) +- ); +- const bindingSource = Object.entries(bindings).map(([name, reference]) => `${JSON.stringify(name)}:${reference}`).join(","); +- return `const __codeModeBindings={${bindingSource}};const tools=new Proxy(Object.create(null),{get(_target,name){const binding=__codeModeBindings[name];return typeof binding==="function"?(input)=>binding(input):(input)=>__codeMode.missing(String(name),input);}});const __codeModeResult=await(async()=>{ +-${js} +-})();if(__codeModeResult===undefined)return undefined;return JSON.parse(JSON.stringify(__codeModeResult));`; ++ // Expose only the active catalog: unknown names must not look callable. ++ const bindingSource = toolNames ++ .map((name, index) => `[${JSON.stringify(name)}]:(input)=>__codeMode.tool${index}(input)`) ++ .join(","); ++ return `const tools=Object.freeze({__proto__:null,${bindingSource}});const __codeModeResult=await(async()=>{\n${js}\n})();if(__codeModeResult===undefined)return undefined;return JSON.parse(JSON.stringify(__codeModeResult));`; + } + function createHostFunctions({ + codeModeErrors, +@@ -164,14 +163,6 @@ function createHostFunctions({ + toolName + }); + } +- group.missing = async (toolName, toolInput) => await invokeCodeModeTool({ +- codeModeErrors, +- input, +- outerToolCallId, +- policy, +- toolInput, +- toolName: String(toolName) +- }); + return { __codeMode: group }; + } + async function invokeCodeModeTool({ +@@ -260,6 +251,7 @@ function assertInterruptPayload(value) { + function toRunLimits(policy, source, userSource) { + return { + timeoutMs: policy.timeoutMs, ++ timeoutMode: policy.timeoutMode, + memoryLimitBytes: policy.memoryLimitBytes, + maxStackSizeBytes: policy.maxStackSizeBytes, + maxResultBytes: expandedSerializationLimit(policy.maxResultBytes), +@@ -402,7 +394,7 @@ function toPendingInterruptions({ + interruptId: `${toolCallId}:interrupt`, + toolName, + toolCallId, +- input: interruption.hostFunctionName === "__codeMode.missing" ? interruption.arguments[1] : interruption.arguments[0], ++ input: interruption.arguments[0], + payload: assertInterruptPayload(interruption.payload) + }; + }); +@@ -417,9 +409,6 @@ function interruptionIndex(interruptionId) { + return Number(match[1]); + } + function toolNameForInterruption(interruption, toolNames) { +- if (interruption.hostFunctionName === "__codeMode.missing") { +- return String(interruption.arguments[0]); +- } + const match = /^__codeMode\.tool(\d+)$/u.exec(interruption.hostFunctionName); + const toolName = match === null ? void 0 : toolNames[Number(match[1])]; + if (toolName === void 0) { +diff --git a/node_modules/@ai-sdk/code-mode/src/run-code-mode.ts b/node_modules/@ai-sdk/code-mode/src/run-code-mode.ts index 95435bd..d69b159 100644 ---- a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/src/run-code-mode.ts -+++ b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/src/run-code-mode.ts -@@ -159,6 +159,7 @@ +--- a/node_modules/@ai-sdk/code-mode/src/run-code-mode.ts ++++ b/node_modules/@ai-sdk/code-mode/src/run-code-mode.ts +@@ -159,6 +159,7 @@ export async function runCodeMode(input: RunCodeModeInput): Promise { } interface ResolvedExecutionPolicy { @@ -23,7 +96,7 @@ index 95435bd..d69b159 100644 timeoutMs: number; memoryLimitBytes: number; maxStackSizeBytes: number; -@@ -176,6 +177,7 @@ +@@ -176,6 +177,7 @@ function resolveExecutionPolicy( ): ResolvedExecutionPolicy { return { timeoutMs: policy.timeoutMs ?? DEFAULT_TIMEOUT_MS, @@ -31,7 +104,7 @@ index 95435bd..d69b159 100644 memoryLimitBytes: policy.memoryLimitBytes ?? DEFAULT_MEMORY_LIMIT_BYTES, maxStackSizeBytes: policy.maxStackSizeBytes ?? DEFAULT_STACK_LIMIT_BYTES, maxResultBytes: policy.maxResultBytes ?? DEFAULT_MAX_RESULT_BYTES, -@@ -202,13 +204,11 @@ +@@ -202,13 +204,11 @@ function assertSourceSize(source: string, maxBytes: number): void { } function createCodeModeSource(js: string, toolNames: string[]): string { @@ -49,7 +122,7 @@ index 95435bd..d69b159 100644 } function createHostFunctions({ -@@ -236,15 +236,6 @@ +@@ -236,15 +236,6 @@ function createHostFunctions({ toolName, }); } @@ -65,7 +138,7 @@ index 95435bd..d69b159 100644 return { __codeMode: group } as HostFunctions; } -@@ -363,6 +354,7 @@ +@@ -363,6 +354,7 @@ function toRunLimits( ): RunLimits { return { timeoutMs: policy.timeoutMs, @@ -73,7 +146,7 @@ index 95435bd..d69b159 100644 memoryLimitBytes: policy.memoryLimitBytes, maxStackSizeBytes: policy.maxStackSizeBytes, maxResultBytes: expandedSerializationLimit(policy.maxResultBytes), -@@ -545,10 +537,7 @@ +@@ -545,10 +537,7 @@ function toPendingInterruptions({ interruptId: `${toolCallId}:interrupt`, toolName, toolCallId, @@ -85,7 +158,7 @@ index 95435bd..d69b159 100644 payload: assertInterruptPayload(interruption.payload), }; }); -@@ -568,9 +557,6 @@ +@@ -568,9 +557,6 @@ function toolNameForInterruption( interruption: RunInterruption, toolNames: string[], ): string { @@ -95,89 +168,16 @@ index 95435bd..d69b159 100644 const match = /^__codeMode\.tool(\d+)$/u.exec(interruption.hostFunctionName); const toolName = match === null ? undefined : toolNames[Number(match[1])]; if (toolName === undefined) { -diff --git a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/index.d.ts b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/index.d.ts -index 9cafdbb..3c924f1 100644 ---- a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/index.d.ts -+++ b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/index.d.ts -@@ -117,6 +117,8 @@ +diff --git a/node_modules/@ai-sdk/code-mode/src/types.ts b/node_modules/@ai-sdk/code-mode/src/types.ts +index 6bd5604..bbf1bbe 100644 +--- a/node_modules/@ai-sdk/code-mode/src/types.ts ++++ b/node_modules/@ai-sdk/code-mode/src/types.ts +@@ -160,6 +160,8 @@ export type CodeModeApprovalInterrupt = * Execution limits applied to each sandbox invocation. */ - interface CodeModeExecutionPolicy { -+ /** Whether timeoutMs counts total elapsed time or synchronous VM execution. */ -+ timeoutMode?: 'wall' | 'execution'; - /** @defaultValue `30_000` */ - timeoutMs?: number; - /** @defaultValue `64 * 1024 * 1024` */ -diff --git a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js -index 257b976..67d8409 100644 ---- a/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js -+++ b/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js -@@ -117,6 +117,7 @@ - function resolveExecutionPolicy(policy = {}) { - return { - timeoutMs: policy.timeoutMs ?? DEFAULT_TIMEOUT_MS, -+ timeoutMode: policy.timeoutMode ?? "wall", - memoryLimitBytes: policy.memoryLimitBytes ?? DEFAULT_MEMORY_LIMIT_BYTES, - maxStackSizeBytes: policy.maxStackSizeBytes ?? DEFAULT_STACK_LIMIT_BYTES, - maxResultBytes: policy.maxResultBytes ?? DEFAULT_MAX_RESULT_BYTES, -@@ -138,13 +139,11 @@ - } - } - function createCodeModeSource(js, toolNames) { -- const bindings = Object.fromEntries( -- toolNames.map((toolName, index) => [toolName, `__codeMode.tool${index}`]) -- ); -- const bindingSource = Object.entries(bindings).map(([name, reference]) => `${JSON.stringify(name)}:${reference}`).join(","); -- return `const __codeModeBindings={${bindingSource}};const tools=new Proxy(Object.create(null),{get(_target,name){const binding=__codeModeBindings[name];return typeof binding==="function"?(input)=>binding(input):(input)=>__codeMode.missing(String(name),input);}});const __codeModeResult=await(async()=>{ --${js} --})();if(__codeModeResult===undefined)return undefined;return JSON.parse(JSON.stringify(__codeModeResult));`; -+ // Expose only the active catalog: unknown names must not look callable. -+ const bindingSource = toolNames -+ .map((name, index) => `[${JSON.stringify(name)}]:(input)=>__codeMode.tool${index}(input)`) -+ .join(","); -+ return `const tools=Object.freeze({__proto__:null,${bindingSource}});const __codeModeResult=await(async()=>{\n${js}\n})();if(__codeModeResult===undefined)return undefined;return JSON.parse(JSON.stringify(__codeModeResult));`; - } - function createHostFunctions({ - codeModeErrors, -@@ -164,14 +163,6 @@ - toolName - }); - } -- group.missing = async (toolName, toolInput) => await invokeCodeModeTool({ -- codeModeErrors, -- input, -- outerToolCallId, -- policy, -- toolInput, -- toolName: String(toolName) -- }); - return { __codeMode: group }; - } - async function invokeCodeModeTool({ -@@ -260,6 +251,7 @@ - function toRunLimits(policy, source, userSource) { - return { - timeoutMs: policy.timeoutMs, -+ timeoutMode: policy.timeoutMode, - memoryLimitBytes: policy.memoryLimitBytes, - maxStackSizeBytes: policy.maxStackSizeBytes, - maxResultBytes: expandedSerializationLimit(policy.maxResultBytes), -@@ -402,7 +394,7 @@ - interruptId: `${toolCallId}:interrupt`, - toolName, - toolCallId, -- input: interruption.hostFunctionName === "__codeMode.missing" ? interruption.arguments[1] : interruption.arguments[0], -+ input: interruption.arguments[0], - payload: assertInterruptPayload(interruption.payload) - }; - }); -@@ -417,9 +409,6 @@ - return Number(match[1]); - } - function toolNameForInterruption(interruption, toolNames) { -- if (interruption.hostFunctionName === "__codeMode.missing") { -- return String(interruption.arguments[0]); -- } - const match = /^__codeMode\.tool(\d+)$/u.exec(interruption.hostFunctionName); - const toolName = match === null ? void 0 : toolNames[Number(match[1])]; - if (toolName === void 0) { + export interface CodeModeExecutionPolicy { ++ /** Whether timeoutMs counts total elapsed time or synchronous VM execution. */ ++ timeoutMode?: 'wall' | 'execution'; + /** @defaultValue `30_000` */ + timeoutMs?: number; + /** @defaultValue `64 * 1024 * 1024` */ diff --git a/patches/@ai-sdk+provider-utils+5.0.40.patch b/patches/@ai-sdk+provider-utils+5.0.40.patch deleted file mode 100644 index 7c13eaf7925..00000000000 --- a/patches/@ai-sdk+provider-utils+5.0.40.patch +++ /dev/null @@ -1,173 +0,0 @@ -diff --git a/node_modules/@ai-sdk/provider-utils/dist/index.js b/node_modules/@ai-sdk/provider-utils/dist/index.js -index bbf563c..aba09ea 100644 ---- a/node_modules/@ai-sdk/provider-utils/dist/index.js -+++ b/node_modules/@ai-sdk/provider-utils/dist/index.js -@@ -4232,11 +4232,12 @@ - import { - InvalidResponseDataError - } from "@ai-sdk/provider"; -+function absentIfBlank(value) { -+ return value != null && value.trim() !== "" ? value : void 0; -+} - var StreamingToolCallTracker = class { - constructor(controller, options = {}) { -- this.toolCalls = /* @__PURE__ */ new Set(); -- this.toolCallsById = /* @__PURE__ */ new Map(); -- this.toolCallsByIndex = /* @__PURE__ */ new Map(); -+ this.toolCalls = []; - var _a3, _b3; - this.controller = controller; - this._generateId = (_a3 = options.generateId) != null ? _a3 : generateId; -@@ -4250,31 +4251,90 @@ - * events as appropriate. - */ - processDelta(toolCallDelta) { -- const { id, index } = toolCallDelta; -- let toolCall = id != null && id.length > 0 ? this.toolCallsById.get(id) : index != null ? this.toolCallsByIndex.get(index) : this.latestToolCall; -+ var _a3; -+ const wireId = absentIfBlank(toolCallDelta.id); -+ const wireIndex = toolCallDelta.index != null ? toolCallDelta.index : void 0; -+ const wireName = absentIfBlank((_a3 = toolCallDelta.function) == null ? void 0 : _a3.name); -+ let toolCall = this.findByAlias(wireId, wireIndex, wireName); -+ if (toolCall == null && this.toolCalls.length === 1) { -+ const only = this.toolCalls[0]; -+ if ((wireName === void 0 || only.function.name === wireName) && (wireId === void 0 || only.wireId === void 0) && (wireIndex === void 0 || only.index === void 0)) { -+ toolCall = only; -+ } -+ } - if (toolCall == null) { -- toolCall = this.processNewToolCall(toolCallDelta); -- } else { -- this.processExistingToolCall(toolCall, toolCallDelta); -+ this.processNewToolCall(toolCallDelta, wireId, wireIndex, wireName); -+ return; - } -- if (index != null) { -- this.toolCallsByIndex.set(index, toolCall); -+ if (wireId !== void 0) { -+ toolCall.wireId = wireId; - } -- this.latestToolCall = toolCall; -+ if (wireIndex !== void 0) { -+ toolCall.index = wireIndex; -+ } -+ this.processExistingToolCall(toolCall, toolCallDelta); -+ } -+ /** -+ * The most recent tool call this delta's aliases claim. An alias the candidate has not -+ * seen yet cannot disagree, so it neither matches nor rejects; at least one alias must -+ * actually match, which is why a delta carrying only arguments never resolves here. -+ * -+ * Scanning stops at the first call an alias claims, and a `function.name` that disagrees -+ * with that call rejects the delta rather than letting the scan continue. Continuing past -+ * it reaches a call whose claim on the alias a later call has already superseded, which -+ * files a whole new call as a continuation of one two positions back. -+ */ -+ /** -+ * Whether an alias the delta carries, but the matched call has not claimed, belongs to some -+ * other call. The delta then addresses two calls at once, which resolves to neither — the -+ * other claimant cannot be it either, because the alias it did match rejected that call -+ * already. Agreement has to be read across the record set: a candidate missing the alias is -+ * not contradicted by it on its own, and reading only the candidate let exactly this -+ * contradiction resolve, silently, onto a call the gateway never addressed. -+ */ -+ claimedByAnother(candidate, alias, value) { -+ return value !== void 0 && candidate[alias] === void 0 && this.toolCalls.some((other) => other !== candidate && other[alias] === value); -+ } -+ findByAlias(wireId, wireIndex, wireName) { -+ for (let position = this.toolCalls.length - 1; position >= 0; position--) { -+ const candidate = this.toolCalls[position]; -+ let matched = false; -+ if (wireIndex !== void 0 && candidate.index !== void 0) { -+ if (candidate.index !== wireIndex) { -+ continue; -+ } -+ matched = true; -+ } -+ if (wireId !== void 0 && candidate.wireId !== void 0) { -+ if (candidate.wireId !== wireId) { -+ continue; -+ } -+ matched = true; -+ } -+ if (matched) { -+ if (this.claimedByAnother(candidate, "wireId", wireId) || this.claimedByAnother(candidate, "index", wireIndex)) { -+ return void 0; -+ } -+ return wireName !== void 0 && candidate.function.name !== wireName ? void 0 : candidate; -+ } -+ } -+ return void 0; - } - /** - * Finalize any unfinished tool calls. Should be called during the stream's - * flush handler to ensure all tool calls are properly completed. - */ - flush() { -- for (const toolCall of this.toolCalls) { -+ const indices = this.toolCalls.map((toolCall) => toolCall.index); -+ const ordered = indices.every((index) => index !== void 0) && new Set(indices).size === indices.length ? [...this.toolCalls].sort((a, b) => a.index - b.index) : this.toolCalls; -+ for (const toolCall of ordered) { - if (!toolCall.hasFinished) { - this.finishToolCall(toolCall); - } - } - } -- processNewToolCall(toolCallDelta) { -- var _a3, _b3, _c; -+ processNewToolCall(toolCallDelta, wireId, wireIndex, wireName) { -+ var _a3, _b3; - if (this.typeValidation === "required") { - if (toolCallDelta.type !== "function") { - throw new InvalidResponseDataError({ -@@ -4290,38 +4350,32 @@ - }); - } - } -- if (toolCallDelta.id == null) { -- throw new InvalidResponseDataError({ -- data: toolCallDelta, -- message: `Expected 'id' to be a string.` -- }); -- } -- if (((_a3 = toolCallDelta.function) == null ? void 0 : _a3.name) == null) { -+ if (wireName === void 0) { - throw new InvalidResponseDataError({ - data: toolCallDelta, - message: `Expected 'function.name' to be a string.` - }); - } -+ const mintedId = wireId === void 0 || this.toolCalls.some((candidate) => candidate.id === wireId) ? this._generateId() : wireId; - this.controller.enqueue({ - type: "tool-input-start", -- id: toolCallDelta.id, -- toolName: toolCallDelta.function.name -+ id: mintedId, -+ toolName: wireName - }); -- const metadata = (_b3 = this.extractMetadata) == null ? void 0 : _b3.call(this, toolCallDelta); -+ const metadata = (_a3 = this.extractMetadata) == null ? void 0 : _a3.call(this, toolCallDelta); - const toolCall = { -- id: toolCallDelta.id, -+ id: mintedId, - type: "function", - function: { -- name: toolCallDelta.function.name, -- arguments: (_c = toolCallDelta.function.arguments) != null ? _c : "" -+ name: wireName, -+ arguments: (_b3 = toolCallDelta.function.arguments) != null ? _b3 : "" - }, - hasFinished: false, -- metadata -+ metadata, -+ wireId, -+ index: wireIndex - }; -- this.toolCalls.add(toolCall); -- if (toolCall.id.length > 0) { -- this.toolCallsById.set(toolCall.id, toolCall); -- } -+ this.toolCalls.push(toolCall); - if (toolCall.function.arguments.length > 0) { - this.controller.enqueue({ - type: "tool-input-delta", diff --git a/patches/@ai-sdk+provider-utils+5.0.51.patch b/patches/@ai-sdk+provider-utils+5.0.51.patch new file mode 100644 index 00000000000..c2808b68bf8 --- /dev/null +++ b/patches/@ai-sdk+provider-utils+5.0.51.patch @@ -0,0 +1,32 @@ +diff --git a/node_modules/@ai-sdk/provider-utils/dist/index.js b/node_modules/@ai-sdk/provider-utils/dist/index.js +index af46d0c..4dc8339 100644 +--- a/node_modules/@ai-sdk/provider-utils/dist/index.js ++++ b/node_modules/@ai-sdk/provider-utils/dist/index.js +@@ -4348,7 +4348,10 @@ var StreamingToolCallTracker = class { + hasExplicitCallStart: name3 != null && startsWithStructuredValue(toolCallDelta.function?.arguments) + }); + if (resolution.kind === "ambiguous") { +- return; ++ throw new InvalidResponseDataError({ ++ data: toolCallDelta, ++ message: "Ambiguous streamed tool call delta." ++ }); + } + let toolCall; + if (resolution.kind === "new") { +diff --git a/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts b/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts +index 1d0bf42..e4d183e 100644 +--- a/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts ++++ b/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts +@@ -140,7 +140,10 @@ export class StreamingToolCallTracker< + }); + + if (resolution.kind === 'ambiguous') { +- return; ++ throw new InvalidResponseDataError({ ++ data: toolCallDelta, ++ message: 'Ambiguous streamed tool call delta.', ++ }); + } + + let toolCall: TrackedToolCall; diff --git a/patches/README.md b/patches/README.md index d105b1f34d9..cbaf6029e42 100644 --- a/patches/README.md +++ b/patches/README.md @@ -44,7 +44,7 @@ withdrawn candidate is never offered or downloaded. Remove the patch when electron-updater ships equivalent missing-metadata candidate selection. The provider regression is in `scripts/desktop-nightly.test.mjs`. -## `run@2.1.4` and `@ai-sdk/code-mode@1.0.56` +## `run@2.1.4` and `@ai-sdk/code-mode@1.0.79` Code Mode awaits normal Runtime tools, including user interactions. The upstream wall deadline aborts those waits. The opt-in `timeoutMode: 'execution'` instead @@ -164,13 +164,14 @@ the queue at the native exit fence. See #2978. Delete when node-pty ships an equivalent Unix write-lifecycle fix. -## `@ai-sdk/provider-utils@5.0.40` +## `@ai-sdk/provider-utils@5.0.51` -Streaming tool-call association for gateways that reuse or omit `index` / `id` -(Ollama-style, Anthropic→OpenAI translators). See #1967 / #1976 and +Upstream now associates streamed calls across reused or omitted `index` / `id`. +Maka still fails closed when a delta ambiguously addresses multiple calls; +the published tracker silently drops that delta. See #1967 / #1976 and `packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts`. -Delete when that guard passes against an unpatched package. +Delete when the ambiguity tests pass against an unpatched package. ## `@astryxdesign/core@0.6.2` diff --git a/scripts/generate-third-party-notices.mjs b/scripts/generate-third-party-notices.mjs index 1ede7e71315..df6125f21f3 100644 --- a/scripts/generate-third-party-notices.mjs +++ b/scripts/generate-third-party-notices.mjs @@ -100,7 +100,6 @@ const LICENSE_METADATA_OVERRIDES = new Map([ // The published tarball omits the repository LICENSE; package.json declares Apache-2.0. // Keyed by exact version so a bump re-checks the license rather than inheriting this. const APACHE_TEXT_OVERRIDE_KEYS = new Set([ - '@ai-sdk/provider-utils@5.0.40', '@ai-sdk/provider-utils@5.0.51', '@sigstore/verify@4.1.2', ]); @@ -108,7 +107,7 @@ const EMBEDDED_COMPONENT_LICENSES = new Map([ [ '@ai-sdk/code-mode', { - version: '1.0.56', + version: '1.0.79', components: [ { name: 'quickjs-emscripten (embedded runtime)', diff --git a/scripts/release-cli-package.mjs b/scripts/release-cli-package.mjs index 9b8f95332a8..c9a43f2c2ae 100644 --- a/scripts/release-cli-package.mjs +++ b/scripts/release-cli-package.mjs @@ -786,7 +786,10 @@ function validateStaging(publishable) { 'node_modules/node-pty/lib/unixTerminal.js', 'CustomWriteStream.prototype._ownsFileDescriptor', ); - assertPatchedFile('node_modules/@ai-sdk/provider-utils/dist/index.js', 'function absentIfBlank'); + assertPatchedFile( + 'node_modules/@ai-sdk/provider-utils/dist/index.js', + 'Ambiguous streamed tool call delta.', + ); const manifest = readJson(join(stageRoot, 'package.json')); for (const [name, specifier] of Object.entries(manifest.dependencies ?? {})) { diff --git a/scripts/smoke-release-cli-package.mjs b/scripts/smoke-release-cli-package.mjs index c275b4a8a12..783a29b51c7 100644 --- a/scripts/smoke-release-cli-package.mjs +++ b/scripts/smoke-release-cli-package.mjs @@ -628,7 +628,7 @@ function validateInstalledRuntimeFiles(packageRoot) { ); assertOutput( readFileSync(join(packageRoot, 'node_modules/@ai-sdk/provider-utils/dist/index.js'), 'utf8'), - 'function absentIfBlank', + 'Ambiguous streamed tool call delta.', ); } From af4ba0865e8c8131c5e0776ea6112f61a6c78996 Mon Sep 17 00:00:00 2001 From: me2seeks Date: Tue, 29 Sep 2026 17:50:15 +0800 Subject: [PATCH 2/2] fix(runtime): reject blank streamed tool call names --- .../model-factory-tool-call-index.test.ts | 9 ++++ patches/@ai-sdk+provider-utils+5.0.51.patch | 42 +++++++++++++++++-- patches/README.md | 7 ++-- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts b/packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts index b37060d0a25..5936b0c8948 100644 --- a/packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts +++ b/packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts @@ -262,6 +262,15 @@ describe('streamed tool-call association', () => { { toolCallId: 'call_a', toolName: 'read_file', input: '{"path":"a"}' }, ]); }); + + test(`rejects an unmatched blank tool name on ${providerType}`, async () => { + const { failure } = await collectDeltas( + [{ index: 0, id: 'call_a', type: 'function', function: { name: ' ', arguments: '{}' } }], + providerType, + ); + + assert.notEqual(failure, undefined); + }); } test('mints unique usable ids when wire ids are unavailable', async () => { diff --git a/patches/@ai-sdk+provider-utils+5.0.51.patch b/patches/@ai-sdk+provider-utils+5.0.51.patch index c2808b68bf8..0c378ec0a96 100644 --- a/patches/@ai-sdk+provider-utils+5.0.51.patch +++ b/patches/@ai-sdk+provider-utils+5.0.51.patch @@ -1,8 +1,16 @@ diff --git a/node_modules/@ai-sdk/provider-utils/dist/index.js b/node_modules/@ai-sdk/provider-utils/dist/index.js -index af46d0c..4dc8339 100644 +index af46d0c..a94af7a 100644 --- a/node_modules/@ai-sdk/provider-utils/dist/index.js +++ b/node_modules/@ai-sdk/provider-utils/dist/index.js -@@ -4348,7 +4348,10 @@ var StreamingToolCallTracker = class { +@@ -4337,7 +4337,6 @@ var StreamingToolCallTracker = class { + */ + processDelta(toolCallDelta) { + const wireName = toolCallDelta.function?.name; +- const hasBlankName = typeof wireName === "string" && wireName.trim().length === 0; + const wireId = this.getNonBlankString(toolCallDelta.id); + const name3 = this.getNonBlankString(wireName); + const { index } = toolCallDelta; +@@ -4348,13 +4347,13 @@ var StreamingToolCallTracker = class { hasExplicitCallStart: name3 != null && startsWithStructuredValue(toolCallDelta.function?.arguments) }); if (resolution.kind === "ambiguous") { @@ -14,11 +22,26 @@ index af46d0c..4dc8339 100644 } let toolCall; if (resolution.kind === "new") { +- if (hasBlankName) { +- return; +- } + toolCall = this.processNewToolCall(toolCallDelta, { + wireId, + index, diff --git a/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts b/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts -index 1d0bf42..e4d183e 100644 +index 1d0bf42..cffe441 100644 --- a/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts +++ b/node_modules/@ai-sdk/provider-utils/src/streaming-tool-call-tracker.ts -@@ -140,7 +140,10 @@ export class StreamingToolCallTracker< +@@ -124,8 +124,6 @@ export class StreamingToolCallTracker< + */ + processDelta(toolCallDelta: DELTA): void { + const wireName = toolCallDelta.function?.name; +- const hasBlankName = +- typeof wireName === 'string' && wireName.trim().length === 0; + const wireId = this.getNonBlankString(toolCallDelta.id); + const name = this.getNonBlankString(wireName); + const { index } = toolCallDelta; +@@ -140,18 +138,14 @@ export class StreamingToolCallTracker< }); if (resolution.kind === 'ambiguous') { @@ -30,3 +53,14 @@ index 1d0bf42..e4d183e 100644 } let toolCall: TrackedToolCall; + if (resolution.kind === 'new') { +- // Blank names cannot start a usable call, but some providers repeat a +- // blank name on continuations. Correlate those continuations first, then +- // ignore only the unmatched blank-name delta. +- if (hasBlankName) { +- return; +- } +- + toolCall = this.processNewToolCall(toolCallDelta, { + wireId, + index, diff --git a/patches/README.md b/patches/README.md index cbaf6029e42..16c05158f9f 100644 --- a/patches/README.md +++ b/patches/README.md @@ -167,11 +167,12 @@ Delete when node-pty ships an equivalent Unix write-lifecycle fix. ## `@ai-sdk/provider-utils@5.0.51` Upstream now associates streamed calls across reused or omitted `index` / `id`. -Maka still fails closed when a delta ambiguously addresses multiple calls; -the published tracker silently drops that delta. See #1967 / #1976 and +Maka still fails closed when a delta ambiguously addresses multiple calls or +starts a new call with a blank name; the published tracker silently drops those +deltas. See #1967 / #1976 and `packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts`. -Delete when the ambiguity tests pass against an unpatched package. +Delete when the ambiguity and blank-name tests pass against an unpatched package. ## `@astryxdesign/core@0.6.2`