ai 6.0.200 → 6.0.201

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,13 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.201
4
+
5
+ ### Patch Changes
6
+
7
+ - 0c8c0ed: fix(ai): return schema-transformed elements in array output mode
8
+
9
+ Previously final array output validation checked each element against the schema but returned the raw model output. Array output now returns the validated values so Zod transforms, coercions, defaults, and pipes are applied consistently with object output.
10
+
3
11
  ## 6.0.200
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1254,7 +1254,7 @@ function detectMediaType({
1254
1254
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
1255
1255
 
1256
1256
  // src/version.ts
1257
- var VERSION = true ? "6.0.200" : "0.0.0-test";
1257
+ var VERSION = true ? "6.0.201" : "0.0.0-test";
1258
1258
 
1259
1259
  // src/util/download/download.ts
1260
1260
  var download = async ({
@@ -10027,13 +10027,15 @@ var arrayOutputStrategy = (schema) => {
10027
10027
  };
10028
10028
  }
10029
10029
  const inputArray = value.elements;
10030
+ const resultArray = [];
10030
10031
  for (const element of inputArray) {
10031
10032
  const result = await (0, import_provider_utils26.safeValidateTypes)({ value: element, schema });
10032
10033
  if (!result.success) {
10033
10034
  return result;
10034
10035
  }
10036
+ resultArray.push(result.value);
10035
10037
  }
10036
- return { success: true, value: inputArray };
10038
+ return { success: true, value: resultArray };
10037
10039
  },
10038
10040
  createElementStream(originalStream) {
10039
10041
  let publishedElements = 0;