ai 6.0.27 → 6.0.29

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
@@ -921,7 +921,7 @@ import {
921
921
  } from "@ai-sdk/provider-utils";
922
922
 
923
923
  // src/version.ts
924
- var VERSION = true ? "6.0.27" : "0.0.0-test";
924
+ var VERSION = true ? "6.0.29" : "0.0.0-test";
925
925
 
926
926
  // src/util/download/download.ts
927
927
  var download = async ({ url }) => {
@@ -5276,6 +5276,8 @@ function createAsyncIterableStream(source) {
5276
5276
  let finished = false;
5277
5277
  async function cleanup(cancelStream) {
5278
5278
  var _a16;
5279
+ if (finished)
5280
+ return;
5279
5281
  finished = true;
5280
5282
  try {
5281
5283
  if (cancelStream) {
@@ -5305,7 +5307,7 @@ function createAsyncIterableStream(source) {
5305
5307
  return { done: false, value };
5306
5308
  },
5307
5309
  /**
5308
- * Called on early exit (e.g., break from for-await).
5310
+ * May be called on early exit (e.g., break from for-await) or after completion.
5309
5311
  * Ensures the stream is cancelled and resources are released.
5310
5312
  * @returns A promise resolving to a completed IteratorResult.
5311
5313
  */