ai 5.0.85 → 5.0.86

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
@@ -671,7 +671,7 @@ import {
671
671
  } from "@ai-sdk/provider-utils";
672
672
 
673
673
  // src/version.ts
674
- var VERSION = true ? "5.0.85" : "0.0.0-test";
674
+ var VERSION = true ? "5.0.86" : "0.0.0-test";
675
675
 
676
676
  // src/util/download/download.ts
677
677
  var download = async ({ url }) => {
@@ -3492,7 +3492,7 @@ function processUIMessageStream({
3492
3492
  }
3493
3493
  }
3494
3494
  function updateDynamicToolPart(options) {
3495
- var _a17;
3495
+ var _a17, _b2;
3496
3496
  const part = state.message.parts.find(
3497
3497
  (part2) => part2.type === "dynamic-tool" && part2.toolCallId === options.toolCallId
3498
3498
  );
@@ -3506,6 +3506,7 @@ function processUIMessageStream({
3506
3506
  anyPart.errorText = anyOptions.errorText;
3507
3507
  anyPart.rawInput = (_a17 = anyOptions.rawInput) != null ? _a17 : anyPart.rawInput;
3508
3508
  anyPart.preliminary = anyOptions.preliminary;
3509
+ anyPart.providerExecuted = (_b2 = anyOptions.providerExecuted) != null ? _b2 : part.providerExecuted;
3509
3510
  if (anyOptions.providerMetadata != null && part.state === "input-available") {
3510
3511
  part.callProviderMetadata = anyOptions.providerMetadata;
3511
3512
  }
@@ -3519,6 +3520,7 @@ function processUIMessageStream({
3519
3520
  output: anyOptions.output,
3520
3521
  errorText: anyOptions.errorText,
3521
3522
  preliminary: anyOptions.preliminary,
3523
+ providerExecuted: anyOptions.providerExecuted,
3522
3524
  ...anyOptions.providerMetadata != null ? { callProviderMetadata: anyOptions.providerMetadata } : {}
3523
3525
  });
3524
3526
  }
@@ -3635,7 +3637,8 @@ function processUIMessageStream({
3635
3637
  toolCallId: chunk.toolCallId,
3636
3638
  toolName: chunk.toolName,
3637
3639
  state: "input-streaming",
3638
- input: void 0
3640
+ input: void 0,
3641
+ providerExecuted: chunk.providerExecuted
3639
3642
  });
3640
3643
  } else {
3641
3644
  updateToolPart({
@@ -3680,6 +3683,7 @@ function processUIMessageStream({
3680
3683
  toolName: chunk.toolName,
3681
3684
  state: "input-available",
3682
3685
  input: chunk.input,
3686
+ providerExecuted: chunk.providerExecuted,
3683
3687
  providerMetadata: chunk.providerMetadata
3684
3688
  });
3685
3689
  } else {
@@ -3708,6 +3712,7 @@ function processUIMessageStream({
3708
3712
  state: "output-error",
3709
3713
  input: chunk.input,
3710
3714
  errorText: chunk.errorText,
3715
+ providerExecuted: chunk.providerExecuted,
3711
3716
  providerMetadata: chunk.providerMetadata
3712
3717
  });
3713
3718
  } else {
@@ -3763,7 +3768,8 @@ function processUIMessageStream({
3763
3768
  toolName: toolInvocation.toolName,
3764
3769
  state: "output-error",
3765
3770
  input: toolInvocation.input,
3766
- errorText: chunk.errorText
3771
+ errorText: chunk.errorText,
3772
+ providerExecuted: chunk.providerExecuted
3767
3773
  });
3768
3774
  } else {
3769
3775
  const toolInvocation = getToolInvocation(chunk.toolCallId);
@@ -3773,7 +3779,8 @@ function processUIMessageStream({
3773
3779
  state: "output-error",
3774
3780
  input: toolInvocation.input,
3775
3781
  rawInput: toolInvocation.rawInput,
3776
- errorText: chunk.errorText
3782
+ errorText: chunk.errorText,
3783
+ providerExecuted: chunk.providerExecuted
3777
3784
  });
3778
3785
  }
3779
3786
  write();
@@ -9455,7 +9462,7 @@ function lastAssistantMessageIsCompleteWithToolCalls({
9455
9462
  const lastStepStartIndex = message.parts.reduce((lastIndex, part, index) => {
9456
9463
  return part.type === "step-start" ? index : lastIndex;
9457
9464
  }, -1);
9458
- const lastStepToolInvocations = message.parts.slice(lastStepStartIndex + 1).filter(isToolOrDynamicToolUIPart);
9465
+ const lastStepToolInvocations = message.parts.slice(lastStepStartIndex + 1).filter(isToolOrDynamicToolUIPart).filter((part) => !part.providerExecuted);
9459
9466
  return lastStepToolInvocations.length > 0 && lastStepToolInvocations.every(
9460
9467
  (part) => part.state === "output-available" || part.state === "output-error"
9461
9468
  );
@@ -9561,6 +9568,7 @@ var uiMessagesSchema = lazyValidator2(
9561
9568
  toolCallId: z8.string(),
9562
9569
  state: z8.literal("input-streaming"),
9563
9570
  input: z8.unknown().optional(),
9571
+ providerExecuted: z8.boolean().optional(),
9564
9572
  output: z8.never().optional(),
9565
9573
  errorText: z8.never().optional()
9566
9574
  }),
@@ -9570,6 +9578,7 @@ var uiMessagesSchema = lazyValidator2(
9570
9578
  toolCallId: z8.string(),
9571
9579
  state: z8.literal("input-available"),
9572
9580
  input: z8.unknown(),
9581
+ providerExecuted: z8.boolean().optional(),
9573
9582
  output: z8.never().optional(),
9574
9583
  errorText: z8.never().optional(),
9575
9584
  callProviderMetadata: providerMetadataSchema.optional()
@@ -9580,6 +9589,7 @@ var uiMessagesSchema = lazyValidator2(
9580
9589
  toolCallId: z8.string(),
9581
9590
  state: z8.literal("output-available"),
9582
9591
  input: z8.unknown(),
9592
+ providerExecuted: z8.boolean().optional(),
9583
9593
  output: z8.unknown(),
9584
9594
  errorText: z8.never().optional(),
9585
9595
  callProviderMetadata: providerMetadataSchema.optional(),
@@ -9591,6 +9601,7 @@ var uiMessagesSchema = lazyValidator2(
9591
9601
  toolCallId: z8.string(),
9592
9602
  state: z8.literal("output-error"),
9593
9603
  input: z8.unknown(),
9604
+ providerExecuted: z8.boolean().optional(),
9594
9605
  output: z8.never().optional(),
9595
9606
  errorText: z8.string(),
9596
9607
  callProviderMetadata: providerMetadataSchema.optional()