ai 6.0.14 → 6.0.15

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
@@ -898,7 +898,7 @@ import {
898
898
  } from "@ai-sdk/provider-utils";
899
899
 
900
900
  // src/version.ts
901
- var VERSION = true ? "6.0.14" : "0.0.0-test";
901
+ var VERSION = true ? "6.0.15" : "0.0.0-test";
902
902
 
903
903
  // src/util/download/download.ts
904
904
  var download = async ({ url }) => {
@@ -4575,7 +4575,8 @@ var uiMessageChunkSchema = lazySchema(
4575
4575
  messageMetadata: z7.unknown().optional()
4576
4576
  }),
4577
4577
  z7.strictObject({
4578
- type: z7.literal("abort")
4578
+ type: z7.literal("abort"),
4579
+ reason: z7.string().optional()
4579
4580
  }),
4580
4581
  z7.strictObject({
4581
4582
  type: z7.literal("message-metadata"),
@@ -6039,7 +6040,13 @@ var DefaultStreamTextResult = class {
6039
6040
  async pull(controller) {
6040
6041
  function abort() {
6041
6042
  onAbort == null ? void 0 : onAbort({ steps: recordedSteps });
6042
- controller.enqueue({ type: "abort" });
6043
+ controller.enqueue({
6044
+ type: "abort",
6045
+ // The `reason` is usually of type DOMException, but it can also be of any type,
6046
+ // so we use getErrorMessage for serialization because it is already designed to accept values of the unknown type.
6047
+ // See: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/reason
6048
+ ...(abortSignal == null ? void 0 : abortSignal.reason) !== void 0 ? { reason: getErrorMessage7(abortSignal.reason) } : {}
6049
+ });
6043
6050
  controller.close();
6044
6051
  }
6045
6052
  try {