ai 6.0.310 → 6.0.311

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.mjs CHANGED
@@ -1225,7 +1225,7 @@ import {
1225
1225
  } from "@ai-sdk/provider-utils";
1226
1226
 
1227
1227
  // src/version.ts
1228
- var VERSION = true ? "6.0.310" : "0.0.0-test";
1228
+ var VERSION = true ? "6.0.311" : "0.0.0-test";
1229
1229
 
1230
1230
  // src/util/download/download.ts
1231
1231
  var download = async ({
@@ -7957,12 +7957,23 @@ var DefaultStreamTextResult = class {
7957
7957
  return stitchableStream.stream.cancel(reason);
7958
7958
  }
7959
7959
  });
7960
+ let isRunning = true;
7961
+ stream = stream.pipeThrough(
7962
+ new TransformStream({
7963
+ async transform(chunk, controller) {
7964
+ if (isRunning) {
7965
+ controller.enqueue(chunk);
7966
+ }
7967
+ }
7968
+ })
7969
+ );
7960
7970
  for (const transform of transforms) {
7961
7971
  stream = stream.pipeThrough(
7962
7972
  transform({
7963
7973
  tools,
7964
7974
  stopStream() {
7965
7975
  stitchableStream.terminate();
7976
+ isRunning = false;
7966
7977
  }
7967
7978
  })
7968
7979
  );