@ai-sdk/openai 3.0.44 → 3.0.46

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.
@@ -36,7 +36,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
36
36
  const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
37
37
  const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
38
38
  const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
39
- const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.4");
39
+ const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4");
40
40
  const systemMessageMode = isReasoningModel ? "developer" : "system";
41
41
  return {
42
42
  supportsFlexProcessing,
@@ -2388,10 +2388,11 @@ import {
2388
2388
  import {
2389
2389
  convertToBase64 as convertToBase642,
2390
2390
  isNonNullable,
2391
+ parseJSON,
2391
2392
  parseProviderOptions as parseProviderOptions6,
2392
2393
  validateTypes
2393
2394
  } from "@ai-sdk/provider-utils";
2394
- import { z as z15 } from "zod/v4";
2395
+ import { z as z16 } from "zod/v4";
2395
2396
 
2396
2397
  // src/tool/apply-patch.ts
2397
2398
  import {
@@ -2570,6 +2571,43 @@ var shell = createProviderToolFactoryWithOutputSchema3({
2570
2571
  outputSchema: shellOutputSchema
2571
2572
  });
2572
2573
 
2574
+ // src/tool/tool-search.ts
2575
+ import {
2576
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2577
+ lazySchema as lazySchema14,
2578
+ zodSchema as zodSchema14
2579
+ } from "@ai-sdk/provider-utils";
2580
+ import { z as z15 } from "zod/v4";
2581
+ var toolSearchArgsSchema = lazySchema14(
2582
+ () => zodSchema14(
2583
+ z15.object({
2584
+ execution: z15.enum(["server", "client"]).optional(),
2585
+ description: z15.string().optional(),
2586
+ parameters: z15.record(z15.string(), z15.unknown()).optional()
2587
+ })
2588
+ )
2589
+ );
2590
+ var toolSearchInputSchema = lazySchema14(
2591
+ () => zodSchema14(
2592
+ z15.object({
2593
+ arguments: z15.unknown().optional(),
2594
+ call_id: z15.string().nullish()
2595
+ })
2596
+ )
2597
+ );
2598
+ var toolSearchOutputSchema = lazySchema14(
2599
+ () => zodSchema14(
2600
+ z15.object({
2601
+ tools: z15.array(z15.record(z15.string(), z15.unknown()))
2602
+ })
2603
+ )
2604
+ );
2605
+ var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
2606
+ id: "openai.tool_search",
2607
+ inputSchema: toolSearchInputSchema,
2608
+ outputSchema: toolSearchOutputSchema
2609
+ });
2610
+
2573
2611
  // src/responses/convert-to-openai-responses-input.ts
2574
2612
  function isFileId(data, prefixes) {
2575
2613
  if (!prefixes) return false;
@@ -2588,7 +2626,7 @@ async function convertToOpenAIResponsesInput({
2588
2626
  hasApplyPatchTool = false,
2589
2627
  customProviderToolNames
2590
2628
  }) {
2591
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2629
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
2592
2630
  let input = [];
2593
2631
  const warnings = [];
2594
2632
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -2692,6 +2730,32 @@ async function convertToOpenAIResponsesInput({
2692
2730
  if (hasConversation && id != null) {
2693
2731
  break;
2694
2732
  }
2733
+ const resolvedToolName = toolNameMapping.toProviderToolName(
2734
+ part.toolName
2735
+ );
2736
+ if (resolvedToolName === "tool_search") {
2737
+ if (store && id != null) {
2738
+ input.push({ type: "item_reference", id });
2739
+ break;
2740
+ }
2741
+ const parsedInput = typeof part.input === "string" ? await parseJSON({
2742
+ text: part.input,
2743
+ schema: toolSearchInputSchema
2744
+ }) : await validateTypes({
2745
+ value: part.input,
2746
+ schema: toolSearchInputSchema
2747
+ });
2748
+ const execution = parsedInput.call_id != null ? "client" : "server";
2749
+ input.push({
2750
+ type: "tool_search_call",
2751
+ id: id != null ? id : part.toolCallId,
2752
+ execution,
2753
+ call_id: (_g = parsedInput.call_id) != null ? _g : null,
2754
+ status: "completed",
2755
+ arguments: parsedInput.arguments
2756
+ });
2757
+ break;
2758
+ }
2695
2759
  if (part.providerExecuted) {
2696
2760
  if (store && id != null) {
2697
2761
  input.push({ type: "item_reference", id });
@@ -2702,9 +2766,6 @@ async function convertToOpenAIResponsesInput({
2702
2766
  input.push({ type: "item_reference", id });
2703
2767
  break;
2704
2768
  }
2705
- const resolvedToolName = toolNameMapping.toProviderToolName(
2706
- part.toolName
2707
- );
2708
2769
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
2709
2770
  const parsedInput = await validateTypes({
2710
2771
  value: part.input,
@@ -2787,6 +2848,26 @@ async function convertToOpenAIResponsesInput({
2787
2848
  const resolvedResultToolName = toolNameMapping.toProviderToolName(
2788
2849
  part.toolName
2789
2850
  );
2851
+ if (resolvedResultToolName === "tool_search") {
2852
+ const itemId = (_j = (_i = (_h = part.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2853
+ if (store) {
2854
+ input.push({ type: "item_reference", id: itemId });
2855
+ } else if (part.output.type === "json") {
2856
+ const parsedOutput = await validateTypes({
2857
+ value: part.output.value,
2858
+ schema: toolSearchOutputSchema
2859
+ });
2860
+ input.push({
2861
+ type: "tool_search_output",
2862
+ id: itemId,
2863
+ execution: "server",
2864
+ call_id: null,
2865
+ status: "completed",
2866
+ tools: parsedOutput.tools
2867
+ });
2868
+ }
2869
+ break;
2870
+ }
2790
2871
  if (hasShellTool && resolvedResultToolName === "shell") {
2791
2872
  if (part.output.type === "json") {
2792
2873
  const parsedOutput = await validateTypes({
@@ -2809,7 +2890,7 @@ async function convertToOpenAIResponsesInput({
2809
2890
  break;
2810
2891
  }
2811
2892
  if (store) {
2812
- const itemId = (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.itemId) != null ? _i : part.toolCallId;
2893
+ const itemId = (_m = (_l = (_k = part.providerOptions) == null ? void 0 : _k[providerOptionsName]) == null ? void 0 : _l.itemId) != null ? _m : part.toolCallId;
2813
2894
  input.push({ type: "item_reference", id: itemId });
2814
2895
  } else {
2815
2896
  warnings.push({
@@ -2919,7 +3000,7 @@ async function convertToOpenAIResponsesInput({
2919
3000
  }
2920
3001
  const output = part.output;
2921
3002
  if (output.type === "execution-denied") {
2922
- const approvalId = (_k = (_j = output.providerOptions) == null ? void 0 : _j.openai) == null ? void 0 : _k.approvalId;
3003
+ const approvalId = (_o = (_n = output.providerOptions) == null ? void 0 : _n.openai) == null ? void 0 : _o.approvalId;
2923
3004
  if (approvalId) {
2924
3005
  continue;
2925
3006
  }
@@ -2927,6 +3008,20 @@ async function convertToOpenAIResponsesInput({
2927
3008
  const resolvedToolName = toolNameMapping.toProviderToolName(
2928
3009
  part.toolName
2929
3010
  );
3011
+ if (resolvedToolName === "tool_search" && output.type === "json") {
3012
+ const parsedOutput = await validateTypes({
3013
+ value: output.value,
3014
+ schema: toolSearchOutputSchema
3015
+ });
3016
+ input.push({
3017
+ type: "tool_search_output",
3018
+ execution: "client",
3019
+ call_id: part.toolCallId,
3020
+ status: "completed",
3021
+ tools: parsedOutput.tools
3022
+ });
3023
+ continue;
3024
+ }
2930
3025
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
2931
3026
  const parsedOutput = await validateTypes({
2932
3027
  value: output.value,
@@ -2979,7 +3074,7 @@ async function convertToOpenAIResponsesInput({
2979
3074
  outputValue = output.value;
2980
3075
  break;
2981
3076
  case "execution-denied":
2982
- outputValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
3077
+ outputValue = (_p = output.reason) != null ? _p : "Tool execution denied.";
2983
3078
  break;
2984
3079
  case "json":
2985
3080
  case "error-json":
@@ -3033,7 +3128,7 @@ async function convertToOpenAIResponsesInput({
3033
3128
  contentValue = output.value;
3034
3129
  break;
3035
3130
  case "execution-denied":
3036
- contentValue = (_m = output.reason) != null ? _m : "Tool execution denied.";
3131
+ contentValue = (_q = output.reason) != null ? _q : "Tool execution denied.";
3037
3132
  break;
3038
3133
  case "json":
3039
3134
  case "error-json":
@@ -3103,9 +3198,9 @@ async function convertToOpenAIResponsesInput({
3103
3198
  }
3104
3199
  return { input, warnings };
3105
3200
  }
3106
- var openaiResponsesReasoningProviderOptionsSchema = z15.object({
3107
- itemId: z15.string().nullish(),
3108
- reasoningEncryptedContent: z15.string().nullish()
3201
+ var openaiResponsesReasoningProviderOptionsSchema = z16.object({
3202
+ itemId: z16.string().nullish(),
3203
+ reasoningEncryptedContent: z16.string().nullish()
3109
3204
  });
3110
3205
 
3111
3206
  // src/responses/map-openai-responses-finish-reason.ts
@@ -3127,483 +3222,525 @@ function mapOpenAIResponseFinishReason({
3127
3222
  }
3128
3223
 
3129
3224
  // src/responses/openai-responses-api.ts
3130
- import { lazySchema as lazySchema14, zodSchema as zodSchema14 } from "@ai-sdk/provider-utils";
3131
- import { z as z16 } from "zod/v4";
3132
- var openaiResponsesChunkSchema = lazySchema14(
3133
- () => zodSchema14(
3134
- z16.union([
3135
- z16.object({
3136
- type: z16.literal("response.output_text.delta"),
3137
- item_id: z16.string(),
3138
- delta: z16.string(),
3139
- logprobs: z16.array(
3140
- z16.object({
3141
- token: z16.string(),
3142
- logprob: z16.number(),
3143
- top_logprobs: z16.array(
3144
- z16.object({
3145
- token: z16.string(),
3146
- logprob: z16.number()
3225
+ import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
3226
+ import { z as z17 } from "zod/v4";
3227
+ var jsonValueSchema = z17.lazy(
3228
+ () => z17.union([
3229
+ z17.string(),
3230
+ z17.number(),
3231
+ z17.boolean(),
3232
+ z17.null(),
3233
+ z17.array(jsonValueSchema),
3234
+ z17.record(z17.string(), jsonValueSchema.optional())
3235
+ ])
3236
+ );
3237
+ var openaiResponsesChunkSchema = lazySchema15(
3238
+ () => zodSchema15(
3239
+ z17.union([
3240
+ z17.object({
3241
+ type: z17.literal("response.output_text.delta"),
3242
+ item_id: z17.string(),
3243
+ delta: z17.string(),
3244
+ logprobs: z17.array(
3245
+ z17.object({
3246
+ token: z17.string(),
3247
+ logprob: z17.number(),
3248
+ top_logprobs: z17.array(
3249
+ z17.object({
3250
+ token: z17.string(),
3251
+ logprob: z17.number()
3147
3252
  })
3148
3253
  )
3149
3254
  })
3150
3255
  ).nullish()
3151
3256
  }),
3152
- z16.object({
3153
- type: z16.enum(["response.completed", "response.incomplete"]),
3154
- response: z16.object({
3155
- incomplete_details: z16.object({ reason: z16.string() }).nullish(),
3156
- usage: z16.object({
3157
- input_tokens: z16.number(),
3158
- input_tokens_details: z16.object({ cached_tokens: z16.number().nullish() }).nullish(),
3159
- output_tokens: z16.number(),
3160
- output_tokens_details: z16.object({ reasoning_tokens: z16.number().nullish() }).nullish()
3257
+ z17.object({
3258
+ type: z17.enum(["response.completed", "response.incomplete"]),
3259
+ response: z17.object({
3260
+ incomplete_details: z17.object({ reason: z17.string() }).nullish(),
3261
+ usage: z17.object({
3262
+ input_tokens: z17.number(),
3263
+ input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
3264
+ output_tokens: z17.number(),
3265
+ output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
3161
3266
  }),
3162
- service_tier: z16.string().nullish()
3267
+ service_tier: z17.string().nullish()
3163
3268
  })
3164
3269
  }),
3165
- z16.object({
3166
- type: z16.literal("response.created"),
3167
- response: z16.object({
3168
- id: z16.string(),
3169
- created_at: z16.number(),
3170
- model: z16.string(),
3171
- service_tier: z16.string().nullish()
3270
+ z17.object({
3271
+ type: z17.literal("response.created"),
3272
+ response: z17.object({
3273
+ id: z17.string(),
3274
+ created_at: z17.number(),
3275
+ model: z17.string(),
3276
+ service_tier: z17.string().nullish()
3172
3277
  })
3173
3278
  }),
3174
- z16.object({
3175
- type: z16.literal("response.output_item.added"),
3176
- output_index: z16.number(),
3177
- item: z16.discriminatedUnion("type", [
3178
- z16.object({
3179
- type: z16.literal("message"),
3180
- id: z16.string(),
3181
- phase: z16.enum(["commentary", "final_answer"]).nullish()
3279
+ z17.object({
3280
+ type: z17.literal("response.output_item.added"),
3281
+ output_index: z17.number(),
3282
+ item: z17.discriminatedUnion("type", [
3283
+ z17.object({
3284
+ type: z17.literal("message"),
3285
+ id: z17.string(),
3286
+ phase: z17.enum(["commentary", "final_answer"]).nullish()
3182
3287
  }),
3183
- z16.object({
3184
- type: z16.literal("reasoning"),
3185
- id: z16.string(),
3186
- encrypted_content: z16.string().nullish()
3288
+ z17.object({
3289
+ type: z17.literal("reasoning"),
3290
+ id: z17.string(),
3291
+ encrypted_content: z17.string().nullish()
3187
3292
  }),
3188
- z16.object({
3189
- type: z16.literal("function_call"),
3190
- id: z16.string(),
3191
- call_id: z16.string(),
3192
- name: z16.string(),
3193
- arguments: z16.string()
3293
+ z17.object({
3294
+ type: z17.literal("function_call"),
3295
+ id: z17.string(),
3296
+ call_id: z17.string(),
3297
+ name: z17.string(),
3298
+ arguments: z17.string()
3194
3299
  }),
3195
- z16.object({
3196
- type: z16.literal("web_search_call"),
3197
- id: z16.string(),
3198
- status: z16.string()
3300
+ z17.object({
3301
+ type: z17.literal("web_search_call"),
3302
+ id: z17.string(),
3303
+ status: z17.string()
3199
3304
  }),
3200
- z16.object({
3201
- type: z16.literal("computer_call"),
3202
- id: z16.string(),
3203
- status: z16.string()
3305
+ z17.object({
3306
+ type: z17.literal("computer_call"),
3307
+ id: z17.string(),
3308
+ status: z17.string()
3204
3309
  }),
3205
- z16.object({
3206
- type: z16.literal("file_search_call"),
3207
- id: z16.string()
3310
+ z17.object({
3311
+ type: z17.literal("file_search_call"),
3312
+ id: z17.string()
3208
3313
  }),
3209
- z16.object({
3210
- type: z16.literal("image_generation_call"),
3211
- id: z16.string()
3314
+ z17.object({
3315
+ type: z17.literal("image_generation_call"),
3316
+ id: z17.string()
3212
3317
  }),
3213
- z16.object({
3214
- type: z16.literal("code_interpreter_call"),
3215
- id: z16.string(),
3216
- container_id: z16.string(),
3217
- code: z16.string().nullable(),
3218
- outputs: z16.array(
3219
- z16.discriminatedUnion("type", [
3220
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
3221
- z16.object({ type: z16.literal("image"), url: z16.string() })
3318
+ z17.object({
3319
+ type: z17.literal("code_interpreter_call"),
3320
+ id: z17.string(),
3321
+ container_id: z17.string(),
3322
+ code: z17.string().nullable(),
3323
+ outputs: z17.array(
3324
+ z17.discriminatedUnion("type", [
3325
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
3326
+ z17.object({ type: z17.literal("image"), url: z17.string() })
3222
3327
  ])
3223
3328
  ).nullable(),
3224
- status: z16.string()
3329
+ status: z17.string()
3225
3330
  }),
3226
- z16.object({
3227
- type: z16.literal("mcp_call"),
3228
- id: z16.string(),
3229
- status: z16.string(),
3230
- approval_request_id: z16.string().nullish()
3331
+ z17.object({
3332
+ type: z17.literal("mcp_call"),
3333
+ id: z17.string(),
3334
+ status: z17.string(),
3335
+ approval_request_id: z17.string().nullish()
3231
3336
  }),
3232
- z16.object({
3233
- type: z16.literal("mcp_list_tools"),
3234
- id: z16.string()
3337
+ z17.object({
3338
+ type: z17.literal("mcp_list_tools"),
3339
+ id: z17.string()
3235
3340
  }),
3236
- z16.object({
3237
- type: z16.literal("mcp_approval_request"),
3238
- id: z16.string()
3341
+ z17.object({
3342
+ type: z17.literal("mcp_approval_request"),
3343
+ id: z17.string()
3239
3344
  }),
3240
- z16.object({
3241
- type: z16.literal("apply_patch_call"),
3242
- id: z16.string(),
3243
- call_id: z16.string(),
3244
- status: z16.enum(["in_progress", "completed"]),
3245
- operation: z16.discriminatedUnion("type", [
3246
- z16.object({
3247
- type: z16.literal("create_file"),
3248
- path: z16.string(),
3249
- diff: z16.string()
3345
+ z17.object({
3346
+ type: z17.literal("apply_patch_call"),
3347
+ id: z17.string(),
3348
+ call_id: z17.string(),
3349
+ status: z17.enum(["in_progress", "completed"]),
3350
+ operation: z17.discriminatedUnion("type", [
3351
+ z17.object({
3352
+ type: z17.literal("create_file"),
3353
+ path: z17.string(),
3354
+ diff: z17.string()
3250
3355
  }),
3251
- z16.object({
3252
- type: z16.literal("delete_file"),
3253
- path: z16.string()
3356
+ z17.object({
3357
+ type: z17.literal("delete_file"),
3358
+ path: z17.string()
3254
3359
  }),
3255
- z16.object({
3256
- type: z16.literal("update_file"),
3257
- path: z16.string(),
3258
- diff: z16.string()
3360
+ z17.object({
3361
+ type: z17.literal("update_file"),
3362
+ path: z17.string(),
3363
+ diff: z17.string()
3259
3364
  })
3260
3365
  ])
3261
3366
  }),
3262
- z16.object({
3263
- type: z16.literal("custom_tool_call"),
3264
- id: z16.string(),
3265
- call_id: z16.string(),
3266
- name: z16.string(),
3267
- input: z16.string()
3367
+ z17.object({
3368
+ type: z17.literal("custom_tool_call"),
3369
+ id: z17.string(),
3370
+ call_id: z17.string(),
3371
+ name: z17.string(),
3372
+ input: z17.string()
3268
3373
  }),
3269
- z16.object({
3270
- type: z16.literal("shell_call"),
3271
- id: z16.string(),
3272
- call_id: z16.string(),
3273
- status: z16.enum(["in_progress", "completed", "incomplete"]),
3274
- action: z16.object({
3275
- commands: z16.array(z16.string())
3374
+ z17.object({
3375
+ type: z17.literal("shell_call"),
3376
+ id: z17.string(),
3377
+ call_id: z17.string(),
3378
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3379
+ action: z17.object({
3380
+ commands: z17.array(z17.string())
3276
3381
  })
3277
3382
  }),
3278
- z16.object({
3279
- type: z16.literal("shell_call_output"),
3280
- id: z16.string(),
3281
- call_id: z16.string(),
3282
- status: z16.enum(["in_progress", "completed", "incomplete"]),
3283
- output: z16.array(
3284
- z16.object({
3285
- stdout: z16.string(),
3286
- stderr: z16.string(),
3287
- outcome: z16.discriminatedUnion("type", [
3288
- z16.object({ type: z16.literal("timeout") }),
3289
- z16.object({
3290
- type: z16.literal("exit"),
3291
- exit_code: z16.number()
3383
+ z17.object({
3384
+ type: z17.literal("shell_call_output"),
3385
+ id: z17.string(),
3386
+ call_id: z17.string(),
3387
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3388
+ output: z17.array(
3389
+ z17.object({
3390
+ stdout: z17.string(),
3391
+ stderr: z17.string(),
3392
+ outcome: z17.discriminatedUnion("type", [
3393
+ z17.object({ type: z17.literal("timeout") }),
3394
+ z17.object({
3395
+ type: z17.literal("exit"),
3396
+ exit_code: z17.number()
3292
3397
  })
3293
3398
  ])
3294
3399
  })
3295
3400
  )
3401
+ }),
3402
+ z17.object({
3403
+ type: z17.literal("tool_search_call"),
3404
+ id: z17.string(),
3405
+ execution: z17.enum(["server", "client"]),
3406
+ call_id: z17.string().nullable(),
3407
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3408
+ arguments: z17.unknown()
3409
+ }),
3410
+ z17.object({
3411
+ type: z17.literal("tool_search_output"),
3412
+ id: z17.string(),
3413
+ execution: z17.enum(["server", "client"]),
3414
+ call_id: z17.string().nullable(),
3415
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3416
+ tools: z17.array(z17.record(z17.string(), jsonValueSchema.optional()))
3296
3417
  })
3297
3418
  ])
3298
3419
  }),
3299
- z16.object({
3300
- type: z16.literal("response.output_item.done"),
3301
- output_index: z16.number(),
3302
- item: z16.discriminatedUnion("type", [
3303
- z16.object({
3304
- type: z16.literal("message"),
3305
- id: z16.string(),
3306
- phase: z16.enum(["commentary", "final_answer"]).nullish()
3420
+ z17.object({
3421
+ type: z17.literal("response.output_item.done"),
3422
+ output_index: z17.number(),
3423
+ item: z17.discriminatedUnion("type", [
3424
+ z17.object({
3425
+ type: z17.literal("message"),
3426
+ id: z17.string(),
3427
+ phase: z17.enum(["commentary", "final_answer"]).nullish()
3307
3428
  }),
3308
- z16.object({
3309
- type: z16.literal("reasoning"),
3310
- id: z16.string(),
3311
- encrypted_content: z16.string().nullish()
3429
+ z17.object({
3430
+ type: z17.literal("reasoning"),
3431
+ id: z17.string(),
3432
+ encrypted_content: z17.string().nullish()
3312
3433
  }),
3313
- z16.object({
3314
- type: z16.literal("function_call"),
3315
- id: z16.string(),
3316
- call_id: z16.string(),
3317
- name: z16.string(),
3318
- arguments: z16.string(),
3319
- status: z16.literal("completed")
3434
+ z17.object({
3435
+ type: z17.literal("function_call"),
3436
+ id: z17.string(),
3437
+ call_id: z17.string(),
3438
+ name: z17.string(),
3439
+ arguments: z17.string(),
3440
+ status: z17.literal("completed")
3320
3441
  }),
3321
- z16.object({
3322
- type: z16.literal("custom_tool_call"),
3323
- id: z16.string(),
3324
- call_id: z16.string(),
3325
- name: z16.string(),
3326
- input: z16.string(),
3327
- status: z16.literal("completed")
3442
+ z17.object({
3443
+ type: z17.literal("custom_tool_call"),
3444
+ id: z17.string(),
3445
+ call_id: z17.string(),
3446
+ name: z17.string(),
3447
+ input: z17.string(),
3448
+ status: z17.literal("completed")
3328
3449
  }),
3329
- z16.object({
3330
- type: z16.literal("code_interpreter_call"),
3331
- id: z16.string(),
3332
- code: z16.string().nullable(),
3333
- container_id: z16.string(),
3334
- outputs: z16.array(
3335
- z16.discriminatedUnion("type", [
3336
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
3337
- z16.object({ type: z16.literal("image"), url: z16.string() })
3450
+ z17.object({
3451
+ type: z17.literal("code_interpreter_call"),
3452
+ id: z17.string(),
3453
+ code: z17.string().nullable(),
3454
+ container_id: z17.string(),
3455
+ outputs: z17.array(
3456
+ z17.discriminatedUnion("type", [
3457
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
3458
+ z17.object({ type: z17.literal("image"), url: z17.string() })
3338
3459
  ])
3339
3460
  ).nullable()
3340
3461
  }),
3341
- z16.object({
3342
- type: z16.literal("image_generation_call"),
3343
- id: z16.string(),
3344
- result: z16.string()
3462
+ z17.object({
3463
+ type: z17.literal("image_generation_call"),
3464
+ id: z17.string(),
3465
+ result: z17.string()
3345
3466
  }),
3346
- z16.object({
3347
- type: z16.literal("web_search_call"),
3348
- id: z16.string(),
3349
- status: z16.string(),
3350
- action: z16.discriminatedUnion("type", [
3351
- z16.object({
3352
- type: z16.literal("search"),
3353
- query: z16.string().nullish(),
3354
- sources: z16.array(
3355
- z16.discriminatedUnion("type", [
3356
- z16.object({ type: z16.literal("url"), url: z16.string() }),
3357
- z16.object({ type: z16.literal("api"), name: z16.string() })
3467
+ z17.object({
3468
+ type: z17.literal("web_search_call"),
3469
+ id: z17.string(),
3470
+ status: z17.string(),
3471
+ action: z17.discriminatedUnion("type", [
3472
+ z17.object({
3473
+ type: z17.literal("search"),
3474
+ query: z17.string().nullish(),
3475
+ sources: z17.array(
3476
+ z17.discriminatedUnion("type", [
3477
+ z17.object({ type: z17.literal("url"), url: z17.string() }),
3478
+ z17.object({ type: z17.literal("api"), name: z17.string() })
3358
3479
  ])
3359
3480
  ).nullish()
3360
3481
  }),
3361
- z16.object({
3362
- type: z16.literal("open_page"),
3363
- url: z16.string().nullish()
3482
+ z17.object({
3483
+ type: z17.literal("open_page"),
3484
+ url: z17.string().nullish()
3364
3485
  }),
3365
- z16.object({
3366
- type: z16.literal("find_in_page"),
3367
- url: z16.string().nullish(),
3368
- pattern: z16.string().nullish()
3486
+ z17.object({
3487
+ type: z17.literal("find_in_page"),
3488
+ url: z17.string().nullish(),
3489
+ pattern: z17.string().nullish()
3369
3490
  })
3370
3491
  ]).nullish()
3371
3492
  }),
3372
- z16.object({
3373
- type: z16.literal("file_search_call"),
3374
- id: z16.string(),
3375
- queries: z16.array(z16.string()),
3376
- results: z16.array(
3377
- z16.object({
3378
- attributes: z16.record(
3379
- z16.string(),
3380
- z16.union([z16.string(), z16.number(), z16.boolean()])
3493
+ z17.object({
3494
+ type: z17.literal("file_search_call"),
3495
+ id: z17.string(),
3496
+ queries: z17.array(z17.string()),
3497
+ results: z17.array(
3498
+ z17.object({
3499
+ attributes: z17.record(
3500
+ z17.string(),
3501
+ z17.union([z17.string(), z17.number(), z17.boolean()])
3381
3502
  ),
3382
- file_id: z16.string(),
3383
- filename: z16.string(),
3384
- score: z16.number(),
3385
- text: z16.string()
3503
+ file_id: z17.string(),
3504
+ filename: z17.string(),
3505
+ score: z17.number(),
3506
+ text: z17.string()
3386
3507
  })
3387
3508
  ).nullish()
3388
3509
  }),
3389
- z16.object({
3390
- type: z16.literal("local_shell_call"),
3391
- id: z16.string(),
3392
- call_id: z16.string(),
3393
- action: z16.object({
3394
- type: z16.literal("exec"),
3395
- command: z16.array(z16.string()),
3396
- timeout_ms: z16.number().optional(),
3397
- user: z16.string().optional(),
3398
- working_directory: z16.string().optional(),
3399
- env: z16.record(z16.string(), z16.string()).optional()
3510
+ z17.object({
3511
+ type: z17.literal("local_shell_call"),
3512
+ id: z17.string(),
3513
+ call_id: z17.string(),
3514
+ action: z17.object({
3515
+ type: z17.literal("exec"),
3516
+ command: z17.array(z17.string()),
3517
+ timeout_ms: z17.number().optional(),
3518
+ user: z17.string().optional(),
3519
+ working_directory: z17.string().optional(),
3520
+ env: z17.record(z17.string(), z17.string()).optional()
3400
3521
  })
3401
3522
  }),
3402
- z16.object({
3403
- type: z16.literal("computer_call"),
3404
- id: z16.string(),
3405
- status: z16.literal("completed")
3523
+ z17.object({
3524
+ type: z17.literal("computer_call"),
3525
+ id: z17.string(),
3526
+ status: z17.literal("completed")
3406
3527
  }),
3407
- z16.object({
3408
- type: z16.literal("mcp_call"),
3409
- id: z16.string(),
3410
- status: z16.string(),
3411
- arguments: z16.string(),
3412
- name: z16.string(),
3413
- server_label: z16.string(),
3414
- output: z16.string().nullish(),
3415
- error: z16.union([
3416
- z16.string(),
3417
- z16.object({
3418
- type: z16.string().optional(),
3419
- code: z16.union([z16.number(), z16.string()]).optional(),
3420
- message: z16.string().optional()
3528
+ z17.object({
3529
+ type: z17.literal("mcp_call"),
3530
+ id: z17.string(),
3531
+ status: z17.string(),
3532
+ arguments: z17.string(),
3533
+ name: z17.string(),
3534
+ server_label: z17.string(),
3535
+ output: z17.string().nullish(),
3536
+ error: z17.union([
3537
+ z17.string(),
3538
+ z17.object({
3539
+ type: z17.string().optional(),
3540
+ code: z17.union([z17.number(), z17.string()]).optional(),
3541
+ message: z17.string().optional()
3421
3542
  }).loose()
3422
3543
  ]).nullish(),
3423
- approval_request_id: z16.string().nullish()
3544
+ approval_request_id: z17.string().nullish()
3424
3545
  }),
3425
- z16.object({
3426
- type: z16.literal("mcp_list_tools"),
3427
- id: z16.string(),
3428
- server_label: z16.string(),
3429
- tools: z16.array(
3430
- z16.object({
3431
- name: z16.string(),
3432
- description: z16.string().optional(),
3433
- input_schema: z16.any(),
3434
- annotations: z16.record(z16.string(), z16.unknown()).optional()
3546
+ z17.object({
3547
+ type: z17.literal("mcp_list_tools"),
3548
+ id: z17.string(),
3549
+ server_label: z17.string(),
3550
+ tools: z17.array(
3551
+ z17.object({
3552
+ name: z17.string(),
3553
+ description: z17.string().optional(),
3554
+ input_schema: z17.any(),
3555
+ annotations: z17.record(z17.string(), z17.unknown()).optional()
3435
3556
  })
3436
3557
  ),
3437
- error: z16.union([
3438
- z16.string(),
3439
- z16.object({
3440
- type: z16.string().optional(),
3441
- code: z16.union([z16.number(), z16.string()]).optional(),
3442
- message: z16.string().optional()
3558
+ error: z17.union([
3559
+ z17.string(),
3560
+ z17.object({
3561
+ type: z17.string().optional(),
3562
+ code: z17.union([z17.number(), z17.string()]).optional(),
3563
+ message: z17.string().optional()
3443
3564
  }).loose()
3444
3565
  ]).optional()
3445
3566
  }),
3446
- z16.object({
3447
- type: z16.literal("mcp_approval_request"),
3448
- id: z16.string(),
3449
- server_label: z16.string(),
3450
- name: z16.string(),
3451
- arguments: z16.string(),
3452
- approval_request_id: z16.string().optional()
3567
+ z17.object({
3568
+ type: z17.literal("mcp_approval_request"),
3569
+ id: z17.string(),
3570
+ server_label: z17.string(),
3571
+ name: z17.string(),
3572
+ arguments: z17.string(),
3573
+ approval_request_id: z17.string().optional()
3453
3574
  }),
3454
- z16.object({
3455
- type: z16.literal("apply_patch_call"),
3456
- id: z16.string(),
3457
- call_id: z16.string(),
3458
- status: z16.enum(["in_progress", "completed"]),
3459
- operation: z16.discriminatedUnion("type", [
3460
- z16.object({
3461
- type: z16.literal("create_file"),
3462
- path: z16.string(),
3463
- diff: z16.string()
3575
+ z17.object({
3576
+ type: z17.literal("apply_patch_call"),
3577
+ id: z17.string(),
3578
+ call_id: z17.string(),
3579
+ status: z17.enum(["in_progress", "completed"]),
3580
+ operation: z17.discriminatedUnion("type", [
3581
+ z17.object({
3582
+ type: z17.literal("create_file"),
3583
+ path: z17.string(),
3584
+ diff: z17.string()
3464
3585
  }),
3465
- z16.object({
3466
- type: z16.literal("delete_file"),
3467
- path: z16.string()
3586
+ z17.object({
3587
+ type: z17.literal("delete_file"),
3588
+ path: z17.string()
3468
3589
  }),
3469
- z16.object({
3470
- type: z16.literal("update_file"),
3471
- path: z16.string(),
3472
- diff: z16.string()
3590
+ z17.object({
3591
+ type: z17.literal("update_file"),
3592
+ path: z17.string(),
3593
+ diff: z17.string()
3473
3594
  })
3474
3595
  ])
3475
3596
  }),
3476
- z16.object({
3477
- type: z16.literal("shell_call"),
3478
- id: z16.string(),
3479
- call_id: z16.string(),
3480
- status: z16.enum(["in_progress", "completed", "incomplete"]),
3481
- action: z16.object({
3482
- commands: z16.array(z16.string())
3597
+ z17.object({
3598
+ type: z17.literal("shell_call"),
3599
+ id: z17.string(),
3600
+ call_id: z17.string(),
3601
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3602
+ action: z17.object({
3603
+ commands: z17.array(z17.string())
3483
3604
  })
3484
3605
  }),
3485
- z16.object({
3486
- type: z16.literal("shell_call_output"),
3487
- id: z16.string(),
3488
- call_id: z16.string(),
3489
- status: z16.enum(["in_progress", "completed", "incomplete"]),
3490
- output: z16.array(
3491
- z16.object({
3492
- stdout: z16.string(),
3493
- stderr: z16.string(),
3494
- outcome: z16.discriminatedUnion("type", [
3495
- z16.object({ type: z16.literal("timeout") }),
3496
- z16.object({
3497
- type: z16.literal("exit"),
3498
- exit_code: z16.number()
3606
+ z17.object({
3607
+ type: z17.literal("shell_call_output"),
3608
+ id: z17.string(),
3609
+ call_id: z17.string(),
3610
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3611
+ output: z17.array(
3612
+ z17.object({
3613
+ stdout: z17.string(),
3614
+ stderr: z17.string(),
3615
+ outcome: z17.discriminatedUnion("type", [
3616
+ z17.object({ type: z17.literal("timeout") }),
3617
+ z17.object({
3618
+ type: z17.literal("exit"),
3619
+ exit_code: z17.number()
3499
3620
  })
3500
3621
  ])
3501
3622
  })
3502
3623
  )
3624
+ }),
3625
+ z17.object({
3626
+ type: z17.literal("tool_search_call"),
3627
+ id: z17.string(),
3628
+ execution: z17.enum(["server", "client"]),
3629
+ call_id: z17.string().nullable(),
3630
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3631
+ arguments: z17.unknown()
3632
+ }),
3633
+ z17.object({
3634
+ type: z17.literal("tool_search_output"),
3635
+ id: z17.string(),
3636
+ execution: z17.enum(["server", "client"]),
3637
+ call_id: z17.string().nullable(),
3638
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3639
+ tools: z17.array(z17.record(z17.string(), jsonValueSchema.optional()))
3503
3640
  })
3504
3641
  ])
3505
3642
  }),
3506
- z16.object({
3507
- type: z16.literal("response.function_call_arguments.delta"),
3508
- item_id: z16.string(),
3509
- output_index: z16.number(),
3510
- delta: z16.string()
3643
+ z17.object({
3644
+ type: z17.literal("response.function_call_arguments.delta"),
3645
+ item_id: z17.string(),
3646
+ output_index: z17.number(),
3647
+ delta: z17.string()
3511
3648
  }),
3512
- z16.object({
3513
- type: z16.literal("response.custom_tool_call_input.delta"),
3514
- item_id: z16.string(),
3515
- output_index: z16.number(),
3516
- delta: z16.string()
3649
+ z17.object({
3650
+ type: z17.literal("response.custom_tool_call_input.delta"),
3651
+ item_id: z17.string(),
3652
+ output_index: z17.number(),
3653
+ delta: z17.string()
3517
3654
  }),
3518
- z16.object({
3519
- type: z16.literal("response.image_generation_call.partial_image"),
3520
- item_id: z16.string(),
3521
- output_index: z16.number(),
3522
- partial_image_b64: z16.string()
3655
+ z17.object({
3656
+ type: z17.literal("response.image_generation_call.partial_image"),
3657
+ item_id: z17.string(),
3658
+ output_index: z17.number(),
3659
+ partial_image_b64: z17.string()
3523
3660
  }),
3524
- z16.object({
3525
- type: z16.literal("response.code_interpreter_call_code.delta"),
3526
- item_id: z16.string(),
3527
- output_index: z16.number(),
3528
- delta: z16.string()
3661
+ z17.object({
3662
+ type: z17.literal("response.code_interpreter_call_code.delta"),
3663
+ item_id: z17.string(),
3664
+ output_index: z17.number(),
3665
+ delta: z17.string()
3529
3666
  }),
3530
- z16.object({
3531
- type: z16.literal("response.code_interpreter_call_code.done"),
3532
- item_id: z16.string(),
3533
- output_index: z16.number(),
3534
- code: z16.string()
3667
+ z17.object({
3668
+ type: z17.literal("response.code_interpreter_call_code.done"),
3669
+ item_id: z17.string(),
3670
+ output_index: z17.number(),
3671
+ code: z17.string()
3535
3672
  }),
3536
- z16.object({
3537
- type: z16.literal("response.output_text.annotation.added"),
3538
- annotation: z16.discriminatedUnion("type", [
3539
- z16.object({
3540
- type: z16.literal("url_citation"),
3541
- start_index: z16.number(),
3542
- end_index: z16.number(),
3543
- url: z16.string(),
3544
- title: z16.string()
3673
+ z17.object({
3674
+ type: z17.literal("response.output_text.annotation.added"),
3675
+ annotation: z17.discriminatedUnion("type", [
3676
+ z17.object({
3677
+ type: z17.literal("url_citation"),
3678
+ start_index: z17.number(),
3679
+ end_index: z17.number(),
3680
+ url: z17.string(),
3681
+ title: z17.string()
3545
3682
  }),
3546
- z16.object({
3547
- type: z16.literal("file_citation"),
3548
- file_id: z16.string(),
3549
- filename: z16.string(),
3550
- index: z16.number()
3683
+ z17.object({
3684
+ type: z17.literal("file_citation"),
3685
+ file_id: z17.string(),
3686
+ filename: z17.string(),
3687
+ index: z17.number()
3551
3688
  }),
3552
- z16.object({
3553
- type: z16.literal("container_file_citation"),
3554
- container_id: z16.string(),
3555
- file_id: z16.string(),
3556
- filename: z16.string(),
3557
- start_index: z16.number(),
3558
- end_index: z16.number()
3689
+ z17.object({
3690
+ type: z17.literal("container_file_citation"),
3691
+ container_id: z17.string(),
3692
+ file_id: z17.string(),
3693
+ filename: z17.string(),
3694
+ start_index: z17.number(),
3695
+ end_index: z17.number()
3559
3696
  }),
3560
- z16.object({
3561
- type: z16.literal("file_path"),
3562
- file_id: z16.string(),
3563
- index: z16.number()
3697
+ z17.object({
3698
+ type: z17.literal("file_path"),
3699
+ file_id: z17.string(),
3700
+ index: z17.number()
3564
3701
  })
3565
3702
  ])
3566
3703
  }),
3567
- z16.object({
3568
- type: z16.literal("response.reasoning_summary_part.added"),
3569
- item_id: z16.string(),
3570
- summary_index: z16.number()
3704
+ z17.object({
3705
+ type: z17.literal("response.reasoning_summary_part.added"),
3706
+ item_id: z17.string(),
3707
+ summary_index: z17.number()
3571
3708
  }),
3572
- z16.object({
3573
- type: z16.literal("response.reasoning_summary_text.delta"),
3574
- item_id: z16.string(),
3575
- summary_index: z16.number(),
3576
- delta: z16.string()
3709
+ z17.object({
3710
+ type: z17.literal("response.reasoning_summary_text.delta"),
3711
+ item_id: z17.string(),
3712
+ summary_index: z17.number(),
3713
+ delta: z17.string()
3577
3714
  }),
3578
- z16.object({
3579
- type: z16.literal("response.reasoning_summary_part.done"),
3580
- item_id: z16.string(),
3581
- summary_index: z16.number()
3715
+ z17.object({
3716
+ type: z17.literal("response.reasoning_summary_part.done"),
3717
+ item_id: z17.string(),
3718
+ summary_index: z17.number()
3582
3719
  }),
3583
- z16.object({
3584
- type: z16.literal("response.apply_patch_call_operation_diff.delta"),
3585
- item_id: z16.string(),
3586
- output_index: z16.number(),
3587
- delta: z16.string(),
3588
- obfuscation: z16.string().nullish()
3720
+ z17.object({
3721
+ type: z17.literal("response.apply_patch_call_operation_diff.delta"),
3722
+ item_id: z17.string(),
3723
+ output_index: z17.number(),
3724
+ delta: z17.string(),
3725
+ obfuscation: z17.string().nullish()
3589
3726
  }),
3590
- z16.object({
3591
- type: z16.literal("response.apply_patch_call_operation_diff.done"),
3592
- item_id: z16.string(),
3593
- output_index: z16.number(),
3594
- diff: z16.string()
3727
+ z17.object({
3728
+ type: z17.literal("response.apply_patch_call_operation_diff.done"),
3729
+ item_id: z17.string(),
3730
+ output_index: z17.number(),
3731
+ diff: z17.string()
3595
3732
  }),
3596
- z16.object({
3597
- type: z16.literal("error"),
3598
- sequence_number: z16.number(),
3599
- error: z16.object({
3600
- type: z16.string(),
3601
- code: z16.string(),
3602
- message: z16.string(),
3603
- param: z16.string().nullish()
3733
+ z17.object({
3734
+ type: z17.literal("error"),
3735
+ sequence_number: z17.number(),
3736
+ error: z17.object({
3737
+ type: z17.string(),
3738
+ code: z17.string(),
3739
+ message: z17.string(),
3740
+ param: z17.string().nullish()
3604
3741
  })
3605
3742
  }),
3606
- z16.object({ type: z16.string() }).loose().transform((value) => ({
3743
+ z17.object({ type: z17.string() }).loose().transform((value) => ({
3607
3744
  type: "unknown_chunk",
3608
3745
  message: value.type
3609
3746
  }))
@@ -3611,294 +3748,310 @@ var openaiResponsesChunkSchema = lazySchema14(
3611
3748
  ])
3612
3749
  )
3613
3750
  );
3614
- var openaiResponsesResponseSchema = lazySchema14(
3615
- () => zodSchema14(
3616
- z16.object({
3617
- id: z16.string().optional(),
3618
- created_at: z16.number().optional(),
3619
- error: z16.object({
3620
- message: z16.string(),
3621
- type: z16.string(),
3622
- param: z16.string().nullish(),
3623
- code: z16.string()
3751
+ var openaiResponsesResponseSchema = lazySchema15(
3752
+ () => zodSchema15(
3753
+ z17.object({
3754
+ id: z17.string().optional(),
3755
+ created_at: z17.number().optional(),
3756
+ error: z17.object({
3757
+ message: z17.string(),
3758
+ type: z17.string(),
3759
+ param: z17.string().nullish(),
3760
+ code: z17.string()
3624
3761
  }).nullish(),
3625
- model: z16.string().optional(),
3626
- output: z16.array(
3627
- z16.discriminatedUnion("type", [
3628
- z16.object({
3629
- type: z16.literal("message"),
3630
- role: z16.literal("assistant"),
3631
- id: z16.string(),
3632
- phase: z16.enum(["commentary", "final_answer"]).nullish(),
3633
- content: z16.array(
3634
- z16.object({
3635
- type: z16.literal("output_text"),
3636
- text: z16.string(),
3637
- logprobs: z16.array(
3638
- z16.object({
3639
- token: z16.string(),
3640
- logprob: z16.number(),
3641
- top_logprobs: z16.array(
3642
- z16.object({
3643
- token: z16.string(),
3644
- logprob: z16.number()
3762
+ model: z17.string().optional(),
3763
+ output: z17.array(
3764
+ z17.discriminatedUnion("type", [
3765
+ z17.object({
3766
+ type: z17.literal("message"),
3767
+ role: z17.literal("assistant"),
3768
+ id: z17.string(),
3769
+ phase: z17.enum(["commentary", "final_answer"]).nullish(),
3770
+ content: z17.array(
3771
+ z17.object({
3772
+ type: z17.literal("output_text"),
3773
+ text: z17.string(),
3774
+ logprobs: z17.array(
3775
+ z17.object({
3776
+ token: z17.string(),
3777
+ logprob: z17.number(),
3778
+ top_logprobs: z17.array(
3779
+ z17.object({
3780
+ token: z17.string(),
3781
+ logprob: z17.number()
3645
3782
  })
3646
3783
  )
3647
3784
  })
3648
3785
  ).nullish(),
3649
- annotations: z16.array(
3650
- z16.discriminatedUnion("type", [
3651
- z16.object({
3652
- type: z16.literal("url_citation"),
3653
- start_index: z16.number(),
3654
- end_index: z16.number(),
3655
- url: z16.string(),
3656
- title: z16.string()
3786
+ annotations: z17.array(
3787
+ z17.discriminatedUnion("type", [
3788
+ z17.object({
3789
+ type: z17.literal("url_citation"),
3790
+ start_index: z17.number(),
3791
+ end_index: z17.number(),
3792
+ url: z17.string(),
3793
+ title: z17.string()
3657
3794
  }),
3658
- z16.object({
3659
- type: z16.literal("file_citation"),
3660
- file_id: z16.string(),
3661
- filename: z16.string(),
3662
- index: z16.number()
3795
+ z17.object({
3796
+ type: z17.literal("file_citation"),
3797
+ file_id: z17.string(),
3798
+ filename: z17.string(),
3799
+ index: z17.number()
3663
3800
  }),
3664
- z16.object({
3665
- type: z16.literal("container_file_citation"),
3666
- container_id: z16.string(),
3667
- file_id: z16.string(),
3668
- filename: z16.string(),
3669
- start_index: z16.number(),
3670
- end_index: z16.number()
3801
+ z17.object({
3802
+ type: z17.literal("container_file_citation"),
3803
+ container_id: z17.string(),
3804
+ file_id: z17.string(),
3805
+ filename: z17.string(),
3806
+ start_index: z17.number(),
3807
+ end_index: z17.number()
3671
3808
  }),
3672
- z16.object({
3673
- type: z16.literal("file_path"),
3674
- file_id: z16.string(),
3675
- index: z16.number()
3809
+ z17.object({
3810
+ type: z17.literal("file_path"),
3811
+ file_id: z17.string(),
3812
+ index: z17.number()
3676
3813
  })
3677
3814
  ])
3678
3815
  )
3679
3816
  })
3680
3817
  )
3681
3818
  }),
3682
- z16.object({
3683
- type: z16.literal("web_search_call"),
3684
- id: z16.string(),
3685
- status: z16.string(),
3686
- action: z16.discriminatedUnion("type", [
3687
- z16.object({
3688
- type: z16.literal("search"),
3689
- query: z16.string().nullish(),
3690
- sources: z16.array(
3691
- z16.discriminatedUnion("type", [
3692
- z16.object({ type: z16.literal("url"), url: z16.string() }),
3693
- z16.object({
3694
- type: z16.literal("api"),
3695
- name: z16.string()
3819
+ z17.object({
3820
+ type: z17.literal("web_search_call"),
3821
+ id: z17.string(),
3822
+ status: z17.string(),
3823
+ action: z17.discriminatedUnion("type", [
3824
+ z17.object({
3825
+ type: z17.literal("search"),
3826
+ query: z17.string().nullish(),
3827
+ sources: z17.array(
3828
+ z17.discriminatedUnion("type", [
3829
+ z17.object({ type: z17.literal("url"), url: z17.string() }),
3830
+ z17.object({
3831
+ type: z17.literal("api"),
3832
+ name: z17.string()
3696
3833
  })
3697
3834
  ])
3698
3835
  ).nullish()
3699
3836
  }),
3700
- z16.object({
3701
- type: z16.literal("open_page"),
3702
- url: z16.string().nullish()
3837
+ z17.object({
3838
+ type: z17.literal("open_page"),
3839
+ url: z17.string().nullish()
3703
3840
  }),
3704
- z16.object({
3705
- type: z16.literal("find_in_page"),
3706
- url: z16.string().nullish(),
3707
- pattern: z16.string().nullish()
3841
+ z17.object({
3842
+ type: z17.literal("find_in_page"),
3843
+ url: z17.string().nullish(),
3844
+ pattern: z17.string().nullish()
3708
3845
  })
3709
3846
  ]).nullish()
3710
3847
  }),
3711
- z16.object({
3712
- type: z16.literal("file_search_call"),
3713
- id: z16.string(),
3714
- queries: z16.array(z16.string()),
3715
- results: z16.array(
3716
- z16.object({
3717
- attributes: z16.record(
3718
- z16.string(),
3719
- z16.union([z16.string(), z16.number(), z16.boolean()])
3848
+ z17.object({
3849
+ type: z17.literal("file_search_call"),
3850
+ id: z17.string(),
3851
+ queries: z17.array(z17.string()),
3852
+ results: z17.array(
3853
+ z17.object({
3854
+ attributes: z17.record(
3855
+ z17.string(),
3856
+ z17.union([z17.string(), z17.number(), z17.boolean()])
3720
3857
  ),
3721
- file_id: z16.string(),
3722
- filename: z16.string(),
3723
- score: z16.number(),
3724
- text: z16.string()
3858
+ file_id: z17.string(),
3859
+ filename: z17.string(),
3860
+ score: z17.number(),
3861
+ text: z17.string()
3725
3862
  })
3726
3863
  ).nullish()
3727
3864
  }),
3728
- z16.object({
3729
- type: z16.literal("code_interpreter_call"),
3730
- id: z16.string(),
3731
- code: z16.string().nullable(),
3732
- container_id: z16.string(),
3733
- outputs: z16.array(
3734
- z16.discriminatedUnion("type", [
3735
- z16.object({ type: z16.literal("logs"), logs: z16.string() }),
3736
- z16.object({ type: z16.literal("image"), url: z16.string() })
3865
+ z17.object({
3866
+ type: z17.literal("code_interpreter_call"),
3867
+ id: z17.string(),
3868
+ code: z17.string().nullable(),
3869
+ container_id: z17.string(),
3870
+ outputs: z17.array(
3871
+ z17.discriminatedUnion("type", [
3872
+ z17.object({ type: z17.literal("logs"), logs: z17.string() }),
3873
+ z17.object({ type: z17.literal("image"), url: z17.string() })
3737
3874
  ])
3738
3875
  ).nullable()
3739
3876
  }),
3740
- z16.object({
3741
- type: z16.literal("image_generation_call"),
3742
- id: z16.string(),
3743
- result: z16.string()
3877
+ z17.object({
3878
+ type: z17.literal("image_generation_call"),
3879
+ id: z17.string(),
3880
+ result: z17.string()
3744
3881
  }),
3745
- z16.object({
3746
- type: z16.literal("local_shell_call"),
3747
- id: z16.string(),
3748
- call_id: z16.string(),
3749
- action: z16.object({
3750
- type: z16.literal("exec"),
3751
- command: z16.array(z16.string()),
3752
- timeout_ms: z16.number().optional(),
3753
- user: z16.string().optional(),
3754
- working_directory: z16.string().optional(),
3755
- env: z16.record(z16.string(), z16.string()).optional()
3882
+ z17.object({
3883
+ type: z17.literal("local_shell_call"),
3884
+ id: z17.string(),
3885
+ call_id: z17.string(),
3886
+ action: z17.object({
3887
+ type: z17.literal("exec"),
3888
+ command: z17.array(z17.string()),
3889
+ timeout_ms: z17.number().optional(),
3890
+ user: z17.string().optional(),
3891
+ working_directory: z17.string().optional(),
3892
+ env: z17.record(z17.string(), z17.string()).optional()
3756
3893
  })
3757
3894
  }),
3758
- z16.object({
3759
- type: z16.literal("function_call"),
3760
- call_id: z16.string(),
3761
- name: z16.string(),
3762
- arguments: z16.string(),
3763
- id: z16.string()
3895
+ z17.object({
3896
+ type: z17.literal("function_call"),
3897
+ call_id: z17.string(),
3898
+ name: z17.string(),
3899
+ arguments: z17.string(),
3900
+ id: z17.string()
3764
3901
  }),
3765
- z16.object({
3766
- type: z16.literal("custom_tool_call"),
3767
- call_id: z16.string(),
3768
- name: z16.string(),
3769
- input: z16.string(),
3770
- id: z16.string()
3902
+ z17.object({
3903
+ type: z17.literal("custom_tool_call"),
3904
+ call_id: z17.string(),
3905
+ name: z17.string(),
3906
+ input: z17.string(),
3907
+ id: z17.string()
3771
3908
  }),
3772
- z16.object({
3773
- type: z16.literal("computer_call"),
3774
- id: z16.string(),
3775
- status: z16.string().optional()
3909
+ z17.object({
3910
+ type: z17.literal("computer_call"),
3911
+ id: z17.string(),
3912
+ status: z17.string().optional()
3776
3913
  }),
3777
- z16.object({
3778
- type: z16.literal("reasoning"),
3779
- id: z16.string(),
3780
- encrypted_content: z16.string().nullish(),
3781
- summary: z16.array(
3782
- z16.object({
3783
- type: z16.literal("summary_text"),
3784
- text: z16.string()
3914
+ z17.object({
3915
+ type: z17.literal("reasoning"),
3916
+ id: z17.string(),
3917
+ encrypted_content: z17.string().nullish(),
3918
+ summary: z17.array(
3919
+ z17.object({
3920
+ type: z17.literal("summary_text"),
3921
+ text: z17.string()
3785
3922
  })
3786
3923
  )
3787
3924
  }),
3788
- z16.object({
3789
- type: z16.literal("mcp_call"),
3790
- id: z16.string(),
3791
- status: z16.string(),
3792
- arguments: z16.string(),
3793
- name: z16.string(),
3794
- server_label: z16.string(),
3795
- output: z16.string().nullish(),
3796
- error: z16.union([
3797
- z16.string(),
3798
- z16.object({
3799
- type: z16.string().optional(),
3800
- code: z16.union([z16.number(), z16.string()]).optional(),
3801
- message: z16.string().optional()
3925
+ z17.object({
3926
+ type: z17.literal("mcp_call"),
3927
+ id: z17.string(),
3928
+ status: z17.string(),
3929
+ arguments: z17.string(),
3930
+ name: z17.string(),
3931
+ server_label: z17.string(),
3932
+ output: z17.string().nullish(),
3933
+ error: z17.union([
3934
+ z17.string(),
3935
+ z17.object({
3936
+ type: z17.string().optional(),
3937
+ code: z17.union([z17.number(), z17.string()]).optional(),
3938
+ message: z17.string().optional()
3802
3939
  }).loose()
3803
3940
  ]).nullish(),
3804
- approval_request_id: z16.string().nullish()
3941
+ approval_request_id: z17.string().nullish()
3805
3942
  }),
3806
- z16.object({
3807
- type: z16.literal("mcp_list_tools"),
3808
- id: z16.string(),
3809
- server_label: z16.string(),
3810
- tools: z16.array(
3811
- z16.object({
3812
- name: z16.string(),
3813
- description: z16.string().optional(),
3814
- input_schema: z16.any(),
3815
- annotations: z16.record(z16.string(), z16.unknown()).optional()
3943
+ z17.object({
3944
+ type: z17.literal("mcp_list_tools"),
3945
+ id: z17.string(),
3946
+ server_label: z17.string(),
3947
+ tools: z17.array(
3948
+ z17.object({
3949
+ name: z17.string(),
3950
+ description: z17.string().optional(),
3951
+ input_schema: z17.any(),
3952
+ annotations: z17.record(z17.string(), z17.unknown()).optional()
3816
3953
  })
3817
3954
  ),
3818
- error: z16.union([
3819
- z16.string(),
3820
- z16.object({
3821
- type: z16.string().optional(),
3822
- code: z16.union([z16.number(), z16.string()]).optional(),
3823
- message: z16.string().optional()
3955
+ error: z17.union([
3956
+ z17.string(),
3957
+ z17.object({
3958
+ type: z17.string().optional(),
3959
+ code: z17.union([z17.number(), z17.string()]).optional(),
3960
+ message: z17.string().optional()
3824
3961
  }).loose()
3825
3962
  ]).optional()
3826
3963
  }),
3827
- z16.object({
3828
- type: z16.literal("mcp_approval_request"),
3829
- id: z16.string(),
3830
- server_label: z16.string(),
3831
- name: z16.string(),
3832
- arguments: z16.string(),
3833
- approval_request_id: z16.string().optional()
3964
+ z17.object({
3965
+ type: z17.literal("mcp_approval_request"),
3966
+ id: z17.string(),
3967
+ server_label: z17.string(),
3968
+ name: z17.string(),
3969
+ arguments: z17.string(),
3970
+ approval_request_id: z17.string().optional()
3834
3971
  }),
3835
- z16.object({
3836
- type: z16.literal("apply_patch_call"),
3837
- id: z16.string(),
3838
- call_id: z16.string(),
3839
- status: z16.enum(["in_progress", "completed"]),
3840
- operation: z16.discriminatedUnion("type", [
3841
- z16.object({
3842
- type: z16.literal("create_file"),
3843
- path: z16.string(),
3844
- diff: z16.string()
3972
+ z17.object({
3973
+ type: z17.literal("apply_patch_call"),
3974
+ id: z17.string(),
3975
+ call_id: z17.string(),
3976
+ status: z17.enum(["in_progress", "completed"]),
3977
+ operation: z17.discriminatedUnion("type", [
3978
+ z17.object({
3979
+ type: z17.literal("create_file"),
3980
+ path: z17.string(),
3981
+ diff: z17.string()
3845
3982
  }),
3846
- z16.object({
3847
- type: z16.literal("delete_file"),
3848
- path: z16.string()
3983
+ z17.object({
3984
+ type: z17.literal("delete_file"),
3985
+ path: z17.string()
3849
3986
  }),
3850
- z16.object({
3851
- type: z16.literal("update_file"),
3852
- path: z16.string(),
3853
- diff: z16.string()
3987
+ z17.object({
3988
+ type: z17.literal("update_file"),
3989
+ path: z17.string(),
3990
+ diff: z17.string()
3854
3991
  })
3855
3992
  ])
3856
3993
  }),
3857
- z16.object({
3858
- type: z16.literal("shell_call"),
3859
- id: z16.string(),
3860
- call_id: z16.string(),
3861
- status: z16.enum(["in_progress", "completed", "incomplete"]),
3862
- action: z16.object({
3863
- commands: z16.array(z16.string())
3994
+ z17.object({
3995
+ type: z17.literal("shell_call"),
3996
+ id: z17.string(),
3997
+ call_id: z17.string(),
3998
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
3999
+ action: z17.object({
4000
+ commands: z17.array(z17.string())
3864
4001
  })
3865
4002
  }),
3866
- z16.object({
3867
- type: z16.literal("shell_call_output"),
3868
- id: z16.string(),
3869
- call_id: z16.string(),
3870
- status: z16.enum(["in_progress", "completed", "incomplete"]),
3871
- output: z16.array(
3872
- z16.object({
3873
- stdout: z16.string(),
3874
- stderr: z16.string(),
3875
- outcome: z16.discriminatedUnion("type", [
3876
- z16.object({ type: z16.literal("timeout") }),
3877
- z16.object({
3878
- type: z16.literal("exit"),
3879
- exit_code: z16.number()
4003
+ z17.object({
4004
+ type: z17.literal("shell_call_output"),
4005
+ id: z17.string(),
4006
+ call_id: z17.string(),
4007
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
4008
+ output: z17.array(
4009
+ z17.object({
4010
+ stdout: z17.string(),
4011
+ stderr: z17.string(),
4012
+ outcome: z17.discriminatedUnion("type", [
4013
+ z17.object({ type: z17.literal("timeout") }),
4014
+ z17.object({
4015
+ type: z17.literal("exit"),
4016
+ exit_code: z17.number()
3880
4017
  })
3881
4018
  ])
3882
4019
  })
3883
4020
  )
4021
+ }),
4022
+ z17.object({
4023
+ type: z17.literal("tool_search_call"),
4024
+ id: z17.string(),
4025
+ execution: z17.enum(["server", "client"]),
4026
+ call_id: z17.string().nullable(),
4027
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
4028
+ arguments: z17.unknown()
4029
+ }),
4030
+ z17.object({
4031
+ type: z17.literal("tool_search_output"),
4032
+ id: z17.string(),
4033
+ execution: z17.enum(["server", "client"]),
4034
+ call_id: z17.string().nullable(),
4035
+ status: z17.enum(["in_progress", "completed", "incomplete"]),
4036
+ tools: z17.array(z17.record(z17.string(), jsonValueSchema.optional()))
3884
4037
  })
3885
4038
  ])
3886
4039
  ).optional(),
3887
- service_tier: z16.string().nullish(),
3888
- incomplete_details: z16.object({ reason: z16.string() }).nullish(),
3889
- usage: z16.object({
3890
- input_tokens: z16.number(),
3891
- input_tokens_details: z16.object({ cached_tokens: z16.number().nullish() }).nullish(),
3892
- output_tokens: z16.number(),
3893
- output_tokens_details: z16.object({ reasoning_tokens: z16.number().nullish() }).nullish()
4040
+ service_tier: z17.string().nullish(),
4041
+ incomplete_details: z17.object({ reason: z17.string() }).nullish(),
4042
+ usage: z17.object({
4043
+ input_tokens: z17.number(),
4044
+ input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
4045
+ output_tokens: z17.number(),
4046
+ output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
3894
4047
  }).optional()
3895
4048
  })
3896
4049
  )
3897
4050
  );
3898
4051
 
3899
4052
  // src/responses/openai-responses-options.ts
3900
- import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
3901
- import { z as z17 } from "zod/v4";
4053
+ import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
4054
+ import { z as z18 } from "zod/v4";
3902
4055
  var TOP_LOGPROBS_MAX = 20;
3903
4056
  var openaiResponsesReasoningModelIds = [
3904
4057
  "o1",
@@ -3927,11 +4080,12 @@ var openaiResponsesReasoningModelIds = [
3927
4080
  "gpt-5.2-chat-latest",
3928
4081
  "gpt-5.2-pro",
3929
4082
  "gpt-5.2-codex",
4083
+ "gpt-5.3-chat-latest",
4084
+ "gpt-5.3-codex",
3930
4085
  "gpt-5.4",
3931
4086
  "gpt-5.4-2026-03-05",
3932
4087
  "gpt-5.4-pro",
3933
- "gpt-5.4-pro-2026-03-05",
3934
- "gpt-5.3-codex"
4088
+ "gpt-5.4-pro-2026-03-05"
3935
4089
  ];
3936
4090
  var openaiResponsesModelIds = [
3937
4091
  "gpt-4.1",
@@ -3958,9 +4112,9 @@ var openaiResponsesModelIds = [
3958
4112
  "gpt-5-chat-latest",
3959
4113
  ...openaiResponsesReasoningModelIds
3960
4114
  ];
3961
- var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
3962
- () => zodSchema15(
3963
- z17.object({
4115
+ var openaiLanguageModelResponsesOptionsSchema = lazySchema16(
4116
+ () => zodSchema16(
4117
+ z18.object({
3964
4118
  /**
3965
4119
  * The ID of the OpenAI Conversation to continue.
3966
4120
  * You must create a conversation first via the OpenAI API.
@@ -3968,13 +4122,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
3968
4122
  * Defaults to `undefined`.
3969
4123
  * @see https://platform.openai.com/docs/api-reference/conversations/create
3970
4124
  */
3971
- conversation: z17.string().nullish(),
4125
+ conversation: z18.string().nullish(),
3972
4126
  /**
3973
4127
  * The set of extra fields to include in the response (advanced, usually not needed).
3974
4128
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
3975
4129
  */
3976
- include: z17.array(
3977
- z17.enum([
4130
+ include: z18.array(
4131
+ z18.enum([
3978
4132
  "reasoning.encrypted_content",
3979
4133
  // handled internally by default, only needed for unknown reasoning models
3980
4134
  "file_search_call.results",
@@ -3986,7 +4140,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
3986
4140
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
3987
4141
  * Defaults to `undefined`.
3988
4142
  */
3989
- instructions: z17.string().nullish(),
4143
+ instructions: z18.string().nullish(),
3990
4144
  /**
3991
4145
  * Return the log probabilities of the tokens. Including logprobs will increase
3992
4146
  * the response size and can slow down response times. However, it can
@@ -4001,30 +4155,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
4001
4155
  * @see https://platform.openai.com/docs/api-reference/responses/create
4002
4156
  * @see https://cookbook.openai.com/examples/using_logprobs
4003
4157
  */
4004
- logprobs: z17.union([z17.boolean(), z17.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4158
+ logprobs: z18.union([z18.boolean(), z18.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4005
4159
  /**
4006
4160
  * The maximum number of total calls to built-in tools that can be processed in a response.
4007
4161
  * This maximum number applies across all built-in tool calls, not per individual tool.
4008
4162
  * Any further attempts to call a tool by the model will be ignored.
4009
4163
  */
4010
- maxToolCalls: z17.number().nullish(),
4164
+ maxToolCalls: z18.number().nullish(),
4011
4165
  /**
4012
4166
  * Additional metadata to store with the generation.
4013
4167
  */
4014
- metadata: z17.any().nullish(),
4168
+ metadata: z18.any().nullish(),
4015
4169
  /**
4016
4170
  * Whether to use parallel tool calls. Defaults to `true`.
4017
4171
  */
4018
- parallelToolCalls: z17.boolean().nullish(),
4172
+ parallelToolCalls: z18.boolean().nullish(),
4019
4173
  /**
4020
4174
  * The ID of the previous response. You can use it to continue a conversation.
4021
4175
  * Defaults to `undefined`.
4022
4176
  */
4023
- previousResponseId: z17.string().nullish(),
4177
+ previousResponseId: z18.string().nullish(),
4024
4178
  /**
4025
4179
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
4026
4180
  */
4027
- promptCacheKey: z17.string().nullish(),
4181
+ promptCacheKey: z18.string().nullish(),
4028
4182
  /**
4029
4183
  * The retention policy for the prompt cache.
4030
4184
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -4033,7 +4187,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
4033
4187
  *
4034
4188
  * @default 'in_memory'
4035
4189
  */
4036
- promptCacheRetention: z17.enum(["in_memory", "24h"]).nullish(),
4190
+ promptCacheRetention: z18.enum(["in_memory", "24h"]).nullish(),
4037
4191
  /**
4038
4192
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
4039
4193
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -4044,17 +4198,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
4044
4198
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
4045
4199
  * an error.
4046
4200
  */
4047
- reasoningEffort: z17.string().nullish(),
4201
+ reasoningEffort: z18.string().nullish(),
4048
4202
  /**
4049
4203
  * Controls reasoning summary output from the model.
4050
4204
  * Set to "auto" to automatically receive the richest level available,
4051
4205
  * or "detailed" for comprehensive summaries.
4052
4206
  */
4053
- reasoningSummary: z17.string().nullish(),
4207
+ reasoningSummary: z18.string().nullish(),
4054
4208
  /**
4055
4209
  * The identifier for safety monitoring and tracking.
4056
4210
  */
4057
- safetyIdentifier: z17.string().nullish(),
4211
+ safetyIdentifier: z18.string().nullish(),
4058
4212
  /**
4059
4213
  * Service tier for the request.
4060
4214
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -4062,34 +4216,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
4062
4216
  *
4063
4217
  * Defaults to 'auto'.
4064
4218
  */
4065
- serviceTier: z17.enum(["auto", "flex", "priority", "default"]).nullish(),
4219
+ serviceTier: z18.enum(["auto", "flex", "priority", "default"]).nullish(),
4066
4220
  /**
4067
4221
  * Whether to store the generation. Defaults to `true`.
4068
4222
  */
4069
- store: z17.boolean().nullish(),
4223
+ store: z18.boolean().nullish(),
4070
4224
  /**
4071
4225
  * Whether to use strict JSON schema validation.
4072
4226
  * Defaults to `true`.
4073
4227
  */
4074
- strictJsonSchema: z17.boolean().nullish(),
4228
+ strictJsonSchema: z18.boolean().nullish(),
4075
4229
  /**
4076
4230
  * Controls the verbosity of the model's responses. Lower values ('low') will result
4077
4231
  * in more concise responses, while higher values ('high') will result in more verbose responses.
4078
4232
  * Valid values: 'low', 'medium', 'high'.
4079
4233
  */
4080
- textVerbosity: z17.enum(["low", "medium", "high"]).nullish(),
4234
+ textVerbosity: z18.enum(["low", "medium", "high"]).nullish(),
4081
4235
  /**
4082
4236
  * Controls output truncation. 'auto' (default) performs truncation automatically;
4083
4237
  * 'disabled' turns truncation off.
4084
4238
  */
4085
- truncation: z17.enum(["auto", "disabled"]).nullish(),
4239
+ truncation: z18.enum(["auto", "disabled"]).nullish(),
4086
4240
  /**
4087
4241
  * A unique identifier representing your end-user, which can help OpenAI to
4088
4242
  * monitor and detect abuse.
4089
4243
  * Defaults to `undefined`.
4090
4244
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
4091
4245
  */
4092
- user: z17.string().nullish(),
4246
+ user: z18.string().nullish(),
4093
4247
  /**
4094
4248
  * Override the system message mode for this model.
4095
4249
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -4098,7 +4252,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
4098
4252
  *
4099
4253
  * If not specified, the mode is automatically determined based on the model.
4100
4254
  */
4101
- systemMessageMode: z17.enum(["system", "developer", "remove"]).optional(),
4255
+ systemMessageMode: z18.enum(["system", "developer", "remove"]).optional(),
4102
4256
  /**
4103
4257
  * Force treating this model as a reasoning model.
4104
4258
  *
@@ -4108,7 +4262,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema15(
4108
4262
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
4109
4263
  * and defaults `systemMessageMode` to `developer` unless overridden.
4110
4264
  */
4111
- forceReasoning: z17.boolean().optional()
4265
+ forceReasoning: z18.boolean().optional()
4112
4266
  })
4113
4267
  )
4114
4268
  );
@@ -4121,44 +4275,44 @@ import { validateTypes as validateTypes2 } from "@ai-sdk/provider-utils";
4121
4275
 
4122
4276
  // src/tool/code-interpreter.ts
4123
4277
  import {
4124
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
4125
- lazySchema as lazySchema16,
4126
- zodSchema as zodSchema16
4278
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
4279
+ lazySchema as lazySchema17,
4280
+ zodSchema as zodSchema17
4127
4281
  } from "@ai-sdk/provider-utils";
4128
- import { z as z18 } from "zod/v4";
4129
- var codeInterpreterInputSchema = lazySchema16(
4130
- () => zodSchema16(
4131
- z18.object({
4132
- code: z18.string().nullish(),
4133
- containerId: z18.string()
4282
+ import { z as z19 } from "zod/v4";
4283
+ var codeInterpreterInputSchema = lazySchema17(
4284
+ () => zodSchema17(
4285
+ z19.object({
4286
+ code: z19.string().nullish(),
4287
+ containerId: z19.string()
4134
4288
  })
4135
4289
  )
4136
4290
  );
4137
- var codeInterpreterOutputSchema = lazySchema16(
4138
- () => zodSchema16(
4139
- z18.object({
4140
- outputs: z18.array(
4141
- z18.discriminatedUnion("type", [
4142
- z18.object({ type: z18.literal("logs"), logs: z18.string() }),
4143
- z18.object({ type: z18.literal("image"), url: z18.string() })
4291
+ var codeInterpreterOutputSchema = lazySchema17(
4292
+ () => zodSchema17(
4293
+ z19.object({
4294
+ outputs: z19.array(
4295
+ z19.discriminatedUnion("type", [
4296
+ z19.object({ type: z19.literal("logs"), logs: z19.string() }),
4297
+ z19.object({ type: z19.literal("image"), url: z19.string() })
4144
4298
  ])
4145
4299
  ).nullish()
4146
4300
  })
4147
4301
  )
4148
4302
  );
4149
- var codeInterpreterArgsSchema = lazySchema16(
4150
- () => zodSchema16(
4151
- z18.object({
4152
- container: z18.union([
4153
- z18.string(),
4154
- z18.object({
4155
- fileIds: z18.array(z18.string()).optional()
4303
+ var codeInterpreterArgsSchema = lazySchema17(
4304
+ () => zodSchema17(
4305
+ z19.object({
4306
+ container: z19.union([
4307
+ z19.string(),
4308
+ z19.object({
4309
+ fileIds: z19.array(z19.string()).optional()
4156
4310
  })
4157
4311
  ]).optional()
4158
4312
  })
4159
4313
  )
4160
4314
  );
4161
- var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema4({
4315
+ var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema5({
4162
4316
  id: "openai.code_interpreter",
4163
4317
  inputSchema: codeInterpreterInputSchema,
4164
4318
  outputSchema: codeInterpreterOutputSchema
@@ -4169,88 +4323,88 @@ var codeInterpreter = (args = {}) => {
4169
4323
 
4170
4324
  // src/tool/file-search.ts
4171
4325
  import {
4172
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
4173
- lazySchema as lazySchema17,
4174
- zodSchema as zodSchema17
4326
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
4327
+ lazySchema as lazySchema18,
4328
+ zodSchema as zodSchema18
4175
4329
  } from "@ai-sdk/provider-utils";
4176
- import { z as z19 } from "zod/v4";
4177
- var comparisonFilterSchema = z19.object({
4178
- key: z19.string(),
4179
- type: z19.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
4180
- value: z19.union([z19.string(), z19.number(), z19.boolean(), z19.array(z19.string())])
4330
+ import { z as z20 } from "zod/v4";
4331
+ var comparisonFilterSchema = z20.object({
4332
+ key: z20.string(),
4333
+ type: z20.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
4334
+ value: z20.union([z20.string(), z20.number(), z20.boolean(), z20.array(z20.string())])
4181
4335
  });
4182
- var compoundFilterSchema = z19.object({
4183
- type: z19.enum(["and", "or"]),
4184
- filters: z19.array(
4185
- z19.union([comparisonFilterSchema, z19.lazy(() => compoundFilterSchema)])
4336
+ var compoundFilterSchema = z20.object({
4337
+ type: z20.enum(["and", "or"]),
4338
+ filters: z20.array(
4339
+ z20.union([comparisonFilterSchema, z20.lazy(() => compoundFilterSchema)])
4186
4340
  )
4187
4341
  });
4188
- var fileSearchArgsSchema = lazySchema17(
4189
- () => zodSchema17(
4190
- z19.object({
4191
- vectorStoreIds: z19.array(z19.string()),
4192
- maxNumResults: z19.number().optional(),
4193
- ranking: z19.object({
4194
- ranker: z19.string().optional(),
4195
- scoreThreshold: z19.number().optional()
4342
+ var fileSearchArgsSchema = lazySchema18(
4343
+ () => zodSchema18(
4344
+ z20.object({
4345
+ vectorStoreIds: z20.array(z20.string()),
4346
+ maxNumResults: z20.number().optional(),
4347
+ ranking: z20.object({
4348
+ ranker: z20.string().optional(),
4349
+ scoreThreshold: z20.number().optional()
4196
4350
  }).optional(),
4197
- filters: z19.union([comparisonFilterSchema, compoundFilterSchema]).optional()
4351
+ filters: z20.union([comparisonFilterSchema, compoundFilterSchema]).optional()
4198
4352
  })
4199
4353
  )
4200
4354
  );
4201
- var fileSearchOutputSchema = lazySchema17(
4202
- () => zodSchema17(
4203
- z19.object({
4204
- queries: z19.array(z19.string()),
4205
- results: z19.array(
4206
- z19.object({
4207
- attributes: z19.record(z19.string(), z19.unknown()),
4208
- fileId: z19.string(),
4209
- filename: z19.string(),
4210
- score: z19.number(),
4211
- text: z19.string()
4355
+ var fileSearchOutputSchema = lazySchema18(
4356
+ () => zodSchema18(
4357
+ z20.object({
4358
+ queries: z20.array(z20.string()),
4359
+ results: z20.array(
4360
+ z20.object({
4361
+ attributes: z20.record(z20.string(), z20.unknown()),
4362
+ fileId: z20.string(),
4363
+ filename: z20.string(),
4364
+ score: z20.number(),
4365
+ text: z20.string()
4212
4366
  })
4213
4367
  ).nullable()
4214
4368
  })
4215
4369
  )
4216
4370
  );
4217
- var fileSearch = createProviderToolFactoryWithOutputSchema5({
4371
+ var fileSearch = createProviderToolFactoryWithOutputSchema6({
4218
4372
  id: "openai.file_search",
4219
- inputSchema: z19.object({}),
4373
+ inputSchema: z20.object({}),
4220
4374
  outputSchema: fileSearchOutputSchema
4221
4375
  });
4222
4376
 
4223
4377
  // src/tool/image-generation.ts
4224
4378
  import {
4225
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
4226
- lazySchema as lazySchema18,
4227
- zodSchema as zodSchema18
4379
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
4380
+ lazySchema as lazySchema19,
4381
+ zodSchema as zodSchema19
4228
4382
  } from "@ai-sdk/provider-utils";
4229
- import { z as z20 } from "zod/v4";
4230
- var imageGenerationArgsSchema = lazySchema18(
4231
- () => zodSchema18(
4232
- z20.object({
4233
- background: z20.enum(["auto", "opaque", "transparent"]).optional(),
4234
- inputFidelity: z20.enum(["low", "high"]).optional(),
4235
- inputImageMask: z20.object({
4236
- fileId: z20.string().optional(),
4237
- imageUrl: z20.string().optional()
4383
+ import { z as z21 } from "zod/v4";
4384
+ var imageGenerationArgsSchema = lazySchema19(
4385
+ () => zodSchema19(
4386
+ z21.object({
4387
+ background: z21.enum(["auto", "opaque", "transparent"]).optional(),
4388
+ inputFidelity: z21.enum(["low", "high"]).optional(),
4389
+ inputImageMask: z21.object({
4390
+ fileId: z21.string().optional(),
4391
+ imageUrl: z21.string().optional()
4238
4392
  }).optional(),
4239
- model: z20.string().optional(),
4240
- moderation: z20.enum(["auto"]).optional(),
4241
- outputCompression: z20.number().int().min(0).max(100).optional(),
4242
- outputFormat: z20.enum(["png", "jpeg", "webp"]).optional(),
4243
- partialImages: z20.number().int().min(0).max(3).optional(),
4244
- quality: z20.enum(["auto", "low", "medium", "high"]).optional(),
4245
- size: z20.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
4393
+ model: z21.string().optional(),
4394
+ moderation: z21.enum(["auto"]).optional(),
4395
+ outputCompression: z21.number().int().min(0).max(100).optional(),
4396
+ outputFormat: z21.enum(["png", "jpeg", "webp"]).optional(),
4397
+ partialImages: z21.number().int().min(0).max(3).optional(),
4398
+ quality: z21.enum(["auto", "low", "medium", "high"]).optional(),
4399
+ size: z21.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
4246
4400
  }).strict()
4247
4401
  )
4248
4402
  );
4249
- var imageGenerationInputSchema = lazySchema18(() => zodSchema18(z20.object({})));
4250
- var imageGenerationOutputSchema = lazySchema18(
4251
- () => zodSchema18(z20.object({ result: z20.string() }))
4403
+ var imageGenerationInputSchema = lazySchema19(() => zodSchema19(z21.object({})));
4404
+ var imageGenerationOutputSchema = lazySchema19(
4405
+ () => zodSchema19(z21.object({ result: z21.string() }))
4252
4406
  );
4253
- var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema6({
4407
+ var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema7({
4254
4408
  id: "openai.image_generation",
4255
4409
  inputSchema: imageGenerationInputSchema,
4256
4410
  outputSchema: imageGenerationOutputSchema
@@ -4262,29 +4416,29 @@ var imageGeneration = (args = {}) => {
4262
4416
  // src/tool/custom.ts
4263
4417
  import {
4264
4418
  createProviderToolFactory,
4265
- lazySchema as lazySchema19,
4266
- zodSchema as zodSchema19
4419
+ lazySchema as lazySchema20,
4420
+ zodSchema as zodSchema20
4267
4421
  } from "@ai-sdk/provider-utils";
4268
- import { z as z21 } from "zod/v4";
4269
- var customArgsSchema = lazySchema19(
4270
- () => zodSchema19(
4271
- z21.object({
4272
- name: z21.string(),
4273
- description: z21.string().optional(),
4274
- format: z21.union([
4275
- z21.object({
4276
- type: z21.literal("grammar"),
4277
- syntax: z21.enum(["regex", "lark"]),
4278
- definition: z21.string()
4422
+ import { z as z22 } from "zod/v4";
4423
+ var customArgsSchema = lazySchema20(
4424
+ () => zodSchema20(
4425
+ z22.object({
4426
+ name: z22.string(),
4427
+ description: z22.string().optional(),
4428
+ format: z22.union([
4429
+ z22.object({
4430
+ type: z22.literal("grammar"),
4431
+ syntax: z22.enum(["regex", "lark"]),
4432
+ definition: z22.string()
4279
4433
  }),
4280
- z21.object({
4281
- type: z21.literal("text")
4434
+ z22.object({
4435
+ type: z22.literal("text")
4282
4436
  })
4283
4437
  ]).optional()
4284
4438
  })
4285
4439
  )
4286
4440
  );
4287
- var customInputSchema = lazySchema19(() => zodSchema19(z21.string()));
4441
+ var customInputSchema = lazySchema20(() => zodSchema20(z22.string()));
4288
4442
  var customToolFactory = createProviderToolFactory({
4289
4443
  id: "openai.custom",
4290
4444
  inputSchema: customInputSchema
@@ -4292,137 +4446,82 @@ var customToolFactory = createProviderToolFactory({
4292
4446
 
4293
4447
  // src/tool/mcp.ts
4294
4448
  import {
4295
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
4296
- lazySchema as lazySchema20,
4297
- zodSchema as zodSchema20
4449
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
4450
+ lazySchema as lazySchema21,
4451
+ zodSchema as zodSchema21
4298
4452
  } from "@ai-sdk/provider-utils";
4299
- import { z as z22 } from "zod/v4";
4300
- var jsonValueSchema = z22.lazy(
4301
- () => z22.union([
4302
- z22.string(),
4303
- z22.number(),
4304
- z22.boolean(),
4305
- z22.null(),
4306
- z22.array(jsonValueSchema),
4307
- z22.record(z22.string(), jsonValueSchema)
4453
+ import { z as z23 } from "zod/v4";
4454
+ var jsonValueSchema2 = z23.lazy(
4455
+ () => z23.union([
4456
+ z23.string(),
4457
+ z23.number(),
4458
+ z23.boolean(),
4459
+ z23.null(),
4460
+ z23.array(jsonValueSchema2),
4461
+ z23.record(z23.string(), jsonValueSchema2)
4308
4462
  ])
4309
4463
  );
4310
- var mcpArgsSchema = lazySchema20(
4311
- () => zodSchema20(
4312
- z22.object({
4313
- serverLabel: z22.string(),
4314
- allowedTools: z22.union([
4315
- z22.array(z22.string()),
4316
- z22.object({
4317
- readOnly: z22.boolean().optional(),
4318
- toolNames: z22.array(z22.string()).optional()
4464
+ var mcpArgsSchema = lazySchema21(
4465
+ () => zodSchema21(
4466
+ z23.object({
4467
+ serverLabel: z23.string(),
4468
+ allowedTools: z23.union([
4469
+ z23.array(z23.string()),
4470
+ z23.object({
4471
+ readOnly: z23.boolean().optional(),
4472
+ toolNames: z23.array(z23.string()).optional()
4319
4473
  })
4320
4474
  ]).optional(),
4321
- authorization: z22.string().optional(),
4322
- connectorId: z22.string().optional(),
4323
- headers: z22.record(z22.string(), z22.string()).optional(),
4324
- requireApproval: z22.union([
4325
- z22.enum(["always", "never"]),
4326
- z22.object({
4327
- never: z22.object({
4328
- toolNames: z22.array(z22.string()).optional()
4475
+ authorization: z23.string().optional(),
4476
+ connectorId: z23.string().optional(),
4477
+ headers: z23.record(z23.string(), z23.string()).optional(),
4478
+ requireApproval: z23.union([
4479
+ z23.enum(["always", "never"]),
4480
+ z23.object({
4481
+ never: z23.object({
4482
+ toolNames: z23.array(z23.string()).optional()
4329
4483
  }).optional()
4330
4484
  })
4331
4485
  ]).optional(),
4332
- serverDescription: z22.string().optional(),
4333
- serverUrl: z22.string().optional()
4486
+ serverDescription: z23.string().optional(),
4487
+ serverUrl: z23.string().optional()
4334
4488
  }).refine(
4335
4489
  (v) => v.serverUrl != null || v.connectorId != null,
4336
4490
  "One of serverUrl or connectorId must be provided."
4337
4491
  )
4338
4492
  )
4339
4493
  );
4340
- var mcpInputSchema = lazySchema20(() => zodSchema20(z22.object({})));
4341
- var mcpOutputSchema = lazySchema20(
4342
- () => zodSchema20(
4343
- z22.object({
4344
- type: z22.literal("call"),
4345
- serverLabel: z22.string(),
4346
- name: z22.string(),
4347
- arguments: z22.string(),
4348
- output: z22.string().nullish(),
4349
- error: z22.union([z22.string(), jsonValueSchema]).optional()
4494
+ var mcpInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
4495
+ var mcpOutputSchema = lazySchema21(
4496
+ () => zodSchema21(
4497
+ z23.object({
4498
+ type: z23.literal("call"),
4499
+ serverLabel: z23.string(),
4500
+ name: z23.string(),
4501
+ arguments: z23.string(),
4502
+ output: z23.string().nullish(),
4503
+ error: z23.union([z23.string(), jsonValueSchema2]).optional()
4350
4504
  })
4351
4505
  )
4352
4506
  );
4353
- var mcpToolFactory = createProviderToolFactoryWithOutputSchema7({
4507
+ var mcpToolFactory = createProviderToolFactoryWithOutputSchema8({
4354
4508
  id: "openai.mcp",
4355
4509
  inputSchema: mcpInputSchema,
4356
4510
  outputSchema: mcpOutputSchema
4357
4511
  });
4358
4512
 
4359
4513
  // src/tool/web-search.ts
4360
- import {
4361
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
4362
- lazySchema as lazySchema21,
4363
- zodSchema as zodSchema21
4364
- } from "@ai-sdk/provider-utils";
4365
- import { z as z23 } from "zod/v4";
4366
- var webSearchArgsSchema = lazySchema21(
4367
- () => zodSchema21(
4368
- z23.object({
4369
- externalWebAccess: z23.boolean().optional(),
4370
- filters: z23.object({ allowedDomains: z23.array(z23.string()).optional() }).optional(),
4371
- searchContextSize: z23.enum(["low", "medium", "high"]).optional(),
4372
- userLocation: z23.object({
4373
- type: z23.literal("approximate"),
4374
- country: z23.string().optional(),
4375
- city: z23.string().optional(),
4376
- region: z23.string().optional(),
4377
- timezone: z23.string().optional()
4378
- }).optional()
4379
- })
4380
- )
4381
- );
4382
- var webSearchInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
4383
- var webSearchOutputSchema = lazySchema21(
4384
- () => zodSchema21(
4385
- z23.object({
4386
- action: z23.discriminatedUnion("type", [
4387
- z23.object({
4388
- type: z23.literal("search"),
4389
- query: z23.string().optional()
4390
- }),
4391
- z23.object({
4392
- type: z23.literal("openPage"),
4393
- url: z23.string().nullish()
4394
- }),
4395
- z23.object({
4396
- type: z23.literal("findInPage"),
4397
- url: z23.string().nullish(),
4398
- pattern: z23.string().nullish()
4399
- })
4400
- ]).optional(),
4401
- sources: z23.array(
4402
- z23.discriminatedUnion("type", [
4403
- z23.object({ type: z23.literal("url"), url: z23.string() }),
4404
- z23.object({ type: z23.literal("api"), name: z23.string() })
4405
- ])
4406
- ).optional()
4407
- })
4408
- )
4409
- );
4410
- var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
4411
- id: "openai.web_search",
4412
- inputSchema: webSearchInputSchema,
4413
- outputSchema: webSearchOutputSchema
4414
- });
4415
-
4416
- // src/tool/web-search-preview.ts
4417
4514
  import {
4418
4515
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
4419
4516
  lazySchema as lazySchema22,
4420
4517
  zodSchema as zodSchema22
4421
4518
  } from "@ai-sdk/provider-utils";
4422
4519
  import { z as z24 } from "zod/v4";
4423
- var webSearchPreviewArgsSchema = lazySchema22(
4520
+ var webSearchArgsSchema = lazySchema22(
4424
4521
  () => zodSchema22(
4425
4522
  z24.object({
4523
+ externalWebAccess: z24.boolean().optional(),
4524
+ filters: z24.object({ allowedDomains: z24.array(z24.string()).optional() }).optional(),
4426
4525
  searchContextSize: z24.enum(["low", "medium", "high"]).optional(),
4427
4526
  userLocation: z24.object({
4428
4527
  type: z24.literal("approximate"),
@@ -4434,10 +4533,8 @@ var webSearchPreviewArgsSchema = lazySchema22(
4434
4533
  })
4435
4534
  )
4436
4535
  );
4437
- var webSearchPreviewInputSchema = lazySchema22(
4438
- () => zodSchema22(z24.object({}))
4439
- );
4440
- var webSearchPreviewOutputSchema = lazySchema22(
4536
+ var webSearchInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
4537
+ var webSearchOutputSchema = lazySchema22(
4441
4538
  () => zodSchema22(
4442
4539
  z24.object({
4443
4540
  action: z24.discriminatedUnion("type", [
@@ -4454,11 +4551,68 @@ var webSearchPreviewOutputSchema = lazySchema22(
4454
4551
  url: z24.string().nullish(),
4455
4552
  pattern: z24.string().nullish()
4456
4553
  })
4554
+ ]).optional(),
4555
+ sources: z24.array(
4556
+ z24.discriminatedUnion("type", [
4557
+ z24.object({ type: z24.literal("url"), url: z24.string() }),
4558
+ z24.object({ type: z24.literal("api"), name: z24.string() })
4559
+ ])
4560
+ ).optional()
4561
+ })
4562
+ )
4563
+ );
4564
+ var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
4565
+ id: "openai.web_search",
4566
+ inputSchema: webSearchInputSchema,
4567
+ outputSchema: webSearchOutputSchema
4568
+ });
4569
+
4570
+ // src/tool/web-search-preview.ts
4571
+ import {
4572
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
4573
+ lazySchema as lazySchema23,
4574
+ zodSchema as zodSchema23
4575
+ } from "@ai-sdk/provider-utils";
4576
+ import { z as z25 } from "zod/v4";
4577
+ var webSearchPreviewArgsSchema = lazySchema23(
4578
+ () => zodSchema23(
4579
+ z25.object({
4580
+ searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
4581
+ userLocation: z25.object({
4582
+ type: z25.literal("approximate"),
4583
+ country: z25.string().optional(),
4584
+ city: z25.string().optional(),
4585
+ region: z25.string().optional(),
4586
+ timezone: z25.string().optional()
4587
+ }).optional()
4588
+ })
4589
+ )
4590
+ );
4591
+ var webSearchPreviewInputSchema = lazySchema23(
4592
+ () => zodSchema23(z25.object({}))
4593
+ );
4594
+ var webSearchPreviewOutputSchema = lazySchema23(
4595
+ () => zodSchema23(
4596
+ z25.object({
4597
+ action: z25.discriminatedUnion("type", [
4598
+ z25.object({
4599
+ type: z25.literal("search"),
4600
+ query: z25.string().optional()
4601
+ }),
4602
+ z25.object({
4603
+ type: z25.literal("openPage"),
4604
+ url: z25.string().nullish()
4605
+ }),
4606
+ z25.object({
4607
+ type: z25.literal("findInPage"),
4608
+ url: z25.string().nullish(),
4609
+ pattern: z25.string().nullish()
4610
+ })
4457
4611
  ]).optional()
4458
4612
  })
4459
4613
  )
4460
4614
  );
4461
- var webSearchPreview = createProviderToolFactoryWithOutputSchema9({
4615
+ var webSearchPreview = createProviderToolFactoryWithOutputSchema10({
4462
4616
  id: "openai.web_search_preview",
4463
4617
  inputSchema: webSearchPreviewInputSchema,
4464
4618
  outputSchema: webSearchPreviewOutputSchema
@@ -4471,7 +4625,7 @@ async function prepareResponsesTools({
4471
4625
  toolNameMapping,
4472
4626
  customProviderToolNames
4473
4627
  }) {
4474
- var _a;
4628
+ var _a, _b;
4475
4629
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
4476
4630
  const toolWarnings = [];
4477
4631
  if (tools == null) {
@@ -4481,15 +4635,19 @@ async function prepareResponsesTools({
4481
4635
  const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
4482
4636
  for (const tool of tools) {
4483
4637
  switch (tool.type) {
4484
- case "function":
4638
+ case "function": {
4639
+ const openaiOptions = (_a = tool.providerOptions) == null ? void 0 : _a.openai;
4640
+ const deferLoading = openaiOptions == null ? void 0 : openaiOptions.deferLoading;
4485
4641
  openaiTools.push({
4486
4642
  type: "function",
4487
4643
  name: tool.name,
4488
4644
  description: tool.description,
4489
4645
  parameters: tool.inputSchema,
4490
- ...tool.strict != null ? { strict: tool.strict } : {}
4646
+ ...tool.strict != null ? { strict: tool.strict } : {},
4647
+ ...deferLoading != null ? { defer_loading: deferLoading } : {}
4491
4648
  });
4492
4649
  break;
4650
+ }
4493
4651
  case "provider": {
4494
4652
  switch (tool.id) {
4495
4653
  case "openai.file_search": {
@@ -4634,6 +4792,19 @@ async function prepareResponsesTools({
4634
4792
  resolvedCustomProviderToolNames.add(args.name);
4635
4793
  break;
4636
4794
  }
4795
+ case "openai.tool_search": {
4796
+ const args = await validateTypes2({
4797
+ value: tool.args,
4798
+ schema: toolSearchArgsSchema
4799
+ });
4800
+ openaiTools.push({
4801
+ type: "tool_search",
4802
+ ...args.execution != null ? { execution: args.execution } : {},
4803
+ ...args.description != null ? { description: args.description } : {},
4804
+ ...args.parameters != null ? { parameters: args.parameters } : {}
4805
+ });
4806
+ break;
4807
+ }
4637
4808
  }
4638
4809
  break;
4639
4810
  }
@@ -4655,7 +4826,7 @@ async function prepareResponsesTools({
4655
4826
  case "required":
4656
4827
  return { tools: openaiTools, toolChoice: type, toolWarnings };
4657
4828
  case "tool": {
4658
- const resolvedToolName = (_a = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _a : toolChoice.toolName;
4829
+ const resolvedToolName = (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _b : toolChoice.toolName;
4659
4830
  return {
4660
4831
  tools: openaiTools,
4661
4832
  toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
@@ -4811,7 +4982,8 @@ var OpenAIResponsesLanguageModel = class {
4811
4982
  "openai.web_search": "web_search",
4812
4983
  "openai.web_search_preview": "web_search_preview",
4813
4984
  "openai.mcp": "mcp",
4814
- "openai.apply_patch": "apply_patch"
4985
+ "openai.apply_patch": "apply_patch",
4986
+ "openai.tool_search": "tool_search"
4815
4987
  },
4816
4988
  resolveProviderToolName: (tool) => tool.id === "openai.custom" ? tool.args.name : void 0
4817
4989
  });
@@ -4989,7 +5161,7 @@ var OpenAIResponsesLanguageModel = class {
4989
5161
  };
4990
5162
  }
4991
5163
  async doGenerate(options) {
4992
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
5164
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
4993
5165
  const {
4994
5166
  args: body,
4995
5167
  warnings,
@@ -5032,6 +5204,7 @@ var OpenAIResponsesLanguageModel = class {
5032
5204
  const content = [];
5033
5205
  const logprobs = [];
5034
5206
  let hasFunctionCall = false;
5207
+ const hostedToolSearchCallIds = [];
5035
5208
  for (const part of response.output) {
5036
5209
  switch (part.type) {
5037
5210
  case "reasoning": {
@@ -5070,6 +5243,46 @@ var OpenAIResponsesLanguageModel = class {
5070
5243
  });
5071
5244
  break;
5072
5245
  }
5246
+ case "tool_search_call": {
5247
+ const toolCallId = (_b = part.call_id) != null ? _b : part.id;
5248
+ const isHosted = part.execution === "server";
5249
+ if (isHosted) {
5250
+ hostedToolSearchCallIds.push(toolCallId);
5251
+ }
5252
+ content.push({
5253
+ type: "tool-call",
5254
+ toolCallId,
5255
+ toolName: toolNameMapping.toCustomToolName("tool_search"),
5256
+ input: JSON.stringify({
5257
+ arguments: part.arguments,
5258
+ call_id: part.call_id
5259
+ }),
5260
+ ...isHosted ? { providerExecuted: true } : {},
5261
+ providerMetadata: {
5262
+ [providerOptionsName]: {
5263
+ itemId: part.id
5264
+ }
5265
+ }
5266
+ });
5267
+ break;
5268
+ }
5269
+ case "tool_search_output": {
5270
+ const toolCallId = (_d = (_c = part.call_id) != null ? _c : hostedToolSearchCallIds.shift()) != null ? _d : part.id;
5271
+ content.push({
5272
+ type: "tool-result",
5273
+ toolCallId,
5274
+ toolName: toolNameMapping.toCustomToolName("tool_search"),
5275
+ result: {
5276
+ tools: part.tools
5277
+ },
5278
+ providerMetadata: {
5279
+ [providerOptionsName]: {
5280
+ itemId: part.id
5281
+ }
5282
+ }
5283
+ });
5284
+ break;
5285
+ }
5073
5286
  case "local_shell_call": {
5074
5287
  content.push({
5075
5288
  type: "tool-call",
@@ -5125,7 +5338,7 @@ var OpenAIResponsesLanguageModel = class {
5125
5338
  }
5126
5339
  case "message": {
5127
5340
  for (const contentPart of part.content) {
5128
- if (((_c = (_b = options.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.logprobs) && contentPart.logprobs) {
5341
+ if (((_f = (_e = options.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.logprobs) && contentPart.logprobs) {
5129
5342
  logprobs.push(contentPart.logprobs);
5130
5343
  }
5131
5344
  const providerMetadata2 = {
@@ -5147,7 +5360,7 @@ var OpenAIResponsesLanguageModel = class {
5147
5360
  content.push({
5148
5361
  type: "source",
5149
5362
  sourceType: "url",
5150
- id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : generateId2(),
5363
+ id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
5151
5364
  url: annotation.url,
5152
5365
  title: annotation.title
5153
5366
  });
@@ -5155,7 +5368,7 @@ var OpenAIResponsesLanguageModel = class {
5155
5368
  content.push({
5156
5369
  type: "source",
5157
5370
  sourceType: "document",
5158
- id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
5371
+ id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
5159
5372
  mediaType: "text/plain",
5160
5373
  title: annotation.filename,
5161
5374
  filename: annotation.filename,
@@ -5171,7 +5384,7 @@ var OpenAIResponsesLanguageModel = class {
5171
5384
  content.push({
5172
5385
  type: "source",
5173
5386
  sourceType: "document",
5174
- id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
5387
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
5175
5388
  mediaType: "text/plain",
5176
5389
  title: annotation.filename,
5177
5390
  filename: annotation.filename,
@@ -5187,7 +5400,7 @@ var OpenAIResponsesLanguageModel = class {
5187
5400
  content.push({
5188
5401
  type: "source",
5189
5402
  sourceType: "document",
5190
- id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
5403
+ id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
5191
5404
  mediaType: "application/octet-stream",
5192
5405
  title: annotation.file_id,
5193
5406
  filename: annotation.file_id,
@@ -5256,7 +5469,7 @@ var OpenAIResponsesLanguageModel = class {
5256
5469
  break;
5257
5470
  }
5258
5471
  case "mcp_call": {
5259
- const toolCallId = part.approval_request_id != null ? (_p = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _p : part.id : part.id;
5472
+ const toolCallId = part.approval_request_id != null ? (_s = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _s : part.id : part.id;
5260
5473
  const toolName = `mcp.${part.name}`;
5261
5474
  content.push({
5262
5475
  type: "tool-call",
@@ -5290,8 +5503,8 @@ var OpenAIResponsesLanguageModel = class {
5290
5503
  break;
5291
5504
  }
5292
5505
  case "mcp_approval_request": {
5293
- const approvalRequestId = (_q = part.approval_request_id) != null ? _q : part.id;
5294
- const dummyToolCallId = (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : generateId2();
5506
+ const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
5507
+ const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2();
5295
5508
  const toolName = `mcp.${part.name}`;
5296
5509
  content.push({
5297
5510
  type: "tool-call",
@@ -5341,13 +5554,13 @@ var OpenAIResponsesLanguageModel = class {
5341
5554
  toolName: toolNameMapping.toCustomToolName("file_search"),
5342
5555
  result: {
5343
5556
  queries: part.queries,
5344
- results: (_v = (_u = part.results) == null ? void 0 : _u.map((result) => ({
5557
+ results: (_y = (_x = part.results) == null ? void 0 : _x.map((result) => ({
5345
5558
  attributes: result.attributes,
5346
5559
  fileId: result.file_id,
5347
5560
  filename: result.filename,
5348
5561
  score: result.score,
5349
5562
  text: result.text
5350
- }))) != null ? _v : null
5563
+ }))) != null ? _y : null
5351
5564
  }
5352
5565
  });
5353
5566
  break;
@@ -5404,10 +5617,10 @@ var OpenAIResponsesLanguageModel = class {
5404
5617
  content,
5405
5618
  finishReason: {
5406
5619
  unified: mapOpenAIResponseFinishReason({
5407
- finishReason: (_w = response.incomplete_details) == null ? void 0 : _w.reason,
5620
+ finishReason: (_z = response.incomplete_details) == null ? void 0 : _z.reason,
5408
5621
  hasFunctionCall
5409
5622
  }),
5410
- raw: (_y = (_x = response.incomplete_details) == null ? void 0 : _x.reason) != null ? _y : void 0
5623
+ raw: (_B = (_A = response.incomplete_details) == null ? void 0 : _A.reason) != null ? _B : void 0
5411
5624
  },
5412
5625
  usage: convertOpenAIResponsesUsage(usage),
5413
5626
  request: { body },
@@ -5465,6 +5678,7 @@ var OpenAIResponsesLanguageModel = class {
5465
5678
  let hasFunctionCall = false;
5466
5679
  const activeReasoning = {};
5467
5680
  let serviceTier;
5681
+ const hostedToolSearchCallIds = [];
5468
5682
  return {
5469
5683
  stream: response.pipeThrough(
5470
5684
  new TransformStream({
@@ -5472,7 +5686,7 @@ var OpenAIResponsesLanguageModel = class {
5472
5686
  controller.enqueue({ type: "stream-start", warnings });
5473
5687
  },
5474
5688
  transform(chunk, controller) {
5475
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
5689
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
5476
5690
  if (options.includeRawChunks) {
5477
5691
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
5478
5692
  }
@@ -5580,6 +5794,24 @@ var OpenAIResponsesLanguageModel = class {
5580
5794
  input: "{}",
5581
5795
  providerExecuted: true
5582
5796
  });
5797
+ } else if (value.item.type === "tool_search_call") {
5798
+ const toolCallId = value.item.id;
5799
+ const toolName = toolNameMapping.toCustomToolName("tool_search");
5800
+ const isHosted = value.item.execution === "server";
5801
+ ongoingToolCalls[value.output_index] = {
5802
+ toolName,
5803
+ toolCallId,
5804
+ toolSearchExecution: (_a = value.item.execution) != null ? _a : "server"
5805
+ };
5806
+ if (isHosted) {
5807
+ controller.enqueue({
5808
+ type: "tool-input-start",
5809
+ id: toolCallId,
5810
+ toolName,
5811
+ providerExecuted: true
5812
+ });
5813
+ }
5814
+ } else if (value.item.type === "tool_search_output") {
5583
5815
  } else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
5584
5816
  } else if (value.item.type === "apply_patch_call") {
5585
5817
  const { call_id: callId, operation } = value.item;
@@ -5626,7 +5858,7 @@ var OpenAIResponsesLanguageModel = class {
5626
5858
  } else if (value.item.type === "shell_call_output") {
5627
5859
  } else if (value.item.type === "message") {
5628
5860
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
5629
- activeMessagePhase = (_a = value.item.phase) != null ? _a : void 0;
5861
+ activeMessagePhase = (_b = value.item.phase) != null ? _b : void 0;
5630
5862
  controller.enqueue({
5631
5863
  type: "text-start",
5632
5864
  id: value.item.id,
@@ -5650,14 +5882,14 @@ var OpenAIResponsesLanguageModel = class {
5650
5882
  providerMetadata: {
5651
5883
  [providerOptionsName]: {
5652
5884
  itemId: value.item.id,
5653
- reasoningEncryptedContent: (_b = value.item.encrypted_content) != null ? _b : null
5885
+ reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
5654
5886
  }
5655
5887
  }
5656
5888
  });
5657
5889
  }
5658
5890
  } else if (isResponseOutputItemDoneChunk(value)) {
5659
5891
  if (value.item.type === "message") {
5660
- const phase = (_c = value.item.phase) != null ? _c : activeMessagePhase;
5892
+ const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
5661
5893
  activeMessagePhase = void 0;
5662
5894
  controller.enqueue({
5663
5895
  type: "text-end",
@@ -5751,13 +5983,13 @@ var OpenAIResponsesLanguageModel = class {
5751
5983
  toolName: toolNameMapping.toCustomToolName("file_search"),
5752
5984
  result: {
5753
5985
  queries: value.item.queries,
5754
- results: (_e = (_d = value.item.results) == null ? void 0 : _d.map((result) => ({
5986
+ results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result) => ({
5755
5987
  attributes: result.attributes,
5756
5988
  fileId: result.file_id,
5757
5989
  filename: result.filename,
5758
5990
  score: result.score,
5759
5991
  text: result.text
5760
- }))) != null ? _e : null
5992
+ }))) != null ? _f : null
5761
5993
  }
5762
5994
  });
5763
5995
  } else if (value.item.type === "code_interpreter_call") {
@@ -5779,12 +6011,62 @@ var OpenAIResponsesLanguageModel = class {
5779
6011
  result: value.item.result
5780
6012
  }
5781
6013
  });
6014
+ } else if (value.item.type === "tool_search_call") {
6015
+ const toolCall = ongoingToolCalls[value.output_index];
6016
+ const isHosted = value.item.execution === "server";
6017
+ if (toolCall != null) {
6018
+ const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
6019
+ if (isHosted) {
6020
+ hostedToolSearchCallIds.push(toolCallId);
6021
+ } else {
6022
+ controller.enqueue({
6023
+ type: "tool-input-start",
6024
+ id: toolCallId,
6025
+ toolName: toolCall.toolName
6026
+ });
6027
+ }
6028
+ controller.enqueue({
6029
+ type: "tool-input-end",
6030
+ id: toolCallId
6031
+ });
6032
+ controller.enqueue({
6033
+ type: "tool-call",
6034
+ toolCallId,
6035
+ toolName: toolCall.toolName,
6036
+ input: JSON.stringify({
6037
+ arguments: value.item.arguments,
6038
+ call_id: isHosted ? null : toolCallId
6039
+ }),
6040
+ ...isHosted ? { providerExecuted: true } : {},
6041
+ providerMetadata: {
6042
+ [providerOptionsName]: {
6043
+ itemId: value.item.id
6044
+ }
6045
+ }
6046
+ });
6047
+ }
6048
+ ongoingToolCalls[value.output_index] = void 0;
6049
+ } else if (value.item.type === "tool_search_output") {
6050
+ const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
6051
+ controller.enqueue({
6052
+ type: "tool-result",
6053
+ toolCallId,
6054
+ toolName: toolNameMapping.toCustomToolName("tool_search"),
6055
+ result: {
6056
+ tools: value.item.tools
6057
+ },
6058
+ providerMetadata: {
6059
+ [providerOptionsName]: {
6060
+ itemId: value.item.id
6061
+ }
6062
+ }
6063
+ });
5782
6064
  } else if (value.item.type === "mcp_call") {
5783
6065
  ongoingToolCalls[value.output_index] = void 0;
5784
- const approvalRequestId = (_f = value.item.approval_request_id) != null ? _f : void 0;
5785
- const aliasedToolCallId = approvalRequestId != null ? (_h = (_g = approvalRequestIdToDummyToolCallIdFromStream.get(
6066
+ const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
6067
+ const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
5786
6068
  approvalRequestId
5787
- )) != null ? _g : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _h : value.item.id : value.item.id;
6069
+ )) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
5788
6070
  const toolName = `mcp.${value.item.name}`;
5789
6071
  controller.enqueue({
5790
6072
  type: "tool-call",
@@ -5854,8 +6136,8 @@ var OpenAIResponsesLanguageModel = class {
5854
6136
  ongoingToolCalls[value.output_index] = void 0;
5855
6137
  } else if (value.item.type === "mcp_approval_request") {
5856
6138
  ongoingToolCalls[value.output_index] = void 0;
5857
- const dummyToolCallId = (_k = (_j = (_i = self.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : generateId2();
5858
- const approvalRequestId = (_l = value.item.approval_request_id) != null ? _l : value.item.id;
6139
+ const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
6140
+ const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
5859
6141
  approvalRequestIdToDummyToolCallIdFromStream.set(
5860
6142
  approvalRequestId,
5861
6143
  dummyToolCallId
@@ -5944,7 +6226,7 @@ var OpenAIResponsesLanguageModel = class {
5944
6226
  providerMetadata: {
5945
6227
  [providerOptionsName]: {
5946
6228
  itemId: value.item.id,
5947
- reasoningEncryptedContent: (_m = value.item.encrypted_content) != null ? _m : null
6229
+ reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
5948
6230
  }
5949
6231
  }
5950
6232
  });
@@ -6057,7 +6339,7 @@ var OpenAIResponsesLanguageModel = class {
6057
6339
  id: value.item_id,
6058
6340
  delta: value.delta
6059
6341
  });
6060
- if (((_o = (_n = options.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.logprobs) && value.logprobs) {
6342
+ if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
6061
6343
  logprobs.push(value.logprobs);
6062
6344
  }
6063
6345
  } else if (value.type === "response.reasoning_summary_part.added") {
@@ -6086,7 +6368,7 @@ var OpenAIResponsesLanguageModel = class {
6086
6368
  providerMetadata: {
6087
6369
  [providerOptionsName]: {
6088
6370
  itemId: value.item_id,
6089
- reasoningEncryptedContent: (_q = (_p = activeReasoning[value.item_id]) == null ? void 0 : _p.encryptedContent) != null ? _q : null
6371
+ reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
6090
6372
  }
6091
6373
  }
6092
6374
  });
@@ -6120,10 +6402,10 @@ var OpenAIResponsesLanguageModel = class {
6120
6402
  } else if (isResponseFinishedChunk(value)) {
6121
6403
  finishReason = {
6122
6404
  unified: mapOpenAIResponseFinishReason({
6123
- finishReason: (_r = value.response.incomplete_details) == null ? void 0 : _r.reason,
6405
+ finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
6124
6406
  hasFunctionCall
6125
6407
  }),
6126
- raw: (_t = (_s = value.response.incomplete_details) == null ? void 0 : _s.reason) != null ? _t : void 0
6408
+ raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
6127
6409
  };
6128
6410
  usage = value.response.usage;
6129
6411
  if (typeof value.response.service_tier === "string") {
@@ -6135,7 +6417,7 @@ var OpenAIResponsesLanguageModel = class {
6135
6417
  controller.enqueue({
6136
6418
  type: "source",
6137
6419
  sourceType: "url",
6138
- id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2(),
6420
+ id: (_A = (_z = (_y = self.config).generateId) == null ? void 0 : _z.call(_y)) != null ? _A : generateId2(),
6139
6421
  url: value.annotation.url,
6140
6422
  title: value.annotation.title
6141
6423
  });
@@ -6143,7 +6425,7 @@ var OpenAIResponsesLanguageModel = class {
6143
6425
  controller.enqueue({
6144
6426
  type: "source",
6145
6427
  sourceType: "document",
6146
- id: (_z = (_y = (_x = self.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : generateId2(),
6428
+ id: (_D = (_C = (_B = self.config).generateId) == null ? void 0 : _C.call(_B)) != null ? _D : generateId2(),
6147
6429
  mediaType: "text/plain",
6148
6430
  title: value.annotation.filename,
6149
6431
  filename: value.annotation.filename,
@@ -6159,7 +6441,7 @@ var OpenAIResponsesLanguageModel = class {
6159
6441
  controller.enqueue({
6160
6442
  type: "source",
6161
6443
  sourceType: "document",
6162
- id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : generateId2(),
6444
+ id: (_G = (_F = (_E = self.config).generateId) == null ? void 0 : _F.call(_E)) != null ? _G : generateId2(),
6163
6445
  mediaType: "text/plain",
6164
6446
  title: value.annotation.filename,
6165
6447
  filename: value.annotation.filename,
@@ -6175,7 +6457,7 @@ var OpenAIResponsesLanguageModel = class {
6175
6457
  controller.enqueue({
6176
6458
  type: "source",
6177
6459
  sourceType: "document",
6178
- id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId2(),
6460
+ id: (_J = (_I = (_H = self.config).generateId) == null ? void 0 : _I.call(_H)) != null ? _J : generateId2(),
6179
6461
  mediaType: "application/octet-stream",
6180
6462
  title: value.annotation.file_id,
6181
6463
  filename: value.annotation.file_id,