ai 7.0.70 → 7.0.73

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,27 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.73
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f607a12]
8
+ - @ai-sdk/gateway@4.0.59
9
+
10
+ ## 7.0.72
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [fdcc814]
15
+ - @ai-sdk/gateway@4.0.58
16
+
17
+ ## 7.0.71
18
+
19
+ ### Patch Changes
20
+
21
+ - 9a37469: Prevent exceptions in streaming `onChunk` and `onError` callbacks from terminating the stream or masking provider errors.
22
+ - Updated dependencies [936719b]
23
+ - @ai-sdk/gateway@4.0.57
24
+
3
25
  ## 7.0.70
4
26
 
5
27
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1143,7 +1143,7 @@ import {
1143
1143
  } from "@ai-sdk/provider-utils";
1144
1144
 
1145
1145
  // src/version.ts
1146
- var VERSION = true ? "7.0.70" : "0.0.0-test";
1146
+ var VERSION = true ? "7.0.73" : "0.0.0-test";
1147
1147
 
1148
1148
  // src/util/download/download.ts
1149
1149
  var download = async ({
@@ -9138,13 +9138,19 @@ var DefaultStreamTextResult = class {
9138
9138
  var _a23, _b, _c, _d;
9139
9139
  controller.enqueue(chunk);
9140
9140
  const { part } = chunk;
9141
- await (onChunk == null ? void 0 : onChunk({ chunk: part }));
9141
+ await notify({
9142
+ event: { chunk: part },
9143
+ callbacks: onChunk
9144
+ });
9142
9145
  if (part.type === "error") {
9143
9146
  const error = wrapGatewayError(part.error);
9144
9147
  if (NoOutputGeneratedError.isInstance(error)) {
9145
9148
  recordedNoOutputError = error;
9146
9149
  }
9147
- await onError({ error });
9150
+ await notify({
9151
+ event: { error },
9152
+ callbacks: onError
9153
+ });
9148
9154
  }
9149
9155
  if (part.type === "custom" || part.type === "source" || part.type === "tool-call" || part.type === "tool-approval-request" || part.type === "tool-approval-response" || part.type === "tool-error") {
9150
9156
  recordedContent.push(part);
@@ -13528,7 +13534,10 @@ var DefaultStreamObjectResult = class {
13528
13534
  transform(chunk, controller) {
13529
13535
  controller.enqueue(chunk);
13530
13536
  if (chunk.type === "error") {
13531
- onError({ error: wrapGatewayError(chunk.error) });
13537
+ void notify({
13538
+ event: { error: wrapGatewayError(chunk.error) },
13539
+ callbacks: onError
13540
+ });
13532
13541
  }
13533
13542
  }
13534
13543
  });