@ai-sdk/openai 4.0.14 → 4.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2525,31 +2525,128 @@ var codeInterpreter = (args = {}) => {
2525
2525
  return codeInterpreterToolFactory(args);
2526
2526
  };
2527
2527
 
2528
- // src/tool/custom.ts
2528
+ // src/tool/computer.ts
2529
2529
  import {
2530
- createProviderDefinedToolFactory,
2530
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
2531
2531
  lazySchema as lazySchema13,
2532
2532
  zodSchema as zodSchema13
2533
2533
  } from "@ai-sdk/provider-utils";
2534
2534
  import { z as z14 } from "zod/v4";
2535
- var customArgsSchema = lazySchema13(
2535
+ var safetyCheckSchema = z14.object({
2536
+ id: z14.string(),
2537
+ code: z14.string().optional(),
2538
+ message: z14.string().optional()
2539
+ });
2540
+ var computerActionSchema = z14.discriminatedUnion("type", [
2541
+ z14.object({
2542
+ type: z14.literal("click"),
2543
+ button: z14.enum(["left", "right", "wheel", "back", "forward"]),
2544
+ x: z14.number(),
2545
+ y: z14.number(),
2546
+ keys: z14.array(z14.string()).optional()
2547
+ }),
2548
+ z14.object({
2549
+ type: z14.literal("double_click"),
2550
+ x: z14.number(),
2551
+ y: z14.number(),
2552
+ keys: z14.array(z14.string()).optional()
2553
+ }),
2554
+ z14.object({
2555
+ type: z14.literal("drag"),
2556
+ path: z14.array(z14.object({ x: z14.number(), y: z14.number() })),
2557
+ keys: z14.array(z14.string()).optional()
2558
+ }),
2559
+ z14.object({
2560
+ type: z14.literal("keypress"),
2561
+ keys: z14.array(z14.string())
2562
+ }),
2563
+ z14.object({
2564
+ type: z14.literal("move"),
2565
+ x: z14.number(),
2566
+ y: z14.number(),
2567
+ keys: z14.array(z14.string()).optional()
2568
+ }),
2569
+ z14.object({
2570
+ type: z14.literal("screenshot")
2571
+ }),
2572
+ z14.object({
2573
+ type: z14.literal("scroll"),
2574
+ x: z14.number(),
2575
+ y: z14.number(),
2576
+ scrollX: z14.number(),
2577
+ scrollY: z14.number(),
2578
+ keys: z14.array(z14.string()).optional()
2579
+ }),
2580
+ z14.object({
2581
+ type: z14.literal("type"),
2582
+ text: z14.string()
2583
+ }),
2584
+ z14.object({
2585
+ type: z14.literal("wait")
2586
+ })
2587
+ ]);
2588
+ var computerInputSchema = lazySchema13(
2589
+ () => zodSchema13(
2590
+ z14.object({
2591
+ actions: z14.array(computerActionSchema),
2592
+ pendingSafetyChecks: z14.array(safetyCheckSchema),
2593
+ status: z14.enum(["in_progress", "completed", "incomplete"])
2594
+ })
2595
+ )
2596
+ );
2597
+ var computerOutputSchema = lazySchema13(
2536
2598
  () => zodSchema13(
2537
2599
  z14.object({
2538
- description: z14.string().optional(),
2539
- format: z14.union([
2600
+ output: z14.union([
2540
2601
  z14.object({
2541
- type: z14.literal("grammar"),
2542
- syntax: z14.enum(["regex", "lark"]),
2543
- definition: z14.string()
2602
+ type: z14.literal("computer_screenshot"),
2603
+ imageUrl: z14.string(),
2604
+ fileId: z14.string().optional(),
2605
+ detail: z14.enum(["auto", "low", "high", "original"]).optional()
2544
2606
  }),
2545
2607
  z14.object({
2546
- type: z14.literal("text")
2608
+ type: z14.literal("computer_screenshot"),
2609
+ fileId: z14.string(),
2610
+ imageUrl: z14.string().optional(),
2611
+ detail: z14.enum(["auto", "low", "high", "original"]).optional()
2612
+ })
2613
+ ]),
2614
+ acknowledgedSafetyChecks: z14.array(safetyCheckSchema).optional()
2615
+ })
2616
+ )
2617
+ );
2618
+ var computerToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
2619
+ id: "openai.computer",
2620
+ inputSchema: computerInputSchema,
2621
+ outputSchema: computerOutputSchema
2622
+ });
2623
+ var computer = (options = {}) => computerToolFactory(options);
2624
+
2625
+ // src/tool/custom.ts
2626
+ import {
2627
+ createProviderDefinedToolFactory,
2628
+ lazySchema as lazySchema14,
2629
+ zodSchema as zodSchema14
2630
+ } from "@ai-sdk/provider-utils";
2631
+ import { z as z15 } from "zod/v4";
2632
+ var customArgsSchema = lazySchema14(
2633
+ () => zodSchema14(
2634
+ z15.object({
2635
+ description: z15.string().optional(),
2636
+ format: z15.union([
2637
+ z15.object({
2638
+ type: z15.literal("grammar"),
2639
+ syntax: z15.enum(["regex", "lark"]),
2640
+ definition: z15.string()
2641
+ }),
2642
+ z15.object({
2643
+ type: z15.literal("text")
2547
2644
  })
2548
2645
  ]).optional()
2549
2646
  })
2550
2647
  )
2551
2648
  );
2552
- var customInputSchema = lazySchema13(() => zodSchema13(z14.string()));
2649
+ var customInputSchema = lazySchema14(() => zodSchema14(z15.string()));
2553
2650
  var customToolFactory = createProviderDefinedToolFactory({
2554
2651
  id: "openai.custom",
2555
2652
  inputSchema: customInputSchema
@@ -2559,45 +2656,45 @@ var customTool = (args) => customToolFactory(args);
2559
2656
  // src/tool/file-search.ts
2560
2657
  import {
2561
2658
  createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
2562
- lazySchema as lazySchema14,
2563
- zodSchema as zodSchema14
2659
+ lazySchema as lazySchema15,
2660
+ zodSchema as zodSchema15
2564
2661
  } from "@ai-sdk/provider-utils";
2565
- import { z as z15 } from "zod/v4";
2566
- var comparisonFilterSchema = z15.object({
2567
- key: z15.string(),
2568
- type: z15.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2569
- value: z15.union([z15.string(), z15.number(), z15.boolean(), z15.array(z15.string())])
2662
+ import { z as z16 } from "zod/v4";
2663
+ var comparisonFilterSchema = z16.object({
2664
+ key: z16.string(),
2665
+ type: z16.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2666
+ value: z16.union([z16.string(), z16.number(), z16.boolean(), z16.array(z16.string())])
2570
2667
  });
2571
- var compoundFilterSchema = z15.object({
2572
- type: z15.enum(["and", "or"]),
2573
- filters: z15.array(
2574
- z15.union([comparisonFilterSchema, z15.lazy(() => compoundFilterSchema)])
2668
+ var compoundFilterSchema = z16.object({
2669
+ type: z16.enum(["and", "or"]),
2670
+ filters: z16.array(
2671
+ z16.union([comparisonFilterSchema, z16.lazy(() => compoundFilterSchema)])
2575
2672
  )
2576
2673
  });
2577
- var fileSearchArgsSchema = lazySchema14(
2578
- () => zodSchema14(
2579
- z15.object({
2580
- vectorStoreIds: z15.array(z15.string()),
2581
- maxNumResults: z15.number().optional(),
2582
- ranking: z15.object({
2583
- ranker: z15.string().optional(),
2584
- scoreThreshold: z15.number().optional()
2674
+ var fileSearchArgsSchema = lazySchema15(
2675
+ () => zodSchema15(
2676
+ z16.object({
2677
+ vectorStoreIds: z16.array(z16.string()),
2678
+ maxNumResults: z16.number().optional(),
2679
+ ranking: z16.object({
2680
+ ranker: z16.string().optional(),
2681
+ scoreThreshold: z16.number().optional()
2585
2682
  }).optional(),
2586
- filters: z15.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2683
+ filters: z16.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2587
2684
  })
2588
2685
  )
2589
2686
  );
2590
- var fileSearchOutputSchema = lazySchema14(
2591
- () => zodSchema14(
2592
- z15.object({
2593
- queries: z15.array(z15.string()),
2594
- results: z15.array(
2595
- z15.object({
2596
- attributes: z15.record(z15.string(), z15.unknown()),
2597
- fileId: z15.string(),
2598
- filename: z15.string(),
2599
- score: z15.number(),
2600
- text: z15.string()
2687
+ var fileSearchOutputSchema = lazySchema15(
2688
+ () => zodSchema15(
2689
+ z16.object({
2690
+ queries: z16.array(z16.string()),
2691
+ results: z16.array(
2692
+ z16.object({
2693
+ attributes: z16.record(z16.string(), z16.unknown()),
2694
+ fileId: z16.string(),
2695
+ filename: z16.string(),
2696
+ score: z16.number(),
2697
+ text: z16.string()
2601
2698
  })
2602
2699
  ).nullable()
2603
2700
  })
@@ -2605,39 +2702,39 @@ var fileSearchOutputSchema = lazySchema14(
2605
2702
  );
2606
2703
  var fileSearch = createProviderExecutedToolFactory2({
2607
2704
  id: "openai.file_search",
2608
- inputSchema: z15.object({}),
2705
+ inputSchema: z16.object({}),
2609
2706
  outputSchema: fileSearchOutputSchema
2610
2707
  });
2611
2708
 
2612
2709
  // src/tool/image-generation.ts
2613
2710
  import {
2614
2711
  createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
2615
- lazySchema as lazySchema15,
2616
- zodSchema as zodSchema15
2712
+ lazySchema as lazySchema16,
2713
+ zodSchema as zodSchema16
2617
2714
  } from "@ai-sdk/provider-utils";
2618
- import { z as z16 } from "zod/v4";
2619
- var imageGenerationArgsSchema = lazySchema15(
2620
- () => zodSchema15(
2621
- z16.object({
2622
- background: z16.enum(["auto", "opaque", "transparent"]).optional(),
2623
- inputFidelity: z16.enum(["low", "high"]).optional(),
2624
- inputImageMask: z16.object({
2625
- fileId: z16.string().optional(),
2626
- imageUrl: z16.string().optional()
2715
+ import { z as z17 } from "zod/v4";
2716
+ var imageGenerationArgsSchema = lazySchema16(
2717
+ () => zodSchema16(
2718
+ z17.object({
2719
+ background: z17.enum(["auto", "opaque", "transparent"]).optional(),
2720
+ inputFidelity: z17.enum(["low", "high"]).optional(),
2721
+ inputImageMask: z17.object({
2722
+ fileId: z17.string().optional(),
2723
+ imageUrl: z17.string().optional()
2627
2724
  }).optional(),
2628
- model: z16.string().optional(),
2629
- moderation: z16.enum(["auto"]).optional(),
2630
- outputCompression: z16.number().int().min(0).max(100).optional(),
2631
- outputFormat: z16.enum(["png", "jpeg", "webp"]).optional(),
2632
- partialImages: z16.number().int().min(0).max(3).optional(),
2633
- quality: z16.enum(["auto", "low", "medium", "high"]).optional(),
2634
- size: z16.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2725
+ model: z17.string().optional(),
2726
+ moderation: z17.enum(["auto"]).optional(),
2727
+ outputCompression: z17.number().int().min(0).max(100).optional(),
2728
+ outputFormat: z17.enum(["png", "jpeg", "webp"]).optional(),
2729
+ partialImages: z17.number().int().min(0).max(3).optional(),
2730
+ quality: z17.enum(["auto", "low", "medium", "high"]).optional(),
2731
+ size: z17.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2635
2732
  }).strict()
2636
2733
  )
2637
2734
  );
2638
- var imageGenerationInputSchema = lazySchema15(() => zodSchema15(z16.object({})));
2639
- var imageGenerationOutputSchema = lazySchema15(
2640
- () => zodSchema15(z16.object({ result: z16.string() }))
2735
+ var imageGenerationInputSchema = lazySchema16(() => zodSchema16(z17.object({})));
2736
+ var imageGenerationOutputSchema = lazySchema16(
2737
+ () => zodSchema16(z17.object({ result: z17.string() }))
2641
2738
  );
2642
2739
  var imageGenerationToolFactory = createProviderExecutedToolFactory3({
2643
2740
  id: "openai.image_generation",
@@ -2650,29 +2747,29 @@ var imageGeneration = (args = {}) => {
2650
2747
 
2651
2748
  // src/tool/local-shell.ts
2652
2749
  import {
2653
- createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
2654
- lazySchema as lazySchema16,
2655
- zodSchema as zodSchema16
2750
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
2751
+ lazySchema as lazySchema17,
2752
+ zodSchema as zodSchema17
2656
2753
  } from "@ai-sdk/provider-utils";
2657
- import { z as z17 } from "zod/v4";
2658
- var localShellInputSchema = lazySchema16(
2659
- () => zodSchema16(
2660
- z17.object({
2661
- action: z17.object({
2662
- type: z17.literal("exec"),
2663
- command: z17.array(z17.string()),
2664
- timeoutMs: z17.number().optional(),
2665
- user: z17.string().optional(),
2666
- workingDirectory: z17.string().optional(),
2667
- env: z17.record(z17.string(), z17.string()).optional()
2754
+ import { z as z18 } from "zod/v4";
2755
+ var localShellInputSchema = lazySchema17(
2756
+ () => zodSchema17(
2757
+ z18.object({
2758
+ action: z18.object({
2759
+ type: z18.literal("exec"),
2760
+ command: z18.array(z18.string()),
2761
+ timeoutMs: z18.number().optional(),
2762
+ user: z18.string().optional(),
2763
+ workingDirectory: z18.string().optional(),
2764
+ env: z18.record(z18.string(), z18.string()).optional()
2668
2765
  })
2669
2766
  })
2670
2767
  )
2671
2768
  );
2672
- var localShellOutputSchema = lazySchema16(
2673
- () => zodSchema16(z17.object({ output: z17.string() }))
2769
+ var localShellOutputSchema = lazySchema17(
2770
+ () => zodSchema17(z18.object({ output: z18.string() }))
2674
2771
  );
2675
- var localShell = createProviderDefinedToolFactoryWithOutputSchema2({
2772
+ var localShell = createProviderDefinedToolFactoryWithOutputSchema3({
2676
2773
  id: "openai.local_shell",
2677
2774
  inputSchema: localShellInputSchema,
2678
2775
  outputSchema: localShellOutputSchema
@@ -2680,92 +2777,92 @@ var localShell = createProviderDefinedToolFactoryWithOutputSchema2({
2680
2777
 
2681
2778
  // src/tool/shell.ts
2682
2779
  import {
2683
- createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
2684
- lazySchema as lazySchema17,
2685
- zodSchema as zodSchema17
2780
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
2781
+ lazySchema as lazySchema18,
2782
+ zodSchema as zodSchema18
2686
2783
  } from "@ai-sdk/provider-utils";
2687
- import { z as z18 } from "zod/v4";
2688
- var shellInputSchema = lazySchema17(
2689
- () => zodSchema17(
2690
- z18.object({
2691
- action: z18.object({
2692
- commands: z18.array(z18.string()),
2693
- timeoutMs: z18.number().optional(),
2694
- maxOutputLength: z18.number().optional()
2784
+ import { z as z19 } from "zod/v4";
2785
+ var shellInputSchema = lazySchema18(
2786
+ () => zodSchema18(
2787
+ z19.object({
2788
+ action: z19.object({
2789
+ commands: z19.array(z19.string()),
2790
+ timeoutMs: z19.number().optional(),
2791
+ maxOutputLength: z19.number().optional()
2695
2792
  })
2696
2793
  })
2697
2794
  )
2698
2795
  );
2699
- var shellOutputSchema = lazySchema17(
2700
- () => zodSchema17(
2701
- z18.object({
2702
- output: z18.array(
2703
- z18.object({
2704
- stdout: z18.string(),
2705
- stderr: z18.string(),
2706
- outcome: z18.discriminatedUnion("type", [
2707
- z18.object({ type: z18.literal("timeout") }),
2708
- z18.object({ type: z18.literal("exit"), exitCode: z18.number() })
2796
+ var shellOutputSchema = lazySchema18(
2797
+ () => zodSchema18(
2798
+ z19.object({
2799
+ output: z19.array(
2800
+ z19.object({
2801
+ stdout: z19.string(),
2802
+ stderr: z19.string(),
2803
+ outcome: z19.discriminatedUnion("type", [
2804
+ z19.object({ type: z19.literal("timeout") }),
2805
+ z19.object({ type: z19.literal("exit"), exitCode: z19.number() })
2709
2806
  ])
2710
2807
  })
2711
2808
  )
2712
2809
  })
2713
2810
  )
2714
2811
  );
2715
- var shellSkillsSchema = z18.array(
2716
- z18.discriminatedUnion("type", [
2717
- z18.object({
2718
- type: z18.literal("skillReference"),
2719
- providerReference: z18.record(z18.string(), z18.string()),
2720
- version: z18.string().optional()
2812
+ var shellSkillsSchema = z19.array(
2813
+ z19.discriminatedUnion("type", [
2814
+ z19.object({
2815
+ type: z19.literal("skillReference"),
2816
+ providerReference: z19.record(z19.string(), z19.string()),
2817
+ version: z19.string().optional()
2721
2818
  }),
2722
- z18.object({
2723
- type: z18.literal("inline"),
2724
- name: z18.string(),
2725
- description: z18.string(),
2726
- source: z18.object({
2727
- type: z18.literal("base64"),
2728
- mediaType: z18.literal("application/zip"),
2729
- data: z18.string()
2819
+ z19.object({
2820
+ type: z19.literal("inline"),
2821
+ name: z19.string(),
2822
+ description: z19.string(),
2823
+ source: z19.object({
2824
+ type: z19.literal("base64"),
2825
+ mediaType: z19.literal("application/zip"),
2826
+ data: z19.string()
2730
2827
  })
2731
2828
  })
2732
2829
  ])
2733
2830
  ).optional();
2734
- var shellArgsSchema = lazySchema17(
2735
- () => zodSchema17(
2736
- z18.object({
2737
- environment: z18.union([
2738
- z18.object({
2739
- type: z18.literal("containerAuto"),
2740
- fileIds: z18.array(z18.string()).optional(),
2741
- memoryLimit: z18.enum(["1g", "4g", "16g", "64g"]).optional(),
2742
- networkPolicy: z18.discriminatedUnion("type", [
2743
- z18.object({ type: z18.literal("disabled") }),
2744
- z18.object({
2745
- type: z18.literal("allowlist"),
2746
- allowedDomains: z18.array(z18.string()),
2747
- domainSecrets: z18.array(
2748
- z18.object({
2749
- domain: z18.string(),
2750
- name: z18.string(),
2751
- value: z18.string()
2831
+ var shellArgsSchema = lazySchema18(
2832
+ () => zodSchema18(
2833
+ z19.object({
2834
+ environment: z19.union([
2835
+ z19.object({
2836
+ type: z19.literal("containerAuto"),
2837
+ fileIds: z19.array(z19.string()).optional(),
2838
+ memoryLimit: z19.enum(["1g", "4g", "16g", "64g"]).optional(),
2839
+ networkPolicy: z19.discriminatedUnion("type", [
2840
+ z19.object({ type: z19.literal("disabled") }),
2841
+ z19.object({
2842
+ type: z19.literal("allowlist"),
2843
+ allowedDomains: z19.array(z19.string()),
2844
+ domainSecrets: z19.array(
2845
+ z19.object({
2846
+ domain: z19.string(),
2847
+ name: z19.string(),
2848
+ value: z19.string()
2752
2849
  })
2753
2850
  ).optional()
2754
2851
  })
2755
2852
  ]).optional(),
2756
2853
  skills: shellSkillsSchema
2757
2854
  }),
2758
- z18.object({
2759
- type: z18.literal("containerReference"),
2760
- containerId: z18.string()
2855
+ z19.object({
2856
+ type: z19.literal("containerReference"),
2857
+ containerId: z19.string()
2761
2858
  }),
2762
- z18.object({
2763
- type: z18.literal("local").optional(),
2764
- skills: z18.array(
2765
- z18.object({
2766
- name: z18.string(),
2767
- description: z18.string(),
2768
- path: z18.string()
2859
+ z19.object({
2860
+ type: z19.literal("local").optional(),
2861
+ skills: z19.array(
2862
+ z19.object({
2863
+ name: z19.string(),
2864
+ description: z19.string(),
2865
+ path: z19.string()
2769
2866
  })
2770
2867
  ).optional()
2771
2868
  })
@@ -2773,7 +2870,7 @@ var shellArgsSchema = lazySchema17(
2773
2870
  })
2774
2871
  )
2775
2872
  );
2776
- var shell = createProviderDefinedToolFactoryWithOutputSchema3({
2873
+ var shell = createProviderDefinedToolFactoryWithOutputSchema4({
2777
2874
  id: "openai.shell",
2778
2875
  inputSchema: shellInputSchema,
2779
2876
  outputSchema: shellOutputSchema
@@ -2781,36 +2878,36 @@ var shell = createProviderDefinedToolFactoryWithOutputSchema3({
2781
2878
 
2782
2879
  // src/tool/tool-search.ts
2783
2880
  import {
2784
- createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
2785
- lazySchema as lazySchema18,
2786
- zodSchema as zodSchema18
2881
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
2882
+ lazySchema as lazySchema19,
2883
+ zodSchema as zodSchema19
2787
2884
  } from "@ai-sdk/provider-utils";
2788
- import { z as z19 } from "zod/v4";
2789
- var toolSearchArgsSchema = lazySchema18(
2790
- () => zodSchema18(
2791
- z19.object({
2792
- execution: z19.enum(["server", "client"]).optional(),
2793
- description: z19.string().optional(),
2794
- parameters: z19.record(z19.string(), z19.unknown()).optional()
2885
+ import { z as z20 } from "zod/v4";
2886
+ var toolSearchArgsSchema = lazySchema19(
2887
+ () => zodSchema19(
2888
+ z20.object({
2889
+ execution: z20.enum(["server", "client"]).optional(),
2890
+ description: z20.string().optional(),
2891
+ parameters: z20.record(z20.string(), z20.unknown()).optional()
2795
2892
  })
2796
2893
  )
2797
2894
  );
2798
- var toolSearchInputSchema = lazySchema18(
2799
- () => zodSchema18(
2800
- z19.object({
2801
- arguments: z19.unknown().optional(),
2802
- call_id: z19.string().nullish()
2895
+ var toolSearchInputSchema = lazySchema19(
2896
+ () => zodSchema19(
2897
+ z20.object({
2898
+ arguments: z20.unknown().optional(),
2899
+ call_id: z20.string().nullish()
2803
2900
  })
2804
2901
  )
2805
2902
  );
2806
- var toolSearchOutputSchema = lazySchema18(
2807
- () => zodSchema18(
2808
- z19.object({
2809
- tools: z19.array(z19.record(z19.string(), z19.unknown()))
2903
+ var toolSearchOutputSchema = lazySchema19(
2904
+ () => zodSchema19(
2905
+ z20.object({
2906
+ tools: z20.array(z20.record(z20.string(), z20.unknown()))
2810
2907
  })
2811
2908
  )
2812
2909
  );
2813
- var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
2910
+ var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
2814
2911
  id: "openai.tool_search",
2815
2912
  inputSchema: toolSearchInputSchema,
2816
2913
  outputSchema: toolSearchOutputSchema
@@ -2820,50 +2917,50 @@ var toolSearch = (args = {}) => toolSearchToolFactory(args);
2820
2917
  // src/tool/web-search.ts
2821
2918
  import {
2822
2919
  createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
2823
- lazySchema as lazySchema19,
2824
- zodSchema as zodSchema19
2920
+ lazySchema as lazySchema20,
2921
+ zodSchema as zodSchema20
2825
2922
  } from "@ai-sdk/provider-utils";
2826
- import { z as z20 } from "zod/v4";
2827
- var webSearchArgsSchema = lazySchema19(
2828
- () => zodSchema19(
2829
- z20.object({
2830
- externalWebAccess: z20.boolean().optional(),
2831
- filters: z20.object({ allowedDomains: z20.array(z20.string()).optional() }).optional(),
2832
- searchContextSize: z20.enum(["low", "medium", "high"]).optional(),
2833
- userLocation: z20.object({
2834
- type: z20.literal("approximate"),
2835
- country: z20.string().optional(),
2836
- city: z20.string().optional(),
2837
- region: z20.string().optional(),
2838
- timezone: z20.string().optional()
2923
+ import { z as z21 } from "zod/v4";
2924
+ var webSearchArgsSchema = lazySchema20(
2925
+ () => zodSchema20(
2926
+ z21.object({
2927
+ externalWebAccess: z21.boolean().optional(),
2928
+ filters: z21.object({ allowedDomains: z21.array(z21.string()).optional() }).optional(),
2929
+ searchContextSize: z21.enum(["low", "medium", "high"]).optional(),
2930
+ userLocation: z21.object({
2931
+ type: z21.literal("approximate"),
2932
+ country: z21.string().optional(),
2933
+ city: z21.string().optional(),
2934
+ region: z21.string().optional(),
2935
+ timezone: z21.string().optional()
2839
2936
  }).optional()
2840
2937
  })
2841
2938
  )
2842
2939
  );
2843
- var webSearchInputSchema = lazySchema19(() => zodSchema19(z20.object({})));
2844
- var webSearchOutputSchema = lazySchema19(
2845
- () => zodSchema19(
2846
- z20.object({
2847
- action: z20.discriminatedUnion("type", [
2848
- z20.object({
2849
- type: z20.literal("search"),
2850
- query: z20.string().optional(),
2851
- queries: z20.array(z20.string()).optional()
2940
+ var webSearchInputSchema = lazySchema20(() => zodSchema20(z21.object({})));
2941
+ var webSearchOutputSchema = lazySchema20(
2942
+ () => zodSchema20(
2943
+ z21.object({
2944
+ action: z21.discriminatedUnion("type", [
2945
+ z21.object({
2946
+ type: z21.literal("search"),
2947
+ query: z21.string().optional(),
2948
+ queries: z21.array(z21.string()).optional()
2852
2949
  }),
2853
- z20.object({
2854
- type: z20.literal("openPage"),
2855
- url: z20.string().nullish()
2950
+ z21.object({
2951
+ type: z21.literal("openPage"),
2952
+ url: z21.string().nullish()
2856
2953
  }),
2857
- z20.object({
2858
- type: z20.literal("findInPage"),
2859
- url: z20.string().nullish(),
2860
- pattern: z20.string().nullish()
2954
+ z21.object({
2955
+ type: z21.literal("findInPage"),
2956
+ url: z21.string().nullish(),
2957
+ pattern: z21.string().nullish()
2861
2958
  })
2862
2959
  ]).optional(),
2863
- sources: z20.array(
2864
- z20.discriminatedUnion("type", [
2865
- z20.object({ type: z20.literal("url"), url: z20.string() }),
2866
- z20.object({ type: z20.literal("api"), name: z20.string() })
2960
+ sources: z21.array(
2961
+ z21.discriminatedUnion("type", [
2962
+ z21.object({ type: z21.literal("url"), url: z21.string() }),
2963
+ z21.object({ type: z21.literal("api"), name: z21.string() })
2867
2964
  ])
2868
2965
  ).optional()
2869
2966
  })
@@ -2879,43 +2976,43 @@ var webSearch = (args = {}) => webSearchToolFactory(args);
2879
2976
  // src/tool/web-search-preview.ts
2880
2977
  import {
2881
2978
  createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
2882
- lazySchema as lazySchema20,
2883
- zodSchema as zodSchema20
2979
+ lazySchema as lazySchema21,
2980
+ zodSchema as zodSchema21
2884
2981
  } from "@ai-sdk/provider-utils";
2885
- import { z as z21 } from "zod/v4";
2886
- var webSearchPreviewArgsSchema = lazySchema20(
2887
- () => zodSchema20(
2888
- z21.object({
2889
- searchContextSize: z21.enum(["low", "medium", "high"]).optional(),
2890
- userLocation: z21.object({
2891
- type: z21.literal("approximate"),
2892
- country: z21.string().optional(),
2893
- city: z21.string().optional(),
2894
- region: z21.string().optional(),
2895
- timezone: z21.string().optional()
2982
+ import { z as z22 } from "zod/v4";
2983
+ var webSearchPreviewArgsSchema = lazySchema21(
2984
+ () => zodSchema21(
2985
+ z22.object({
2986
+ searchContextSize: z22.enum(["low", "medium", "high"]).optional(),
2987
+ userLocation: z22.object({
2988
+ type: z22.literal("approximate"),
2989
+ country: z22.string().optional(),
2990
+ city: z22.string().optional(),
2991
+ region: z22.string().optional(),
2992
+ timezone: z22.string().optional()
2896
2993
  }).optional()
2897
2994
  })
2898
2995
  )
2899
2996
  );
2900
- var webSearchPreviewInputSchema = lazySchema20(
2901
- () => zodSchema20(z21.object({}))
2997
+ var webSearchPreviewInputSchema = lazySchema21(
2998
+ () => zodSchema21(z22.object({}))
2902
2999
  );
2903
- var webSearchPreviewOutputSchema = lazySchema20(
2904
- () => zodSchema20(
2905
- z21.object({
2906
- action: z21.discriminatedUnion("type", [
2907
- z21.object({
2908
- type: z21.literal("search"),
2909
- query: z21.string().optional()
3000
+ var webSearchPreviewOutputSchema = lazySchema21(
3001
+ () => zodSchema21(
3002
+ z22.object({
3003
+ action: z22.discriminatedUnion("type", [
3004
+ z22.object({
3005
+ type: z22.literal("search"),
3006
+ query: z22.string().optional()
2910
3007
  }),
2911
- z21.object({
2912
- type: z21.literal("openPage"),
2913
- url: z21.string().nullish()
3008
+ z22.object({
3009
+ type: z22.literal("openPage"),
3010
+ url: z22.string().nullish()
2914
3011
  }),
2915
- z21.object({
2916
- type: z21.literal("findInPage"),
2917
- url: z21.string().nullish(),
2918
- pattern: z21.string().nullish()
3012
+ z22.object({
3013
+ type: z22.literal("findInPage"),
3014
+ url: z22.string().nullish(),
3015
+ pattern: z22.string().nullish()
2919
3016
  })
2920
3017
  ]).optional()
2921
3018
  })
@@ -2930,60 +3027,60 @@ var webSearchPreview = createProviderExecutedToolFactory5({
2930
3027
  // src/tool/mcp.ts
2931
3028
  import {
2932
3029
  createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
2933
- lazySchema as lazySchema21,
2934
- zodSchema as zodSchema21
3030
+ lazySchema as lazySchema22,
3031
+ zodSchema as zodSchema22
2935
3032
  } from "@ai-sdk/provider-utils";
2936
- import { z as z22 } from "zod/v4";
2937
- var jsonValueSchema = z22.lazy(
2938
- () => z22.union([
2939
- z22.string(),
2940
- z22.number(),
2941
- z22.boolean(),
2942
- z22.null(),
2943
- z22.array(jsonValueSchema),
2944
- z22.record(z22.string(), jsonValueSchema)
3033
+ import { z as z23 } from "zod/v4";
3034
+ var jsonValueSchema = z23.lazy(
3035
+ () => z23.union([
3036
+ z23.string(),
3037
+ z23.number(),
3038
+ z23.boolean(),
3039
+ z23.null(),
3040
+ z23.array(jsonValueSchema),
3041
+ z23.record(z23.string(), jsonValueSchema)
2945
3042
  ])
2946
3043
  );
2947
- var mcpArgsSchema = lazySchema21(
2948
- () => zodSchema21(
2949
- z22.object({
2950
- serverLabel: z22.string(),
2951
- allowedTools: z22.union([
2952
- z22.array(z22.string()),
2953
- z22.object({
2954
- readOnly: z22.boolean().optional(),
2955
- toolNames: z22.array(z22.string()).optional()
3044
+ var mcpArgsSchema = lazySchema22(
3045
+ () => zodSchema22(
3046
+ z23.object({
3047
+ serverLabel: z23.string(),
3048
+ allowedTools: z23.union([
3049
+ z23.array(z23.string()),
3050
+ z23.object({
3051
+ readOnly: z23.boolean().optional(),
3052
+ toolNames: z23.array(z23.string()).optional()
2956
3053
  })
2957
3054
  ]).optional(),
2958
- authorization: z22.string().optional(),
2959
- connectorId: z22.string().optional(),
2960
- headers: z22.record(z22.string(), z22.string()).optional(),
2961
- requireApproval: z22.union([
2962
- z22.enum(["always", "never"]),
2963
- z22.object({
2964
- never: z22.object({
2965
- toolNames: z22.array(z22.string()).optional()
3055
+ authorization: z23.string().optional(),
3056
+ connectorId: z23.string().optional(),
3057
+ headers: z23.record(z23.string(), z23.string()).optional(),
3058
+ requireApproval: z23.union([
3059
+ z23.enum(["always", "never"]),
3060
+ z23.object({
3061
+ never: z23.object({
3062
+ toolNames: z23.array(z23.string()).optional()
2966
3063
  }).optional()
2967
3064
  })
2968
3065
  ]).optional(),
2969
- serverDescription: z22.string().optional(),
2970
- serverUrl: z22.string().optional()
3066
+ serverDescription: z23.string().optional(),
3067
+ serverUrl: z23.string().optional()
2971
3068
  }).refine(
2972
3069
  (v) => v.serverUrl != null || v.connectorId != null,
2973
3070
  "One of serverUrl or connectorId must be provided."
2974
3071
  )
2975
3072
  )
2976
3073
  );
2977
- var mcpInputSchema = lazySchema21(() => zodSchema21(z22.object({})));
2978
- var mcpOutputSchema = lazySchema21(
2979
- () => zodSchema21(
2980
- z22.object({
2981
- type: z22.literal("call"),
2982
- serverLabel: z22.string(),
2983
- name: z22.string(),
2984
- arguments: z22.string(),
2985
- output: z22.string().nullish(),
2986
- error: z22.union([z22.string(), jsonValueSchema]).optional()
3074
+ var mcpInputSchema = lazySchema22(() => zodSchema22(z23.object({})));
3075
+ var mcpOutputSchema = lazySchema22(
3076
+ () => zodSchema22(
3077
+ z23.object({
3078
+ type: z23.literal("call"),
3079
+ serverLabel: z23.string(),
3080
+ name: z23.string(),
3081
+ arguments: z23.string(),
3082
+ output: z23.string().nullish(),
3083
+ error: z23.union([z23.string(), jsonValueSchema]).optional()
2987
3084
  })
2988
3085
  )
2989
3086
  );
@@ -3021,6 +3118,15 @@ var openaiTools = {
3021
3118
  * @param container - The container to use for the code interpreter.
3022
3119
  */
3023
3120
  codeInterpreter,
3121
+ /**
3122
+ * The computer tool allows models to operate a browser or desktop through
3123
+ * batched UI actions. Your application executes the actions and returns an
3124
+ * updated screenshot.
3125
+ *
3126
+ * WARNING: Run computer use in an isolated environment, treat on-screen
3127
+ * content as untrusted, and require confirmation for consequential actions.
3128
+ */
3129
+ computer,
3024
3130
  /**
3025
3131
  * File search is a tool available in the Responses API. It enables models to
3026
3132
  * retrieve information in a knowledge base of previously uploaded files through
@@ -3572,7 +3678,7 @@ import {
3572
3678
  resolveProviderReference as resolveProviderReference2,
3573
3679
  validateTypes
3574
3680
  } from "@ai-sdk/provider-utils";
3575
- import { z as z23 } from "zod/v4";
3681
+ import { z as z24 } from "zod/v4";
3576
3682
  function serializeToolCallArguments2(input) {
3577
3683
  return JSON.stringify(input === void 0 ? {} : input);
3578
3684
  }
@@ -3597,9 +3703,10 @@ async function convertToOpenAIResponsesInput({
3597
3703
  hasLocalShellTool = false,
3598
3704
  hasShellTool = false,
3599
3705
  hasApplyPatchTool = false,
3706
+ hasComputerTool = false,
3600
3707
  customProviderToolNames
3601
3708
  }) {
3602
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
3709
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
3603
3710
  let input = [];
3604
3711
  const warnings = [];
3605
3712
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -3823,7 +3930,7 @@ async function convertToOpenAIResponsesInput({
3823
3930
  if (hasPreviousResponseId && store && id != null) {
3824
3931
  break;
3825
3932
  }
3826
- const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
3933
+ const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
3827
3934
  if (store && id != null && isProviderDefinedToolCall) {
3828
3935
  input.push({ type: "item_reference", id });
3829
3936
  break;
@@ -3880,6 +3987,53 @@ async function convertToOpenAIResponsesInput({
3880
3987
  });
3881
3988
  break;
3882
3989
  }
3990
+ if (hasComputerTool && resolvedToolName === "computer") {
3991
+ const parsedInput = await validateTypes({
3992
+ value: part.input,
3993
+ schema: computerInputSchema
3994
+ });
3995
+ input.push({
3996
+ type: "computer_call",
3997
+ call_id: part.toolCallId,
3998
+ id,
3999
+ status: parsedInput.status,
4000
+ actions: parsedInput.actions.map((action) => {
4001
+ switch (action.type) {
4002
+ case "click":
4003
+ case "double_click":
4004
+ case "move":
4005
+ return {
4006
+ ...action,
4007
+ keys: action.keys
4008
+ };
4009
+ case "drag":
4010
+ return {
4011
+ ...action,
4012
+ keys: action.keys
4013
+ };
4014
+ case "scroll":
4015
+ return {
4016
+ type: "scroll",
4017
+ x: action.x,
4018
+ y: action.y,
4019
+ scroll_x: action.scrollX,
4020
+ scroll_y: action.scrollY,
4021
+ keys: action.keys
4022
+ };
4023
+ default:
4024
+ return action;
4025
+ }
4026
+ }),
4027
+ pending_safety_checks: parsedInput.pendingSafetyChecks.map(
4028
+ (safetyCheck) => ({
4029
+ id: safetyCheck.id,
4030
+ code: safetyCheck.code,
4031
+ message: safetyCheck.message
4032
+ })
4033
+ )
4034
+ });
4035
+ break;
4036
+ }
3883
4037
  if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
3884
4038
  input.push({
3885
4039
  type: "custom_tool_call",
@@ -4150,6 +4304,28 @@ async function convertToOpenAIResponsesInput({
4150
4304
  });
4151
4305
  continue;
4152
4306
  }
4307
+ if (hasComputerTool && resolvedToolName === "computer" && output.type === "json") {
4308
+ const parsedOutput = await validateTypes({
4309
+ value: output.value,
4310
+ schema: computerOutputSchema
4311
+ });
4312
+ input.push({
4313
+ type: "computer_call_output",
4314
+ call_id: part.toolCallId,
4315
+ output: {
4316
+ type: "computer_screenshot",
4317
+ image_url: parsedOutput.output.imageUrl,
4318
+ file_id: parsedOutput.output.fileId,
4319
+ detail: parsedOutput.output.detail
4320
+ },
4321
+ acknowledged_safety_checks: (_w = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _w.map((safetyCheck) => ({
4322
+ id: safetyCheck.id,
4323
+ code: safetyCheck.code,
4324
+ message: safetyCheck.message
4325
+ }))
4326
+ });
4327
+ continue;
4328
+ }
4153
4329
  if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
4154
4330
  let outputValue;
4155
4331
  switch (output.type) {
@@ -4158,7 +4334,7 @@ async function convertToOpenAIResponsesInput({
4158
4334
  outputValue = output.value;
4159
4335
  break;
4160
4336
  case "execution-denied":
4161
- outputValue = (_w = output.reason) != null ? _w : "Tool call execution denied.";
4337
+ outputValue = (_x = output.reason) != null ? _x : "Tool call execution denied.";
4162
4338
  break;
4163
4339
  case "json":
4164
4340
  case "error-json":
@@ -4257,7 +4433,7 @@ async function convertToOpenAIResponsesInput({
4257
4433
  contentValue = output.value;
4258
4434
  break;
4259
4435
  case "execution-denied":
4260
- contentValue = (_x = output.reason) != null ? _x : "Tool call execution denied.";
4436
+ contentValue = (_y = output.reason) != null ? _y : "Tool call execution denied.";
4261
4437
  break;
4262
4438
  case "json":
4263
4439
  case "error-json":
@@ -4369,9 +4545,9 @@ async function convertToOpenAIResponsesInput({
4369
4545
  }
4370
4546
  return { input, warnings };
4371
4547
  }
4372
- var openaiResponsesReasoningProviderOptionsSchema = z23.object({
4373
- itemId: z23.string().nullish(),
4374
- reasoningEncryptedContent: z23.string().nullish()
4548
+ var openaiResponsesReasoningProviderOptionsSchema = z24.object({
4549
+ itemId: z24.string().nullish(),
4550
+ reasoningEncryptedContent: z24.string().nullish()
4375
4551
  });
4376
4552
 
4377
4553
  // src/responses/map-openai-responses-finish-reason.ts
@@ -4394,589 +4570,643 @@ function mapOpenAIResponseFinishReason({
4394
4570
 
4395
4571
  // src/responses/openai-responses-api.ts
4396
4572
  import {
4397
- lazySchema as lazySchema22,
4398
- zodSchema as zodSchema22
4573
+ lazySchema as lazySchema23,
4574
+ zodSchema as zodSchema23
4399
4575
  } from "@ai-sdk/provider-utils";
4400
- import { z as z24 } from "zod/v4";
4401
- var jsonValueSchema2 = z24.lazy(
4402
- () => z24.union([
4403
- z24.string(),
4404
- z24.number(),
4405
- z24.boolean(),
4406
- z24.null(),
4407
- z24.array(jsonValueSchema2),
4408
- z24.record(z24.string(), jsonValueSchema2.optional())
4576
+ import { z as z25 } from "zod/v4";
4577
+ var jsonValueSchema2 = z25.lazy(
4578
+ () => z25.union([
4579
+ z25.string(),
4580
+ z25.number(),
4581
+ z25.boolean(),
4582
+ z25.null(),
4583
+ z25.array(jsonValueSchema2),
4584
+ z25.record(z25.string(), jsonValueSchema2.optional())
4409
4585
  ])
4410
4586
  );
4411
- var openaiResponsesNestedErrorChunkSchema = z24.object({
4412
- type: z24.literal("error"),
4413
- sequence_number: z24.number(),
4414
- error: z24.object({
4415
- type: z24.string(),
4416
- code: z24.string(),
4417
- message: z24.string(),
4418
- param: z24.string().nullish()
4587
+ var openaiResponsesComputerSafetyCheckSchema = z25.object({
4588
+ id: z25.string(),
4589
+ code: z25.string().nullish(),
4590
+ message: z25.string().nullish()
4591
+ });
4592
+ var openaiResponsesComputerActionSchema = z25.discriminatedUnion("type", [
4593
+ z25.object({
4594
+ type: z25.literal("click"),
4595
+ button: z25.enum(["left", "right", "wheel", "back", "forward"]),
4596
+ x: z25.number(),
4597
+ y: z25.number(),
4598
+ keys: z25.array(z25.string()).nullish()
4599
+ }),
4600
+ z25.object({
4601
+ type: z25.literal("double_click"),
4602
+ x: z25.number(),
4603
+ y: z25.number(),
4604
+ keys: z25.array(z25.string()).nullish()
4605
+ }),
4606
+ z25.object({
4607
+ type: z25.literal("drag"),
4608
+ path: z25.array(z25.object({ x: z25.number(), y: z25.number() })),
4609
+ keys: z25.array(z25.string()).nullish()
4610
+ }),
4611
+ z25.object({
4612
+ type: z25.literal("keypress"),
4613
+ keys: z25.array(z25.string())
4614
+ }),
4615
+ z25.object({
4616
+ type: z25.literal("move"),
4617
+ x: z25.number(),
4618
+ y: z25.number(),
4619
+ keys: z25.array(z25.string()).nullish()
4620
+ }),
4621
+ z25.object({
4622
+ type: z25.literal("screenshot")
4623
+ }),
4624
+ z25.object({
4625
+ type: z25.literal("scroll"),
4626
+ x: z25.number(),
4627
+ y: z25.number(),
4628
+ scroll_x: z25.number(),
4629
+ scroll_y: z25.number(),
4630
+ keys: z25.array(z25.string()).nullish()
4631
+ }),
4632
+ z25.object({
4633
+ type: z25.literal("type"),
4634
+ text: z25.string()
4635
+ }),
4636
+ z25.object({
4637
+ type: z25.literal("wait")
4419
4638
  })
4639
+ ]);
4640
+ var openaiResponsesComputerCallSchema = z25.object({
4641
+ type: z25.literal("computer_call"),
4642
+ id: z25.string(),
4643
+ call_id: z25.string().nullish(),
4644
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
4645
+ action: openaiResponsesComputerActionSchema.nullish(),
4646
+ actions: z25.array(openaiResponsesComputerActionSchema).nullish(),
4647
+ pending_safety_checks: z25.array(openaiResponsesComputerSafetyCheckSchema).nullish()
4420
4648
  });
4421
- var openaiResponsesErrorChunkSchema = z24.object({
4422
- type: z24.literal("error"),
4423
- sequence_number: z24.number(),
4424
- code: z24.string().nullish(),
4425
- message: z24.string(),
4426
- param: z24.string().nullish()
4649
+ var openaiResponsesNestedErrorChunkSchema = z25.object({
4650
+ type: z25.literal("error"),
4651
+ sequence_number: z25.number(),
4652
+ error: z25.object({
4653
+ type: z25.string(),
4654
+ code: z25.string(),
4655
+ message: z25.string(),
4656
+ param: z25.string().nullish()
4657
+ })
4427
4658
  });
4428
- var openaiResponsesChunkSchema = lazySchema22(
4429
- () => zodSchema22(
4430
- z24.union([
4431
- z24.object({
4432
- type: z24.literal("response.output_text.delta"),
4433
- item_id: z24.string(),
4434
- delta: z24.string(),
4435
- logprobs: z24.array(
4436
- z24.object({
4437
- token: z24.string(),
4438
- logprob: z24.number(),
4439
- top_logprobs: z24.array(
4440
- z24.object({
4441
- token: z24.string(),
4442
- logprob: z24.number()
4659
+ var openaiResponsesErrorChunkSchema = z25.object({
4660
+ type: z25.literal("error"),
4661
+ sequence_number: z25.number(),
4662
+ code: z25.string().nullish(),
4663
+ message: z25.string(),
4664
+ param: z25.string().nullish()
4665
+ });
4666
+ var openaiResponsesChunkSchema = lazySchema23(
4667
+ () => zodSchema23(
4668
+ z25.union([
4669
+ z25.object({
4670
+ type: z25.literal("response.output_text.delta"),
4671
+ item_id: z25.string(),
4672
+ delta: z25.string(),
4673
+ logprobs: z25.array(
4674
+ z25.object({
4675
+ token: z25.string(),
4676
+ logprob: z25.number(),
4677
+ top_logprobs: z25.array(
4678
+ z25.object({
4679
+ token: z25.string(),
4680
+ logprob: z25.number()
4443
4681
  })
4444
4682
  )
4445
4683
  })
4446
4684
  ).nullish()
4447
4685
  }),
4448
- z24.object({
4449
- type: z24.enum(["response.completed", "response.incomplete"]),
4450
- response: z24.object({
4451
- incomplete_details: z24.object({ reason: z24.string() }).nullish(),
4452
- usage: z24.object({
4453
- input_tokens: z24.number(),
4454
- input_tokens_details: z24.object({
4455
- cached_tokens: z24.number().nullish(),
4456
- cache_write_tokens: z24.number().nullish(),
4457
- orchestration_input_tokens: z24.number().nullish(),
4458
- orchestration_input_cached_tokens: z24.number().nullish()
4686
+ z25.object({
4687
+ type: z25.enum(["response.completed", "response.incomplete"]),
4688
+ response: z25.object({
4689
+ incomplete_details: z25.object({ reason: z25.string() }).nullish(),
4690
+ usage: z25.object({
4691
+ input_tokens: z25.number(),
4692
+ input_tokens_details: z25.object({
4693
+ cached_tokens: z25.number().nullish(),
4694
+ cache_write_tokens: z25.number().nullish(),
4695
+ orchestration_input_tokens: z25.number().nullish(),
4696
+ orchestration_input_cached_tokens: z25.number().nullish()
4459
4697
  }).nullish(),
4460
- output_tokens: z24.number(),
4461
- output_tokens_details: z24.object({
4462
- reasoning_tokens: z24.number().nullish(),
4463
- orchestration_output_tokens: z24.number().nullish()
4698
+ output_tokens: z25.number(),
4699
+ output_tokens_details: z25.object({
4700
+ reasoning_tokens: z25.number().nullish(),
4701
+ orchestration_output_tokens: z25.number().nullish()
4464
4702
  }).nullish()
4465
4703
  }),
4466
- reasoning: z24.object({
4467
- context: z24.string().nullish()
4704
+ reasoning: z25.object({
4705
+ context: z25.string().nullish()
4468
4706
  }).nullish(),
4469
- service_tier: z24.string().nullish()
4707
+ service_tier: z25.string().nullish()
4470
4708
  })
4471
4709
  }),
4472
- z24.object({
4473
- type: z24.literal("response.failed"),
4474
- sequence_number: z24.number(),
4475
- response: z24.object({
4476
- error: z24.object({
4477
- code: z24.string().nullish(),
4478
- message: z24.string()
4710
+ z25.object({
4711
+ type: z25.literal("response.failed"),
4712
+ sequence_number: z25.number(),
4713
+ response: z25.object({
4714
+ error: z25.object({
4715
+ code: z25.string().nullish(),
4716
+ message: z25.string()
4479
4717
  }).nullish(),
4480
- incomplete_details: z24.object({ reason: z24.string() }).nullish(),
4481
- usage: z24.object({
4482
- input_tokens: z24.number(),
4483
- input_tokens_details: z24.object({
4484
- cached_tokens: z24.number().nullish(),
4485
- cache_write_tokens: z24.number().nullish(),
4486
- orchestration_input_tokens: z24.number().nullish(),
4487
- orchestration_input_cached_tokens: z24.number().nullish()
4718
+ incomplete_details: z25.object({ reason: z25.string() }).nullish(),
4719
+ usage: z25.object({
4720
+ input_tokens: z25.number(),
4721
+ input_tokens_details: z25.object({
4722
+ cached_tokens: z25.number().nullish(),
4723
+ cache_write_tokens: z25.number().nullish(),
4724
+ orchestration_input_tokens: z25.number().nullish(),
4725
+ orchestration_input_cached_tokens: z25.number().nullish()
4488
4726
  }).nullish(),
4489
- output_tokens: z24.number(),
4490
- output_tokens_details: z24.object({
4491
- reasoning_tokens: z24.number().nullish(),
4492
- orchestration_output_tokens: z24.number().nullish()
4727
+ output_tokens: z25.number(),
4728
+ output_tokens_details: z25.object({
4729
+ reasoning_tokens: z25.number().nullish(),
4730
+ orchestration_output_tokens: z25.number().nullish()
4493
4731
  }).nullish()
4494
4732
  }).nullish(),
4495
- reasoning: z24.object({
4496
- context: z24.string().nullish()
4733
+ reasoning: z25.object({
4734
+ context: z25.string().nullish()
4497
4735
  }).nullish(),
4498
- service_tier: z24.string().nullish()
4736
+ service_tier: z25.string().nullish()
4499
4737
  })
4500
4738
  }),
4501
- z24.object({
4502
- type: z24.literal("response.created"),
4503
- response: z24.object({
4504
- id: z24.string(),
4505
- created_at: z24.number(),
4506
- model: z24.string(),
4507
- service_tier: z24.string().nullish()
4739
+ z25.object({
4740
+ type: z25.literal("response.created"),
4741
+ response: z25.object({
4742
+ id: z25.string(),
4743
+ created_at: z25.number(),
4744
+ model: z25.string(),
4745
+ service_tier: z25.string().nullish()
4508
4746
  })
4509
4747
  }),
4510
- z24.object({
4511
- type: z24.literal("response.output_item.added"),
4512
- output_index: z24.number(),
4513
- item: z24.discriminatedUnion("type", [
4514
- z24.object({
4515
- type: z24.literal("message"),
4516
- id: z24.string(),
4517
- phase: z24.enum(["commentary", "final_answer"]).nullish()
4518
- }),
4519
- z24.object({
4520
- type: z24.literal("reasoning"),
4521
- id: z24.string(),
4522
- encrypted_content: z24.string().nullish()
4748
+ z25.object({
4749
+ type: z25.literal("response.output_item.added"),
4750
+ output_index: z25.number(),
4751
+ item: z25.discriminatedUnion("type", [
4752
+ z25.object({
4753
+ type: z25.literal("message"),
4754
+ id: z25.string(),
4755
+ phase: z25.enum(["commentary", "final_answer"]).nullish()
4523
4756
  }),
4524
- z24.object({
4525
- type: z24.literal("function_call"),
4526
- id: z24.string(),
4527
- call_id: z24.string(),
4528
- name: z24.string(),
4529
- arguments: z24.string(),
4530
- namespace: z24.string().nullish()
4757
+ z25.object({
4758
+ type: z25.literal("reasoning"),
4759
+ id: z25.string(),
4760
+ encrypted_content: z25.string().nullish()
4531
4761
  }),
4532
- z24.object({
4533
- type: z24.literal("web_search_call"),
4534
- id: z24.string(),
4535
- status: z24.string()
4762
+ z25.object({
4763
+ type: z25.literal("function_call"),
4764
+ id: z25.string(),
4765
+ call_id: z25.string(),
4766
+ name: z25.string(),
4767
+ arguments: z25.string(),
4768
+ namespace: z25.string().nullish()
4536
4769
  }),
4537
- z24.object({
4538
- type: z24.literal("computer_call"),
4539
- id: z24.string(),
4540
- status: z24.string()
4770
+ z25.object({
4771
+ type: z25.literal("web_search_call"),
4772
+ id: z25.string(),
4773
+ status: z25.string()
4541
4774
  }),
4542
- z24.object({
4543
- type: z24.literal("file_search_call"),
4544
- id: z24.string()
4775
+ openaiResponsesComputerCallSchema,
4776
+ z25.object({
4777
+ type: z25.literal("file_search_call"),
4778
+ id: z25.string()
4545
4779
  }),
4546
- z24.object({
4547
- type: z24.literal("image_generation_call"),
4548
- id: z24.string()
4780
+ z25.object({
4781
+ type: z25.literal("image_generation_call"),
4782
+ id: z25.string()
4549
4783
  }),
4550
- z24.object({
4551
- type: z24.literal("code_interpreter_call"),
4552
- id: z24.string(),
4553
- container_id: z24.string(),
4554
- code: z24.string().nullable(),
4555
- outputs: z24.array(
4556
- z24.discriminatedUnion("type", [
4557
- z24.object({ type: z24.literal("logs"), logs: z24.string() }),
4558
- z24.object({ type: z24.literal("image"), url: z24.string() })
4784
+ z25.object({
4785
+ type: z25.literal("code_interpreter_call"),
4786
+ id: z25.string(),
4787
+ container_id: z25.string(),
4788
+ code: z25.string().nullable(),
4789
+ outputs: z25.array(
4790
+ z25.discriminatedUnion("type", [
4791
+ z25.object({ type: z25.literal("logs"), logs: z25.string() }),
4792
+ z25.object({ type: z25.literal("image"), url: z25.string() })
4559
4793
  ])
4560
4794
  ).nullable(),
4561
- status: z24.string()
4795
+ status: z25.string()
4562
4796
  }),
4563
- z24.object({
4564
- type: z24.literal("mcp_call"),
4565
- id: z24.string(),
4566
- status: z24.string(),
4567
- approval_request_id: z24.string().nullish()
4797
+ z25.object({
4798
+ type: z25.literal("mcp_call"),
4799
+ id: z25.string(),
4800
+ status: z25.string(),
4801
+ approval_request_id: z25.string().nullish()
4568
4802
  }),
4569
- z24.object({
4570
- type: z24.literal("mcp_list_tools"),
4571
- id: z24.string()
4803
+ z25.object({
4804
+ type: z25.literal("mcp_list_tools"),
4805
+ id: z25.string()
4572
4806
  }),
4573
- z24.object({
4574
- type: z24.literal("mcp_approval_request"),
4575
- id: z24.string()
4807
+ z25.object({
4808
+ type: z25.literal("mcp_approval_request"),
4809
+ id: z25.string()
4576
4810
  }),
4577
- z24.object({
4578
- type: z24.literal("apply_patch_call"),
4579
- id: z24.string(),
4580
- call_id: z24.string(),
4581
- status: z24.enum(["in_progress", "completed"]),
4582
- operation: z24.discriminatedUnion("type", [
4583
- z24.object({
4584
- type: z24.literal("create_file"),
4585
- path: z24.string(),
4586
- diff: z24.string()
4811
+ z25.object({
4812
+ type: z25.literal("apply_patch_call"),
4813
+ id: z25.string(),
4814
+ call_id: z25.string(),
4815
+ status: z25.enum(["in_progress", "completed"]),
4816
+ operation: z25.discriminatedUnion("type", [
4817
+ z25.object({
4818
+ type: z25.literal("create_file"),
4819
+ path: z25.string(),
4820
+ diff: z25.string()
4587
4821
  }),
4588
- z24.object({
4589
- type: z24.literal("delete_file"),
4590
- path: z24.string()
4822
+ z25.object({
4823
+ type: z25.literal("delete_file"),
4824
+ path: z25.string()
4591
4825
  }),
4592
- z24.object({
4593
- type: z24.literal("update_file"),
4594
- path: z24.string(),
4595
- diff: z24.string()
4826
+ z25.object({
4827
+ type: z25.literal("update_file"),
4828
+ path: z25.string(),
4829
+ diff: z25.string()
4596
4830
  })
4597
4831
  ])
4598
4832
  }),
4599
- z24.object({
4600
- type: z24.literal("custom_tool_call"),
4601
- id: z24.string(),
4602
- call_id: z24.string(),
4603
- name: z24.string(),
4604
- input: z24.string()
4833
+ z25.object({
4834
+ type: z25.literal("custom_tool_call"),
4835
+ id: z25.string(),
4836
+ call_id: z25.string(),
4837
+ name: z25.string(),
4838
+ input: z25.string()
4605
4839
  }),
4606
- z24.object({
4607
- type: z24.literal("shell_call"),
4608
- id: z24.string(),
4609
- call_id: z24.string(),
4610
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4611
- action: z24.object({
4612
- commands: z24.array(z24.string())
4840
+ z25.object({
4841
+ type: z25.literal("shell_call"),
4842
+ id: z25.string(),
4843
+ call_id: z25.string(),
4844
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
4845
+ action: z25.object({
4846
+ commands: z25.array(z25.string())
4613
4847
  })
4614
4848
  }),
4615
- z24.object({
4616
- type: z24.literal("compaction"),
4617
- id: z24.string(),
4618
- encrypted_content: z24.string().nullish()
4849
+ z25.object({
4850
+ type: z25.literal("compaction"),
4851
+ id: z25.string(),
4852
+ encrypted_content: z25.string().nullish()
4619
4853
  }),
4620
- z24.object({
4621
- type: z24.literal("shell_call_output"),
4622
- id: z24.string(),
4623
- call_id: z24.string(),
4624
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4625
- output: z24.array(
4626
- z24.object({
4627
- stdout: z24.string(),
4628
- stderr: z24.string(),
4629
- outcome: z24.discriminatedUnion("type", [
4630
- z24.object({ type: z24.literal("timeout") }),
4631
- z24.object({
4632
- type: z24.literal("exit"),
4633
- exit_code: z24.number()
4854
+ z25.object({
4855
+ type: z25.literal("shell_call_output"),
4856
+ id: z25.string(),
4857
+ call_id: z25.string(),
4858
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
4859
+ output: z25.array(
4860
+ z25.object({
4861
+ stdout: z25.string(),
4862
+ stderr: z25.string(),
4863
+ outcome: z25.discriminatedUnion("type", [
4864
+ z25.object({ type: z25.literal("timeout") }),
4865
+ z25.object({
4866
+ type: z25.literal("exit"),
4867
+ exit_code: z25.number()
4634
4868
  })
4635
4869
  ])
4636
4870
  })
4637
4871
  )
4638
4872
  }),
4639
- z24.object({
4640
- type: z24.literal("tool_search_call"),
4641
- id: z24.string(),
4642
- execution: z24.enum(["server", "client"]),
4643
- call_id: z24.string().nullable(),
4644
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4645
- arguments: z24.unknown()
4873
+ z25.object({
4874
+ type: z25.literal("tool_search_call"),
4875
+ id: z25.string(),
4876
+ execution: z25.enum(["server", "client"]),
4877
+ call_id: z25.string().nullable(),
4878
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
4879
+ arguments: z25.unknown()
4646
4880
  }),
4647
- z24.object({
4648
- type: z24.literal("tool_search_output"),
4649
- id: z24.string(),
4650
- execution: z24.enum(["server", "client"]),
4651
- call_id: z24.string().nullable(),
4652
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4653
- tools: z24.array(z24.record(z24.string(), jsonValueSchema2.optional()))
4881
+ z25.object({
4882
+ type: z25.literal("tool_search_output"),
4883
+ id: z25.string(),
4884
+ execution: z25.enum(["server", "client"]),
4885
+ call_id: z25.string().nullable(),
4886
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
4887
+ tools: z25.array(z25.record(z25.string(), jsonValueSchema2.optional()))
4654
4888
  })
4655
4889
  ])
4656
4890
  }),
4657
- z24.object({
4658
- type: z24.literal("response.output_item.done"),
4659
- output_index: z24.number(),
4660
- item: z24.discriminatedUnion("type", [
4661
- z24.object({
4662
- type: z24.literal("message"),
4663
- id: z24.string(),
4664
- phase: z24.enum(["commentary", "final_answer"]).nullish()
4891
+ z25.object({
4892
+ type: z25.literal("response.output_item.done"),
4893
+ output_index: z25.number(),
4894
+ item: z25.discriminatedUnion("type", [
4895
+ z25.object({
4896
+ type: z25.literal("message"),
4897
+ id: z25.string(),
4898
+ phase: z25.enum(["commentary", "final_answer"]).nullish()
4665
4899
  }),
4666
- z24.object({
4667
- type: z24.literal("reasoning"),
4668
- id: z24.string(),
4669
- encrypted_content: z24.string().nullish()
4900
+ z25.object({
4901
+ type: z25.literal("reasoning"),
4902
+ id: z25.string(),
4903
+ encrypted_content: z25.string().nullish()
4670
4904
  }),
4671
- z24.object({
4672
- type: z24.literal("function_call"),
4673
- id: z24.string(),
4674
- call_id: z24.string(),
4675
- name: z24.string(),
4676
- arguments: z24.string(),
4677
- status: z24.literal("completed"),
4678
- namespace: z24.string().nullish()
4905
+ z25.object({
4906
+ type: z25.literal("function_call"),
4907
+ id: z25.string(),
4908
+ call_id: z25.string(),
4909
+ name: z25.string(),
4910
+ arguments: z25.string(),
4911
+ status: z25.literal("completed"),
4912
+ namespace: z25.string().nullish()
4679
4913
  }),
4680
- z24.object({
4681
- type: z24.literal("custom_tool_call"),
4682
- id: z24.string(),
4683
- call_id: z24.string(),
4684
- name: z24.string(),
4685
- input: z24.string(),
4686
- status: z24.literal("completed")
4914
+ z25.object({
4915
+ type: z25.literal("custom_tool_call"),
4916
+ id: z25.string(),
4917
+ call_id: z25.string(),
4918
+ name: z25.string(),
4919
+ input: z25.string(),
4920
+ status: z25.literal("completed")
4687
4921
  }),
4688
- z24.object({
4689
- type: z24.literal("code_interpreter_call"),
4690
- id: z24.string(),
4691
- code: z24.string().nullable(),
4692
- container_id: z24.string(),
4693
- outputs: z24.array(
4694
- z24.discriminatedUnion("type", [
4695
- z24.object({ type: z24.literal("logs"), logs: z24.string() }),
4696
- z24.object({ type: z24.literal("image"), url: z24.string() })
4922
+ z25.object({
4923
+ type: z25.literal("code_interpreter_call"),
4924
+ id: z25.string(),
4925
+ code: z25.string().nullable(),
4926
+ container_id: z25.string(),
4927
+ outputs: z25.array(
4928
+ z25.discriminatedUnion("type", [
4929
+ z25.object({ type: z25.literal("logs"), logs: z25.string() }),
4930
+ z25.object({ type: z25.literal("image"), url: z25.string() })
4697
4931
  ])
4698
4932
  ).nullable()
4699
4933
  }),
4700
- z24.object({
4701
- type: z24.literal("image_generation_call"),
4702
- id: z24.string(),
4703
- result: z24.string()
4934
+ z25.object({
4935
+ type: z25.literal("image_generation_call"),
4936
+ id: z25.string(),
4937
+ result: z25.string()
4704
4938
  }),
4705
- z24.object({
4706
- type: z24.literal("web_search_call"),
4707
- id: z24.string(),
4708
- status: z24.string(),
4709
- action: z24.discriminatedUnion("type", [
4710
- z24.object({
4711
- type: z24.literal("search"),
4712
- query: z24.string().nullish(),
4713
- queries: z24.array(z24.string()).nullish(),
4714
- sources: z24.array(
4715
- z24.discriminatedUnion("type", [
4716
- z24.object({ type: z24.literal("url"), url: z24.string() }),
4717
- z24.object({ type: z24.literal("api"), name: z24.string() })
4939
+ z25.object({
4940
+ type: z25.literal("web_search_call"),
4941
+ id: z25.string(),
4942
+ status: z25.string(),
4943
+ action: z25.discriminatedUnion("type", [
4944
+ z25.object({
4945
+ type: z25.literal("search"),
4946
+ query: z25.string().nullish(),
4947
+ queries: z25.array(z25.string()).nullish(),
4948
+ sources: z25.array(
4949
+ z25.discriminatedUnion("type", [
4950
+ z25.object({ type: z25.literal("url"), url: z25.string() }),
4951
+ z25.object({ type: z25.literal("api"), name: z25.string() })
4718
4952
  ])
4719
4953
  ).nullish()
4720
4954
  }),
4721
- z24.object({
4722
- type: z24.literal("open_page"),
4723
- url: z24.string().nullish()
4955
+ z25.object({
4956
+ type: z25.literal("open_page"),
4957
+ url: z25.string().nullish()
4724
4958
  }),
4725
- z24.object({
4726
- type: z24.literal("find_in_page"),
4727
- url: z24.string().nullish(),
4728
- pattern: z24.string().nullish()
4959
+ z25.object({
4960
+ type: z25.literal("find_in_page"),
4961
+ url: z25.string().nullish(),
4962
+ pattern: z25.string().nullish()
4729
4963
  })
4730
4964
  ]).nullish()
4731
4965
  }),
4732
- z24.object({
4733
- type: z24.literal("file_search_call"),
4734
- id: z24.string(),
4735
- queries: z24.array(z24.string()),
4736
- results: z24.array(
4737
- z24.object({
4738
- attributes: z24.record(
4739
- z24.string(),
4740
- z24.union([z24.string(), z24.number(), z24.boolean()])
4966
+ z25.object({
4967
+ type: z25.literal("file_search_call"),
4968
+ id: z25.string(),
4969
+ queries: z25.array(z25.string()),
4970
+ results: z25.array(
4971
+ z25.object({
4972
+ attributes: z25.record(
4973
+ z25.string(),
4974
+ z25.union([z25.string(), z25.number(), z25.boolean()])
4741
4975
  ),
4742
- file_id: z24.string(),
4743
- filename: z24.string(),
4744
- score: z24.number(),
4745
- text: z24.string()
4976
+ file_id: z25.string(),
4977
+ filename: z25.string(),
4978
+ score: z25.number(),
4979
+ text: z25.string()
4746
4980
  })
4747
4981
  ).nullish()
4748
4982
  }),
4749
- z24.object({
4750
- type: z24.literal("local_shell_call"),
4751
- id: z24.string(),
4752
- call_id: z24.string(),
4753
- action: z24.object({
4754
- type: z24.literal("exec"),
4755
- command: z24.array(z24.string()),
4756
- timeout_ms: z24.number().optional(),
4757
- user: z24.string().optional(),
4758
- working_directory: z24.string().optional(),
4759
- env: z24.record(z24.string(), z24.string()).optional()
4983
+ z25.object({
4984
+ type: z25.literal("local_shell_call"),
4985
+ id: z25.string(),
4986
+ call_id: z25.string(),
4987
+ action: z25.object({
4988
+ type: z25.literal("exec"),
4989
+ command: z25.array(z25.string()),
4990
+ timeout_ms: z25.number().optional(),
4991
+ user: z25.string().optional(),
4992
+ working_directory: z25.string().optional(),
4993
+ env: z25.record(z25.string(), z25.string()).optional()
4760
4994
  })
4761
4995
  }),
4762
- z24.object({
4763
- type: z24.literal("computer_call"),
4764
- id: z24.string(),
4765
- status: z24.literal("completed")
4766
- }),
4767
- z24.object({
4768
- type: z24.literal("mcp_call"),
4769
- id: z24.string(),
4770
- status: z24.string(),
4771
- arguments: z24.string(),
4772
- name: z24.string(),
4773
- server_label: z24.string(),
4774
- output: z24.string().nullish(),
4775
- error: z24.union([
4776
- z24.string(),
4777
- z24.object({
4778
- type: z24.string().optional(),
4779
- code: z24.union([z24.number(), z24.string()]).optional(),
4780
- message: z24.string().optional()
4996
+ openaiResponsesComputerCallSchema,
4997
+ z25.object({
4998
+ type: z25.literal("mcp_call"),
4999
+ id: z25.string(),
5000
+ status: z25.string(),
5001
+ arguments: z25.string(),
5002
+ name: z25.string(),
5003
+ server_label: z25.string(),
5004
+ output: z25.string().nullish(),
5005
+ error: z25.union([
5006
+ z25.string(),
5007
+ z25.object({
5008
+ type: z25.string().optional(),
5009
+ code: z25.union([z25.number(), z25.string()]).optional(),
5010
+ message: z25.string().optional()
4781
5011
  }).loose()
4782
5012
  ]).nullish(),
4783
- approval_request_id: z24.string().nullish()
5013
+ approval_request_id: z25.string().nullish()
4784
5014
  }),
4785
- z24.object({
4786
- type: z24.literal("mcp_list_tools"),
4787
- id: z24.string(),
4788
- server_label: z24.string(),
4789
- tools: z24.array(
4790
- z24.object({
4791
- name: z24.string(),
4792
- description: z24.string().optional(),
4793
- input_schema: z24.any(),
4794
- annotations: z24.record(z24.string(), z24.unknown()).optional()
5015
+ z25.object({
5016
+ type: z25.literal("mcp_list_tools"),
5017
+ id: z25.string(),
5018
+ server_label: z25.string(),
5019
+ tools: z25.array(
5020
+ z25.object({
5021
+ name: z25.string(),
5022
+ description: z25.string().optional(),
5023
+ input_schema: z25.any(),
5024
+ annotations: z25.record(z25.string(), z25.unknown()).optional()
4795
5025
  })
4796
5026
  ),
4797
- error: z24.union([
4798
- z24.string(),
4799
- z24.object({
4800
- type: z24.string().optional(),
4801
- code: z24.union([z24.number(), z24.string()]).optional(),
4802
- message: z24.string().optional()
5027
+ error: z25.union([
5028
+ z25.string(),
5029
+ z25.object({
5030
+ type: z25.string().optional(),
5031
+ code: z25.union([z25.number(), z25.string()]).optional(),
5032
+ message: z25.string().optional()
4803
5033
  }).loose()
4804
5034
  ]).optional()
4805
5035
  }),
4806
- z24.object({
4807
- type: z24.literal("mcp_approval_request"),
4808
- id: z24.string(),
4809
- server_label: z24.string(),
4810
- name: z24.string(),
4811
- arguments: z24.string(),
4812
- approval_request_id: z24.string().optional()
5036
+ z25.object({
5037
+ type: z25.literal("mcp_approval_request"),
5038
+ id: z25.string(),
5039
+ server_label: z25.string(),
5040
+ name: z25.string(),
5041
+ arguments: z25.string(),
5042
+ approval_request_id: z25.string().optional()
4813
5043
  }),
4814
- z24.object({
4815
- type: z24.literal("apply_patch_call"),
4816
- id: z24.string(),
4817
- call_id: z24.string(),
4818
- status: z24.enum(["in_progress", "completed"]),
4819
- operation: z24.discriminatedUnion("type", [
4820
- z24.object({
4821
- type: z24.literal("create_file"),
4822
- path: z24.string(),
4823
- diff: z24.string()
5044
+ z25.object({
5045
+ type: z25.literal("apply_patch_call"),
5046
+ id: z25.string(),
5047
+ call_id: z25.string(),
5048
+ status: z25.enum(["in_progress", "completed"]),
5049
+ operation: z25.discriminatedUnion("type", [
5050
+ z25.object({
5051
+ type: z25.literal("create_file"),
5052
+ path: z25.string(),
5053
+ diff: z25.string()
4824
5054
  }),
4825
- z24.object({
4826
- type: z24.literal("delete_file"),
4827
- path: z24.string()
5055
+ z25.object({
5056
+ type: z25.literal("delete_file"),
5057
+ path: z25.string()
4828
5058
  }),
4829
- z24.object({
4830
- type: z24.literal("update_file"),
4831
- path: z24.string(),
4832
- diff: z24.string()
5059
+ z25.object({
5060
+ type: z25.literal("update_file"),
5061
+ path: z25.string(),
5062
+ diff: z25.string()
4833
5063
  })
4834
5064
  ])
4835
5065
  }),
4836
- z24.object({
4837
- type: z24.literal("shell_call"),
4838
- id: z24.string(),
4839
- call_id: z24.string(),
4840
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4841
- action: z24.object({
4842
- commands: z24.array(z24.string())
5066
+ z25.object({
5067
+ type: z25.literal("shell_call"),
5068
+ id: z25.string(),
5069
+ call_id: z25.string(),
5070
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5071
+ action: z25.object({
5072
+ commands: z25.array(z25.string())
4843
5073
  })
4844
5074
  }),
4845
- z24.object({
4846
- type: z24.literal("compaction"),
4847
- id: z24.string(),
4848
- encrypted_content: z24.string()
5075
+ z25.object({
5076
+ type: z25.literal("compaction"),
5077
+ id: z25.string(),
5078
+ encrypted_content: z25.string()
4849
5079
  }),
4850
- z24.object({
4851
- type: z24.literal("shell_call_output"),
4852
- id: z24.string(),
4853
- call_id: z24.string(),
4854
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4855
- output: z24.array(
4856
- z24.object({
4857
- stdout: z24.string(),
4858
- stderr: z24.string(),
4859
- outcome: z24.discriminatedUnion("type", [
4860
- z24.object({ type: z24.literal("timeout") }),
4861
- z24.object({
4862
- type: z24.literal("exit"),
4863
- exit_code: z24.number()
5080
+ z25.object({
5081
+ type: z25.literal("shell_call_output"),
5082
+ id: z25.string(),
5083
+ call_id: z25.string(),
5084
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5085
+ output: z25.array(
5086
+ z25.object({
5087
+ stdout: z25.string(),
5088
+ stderr: z25.string(),
5089
+ outcome: z25.discriminatedUnion("type", [
5090
+ z25.object({ type: z25.literal("timeout") }),
5091
+ z25.object({
5092
+ type: z25.literal("exit"),
5093
+ exit_code: z25.number()
4864
5094
  })
4865
5095
  ])
4866
5096
  })
4867
5097
  )
4868
5098
  }),
4869
- z24.object({
4870
- type: z24.literal("tool_search_call"),
4871
- id: z24.string(),
4872
- execution: z24.enum(["server", "client"]),
4873
- call_id: z24.string().nullable(),
4874
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4875
- arguments: z24.unknown()
5099
+ z25.object({
5100
+ type: z25.literal("tool_search_call"),
5101
+ id: z25.string(),
5102
+ execution: z25.enum(["server", "client"]),
5103
+ call_id: z25.string().nullable(),
5104
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5105
+ arguments: z25.unknown()
4876
5106
  }),
4877
- z24.object({
4878
- type: z24.literal("tool_search_output"),
4879
- id: z24.string(),
4880
- execution: z24.enum(["server", "client"]),
4881
- call_id: z24.string().nullable(),
4882
- status: z24.enum(["in_progress", "completed", "incomplete"]),
4883
- tools: z24.array(z24.record(z24.string(), jsonValueSchema2.optional()))
5107
+ z25.object({
5108
+ type: z25.literal("tool_search_output"),
5109
+ id: z25.string(),
5110
+ execution: z25.enum(["server", "client"]),
5111
+ call_id: z25.string().nullable(),
5112
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5113
+ tools: z25.array(z25.record(z25.string(), jsonValueSchema2.optional()))
4884
5114
  })
4885
5115
  ])
4886
5116
  }),
4887
- z24.object({
4888
- type: z24.literal("response.function_call_arguments.delta"),
4889
- item_id: z24.string(),
4890
- output_index: z24.number(),
4891
- delta: z24.string()
5117
+ z25.object({
5118
+ type: z25.literal("response.function_call_arguments.delta"),
5119
+ item_id: z25.string(),
5120
+ output_index: z25.number(),
5121
+ delta: z25.string()
4892
5122
  }),
4893
- z24.object({
4894
- type: z24.literal("response.custom_tool_call_input.delta"),
4895
- item_id: z24.string(),
4896
- output_index: z24.number(),
4897
- delta: z24.string()
5123
+ z25.object({
5124
+ type: z25.literal("response.custom_tool_call_input.delta"),
5125
+ item_id: z25.string(),
5126
+ output_index: z25.number(),
5127
+ delta: z25.string()
4898
5128
  }),
4899
- z24.object({
4900
- type: z24.literal("response.image_generation_call.partial_image"),
4901
- item_id: z24.string(),
4902
- output_index: z24.number(),
4903
- partial_image_b64: z24.string()
5129
+ z25.object({
5130
+ type: z25.literal("response.image_generation_call.partial_image"),
5131
+ item_id: z25.string(),
5132
+ output_index: z25.number(),
5133
+ partial_image_b64: z25.string()
4904
5134
  }),
4905
- z24.object({
4906
- type: z24.literal("response.code_interpreter_call_code.delta"),
4907
- item_id: z24.string(),
4908
- output_index: z24.number(),
4909
- delta: z24.string()
5135
+ z25.object({
5136
+ type: z25.literal("response.code_interpreter_call_code.delta"),
5137
+ item_id: z25.string(),
5138
+ output_index: z25.number(),
5139
+ delta: z25.string()
4910
5140
  }),
4911
- z24.object({
4912
- type: z24.literal("response.code_interpreter_call_code.done"),
4913
- item_id: z24.string(),
4914
- output_index: z24.number(),
4915
- code: z24.string()
5141
+ z25.object({
5142
+ type: z25.literal("response.code_interpreter_call_code.done"),
5143
+ item_id: z25.string(),
5144
+ output_index: z25.number(),
5145
+ code: z25.string()
4916
5146
  }),
4917
- z24.object({
4918
- type: z24.literal("response.output_text.annotation.added"),
4919
- annotation: z24.discriminatedUnion("type", [
4920
- z24.object({
4921
- type: z24.literal("url_citation"),
4922
- start_index: z24.number(),
4923
- end_index: z24.number(),
4924
- url: z24.string(),
4925
- title: z24.string()
5147
+ z25.object({
5148
+ type: z25.literal("response.output_text.annotation.added"),
5149
+ annotation: z25.discriminatedUnion("type", [
5150
+ z25.object({
5151
+ type: z25.literal("url_citation"),
5152
+ start_index: z25.number(),
5153
+ end_index: z25.number(),
5154
+ url: z25.string(),
5155
+ title: z25.string()
4926
5156
  }),
4927
- z24.object({
4928
- type: z24.literal("file_citation"),
4929
- file_id: z24.string(),
4930
- filename: z24.string(),
4931
- index: z24.number()
5157
+ z25.object({
5158
+ type: z25.literal("file_citation"),
5159
+ file_id: z25.string(),
5160
+ filename: z25.string(),
5161
+ index: z25.number()
4932
5162
  }),
4933
- z24.object({
4934
- type: z24.literal("container_file_citation"),
4935
- container_id: z24.string(),
4936
- file_id: z24.string(),
4937
- filename: z24.string(),
4938
- start_index: z24.number(),
4939
- end_index: z24.number()
5163
+ z25.object({
5164
+ type: z25.literal("container_file_citation"),
5165
+ container_id: z25.string(),
5166
+ file_id: z25.string(),
5167
+ filename: z25.string(),
5168
+ start_index: z25.number(),
5169
+ end_index: z25.number()
4940
5170
  }),
4941
- z24.object({
4942
- type: z24.literal("file_path"),
4943
- file_id: z24.string(),
4944
- index: z24.number()
5171
+ z25.object({
5172
+ type: z25.literal("file_path"),
5173
+ file_id: z25.string(),
5174
+ index: z25.number()
4945
5175
  })
4946
5176
  ])
4947
5177
  }),
4948
- z24.object({
4949
- type: z24.literal("response.reasoning_summary_part.added"),
4950
- item_id: z24.string(),
4951
- summary_index: z24.number()
5178
+ z25.object({
5179
+ type: z25.literal("response.reasoning_summary_part.added"),
5180
+ item_id: z25.string(),
5181
+ summary_index: z25.number()
4952
5182
  }),
4953
- z24.object({
4954
- type: z24.literal("response.reasoning_summary_text.delta"),
4955
- item_id: z24.string(),
4956
- summary_index: z24.number(),
4957
- delta: z24.string()
5183
+ z25.object({
5184
+ type: z25.literal("response.reasoning_summary_text.delta"),
5185
+ item_id: z25.string(),
5186
+ summary_index: z25.number(),
5187
+ delta: z25.string()
4958
5188
  }),
4959
- z24.object({
4960
- type: z24.literal("response.reasoning_summary_part.done"),
4961
- item_id: z24.string(),
4962
- summary_index: z24.number()
5189
+ z25.object({
5190
+ type: z25.literal("response.reasoning_summary_part.done"),
5191
+ item_id: z25.string(),
5192
+ summary_index: z25.number()
4963
5193
  }),
4964
- z24.object({
4965
- type: z24.literal("response.apply_patch_call_operation_diff.delta"),
4966
- item_id: z24.string(),
4967
- output_index: z24.number(),
4968
- delta: z24.string(),
4969
- obfuscation: z24.string().nullish()
5194
+ z25.object({
5195
+ type: z25.literal("response.apply_patch_call_operation_diff.delta"),
5196
+ item_id: z25.string(),
5197
+ output_index: z25.number(),
5198
+ delta: z25.string(),
5199
+ obfuscation: z25.string().nullish()
4970
5200
  }),
4971
- z24.object({
4972
- type: z24.literal("response.apply_patch_call_operation_diff.done"),
4973
- item_id: z24.string(),
4974
- output_index: z24.number(),
4975
- diff: z24.string()
5201
+ z25.object({
5202
+ type: z25.literal("response.apply_patch_call_operation_diff.done"),
5203
+ item_id: z25.string(),
5204
+ output_index: z25.number(),
5205
+ diff: z25.string()
4976
5206
  }),
4977
5207
  openaiResponsesNestedErrorChunkSchema,
4978
5208
  openaiResponsesErrorChunkSchema,
4979
- z24.object({ type: z24.string() }).loose().transform((value) => ({
5209
+ z25.object({ type: z25.string() }).loose().transform((value) => ({
4980
5210
  type: "unknown_chunk",
4981
5211
  message: value.type
4982
5212
  }))
@@ -4984,319 +5214,315 @@ var openaiResponsesChunkSchema = lazySchema22(
4984
5214
  ])
4985
5215
  )
4986
5216
  );
4987
- var openaiResponsesResponseSchema = lazySchema22(
4988
- () => zodSchema22(
4989
- z24.object({
4990
- id: z24.string().optional(),
4991
- created_at: z24.number().optional(),
4992
- error: z24.object({
4993
- message: z24.string(),
4994
- type: z24.string(),
4995
- param: z24.string().nullish(),
4996
- code: z24.string()
5217
+ var openaiResponsesResponseSchema = lazySchema23(
5218
+ () => zodSchema23(
5219
+ z25.object({
5220
+ id: z25.string().optional(),
5221
+ created_at: z25.number().optional(),
5222
+ error: z25.object({
5223
+ message: z25.string(),
5224
+ type: z25.string(),
5225
+ param: z25.string().nullish(),
5226
+ code: z25.string()
4997
5227
  }).nullish(),
4998
- model: z24.string().optional(),
4999
- output: z24.array(
5000
- z24.discriminatedUnion("type", [
5001
- z24.object({
5002
- type: z24.literal("message"),
5003
- role: z24.literal("assistant"),
5004
- id: z24.string(),
5005
- phase: z24.enum(["commentary", "final_answer"]).nullish(),
5006
- content: z24.array(
5007
- z24.object({
5008
- type: z24.literal("output_text"),
5009
- text: z24.string(),
5010
- logprobs: z24.array(
5011
- z24.object({
5012
- token: z24.string(),
5013
- logprob: z24.number(),
5014
- top_logprobs: z24.array(
5015
- z24.object({
5016
- token: z24.string(),
5017
- logprob: z24.number()
5228
+ model: z25.string().optional(),
5229
+ output: z25.array(
5230
+ z25.discriminatedUnion("type", [
5231
+ z25.object({
5232
+ type: z25.literal("message"),
5233
+ role: z25.literal("assistant"),
5234
+ id: z25.string(),
5235
+ phase: z25.enum(["commentary", "final_answer"]).nullish(),
5236
+ content: z25.array(
5237
+ z25.object({
5238
+ type: z25.literal("output_text"),
5239
+ text: z25.string(),
5240
+ logprobs: z25.array(
5241
+ z25.object({
5242
+ token: z25.string(),
5243
+ logprob: z25.number(),
5244
+ top_logprobs: z25.array(
5245
+ z25.object({
5246
+ token: z25.string(),
5247
+ logprob: z25.number()
5018
5248
  })
5019
5249
  )
5020
5250
  })
5021
5251
  ).nullish(),
5022
- annotations: z24.array(
5023
- z24.discriminatedUnion("type", [
5024
- z24.object({
5025
- type: z24.literal("url_citation"),
5026
- start_index: z24.number(),
5027
- end_index: z24.number(),
5028
- url: z24.string(),
5029
- title: z24.string()
5252
+ annotations: z25.array(
5253
+ z25.discriminatedUnion("type", [
5254
+ z25.object({
5255
+ type: z25.literal("url_citation"),
5256
+ start_index: z25.number(),
5257
+ end_index: z25.number(),
5258
+ url: z25.string(),
5259
+ title: z25.string()
5030
5260
  }),
5031
- z24.object({
5032
- type: z24.literal("file_citation"),
5033
- file_id: z24.string(),
5034
- filename: z24.string(),
5035
- index: z24.number()
5261
+ z25.object({
5262
+ type: z25.literal("file_citation"),
5263
+ file_id: z25.string(),
5264
+ filename: z25.string(),
5265
+ index: z25.number()
5036
5266
  }),
5037
- z24.object({
5038
- type: z24.literal("container_file_citation"),
5039
- container_id: z24.string(),
5040
- file_id: z24.string(),
5041
- filename: z24.string(),
5042
- start_index: z24.number(),
5043
- end_index: z24.number()
5267
+ z25.object({
5268
+ type: z25.literal("container_file_citation"),
5269
+ container_id: z25.string(),
5270
+ file_id: z25.string(),
5271
+ filename: z25.string(),
5272
+ start_index: z25.number(),
5273
+ end_index: z25.number()
5044
5274
  }),
5045
- z24.object({
5046
- type: z24.literal("file_path"),
5047
- file_id: z24.string(),
5048
- index: z24.number()
5275
+ z25.object({
5276
+ type: z25.literal("file_path"),
5277
+ file_id: z25.string(),
5278
+ index: z25.number()
5049
5279
  })
5050
5280
  ])
5051
5281
  )
5052
5282
  })
5053
5283
  )
5054
5284
  }),
5055
- z24.object({
5056
- type: z24.literal("web_search_call"),
5057
- id: z24.string(),
5058
- status: z24.string(),
5059
- action: z24.discriminatedUnion("type", [
5060
- z24.object({
5061
- type: z24.literal("search"),
5062
- query: z24.string().nullish(),
5063
- queries: z24.array(z24.string()).nullish(),
5064
- sources: z24.array(
5065
- z24.discriminatedUnion("type", [
5066
- z24.object({ type: z24.literal("url"), url: z24.string() }),
5067
- z24.object({
5068
- type: z24.literal("api"),
5069
- name: z24.string()
5285
+ z25.object({
5286
+ type: z25.literal("web_search_call"),
5287
+ id: z25.string(),
5288
+ status: z25.string(),
5289
+ action: z25.discriminatedUnion("type", [
5290
+ z25.object({
5291
+ type: z25.literal("search"),
5292
+ query: z25.string().nullish(),
5293
+ queries: z25.array(z25.string()).nullish(),
5294
+ sources: z25.array(
5295
+ z25.discriminatedUnion("type", [
5296
+ z25.object({ type: z25.literal("url"), url: z25.string() }),
5297
+ z25.object({
5298
+ type: z25.literal("api"),
5299
+ name: z25.string()
5070
5300
  })
5071
5301
  ])
5072
5302
  ).nullish()
5073
5303
  }),
5074
- z24.object({
5075
- type: z24.literal("open_page"),
5076
- url: z24.string().nullish()
5304
+ z25.object({
5305
+ type: z25.literal("open_page"),
5306
+ url: z25.string().nullish()
5077
5307
  }),
5078
- z24.object({
5079
- type: z24.literal("find_in_page"),
5080
- url: z24.string().nullish(),
5081
- pattern: z24.string().nullish()
5308
+ z25.object({
5309
+ type: z25.literal("find_in_page"),
5310
+ url: z25.string().nullish(),
5311
+ pattern: z25.string().nullish()
5082
5312
  })
5083
5313
  ]).nullish()
5084
5314
  }),
5085
- z24.object({
5086
- type: z24.literal("file_search_call"),
5087
- id: z24.string(),
5088
- queries: z24.array(z24.string()),
5089
- results: z24.array(
5090
- z24.object({
5091
- attributes: z24.record(
5092
- z24.string(),
5093
- z24.union([z24.string(), z24.number(), z24.boolean()])
5315
+ z25.object({
5316
+ type: z25.literal("file_search_call"),
5317
+ id: z25.string(),
5318
+ queries: z25.array(z25.string()),
5319
+ results: z25.array(
5320
+ z25.object({
5321
+ attributes: z25.record(
5322
+ z25.string(),
5323
+ z25.union([z25.string(), z25.number(), z25.boolean()])
5094
5324
  ),
5095
- file_id: z24.string(),
5096
- filename: z24.string(),
5097
- score: z24.number(),
5098
- text: z24.string()
5325
+ file_id: z25.string(),
5326
+ filename: z25.string(),
5327
+ score: z25.number(),
5328
+ text: z25.string()
5099
5329
  })
5100
5330
  ).nullish()
5101
5331
  }),
5102
- z24.object({
5103
- type: z24.literal("code_interpreter_call"),
5104
- id: z24.string(),
5105
- code: z24.string().nullable(),
5106
- container_id: z24.string(),
5107
- outputs: z24.array(
5108
- z24.discriminatedUnion("type", [
5109
- z24.object({ type: z24.literal("logs"), logs: z24.string() }),
5110
- z24.object({ type: z24.literal("image"), url: z24.string() })
5332
+ z25.object({
5333
+ type: z25.literal("code_interpreter_call"),
5334
+ id: z25.string(),
5335
+ code: z25.string().nullable(),
5336
+ container_id: z25.string(),
5337
+ outputs: z25.array(
5338
+ z25.discriminatedUnion("type", [
5339
+ z25.object({ type: z25.literal("logs"), logs: z25.string() }),
5340
+ z25.object({ type: z25.literal("image"), url: z25.string() })
5111
5341
  ])
5112
5342
  ).nullable()
5113
5343
  }),
5114
- z24.object({
5115
- type: z24.literal("image_generation_call"),
5116
- id: z24.string(),
5117
- result: z24.string()
5344
+ z25.object({
5345
+ type: z25.literal("image_generation_call"),
5346
+ id: z25.string(),
5347
+ result: z25.string()
5118
5348
  }),
5119
- z24.object({
5120
- type: z24.literal("local_shell_call"),
5121
- id: z24.string(),
5122
- call_id: z24.string(),
5123
- action: z24.object({
5124
- type: z24.literal("exec"),
5125
- command: z24.array(z24.string()),
5126
- timeout_ms: z24.number().optional(),
5127
- user: z24.string().optional(),
5128
- working_directory: z24.string().optional(),
5129
- env: z24.record(z24.string(), z24.string()).optional()
5349
+ z25.object({
5350
+ type: z25.literal("local_shell_call"),
5351
+ id: z25.string(),
5352
+ call_id: z25.string(),
5353
+ action: z25.object({
5354
+ type: z25.literal("exec"),
5355
+ command: z25.array(z25.string()),
5356
+ timeout_ms: z25.number().optional(),
5357
+ user: z25.string().optional(),
5358
+ working_directory: z25.string().optional(),
5359
+ env: z25.record(z25.string(), z25.string()).optional()
5130
5360
  })
5131
5361
  }),
5132
- z24.object({
5133
- type: z24.literal("function_call"),
5134
- call_id: z24.string(),
5135
- name: z24.string(),
5136
- arguments: z24.string(),
5137
- id: z24.string(),
5138
- namespace: z24.string().nullish()
5362
+ z25.object({
5363
+ type: z25.literal("function_call"),
5364
+ call_id: z25.string(),
5365
+ name: z25.string(),
5366
+ arguments: z25.string(),
5367
+ id: z25.string(),
5368
+ namespace: z25.string().nullish()
5139
5369
  }),
5140
- z24.object({
5141
- type: z24.literal("custom_tool_call"),
5142
- call_id: z24.string(),
5143
- name: z24.string(),
5144
- input: z24.string(),
5145
- id: z24.string()
5370
+ z25.object({
5371
+ type: z25.literal("custom_tool_call"),
5372
+ call_id: z25.string(),
5373
+ name: z25.string(),
5374
+ input: z25.string(),
5375
+ id: z25.string()
5146
5376
  }),
5147
- z24.object({
5148
- type: z24.literal("computer_call"),
5149
- id: z24.string(),
5150
- status: z24.string().optional()
5151
- }),
5152
- z24.object({
5153
- type: z24.literal("reasoning"),
5154
- id: z24.string(),
5155
- encrypted_content: z24.string().nullish(),
5156
- summary: z24.array(
5157
- z24.object({
5158
- type: z24.literal("summary_text"),
5159
- text: z24.string()
5377
+ openaiResponsesComputerCallSchema,
5378
+ z25.object({
5379
+ type: z25.literal("reasoning"),
5380
+ id: z25.string(),
5381
+ encrypted_content: z25.string().nullish(),
5382
+ summary: z25.array(
5383
+ z25.object({
5384
+ type: z25.literal("summary_text"),
5385
+ text: z25.string()
5160
5386
  })
5161
5387
  )
5162
5388
  }),
5163
- z24.object({
5164
- type: z24.literal("mcp_call"),
5165
- id: z24.string(),
5166
- status: z24.string(),
5167
- arguments: z24.string(),
5168
- name: z24.string(),
5169
- server_label: z24.string(),
5170
- output: z24.string().nullish(),
5171
- error: z24.union([
5172
- z24.string(),
5173
- z24.object({
5174
- type: z24.string().optional(),
5175
- code: z24.union([z24.number(), z24.string()]).optional(),
5176
- message: z24.string().optional()
5389
+ z25.object({
5390
+ type: z25.literal("mcp_call"),
5391
+ id: z25.string(),
5392
+ status: z25.string(),
5393
+ arguments: z25.string(),
5394
+ name: z25.string(),
5395
+ server_label: z25.string(),
5396
+ output: z25.string().nullish(),
5397
+ error: z25.union([
5398
+ z25.string(),
5399
+ z25.object({
5400
+ type: z25.string().optional(),
5401
+ code: z25.union([z25.number(), z25.string()]).optional(),
5402
+ message: z25.string().optional()
5177
5403
  }).loose()
5178
5404
  ]).nullish(),
5179
- approval_request_id: z24.string().nullish()
5405
+ approval_request_id: z25.string().nullish()
5180
5406
  }),
5181
- z24.object({
5182
- type: z24.literal("mcp_list_tools"),
5183
- id: z24.string(),
5184
- server_label: z24.string(),
5185
- tools: z24.array(
5186
- z24.object({
5187
- name: z24.string(),
5188
- description: z24.string().optional(),
5189
- input_schema: z24.any(),
5190
- annotations: z24.record(z24.string(), z24.unknown()).optional()
5407
+ z25.object({
5408
+ type: z25.literal("mcp_list_tools"),
5409
+ id: z25.string(),
5410
+ server_label: z25.string(),
5411
+ tools: z25.array(
5412
+ z25.object({
5413
+ name: z25.string(),
5414
+ description: z25.string().optional(),
5415
+ input_schema: z25.any(),
5416
+ annotations: z25.record(z25.string(), z25.unknown()).optional()
5191
5417
  })
5192
5418
  ),
5193
- error: z24.union([
5194
- z24.string(),
5195
- z24.object({
5196
- type: z24.string().optional(),
5197
- code: z24.union([z24.number(), z24.string()]).optional(),
5198
- message: z24.string().optional()
5419
+ error: z25.union([
5420
+ z25.string(),
5421
+ z25.object({
5422
+ type: z25.string().optional(),
5423
+ code: z25.union([z25.number(), z25.string()]).optional(),
5424
+ message: z25.string().optional()
5199
5425
  }).loose()
5200
5426
  ]).optional()
5201
5427
  }),
5202
- z24.object({
5203
- type: z24.literal("mcp_approval_request"),
5204
- id: z24.string(),
5205
- server_label: z24.string(),
5206
- name: z24.string(),
5207
- arguments: z24.string(),
5208
- approval_request_id: z24.string().optional()
5428
+ z25.object({
5429
+ type: z25.literal("mcp_approval_request"),
5430
+ id: z25.string(),
5431
+ server_label: z25.string(),
5432
+ name: z25.string(),
5433
+ arguments: z25.string(),
5434
+ approval_request_id: z25.string().optional()
5209
5435
  }),
5210
- z24.object({
5211
- type: z24.literal("apply_patch_call"),
5212
- id: z24.string(),
5213
- call_id: z24.string(),
5214
- status: z24.enum(["in_progress", "completed"]),
5215
- operation: z24.discriminatedUnion("type", [
5216
- z24.object({
5217
- type: z24.literal("create_file"),
5218
- path: z24.string(),
5219
- diff: z24.string()
5436
+ z25.object({
5437
+ type: z25.literal("apply_patch_call"),
5438
+ id: z25.string(),
5439
+ call_id: z25.string(),
5440
+ status: z25.enum(["in_progress", "completed"]),
5441
+ operation: z25.discriminatedUnion("type", [
5442
+ z25.object({
5443
+ type: z25.literal("create_file"),
5444
+ path: z25.string(),
5445
+ diff: z25.string()
5220
5446
  }),
5221
- z24.object({
5222
- type: z24.literal("delete_file"),
5223
- path: z24.string()
5447
+ z25.object({
5448
+ type: z25.literal("delete_file"),
5449
+ path: z25.string()
5224
5450
  }),
5225
- z24.object({
5226
- type: z24.literal("update_file"),
5227
- path: z24.string(),
5228
- diff: z24.string()
5451
+ z25.object({
5452
+ type: z25.literal("update_file"),
5453
+ path: z25.string(),
5454
+ diff: z25.string()
5229
5455
  })
5230
5456
  ])
5231
5457
  }),
5232
- z24.object({
5233
- type: z24.literal("shell_call"),
5234
- id: z24.string(),
5235
- call_id: z24.string(),
5236
- status: z24.enum(["in_progress", "completed", "incomplete"]),
5237
- action: z24.object({
5238
- commands: z24.array(z24.string())
5458
+ z25.object({
5459
+ type: z25.literal("shell_call"),
5460
+ id: z25.string(),
5461
+ call_id: z25.string(),
5462
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5463
+ action: z25.object({
5464
+ commands: z25.array(z25.string())
5239
5465
  })
5240
5466
  }),
5241
- z24.object({
5242
- type: z24.literal("compaction"),
5243
- id: z24.string(),
5244
- encrypted_content: z24.string()
5467
+ z25.object({
5468
+ type: z25.literal("compaction"),
5469
+ id: z25.string(),
5470
+ encrypted_content: z25.string()
5245
5471
  }),
5246
- z24.object({
5247
- type: z24.literal("shell_call_output"),
5248
- id: z24.string(),
5249
- call_id: z24.string(),
5250
- status: z24.enum(["in_progress", "completed", "incomplete"]),
5251
- output: z24.array(
5252
- z24.object({
5253
- stdout: z24.string(),
5254
- stderr: z24.string(),
5255
- outcome: z24.discriminatedUnion("type", [
5256
- z24.object({ type: z24.literal("timeout") }),
5257
- z24.object({
5258
- type: z24.literal("exit"),
5259
- exit_code: z24.number()
5472
+ z25.object({
5473
+ type: z25.literal("shell_call_output"),
5474
+ id: z25.string(),
5475
+ call_id: z25.string(),
5476
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5477
+ output: z25.array(
5478
+ z25.object({
5479
+ stdout: z25.string(),
5480
+ stderr: z25.string(),
5481
+ outcome: z25.discriminatedUnion("type", [
5482
+ z25.object({ type: z25.literal("timeout") }),
5483
+ z25.object({
5484
+ type: z25.literal("exit"),
5485
+ exit_code: z25.number()
5260
5486
  })
5261
5487
  ])
5262
5488
  })
5263
5489
  )
5264
5490
  }),
5265
- z24.object({
5266
- type: z24.literal("tool_search_call"),
5267
- id: z24.string(),
5268
- execution: z24.enum(["server", "client"]),
5269
- call_id: z24.string().nullable(),
5270
- status: z24.enum(["in_progress", "completed", "incomplete"]),
5271
- arguments: z24.unknown()
5491
+ z25.object({
5492
+ type: z25.literal("tool_search_call"),
5493
+ id: z25.string(),
5494
+ execution: z25.enum(["server", "client"]),
5495
+ call_id: z25.string().nullable(),
5496
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5497
+ arguments: z25.unknown()
5272
5498
  }),
5273
- z24.object({
5274
- type: z24.literal("tool_search_output"),
5275
- id: z24.string(),
5276
- execution: z24.enum(["server", "client"]),
5277
- call_id: z24.string().nullable(),
5278
- status: z24.enum(["in_progress", "completed", "incomplete"]),
5279
- tools: z24.array(z24.record(z24.string(), jsonValueSchema2.optional()))
5499
+ z25.object({
5500
+ type: z25.literal("tool_search_output"),
5501
+ id: z25.string(),
5502
+ execution: z25.enum(["server", "client"]),
5503
+ call_id: z25.string().nullable(),
5504
+ status: z25.enum(["in_progress", "completed", "incomplete"]),
5505
+ tools: z25.array(z25.record(z25.string(), jsonValueSchema2.optional()))
5280
5506
  })
5281
5507
  ])
5282
5508
  ).optional(),
5283
- service_tier: z24.string().nullish(),
5284
- reasoning: z24.object({
5285
- context: z24.string().nullish()
5509
+ service_tier: z25.string().nullish(),
5510
+ reasoning: z25.object({
5511
+ context: z25.string().nullish()
5286
5512
  }).nullish(),
5287
- incomplete_details: z24.object({ reason: z24.string() }).nullish(),
5288
- usage: z24.object({
5289
- input_tokens: z24.number(),
5290
- input_tokens_details: z24.object({
5291
- cached_tokens: z24.number().nullish(),
5292
- cache_write_tokens: z24.number().nullish(),
5293
- orchestration_input_tokens: z24.number().nullish(),
5294
- orchestration_input_cached_tokens: z24.number().nullish()
5513
+ incomplete_details: z25.object({ reason: z25.string() }).nullish(),
5514
+ usage: z25.object({
5515
+ input_tokens: z25.number(),
5516
+ input_tokens_details: z25.object({
5517
+ cached_tokens: z25.number().nullish(),
5518
+ cache_write_tokens: z25.number().nullish(),
5519
+ orchestration_input_tokens: z25.number().nullish(),
5520
+ orchestration_input_cached_tokens: z25.number().nullish()
5295
5521
  }).nullish(),
5296
- output_tokens: z24.number(),
5297
- output_tokens_details: z24.object({
5298
- reasoning_tokens: z24.number().nullish(),
5299
- orchestration_output_tokens: z24.number().nullish()
5522
+ output_tokens: z25.number(),
5523
+ output_tokens_details: z25.object({
5524
+ reasoning_tokens: z25.number().nullish(),
5525
+ orchestration_output_tokens: z25.number().nullish()
5300
5526
  }).nullish()
5301
5527
  }).optional()
5302
5528
  })
@@ -5305,10 +5531,10 @@ var openaiResponsesResponseSchema = lazySchema22(
5305
5531
 
5306
5532
  // src/responses/openai-responses-language-model-options.ts
5307
5533
  import {
5308
- lazySchema as lazySchema23,
5309
- zodSchema as zodSchema23
5534
+ lazySchema as lazySchema24,
5535
+ zodSchema as zodSchema24
5310
5536
  } from "@ai-sdk/provider-utils";
5311
- import { z as z25 } from "zod/v4";
5537
+ import { z as z26 } from "zod/v4";
5312
5538
  var TOP_LOGPROBS_MAX = 20;
5313
5539
  var openaiResponsesReasoningModelIds = [
5314
5540
  "o1",
@@ -5379,9 +5605,9 @@ var openaiResponsesModelIds = [
5379
5605
  "gpt-5-chat-latest",
5380
5606
  ...openaiResponsesReasoningModelIds
5381
5607
  ];
5382
- var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5383
- () => zodSchema23(
5384
- z25.object({
5608
+ var openaiLanguageModelResponsesOptionsSchema = lazySchema24(
5609
+ () => zodSchema24(
5610
+ z26.object({
5385
5611
  /**
5386
5612
  * The ID of the OpenAI Conversation to continue.
5387
5613
  * You must create a conversation first via the OpenAI API.
@@ -5389,13 +5615,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5389
5615
  * Defaults to `undefined`.
5390
5616
  * @see https://platform.openai.com/docs/api-reference/conversations/create
5391
5617
  */
5392
- conversation: z25.string().nullish(),
5618
+ conversation: z26.string().nullish(),
5393
5619
  /**
5394
5620
  * The set of extra fields to include in the response (advanced, usually not needed).
5395
5621
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
5396
5622
  */
5397
- include: z25.array(
5398
- z25.enum([
5623
+ include: z26.array(
5624
+ z26.enum([
5399
5625
  "reasoning.encrypted_content",
5400
5626
  // handled internally by default, only needed for unknown reasoning models
5401
5627
  "file_search_call.results",
@@ -5408,7 +5634,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5408
5634
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
5409
5635
  * Defaults to `undefined`.
5410
5636
  */
5411
- instructions: z25.string().nullish(),
5637
+ instructions: z26.string().nullish(),
5412
5638
  /**
5413
5639
  * Return the log probabilities of the tokens. Including logprobs will increase
5414
5640
  * the response size and can slow down response times. However, it can
@@ -5423,38 +5649,38 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5423
5649
  * @see https://platform.openai.com/docs/api-reference/responses/create
5424
5650
  * @see https://cookbook.openai.com/examples/using_logprobs
5425
5651
  */
5426
- logprobs: z25.union([z25.boolean(), z25.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
5652
+ logprobs: z26.union([z26.boolean(), z26.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
5427
5653
  /**
5428
5654
  * The maximum number of total calls to built-in tools that can be processed in a response.
5429
5655
  * This maximum number applies across all built-in tool calls, not per individual tool.
5430
5656
  * Any further attempts to call a tool by the model will be ignored.
5431
5657
  */
5432
- maxToolCalls: z25.number().nullish(),
5658
+ maxToolCalls: z26.number().nullish(),
5433
5659
  /**
5434
5660
  * Additional metadata to store with the generation.
5435
5661
  */
5436
- metadata: z25.any().nullish(),
5662
+ metadata: z26.any().nullish(),
5437
5663
  /**
5438
5664
  * Whether to use parallel tool calls. Defaults to `true`.
5439
5665
  */
5440
- parallelToolCalls: z25.boolean().nullish(),
5666
+ parallelToolCalls: z26.boolean().nullish(),
5441
5667
  /**
5442
5668
  * The ID of the previous response. You can use it to continue a conversation.
5443
5669
  * Defaults to `undefined`.
5444
5670
  */
5445
- previousResponseId: z25.string().nullish(),
5671
+ previousResponseId: z26.string().nullish(),
5446
5672
  /**
5447
5673
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
5448
5674
  */
5449
- promptCacheKey: z25.string().nullish(),
5675
+ promptCacheKey: z26.string().nullish(),
5450
5676
  /**
5451
5677
  * Prompt cache behavior for GPT-5.6 and later models.
5452
5678
  * `mode` controls whether OpenAI also places an implicit breakpoint.
5453
5679
  * `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
5454
5680
  */
5455
- promptCacheOptions: z25.object({
5456
- mode: z25.enum(["implicit", "explicit"]).optional(),
5457
- ttl: z25.literal("30m").optional()
5681
+ promptCacheOptions: z26.object({
5682
+ mode: z26.enum(["implicit", "explicit"]).optional(),
5683
+ ttl: z26.literal("30m").optional()
5458
5684
  }).optional(),
5459
5685
  /**
5460
5686
  * The retention policy for the prompt cache.
@@ -5466,35 +5692,35 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5466
5692
  *
5467
5693
  * @default 'in_memory'
5468
5694
  */
5469
- promptCacheRetention: z25.enum(["in_memory", "24h"]).nullish(),
5695
+ promptCacheRetention: z26.enum(["in_memory", "24h"]).nullish(),
5470
5696
  /**
5471
5697
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
5472
5698
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
5473
5699
  * GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
5474
5700
  * Supported values vary by model.
5475
5701
  */
5476
- reasoningEffort: z25.string().nullish(),
5702
+ reasoningEffort: z26.string().nullish(),
5477
5703
  /**
5478
5704
  * Controls how much model work GPT-5.6 performs before returning a final answer.
5479
5705
  * `standard` is the default. `pro` increases quality, latency, and token usage.
5480
5706
  */
5481
- reasoningMode: z25.enum(["standard", "pro"]).optional(),
5707
+ reasoningMode: z26.enum(["standard", "pro"]).optional(),
5482
5708
  /**
5483
5709
  * Controls which available reasoning items GPT-5.6 can use.
5484
5710
  * `auto` uses the model default, `current_turn` excludes reasoning from earlier
5485
5711
  * turns, and `all_turns` makes compatible earlier reasoning available.
5486
5712
  */
5487
- reasoningContext: z25.enum(["auto", "current_turn", "all_turns"]).optional(),
5713
+ reasoningContext: z26.enum(["auto", "current_turn", "all_turns"]).optional(),
5488
5714
  /**
5489
5715
  * Controls reasoning summary output from the model.
5490
5716
  * Set to "auto" to automatically receive the richest level available,
5491
5717
  * or "detailed" for comprehensive summaries.
5492
5718
  */
5493
- reasoningSummary: z25.string().nullish(),
5719
+ reasoningSummary: z26.string().nullish(),
5494
5720
  /**
5495
5721
  * The identifier for safety monitoring and tracking.
5496
5722
  */
5497
- safetyIdentifier: z25.string().nullish(),
5723
+ safetyIdentifier: z26.string().nullish(),
5498
5724
  /**
5499
5725
  * Service tier for the request.
5500
5726
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -5502,11 +5728,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5502
5728
  *
5503
5729
  * Defaults to 'auto'.
5504
5730
  */
5505
- serviceTier: z25.enum(["auto", "flex", "priority", "default"]).nullish(),
5731
+ serviceTier: z26.enum(["auto", "flex", "priority", "default"]).nullish(),
5506
5732
  /**
5507
5733
  * Whether to store the generation. Defaults to `true`.
5508
5734
  */
5509
- store: z25.boolean().nullish(),
5735
+ store: z26.boolean().nullish(),
5510
5736
  /**
5511
5737
  * Whether to pass through non-image file types as generic input files.
5512
5738
  *
@@ -5514,30 +5740,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5514
5740
  * Enable this when the target OpenAI Responses model supports additional
5515
5741
  * file media types, such as text/csv.
5516
5742
  */
5517
- passThroughUnsupportedFiles: z25.boolean().optional(),
5743
+ passThroughUnsupportedFiles: z26.boolean().optional(),
5518
5744
  /**
5519
5745
  * Whether to use strict JSON schema validation.
5520
5746
  * Defaults to `true`.
5521
5747
  */
5522
- strictJsonSchema: z25.boolean().nullish(),
5748
+ strictJsonSchema: z26.boolean().nullish(),
5523
5749
  /**
5524
5750
  * Controls the verbosity of the model's responses. Lower values ('low') will result
5525
5751
  * in more concise responses, while higher values ('high') will result in more verbose responses.
5526
5752
  * Valid values: 'low', 'medium', 'high'.
5527
5753
  */
5528
- textVerbosity: z25.enum(["low", "medium", "high"]).nullish(),
5754
+ textVerbosity: z26.enum(["low", "medium", "high"]).nullish(),
5529
5755
  /**
5530
5756
  * Controls output truncation. 'auto' (default) performs truncation automatically;
5531
5757
  * 'disabled' turns truncation off.
5532
5758
  */
5533
- truncation: z25.enum(["auto", "disabled"]).nullish(),
5759
+ truncation: z26.enum(["auto", "disabled"]).nullish(),
5534
5760
  /**
5535
5761
  * A unique identifier representing your end-user, which can help OpenAI to
5536
5762
  * monitor and detect abuse.
5537
5763
  * Defaults to `undefined`.
5538
5764
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
5539
5765
  */
5540
- user: z25.string().nullish(),
5766
+ user: z26.string().nullish(),
5541
5767
  /**
5542
5768
  * Override the system message mode for this model.
5543
5769
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -5546,7 +5772,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5546
5772
  *
5547
5773
  * If not specified, the mode is automatically determined based on the model.
5548
5774
  */
5549
- systemMessageMode: z25.enum(["system", "developer", "remove"]).optional(),
5775
+ systemMessageMode: z26.enum(["system", "developer", "remove"]).optional(),
5550
5776
  /**
5551
5777
  * Force treating this model as a reasoning model.
5552
5778
  *
@@ -5556,14 +5782,14 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5556
5782
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
5557
5783
  * and defaults `systemMessageMode` to `developer` unless overridden.
5558
5784
  */
5559
- forceReasoning: z25.boolean().optional(),
5785
+ forceReasoning: z26.boolean().optional(),
5560
5786
  /**
5561
5787
  * Enable server-side context management (compaction).
5562
5788
  */
5563
- contextManagement: z25.array(
5564
- z25.object({
5565
- type: z25.literal("compaction"),
5566
- compactThreshold: z25.number()
5789
+ contextManagement: z26.array(
5790
+ z26.object({
5791
+ type: z26.literal("compaction"),
5792
+ compactThreshold: z26.number()
5567
5793
  })
5568
5794
  ).nullish(),
5569
5795
  /**
@@ -5576,9 +5802,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema23(
5576
5802
  *
5577
5803
  * @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
5578
5804
  */
5579
- allowedTools: z25.object({
5580
- toolNames: z25.array(z25.string()).min(1),
5581
- mode: z25.enum(["auto", "required"]).optional()
5805
+ allowedTools: z26.object({
5806
+ toolNames: z26.array(z26.string()).min(1),
5807
+ mode: z26.enum(["auto", "required"]).optional()
5582
5808
  }).optional()
5583
5809
  })
5584
5810
  )
@@ -5683,6 +5909,12 @@ async function prepareResponsesTools({
5683
5909
  });
5684
5910
  break;
5685
5911
  }
5912
+ case "openai.computer": {
5913
+ openaiTools2.push({
5914
+ type: "computer"
5915
+ });
5916
+ break;
5917
+ }
5686
5918
  case "openai.web_search_preview": {
5687
5919
  const args = await validateTypes2({
5688
5920
  value: tool.args,
@@ -5837,7 +6069,7 @@ async function prepareResponsesTools({
5837
6069
  const resolvedToolName = (_c = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _c : toolChoice.toolName;
5838
6070
  return {
5839
6071
  tools: openaiTools2,
5840
- toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
6072
+ toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" || resolvedToolName === "computer" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
5841
6073
  toolWarnings
5842
6074
  };
5843
6075
  }
@@ -5932,6 +6164,74 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
5932
6164
  }
5933
6165
  return mapping;
5934
6166
  }
6167
+ function mapComputerAction(action) {
6168
+ switch (action.type) {
6169
+ case "click":
6170
+ return {
6171
+ type: "click",
6172
+ button: action.button,
6173
+ x: action.x,
6174
+ y: action.y,
6175
+ ...action.keys != null && { keys: action.keys }
6176
+ };
6177
+ case "double_click":
6178
+ return {
6179
+ type: "double_click",
6180
+ x: action.x,
6181
+ y: action.y,
6182
+ ...action.keys != null && { keys: action.keys }
6183
+ };
6184
+ case "drag":
6185
+ return {
6186
+ type: "drag",
6187
+ path: action.path,
6188
+ ...action.keys != null && { keys: action.keys }
6189
+ };
6190
+ case "keypress":
6191
+ return action;
6192
+ case "move":
6193
+ return {
6194
+ type: "move",
6195
+ x: action.x,
6196
+ y: action.y,
6197
+ ...action.keys != null && { keys: action.keys }
6198
+ };
6199
+ case "screenshot":
6200
+ return action;
6201
+ case "scroll":
6202
+ return {
6203
+ type: "scroll",
6204
+ x: action.x,
6205
+ y: action.y,
6206
+ scrollX: action.scroll_x,
6207
+ scrollY: action.scroll_y,
6208
+ ...action.keys != null && { keys: action.keys }
6209
+ };
6210
+ case "type":
6211
+ return action;
6212
+ case "wait":
6213
+ return action;
6214
+ }
6215
+ }
6216
+ function mapComputerCallInput({
6217
+ action,
6218
+ actions,
6219
+ pending_safety_checks,
6220
+ status
6221
+ }) {
6222
+ var _a;
6223
+ return {
6224
+ actions: (actions != null ? actions : action != null ? [action] : []).map(
6225
+ mapComputerAction
6226
+ ),
6227
+ pendingSafetyChecks: (_a = pending_safety_checks == null ? void 0 : pending_safety_checks.map((safetyCheck) => ({
6228
+ id: safetyCheck.id,
6229
+ ...safetyCheck.code != null && { code: safetyCheck.code },
6230
+ ...safetyCheck.message != null && { message: safetyCheck.message }
6231
+ }))) != null ? _a : [],
6232
+ status
6233
+ };
6234
+ }
5935
6235
  var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
5936
6236
  constructor(modelId, config) {
5937
6237
  this.specificationVersion = "v4";
@@ -6015,6 +6315,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6015
6315
  tools,
6016
6316
  providerToolNames: {
6017
6317
  "openai.code_interpreter": "code_interpreter",
6318
+ "openai.computer": "computer",
6018
6319
  "openai.file_search": "file_search",
6019
6320
  "openai.image_generation": "image_generation",
6020
6321
  "openai.local_shell": "local_shell",
@@ -6051,6 +6352,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6051
6352
  hasLocalShellTool: hasOpenAITool("openai.local_shell"),
6052
6353
  hasShellTool: hasOpenAITool("openai.shell"),
6053
6354
  hasApplyPatchTool: hasOpenAITool("openai.apply_patch"),
6355
+ hasComputerTool: hasOpenAITool("openai.computer"),
6054
6356
  customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0
6055
6357
  });
6056
6358
  warnings.push(...inputWarnings);
@@ -6231,7 +6533,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6231
6533
  };
6232
6534
  }
6233
6535
  async doGenerate(options) {
6234
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
6536
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
6235
6537
  const {
6236
6538
  args: body,
6237
6539
  warnings,
@@ -6271,6 +6573,18 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6271
6573
  isRetryable: false
6272
6574
  });
6273
6575
  }
6576
+ if (response.output == null) {
6577
+ const detail = (_c = response.incomplete_details) == null ? void 0 : _c.reason;
6578
+ throw new APICallError2({
6579
+ message: detail ? `Responses API returned no output (${detail})` : "Responses API returned no output",
6580
+ url,
6581
+ requestBodyValues: body,
6582
+ statusCode: 500,
6583
+ responseHeaders,
6584
+ responseBody: rawResponse,
6585
+ isRetryable: false
6586
+ });
6587
+ }
6274
6588
  const content = [];
6275
6589
  const logprobs = [];
6276
6590
  let hasFunctionCall = false;
@@ -6288,7 +6602,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6288
6602
  providerMetadata: {
6289
6603
  [providerOptionsName]: {
6290
6604
  itemId: part.id,
6291
- reasoningEncryptedContent: (_c = part.encrypted_content) != null ? _c : null
6605
+ reasoningEncryptedContent: (_d = part.encrypted_content) != null ? _d : null
6292
6606
  }
6293
6607
  }
6294
6608
  });
@@ -6314,7 +6628,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6314
6628
  break;
6315
6629
  }
6316
6630
  case "tool_search_call": {
6317
- const toolCallId = (_d = part.call_id) != null ? _d : part.id;
6631
+ const toolCallId = (_e = part.call_id) != null ? _e : part.id;
6318
6632
  const isHosted = part.execution === "server";
6319
6633
  if (isHosted) {
6320
6634
  hostedToolSearchCallIds.push(toolCallId);
@@ -6337,7 +6651,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6337
6651
  break;
6338
6652
  }
6339
6653
  case "tool_search_output": {
6340
- const toolCallId = (_f = (_e = part.call_id) != null ? _e : hostedToolSearchCallIds.shift()) != null ? _f : part.id;
6654
+ const toolCallId = (_g = (_f = part.call_id) != null ? _f : hostedToolSearchCallIds.shift()) != null ? _g : part.id;
6341
6655
  content.push({
6342
6656
  type: "tool-result",
6343
6657
  toolCallId,
@@ -6408,7 +6722,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6408
6722
  }
6409
6723
  case "message": {
6410
6724
  for (const contentPart of part.content) {
6411
- if (((_h = (_g = options.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.logprobs) && contentPart.logprobs) {
6725
+ if (((_i = (_h = options.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.logprobs) && contentPart.logprobs) {
6412
6726
  logprobs.push(contentPart.logprobs);
6413
6727
  }
6414
6728
  const providerMetadata2 = {
@@ -6430,7 +6744,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6430
6744
  content.push({
6431
6745
  type: "source",
6432
6746
  sourceType: "url",
6433
- id: (_k = (_j = (_i = this.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : generateId2(),
6747
+ id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
6434
6748
  url: annotation.url,
6435
6749
  title: annotation.title
6436
6750
  });
@@ -6438,7 +6752,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6438
6752
  content.push({
6439
6753
  type: "source",
6440
6754
  sourceType: "document",
6441
- id: (_n = (_m = (_l = this.config).generateId) == null ? void 0 : _m.call(_l)) != null ? _n : generateId2(),
6755
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
6442
6756
  mediaType: "text/plain",
6443
6757
  title: annotation.filename,
6444
6758
  filename: annotation.filename,
@@ -6454,7 +6768,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6454
6768
  content.push({
6455
6769
  type: "source",
6456
6770
  sourceType: "document",
6457
- id: (_q = (_p = (_o = this.config).generateId) == null ? void 0 : _p.call(_o)) != null ? _q : generateId2(),
6771
+ id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
6458
6772
  mediaType: "text/plain",
6459
6773
  title: annotation.filename,
6460
6774
  filename: annotation.filename,
@@ -6470,7 +6784,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6470
6784
  content.push({
6471
6785
  type: "source",
6472
6786
  sourceType: "document",
6473
- id: (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : generateId2(),
6787
+ id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : generateId2(),
6474
6788
  mediaType: "application/octet-stream",
6475
6789
  title: annotation.file_id,
6476
6790
  filename: annotation.file_id,
@@ -6540,7 +6854,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6540
6854
  break;
6541
6855
  }
6542
6856
  case "mcp_call": {
6543
- const toolCallId = part.approval_request_id != null ? (_u = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _u : part.id : part.id;
6857
+ const toolCallId = part.approval_request_id != null ? (_v = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _v : part.id : part.id;
6544
6858
  const toolName = `mcp.${part.name}`;
6545
6859
  content.push({
6546
6860
  type: "tool-call",
@@ -6574,8 +6888,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6574
6888
  break;
6575
6889
  }
6576
6890
  case "mcp_approval_request": {
6577
- const approvalRequestId = (_v = part.approval_request_id) != null ? _v : part.id;
6578
- const dummyToolCallId = (_y = (_x = (_w = this.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : generateId2();
6891
+ const approvalRequestId = (_w = part.approval_request_id) != null ? _w : part.id;
6892
+ const dummyToolCallId = (_z = (_y = (_x = this.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : generateId2();
6579
6893
  const toolName = `mcp.${part.name}`;
6580
6894
  content.push({
6581
6895
  type: "tool-call",
@@ -6593,20 +6907,36 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6593
6907
  break;
6594
6908
  }
6595
6909
  case "computer_call": {
6910
+ if (part.call_id == null) {
6911
+ content.push({
6912
+ type: "tool-call",
6913
+ toolCallId: part.id,
6914
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
6915
+ input: "",
6916
+ providerExecuted: true
6917
+ });
6918
+ content.push({
6919
+ type: "tool-result",
6920
+ toolCallId: part.id,
6921
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
6922
+ result: {
6923
+ type: "computer_use_tool_result",
6924
+ status: part.status
6925
+ }
6926
+ });
6927
+ break;
6928
+ }
6929
+ hasFunctionCall = true;
6930
+ const toolName = toolNameMapping.toCustomToolName("computer");
6596
6931
  content.push({
6597
6932
  type: "tool-call",
6598
- toolCallId: part.id,
6599
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6600
- input: "",
6601
- providerExecuted: true
6602
- });
6603
- content.push({
6604
- type: "tool-result",
6605
- toolCallId: part.id,
6606
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6607
- result: {
6608
- type: "computer_use_tool_result",
6609
- status: part.status || "completed"
6933
+ toolCallId: part.call_id,
6934
+ toolName,
6935
+ input: JSON.stringify(mapComputerCallInput(part)),
6936
+ providerMetadata: {
6937
+ [providerOptionsName]: {
6938
+ itemId: part.id
6939
+ }
6610
6940
  }
6611
6941
  });
6612
6942
  break;
@@ -6625,13 +6955,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6625
6955
  toolName: toolNameMapping.toCustomToolName("file_search"),
6626
6956
  result: {
6627
6957
  queries: part.queries,
6628
- results: (_A = (_z = part.results) == null ? void 0 : _z.map((result) => ({
6958
+ results: (_B = (_A = part.results) == null ? void 0 : _A.map((result) => ({
6629
6959
  attributes: result.attributes,
6630
6960
  fileId: result.file_id,
6631
6961
  filename: result.filename,
6632
6962
  score: result.score,
6633
6963
  text: result.text
6634
- }))) != null ? _A : null
6964
+ }))) != null ? _B : null
6635
6965
  }
6636
6966
  });
6637
6967
  break;
@@ -6695,7 +7025,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6695
7025
  responseId: response.id,
6696
7026
  ...logprobs.length > 0 ? { logprobs } : {},
6697
7027
  ...typeof response.service_tier === "string" ? { serviceTier: response.service_tier } : {},
6698
- ...((_B = response.reasoning) == null ? void 0 : _B.context) != null ? { reasoningContext: response.reasoning.context } : {}
7028
+ ...((_C = response.reasoning) == null ? void 0 : _C.context) != null ? { reasoningContext: response.reasoning.context } : {}
6699
7029
  }
6700
7030
  };
6701
7031
  const usage = response.usage;
@@ -6703,10 +7033,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6703
7033
  content,
6704
7034
  finishReason: {
6705
7035
  unified: mapOpenAIResponseFinishReason({
6706
- finishReason: (_C = response.incomplete_details) == null ? void 0 : _C.reason,
7036
+ finishReason: (_D = response.incomplete_details) == null ? void 0 : _D.reason,
6707
7037
  hasFunctionCall
6708
7038
  }),
6709
- raw: (_E = (_D = response.incomplete_details) == null ? void 0 : _D.reason) != null ? _E : void 0
7039
+ raw: (_F = (_E = response.incomplete_details) == null ? void 0 : _E.reason) != null ? _F : void 0
6710
7040
  },
6711
7041
  usage: convertOpenAIResponsesUsage(usage),
6712
7042
  request: { body },
@@ -6784,7 +7114,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6784
7114
  controller.enqueue({ type: "stream-start", warnings });
6785
7115
  },
6786
7116
  transform(chunk, controller) {
6787
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
7117
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O;
6788
7118
  if (options.includeRawChunks) {
6789
7119
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
6790
7120
  }
@@ -6854,15 +7184,15 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6854
7184
  providerExecuted: true
6855
7185
  });
6856
7186
  } else if (value.item.type === "computer_call") {
7187
+ const toolCallId = (_a2 = value.item.call_id) != null ? _a2 : value.item.id;
6857
7188
  ongoingToolCalls[value.output_index] = {
6858
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6859
- toolCallId: value.item.id
7189
+ toolName: toolNameMapping.toCustomToolName("computer"),
7190
+ toolCallId
6860
7191
  };
6861
7192
  controller.enqueue({
6862
7193
  type: "tool-input-start",
6863
- id: value.item.id,
6864
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6865
- providerExecuted: true
7194
+ id: toolCallId,
7195
+ toolName: toolNameMapping.toCustomToolName("computer")
6866
7196
  });
6867
7197
  } else if (value.item.type === "code_interpreter_call") {
6868
7198
  ongoingToolCalls[value.output_index] = {
@@ -6906,7 +7236,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6906
7236
  ongoingToolCalls[value.output_index] = {
6907
7237
  toolName,
6908
7238
  toolCallId,
6909
- toolSearchExecution: (_a2 = value.item.execution) != null ? _a2 : "server"
7239
+ toolSearchExecution: (_b2 = value.item.execution) != null ? _b2 : "server"
6910
7240
  };
6911
7241
  if (isHosted) {
6912
7242
  controller.enqueue({
@@ -6963,7 +7293,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6963
7293
  } else if (value.item.type === "shell_call_output") {
6964
7294
  } else if (value.item.type === "message") {
6965
7295
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
6966
- activeMessagePhase = (_b2 = value.item.phase) != null ? _b2 : void 0;
7296
+ activeMessagePhase = (_c = value.item.phase) != null ? _c : void 0;
6967
7297
  controller.enqueue({
6968
7298
  type: "text-start",
6969
7299
  id: value.item.id,
@@ -6987,14 +7317,14 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6987
7317
  providerMetadata: {
6988
7318
  [providerOptionsName]: {
6989
7319
  itemId: value.item.id,
6990
- reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
7320
+ reasoningEncryptedContent: (_d = value.item.encrypted_content) != null ? _d : null
6991
7321
  }
6992
7322
  }
6993
7323
  });
6994
7324
  }
6995
7325
  } else if (isResponseOutputItemDoneChunk(value)) {
6996
7326
  if (value.item.type === "message") {
6997
- const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
7327
+ const phase = (_e = value.item.phase) != null ? _e : activeMessagePhase;
6998
7328
  activeMessagePhase = void 0;
6999
7329
  controller.enqueue({
7000
7330
  type: "text-end",
@@ -7070,24 +7400,50 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7070
7400
  });
7071
7401
  } else if (value.item.type === "computer_call") {
7072
7402
  ongoingToolCalls[value.output_index] = void 0;
7403
+ if (value.item.call_id == null) {
7404
+ controller.enqueue({
7405
+ type: "tool-input-end",
7406
+ id: value.item.id
7407
+ });
7408
+ controller.enqueue({
7409
+ type: "tool-call",
7410
+ toolCallId: value.item.id,
7411
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
7412
+ input: "",
7413
+ providerExecuted: true
7414
+ });
7415
+ controller.enqueue({
7416
+ type: "tool-result",
7417
+ toolCallId: value.item.id,
7418
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
7419
+ result: {
7420
+ type: "computer_use_tool_result",
7421
+ status: value.item.status
7422
+ }
7423
+ });
7424
+ return;
7425
+ }
7426
+ hasFunctionCall = true;
7427
+ const toolName = toolNameMapping.toCustomToolName("computer");
7428
+ const input = JSON.stringify(mapComputerCallInput(value.item));
7073
7429
  controller.enqueue({
7074
- type: "tool-input-end",
7075
- id: value.item.id
7430
+ type: "tool-input-delta",
7431
+ id: value.item.call_id,
7432
+ delta: input
7076
7433
  });
7077
7434
  controller.enqueue({
7078
- type: "tool-call",
7079
- toolCallId: value.item.id,
7080
- toolName: toolNameMapping.toCustomToolName("computer_use"),
7081
- input: "",
7082
- providerExecuted: true
7435
+ type: "tool-input-end",
7436
+ id: value.item.call_id
7083
7437
  });
7084
7438
  controller.enqueue({
7085
- type: "tool-result",
7086
- toolCallId: value.item.id,
7087
- toolName: toolNameMapping.toCustomToolName("computer_use"),
7088
- result: {
7089
- type: "computer_use_tool_result",
7090
- status: value.item.status || "completed"
7439
+ type: "tool-call",
7440
+ toolCallId: value.item.call_id,
7441
+ toolName,
7442
+ input,
7443
+ providerMetadata: {
7444
+ [providerOptionsName]: {
7445
+ itemId: value.item.id
7446
+ }
7091
7447
  }
7092
7448
  });
7093
7449
  } else if (value.item.type === "file_search_call") {
@@ -7098,13 +7454,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7098
7454
  toolName: toolNameMapping.toCustomToolName("file_search"),
7099
7455
  result: {
7100
7456
  queries: value.item.queries,
7101
- results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result2) => ({
7457
+ results: (_g = (_f = value.item.results) == null ? void 0 : _f.map((result2) => ({
7102
7458
  attributes: result2.attributes,
7103
7459
  fileId: result2.file_id,
7104
7460
  filename: result2.filename,
7105
7461
  score: result2.score,
7106
7462
  text: result2.text
7107
- }))) != null ? _f : null
7463
+ }))) != null ? _g : null
7108
7464
  }
7109
7465
  });
7110
7466
  } else if (value.item.type === "code_interpreter_call") {
@@ -7130,7 +7486,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7130
7486
  const toolCall = ongoingToolCalls[value.output_index];
7131
7487
  const isHosted = value.item.execution === "server";
7132
7488
  if (toolCall != null) {
7133
- const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
7489
+ const toolCallId = isHosted ? toolCall.toolCallId : (_h = value.item.call_id) != null ? _h : value.item.id;
7134
7490
  if (isHosted) {
7135
7491
  hostedToolSearchCallIds.push(toolCallId);
7136
7492
  } else {
@@ -7162,7 +7518,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7162
7518
  }
7163
7519
  ongoingToolCalls[value.output_index] = void 0;
7164
7520
  } else if (value.item.type === "tool_search_output") {
7165
- const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
7521
+ const toolCallId = (_j = (_i = value.item.call_id) != null ? _i : hostedToolSearchCallIds.shift()) != null ? _j : value.item.id;
7166
7522
  controller.enqueue({
7167
7523
  type: "tool-result",
7168
7524
  toolCallId,
@@ -7178,10 +7534,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7178
7534
  });
7179
7535
  } else if (value.item.type === "mcp_call") {
7180
7536
  ongoingToolCalls[value.output_index] = void 0;
7181
- const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
7182
- const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
7537
+ const approvalRequestId = (_k = value.item.approval_request_id) != null ? _k : void 0;
7538
+ const aliasedToolCallId = approvalRequestId != null ? (_m = (_l = approvalRequestIdToDummyToolCallIdFromStream.get(
7183
7539
  approvalRequestId
7184
- )) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
7540
+ )) != null ? _l : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _m : value.item.id : value.item.id;
7185
7541
  const toolName = `mcp.${value.item.name}`;
7186
7542
  controller.enqueue({
7187
7543
  type: "tool-call",
@@ -7251,8 +7607,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7251
7607
  ongoingToolCalls[value.output_index] = void 0;
7252
7608
  } else if (value.item.type === "mcp_approval_request") {
7253
7609
  ongoingToolCalls[value.output_index] = void 0;
7254
- const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
7255
- const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
7610
+ const dummyToolCallId = (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : generateId2();
7611
+ const approvalRequestId = (_q = value.item.approval_request_id) != null ? _q : value.item.id;
7256
7612
  approvalRequestIdToDummyToolCallIdFromStream.set(
7257
7613
  approvalRequestId,
7258
7614
  dummyToolCallId
@@ -7341,7 +7697,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7341
7697
  providerMetadata: {
7342
7698
  [providerOptionsName]: {
7343
7699
  itemId: value.item.id,
7344
- reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
7700
+ reasoningEncryptedContent: (_r = value.item.encrypted_content) != null ? _r : null
7345
7701
  }
7346
7702
  }
7347
7703
  });
@@ -7466,7 +7822,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7466
7822
  id: value.item_id,
7467
7823
  delta: value.delta
7468
7824
  });
7469
- if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
7825
+ if (((_t = (_s = options.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.logprobs) && value.logprobs) {
7470
7826
  logprobs.push(value.logprobs);
7471
7827
  }
7472
7828
  } else if (value.type === "response.reasoning_summary_part.added") {
@@ -7495,7 +7851,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7495
7851
  providerMetadata: {
7496
7852
  [providerOptionsName]: {
7497
7853
  itemId: value.item_id,
7498
- reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
7854
+ reasoningEncryptedContent: (_v = (_u = activeReasoning[value.item_id]) == null ? void 0 : _u.encryptedContent) != null ? _v : null
7499
7855
  }
7500
7856
  }
7501
7857
  });
@@ -7529,20 +7885,20 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7529
7885
  } else if (isResponseFinishedChunk(value)) {
7530
7886
  finishReason = {
7531
7887
  unified: mapOpenAIResponseFinishReason({
7532
- finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
7888
+ finishReason: (_w = value.response.incomplete_details) == null ? void 0 : _w.reason,
7533
7889
  hasFunctionCall
7534
7890
  }),
7535
- raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
7891
+ raw: (_y = (_x = value.response.incomplete_details) == null ? void 0 : _x.reason) != null ? _y : void 0
7536
7892
  };
7537
7893
  usage = value.response.usage;
7538
7894
  if (typeof value.response.service_tier === "string") {
7539
7895
  serviceTier = value.response.service_tier;
7540
7896
  }
7541
- if (((_y = value.response.reasoning) == null ? void 0 : _y.context) != null) {
7897
+ if (((_z = value.response.reasoning) == null ? void 0 : _z.context) != null) {
7542
7898
  reasoningContext = value.response.reasoning.context;
7543
7899
  }
7544
7900
  } else if (isResponseFailedChunk(value)) {
7545
- const incompleteReason = (_z = value.response.incomplete_details) == null ? void 0 : _z.reason;
7901
+ const incompleteReason = (_A = value.response.incomplete_details) == null ? void 0 : _A.reason;
7546
7902
  finishReason = {
7547
7903
  unified: incompleteReason ? mapOpenAIResponseFinishReason({
7548
7904
  finishReason: incompleteReason,
@@ -7550,8 +7906,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7550
7906
  }) : "error",
7551
7907
  raw: incompleteReason != null ? incompleteReason : "error"
7552
7908
  };
7553
- usage = (_A = value.response.usage) != null ? _A : void 0;
7554
- if (((_B = value.response.reasoning) == null ? void 0 : _B.context) != null) {
7909
+ usage = (_B = value.response.usage) != null ? _B : void 0;
7910
+ if (((_C = value.response.reasoning) == null ? void 0 : _C.context) != null) {
7555
7911
  reasoningContext = value.response.reasoning.context;
7556
7912
  }
7557
7913
  if (!encounteredStreamError && value.response.error != null) {
@@ -7575,7 +7931,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7575
7931
  controller.enqueue({
7576
7932
  type: "source",
7577
7933
  sourceType: "url",
7578
- id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : generateId2(),
7934
+ id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId2(),
7579
7935
  url: value.annotation.url,
7580
7936
  title: value.annotation.title
7581
7937
  });
@@ -7583,7 +7939,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7583
7939
  controller.enqueue({
7584
7940
  type: "source",
7585
7941
  sourceType: "document",
7586
- id: (_H = (_G = (_F = self.config).generateId) == null ? void 0 : _G.call(_F)) != null ? _H : generateId2(),
7942
+ id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),
7587
7943
  mediaType: "text/plain",
7588
7944
  title: value.annotation.filename,
7589
7945
  filename: value.annotation.filename,
@@ -7599,7 +7955,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7599
7955
  controller.enqueue({
7600
7956
  type: "source",
7601
7957
  sourceType: "document",
7602
- id: (_K = (_J = (_I = self.config).generateId) == null ? void 0 : _J.call(_I)) != null ? _K : generateId2(),
7958
+ id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),
7603
7959
  mediaType: "text/plain",
7604
7960
  title: value.annotation.filename,
7605
7961
  filename: value.annotation.filename,
@@ -7615,7 +7971,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7615
7971
  controller.enqueue({
7616
7972
  type: "source",
7617
7973
  sourceType: "document",
7618
- id: (_N = (_M = (_L = self.config).generateId) == null ? void 0 : _M.call(_L)) != null ? _N : generateId2(),
7974
+ id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : generateId2(),
7619
7975
  mediaType: "application/octet-stream",
7620
7976
  title: value.annotation.file_id,
7621
7977
  filename: value.annotation.file_id,
@@ -7776,15 +8132,15 @@ import {
7776
8132
 
7777
8133
  // src/speech/openai-speech-model-options.ts
7778
8134
  import {
7779
- lazySchema as lazySchema24,
7780
- zodSchema as zodSchema24
8135
+ lazySchema as lazySchema25,
8136
+ zodSchema as zodSchema25
7781
8137
  } from "@ai-sdk/provider-utils";
7782
- import { z as z26 } from "zod/v4";
7783
- var openaiSpeechModelOptionsSchema = lazySchema24(
7784
- () => zodSchema24(
7785
- z26.object({
7786
- instructions: z26.string().nullish(),
7787
- speed: z26.number().min(0.25).max(4).default(1).nullish()
8138
+ import { z as z27 } from "zod/v4";
8139
+ var openaiSpeechModelOptionsSchema = lazySchema25(
8140
+ () => zodSchema25(
8141
+ z27.object({
8142
+ instructions: z27.string().nullish(),
8143
+ speed: z27.number().min(0.25).max(4).default(1).nullish()
7788
8144
  })
7789
8145
  )
7790
8146
  );
@@ -7921,33 +8277,33 @@ import {
7921
8277
  } from "@ai-sdk/provider-utils";
7922
8278
 
7923
8279
  // src/transcription/openai-transcription-api.ts
7924
- import { lazySchema as lazySchema25, zodSchema as zodSchema25 } from "@ai-sdk/provider-utils";
7925
- import { z as z27 } from "zod/v4";
7926
- var openaiTranscriptionResponseSchema = lazySchema25(
7927
- () => zodSchema25(
7928
- z27.object({
7929
- text: z27.string(),
7930
- language: z27.string().nullish(),
7931
- duration: z27.number().nullish(),
7932
- words: z27.array(
7933
- z27.object({
7934
- word: z27.string(),
7935
- start: z27.number(),
7936
- end: z27.number()
8280
+ import { lazySchema as lazySchema26, zodSchema as zodSchema26 } from "@ai-sdk/provider-utils";
8281
+ import { z as z28 } from "zod/v4";
8282
+ var openaiTranscriptionResponseSchema = lazySchema26(
8283
+ () => zodSchema26(
8284
+ z28.object({
8285
+ text: z28.string(),
8286
+ language: z28.string().nullish(),
8287
+ duration: z28.number().nullish(),
8288
+ words: z28.array(
8289
+ z28.object({
8290
+ word: z28.string(),
8291
+ start: z28.number(),
8292
+ end: z28.number()
7937
8293
  })
7938
8294
  ).nullish(),
7939
- segments: z27.array(
7940
- z27.object({
7941
- id: z27.number(),
7942
- seek: z27.number(),
7943
- start: z27.number(),
7944
- end: z27.number(),
7945
- text: z27.string(),
7946
- tokens: z27.array(z27.number()),
7947
- temperature: z27.number(),
7948
- avg_logprob: z27.number(),
7949
- compression_ratio: z27.number(),
7950
- no_speech_prob: z27.number()
8295
+ segments: z28.array(
8296
+ z28.object({
8297
+ id: z28.number(),
8298
+ seek: z28.number(),
8299
+ start: z28.number(),
8300
+ end: z28.number(),
8301
+ text: z28.string(),
8302
+ tokens: z28.array(z28.number()),
8303
+ temperature: z28.number(),
8304
+ avg_logprob: z28.number(),
8305
+ compression_ratio: z28.number(),
8306
+ no_speech_prob: z28.number()
7951
8307
  })
7952
8308
  ).nullish()
7953
8309
  })
@@ -7956,47 +8312,47 @@ var openaiTranscriptionResponseSchema = lazySchema25(
7956
8312
 
7957
8313
  // src/transcription/openai-transcription-model-options.ts
7958
8314
  import {
7959
- lazySchema as lazySchema26,
7960
- zodSchema as zodSchema26
8315
+ lazySchema as lazySchema27,
8316
+ zodSchema as zodSchema27
7961
8317
  } from "@ai-sdk/provider-utils";
7962
- import { z as z28 } from "zod/v4";
7963
- var openAITranscriptionModelOptions = lazySchema26(
7964
- () => zodSchema26(
7965
- z28.object({
8318
+ import { z as z29 } from "zod/v4";
8319
+ var openAITranscriptionModelOptions = lazySchema27(
8320
+ () => zodSchema27(
8321
+ z29.object({
7966
8322
  /**
7967
8323
  * Additional information to include in the transcription response.
7968
8324
  */
7969
- include: z28.array(z28.string()).optional(),
8325
+ include: z29.array(z29.string()).optional(),
7970
8326
  /**
7971
8327
  * The language of the input audio in ISO-639-1 format.
7972
8328
  */
7973
- language: z28.string().optional(),
8329
+ language: z29.string().optional(),
7974
8330
  /**
7975
8331
  * An optional text to guide the model's style or continue a previous audio segment.
7976
8332
  */
7977
- prompt: z28.string().optional(),
8333
+ prompt: z29.string().optional(),
7978
8334
  /**
7979
8335
  * The sampling temperature, between 0 and 1.
7980
8336
  * @default 0
7981
8337
  */
7982
- temperature: z28.number().min(0).max(1).default(0).optional(),
8338
+ temperature: z29.number().min(0).max(1).default(0).optional(),
7983
8339
  /**
7984
8340
  * The timestamp granularities to populate for this transcription.
7985
8341
  * @default ['segment']
7986
8342
  */
7987
- timestampGranularities: z28.array(z28.enum(["word", "segment"])).default(["segment"]).optional(),
8343
+ timestampGranularities: z29.array(z29.enum(["word", "segment"])).default(["segment"]).optional(),
7988
8344
  /**
7989
8345
  * Options for streaming transcription models such as `gpt-realtime-whisper`.
7990
8346
  */
7991
- streaming: z28.object({
8347
+ streaming: z29.object({
7992
8348
  /**
7993
8349
  * Latency/accuracy tradeoff for realtime transcription.
7994
8350
  */
7995
- delay: z28.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
8351
+ delay: z29.enum(["minimal", "low", "medium", "high", "xhigh"]).optional(),
7996
8352
  /**
7997
8353
  * Additional fields to include in realtime transcription events.
7998
8354
  */
7999
- include: z28.array(z28.string()).optional()
8355
+ include: z29.array(z29.string()).optional()
8000
8356
  }).optional()
8001
8357
  })
8002
8358
  )
@@ -8441,28 +8797,28 @@ import {
8441
8797
  } from "@ai-sdk/provider-utils";
8442
8798
 
8443
8799
  // src/skills/openai-skills-api.ts
8444
- import { lazySchema as lazySchema27, zodSchema as zodSchema27 } from "@ai-sdk/provider-utils";
8445
- import { z as z29 } from "zod/v4";
8446
- var openaiSkillResponseSchema = lazySchema27(
8447
- () => zodSchema27(
8448
- z29.object({
8449
- id: z29.string(),
8450
- name: z29.string().nullish(),
8451
- description: z29.string().nullish(),
8452
- default_version: z29.string().nullish(),
8453
- latest_version: z29.string().nullish(),
8454
- created_at: z29.number(),
8455
- updated_at: z29.number().nullish()
8800
+ import { lazySchema as lazySchema28, zodSchema as zodSchema28 } from "@ai-sdk/provider-utils";
8801
+ import { z as z30 } from "zod/v4";
8802
+ var openaiSkillResponseSchema = lazySchema28(
8803
+ () => zodSchema28(
8804
+ z30.object({
8805
+ id: z30.string(),
8806
+ name: z30.string().nullish(),
8807
+ description: z30.string().nullish(),
8808
+ default_version: z30.string().nullish(),
8809
+ latest_version: z30.string().nullish(),
8810
+ created_at: z30.number(),
8811
+ updated_at: z30.number().nullish()
8456
8812
  })
8457
8813
  )
8458
8814
  );
8459
- var openaiSkillVersionResponseSchema = lazySchema27(
8460
- () => zodSchema27(
8461
- z29.object({
8462
- id: z29.string(),
8463
- version: z29.string().nullish(),
8464
- name: z29.string().nullish(),
8465
- description: z29.string().nullish()
8815
+ var openaiSkillVersionResponseSchema = lazySchema28(
8816
+ () => zodSchema28(
8817
+ z30.object({
8818
+ id: z30.string(),
8819
+ version: z30.string().nullish(),
8820
+ name: z30.string().nullish(),
8821
+ description: z30.string().nullish()
8466
8822
  })
8467
8823
  )
8468
8824
  );
@@ -8517,7 +8873,7 @@ var OpenAISkills = class {
8517
8873
  };
8518
8874
 
8519
8875
  // src/version.ts
8520
- var VERSION = true ? "4.0.14" : "0.0.0-test";
8876
+ var VERSION = true ? "4.0.16" : "0.0.0-test";
8521
8877
 
8522
8878
  // src/openai-provider.ts
8523
8879
  function createOpenAI(options = {}) {