ai 6.0.0-beta.44 → 6.0.0-beta.45

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
@@ -720,7 +720,7 @@ import {
720
720
  } from "@ai-sdk/provider-utils";
721
721
 
722
722
  // src/version.ts
723
- var VERSION = true ? "6.0.0-beta.44" : "0.0.0-test";
723
+ var VERSION = true ? "6.0.0-beta.45" : "0.0.0-test";
724
724
 
725
725
  // src/util/download/download.ts
726
726
  var download = async ({ url }) => {
@@ -3044,7 +3044,12 @@ function writeToServerResponse({
3044
3044
  const { done, value } = await reader.read();
3045
3045
  if (done)
3046
3046
  break;
3047
- response.write(value);
3047
+ const canContinue = response.write(value);
3048
+ if (!canContinue) {
3049
+ await new Promise((resolve3) => {
3050
+ response.once("drain", resolve3);
3051
+ });
3052
+ }
3048
3053
  }
3049
3054
  } catch (error) {
3050
3055
  throw error;