ai 5.0.67 → 5.0.69

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
@@ -695,7 +695,7 @@ import {
695
695
  } from "@ai-sdk/provider-utils";
696
696
 
697
697
  // src/version.ts
698
- var VERSION = true ? "5.0.67" : "0.0.0-test";
698
+ var VERSION = true ? "5.0.69" : "0.0.0-test";
699
699
 
700
700
  // src/util/download/download.ts
701
701
  var download = async ({ url }) => {
@@ -2778,7 +2778,12 @@ function writeToServerResponse({
2778
2778
  const { done, value } = await reader.read();
2779
2779
  if (done)
2780
2780
  break;
2781
- response.write(value);
2781
+ const canContinue = response.write(value);
2782
+ if (!canContinue) {
2783
+ await new Promise((resolve2) => {
2784
+ response.once("drain", resolve2);
2785
+ });
2786
+ }
2782
2787
  }
2783
2788
  } catch (error) {
2784
2789
  throw error;