@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.
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/internal/index.ts
21
- var internal_exports = {};
22
- __export(internal_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  OpenAIChatLanguageModel: () => OpenAIChatLanguageModel,
24
24
  OpenAICompletionLanguageModel: () => OpenAICompletionLanguageModel,
25
25
  OpenAIEmbeddingModel: () => OpenAIEmbeddingModel,
@@ -54,7 +54,7 @@ __export(internal_exports, {
54
54
  webSearchPreviewArgsSchema: () => webSearchPreviewArgsSchema,
55
55
  webSearchPreviewInputSchema: () => webSearchPreviewInputSchema
56
56
  });
57
- module.exports = __toCommonJS(internal_exports);
57
+ module.exports = __toCommonJS(index_exports);
58
58
 
59
59
  // src/chat/openai-chat-language-model.ts
60
60
  var import_provider3 = require("@ai-sdk/provider");
@@ -84,7 +84,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
84
84
  const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
85
85
  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");
86
86
  const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
87
- const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.4");
87
+ const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2") || modelId.startsWith("gpt-5.3") || modelId.startsWith("gpt-5.4");
88
88
  const systemMessageMode = isReasoningModel ? "developer" : "system";
89
89
  return {
90
90
  supportsFlexProcessing,
@@ -2338,7 +2338,7 @@ var OpenAISpeechModel = class {
2338
2338
 
2339
2339
  // src/responses/openai-responses-language-model.ts
2340
2340
  var import_provider8 = require("@ai-sdk/provider");
2341
- var import_provider_utils33 = require("@ai-sdk/provider-utils");
2341
+ var import_provider_utils34 = require("@ai-sdk/provider-utils");
2342
2342
 
2343
2343
  // src/responses/convert-openai-responses-usage.ts
2344
2344
  function convertOpenAIResponsesUsage(usage) {
@@ -2381,8 +2381,8 @@ function convertOpenAIResponsesUsage(usage) {
2381
2381
 
2382
2382
  // src/responses/convert-to-openai-responses-input.ts
2383
2383
  var import_provider6 = require("@ai-sdk/provider");
2384
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
2385
- var import_v415 = require("zod/v4");
2384
+ var import_provider_utils23 = require("@ai-sdk/provider-utils");
2385
+ var import_v416 = require("zod/v4");
2386
2386
 
2387
2387
  // src/tool/apply-patch.ts
2388
2388
  var import_provider_utils19 = require("@ai-sdk/provider-utils");
@@ -2549,6 +2549,39 @@ var shell = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchem
2549
2549
  outputSchema: shellOutputSchema
2550
2550
  });
2551
2551
 
2552
+ // src/tool/tool-search.ts
2553
+ var import_provider_utils22 = require("@ai-sdk/provider-utils");
2554
+ var import_v415 = require("zod/v4");
2555
+ var toolSearchArgsSchema = (0, import_provider_utils22.lazySchema)(
2556
+ () => (0, import_provider_utils22.zodSchema)(
2557
+ import_v415.z.object({
2558
+ execution: import_v415.z.enum(["server", "client"]).optional(),
2559
+ description: import_v415.z.string().optional(),
2560
+ parameters: import_v415.z.record(import_v415.z.string(), import_v415.z.unknown()).optional()
2561
+ })
2562
+ )
2563
+ );
2564
+ var toolSearchInputSchema = (0, import_provider_utils22.lazySchema)(
2565
+ () => (0, import_provider_utils22.zodSchema)(
2566
+ import_v415.z.object({
2567
+ arguments: import_v415.z.unknown().optional(),
2568
+ call_id: import_v415.z.string().nullish()
2569
+ })
2570
+ )
2571
+ );
2572
+ var toolSearchOutputSchema = (0, import_provider_utils22.lazySchema)(
2573
+ () => (0, import_provider_utils22.zodSchema)(
2574
+ import_v415.z.object({
2575
+ tools: import_v415.z.array(import_v415.z.record(import_v415.z.string(), import_v415.z.unknown()))
2576
+ })
2577
+ )
2578
+ );
2579
+ var toolSearchToolFactory = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
2580
+ id: "openai.tool_search",
2581
+ inputSchema: toolSearchInputSchema,
2582
+ outputSchema: toolSearchOutputSchema
2583
+ });
2584
+
2552
2585
  // src/responses/convert-to-openai-responses-input.ts
2553
2586
  function isFileId(data, prefixes) {
2554
2587
  if (!prefixes) return false;
@@ -2567,7 +2600,7 @@ async function convertToOpenAIResponsesInput({
2567
2600
  hasApplyPatchTool = false,
2568
2601
  customProviderToolNames
2569
2602
  }) {
2570
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2603
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
2571
2604
  let input = [];
2572
2605
  const warnings = [];
2573
2606
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -2614,7 +2647,7 @@ async function convertToOpenAIResponsesInput({
2614
2647
  return {
2615
2648
  type: "input_image",
2616
2649
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2617
- image_url: `data:${mediaType};base64,${(0, import_provider_utils22.convertToBase64)(part.data)}`
2650
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
2618
2651
  },
2619
2652
  detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail
2620
2653
  };
@@ -2629,7 +2662,7 @@ async function convertToOpenAIResponsesInput({
2629
2662
  type: "input_file",
2630
2663
  ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2631
2664
  filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
2632
- file_data: `data:application/pdf;base64,${(0, import_provider_utils22.convertToBase64)(part.data)}`
2665
+ file_data: `data:application/pdf;base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
2633
2666
  }
2634
2667
  };
2635
2668
  } else {
@@ -2671,6 +2704,32 @@ async function convertToOpenAIResponsesInput({
2671
2704
  if (hasConversation && id != null) {
2672
2705
  break;
2673
2706
  }
2707
+ const resolvedToolName = toolNameMapping.toProviderToolName(
2708
+ part.toolName
2709
+ );
2710
+ if (resolvedToolName === "tool_search") {
2711
+ if (store && id != null) {
2712
+ input.push({ type: "item_reference", id });
2713
+ break;
2714
+ }
2715
+ const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils23.parseJSON)({
2716
+ text: part.input,
2717
+ schema: toolSearchInputSchema
2718
+ }) : await (0, import_provider_utils23.validateTypes)({
2719
+ value: part.input,
2720
+ schema: toolSearchInputSchema
2721
+ });
2722
+ const execution = parsedInput.call_id != null ? "client" : "server";
2723
+ input.push({
2724
+ type: "tool_search_call",
2725
+ id: id != null ? id : part.toolCallId,
2726
+ execution,
2727
+ call_id: (_g = parsedInput.call_id) != null ? _g : null,
2728
+ status: "completed",
2729
+ arguments: parsedInput.arguments
2730
+ });
2731
+ break;
2732
+ }
2674
2733
  if (part.providerExecuted) {
2675
2734
  if (store && id != null) {
2676
2735
  input.push({ type: "item_reference", id });
@@ -2681,11 +2740,8 @@ async function convertToOpenAIResponsesInput({
2681
2740
  input.push({ type: "item_reference", id });
2682
2741
  break;
2683
2742
  }
2684
- const resolvedToolName = toolNameMapping.toProviderToolName(
2685
- part.toolName
2686
- );
2687
2743
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
2688
- const parsedInput = await (0, import_provider_utils22.validateTypes)({
2744
+ const parsedInput = await (0, import_provider_utils23.validateTypes)({
2689
2745
  value: part.input,
2690
2746
  schema: localShellInputSchema
2691
2747
  });
@@ -2705,7 +2761,7 @@ async function convertToOpenAIResponsesInput({
2705
2761
  break;
2706
2762
  }
2707
2763
  if (hasShellTool && resolvedToolName === "shell") {
2708
- const parsedInput = await (0, import_provider_utils22.validateTypes)({
2764
+ const parsedInput = await (0, import_provider_utils23.validateTypes)({
2709
2765
  value: part.input,
2710
2766
  schema: shellInputSchema
2711
2767
  });
@@ -2723,7 +2779,7 @@ async function convertToOpenAIResponsesInput({
2723
2779
  break;
2724
2780
  }
2725
2781
  if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
2726
- const parsedInput = await (0, import_provider_utils22.validateTypes)({
2782
+ const parsedInput = await (0, import_provider_utils23.validateTypes)({
2727
2783
  value: part.input,
2728
2784
  schema: applyPatchInputSchema
2729
2785
  });
@@ -2766,9 +2822,29 @@ async function convertToOpenAIResponsesInput({
2766
2822
  const resolvedResultToolName = toolNameMapping.toProviderToolName(
2767
2823
  part.toolName
2768
2824
  );
2825
+ if (resolvedResultToolName === "tool_search") {
2826
+ const itemId = (_j = (_i = (_h = part.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.itemId) != null ? _j : part.toolCallId;
2827
+ if (store) {
2828
+ input.push({ type: "item_reference", id: itemId });
2829
+ } else if (part.output.type === "json") {
2830
+ const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2831
+ value: part.output.value,
2832
+ schema: toolSearchOutputSchema
2833
+ });
2834
+ input.push({
2835
+ type: "tool_search_output",
2836
+ id: itemId,
2837
+ execution: "server",
2838
+ call_id: null,
2839
+ status: "completed",
2840
+ tools: parsedOutput.tools
2841
+ });
2842
+ }
2843
+ break;
2844
+ }
2769
2845
  if (hasShellTool && resolvedResultToolName === "shell") {
2770
2846
  if (part.output.type === "json") {
2771
- const parsedOutput = await (0, import_provider_utils22.validateTypes)({
2847
+ const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2772
2848
  value: part.output.value,
2773
2849
  schema: shellOutputSchema
2774
2850
  });
@@ -2788,7 +2864,7 @@ async function convertToOpenAIResponsesInput({
2788
2864
  break;
2789
2865
  }
2790
2866
  if (store) {
2791
- const itemId = (_i = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.itemId) != null ? _i : part.toolCallId;
2867
+ const itemId = (_m = (_l = (_k = part.providerOptions) == null ? void 0 : _k[providerOptionsName]) == null ? void 0 : _l.itemId) != null ? _m : part.toolCallId;
2792
2868
  input.push({ type: "item_reference", id: itemId });
2793
2869
  } else {
2794
2870
  warnings.push({
@@ -2799,7 +2875,7 @@ async function convertToOpenAIResponsesInput({
2799
2875
  break;
2800
2876
  }
2801
2877
  case "reasoning": {
2802
- const providerOptions = await (0, import_provider_utils22.parseProviderOptions)({
2878
+ const providerOptions = await (0, import_provider_utils23.parseProviderOptions)({
2803
2879
  provider: providerOptionsName,
2804
2880
  providerOptions: part.providerOptions,
2805
2881
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -2898,7 +2974,7 @@ async function convertToOpenAIResponsesInput({
2898
2974
  }
2899
2975
  const output = part.output;
2900
2976
  if (output.type === "execution-denied") {
2901
- const approvalId = (_k = (_j = output.providerOptions) == null ? void 0 : _j.openai) == null ? void 0 : _k.approvalId;
2977
+ const approvalId = (_o = (_n = output.providerOptions) == null ? void 0 : _n.openai) == null ? void 0 : _o.approvalId;
2902
2978
  if (approvalId) {
2903
2979
  continue;
2904
2980
  }
@@ -2906,8 +2982,22 @@ async function convertToOpenAIResponsesInput({
2906
2982
  const resolvedToolName = toolNameMapping.toProviderToolName(
2907
2983
  part.toolName
2908
2984
  );
2985
+ if (resolvedToolName === "tool_search" && output.type === "json") {
2986
+ const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2987
+ value: output.value,
2988
+ schema: toolSearchOutputSchema
2989
+ });
2990
+ input.push({
2991
+ type: "tool_search_output",
2992
+ execution: "client",
2993
+ call_id: part.toolCallId,
2994
+ status: "completed",
2995
+ tools: parsedOutput.tools
2996
+ });
2997
+ continue;
2998
+ }
2909
2999
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
2910
- const parsedOutput = await (0, import_provider_utils22.validateTypes)({
3000
+ const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2911
3001
  value: output.value,
2912
3002
  schema: localShellOutputSchema
2913
3003
  });
@@ -2919,7 +3009,7 @@ async function convertToOpenAIResponsesInput({
2919
3009
  continue;
2920
3010
  }
2921
3011
  if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
2922
- const parsedOutput = await (0, import_provider_utils22.validateTypes)({
3012
+ const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2923
3013
  value: output.value,
2924
3014
  schema: shellOutputSchema
2925
3015
  });
@@ -2938,7 +3028,7 @@ async function convertToOpenAIResponsesInput({
2938
3028
  continue;
2939
3029
  }
2940
3030
  if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
2941
- const parsedOutput = await (0, import_provider_utils22.validateTypes)({
3031
+ const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2942
3032
  value: output.value,
2943
3033
  schema: applyPatchOutputSchema
2944
3034
  });
@@ -2958,7 +3048,7 @@ async function convertToOpenAIResponsesInput({
2958
3048
  outputValue = output.value;
2959
3049
  break;
2960
3050
  case "execution-denied":
2961
- outputValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
3051
+ outputValue = (_p = output.reason) != null ? _p : "Tool execution denied.";
2962
3052
  break;
2963
3053
  case "json":
2964
3054
  case "error-json":
@@ -2993,7 +3083,7 @@ async function convertToOpenAIResponsesInput({
2993
3083
  });
2994
3084
  return void 0;
2995
3085
  }
2996
- }).filter(import_provider_utils22.isNonNullable);
3086
+ }).filter(import_provider_utils23.isNonNullable);
2997
3087
  break;
2998
3088
  default:
2999
3089
  outputValue = "";
@@ -3012,7 +3102,7 @@ async function convertToOpenAIResponsesInput({
3012
3102
  contentValue = output.value;
3013
3103
  break;
3014
3104
  case "execution-denied":
3015
- contentValue = (_m = output.reason) != null ? _m : "Tool execution denied.";
3105
+ contentValue = (_q = output.reason) != null ? _q : "Tool execution denied.";
3016
3106
  break;
3017
3107
  case "json":
3018
3108
  case "error-json":
@@ -3052,7 +3142,7 @@ async function convertToOpenAIResponsesInput({
3052
3142
  return void 0;
3053
3143
  }
3054
3144
  }
3055
- }).filter(import_provider_utils22.isNonNullable);
3145
+ }).filter(import_provider_utils23.isNonNullable);
3056
3146
  break;
3057
3147
  }
3058
3148
  input.push({
@@ -3082,9 +3172,9 @@ async function convertToOpenAIResponsesInput({
3082
3172
  }
3083
3173
  return { input, warnings };
3084
3174
  }
3085
- var openaiResponsesReasoningProviderOptionsSchema = import_v415.z.object({
3086
- itemId: import_v415.z.string().nullish(),
3087
- reasoningEncryptedContent: import_v415.z.string().nullish()
3175
+ var openaiResponsesReasoningProviderOptionsSchema = import_v416.z.object({
3176
+ itemId: import_v416.z.string().nullish(),
3177
+ reasoningEncryptedContent: import_v416.z.string().nullish()
3088
3178
  });
3089
3179
 
3090
3180
  // src/responses/map-openai-responses-finish-reason.ts
@@ -3106,483 +3196,525 @@ function mapOpenAIResponseFinishReason({
3106
3196
  }
3107
3197
 
3108
3198
  // src/responses/openai-responses-api.ts
3109
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
3110
- var import_v416 = require("zod/v4");
3111
- var openaiResponsesChunkSchema = (0, import_provider_utils23.lazySchema)(
3112
- () => (0, import_provider_utils23.zodSchema)(
3113
- import_v416.z.union([
3114
- import_v416.z.object({
3115
- type: import_v416.z.literal("response.output_text.delta"),
3116
- item_id: import_v416.z.string(),
3117
- delta: import_v416.z.string(),
3118
- logprobs: import_v416.z.array(
3119
- import_v416.z.object({
3120
- token: import_v416.z.string(),
3121
- logprob: import_v416.z.number(),
3122
- top_logprobs: import_v416.z.array(
3123
- import_v416.z.object({
3124
- token: import_v416.z.string(),
3125
- logprob: import_v416.z.number()
3199
+ var import_provider_utils24 = require("@ai-sdk/provider-utils");
3200
+ var import_v417 = require("zod/v4");
3201
+ var jsonValueSchema = import_v417.z.lazy(
3202
+ () => import_v417.z.union([
3203
+ import_v417.z.string(),
3204
+ import_v417.z.number(),
3205
+ import_v417.z.boolean(),
3206
+ import_v417.z.null(),
3207
+ import_v417.z.array(jsonValueSchema),
3208
+ import_v417.z.record(import_v417.z.string(), jsonValueSchema.optional())
3209
+ ])
3210
+ );
3211
+ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3212
+ () => (0, import_provider_utils24.zodSchema)(
3213
+ import_v417.z.union([
3214
+ import_v417.z.object({
3215
+ type: import_v417.z.literal("response.output_text.delta"),
3216
+ item_id: import_v417.z.string(),
3217
+ delta: import_v417.z.string(),
3218
+ logprobs: import_v417.z.array(
3219
+ import_v417.z.object({
3220
+ token: import_v417.z.string(),
3221
+ logprob: import_v417.z.number(),
3222
+ top_logprobs: import_v417.z.array(
3223
+ import_v417.z.object({
3224
+ token: import_v417.z.string(),
3225
+ logprob: import_v417.z.number()
3126
3226
  })
3127
3227
  )
3128
3228
  })
3129
3229
  ).nullish()
3130
3230
  }),
3131
- import_v416.z.object({
3132
- type: import_v416.z.enum(["response.completed", "response.incomplete"]),
3133
- response: import_v416.z.object({
3134
- incomplete_details: import_v416.z.object({ reason: import_v416.z.string() }).nullish(),
3135
- usage: import_v416.z.object({
3136
- input_tokens: import_v416.z.number(),
3137
- input_tokens_details: import_v416.z.object({ cached_tokens: import_v416.z.number().nullish() }).nullish(),
3138
- output_tokens: import_v416.z.number(),
3139
- output_tokens_details: import_v416.z.object({ reasoning_tokens: import_v416.z.number().nullish() }).nullish()
3231
+ import_v417.z.object({
3232
+ type: import_v417.z.enum(["response.completed", "response.incomplete"]),
3233
+ response: import_v417.z.object({
3234
+ incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
3235
+ usage: import_v417.z.object({
3236
+ input_tokens: import_v417.z.number(),
3237
+ input_tokens_details: import_v417.z.object({ cached_tokens: import_v417.z.number().nullish() }).nullish(),
3238
+ output_tokens: import_v417.z.number(),
3239
+ output_tokens_details: import_v417.z.object({ reasoning_tokens: import_v417.z.number().nullish() }).nullish()
3140
3240
  }),
3141
- service_tier: import_v416.z.string().nullish()
3241
+ service_tier: import_v417.z.string().nullish()
3142
3242
  })
3143
3243
  }),
3144
- import_v416.z.object({
3145
- type: import_v416.z.literal("response.created"),
3146
- response: import_v416.z.object({
3147
- id: import_v416.z.string(),
3148
- created_at: import_v416.z.number(),
3149
- model: import_v416.z.string(),
3150
- service_tier: import_v416.z.string().nullish()
3244
+ import_v417.z.object({
3245
+ type: import_v417.z.literal("response.created"),
3246
+ response: import_v417.z.object({
3247
+ id: import_v417.z.string(),
3248
+ created_at: import_v417.z.number(),
3249
+ model: import_v417.z.string(),
3250
+ service_tier: import_v417.z.string().nullish()
3151
3251
  })
3152
3252
  }),
3153
- import_v416.z.object({
3154
- type: import_v416.z.literal("response.output_item.added"),
3155
- output_index: import_v416.z.number(),
3156
- item: import_v416.z.discriminatedUnion("type", [
3157
- import_v416.z.object({
3158
- type: import_v416.z.literal("message"),
3159
- id: import_v416.z.string(),
3160
- phase: import_v416.z.enum(["commentary", "final_answer"]).nullish()
3253
+ import_v417.z.object({
3254
+ type: import_v417.z.literal("response.output_item.added"),
3255
+ output_index: import_v417.z.number(),
3256
+ item: import_v417.z.discriminatedUnion("type", [
3257
+ import_v417.z.object({
3258
+ type: import_v417.z.literal("message"),
3259
+ id: import_v417.z.string(),
3260
+ phase: import_v417.z.enum(["commentary", "final_answer"]).nullish()
3161
3261
  }),
3162
- import_v416.z.object({
3163
- type: import_v416.z.literal("reasoning"),
3164
- id: import_v416.z.string(),
3165
- encrypted_content: import_v416.z.string().nullish()
3262
+ import_v417.z.object({
3263
+ type: import_v417.z.literal("reasoning"),
3264
+ id: import_v417.z.string(),
3265
+ encrypted_content: import_v417.z.string().nullish()
3166
3266
  }),
3167
- import_v416.z.object({
3168
- type: import_v416.z.literal("function_call"),
3169
- id: import_v416.z.string(),
3170
- call_id: import_v416.z.string(),
3171
- name: import_v416.z.string(),
3172
- arguments: import_v416.z.string()
3267
+ import_v417.z.object({
3268
+ type: import_v417.z.literal("function_call"),
3269
+ id: import_v417.z.string(),
3270
+ call_id: import_v417.z.string(),
3271
+ name: import_v417.z.string(),
3272
+ arguments: import_v417.z.string()
3173
3273
  }),
3174
- import_v416.z.object({
3175
- type: import_v416.z.literal("web_search_call"),
3176
- id: import_v416.z.string(),
3177
- status: import_v416.z.string()
3274
+ import_v417.z.object({
3275
+ type: import_v417.z.literal("web_search_call"),
3276
+ id: import_v417.z.string(),
3277
+ status: import_v417.z.string()
3178
3278
  }),
3179
- import_v416.z.object({
3180
- type: import_v416.z.literal("computer_call"),
3181
- id: import_v416.z.string(),
3182
- status: import_v416.z.string()
3279
+ import_v417.z.object({
3280
+ type: import_v417.z.literal("computer_call"),
3281
+ id: import_v417.z.string(),
3282
+ status: import_v417.z.string()
3183
3283
  }),
3184
- import_v416.z.object({
3185
- type: import_v416.z.literal("file_search_call"),
3186
- id: import_v416.z.string()
3284
+ import_v417.z.object({
3285
+ type: import_v417.z.literal("file_search_call"),
3286
+ id: import_v417.z.string()
3187
3287
  }),
3188
- import_v416.z.object({
3189
- type: import_v416.z.literal("image_generation_call"),
3190
- id: import_v416.z.string()
3288
+ import_v417.z.object({
3289
+ type: import_v417.z.literal("image_generation_call"),
3290
+ id: import_v417.z.string()
3191
3291
  }),
3192
- import_v416.z.object({
3193
- type: import_v416.z.literal("code_interpreter_call"),
3194
- id: import_v416.z.string(),
3195
- container_id: import_v416.z.string(),
3196
- code: import_v416.z.string().nullable(),
3197
- outputs: import_v416.z.array(
3198
- import_v416.z.discriminatedUnion("type", [
3199
- import_v416.z.object({ type: import_v416.z.literal("logs"), logs: import_v416.z.string() }),
3200
- import_v416.z.object({ type: import_v416.z.literal("image"), url: import_v416.z.string() })
3292
+ import_v417.z.object({
3293
+ type: import_v417.z.literal("code_interpreter_call"),
3294
+ id: import_v417.z.string(),
3295
+ container_id: import_v417.z.string(),
3296
+ code: import_v417.z.string().nullable(),
3297
+ outputs: import_v417.z.array(
3298
+ import_v417.z.discriminatedUnion("type", [
3299
+ import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
3300
+ import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
3201
3301
  ])
3202
3302
  ).nullable(),
3203
- status: import_v416.z.string()
3303
+ status: import_v417.z.string()
3204
3304
  }),
3205
- import_v416.z.object({
3206
- type: import_v416.z.literal("mcp_call"),
3207
- id: import_v416.z.string(),
3208
- status: import_v416.z.string(),
3209
- approval_request_id: import_v416.z.string().nullish()
3305
+ import_v417.z.object({
3306
+ type: import_v417.z.literal("mcp_call"),
3307
+ id: import_v417.z.string(),
3308
+ status: import_v417.z.string(),
3309
+ approval_request_id: import_v417.z.string().nullish()
3210
3310
  }),
3211
- import_v416.z.object({
3212
- type: import_v416.z.literal("mcp_list_tools"),
3213
- id: import_v416.z.string()
3311
+ import_v417.z.object({
3312
+ type: import_v417.z.literal("mcp_list_tools"),
3313
+ id: import_v417.z.string()
3214
3314
  }),
3215
- import_v416.z.object({
3216
- type: import_v416.z.literal("mcp_approval_request"),
3217
- id: import_v416.z.string()
3315
+ import_v417.z.object({
3316
+ type: import_v417.z.literal("mcp_approval_request"),
3317
+ id: import_v417.z.string()
3218
3318
  }),
3219
- import_v416.z.object({
3220
- type: import_v416.z.literal("apply_patch_call"),
3221
- id: import_v416.z.string(),
3222
- call_id: import_v416.z.string(),
3223
- status: import_v416.z.enum(["in_progress", "completed"]),
3224
- operation: import_v416.z.discriminatedUnion("type", [
3225
- import_v416.z.object({
3226
- type: import_v416.z.literal("create_file"),
3227
- path: import_v416.z.string(),
3228
- diff: import_v416.z.string()
3319
+ import_v417.z.object({
3320
+ type: import_v417.z.literal("apply_patch_call"),
3321
+ id: import_v417.z.string(),
3322
+ call_id: import_v417.z.string(),
3323
+ status: import_v417.z.enum(["in_progress", "completed"]),
3324
+ operation: import_v417.z.discriminatedUnion("type", [
3325
+ import_v417.z.object({
3326
+ type: import_v417.z.literal("create_file"),
3327
+ path: import_v417.z.string(),
3328
+ diff: import_v417.z.string()
3229
3329
  }),
3230
- import_v416.z.object({
3231
- type: import_v416.z.literal("delete_file"),
3232
- path: import_v416.z.string()
3330
+ import_v417.z.object({
3331
+ type: import_v417.z.literal("delete_file"),
3332
+ path: import_v417.z.string()
3233
3333
  }),
3234
- import_v416.z.object({
3235
- type: import_v416.z.literal("update_file"),
3236
- path: import_v416.z.string(),
3237
- diff: import_v416.z.string()
3334
+ import_v417.z.object({
3335
+ type: import_v417.z.literal("update_file"),
3336
+ path: import_v417.z.string(),
3337
+ diff: import_v417.z.string()
3238
3338
  })
3239
3339
  ])
3240
3340
  }),
3241
- import_v416.z.object({
3242
- type: import_v416.z.literal("custom_tool_call"),
3243
- id: import_v416.z.string(),
3244
- call_id: import_v416.z.string(),
3245
- name: import_v416.z.string(),
3246
- input: import_v416.z.string()
3341
+ import_v417.z.object({
3342
+ type: import_v417.z.literal("custom_tool_call"),
3343
+ id: import_v417.z.string(),
3344
+ call_id: import_v417.z.string(),
3345
+ name: import_v417.z.string(),
3346
+ input: import_v417.z.string()
3247
3347
  }),
3248
- import_v416.z.object({
3249
- type: import_v416.z.literal("shell_call"),
3250
- id: import_v416.z.string(),
3251
- call_id: import_v416.z.string(),
3252
- status: import_v416.z.enum(["in_progress", "completed", "incomplete"]),
3253
- action: import_v416.z.object({
3254
- commands: import_v416.z.array(import_v416.z.string())
3348
+ import_v417.z.object({
3349
+ type: import_v417.z.literal("shell_call"),
3350
+ id: import_v417.z.string(),
3351
+ call_id: import_v417.z.string(),
3352
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3353
+ action: import_v417.z.object({
3354
+ commands: import_v417.z.array(import_v417.z.string())
3255
3355
  })
3256
3356
  }),
3257
- import_v416.z.object({
3258
- type: import_v416.z.literal("shell_call_output"),
3259
- id: import_v416.z.string(),
3260
- call_id: import_v416.z.string(),
3261
- status: import_v416.z.enum(["in_progress", "completed", "incomplete"]),
3262
- output: import_v416.z.array(
3263
- import_v416.z.object({
3264
- stdout: import_v416.z.string(),
3265
- stderr: import_v416.z.string(),
3266
- outcome: import_v416.z.discriminatedUnion("type", [
3267
- import_v416.z.object({ type: import_v416.z.literal("timeout") }),
3268
- import_v416.z.object({
3269
- type: import_v416.z.literal("exit"),
3270
- exit_code: import_v416.z.number()
3357
+ import_v417.z.object({
3358
+ type: import_v417.z.literal("shell_call_output"),
3359
+ id: import_v417.z.string(),
3360
+ call_id: import_v417.z.string(),
3361
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3362
+ output: import_v417.z.array(
3363
+ import_v417.z.object({
3364
+ stdout: import_v417.z.string(),
3365
+ stderr: import_v417.z.string(),
3366
+ outcome: import_v417.z.discriminatedUnion("type", [
3367
+ import_v417.z.object({ type: import_v417.z.literal("timeout") }),
3368
+ import_v417.z.object({
3369
+ type: import_v417.z.literal("exit"),
3370
+ exit_code: import_v417.z.number()
3271
3371
  })
3272
3372
  ])
3273
3373
  })
3274
3374
  )
3375
+ }),
3376
+ import_v417.z.object({
3377
+ type: import_v417.z.literal("tool_search_call"),
3378
+ id: import_v417.z.string(),
3379
+ execution: import_v417.z.enum(["server", "client"]),
3380
+ call_id: import_v417.z.string().nullable(),
3381
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3382
+ arguments: import_v417.z.unknown()
3383
+ }),
3384
+ import_v417.z.object({
3385
+ type: import_v417.z.literal("tool_search_output"),
3386
+ id: import_v417.z.string(),
3387
+ execution: import_v417.z.enum(["server", "client"]),
3388
+ call_id: import_v417.z.string().nullable(),
3389
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3390
+ tools: import_v417.z.array(import_v417.z.record(import_v417.z.string(), jsonValueSchema.optional()))
3275
3391
  })
3276
3392
  ])
3277
3393
  }),
3278
- import_v416.z.object({
3279
- type: import_v416.z.literal("response.output_item.done"),
3280
- output_index: import_v416.z.number(),
3281
- item: import_v416.z.discriminatedUnion("type", [
3282
- import_v416.z.object({
3283
- type: import_v416.z.literal("message"),
3284
- id: import_v416.z.string(),
3285
- phase: import_v416.z.enum(["commentary", "final_answer"]).nullish()
3394
+ import_v417.z.object({
3395
+ type: import_v417.z.literal("response.output_item.done"),
3396
+ output_index: import_v417.z.number(),
3397
+ item: import_v417.z.discriminatedUnion("type", [
3398
+ import_v417.z.object({
3399
+ type: import_v417.z.literal("message"),
3400
+ id: import_v417.z.string(),
3401
+ phase: import_v417.z.enum(["commentary", "final_answer"]).nullish()
3286
3402
  }),
3287
- import_v416.z.object({
3288
- type: import_v416.z.literal("reasoning"),
3289
- id: import_v416.z.string(),
3290
- encrypted_content: import_v416.z.string().nullish()
3403
+ import_v417.z.object({
3404
+ type: import_v417.z.literal("reasoning"),
3405
+ id: import_v417.z.string(),
3406
+ encrypted_content: import_v417.z.string().nullish()
3291
3407
  }),
3292
- import_v416.z.object({
3293
- type: import_v416.z.literal("function_call"),
3294
- id: import_v416.z.string(),
3295
- call_id: import_v416.z.string(),
3296
- name: import_v416.z.string(),
3297
- arguments: import_v416.z.string(),
3298
- status: import_v416.z.literal("completed")
3408
+ import_v417.z.object({
3409
+ type: import_v417.z.literal("function_call"),
3410
+ id: import_v417.z.string(),
3411
+ call_id: import_v417.z.string(),
3412
+ name: import_v417.z.string(),
3413
+ arguments: import_v417.z.string(),
3414
+ status: import_v417.z.literal("completed")
3299
3415
  }),
3300
- import_v416.z.object({
3301
- type: import_v416.z.literal("custom_tool_call"),
3302
- id: import_v416.z.string(),
3303
- call_id: import_v416.z.string(),
3304
- name: import_v416.z.string(),
3305
- input: import_v416.z.string(),
3306
- status: import_v416.z.literal("completed")
3416
+ import_v417.z.object({
3417
+ type: import_v417.z.literal("custom_tool_call"),
3418
+ id: import_v417.z.string(),
3419
+ call_id: import_v417.z.string(),
3420
+ name: import_v417.z.string(),
3421
+ input: import_v417.z.string(),
3422
+ status: import_v417.z.literal("completed")
3307
3423
  }),
3308
- import_v416.z.object({
3309
- type: import_v416.z.literal("code_interpreter_call"),
3310
- id: import_v416.z.string(),
3311
- code: import_v416.z.string().nullable(),
3312
- container_id: import_v416.z.string(),
3313
- outputs: import_v416.z.array(
3314
- import_v416.z.discriminatedUnion("type", [
3315
- import_v416.z.object({ type: import_v416.z.literal("logs"), logs: import_v416.z.string() }),
3316
- import_v416.z.object({ type: import_v416.z.literal("image"), url: import_v416.z.string() })
3424
+ import_v417.z.object({
3425
+ type: import_v417.z.literal("code_interpreter_call"),
3426
+ id: import_v417.z.string(),
3427
+ code: import_v417.z.string().nullable(),
3428
+ container_id: import_v417.z.string(),
3429
+ outputs: import_v417.z.array(
3430
+ import_v417.z.discriminatedUnion("type", [
3431
+ import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
3432
+ import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
3317
3433
  ])
3318
3434
  ).nullable()
3319
3435
  }),
3320
- import_v416.z.object({
3321
- type: import_v416.z.literal("image_generation_call"),
3322
- id: import_v416.z.string(),
3323
- result: import_v416.z.string()
3436
+ import_v417.z.object({
3437
+ type: import_v417.z.literal("image_generation_call"),
3438
+ id: import_v417.z.string(),
3439
+ result: import_v417.z.string()
3324
3440
  }),
3325
- import_v416.z.object({
3326
- type: import_v416.z.literal("web_search_call"),
3327
- id: import_v416.z.string(),
3328
- status: import_v416.z.string(),
3329
- action: import_v416.z.discriminatedUnion("type", [
3330
- import_v416.z.object({
3331
- type: import_v416.z.literal("search"),
3332
- query: import_v416.z.string().nullish(),
3333
- sources: import_v416.z.array(
3334
- import_v416.z.discriminatedUnion("type", [
3335
- import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
3336
- import_v416.z.object({ type: import_v416.z.literal("api"), name: import_v416.z.string() })
3441
+ import_v417.z.object({
3442
+ type: import_v417.z.literal("web_search_call"),
3443
+ id: import_v417.z.string(),
3444
+ status: import_v417.z.string(),
3445
+ action: import_v417.z.discriminatedUnion("type", [
3446
+ import_v417.z.object({
3447
+ type: import_v417.z.literal("search"),
3448
+ query: import_v417.z.string().nullish(),
3449
+ sources: import_v417.z.array(
3450
+ import_v417.z.discriminatedUnion("type", [
3451
+ import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
3452
+ import_v417.z.object({ type: import_v417.z.literal("api"), name: import_v417.z.string() })
3337
3453
  ])
3338
3454
  ).nullish()
3339
3455
  }),
3340
- import_v416.z.object({
3341
- type: import_v416.z.literal("open_page"),
3342
- url: import_v416.z.string().nullish()
3456
+ import_v417.z.object({
3457
+ type: import_v417.z.literal("open_page"),
3458
+ url: import_v417.z.string().nullish()
3343
3459
  }),
3344
- import_v416.z.object({
3345
- type: import_v416.z.literal("find_in_page"),
3346
- url: import_v416.z.string().nullish(),
3347
- pattern: import_v416.z.string().nullish()
3460
+ import_v417.z.object({
3461
+ type: import_v417.z.literal("find_in_page"),
3462
+ url: import_v417.z.string().nullish(),
3463
+ pattern: import_v417.z.string().nullish()
3348
3464
  })
3349
3465
  ]).nullish()
3350
3466
  }),
3351
- import_v416.z.object({
3352
- type: import_v416.z.literal("file_search_call"),
3353
- id: import_v416.z.string(),
3354
- queries: import_v416.z.array(import_v416.z.string()),
3355
- results: import_v416.z.array(
3356
- import_v416.z.object({
3357
- attributes: import_v416.z.record(
3358
- import_v416.z.string(),
3359
- import_v416.z.union([import_v416.z.string(), import_v416.z.number(), import_v416.z.boolean()])
3467
+ import_v417.z.object({
3468
+ type: import_v417.z.literal("file_search_call"),
3469
+ id: import_v417.z.string(),
3470
+ queries: import_v417.z.array(import_v417.z.string()),
3471
+ results: import_v417.z.array(
3472
+ import_v417.z.object({
3473
+ attributes: import_v417.z.record(
3474
+ import_v417.z.string(),
3475
+ import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
3360
3476
  ),
3361
- file_id: import_v416.z.string(),
3362
- filename: import_v416.z.string(),
3363
- score: import_v416.z.number(),
3364
- text: import_v416.z.string()
3477
+ file_id: import_v417.z.string(),
3478
+ filename: import_v417.z.string(),
3479
+ score: import_v417.z.number(),
3480
+ text: import_v417.z.string()
3365
3481
  })
3366
3482
  ).nullish()
3367
3483
  }),
3368
- import_v416.z.object({
3369
- type: import_v416.z.literal("local_shell_call"),
3370
- id: import_v416.z.string(),
3371
- call_id: import_v416.z.string(),
3372
- action: import_v416.z.object({
3373
- type: import_v416.z.literal("exec"),
3374
- command: import_v416.z.array(import_v416.z.string()),
3375
- timeout_ms: import_v416.z.number().optional(),
3376
- user: import_v416.z.string().optional(),
3377
- working_directory: import_v416.z.string().optional(),
3378
- env: import_v416.z.record(import_v416.z.string(), import_v416.z.string()).optional()
3484
+ import_v417.z.object({
3485
+ type: import_v417.z.literal("local_shell_call"),
3486
+ id: import_v417.z.string(),
3487
+ call_id: import_v417.z.string(),
3488
+ action: import_v417.z.object({
3489
+ type: import_v417.z.literal("exec"),
3490
+ command: import_v417.z.array(import_v417.z.string()),
3491
+ timeout_ms: import_v417.z.number().optional(),
3492
+ user: import_v417.z.string().optional(),
3493
+ working_directory: import_v417.z.string().optional(),
3494
+ env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
3379
3495
  })
3380
3496
  }),
3381
- import_v416.z.object({
3382
- type: import_v416.z.literal("computer_call"),
3383
- id: import_v416.z.string(),
3384
- status: import_v416.z.literal("completed")
3497
+ import_v417.z.object({
3498
+ type: import_v417.z.literal("computer_call"),
3499
+ id: import_v417.z.string(),
3500
+ status: import_v417.z.literal("completed")
3385
3501
  }),
3386
- import_v416.z.object({
3387
- type: import_v416.z.literal("mcp_call"),
3388
- id: import_v416.z.string(),
3389
- status: import_v416.z.string(),
3390
- arguments: import_v416.z.string(),
3391
- name: import_v416.z.string(),
3392
- server_label: import_v416.z.string(),
3393
- output: import_v416.z.string().nullish(),
3394
- error: import_v416.z.union([
3395
- import_v416.z.string(),
3396
- import_v416.z.object({
3397
- type: import_v416.z.string().optional(),
3398
- code: import_v416.z.union([import_v416.z.number(), import_v416.z.string()]).optional(),
3399
- message: import_v416.z.string().optional()
3502
+ import_v417.z.object({
3503
+ type: import_v417.z.literal("mcp_call"),
3504
+ id: import_v417.z.string(),
3505
+ status: import_v417.z.string(),
3506
+ arguments: import_v417.z.string(),
3507
+ name: import_v417.z.string(),
3508
+ server_label: import_v417.z.string(),
3509
+ output: import_v417.z.string().nullish(),
3510
+ error: import_v417.z.union([
3511
+ import_v417.z.string(),
3512
+ import_v417.z.object({
3513
+ type: import_v417.z.string().optional(),
3514
+ code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
3515
+ message: import_v417.z.string().optional()
3400
3516
  }).loose()
3401
3517
  ]).nullish(),
3402
- approval_request_id: import_v416.z.string().nullish()
3518
+ approval_request_id: import_v417.z.string().nullish()
3403
3519
  }),
3404
- import_v416.z.object({
3405
- type: import_v416.z.literal("mcp_list_tools"),
3406
- id: import_v416.z.string(),
3407
- server_label: import_v416.z.string(),
3408
- tools: import_v416.z.array(
3409
- import_v416.z.object({
3410
- name: import_v416.z.string(),
3411
- description: import_v416.z.string().optional(),
3412
- input_schema: import_v416.z.any(),
3413
- annotations: import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()).optional()
3520
+ import_v417.z.object({
3521
+ type: import_v417.z.literal("mcp_list_tools"),
3522
+ id: import_v417.z.string(),
3523
+ server_label: import_v417.z.string(),
3524
+ tools: import_v417.z.array(
3525
+ import_v417.z.object({
3526
+ name: import_v417.z.string(),
3527
+ description: import_v417.z.string().optional(),
3528
+ input_schema: import_v417.z.any(),
3529
+ annotations: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
3414
3530
  })
3415
3531
  ),
3416
- error: import_v416.z.union([
3417
- import_v416.z.string(),
3418
- import_v416.z.object({
3419
- type: import_v416.z.string().optional(),
3420
- code: import_v416.z.union([import_v416.z.number(), import_v416.z.string()]).optional(),
3421
- message: import_v416.z.string().optional()
3532
+ error: import_v417.z.union([
3533
+ import_v417.z.string(),
3534
+ import_v417.z.object({
3535
+ type: import_v417.z.string().optional(),
3536
+ code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
3537
+ message: import_v417.z.string().optional()
3422
3538
  }).loose()
3423
3539
  ]).optional()
3424
3540
  }),
3425
- import_v416.z.object({
3426
- type: import_v416.z.literal("mcp_approval_request"),
3427
- id: import_v416.z.string(),
3428
- server_label: import_v416.z.string(),
3429
- name: import_v416.z.string(),
3430
- arguments: import_v416.z.string(),
3431
- approval_request_id: import_v416.z.string().optional()
3541
+ import_v417.z.object({
3542
+ type: import_v417.z.literal("mcp_approval_request"),
3543
+ id: import_v417.z.string(),
3544
+ server_label: import_v417.z.string(),
3545
+ name: import_v417.z.string(),
3546
+ arguments: import_v417.z.string(),
3547
+ approval_request_id: import_v417.z.string().optional()
3432
3548
  }),
3433
- import_v416.z.object({
3434
- type: import_v416.z.literal("apply_patch_call"),
3435
- id: import_v416.z.string(),
3436
- call_id: import_v416.z.string(),
3437
- status: import_v416.z.enum(["in_progress", "completed"]),
3438
- operation: import_v416.z.discriminatedUnion("type", [
3439
- import_v416.z.object({
3440
- type: import_v416.z.literal("create_file"),
3441
- path: import_v416.z.string(),
3442
- diff: import_v416.z.string()
3549
+ import_v417.z.object({
3550
+ type: import_v417.z.literal("apply_patch_call"),
3551
+ id: import_v417.z.string(),
3552
+ call_id: import_v417.z.string(),
3553
+ status: import_v417.z.enum(["in_progress", "completed"]),
3554
+ operation: import_v417.z.discriminatedUnion("type", [
3555
+ import_v417.z.object({
3556
+ type: import_v417.z.literal("create_file"),
3557
+ path: import_v417.z.string(),
3558
+ diff: import_v417.z.string()
3443
3559
  }),
3444
- import_v416.z.object({
3445
- type: import_v416.z.literal("delete_file"),
3446
- path: import_v416.z.string()
3560
+ import_v417.z.object({
3561
+ type: import_v417.z.literal("delete_file"),
3562
+ path: import_v417.z.string()
3447
3563
  }),
3448
- import_v416.z.object({
3449
- type: import_v416.z.literal("update_file"),
3450
- path: import_v416.z.string(),
3451
- diff: import_v416.z.string()
3564
+ import_v417.z.object({
3565
+ type: import_v417.z.literal("update_file"),
3566
+ path: import_v417.z.string(),
3567
+ diff: import_v417.z.string()
3452
3568
  })
3453
3569
  ])
3454
3570
  }),
3455
- import_v416.z.object({
3456
- type: import_v416.z.literal("shell_call"),
3457
- id: import_v416.z.string(),
3458
- call_id: import_v416.z.string(),
3459
- status: import_v416.z.enum(["in_progress", "completed", "incomplete"]),
3460
- action: import_v416.z.object({
3461
- commands: import_v416.z.array(import_v416.z.string())
3571
+ import_v417.z.object({
3572
+ type: import_v417.z.literal("shell_call"),
3573
+ id: import_v417.z.string(),
3574
+ call_id: import_v417.z.string(),
3575
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3576
+ action: import_v417.z.object({
3577
+ commands: import_v417.z.array(import_v417.z.string())
3462
3578
  })
3463
3579
  }),
3464
- import_v416.z.object({
3465
- type: import_v416.z.literal("shell_call_output"),
3466
- id: import_v416.z.string(),
3467
- call_id: import_v416.z.string(),
3468
- status: import_v416.z.enum(["in_progress", "completed", "incomplete"]),
3469
- output: import_v416.z.array(
3470
- import_v416.z.object({
3471
- stdout: import_v416.z.string(),
3472
- stderr: import_v416.z.string(),
3473
- outcome: import_v416.z.discriminatedUnion("type", [
3474
- import_v416.z.object({ type: import_v416.z.literal("timeout") }),
3475
- import_v416.z.object({
3476
- type: import_v416.z.literal("exit"),
3477
- exit_code: import_v416.z.number()
3580
+ import_v417.z.object({
3581
+ type: import_v417.z.literal("shell_call_output"),
3582
+ id: import_v417.z.string(),
3583
+ call_id: import_v417.z.string(),
3584
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3585
+ output: import_v417.z.array(
3586
+ import_v417.z.object({
3587
+ stdout: import_v417.z.string(),
3588
+ stderr: import_v417.z.string(),
3589
+ outcome: import_v417.z.discriminatedUnion("type", [
3590
+ import_v417.z.object({ type: import_v417.z.literal("timeout") }),
3591
+ import_v417.z.object({
3592
+ type: import_v417.z.literal("exit"),
3593
+ exit_code: import_v417.z.number()
3478
3594
  })
3479
3595
  ])
3480
3596
  })
3481
3597
  )
3598
+ }),
3599
+ import_v417.z.object({
3600
+ type: import_v417.z.literal("tool_search_call"),
3601
+ id: import_v417.z.string(),
3602
+ execution: import_v417.z.enum(["server", "client"]),
3603
+ call_id: import_v417.z.string().nullable(),
3604
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3605
+ arguments: import_v417.z.unknown()
3606
+ }),
3607
+ import_v417.z.object({
3608
+ type: import_v417.z.literal("tool_search_output"),
3609
+ id: import_v417.z.string(),
3610
+ execution: import_v417.z.enum(["server", "client"]),
3611
+ call_id: import_v417.z.string().nullable(),
3612
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3613
+ tools: import_v417.z.array(import_v417.z.record(import_v417.z.string(), jsonValueSchema.optional()))
3482
3614
  })
3483
3615
  ])
3484
3616
  }),
3485
- import_v416.z.object({
3486
- type: import_v416.z.literal("response.function_call_arguments.delta"),
3487
- item_id: import_v416.z.string(),
3488
- output_index: import_v416.z.number(),
3489
- delta: import_v416.z.string()
3617
+ import_v417.z.object({
3618
+ type: import_v417.z.literal("response.function_call_arguments.delta"),
3619
+ item_id: import_v417.z.string(),
3620
+ output_index: import_v417.z.number(),
3621
+ delta: import_v417.z.string()
3490
3622
  }),
3491
- import_v416.z.object({
3492
- type: import_v416.z.literal("response.custom_tool_call_input.delta"),
3493
- item_id: import_v416.z.string(),
3494
- output_index: import_v416.z.number(),
3495
- delta: import_v416.z.string()
3623
+ import_v417.z.object({
3624
+ type: import_v417.z.literal("response.custom_tool_call_input.delta"),
3625
+ item_id: import_v417.z.string(),
3626
+ output_index: import_v417.z.number(),
3627
+ delta: import_v417.z.string()
3496
3628
  }),
3497
- import_v416.z.object({
3498
- type: import_v416.z.literal("response.image_generation_call.partial_image"),
3499
- item_id: import_v416.z.string(),
3500
- output_index: import_v416.z.number(),
3501
- partial_image_b64: import_v416.z.string()
3629
+ import_v417.z.object({
3630
+ type: import_v417.z.literal("response.image_generation_call.partial_image"),
3631
+ item_id: import_v417.z.string(),
3632
+ output_index: import_v417.z.number(),
3633
+ partial_image_b64: import_v417.z.string()
3502
3634
  }),
3503
- import_v416.z.object({
3504
- type: import_v416.z.literal("response.code_interpreter_call_code.delta"),
3505
- item_id: import_v416.z.string(),
3506
- output_index: import_v416.z.number(),
3507
- delta: import_v416.z.string()
3635
+ import_v417.z.object({
3636
+ type: import_v417.z.literal("response.code_interpreter_call_code.delta"),
3637
+ item_id: import_v417.z.string(),
3638
+ output_index: import_v417.z.number(),
3639
+ delta: import_v417.z.string()
3508
3640
  }),
3509
- import_v416.z.object({
3510
- type: import_v416.z.literal("response.code_interpreter_call_code.done"),
3511
- item_id: import_v416.z.string(),
3512
- output_index: import_v416.z.number(),
3513
- code: import_v416.z.string()
3641
+ import_v417.z.object({
3642
+ type: import_v417.z.literal("response.code_interpreter_call_code.done"),
3643
+ item_id: import_v417.z.string(),
3644
+ output_index: import_v417.z.number(),
3645
+ code: import_v417.z.string()
3514
3646
  }),
3515
- import_v416.z.object({
3516
- type: import_v416.z.literal("response.output_text.annotation.added"),
3517
- annotation: import_v416.z.discriminatedUnion("type", [
3518
- import_v416.z.object({
3519
- type: import_v416.z.literal("url_citation"),
3520
- start_index: import_v416.z.number(),
3521
- end_index: import_v416.z.number(),
3522
- url: import_v416.z.string(),
3523
- title: import_v416.z.string()
3647
+ import_v417.z.object({
3648
+ type: import_v417.z.literal("response.output_text.annotation.added"),
3649
+ annotation: import_v417.z.discriminatedUnion("type", [
3650
+ import_v417.z.object({
3651
+ type: import_v417.z.literal("url_citation"),
3652
+ start_index: import_v417.z.number(),
3653
+ end_index: import_v417.z.number(),
3654
+ url: import_v417.z.string(),
3655
+ title: import_v417.z.string()
3524
3656
  }),
3525
- import_v416.z.object({
3526
- type: import_v416.z.literal("file_citation"),
3527
- file_id: import_v416.z.string(),
3528
- filename: import_v416.z.string(),
3529
- index: import_v416.z.number()
3657
+ import_v417.z.object({
3658
+ type: import_v417.z.literal("file_citation"),
3659
+ file_id: import_v417.z.string(),
3660
+ filename: import_v417.z.string(),
3661
+ index: import_v417.z.number()
3530
3662
  }),
3531
- import_v416.z.object({
3532
- type: import_v416.z.literal("container_file_citation"),
3533
- container_id: import_v416.z.string(),
3534
- file_id: import_v416.z.string(),
3535
- filename: import_v416.z.string(),
3536
- start_index: import_v416.z.number(),
3537
- end_index: import_v416.z.number()
3663
+ import_v417.z.object({
3664
+ type: import_v417.z.literal("container_file_citation"),
3665
+ container_id: import_v417.z.string(),
3666
+ file_id: import_v417.z.string(),
3667
+ filename: import_v417.z.string(),
3668
+ start_index: import_v417.z.number(),
3669
+ end_index: import_v417.z.number()
3538
3670
  }),
3539
- import_v416.z.object({
3540
- type: import_v416.z.literal("file_path"),
3541
- file_id: import_v416.z.string(),
3542
- index: import_v416.z.number()
3671
+ import_v417.z.object({
3672
+ type: import_v417.z.literal("file_path"),
3673
+ file_id: import_v417.z.string(),
3674
+ index: import_v417.z.number()
3543
3675
  })
3544
3676
  ])
3545
3677
  }),
3546
- import_v416.z.object({
3547
- type: import_v416.z.literal("response.reasoning_summary_part.added"),
3548
- item_id: import_v416.z.string(),
3549
- summary_index: import_v416.z.number()
3678
+ import_v417.z.object({
3679
+ type: import_v417.z.literal("response.reasoning_summary_part.added"),
3680
+ item_id: import_v417.z.string(),
3681
+ summary_index: import_v417.z.number()
3550
3682
  }),
3551
- import_v416.z.object({
3552
- type: import_v416.z.literal("response.reasoning_summary_text.delta"),
3553
- item_id: import_v416.z.string(),
3554
- summary_index: import_v416.z.number(),
3555
- delta: import_v416.z.string()
3683
+ import_v417.z.object({
3684
+ type: import_v417.z.literal("response.reasoning_summary_text.delta"),
3685
+ item_id: import_v417.z.string(),
3686
+ summary_index: import_v417.z.number(),
3687
+ delta: import_v417.z.string()
3556
3688
  }),
3557
- import_v416.z.object({
3558
- type: import_v416.z.literal("response.reasoning_summary_part.done"),
3559
- item_id: import_v416.z.string(),
3560
- summary_index: import_v416.z.number()
3689
+ import_v417.z.object({
3690
+ type: import_v417.z.literal("response.reasoning_summary_part.done"),
3691
+ item_id: import_v417.z.string(),
3692
+ summary_index: import_v417.z.number()
3561
3693
  }),
3562
- import_v416.z.object({
3563
- type: import_v416.z.literal("response.apply_patch_call_operation_diff.delta"),
3564
- item_id: import_v416.z.string(),
3565
- output_index: import_v416.z.number(),
3566
- delta: import_v416.z.string(),
3567
- obfuscation: import_v416.z.string().nullish()
3694
+ import_v417.z.object({
3695
+ type: import_v417.z.literal("response.apply_patch_call_operation_diff.delta"),
3696
+ item_id: import_v417.z.string(),
3697
+ output_index: import_v417.z.number(),
3698
+ delta: import_v417.z.string(),
3699
+ obfuscation: import_v417.z.string().nullish()
3568
3700
  }),
3569
- import_v416.z.object({
3570
- type: import_v416.z.literal("response.apply_patch_call_operation_diff.done"),
3571
- item_id: import_v416.z.string(),
3572
- output_index: import_v416.z.number(),
3573
- diff: import_v416.z.string()
3701
+ import_v417.z.object({
3702
+ type: import_v417.z.literal("response.apply_patch_call_operation_diff.done"),
3703
+ item_id: import_v417.z.string(),
3704
+ output_index: import_v417.z.number(),
3705
+ diff: import_v417.z.string()
3574
3706
  }),
3575
- import_v416.z.object({
3576
- type: import_v416.z.literal("error"),
3577
- sequence_number: import_v416.z.number(),
3578
- error: import_v416.z.object({
3579
- type: import_v416.z.string(),
3580
- code: import_v416.z.string(),
3581
- message: import_v416.z.string(),
3582
- param: import_v416.z.string().nullish()
3707
+ import_v417.z.object({
3708
+ type: import_v417.z.literal("error"),
3709
+ sequence_number: import_v417.z.number(),
3710
+ error: import_v417.z.object({
3711
+ type: import_v417.z.string(),
3712
+ code: import_v417.z.string(),
3713
+ message: import_v417.z.string(),
3714
+ param: import_v417.z.string().nullish()
3583
3715
  })
3584
3716
  }),
3585
- import_v416.z.object({ type: import_v416.z.string() }).loose().transform((value) => ({
3717
+ import_v417.z.object({ type: import_v417.z.string() }).loose().transform((value) => ({
3586
3718
  type: "unknown_chunk",
3587
3719
  message: value.type
3588
3720
  }))
@@ -3590,294 +3722,310 @@ var openaiResponsesChunkSchema = (0, import_provider_utils23.lazySchema)(
3590
3722
  ])
3591
3723
  )
3592
3724
  );
3593
- var openaiResponsesResponseSchema = (0, import_provider_utils23.lazySchema)(
3594
- () => (0, import_provider_utils23.zodSchema)(
3595
- import_v416.z.object({
3596
- id: import_v416.z.string().optional(),
3597
- created_at: import_v416.z.number().optional(),
3598
- error: import_v416.z.object({
3599
- message: import_v416.z.string(),
3600
- type: import_v416.z.string(),
3601
- param: import_v416.z.string().nullish(),
3602
- code: import_v416.z.string()
3725
+ var openaiResponsesResponseSchema = (0, import_provider_utils24.lazySchema)(
3726
+ () => (0, import_provider_utils24.zodSchema)(
3727
+ import_v417.z.object({
3728
+ id: import_v417.z.string().optional(),
3729
+ created_at: import_v417.z.number().optional(),
3730
+ error: import_v417.z.object({
3731
+ message: import_v417.z.string(),
3732
+ type: import_v417.z.string(),
3733
+ param: import_v417.z.string().nullish(),
3734
+ code: import_v417.z.string()
3603
3735
  }).nullish(),
3604
- model: import_v416.z.string().optional(),
3605
- output: import_v416.z.array(
3606
- import_v416.z.discriminatedUnion("type", [
3607
- import_v416.z.object({
3608
- type: import_v416.z.literal("message"),
3609
- role: import_v416.z.literal("assistant"),
3610
- id: import_v416.z.string(),
3611
- phase: import_v416.z.enum(["commentary", "final_answer"]).nullish(),
3612
- content: import_v416.z.array(
3613
- import_v416.z.object({
3614
- type: import_v416.z.literal("output_text"),
3615
- text: import_v416.z.string(),
3616
- logprobs: import_v416.z.array(
3617
- import_v416.z.object({
3618
- token: import_v416.z.string(),
3619
- logprob: import_v416.z.number(),
3620
- top_logprobs: import_v416.z.array(
3621
- import_v416.z.object({
3622
- token: import_v416.z.string(),
3623
- logprob: import_v416.z.number()
3736
+ model: import_v417.z.string().optional(),
3737
+ output: import_v417.z.array(
3738
+ import_v417.z.discriminatedUnion("type", [
3739
+ import_v417.z.object({
3740
+ type: import_v417.z.literal("message"),
3741
+ role: import_v417.z.literal("assistant"),
3742
+ id: import_v417.z.string(),
3743
+ phase: import_v417.z.enum(["commentary", "final_answer"]).nullish(),
3744
+ content: import_v417.z.array(
3745
+ import_v417.z.object({
3746
+ type: import_v417.z.literal("output_text"),
3747
+ text: import_v417.z.string(),
3748
+ logprobs: import_v417.z.array(
3749
+ import_v417.z.object({
3750
+ token: import_v417.z.string(),
3751
+ logprob: import_v417.z.number(),
3752
+ top_logprobs: import_v417.z.array(
3753
+ import_v417.z.object({
3754
+ token: import_v417.z.string(),
3755
+ logprob: import_v417.z.number()
3624
3756
  })
3625
3757
  )
3626
3758
  })
3627
3759
  ).nullish(),
3628
- annotations: import_v416.z.array(
3629
- import_v416.z.discriminatedUnion("type", [
3630
- import_v416.z.object({
3631
- type: import_v416.z.literal("url_citation"),
3632
- start_index: import_v416.z.number(),
3633
- end_index: import_v416.z.number(),
3634
- url: import_v416.z.string(),
3635
- title: import_v416.z.string()
3760
+ annotations: import_v417.z.array(
3761
+ import_v417.z.discriminatedUnion("type", [
3762
+ import_v417.z.object({
3763
+ type: import_v417.z.literal("url_citation"),
3764
+ start_index: import_v417.z.number(),
3765
+ end_index: import_v417.z.number(),
3766
+ url: import_v417.z.string(),
3767
+ title: import_v417.z.string()
3636
3768
  }),
3637
- import_v416.z.object({
3638
- type: import_v416.z.literal("file_citation"),
3639
- file_id: import_v416.z.string(),
3640
- filename: import_v416.z.string(),
3641
- index: import_v416.z.number()
3769
+ import_v417.z.object({
3770
+ type: import_v417.z.literal("file_citation"),
3771
+ file_id: import_v417.z.string(),
3772
+ filename: import_v417.z.string(),
3773
+ index: import_v417.z.number()
3642
3774
  }),
3643
- import_v416.z.object({
3644
- type: import_v416.z.literal("container_file_citation"),
3645
- container_id: import_v416.z.string(),
3646
- file_id: import_v416.z.string(),
3647
- filename: import_v416.z.string(),
3648
- start_index: import_v416.z.number(),
3649
- end_index: import_v416.z.number()
3775
+ import_v417.z.object({
3776
+ type: import_v417.z.literal("container_file_citation"),
3777
+ container_id: import_v417.z.string(),
3778
+ file_id: import_v417.z.string(),
3779
+ filename: import_v417.z.string(),
3780
+ start_index: import_v417.z.number(),
3781
+ end_index: import_v417.z.number()
3650
3782
  }),
3651
- import_v416.z.object({
3652
- type: import_v416.z.literal("file_path"),
3653
- file_id: import_v416.z.string(),
3654
- index: import_v416.z.number()
3783
+ import_v417.z.object({
3784
+ type: import_v417.z.literal("file_path"),
3785
+ file_id: import_v417.z.string(),
3786
+ index: import_v417.z.number()
3655
3787
  })
3656
3788
  ])
3657
3789
  )
3658
3790
  })
3659
3791
  )
3660
3792
  }),
3661
- import_v416.z.object({
3662
- type: import_v416.z.literal("web_search_call"),
3663
- id: import_v416.z.string(),
3664
- status: import_v416.z.string(),
3665
- action: import_v416.z.discriminatedUnion("type", [
3666
- import_v416.z.object({
3667
- type: import_v416.z.literal("search"),
3668
- query: import_v416.z.string().nullish(),
3669
- sources: import_v416.z.array(
3670
- import_v416.z.discriminatedUnion("type", [
3671
- import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
3672
- import_v416.z.object({
3673
- type: import_v416.z.literal("api"),
3674
- name: import_v416.z.string()
3793
+ import_v417.z.object({
3794
+ type: import_v417.z.literal("web_search_call"),
3795
+ id: import_v417.z.string(),
3796
+ status: import_v417.z.string(),
3797
+ action: import_v417.z.discriminatedUnion("type", [
3798
+ import_v417.z.object({
3799
+ type: import_v417.z.literal("search"),
3800
+ query: import_v417.z.string().nullish(),
3801
+ sources: import_v417.z.array(
3802
+ import_v417.z.discriminatedUnion("type", [
3803
+ import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
3804
+ import_v417.z.object({
3805
+ type: import_v417.z.literal("api"),
3806
+ name: import_v417.z.string()
3675
3807
  })
3676
3808
  ])
3677
3809
  ).nullish()
3678
3810
  }),
3679
- import_v416.z.object({
3680
- type: import_v416.z.literal("open_page"),
3681
- url: import_v416.z.string().nullish()
3811
+ import_v417.z.object({
3812
+ type: import_v417.z.literal("open_page"),
3813
+ url: import_v417.z.string().nullish()
3682
3814
  }),
3683
- import_v416.z.object({
3684
- type: import_v416.z.literal("find_in_page"),
3685
- url: import_v416.z.string().nullish(),
3686
- pattern: import_v416.z.string().nullish()
3815
+ import_v417.z.object({
3816
+ type: import_v417.z.literal("find_in_page"),
3817
+ url: import_v417.z.string().nullish(),
3818
+ pattern: import_v417.z.string().nullish()
3687
3819
  })
3688
3820
  ]).nullish()
3689
3821
  }),
3690
- import_v416.z.object({
3691
- type: import_v416.z.literal("file_search_call"),
3692
- id: import_v416.z.string(),
3693
- queries: import_v416.z.array(import_v416.z.string()),
3694
- results: import_v416.z.array(
3695
- import_v416.z.object({
3696
- attributes: import_v416.z.record(
3697
- import_v416.z.string(),
3698
- import_v416.z.union([import_v416.z.string(), import_v416.z.number(), import_v416.z.boolean()])
3822
+ import_v417.z.object({
3823
+ type: import_v417.z.literal("file_search_call"),
3824
+ id: import_v417.z.string(),
3825
+ queries: import_v417.z.array(import_v417.z.string()),
3826
+ results: import_v417.z.array(
3827
+ import_v417.z.object({
3828
+ attributes: import_v417.z.record(
3829
+ import_v417.z.string(),
3830
+ import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
3699
3831
  ),
3700
- file_id: import_v416.z.string(),
3701
- filename: import_v416.z.string(),
3702
- score: import_v416.z.number(),
3703
- text: import_v416.z.string()
3832
+ file_id: import_v417.z.string(),
3833
+ filename: import_v417.z.string(),
3834
+ score: import_v417.z.number(),
3835
+ text: import_v417.z.string()
3704
3836
  })
3705
3837
  ).nullish()
3706
3838
  }),
3707
- import_v416.z.object({
3708
- type: import_v416.z.literal("code_interpreter_call"),
3709
- id: import_v416.z.string(),
3710
- code: import_v416.z.string().nullable(),
3711
- container_id: import_v416.z.string(),
3712
- outputs: import_v416.z.array(
3713
- import_v416.z.discriminatedUnion("type", [
3714
- import_v416.z.object({ type: import_v416.z.literal("logs"), logs: import_v416.z.string() }),
3715
- import_v416.z.object({ type: import_v416.z.literal("image"), url: import_v416.z.string() })
3839
+ import_v417.z.object({
3840
+ type: import_v417.z.literal("code_interpreter_call"),
3841
+ id: import_v417.z.string(),
3842
+ code: import_v417.z.string().nullable(),
3843
+ container_id: import_v417.z.string(),
3844
+ outputs: import_v417.z.array(
3845
+ import_v417.z.discriminatedUnion("type", [
3846
+ import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
3847
+ import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
3716
3848
  ])
3717
3849
  ).nullable()
3718
3850
  }),
3719
- import_v416.z.object({
3720
- type: import_v416.z.literal("image_generation_call"),
3721
- id: import_v416.z.string(),
3722
- result: import_v416.z.string()
3851
+ import_v417.z.object({
3852
+ type: import_v417.z.literal("image_generation_call"),
3853
+ id: import_v417.z.string(),
3854
+ result: import_v417.z.string()
3723
3855
  }),
3724
- import_v416.z.object({
3725
- type: import_v416.z.literal("local_shell_call"),
3726
- id: import_v416.z.string(),
3727
- call_id: import_v416.z.string(),
3728
- action: import_v416.z.object({
3729
- type: import_v416.z.literal("exec"),
3730
- command: import_v416.z.array(import_v416.z.string()),
3731
- timeout_ms: import_v416.z.number().optional(),
3732
- user: import_v416.z.string().optional(),
3733
- working_directory: import_v416.z.string().optional(),
3734
- env: import_v416.z.record(import_v416.z.string(), import_v416.z.string()).optional()
3856
+ import_v417.z.object({
3857
+ type: import_v417.z.literal("local_shell_call"),
3858
+ id: import_v417.z.string(),
3859
+ call_id: import_v417.z.string(),
3860
+ action: import_v417.z.object({
3861
+ type: import_v417.z.literal("exec"),
3862
+ command: import_v417.z.array(import_v417.z.string()),
3863
+ timeout_ms: import_v417.z.number().optional(),
3864
+ user: import_v417.z.string().optional(),
3865
+ working_directory: import_v417.z.string().optional(),
3866
+ env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
3735
3867
  })
3736
3868
  }),
3737
- import_v416.z.object({
3738
- type: import_v416.z.literal("function_call"),
3739
- call_id: import_v416.z.string(),
3740
- name: import_v416.z.string(),
3741
- arguments: import_v416.z.string(),
3742
- id: import_v416.z.string()
3869
+ import_v417.z.object({
3870
+ type: import_v417.z.literal("function_call"),
3871
+ call_id: import_v417.z.string(),
3872
+ name: import_v417.z.string(),
3873
+ arguments: import_v417.z.string(),
3874
+ id: import_v417.z.string()
3743
3875
  }),
3744
- import_v416.z.object({
3745
- type: import_v416.z.literal("custom_tool_call"),
3746
- call_id: import_v416.z.string(),
3747
- name: import_v416.z.string(),
3748
- input: import_v416.z.string(),
3749
- id: import_v416.z.string()
3876
+ import_v417.z.object({
3877
+ type: import_v417.z.literal("custom_tool_call"),
3878
+ call_id: import_v417.z.string(),
3879
+ name: import_v417.z.string(),
3880
+ input: import_v417.z.string(),
3881
+ id: import_v417.z.string()
3750
3882
  }),
3751
- import_v416.z.object({
3752
- type: import_v416.z.literal("computer_call"),
3753
- id: import_v416.z.string(),
3754
- status: import_v416.z.string().optional()
3883
+ import_v417.z.object({
3884
+ type: import_v417.z.literal("computer_call"),
3885
+ id: import_v417.z.string(),
3886
+ status: import_v417.z.string().optional()
3755
3887
  }),
3756
- import_v416.z.object({
3757
- type: import_v416.z.literal("reasoning"),
3758
- id: import_v416.z.string(),
3759
- encrypted_content: import_v416.z.string().nullish(),
3760
- summary: import_v416.z.array(
3761
- import_v416.z.object({
3762
- type: import_v416.z.literal("summary_text"),
3763
- text: import_v416.z.string()
3888
+ import_v417.z.object({
3889
+ type: import_v417.z.literal("reasoning"),
3890
+ id: import_v417.z.string(),
3891
+ encrypted_content: import_v417.z.string().nullish(),
3892
+ summary: import_v417.z.array(
3893
+ import_v417.z.object({
3894
+ type: import_v417.z.literal("summary_text"),
3895
+ text: import_v417.z.string()
3764
3896
  })
3765
3897
  )
3766
3898
  }),
3767
- import_v416.z.object({
3768
- type: import_v416.z.literal("mcp_call"),
3769
- id: import_v416.z.string(),
3770
- status: import_v416.z.string(),
3771
- arguments: import_v416.z.string(),
3772
- name: import_v416.z.string(),
3773
- server_label: import_v416.z.string(),
3774
- output: import_v416.z.string().nullish(),
3775
- error: import_v416.z.union([
3776
- import_v416.z.string(),
3777
- import_v416.z.object({
3778
- type: import_v416.z.string().optional(),
3779
- code: import_v416.z.union([import_v416.z.number(), import_v416.z.string()]).optional(),
3780
- message: import_v416.z.string().optional()
3899
+ import_v417.z.object({
3900
+ type: import_v417.z.literal("mcp_call"),
3901
+ id: import_v417.z.string(),
3902
+ status: import_v417.z.string(),
3903
+ arguments: import_v417.z.string(),
3904
+ name: import_v417.z.string(),
3905
+ server_label: import_v417.z.string(),
3906
+ output: import_v417.z.string().nullish(),
3907
+ error: import_v417.z.union([
3908
+ import_v417.z.string(),
3909
+ import_v417.z.object({
3910
+ type: import_v417.z.string().optional(),
3911
+ code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
3912
+ message: import_v417.z.string().optional()
3781
3913
  }).loose()
3782
3914
  ]).nullish(),
3783
- approval_request_id: import_v416.z.string().nullish()
3915
+ approval_request_id: import_v417.z.string().nullish()
3784
3916
  }),
3785
- import_v416.z.object({
3786
- type: import_v416.z.literal("mcp_list_tools"),
3787
- id: import_v416.z.string(),
3788
- server_label: import_v416.z.string(),
3789
- tools: import_v416.z.array(
3790
- import_v416.z.object({
3791
- name: import_v416.z.string(),
3792
- description: import_v416.z.string().optional(),
3793
- input_schema: import_v416.z.any(),
3794
- annotations: import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()).optional()
3917
+ import_v417.z.object({
3918
+ type: import_v417.z.literal("mcp_list_tools"),
3919
+ id: import_v417.z.string(),
3920
+ server_label: import_v417.z.string(),
3921
+ tools: import_v417.z.array(
3922
+ import_v417.z.object({
3923
+ name: import_v417.z.string(),
3924
+ description: import_v417.z.string().optional(),
3925
+ input_schema: import_v417.z.any(),
3926
+ annotations: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
3795
3927
  })
3796
3928
  ),
3797
- error: import_v416.z.union([
3798
- import_v416.z.string(),
3799
- import_v416.z.object({
3800
- type: import_v416.z.string().optional(),
3801
- code: import_v416.z.union([import_v416.z.number(), import_v416.z.string()]).optional(),
3802
- message: import_v416.z.string().optional()
3929
+ error: import_v417.z.union([
3930
+ import_v417.z.string(),
3931
+ import_v417.z.object({
3932
+ type: import_v417.z.string().optional(),
3933
+ code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
3934
+ message: import_v417.z.string().optional()
3803
3935
  }).loose()
3804
3936
  ]).optional()
3805
3937
  }),
3806
- import_v416.z.object({
3807
- type: import_v416.z.literal("mcp_approval_request"),
3808
- id: import_v416.z.string(),
3809
- server_label: import_v416.z.string(),
3810
- name: import_v416.z.string(),
3811
- arguments: import_v416.z.string(),
3812
- approval_request_id: import_v416.z.string().optional()
3938
+ import_v417.z.object({
3939
+ type: import_v417.z.literal("mcp_approval_request"),
3940
+ id: import_v417.z.string(),
3941
+ server_label: import_v417.z.string(),
3942
+ name: import_v417.z.string(),
3943
+ arguments: import_v417.z.string(),
3944
+ approval_request_id: import_v417.z.string().optional()
3813
3945
  }),
3814
- import_v416.z.object({
3815
- type: import_v416.z.literal("apply_patch_call"),
3816
- id: import_v416.z.string(),
3817
- call_id: import_v416.z.string(),
3818
- status: import_v416.z.enum(["in_progress", "completed"]),
3819
- operation: import_v416.z.discriminatedUnion("type", [
3820
- import_v416.z.object({
3821
- type: import_v416.z.literal("create_file"),
3822
- path: import_v416.z.string(),
3823
- diff: import_v416.z.string()
3946
+ import_v417.z.object({
3947
+ type: import_v417.z.literal("apply_patch_call"),
3948
+ id: import_v417.z.string(),
3949
+ call_id: import_v417.z.string(),
3950
+ status: import_v417.z.enum(["in_progress", "completed"]),
3951
+ operation: import_v417.z.discriminatedUnion("type", [
3952
+ import_v417.z.object({
3953
+ type: import_v417.z.literal("create_file"),
3954
+ path: import_v417.z.string(),
3955
+ diff: import_v417.z.string()
3824
3956
  }),
3825
- import_v416.z.object({
3826
- type: import_v416.z.literal("delete_file"),
3827
- path: import_v416.z.string()
3957
+ import_v417.z.object({
3958
+ type: import_v417.z.literal("delete_file"),
3959
+ path: import_v417.z.string()
3828
3960
  }),
3829
- import_v416.z.object({
3830
- type: import_v416.z.literal("update_file"),
3831
- path: import_v416.z.string(),
3832
- diff: import_v416.z.string()
3961
+ import_v417.z.object({
3962
+ type: import_v417.z.literal("update_file"),
3963
+ path: import_v417.z.string(),
3964
+ diff: import_v417.z.string()
3833
3965
  })
3834
3966
  ])
3835
3967
  }),
3836
- import_v416.z.object({
3837
- type: import_v416.z.literal("shell_call"),
3838
- id: import_v416.z.string(),
3839
- call_id: import_v416.z.string(),
3840
- status: import_v416.z.enum(["in_progress", "completed", "incomplete"]),
3841
- action: import_v416.z.object({
3842
- commands: import_v416.z.array(import_v416.z.string())
3968
+ import_v417.z.object({
3969
+ type: import_v417.z.literal("shell_call"),
3970
+ id: import_v417.z.string(),
3971
+ call_id: import_v417.z.string(),
3972
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3973
+ action: import_v417.z.object({
3974
+ commands: import_v417.z.array(import_v417.z.string())
3843
3975
  })
3844
3976
  }),
3845
- import_v416.z.object({
3846
- type: import_v416.z.literal("shell_call_output"),
3847
- id: import_v416.z.string(),
3848
- call_id: import_v416.z.string(),
3849
- status: import_v416.z.enum(["in_progress", "completed", "incomplete"]),
3850
- output: import_v416.z.array(
3851
- import_v416.z.object({
3852
- stdout: import_v416.z.string(),
3853
- stderr: import_v416.z.string(),
3854
- outcome: import_v416.z.discriminatedUnion("type", [
3855
- import_v416.z.object({ type: import_v416.z.literal("timeout") }),
3856
- import_v416.z.object({
3857
- type: import_v416.z.literal("exit"),
3858
- exit_code: import_v416.z.number()
3977
+ import_v417.z.object({
3978
+ type: import_v417.z.literal("shell_call_output"),
3979
+ id: import_v417.z.string(),
3980
+ call_id: import_v417.z.string(),
3981
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
3982
+ output: import_v417.z.array(
3983
+ import_v417.z.object({
3984
+ stdout: import_v417.z.string(),
3985
+ stderr: import_v417.z.string(),
3986
+ outcome: import_v417.z.discriminatedUnion("type", [
3987
+ import_v417.z.object({ type: import_v417.z.literal("timeout") }),
3988
+ import_v417.z.object({
3989
+ type: import_v417.z.literal("exit"),
3990
+ exit_code: import_v417.z.number()
3859
3991
  })
3860
3992
  ])
3861
3993
  })
3862
3994
  )
3995
+ }),
3996
+ import_v417.z.object({
3997
+ type: import_v417.z.literal("tool_search_call"),
3998
+ id: import_v417.z.string(),
3999
+ execution: import_v417.z.enum(["server", "client"]),
4000
+ call_id: import_v417.z.string().nullable(),
4001
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
4002
+ arguments: import_v417.z.unknown()
4003
+ }),
4004
+ import_v417.z.object({
4005
+ type: import_v417.z.literal("tool_search_output"),
4006
+ id: import_v417.z.string(),
4007
+ execution: import_v417.z.enum(["server", "client"]),
4008
+ call_id: import_v417.z.string().nullable(),
4009
+ status: import_v417.z.enum(["in_progress", "completed", "incomplete"]),
4010
+ tools: import_v417.z.array(import_v417.z.record(import_v417.z.string(), jsonValueSchema.optional()))
3863
4011
  })
3864
4012
  ])
3865
4013
  ).optional(),
3866
- service_tier: import_v416.z.string().nullish(),
3867
- incomplete_details: import_v416.z.object({ reason: import_v416.z.string() }).nullish(),
3868
- usage: import_v416.z.object({
3869
- input_tokens: import_v416.z.number(),
3870
- input_tokens_details: import_v416.z.object({ cached_tokens: import_v416.z.number().nullish() }).nullish(),
3871
- output_tokens: import_v416.z.number(),
3872
- output_tokens_details: import_v416.z.object({ reasoning_tokens: import_v416.z.number().nullish() }).nullish()
4014
+ service_tier: import_v417.z.string().nullish(),
4015
+ incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
4016
+ usage: import_v417.z.object({
4017
+ input_tokens: import_v417.z.number(),
4018
+ input_tokens_details: import_v417.z.object({ cached_tokens: import_v417.z.number().nullish() }).nullish(),
4019
+ output_tokens: import_v417.z.number(),
4020
+ output_tokens_details: import_v417.z.object({ reasoning_tokens: import_v417.z.number().nullish() }).nullish()
3873
4021
  }).optional()
3874
4022
  })
3875
4023
  )
3876
4024
  );
3877
4025
 
3878
4026
  // src/responses/openai-responses-options.ts
3879
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
3880
- var import_v417 = require("zod/v4");
4027
+ var import_provider_utils25 = require("@ai-sdk/provider-utils");
4028
+ var import_v418 = require("zod/v4");
3881
4029
  var TOP_LOGPROBS_MAX = 20;
3882
4030
  var openaiResponsesReasoningModelIds = [
3883
4031
  "o1",
@@ -3906,11 +4054,12 @@ var openaiResponsesReasoningModelIds = [
3906
4054
  "gpt-5.2-chat-latest",
3907
4055
  "gpt-5.2-pro",
3908
4056
  "gpt-5.2-codex",
4057
+ "gpt-5.3-chat-latest",
4058
+ "gpt-5.3-codex",
3909
4059
  "gpt-5.4",
3910
4060
  "gpt-5.4-2026-03-05",
3911
4061
  "gpt-5.4-pro",
3912
- "gpt-5.4-pro-2026-03-05",
3913
- "gpt-5.3-codex"
4062
+ "gpt-5.4-pro-2026-03-05"
3914
4063
  ];
3915
4064
  var openaiResponsesModelIds = [
3916
4065
  "gpt-4.1",
@@ -3937,9 +4086,9 @@ var openaiResponsesModelIds = [
3937
4086
  "gpt-5-chat-latest",
3938
4087
  ...openaiResponsesReasoningModelIds
3939
4088
  ];
3940
- var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazySchema)(
3941
- () => (0, import_provider_utils24.zodSchema)(
3942
- import_v417.z.object({
4089
+ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazySchema)(
4090
+ () => (0, import_provider_utils25.zodSchema)(
4091
+ import_v418.z.object({
3943
4092
  /**
3944
4093
  * The ID of the OpenAI Conversation to continue.
3945
4094
  * You must create a conversation first via the OpenAI API.
@@ -3947,13 +4096,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
3947
4096
  * Defaults to `undefined`.
3948
4097
  * @see https://platform.openai.com/docs/api-reference/conversations/create
3949
4098
  */
3950
- conversation: import_v417.z.string().nullish(),
4099
+ conversation: import_v418.z.string().nullish(),
3951
4100
  /**
3952
4101
  * The set of extra fields to include in the response (advanced, usually not needed).
3953
4102
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
3954
4103
  */
3955
- include: import_v417.z.array(
3956
- import_v417.z.enum([
4104
+ include: import_v418.z.array(
4105
+ import_v418.z.enum([
3957
4106
  "reasoning.encrypted_content",
3958
4107
  // handled internally by default, only needed for unknown reasoning models
3959
4108
  "file_search_call.results",
@@ -3965,7 +4114,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
3965
4114
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
3966
4115
  * Defaults to `undefined`.
3967
4116
  */
3968
- instructions: import_v417.z.string().nullish(),
4117
+ instructions: import_v418.z.string().nullish(),
3969
4118
  /**
3970
4119
  * Return the log probabilities of the tokens. Including logprobs will increase
3971
4120
  * the response size and can slow down response times. However, it can
@@ -3980,30 +4129,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
3980
4129
  * @see https://platform.openai.com/docs/api-reference/responses/create
3981
4130
  * @see https://cookbook.openai.com/examples/using_logprobs
3982
4131
  */
3983
- logprobs: import_v417.z.union([import_v417.z.boolean(), import_v417.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4132
+ logprobs: import_v418.z.union([import_v418.z.boolean(), import_v418.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3984
4133
  /**
3985
4134
  * The maximum number of total calls to built-in tools that can be processed in a response.
3986
4135
  * This maximum number applies across all built-in tool calls, not per individual tool.
3987
4136
  * Any further attempts to call a tool by the model will be ignored.
3988
4137
  */
3989
- maxToolCalls: import_v417.z.number().nullish(),
4138
+ maxToolCalls: import_v418.z.number().nullish(),
3990
4139
  /**
3991
4140
  * Additional metadata to store with the generation.
3992
4141
  */
3993
- metadata: import_v417.z.any().nullish(),
4142
+ metadata: import_v418.z.any().nullish(),
3994
4143
  /**
3995
4144
  * Whether to use parallel tool calls. Defaults to `true`.
3996
4145
  */
3997
- parallelToolCalls: import_v417.z.boolean().nullish(),
4146
+ parallelToolCalls: import_v418.z.boolean().nullish(),
3998
4147
  /**
3999
4148
  * The ID of the previous response. You can use it to continue a conversation.
4000
4149
  * Defaults to `undefined`.
4001
4150
  */
4002
- previousResponseId: import_v417.z.string().nullish(),
4151
+ previousResponseId: import_v418.z.string().nullish(),
4003
4152
  /**
4004
4153
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
4005
4154
  */
4006
- promptCacheKey: import_v417.z.string().nullish(),
4155
+ promptCacheKey: import_v418.z.string().nullish(),
4007
4156
  /**
4008
4157
  * The retention policy for the prompt cache.
4009
4158
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -4012,7 +4161,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4012
4161
  *
4013
4162
  * @default 'in_memory'
4014
4163
  */
4015
- promptCacheRetention: import_v417.z.enum(["in_memory", "24h"]).nullish(),
4164
+ promptCacheRetention: import_v418.z.enum(["in_memory", "24h"]).nullish(),
4016
4165
  /**
4017
4166
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
4018
4167
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -4023,17 +4172,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4023
4172
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
4024
4173
  * an error.
4025
4174
  */
4026
- reasoningEffort: import_v417.z.string().nullish(),
4175
+ reasoningEffort: import_v418.z.string().nullish(),
4027
4176
  /**
4028
4177
  * Controls reasoning summary output from the model.
4029
4178
  * Set to "auto" to automatically receive the richest level available,
4030
4179
  * or "detailed" for comprehensive summaries.
4031
4180
  */
4032
- reasoningSummary: import_v417.z.string().nullish(),
4181
+ reasoningSummary: import_v418.z.string().nullish(),
4033
4182
  /**
4034
4183
  * The identifier for safety monitoring and tracking.
4035
4184
  */
4036
- safetyIdentifier: import_v417.z.string().nullish(),
4185
+ safetyIdentifier: import_v418.z.string().nullish(),
4037
4186
  /**
4038
4187
  * Service tier for the request.
4039
4188
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -4041,34 +4190,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4041
4190
  *
4042
4191
  * Defaults to 'auto'.
4043
4192
  */
4044
- serviceTier: import_v417.z.enum(["auto", "flex", "priority", "default"]).nullish(),
4193
+ serviceTier: import_v418.z.enum(["auto", "flex", "priority", "default"]).nullish(),
4045
4194
  /**
4046
4195
  * Whether to store the generation. Defaults to `true`.
4047
4196
  */
4048
- store: import_v417.z.boolean().nullish(),
4197
+ store: import_v418.z.boolean().nullish(),
4049
4198
  /**
4050
4199
  * Whether to use strict JSON schema validation.
4051
4200
  * Defaults to `true`.
4052
4201
  */
4053
- strictJsonSchema: import_v417.z.boolean().nullish(),
4202
+ strictJsonSchema: import_v418.z.boolean().nullish(),
4054
4203
  /**
4055
4204
  * Controls the verbosity of the model's responses. Lower values ('low') will result
4056
4205
  * in more concise responses, while higher values ('high') will result in more verbose responses.
4057
4206
  * Valid values: 'low', 'medium', 'high'.
4058
4207
  */
4059
- textVerbosity: import_v417.z.enum(["low", "medium", "high"]).nullish(),
4208
+ textVerbosity: import_v418.z.enum(["low", "medium", "high"]).nullish(),
4060
4209
  /**
4061
4210
  * Controls output truncation. 'auto' (default) performs truncation automatically;
4062
4211
  * 'disabled' turns truncation off.
4063
4212
  */
4064
- truncation: import_v417.z.enum(["auto", "disabled"]).nullish(),
4213
+ truncation: import_v418.z.enum(["auto", "disabled"]).nullish(),
4065
4214
  /**
4066
4215
  * A unique identifier representing your end-user, which can help OpenAI to
4067
4216
  * monitor and detect abuse.
4068
4217
  * Defaults to `undefined`.
4069
4218
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
4070
4219
  */
4071
- user: import_v417.z.string().nullish(),
4220
+ user: import_v418.z.string().nullish(),
4072
4221
  /**
4073
4222
  * Override the system message mode for this model.
4074
4223
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -4077,7 +4226,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4077
4226
  *
4078
4227
  * If not specified, the mode is automatically determined based on the model.
4079
4228
  */
4080
- systemMessageMode: import_v417.z.enum(["system", "developer", "remove"]).optional(),
4229
+ systemMessageMode: import_v418.z.enum(["system", "developer", "remove"]).optional(),
4081
4230
  /**
4082
4231
  * Force treating this model as a reasoning model.
4083
4232
  *
@@ -4087,51 +4236,51 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4087
4236
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
4088
4237
  * and defaults `systemMessageMode` to `developer` unless overridden.
4089
4238
  */
4090
- forceReasoning: import_v417.z.boolean().optional()
4239
+ forceReasoning: import_v418.z.boolean().optional()
4091
4240
  })
4092
4241
  )
4093
4242
  );
4094
4243
 
4095
4244
  // src/responses/openai-responses-prepare-tools.ts
4096
4245
  var import_provider7 = require("@ai-sdk/provider");
4097
- var import_provider_utils32 = require("@ai-sdk/provider-utils");
4246
+ var import_provider_utils33 = require("@ai-sdk/provider-utils");
4098
4247
 
4099
4248
  // src/tool/code-interpreter.ts
4100
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
4101
- var import_v418 = require("zod/v4");
4102
- var codeInterpreterInputSchema = (0, import_provider_utils25.lazySchema)(
4103
- () => (0, import_provider_utils25.zodSchema)(
4104
- import_v418.z.object({
4105
- code: import_v418.z.string().nullish(),
4106
- containerId: import_v418.z.string()
4249
+ var import_provider_utils26 = require("@ai-sdk/provider-utils");
4250
+ var import_v419 = require("zod/v4");
4251
+ var codeInterpreterInputSchema = (0, import_provider_utils26.lazySchema)(
4252
+ () => (0, import_provider_utils26.zodSchema)(
4253
+ import_v419.z.object({
4254
+ code: import_v419.z.string().nullish(),
4255
+ containerId: import_v419.z.string()
4107
4256
  })
4108
4257
  )
4109
4258
  );
4110
- var codeInterpreterOutputSchema = (0, import_provider_utils25.lazySchema)(
4111
- () => (0, import_provider_utils25.zodSchema)(
4112
- import_v418.z.object({
4113
- outputs: import_v418.z.array(
4114
- import_v418.z.discriminatedUnion("type", [
4115
- import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
4116
- import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
4259
+ var codeInterpreterOutputSchema = (0, import_provider_utils26.lazySchema)(
4260
+ () => (0, import_provider_utils26.zodSchema)(
4261
+ import_v419.z.object({
4262
+ outputs: import_v419.z.array(
4263
+ import_v419.z.discriminatedUnion("type", [
4264
+ import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
4265
+ import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
4117
4266
  ])
4118
4267
  ).nullish()
4119
4268
  })
4120
4269
  )
4121
4270
  );
4122
- var codeInterpreterArgsSchema = (0, import_provider_utils25.lazySchema)(
4123
- () => (0, import_provider_utils25.zodSchema)(
4124
- import_v418.z.object({
4125
- container: import_v418.z.union([
4126
- import_v418.z.string(),
4127
- import_v418.z.object({
4128
- fileIds: import_v418.z.array(import_v418.z.string()).optional()
4271
+ var codeInterpreterArgsSchema = (0, import_provider_utils26.lazySchema)(
4272
+ () => (0, import_provider_utils26.zodSchema)(
4273
+ import_v419.z.object({
4274
+ container: import_v419.z.union([
4275
+ import_v419.z.string(),
4276
+ import_v419.z.object({
4277
+ fileIds: import_v419.z.array(import_v419.z.string()).optional()
4129
4278
  })
4130
4279
  ]).optional()
4131
4280
  })
4132
4281
  )
4133
4282
  );
4134
- var codeInterpreterToolFactory = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
4283
+ var codeInterpreterToolFactory = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
4135
4284
  id: "openai.code_interpreter",
4136
4285
  inputSchema: codeInterpreterInputSchema,
4137
4286
  outputSchema: codeInterpreterOutputSchema
@@ -4141,81 +4290,81 @@ var codeInterpreter = (args = {}) => {
4141
4290
  };
4142
4291
 
4143
4292
  // src/tool/file-search.ts
4144
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
4145
- var import_v419 = require("zod/v4");
4146
- var comparisonFilterSchema = import_v419.z.object({
4147
- key: import_v419.z.string(),
4148
- type: import_v419.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
4149
- value: import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean(), import_v419.z.array(import_v419.z.string())])
4293
+ var import_provider_utils27 = require("@ai-sdk/provider-utils");
4294
+ var import_v420 = require("zod/v4");
4295
+ var comparisonFilterSchema = import_v420.z.object({
4296
+ key: import_v420.z.string(),
4297
+ type: import_v420.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
4298
+ value: import_v420.z.union([import_v420.z.string(), import_v420.z.number(), import_v420.z.boolean(), import_v420.z.array(import_v420.z.string())])
4150
4299
  });
4151
- var compoundFilterSchema = import_v419.z.object({
4152
- type: import_v419.z.enum(["and", "or"]),
4153
- filters: import_v419.z.array(
4154
- import_v419.z.union([comparisonFilterSchema, import_v419.z.lazy(() => compoundFilterSchema)])
4300
+ var compoundFilterSchema = import_v420.z.object({
4301
+ type: import_v420.z.enum(["and", "or"]),
4302
+ filters: import_v420.z.array(
4303
+ import_v420.z.union([comparisonFilterSchema, import_v420.z.lazy(() => compoundFilterSchema)])
4155
4304
  )
4156
4305
  });
4157
- var fileSearchArgsSchema = (0, import_provider_utils26.lazySchema)(
4158
- () => (0, import_provider_utils26.zodSchema)(
4159
- import_v419.z.object({
4160
- vectorStoreIds: import_v419.z.array(import_v419.z.string()),
4161
- maxNumResults: import_v419.z.number().optional(),
4162
- ranking: import_v419.z.object({
4163
- ranker: import_v419.z.string().optional(),
4164
- scoreThreshold: import_v419.z.number().optional()
4306
+ var fileSearchArgsSchema = (0, import_provider_utils27.lazySchema)(
4307
+ () => (0, import_provider_utils27.zodSchema)(
4308
+ import_v420.z.object({
4309
+ vectorStoreIds: import_v420.z.array(import_v420.z.string()),
4310
+ maxNumResults: import_v420.z.number().optional(),
4311
+ ranking: import_v420.z.object({
4312
+ ranker: import_v420.z.string().optional(),
4313
+ scoreThreshold: import_v420.z.number().optional()
4165
4314
  }).optional(),
4166
- filters: import_v419.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
4315
+ filters: import_v420.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
4167
4316
  })
4168
4317
  )
4169
4318
  );
4170
- var fileSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
4171
- () => (0, import_provider_utils26.zodSchema)(
4172
- import_v419.z.object({
4173
- queries: import_v419.z.array(import_v419.z.string()),
4174
- results: import_v419.z.array(
4175
- import_v419.z.object({
4176
- attributes: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()),
4177
- fileId: import_v419.z.string(),
4178
- filename: import_v419.z.string(),
4179
- score: import_v419.z.number(),
4180
- text: import_v419.z.string()
4319
+ var fileSearchOutputSchema = (0, import_provider_utils27.lazySchema)(
4320
+ () => (0, import_provider_utils27.zodSchema)(
4321
+ import_v420.z.object({
4322
+ queries: import_v420.z.array(import_v420.z.string()),
4323
+ results: import_v420.z.array(
4324
+ import_v420.z.object({
4325
+ attributes: import_v420.z.record(import_v420.z.string(), import_v420.z.unknown()),
4326
+ fileId: import_v420.z.string(),
4327
+ filename: import_v420.z.string(),
4328
+ score: import_v420.z.number(),
4329
+ text: import_v420.z.string()
4181
4330
  })
4182
4331
  ).nullable()
4183
4332
  })
4184
4333
  )
4185
4334
  );
4186
- var fileSearch = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
4335
+ var fileSearch = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
4187
4336
  id: "openai.file_search",
4188
- inputSchema: import_v419.z.object({}),
4337
+ inputSchema: import_v420.z.object({}),
4189
4338
  outputSchema: fileSearchOutputSchema
4190
4339
  });
4191
4340
 
4192
4341
  // src/tool/image-generation.ts
4193
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
4194
- var import_v420 = require("zod/v4");
4195
- var imageGenerationArgsSchema = (0, import_provider_utils27.lazySchema)(
4196
- () => (0, import_provider_utils27.zodSchema)(
4197
- import_v420.z.object({
4198
- background: import_v420.z.enum(["auto", "opaque", "transparent"]).optional(),
4199
- inputFidelity: import_v420.z.enum(["low", "high"]).optional(),
4200
- inputImageMask: import_v420.z.object({
4201
- fileId: import_v420.z.string().optional(),
4202
- imageUrl: import_v420.z.string().optional()
4342
+ var import_provider_utils28 = require("@ai-sdk/provider-utils");
4343
+ var import_v421 = require("zod/v4");
4344
+ var imageGenerationArgsSchema = (0, import_provider_utils28.lazySchema)(
4345
+ () => (0, import_provider_utils28.zodSchema)(
4346
+ import_v421.z.object({
4347
+ background: import_v421.z.enum(["auto", "opaque", "transparent"]).optional(),
4348
+ inputFidelity: import_v421.z.enum(["low", "high"]).optional(),
4349
+ inputImageMask: import_v421.z.object({
4350
+ fileId: import_v421.z.string().optional(),
4351
+ imageUrl: import_v421.z.string().optional()
4203
4352
  }).optional(),
4204
- model: import_v420.z.string().optional(),
4205
- moderation: import_v420.z.enum(["auto"]).optional(),
4206
- outputCompression: import_v420.z.number().int().min(0).max(100).optional(),
4207
- outputFormat: import_v420.z.enum(["png", "jpeg", "webp"]).optional(),
4208
- partialImages: import_v420.z.number().int().min(0).max(3).optional(),
4209
- quality: import_v420.z.enum(["auto", "low", "medium", "high"]).optional(),
4210
- size: import_v420.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
4353
+ model: import_v421.z.string().optional(),
4354
+ moderation: import_v421.z.enum(["auto"]).optional(),
4355
+ outputCompression: import_v421.z.number().int().min(0).max(100).optional(),
4356
+ outputFormat: import_v421.z.enum(["png", "jpeg", "webp"]).optional(),
4357
+ partialImages: import_v421.z.number().int().min(0).max(3).optional(),
4358
+ quality: import_v421.z.enum(["auto", "low", "medium", "high"]).optional(),
4359
+ size: import_v421.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
4211
4360
  }).strict()
4212
4361
  )
4213
4362
  );
4214
- var imageGenerationInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
4215
- var imageGenerationOutputSchema = (0, import_provider_utils27.lazySchema)(
4216
- () => (0, import_provider_utils27.zodSchema)(import_v420.z.object({ result: import_v420.z.string() }))
4363
+ var imageGenerationInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(import_v421.z.object({})));
4364
+ var imageGenerationOutputSchema = (0, import_provider_utils28.lazySchema)(
4365
+ () => (0, import_provider_utils28.zodSchema)(import_v421.z.object({ result: import_v421.z.string() }))
4217
4366
  );
4218
- var imageGenerationToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
4367
+ var imageGenerationToolFactory = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
4219
4368
  id: "openai.image_generation",
4220
4369
  inputSchema: imageGenerationInputSchema,
4221
4370
  outputSchema: imageGenerationOutputSchema
@@ -4225,153 +4374,102 @@ var imageGeneration = (args = {}) => {
4225
4374
  };
4226
4375
 
4227
4376
  // src/tool/custom.ts
4228
- var import_provider_utils28 = require("@ai-sdk/provider-utils");
4229
- var import_v421 = require("zod/v4");
4230
- var customArgsSchema = (0, import_provider_utils28.lazySchema)(
4231
- () => (0, import_provider_utils28.zodSchema)(
4232
- import_v421.z.object({
4233
- name: import_v421.z.string(),
4234
- description: import_v421.z.string().optional(),
4235
- format: import_v421.z.union([
4236
- import_v421.z.object({
4237
- type: import_v421.z.literal("grammar"),
4238
- syntax: import_v421.z.enum(["regex", "lark"]),
4239
- definition: import_v421.z.string()
4377
+ var import_provider_utils29 = require("@ai-sdk/provider-utils");
4378
+ var import_v422 = require("zod/v4");
4379
+ var customArgsSchema = (0, import_provider_utils29.lazySchema)(
4380
+ () => (0, import_provider_utils29.zodSchema)(
4381
+ import_v422.z.object({
4382
+ name: import_v422.z.string(),
4383
+ description: import_v422.z.string().optional(),
4384
+ format: import_v422.z.union([
4385
+ import_v422.z.object({
4386
+ type: import_v422.z.literal("grammar"),
4387
+ syntax: import_v422.z.enum(["regex", "lark"]),
4388
+ definition: import_v422.z.string()
4240
4389
  }),
4241
- import_v421.z.object({
4242
- type: import_v421.z.literal("text")
4390
+ import_v422.z.object({
4391
+ type: import_v422.z.literal("text")
4243
4392
  })
4244
4393
  ]).optional()
4245
4394
  })
4246
4395
  )
4247
4396
  );
4248
- var customInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(import_v421.z.string()));
4249
- var customToolFactory = (0, import_provider_utils28.createProviderToolFactory)({
4397
+ var customInputSchema = (0, import_provider_utils29.lazySchema)(() => (0, import_provider_utils29.zodSchema)(import_v422.z.string()));
4398
+ var customToolFactory = (0, import_provider_utils29.createProviderToolFactory)({
4250
4399
  id: "openai.custom",
4251
4400
  inputSchema: customInputSchema
4252
4401
  });
4253
4402
 
4254
4403
  // src/tool/mcp.ts
4255
- var import_provider_utils29 = require("@ai-sdk/provider-utils");
4256
- var import_v422 = require("zod/v4");
4257
- var jsonValueSchema = import_v422.z.lazy(
4258
- () => import_v422.z.union([
4259
- import_v422.z.string(),
4260
- import_v422.z.number(),
4261
- import_v422.z.boolean(),
4262
- import_v422.z.null(),
4263
- import_v422.z.array(jsonValueSchema),
4264
- import_v422.z.record(import_v422.z.string(), jsonValueSchema)
4404
+ var import_provider_utils30 = require("@ai-sdk/provider-utils");
4405
+ var import_v423 = require("zod/v4");
4406
+ var jsonValueSchema2 = import_v423.z.lazy(
4407
+ () => import_v423.z.union([
4408
+ import_v423.z.string(),
4409
+ import_v423.z.number(),
4410
+ import_v423.z.boolean(),
4411
+ import_v423.z.null(),
4412
+ import_v423.z.array(jsonValueSchema2),
4413
+ import_v423.z.record(import_v423.z.string(), jsonValueSchema2)
4265
4414
  ])
4266
4415
  );
4267
- var mcpArgsSchema = (0, import_provider_utils29.lazySchema)(
4268
- () => (0, import_provider_utils29.zodSchema)(
4269
- import_v422.z.object({
4270
- serverLabel: import_v422.z.string(),
4271
- allowedTools: import_v422.z.union([
4272
- import_v422.z.array(import_v422.z.string()),
4273
- import_v422.z.object({
4274
- readOnly: import_v422.z.boolean().optional(),
4275
- toolNames: import_v422.z.array(import_v422.z.string()).optional()
4416
+ var mcpArgsSchema = (0, import_provider_utils30.lazySchema)(
4417
+ () => (0, import_provider_utils30.zodSchema)(
4418
+ import_v423.z.object({
4419
+ serverLabel: import_v423.z.string(),
4420
+ allowedTools: import_v423.z.union([
4421
+ import_v423.z.array(import_v423.z.string()),
4422
+ import_v423.z.object({
4423
+ readOnly: import_v423.z.boolean().optional(),
4424
+ toolNames: import_v423.z.array(import_v423.z.string()).optional()
4276
4425
  })
4277
4426
  ]).optional(),
4278
- authorization: import_v422.z.string().optional(),
4279
- connectorId: import_v422.z.string().optional(),
4280
- headers: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).optional(),
4281
- requireApproval: import_v422.z.union([
4282
- import_v422.z.enum(["always", "never"]),
4283
- import_v422.z.object({
4284
- never: import_v422.z.object({
4285
- toolNames: import_v422.z.array(import_v422.z.string()).optional()
4427
+ authorization: import_v423.z.string().optional(),
4428
+ connectorId: import_v423.z.string().optional(),
4429
+ headers: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).optional(),
4430
+ requireApproval: import_v423.z.union([
4431
+ import_v423.z.enum(["always", "never"]),
4432
+ import_v423.z.object({
4433
+ never: import_v423.z.object({
4434
+ toolNames: import_v423.z.array(import_v423.z.string()).optional()
4286
4435
  }).optional()
4287
4436
  })
4288
4437
  ]).optional(),
4289
- serverDescription: import_v422.z.string().optional(),
4290
- serverUrl: import_v422.z.string().optional()
4438
+ serverDescription: import_v423.z.string().optional(),
4439
+ serverUrl: import_v423.z.string().optional()
4291
4440
  }).refine(
4292
4441
  (v) => v.serverUrl != null || v.connectorId != null,
4293
4442
  "One of serverUrl or connectorId must be provided."
4294
4443
  )
4295
4444
  )
4296
4445
  );
4297
- var mcpInputSchema = (0, import_provider_utils29.lazySchema)(() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({})));
4298
- var mcpOutputSchema = (0, import_provider_utils29.lazySchema)(
4299
- () => (0, import_provider_utils29.zodSchema)(
4300
- import_v422.z.object({
4301
- type: import_v422.z.literal("call"),
4302
- serverLabel: import_v422.z.string(),
4303
- name: import_v422.z.string(),
4304
- arguments: import_v422.z.string(),
4305
- output: import_v422.z.string().nullish(),
4306
- error: import_v422.z.union([import_v422.z.string(), jsonValueSchema]).optional()
4446
+ var mcpInputSchema = (0, import_provider_utils30.lazySchema)(() => (0, import_provider_utils30.zodSchema)(import_v423.z.object({})));
4447
+ var mcpOutputSchema = (0, import_provider_utils30.lazySchema)(
4448
+ () => (0, import_provider_utils30.zodSchema)(
4449
+ import_v423.z.object({
4450
+ type: import_v423.z.literal("call"),
4451
+ serverLabel: import_v423.z.string(),
4452
+ name: import_v423.z.string(),
4453
+ arguments: import_v423.z.string(),
4454
+ output: import_v423.z.string().nullish(),
4455
+ error: import_v423.z.union([import_v423.z.string(), jsonValueSchema2]).optional()
4307
4456
  })
4308
4457
  )
4309
4458
  );
4310
- var mcpToolFactory = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
4459
+ var mcpToolFactory = (0, import_provider_utils30.createProviderToolFactoryWithOutputSchema)({
4311
4460
  id: "openai.mcp",
4312
4461
  inputSchema: mcpInputSchema,
4313
4462
  outputSchema: mcpOutputSchema
4314
4463
  });
4315
4464
 
4316
4465
  // src/tool/web-search.ts
4317
- var import_provider_utils30 = require("@ai-sdk/provider-utils");
4318
- var import_v423 = require("zod/v4");
4319
- var webSearchArgsSchema = (0, import_provider_utils30.lazySchema)(
4320
- () => (0, import_provider_utils30.zodSchema)(
4321
- import_v423.z.object({
4322
- externalWebAccess: import_v423.z.boolean().optional(),
4323
- filters: import_v423.z.object({ allowedDomains: import_v423.z.array(import_v423.z.string()).optional() }).optional(),
4324
- searchContextSize: import_v423.z.enum(["low", "medium", "high"]).optional(),
4325
- userLocation: import_v423.z.object({
4326
- type: import_v423.z.literal("approximate"),
4327
- country: import_v423.z.string().optional(),
4328
- city: import_v423.z.string().optional(),
4329
- region: import_v423.z.string().optional(),
4330
- timezone: import_v423.z.string().optional()
4331
- }).optional()
4332
- })
4333
- )
4334
- );
4335
- var webSearchInputSchema = (0, import_provider_utils30.lazySchema)(() => (0, import_provider_utils30.zodSchema)(import_v423.z.object({})));
4336
- var webSearchOutputSchema = (0, import_provider_utils30.lazySchema)(
4337
- () => (0, import_provider_utils30.zodSchema)(
4338
- import_v423.z.object({
4339
- action: import_v423.z.discriminatedUnion("type", [
4340
- import_v423.z.object({
4341
- type: import_v423.z.literal("search"),
4342
- query: import_v423.z.string().optional()
4343
- }),
4344
- import_v423.z.object({
4345
- type: import_v423.z.literal("openPage"),
4346
- url: import_v423.z.string().nullish()
4347
- }),
4348
- import_v423.z.object({
4349
- type: import_v423.z.literal("findInPage"),
4350
- url: import_v423.z.string().nullish(),
4351
- pattern: import_v423.z.string().nullish()
4352
- })
4353
- ]).optional(),
4354
- sources: import_v423.z.array(
4355
- import_v423.z.discriminatedUnion("type", [
4356
- import_v423.z.object({ type: import_v423.z.literal("url"), url: import_v423.z.string() }),
4357
- import_v423.z.object({ type: import_v423.z.literal("api"), name: import_v423.z.string() })
4358
- ])
4359
- ).optional()
4360
- })
4361
- )
4362
- );
4363
- var webSearchToolFactory = (0, import_provider_utils30.createProviderToolFactoryWithOutputSchema)({
4364
- id: "openai.web_search",
4365
- inputSchema: webSearchInputSchema,
4366
- outputSchema: webSearchOutputSchema
4367
- });
4368
-
4369
- // src/tool/web-search-preview.ts
4370
4466
  var import_provider_utils31 = require("@ai-sdk/provider-utils");
4371
4467
  var import_v424 = require("zod/v4");
4372
- var webSearchPreviewArgsSchema = (0, import_provider_utils31.lazySchema)(
4468
+ var webSearchArgsSchema = (0, import_provider_utils31.lazySchema)(
4373
4469
  () => (0, import_provider_utils31.zodSchema)(
4374
4470
  import_v424.z.object({
4471
+ externalWebAccess: import_v424.z.boolean().optional(),
4472
+ filters: import_v424.z.object({ allowedDomains: import_v424.z.array(import_v424.z.string()).optional() }).optional(),
4375
4473
  searchContextSize: import_v424.z.enum(["low", "medium", "high"]).optional(),
4376
4474
  userLocation: import_v424.z.object({
4377
4475
  type: import_v424.z.literal("approximate"),
@@ -4383,10 +4481,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils31.lazySchema)(
4383
4481
  })
4384
4482
  )
4385
4483
  );
4386
- var webSearchPreviewInputSchema = (0, import_provider_utils31.lazySchema)(
4387
- () => (0, import_provider_utils31.zodSchema)(import_v424.z.object({}))
4388
- );
4389
- var webSearchPreviewOutputSchema = (0, import_provider_utils31.lazySchema)(
4484
+ var webSearchInputSchema = (0, import_provider_utils31.lazySchema)(() => (0, import_provider_utils31.zodSchema)(import_v424.z.object({})));
4485
+ var webSearchOutputSchema = (0, import_provider_utils31.lazySchema)(
4390
4486
  () => (0, import_provider_utils31.zodSchema)(
4391
4487
  import_v424.z.object({
4392
4488
  action: import_v424.z.discriminatedUnion("type", [
@@ -4403,11 +4499,64 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils31.lazySchema)(
4403
4499
  url: import_v424.z.string().nullish(),
4404
4500
  pattern: import_v424.z.string().nullish()
4405
4501
  })
4502
+ ]).optional(),
4503
+ sources: import_v424.z.array(
4504
+ import_v424.z.discriminatedUnion("type", [
4505
+ import_v424.z.object({ type: import_v424.z.literal("url"), url: import_v424.z.string() }),
4506
+ import_v424.z.object({ type: import_v424.z.literal("api"), name: import_v424.z.string() })
4507
+ ])
4508
+ ).optional()
4509
+ })
4510
+ )
4511
+ );
4512
+ var webSearchToolFactory = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
4513
+ id: "openai.web_search",
4514
+ inputSchema: webSearchInputSchema,
4515
+ outputSchema: webSearchOutputSchema
4516
+ });
4517
+
4518
+ // src/tool/web-search-preview.ts
4519
+ var import_provider_utils32 = require("@ai-sdk/provider-utils");
4520
+ var import_v425 = require("zod/v4");
4521
+ var webSearchPreviewArgsSchema = (0, import_provider_utils32.lazySchema)(
4522
+ () => (0, import_provider_utils32.zodSchema)(
4523
+ import_v425.z.object({
4524
+ searchContextSize: import_v425.z.enum(["low", "medium", "high"]).optional(),
4525
+ userLocation: import_v425.z.object({
4526
+ type: import_v425.z.literal("approximate"),
4527
+ country: import_v425.z.string().optional(),
4528
+ city: import_v425.z.string().optional(),
4529
+ region: import_v425.z.string().optional(),
4530
+ timezone: import_v425.z.string().optional()
4531
+ }).optional()
4532
+ })
4533
+ )
4534
+ );
4535
+ var webSearchPreviewInputSchema = (0, import_provider_utils32.lazySchema)(
4536
+ () => (0, import_provider_utils32.zodSchema)(import_v425.z.object({}))
4537
+ );
4538
+ var webSearchPreviewOutputSchema = (0, import_provider_utils32.lazySchema)(
4539
+ () => (0, import_provider_utils32.zodSchema)(
4540
+ import_v425.z.object({
4541
+ action: import_v425.z.discriminatedUnion("type", [
4542
+ import_v425.z.object({
4543
+ type: import_v425.z.literal("search"),
4544
+ query: import_v425.z.string().optional()
4545
+ }),
4546
+ import_v425.z.object({
4547
+ type: import_v425.z.literal("openPage"),
4548
+ url: import_v425.z.string().nullish()
4549
+ }),
4550
+ import_v425.z.object({
4551
+ type: import_v425.z.literal("findInPage"),
4552
+ url: import_v425.z.string().nullish(),
4553
+ pattern: import_v425.z.string().nullish()
4554
+ })
4406
4555
  ]).optional()
4407
4556
  })
4408
4557
  )
4409
4558
  );
4410
- var webSearchPreview = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
4559
+ var webSearchPreview = (0, import_provider_utils32.createProviderToolFactoryWithOutputSchema)({
4411
4560
  id: "openai.web_search_preview",
4412
4561
  inputSchema: webSearchPreviewInputSchema,
4413
4562
  outputSchema: webSearchPreviewOutputSchema
@@ -4420,7 +4569,7 @@ async function prepareResponsesTools({
4420
4569
  toolNameMapping,
4421
4570
  customProviderToolNames
4422
4571
  }) {
4423
- var _a;
4572
+ var _a, _b;
4424
4573
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
4425
4574
  const toolWarnings = [];
4426
4575
  if (tools == null) {
@@ -4430,19 +4579,23 @@ async function prepareResponsesTools({
4430
4579
  const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
4431
4580
  for (const tool of tools) {
4432
4581
  switch (tool.type) {
4433
- case "function":
4582
+ case "function": {
4583
+ const openaiOptions = (_a = tool.providerOptions) == null ? void 0 : _a.openai;
4584
+ const deferLoading = openaiOptions == null ? void 0 : openaiOptions.deferLoading;
4434
4585
  openaiTools.push({
4435
4586
  type: "function",
4436
4587
  name: tool.name,
4437
4588
  description: tool.description,
4438
4589
  parameters: tool.inputSchema,
4439
- ...tool.strict != null ? { strict: tool.strict } : {}
4590
+ ...tool.strict != null ? { strict: tool.strict } : {},
4591
+ ...deferLoading != null ? { defer_loading: deferLoading } : {}
4440
4592
  });
4441
4593
  break;
4594
+ }
4442
4595
  case "provider": {
4443
4596
  switch (tool.id) {
4444
4597
  case "openai.file_search": {
4445
- const args = await (0, import_provider_utils32.validateTypes)({
4598
+ const args = await (0, import_provider_utils33.validateTypes)({
4446
4599
  value: tool.args,
4447
4600
  schema: fileSearchArgsSchema
4448
4601
  });
@@ -4465,7 +4618,7 @@ async function prepareResponsesTools({
4465
4618
  break;
4466
4619
  }
4467
4620
  case "openai.shell": {
4468
- const args = await (0, import_provider_utils32.validateTypes)({
4621
+ const args = await (0, import_provider_utils33.validateTypes)({
4469
4622
  value: tool.args,
4470
4623
  schema: shellArgsSchema
4471
4624
  });
@@ -4484,7 +4637,7 @@ async function prepareResponsesTools({
4484
4637
  break;
4485
4638
  }
4486
4639
  case "openai.web_search_preview": {
4487
- const args = await (0, import_provider_utils32.validateTypes)({
4640
+ const args = await (0, import_provider_utils33.validateTypes)({
4488
4641
  value: tool.args,
4489
4642
  schema: webSearchPreviewArgsSchema
4490
4643
  });
@@ -4496,7 +4649,7 @@ async function prepareResponsesTools({
4496
4649
  break;
4497
4650
  }
4498
4651
  case "openai.web_search": {
4499
- const args = await (0, import_provider_utils32.validateTypes)({
4652
+ const args = await (0, import_provider_utils33.validateTypes)({
4500
4653
  value: tool.args,
4501
4654
  schema: webSearchArgsSchema
4502
4655
  });
@@ -4510,7 +4663,7 @@ async function prepareResponsesTools({
4510
4663
  break;
4511
4664
  }
4512
4665
  case "openai.code_interpreter": {
4513
- const args = await (0, import_provider_utils32.validateTypes)({
4666
+ const args = await (0, import_provider_utils33.validateTypes)({
4514
4667
  value: tool.args,
4515
4668
  schema: codeInterpreterArgsSchema
4516
4669
  });
@@ -4521,7 +4674,7 @@ async function prepareResponsesTools({
4521
4674
  break;
4522
4675
  }
4523
4676
  case "openai.image_generation": {
4524
- const args = await (0, import_provider_utils32.validateTypes)({
4677
+ const args = await (0, import_provider_utils33.validateTypes)({
4525
4678
  value: tool.args,
4526
4679
  schema: imageGenerationArgsSchema
4527
4680
  });
@@ -4544,7 +4697,7 @@ async function prepareResponsesTools({
4544
4697
  break;
4545
4698
  }
4546
4699
  case "openai.mcp": {
4547
- const args = await (0, import_provider_utils32.validateTypes)({
4700
+ const args = await (0, import_provider_utils33.validateTypes)({
4548
4701
  value: tool.args,
4549
4702
  schema: mcpArgsSchema
4550
4703
  });
@@ -4570,7 +4723,7 @@ async function prepareResponsesTools({
4570
4723
  break;
4571
4724
  }
4572
4725
  case "openai.custom": {
4573
- const args = await (0, import_provider_utils32.validateTypes)({
4726
+ const args = await (0, import_provider_utils33.validateTypes)({
4574
4727
  value: tool.args,
4575
4728
  schema: customArgsSchema
4576
4729
  });
@@ -4583,6 +4736,19 @@ async function prepareResponsesTools({
4583
4736
  resolvedCustomProviderToolNames.add(args.name);
4584
4737
  break;
4585
4738
  }
4739
+ case "openai.tool_search": {
4740
+ const args = await (0, import_provider_utils33.validateTypes)({
4741
+ value: tool.args,
4742
+ schema: toolSearchArgsSchema
4743
+ });
4744
+ openaiTools.push({
4745
+ type: "tool_search",
4746
+ ...args.execution != null ? { execution: args.execution } : {},
4747
+ ...args.description != null ? { description: args.description } : {},
4748
+ ...args.parameters != null ? { parameters: args.parameters } : {}
4749
+ });
4750
+ break;
4751
+ }
4586
4752
  }
4587
4753
  break;
4588
4754
  }
@@ -4604,7 +4770,7 @@ async function prepareResponsesTools({
4604
4770
  case "required":
4605
4771
  return { tools: openaiTools, toolChoice: type, toolWarnings };
4606
4772
  case "tool": {
4607
- const resolvedToolName = (_a = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _a : toolChoice.toolName;
4773
+ const resolvedToolName = (_b = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _b : toolChoice.toolName;
4608
4774
  return {
4609
4775
  tools: openaiTools,
4610
4776
  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 },
@@ -4729,13 +4895,13 @@ var OpenAIResponsesLanguageModel = class {
4729
4895
  warnings.push({ type: "unsupported", feature: "stopSequences" });
4730
4896
  }
4731
4897
  const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
4732
- let openaiOptions = await (0, import_provider_utils33.parseProviderOptions)({
4898
+ let openaiOptions = await (0, import_provider_utils34.parseProviderOptions)({
4733
4899
  provider: providerOptionsName,
4734
4900
  providerOptions,
4735
4901
  schema: openaiLanguageModelResponsesOptionsSchema
4736
4902
  });
4737
4903
  if (openaiOptions == null && providerOptionsName !== "openai") {
4738
- openaiOptions = await (0, import_provider_utils33.parseProviderOptions)({
4904
+ openaiOptions = await (0, import_provider_utils34.parseProviderOptions)({
4739
4905
  provider: "openai",
4740
4906
  providerOptions,
4741
4907
  schema: openaiLanguageModelResponsesOptionsSchema
@@ -4749,7 +4915,7 @@ var OpenAIResponsesLanguageModel = class {
4749
4915
  details: "conversation and previousResponseId cannot be used together"
4750
4916
  });
4751
4917
  }
4752
- const toolNameMapping = (0, import_provider_utils33.createToolNameMapping)({
4918
+ const toolNameMapping = (0, import_provider_utils34.createToolNameMapping)({
4753
4919
  tools,
4754
4920
  providerToolNames: {
4755
4921
  "openai.code_interpreter": "code_interpreter",
@@ -4760,7 +4926,8 @@ var OpenAIResponsesLanguageModel = class {
4760
4926
  "openai.web_search": "web_search",
4761
4927
  "openai.web_search_preview": "web_search_preview",
4762
4928
  "openai.mcp": "mcp",
4763
- "openai.apply_patch": "apply_patch"
4929
+ "openai.apply_patch": "apply_patch",
4930
+ "openai.tool_search": "tool_search"
4764
4931
  },
4765
4932
  resolveProviderToolName: (tool) => tool.id === "openai.custom" ? tool.args.name : void 0
4766
4933
  });
@@ -4938,7 +5105,7 @@ var OpenAIResponsesLanguageModel = class {
4938
5105
  };
4939
5106
  }
4940
5107
  async doGenerate(options) {
4941
- 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;
5108
+ 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;
4942
5109
  const {
4943
5110
  args: body,
4944
5111
  warnings,
@@ -4956,12 +5123,12 @@ var OpenAIResponsesLanguageModel = class {
4956
5123
  responseHeaders,
4957
5124
  value: response,
4958
5125
  rawValue: rawResponse
4959
- } = await (0, import_provider_utils33.postJsonToApi)({
5126
+ } = await (0, import_provider_utils34.postJsonToApi)({
4960
5127
  url,
4961
- headers: (0, import_provider_utils33.combineHeaders)(this.config.headers(), options.headers),
5128
+ headers: (0, import_provider_utils34.combineHeaders)(this.config.headers(), options.headers),
4962
5129
  body,
4963
5130
  failedResponseHandler: openaiFailedResponseHandler,
4964
- successfulResponseHandler: (0, import_provider_utils33.createJsonResponseHandler)(
5131
+ successfulResponseHandler: (0, import_provider_utils34.createJsonResponseHandler)(
4965
5132
  openaiResponsesResponseSchema
4966
5133
  ),
4967
5134
  abortSignal: options.abortSignal,
@@ -4981,6 +5148,7 @@ var OpenAIResponsesLanguageModel = class {
4981
5148
  const content = [];
4982
5149
  const logprobs = [];
4983
5150
  let hasFunctionCall = false;
5151
+ const hostedToolSearchCallIds = [];
4984
5152
  for (const part of response.output) {
4985
5153
  switch (part.type) {
4986
5154
  case "reasoning": {
@@ -5019,6 +5187,46 @@ var OpenAIResponsesLanguageModel = class {
5019
5187
  });
5020
5188
  break;
5021
5189
  }
5190
+ case "tool_search_call": {
5191
+ const toolCallId = (_b = part.call_id) != null ? _b : part.id;
5192
+ const isHosted = part.execution === "server";
5193
+ if (isHosted) {
5194
+ hostedToolSearchCallIds.push(toolCallId);
5195
+ }
5196
+ content.push({
5197
+ type: "tool-call",
5198
+ toolCallId,
5199
+ toolName: toolNameMapping.toCustomToolName("tool_search"),
5200
+ input: JSON.stringify({
5201
+ arguments: part.arguments,
5202
+ call_id: part.call_id
5203
+ }),
5204
+ ...isHosted ? { providerExecuted: true } : {},
5205
+ providerMetadata: {
5206
+ [providerOptionsName]: {
5207
+ itemId: part.id
5208
+ }
5209
+ }
5210
+ });
5211
+ break;
5212
+ }
5213
+ case "tool_search_output": {
5214
+ const toolCallId = (_d = (_c = part.call_id) != null ? _c : hostedToolSearchCallIds.shift()) != null ? _d : part.id;
5215
+ content.push({
5216
+ type: "tool-result",
5217
+ toolCallId,
5218
+ toolName: toolNameMapping.toCustomToolName("tool_search"),
5219
+ result: {
5220
+ tools: part.tools
5221
+ },
5222
+ providerMetadata: {
5223
+ [providerOptionsName]: {
5224
+ itemId: part.id
5225
+ }
5226
+ }
5227
+ });
5228
+ break;
5229
+ }
5022
5230
  case "local_shell_call": {
5023
5231
  content.push({
5024
5232
  type: "tool-call",
@@ -5074,7 +5282,7 @@ var OpenAIResponsesLanguageModel = class {
5074
5282
  }
5075
5283
  case "message": {
5076
5284
  for (const contentPart of part.content) {
5077
- if (((_c = (_b = options.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.logprobs) && contentPart.logprobs) {
5285
+ if (((_f = (_e = options.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.logprobs) && contentPart.logprobs) {
5078
5286
  logprobs.push(contentPart.logprobs);
5079
5287
  }
5080
5288
  const providerMetadata2 = {
@@ -5096,7 +5304,7 @@ var OpenAIResponsesLanguageModel = class {
5096
5304
  content.push({
5097
5305
  type: "source",
5098
5306
  sourceType: "url",
5099
- id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils33.generateId)(),
5307
+ id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils34.generateId)(),
5100
5308
  url: annotation.url,
5101
5309
  title: annotation.title
5102
5310
  });
@@ -5104,7 +5312,7 @@ var OpenAIResponsesLanguageModel = class {
5104
5312
  content.push({
5105
5313
  type: "source",
5106
5314
  sourceType: "document",
5107
- id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils33.generateId)(),
5315
+ id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils34.generateId)(),
5108
5316
  mediaType: "text/plain",
5109
5317
  title: annotation.filename,
5110
5318
  filename: annotation.filename,
@@ -5120,7 +5328,7 @@ var OpenAIResponsesLanguageModel = class {
5120
5328
  content.push({
5121
5329
  type: "source",
5122
5330
  sourceType: "document",
5123
- id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils33.generateId)(),
5331
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils34.generateId)(),
5124
5332
  mediaType: "text/plain",
5125
5333
  title: annotation.filename,
5126
5334
  filename: annotation.filename,
@@ -5136,7 +5344,7 @@ var OpenAIResponsesLanguageModel = class {
5136
5344
  content.push({
5137
5345
  type: "source",
5138
5346
  sourceType: "document",
5139
- id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils33.generateId)(),
5347
+ id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils34.generateId)(),
5140
5348
  mediaType: "application/octet-stream",
5141
5349
  title: annotation.file_id,
5142
5350
  filename: annotation.file_id,
@@ -5205,7 +5413,7 @@ var OpenAIResponsesLanguageModel = class {
5205
5413
  break;
5206
5414
  }
5207
5415
  case "mcp_call": {
5208
- const toolCallId = part.approval_request_id != null ? (_p = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _p : part.id : part.id;
5416
+ const toolCallId = part.approval_request_id != null ? (_s = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _s : part.id : part.id;
5209
5417
  const toolName = `mcp.${part.name}`;
5210
5418
  content.push({
5211
5419
  type: "tool-call",
@@ -5239,8 +5447,8 @@ var OpenAIResponsesLanguageModel = class {
5239
5447
  break;
5240
5448
  }
5241
5449
  case "mcp_approval_request": {
5242
- const approvalRequestId = (_q = part.approval_request_id) != null ? _q : part.id;
5243
- const dummyToolCallId = (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : (0, import_provider_utils33.generateId)();
5450
+ const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
5451
+ const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils34.generateId)();
5244
5452
  const toolName = `mcp.${part.name}`;
5245
5453
  content.push({
5246
5454
  type: "tool-call",
@@ -5290,13 +5498,13 @@ var OpenAIResponsesLanguageModel = class {
5290
5498
  toolName: toolNameMapping.toCustomToolName("file_search"),
5291
5499
  result: {
5292
5500
  queries: part.queries,
5293
- results: (_v = (_u = part.results) == null ? void 0 : _u.map((result) => ({
5501
+ results: (_y = (_x = part.results) == null ? void 0 : _x.map((result) => ({
5294
5502
  attributes: result.attributes,
5295
5503
  fileId: result.file_id,
5296
5504
  filename: result.filename,
5297
5505
  score: result.score,
5298
5506
  text: result.text
5299
- }))) != null ? _v : null
5507
+ }))) != null ? _y : null
5300
5508
  }
5301
5509
  });
5302
5510
  break;
@@ -5353,10 +5561,10 @@ var OpenAIResponsesLanguageModel = class {
5353
5561
  content,
5354
5562
  finishReason: {
5355
5563
  unified: mapOpenAIResponseFinishReason({
5356
- finishReason: (_w = response.incomplete_details) == null ? void 0 : _w.reason,
5564
+ finishReason: (_z = response.incomplete_details) == null ? void 0 : _z.reason,
5357
5565
  hasFunctionCall
5358
5566
  }),
5359
- raw: (_y = (_x = response.incomplete_details) == null ? void 0 : _x.reason) != null ? _y : void 0
5567
+ raw: (_B = (_A = response.incomplete_details) == null ? void 0 : _A.reason) != null ? _B : void 0
5360
5568
  },
5361
5569
  usage: convertOpenAIResponsesUsage(usage),
5362
5570
  request: { body },
@@ -5381,18 +5589,18 @@ var OpenAIResponsesLanguageModel = class {
5381
5589
  providerOptionsName,
5382
5590
  isShellProviderExecuted
5383
5591
  } = await this.getArgs(options);
5384
- const { responseHeaders, value: response } = await (0, import_provider_utils33.postJsonToApi)({
5592
+ const { responseHeaders, value: response } = await (0, import_provider_utils34.postJsonToApi)({
5385
5593
  url: this.config.url({
5386
5594
  path: "/responses",
5387
5595
  modelId: this.modelId
5388
5596
  }),
5389
- headers: (0, import_provider_utils33.combineHeaders)(this.config.headers(), options.headers),
5597
+ headers: (0, import_provider_utils34.combineHeaders)(this.config.headers(), options.headers),
5390
5598
  body: {
5391
5599
  ...body,
5392
5600
  stream: true
5393
5601
  },
5394
5602
  failedResponseHandler: openaiFailedResponseHandler,
5395
- successfulResponseHandler: (0, import_provider_utils33.createEventSourceResponseHandler)(
5603
+ successfulResponseHandler: (0, import_provider_utils34.createEventSourceResponseHandler)(
5396
5604
  openaiResponsesChunkSchema
5397
5605
  ),
5398
5606
  abortSignal: options.abortSignal,
@@ -5414,6 +5622,7 @@ var OpenAIResponsesLanguageModel = class {
5414
5622
  let hasFunctionCall = false;
5415
5623
  const activeReasoning = {};
5416
5624
  let serviceTier;
5625
+ const hostedToolSearchCallIds = [];
5417
5626
  return {
5418
5627
  stream: response.pipeThrough(
5419
5628
  new TransformStream({
@@ -5421,7 +5630,7 @@ var OpenAIResponsesLanguageModel = class {
5421
5630
  controller.enqueue({ type: "stream-start", warnings });
5422
5631
  },
5423
5632
  transform(chunk, controller) {
5424
- 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;
5633
+ 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;
5425
5634
  if (options.includeRawChunks) {
5426
5635
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
5427
5636
  }
@@ -5529,6 +5738,24 @@ var OpenAIResponsesLanguageModel = class {
5529
5738
  input: "{}",
5530
5739
  providerExecuted: true
5531
5740
  });
5741
+ } else if (value.item.type === "tool_search_call") {
5742
+ const toolCallId = value.item.id;
5743
+ const toolName = toolNameMapping.toCustomToolName("tool_search");
5744
+ const isHosted = value.item.execution === "server";
5745
+ ongoingToolCalls[value.output_index] = {
5746
+ toolName,
5747
+ toolCallId,
5748
+ toolSearchExecution: (_a = value.item.execution) != null ? _a : "server"
5749
+ };
5750
+ if (isHosted) {
5751
+ controller.enqueue({
5752
+ type: "tool-input-start",
5753
+ id: toolCallId,
5754
+ toolName,
5755
+ providerExecuted: true
5756
+ });
5757
+ }
5758
+ } else if (value.item.type === "tool_search_output") {
5532
5759
  } else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
5533
5760
  } else if (value.item.type === "apply_patch_call") {
5534
5761
  const { call_id: callId, operation } = value.item;
@@ -5575,7 +5802,7 @@ var OpenAIResponsesLanguageModel = class {
5575
5802
  } else if (value.item.type === "shell_call_output") {
5576
5803
  } else if (value.item.type === "message") {
5577
5804
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
5578
- activeMessagePhase = (_a = value.item.phase) != null ? _a : void 0;
5805
+ activeMessagePhase = (_b = value.item.phase) != null ? _b : void 0;
5579
5806
  controller.enqueue({
5580
5807
  type: "text-start",
5581
5808
  id: value.item.id,
@@ -5599,14 +5826,14 @@ var OpenAIResponsesLanguageModel = class {
5599
5826
  providerMetadata: {
5600
5827
  [providerOptionsName]: {
5601
5828
  itemId: value.item.id,
5602
- reasoningEncryptedContent: (_b = value.item.encrypted_content) != null ? _b : null
5829
+ reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
5603
5830
  }
5604
5831
  }
5605
5832
  });
5606
5833
  }
5607
5834
  } else if (isResponseOutputItemDoneChunk(value)) {
5608
5835
  if (value.item.type === "message") {
5609
- const phase = (_c = value.item.phase) != null ? _c : activeMessagePhase;
5836
+ const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
5610
5837
  activeMessagePhase = void 0;
5611
5838
  controller.enqueue({
5612
5839
  type: "text-end",
@@ -5700,13 +5927,13 @@ var OpenAIResponsesLanguageModel = class {
5700
5927
  toolName: toolNameMapping.toCustomToolName("file_search"),
5701
5928
  result: {
5702
5929
  queries: value.item.queries,
5703
- results: (_e = (_d = value.item.results) == null ? void 0 : _d.map((result) => ({
5930
+ results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result) => ({
5704
5931
  attributes: result.attributes,
5705
5932
  fileId: result.file_id,
5706
5933
  filename: result.filename,
5707
5934
  score: result.score,
5708
5935
  text: result.text
5709
- }))) != null ? _e : null
5936
+ }))) != null ? _f : null
5710
5937
  }
5711
5938
  });
5712
5939
  } else if (value.item.type === "code_interpreter_call") {
@@ -5728,12 +5955,62 @@ var OpenAIResponsesLanguageModel = class {
5728
5955
  result: value.item.result
5729
5956
  }
5730
5957
  });
5958
+ } else if (value.item.type === "tool_search_call") {
5959
+ const toolCall = ongoingToolCalls[value.output_index];
5960
+ const isHosted = value.item.execution === "server";
5961
+ if (toolCall != null) {
5962
+ const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
5963
+ if (isHosted) {
5964
+ hostedToolSearchCallIds.push(toolCallId);
5965
+ } else {
5966
+ controller.enqueue({
5967
+ type: "tool-input-start",
5968
+ id: toolCallId,
5969
+ toolName: toolCall.toolName
5970
+ });
5971
+ }
5972
+ controller.enqueue({
5973
+ type: "tool-input-end",
5974
+ id: toolCallId
5975
+ });
5976
+ controller.enqueue({
5977
+ type: "tool-call",
5978
+ toolCallId,
5979
+ toolName: toolCall.toolName,
5980
+ input: JSON.stringify({
5981
+ arguments: value.item.arguments,
5982
+ call_id: isHosted ? null : toolCallId
5983
+ }),
5984
+ ...isHosted ? { providerExecuted: true } : {},
5985
+ providerMetadata: {
5986
+ [providerOptionsName]: {
5987
+ itemId: value.item.id
5988
+ }
5989
+ }
5990
+ });
5991
+ }
5992
+ ongoingToolCalls[value.output_index] = void 0;
5993
+ } else if (value.item.type === "tool_search_output") {
5994
+ const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
5995
+ controller.enqueue({
5996
+ type: "tool-result",
5997
+ toolCallId,
5998
+ toolName: toolNameMapping.toCustomToolName("tool_search"),
5999
+ result: {
6000
+ tools: value.item.tools
6001
+ },
6002
+ providerMetadata: {
6003
+ [providerOptionsName]: {
6004
+ itemId: value.item.id
6005
+ }
6006
+ }
6007
+ });
5731
6008
  } else if (value.item.type === "mcp_call") {
5732
6009
  ongoingToolCalls[value.output_index] = void 0;
5733
- const approvalRequestId = (_f = value.item.approval_request_id) != null ? _f : void 0;
5734
- const aliasedToolCallId = approvalRequestId != null ? (_h = (_g = approvalRequestIdToDummyToolCallIdFromStream.get(
6010
+ const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
6011
+ const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
5735
6012
  approvalRequestId
5736
- )) != null ? _g : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _h : value.item.id : value.item.id;
6013
+ )) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
5737
6014
  const toolName = `mcp.${value.item.name}`;
5738
6015
  controller.enqueue({
5739
6016
  type: "tool-call",
@@ -5803,8 +6080,8 @@ var OpenAIResponsesLanguageModel = class {
5803
6080
  ongoingToolCalls[value.output_index] = void 0;
5804
6081
  } else if (value.item.type === "mcp_approval_request") {
5805
6082
  ongoingToolCalls[value.output_index] = void 0;
5806
- const dummyToolCallId = (_k = (_j = (_i = self.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : (0, import_provider_utils33.generateId)();
5807
- const approvalRequestId = (_l = value.item.approval_request_id) != null ? _l : value.item.id;
6083
+ const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils34.generateId)();
6084
+ const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
5808
6085
  approvalRequestIdToDummyToolCallIdFromStream.set(
5809
6086
  approvalRequestId,
5810
6087
  dummyToolCallId
@@ -5893,7 +6170,7 @@ var OpenAIResponsesLanguageModel = class {
5893
6170
  providerMetadata: {
5894
6171
  [providerOptionsName]: {
5895
6172
  itemId: value.item.id,
5896
- reasoningEncryptedContent: (_m = value.item.encrypted_content) != null ? _m : null
6173
+ reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
5897
6174
  }
5898
6175
  }
5899
6176
  });
@@ -6006,7 +6283,7 @@ var OpenAIResponsesLanguageModel = class {
6006
6283
  id: value.item_id,
6007
6284
  delta: value.delta
6008
6285
  });
6009
- if (((_o = (_n = options.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.logprobs) && value.logprobs) {
6286
+ if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
6010
6287
  logprobs.push(value.logprobs);
6011
6288
  }
6012
6289
  } else if (value.type === "response.reasoning_summary_part.added") {
@@ -6035,7 +6312,7 @@ var OpenAIResponsesLanguageModel = class {
6035
6312
  providerMetadata: {
6036
6313
  [providerOptionsName]: {
6037
6314
  itemId: value.item_id,
6038
- reasoningEncryptedContent: (_q = (_p = activeReasoning[value.item_id]) == null ? void 0 : _p.encryptedContent) != null ? _q : null
6315
+ reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
6039
6316
  }
6040
6317
  }
6041
6318
  });
@@ -6069,10 +6346,10 @@ var OpenAIResponsesLanguageModel = class {
6069
6346
  } else if (isResponseFinishedChunk(value)) {
6070
6347
  finishReason = {
6071
6348
  unified: mapOpenAIResponseFinishReason({
6072
- finishReason: (_r = value.response.incomplete_details) == null ? void 0 : _r.reason,
6349
+ finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
6073
6350
  hasFunctionCall
6074
6351
  }),
6075
- raw: (_t = (_s = value.response.incomplete_details) == null ? void 0 : _s.reason) != null ? _t : void 0
6352
+ raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
6076
6353
  };
6077
6354
  usage = value.response.usage;
6078
6355
  if (typeof value.response.service_tier === "string") {
@@ -6084,7 +6361,7 @@ var OpenAIResponsesLanguageModel = class {
6084
6361
  controller.enqueue({
6085
6362
  type: "source",
6086
6363
  sourceType: "url",
6087
- id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils33.generateId)(),
6364
+ id: (_A = (_z = (_y = self.config).generateId) == null ? void 0 : _z.call(_y)) != null ? _A : (0, import_provider_utils34.generateId)(),
6088
6365
  url: value.annotation.url,
6089
6366
  title: value.annotation.title
6090
6367
  });
@@ -6092,7 +6369,7 @@ var OpenAIResponsesLanguageModel = class {
6092
6369
  controller.enqueue({
6093
6370
  type: "source",
6094
6371
  sourceType: "document",
6095
- id: (_z = (_y = (_x = self.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : (0, import_provider_utils33.generateId)(),
6372
+ id: (_D = (_C = (_B = self.config).generateId) == null ? void 0 : _C.call(_B)) != null ? _D : (0, import_provider_utils34.generateId)(),
6096
6373
  mediaType: "text/plain",
6097
6374
  title: value.annotation.filename,
6098
6375
  filename: value.annotation.filename,
@@ -6108,7 +6385,7 @@ var OpenAIResponsesLanguageModel = class {
6108
6385
  controller.enqueue({
6109
6386
  type: "source",
6110
6387
  sourceType: "document",
6111
- id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils33.generateId)(),
6388
+ id: (_G = (_F = (_E = self.config).generateId) == null ? void 0 : _F.call(_E)) != null ? _G : (0, import_provider_utils34.generateId)(),
6112
6389
  mediaType: "text/plain",
6113
6390
  title: value.annotation.filename,
6114
6391
  filename: value.annotation.filename,
@@ -6124,7 +6401,7 @@ var OpenAIResponsesLanguageModel = class {
6124
6401
  controller.enqueue({
6125
6402
  type: "source",
6126
6403
  sourceType: "document",
6127
- id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils33.generateId)(),
6404
+ id: (_J = (_I = (_H = self.config).generateId) == null ? void 0 : _I.call(_H)) != null ? _J : (0, import_provider_utils34.generateId)(),
6128
6405
  mediaType: "application/octet-stream",
6129
6406
  title: value.annotation.file_id,
6130
6407
  filename: value.annotation.file_id,