@ai-sdk/provider-utils 5.0.0-beta.4 → 5.0.0-beta.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +373 -11
  2. package/dist/index.d.ts +1460 -553
  3. package/dist/index.js +1044 -361
  4. package/dist/index.js.map +1 -1
  5. package/dist/test/index.d.ts +2 -1
  6. package/dist/test/index.js +18 -37
  7. package/dist/test/index.js.map +1 -1
  8. package/package.json +16 -16
  9. package/src/add-additional-properties-to-json-schema.ts +1 -1
  10. package/src/as-array.ts +12 -0
  11. package/src/cancel-response-body.ts +19 -0
  12. package/src/convert-image-model-file-to-data-uri.ts +1 -1
  13. package/src/convert-inline-file-data-to-uint8-array.ts +30 -0
  14. package/src/create-tool-name-mapping.ts +1 -1
  15. package/src/detect-media-type.ts +312 -0
  16. package/src/download-blob.ts +8 -9
  17. package/src/extract-lines.ts +31 -0
  18. package/src/fetch-with-validated-redirects.ts +87 -0
  19. package/src/filter-nullable.ts +11 -0
  20. package/src/get-error-message.ts +1 -15
  21. package/src/get-from-api.ts +2 -2
  22. package/src/has-required-key.ts +6 -0
  23. package/src/index.ts +47 -12
  24. package/src/inject-json-instruction.ts +1 -1
  25. package/src/is-browser-runtime.ts +13 -0
  26. package/src/is-buffer.ts +9 -0
  27. package/src/is-json-serializable.ts +29 -0
  28. package/src/is-provider-reference.ts +21 -0
  29. package/src/is-same-origin.ts +19 -0
  30. package/src/is-url-supported.ts +17 -2
  31. package/src/load-api-key.ts +1 -1
  32. package/src/load-setting.ts +1 -1
  33. package/src/map-reasoning-to-provider.ts +108 -0
  34. package/src/maybe-promise-like.ts +3 -0
  35. package/src/parse-json-event-stream.ts +3 -3
  36. package/src/parse-json.ts +3 -3
  37. package/src/parse-provider-options.ts +1 -1
  38. package/src/post-to-api.ts +4 -4
  39. package/src/provider-defined-tool-factory.ts +129 -0
  40. package/src/provider-executed-tool-factory.ts +69 -0
  41. package/src/read-response-with-size-limit.ts +4 -0
  42. package/src/resolve-full-media-type.ts +49 -0
  43. package/src/resolve-provider-reference.ts +26 -0
  44. package/src/resolve.ts +16 -1
  45. package/src/response-handler.ts +3 -3
  46. package/src/schema.ts +11 -4
  47. package/src/secure-json-parse.ts +1 -1
  48. package/src/serialize-model-options.ts +63 -0
  49. package/src/streaming-tool-call-tracker.ts +241 -0
  50. package/src/test/convert-response-stream-to-array.ts +1 -1
  51. package/src/test/is-node-version.ts +22 -1
  52. package/src/to-json-schema/zod3-to-json-schema/options.ts +3 -3
  53. package/src/to-json-schema/zod3-to-json-schema/parse-def.ts +3 -3
  54. package/src/to-json-schema/zod3-to-json-schema/parse-types.ts +22 -22
  55. package/src/to-json-schema/zod3-to-json-schema/parsers/array.ts +3 -3
  56. package/src/to-json-schema/zod3-to-json-schema/parsers/bigint.ts +1 -1
  57. package/src/to-json-schema/zod3-to-json-schema/parsers/branded.ts +2 -2
  58. package/src/to-json-schema/zod3-to-json-schema/parsers/catch.ts +2 -2
  59. package/src/to-json-schema/zod3-to-json-schema/parsers/date.ts +4 -4
  60. package/src/to-json-schema/zod3-to-json-schema/parsers/default.ts +3 -3
  61. package/src/to-json-schema/zod3-to-json-schema/parsers/effects.ts +3 -3
  62. package/src/to-json-schema/zod3-to-json-schema/parsers/enum.ts +1 -1
  63. package/src/to-json-schema/zod3-to-json-schema/parsers/intersection.ts +5 -5
  64. package/src/to-json-schema/zod3-to-json-schema/parsers/literal.ts +1 -1
  65. package/src/to-json-schema/zod3-to-json-schema/parsers/map.ts +4 -5
  66. package/src/to-json-schema/zod3-to-json-schema/parsers/native-enum.ts +1 -1
  67. package/src/to-json-schema/zod3-to-json-schema/parsers/never.ts +1 -2
  68. package/src/to-json-schema/zod3-to-json-schema/parsers/nullable.ts +4 -4
  69. package/src/to-json-schema/zod3-to-json-schema/parsers/number.ts +1 -1
  70. package/src/to-json-schema/zod3-to-json-schema/parsers/object.ts +3 -3
  71. package/src/to-json-schema/zod3-to-json-schema/parsers/optional.ts +3 -3
  72. package/src/to-json-schema/zod3-to-json-schema/parsers/pipeline.ts +10 -8
  73. package/src/to-json-schema/zod3-to-json-schema/parsers/promise.ts +3 -3
  74. package/src/to-json-schema/zod3-to-json-schema/parsers/readonly.ts +2 -2
  75. package/src/to-json-schema/zod3-to-json-schema/parsers/record.ts +9 -10
  76. package/src/to-json-schema/zod3-to-json-schema/parsers/set.ts +3 -3
  77. package/src/to-json-schema/zod3-to-json-schema/parsers/string.ts +2 -2
  78. package/src/to-json-schema/zod3-to-json-schema/parsers/tuple.ts +3 -3
  79. package/src/to-json-schema/zod3-to-json-schema/parsers/undefined.ts +1 -2
  80. package/src/to-json-schema/zod3-to-json-schema/parsers/union.ts +3 -3
  81. package/src/to-json-schema/zod3-to-json-schema/parsers/unknown.ts +1 -2
  82. package/src/to-json-schema/zod3-to-json-schema/refs.ts +3 -3
  83. package/src/to-json-schema/zod3-to-json-schema/select-parser.ts +2 -2
  84. package/src/to-json-schema/zod3-to-json-schema/zod3-to-json-schema.ts +3 -3
  85. package/src/types/assistant-model-message.ts +5 -3
  86. package/src/types/content-part.ts +158 -19
  87. package/src/types/context.ts +4 -0
  88. package/src/types/executable-tool.ts +17 -0
  89. package/src/types/execute-tool.ts +29 -9
  90. package/src/types/file-data.ts +48 -0
  91. package/src/types/index.ts +29 -11
  92. package/src/types/infer-tool-context.ts +41 -0
  93. package/src/types/infer-tool-input.ts +7 -0
  94. package/src/types/infer-tool-output.ts +7 -0
  95. package/src/types/infer-tool-set-context.ts +44 -0
  96. package/src/types/model-message.ts +4 -4
  97. package/src/types/never-optional.ts +7 -0
  98. package/src/types/provider-options.ts +1 -1
  99. package/src/types/provider-reference.ts +10 -0
  100. package/src/types/sandbox.ts +217 -0
  101. package/src/types/system-model-message.ts +1 -1
  102. package/src/types/tool-approval-request.ts +13 -0
  103. package/src/types/tool-execute-function.ts +56 -0
  104. package/src/types/tool-model-message.ts +3 -3
  105. package/src/types/tool-needs-approval-function.ts +39 -0
  106. package/src/types/tool-set.ts +22 -0
  107. package/src/types/tool.ts +278 -225
  108. package/src/types/user-model-message.ts +2 -2
  109. package/src/validate-download-url.ts +120 -33
  110. package/src/validate-types.ts +5 -3
  111. package/dist/index.d.mts +0 -1455
  112. package/dist/index.mjs +0 -2754
  113. package/dist/index.mjs.map +0 -1
  114. package/dist/test/index.d.mts +0 -17
  115. package/dist/test/index.mjs +0 -77
  116. package/dist/test/index.mjs.map +0 -1
  117. package/src/provider-tool-factory.ts +0 -125
package/CHANGELOG.md CHANGED
@@ -1,5 +1,367 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 5.0.0-beta.49
4
+
5
+ ### Patch Changes
6
+
7
+ - b8396f0: trigger initial beta release
8
+ - Updated dependencies [b8396f0]
9
+ - @ai-sdk/provider@4.0.0-beta.19
10
+
11
+ ## 5.0.0-canary.48
12
+
13
+ ### Patch Changes
14
+
15
+ - aeda373: fix: only send provider credentials to same-origin response-supplied URLs
16
+
17
+ Several provider clients followed a URL taken from the provider's API response (a polling/status URL or a final media URL such as `polling_url`, `urls.get`, `result_url`, `result.sample`, or `video.uri`) and reused the authenticated headers — or appended `?key=<API_KEY>` — on that request. Because the host of the response-supplied URL was never validated, the long-lived API key was sent to whatever host the response named (a CDN in the benign case, or an attacker-chosen host if the provider response was tampered with), allowing credential exfiltration.
18
+
19
+ A new `isSameOrigin` helper is added to `@ai-sdk/provider-utils`, and the affected fetches in `@ai-sdk/black-forest-labs`, `@ai-sdk/fireworks`, `@ai-sdk/replicate`, `@ai-sdk/gladia`, `@ai-sdk/fal`, and `@ai-sdk/google` now attach credentials only when the followed URL is same-origin with the provider's configured API origin. Requests to a foreign origin are made without the credential.
20
+
21
+ - 375fdd7: fix: harden download URL SSRF guard against hostname and redirect bypasses
22
+
23
+ `validateDownloadUrl` and the file download helpers (`downloadBlob`, `download`) could be bypassed in several ways when handling untrusted URLs:
24
+
25
+ - A fully-qualified hostname with a trailing dot (e.g. `localhost.`, `myhost.local.`) skipped the localhost/`.local` blocklist.
26
+ - IPv6 addresses that embed an IPv4 address in their last 32 bits — IPv4-compatible (`::127.0.0.1`), IPv4-translated (`::ffff:0:127.0.0.1`), and NAT64 (`64:ff9b::127.0.0.1`, including the `64:ff9b:1::/48` local-use prefix) — were not decoded and checked against the private IPv4 ranges.
27
+ - Redirects were validated only _after_ `fetch` had already followed them, so the request to a redirect target (e.g. an internal/metadata address) had already been issued before the check ran.
28
+ - Several reserved/internal address ranges were not blocked: CGNAT (`100.64.0.0/10`, used by some cloud providers for internal traffic), benchmarking (`198.18.0.0/15`), IETF protocol assignments (`192.0.0.0/24`), the reserved `240.0.0.0/4` block (including the `255.255.255.255` broadcast address), and IPv6 site-local (`fec0::/10`) and multicast (`ff00::/8`).
29
+
30
+ The validator now strips trailing dots before the hostname checks and fully expands IPv6 addresses to detect embedded private IPv4 targets. The download helpers now follow redirects manually (`redirect: 'manual'`), re-validating each hop before requesting it, so an unsafe redirect target is never fetched. When a redirect cannot be inspected because the runtime returns an opaque response, the helpers fail closed (reject the redirect) on the server; only in a real browser — where SSRF is not reachable (fetch is constrained by CORS and cannot reach a server's internal network or cloud-metadata endpoints) — is the redirect followed natively so legitimate redirected downloads keep working.
31
+
32
+ - b4507d5: fix(provider-utils): cancel response body on download rejection to prevent socket leak
33
+
34
+ When a download was rejected early — because the `Content-Length` header exceeded the size limit, the response status was not ok, or a redirect resolved to a blocked URL — the fetch response body was left unconsumed and uncancelled. With WHATWG Fetch/undici this leaves the underlying TCP socket open instead of returning it to the connection pool, allowing an attacker-controlled origin to exhaust file descriptors and cause a denial of service. The body is now cancelled on all early-rejection paths in `readResponseWithSizeLimit`, `download`, and `downloadBlob`, and `fetchWithValidatedRedirects` cancels each redirect hop's body before following or rejecting the next hop.
35
+
36
+ ## 5.0.0-canary.47
37
+
38
+ ### Patch Changes
39
+
40
+ - bae5e2b: fix(security): re-validate tool approvals from client message history before execution
41
+
42
+ The approval-replay path in `generateText`/`streamText` (and `WorkflowAgent.stream`) reconstructed approved tool calls from the client-supplied messages array and executed them without re-validating input against the tool's schema or re-applying the approval policy. A client could forge an assistant message with a pre-approved tool-call part and have the server execute a tool with attacker-chosen arguments.
43
+
44
+ The replay path now validates HMAC signature (when `experimental_toolApprovalSecret` is configured), re-validates tool-call input against the tool's input schema, and re-resolves the approval policy before execution.
45
+
46
+ ## 5.0.0-canary.46
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [ce769dd]
51
+ - @ai-sdk/provider@4.0.0-canary.18
52
+
53
+ ## 5.0.0-canary.45
54
+
55
+ ### Patch Changes
56
+
57
+ - ee798eb: chore(provider-utils): rename `Experimental_Sandbox` to `Experimental_SandboxSession`
58
+ - daf6637: feat(provider-utils): add `env` option to `spawn` and `run` methods of `Experimental_SandboxSession`
59
+
60
+ ## 5.0.0-canary.44
61
+
62
+ ### Patch Changes
63
+
64
+ - 6c93e36: feat(provider-utils): add `spawnCommand` method to `Experimental_Sandbox` to allow for detached command execution
65
+ - f617ac2: feat(provider-utils): narrow `tool()` return type to `ExecutableTool<...>` when `execute` is provided
66
+
67
+ ## 5.0.0-canary.43
68
+
69
+ ### Patch Changes
70
+
71
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
72
+ - Updated dependencies [7fc6bd6]
73
+ - @ai-sdk/provider@4.0.0-canary.17
74
+
75
+ ## 5.0.0-canary.42
76
+
77
+ ### Patch Changes
78
+
79
+ - a6617c5: feat(provider-utils): add `readFile` and `writeFile` plus convenience wrappers to `Experimental_Sandbox` abstraction
80
+
81
+ ## 5.0.0-canary.41
82
+
83
+ ### Patch Changes
84
+
85
+ - 28dfa06: fix: support tools with optional context
86
+ - e93fa91: rename Sandbox.executeCommand to Sandbox.runCommand
87
+
88
+ ## 5.0.0-canary.40
89
+
90
+ ### Patch Changes
91
+
92
+ - a7de9c9: fix: make sandbox experimental
93
+
94
+ ## 5.0.0-canary.39
95
+
96
+ ### Patch Changes
97
+
98
+ - 105f95b: Ensure the default empty tool input schema includes `type: "object"` for OpenAI-compatible providers that require object schemas.
99
+
100
+ ## 5.0.0-canary.38
101
+
102
+ ### Patch Changes
103
+
104
+ - ca446f8: feat: flexible tool descriptions
105
+
106
+ ## 5.0.0-canary.37
107
+
108
+ ### Patch Changes
109
+
110
+ - d848405: feat: add optional `abortSignal` parameters to sandbox command execution
111
+
112
+ ## 5.0.0-canary.36
113
+
114
+ ### Patch Changes
115
+
116
+ - ca39020: Add an optional `workingDirectory` parameter to sandbox command execution.
117
+
118
+ ## 5.0.0-canary.35
119
+
120
+ ### Patch Changes
121
+
122
+ - f634bac: feat(mcp): add new McpProviderMetadata type
123
+
124
+ ## 5.0.0-canary.34
125
+
126
+ ### Patch Changes
127
+
128
+ - 69254e0: feat(ai): add toolMetadata for tool specific metdata
129
+ - 3015fc3: feat: sandbox shell execution abstraction
130
+
131
+ ## 5.0.0-canary.33
132
+
133
+ ### Patch Changes
134
+
135
+ - 2427d88: feat(ai): change Tool.sensitiveContext to telemetry.includeToolsContext and make it opt-in
136
+
137
+ ## 5.0.0-canary.32
138
+
139
+ ### Major Changes
140
+
141
+ - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies [5463d0d]
146
+ - @ai-sdk/provider@4.0.0-canary.16
147
+
148
+ ## 5.0.0-canary.31
149
+
150
+ ### Patch Changes
151
+
152
+ - 0c4c275: trigger initial canary release
153
+ - Updated dependencies [0c4c275]
154
+ - @ai-sdk/provider@4.0.0-canary.15
155
+
156
+ ## 5.0.0-beta.30
157
+
158
+ ### Patch Changes
159
+
160
+ - 08d2129: feat(mcp): propagate the server name through dynamic tool parts
161
+
162
+ ## 5.0.0-beta.29
163
+
164
+ ### Patch Changes
165
+
166
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
167
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
168
+ - b6783da: refactoring: restructure Tool types
169
+ - Updated dependencies [9bd6512]
170
+ - Updated dependencies [258c093]
171
+ - @ai-sdk/provider@4.0.0-beta.14
172
+
173
+ ## 5.0.0-beta.28
174
+
175
+ ### Patch Changes
176
+
177
+ - 9f0e36c: trigger release for all packages after provenance setup
178
+ - Updated dependencies [9f0e36c]
179
+ - @ai-sdk/provider@4.0.0-beta.13
180
+
181
+ ## 5.0.0-beta.27
182
+
183
+ ### Patch Changes
184
+
185
+ - 785fe16: feat: distinguish provider-defined and provider-executed tools
186
+ - 67df0a0: feat: add sensitiveContext property to Tool
187
+ - befb78c: refactoring: remove real-time delays in unit tests
188
+ - 0458559: fix: deprecate needsApproval on Tool
189
+ - 5852c0a: refactoring(provider-utils): add controller as property to StreamingToolCallTracker
190
+ - fc92055: feat(ai): automatic tool approval
191
+
192
+ ## 5.0.0-beta.26
193
+
194
+ ### Patch Changes
195
+
196
+ - 2e98477: fix: retain stack traces on async errors
197
+
198
+ ## 5.0.0-beta.25
199
+
200
+ ### Patch Changes
201
+
202
+ - eea8d98: refactoring: rename tool execution events
203
+
204
+ ## 5.0.0-beta.24
205
+
206
+ ### Patch Changes
207
+
208
+ - f807e45: Extract shared `StreamingToolCallTracker` class into `@ai-sdk/provider-utils` to deduplicate streaming tool call handling across OpenAI-compatible providers. Also adds missing `generateId()` fallback for `toolCallId` in Alibaba's `doGenerate` path and ensures all providers finalize unfinished tool calls during stream flush.
209
+
210
+ ## 5.0.0-beta.23
211
+
212
+ ### Patch Changes
213
+
214
+ - 350ea38: refactoring: introduce Arrayable type
215
+
216
+ ## 5.0.0-beta.22
217
+
218
+ ### Patch Changes
219
+
220
+ - 083947b: feat(ai): separate toolsContext from context
221
+
222
+ ## 5.0.0-beta.21
223
+
224
+ ### Patch Changes
225
+
226
+ - add1126: refactoring: executeTool uses tool as parameter
227
+
228
+ ## 5.0.0-beta.20
229
+
230
+ ### Patch Changes
231
+
232
+ - b3976a2: Add workflow serialization support to all provider models.
233
+
234
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
235
+
236
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
237
+
238
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
239
+
240
+ - ff5eba1: feat: roll `image-*` tool output types into their equivalent `file-*` types
241
+ - Updated dependencies [ff5eba1]
242
+ - @ai-sdk/provider@4.0.0-beta.12
243
+
244
+ ## 5.0.0-beta.19
245
+
246
+ ### Major Changes
247
+
248
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
249
+
250
+ ### Patch Changes
251
+
252
+ - Updated dependencies [ef992f8]
253
+ - @ai-sdk/provider@4.0.0-beta.11
254
+
255
+ ## 5.0.0-beta.18
256
+
257
+ ### Patch Changes
258
+
259
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
260
+
261
+ ## 5.0.0-beta.17
262
+
263
+ ### Patch Changes
264
+
265
+ - 3ae1786: fix: better context type inference
266
+
267
+ ## 5.0.0-beta.16
268
+
269
+ ### Patch Changes
270
+
271
+ - Updated dependencies [176466a]
272
+ - @ai-sdk/provider@4.0.0-beta.10
273
+
274
+ ## 5.0.0-beta.15
275
+
276
+ ### Patch Changes
277
+
278
+ - Updated dependencies [e311194]
279
+ - @ai-sdk/provider@4.0.0-beta.9
280
+
281
+ ## 5.0.0-beta.14
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [34bd95d]
286
+ - Updated dependencies [008271d]
287
+ - @ai-sdk/provider@4.0.0-beta.8
288
+
289
+ ## 5.0.0-beta.13
290
+
291
+ ### Major Changes
292
+
293
+ - 7e26e81: chore: rename experimental_context to context
294
+
295
+ ### Patch Changes
296
+
297
+ - b0c2869: chore(ai): remove deprecated `media` type part from `ToolResultOutput`
298
+
299
+ ## 5.0.0-beta.12
300
+
301
+ ### Patch Changes
302
+
303
+ - 46d1149: chore(provider-utils,google): fix grammar errors in error and warning messages
304
+
305
+ ## 5.0.0-beta.11
306
+
307
+ ### Patch Changes
308
+
309
+ - 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
310
+ - Updated dependencies [6fd51c0]
311
+ - @ai-sdk/provider@4.0.0-beta.7
312
+
313
+ ## 5.0.0-beta.10
314
+
315
+ ### Patch Changes
316
+
317
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
318
+ - Updated dependencies [c29a26f]
319
+ - @ai-sdk/provider@4.0.0-beta.6
320
+
321
+ ## 5.0.0-beta.9
322
+
323
+ ### Patch Changes
324
+
325
+ - 2e17091: fix(types): move shared tool set utility types into provider-utils
326
+
327
+ Moved `ToolSet`, `InferToolSetContext`, and `UnionToIntersection` into `@ai-sdk/provider-utils` and updated `ai` internals to import them directly from there. This keeps the shared tool typing utilities colocated with the core tool type definitions.
328
+
329
+ ## 5.0.0-beta.8
330
+
331
+ ### Major Changes
332
+
333
+ - 986c6fd: feat(ai): change type of experimental_context from unknown to generic
334
+ - 493295c: Remove the deprecated `ToolCallOptions` export.
335
+
336
+ Use `ToolExecutionOptions` instead.
337
+
338
+ ## 5.0.0-beta.7
339
+
340
+ ### Patch Changes
341
+
342
+ - 1f509d4: fix(ai): force template check on 'kind' param
343
+ - Updated dependencies [1f509d4]
344
+ - @ai-sdk/provider@4.0.0-beta.5
345
+
346
+ ## 5.0.0-beta.6
347
+
348
+ ### Patch Changes
349
+
350
+ - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText`
351
+ - Updated dependencies [3887c70]
352
+ - @ai-sdk/provider@4.0.0-beta.4
353
+
354
+ ## 5.0.0-beta.5
355
+
356
+ ### Major Changes
357
+
358
+ - 776b617: feat(provider): adding new 'custom' content type
359
+
360
+ ### Patch Changes
361
+
362
+ - Updated dependencies [776b617]
363
+ - @ai-sdk/provider@4.0.0-beta.3
364
+
3
365
  ## 5.0.0-beta.4
4
366
 
5
367
  ### Major Changes
@@ -39,18 +401,18 @@
39
401
  const toolNameMapping = createToolNameMapping({
40
402
  tools,
41
403
  providerToolNames: {
42
- 'openai.code_interpreter': 'code_interpreter',
43
- 'openai.file_search': 'file_search',
44
- 'openai.image_generation': 'image_generation',
45
- 'openai.local_shell': 'local_shell',
46
- 'openai.shell': 'shell',
47
- 'openai.web_search': 'web_search',
48
- 'openai.web_search_preview': 'web_search_preview',
49
- 'openai.mcp': 'mcp',
50
- 'openai.apply_patch': 'apply_patch',
404
+ "openai.code_interpreter": "code_interpreter",
405
+ "openai.file_search": "file_search",
406
+ "openai.image_generation": "image_generation",
407
+ "openai.local_shell": "local_shell",
408
+ "openai.shell": "shell",
409
+ "openai.web_search": "web_search",
410
+ "openai.web_search_preview": "web_search_preview",
411
+ "openai.mcp": "mcp",
412
+ "openai.apply_patch": "apply_patch",
51
413
  },
52
- resolveProviderToolName: tool =>
53
- tool.id === 'openai.custom'
414
+ resolveProviderToolName: (tool) =>
415
+ tool.id === "openai.custom"
54
416
  ? (tool.args as { name?: string }).name
55
417
  : undefined,
56
418
  });