ai 5.0.198 → 5.0.199

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
+ ## 5.0.199
4
+
5
+ ### Patch Changes
6
+
7
+ - 040dc83: 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
  ## 5.0.198
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -778,7 +778,7 @@ function detectMediaType({
778
778
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
779
779
 
780
780
  // src/version.ts
781
- var VERSION = true ? "5.0.198" : "0.0.0-test";
781
+ var VERSION = true ? "5.0.199" : "0.0.0-test";
782
782
 
783
783
  // src/util/download/download.ts
784
784
  var download = async ({
@@ -6736,13 +6736,15 @@ var arrayOutputStrategy = (schema) => {
6736
6736
  };
6737
6737
  }
6738
6738
  const inputArray = value.elements;
6739
+ const resultArray = [];
6739
6740
  for (const element of inputArray) {
6740
6741
  const result = await (0, import_provider_utils19.safeValidateTypes)({ value: element, schema });
6741
6742
  if (!result.success) {
6742
6743
  return result;
6743
6744
  }
6745
+ resultArray.push(result.value);
6744
6746
  }
6745
- return { success: true, value: inputArray };
6747
+ return { success: true, value: resultArray };
6746
6748
  },
6747
6749
  createElementStream(originalStream) {
6748
6750
  let publishedElements = 0;