ai 5.0.232 → 5.0.234

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.234
4
+
5
+ ### Patch Changes
6
+
7
+ - 412c15e: Preserve reasoning part IDs when processing UI message streams.
8
+ - Updated dependencies [1e632f7]
9
+ - @ai-sdk/gateway@2.0.132
10
+
11
+ ## 5.0.233
12
+
13
+ ### Patch Changes
14
+
15
+ - 2604cb6: Prevent `resumeStream` from copying the previous assistant message into the resumed response.
16
+
3
17
  ## 5.0.232
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1533,6 +1533,10 @@ type TextUIPart = {
1533
1533
  */
1534
1534
  type ReasoningUIPart = {
1535
1535
  type: 'reasoning';
1536
+ /**
1537
+ * The identifier of the reasoning part.
1538
+ */
1539
+ id?: string;
1536
1540
  /**
1537
1541
  * The reasoning text.
1538
1542
  */
package/dist/index.d.ts CHANGED
@@ -1533,6 +1533,10 @@ type TextUIPart = {
1533
1533
  */
1534
1534
  type ReasoningUIPart = {
1535
1535
  type: 'reasoning';
1536
+ /**
1537
+ * The identifier of the reasoning part.
1538
+ */
1539
+ id?: string;
1536
1540
  /**
1537
1541
  * The reasoning text.
1538
1542
  */
package/dist/index.js CHANGED
@@ -816,7 +816,7 @@ function detectMediaType({
816
816
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
817
817
 
818
818
  // src/version.ts
819
- var VERSION = true ? "5.0.232" : "0.0.0-test";
819
+ var VERSION = true ? "5.0.234" : "0.0.0-test";
820
820
 
821
821
  // src/util/download/download.ts
822
822
  var download = async ({
@@ -3820,6 +3820,7 @@ function processUIMessageStream({
3820
3820
  case "reasoning-start": {
3821
3821
  const reasoningPart = {
3822
3822
  type: "reasoning",
3823
+ id: chunk.id,
3823
3824
  text: "",
3824
3825
  providerMetadata: chunk.providerMetadata,
3825
3826
  state: "streaming"
@@ -9623,7 +9624,7 @@ var AbstractChat = class {
9623
9624
  try {
9624
9625
  const response = {
9625
9626
  state: createStreamingUIMessageState({
9626
- lastMessage: this.state.snapshot(lastMessage),
9627
+ lastMessage: trigger === "resume-stream" ? void 0 : this.state.snapshot(lastMessage),
9627
9628
  messageId: this.generateId()
9628
9629
  }),
9629
9630
  abortController
@@ -9849,6 +9850,7 @@ var uiMessagesSchema = (0, import_provider_utils32.lazyValidator)(
9849
9850
  }),
9850
9851
  import_v48.z.object({
9851
9852
  type: import_v48.z.literal("reasoning"),
9853
+ id: import_v48.z.string().optional(),
9852
9854
  text: import_v48.z.string(),
9853
9855
  state: import_v48.z.enum(["streaming", "done"]).optional(),
9854
9856
  providerMetadata: providerMetadataSchema.optional()