@ai-sdk/workflow 2.0.7 → 2.0.8

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,13 @@
1
1
  # @ai-sdk/workflow
2
2
 
3
+ ## 2.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 96970bb: Continue approved `generateText`, `streamText`, and `WorkflowAgent` turns with a model-visible tool error when revalidated tool input is invalid.
8
+ - Updated dependencies [96970bb]
9
+ - ai@7.0.78
10
+
3
11
  ## 2.0.7
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -979,7 +979,7 @@ var WorkflowAgent = class {
979
979
  }
980
980
  let revalidationReason;
981
981
  try {
982
- const { deniedToolApprovals: policyDenied } = await validateApprovedToolApprovals({
982
+ const { deniedToolApprovals: policyDenied, invalidToolApprovals } = await validateApprovedToolApprovals({
983
983
  approvedToolApprovals: [approval.collected],
984
984
  tools: this.tools,
985
985
  toolApproval: void 0,
@@ -987,7 +987,11 @@ var WorkflowAgent = class {
987
987
  toolsContext: effectiveToolsContext,
988
988
  runtimeContext: effectiveRuntimeContext
989
989
  });
990
- if (policyDenied.length > 0) {
990
+ if (invalidToolApprovals.length > 0) {
991
+ revalidationReason = getErrorMessage(
992
+ invalidToolApprovals[0].error
993
+ );
994
+ } else if (policyDenied.length > 0) {
991
995
  revalidationReason = (_n = policyDenied[0].approvalResponse.reason) != null ? _n : "Tool approval denied";
992
996
  }
993
997
  } catch (error) {