@ai-sdk/openai 3.0.0-beta.73 → 3.0.0-beta.75

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.
@@ -27,6 +27,11 @@ __export(internal_exports, {
27
27
  OpenAIResponsesLanguageModel: () => OpenAIResponsesLanguageModel,
28
28
  OpenAISpeechModel: () => OpenAISpeechModel,
29
29
  OpenAITranscriptionModel: () => OpenAITranscriptionModel,
30
+ applyPatch: () => applyPatch,
31
+ applyPatchArgsSchema: () => applyPatchArgsSchema,
32
+ applyPatchInputSchema: () => applyPatchInputSchema,
33
+ applyPatchOutputSchema: () => applyPatchOutputSchema,
34
+ applyPatchToolFactory: () => applyPatchToolFactory,
30
35
  codeInterpreter: () => codeInterpreter,
31
36
  codeInterpreterArgsSchema: () => codeInterpreterArgsSchema,
32
37
  codeInterpreterInputSchema: () => codeInterpreterInputSchema,
@@ -485,12 +490,6 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
485
490
  * Parameters for prediction mode.
486
491
  */
487
492
  prediction: import_v43.z.record(import_v43.z.string(), import_v43.z.any()).optional(),
488
- /**
489
- * Whether to use structured outputs.
490
- *
491
- * @default true
492
- */
493
- structuredOutputs: import_v43.z.boolean().optional(),
494
493
  /**
495
494
  * Service tier for the request.
496
495
  * - 'auto': Default service tier. The request will be processed with the service tier configured in the
@@ -505,7 +504,7 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
505
504
  /**
506
505
  * Whether to use strict JSON schema validation.
507
506
  *
508
- * @default false
507
+ * @default true
509
508
  */
510
509
  strictJsonSchema: import_v43.z.boolean().optional(),
511
510
  /**
@@ -544,7 +543,6 @@ var import_provider2 = require("@ai-sdk/provider");
544
543
  function prepareChatTools({
545
544
  tools,
546
545
  toolChoice,
547
- structuredOutputs,
548
546
  strictJsonSchema
549
547
  }) {
550
548
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
@@ -562,7 +560,7 @@ function prepareChatTools({
562
560
  name: tool.name,
563
561
  description: tool.description,
564
562
  parameters: tool.inputSchema,
565
- strict: structuredOutputs ? strictJsonSchema : void 0
563
+ strict: strictJsonSchema
566
564
  }
567
565
  });
568
566
  break;
@@ -631,24 +629,16 @@ var OpenAIChatLanguageModel = class {
631
629
  toolChoice,
632
630
  providerOptions
633
631
  }) {
634
- var _a, _b, _c, _d;
632
+ var _a, _b, _c;
635
633
  const warnings = [];
636
634
  const openaiOptions = (_a = await (0, import_provider_utils5.parseProviderOptions)({
637
635
  provider: "openai",
638
636
  providerOptions,
639
637
  schema: openaiChatLanguageModelOptions
640
638
  })) != null ? _a : {};
641
- const structuredOutputs = (_b = openaiOptions.structuredOutputs) != null ? _b : true;
642
639
  if (topK != null) {
643
640
  warnings.push({ type: "unsupported", feature: "topK" });
644
641
  }
645
- if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !structuredOutputs) {
646
- warnings.push({
647
- type: "unsupported",
648
- feature: "responseFormat",
649
- details: "JSON response format schema is only supported with structuredOutputs"
650
- });
651
- }
652
642
  const { messages, warnings: messageWarnings } = convertToOpenAIChatMessages(
653
643
  {
654
644
  prompt,
@@ -656,7 +646,7 @@ var OpenAIChatLanguageModel = class {
656
646
  }
657
647
  );
658
648
  warnings.push(...messageWarnings);
659
- const strictJsonSchema = (_c = openaiOptions.strictJsonSchema) != null ? _c : false;
649
+ const strictJsonSchema = (_b = openaiOptions.strictJsonSchema) != null ? _b : true;
660
650
  const baseArgs = {
661
651
  // model id:
662
652
  model: this.modelId,
@@ -672,12 +662,12 @@ var OpenAIChatLanguageModel = class {
672
662
  top_p: topP,
673
663
  frequency_penalty: frequencyPenalty,
674
664
  presence_penalty: presencePenalty,
675
- response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? structuredOutputs && responseFormat.schema != null ? {
665
+ response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
676
666
  type: "json_schema",
677
667
  json_schema: {
678
668
  schema: responseFormat.schema,
679
669
  strict: strictJsonSchema,
680
- name: (_d = responseFormat.name) != null ? _d : "response",
670
+ name: (_c = responseFormat.name) != null ? _c : "response",
681
671
  description: responseFormat.description
682
672
  }
683
673
  } : { type: "json_object" } : void 0,
@@ -791,7 +781,6 @@ var OpenAIChatLanguageModel = class {
791
781
  } = prepareChatTools({
792
782
  tools,
793
783
  toolChoice,
794
- structuredOutputs,
795
784
  strictJsonSchema
796
785
  });
797
786
  return {
@@ -2129,34 +2118,76 @@ var OpenAISpeechModel = class {
2129
2118
 
2130
2119
  // src/responses/openai-responses-language-model.ts
2131
2120
  var import_provider8 = require("@ai-sdk/provider");
2132
- var import_provider_utils30 = require("@ai-sdk/provider-utils");
2121
+ var import_provider_utils31 = require("@ai-sdk/provider-utils");
2133
2122
 
2134
2123
  // src/responses/convert-to-openai-responses-input.ts
2135
2124
  var import_provider6 = require("@ai-sdk/provider");
2136
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
2137
- var import_v413 = require("zod/v4");
2125
+ var import_provider_utils21 = require("@ai-sdk/provider-utils");
2126
+ var import_v414 = require("zod/v4");
2138
2127
 
2139
- // src/tool/local-shell.ts
2128
+ // src/tool/apply-patch.ts
2140
2129
  var import_provider_utils19 = require("@ai-sdk/provider-utils");
2141
2130
  var import_v412 = require("zod/v4");
2142
- var localShellInputSchema = (0, import_provider_utils19.lazySchema)(
2131
+ var applyPatchInputSchema = (0, import_provider_utils19.lazySchema)(
2132
+ () => (0, import_provider_utils19.zodSchema)(
2133
+ import_v412.z.object({
2134
+ callId: import_v412.z.string(),
2135
+ operation: import_v412.z.discriminatedUnion("type", [
2136
+ import_v412.z.object({
2137
+ type: import_v412.z.literal("create_file"),
2138
+ path: import_v412.z.string(),
2139
+ diff: import_v412.z.string()
2140
+ }),
2141
+ import_v412.z.object({
2142
+ type: import_v412.z.literal("delete_file"),
2143
+ path: import_v412.z.string()
2144
+ }),
2145
+ import_v412.z.object({
2146
+ type: import_v412.z.literal("update_file"),
2147
+ path: import_v412.z.string(),
2148
+ diff: import_v412.z.string()
2149
+ })
2150
+ ])
2151
+ })
2152
+ )
2153
+ );
2154
+ var applyPatchOutputSchema = (0, import_provider_utils19.lazySchema)(
2143
2155
  () => (0, import_provider_utils19.zodSchema)(
2144
2156
  import_v412.z.object({
2145
- action: import_v412.z.object({
2146
- type: import_v412.z.literal("exec"),
2147
- command: import_v412.z.array(import_v412.z.string()),
2148
- timeoutMs: import_v412.z.number().optional(),
2149
- user: import_v412.z.string().optional(),
2150
- workingDirectory: import_v412.z.string().optional(),
2151
- env: import_v412.z.record(import_v412.z.string(), import_v412.z.string()).optional()
2157
+ status: import_v412.z.enum(["completed", "failed"]),
2158
+ output: import_v412.z.string().optional()
2159
+ })
2160
+ )
2161
+ );
2162
+ var applyPatchArgsSchema = (0, import_provider_utils19.lazySchema)(() => (0, import_provider_utils19.zodSchema)(import_v412.z.object({})));
2163
+ var applyPatchToolFactory = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
2164
+ id: "openai.apply_patch",
2165
+ inputSchema: applyPatchInputSchema,
2166
+ outputSchema: applyPatchOutputSchema
2167
+ });
2168
+ var applyPatch = () => applyPatchToolFactory({});
2169
+
2170
+ // src/tool/local-shell.ts
2171
+ var import_provider_utils20 = require("@ai-sdk/provider-utils");
2172
+ var import_v413 = require("zod/v4");
2173
+ var localShellInputSchema = (0, import_provider_utils20.lazySchema)(
2174
+ () => (0, import_provider_utils20.zodSchema)(
2175
+ import_v413.z.object({
2176
+ action: import_v413.z.object({
2177
+ type: import_v413.z.literal("exec"),
2178
+ command: import_v413.z.array(import_v413.z.string()),
2179
+ timeoutMs: import_v413.z.number().optional(),
2180
+ user: import_v413.z.string().optional(),
2181
+ workingDirectory: import_v413.z.string().optional(),
2182
+ env: import_v413.z.record(import_v413.z.string(), import_v413.z.string()).optional()
2152
2183
  })
2153
2184
  })
2154
2185
  )
2155
2186
  );
2156
- var localShellOutputSchema = (0, import_provider_utils19.lazySchema)(
2157
- () => (0, import_provider_utils19.zodSchema)(import_v412.z.object({ output: import_v412.z.string() }))
2187
+ var localShellOutputSchema = (0, import_provider_utils20.lazySchema)(
2188
+ () => (0, import_provider_utils20.zodSchema)(import_v413.z.object({ output: import_v413.z.string() }))
2158
2189
  );
2159
- var localShell = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
2190
+ var localShell = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
2160
2191
  id: "openai.local_shell",
2161
2192
  inputSchema: localShellInputSchema,
2162
2193
  outputSchema: localShellOutputSchema
@@ -2173,7 +2204,8 @@ async function convertToOpenAIResponsesInput({
2173
2204
  systemMessageMode,
2174
2205
  fileIdPrefixes,
2175
2206
  store,
2176
- hasLocalShellTool = false
2207
+ hasLocalShellTool = false,
2208
+ hasApplyPatchTool = false
2177
2209
  }) {
2178
2210
  var _a, _b, _c, _d, _e;
2179
2211
  const input = [];
@@ -2221,7 +2253,7 @@ async function convertToOpenAIResponsesInput({
2221
2253
  return {
2222
2254
  type: "input_image",
2223
2255
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2224
- image_url: `data:${mediaType};base64,${(0, import_provider_utils20.convertToBase64)(part.data)}`
2256
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils21.convertToBase64)(part.data)}`
2225
2257
  },
2226
2258
  detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b2.imageDetail
2227
2259
  };
@@ -2236,7 +2268,7 @@ async function convertToOpenAIResponsesInput({
2236
2268
  type: "input_file",
2237
2269
  ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2238
2270
  filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
2239
- file_data: `data:application/pdf;base64,${(0, import_provider_utils20.convertToBase64)(part.data)}`
2271
+ file_data: `data:application/pdf;base64,${(0, import_provider_utils21.convertToBase64)(part.data)}`
2240
2272
  }
2241
2273
  };
2242
2274
  } else {
@@ -2280,7 +2312,7 @@ async function convertToOpenAIResponsesInput({
2280
2312
  part.toolName
2281
2313
  );
2282
2314
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
2283
- const parsedInput = await (0, import_provider_utils20.validateTypes)({
2315
+ const parsedInput = await (0, import_provider_utils21.validateTypes)({
2284
2316
  value: part.input,
2285
2317
  schema: localShellInputSchema
2286
2318
  });
@@ -2321,7 +2353,7 @@ async function convertToOpenAIResponsesInput({
2321
2353
  break;
2322
2354
  }
2323
2355
  case "reasoning": {
2324
- const providerOptions = await (0, import_provider_utils20.parseProviderOptions)({
2356
+ const providerOptions = await (0, import_provider_utils21.parseProviderOptions)({
2325
2357
  provider: "openai",
2326
2358
  providerOptions: part.providerOptions,
2327
2359
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -2385,7 +2417,7 @@ async function convertToOpenAIResponsesInput({
2385
2417
  part.toolName
2386
2418
  );
2387
2419
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
2388
- const parsedOutput = await (0, import_provider_utils20.validateTypes)({
2420
+ const parsedOutput = await (0, import_provider_utils21.validateTypes)({
2389
2421
  value: output.value,
2390
2422
  schema: localShellOutputSchema
2391
2423
  });
@@ -2396,6 +2428,19 @@ async function convertToOpenAIResponsesInput({
2396
2428
  });
2397
2429
  break;
2398
2430
  }
2431
+ if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
2432
+ const parsedOutput = await (0, import_provider_utils21.validateTypes)({
2433
+ value: output.value,
2434
+ schema: applyPatchOutputSchema
2435
+ });
2436
+ input.push({
2437
+ type: "apply_patch_call_output",
2438
+ call_id: part.toolCallId,
2439
+ status: parsedOutput.status,
2440
+ output: parsedOutput.output
2441
+ });
2442
+ break;
2443
+ }
2399
2444
  let contentValue;
2400
2445
  switch (output.type) {
2401
2446
  case "text":
@@ -2437,7 +2482,7 @@ async function convertToOpenAIResponsesInput({
2437
2482
  return void 0;
2438
2483
  }
2439
2484
  }
2440
- }).filter(import_provider_utils20.isNonNullable);
2485
+ }).filter(import_provider_utils21.isNonNullable);
2441
2486
  break;
2442
2487
  }
2443
2488
  input.push({
@@ -2456,9 +2501,9 @@ async function convertToOpenAIResponsesInput({
2456
2501
  }
2457
2502
  return { input, warnings };
2458
2503
  }
2459
- var openaiResponsesReasoningProviderOptionsSchema = import_v413.z.object({
2460
- itemId: import_v413.z.string().nullish(),
2461
- reasoningEncryptedContent: import_v413.z.string().nullish()
2504
+ var openaiResponsesReasoningProviderOptionsSchema = import_v414.z.object({
2505
+ itemId: import_v414.z.string().nullish(),
2506
+ reasoningEncryptedContent: import_v414.z.string().nullish()
2462
2507
  });
2463
2508
 
2464
2509
  // src/responses/map-openai-responses-finish-reason.ts
@@ -2480,349 +2525,393 @@ function mapOpenAIResponseFinishReason({
2480
2525
  }
2481
2526
 
2482
2527
  // src/responses/openai-responses-api.ts
2483
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
2484
- var import_v414 = require("zod/v4");
2485
- var openaiResponsesChunkSchema = (0, import_provider_utils21.lazySchema)(
2486
- () => (0, import_provider_utils21.zodSchema)(
2487
- import_v414.z.union([
2488
- import_v414.z.object({
2489
- type: import_v414.z.literal("response.output_text.delta"),
2490
- item_id: import_v414.z.string(),
2491
- delta: import_v414.z.string(),
2492
- logprobs: import_v414.z.array(
2493
- import_v414.z.object({
2494
- token: import_v414.z.string(),
2495
- logprob: import_v414.z.number(),
2496
- top_logprobs: import_v414.z.array(
2497
- import_v414.z.object({
2498
- token: import_v414.z.string(),
2499
- logprob: import_v414.z.number()
2528
+ var import_provider_utils22 = require("@ai-sdk/provider-utils");
2529
+ var import_v415 = require("zod/v4");
2530
+ var openaiResponsesChunkSchema = (0, import_provider_utils22.lazySchema)(
2531
+ () => (0, import_provider_utils22.zodSchema)(
2532
+ import_v415.z.union([
2533
+ import_v415.z.object({
2534
+ type: import_v415.z.literal("response.output_text.delta"),
2535
+ item_id: import_v415.z.string(),
2536
+ delta: import_v415.z.string(),
2537
+ logprobs: import_v415.z.array(
2538
+ import_v415.z.object({
2539
+ token: import_v415.z.string(),
2540
+ logprob: import_v415.z.number(),
2541
+ top_logprobs: import_v415.z.array(
2542
+ import_v415.z.object({
2543
+ token: import_v415.z.string(),
2544
+ logprob: import_v415.z.number()
2500
2545
  })
2501
2546
  )
2502
2547
  })
2503
2548
  ).nullish()
2504
2549
  }),
2505
- import_v414.z.object({
2506
- type: import_v414.z.enum(["response.completed", "response.incomplete"]),
2507
- response: import_v414.z.object({
2508
- incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
2509
- usage: import_v414.z.object({
2510
- input_tokens: import_v414.z.number(),
2511
- input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
2512
- output_tokens: import_v414.z.number(),
2513
- output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
2550
+ import_v415.z.object({
2551
+ type: import_v415.z.enum(["response.completed", "response.incomplete"]),
2552
+ response: import_v415.z.object({
2553
+ incomplete_details: import_v415.z.object({ reason: import_v415.z.string() }).nullish(),
2554
+ usage: import_v415.z.object({
2555
+ input_tokens: import_v415.z.number(),
2556
+ input_tokens_details: import_v415.z.object({ cached_tokens: import_v415.z.number().nullish() }).nullish(),
2557
+ output_tokens: import_v415.z.number(),
2558
+ output_tokens_details: import_v415.z.object({ reasoning_tokens: import_v415.z.number().nullish() }).nullish()
2514
2559
  }),
2515
- service_tier: import_v414.z.string().nullish()
2560
+ service_tier: import_v415.z.string().nullish()
2516
2561
  })
2517
2562
  }),
2518
- import_v414.z.object({
2519
- type: import_v414.z.literal("response.created"),
2520
- response: import_v414.z.object({
2521
- id: import_v414.z.string(),
2522
- created_at: import_v414.z.number(),
2523
- model: import_v414.z.string(),
2524
- service_tier: import_v414.z.string().nullish()
2563
+ import_v415.z.object({
2564
+ type: import_v415.z.literal("response.created"),
2565
+ response: import_v415.z.object({
2566
+ id: import_v415.z.string(),
2567
+ created_at: import_v415.z.number(),
2568
+ model: import_v415.z.string(),
2569
+ service_tier: import_v415.z.string().nullish()
2525
2570
  })
2526
2571
  }),
2527
- import_v414.z.object({
2528
- type: import_v414.z.literal("response.output_item.added"),
2529
- output_index: import_v414.z.number(),
2530
- item: import_v414.z.discriminatedUnion("type", [
2531
- import_v414.z.object({
2532
- type: import_v414.z.literal("message"),
2533
- id: import_v414.z.string()
2572
+ import_v415.z.object({
2573
+ type: import_v415.z.literal("response.output_item.added"),
2574
+ output_index: import_v415.z.number(),
2575
+ item: import_v415.z.discriminatedUnion("type", [
2576
+ import_v415.z.object({
2577
+ type: import_v415.z.literal("message"),
2578
+ id: import_v415.z.string()
2534
2579
  }),
2535
- import_v414.z.object({
2536
- type: import_v414.z.literal("reasoning"),
2537
- id: import_v414.z.string(),
2538
- encrypted_content: import_v414.z.string().nullish()
2580
+ import_v415.z.object({
2581
+ type: import_v415.z.literal("reasoning"),
2582
+ id: import_v415.z.string(),
2583
+ encrypted_content: import_v415.z.string().nullish()
2539
2584
  }),
2540
- import_v414.z.object({
2541
- type: import_v414.z.literal("function_call"),
2542
- id: import_v414.z.string(),
2543
- call_id: import_v414.z.string(),
2544
- name: import_v414.z.string(),
2545
- arguments: import_v414.z.string()
2585
+ import_v415.z.object({
2586
+ type: import_v415.z.literal("function_call"),
2587
+ id: import_v415.z.string(),
2588
+ call_id: import_v415.z.string(),
2589
+ name: import_v415.z.string(),
2590
+ arguments: import_v415.z.string()
2546
2591
  }),
2547
- import_v414.z.object({
2548
- type: import_v414.z.literal("web_search_call"),
2549
- id: import_v414.z.string(),
2550
- status: import_v414.z.string()
2592
+ import_v415.z.object({
2593
+ type: import_v415.z.literal("web_search_call"),
2594
+ id: import_v415.z.string(),
2595
+ status: import_v415.z.string()
2551
2596
  }),
2552
- import_v414.z.object({
2553
- type: import_v414.z.literal("computer_call"),
2554
- id: import_v414.z.string(),
2555
- status: import_v414.z.string()
2597
+ import_v415.z.object({
2598
+ type: import_v415.z.literal("computer_call"),
2599
+ id: import_v415.z.string(),
2600
+ status: import_v415.z.string()
2556
2601
  }),
2557
- import_v414.z.object({
2558
- type: import_v414.z.literal("file_search_call"),
2559
- id: import_v414.z.string()
2602
+ import_v415.z.object({
2603
+ type: import_v415.z.literal("file_search_call"),
2604
+ id: import_v415.z.string()
2560
2605
  }),
2561
- import_v414.z.object({
2562
- type: import_v414.z.literal("image_generation_call"),
2563
- id: import_v414.z.string()
2606
+ import_v415.z.object({
2607
+ type: import_v415.z.literal("image_generation_call"),
2608
+ id: import_v415.z.string()
2564
2609
  }),
2565
- import_v414.z.object({
2566
- type: import_v414.z.literal("code_interpreter_call"),
2567
- id: import_v414.z.string(),
2568
- container_id: import_v414.z.string(),
2569
- code: import_v414.z.string().nullable(),
2570
- outputs: import_v414.z.array(
2571
- import_v414.z.discriminatedUnion("type", [
2572
- import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
2573
- import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
2610
+ import_v415.z.object({
2611
+ type: import_v415.z.literal("code_interpreter_call"),
2612
+ id: import_v415.z.string(),
2613
+ container_id: import_v415.z.string(),
2614
+ code: import_v415.z.string().nullable(),
2615
+ outputs: import_v415.z.array(
2616
+ import_v415.z.discriminatedUnion("type", [
2617
+ import_v415.z.object({ type: import_v415.z.literal("logs"), logs: import_v415.z.string() }),
2618
+ import_v415.z.object({ type: import_v415.z.literal("image"), url: import_v415.z.string() })
2574
2619
  ])
2575
2620
  ).nullable(),
2576
- status: import_v414.z.string()
2621
+ status: import_v415.z.string()
2577
2622
  }),
2578
- import_v414.z.object({
2579
- type: import_v414.z.literal("mcp_call"),
2580
- id: import_v414.z.string(),
2581
- status: import_v414.z.string()
2623
+ import_v415.z.object({
2624
+ type: import_v415.z.literal("mcp_call"),
2625
+ id: import_v415.z.string(),
2626
+ status: import_v415.z.string()
2582
2627
  }),
2583
- import_v414.z.object({
2584
- type: import_v414.z.literal("mcp_list_tools"),
2585
- id: import_v414.z.string()
2628
+ import_v415.z.object({
2629
+ type: import_v415.z.literal("mcp_list_tools"),
2630
+ id: import_v415.z.string()
2586
2631
  }),
2587
- import_v414.z.object({
2588
- type: import_v414.z.literal("mcp_approval_request"),
2589
- id: import_v414.z.string()
2632
+ import_v415.z.object({
2633
+ type: import_v415.z.literal("mcp_approval_request"),
2634
+ id: import_v415.z.string()
2635
+ }),
2636
+ import_v415.z.object({
2637
+ type: import_v415.z.literal("apply_patch_call"),
2638
+ id: import_v415.z.string(),
2639
+ call_id: import_v415.z.string(),
2640
+ status: import_v415.z.enum(["in_progress", "completed"]),
2641
+ operation: import_v415.z.discriminatedUnion("type", [
2642
+ import_v415.z.object({
2643
+ type: import_v415.z.literal("create_file"),
2644
+ path: import_v415.z.string(),
2645
+ diff: import_v415.z.string()
2646
+ }),
2647
+ import_v415.z.object({
2648
+ type: import_v415.z.literal("delete_file"),
2649
+ path: import_v415.z.string()
2650
+ }),
2651
+ import_v415.z.object({
2652
+ type: import_v415.z.literal("update_file"),
2653
+ path: import_v415.z.string(),
2654
+ diff: import_v415.z.string()
2655
+ })
2656
+ ])
2590
2657
  })
2591
2658
  ])
2592
2659
  }),
2593
- import_v414.z.object({
2594
- type: import_v414.z.literal("response.output_item.done"),
2595
- output_index: import_v414.z.number(),
2596
- item: import_v414.z.discriminatedUnion("type", [
2597
- import_v414.z.object({
2598
- type: import_v414.z.literal("message"),
2599
- id: import_v414.z.string()
2660
+ import_v415.z.object({
2661
+ type: import_v415.z.literal("response.output_item.done"),
2662
+ output_index: import_v415.z.number(),
2663
+ item: import_v415.z.discriminatedUnion("type", [
2664
+ import_v415.z.object({
2665
+ type: import_v415.z.literal("message"),
2666
+ id: import_v415.z.string()
2600
2667
  }),
2601
- import_v414.z.object({
2602
- type: import_v414.z.literal("reasoning"),
2603
- id: import_v414.z.string(),
2604
- encrypted_content: import_v414.z.string().nullish()
2668
+ import_v415.z.object({
2669
+ type: import_v415.z.literal("reasoning"),
2670
+ id: import_v415.z.string(),
2671
+ encrypted_content: import_v415.z.string().nullish()
2605
2672
  }),
2606
- import_v414.z.object({
2607
- type: import_v414.z.literal("function_call"),
2608
- id: import_v414.z.string(),
2609
- call_id: import_v414.z.string(),
2610
- name: import_v414.z.string(),
2611
- arguments: import_v414.z.string(),
2612
- status: import_v414.z.literal("completed")
2673
+ import_v415.z.object({
2674
+ type: import_v415.z.literal("function_call"),
2675
+ id: import_v415.z.string(),
2676
+ call_id: import_v415.z.string(),
2677
+ name: import_v415.z.string(),
2678
+ arguments: import_v415.z.string(),
2679
+ status: import_v415.z.literal("completed")
2613
2680
  }),
2614
- import_v414.z.object({
2615
- type: import_v414.z.literal("code_interpreter_call"),
2616
- id: import_v414.z.string(),
2617
- code: import_v414.z.string().nullable(),
2618
- container_id: import_v414.z.string(),
2619
- outputs: import_v414.z.array(
2620
- import_v414.z.discriminatedUnion("type", [
2621
- import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
2622
- import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
2681
+ import_v415.z.object({
2682
+ type: import_v415.z.literal("code_interpreter_call"),
2683
+ id: import_v415.z.string(),
2684
+ code: import_v415.z.string().nullable(),
2685
+ container_id: import_v415.z.string(),
2686
+ outputs: import_v415.z.array(
2687
+ import_v415.z.discriminatedUnion("type", [
2688
+ import_v415.z.object({ type: import_v415.z.literal("logs"), logs: import_v415.z.string() }),
2689
+ import_v415.z.object({ type: import_v415.z.literal("image"), url: import_v415.z.string() })
2623
2690
  ])
2624
2691
  ).nullable()
2625
2692
  }),
2626
- import_v414.z.object({
2627
- type: import_v414.z.literal("image_generation_call"),
2628
- id: import_v414.z.string(),
2629
- result: import_v414.z.string()
2693
+ import_v415.z.object({
2694
+ type: import_v415.z.literal("image_generation_call"),
2695
+ id: import_v415.z.string(),
2696
+ result: import_v415.z.string()
2630
2697
  }),
2631
- import_v414.z.object({
2632
- type: import_v414.z.literal("web_search_call"),
2633
- id: import_v414.z.string(),
2634
- status: import_v414.z.string(),
2635
- action: import_v414.z.discriminatedUnion("type", [
2636
- import_v414.z.object({
2637
- type: import_v414.z.literal("search"),
2638
- query: import_v414.z.string().nullish(),
2639
- sources: import_v414.z.array(
2640
- import_v414.z.discriminatedUnion("type", [
2641
- import_v414.z.object({ type: import_v414.z.literal("url"), url: import_v414.z.string() }),
2642
- import_v414.z.object({ type: import_v414.z.literal("api"), name: import_v414.z.string() })
2698
+ import_v415.z.object({
2699
+ type: import_v415.z.literal("web_search_call"),
2700
+ id: import_v415.z.string(),
2701
+ status: import_v415.z.string(),
2702
+ action: import_v415.z.discriminatedUnion("type", [
2703
+ import_v415.z.object({
2704
+ type: import_v415.z.literal("search"),
2705
+ query: import_v415.z.string().nullish(),
2706
+ sources: import_v415.z.array(
2707
+ import_v415.z.discriminatedUnion("type", [
2708
+ import_v415.z.object({ type: import_v415.z.literal("url"), url: import_v415.z.string() }),
2709
+ import_v415.z.object({ type: import_v415.z.literal("api"), name: import_v415.z.string() })
2643
2710
  ])
2644
2711
  ).nullish()
2645
2712
  }),
2646
- import_v414.z.object({
2647
- type: import_v414.z.literal("open_page"),
2648
- url: import_v414.z.string()
2713
+ import_v415.z.object({
2714
+ type: import_v415.z.literal("open_page"),
2715
+ url: import_v415.z.string()
2649
2716
  }),
2650
- import_v414.z.object({
2651
- type: import_v414.z.literal("find"),
2652
- url: import_v414.z.string(),
2653
- pattern: import_v414.z.string()
2717
+ import_v415.z.object({
2718
+ type: import_v415.z.literal("find"),
2719
+ url: import_v415.z.string(),
2720
+ pattern: import_v415.z.string()
2654
2721
  })
2655
2722
  ])
2656
2723
  }),
2657
- import_v414.z.object({
2658
- type: import_v414.z.literal("file_search_call"),
2659
- id: import_v414.z.string(),
2660
- queries: import_v414.z.array(import_v414.z.string()),
2661
- results: import_v414.z.array(
2662
- import_v414.z.object({
2663
- attributes: import_v414.z.record(
2664
- import_v414.z.string(),
2665
- import_v414.z.union([import_v414.z.string(), import_v414.z.number(), import_v414.z.boolean()])
2724
+ import_v415.z.object({
2725
+ type: import_v415.z.literal("file_search_call"),
2726
+ id: import_v415.z.string(),
2727
+ queries: import_v415.z.array(import_v415.z.string()),
2728
+ results: import_v415.z.array(
2729
+ import_v415.z.object({
2730
+ attributes: import_v415.z.record(
2731
+ import_v415.z.string(),
2732
+ import_v415.z.union([import_v415.z.string(), import_v415.z.number(), import_v415.z.boolean()])
2666
2733
  ),
2667
- file_id: import_v414.z.string(),
2668
- filename: import_v414.z.string(),
2669
- score: import_v414.z.number(),
2670
- text: import_v414.z.string()
2734
+ file_id: import_v415.z.string(),
2735
+ filename: import_v415.z.string(),
2736
+ score: import_v415.z.number(),
2737
+ text: import_v415.z.string()
2671
2738
  })
2672
2739
  ).nullish()
2673
2740
  }),
2674
- import_v414.z.object({
2675
- type: import_v414.z.literal("local_shell_call"),
2676
- id: import_v414.z.string(),
2677
- call_id: import_v414.z.string(),
2678
- action: import_v414.z.object({
2679
- type: import_v414.z.literal("exec"),
2680
- command: import_v414.z.array(import_v414.z.string()),
2681
- timeout_ms: import_v414.z.number().optional(),
2682
- user: import_v414.z.string().optional(),
2683
- working_directory: import_v414.z.string().optional(),
2684
- env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
2741
+ import_v415.z.object({
2742
+ type: import_v415.z.literal("local_shell_call"),
2743
+ id: import_v415.z.string(),
2744
+ call_id: import_v415.z.string(),
2745
+ action: import_v415.z.object({
2746
+ type: import_v415.z.literal("exec"),
2747
+ command: import_v415.z.array(import_v415.z.string()),
2748
+ timeout_ms: import_v415.z.number().optional(),
2749
+ user: import_v415.z.string().optional(),
2750
+ working_directory: import_v415.z.string().optional(),
2751
+ env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
2685
2752
  })
2686
2753
  }),
2687
- import_v414.z.object({
2688
- type: import_v414.z.literal("computer_call"),
2689
- id: import_v414.z.string(),
2690
- status: import_v414.z.literal("completed")
2754
+ import_v415.z.object({
2755
+ type: import_v415.z.literal("computer_call"),
2756
+ id: import_v415.z.string(),
2757
+ status: import_v415.z.literal("completed")
2691
2758
  }),
2692
- import_v414.z.object({
2693
- type: import_v414.z.literal("mcp_call"),
2694
- id: import_v414.z.string(),
2695
- status: import_v414.z.string(),
2696
- arguments: import_v414.z.string(),
2697
- name: import_v414.z.string(),
2698
- server_label: import_v414.z.string(),
2699
- output: import_v414.z.string().nullish(),
2700
- error: import_v414.z.union([
2701
- import_v414.z.string(),
2702
- import_v414.z.object({
2703
- type: import_v414.z.string().optional(),
2704
- code: import_v414.z.union([import_v414.z.number(), import_v414.z.string()]).optional(),
2705
- message: import_v414.z.string().optional()
2759
+ import_v415.z.object({
2760
+ type: import_v415.z.literal("mcp_call"),
2761
+ id: import_v415.z.string(),
2762
+ status: import_v415.z.string(),
2763
+ arguments: import_v415.z.string(),
2764
+ name: import_v415.z.string(),
2765
+ server_label: import_v415.z.string(),
2766
+ output: import_v415.z.string().nullish(),
2767
+ error: import_v415.z.union([
2768
+ import_v415.z.string(),
2769
+ import_v415.z.object({
2770
+ type: import_v415.z.string().optional(),
2771
+ code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
2772
+ message: import_v415.z.string().optional()
2706
2773
  }).loose()
2707
2774
  ]).nullish()
2708
2775
  }),
2709
- import_v414.z.object({
2710
- type: import_v414.z.literal("mcp_list_tools"),
2711
- id: import_v414.z.string(),
2712
- server_label: import_v414.z.string(),
2713
- tools: import_v414.z.array(
2714
- import_v414.z.object({
2715
- name: import_v414.z.string(),
2716
- description: import_v414.z.string().optional(),
2717
- input_schema: import_v414.z.any(),
2718
- annotations: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()).optional()
2776
+ import_v415.z.object({
2777
+ type: import_v415.z.literal("mcp_list_tools"),
2778
+ id: import_v415.z.string(),
2779
+ server_label: import_v415.z.string(),
2780
+ tools: import_v415.z.array(
2781
+ import_v415.z.object({
2782
+ name: import_v415.z.string(),
2783
+ description: import_v415.z.string().optional(),
2784
+ input_schema: import_v415.z.any(),
2785
+ annotations: import_v415.z.record(import_v415.z.string(), import_v415.z.unknown()).optional()
2719
2786
  })
2720
2787
  ),
2721
- error: import_v414.z.union([
2722
- import_v414.z.string(),
2723
- import_v414.z.object({
2724
- type: import_v414.z.string().optional(),
2725
- code: import_v414.z.union([import_v414.z.number(), import_v414.z.string()]).optional(),
2726
- message: import_v414.z.string().optional()
2788
+ error: import_v415.z.union([
2789
+ import_v415.z.string(),
2790
+ import_v415.z.object({
2791
+ type: import_v415.z.string().optional(),
2792
+ code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
2793
+ message: import_v415.z.string().optional()
2727
2794
  }).loose()
2728
2795
  ]).optional()
2729
2796
  }),
2730
- import_v414.z.object({
2731
- type: import_v414.z.literal("mcp_approval_request"),
2732
- id: import_v414.z.string(),
2733
- server_label: import_v414.z.string(),
2734
- name: import_v414.z.string(),
2735
- arguments: import_v414.z.string(),
2736
- approval_request_id: import_v414.z.string()
2797
+ import_v415.z.object({
2798
+ type: import_v415.z.literal("mcp_approval_request"),
2799
+ id: import_v415.z.string(),
2800
+ server_label: import_v415.z.string(),
2801
+ name: import_v415.z.string(),
2802
+ arguments: import_v415.z.string(),
2803
+ approval_request_id: import_v415.z.string()
2804
+ }),
2805
+ import_v415.z.object({
2806
+ type: import_v415.z.literal("apply_patch_call"),
2807
+ id: import_v415.z.string(),
2808
+ call_id: import_v415.z.string(),
2809
+ status: import_v415.z.enum(["in_progress", "completed"]),
2810
+ operation: import_v415.z.discriminatedUnion("type", [
2811
+ import_v415.z.object({
2812
+ type: import_v415.z.literal("create_file"),
2813
+ path: import_v415.z.string(),
2814
+ diff: import_v415.z.string()
2815
+ }),
2816
+ import_v415.z.object({
2817
+ type: import_v415.z.literal("delete_file"),
2818
+ path: import_v415.z.string()
2819
+ }),
2820
+ import_v415.z.object({
2821
+ type: import_v415.z.literal("update_file"),
2822
+ path: import_v415.z.string(),
2823
+ diff: import_v415.z.string()
2824
+ })
2825
+ ])
2737
2826
  })
2738
2827
  ])
2739
2828
  }),
2740
- import_v414.z.object({
2741
- type: import_v414.z.literal("response.function_call_arguments.delta"),
2742
- item_id: import_v414.z.string(),
2743
- output_index: import_v414.z.number(),
2744
- delta: import_v414.z.string()
2829
+ import_v415.z.object({
2830
+ type: import_v415.z.literal("response.function_call_arguments.delta"),
2831
+ item_id: import_v415.z.string(),
2832
+ output_index: import_v415.z.number(),
2833
+ delta: import_v415.z.string()
2745
2834
  }),
2746
- import_v414.z.object({
2747
- type: import_v414.z.literal("response.image_generation_call.partial_image"),
2748
- item_id: import_v414.z.string(),
2749
- output_index: import_v414.z.number(),
2750
- partial_image_b64: import_v414.z.string()
2835
+ import_v415.z.object({
2836
+ type: import_v415.z.literal("response.image_generation_call.partial_image"),
2837
+ item_id: import_v415.z.string(),
2838
+ output_index: import_v415.z.number(),
2839
+ partial_image_b64: import_v415.z.string()
2751
2840
  }),
2752
- import_v414.z.object({
2753
- type: import_v414.z.literal("response.code_interpreter_call_code.delta"),
2754
- item_id: import_v414.z.string(),
2755
- output_index: import_v414.z.number(),
2756
- delta: import_v414.z.string()
2841
+ import_v415.z.object({
2842
+ type: import_v415.z.literal("response.code_interpreter_call_code.delta"),
2843
+ item_id: import_v415.z.string(),
2844
+ output_index: import_v415.z.number(),
2845
+ delta: import_v415.z.string()
2757
2846
  }),
2758
- import_v414.z.object({
2759
- type: import_v414.z.literal("response.code_interpreter_call_code.done"),
2760
- item_id: import_v414.z.string(),
2761
- output_index: import_v414.z.number(),
2762
- code: import_v414.z.string()
2847
+ import_v415.z.object({
2848
+ type: import_v415.z.literal("response.code_interpreter_call_code.done"),
2849
+ item_id: import_v415.z.string(),
2850
+ output_index: import_v415.z.number(),
2851
+ code: import_v415.z.string()
2763
2852
  }),
2764
- import_v414.z.object({
2765
- type: import_v414.z.literal("response.output_text.annotation.added"),
2766
- annotation: import_v414.z.discriminatedUnion("type", [
2767
- import_v414.z.object({
2768
- type: import_v414.z.literal("url_citation"),
2769
- start_index: import_v414.z.number(),
2770
- end_index: import_v414.z.number(),
2771
- url: import_v414.z.string(),
2772
- title: import_v414.z.string()
2853
+ import_v415.z.object({
2854
+ type: import_v415.z.literal("response.output_text.annotation.added"),
2855
+ annotation: import_v415.z.discriminatedUnion("type", [
2856
+ import_v415.z.object({
2857
+ type: import_v415.z.literal("url_citation"),
2858
+ start_index: import_v415.z.number(),
2859
+ end_index: import_v415.z.number(),
2860
+ url: import_v415.z.string(),
2861
+ title: import_v415.z.string()
2773
2862
  }),
2774
- import_v414.z.object({
2775
- type: import_v414.z.literal("file_citation"),
2776
- file_id: import_v414.z.string(),
2777
- filename: import_v414.z.string().nullish(),
2778
- index: import_v414.z.number().nullish(),
2779
- start_index: import_v414.z.number().nullish(),
2780
- end_index: import_v414.z.number().nullish(),
2781
- quote: import_v414.z.string().nullish()
2863
+ import_v415.z.object({
2864
+ type: import_v415.z.literal("file_citation"),
2865
+ file_id: import_v415.z.string(),
2866
+ filename: import_v415.z.string().nullish(),
2867
+ index: import_v415.z.number().nullish(),
2868
+ start_index: import_v415.z.number().nullish(),
2869
+ end_index: import_v415.z.number().nullish(),
2870
+ quote: import_v415.z.string().nullish()
2782
2871
  }),
2783
- import_v414.z.object({
2784
- type: import_v414.z.literal("container_file_citation"),
2785
- container_id: import_v414.z.string(),
2786
- file_id: import_v414.z.string(),
2787
- filename: import_v414.z.string().nullish(),
2788
- start_index: import_v414.z.number().nullish(),
2789
- end_index: import_v414.z.number().nullish(),
2790
- index: import_v414.z.number().nullish()
2872
+ import_v415.z.object({
2873
+ type: import_v415.z.literal("container_file_citation"),
2874
+ container_id: import_v415.z.string(),
2875
+ file_id: import_v415.z.string(),
2876
+ filename: import_v415.z.string().nullish(),
2877
+ start_index: import_v415.z.number().nullish(),
2878
+ end_index: import_v415.z.number().nullish(),
2879
+ index: import_v415.z.number().nullish()
2791
2880
  }),
2792
- import_v414.z.object({
2793
- type: import_v414.z.literal("file_path"),
2794
- file_id: import_v414.z.string(),
2795
- index: import_v414.z.number().nullish()
2881
+ import_v415.z.object({
2882
+ type: import_v415.z.literal("file_path"),
2883
+ file_id: import_v415.z.string(),
2884
+ index: import_v415.z.number().nullish()
2796
2885
  })
2797
2886
  ])
2798
2887
  }),
2799
- import_v414.z.object({
2800
- type: import_v414.z.literal("response.reasoning_summary_part.added"),
2801
- item_id: import_v414.z.string(),
2802
- summary_index: import_v414.z.number()
2888
+ import_v415.z.object({
2889
+ type: import_v415.z.literal("response.reasoning_summary_part.added"),
2890
+ item_id: import_v415.z.string(),
2891
+ summary_index: import_v415.z.number()
2803
2892
  }),
2804
- import_v414.z.object({
2805
- type: import_v414.z.literal("response.reasoning_summary_text.delta"),
2806
- item_id: import_v414.z.string(),
2807
- summary_index: import_v414.z.number(),
2808
- delta: import_v414.z.string()
2893
+ import_v415.z.object({
2894
+ type: import_v415.z.literal("response.reasoning_summary_text.delta"),
2895
+ item_id: import_v415.z.string(),
2896
+ summary_index: import_v415.z.number(),
2897
+ delta: import_v415.z.string()
2809
2898
  }),
2810
- import_v414.z.object({
2811
- type: import_v414.z.literal("response.reasoning_summary_part.done"),
2812
- item_id: import_v414.z.string(),
2813
- summary_index: import_v414.z.number()
2899
+ import_v415.z.object({
2900
+ type: import_v415.z.literal("response.reasoning_summary_part.done"),
2901
+ item_id: import_v415.z.string(),
2902
+ summary_index: import_v415.z.number()
2814
2903
  }),
2815
- import_v414.z.object({
2816
- type: import_v414.z.literal("error"),
2817
- sequence_number: import_v414.z.number(),
2818
- error: import_v414.z.object({
2819
- type: import_v414.z.string(),
2820
- code: import_v414.z.string(),
2821
- message: import_v414.z.string(),
2822
- param: import_v414.z.string().nullish()
2904
+ import_v415.z.object({
2905
+ type: import_v415.z.literal("error"),
2906
+ sequence_number: import_v415.z.number(),
2907
+ error: import_v415.z.object({
2908
+ type: import_v415.z.string(),
2909
+ code: import_v415.z.string(),
2910
+ message: import_v415.z.string(),
2911
+ param: import_v415.z.string().nullish()
2823
2912
  })
2824
2913
  }),
2825
- import_v414.z.object({ type: import_v414.z.string() }).loose().transform((value) => ({
2914
+ import_v415.z.object({ type: import_v415.z.string() }).loose().transform((value) => ({
2826
2915
  type: "unknown_chunk",
2827
2916
  message: value.type
2828
2917
  }))
@@ -2830,236 +2919,258 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazySchema)(
2830
2919
  ])
2831
2920
  )
2832
2921
  );
2833
- var openaiResponsesResponseSchema = (0, import_provider_utils21.lazySchema)(
2834
- () => (0, import_provider_utils21.zodSchema)(
2835
- import_v414.z.object({
2836
- id: import_v414.z.string().optional(),
2837
- created_at: import_v414.z.number().optional(),
2838
- error: import_v414.z.object({
2839
- message: import_v414.z.string(),
2840
- type: import_v414.z.string(),
2841
- param: import_v414.z.string().nullish(),
2842
- code: import_v414.z.string()
2922
+ var openaiResponsesResponseSchema = (0, import_provider_utils22.lazySchema)(
2923
+ () => (0, import_provider_utils22.zodSchema)(
2924
+ import_v415.z.object({
2925
+ id: import_v415.z.string().optional(),
2926
+ created_at: import_v415.z.number().optional(),
2927
+ error: import_v415.z.object({
2928
+ message: import_v415.z.string(),
2929
+ type: import_v415.z.string(),
2930
+ param: import_v415.z.string().nullish(),
2931
+ code: import_v415.z.string()
2843
2932
  }).nullish(),
2844
- model: import_v414.z.string().optional(),
2845
- output: import_v414.z.array(
2846
- import_v414.z.discriminatedUnion("type", [
2847
- import_v414.z.object({
2848
- type: import_v414.z.literal("message"),
2849
- role: import_v414.z.literal("assistant"),
2850
- id: import_v414.z.string(),
2851
- content: import_v414.z.array(
2852
- import_v414.z.object({
2853
- type: import_v414.z.literal("output_text"),
2854
- text: import_v414.z.string(),
2855
- logprobs: import_v414.z.array(
2856
- import_v414.z.object({
2857
- token: import_v414.z.string(),
2858
- logprob: import_v414.z.number(),
2859
- top_logprobs: import_v414.z.array(
2860
- import_v414.z.object({
2861
- token: import_v414.z.string(),
2862
- logprob: import_v414.z.number()
2933
+ model: import_v415.z.string().optional(),
2934
+ output: import_v415.z.array(
2935
+ import_v415.z.discriminatedUnion("type", [
2936
+ import_v415.z.object({
2937
+ type: import_v415.z.literal("message"),
2938
+ role: import_v415.z.literal("assistant"),
2939
+ id: import_v415.z.string(),
2940
+ content: import_v415.z.array(
2941
+ import_v415.z.object({
2942
+ type: import_v415.z.literal("output_text"),
2943
+ text: import_v415.z.string(),
2944
+ logprobs: import_v415.z.array(
2945
+ import_v415.z.object({
2946
+ token: import_v415.z.string(),
2947
+ logprob: import_v415.z.number(),
2948
+ top_logprobs: import_v415.z.array(
2949
+ import_v415.z.object({
2950
+ token: import_v415.z.string(),
2951
+ logprob: import_v415.z.number()
2863
2952
  })
2864
2953
  )
2865
2954
  })
2866
2955
  ).nullish(),
2867
- annotations: import_v414.z.array(
2868
- import_v414.z.discriminatedUnion("type", [
2869
- import_v414.z.object({
2870
- type: import_v414.z.literal("url_citation"),
2871
- start_index: import_v414.z.number(),
2872
- end_index: import_v414.z.number(),
2873
- url: import_v414.z.string(),
2874
- title: import_v414.z.string()
2956
+ annotations: import_v415.z.array(
2957
+ import_v415.z.discriminatedUnion("type", [
2958
+ import_v415.z.object({
2959
+ type: import_v415.z.literal("url_citation"),
2960
+ start_index: import_v415.z.number(),
2961
+ end_index: import_v415.z.number(),
2962
+ url: import_v415.z.string(),
2963
+ title: import_v415.z.string()
2875
2964
  }),
2876
- import_v414.z.object({
2877
- type: import_v414.z.literal("file_citation"),
2878
- file_id: import_v414.z.string(),
2879
- filename: import_v414.z.string().nullish(),
2880
- index: import_v414.z.number().nullish(),
2881
- start_index: import_v414.z.number().nullish(),
2882
- end_index: import_v414.z.number().nullish(),
2883
- quote: import_v414.z.string().nullish()
2965
+ import_v415.z.object({
2966
+ type: import_v415.z.literal("file_citation"),
2967
+ file_id: import_v415.z.string(),
2968
+ filename: import_v415.z.string().nullish(),
2969
+ index: import_v415.z.number().nullish(),
2970
+ start_index: import_v415.z.number().nullish(),
2971
+ end_index: import_v415.z.number().nullish(),
2972
+ quote: import_v415.z.string().nullish()
2884
2973
  }),
2885
- import_v414.z.object({
2886
- type: import_v414.z.literal("container_file_citation"),
2887
- container_id: import_v414.z.string(),
2888
- file_id: import_v414.z.string(),
2889
- filename: import_v414.z.string().nullish(),
2890
- start_index: import_v414.z.number().nullish(),
2891
- end_index: import_v414.z.number().nullish(),
2892
- index: import_v414.z.number().nullish()
2974
+ import_v415.z.object({
2975
+ type: import_v415.z.literal("container_file_citation"),
2976
+ container_id: import_v415.z.string(),
2977
+ file_id: import_v415.z.string(),
2978
+ filename: import_v415.z.string().nullish(),
2979
+ start_index: import_v415.z.number().nullish(),
2980
+ end_index: import_v415.z.number().nullish(),
2981
+ index: import_v415.z.number().nullish()
2893
2982
  }),
2894
- import_v414.z.object({
2895
- type: import_v414.z.literal("file_path"),
2896
- file_id: import_v414.z.string(),
2897
- index: import_v414.z.number().nullish()
2983
+ import_v415.z.object({
2984
+ type: import_v415.z.literal("file_path"),
2985
+ file_id: import_v415.z.string(),
2986
+ index: import_v415.z.number().nullish()
2898
2987
  })
2899
2988
  ])
2900
2989
  )
2901
2990
  })
2902
2991
  )
2903
2992
  }),
2904
- import_v414.z.object({
2905
- type: import_v414.z.literal("web_search_call"),
2906
- id: import_v414.z.string(),
2907
- status: import_v414.z.string(),
2908
- action: import_v414.z.discriminatedUnion("type", [
2909
- import_v414.z.object({
2910
- type: import_v414.z.literal("search"),
2911
- query: import_v414.z.string().nullish(),
2912
- sources: import_v414.z.array(
2913
- import_v414.z.discriminatedUnion("type", [
2914
- import_v414.z.object({ type: import_v414.z.literal("url"), url: import_v414.z.string() }),
2915
- import_v414.z.object({ type: import_v414.z.literal("api"), name: import_v414.z.string() })
2993
+ import_v415.z.object({
2994
+ type: import_v415.z.literal("web_search_call"),
2995
+ id: import_v415.z.string(),
2996
+ status: import_v415.z.string(),
2997
+ action: import_v415.z.discriminatedUnion("type", [
2998
+ import_v415.z.object({
2999
+ type: import_v415.z.literal("search"),
3000
+ query: import_v415.z.string().nullish(),
3001
+ sources: import_v415.z.array(
3002
+ import_v415.z.discriminatedUnion("type", [
3003
+ import_v415.z.object({ type: import_v415.z.literal("url"), url: import_v415.z.string() }),
3004
+ import_v415.z.object({ type: import_v415.z.literal("api"), name: import_v415.z.string() })
2916
3005
  ])
2917
3006
  ).nullish()
2918
3007
  }),
2919
- import_v414.z.object({
2920
- type: import_v414.z.literal("open_page"),
2921
- url: import_v414.z.string()
3008
+ import_v415.z.object({
3009
+ type: import_v415.z.literal("open_page"),
3010
+ url: import_v415.z.string()
2922
3011
  }),
2923
- import_v414.z.object({
2924
- type: import_v414.z.literal("find"),
2925
- url: import_v414.z.string(),
2926
- pattern: import_v414.z.string()
3012
+ import_v415.z.object({
3013
+ type: import_v415.z.literal("find"),
3014
+ url: import_v415.z.string(),
3015
+ pattern: import_v415.z.string()
2927
3016
  })
2928
3017
  ])
2929
3018
  }),
2930
- import_v414.z.object({
2931
- type: import_v414.z.literal("file_search_call"),
2932
- id: import_v414.z.string(),
2933
- queries: import_v414.z.array(import_v414.z.string()),
2934
- results: import_v414.z.array(
2935
- import_v414.z.object({
2936
- attributes: import_v414.z.record(
2937
- import_v414.z.string(),
2938
- import_v414.z.union([import_v414.z.string(), import_v414.z.number(), import_v414.z.boolean()])
3019
+ import_v415.z.object({
3020
+ type: import_v415.z.literal("file_search_call"),
3021
+ id: import_v415.z.string(),
3022
+ queries: import_v415.z.array(import_v415.z.string()),
3023
+ results: import_v415.z.array(
3024
+ import_v415.z.object({
3025
+ attributes: import_v415.z.record(
3026
+ import_v415.z.string(),
3027
+ import_v415.z.union([import_v415.z.string(), import_v415.z.number(), import_v415.z.boolean()])
2939
3028
  ),
2940
- file_id: import_v414.z.string(),
2941
- filename: import_v414.z.string(),
2942
- score: import_v414.z.number(),
2943
- text: import_v414.z.string()
3029
+ file_id: import_v415.z.string(),
3030
+ filename: import_v415.z.string(),
3031
+ score: import_v415.z.number(),
3032
+ text: import_v415.z.string()
2944
3033
  })
2945
3034
  ).nullish()
2946
3035
  }),
2947
- import_v414.z.object({
2948
- type: import_v414.z.literal("code_interpreter_call"),
2949
- id: import_v414.z.string(),
2950
- code: import_v414.z.string().nullable(),
2951
- container_id: import_v414.z.string(),
2952
- outputs: import_v414.z.array(
2953
- import_v414.z.discriminatedUnion("type", [
2954
- import_v414.z.object({ type: import_v414.z.literal("logs"), logs: import_v414.z.string() }),
2955
- import_v414.z.object({ type: import_v414.z.literal("image"), url: import_v414.z.string() })
3036
+ import_v415.z.object({
3037
+ type: import_v415.z.literal("code_interpreter_call"),
3038
+ id: import_v415.z.string(),
3039
+ code: import_v415.z.string().nullable(),
3040
+ container_id: import_v415.z.string(),
3041
+ outputs: import_v415.z.array(
3042
+ import_v415.z.discriminatedUnion("type", [
3043
+ import_v415.z.object({ type: import_v415.z.literal("logs"), logs: import_v415.z.string() }),
3044
+ import_v415.z.object({ type: import_v415.z.literal("image"), url: import_v415.z.string() })
2956
3045
  ])
2957
3046
  ).nullable()
2958
3047
  }),
2959
- import_v414.z.object({
2960
- type: import_v414.z.literal("image_generation_call"),
2961
- id: import_v414.z.string(),
2962
- result: import_v414.z.string()
3048
+ import_v415.z.object({
3049
+ type: import_v415.z.literal("image_generation_call"),
3050
+ id: import_v415.z.string(),
3051
+ result: import_v415.z.string()
2963
3052
  }),
2964
- import_v414.z.object({
2965
- type: import_v414.z.literal("local_shell_call"),
2966
- id: import_v414.z.string(),
2967
- call_id: import_v414.z.string(),
2968
- action: import_v414.z.object({
2969
- type: import_v414.z.literal("exec"),
2970
- command: import_v414.z.array(import_v414.z.string()),
2971
- timeout_ms: import_v414.z.number().optional(),
2972
- user: import_v414.z.string().optional(),
2973
- working_directory: import_v414.z.string().optional(),
2974
- env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
3053
+ import_v415.z.object({
3054
+ type: import_v415.z.literal("local_shell_call"),
3055
+ id: import_v415.z.string(),
3056
+ call_id: import_v415.z.string(),
3057
+ action: import_v415.z.object({
3058
+ type: import_v415.z.literal("exec"),
3059
+ command: import_v415.z.array(import_v415.z.string()),
3060
+ timeout_ms: import_v415.z.number().optional(),
3061
+ user: import_v415.z.string().optional(),
3062
+ working_directory: import_v415.z.string().optional(),
3063
+ env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
2975
3064
  })
2976
3065
  }),
2977
- import_v414.z.object({
2978
- type: import_v414.z.literal("function_call"),
2979
- call_id: import_v414.z.string(),
2980
- name: import_v414.z.string(),
2981
- arguments: import_v414.z.string(),
2982
- id: import_v414.z.string()
3066
+ import_v415.z.object({
3067
+ type: import_v415.z.literal("function_call"),
3068
+ call_id: import_v415.z.string(),
3069
+ name: import_v415.z.string(),
3070
+ arguments: import_v415.z.string(),
3071
+ id: import_v415.z.string()
2983
3072
  }),
2984
- import_v414.z.object({
2985
- type: import_v414.z.literal("computer_call"),
2986
- id: import_v414.z.string(),
2987
- status: import_v414.z.string().optional()
3073
+ import_v415.z.object({
3074
+ type: import_v415.z.literal("computer_call"),
3075
+ id: import_v415.z.string(),
3076
+ status: import_v415.z.string().optional()
2988
3077
  }),
2989
- import_v414.z.object({
2990
- type: import_v414.z.literal("reasoning"),
2991
- id: import_v414.z.string(),
2992
- encrypted_content: import_v414.z.string().nullish(),
2993
- summary: import_v414.z.array(
2994
- import_v414.z.object({
2995
- type: import_v414.z.literal("summary_text"),
2996
- text: import_v414.z.string()
3078
+ import_v415.z.object({
3079
+ type: import_v415.z.literal("reasoning"),
3080
+ id: import_v415.z.string(),
3081
+ encrypted_content: import_v415.z.string().nullish(),
3082
+ summary: import_v415.z.array(
3083
+ import_v415.z.object({
3084
+ type: import_v415.z.literal("summary_text"),
3085
+ text: import_v415.z.string()
2997
3086
  })
2998
3087
  )
2999
3088
  }),
3000
- import_v414.z.object({
3001
- type: import_v414.z.literal("mcp_call"),
3002
- id: import_v414.z.string(),
3003
- status: import_v414.z.string(),
3004
- arguments: import_v414.z.string(),
3005
- name: import_v414.z.string(),
3006
- server_label: import_v414.z.string(),
3007
- output: import_v414.z.string().nullish(),
3008
- error: import_v414.z.union([
3009
- import_v414.z.string(),
3010
- import_v414.z.object({
3011
- type: import_v414.z.string().optional(),
3012
- code: import_v414.z.union([import_v414.z.number(), import_v414.z.string()]).optional(),
3013
- message: import_v414.z.string().optional()
3089
+ import_v415.z.object({
3090
+ type: import_v415.z.literal("mcp_call"),
3091
+ id: import_v415.z.string(),
3092
+ status: import_v415.z.string(),
3093
+ arguments: import_v415.z.string(),
3094
+ name: import_v415.z.string(),
3095
+ server_label: import_v415.z.string(),
3096
+ output: import_v415.z.string().nullish(),
3097
+ error: import_v415.z.union([
3098
+ import_v415.z.string(),
3099
+ import_v415.z.object({
3100
+ type: import_v415.z.string().optional(),
3101
+ code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
3102
+ message: import_v415.z.string().optional()
3014
3103
  }).loose()
3015
3104
  ]).nullish()
3016
3105
  }),
3017
- import_v414.z.object({
3018
- type: import_v414.z.literal("mcp_list_tools"),
3019
- id: import_v414.z.string(),
3020
- server_label: import_v414.z.string(),
3021
- tools: import_v414.z.array(
3022
- import_v414.z.object({
3023
- name: import_v414.z.string(),
3024
- description: import_v414.z.string().optional(),
3025
- input_schema: import_v414.z.any(),
3026
- annotations: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()).optional()
3106
+ import_v415.z.object({
3107
+ type: import_v415.z.literal("mcp_list_tools"),
3108
+ id: import_v415.z.string(),
3109
+ server_label: import_v415.z.string(),
3110
+ tools: import_v415.z.array(
3111
+ import_v415.z.object({
3112
+ name: import_v415.z.string(),
3113
+ description: import_v415.z.string().optional(),
3114
+ input_schema: import_v415.z.any(),
3115
+ annotations: import_v415.z.record(import_v415.z.string(), import_v415.z.unknown()).optional()
3027
3116
  })
3028
3117
  ),
3029
- error: import_v414.z.union([
3030
- import_v414.z.string(),
3031
- import_v414.z.object({
3032
- type: import_v414.z.string().optional(),
3033
- code: import_v414.z.union([import_v414.z.number(), import_v414.z.string()]).optional(),
3034
- message: import_v414.z.string().optional()
3118
+ error: import_v415.z.union([
3119
+ import_v415.z.string(),
3120
+ import_v415.z.object({
3121
+ type: import_v415.z.string().optional(),
3122
+ code: import_v415.z.union([import_v415.z.number(), import_v415.z.string()]).optional(),
3123
+ message: import_v415.z.string().optional()
3035
3124
  }).loose()
3036
3125
  ]).optional()
3037
3126
  }),
3038
- import_v414.z.object({
3039
- type: import_v414.z.literal("mcp_approval_request"),
3040
- id: import_v414.z.string(),
3041
- server_label: import_v414.z.string(),
3042
- name: import_v414.z.string(),
3043
- arguments: import_v414.z.string(),
3044
- approval_request_id: import_v414.z.string()
3127
+ import_v415.z.object({
3128
+ type: import_v415.z.literal("mcp_approval_request"),
3129
+ id: import_v415.z.string(),
3130
+ server_label: import_v415.z.string(),
3131
+ name: import_v415.z.string(),
3132
+ arguments: import_v415.z.string(),
3133
+ approval_request_id: import_v415.z.string()
3134
+ }),
3135
+ import_v415.z.object({
3136
+ type: import_v415.z.literal("apply_patch_call"),
3137
+ id: import_v415.z.string(),
3138
+ call_id: import_v415.z.string(),
3139
+ status: import_v415.z.enum(["in_progress", "completed"]),
3140
+ operation: import_v415.z.discriminatedUnion("type", [
3141
+ import_v415.z.object({
3142
+ type: import_v415.z.literal("create_file"),
3143
+ path: import_v415.z.string(),
3144
+ diff: import_v415.z.string()
3145
+ }),
3146
+ import_v415.z.object({
3147
+ type: import_v415.z.literal("delete_file"),
3148
+ path: import_v415.z.string()
3149
+ }),
3150
+ import_v415.z.object({
3151
+ type: import_v415.z.literal("update_file"),
3152
+ path: import_v415.z.string(),
3153
+ diff: import_v415.z.string()
3154
+ })
3155
+ ])
3045
3156
  })
3046
3157
  ])
3047
3158
  ).optional(),
3048
- service_tier: import_v414.z.string().nullish(),
3049
- incomplete_details: import_v414.z.object({ reason: import_v414.z.string() }).nullish(),
3050
- usage: import_v414.z.object({
3051
- input_tokens: import_v414.z.number(),
3052
- input_tokens_details: import_v414.z.object({ cached_tokens: import_v414.z.number().nullish() }).nullish(),
3053
- output_tokens: import_v414.z.number(),
3054
- output_tokens_details: import_v414.z.object({ reasoning_tokens: import_v414.z.number().nullish() }).nullish()
3159
+ service_tier: import_v415.z.string().nullish(),
3160
+ incomplete_details: import_v415.z.object({ reason: import_v415.z.string() }).nullish(),
3161
+ usage: import_v415.z.object({
3162
+ input_tokens: import_v415.z.number(),
3163
+ input_tokens_details: import_v415.z.object({ cached_tokens: import_v415.z.number().nullish() }).nullish(),
3164
+ output_tokens: import_v415.z.number(),
3165
+ output_tokens_details: import_v415.z.object({ reasoning_tokens: import_v415.z.number().nullish() }).nullish()
3055
3166
  }).optional()
3056
3167
  })
3057
3168
  )
3058
3169
  );
3059
3170
 
3060
3171
  // src/responses/openai-responses-options.ts
3061
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
3062
- var import_v415 = require("zod/v4");
3172
+ var import_provider_utils23 = require("@ai-sdk/provider-utils");
3173
+ var import_v416 = require("zod/v4");
3063
3174
  var TOP_LOGPROBS_MAX = 20;
3064
3175
  var openaiResponsesReasoningModelIds = [
3065
3176
  "o1",
@@ -3126,19 +3237,19 @@ var openaiResponsesModelIds = [
3126
3237
  "gpt-5-chat-latest",
3127
3238
  ...openaiResponsesReasoningModelIds
3128
3239
  ];
3129
- var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazySchema)(
3130
- () => (0, import_provider_utils22.zodSchema)(
3131
- import_v415.z.object({
3132
- conversation: import_v415.z.string().nullish(),
3133
- include: import_v415.z.array(
3134
- import_v415.z.enum([
3240
+ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazySchema)(
3241
+ () => (0, import_provider_utils23.zodSchema)(
3242
+ import_v416.z.object({
3243
+ conversation: import_v416.z.string().nullish(),
3244
+ include: import_v416.z.array(
3245
+ import_v416.z.enum([
3135
3246
  "reasoning.encrypted_content",
3136
3247
  // handled internally by default, only needed for unknown reasoning models
3137
3248
  "file_search_call.results",
3138
3249
  "message.output_text.logprobs"
3139
3250
  ])
3140
3251
  ).nullish(),
3141
- instructions: import_v415.z.string().nullish(),
3252
+ instructions: import_v416.z.string().nullish(),
3142
3253
  /**
3143
3254
  * Return the log probabilities of the tokens.
3144
3255
  *
@@ -3151,17 +3262,17 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazySchem
3151
3262
  * @see https://platform.openai.com/docs/api-reference/responses/create
3152
3263
  * @see https://cookbook.openai.com/examples/using_logprobs
3153
3264
  */
3154
- logprobs: import_v415.z.union([import_v415.z.boolean(), import_v415.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3265
+ logprobs: import_v416.z.union([import_v416.z.boolean(), import_v416.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3155
3266
  /**
3156
3267
  * The maximum number of total calls to built-in tools that can be processed in a response.
3157
3268
  * This maximum number applies across all built-in tool calls, not per individual tool.
3158
3269
  * Any further attempts to call a tool by the model will be ignored.
3159
3270
  */
3160
- maxToolCalls: import_v415.z.number().nullish(),
3161
- metadata: import_v415.z.any().nullish(),
3162
- parallelToolCalls: import_v415.z.boolean().nullish(),
3163
- previousResponseId: import_v415.z.string().nullish(),
3164
- promptCacheKey: import_v415.z.string().nullish(),
3271
+ maxToolCalls: import_v416.z.number().nullish(),
3272
+ metadata: import_v416.z.any().nullish(),
3273
+ parallelToolCalls: import_v416.z.boolean().nullish(),
3274
+ previousResponseId: import_v416.z.string().nullish(),
3275
+ promptCacheKey: import_v416.z.string().nullish(),
3165
3276
  /**
3166
3277
  * The retention policy for the prompt cache.
3167
3278
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -3170,60 +3281,60 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazySchem
3170
3281
  *
3171
3282
  * @default 'in_memory'
3172
3283
  */
3173
- promptCacheRetention: import_v415.z.enum(["in_memory", "24h"]).nullish(),
3174
- reasoningEffort: import_v415.z.string().nullish(),
3175
- reasoningSummary: import_v415.z.string().nullish(),
3176
- safetyIdentifier: import_v415.z.string().nullish(),
3177
- serviceTier: import_v415.z.enum(["auto", "flex", "priority", "default"]).nullish(),
3178
- store: import_v415.z.boolean().nullish(),
3179
- strictJsonSchema: import_v415.z.boolean().nullish(),
3180
- textVerbosity: import_v415.z.enum(["low", "medium", "high"]).nullish(),
3181
- truncation: import_v415.z.enum(["auto", "disabled"]).nullish(),
3182
- user: import_v415.z.string().nullish()
3284
+ promptCacheRetention: import_v416.z.enum(["in_memory", "24h"]).nullish(),
3285
+ reasoningEffort: import_v416.z.string().nullish(),
3286
+ reasoningSummary: import_v416.z.string().nullish(),
3287
+ safetyIdentifier: import_v416.z.string().nullish(),
3288
+ serviceTier: import_v416.z.enum(["auto", "flex", "priority", "default"]).nullish(),
3289
+ store: import_v416.z.boolean().nullish(),
3290
+ strictJsonSchema: import_v416.z.boolean().nullish(),
3291
+ textVerbosity: import_v416.z.enum(["low", "medium", "high"]).nullish(),
3292
+ truncation: import_v416.z.enum(["auto", "disabled"]).nullish(),
3293
+ user: import_v416.z.string().nullish()
3183
3294
  })
3184
3295
  )
3185
3296
  );
3186
3297
 
3187
3298
  // src/responses/openai-responses-prepare-tools.ts
3188
3299
  var import_provider7 = require("@ai-sdk/provider");
3189
- var import_provider_utils29 = require("@ai-sdk/provider-utils");
3300
+ var import_provider_utils30 = require("@ai-sdk/provider-utils");
3190
3301
 
3191
3302
  // src/tool/code-interpreter.ts
3192
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
3193
- var import_v416 = require("zod/v4");
3194
- var codeInterpreterInputSchema = (0, import_provider_utils23.lazySchema)(
3195
- () => (0, import_provider_utils23.zodSchema)(
3196
- import_v416.z.object({
3197
- code: import_v416.z.string().nullish(),
3198
- containerId: import_v416.z.string()
3303
+ var import_provider_utils24 = require("@ai-sdk/provider-utils");
3304
+ var import_v417 = require("zod/v4");
3305
+ var codeInterpreterInputSchema = (0, import_provider_utils24.lazySchema)(
3306
+ () => (0, import_provider_utils24.zodSchema)(
3307
+ import_v417.z.object({
3308
+ code: import_v417.z.string().nullish(),
3309
+ containerId: import_v417.z.string()
3199
3310
  })
3200
3311
  )
3201
3312
  );
3202
- var codeInterpreterOutputSchema = (0, import_provider_utils23.lazySchema)(
3203
- () => (0, import_provider_utils23.zodSchema)(
3204
- import_v416.z.object({
3205
- outputs: import_v416.z.array(
3206
- import_v416.z.discriminatedUnion("type", [
3207
- import_v416.z.object({ type: import_v416.z.literal("logs"), logs: import_v416.z.string() }),
3208
- import_v416.z.object({ type: import_v416.z.literal("image"), url: import_v416.z.string() })
3313
+ var codeInterpreterOutputSchema = (0, import_provider_utils24.lazySchema)(
3314
+ () => (0, import_provider_utils24.zodSchema)(
3315
+ import_v417.z.object({
3316
+ outputs: import_v417.z.array(
3317
+ import_v417.z.discriminatedUnion("type", [
3318
+ import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
3319
+ import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
3209
3320
  ])
3210
3321
  ).nullish()
3211
3322
  })
3212
3323
  )
3213
3324
  );
3214
- var codeInterpreterArgsSchema = (0, import_provider_utils23.lazySchema)(
3215
- () => (0, import_provider_utils23.zodSchema)(
3216
- import_v416.z.object({
3217
- container: import_v416.z.union([
3218
- import_v416.z.string(),
3219
- import_v416.z.object({
3220
- fileIds: import_v416.z.array(import_v416.z.string()).optional()
3325
+ var codeInterpreterArgsSchema = (0, import_provider_utils24.lazySchema)(
3326
+ () => (0, import_provider_utils24.zodSchema)(
3327
+ import_v417.z.object({
3328
+ container: import_v417.z.union([
3329
+ import_v417.z.string(),
3330
+ import_v417.z.object({
3331
+ fileIds: import_v417.z.array(import_v417.z.string()).optional()
3221
3332
  })
3222
3333
  ]).optional()
3223
3334
  })
3224
3335
  )
3225
3336
  );
3226
- var codeInterpreterToolFactory = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
3337
+ var codeInterpreterToolFactory = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
3227
3338
  id: "openai.code_interpreter",
3228
3339
  inputSchema: codeInterpreterInputSchema,
3229
3340
  outputSchema: codeInterpreterOutputSchema
@@ -3233,81 +3344,81 @@ var codeInterpreter = (args = {}) => {
3233
3344
  };
3234
3345
 
3235
3346
  // src/tool/file-search.ts
3236
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
3237
- var import_v417 = require("zod/v4");
3238
- var comparisonFilterSchema = import_v417.z.object({
3239
- key: import_v417.z.string(),
3240
- type: import_v417.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
3241
- value: import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
3347
+ var import_provider_utils25 = require("@ai-sdk/provider-utils");
3348
+ var import_v418 = require("zod/v4");
3349
+ var comparisonFilterSchema = import_v418.z.object({
3350
+ key: import_v418.z.string(),
3351
+ type: import_v418.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
3352
+ value: import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
3242
3353
  });
3243
- var compoundFilterSchema = import_v417.z.object({
3244
- type: import_v417.z.enum(["and", "or"]),
3245
- filters: import_v417.z.array(
3246
- import_v417.z.union([comparisonFilterSchema, import_v417.z.lazy(() => compoundFilterSchema)])
3354
+ var compoundFilterSchema = import_v418.z.object({
3355
+ type: import_v418.z.enum(["and", "or"]),
3356
+ filters: import_v418.z.array(
3357
+ import_v418.z.union([comparisonFilterSchema, import_v418.z.lazy(() => compoundFilterSchema)])
3247
3358
  )
3248
3359
  });
3249
- var fileSearchArgsSchema = (0, import_provider_utils24.lazySchema)(
3250
- () => (0, import_provider_utils24.zodSchema)(
3251
- import_v417.z.object({
3252
- vectorStoreIds: import_v417.z.array(import_v417.z.string()),
3253
- maxNumResults: import_v417.z.number().optional(),
3254
- ranking: import_v417.z.object({
3255
- ranker: import_v417.z.string().optional(),
3256
- scoreThreshold: import_v417.z.number().optional()
3360
+ var fileSearchArgsSchema = (0, import_provider_utils25.lazySchema)(
3361
+ () => (0, import_provider_utils25.zodSchema)(
3362
+ import_v418.z.object({
3363
+ vectorStoreIds: import_v418.z.array(import_v418.z.string()),
3364
+ maxNumResults: import_v418.z.number().optional(),
3365
+ ranking: import_v418.z.object({
3366
+ ranker: import_v418.z.string().optional(),
3367
+ scoreThreshold: import_v418.z.number().optional()
3257
3368
  }).optional(),
3258
- filters: import_v417.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
3369
+ filters: import_v418.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
3259
3370
  })
3260
3371
  )
3261
3372
  );
3262
- var fileSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
3263
- () => (0, import_provider_utils24.zodSchema)(
3264
- import_v417.z.object({
3265
- queries: import_v417.z.array(import_v417.z.string()),
3266
- results: import_v417.z.array(
3267
- import_v417.z.object({
3268
- attributes: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()),
3269
- fileId: import_v417.z.string(),
3270
- filename: import_v417.z.string(),
3271
- score: import_v417.z.number(),
3272
- text: import_v417.z.string()
3373
+ var fileSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
3374
+ () => (0, import_provider_utils25.zodSchema)(
3375
+ import_v418.z.object({
3376
+ queries: import_v418.z.array(import_v418.z.string()),
3377
+ results: import_v418.z.array(
3378
+ import_v418.z.object({
3379
+ attributes: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()),
3380
+ fileId: import_v418.z.string(),
3381
+ filename: import_v418.z.string(),
3382
+ score: import_v418.z.number(),
3383
+ text: import_v418.z.string()
3273
3384
  })
3274
3385
  ).nullable()
3275
3386
  })
3276
3387
  )
3277
3388
  );
3278
- var fileSearch = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
3389
+ var fileSearch = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
3279
3390
  id: "openai.file_search",
3280
- inputSchema: import_v417.z.object({}),
3391
+ inputSchema: import_v418.z.object({}),
3281
3392
  outputSchema: fileSearchOutputSchema
3282
3393
  });
3283
3394
 
3284
3395
  // src/tool/image-generation.ts
3285
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
3286
- var import_v418 = require("zod/v4");
3287
- var imageGenerationArgsSchema = (0, import_provider_utils25.lazySchema)(
3288
- () => (0, import_provider_utils25.zodSchema)(
3289
- import_v418.z.object({
3290
- background: import_v418.z.enum(["auto", "opaque", "transparent"]).optional(),
3291
- inputFidelity: import_v418.z.enum(["low", "high"]).optional(),
3292
- inputImageMask: import_v418.z.object({
3293
- fileId: import_v418.z.string().optional(),
3294
- imageUrl: import_v418.z.string().optional()
3396
+ var import_provider_utils26 = require("@ai-sdk/provider-utils");
3397
+ var import_v419 = require("zod/v4");
3398
+ var imageGenerationArgsSchema = (0, import_provider_utils26.lazySchema)(
3399
+ () => (0, import_provider_utils26.zodSchema)(
3400
+ import_v419.z.object({
3401
+ background: import_v419.z.enum(["auto", "opaque", "transparent"]).optional(),
3402
+ inputFidelity: import_v419.z.enum(["low", "high"]).optional(),
3403
+ inputImageMask: import_v419.z.object({
3404
+ fileId: import_v419.z.string().optional(),
3405
+ imageUrl: import_v419.z.string().optional()
3295
3406
  }).optional(),
3296
- model: import_v418.z.string().optional(),
3297
- moderation: import_v418.z.enum(["auto"]).optional(),
3298
- outputCompression: import_v418.z.number().int().min(0).max(100).optional(),
3299
- outputFormat: import_v418.z.enum(["png", "jpeg", "webp"]).optional(),
3300
- partialImages: import_v418.z.number().int().min(0).max(3).optional(),
3301
- quality: import_v418.z.enum(["auto", "low", "medium", "high"]).optional(),
3302
- size: import_v418.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3407
+ model: import_v419.z.string().optional(),
3408
+ moderation: import_v419.z.enum(["auto"]).optional(),
3409
+ outputCompression: import_v419.z.number().int().min(0).max(100).optional(),
3410
+ outputFormat: import_v419.z.enum(["png", "jpeg", "webp"]).optional(),
3411
+ partialImages: import_v419.z.number().int().min(0).max(3).optional(),
3412
+ quality: import_v419.z.enum(["auto", "low", "medium", "high"]).optional(),
3413
+ size: import_v419.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
3303
3414
  }).strict()
3304
3415
  )
3305
3416
  );
3306
- var imageGenerationInputSchema = (0, import_provider_utils25.lazySchema)(() => (0, import_provider_utils25.zodSchema)(import_v418.z.object({})));
3307
- var imageGenerationOutputSchema = (0, import_provider_utils25.lazySchema)(
3308
- () => (0, import_provider_utils25.zodSchema)(import_v418.z.object({ result: import_v418.z.string() }))
3417
+ var imageGenerationInputSchema = (0, import_provider_utils26.lazySchema)(() => (0, import_provider_utils26.zodSchema)(import_v419.z.object({})));
3418
+ var imageGenerationOutputSchema = (0, import_provider_utils26.lazySchema)(
3419
+ () => (0, import_provider_utils26.zodSchema)(import_v419.z.object({ result: import_v419.z.string() }))
3309
3420
  );
3310
- var imageGenerationToolFactory = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
3421
+ var imageGenerationToolFactory = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
3311
3422
  id: "openai.image_generation",
3312
3423
  inputSchema: imageGenerationInputSchema,
3313
3424
  outputSchema: imageGenerationOutputSchema
@@ -3317,32 +3428,32 @@ var imageGeneration = (args = {}) => {
3317
3428
  };
3318
3429
 
3319
3430
  // src/tool/mcp.ts
3320
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
3321
- var import_v419 = require("zod/v4");
3322
- var jsonValueSchema = import_v419.z.lazy(
3323
- () => import_v419.z.union([
3324
- import_v419.z.string(),
3325
- import_v419.z.number(),
3326
- import_v419.z.boolean(),
3327
- import_v419.z.null(),
3328
- import_v419.z.array(jsonValueSchema),
3329
- import_v419.z.record(import_v419.z.string(), jsonValueSchema)
3431
+ var import_provider_utils27 = require("@ai-sdk/provider-utils");
3432
+ var import_v420 = require("zod/v4");
3433
+ var jsonValueSchema = import_v420.z.lazy(
3434
+ () => import_v420.z.union([
3435
+ import_v420.z.string(),
3436
+ import_v420.z.number(),
3437
+ import_v420.z.boolean(),
3438
+ import_v420.z.null(),
3439
+ import_v420.z.array(jsonValueSchema),
3440
+ import_v420.z.record(import_v420.z.string(), jsonValueSchema)
3330
3441
  ])
3331
3442
  );
3332
- var mcpArgsSchema = (0, import_provider_utils26.lazySchema)(
3333
- () => (0, import_provider_utils26.zodSchema)(
3334
- import_v419.z.object({
3335
- serverLabel: import_v419.z.string(),
3336
- allowedTools: import_v419.z.union([
3337
- import_v419.z.array(import_v419.z.string()),
3338
- import_v419.z.object({
3339
- readOnly: import_v419.z.boolean().optional(),
3340
- toolNames: import_v419.z.array(import_v419.z.string()).optional()
3443
+ var mcpArgsSchema = (0, import_provider_utils27.lazySchema)(
3444
+ () => (0, import_provider_utils27.zodSchema)(
3445
+ import_v420.z.object({
3446
+ serverLabel: import_v420.z.string(),
3447
+ allowedTools: import_v420.z.union([
3448
+ import_v420.z.array(import_v420.z.string()),
3449
+ import_v420.z.object({
3450
+ readOnly: import_v420.z.boolean().optional(),
3451
+ toolNames: import_v420.z.array(import_v420.z.string()).optional()
3341
3452
  })
3342
3453
  ]).optional(),
3343
- authorization: import_v419.z.string().optional(),
3344
- connectorId: import_v419.z.string().optional(),
3345
- headers: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional(),
3454
+ authorization: import_v420.z.string().optional(),
3455
+ connectorId: import_v420.z.string().optional(),
3456
+ headers: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional(),
3346
3457
  // TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
3347
3458
  // requireApproval: z
3348
3459
  // .union([
@@ -3353,114 +3464,63 @@ var mcpArgsSchema = (0, import_provider_utils26.lazySchema)(
3353
3464
  // }),
3354
3465
  // ])
3355
3466
  // .optional(),
3356
- serverDescription: import_v419.z.string().optional(),
3357
- serverUrl: import_v419.z.string().optional()
3467
+ serverDescription: import_v420.z.string().optional(),
3468
+ serverUrl: import_v420.z.string().optional()
3358
3469
  }).refine(
3359
3470
  (v) => v.serverUrl != null || v.connectorId != null,
3360
3471
  "One of serverUrl or connectorId must be provided."
3361
3472
  )
3362
3473
  )
3363
3474
  );
3364
- var mcpInputSchema = (0, import_provider_utils26.lazySchema)(() => (0, import_provider_utils26.zodSchema)(import_v419.z.object({})));
3365
- var mcpOutputSchema = (0, import_provider_utils26.lazySchema)(
3366
- () => (0, import_provider_utils26.zodSchema)(
3367
- import_v419.z.discriminatedUnion("type", [
3368
- import_v419.z.object({
3369
- type: import_v419.z.literal("call"),
3370
- serverLabel: import_v419.z.string(),
3371
- name: import_v419.z.string(),
3372
- arguments: import_v419.z.string(),
3373
- output: import_v419.z.string().nullable().optional(),
3374
- error: import_v419.z.union([import_v419.z.string(), jsonValueSchema]).optional()
3475
+ var mcpInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
3476
+ var mcpOutputSchema = (0, import_provider_utils27.lazySchema)(
3477
+ () => (0, import_provider_utils27.zodSchema)(
3478
+ import_v420.z.discriminatedUnion("type", [
3479
+ import_v420.z.object({
3480
+ type: import_v420.z.literal("call"),
3481
+ serverLabel: import_v420.z.string(),
3482
+ name: import_v420.z.string(),
3483
+ arguments: import_v420.z.string(),
3484
+ output: import_v420.z.string().nullable().optional(),
3485
+ error: import_v420.z.union([import_v420.z.string(), jsonValueSchema]).optional()
3375
3486
  }),
3376
- import_v419.z.object({
3377
- type: import_v419.z.literal("listTools"),
3378
- serverLabel: import_v419.z.string(),
3379
- tools: import_v419.z.array(
3380
- import_v419.z.object({
3381
- name: import_v419.z.string(),
3382
- description: import_v419.z.string().optional(),
3487
+ import_v420.z.object({
3488
+ type: import_v420.z.literal("listTools"),
3489
+ serverLabel: import_v420.z.string(),
3490
+ tools: import_v420.z.array(
3491
+ import_v420.z.object({
3492
+ name: import_v420.z.string(),
3493
+ description: import_v420.z.string().optional(),
3383
3494
  inputSchema: jsonValueSchema,
3384
- annotations: import_v419.z.record(import_v419.z.string(), jsonValueSchema).optional()
3495
+ annotations: import_v420.z.record(import_v420.z.string(), jsonValueSchema).optional()
3385
3496
  })
3386
3497
  ),
3387
- error: import_v419.z.union([import_v419.z.string(), jsonValueSchema]).optional()
3498
+ error: import_v420.z.union([import_v420.z.string(), jsonValueSchema]).optional()
3388
3499
  }),
3389
- import_v419.z.object({
3390
- type: import_v419.z.literal("approvalRequest"),
3391
- serverLabel: import_v419.z.string(),
3392
- name: import_v419.z.string(),
3393
- arguments: import_v419.z.string(),
3394
- approvalRequestId: import_v419.z.string()
3500
+ import_v420.z.object({
3501
+ type: import_v420.z.literal("approvalRequest"),
3502
+ serverLabel: import_v420.z.string(),
3503
+ name: import_v420.z.string(),
3504
+ arguments: import_v420.z.string(),
3505
+ approvalRequestId: import_v420.z.string()
3395
3506
  })
3396
3507
  ])
3397
3508
  )
3398
3509
  );
3399
- var mcpToolFactory = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
3510
+ var mcpToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
3400
3511
  id: "openai.mcp",
3401
3512
  inputSchema: mcpInputSchema,
3402
3513
  outputSchema: mcpOutputSchema
3403
3514
  });
3404
3515
 
3405
3516
  // src/tool/web-search.ts
3406
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
3407
- var import_v420 = require("zod/v4");
3408
- var webSearchArgsSchema = (0, import_provider_utils27.lazySchema)(
3409
- () => (0, import_provider_utils27.zodSchema)(
3410
- import_v420.z.object({
3411
- externalWebAccess: import_v420.z.boolean().optional(),
3412
- filters: import_v420.z.object({ allowedDomains: import_v420.z.array(import_v420.z.string()).optional() }).optional(),
3413
- searchContextSize: import_v420.z.enum(["low", "medium", "high"]).optional(),
3414
- userLocation: import_v420.z.object({
3415
- type: import_v420.z.literal("approximate"),
3416
- country: import_v420.z.string().optional(),
3417
- city: import_v420.z.string().optional(),
3418
- region: import_v420.z.string().optional(),
3419
- timezone: import_v420.z.string().optional()
3420
- }).optional()
3421
- })
3422
- )
3423
- );
3424
- var webSearchInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v420.z.object({})));
3425
- var webSearchOutputSchema = (0, import_provider_utils27.lazySchema)(
3426
- () => (0, import_provider_utils27.zodSchema)(
3427
- import_v420.z.object({
3428
- action: import_v420.z.discriminatedUnion("type", [
3429
- import_v420.z.object({
3430
- type: import_v420.z.literal("search"),
3431
- query: import_v420.z.string().optional()
3432
- }),
3433
- import_v420.z.object({
3434
- type: import_v420.z.literal("openPage"),
3435
- url: import_v420.z.string()
3436
- }),
3437
- import_v420.z.object({
3438
- type: import_v420.z.literal("find"),
3439
- url: import_v420.z.string(),
3440
- pattern: import_v420.z.string()
3441
- })
3442
- ]),
3443
- sources: import_v420.z.array(
3444
- import_v420.z.discriminatedUnion("type", [
3445
- import_v420.z.object({ type: import_v420.z.literal("url"), url: import_v420.z.string() }),
3446
- import_v420.z.object({ type: import_v420.z.literal("api"), name: import_v420.z.string() })
3447
- ])
3448
- ).optional()
3449
- })
3450
- )
3451
- );
3452
- var webSearchToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
3453
- id: "openai.web_search",
3454
- inputSchema: webSearchInputSchema,
3455
- outputSchema: webSearchOutputSchema
3456
- });
3457
-
3458
- // src/tool/web-search-preview.ts
3459
3517
  var import_provider_utils28 = require("@ai-sdk/provider-utils");
3460
3518
  var import_v421 = require("zod/v4");
3461
- var webSearchPreviewArgsSchema = (0, import_provider_utils28.lazySchema)(
3519
+ var webSearchArgsSchema = (0, import_provider_utils28.lazySchema)(
3462
3520
  () => (0, import_provider_utils28.zodSchema)(
3463
3521
  import_v421.z.object({
3522
+ externalWebAccess: import_v421.z.boolean().optional(),
3523
+ filters: import_v421.z.object({ allowedDomains: import_v421.z.array(import_v421.z.string()).optional() }).optional(),
3464
3524
  searchContextSize: import_v421.z.enum(["low", "medium", "high"]).optional(),
3465
3525
  userLocation: import_v421.z.object({
3466
3526
  type: import_v421.z.literal("approximate"),
@@ -3472,10 +3532,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils28.lazySchema)(
3472
3532
  })
3473
3533
  )
3474
3534
  );
3475
- var webSearchPreviewInputSchema = (0, import_provider_utils28.lazySchema)(
3476
- () => (0, import_provider_utils28.zodSchema)(import_v421.z.object({}))
3477
- );
3478
- var webSearchPreviewOutputSchema = (0, import_provider_utils28.lazySchema)(
3535
+ var webSearchInputSchema = (0, import_provider_utils28.lazySchema)(() => (0, import_provider_utils28.zodSchema)(import_v421.z.object({})));
3536
+ var webSearchOutputSchema = (0, import_provider_utils28.lazySchema)(
3479
3537
  () => (0, import_provider_utils28.zodSchema)(
3480
3538
  import_v421.z.object({
3481
3539
  action: import_v421.z.discriminatedUnion("type", [
@@ -3492,11 +3550,64 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils28.lazySchema)(
3492
3550
  url: import_v421.z.string(),
3493
3551
  pattern: import_v421.z.string()
3494
3552
  })
3553
+ ]),
3554
+ sources: import_v421.z.array(
3555
+ import_v421.z.discriminatedUnion("type", [
3556
+ import_v421.z.object({ type: import_v421.z.literal("url"), url: import_v421.z.string() }),
3557
+ import_v421.z.object({ type: import_v421.z.literal("api"), name: import_v421.z.string() })
3558
+ ])
3559
+ ).optional()
3560
+ })
3561
+ )
3562
+ );
3563
+ var webSearchToolFactory = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
3564
+ id: "openai.web_search",
3565
+ inputSchema: webSearchInputSchema,
3566
+ outputSchema: webSearchOutputSchema
3567
+ });
3568
+
3569
+ // src/tool/web-search-preview.ts
3570
+ var import_provider_utils29 = require("@ai-sdk/provider-utils");
3571
+ var import_v422 = require("zod/v4");
3572
+ var webSearchPreviewArgsSchema = (0, import_provider_utils29.lazySchema)(
3573
+ () => (0, import_provider_utils29.zodSchema)(
3574
+ import_v422.z.object({
3575
+ searchContextSize: import_v422.z.enum(["low", "medium", "high"]).optional(),
3576
+ userLocation: import_v422.z.object({
3577
+ type: import_v422.z.literal("approximate"),
3578
+ country: import_v422.z.string().optional(),
3579
+ city: import_v422.z.string().optional(),
3580
+ region: import_v422.z.string().optional(),
3581
+ timezone: import_v422.z.string().optional()
3582
+ }).optional()
3583
+ })
3584
+ )
3585
+ );
3586
+ var webSearchPreviewInputSchema = (0, import_provider_utils29.lazySchema)(
3587
+ () => (0, import_provider_utils29.zodSchema)(import_v422.z.object({}))
3588
+ );
3589
+ var webSearchPreviewOutputSchema = (0, import_provider_utils29.lazySchema)(
3590
+ () => (0, import_provider_utils29.zodSchema)(
3591
+ import_v422.z.object({
3592
+ action: import_v422.z.discriminatedUnion("type", [
3593
+ import_v422.z.object({
3594
+ type: import_v422.z.literal("search"),
3595
+ query: import_v422.z.string().optional()
3596
+ }),
3597
+ import_v422.z.object({
3598
+ type: import_v422.z.literal("openPage"),
3599
+ url: import_v422.z.string()
3600
+ }),
3601
+ import_v422.z.object({
3602
+ type: import_v422.z.literal("find"),
3603
+ url: import_v422.z.string(),
3604
+ pattern: import_v422.z.string()
3605
+ })
3495
3606
  ])
3496
3607
  })
3497
3608
  )
3498
3609
  );
3499
- var webSearchPreview = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
3610
+ var webSearchPreview = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
3500
3611
  id: "openai.web_search_preview",
3501
3612
  inputSchema: webSearchPreviewInputSchema,
3502
3613
  outputSchema: webSearchPreviewOutputSchema
@@ -3528,7 +3639,7 @@ async function prepareResponsesTools({
3528
3639
  case "provider": {
3529
3640
  switch (tool.id) {
3530
3641
  case "openai.file_search": {
3531
- const args = await (0, import_provider_utils29.validateTypes)({
3642
+ const args = await (0, import_provider_utils30.validateTypes)({
3532
3643
  value: tool.args,
3533
3644
  schema: fileSearchArgsSchema
3534
3645
  });
@@ -3550,8 +3661,14 @@ async function prepareResponsesTools({
3550
3661
  });
3551
3662
  break;
3552
3663
  }
3664
+ case "openai.apply_patch": {
3665
+ openaiTools.push({
3666
+ type: "apply_patch"
3667
+ });
3668
+ break;
3669
+ }
3553
3670
  case "openai.web_search_preview": {
3554
- const args = await (0, import_provider_utils29.validateTypes)({
3671
+ const args = await (0, import_provider_utils30.validateTypes)({
3555
3672
  value: tool.args,
3556
3673
  schema: webSearchPreviewArgsSchema
3557
3674
  });
@@ -3563,7 +3680,7 @@ async function prepareResponsesTools({
3563
3680
  break;
3564
3681
  }
3565
3682
  case "openai.web_search": {
3566
- const args = await (0, import_provider_utils29.validateTypes)({
3683
+ const args = await (0, import_provider_utils30.validateTypes)({
3567
3684
  value: tool.args,
3568
3685
  schema: webSearchArgsSchema
3569
3686
  });
@@ -3577,7 +3694,7 @@ async function prepareResponsesTools({
3577
3694
  break;
3578
3695
  }
3579
3696
  case "openai.code_interpreter": {
3580
- const args = await (0, import_provider_utils29.validateTypes)({
3697
+ const args = await (0, import_provider_utils30.validateTypes)({
3581
3698
  value: tool.args,
3582
3699
  schema: codeInterpreterArgsSchema
3583
3700
  });
@@ -3588,7 +3705,7 @@ async function prepareResponsesTools({
3588
3705
  break;
3589
3706
  }
3590
3707
  case "openai.image_generation": {
3591
- const args = await (0, import_provider_utils29.validateTypes)({
3708
+ const args = await (0, import_provider_utils30.validateTypes)({
3592
3709
  value: tool.args,
3593
3710
  schema: imageGenerationArgsSchema
3594
3711
  });
@@ -3611,7 +3728,7 @@ async function prepareResponsesTools({
3611
3728
  break;
3612
3729
  }
3613
3730
  case "openai.mcp": {
3614
- const args = await (0, import_provider_utils29.validateTypes)({
3731
+ const args = await (0, import_provider_utils30.validateTypes)({
3615
3732
  value: tool.args,
3616
3733
  schema: mcpArgsSchema
3617
3734
  });
@@ -3654,7 +3771,7 @@ async function prepareResponsesTools({
3654
3771
  case "tool":
3655
3772
  return {
3656
3773
  tools: openaiTools,
3657
- toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
3774
+ toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" || toolChoice.toolName === "apply_patch" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
3658
3775
  toolWarnings
3659
3776
  };
3660
3777
  default: {
@@ -3713,7 +3830,7 @@ var OpenAIResponsesLanguageModel = class {
3713
3830
  if (stopSequences != null) {
3714
3831
  warnings.push({ type: "unsupported", feature: "stopSequences" });
3715
3832
  }
3716
- const openaiOptions = await (0, import_provider_utils30.parseProviderOptions)({
3833
+ const openaiOptions = await (0, import_provider_utils31.parseProviderOptions)({
3717
3834
  provider: "openai",
3718
3835
  providerOptions,
3719
3836
  schema: openaiResponsesProviderOptionsSchema
@@ -3725,7 +3842,7 @@ var OpenAIResponsesLanguageModel = class {
3725
3842
  details: "conversation and previousResponseId cannot be used together"
3726
3843
  });
3727
3844
  }
3728
- const toolNameMapping = (0, import_provider_utils30.createToolNameMapping)({
3845
+ const toolNameMapping = (0, import_provider_utils31.createToolNameMapping)({
3729
3846
  tools,
3730
3847
  providerToolNames: {
3731
3848
  "openai.code_interpreter": "code_interpreter",
@@ -3734,7 +3851,8 @@ var OpenAIResponsesLanguageModel = class {
3734
3851
  "openai.local_shell": "local_shell",
3735
3852
  "openai.web_search": "web_search",
3736
3853
  "openai.web_search_preview": "web_search_preview",
3737
- "openai.mcp": "mcp"
3854
+ "openai.mcp": "mcp",
3855
+ "openai.apply_patch": "apply_patch"
3738
3856
  }
3739
3857
  });
3740
3858
  const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
@@ -3743,10 +3861,11 @@ var OpenAIResponsesLanguageModel = class {
3743
3861
  systemMessageMode: modelConfig.systemMessageMode,
3744
3862
  fileIdPrefixes: this.config.fileIdPrefixes,
3745
3863
  store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
3746
- hasLocalShellTool: hasOpenAITool("openai.local_shell")
3864
+ hasLocalShellTool: hasOpenAITool("openai.local_shell"),
3865
+ hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
3747
3866
  });
3748
3867
  warnings.push(...inputWarnings);
3749
- const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
3868
+ const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : true;
3750
3869
  let include = openaiOptions == null ? void 0 : openaiOptions.include;
3751
3870
  function addInclude(key) {
3752
3871
  if (include == null) {
@@ -3912,12 +4031,12 @@ var OpenAIResponsesLanguageModel = class {
3912
4031
  responseHeaders,
3913
4032
  value: response,
3914
4033
  rawValue: rawResponse
3915
- } = await (0, import_provider_utils30.postJsonToApi)({
4034
+ } = await (0, import_provider_utils31.postJsonToApi)({
3916
4035
  url,
3917
- headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
4036
+ headers: (0, import_provider_utils31.combineHeaders)(this.config.headers(), options.headers),
3918
4037
  body,
3919
4038
  failedResponseHandler: openaiFailedResponseHandler,
3920
- successfulResponseHandler: (0, import_provider_utils30.createJsonResponseHandler)(
4039
+ successfulResponseHandler: (0, import_provider_utils31.createJsonResponseHandler)(
3921
4040
  openaiResponsesResponseSchema
3922
4041
  ),
3923
4042
  abortSignal: options.abortSignal,
@@ -4014,7 +4133,7 @@ var OpenAIResponsesLanguageModel = class {
4014
4133
  content.push({
4015
4134
  type: "source",
4016
4135
  sourceType: "url",
4017
- id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils30.generateId)(),
4136
+ id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils31.generateId)(),
4018
4137
  url: annotation.url,
4019
4138
  title: annotation.title
4020
4139
  });
@@ -4022,7 +4141,7 @@ var OpenAIResponsesLanguageModel = class {
4022
4141
  content.push({
4023
4142
  type: "source",
4024
4143
  sourceType: "document",
4025
- id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils30.generateId)(),
4144
+ id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils31.generateId)(),
4026
4145
  mediaType: "text/plain",
4027
4146
  title: (_k = (_j = annotation.quote) != null ? _j : annotation.filename) != null ? _k : "Document",
4028
4147
  filename: (_l = annotation.filename) != null ? _l : annotation.file_id,
@@ -4038,7 +4157,7 @@ var OpenAIResponsesLanguageModel = class {
4038
4157
  content.push({
4039
4158
  type: "source",
4040
4159
  sourceType: "document",
4041
- id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils30.generateId)(),
4160
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils31.generateId)(),
4042
4161
  mediaType: "text/plain",
4043
4162
  title: (_q = (_p = annotation.filename) != null ? _p : annotation.file_id) != null ? _q : "Document",
4044
4163
  filename: (_r = annotation.filename) != null ? _r : annotation.file_id,
@@ -4054,7 +4173,7 @@ var OpenAIResponsesLanguageModel = class {
4054
4173
  content.push({
4055
4174
  type: "source",
4056
4175
  sourceType: "document",
4057
- id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0, import_provider_utils30.generateId)(),
4176
+ id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0, import_provider_utils31.generateId)(),
4058
4177
  mediaType: "application/octet-stream",
4059
4178
  title: annotation.file_id,
4060
4179
  filename: annotation.file_id,
@@ -4244,6 +4363,23 @@ var OpenAIResponsesLanguageModel = class {
4244
4363
  });
4245
4364
  break;
4246
4365
  }
4366
+ case "apply_patch_call": {
4367
+ content.push({
4368
+ type: "tool-call",
4369
+ toolCallId: part.call_id,
4370
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4371
+ input: JSON.stringify({
4372
+ callId: part.call_id,
4373
+ operation: part.operation
4374
+ }),
4375
+ providerMetadata: {
4376
+ [providerKey]: {
4377
+ itemId: part.id
4378
+ }
4379
+ }
4380
+ });
4381
+ break;
4382
+ }
4247
4383
  }
4248
4384
  }
4249
4385
  const providerMetadata = {
@@ -4289,18 +4425,18 @@ var OpenAIResponsesLanguageModel = class {
4289
4425
  toolNameMapping,
4290
4426
  store
4291
4427
  } = await this.getArgs(options);
4292
- const { responseHeaders, value: response } = await (0, import_provider_utils30.postJsonToApi)({
4428
+ const { responseHeaders, value: response } = await (0, import_provider_utils31.postJsonToApi)({
4293
4429
  url: this.config.url({
4294
4430
  path: "/responses",
4295
4431
  modelId: this.modelId
4296
4432
  }),
4297
- headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
4433
+ headers: (0, import_provider_utils31.combineHeaders)(this.config.headers(), options.headers),
4298
4434
  body: {
4299
4435
  ...body,
4300
4436
  stream: true
4301
4437
  },
4302
4438
  failedResponseHandler: openaiFailedResponseHandler,
4303
- successfulResponseHandler: (0, import_provider_utils30.createEventSourceResponseHandler)(
4439
+ successfulResponseHandler: (0, import_provider_utils31.createEventSourceResponseHandler)(
4304
4440
  openaiResponsesChunkSchema
4305
4441
  ),
4306
4442
  abortSignal: options.abortSignal,
@@ -4431,6 +4567,27 @@ var OpenAIResponsesLanguageModel = class {
4431
4567
  input: "{}",
4432
4568
  providerExecuted: true
4433
4569
  });
4570
+ } else if (value.item.type === "apply_patch_call") {
4571
+ ongoingToolCalls[value.output_index] = {
4572
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4573
+ toolCallId: value.item.call_id
4574
+ };
4575
+ if (value.item.status === "completed") {
4576
+ controller.enqueue({
4577
+ type: "tool-call",
4578
+ toolCallId: value.item.call_id,
4579
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4580
+ input: JSON.stringify({
4581
+ callId: value.item.call_id,
4582
+ operation: value.item.operation
4583
+ }),
4584
+ providerMetadata: {
4585
+ [providerKey]: {
4586
+ itemId: value.item.id
4587
+ }
4588
+ }
4589
+ });
4590
+ }
4434
4591
  } else if (value.item.type === "message") {
4435
4592
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
4436
4593
  controller.enqueue({
@@ -4594,6 +4751,24 @@ var OpenAIResponsesLanguageModel = class {
4594
4751
  ...value.item.error != null ? { error: value.item.error } : {}
4595
4752
  }
4596
4753
  });
4754
+ } else if (value.item.type === "apply_patch_call") {
4755
+ ongoingToolCalls[value.output_index] = void 0;
4756
+ if (value.item.status === "completed") {
4757
+ controller.enqueue({
4758
+ type: "tool-call",
4759
+ toolCallId: value.item.call_id,
4760
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4761
+ input: JSON.stringify({
4762
+ callId: value.item.call_id,
4763
+ operation: value.item.operation
4764
+ }),
4765
+ providerMetadata: {
4766
+ [providerKey]: {
4767
+ itemId: value.item.id
4768
+ }
4769
+ }
4770
+ });
4771
+ }
4597
4772
  } else if (value.item.type === "mcp_approval_request") {
4598
4773
  ongoingToolCalls[value.output_index] = void 0;
4599
4774
  controller.enqueue({
@@ -4791,7 +4966,7 @@ var OpenAIResponsesLanguageModel = class {
4791
4966
  controller.enqueue({
4792
4967
  type: "source",
4793
4968
  sourceType: "url",
4794
- id: (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : (0, import_provider_utils30.generateId)(),
4969
+ id: (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : (0, import_provider_utils31.generateId)(),
4795
4970
  url: value.annotation.url,
4796
4971
  title: value.annotation.title
4797
4972
  });
@@ -4799,7 +4974,7 @@ var OpenAIResponsesLanguageModel = class {
4799
4974
  controller.enqueue({
4800
4975
  type: "source",
4801
4976
  sourceType: "document",
4802
- id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : (0, import_provider_utils30.generateId)(),
4977
+ id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : (0, import_provider_utils31.generateId)(),
4803
4978
  mediaType: "text/plain",
4804
4979
  title: (_u = (_t = value.annotation.quote) != null ? _t : value.annotation.filename) != null ? _u : "Document",
4805
4980
  filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id,
@@ -4815,7 +4990,7 @@ var OpenAIResponsesLanguageModel = class {
4815
4990
  controller.enqueue({
4816
4991
  type: "source",
4817
4992
  sourceType: "document",
4818
- id: (_y = (_x = (_w = self.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : (0, import_provider_utils30.generateId)(),
4993
+ id: (_y = (_x = (_w = self.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : (0, import_provider_utils31.generateId)(),
4819
4994
  mediaType: "text/plain",
4820
4995
  title: (_A = (_z = value.annotation.filename) != null ? _z : value.annotation.file_id) != null ? _A : "Document",
4821
4996
  filename: (_B = value.annotation.filename) != null ? _B : value.annotation.file_id,
@@ -4831,7 +5006,7 @@ var OpenAIResponsesLanguageModel = class {
4831
5006
  controller.enqueue({
4832
5007
  type: "source",
4833
5008
  sourceType: "document",
4834
- id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : (0, import_provider_utils30.generateId)(),
5009
+ id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : (0, import_provider_utils31.generateId)(),
4835
5010
  mediaType: "application/octet-stream",
4836
5011
  title: value.annotation.file_id,
4837
5012
  filename: value.annotation.file_id,
@@ -4944,6 +5119,11 @@ function mapWebSearchOutput(action) {
4944
5119
  OpenAIResponsesLanguageModel,
4945
5120
  OpenAISpeechModel,
4946
5121
  OpenAITranscriptionModel,
5122
+ applyPatch,
5123
+ applyPatchArgsSchema,
5124
+ applyPatchInputSchema,
5125
+ applyPatchOutputSchema,
5126
+ applyPatchToolFactory,
4947
5127
  codeInterpreter,
4948
5128
  codeInterpreterArgsSchema,
4949
5129
  codeInterpreterInputSchema,