ai 5.0.235 → 5.0.236

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
@@ -727,7 +727,7 @@ import {
727
727
  } from "@ai-sdk/provider-utils";
728
728
 
729
729
  // src/version.ts
730
- var VERSION = true ? "5.0.235" : "0.0.0-test";
730
+ var VERSION = true ? "5.0.236" : "0.0.0-test";
731
731
 
732
732
  // src/util/download/download.ts
733
733
  var download = async ({
@@ -3997,7 +3997,7 @@ function processUIMessageStream({
3997
3997
  }
3998
3998
  await updateMessageMetadata(chunk.messageMetadata);
3999
3999
  if (chunk.messageId != null || chunk.messageMetadata != null) {
4000
- write();
4000
+ write({ updateStatus: false });
4001
4001
  }
4002
4002
  break;
4003
4003
  }
@@ -9654,12 +9654,14 @@ var AbstractChat = class {
9654
9654
  }
9655
9655
  return job({
9656
9656
  state: response.state,
9657
- write: () => {
9657
+ write: ({ updateStatus = true } = {}) => {
9658
9658
  var _a17;
9659
9659
  if (response.abortController.signal.aborted) {
9660
9660
  return;
9661
9661
  }
9662
- this.setStatus({ status: "streaming" });
9662
+ if (updateStatus) {
9663
+ this.setStatus({ status: "streaming" });
9664
+ }
9663
9665
  const replaceLastMessage = response.state.message.id === ((_a17 = this.lastMessage) == null ? void 0 : _a17.id);
9664
9666
  if (replaceLastMessage) {
9665
9667
  this.state.replaceMessage(
@@ -9730,13 +9732,12 @@ var AbstractChat = class {
9730
9732
  finishReason: activeResponse.state.finishReason
9731
9733
  });
9732
9734
  }
9733
- } catch (err) {
9734
- console.error(err);
9735
- }
9736
- if (this.activeResponse === activeResponse) {
9737
- this.activeResponse = void 0;
9735
+ } finally {
9736
+ if (this.activeResponse === activeResponse) {
9737
+ this.activeResponse = void 0;
9738
+ }
9739
+ clearActiveResumeRequest();
9738
9740
  }
9739
- clearActiveResumeRequest();
9740
9741
  }
9741
9742
  if (((_c = this.sendAutomaticallyWhen) == null ? void 0 : _c.call(this, { messages: this.state.messages })) && !isError) {
9742
9743
  await this.makeRequest({