@ai-sdk/provider-utils 4.0.46 → 4.0.47

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 4.0.47
4
+
5
+ ### Patch Changes
6
+
7
+ - 2d172fb: Preserve schema-valued additional properties when converting Zod 4 schemas.
8
+
3
9
  ## 4.0.46
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -892,7 +892,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
892
892
  }
893
893
 
894
894
  // src/version.ts
895
- var VERSION = true ? "4.0.46" : "0.0.0-test";
895
+ var VERSION = true ? "4.0.47" : "0.0.0-test";
896
896
 
897
897
  // src/get-from-api.ts
898
898
  var getOriginalFetch = () => globalThis.fetch;
@@ -1194,7 +1194,8 @@ var z4 = __toESM(require("zod/v4"));
1194
1194
  // src/add-additional-properties-to-json-schema.ts
1195
1195
  function addAdditionalPropertiesToJsonSchema(jsonSchema2) {
1196
1196
  if (jsonSchema2.type === "object" || Array.isArray(jsonSchema2.type) && jsonSchema2.type.includes("object")) {
1197
- jsonSchema2.additionalProperties = false;
1197
+ const { additionalProperties } = jsonSchema2;
1198
+ jsonSchema2.additionalProperties = additionalProperties != null && typeof additionalProperties !== "boolean" ? visit(additionalProperties) : false;
1198
1199
  const { properties } = jsonSchema2;
1199
1200
  if (properties != null) {
1200
1201
  for (const key of Object.keys(properties)) {