ai 7.0.0-beta.180 → 7.0.0-beta.181

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
2
2
 
3
+ ## 7.0.0-beta.181
4
+
5
+ ### Patch Changes
6
+
7
+ - 6a2caf9: Serialize `undefined` tool output to `null` in UI message chunks
8
+
3
9
  ## 7.0.0-beta.180
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1088,7 +1088,7 @@ import {
1088
1088
  } from "@ai-sdk/provider-utils";
1089
1089
 
1090
1090
  // src/version.ts
1091
- var VERSION = true ? "7.0.0-beta.180" : "0.0.0-test";
1091
+ var VERSION = true ? "7.0.0-beta.181" : "0.0.0-test";
1092
1092
 
1093
1093
  // src/util/download/download.ts
1094
1094
  var download = async ({
@@ -7379,7 +7379,9 @@ function toUIMessageChunk(part, {
7379
7379
  return {
7380
7380
  type: "tool-output-available",
7381
7381
  toolCallId: part.toolCallId,
7382
- output: part.output,
7382
+ // UI stream chunks are serialized as JSON, which drops undefined
7383
+ // properties. Use null so tool outputs always keep the output field.
7384
+ output: part.output === void 0 ? null : part.output,
7383
7385
  ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
7384
7386
  ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {},
7385
7387
  ...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {},