ai 3.0.32 → 3.0.33

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/dist/index.js CHANGED
@@ -48,7 +48,7 @@ __export(streams_exports, {
48
48
  MistralStream: () => MistralStream,
49
49
  OpenAIStream: () => OpenAIStream,
50
50
  ReplicateStream: () => ReplicateStream,
51
- StreamData: () => StreamData2,
51
+ StreamData: () => StreamData,
52
52
  StreamObjectResult: () => StreamObjectResult,
53
53
  StreamTextResult: () => StreamTextResult,
54
54
  StreamingTextResponse: () => StreamingTextResponse,
@@ -374,7 +374,7 @@ async function _retryWithExponentialBackoff(f, {
374
374
  try {
375
375
  return await f();
376
376
  } catch (error) {
377
- if (error instanceof Error && error.name === "AbortError") {
377
+ if ((0, import_provider_utils2.isAbortError)(error)) {
378
378
  throw error;
379
379
  }
380
380
  if (maxRetries === 0) {
@@ -1393,25 +1393,27 @@ function runToolsTransformation({
1393
1393
  });
1394
1394
  return new ReadableStream({
1395
1395
  async start(controller) {
1396
- generatorStream.pipeThrough(forwardStream).pipeTo(
1397
- new WritableStream({
1398
- write(chunk) {
1399
- controller.enqueue(chunk);
1400
- },
1401
- close() {
1402
- }
1403
- })
1404
- );
1405
- toolResultsStream.pipeTo(
1406
- new WritableStream({
1407
- write(chunk) {
1408
- controller.enqueue(chunk);
1409
- },
1410
- close() {
1411
- controller.close();
1412
- }
1413
- })
1414
- );
1396
+ return Promise.all([
1397
+ generatorStream.pipeThrough(forwardStream).pipeTo(
1398
+ new WritableStream({
1399
+ write(chunk) {
1400
+ controller.enqueue(chunk);
1401
+ },
1402
+ close() {
1403
+ }
1404
+ })
1405
+ ),
1406
+ toolResultsStream.pipeTo(
1407
+ new WritableStream({
1408
+ write(chunk) {
1409
+ controller.enqueue(chunk);
1410
+ },
1411
+ close() {
1412
+ controller.close();
1413
+ }
1414
+ })
1415
+ )
1416
+ ]);
1415
1417
  }
1416
1418
  });
1417
1419
  }
@@ -1985,7 +1987,7 @@ function readableFromAsyncIterable(iterable) {
1985
1987
  }
1986
1988
 
1987
1989
  // streams/stream-data.ts
1988
- var StreamData2 = class {
1990
+ var StreamData = class {
1989
1991
  constructor() {
1990
1992
  this.encoder = new TextEncoder();
1991
1993
  this.controller = null;
@@ -2081,7 +2083,7 @@ function createStreamDataTransformer() {
2081
2083
  }
2082
2084
  });
2083
2085
  }
2084
- var experimental_StreamData = class extends StreamData2 {
2086
+ var experimental_StreamData = class extends StreamData {
2085
2087
  };
2086
2088
 
2087
2089
  // streams/anthropic-stream.ts