ai 6.0.89 → 6.0.91

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
@@ -1104,7 +1104,7 @@ import {
1104
1104
  } from "@ai-sdk/provider-utils";
1105
1105
 
1106
1106
  // src/version.ts
1107
- var VERSION = true ? "6.0.89" : "0.0.0-test";
1107
+ var VERSION = true ? "6.0.91" : "0.0.0-test";
1108
1108
 
1109
1109
  // src/util/download/download.ts
1110
1110
  var download = async ({
@@ -12687,6 +12687,27 @@ var AbstractChat = class {
12687
12687
  messageId
12688
12688
  }) {
12689
12689
  var _a21, _b, _c;
12690
+ let resumeStream;
12691
+ if (trigger === "resume-stream") {
12692
+ try {
12693
+ const reconnect = await this.transport.reconnectToStream({
12694
+ chatId: this.id,
12695
+ metadata,
12696
+ headers,
12697
+ body
12698
+ });
12699
+ if (reconnect == null) {
12700
+ return;
12701
+ }
12702
+ resumeStream = reconnect;
12703
+ } catch (err) {
12704
+ if (this.onError && err instanceof Error) {
12705
+ this.onError(err);
12706
+ }
12707
+ this.setStatus({ status: "error", error: err });
12708
+ return;
12709
+ }
12710
+ }
12690
12711
  this.setStatus({ status: "submitted", error: void 0 });
12691
12712
  const lastMessage = this.lastMessage;
12692
12713
  let isAbort = false;
@@ -12706,17 +12727,7 @@ var AbstractChat = class {
12706
12727
  this.activeResponse = activeResponse;
12707
12728
  let stream;
12708
12729
  if (trigger === "resume-stream") {
12709
- const reconnect = await this.transport.reconnectToStream({
12710
- chatId: this.id,
12711
- metadata,
12712
- headers,
12713
- body
12714
- });
12715
- if (reconnect == null) {
12716
- this.setStatus({ status: "ready" });
12717
- return;
12718
- }
12719
- stream = reconnect;
12730
+ stream = resumeStream;
12720
12731
  } else {
12721
12732
  stream = await this.transport.sendMessages({
12722
12733
  chatId: this.id,