ai 6.0.0-beta.73 → 6.0.0-beta.74

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
@@ -750,7 +750,7 @@ import {
750
750
  } from "@ai-sdk/provider-utils";
751
751
 
752
752
  // src/version.ts
753
- var VERSION = true ? "6.0.0-beta.73" : "0.0.0-test";
753
+ var VERSION = true ? "6.0.0-beta.74" : "0.0.0-test";
754
754
 
755
755
  // src/util/download/download.ts
756
756
  var download = async ({ url }) => {
@@ -2229,6 +2229,7 @@ async function parseToolCall({
2229
2229
  system,
2230
2230
  messages
2231
2231
  }) {
2232
+ var _a16;
2232
2233
  try {
2233
2234
  if (tools == null) {
2234
2235
  if (toolCall.providerExecuted && toolCall.dynamic) {
@@ -2276,7 +2277,8 @@ async function parseToolCall({
2276
2277
  input,
2277
2278
  dynamic: true,
2278
2279
  invalid: true,
2279
- error
2280
+ error,
2281
+ title: (_a16 = tools == null ? void 0 : tools[toolCall.toolName]) == null ? void 0 : _a16.title
2280
2282
  };
2281
2283
  }
2282
2284
  }
@@ -2330,14 +2332,16 @@ async function doParseToolCall({
2330
2332
  input: parseResult.value,
2331
2333
  providerExecuted: toolCall.providerExecuted,
2332
2334
  providerMetadata: toolCall.providerMetadata,
2333
- dynamic: true
2335
+ dynamic: true,
2336
+ title: tool2.title
2334
2337
  } : {
2335
2338
  type: "tool-call",
2336
2339
  toolCallId: toolCall.toolCallId,
2337
2340
  toolName,
2338
2341
  input: parseResult.value,
2339
2342
  providerExecuted: toolCall.providerExecuted,
2340
- providerMetadata: toolCall.providerMetadata
2343
+ providerMetadata: toolCall.providerMetadata,
2344
+ title: tool2.title
2341
2345
  };
2342
2346
  }
2343
2347
 
@@ -3309,7 +3313,8 @@ var uiMessageChunkSchema = lazySchema(
3309
3313
  toolCallId: z7.string(),
3310
3314
  toolName: z7.string(),
3311
3315
  providerExecuted: z7.boolean().optional(),
3312
- dynamic: z7.boolean().optional()
3316
+ dynamic: z7.boolean().optional(),
3317
+ title: z7.string().optional()
3313
3318
  }),
3314
3319
  z7.strictObject({
3315
3320
  type: z7.literal("tool-input-delta"),
@@ -3323,7 +3328,8 @@ var uiMessageChunkSchema = lazySchema(
3323
3328
  input: z7.unknown(),
3324
3329
  providerExecuted: z7.boolean().optional(),
3325
3330
  providerMetadata: providerMetadataSchema.optional(),
3326
- dynamic: z7.boolean().optional()
3331
+ dynamic: z7.boolean().optional(),
3332
+ title: z7.string().optional()
3327
3333
  }),
3328
3334
  z7.strictObject({
3329
3335
  type: z7.literal("tool-input-error"),
@@ -3333,7 +3339,8 @@ var uiMessageChunkSchema = lazySchema(
3333
3339
  providerExecuted: z7.boolean().optional(),
3334
3340
  providerMetadata: providerMetadataSchema.optional(),
3335
3341
  dynamic: z7.boolean().optional(),
3336
- errorText: z7.string()
3342
+ errorText: z7.string(),
3343
+ title: z7.string().optional()
3337
3344
  }),
3338
3345
  z7.strictObject({
3339
3346
  type: z7.literal("tool-approval-request"),
@@ -3892,6 +3899,9 @@ function processUIMessageStream({
3892
3899
  anyPart.errorText = anyOptions.errorText;
3893
3900
  anyPart.rawInput = anyOptions.rawInput;
3894
3901
  anyPart.preliminary = anyOptions.preliminary;
3902
+ if (options.title !== void 0) {
3903
+ anyPart.title = options.title;
3904
+ }
3895
3905
  anyPart.providerExecuted = (_a17 = anyOptions.providerExecuted) != null ? _a17 : part.providerExecuted;
3896
3906
  if (anyOptions.providerMetadata != null && part.state === "input-available") {
3897
3907
  part.callProviderMetadata = anyOptions.providerMetadata;
@@ -3901,6 +3911,7 @@ function processUIMessageStream({
3901
3911
  type: `tool-${options.toolName}`,
3902
3912
  toolCallId: options.toolCallId,
3903
3913
  state: options.state,
3914
+ title: options.title,
3904
3915
  input: anyOptions.input,
3905
3916
  output: anyOptions.output,
3906
3917
  rawInput: anyOptions.rawInput,
@@ -3926,6 +3937,9 @@ function processUIMessageStream({
3926
3937
  anyPart.errorText = anyOptions.errorText;
3927
3938
  anyPart.rawInput = (_a17 = anyOptions.rawInput) != null ? _a17 : anyPart.rawInput;
3928
3939
  anyPart.preliminary = anyOptions.preliminary;
3940
+ if (options.title !== void 0) {
3941
+ anyPart.title = options.title;
3942
+ }
3929
3943
  anyPart.providerExecuted = (_b2 = anyOptions.providerExecuted) != null ? _b2 : part.providerExecuted;
3930
3944
  if (anyOptions.providerMetadata != null && part.state === "input-available") {
3931
3945
  part.callProviderMetadata = anyOptions.providerMetadata;
@@ -3941,6 +3955,7 @@ function processUIMessageStream({
3941
3955
  errorText: anyOptions.errorText,
3942
3956
  preliminary: anyOptions.preliminary,
3943
3957
  providerExecuted: anyOptions.providerExecuted,
3958
+ title: options.title,
3944
3959
  ...anyOptions.providerMetadata != null ? { callProviderMetadata: anyOptions.providerMetadata } : {}
3945
3960
  });
3946
3961
  }
@@ -4050,7 +4065,8 @@ function processUIMessageStream({
4050
4065
  text: "",
4051
4066
  toolName: chunk.toolName,
4052
4067
  index: toolInvocations.length,
4053
- dynamic: chunk.dynamic
4068
+ dynamic: chunk.dynamic,
4069
+ title: chunk.title
4054
4070
  };
4055
4071
  if (chunk.dynamic) {
4056
4072
  updateDynamicToolPart({
@@ -4058,7 +4074,8 @@ function processUIMessageStream({
4058
4074
  toolName: chunk.toolName,
4059
4075
  state: "input-streaming",
4060
4076
  input: void 0,
4061
- providerExecuted: chunk.providerExecuted
4077
+ providerExecuted: chunk.providerExecuted,
4078
+ title: chunk.title
4062
4079
  });
4063
4080
  } else {
4064
4081
  updateToolPart({
@@ -4066,7 +4083,8 @@ function processUIMessageStream({
4066
4083
  toolName: chunk.toolName,
4067
4084
  state: "input-streaming",
4068
4085
  input: void 0,
4069
- providerExecuted: chunk.providerExecuted
4086
+ providerExecuted: chunk.providerExecuted,
4087
+ title: chunk.title
4070
4088
  });
4071
4089
  }
4072
4090
  write();
@@ -4083,14 +4101,16 @@ function processUIMessageStream({
4083
4101
  toolCallId: chunk.toolCallId,
4084
4102
  toolName: partialToolCall.toolName,
4085
4103
  state: "input-streaming",
4086
- input: partialArgs
4104
+ input: partialArgs,
4105
+ title: partialToolCall.title
4087
4106
  });
4088
4107
  } else {
4089
4108
  updateToolPart({
4090
4109
  toolCallId: chunk.toolCallId,
4091
4110
  toolName: partialToolCall.toolName,
4092
4111
  state: "input-streaming",
4093
- input: partialArgs
4112
+ input: partialArgs,
4113
+ title: partialToolCall.title
4094
4114
  });
4095
4115
  }
4096
4116
  write();
@@ -4104,7 +4124,8 @@ function processUIMessageStream({
4104
4124
  state: "input-available",
4105
4125
  input: chunk.input,
4106
4126
  providerExecuted: chunk.providerExecuted,
4107
- providerMetadata: chunk.providerMetadata
4127
+ providerMetadata: chunk.providerMetadata,
4128
+ title: chunk.title
4108
4129
  });
4109
4130
  } else {
4110
4131
  updateToolPart({
@@ -4113,7 +4134,8 @@ function processUIMessageStream({
4113
4134
  state: "input-available",
4114
4135
  input: chunk.input,
4115
4136
  providerExecuted: chunk.providerExecuted,
4116
- providerMetadata: chunk.providerMetadata
4137
+ providerMetadata: chunk.providerMetadata,
4138
+ title: chunk.title
4117
4139
  });
4118
4140
  }
4119
4141
  write();
@@ -4173,7 +4195,8 @@ function processUIMessageStream({
4173
4195
  input: toolInvocation.input,
4174
4196
  output: chunk.output,
4175
4197
  preliminary: chunk.preliminary,
4176
- providerExecuted: chunk.providerExecuted
4198
+ providerExecuted: chunk.providerExecuted,
4199
+ title: toolInvocation.title
4177
4200
  });
4178
4201
  } else {
4179
4202
  updateToolPart({
@@ -4183,7 +4206,8 @@ function processUIMessageStream({
4183
4206
  input: toolInvocation.input,
4184
4207
  output: chunk.output,
4185
4208
  providerExecuted: chunk.providerExecuted,
4186
- preliminary: chunk.preliminary
4209
+ preliminary: chunk.preliminary,
4210
+ title: toolInvocation.title
4187
4211
  });
4188
4212
  }
4189
4213
  write();
@@ -4198,7 +4222,8 @@ function processUIMessageStream({
4198
4222
  state: "output-error",
4199
4223
  input: toolInvocation.input,
4200
4224
  errorText: chunk.errorText,
4201
- providerExecuted: chunk.providerExecuted
4225
+ providerExecuted: chunk.providerExecuted,
4226
+ title: toolInvocation.title
4202
4227
  });
4203
4228
  } else {
4204
4229
  updateToolPart({
@@ -4208,7 +4233,8 @@ function processUIMessageStream({
4208
4233
  input: toolInvocation.input,
4209
4234
  rawInput: toolInvocation.rawInput,
4210
4235
  errorText: chunk.errorText,
4211
- providerExecuted: chunk.providerExecuted
4236
+ providerExecuted: chunk.providerExecuted,
4237
+ title: toolInvocation.title
4212
4238
  });
4213
4239
  }
4214
4240
  write();
@@ -4700,7 +4726,8 @@ function runToolsTransformation({
4700
4726
  toolName: toolCall.toolName,
4701
4727
  input: toolCall.input,
4702
4728
  error: getErrorMessage6(toolCall.error),
4703
- dynamic: true
4729
+ dynamic: true,
4730
+ title: toolCall.title
4704
4731
  });
4705
4732
  break;
4706
4733
  }
@@ -5613,7 +5640,8 @@ var DefaultStreamTextResult = class {
5613
5640
  }
5614
5641
  controller.enqueue({
5615
5642
  ...chunk,
5616
- dynamic: (_e2 = chunk.dynamic) != null ? _e2 : (tool2 == null ? void 0 : tool2.type) === "dynamic"
5643
+ dynamic: (_e2 = chunk.dynamic) != null ? _e2 : (tool2 == null ? void 0 : tool2.type) === "dynamic",
5644
+ title: tool2 == null ? void 0 : tool2.title
5617
5645
  });
5618
5646
  break;
5619
5647
  }
@@ -6023,7 +6051,8 @@ var DefaultStreamTextResult = class {
6023
6051
  toolCallId: part.id,
6024
6052
  toolName: part.toolName,
6025
6053
  ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
6026
- ...dynamic != null ? { dynamic } : {}
6054
+ ...dynamic != null ? { dynamic } : {},
6055
+ ...part.title != null ? { title: part.title } : {}
6027
6056
  });
6028
6057
  break;
6029
6058
  }
@@ -6046,7 +6075,8 @@ var DefaultStreamTextResult = class {
6046
6075
  ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
6047
6076
  ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {},
6048
6077
  ...dynamic != null ? { dynamic } : {},
6049
- errorText: onError(part.error)
6078
+ errorText: onError(part.error),
6079
+ ...part.title != null ? { title: part.title } : {}
6050
6080
  });
6051
6081
  } else {
6052
6082
  controller.enqueue({
@@ -6056,7 +6086,8 @@ var DefaultStreamTextResult = class {
6056
6086
  input: part.input,
6057
6087
  ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {},
6058
6088
  ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {},
6059
- ...dynamic != null ? { dynamic } : {}
6089
+ ...dynamic != null ? { dynamic } : {},
6090
+ ...part.title != null ? { title: part.title } : {}
6060
6091
  });
6061
6092
  }
6062
6093
  break;