ai 4.0.30 → 4.0.32

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,22 @@
1
1
  # ai
2
2
 
3
+ ## 4.0.32
4
+
5
+ ### Patch Changes
6
+
7
+ - de66619: feat (ai/core): add tool call id to ToolExecution error
8
+
9
+ ## 4.0.31
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [90fb95a]
14
+ - Updated dependencies [e6dfef4]
15
+ - Updated dependencies [6636db6]
16
+ - @ai-sdk/provider-utils@2.0.7
17
+ - @ai-sdk/react@1.0.9
18
+ - @ai-sdk/ui-utils@1.0.8
19
+
3
20
  ## 4.0.30
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -2404,10 +2404,12 @@ declare class ToolExecutionError extends AISDKError {
2404
2404
  private readonly [symbol$5];
2405
2405
  readonly toolName: string;
2406
2406
  readonly toolArgs: JSONValue;
2407
- constructor({ toolArgs, toolName, cause, message, }: {
2407
+ readonly toolCallId: string;
2408
+ constructor({ toolArgs, toolName, toolCallId, cause, message, }: {
2408
2409
  message?: string;
2409
2410
  toolArgs: JSONValue;
2410
2411
  toolName: string;
2412
+ toolCallId: string;
2411
2413
  cause: unknown;
2412
2414
  });
2413
2415
  static isInstance(error: unknown): error is ToolExecutionError;
package/dist/index.d.ts CHANGED
@@ -2404,10 +2404,12 @@ declare class ToolExecutionError extends AISDKError {
2404
2404
  private readonly [symbol$5];
2405
2405
  readonly toolName: string;
2406
2406
  readonly toolArgs: JSONValue;
2407
- constructor({ toolArgs, toolName, cause, message, }: {
2407
+ readonly toolCallId: string;
2408
+ constructor({ toolArgs, toolName, toolCallId, cause, message, }: {
2408
2409
  message?: string;
2409
2410
  toolArgs: JSONValue;
2410
2411
  toolName: string;
2412
+ toolCallId: string;
2411
2413
  cause: unknown;
2412
2414
  });
2413
2415
  static isInstance(error: unknown): error is ToolExecutionError;
package/dist/index.js CHANGED
@@ -3368,6 +3368,7 @@ var ToolExecutionError = class extends import_provider12.AISDKError {
3368
3368
  constructor({
3369
3369
  toolArgs,
3370
3370
  toolName,
3371
+ toolCallId,
3371
3372
  cause,
3372
3373
  message = `Error executing tool ${toolName}: ${(0, import_provider12.getErrorMessage)(cause)}`
3373
3374
  }) {
@@ -3375,6 +3376,7 @@ var ToolExecutionError = class extends import_provider12.AISDKError {
3375
3376
  this[_a9] = true;
3376
3377
  this.toolArgs = toolArgs;
3377
3378
  this.toolName = toolName;
3379
+ this.toolCallId = toolCallId;
3378
3380
  }
3379
3381
  static isInstance(error) {
3380
3382
  return import_provider12.AISDKError.hasMarker(error, marker9);
@@ -3997,6 +3999,7 @@ async function executeTools({
3997
3999
  return result2;
3998
4000
  } catch (error) {
3999
4001
  throw new ToolExecutionError({
4002
+ toolCallId,
4000
4003
  toolName,
4001
4004
  toolArgs: args,
4002
4005
  cause: error
@@ -4340,6 +4343,7 @@ function runToolsTransformation({
4340
4343
  toolResultsStreamController.enqueue({
4341
4344
  type: "error",
4342
4345
  error: new ToolExecutionError({
4346
+ toolCallId: toolCall.toolCallId,
4343
4347
  toolName: toolCall.toolName,
4344
4348
  toolArgs: toolCall.args,
4345
4349
  cause: error