ai 7.0.76 → 7.0.78

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.
@@ -2696,6 +2696,9 @@ declare function validateApprovedToolApprovals<TOOLS extends ToolSet, RUNTIME_CO
2696
2696
  }): Promise<{
2697
2697
  approvedToolApprovals: Array<CollectedToolApprovals<TOOLS>>;
2698
2698
  deniedToolApprovals: Array<CollectedToolApprovals<TOOLS>>;
2699
+ invalidToolApprovals: Array<CollectedToolApprovals<TOOLS> & {
2700
+ error: InvalidToolInputError;
2701
+ }>;
2699
2702
  }>;
2700
2703
 
2701
2704
  /**
@@ -92,7 +92,7 @@ import {
92
92
  } from "@ai-sdk/provider-utils";
93
93
 
94
94
  // src/version.ts
95
- var VERSION = true ? "7.0.76" : "0.0.0-test";
95
+ var VERSION = true ? "7.0.78" : "0.0.0-test";
96
96
 
97
97
  // src/util/download/download.ts
98
98
  var download = async ({
@@ -3387,6 +3387,7 @@ async function validateApprovedToolApprovals({
3387
3387
  var _a12;
3388
3388
  const approved = [];
3389
3389
  const denied = [];
3390
+ const invalid = [];
3390
3391
  for (const approval of approvedToolApprovals) {
3391
3392
  const { toolCall, approvalRequest } = approval;
3392
3393
  const tool = getOwn(tools, toolCall.toolName);
@@ -3420,11 +3421,15 @@ async function validateApprovedToolApprovals({
3420
3421
  schema: asSchema3(tool.inputSchema)
3421
3422
  });
3422
3423
  if (!validation.success) {
3423
- throw new InvalidToolInputError({
3424
- toolName: toolCall.toolName,
3425
- toolInput: JSON.stringify(toolCall.input),
3426
- cause: validation.error
3424
+ invalid.push({
3425
+ ...approval,
3426
+ error: new InvalidToolInputError({
3427
+ toolName: toolCall.toolName,
3428
+ toolInput: JSON.stringify(toolCall.input),
3429
+ cause: validation.error
3430
+ })
3427
3431
  });
3432
+ continue;
3428
3433
  }
3429
3434
  }
3430
3435
  const approvalStatus = await resolveToolApproval({
@@ -3448,7 +3453,11 @@ async function validateApprovedToolApprovals({
3448
3453
  approved.push(approval);
3449
3454
  }
3450
3455
  }
3451
- return { approvedToolApprovals: approved, deniedToolApprovals: denied };
3456
+ return {
3457
+ approvedToolApprovals: approved,
3458
+ deniedToolApprovals: denied,
3459
+ invalidToolApprovals: invalid
3460
+ };
3452
3461
  }
3453
3462
 
3454
3463
  // src/generate-text/to-response-messages.ts