@ai-sdk/openai 3.0.45 → 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");
@@ -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",
@@ -3938,9 +4086,9 @@ var openaiResponsesModelIds = [
3938
4086
  "gpt-5-chat-latest",
3939
4087
  ...openaiResponsesReasoningModelIds
3940
4088
  ];
3941
- var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazySchema)(
3942
- () => (0, import_provider_utils24.zodSchema)(
3943
- import_v417.z.object({
4089
+ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazySchema)(
4090
+ () => (0, import_provider_utils25.zodSchema)(
4091
+ import_v418.z.object({
3944
4092
  /**
3945
4093
  * The ID of the OpenAI Conversation to continue.
3946
4094
  * You must create a conversation first via the OpenAI API.
@@ -3948,13 +4096,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
3948
4096
  * Defaults to `undefined`.
3949
4097
  * @see https://platform.openai.com/docs/api-reference/conversations/create
3950
4098
  */
3951
- conversation: import_v417.z.string().nullish(),
4099
+ conversation: import_v418.z.string().nullish(),
3952
4100
  /**
3953
4101
  * The set of extra fields to include in the response (advanced, usually not needed).
3954
4102
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
3955
4103
  */
3956
- include: import_v417.z.array(
3957
- import_v417.z.enum([
4104
+ include: import_v418.z.array(
4105
+ import_v418.z.enum([
3958
4106
  "reasoning.encrypted_content",
3959
4107
  // handled internally by default, only needed for unknown reasoning models
3960
4108
  "file_search_call.results",
@@ -3966,7 +4114,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
3966
4114
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
3967
4115
  * Defaults to `undefined`.
3968
4116
  */
3969
- instructions: import_v417.z.string().nullish(),
4117
+ instructions: import_v418.z.string().nullish(),
3970
4118
  /**
3971
4119
  * Return the log probabilities of the tokens. Including logprobs will increase
3972
4120
  * the response size and can slow down response times. However, it can
@@ -3981,30 +4129,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
3981
4129
  * @see https://platform.openai.com/docs/api-reference/responses/create
3982
4130
  * @see https://cookbook.openai.com/examples/using_logprobs
3983
4131
  */
3984
- 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(),
3985
4133
  /**
3986
4134
  * The maximum number of total calls to built-in tools that can be processed in a response.
3987
4135
  * This maximum number applies across all built-in tool calls, not per individual tool.
3988
4136
  * Any further attempts to call a tool by the model will be ignored.
3989
4137
  */
3990
- maxToolCalls: import_v417.z.number().nullish(),
4138
+ maxToolCalls: import_v418.z.number().nullish(),
3991
4139
  /**
3992
4140
  * Additional metadata to store with the generation.
3993
4141
  */
3994
- metadata: import_v417.z.any().nullish(),
4142
+ metadata: import_v418.z.any().nullish(),
3995
4143
  /**
3996
4144
  * Whether to use parallel tool calls. Defaults to `true`.
3997
4145
  */
3998
- parallelToolCalls: import_v417.z.boolean().nullish(),
4146
+ parallelToolCalls: import_v418.z.boolean().nullish(),
3999
4147
  /**
4000
4148
  * The ID of the previous response. You can use it to continue a conversation.
4001
4149
  * Defaults to `undefined`.
4002
4150
  */
4003
- previousResponseId: import_v417.z.string().nullish(),
4151
+ previousResponseId: import_v418.z.string().nullish(),
4004
4152
  /**
4005
4153
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
4006
4154
  */
4007
- promptCacheKey: import_v417.z.string().nullish(),
4155
+ promptCacheKey: import_v418.z.string().nullish(),
4008
4156
  /**
4009
4157
  * The retention policy for the prompt cache.
4010
4158
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -4013,7 +4161,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4013
4161
  *
4014
4162
  * @default 'in_memory'
4015
4163
  */
4016
- promptCacheRetention: import_v417.z.enum(["in_memory", "24h"]).nullish(),
4164
+ promptCacheRetention: import_v418.z.enum(["in_memory", "24h"]).nullish(),
4017
4165
  /**
4018
4166
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
4019
4167
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -4024,17 +4172,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4024
4172
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
4025
4173
  * an error.
4026
4174
  */
4027
- reasoningEffort: import_v417.z.string().nullish(),
4175
+ reasoningEffort: import_v418.z.string().nullish(),
4028
4176
  /**
4029
4177
  * Controls reasoning summary output from the model.
4030
4178
  * Set to "auto" to automatically receive the richest level available,
4031
4179
  * or "detailed" for comprehensive summaries.
4032
4180
  */
4033
- reasoningSummary: import_v417.z.string().nullish(),
4181
+ reasoningSummary: import_v418.z.string().nullish(),
4034
4182
  /**
4035
4183
  * The identifier for safety monitoring and tracking.
4036
4184
  */
4037
- safetyIdentifier: import_v417.z.string().nullish(),
4185
+ safetyIdentifier: import_v418.z.string().nullish(),
4038
4186
  /**
4039
4187
  * Service tier for the request.
4040
4188
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -4042,34 +4190,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4042
4190
  *
4043
4191
  * Defaults to 'auto'.
4044
4192
  */
4045
- serviceTier: import_v417.z.enum(["auto", "flex", "priority", "default"]).nullish(),
4193
+ serviceTier: import_v418.z.enum(["auto", "flex", "priority", "default"]).nullish(),
4046
4194
  /**
4047
4195
  * Whether to store the generation. Defaults to `true`.
4048
4196
  */
4049
- store: import_v417.z.boolean().nullish(),
4197
+ store: import_v418.z.boolean().nullish(),
4050
4198
  /**
4051
4199
  * Whether to use strict JSON schema validation.
4052
4200
  * Defaults to `true`.
4053
4201
  */
4054
- strictJsonSchema: import_v417.z.boolean().nullish(),
4202
+ strictJsonSchema: import_v418.z.boolean().nullish(),
4055
4203
  /**
4056
4204
  * Controls the verbosity of the model's responses. Lower values ('low') will result
4057
4205
  * in more concise responses, while higher values ('high') will result in more verbose responses.
4058
4206
  * Valid values: 'low', 'medium', 'high'.
4059
4207
  */
4060
- textVerbosity: import_v417.z.enum(["low", "medium", "high"]).nullish(),
4208
+ textVerbosity: import_v418.z.enum(["low", "medium", "high"]).nullish(),
4061
4209
  /**
4062
4210
  * Controls output truncation. 'auto' (default) performs truncation automatically;
4063
4211
  * 'disabled' turns truncation off.
4064
4212
  */
4065
- truncation: import_v417.z.enum(["auto", "disabled"]).nullish(),
4213
+ truncation: import_v418.z.enum(["auto", "disabled"]).nullish(),
4066
4214
  /**
4067
4215
  * A unique identifier representing your end-user, which can help OpenAI to
4068
4216
  * monitor and detect abuse.
4069
4217
  * Defaults to `undefined`.
4070
4218
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
4071
4219
  */
4072
- user: import_v417.z.string().nullish(),
4220
+ user: import_v418.z.string().nullish(),
4073
4221
  /**
4074
4222
  * Override the system message mode for this model.
4075
4223
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -4078,7 +4226,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4078
4226
  *
4079
4227
  * If not specified, the mode is automatically determined based on the model.
4080
4228
  */
4081
- systemMessageMode: import_v417.z.enum(["system", "developer", "remove"]).optional(),
4229
+ systemMessageMode: import_v418.z.enum(["system", "developer", "remove"]).optional(),
4082
4230
  /**
4083
4231
  * Force treating this model as a reasoning model.
4084
4232
  *
@@ -4088,51 +4236,51 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils24.lazy
4088
4236
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
4089
4237
  * and defaults `systemMessageMode` to `developer` unless overridden.
4090
4238
  */
4091
- forceReasoning: import_v417.z.boolean().optional()
4239
+ forceReasoning: import_v418.z.boolean().optional()
4092
4240
  })
4093
4241
  )
4094
4242
  );
4095
4243
 
4096
4244
  // src/responses/openai-responses-prepare-tools.ts
4097
4245
  var import_provider7 = require("@ai-sdk/provider");
4098
- var import_provider_utils32 = require("@ai-sdk/provider-utils");
4246
+ var import_provider_utils33 = require("@ai-sdk/provider-utils");
4099
4247
 
4100
4248
  // src/tool/code-interpreter.ts
4101
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
4102
- var import_v418 = require("zod/v4");
4103
- var codeInterpreterInputSchema = (0, import_provider_utils25.lazySchema)(
4104
- () => (0, import_provider_utils25.zodSchema)(
4105
- import_v418.z.object({
4106
- code: import_v418.z.string().nullish(),
4107
- 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()
4108
4256
  })
4109
4257
  )
4110
4258
  );
4111
- var codeInterpreterOutputSchema = (0, import_provider_utils25.lazySchema)(
4112
- () => (0, import_provider_utils25.zodSchema)(
4113
- import_v418.z.object({
4114
- outputs: import_v418.z.array(
4115
- import_v418.z.discriminatedUnion("type", [
4116
- import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
4117
- 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() })
4118
4266
  ])
4119
4267
  ).nullish()
4120
4268
  })
4121
4269
  )
4122
4270
  );
4123
- var codeInterpreterArgsSchema = (0, import_provider_utils25.lazySchema)(
4124
- () => (0, import_provider_utils25.zodSchema)(
4125
- import_v418.z.object({
4126
- container: import_v418.z.union([
4127
- import_v418.z.string(),
4128
- import_v418.z.object({
4129
- 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()
4130
4278
  })
4131
4279
  ]).optional()
4132
4280
  })
4133
4281
  )
4134
4282
  );
4135
- var codeInterpreterToolFactory = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
4283
+ var codeInterpreterToolFactory = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
4136
4284
  id: "openai.code_interpreter",
4137
4285
  inputSchema: codeInterpreterInputSchema,
4138
4286
  outputSchema: codeInterpreterOutputSchema
@@ -4142,81 +4290,81 @@ var codeInterpreter = (args = {}) => {
4142
4290
  };
4143
4291
 
4144
4292
  // src/tool/file-search.ts
4145
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
4146
- var import_v419 = require("zod/v4");
4147
- var comparisonFilterSchema = import_v419.z.object({
4148
- key: import_v419.z.string(),
4149
- type: import_v419.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
4150
- 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())])
4151
4299
  });
4152
- var compoundFilterSchema = import_v419.z.object({
4153
- type: import_v419.z.enum(["and", "or"]),
4154
- filters: import_v419.z.array(
4155
- 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)])
4156
4304
  )
4157
4305
  });
4158
- var fileSearchArgsSchema = (0, import_provider_utils26.lazySchema)(
4159
- () => (0, import_provider_utils26.zodSchema)(
4160
- import_v419.z.object({
4161
- vectorStoreIds: import_v419.z.array(import_v419.z.string()),
4162
- maxNumResults: import_v419.z.number().optional(),
4163
- ranking: import_v419.z.object({
4164
- ranker: import_v419.z.string().optional(),
4165
- 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()
4166
4314
  }).optional(),
4167
- filters: import_v419.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
4315
+ filters: import_v420.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
4168
4316
  })
4169
4317
  )
4170
4318
  );
4171
- var fileSearchOutputSchema = (0, import_provider_utils26.lazySchema)(
4172
- () => (0, import_provider_utils26.zodSchema)(
4173
- import_v419.z.object({
4174
- queries: import_v419.z.array(import_v419.z.string()),
4175
- results: import_v419.z.array(
4176
- import_v419.z.object({
4177
- attributes: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()),
4178
- fileId: import_v419.z.string(),
4179
- filename: import_v419.z.string(),
4180
- score: import_v419.z.number(),
4181
- 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()
4182
4330
  })
4183
4331
  ).nullable()
4184
4332
  })
4185
4333
  )
4186
4334
  );
4187
- var fileSearch = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
4335
+ var fileSearch = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
4188
4336
  id: "openai.file_search",
4189
- inputSchema: import_v419.z.object({}),
4337
+ inputSchema: import_v420.z.object({}),
4190
4338
  outputSchema: fileSearchOutputSchema
4191
4339
  });
4192
4340
 
4193
4341
  // src/tool/image-generation.ts
4194
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
4195
- var import_v420 = require("zod/v4");
4196
- var imageGenerationArgsSchema = (0, import_provider_utils27.lazySchema)(
4197
- () => (0, import_provider_utils27.zodSchema)(
4198
- import_v420.z.object({
4199
- background: import_v420.z.enum(["auto", "opaque", "transparent"]).optional(),
4200
- inputFidelity: import_v420.z.enum(["low", "high"]).optional(),
4201
- inputImageMask: import_v420.z.object({
4202
- fileId: import_v420.z.string().optional(),
4203
- 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()
4204
4352
  }).optional(),
4205
- model: import_v420.z.string().optional(),
4206
- moderation: import_v420.z.enum(["auto"]).optional(),
4207
- outputCompression: import_v420.z.number().int().min(0).max(100).optional(),
4208
- outputFormat: import_v420.z.enum(["png", "jpeg", "webp"]).optional(),
4209
- partialImages: import_v420.z.number().int().min(0).max(3).optional(),
4210
- quality: import_v420.z.enum(["auto", "low", "medium", "high"]).optional(),
4211
- 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()
4212
4360
  }).strict()
4213
4361
  )
4214
4362
  );
4215
- var imageGenerationInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
4216
- var imageGenerationOutputSchema = (0, import_provider_utils27.lazySchema)(
4217
- () => (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() }))
4218
4366
  );
4219
- var imageGenerationToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
4367
+ var imageGenerationToolFactory = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
4220
4368
  id: "openai.image_generation",
4221
4369
  inputSchema: imageGenerationInputSchema,
4222
4370
  outputSchema: imageGenerationOutputSchema
@@ -4226,153 +4374,102 @@ var imageGeneration = (args = {}) => {
4226
4374
  };
4227
4375
 
4228
4376
  // src/tool/custom.ts
4229
- var import_provider_utils28 = require("@ai-sdk/provider-utils");
4230
- var import_v421 = require("zod/v4");
4231
- var customArgsSchema = (0, import_provider_utils28.lazySchema)(
4232
- () => (0, import_provider_utils28.zodSchema)(
4233
- import_v421.z.object({
4234
- name: import_v421.z.string(),
4235
- description: import_v421.z.string().optional(),
4236
- format: import_v421.z.union([
4237
- import_v421.z.object({
4238
- type: import_v421.z.literal("grammar"),
4239
- syntax: import_v421.z.enum(["regex", "lark"]),
4240
- 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()
4241
4389
  }),
4242
- import_v421.z.object({
4243
- type: import_v421.z.literal("text")
4390
+ import_v422.z.object({
4391
+ type: import_v422.z.literal("text")
4244
4392
  })
4245
4393
  ]).optional()
4246
4394
  })
4247
4395
  )
4248
4396
  );
4249
- var customInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(import_v421.z.string()));
4250
- 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)({
4251
4399
  id: "openai.custom",
4252
4400
  inputSchema: customInputSchema
4253
4401
  });
4254
4402
 
4255
4403
  // src/tool/mcp.ts
4256
- var import_provider_utils29 = require("@ai-sdk/provider-utils");
4257
- var import_v422 = require("zod/v4");
4258
- var jsonValueSchema = import_v422.z.lazy(
4259
- () => import_v422.z.union([
4260
- import_v422.z.string(),
4261
- import_v422.z.number(),
4262
- import_v422.z.boolean(),
4263
- import_v422.z.null(),
4264
- import_v422.z.array(jsonValueSchema),
4265
- 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)
4266
4414
  ])
4267
4415
  );
4268
- var mcpArgsSchema = (0, import_provider_utils29.lazySchema)(
4269
- () => (0, import_provider_utils29.zodSchema)(
4270
- import_v422.z.object({
4271
- serverLabel: import_v422.z.string(),
4272
- allowedTools: import_v422.z.union([
4273
- import_v422.z.array(import_v422.z.string()),
4274
- import_v422.z.object({
4275
- readOnly: import_v422.z.boolean().optional(),
4276
- 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()
4277
4425
  })
4278
4426
  ]).optional(),
4279
- authorization: import_v422.z.string().optional(),
4280
- connectorId: import_v422.z.string().optional(),
4281
- headers: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).optional(),
4282
- requireApproval: import_v422.z.union([
4283
- import_v422.z.enum(["always", "never"]),
4284
- import_v422.z.object({
4285
- never: import_v422.z.object({
4286
- 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()
4287
4435
  }).optional()
4288
4436
  })
4289
4437
  ]).optional(),
4290
- serverDescription: import_v422.z.string().optional(),
4291
- serverUrl: import_v422.z.string().optional()
4438
+ serverDescription: import_v423.z.string().optional(),
4439
+ serverUrl: import_v423.z.string().optional()
4292
4440
  }).refine(
4293
4441
  (v) => v.serverUrl != null || v.connectorId != null,
4294
4442
  "One of serverUrl or connectorId must be provided."
4295
4443
  )
4296
4444
  )
4297
4445
  );
4298
- var mcpInputSchema = (0, import_provider_utils29.lazySchema)(() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({})));
4299
- var mcpOutputSchema = (0, import_provider_utils29.lazySchema)(
4300
- () => (0, import_provider_utils29.zodSchema)(
4301
- import_v422.z.object({
4302
- type: import_v422.z.literal("call"),
4303
- serverLabel: import_v422.z.string(),
4304
- name: import_v422.z.string(),
4305
- arguments: import_v422.z.string(),
4306
- output: import_v422.z.string().nullish(),
4307
- 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()
4308
4456
  })
4309
4457
  )
4310
4458
  );
4311
- var mcpToolFactory = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
4459
+ var mcpToolFactory = (0, import_provider_utils30.createProviderToolFactoryWithOutputSchema)({
4312
4460
  id: "openai.mcp",
4313
4461
  inputSchema: mcpInputSchema,
4314
4462
  outputSchema: mcpOutputSchema
4315
4463
  });
4316
4464
 
4317
4465
  // src/tool/web-search.ts
4318
- var import_provider_utils30 = require("@ai-sdk/provider-utils");
4319
- var import_v423 = require("zod/v4");
4320
- var webSearchArgsSchema = (0, import_provider_utils30.lazySchema)(
4321
- () => (0, import_provider_utils30.zodSchema)(
4322
- import_v423.z.object({
4323
- externalWebAccess: import_v423.z.boolean().optional(),
4324
- filters: import_v423.z.object({ allowedDomains: import_v423.z.array(import_v423.z.string()).optional() }).optional(),
4325
- searchContextSize: import_v423.z.enum(["low", "medium", "high"]).optional(),
4326
- userLocation: import_v423.z.object({
4327
- type: import_v423.z.literal("approximate"),
4328
- country: import_v423.z.string().optional(),
4329
- city: import_v423.z.string().optional(),
4330
- region: import_v423.z.string().optional(),
4331
- timezone: import_v423.z.string().optional()
4332
- }).optional()
4333
- })
4334
- )
4335
- );
4336
- var webSearchInputSchema = (0, import_provider_utils30.lazySchema)(() => (0, import_provider_utils30.zodSchema)(import_v423.z.object({})));
4337
- var webSearchOutputSchema = (0, import_provider_utils30.lazySchema)(
4338
- () => (0, import_provider_utils30.zodSchema)(
4339
- import_v423.z.object({
4340
- action: import_v423.z.discriminatedUnion("type", [
4341
- import_v423.z.object({
4342
- type: import_v423.z.literal("search"),
4343
- query: import_v423.z.string().optional()
4344
- }),
4345
- import_v423.z.object({
4346
- type: import_v423.z.literal("openPage"),
4347
- url: import_v423.z.string().nullish()
4348
- }),
4349
- import_v423.z.object({
4350
- type: import_v423.z.literal("findInPage"),
4351
- url: import_v423.z.string().nullish(),
4352
- pattern: import_v423.z.string().nullish()
4353
- })
4354
- ]).optional(),
4355
- sources: import_v423.z.array(
4356
- import_v423.z.discriminatedUnion("type", [
4357
- import_v423.z.object({ type: import_v423.z.literal("url"), url: import_v423.z.string() }),
4358
- import_v423.z.object({ type: import_v423.z.literal("api"), name: import_v423.z.string() })
4359
- ])
4360
- ).optional()
4361
- })
4362
- )
4363
- );
4364
- var webSearchToolFactory = (0, import_provider_utils30.createProviderToolFactoryWithOutputSchema)({
4365
- id: "openai.web_search",
4366
- inputSchema: webSearchInputSchema,
4367
- outputSchema: webSearchOutputSchema
4368
- });
4369
-
4370
- // src/tool/web-search-preview.ts
4371
4466
  var import_provider_utils31 = require("@ai-sdk/provider-utils");
4372
4467
  var import_v424 = require("zod/v4");
4373
- var webSearchPreviewArgsSchema = (0, import_provider_utils31.lazySchema)(
4468
+ var webSearchArgsSchema = (0, import_provider_utils31.lazySchema)(
4374
4469
  () => (0, import_provider_utils31.zodSchema)(
4375
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(),
4376
4473
  searchContextSize: import_v424.z.enum(["low", "medium", "high"]).optional(),
4377
4474
  userLocation: import_v424.z.object({
4378
4475
  type: import_v424.z.literal("approximate"),
@@ -4384,10 +4481,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils31.lazySchema)(
4384
4481
  })
4385
4482
  )
4386
4483
  );
4387
- var webSearchPreviewInputSchema = (0, import_provider_utils31.lazySchema)(
4388
- () => (0, import_provider_utils31.zodSchema)(import_v424.z.object({}))
4389
- );
4390
- 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)(
4391
4486
  () => (0, import_provider_utils31.zodSchema)(
4392
4487
  import_v424.z.object({
4393
4488
  action: import_v424.z.discriminatedUnion("type", [
@@ -4404,11 +4499,64 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils31.lazySchema)(
4404
4499
  url: import_v424.z.string().nullish(),
4405
4500
  pattern: import_v424.z.string().nullish()
4406
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
+ })
4407
4555
  ]).optional()
4408
4556
  })
4409
4557
  )
4410
4558
  );
4411
- var webSearchPreview = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
4559
+ var webSearchPreview = (0, import_provider_utils32.createProviderToolFactoryWithOutputSchema)({
4412
4560
  id: "openai.web_search_preview",
4413
4561
  inputSchema: webSearchPreviewInputSchema,
4414
4562
  outputSchema: webSearchPreviewOutputSchema
@@ -4421,7 +4569,7 @@ async function prepareResponsesTools({
4421
4569
  toolNameMapping,
4422
4570
  customProviderToolNames
4423
4571
  }) {
4424
- var _a;
4572
+ var _a, _b;
4425
4573
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
4426
4574
  const toolWarnings = [];
4427
4575
  if (tools == null) {
@@ -4431,19 +4579,23 @@ async function prepareResponsesTools({
4431
4579
  const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
4432
4580
  for (const tool of tools) {
4433
4581
  switch (tool.type) {
4434
- 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;
4435
4585
  openaiTools.push({
4436
4586
  type: "function",
4437
4587
  name: tool.name,
4438
4588
  description: tool.description,
4439
4589
  parameters: tool.inputSchema,
4440
- ...tool.strict != null ? { strict: tool.strict } : {}
4590
+ ...tool.strict != null ? { strict: tool.strict } : {},
4591
+ ...deferLoading != null ? { defer_loading: deferLoading } : {}
4441
4592
  });
4442
4593
  break;
4594
+ }
4443
4595
  case "provider": {
4444
4596
  switch (tool.id) {
4445
4597
  case "openai.file_search": {
4446
- const args = await (0, import_provider_utils32.validateTypes)({
4598
+ const args = await (0, import_provider_utils33.validateTypes)({
4447
4599
  value: tool.args,
4448
4600
  schema: fileSearchArgsSchema
4449
4601
  });
@@ -4466,7 +4618,7 @@ async function prepareResponsesTools({
4466
4618
  break;
4467
4619
  }
4468
4620
  case "openai.shell": {
4469
- const args = await (0, import_provider_utils32.validateTypes)({
4621
+ const args = await (0, import_provider_utils33.validateTypes)({
4470
4622
  value: tool.args,
4471
4623
  schema: shellArgsSchema
4472
4624
  });
@@ -4485,7 +4637,7 @@ async function prepareResponsesTools({
4485
4637
  break;
4486
4638
  }
4487
4639
  case "openai.web_search_preview": {
4488
- const args = await (0, import_provider_utils32.validateTypes)({
4640
+ const args = await (0, import_provider_utils33.validateTypes)({
4489
4641
  value: tool.args,
4490
4642
  schema: webSearchPreviewArgsSchema
4491
4643
  });
@@ -4497,7 +4649,7 @@ async function prepareResponsesTools({
4497
4649
  break;
4498
4650
  }
4499
4651
  case "openai.web_search": {
4500
- const args = await (0, import_provider_utils32.validateTypes)({
4652
+ const args = await (0, import_provider_utils33.validateTypes)({
4501
4653
  value: tool.args,
4502
4654
  schema: webSearchArgsSchema
4503
4655
  });
@@ -4511,7 +4663,7 @@ async function prepareResponsesTools({
4511
4663
  break;
4512
4664
  }
4513
4665
  case "openai.code_interpreter": {
4514
- const args = await (0, import_provider_utils32.validateTypes)({
4666
+ const args = await (0, import_provider_utils33.validateTypes)({
4515
4667
  value: tool.args,
4516
4668
  schema: codeInterpreterArgsSchema
4517
4669
  });
@@ -4522,7 +4674,7 @@ async function prepareResponsesTools({
4522
4674
  break;
4523
4675
  }
4524
4676
  case "openai.image_generation": {
4525
- const args = await (0, import_provider_utils32.validateTypes)({
4677
+ const args = await (0, import_provider_utils33.validateTypes)({
4526
4678
  value: tool.args,
4527
4679
  schema: imageGenerationArgsSchema
4528
4680
  });
@@ -4545,7 +4697,7 @@ async function prepareResponsesTools({
4545
4697
  break;
4546
4698
  }
4547
4699
  case "openai.mcp": {
4548
- const args = await (0, import_provider_utils32.validateTypes)({
4700
+ const args = await (0, import_provider_utils33.validateTypes)({
4549
4701
  value: tool.args,
4550
4702
  schema: mcpArgsSchema
4551
4703
  });
@@ -4571,7 +4723,7 @@ async function prepareResponsesTools({
4571
4723
  break;
4572
4724
  }
4573
4725
  case "openai.custom": {
4574
- const args = await (0, import_provider_utils32.validateTypes)({
4726
+ const args = await (0, import_provider_utils33.validateTypes)({
4575
4727
  value: tool.args,
4576
4728
  schema: customArgsSchema
4577
4729
  });
@@ -4584,6 +4736,19 @@ async function prepareResponsesTools({
4584
4736
  resolvedCustomProviderToolNames.add(args.name);
4585
4737
  break;
4586
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
+ }
4587
4752
  }
4588
4753
  break;
4589
4754
  }
@@ -4605,7 +4770,7 @@ async function prepareResponsesTools({
4605
4770
  case "required":
4606
4771
  return { tools: openaiTools, toolChoice: type, toolWarnings };
4607
4772
  case "tool": {
4608
- 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;
4609
4774
  return {
4610
4775
  tools: openaiTools,
4611
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 },
@@ -4730,13 +4895,13 @@ var OpenAIResponsesLanguageModel = class {
4730
4895
  warnings.push({ type: "unsupported", feature: "stopSequences" });
4731
4896
  }
4732
4897
  const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
4733
- let openaiOptions = await (0, import_provider_utils33.parseProviderOptions)({
4898
+ let openaiOptions = await (0, import_provider_utils34.parseProviderOptions)({
4734
4899
  provider: providerOptionsName,
4735
4900
  providerOptions,
4736
4901
  schema: openaiLanguageModelResponsesOptionsSchema
4737
4902
  });
4738
4903
  if (openaiOptions == null && providerOptionsName !== "openai") {
4739
- openaiOptions = await (0, import_provider_utils33.parseProviderOptions)({
4904
+ openaiOptions = await (0, import_provider_utils34.parseProviderOptions)({
4740
4905
  provider: "openai",
4741
4906
  providerOptions,
4742
4907
  schema: openaiLanguageModelResponsesOptionsSchema
@@ -4750,7 +4915,7 @@ var OpenAIResponsesLanguageModel = class {
4750
4915
  details: "conversation and previousResponseId cannot be used together"
4751
4916
  });
4752
4917
  }
4753
- const toolNameMapping = (0, import_provider_utils33.createToolNameMapping)({
4918
+ const toolNameMapping = (0, import_provider_utils34.createToolNameMapping)({
4754
4919
  tools,
4755
4920
  providerToolNames: {
4756
4921
  "openai.code_interpreter": "code_interpreter",
@@ -4761,7 +4926,8 @@ var OpenAIResponsesLanguageModel = class {
4761
4926
  "openai.web_search": "web_search",
4762
4927
  "openai.web_search_preview": "web_search_preview",
4763
4928
  "openai.mcp": "mcp",
4764
- "openai.apply_patch": "apply_patch"
4929
+ "openai.apply_patch": "apply_patch",
4930
+ "openai.tool_search": "tool_search"
4765
4931
  },
4766
4932
  resolveProviderToolName: (tool) => tool.id === "openai.custom" ? tool.args.name : void 0
4767
4933
  });
@@ -4939,7 +5105,7 @@ var OpenAIResponsesLanguageModel = class {
4939
5105
  };
4940
5106
  }
4941
5107
  async doGenerate(options) {
4942
- 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;
4943
5109
  const {
4944
5110
  args: body,
4945
5111
  warnings,
@@ -4957,12 +5123,12 @@ var OpenAIResponsesLanguageModel = class {
4957
5123
  responseHeaders,
4958
5124
  value: response,
4959
5125
  rawValue: rawResponse
4960
- } = await (0, import_provider_utils33.postJsonToApi)({
5126
+ } = await (0, import_provider_utils34.postJsonToApi)({
4961
5127
  url,
4962
- headers: (0, import_provider_utils33.combineHeaders)(this.config.headers(), options.headers),
5128
+ headers: (0, import_provider_utils34.combineHeaders)(this.config.headers(), options.headers),
4963
5129
  body,
4964
5130
  failedResponseHandler: openaiFailedResponseHandler,
4965
- successfulResponseHandler: (0, import_provider_utils33.createJsonResponseHandler)(
5131
+ successfulResponseHandler: (0, import_provider_utils34.createJsonResponseHandler)(
4966
5132
  openaiResponsesResponseSchema
4967
5133
  ),
4968
5134
  abortSignal: options.abortSignal,
@@ -4982,6 +5148,7 @@ var OpenAIResponsesLanguageModel = class {
4982
5148
  const content = [];
4983
5149
  const logprobs = [];
4984
5150
  let hasFunctionCall = false;
5151
+ const hostedToolSearchCallIds = [];
4985
5152
  for (const part of response.output) {
4986
5153
  switch (part.type) {
4987
5154
  case "reasoning": {
@@ -5020,6 +5187,46 @@ var OpenAIResponsesLanguageModel = class {
5020
5187
  });
5021
5188
  break;
5022
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
+ }
5023
5230
  case "local_shell_call": {
5024
5231
  content.push({
5025
5232
  type: "tool-call",
@@ -5075,7 +5282,7 @@ var OpenAIResponsesLanguageModel = class {
5075
5282
  }
5076
5283
  case "message": {
5077
5284
  for (const contentPart of part.content) {
5078
- 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) {
5079
5286
  logprobs.push(contentPart.logprobs);
5080
5287
  }
5081
5288
  const providerMetadata2 = {
@@ -5097,7 +5304,7 @@ var OpenAIResponsesLanguageModel = class {
5097
5304
  content.push({
5098
5305
  type: "source",
5099
5306
  sourceType: "url",
5100
- 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)(),
5101
5308
  url: annotation.url,
5102
5309
  title: annotation.title
5103
5310
  });
@@ -5105,7 +5312,7 @@ var OpenAIResponsesLanguageModel = class {
5105
5312
  content.push({
5106
5313
  type: "source",
5107
5314
  sourceType: "document",
5108
- 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)(),
5109
5316
  mediaType: "text/plain",
5110
5317
  title: annotation.filename,
5111
5318
  filename: annotation.filename,
@@ -5121,7 +5328,7 @@ var OpenAIResponsesLanguageModel = class {
5121
5328
  content.push({
5122
5329
  type: "source",
5123
5330
  sourceType: "document",
5124
- 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)(),
5125
5332
  mediaType: "text/plain",
5126
5333
  title: annotation.filename,
5127
5334
  filename: annotation.filename,
@@ -5137,7 +5344,7 @@ var OpenAIResponsesLanguageModel = class {
5137
5344
  content.push({
5138
5345
  type: "source",
5139
5346
  sourceType: "document",
5140
- 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)(),
5141
5348
  mediaType: "application/octet-stream",
5142
5349
  title: annotation.file_id,
5143
5350
  filename: annotation.file_id,
@@ -5206,7 +5413,7 @@ var OpenAIResponsesLanguageModel = class {
5206
5413
  break;
5207
5414
  }
5208
5415
  case "mcp_call": {
5209
- 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;
5210
5417
  const toolName = `mcp.${part.name}`;
5211
5418
  content.push({
5212
5419
  type: "tool-call",
@@ -5240,8 +5447,8 @@ var OpenAIResponsesLanguageModel = class {
5240
5447
  break;
5241
5448
  }
5242
5449
  case "mcp_approval_request": {
5243
- const approvalRequestId = (_q = part.approval_request_id) != null ? _q : part.id;
5244
- 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)();
5245
5452
  const toolName = `mcp.${part.name}`;
5246
5453
  content.push({
5247
5454
  type: "tool-call",
@@ -5291,13 +5498,13 @@ var OpenAIResponsesLanguageModel = class {
5291
5498
  toolName: toolNameMapping.toCustomToolName("file_search"),
5292
5499
  result: {
5293
5500
  queries: part.queries,
5294
- results: (_v = (_u = part.results) == null ? void 0 : _u.map((result) => ({
5501
+ results: (_y = (_x = part.results) == null ? void 0 : _x.map((result) => ({
5295
5502
  attributes: result.attributes,
5296
5503
  fileId: result.file_id,
5297
5504
  filename: result.filename,
5298
5505
  score: result.score,
5299
5506
  text: result.text
5300
- }))) != null ? _v : null
5507
+ }))) != null ? _y : null
5301
5508
  }
5302
5509
  });
5303
5510
  break;
@@ -5354,10 +5561,10 @@ var OpenAIResponsesLanguageModel = class {
5354
5561
  content,
5355
5562
  finishReason: {
5356
5563
  unified: mapOpenAIResponseFinishReason({
5357
- finishReason: (_w = response.incomplete_details) == null ? void 0 : _w.reason,
5564
+ finishReason: (_z = response.incomplete_details) == null ? void 0 : _z.reason,
5358
5565
  hasFunctionCall
5359
5566
  }),
5360
- 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
5361
5568
  },
5362
5569
  usage: convertOpenAIResponsesUsage(usage),
5363
5570
  request: { body },
@@ -5382,18 +5589,18 @@ var OpenAIResponsesLanguageModel = class {
5382
5589
  providerOptionsName,
5383
5590
  isShellProviderExecuted
5384
5591
  } = await this.getArgs(options);
5385
- const { responseHeaders, value: response } = await (0, import_provider_utils33.postJsonToApi)({
5592
+ const { responseHeaders, value: response } = await (0, import_provider_utils34.postJsonToApi)({
5386
5593
  url: this.config.url({
5387
5594
  path: "/responses",
5388
5595
  modelId: this.modelId
5389
5596
  }),
5390
- headers: (0, import_provider_utils33.combineHeaders)(this.config.headers(), options.headers),
5597
+ headers: (0, import_provider_utils34.combineHeaders)(this.config.headers(), options.headers),
5391
5598
  body: {
5392
5599
  ...body,
5393
5600
  stream: true
5394
5601
  },
5395
5602
  failedResponseHandler: openaiFailedResponseHandler,
5396
- successfulResponseHandler: (0, import_provider_utils33.createEventSourceResponseHandler)(
5603
+ successfulResponseHandler: (0, import_provider_utils34.createEventSourceResponseHandler)(
5397
5604
  openaiResponsesChunkSchema
5398
5605
  ),
5399
5606
  abortSignal: options.abortSignal,
@@ -5415,6 +5622,7 @@ var OpenAIResponsesLanguageModel = class {
5415
5622
  let hasFunctionCall = false;
5416
5623
  const activeReasoning = {};
5417
5624
  let serviceTier;
5625
+ const hostedToolSearchCallIds = [];
5418
5626
  return {
5419
5627
  stream: response.pipeThrough(
5420
5628
  new TransformStream({
@@ -5422,7 +5630,7 @@ var OpenAIResponsesLanguageModel = class {
5422
5630
  controller.enqueue({ type: "stream-start", warnings });
5423
5631
  },
5424
5632
  transform(chunk, controller) {
5425
- 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;
5426
5634
  if (options.includeRawChunks) {
5427
5635
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
5428
5636
  }
@@ -5530,6 +5738,24 @@ var OpenAIResponsesLanguageModel = class {
5530
5738
  input: "{}",
5531
5739
  providerExecuted: true
5532
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") {
5533
5759
  } else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
5534
5760
  } else if (value.item.type === "apply_patch_call") {
5535
5761
  const { call_id: callId, operation } = value.item;
@@ -5576,7 +5802,7 @@ var OpenAIResponsesLanguageModel = class {
5576
5802
  } else if (value.item.type === "shell_call_output") {
5577
5803
  } else if (value.item.type === "message") {
5578
5804
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
5579
- activeMessagePhase = (_a = value.item.phase) != null ? _a : void 0;
5805
+ activeMessagePhase = (_b = value.item.phase) != null ? _b : void 0;
5580
5806
  controller.enqueue({
5581
5807
  type: "text-start",
5582
5808
  id: value.item.id,
@@ -5600,14 +5826,14 @@ var OpenAIResponsesLanguageModel = class {
5600
5826
  providerMetadata: {
5601
5827
  [providerOptionsName]: {
5602
5828
  itemId: value.item.id,
5603
- reasoningEncryptedContent: (_b = value.item.encrypted_content) != null ? _b : null
5829
+ reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
5604
5830
  }
5605
5831
  }
5606
5832
  });
5607
5833
  }
5608
5834
  } else if (isResponseOutputItemDoneChunk(value)) {
5609
5835
  if (value.item.type === "message") {
5610
- const phase = (_c = value.item.phase) != null ? _c : activeMessagePhase;
5836
+ const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
5611
5837
  activeMessagePhase = void 0;
5612
5838
  controller.enqueue({
5613
5839
  type: "text-end",
@@ -5701,13 +5927,13 @@ var OpenAIResponsesLanguageModel = class {
5701
5927
  toolName: toolNameMapping.toCustomToolName("file_search"),
5702
5928
  result: {
5703
5929
  queries: value.item.queries,
5704
- 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) => ({
5705
5931
  attributes: result.attributes,
5706
5932
  fileId: result.file_id,
5707
5933
  filename: result.filename,
5708
5934
  score: result.score,
5709
5935
  text: result.text
5710
- }))) != null ? _e : null
5936
+ }))) != null ? _f : null
5711
5937
  }
5712
5938
  });
5713
5939
  } else if (value.item.type === "code_interpreter_call") {
@@ -5729,12 +5955,62 @@ var OpenAIResponsesLanguageModel = class {
5729
5955
  result: value.item.result
5730
5956
  }
5731
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
+ });
5732
6008
  } else if (value.item.type === "mcp_call") {
5733
6009
  ongoingToolCalls[value.output_index] = void 0;
5734
- const approvalRequestId = (_f = value.item.approval_request_id) != null ? _f : void 0;
5735
- 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(
5736
6012
  approvalRequestId
5737
- )) != 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;
5738
6014
  const toolName = `mcp.${value.item.name}`;
5739
6015
  controller.enqueue({
5740
6016
  type: "tool-call",
@@ -5804,8 +6080,8 @@ var OpenAIResponsesLanguageModel = class {
5804
6080
  ongoingToolCalls[value.output_index] = void 0;
5805
6081
  } else if (value.item.type === "mcp_approval_request") {
5806
6082
  ongoingToolCalls[value.output_index] = void 0;
5807
- const dummyToolCallId = (_k = (_j = (_i = self.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : (0, import_provider_utils33.generateId)();
5808
- 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;
5809
6085
  approvalRequestIdToDummyToolCallIdFromStream.set(
5810
6086
  approvalRequestId,
5811
6087
  dummyToolCallId
@@ -5894,7 +6170,7 @@ var OpenAIResponsesLanguageModel = class {
5894
6170
  providerMetadata: {
5895
6171
  [providerOptionsName]: {
5896
6172
  itemId: value.item.id,
5897
- reasoningEncryptedContent: (_m = value.item.encrypted_content) != null ? _m : null
6173
+ reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
5898
6174
  }
5899
6175
  }
5900
6176
  });
@@ -6007,7 +6283,7 @@ var OpenAIResponsesLanguageModel = class {
6007
6283
  id: value.item_id,
6008
6284
  delta: value.delta
6009
6285
  });
6010
- 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) {
6011
6287
  logprobs.push(value.logprobs);
6012
6288
  }
6013
6289
  } else if (value.type === "response.reasoning_summary_part.added") {
@@ -6036,7 +6312,7 @@ var OpenAIResponsesLanguageModel = class {
6036
6312
  providerMetadata: {
6037
6313
  [providerOptionsName]: {
6038
6314
  itemId: value.item_id,
6039
- 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
6040
6316
  }
6041
6317
  }
6042
6318
  });
@@ -6070,10 +6346,10 @@ var OpenAIResponsesLanguageModel = class {
6070
6346
  } else if (isResponseFinishedChunk(value)) {
6071
6347
  finishReason = {
6072
6348
  unified: mapOpenAIResponseFinishReason({
6073
- finishReason: (_r = value.response.incomplete_details) == null ? void 0 : _r.reason,
6349
+ finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
6074
6350
  hasFunctionCall
6075
6351
  }),
6076
- 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
6077
6353
  };
6078
6354
  usage = value.response.usage;
6079
6355
  if (typeof value.response.service_tier === "string") {
@@ -6085,7 +6361,7 @@ var OpenAIResponsesLanguageModel = class {
6085
6361
  controller.enqueue({
6086
6362
  type: "source",
6087
6363
  sourceType: "url",
6088
- 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)(),
6089
6365
  url: value.annotation.url,
6090
6366
  title: value.annotation.title
6091
6367
  });
@@ -6093,7 +6369,7 @@ var OpenAIResponsesLanguageModel = class {
6093
6369
  controller.enqueue({
6094
6370
  type: "source",
6095
6371
  sourceType: "document",
6096
- 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)(),
6097
6373
  mediaType: "text/plain",
6098
6374
  title: value.annotation.filename,
6099
6375
  filename: value.annotation.filename,
@@ -6109,7 +6385,7 @@ var OpenAIResponsesLanguageModel = class {
6109
6385
  controller.enqueue({
6110
6386
  type: "source",
6111
6387
  sourceType: "document",
6112
- 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)(),
6113
6389
  mediaType: "text/plain",
6114
6390
  title: value.annotation.filename,
6115
6391
  filename: value.annotation.filename,
@@ -6125,7 +6401,7 @@ var OpenAIResponsesLanguageModel = class {
6125
6401
  controller.enqueue({
6126
6402
  type: "source",
6127
6403
  sourceType: "document",
6128
- 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)(),
6129
6405
  mediaType: "application/octet-stream",
6130
6406
  title: value.annotation.file_id,
6131
6407
  filename: value.annotation.file_id,