@ai-sdk/openai 3.0.117 → 3.0.119

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.
@@ -2791,45 +2791,343 @@ function convertOpenAIResponsesUsage(usage) {
2791
2791
 
2792
2792
  // src/responses/convert-to-openai-responses-input.ts
2793
2793
  var import_provider8 = require("@ai-sdk/provider");
2794
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
2795
- var import_v417 = require("zod/v4");
2794
+ var import_provider_utils26 = require("@ai-sdk/provider-utils");
2795
+ var import_v418 = require("zod/v4");
2796
2796
 
2797
- // src/tool/apply-patch.ts
2797
+ // src/responses/openai-responses-options.ts
2798
2798
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
2799
2799
  var import_v413 = require("zod/v4");
2800
- var applyPatchInputSchema = (0, import_provider_utils20.lazySchema)(
2800
+ var TOP_LOGPROBS_MAX = 20;
2801
+ var openaiResponsesReasoningModelIds = [
2802
+ "o1",
2803
+ "o1-2024-12-17",
2804
+ "o3",
2805
+ "o3-2025-04-16",
2806
+ "o3-mini",
2807
+ "o3-mini-2025-01-31",
2808
+ "o4-mini",
2809
+ "o4-mini-2025-04-16",
2810
+ "gpt-5",
2811
+ "gpt-5-2025-08-07",
2812
+ "gpt-5-codex",
2813
+ "gpt-5-mini",
2814
+ "gpt-5-mini-2025-08-07",
2815
+ "gpt-5-nano",
2816
+ "gpt-5-nano-2025-08-07",
2817
+ "gpt-5-pro",
2818
+ "gpt-5-pro-2025-10-06",
2819
+ "gpt-5.1",
2820
+ "gpt-5.1-chat-latest",
2821
+ "gpt-5.1-codex-mini",
2822
+ "gpt-5.1-codex",
2823
+ "gpt-5.1-codex-max",
2824
+ "gpt-5.2",
2825
+ "gpt-5.2-chat-latest",
2826
+ "gpt-5.2-pro",
2827
+ "gpt-5.2-codex",
2828
+ "gpt-5.3-chat-latest",
2829
+ "gpt-5.3-codex",
2830
+ "gpt-5.4",
2831
+ "gpt-5.4-2026-03-05",
2832
+ "gpt-5.4-mini",
2833
+ "gpt-5.4-mini-2026-03-17",
2834
+ "gpt-5.4-nano",
2835
+ "gpt-5.4-nano-2026-03-17",
2836
+ "gpt-5.4-pro",
2837
+ "gpt-5.4-pro-2026-03-05",
2838
+ "gpt-5.5",
2839
+ "gpt-5.5-2026-04-23",
2840
+ "gpt-5.6",
2841
+ "gpt-5.6-luna",
2842
+ "gpt-5.6-sol",
2843
+ "gpt-5.6-terra",
2844
+ "gpt-6-astra",
2845
+ "gpt-6-luna",
2846
+ "gpt-6-sol"
2847
+ ];
2848
+ var openaiResponsesModelIds = [
2849
+ "gpt-4.1",
2850
+ "gpt-4.1-2025-04-14",
2851
+ "gpt-4.1-mini",
2852
+ "gpt-4.1-mini-2025-04-14",
2853
+ "gpt-4.1-nano",
2854
+ "gpt-4.1-nano-2025-04-14",
2855
+ "gpt-4o",
2856
+ "gpt-4o-2024-05-13",
2857
+ "gpt-4o-2024-08-06",
2858
+ "gpt-4o-2024-11-20",
2859
+ "gpt-4o-audio-preview",
2860
+ "gpt-4o-audio-preview-2024-12-17",
2861
+ "gpt-4o-search-preview",
2862
+ "gpt-4o-search-preview-2025-03-11",
2863
+ "gpt-4o-mini-search-preview",
2864
+ "gpt-4o-mini-search-preview-2025-03-11",
2865
+ "gpt-4o-mini",
2866
+ "gpt-4o-mini-2024-07-18",
2867
+ "gpt-3.5-turbo-0125",
2868
+ "gpt-3.5-turbo",
2869
+ "gpt-3.5-turbo-1106",
2870
+ "gpt-5-chat-latest",
2871
+ ...openaiResponsesReasoningModelIds
2872
+ ];
2873
+ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils20.lazySchema)(
2874
+ () => (0, import_provider_utils20.zodSchema)(
2875
+ import_v413.z.object({
2876
+ /**
2877
+ * The ID of the OpenAI Conversation to continue.
2878
+ * You must create a conversation first via the OpenAI API.
2879
+ * Cannot be used in conjunction with `previousResponseId`.
2880
+ * Defaults to `undefined`.
2881
+ * @see https://platform.openai.com/docs/api-reference/conversations/create
2882
+ */
2883
+ conversation: import_v413.z.string().nullish(),
2884
+ /**
2885
+ * The set of extra fields to include in the response (advanced, usually not needed).
2886
+ * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
2887
+ */
2888
+ include: import_v413.z.array(
2889
+ import_v413.z.enum([
2890
+ "reasoning.encrypted_content",
2891
+ // handled internally by default, only needed for unknown reasoning models
2892
+ "file_search_call.results",
2893
+ "web_search_call.results",
2894
+ "message.output_text.logprobs"
2895
+ ])
2896
+ ).nullish(),
2897
+ /**
2898
+ * Instructions for the model.
2899
+ * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
2900
+ * Defaults to `undefined`.
2901
+ */
2902
+ instructions: import_v413.z.string().nullish(),
2903
+ /**
2904
+ * Return the log probabilities of the tokens. Including logprobs will increase
2905
+ * the response size and can slow down response times. However, it can
2906
+ * be useful to better understand how the model is behaving.
2907
+ *
2908
+ * Setting to true will return the log probabilities of the tokens that
2909
+ * were generated.
2910
+ *
2911
+ * Setting to a number will return the log probabilities of the top n
2912
+ * tokens that were generated.
2913
+ *
2914
+ * @see https://platform.openai.com/docs/api-reference/responses/create
2915
+ * @see https://cookbook.openai.com/examples/using_logprobs
2916
+ */
2917
+ logprobs: import_v413.z.union([import_v413.z.boolean(), import_v413.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
2918
+ /**
2919
+ * The maximum number of total calls to built-in tools that can be processed in a response.
2920
+ * This maximum number applies across all built-in tool calls, not per individual tool.
2921
+ * Any further attempts to call a tool by the model will be ignored.
2922
+ */
2923
+ maxToolCalls: import_v413.z.number().nullish(),
2924
+ /**
2925
+ * Additional metadata to store with the generation.
2926
+ */
2927
+ metadata: import_v413.z.any().nullish(),
2928
+ /**
2929
+ * Whether to use parallel tool calls. Defaults to `true`.
2930
+ */
2931
+ parallelToolCalls: import_v413.z.boolean().nullish(),
2932
+ /**
2933
+ * The ID of the previous response. You can use it to continue a conversation.
2934
+ * Defaults to `undefined`.
2935
+ */
2936
+ previousResponseId: import_v413.z.string().nullish(),
2937
+ /**
2938
+ * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
2939
+ */
2940
+ promptCacheKey: import_v413.z.string().nullish(),
2941
+ /**
2942
+ * Prompt cache behavior for GPT-5.6 and later models.
2943
+ * `mode` controls whether OpenAI also places an implicit breakpoint.
2944
+ * `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
2945
+ */
2946
+ promptCacheOptions: import_v413.z.object({
2947
+ mode: import_v413.z.enum(["implicit", "explicit"]).optional(),
2948
+ ttl: import_v413.z.literal("30m").optional()
2949
+ }).optional(),
2950
+ /**
2951
+ * The retention policy for the prompt cache.
2952
+ * - 'in_memory': Default. Standard prompt caching behavior.
2953
+ * - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
2954
+ * Available for models before GPT-5.6 that support extended caching.
2955
+ *
2956
+ * @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
2957
+ *
2958
+ * @default 'in_memory'
2959
+ */
2960
+ promptCacheRetention: import_v413.z.enum(["in_memory", "24h"]).nullish(),
2961
+ /**
2962
+ * Reasoning effort for reasoning models. Defaults to `medium`. If you use
2963
+ * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
2964
+ * GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
2965
+ * GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
2966
+ * Supported values vary by model.
2967
+ */
2968
+ reasoningEffort: import_v413.z.string().nullish(),
2969
+ /**
2970
+ * Updates the reasoning effort for GPT-6 and later models starting with this response
2971
+ * without changing the request-level reasoning effort. This preserves the
2972
+ * request prefix for prompt caching.
2973
+ *
2974
+ * Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
2975
+ * combined with automatic truncation.
2976
+ */
2977
+ reasoningEffortUpdate: import_v413.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
2978
+ /**
2979
+ * Controls how much model work GPT-5.6 performs before returning a final answer.
2980
+ * `standard` is the default. `pro` increases quality, latency, and token usage.
2981
+ */
2982
+ reasoningMode: import_v413.z.enum(["standard", "pro"]).optional(),
2983
+ /**
2984
+ * Controls which available reasoning items GPT-5.6 can use.
2985
+ * `auto` uses the model default, `current_turn` excludes reasoning from earlier
2986
+ * turns, and `all_turns` makes compatible earlier reasoning available.
2987
+ */
2988
+ reasoningContext: import_v413.z.enum(["auto", "current_turn", "all_turns"]).optional(),
2989
+ /**
2990
+ * Controls reasoning summary output from the model.
2991
+ * Set to "auto" to automatically receive the richest level available,
2992
+ * or "detailed" for comprehensive summaries.
2993
+ */
2994
+ reasoningSummary: import_v413.z.string().nullish(),
2995
+ /**
2996
+ * The identifier for safety monitoring and tracking.
2997
+ */
2998
+ safetyIdentifier: import_v413.z.string().nullish(),
2999
+ /**
3000
+ * Service tier for the request.
3001
+ * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
3002
+ * Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
3003
+ * Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
3004
+ *
3005
+ * Defaults to 'auto'.
3006
+ */
3007
+ serviceTier: import_v413.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
3008
+ /**
3009
+ * Whether to store the generation. Defaults to `true`.
3010
+ */
3011
+ store: import_v413.z.boolean().nullish(),
3012
+ /**
3013
+ * Whether to pass through non-image file types as generic input files.
3014
+ *
3015
+ * By default, inline file inputs are restricted to images and PDFs.
3016
+ * Enable this when the target OpenAI Responses model supports additional
3017
+ * file media types, such as text/csv.
3018
+ */
3019
+ passThroughUnsupportedFiles: import_v413.z.boolean().optional(),
3020
+ /**
3021
+ * Whether to use strict JSON schema validation.
3022
+ * Defaults to `true`.
3023
+ */
3024
+ strictJsonSchema: import_v413.z.boolean().nullish(),
3025
+ /**
3026
+ * Controls the verbosity of the model's responses. Lower values ('low') will result
3027
+ * in more concise responses, while higher values ('high') will result in more verbose responses.
3028
+ * Valid values: 'low', 'medium', 'high'.
3029
+ */
3030
+ textVerbosity: import_v413.z.enum(["low", "medium", "high"]).nullish(),
3031
+ /**
3032
+ * Controls output truncation. 'auto' (default) performs truncation automatically;
3033
+ * 'disabled' turns truncation off.
3034
+ */
3035
+ truncation: import_v413.z.enum(["auto", "disabled"]).nullish(),
3036
+ /**
3037
+ * A unique identifier representing your end-user, which can help OpenAI to
3038
+ * monitor and detect abuse.
3039
+ * Defaults to `undefined`.
3040
+ * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
3041
+ */
3042
+ user: import_v413.z.string().nullish(),
3043
+ /**
3044
+ * Override the system message mode for this model.
3045
+ * - 'system': Use the 'system' role for system messages (default for most models)
3046
+ * - 'developer': Use the 'developer' role for system messages (used by reasoning models)
3047
+ * - 'remove': Remove system messages entirely
3048
+ *
3049
+ * If not specified, the mode is automatically determined based on the model.
3050
+ */
3051
+ systemMessageMode: import_v413.z.enum(["system", "developer", "remove"]).optional(),
3052
+ /**
3053
+ * Force treating this model as a reasoning model.
3054
+ *
3055
+ * This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
3056
+ * where the model ID is not recognized by the SDK's allowlist.
3057
+ *
3058
+ * When enabled, the SDK applies reasoning-model parameter compatibility rules
3059
+ * and defaults `systemMessageMode` to `developer` unless overridden.
3060
+ */
3061
+ forceReasoning: import_v413.z.boolean().optional(),
3062
+ /**
3063
+ * Restrict the callable tools to a subset while keeping the full tools
3064
+ * list intact, so prompt caching is preserved across requests with
3065
+ * different allowlists.
3066
+ *
3067
+ * When set, this overrides the request-level `toolChoice` and emits
3068
+ * `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
3069
+ *
3070
+ * @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
3071
+ */
3072
+ allowedTools: import_v413.z.object({
3073
+ toolNames: import_v413.z.array(import_v413.z.string()).min(1),
3074
+ mode: import_v413.z.enum(["auto", "required"]).optional()
3075
+ }).optional()
3076
+ })
3077
+ )
3078
+ );
3079
+ var openaiResponsesSystemMessageOptionsSchema = (0, import_provider_utils20.lazySchema)(
2801
3080
  () => (0, import_provider_utils20.zodSchema)(
2802
3081
  import_v413.z.object({
2803
- callId: import_v413.z.string(),
2804
- operation: import_v413.z.discriminatedUnion("type", [
2805
- import_v413.z.object({
2806
- type: import_v413.z.literal("create_file"),
2807
- path: import_v413.z.string(),
2808
- diff: import_v413.z.string()
3082
+ /**
3083
+ * Emit a configuration update at this position in Responses history.
3084
+ * Requires empty system message content and the same supported
3085
+ * configuration as the request-level reasoningEffortUpdate option.
3086
+ * Unsupported historical updates throw instead of being omitted.
3087
+ *
3088
+ * @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
3089
+ */
3090
+ reasoningEffortUpdate: import_v413.z.enum(["low", "medium", "high", "xhigh", "max"]).optional()
3091
+ })
3092
+ )
3093
+ );
3094
+
3095
+ // src/tool/apply-patch.ts
3096
+ var import_provider_utils21 = require("@ai-sdk/provider-utils");
3097
+ var import_v414 = require("zod/v4");
3098
+ var applyPatchInputSchema = (0, import_provider_utils21.lazySchema)(
3099
+ () => (0, import_provider_utils21.zodSchema)(
3100
+ import_v414.z.object({
3101
+ callId: import_v414.z.string(),
3102
+ operation: import_v414.z.discriminatedUnion("type", [
3103
+ import_v414.z.object({
3104
+ type: import_v414.z.literal("create_file"),
3105
+ path: import_v414.z.string(),
3106
+ diff: import_v414.z.string()
2809
3107
  }),
2810
- import_v413.z.object({
2811
- type: import_v413.z.literal("delete_file"),
2812
- path: import_v413.z.string()
3108
+ import_v414.z.object({
3109
+ type: import_v414.z.literal("delete_file"),
3110
+ path: import_v414.z.string()
2813
3111
  }),
2814
- import_v413.z.object({
2815
- type: import_v413.z.literal("update_file"),
2816
- path: import_v413.z.string(),
2817
- diff: import_v413.z.string()
3112
+ import_v414.z.object({
3113
+ type: import_v414.z.literal("update_file"),
3114
+ path: import_v414.z.string(),
3115
+ diff: import_v414.z.string()
2818
3116
  })
2819
3117
  ])
2820
3118
  })
2821
3119
  )
2822
3120
  );
2823
- var applyPatchOutputSchema = (0, import_provider_utils20.lazySchema)(
2824
- () => (0, import_provider_utils20.zodSchema)(
2825
- import_v413.z.object({
2826
- status: import_v413.z.enum(["completed", "failed"]),
2827
- output: import_v413.z.string().optional()
3121
+ var applyPatchOutputSchema = (0, import_provider_utils21.lazySchema)(
3122
+ () => (0, import_provider_utils21.zodSchema)(
3123
+ import_v414.z.object({
3124
+ status: import_v414.z.enum(["completed", "failed"]),
3125
+ output: import_v414.z.string().optional()
2828
3126
  })
2829
3127
  )
2830
3128
  );
2831
- var applyPatchArgsSchema = (0, import_provider_utils20.lazySchema)(() => (0, import_provider_utils20.zodSchema)(import_v413.z.object({})));
2832
- var applyPatchToolFactory = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
3129
+ var applyPatchArgsSchema = (0, import_provider_utils21.lazySchema)(() => (0, import_provider_utils21.zodSchema)(import_v414.z.object({})));
3130
+ var applyPatchToolFactory = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
2833
3131
  id: "openai.apply_patch",
2834
3132
  inputSchema: applyPatchInputSchema,
2835
3133
  outputSchema: applyPatchOutputSchema
@@ -2837,115 +3135,115 @@ var applyPatchToolFactory = (0, import_provider_utils20.createProviderToolFactor
2837
3135
  var applyPatch = applyPatchToolFactory;
2838
3136
 
2839
3137
  // src/tool/local-shell.ts
2840
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
2841
- var import_v414 = require("zod/v4");
2842
- var localShellInputSchema = (0, import_provider_utils21.lazySchema)(
2843
- () => (0, import_provider_utils21.zodSchema)(
2844
- import_v414.z.object({
2845
- action: import_v414.z.object({
2846
- type: import_v414.z.literal("exec"),
2847
- command: import_v414.z.array(import_v414.z.string()),
2848
- timeoutMs: import_v414.z.number().optional(),
2849
- user: import_v414.z.string().optional(),
2850
- workingDirectory: import_v414.z.string().optional(),
2851
- env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
3138
+ var import_provider_utils22 = require("@ai-sdk/provider-utils");
3139
+ var import_v415 = require("zod/v4");
3140
+ var localShellInputSchema = (0, import_provider_utils22.lazySchema)(
3141
+ () => (0, import_provider_utils22.zodSchema)(
3142
+ import_v415.z.object({
3143
+ action: import_v415.z.object({
3144
+ type: import_v415.z.literal("exec"),
3145
+ command: import_v415.z.array(import_v415.z.string()),
3146
+ timeoutMs: import_v415.z.number().optional(),
3147
+ user: import_v415.z.string().optional(),
3148
+ workingDirectory: import_v415.z.string().optional(),
3149
+ env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
2852
3150
  })
2853
3151
  })
2854
3152
  )
2855
3153
  );
2856
- var localShellOutputSchema = (0, import_provider_utils21.lazySchema)(
2857
- () => (0, import_provider_utils21.zodSchema)(import_v414.z.object({ output: import_v414.z.string() }))
3154
+ var localShellOutputSchema = (0, import_provider_utils22.lazySchema)(
3155
+ () => (0, import_provider_utils22.zodSchema)(import_v415.z.object({ output: import_v415.z.string() }))
2858
3156
  );
2859
- var localShell = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
3157
+ var localShell = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
2860
3158
  id: "openai.local_shell",
2861
3159
  inputSchema: localShellInputSchema,
2862
3160
  outputSchema: localShellOutputSchema
2863
3161
  });
2864
3162
 
2865
3163
  // src/tool/shell.ts
2866
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
2867
- var import_v415 = require("zod/v4");
2868
- var shellInputSchema = (0, import_provider_utils22.lazySchema)(
2869
- () => (0, import_provider_utils22.zodSchema)(
2870
- import_v415.z.object({
2871
- action: import_v415.z.object({
2872
- commands: import_v415.z.array(import_v415.z.string()),
2873
- timeoutMs: import_v415.z.number().optional(),
2874
- maxOutputLength: import_v415.z.number().optional()
3164
+ var import_provider_utils23 = require("@ai-sdk/provider-utils");
3165
+ var import_v416 = require("zod/v4");
3166
+ var shellInputSchema = (0, import_provider_utils23.lazySchema)(
3167
+ () => (0, import_provider_utils23.zodSchema)(
3168
+ import_v416.z.object({
3169
+ action: import_v416.z.object({
3170
+ commands: import_v416.z.array(import_v416.z.string()),
3171
+ timeoutMs: import_v416.z.number().optional(),
3172
+ maxOutputLength: import_v416.z.number().optional()
2875
3173
  })
2876
3174
  })
2877
3175
  )
2878
3176
  );
2879
- var shellOutputSchema = (0, import_provider_utils22.lazySchema)(
2880
- () => (0, import_provider_utils22.zodSchema)(
2881
- import_v415.z.object({
2882
- output: import_v415.z.array(
2883
- import_v415.z.object({
2884
- stdout: import_v415.z.string(),
2885
- stderr: import_v415.z.string(),
2886
- outcome: import_v415.z.discriminatedUnion("type", [
2887
- import_v415.z.object({ type: import_v415.z.literal("timeout") }),
2888
- import_v415.z.object({ type: import_v415.z.literal("exit"), exitCode: import_v415.z.number() })
3177
+ var shellOutputSchema = (0, import_provider_utils23.lazySchema)(
3178
+ () => (0, import_provider_utils23.zodSchema)(
3179
+ import_v416.z.object({
3180
+ output: import_v416.z.array(
3181
+ import_v416.z.object({
3182
+ stdout: import_v416.z.string(),
3183
+ stderr: import_v416.z.string(),
3184
+ outcome: import_v416.z.discriminatedUnion("type", [
3185
+ import_v416.z.object({ type: import_v416.z.literal("timeout") }),
3186
+ import_v416.z.object({ type: import_v416.z.literal("exit"), exitCode: import_v416.z.number() })
2889
3187
  ])
2890
3188
  })
2891
3189
  )
2892
3190
  })
2893
3191
  )
2894
3192
  );
2895
- var shellSkillsSchema = import_v415.z.array(
2896
- import_v415.z.discriminatedUnion("type", [
2897
- import_v415.z.object({
2898
- type: import_v415.z.literal("skillReference"),
2899
- skillId: import_v415.z.string(),
2900
- version: import_v415.z.string().optional()
3193
+ var shellSkillsSchema = import_v416.z.array(
3194
+ import_v416.z.discriminatedUnion("type", [
3195
+ import_v416.z.object({
3196
+ type: import_v416.z.literal("skillReference"),
3197
+ skillId: import_v416.z.string(),
3198
+ version: import_v416.z.string().optional()
2901
3199
  }),
2902
- import_v415.z.object({
2903
- type: import_v415.z.literal("inline"),
2904
- name: import_v415.z.string(),
2905
- description: import_v415.z.string(),
2906
- source: import_v415.z.object({
2907
- type: import_v415.z.literal("base64"),
2908
- mediaType: import_v415.z.literal("application/zip"),
2909
- data: import_v415.z.string()
3200
+ import_v416.z.object({
3201
+ type: import_v416.z.literal("inline"),
3202
+ name: import_v416.z.string(),
3203
+ description: import_v416.z.string(),
3204
+ source: import_v416.z.object({
3205
+ type: import_v416.z.literal("base64"),
3206
+ mediaType: import_v416.z.literal("application/zip"),
3207
+ data: import_v416.z.string()
2910
3208
  })
2911
3209
  })
2912
3210
  ])
2913
3211
  ).optional();
2914
- var shellArgsSchema = (0, import_provider_utils22.lazySchema)(
2915
- () => (0, import_provider_utils22.zodSchema)(
2916
- import_v415.z.object({
2917
- environment: import_v415.z.union([
2918
- import_v415.z.object({
2919
- type: import_v415.z.literal("containerAuto"),
2920
- fileIds: import_v415.z.array(import_v415.z.string()).optional(),
2921
- memoryLimit: import_v415.z.enum(["1g", "4g", "16g", "64g"]).optional(),
2922
- networkPolicy: import_v415.z.discriminatedUnion("type", [
2923
- import_v415.z.object({ type: import_v415.z.literal("disabled") }),
2924
- import_v415.z.object({
2925
- type: import_v415.z.literal("allowlist"),
2926
- allowedDomains: import_v415.z.array(import_v415.z.string()),
2927
- domainSecrets: import_v415.z.array(
2928
- import_v415.z.object({
2929
- domain: import_v415.z.string(),
2930
- name: import_v415.z.string(),
2931
- value: import_v415.z.string()
3212
+ var shellArgsSchema = (0, import_provider_utils23.lazySchema)(
3213
+ () => (0, import_provider_utils23.zodSchema)(
3214
+ import_v416.z.object({
3215
+ environment: import_v416.z.union([
3216
+ import_v416.z.object({
3217
+ type: import_v416.z.literal("containerAuto"),
3218
+ fileIds: import_v416.z.array(import_v416.z.string()).optional(),
3219
+ memoryLimit: import_v416.z.enum(["1g", "4g", "16g", "64g"]).optional(),
3220
+ networkPolicy: import_v416.z.discriminatedUnion("type", [
3221
+ import_v416.z.object({ type: import_v416.z.literal("disabled") }),
3222
+ import_v416.z.object({
3223
+ type: import_v416.z.literal("allowlist"),
3224
+ allowedDomains: import_v416.z.array(import_v416.z.string()),
3225
+ domainSecrets: import_v416.z.array(
3226
+ import_v416.z.object({
3227
+ domain: import_v416.z.string(),
3228
+ name: import_v416.z.string(),
3229
+ value: import_v416.z.string()
2932
3230
  })
2933
3231
  ).optional()
2934
3232
  })
2935
3233
  ]).optional(),
2936
3234
  skills: shellSkillsSchema
2937
3235
  }),
2938
- import_v415.z.object({
2939
- type: import_v415.z.literal("containerReference"),
2940
- containerId: import_v415.z.string()
3236
+ import_v416.z.object({
3237
+ type: import_v416.z.literal("containerReference"),
3238
+ containerId: import_v416.z.string()
2941
3239
  }),
2942
- import_v415.z.object({
2943
- type: import_v415.z.literal("local").optional(),
2944
- skills: import_v415.z.array(
2945
- import_v415.z.object({
2946
- name: import_v415.z.string(),
2947
- description: import_v415.z.string(),
2948
- path: import_v415.z.string()
3240
+ import_v416.z.object({
3241
+ type: import_v416.z.literal("local").optional(),
3242
+ skills: import_v416.z.array(
3243
+ import_v416.z.object({
3244
+ name: import_v416.z.string(),
3245
+ description: import_v416.z.string(),
3246
+ path: import_v416.z.string()
2949
3247
  })
2950
3248
  ).optional()
2951
3249
  })
@@ -2953,40 +3251,40 @@ var shellArgsSchema = (0, import_provider_utils22.lazySchema)(
2953
3251
  })
2954
3252
  )
2955
3253
  );
2956
- var shell = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
3254
+ var shell = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
2957
3255
  id: "openai.shell",
2958
3256
  inputSchema: shellInputSchema,
2959
3257
  outputSchema: shellOutputSchema
2960
3258
  });
2961
3259
 
2962
3260
  // src/tool/tool-search.ts
2963
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
2964
- var import_v416 = require("zod/v4");
2965
- var toolSearchArgsSchema = (0, import_provider_utils23.lazySchema)(
2966
- () => (0, import_provider_utils23.zodSchema)(
2967
- import_v416.z.object({
2968
- execution: import_v416.z.enum(["server", "client"]).optional(),
2969
- description: import_v416.z.string().optional(),
2970
- parameters: import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()).optional()
3261
+ var import_provider_utils24 = require("@ai-sdk/provider-utils");
3262
+ var import_v417 = require("zod/v4");
3263
+ var toolSearchArgsSchema = (0, import_provider_utils24.lazySchema)(
3264
+ () => (0, import_provider_utils24.zodSchema)(
3265
+ import_v417.z.object({
3266
+ execution: import_v417.z.enum(["server", "client"]).optional(),
3267
+ description: import_v417.z.string().optional(),
3268
+ parameters: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
2971
3269
  })
2972
3270
  )
2973
3271
  );
2974
- var toolSearchInputSchema = (0, import_provider_utils23.lazySchema)(
2975
- () => (0, import_provider_utils23.zodSchema)(
2976
- import_v416.z.object({
2977
- arguments: import_v416.z.unknown().optional(),
2978
- call_id: import_v416.z.string().nullish()
3272
+ var toolSearchInputSchema = (0, import_provider_utils24.lazySchema)(
3273
+ () => (0, import_provider_utils24.zodSchema)(
3274
+ import_v417.z.object({
3275
+ arguments: import_v417.z.unknown().optional(),
3276
+ call_id: import_v417.z.string().nullish()
2979
3277
  })
2980
3278
  )
2981
3279
  );
2982
- var toolSearchOutputSchema = (0, import_provider_utils23.lazySchema)(
2983
- () => (0, import_provider_utils23.zodSchema)(
2984
- import_v416.z.object({
2985
- tools: import_v416.z.array(import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()))
3280
+ var toolSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
3281
+ () => (0, import_provider_utils24.zodSchema)(
3282
+ import_v417.z.object({
3283
+ tools: import_v417.z.array(import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()))
2986
3284
  })
2987
3285
  )
2988
3286
  );
2989
- var toolSearchToolFactory = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
3287
+ var toolSearchToolFactory = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
2990
3288
  id: "openai.tool_search",
2991
3289
  inputSchema: toolSearchInputSchema,
2992
3290
  outputSchema: toolSearchOutputSchema
@@ -2994,7 +3292,7 @@ var toolSearchToolFactory = (0, import_provider_utils23.createProviderToolFactor
2994
3292
 
2995
3293
  // src/responses/expand-parallel-tool-call.ts
2996
3294
  var import_provider7 = require("@ai-sdk/provider");
2997
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
3295
+ var import_provider_utils25 = require("@ai-sdk/provider-utils");
2998
3296
  var parallelToolName = "parallel";
2999
3297
  var recipientNamePrefix = "functions.";
3000
3298
  function getParallelToolCallMetadata({
@@ -3023,7 +3321,7 @@ async function expandParallelToolCall({
3023
3321
  if (!isUndeclaredParallelToolCall({ toolName: toolCall.toolName, tools })) {
3024
3322
  return void 0;
3025
3323
  }
3026
- const parsedInput = await (0, import_provider_utils24.safeParseJSON)({ text: toolCall.input });
3324
+ const parsedInput = await (0, import_provider_utils25.safeParseJSON)({ text: toolCall.input });
3027
3325
  if (!parsedInput.success || !(0, import_provider7.isJSONObject)(parsedInput.value)) {
3028
3326
  return void 0;
3029
3327
  }
@@ -3181,7 +3479,7 @@ async function convertFunctionToolResultOutput({
3181
3479
  return void 0;
3182
3480
  }
3183
3481
  }
3184
- }).filter(import_provider_utils25.isNonNullable);
3482
+ }).filter(import_provider_utils26.isNonNullable);
3185
3483
  }
3186
3484
  }
3187
3485
  function hasSameParallelToolCall(first, second) {
@@ -3232,7 +3530,7 @@ function collectCompleteParallelToolResultGroups({
3232
3530
  { length: group.metadata.count },
3233
3531
  (_, index) => group.results.get(index)
3234
3532
  );
3235
- if (results.every(import_provider_utils25.isNonNullable)) {
3533
+ if (results.every(import_provider_utils26.isNonNullable)) {
3236
3534
  completeGroups.set(toolCallId, {
3237
3535
  metadata: group.metadata,
3238
3536
  results
@@ -3271,6 +3569,7 @@ async function convertToOpenAIResponsesInput({
3271
3569
  store,
3272
3570
  hasConversation = false,
3273
3571
  hasPreviousResponseId = false,
3572
+ configurationUpdateUnsupportedReason,
3274
3573
  hasLocalShellTool = false,
3275
3574
  hasShellTool = false,
3276
3575
  hasApplyPatchTool = false,
@@ -3290,6 +3589,33 @@ async function convertToOpenAIResponsesInput({
3290
3589
  for (const { role, content, providerOptions } of prompt) {
3291
3590
  switch (role) {
3292
3591
  case "system": {
3592
+ let options = await (0, import_provider_utils26.parseProviderOptions)({
3593
+ provider: providerOptionsName,
3594
+ providerOptions,
3595
+ schema: openaiResponsesSystemMessageOptionsSchema
3596
+ });
3597
+ if (options == null && providerOptionsName !== "openai") {
3598
+ options = await (0, import_provider_utils26.parseProviderOptions)({
3599
+ provider: "openai",
3600
+ providerOptions,
3601
+ schema: openaiResponsesSystemMessageOptionsSchema
3602
+ });
3603
+ }
3604
+ const effort = options == null ? void 0 : options.reasoningEffortUpdate;
3605
+ if (effort != null) {
3606
+ const unsupportedReason = content !== "" ? "Message-level reasoningEffortUpdate requires empty system message content." : configurationUpdateUnsupportedReason;
3607
+ if (unsupportedReason != null) {
3608
+ throw new import_provider8.UnsupportedFunctionalityError({
3609
+ functionality: "Message-level reasoningEffortUpdate",
3610
+ message: unsupportedReason
3611
+ });
3612
+ }
3613
+ input.push({
3614
+ type: "configuration_update",
3615
+ reasoning: { effort }
3616
+ });
3617
+ break;
3618
+ }
3293
3619
  switch (systemMessageMode) {
3294
3620
  case "system": {
3295
3621
  const promptCacheBreakpoint = getPromptCacheBreakpoint2(
@@ -3373,7 +3699,7 @@ async function convertToOpenAIResponsesInput({
3373
3699
  return {
3374
3700
  type: "input_image",
3375
3701
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
3376
- image_url: `data:${mediaType};base64,${(0, import_provider_utils25.convertToBase64)(part.data)}`
3702
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils26.convertToBase64)(part.data)}`
3377
3703
  },
3378
3704
  detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,
3379
3705
  ...promptCacheBreakpoint != null && {
@@ -3399,7 +3725,7 @@ async function convertToOpenAIResponsesInput({
3399
3725
  type: "input_file",
3400
3726
  ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
3401
3727
  filename: (_c2 = part.filename) != null ? _c2 : mediaType === "application/pdf" ? `part-${index}.pdf` : `part-${index}`,
3402
- file_data: `data:${mediaType};base64,${(0, import_provider_utils25.convertToBase64)(part.data)}`
3728
+ file_data: `data:${mediaType};base64,${(0, import_provider_utils26.convertToBase64)(part.data)}`
3403
3729
  },
3404
3730
  ...promptCacheBreakpoint != null && {
3405
3731
  prompt_cache_breakpoint: promptCacheBreakpoint
@@ -3478,10 +3804,10 @@ async function convertToOpenAIResponsesInput({
3478
3804
  input.push({ type: "item_reference", id });
3479
3805
  break;
3480
3806
  }
3481
- const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils25.parseJSON)({
3807
+ const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils26.parseJSON)({
3482
3808
  text: part.input,
3483
3809
  schema: toolSearchInputSchema
3484
- }) : await (0, import_provider_utils25.validateTypes)({
3810
+ }) : await (0, import_provider_utils26.validateTypes)({
3485
3811
  value: part.input,
3486
3812
  schema: toolSearchInputSchema
3487
3813
  });
@@ -3513,7 +3839,7 @@ async function convertToOpenAIResponsesInput({
3513
3839
  break;
3514
3840
  }
3515
3841
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
3516
- const parsedInput = await (0, import_provider_utils25.validateTypes)({
3842
+ const parsedInput = await (0, import_provider_utils26.validateTypes)({
3517
3843
  value: part.input,
3518
3844
  schema: localShellInputSchema
3519
3845
  });
@@ -3533,7 +3859,7 @@ async function convertToOpenAIResponsesInput({
3533
3859
  break;
3534
3860
  }
3535
3861
  if (hasShellTool && resolvedToolName === "shell") {
3536
- const parsedInput = await (0, import_provider_utils25.validateTypes)({
3862
+ const parsedInput = await (0, import_provider_utils26.validateTypes)({
3537
3863
  value: part.input,
3538
3864
  schema: shellInputSchema
3539
3865
  });
@@ -3551,7 +3877,7 @@ async function convertToOpenAIResponsesInput({
3551
3877
  break;
3552
3878
  }
3553
3879
  if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
3554
- const parsedInput = await (0, import_provider_utils25.validateTypes)({
3880
+ const parsedInput = await (0, import_provider_utils26.validateTypes)({
3555
3881
  value: part.input,
3556
3882
  schema: applyPatchInputSchema
3557
3883
  });
@@ -3601,7 +3927,7 @@ async function convertToOpenAIResponsesInput({
3601
3927
  if (store) {
3602
3928
  input.push({ type: "item_reference", id: itemId });
3603
3929
  } else if (part.output.type === "json") {
3604
- const parsedOutput = await (0, import_provider_utils25.validateTypes)({
3930
+ const parsedOutput = await (0, import_provider_utils26.validateTypes)({
3605
3931
  value: part.output.value,
3606
3932
  schema: toolSearchOutputSchema
3607
3933
  });
@@ -3618,7 +3944,7 @@ async function convertToOpenAIResponsesInput({
3618
3944
  }
3619
3945
  if (hasShellTool && resolvedResultToolName === "shell") {
3620
3946
  if (part.output.type === "json") {
3621
- const parsedOutput = await (0, import_provider_utils25.validateTypes)({
3947
+ const parsedOutput = await (0, import_provider_utils26.validateTypes)({
3622
3948
  value: part.output.value,
3623
3949
  schema: shellOutputSchema
3624
3950
  });
@@ -3649,7 +3975,7 @@ async function convertToOpenAIResponsesInput({
3649
3975
  break;
3650
3976
  }
3651
3977
  case "reasoning": {
3652
- const providerOptions2 = await (0, import_provider_utils25.parseProviderOptions)({
3978
+ const providerOptions2 = await (0, import_provider_utils26.parseProviderOptions)({
3653
3979
  provider: providerOptionsName,
3654
3980
  providerOptions: part.providerOptions,
3655
3981
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -3814,7 +4140,7 @@ ${text}`,
3814
4140
  part.toolName
3815
4141
  );
3816
4142
  if (part.toolName === toolSearchToolName && output.type === "json") {
3817
- const parsedOutput = await (0, import_provider_utils25.validateTypes)({
4143
+ const parsedOutput = await (0, import_provider_utils26.validateTypes)({
3818
4144
  value: output.value,
3819
4145
  schema: toolSearchOutputSchema
3820
4146
  });
@@ -3828,7 +4154,7 @@ ${text}`,
3828
4154
  continue;
3829
4155
  }
3830
4156
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
3831
- const parsedOutput = await (0, import_provider_utils25.validateTypes)({
4157
+ const parsedOutput = await (0, import_provider_utils26.validateTypes)({
3832
4158
  value: output.value,
3833
4159
  schema: localShellOutputSchema
3834
4160
  });
@@ -3840,7 +4166,7 @@ ${text}`,
3840
4166
  continue;
3841
4167
  }
3842
4168
  if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
3843
- const parsedOutput = await (0, import_provider_utils25.validateTypes)({
4169
+ const parsedOutput = await (0, import_provider_utils26.validateTypes)({
3844
4170
  value: output.value,
3845
4171
  schema: shellOutputSchema
3846
4172
  });
@@ -3859,7 +4185,7 @@ ${text}`,
3859
4185
  continue;
3860
4186
  }
3861
4187
  if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
3862
- const parsedOutput = await (0, import_provider_utils25.validateTypes)({
4188
+ const parsedOutput = await (0, import_provider_utils26.validateTypes)({
3863
4189
  value: output.value,
3864
4190
  schema: applyPatchOutputSchema
3865
4191
  });
@@ -3957,7 +4283,7 @@ ${text}`,
3957
4283
  });
3958
4284
  return void 0;
3959
4285
  }
3960
- }).filter(import_provider_utils25.isNonNullable);
4286
+ }).filter(import_provider_utils26.isNonNullable);
3961
4287
  break;
3962
4288
  default:
3963
4289
  outputValue = "";
@@ -4006,9 +4332,9 @@ ${text}`,
4006
4332
  }
4007
4333
  return { input, warnings };
4008
4334
  }
4009
- var openaiResponsesReasoningProviderOptionsSchema = import_v417.z.object({
4010
- itemId: import_v417.z.string().nullish(),
4011
- reasoningEncryptedContent: import_v417.z.string().nullish()
4335
+ var openaiResponsesReasoningProviderOptionsSchema = import_v418.z.object({
4336
+ itemId: import_v418.z.string().nullish(),
4337
+ reasoningEncryptedContent: import_v418.z.string().nullish()
4012
4338
  });
4013
4339
 
4014
4340
  // src/responses/map-openai-responses-finish-reason.ts
@@ -4030,75 +4356,75 @@ function mapOpenAIResponseFinishReason({
4030
4356
  }
4031
4357
 
4032
4358
  // src/responses/openai-responses-api.ts
4033
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
4034
- var import_v418 = require("zod/v4");
4035
- var jsonValueSchema = import_v418.z.lazy(
4036
- () => import_v418.z.union([
4037
- import_v418.z.string(),
4038
- import_v418.z.number(),
4039
- import_v418.z.boolean(),
4040
- import_v418.z.null(),
4041
- import_v418.z.array(jsonValueSchema),
4042
- import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional())
4359
+ var import_provider_utils27 = require("@ai-sdk/provider-utils");
4360
+ var import_v419 = require("zod/v4");
4361
+ var jsonValueSchema = import_v419.z.lazy(
4362
+ () => import_v419.z.union([
4363
+ import_v419.z.string(),
4364
+ import_v419.z.number(),
4365
+ import_v419.z.boolean(),
4366
+ import_v419.z.null(),
4367
+ import_v419.z.array(jsonValueSchema),
4368
+ import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional())
4043
4369
  ])
4044
4370
  );
4045
- var jsonObjectSchema = import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional());
4046
- var openaiResponsesUsageSchema = import_v418.z.intersection(
4371
+ var jsonObjectSchema = import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional());
4372
+ var openaiResponsesUsageSchema = import_v419.z.intersection(
4047
4373
  jsonObjectSchema,
4048
- import_v418.z.object({
4049
- input_tokens: import_v418.z.number(),
4050
- input_tokens_details: import_v418.z.intersection(
4374
+ import_v419.z.object({
4375
+ input_tokens: import_v419.z.number(),
4376
+ input_tokens_details: import_v419.z.intersection(
4051
4377
  jsonObjectSchema,
4052
- import_v418.z.object({
4053
- cached_tokens: import_v418.z.number().nullish(),
4054
- cache_write_tokens: import_v418.z.number().nullish(),
4055
- orchestration_input_tokens: import_v418.z.number().nullish(),
4056
- orchestration_input_cached_tokens: import_v418.z.number().nullish()
4378
+ import_v419.z.object({
4379
+ cached_tokens: import_v419.z.number().nullish(),
4380
+ cache_write_tokens: import_v419.z.number().nullish(),
4381
+ orchestration_input_tokens: import_v419.z.number().nullish(),
4382
+ orchestration_input_cached_tokens: import_v419.z.number().nullish()
4057
4383
  })
4058
4384
  ).nullish(),
4059
- output_tokens: import_v418.z.number(),
4060
- output_tokens_details: import_v418.z.intersection(
4385
+ output_tokens: import_v419.z.number(),
4386
+ output_tokens_details: import_v419.z.intersection(
4061
4387
  jsonObjectSchema,
4062
- import_v418.z.object({
4063
- reasoning_tokens: import_v418.z.number().nullish(),
4064
- orchestration_output_tokens: import_v418.z.number().nullish()
4388
+ import_v419.z.object({
4389
+ reasoning_tokens: import_v419.z.number().nullish(),
4390
+ orchestration_output_tokens: import_v419.z.number().nullish()
4065
4391
  })
4066
4392
  ).nullish(),
4067
- total_tokens: import_v418.z.number().optional()
4393
+ total_tokens: import_v419.z.number().optional()
4068
4394
  })
4069
4395
  );
4070
4396
  function isRecord(value) {
4071
4397
  return value != null && typeof value === "object" && !Array.isArray(value);
4072
4398
  }
4073
- var openaiResponsesLocalShellCallSchema = import_v418.z.object({
4074
- type: import_v418.z.literal("local_shell_call"),
4075
- id: import_v418.z.string(),
4076
- call_id: import_v418.z.string(),
4077
- action: import_v418.z.object({
4078
- type: import_v418.z.literal("exec"),
4079
- command: import_v418.z.array(import_v418.z.string()),
4080
- timeout_ms: import_v418.z.number().optional(),
4081
- user: import_v418.z.string().optional(),
4082
- working_directory: import_v418.z.string().optional(),
4083
- env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
4399
+ var openaiResponsesLocalShellCallSchema = import_v419.z.object({
4400
+ type: import_v419.z.literal("local_shell_call"),
4401
+ id: import_v419.z.string(),
4402
+ call_id: import_v419.z.string(),
4403
+ action: import_v419.z.object({
4404
+ type: import_v419.z.literal("exec"),
4405
+ command: import_v419.z.array(import_v419.z.string()),
4406
+ timeout_ms: import_v419.z.number().optional(),
4407
+ user: import_v419.z.string().optional(),
4408
+ working_directory: import_v419.z.string().optional(),
4409
+ env: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional()
4084
4410
  })
4085
4411
  });
4086
- var openaiResponsesNestedErrorChunkSchema = import_v418.z.object({
4087
- type: import_v418.z.literal("error"),
4088
- sequence_number: import_v418.z.number(),
4089
- error: import_v418.z.object({
4090
- type: import_v418.z.string(),
4091
- code: import_v418.z.string(),
4092
- message: import_v418.z.string(),
4093
- param: import_v418.z.string().nullish()
4412
+ var openaiResponsesNestedErrorChunkSchema = import_v419.z.object({
4413
+ type: import_v419.z.literal("error"),
4414
+ sequence_number: import_v419.z.number(),
4415
+ error: import_v419.z.object({
4416
+ type: import_v419.z.string(),
4417
+ code: import_v419.z.string(),
4418
+ message: import_v419.z.string(),
4419
+ param: import_v419.z.string().nullish()
4094
4420
  })
4095
4421
  });
4096
- var openaiResponsesErrorChunkSchema = import_v418.z.object({
4097
- type: import_v418.z.literal("error"),
4098
- sequence_number: import_v418.z.number(),
4099
- code: import_v418.z.string().nullish(),
4100
- message: import_v418.z.string(),
4101
- param: import_v418.z.string().nullish()
4422
+ var openaiResponsesErrorChunkSchema = import_v419.z.object({
4423
+ type: import_v419.z.literal("error"),
4424
+ sequence_number: import_v419.z.number(),
4425
+ code: import_v419.z.string().nullish(),
4426
+ message: import_v419.z.string(),
4427
+ param: import_v419.z.string().nullish()
4102
4428
  });
4103
4429
  var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
4104
4430
  "error",
@@ -4154,1102 +4480,819 @@ function isModeledOpenAIResponsesChunk(value) {
4154
4480
  }
4155
4481
  return openaiResponsesModeledOutputItemTypes.has(value.item.type);
4156
4482
  }
4157
- var openaiResponsesChunkSchema = (0, import_provider_utils26.lazySchema)(
4158
- () => (0, import_provider_utils26.zodSchema)(
4159
- import_v418.z.union([
4160
- import_v418.z.object({
4161
- type: import_v418.z.literal("response.output_text.delta"),
4162
- item_id: import_v418.z.string(),
4163
- delta: import_v418.z.string(),
4164
- logprobs: import_v418.z.array(
4165
- import_v418.z.object({
4166
- token: import_v418.z.string(),
4167
- logprob: import_v418.z.number(),
4168
- top_logprobs: import_v418.z.array(
4169
- import_v418.z.object({
4170
- token: import_v418.z.string(),
4171
- logprob: import_v418.z.number()
4483
+ var openaiResponsesChunkSchema = (0, import_provider_utils27.lazySchema)(
4484
+ () => (0, import_provider_utils27.zodSchema)(
4485
+ import_v419.z.union([
4486
+ import_v419.z.object({
4487
+ type: import_v419.z.literal("response.output_text.delta"),
4488
+ item_id: import_v419.z.string(),
4489
+ delta: import_v419.z.string(),
4490
+ logprobs: import_v419.z.array(
4491
+ import_v419.z.object({
4492
+ token: import_v419.z.string(),
4493
+ logprob: import_v419.z.number(),
4494
+ top_logprobs: import_v419.z.array(
4495
+ import_v419.z.object({
4496
+ token: import_v419.z.string(),
4497
+ logprob: import_v419.z.number()
4172
4498
  })
4173
4499
  )
4174
4500
  })
4175
4501
  ).nullish()
4176
4502
  }),
4177
- import_v418.z.object({
4178
- type: import_v418.z.enum(["response.completed", "response.incomplete"]),
4179
- response: import_v418.z.object({
4180
- incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
4503
+ import_v419.z.object({
4504
+ type: import_v419.z.enum(["response.completed", "response.incomplete"]),
4505
+ response: import_v419.z.object({
4506
+ incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
4181
4507
  usage: openaiResponsesUsageSchema.nullish(),
4182
- reasoning: import_v418.z.object({
4183
- context: import_v418.z.string().nullish()
4508
+ reasoning: import_v419.z.object({
4509
+ context: import_v419.z.string().nullish()
4184
4510
  }).nullish(),
4185
- service_tier: import_v418.z.string().nullish()
4511
+ service_tier: import_v419.z.string().nullish()
4186
4512
  })
4187
4513
  }),
4188
- import_v418.z.object({
4189
- type: import_v418.z.literal("response.failed"),
4190
- sequence_number: import_v418.z.number(),
4191
- response: import_v418.z.object({
4192
- error: import_v418.z.object({
4193
- code: import_v418.z.string().nullish(),
4194
- message: import_v418.z.string()
4514
+ import_v419.z.object({
4515
+ type: import_v419.z.literal("response.failed"),
4516
+ sequence_number: import_v419.z.number(),
4517
+ response: import_v419.z.object({
4518
+ error: import_v419.z.object({
4519
+ code: import_v419.z.string().nullish(),
4520
+ message: import_v419.z.string()
4195
4521
  }).nullish(),
4196
- incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
4522
+ incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
4197
4523
  usage: openaiResponsesUsageSchema.nullish(),
4198
- reasoning: import_v418.z.object({
4199
- context: import_v418.z.string().nullish()
4524
+ reasoning: import_v419.z.object({
4525
+ context: import_v419.z.string().nullish()
4200
4526
  }).nullish(),
4201
- service_tier: import_v418.z.string().nullish()
4527
+ service_tier: import_v419.z.string().nullish()
4202
4528
  })
4203
4529
  }),
4204
- import_v418.z.object({
4205
- type: import_v418.z.literal("response.created"),
4206
- response: import_v418.z.object({
4207
- id: import_v418.z.string(),
4208
- created_at: import_v418.z.number(),
4209
- model: import_v418.z.string(),
4210
- service_tier: import_v418.z.string().nullish()
4530
+ import_v419.z.object({
4531
+ type: import_v419.z.literal("response.created"),
4532
+ response: import_v419.z.object({
4533
+ id: import_v419.z.string(),
4534
+ created_at: import_v419.z.number(),
4535
+ model: import_v419.z.string(),
4536
+ service_tier: import_v419.z.string().nullish()
4211
4537
  })
4212
4538
  }),
4213
- import_v418.z.object({
4214
- type: import_v418.z.literal("response.output_item.added"),
4215
- output_index: import_v418.z.number(),
4216
- item: import_v418.z.discriminatedUnion("type", [
4217
- import_v418.z.object({
4218
- type: import_v418.z.literal("message"),
4219
- id: import_v418.z.string(),
4220
- phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
4539
+ import_v419.z.object({
4540
+ type: import_v419.z.literal("response.output_item.added"),
4541
+ output_index: import_v419.z.number(),
4542
+ item: import_v419.z.discriminatedUnion("type", [
4543
+ import_v419.z.object({
4544
+ type: import_v419.z.literal("message"),
4545
+ id: import_v419.z.string(),
4546
+ phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
4221
4547
  }),
4222
- import_v418.z.object({
4223
- type: import_v418.z.literal("reasoning"),
4224
- id: import_v418.z.string(),
4225
- encrypted_content: import_v418.z.string().nullish()
4548
+ import_v419.z.object({
4549
+ type: import_v419.z.literal("reasoning"),
4550
+ id: import_v419.z.string(),
4551
+ encrypted_content: import_v419.z.string().nullish()
4226
4552
  }),
4227
- import_v418.z.object({
4228
- type: import_v418.z.literal("function_call"),
4229
- id: import_v418.z.string(),
4230
- call_id: import_v418.z.string(),
4231
- name: import_v418.z.string(),
4232
- arguments: import_v418.z.string(),
4233
- async: import_v418.z.boolean().nullish(),
4234
- namespace: import_v418.z.string().nullish()
4553
+ import_v419.z.object({
4554
+ type: import_v419.z.literal("function_call"),
4555
+ id: import_v419.z.string(),
4556
+ call_id: import_v419.z.string(),
4557
+ name: import_v419.z.string(),
4558
+ arguments: import_v419.z.string(),
4559
+ async: import_v419.z.boolean().nullish(),
4560
+ namespace: import_v419.z.string().nullish()
4235
4561
  }),
4236
- import_v418.z.object({
4237
- type: import_v418.z.literal("web_search_call"),
4238
- id: import_v418.z.string(),
4239
- status: import_v418.z.string()
4562
+ import_v419.z.object({
4563
+ type: import_v419.z.literal("web_search_call"),
4564
+ id: import_v419.z.string(),
4565
+ status: import_v419.z.string()
4240
4566
  }),
4241
- import_v418.z.object({
4242
- type: import_v418.z.literal("computer_call"),
4243
- id: import_v418.z.string(),
4244
- status: import_v418.z.string()
4567
+ import_v419.z.object({
4568
+ type: import_v419.z.literal("computer_call"),
4569
+ id: import_v419.z.string(),
4570
+ status: import_v419.z.string()
4245
4571
  }),
4246
- import_v418.z.object({
4247
- type: import_v418.z.literal("file_search_call"),
4248
- id: import_v418.z.string()
4572
+ import_v419.z.object({
4573
+ type: import_v419.z.literal("file_search_call"),
4574
+ id: import_v419.z.string()
4249
4575
  }),
4250
4576
  openaiResponsesLocalShellCallSchema,
4251
- import_v418.z.object({
4252
- type: import_v418.z.literal("image_generation_call"),
4253
- id: import_v418.z.string()
4577
+ import_v419.z.object({
4578
+ type: import_v419.z.literal("image_generation_call"),
4579
+ id: import_v419.z.string()
4254
4580
  }),
4255
- import_v418.z.object({
4256
- type: import_v418.z.literal("code_interpreter_call"),
4257
- id: import_v418.z.string(),
4258
- container_id: import_v418.z.string(),
4259
- code: import_v418.z.string().nullable(),
4260
- outputs: import_v418.z.array(
4261
- import_v418.z.discriminatedUnion("type", [
4262
- import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
4263
- import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
4581
+ import_v419.z.object({
4582
+ type: import_v419.z.literal("code_interpreter_call"),
4583
+ id: import_v419.z.string(),
4584
+ container_id: import_v419.z.string(),
4585
+ code: import_v419.z.string().nullable(),
4586
+ outputs: import_v419.z.array(
4587
+ import_v419.z.discriminatedUnion("type", [
4588
+ import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
4589
+ import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
4264
4590
  ])
4265
4591
  ).nullable(),
4266
- status: import_v418.z.string()
4592
+ status: import_v419.z.string()
4267
4593
  }),
4268
- import_v418.z.object({
4269
- type: import_v418.z.literal("mcp_call"),
4270
- id: import_v418.z.string(),
4271
- status: import_v418.z.string(),
4272
- approval_request_id: import_v418.z.string().nullish()
4594
+ import_v419.z.object({
4595
+ type: import_v419.z.literal("mcp_call"),
4596
+ id: import_v419.z.string(),
4597
+ status: import_v419.z.string(),
4598
+ approval_request_id: import_v419.z.string().nullish()
4273
4599
  }),
4274
- import_v418.z.object({
4275
- type: import_v418.z.literal("mcp_list_tools"),
4276
- id: import_v418.z.string()
4600
+ import_v419.z.object({
4601
+ type: import_v419.z.literal("mcp_list_tools"),
4602
+ id: import_v419.z.string()
4277
4603
  }),
4278
- import_v418.z.object({
4279
- type: import_v418.z.literal("mcp_approval_request"),
4280
- id: import_v418.z.string()
4604
+ import_v419.z.object({
4605
+ type: import_v419.z.literal("mcp_approval_request"),
4606
+ id: import_v419.z.string()
4281
4607
  }),
4282
- import_v418.z.object({
4283
- type: import_v418.z.literal("apply_patch_call"),
4284
- id: import_v418.z.string(),
4285
- call_id: import_v418.z.string(),
4286
- status: import_v418.z.enum(["in_progress", "completed"]),
4287
- operation: import_v418.z.discriminatedUnion("type", [
4288
- import_v418.z.object({
4289
- type: import_v418.z.literal("create_file"),
4290
- path: import_v418.z.string(),
4291
- diff: import_v418.z.string()
4608
+ import_v419.z.object({
4609
+ type: import_v419.z.literal("apply_patch_call"),
4610
+ id: import_v419.z.string(),
4611
+ call_id: import_v419.z.string(),
4612
+ status: import_v419.z.enum(["in_progress", "completed"]),
4613
+ operation: import_v419.z.discriminatedUnion("type", [
4614
+ import_v419.z.object({
4615
+ type: import_v419.z.literal("create_file"),
4616
+ path: import_v419.z.string(),
4617
+ diff: import_v419.z.string()
4292
4618
  }),
4293
- import_v418.z.object({
4294
- type: import_v418.z.literal("delete_file"),
4295
- path: import_v418.z.string()
4619
+ import_v419.z.object({
4620
+ type: import_v419.z.literal("delete_file"),
4621
+ path: import_v419.z.string()
4296
4622
  }),
4297
- import_v418.z.object({
4298
- type: import_v418.z.literal("update_file"),
4299
- path: import_v418.z.string(),
4300
- diff: import_v418.z.string()
4623
+ import_v419.z.object({
4624
+ type: import_v419.z.literal("update_file"),
4625
+ path: import_v419.z.string(),
4626
+ diff: import_v419.z.string()
4301
4627
  })
4302
4628
  ])
4303
4629
  }),
4304
- import_v418.z.object({
4305
- type: import_v418.z.literal("custom_tool_call"),
4306
- id: import_v418.z.string(),
4307
- call_id: import_v418.z.string(),
4308
- name: import_v418.z.string(),
4309
- input: import_v418.z.string(),
4310
- async: import_v418.z.boolean().nullish()
4630
+ import_v419.z.object({
4631
+ type: import_v419.z.literal("custom_tool_call"),
4632
+ id: import_v419.z.string(),
4633
+ call_id: import_v419.z.string(),
4634
+ name: import_v419.z.string(),
4635
+ input: import_v419.z.string(),
4636
+ async: import_v419.z.boolean().nullish()
4311
4637
  }),
4312
- import_v418.z.object({
4313
- type: import_v418.z.literal("shell_call"),
4314
- id: import_v418.z.string(),
4315
- call_id: import_v418.z.string(),
4316
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4317
- action: import_v418.z.object({
4318
- commands: import_v418.z.array(import_v418.z.string())
4638
+ import_v419.z.object({
4639
+ type: import_v419.z.literal("shell_call"),
4640
+ id: import_v419.z.string(),
4641
+ call_id: import_v419.z.string(),
4642
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4643
+ action: import_v419.z.object({
4644
+ commands: import_v419.z.array(import_v419.z.string())
4319
4645
  })
4320
4646
  }),
4321
- import_v418.z.object({
4322
- type: import_v418.z.literal("shell_call_output"),
4323
- id: import_v418.z.string(),
4324
- call_id: import_v418.z.string(),
4325
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4326
- output: import_v418.z.array(
4327
- import_v418.z.object({
4328
- stdout: import_v418.z.string(),
4329
- stderr: import_v418.z.string(),
4330
- outcome: import_v418.z.discriminatedUnion("type", [
4331
- import_v418.z.object({ type: import_v418.z.literal("timeout") }),
4332
- import_v418.z.object({
4333
- type: import_v418.z.literal("exit"),
4334
- exit_code: import_v418.z.number()
4647
+ import_v419.z.object({
4648
+ type: import_v419.z.literal("shell_call_output"),
4649
+ id: import_v419.z.string(),
4650
+ call_id: import_v419.z.string(),
4651
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4652
+ output: import_v419.z.array(
4653
+ import_v419.z.object({
4654
+ stdout: import_v419.z.string(),
4655
+ stderr: import_v419.z.string(),
4656
+ outcome: import_v419.z.discriminatedUnion("type", [
4657
+ import_v419.z.object({ type: import_v419.z.literal("timeout") }),
4658
+ import_v419.z.object({
4659
+ type: import_v419.z.literal("exit"),
4660
+ exit_code: import_v419.z.number()
4335
4661
  })
4336
4662
  ])
4337
4663
  })
4338
4664
  )
4339
4665
  }),
4340
- import_v418.z.object({
4341
- type: import_v418.z.literal("tool_search_call"),
4342
- id: import_v418.z.string(),
4343
- execution: import_v418.z.enum(["server", "client"]),
4344
- call_id: import_v418.z.string().nullable(),
4345
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4346
- arguments: import_v418.z.unknown()
4666
+ import_v419.z.object({
4667
+ type: import_v419.z.literal("tool_search_call"),
4668
+ id: import_v419.z.string(),
4669
+ execution: import_v419.z.enum(["server", "client"]),
4670
+ call_id: import_v419.z.string().nullable(),
4671
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4672
+ arguments: import_v419.z.unknown()
4347
4673
  }),
4348
- import_v418.z.object({
4349
- type: import_v418.z.literal("tool_search_output"),
4350
- id: import_v418.z.string(),
4351
- execution: import_v418.z.enum(["server", "client"]),
4352
- call_id: import_v418.z.string().nullable(),
4353
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4354
- tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
4674
+ import_v419.z.object({
4675
+ type: import_v419.z.literal("tool_search_output"),
4676
+ id: import_v419.z.string(),
4677
+ execution: import_v419.z.enum(["server", "client"]),
4678
+ call_id: import_v419.z.string().nullable(),
4679
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4680
+ tools: import_v419.z.array(import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional()))
4355
4681
  })
4356
4682
  ])
4357
4683
  }),
4358
- import_v418.z.object({
4359
- type: import_v418.z.literal("response.output_item.done"),
4360
- output_index: import_v418.z.number(),
4361
- item: import_v418.z.discriminatedUnion("type", [
4362
- import_v418.z.object({
4363
- type: import_v418.z.literal("message"),
4364
- id: import_v418.z.string(),
4365
- phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
4684
+ import_v419.z.object({
4685
+ type: import_v419.z.literal("response.output_item.done"),
4686
+ output_index: import_v419.z.number(),
4687
+ item: import_v419.z.discriminatedUnion("type", [
4688
+ import_v419.z.object({
4689
+ type: import_v419.z.literal("message"),
4690
+ id: import_v419.z.string(),
4691
+ phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
4366
4692
  }),
4367
- import_v418.z.object({
4368
- type: import_v418.z.literal("reasoning"),
4369
- id: import_v418.z.string(),
4370
- encrypted_content: import_v418.z.string().nullish()
4693
+ import_v419.z.object({
4694
+ type: import_v419.z.literal("reasoning"),
4695
+ id: import_v419.z.string(),
4696
+ encrypted_content: import_v419.z.string().nullish()
4371
4697
  }),
4372
- import_v418.z.object({
4373
- type: import_v418.z.literal("function_call"),
4374
- id: import_v418.z.string(),
4375
- call_id: import_v418.z.string(),
4376
- name: import_v418.z.string(),
4377
- arguments: import_v418.z.string(),
4378
- async: import_v418.z.boolean().nullish(),
4379
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4380
- namespace: import_v418.z.string().nullish()
4698
+ import_v419.z.object({
4699
+ type: import_v419.z.literal("function_call"),
4700
+ id: import_v419.z.string(),
4701
+ call_id: import_v419.z.string(),
4702
+ name: import_v419.z.string(),
4703
+ arguments: import_v419.z.string(),
4704
+ async: import_v419.z.boolean().nullish(),
4705
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4706
+ namespace: import_v419.z.string().nullish()
4381
4707
  }),
4382
- import_v418.z.object({
4383
- type: import_v418.z.literal("custom_tool_call"),
4384
- id: import_v418.z.string(),
4385
- call_id: import_v418.z.string(),
4386
- name: import_v418.z.string(),
4387
- input: import_v418.z.string(),
4388
- async: import_v418.z.boolean().nullish(),
4389
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"])
4708
+ import_v419.z.object({
4709
+ type: import_v419.z.literal("custom_tool_call"),
4710
+ id: import_v419.z.string(),
4711
+ call_id: import_v419.z.string(),
4712
+ name: import_v419.z.string(),
4713
+ input: import_v419.z.string(),
4714
+ async: import_v419.z.boolean().nullish(),
4715
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"])
4390
4716
  }),
4391
- import_v418.z.object({
4392
- type: import_v418.z.literal("code_interpreter_call"),
4393
- id: import_v418.z.string(),
4394
- code: import_v418.z.string().nullable(),
4395
- container_id: import_v418.z.string(),
4396
- outputs: import_v418.z.array(
4397
- import_v418.z.discriminatedUnion("type", [
4398
- import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
4399
- import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
4717
+ import_v419.z.object({
4718
+ type: import_v419.z.literal("code_interpreter_call"),
4719
+ id: import_v419.z.string(),
4720
+ code: import_v419.z.string().nullable(),
4721
+ container_id: import_v419.z.string(),
4722
+ outputs: import_v419.z.array(
4723
+ import_v419.z.discriminatedUnion("type", [
4724
+ import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
4725
+ import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
4400
4726
  ])
4401
4727
  ).nullable()
4402
4728
  }),
4403
- import_v418.z.object({
4404
- type: import_v418.z.literal("image_generation_call"),
4405
- id: import_v418.z.string(),
4406
- result: import_v418.z.string()
4729
+ import_v419.z.object({
4730
+ type: import_v419.z.literal("image_generation_call"),
4731
+ id: import_v419.z.string(),
4732
+ result: import_v419.z.string()
4407
4733
  }),
4408
- import_v418.z.object({
4409
- type: import_v418.z.literal("web_search_call"),
4410
- id: import_v418.z.string(),
4411
- status: import_v418.z.string(),
4412
- action: import_v418.z.discriminatedUnion("type", [
4413
- import_v418.z.object({
4414
- type: import_v418.z.literal("search"),
4415
- query: import_v418.z.string().nullish(),
4416
- queries: import_v418.z.array(import_v418.z.string()).nullish(),
4417
- sources: import_v418.z.array(
4418
- import_v418.z.discriminatedUnion("type", [
4419
- import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
4420
- import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
4734
+ import_v419.z.object({
4735
+ type: import_v419.z.literal("web_search_call"),
4736
+ id: import_v419.z.string(),
4737
+ status: import_v419.z.string(),
4738
+ action: import_v419.z.discriminatedUnion("type", [
4739
+ import_v419.z.object({
4740
+ type: import_v419.z.literal("search"),
4741
+ query: import_v419.z.string().nullish(),
4742
+ queries: import_v419.z.array(import_v419.z.string()).nullish(),
4743
+ sources: import_v419.z.array(
4744
+ import_v419.z.discriminatedUnion("type", [
4745
+ import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
4746
+ import_v419.z.object({ type: import_v419.z.literal("api"), name: import_v419.z.string() })
4421
4747
  ])
4422
4748
  ).nullish()
4423
4749
  }),
4424
- import_v418.z.object({
4425
- type: import_v418.z.literal("open_page"),
4426
- url: import_v418.z.string().nullish()
4750
+ import_v419.z.object({
4751
+ type: import_v419.z.literal("open_page"),
4752
+ url: import_v419.z.string().nullish()
4427
4753
  }),
4428
- import_v418.z.object({
4429
- type: import_v418.z.literal("find_in_page"),
4430
- url: import_v418.z.string().nullish(),
4431
- pattern: import_v418.z.string().nullish()
4754
+ import_v419.z.object({
4755
+ type: import_v419.z.literal("find_in_page"),
4756
+ url: import_v419.z.string().nullish(),
4757
+ pattern: import_v419.z.string().nullish()
4432
4758
  })
4433
4759
  ]).nullish()
4434
4760
  }),
4435
- import_v418.z.object({
4436
- type: import_v418.z.literal("file_search_call"),
4437
- id: import_v418.z.string(),
4438
- queries: import_v418.z.array(import_v418.z.string()),
4439
- results: import_v418.z.array(
4440
- import_v418.z.object({
4441
- attributes: import_v418.z.record(
4442
- import_v418.z.string(),
4443
- import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
4761
+ import_v419.z.object({
4762
+ type: import_v419.z.literal("file_search_call"),
4763
+ id: import_v419.z.string(),
4764
+ queries: import_v419.z.array(import_v419.z.string()),
4765
+ results: import_v419.z.array(
4766
+ import_v419.z.object({
4767
+ attributes: import_v419.z.record(
4768
+ import_v419.z.string(),
4769
+ import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
4444
4770
  ),
4445
- file_id: import_v418.z.string(),
4446
- filename: import_v418.z.string(),
4447
- score: import_v418.z.number(),
4448
- text: import_v418.z.string()
4771
+ file_id: import_v419.z.string(),
4772
+ filename: import_v419.z.string(),
4773
+ score: import_v419.z.number(),
4774
+ text: import_v419.z.string()
4449
4775
  })
4450
4776
  ).nullish()
4451
4777
  }),
4452
4778
  openaiResponsesLocalShellCallSchema,
4453
- import_v418.z.object({
4454
- type: import_v418.z.literal("computer_call"),
4455
- id: import_v418.z.string(),
4456
- status: import_v418.z.literal("completed")
4779
+ import_v419.z.object({
4780
+ type: import_v419.z.literal("computer_call"),
4781
+ id: import_v419.z.string(),
4782
+ status: import_v419.z.literal("completed")
4457
4783
  }),
4458
- import_v418.z.object({
4459
- type: import_v418.z.literal("mcp_call"),
4460
- id: import_v418.z.string(),
4461
- status: import_v418.z.string(),
4462
- arguments: import_v418.z.string(),
4463
- name: import_v418.z.string(),
4464
- server_label: import_v418.z.string(),
4465
- output: import_v418.z.string().nullish(),
4466
- error: import_v418.z.union([
4467
- import_v418.z.string(),
4468
- import_v418.z.object({
4469
- type: import_v418.z.string().optional(),
4470
- code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
4471
- message: import_v418.z.string().optional()
4784
+ import_v419.z.object({
4785
+ type: import_v419.z.literal("mcp_call"),
4786
+ id: import_v419.z.string(),
4787
+ status: import_v419.z.string(),
4788
+ arguments: import_v419.z.string(),
4789
+ name: import_v419.z.string(),
4790
+ server_label: import_v419.z.string(),
4791
+ output: import_v419.z.string().nullish(),
4792
+ error: import_v419.z.union([
4793
+ import_v419.z.string(),
4794
+ import_v419.z.object({
4795
+ type: import_v419.z.string().optional(),
4796
+ code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
4797
+ message: import_v419.z.string().optional()
4472
4798
  }).loose()
4473
4799
  ]).nullish(),
4474
- approval_request_id: import_v418.z.string().nullish()
4800
+ approval_request_id: import_v419.z.string().nullish()
4475
4801
  }),
4476
- import_v418.z.object({
4477
- type: import_v418.z.literal("mcp_list_tools"),
4478
- id: import_v418.z.string(),
4479
- server_label: import_v418.z.string(),
4480
- tools: import_v418.z.array(
4481
- import_v418.z.object({
4482
- name: import_v418.z.string(),
4483
- description: import_v418.z.string().optional(),
4484
- input_schema: import_v418.z.any(),
4485
- annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
4802
+ import_v419.z.object({
4803
+ type: import_v419.z.literal("mcp_list_tools"),
4804
+ id: import_v419.z.string(),
4805
+ server_label: import_v419.z.string(),
4806
+ tools: import_v419.z.array(
4807
+ import_v419.z.object({
4808
+ name: import_v419.z.string(),
4809
+ description: import_v419.z.string().optional(),
4810
+ input_schema: import_v419.z.any(),
4811
+ annotations: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()).optional()
4486
4812
  })
4487
4813
  ),
4488
- error: import_v418.z.union([
4489
- import_v418.z.string(),
4490
- import_v418.z.object({
4491
- type: import_v418.z.string().optional(),
4492
- code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
4493
- message: import_v418.z.string().optional()
4814
+ error: import_v419.z.union([
4815
+ import_v419.z.string(),
4816
+ import_v419.z.object({
4817
+ type: import_v419.z.string().optional(),
4818
+ code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
4819
+ message: import_v419.z.string().optional()
4494
4820
  }).loose()
4495
4821
  ]).optional()
4496
4822
  }),
4497
- import_v418.z.object({
4498
- type: import_v418.z.literal("mcp_approval_request"),
4499
- id: import_v418.z.string(),
4500
- server_label: import_v418.z.string(),
4501
- name: import_v418.z.string(),
4502
- arguments: import_v418.z.string(),
4503
- approval_request_id: import_v418.z.string().optional()
4823
+ import_v419.z.object({
4824
+ type: import_v419.z.literal("mcp_approval_request"),
4825
+ id: import_v419.z.string(),
4826
+ server_label: import_v419.z.string(),
4827
+ name: import_v419.z.string(),
4828
+ arguments: import_v419.z.string(),
4829
+ approval_request_id: import_v419.z.string().optional()
4504
4830
  }),
4505
- import_v418.z.object({
4506
- type: import_v418.z.literal("apply_patch_call"),
4507
- id: import_v418.z.string(),
4508
- call_id: import_v418.z.string(),
4509
- status: import_v418.z.enum(["in_progress", "completed"]),
4510
- operation: import_v418.z.discriminatedUnion("type", [
4511
- import_v418.z.object({
4512
- type: import_v418.z.literal("create_file"),
4513
- path: import_v418.z.string(),
4514
- diff: import_v418.z.string()
4831
+ import_v419.z.object({
4832
+ type: import_v419.z.literal("apply_patch_call"),
4833
+ id: import_v419.z.string(),
4834
+ call_id: import_v419.z.string(),
4835
+ status: import_v419.z.enum(["in_progress", "completed"]),
4836
+ operation: import_v419.z.discriminatedUnion("type", [
4837
+ import_v419.z.object({
4838
+ type: import_v419.z.literal("create_file"),
4839
+ path: import_v419.z.string(),
4840
+ diff: import_v419.z.string()
4515
4841
  }),
4516
- import_v418.z.object({
4517
- type: import_v418.z.literal("delete_file"),
4518
- path: import_v418.z.string()
4842
+ import_v419.z.object({
4843
+ type: import_v419.z.literal("delete_file"),
4844
+ path: import_v419.z.string()
4519
4845
  }),
4520
- import_v418.z.object({
4521
- type: import_v418.z.literal("update_file"),
4522
- path: import_v418.z.string(),
4523
- diff: import_v418.z.string()
4846
+ import_v419.z.object({
4847
+ type: import_v419.z.literal("update_file"),
4848
+ path: import_v419.z.string(),
4849
+ diff: import_v419.z.string()
4524
4850
  })
4525
4851
  ])
4526
4852
  }),
4527
- import_v418.z.object({
4528
- type: import_v418.z.literal("shell_call"),
4529
- id: import_v418.z.string(),
4530
- call_id: import_v418.z.string(),
4531
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4532
- action: import_v418.z.object({
4533
- commands: import_v418.z.array(import_v418.z.string())
4853
+ import_v419.z.object({
4854
+ type: import_v419.z.literal("shell_call"),
4855
+ id: import_v419.z.string(),
4856
+ call_id: import_v419.z.string(),
4857
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4858
+ action: import_v419.z.object({
4859
+ commands: import_v419.z.array(import_v419.z.string())
4534
4860
  })
4535
4861
  }),
4536
- import_v418.z.object({
4537
- type: import_v418.z.literal("shell_call_output"),
4538
- id: import_v418.z.string(),
4539
- call_id: import_v418.z.string(),
4540
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4541
- output: import_v418.z.array(
4542
- import_v418.z.object({
4543
- stdout: import_v418.z.string(),
4544
- stderr: import_v418.z.string(),
4545
- outcome: import_v418.z.discriminatedUnion("type", [
4546
- import_v418.z.object({ type: import_v418.z.literal("timeout") }),
4547
- import_v418.z.object({
4548
- type: import_v418.z.literal("exit"),
4549
- exit_code: import_v418.z.number()
4862
+ import_v419.z.object({
4863
+ type: import_v419.z.literal("shell_call_output"),
4864
+ id: import_v419.z.string(),
4865
+ call_id: import_v419.z.string(),
4866
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4867
+ output: import_v419.z.array(
4868
+ import_v419.z.object({
4869
+ stdout: import_v419.z.string(),
4870
+ stderr: import_v419.z.string(),
4871
+ outcome: import_v419.z.discriminatedUnion("type", [
4872
+ import_v419.z.object({ type: import_v419.z.literal("timeout") }),
4873
+ import_v419.z.object({
4874
+ type: import_v419.z.literal("exit"),
4875
+ exit_code: import_v419.z.number()
4550
4876
  })
4551
4877
  ])
4552
4878
  })
4553
4879
  )
4554
4880
  }),
4555
- import_v418.z.object({
4556
- type: import_v418.z.literal("tool_search_call"),
4557
- id: import_v418.z.string(),
4558
- execution: import_v418.z.enum(["server", "client"]),
4559
- call_id: import_v418.z.string().nullable(),
4560
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4561
- arguments: import_v418.z.unknown()
4881
+ import_v419.z.object({
4882
+ type: import_v419.z.literal("tool_search_call"),
4883
+ id: import_v419.z.string(),
4884
+ execution: import_v419.z.enum(["server", "client"]),
4885
+ call_id: import_v419.z.string().nullable(),
4886
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4887
+ arguments: import_v419.z.unknown()
4562
4888
  }),
4563
- import_v418.z.object({
4564
- type: import_v418.z.literal("tool_search_output"),
4565
- id: import_v418.z.string(),
4566
- execution: import_v418.z.enum(["server", "client"]),
4567
- call_id: import_v418.z.string().nullable(),
4568
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4569
- tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
4889
+ import_v419.z.object({
4890
+ type: import_v419.z.literal("tool_search_output"),
4891
+ id: import_v419.z.string(),
4892
+ execution: import_v419.z.enum(["server", "client"]),
4893
+ call_id: import_v419.z.string().nullable(),
4894
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
4895
+ tools: import_v419.z.array(import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional()))
4570
4896
  })
4571
4897
  ])
4572
4898
  }),
4573
- import_v418.z.object({
4574
- type: import_v418.z.literal("response.function_call_arguments.delta"),
4575
- item_id: import_v418.z.string(),
4576
- output_index: import_v418.z.number(),
4577
- delta: import_v418.z.string()
4899
+ import_v419.z.object({
4900
+ type: import_v419.z.literal("response.function_call_arguments.delta"),
4901
+ item_id: import_v419.z.string(),
4902
+ output_index: import_v419.z.number(),
4903
+ delta: import_v419.z.string()
4578
4904
  }),
4579
- import_v418.z.object({
4905
+ import_v419.z.object({
4580
4906
  // `name` is documented as required but omitted from live API events:
4581
4907
  // https://github.com/openai/openai-openapi/issues/545
4582
- type: import_v418.z.literal("response.function_call_arguments.done"),
4583
- item_id: import_v418.z.string(),
4584
- output_index: import_v418.z.number(),
4585
- arguments: import_v418.z.string()
4908
+ type: import_v419.z.literal("response.function_call_arguments.done"),
4909
+ item_id: import_v419.z.string(),
4910
+ output_index: import_v419.z.number(),
4911
+ arguments: import_v419.z.string()
4586
4912
  }),
4587
- import_v418.z.object({
4588
- type: import_v418.z.literal("response.custom_tool_call_input.delta"),
4589
- item_id: import_v418.z.string(),
4590
- output_index: import_v418.z.number(),
4591
- delta: import_v418.z.string()
4913
+ import_v419.z.object({
4914
+ type: import_v419.z.literal("response.custom_tool_call_input.delta"),
4915
+ item_id: import_v419.z.string(),
4916
+ output_index: import_v419.z.number(),
4917
+ delta: import_v419.z.string()
4592
4918
  }),
4593
- import_v418.z.object({
4594
- type: import_v418.z.literal("response.image_generation_call.partial_image"),
4595
- item_id: import_v418.z.string(),
4596
- output_index: import_v418.z.number(),
4597
- partial_image_b64: import_v418.z.string()
4919
+ import_v419.z.object({
4920
+ type: import_v419.z.literal("response.image_generation_call.partial_image"),
4921
+ item_id: import_v419.z.string(),
4922
+ output_index: import_v419.z.number(),
4923
+ partial_image_b64: import_v419.z.string()
4598
4924
  }),
4599
- import_v418.z.object({
4600
- type: import_v418.z.literal("response.code_interpreter_call_code.delta"),
4601
- item_id: import_v418.z.string(),
4602
- output_index: import_v418.z.number(),
4603
- delta: import_v418.z.string()
4925
+ import_v419.z.object({
4926
+ type: import_v419.z.literal("response.code_interpreter_call_code.delta"),
4927
+ item_id: import_v419.z.string(),
4928
+ output_index: import_v419.z.number(),
4929
+ delta: import_v419.z.string()
4604
4930
  }),
4605
- import_v418.z.object({
4606
- type: import_v418.z.literal("response.code_interpreter_call_code.done"),
4607
- item_id: import_v418.z.string(),
4608
- output_index: import_v418.z.number(),
4609
- code: import_v418.z.string()
4931
+ import_v419.z.object({
4932
+ type: import_v419.z.literal("response.code_interpreter_call_code.done"),
4933
+ item_id: import_v419.z.string(),
4934
+ output_index: import_v419.z.number(),
4935
+ code: import_v419.z.string()
4610
4936
  }),
4611
- import_v418.z.object({
4612
- type: import_v418.z.literal("response.output_text.annotation.added"),
4613
- annotation: import_v418.z.discriminatedUnion("type", [
4614
- import_v418.z.object({
4615
- type: import_v418.z.literal("url_citation"),
4616
- start_index: import_v418.z.number(),
4617
- end_index: import_v418.z.number(),
4618
- url: import_v418.z.string(),
4619
- title: import_v418.z.string()
4937
+ import_v419.z.object({
4938
+ type: import_v419.z.literal("response.output_text.annotation.added"),
4939
+ annotation: import_v419.z.discriminatedUnion("type", [
4940
+ import_v419.z.object({
4941
+ type: import_v419.z.literal("url_citation"),
4942
+ start_index: import_v419.z.number(),
4943
+ end_index: import_v419.z.number(),
4944
+ url: import_v419.z.string(),
4945
+ title: import_v419.z.string()
4620
4946
  }),
4621
- import_v418.z.object({
4622
- type: import_v418.z.literal("file_citation"),
4623
- file_id: import_v418.z.string(),
4624
- filename: import_v418.z.string(),
4625
- index: import_v418.z.number()
4947
+ import_v419.z.object({
4948
+ type: import_v419.z.literal("file_citation"),
4949
+ file_id: import_v419.z.string(),
4950
+ filename: import_v419.z.string(),
4951
+ index: import_v419.z.number()
4626
4952
  }),
4627
- import_v418.z.object({
4628
- type: import_v418.z.literal("container_file_citation"),
4629
- container_id: import_v418.z.string(),
4630
- file_id: import_v418.z.string(),
4631
- filename: import_v418.z.string(),
4632
- start_index: import_v418.z.number(),
4633
- end_index: import_v418.z.number()
4953
+ import_v419.z.object({
4954
+ type: import_v419.z.literal("container_file_citation"),
4955
+ container_id: import_v419.z.string(),
4956
+ file_id: import_v419.z.string(),
4957
+ filename: import_v419.z.string(),
4958
+ start_index: import_v419.z.number(),
4959
+ end_index: import_v419.z.number()
4634
4960
  }),
4635
- import_v418.z.object({
4636
- type: import_v418.z.literal("file_path"),
4637
- file_id: import_v418.z.string(),
4638
- index: import_v418.z.number()
4961
+ import_v419.z.object({
4962
+ type: import_v419.z.literal("file_path"),
4963
+ file_id: import_v419.z.string(),
4964
+ index: import_v419.z.number()
4639
4965
  })
4640
4966
  ])
4641
4967
  }),
4642
- import_v418.z.object({
4643
- type: import_v418.z.literal("response.reasoning_summary_part.added"),
4644
- item_id: import_v418.z.string(),
4645
- summary_index: import_v418.z.number()
4968
+ import_v419.z.object({
4969
+ type: import_v419.z.literal("response.reasoning_summary_part.added"),
4970
+ item_id: import_v419.z.string(),
4971
+ summary_index: import_v419.z.number()
4646
4972
  }),
4647
- import_v418.z.object({
4648
- type: import_v418.z.literal("response.reasoning_summary_text.delta"),
4649
- item_id: import_v418.z.string(),
4650
- summary_index: import_v418.z.number(),
4651
- delta: import_v418.z.string()
4973
+ import_v419.z.object({
4974
+ type: import_v419.z.literal("response.reasoning_summary_text.delta"),
4975
+ item_id: import_v419.z.string(),
4976
+ summary_index: import_v419.z.number(),
4977
+ delta: import_v419.z.string()
4652
4978
  }),
4653
- import_v418.z.object({
4654
- type: import_v418.z.literal("response.reasoning_summary_part.done"),
4655
- item_id: import_v418.z.string(),
4656
- summary_index: import_v418.z.number()
4657
- }),
4658
- import_v418.z.object({
4659
- type: import_v418.z.literal("response.apply_patch_call_operation_diff.delta"),
4660
- item_id: import_v418.z.string(),
4661
- output_index: import_v418.z.number(),
4662
- delta: import_v418.z.string(),
4663
- obfuscation: import_v418.z.string().nullish()
4664
- }),
4665
- import_v418.z.object({
4666
- type: import_v418.z.literal("response.apply_patch_call_operation_diff.done"),
4667
- item_id: import_v418.z.string(),
4668
- output_index: import_v418.z.number(),
4669
- diff: import_v418.z.string()
4670
- }),
4671
- openaiResponsesNestedErrorChunkSchema,
4672
- openaiResponsesErrorChunkSchema,
4673
- import_v418.z.object({ type: import_v418.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
4674
- message: "Known response chunk failed schema validation"
4675
- }).transform((value) => ({
4676
- type: "unknown_chunk",
4677
- message: value.type
4678
- }))
4679
- // fallback for unknown chunks
4680
- ])
4681
- )
4682
- );
4683
- var openaiResponsesResponseSchema = (0, import_provider_utils26.lazySchema)(
4684
- () => (0, import_provider_utils26.zodSchema)(
4685
- import_v418.z.object({
4686
- id: import_v418.z.string().optional(),
4687
- created_at: import_v418.z.number().optional(),
4688
- error: import_v418.z.object({
4689
- message: import_v418.z.string(),
4690
- type: import_v418.z.string(),
4691
- param: import_v418.z.string().nullish(),
4692
- code: import_v418.z.string()
4693
- }).nullish(),
4694
- model: import_v418.z.string().optional(),
4695
- output: import_v418.z.array(
4696
- import_v418.z.discriminatedUnion("type", [
4697
- import_v418.z.object({
4698
- type: import_v418.z.literal("message"),
4699
- role: import_v418.z.literal("assistant"),
4700
- id: import_v418.z.string(),
4701
- phase: import_v418.z.enum(["commentary", "final_answer"]).nullish(),
4702
- content: import_v418.z.array(
4703
- import_v418.z.object({
4704
- type: import_v418.z.literal("output_text"),
4705
- text: import_v418.z.string(),
4706
- logprobs: import_v418.z.array(
4707
- import_v418.z.object({
4708
- token: import_v418.z.string(),
4709
- logprob: import_v418.z.number(),
4710
- top_logprobs: import_v418.z.array(
4711
- import_v418.z.object({
4712
- token: import_v418.z.string(),
4713
- logprob: import_v418.z.number()
4714
- })
4715
- )
4716
- })
4717
- ).nullish(),
4718
- annotations: import_v418.z.array(
4719
- import_v418.z.discriminatedUnion("type", [
4720
- import_v418.z.object({
4721
- type: import_v418.z.literal("url_citation"),
4722
- start_index: import_v418.z.number(),
4723
- end_index: import_v418.z.number(),
4724
- url: import_v418.z.string(),
4725
- title: import_v418.z.string()
4726
- }),
4727
- import_v418.z.object({
4728
- type: import_v418.z.literal("file_citation"),
4729
- file_id: import_v418.z.string(),
4730
- filename: import_v418.z.string(),
4731
- index: import_v418.z.number()
4732
- }),
4733
- import_v418.z.object({
4734
- type: import_v418.z.literal("container_file_citation"),
4735
- container_id: import_v418.z.string(),
4736
- file_id: import_v418.z.string(),
4737
- filename: import_v418.z.string(),
4738
- start_index: import_v418.z.number(),
4739
- end_index: import_v418.z.number()
4740
- }),
4741
- import_v418.z.object({
4742
- type: import_v418.z.literal("file_path"),
4743
- file_id: import_v418.z.string(),
4744
- index: import_v418.z.number()
4745
- })
4746
- ])
4747
- )
4748
- })
4749
- )
4750
- }),
4751
- import_v418.z.object({
4752
- type: import_v418.z.literal("web_search_call"),
4753
- id: import_v418.z.string(),
4754
- status: import_v418.z.string(),
4755
- action: import_v418.z.discriminatedUnion("type", [
4756
- import_v418.z.object({
4757
- type: import_v418.z.literal("search"),
4758
- query: import_v418.z.string().nullish(),
4759
- queries: import_v418.z.array(import_v418.z.string()).nullish(),
4760
- sources: import_v418.z.array(
4761
- import_v418.z.discriminatedUnion("type", [
4762
- import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
4763
- import_v418.z.object({
4764
- type: import_v418.z.literal("api"),
4765
- name: import_v418.z.string()
4766
- })
4767
- ])
4768
- ).nullish()
4769
- }),
4770
- import_v418.z.object({
4771
- type: import_v418.z.literal("open_page"),
4772
- url: import_v418.z.string().nullish()
4773
- }),
4774
- import_v418.z.object({
4775
- type: import_v418.z.literal("find_in_page"),
4776
- url: import_v418.z.string().nullish(),
4777
- pattern: import_v418.z.string().nullish()
4778
- })
4779
- ]).nullish()
4780
- }),
4781
- import_v418.z.object({
4782
- type: import_v418.z.literal("file_search_call"),
4783
- id: import_v418.z.string(),
4784
- queries: import_v418.z.array(import_v418.z.string()),
4785
- results: import_v418.z.array(
4786
- import_v418.z.object({
4787
- attributes: import_v418.z.record(
4788
- import_v418.z.string(),
4789
- import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
4790
- ),
4791
- file_id: import_v418.z.string(),
4792
- filename: import_v418.z.string(),
4793
- score: import_v418.z.number(),
4794
- text: import_v418.z.string()
4795
- })
4796
- ).nullish()
4797
- }),
4798
- import_v418.z.object({
4799
- type: import_v418.z.literal("code_interpreter_call"),
4800
- id: import_v418.z.string(),
4801
- code: import_v418.z.string().nullable(),
4802
- container_id: import_v418.z.string(),
4803
- outputs: import_v418.z.array(
4804
- import_v418.z.discriminatedUnion("type", [
4805
- import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
4806
- import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
4807
- ])
4808
- ).nullable()
4809
- }),
4810
- import_v418.z.object({
4811
- type: import_v418.z.literal("image_generation_call"),
4812
- id: import_v418.z.string(),
4813
- result: import_v418.z.string()
4814
- }),
4815
- openaiResponsesLocalShellCallSchema,
4816
- import_v418.z.object({
4817
- type: import_v418.z.literal("function_call"),
4818
- call_id: import_v418.z.string(),
4819
- name: import_v418.z.string(),
4820
- arguments: import_v418.z.string(),
4821
- id: import_v418.z.string(),
4822
- async: import_v418.z.boolean().nullish(),
4823
- namespace: import_v418.z.string().nullish()
4824
- }),
4825
- import_v418.z.object({
4826
- type: import_v418.z.literal("custom_tool_call"),
4827
- call_id: import_v418.z.string(),
4828
- name: import_v418.z.string(),
4829
- input: import_v418.z.string(),
4830
- id: import_v418.z.string(),
4831
- async: import_v418.z.boolean().nullish()
4832
- }),
4833
- import_v418.z.object({
4834
- type: import_v418.z.literal("computer_call"),
4835
- id: import_v418.z.string(),
4836
- status: import_v418.z.string().optional()
4837
- }),
4838
- import_v418.z.object({
4839
- type: import_v418.z.literal("reasoning"),
4840
- id: import_v418.z.string(),
4841
- encrypted_content: import_v418.z.string().nullish(),
4842
- summary: import_v418.z.array(
4843
- import_v418.z.object({
4844
- type: import_v418.z.literal("summary_text"),
4845
- text: import_v418.z.string()
4846
- })
4847
- )
4848
- }),
4849
- import_v418.z.object({
4850
- type: import_v418.z.literal("mcp_call"),
4851
- id: import_v418.z.string(),
4852
- status: import_v418.z.string(),
4853
- arguments: import_v418.z.string(),
4854
- name: import_v418.z.string(),
4855
- server_label: import_v418.z.string(),
4856
- output: import_v418.z.string().nullish(),
4857
- error: import_v418.z.union([
4858
- import_v418.z.string(),
4859
- import_v418.z.object({
4860
- type: import_v418.z.string().optional(),
4861
- code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
4862
- message: import_v418.z.string().optional()
4863
- }).loose()
4864
- ]).nullish(),
4865
- approval_request_id: import_v418.z.string().nullish()
4866
- }),
4867
- import_v418.z.object({
4868
- type: import_v418.z.literal("mcp_list_tools"),
4869
- id: import_v418.z.string(),
4870
- server_label: import_v418.z.string(),
4871
- tools: import_v418.z.array(
4872
- import_v418.z.object({
4873
- name: import_v418.z.string(),
4874
- description: import_v418.z.string().optional(),
4875
- input_schema: import_v418.z.any(),
4876
- annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
4877
- })
4878
- ),
4879
- error: import_v418.z.union([
4880
- import_v418.z.string(),
4881
- import_v418.z.object({
4882
- type: import_v418.z.string().optional(),
4883
- code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
4884
- message: import_v418.z.string().optional()
4885
- }).loose()
4886
- ]).optional()
4887
- }),
4888
- import_v418.z.object({
4889
- type: import_v418.z.literal("mcp_approval_request"),
4890
- id: import_v418.z.string(),
4891
- server_label: import_v418.z.string(),
4892
- name: import_v418.z.string(),
4893
- arguments: import_v418.z.string(),
4894
- approval_request_id: import_v418.z.string().optional()
4895
- }),
4896
- import_v418.z.object({
4897
- type: import_v418.z.literal("apply_patch_call"),
4898
- id: import_v418.z.string(),
4899
- call_id: import_v418.z.string(),
4900
- status: import_v418.z.enum(["in_progress", "completed"]),
4901
- operation: import_v418.z.discriminatedUnion("type", [
4902
- import_v418.z.object({
4903
- type: import_v418.z.literal("create_file"),
4904
- path: import_v418.z.string(),
4905
- diff: import_v418.z.string()
4906
- }),
4907
- import_v418.z.object({
4908
- type: import_v418.z.literal("delete_file"),
4909
- path: import_v418.z.string()
4910
- }),
4911
- import_v418.z.object({
4912
- type: import_v418.z.literal("update_file"),
4913
- path: import_v418.z.string(),
4914
- diff: import_v418.z.string()
4915
- })
4916
- ])
4917
- }),
4918
- import_v418.z.object({
4919
- type: import_v418.z.literal("shell_call"),
4920
- id: import_v418.z.string(),
4921
- call_id: import_v418.z.string(),
4922
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4923
- action: import_v418.z.object({
4924
- commands: import_v418.z.array(import_v418.z.string())
4925
- })
4926
- }),
4927
- import_v418.z.object({
4928
- type: import_v418.z.literal("shell_call_output"),
4929
- id: import_v418.z.string(),
4930
- call_id: import_v418.z.string(),
4931
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4932
- output: import_v418.z.array(
4933
- import_v418.z.object({
4934
- stdout: import_v418.z.string(),
4935
- stderr: import_v418.z.string(),
4936
- outcome: import_v418.z.discriminatedUnion("type", [
4937
- import_v418.z.object({ type: import_v418.z.literal("timeout") }),
4938
- import_v418.z.object({
4939
- type: import_v418.z.literal("exit"),
4940
- exit_code: import_v418.z.number()
4941
- })
4942
- ])
4943
- })
4944
- )
4945
- }),
4946
- import_v418.z.object({
4947
- type: import_v418.z.literal("tool_search_call"),
4948
- id: import_v418.z.string(),
4949
- execution: import_v418.z.enum(["server", "client"]),
4950
- call_id: import_v418.z.string().nullable(),
4951
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4952
- arguments: import_v418.z.unknown()
4953
- }),
4954
- import_v418.z.object({
4955
- type: import_v418.z.literal("tool_search_output"),
4956
- id: import_v418.z.string(),
4957
- execution: import_v418.z.enum(["server", "client"]),
4958
- call_id: import_v418.z.string().nullable(),
4959
- status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
4960
- tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
4961
- })
4962
- ])
4963
- ).optional(),
4964
- service_tier: import_v418.z.string().nullish(),
4965
- reasoning: import_v418.z.object({
4966
- context: import_v418.z.string().nullish()
4967
- }).nullish(),
4968
- incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
4969
- usage: openaiResponsesUsageSchema.nullish()
4970
- })
4971
- )
4972
- );
4973
-
4974
- // src/responses/openai-responses-options.ts
4975
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
4976
- var import_v419 = require("zod/v4");
4977
- var TOP_LOGPROBS_MAX = 20;
4978
- var openaiResponsesReasoningModelIds = [
4979
- "o1",
4980
- "o1-2024-12-17",
4981
- "o3",
4982
- "o3-2025-04-16",
4983
- "o3-mini",
4984
- "o3-mini-2025-01-31",
4985
- "o4-mini",
4986
- "o4-mini-2025-04-16",
4987
- "gpt-5",
4988
- "gpt-5-2025-08-07",
4989
- "gpt-5-codex",
4990
- "gpt-5-mini",
4991
- "gpt-5-mini-2025-08-07",
4992
- "gpt-5-nano",
4993
- "gpt-5-nano-2025-08-07",
4994
- "gpt-5-pro",
4995
- "gpt-5-pro-2025-10-06",
4996
- "gpt-5.1",
4997
- "gpt-5.1-chat-latest",
4998
- "gpt-5.1-codex-mini",
4999
- "gpt-5.1-codex",
5000
- "gpt-5.1-codex-max",
5001
- "gpt-5.2",
5002
- "gpt-5.2-chat-latest",
5003
- "gpt-5.2-pro",
5004
- "gpt-5.2-codex",
5005
- "gpt-5.3-chat-latest",
5006
- "gpt-5.3-codex",
5007
- "gpt-5.4",
5008
- "gpt-5.4-2026-03-05",
5009
- "gpt-5.4-mini",
5010
- "gpt-5.4-mini-2026-03-17",
5011
- "gpt-5.4-nano",
5012
- "gpt-5.4-nano-2026-03-17",
5013
- "gpt-5.4-pro",
5014
- "gpt-5.4-pro-2026-03-05",
5015
- "gpt-5.5",
5016
- "gpt-5.5-2026-04-23",
5017
- "gpt-5.6",
5018
- "gpt-5.6-luna",
5019
- "gpt-5.6-sol",
5020
- "gpt-5.6-terra",
5021
- "gpt-6-astra",
5022
- "gpt-6-luna",
5023
- "gpt-6-sol"
5024
- ];
5025
- var openaiResponsesModelIds = [
5026
- "gpt-4.1",
5027
- "gpt-4.1-2025-04-14",
5028
- "gpt-4.1-mini",
5029
- "gpt-4.1-mini-2025-04-14",
5030
- "gpt-4.1-nano",
5031
- "gpt-4.1-nano-2025-04-14",
5032
- "gpt-4o",
5033
- "gpt-4o-2024-05-13",
5034
- "gpt-4o-2024-08-06",
5035
- "gpt-4o-2024-11-20",
5036
- "gpt-4o-audio-preview",
5037
- "gpt-4o-audio-preview-2024-12-17",
5038
- "gpt-4o-search-preview",
5039
- "gpt-4o-search-preview-2025-03-11",
5040
- "gpt-4o-mini-search-preview",
5041
- "gpt-4o-mini-search-preview-2025-03-11",
5042
- "gpt-4o-mini",
5043
- "gpt-4o-mini-2024-07-18",
5044
- "gpt-3.5-turbo-0125",
5045
- "gpt-3.5-turbo",
5046
- "gpt-3.5-turbo-1106",
5047
- "gpt-5-chat-latest",
5048
- ...openaiResponsesReasoningModelIds
5049
- ];
5050
- var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazySchema)(
4979
+ import_v419.z.object({
4980
+ type: import_v419.z.literal("response.reasoning_summary_part.done"),
4981
+ item_id: import_v419.z.string(),
4982
+ summary_index: import_v419.z.number()
4983
+ }),
4984
+ import_v419.z.object({
4985
+ type: import_v419.z.literal("response.apply_patch_call_operation_diff.delta"),
4986
+ item_id: import_v419.z.string(),
4987
+ output_index: import_v419.z.number(),
4988
+ delta: import_v419.z.string(),
4989
+ obfuscation: import_v419.z.string().nullish()
4990
+ }),
4991
+ import_v419.z.object({
4992
+ type: import_v419.z.literal("response.apply_patch_call_operation_diff.done"),
4993
+ item_id: import_v419.z.string(),
4994
+ output_index: import_v419.z.number(),
4995
+ diff: import_v419.z.string()
4996
+ }),
4997
+ openaiResponsesNestedErrorChunkSchema,
4998
+ openaiResponsesErrorChunkSchema,
4999
+ import_v419.z.object({ type: import_v419.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
5000
+ message: "Known response chunk failed schema validation"
5001
+ }).transform((value) => ({
5002
+ type: "unknown_chunk",
5003
+ message: value.type
5004
+ }))
5005
+ // fallback for unknown chunks
5006
+ ])
5007
+ )
5008
+ );
5009
+ var openaiResponsesResponseSchema = (0, import_provider_utils27.lazySchema)(
5051
5010
  () => (0, import_provider_utils27.zodSchema)(
5052
5011
  import_v419.z.object({
5053
- /**
5054
- * The ID of the OpenAI Conversation to continue.
5055
- * You must create a conversation first via the OpenAI API.
5056
- * Cannot be used in conjunction with `previousResponseId`.
5057
- * Defaults to `undefined`.
5058
- * @see https://platform.openai.com/docs/api-reference/conversations/create
5059
- */
5060
- conversation: import_v419.z.string().nullish(),
5061
- /**
5062
- * The set of extra fields to include in the response (advanced, usually not needed).
5063
- * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
5064
- */
5065
- include: import_v419.z.array(
5066
- import_v419.z.enum([
5067
- "reasoning.encrypted_content",
5068
- // handled internally by default, only needed for unknown reasoning models
5069
- "file_search_call.results",
5070
- "web_search_call.results",
5071
- "message.output_text.logprobs"
5012
+ id: import_v419.z.string().optional(),
5013
+ created_at: import_v419.z.number().optional(),
5014
+ error: import_v419.z.object({
5015
+ message: import_v419.z.string(),
5016
+ type: import_v419.z.string(),
5017
+ param: import_v419.z.string().nullish(),
5018
+ code: import_v419.z.string()
5019
+ }).nullish(),
5020
+ model: import_v419.z.string().optional(),
5021
+ output: import_v419.z.array(
5022
+ import_v419.z.discriminatedUnion("type", [
5023
+ import_v419.z.object({
5024
+ type: import_v419.z.literal("message"),
5025
+ role: import_v419.z.literal("assistant"),
5026
+ id: import_v419.z.string(),
5027
+ phase: import_v419.z.enum(["commentary", "final_answer"]).nullish(),
5028
+ content: import_v419.z.array(
5029
+ import_v419.z.object({
5030
+ type: import_v419.z.literal("output_text"),
5031
+ text: import_v419.z.string(),
5032
+ logprobs: import_v419.z.array(
5033
+ import_v419.z.object({
5034
+ token: import_v419.z.string(),
5035
+ logprob: import_v419.z.number(),
5036
+ top_logprobs: import_v419.z.array(
5037
+ import_v419.z.object({
5038
+ token: import_v419.z.string(),
5039
+ logprob: import_v419.z.number()
5040
+ })
5041
+ )
5042
+ })
5043
+ ).nullish(),
5044
+ annotations: import_v419.z.array(
5045
+ import_v419.z.discriminatedUnion("type", [
5046
+ import_v419.z.object({
5047
+ type: import_v419.z.literal("url_citation"),
5048
+ start_index: import_v419.z.number(),
5049
+ end_index: import_v419.z.number(),
5050
+ url: import_v419.z.string(),
5051
+ title: import_v419.z.string()
5052
+ }),
5053
+ import_v419.z.object({
5054
+ type: import_v419.z.literal("file_citation"),
5055
+ file_id: import_v419.z.string(),
5056
+ filename: import_v419.z.string(),
5057
+ index: import_v419.z.number()
5058
+ }),
5059
+ import_v419.z.object({
5060
+ type: import_v419.z.literal("container_file_citation"),
5061
+ container_id: import_v419.z.string(),
5062
+ file_id: import_v419.z.string(),
5063
+ filename: import_v419.z.string(),
5064
+ start_index: import_v419.z.number(),
5065
+ end_index: import_v419.z.number()
5066
+ }),
5067
+ import_v419.z.object({
5068
+ type: import_v419.z.literal("file_path"),
5069
+ file_id: import_v419.z.string(),
5070
+ index: import_v419.z.number()
5071
+ })
5072
+ ])
5073
+ )
5074
+ })
5075
+ )
5076
+ }),
5077
+ import_v419.z.object({
5078
+ type: import_v419.z.literal("web_search_call"),
5079
+ id: import_v419.z.string(),
5080
+ status: import_v419.z.string(),
5081
+ action: import_v419.z.discriminatedUnion("type", [
5082
+ import_v419.z.object({
5083
+ type: import_v419.z.literal("search"),
5084
+ query: import_v419.z.string().nullish(),
5085
+ queries: import_v419.z.array(import_v419.z.string()).nullish(),
5086
+ sources: import_v419.z.array(
5087
+ import_v419.z.discriminatedUnion("type", [
5088
+ import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
5089
+ import_v419.z.object({
5090
+ type: import_v419.z.literal("api"),
5091
+ name: import_v419.z.string()
5092
+ })
5093
+ ])
5094
+ ).nullish()
5095
+ }),
5096
+ import_v419.z.object({
5097
+ type: import_v419.z.literal("open_page"),
5098
+ url: import_v419.z.string().nullish()
5099
+ }),
5100
+ import_v419.z.object({
5101
+ type: import_v419.z.literal("find_in_page"),
5102
+ url: import_v419.z.string().nullish(),
5103
+ pattern: import_v419.z.string().nullish()
5104
+ })
5105
+ ]).nullish()
5106
+ }),
5107
+ import_v419.z.object({
5108
+ type: import_v419.z.literal("file_search_call"),
5109
+ id: import_v419.z.string(),
5110
+ queries: import_v419.z.array(import_v419.z.string()),
5111
+ results: import_v419.z.array(
5112
+ import_v419.z.object({
5113
+ attributes: import_v419.z.record(
5114
+ import_v419.z.string(),
5115
+ import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
5116
+ ),
5117
+ file_id: import_v419.z.string(),
5118
+ filename: import_v419.z.string(),
5119
+ score: import_v419.z.number(),
5120
+ text: import_v419.z.string()
5121
+ })
5122
+ ).nullish()
5123
+ }),
5124
+ import_v419.z.object({
5125
+ type: import_v419.z.literal("code_interpreter_call"),
5126
+ id: import_v419.z.string(),
5127
+ code: import_v419.z.string().nullable(),
5128
+ container_id: import_v419.z.string(),
5129
+ outputs: import_v419.z.array(
5130
+ import_v419.z.discriminatedUnion("type", [
5131
+ import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
5132
+ import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
5133
+ ])
5134
+ ).nullable()
5135
+ }),
5136
+ import_v419.z.object({
5137
+ type: import_v419.z.literal("image_generation_call"),
5138
+ id: import_v419.z.string(),
5139
+ result: import_v419.z.string()
5140
+ }),
5141
+ openaiResponsesLocalShellCallSchema,
5142
+ import_v419.z.object({
5143
+ type: import_v419.z.literal("function_call"),
5144
+ call_id: import_v419.z.string(),
5145
+ name: import_v419.z.string(),
5146
+ arguments: import_v419.z.string(),
5147
+ id: import_v419.z.string(),
5148
+ async: import_v419.z.boolean().nullish(),
5149
+ namespace: import_v419.z.string().nullish()
5150
+ }),
5151
+ import_v419.z.object({
5152
+ type: import_v419.z.literal("custom_tool_call"),
5153
+ call_id: import_v419.z.string(),
5154
+ name: import_v419.z.string(),
5155
+ input: import_v419.z.string(),
5156
+ id: import_v419.z.string(),
5157
+ async: import_v419.z.boolean().nullish()
5158
+ }),
5159
+ import_v419.z.object({
5160
+ type: import_v419.z.literal("computer_call"),
5161
+ id: import_v419.z.string(),
5162
+ status: import_v419.z.string().optional()
5163
+ }),
5164
+ import_v419.z.object({
5165
+ type: import_v419.z.literal("reasoning"),
5166
+ id: import_v419.z.string(),
5167
+ encrypted_content: import_v419.z.string().nullish(),
5168
+ summary: import_v419.z.array(
5169
+ import_v419.z.object({
5170
+ type: import_v419.z.literal("summary_text"),
5171
+ text: import_v419.z.string()
5172
+ })
5173
+ )
5174
+ }),
5175
+ import_v419.z.object({
5176
+ type: import_v419.z.literal("mcp_call"),
5177
+ id: import_v419.z.string(),
5178
+ status: import_v419.z.string(),
5179
+ arguments: import_v419.z.string(),
5180
+ name: import_v419.z.string(),
5181
+ server_label: import_v419.z.string(),
5182
+ output: import_v419.z.string().nullish(),
5183
+ error: import_v419.z.union([
5184
+ import_v419.z.string(),
5185
+ import_v419.z.object({
5186
+ type: import_v419.z.string().optional(),
5187
+ code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
5188
+ message: import_v419.z.string().optional()
5189
+ }).loose()
5190
+ ]).nullish(),
5191
+ approval_request_id: import_v419.z.string().nullish()
5192
+ }),
5193
+ import_v419.z.object({
5194
+ type: import_v419.z.literal("mcp_list_tools"),
5195
+ id: import_v419.z.string(),
5196
+ server_label: import_v419.z.string(),
5197
+ tools: import_v419.z.array(
5198
+ import_v419.z.object({
5199
+ name: import_v419.z.string(),
5200
+ description: import_v419.z.string().optional(),
5201
+ input_schema: import_v419.z.any(),
5202
+ annotations: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()).optional()
5203
+ })
5204
+ ),
5205
+ error: import_v419.z.union([
5206
+ import_v419.z.string(),
5207
+ import_v419.z.object({
5208
+ type: import_v419.z.string().optional(),
5209
+ code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
5210
+ message: import_v419.z.string().optional()
5211
+ }).loose()
5212
+ ]).optional()
5213
+ }),
5214
+ import_v419.z.object({
5215
+ type: import_v419.z.literal("mcp_approval_request"),
5216
+ id: import_v419.z.string(),
5217
+ server_label: import_v419.z.string(),
5218
+ name: import_v419.z.string(),
5219
+ arguments: import_v419.z.string(),
5220
+ approval_request_id: import_v419.z.string().optional()
5221
+ }),
5222
+ import_v419.z.object({
5223
+ type: import_v419.z.literal("apply_patch_call"),
5224
+ id: import_v419.z.string(),
5225
+ call_id: import_v419.z.string(),
5226
+ status: import_v419.z.enum(["in_progress", "completed"]),
5227
+ operation: import_v419.z.discriminatedUnion("type", [
5228
+ import_v419.z.object({
5229
+ type: import_v419.z.literal("create_file"),
5230
+ path: import_v419.z.string(),
5231
+ diff: import_v419.z.string()
5232
+ }),
5233
+ import_v419.z.object({
5234
+ type: import_v419.z.literal("delete_file"),
5235
+ path: import_v419.z.string()
5236
+ }),
5237
+ import_v419.z.object({
5238
+ type: import_v419.z.literal("update_file"),
5239
+ path: import_v419.z.string(),
5240
+ diff: import_v419.z.string()
5241
+ })
5242
+ ])
5243
+ }),
5244
+ import_v419.z.object({
5245
+ type: import_v419.z.literal("shell_call"),
5246
+ id: import_v419.z.string(),
5247
+ call_id: import_v419.z.string(),
5248
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
5249
+ action: import_v419.z.object({
5250
+ commands: import_v419.z.array(import_v419.z.string())
5251
+ })
5252
+ }),
5253
+ import_v419.z.object({
5254
+ type: import_v419.z.literal("shell_call_output"),
5255
+ id: import_v419.z.string(),
5256
+ call_id: import_v419.z.string(),
5257
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
5258
+ output: import_v419.z.array(
5259
+ import_v419.z.object({
5260
+ stdout: import_v419.z.string(),
5261
+ stderr: import_v419.z.string(),
5262
+ outcome: import_v419.z.discriminatedUnion("type", [
5263
+ import_v419.z.object({ type: import_v419.z.literal("timeout") }),
5264
+ import_v419.z.object({
5265
+ type: import_v419.z.literal("exit"),
5266
+ exit_code: import_v419.z.number()
5267
+ })
5268
+ ])
5269
+ })
5270
+ )
5271
+ }),
5272
+ import_v419.z.object({
5273
+ type: import_v419.z.literal("tool_search_call"),
5274
+ id: import_v419.z.string(),
5275
+ execution: import_v419.z.enum(["server", "client"]),
5276
+ call_id: import_v419.z.string().nullable(),
5277
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
5278
+ arguments: import_v419.z.unknown()
5279
+ }),
5280
+ import_v419.z.object({
5281
+ type: import_v419.z.literal("tool_search_output"),
5282
+ id: import_v419.z.string(),
5283
+ execution: import_v419.z.enum(["server", "client"]),
5284
+ call_id: import_v419.z.string().nullable(),
5285
+ status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
5286
+ tools: import_v419.z.array(import_v419.z.record(import_v419.z.string(), jsonValueSchema.optional()))
5287
+ })
5072
5288
  ])
5073
- ).nullish(),
5074
- /**
5075
- * Instructions for the model.
5076
- * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
5077
- * Defaults to `undefined`.
5078
- */
5079
- instructions: import_v419.z.string().nullish(),
5080
- /**
5081
- * Return the log probabilities of the tokens. Including logprobs will increase
5082
- * the response size and can slow down response times. However, it can
5083
- * be useful to better understand how the model is behaving.
5084
- *
5085
- * Setting to true will return the log probabilities of the tokens that
5086
- * were generated.
5087
- *
5088
- * Setting to a number will return the log probabilities of the top n
5089
- * tokens that were generated.
5090
- *
5091
- * @see https://platform.openai.com/docs/api-reference/responses/create
5092
- * @see https://cookbook.openai.com/examples/using_logprobs
5093
- */
5094
- logprobs: import_v419.z.union([import_v419.z.boolean(), import_v419.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
5095
- /**
5096
- * The maximum number of total calls to built-in tools that can be processed in a response.
5097
- * This maximum number applies across all built-in tool calls, not per individual tool.
5098
- * Any further attempts to call a tool by the model will be ignored.
5099
- */
5100
- maxToolCalls: import_v419.z.number().nullish(),
5101
- /**
5102
- * Additional metadata to store with the generation.
5103
- */
5104
- metadata: import_v419.z.any().nullish(),
5105
- /**
5106
- * Whether to use parallel tool calls. Defaults to `true`.
5107
- */
5108
- parallelToolCalls: import_v419.z.boolean().nullish(),
5109
- /**
5110
- * The ID of the previous response. You can use it to continue a conversation.
5111
- * Defaults to `undefined`.
5112
- */
5113
- previousResponseId: import_v419.z.string().nullish(),
5114
- /**
5115
- * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
5116
- */
5117
- promptCacheKey: import_v419.z.string().nullish(),
5118
- /**
5119
- * Prompt cache behavior for GPT-5.6 and later models.
5120
- * `mode` controls whether OpenAI also places an implicit breakpoint.
5121
- * `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
5122
- */
5123
- promptCacheOptions: import_v419.z.object({
5124
- mode: import_v419.z.enum(["implicit", "explicit"]).optional(),
5125
- ttl: import_v419.z.literal("30m").optional()
5126
- }).optional(),
5127
- /**
5128
- * The retention policy for the prompt cache.
5129
- * - 'in_memory': Default. Standard prompt caching behavior.
5130
- * - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
5131
- * Available for models before GPT-5.6 that support extended caching.
5132
- *
5133
- * @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
5134
- *
5135
- * @default 'in_memory'
5136
- */
5137
- promptCacheRetention: import_v419.z.enum(["in_memory", "24h"]).nullish(),
5138
- /**
5139
- * Reasoning effort for reasoning models. Defaults to `medium`. If you use
5140
- * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
5141
- * GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
5142
- * GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
5143
- * Supported values vary by model.
5144
- */
5145
- reasoningEffort: import_v419.z.string().nullish(),
5146
- /**
5147
- * Updates the reasoning effort for GPT-6 and later models starting with this response
5148
- * without changing the request-level reasoning effort. This preserves the
5149
- * request prefix for prompt caching.
5150
- *
5151
- * Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
5152
- * combined with automatic truncation.
5153
- */
5154
- reasoningEffortUpdate: import_v419.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
5155
- /**
5156
- * Controls how much model work GPT-5.6 performs before returning a final answer.
5157
- * `standard` is the default. `pro` increases quality, latency, and token usage.
5158
- */
5159
- reasoningMode: import_v419.z.enum(["standard", "pro"]).optional(),
5160
- /**
5161
- * Controls which available reasoning items GPT-5.6 can use.
5162
- * `auto` uses the model default, `current_turn` excludes reasoning from earlier
5163
- * turns, and `all_turns` makes compatible earlier reasoning available.
5164
- */
5165
- reasoningContext: import_v419.z.enum(["auto", "current_turn", "all_turns"]).optional(),
5166
- /**
5167
- * Controls reasoning summary output from the model.
5168
- * Set to "auto" to automatically receive the richest level available,
5169
- * or "detailed" for comprehensive summaries.
5170
- */
5171
- reasoningSummary: import_v419.z.string().nullish(),
5172
- /**
5173
- * The identifier for safety monitoring and tracking.
5174
- */
5175
- safetyIdentifier: import_v419.z.string().nullish(),
5176
- /**
5177
- * Service tier for the request.
5178
- * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
5179
- * Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
5180
- * Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
5181
- *
5182
- * Defaults to 'auto'.
5183
- */
5184
- serviceTier: import_v419.z.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
5185
- /**
5186
- * Whether to store the generation. Defaults to `true`.
5187
- */
5188
- store: import_v419.z.boolean().nullish(),
5189
- /**
5190
- * Whether to pass through non-image file types as generic input files.
5191
- *
5192
- * By default, inline file inputs are restricted to images and PDFs.
5193
- * Enable this when the target OpenAI Responses model supports additional
5194
- * file media types, such as text/csv.
5195
- */
5196
- passThroughUnsupportedFiles: import_v419.z.boolean().optional(),
5197
- /**
5198
- * Whether to use strict JSON schema validation.
5199
- * Defaults to `true`.
5200
- */
5201
- strictJsonSchema: import_v419.z.boolean().nullish(),
5202
- /**
5203
- * Controls the verbosity of the model's responses. Lower values ('low') will result
5204
- * in more concise responses, while higher values ('high') will result in more verbose responses.
5205
- * Valid values: 'low', 'medium', 'high'.
5206
- */
5207
- textVerbosity: import_v419.z.enum(["low", "medium", "high"]).nullish(),
5208
- /**
5209
- * Controls output truncation. 'auto' (default) performs truncation automatically;
5210
- * 'disabled' turns truncation off.
5211
- */
5212
- truncation: import_v419.z.enum(["auto", "disabled"]).nullish(),
5213
- /**
5214
- * A unique identifier representing your end-user, which can help OpenAI to
5215
- * monitor and detect abuse.
5216
- * Defaults to `undefined`.
5217
- * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
5218
- */
5219
- user: import_v419.z.string().nullish(),
5220
- /**
5221
- * Override the system message mode for this model.
5222
- * - 'system': Use the 'system' role for system messages (default for most models)
5223
- * - 'developer': Use the 'developer' role for system messages (used by reasoning models)
5224
- * - 'remove': Remove system messages entirely
5225
- *
5226
- * If not specified, the mode is automatically determined based on the model.
5227
- */
5228
- systemMessageMode: import_v419.z.enum(["system", "developer", "remove"]).optional(),
5229
- /**
5230
- * Force treating this model as a reasoning model.
5231
- *
5232
- * This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
5233
- * where the model ID is not recognized by the SDK's allowlist.
5234
- *
5235
- * When enabled, the SDK applies reasoning-model parameter compatibility rules
5236
- * and defaults `systemMessageMode` to `developer` unless overridden.
5237
- */
5238
- forceReasoning: import_v419.z.boolean().optional(),
5239
- /**
5240
- * Restrict the callable tools to a subset while keeping the full tools
5241
- * list intact, so prompt caching is preserved across requests with
5242
- * different allowlists.
5243
- *
5244
- * When set, this overrides the request-level `toolChoice` and emits
5245
- * `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
5246
- *
5247
- * @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
5248
- */
5249
- allowedTools: import_v419.z.object({
5250
- toolNames: import_v419.z.array(import_v419.z.string()).min(1),
5251
- mode: import_v419.z.enum(["auto", "required"]).optional()
5252
- }).optional()
5289
+ ).optional(),
5290
+ service_tier: import_v419.z.string().nullish(),
5291
+ reasoning: import_v419.z.object({
5292
+ context: import_v419.z.string().nullish()
5293
+ }).nullish(),
5294
+ incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
5295
+ usage: openaiResponsesUsageSchema.nullish()
5253
5296
  })
5254
5297
  )
5255
5298
  );
@@ -6077,6 +6120,18 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
6077
6120
  }
6078
6121
  return mapping;
6079
6122
  }
6123
+ function getConfigurationUpdateUnsupportedReason({
6124
+ modelCapabilities,
6125
+ options
6126
+ }) {
6127
+ if (!modelCapabilities.supportsConfigurationUpdate) {
6128
+ return "reasoningEffortUpdate is only supported by GPT-6 and later models";
6129
+ }
6130
+ if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
6131
+ return "reasoningEffortUpdate requires standard reasoning mode without automatic truncation";
6132
+ }
6133
+ return void 0;
6134
+ }
6080
6135
  var OpenAIResponsesLanguageModel = class {
6081
6136
  constructor(modelId, config) {
6082
6137
  this.specificationVersion = "v3";
@@ -6184,8 +6239,13 @@ var OpenAIResponsesLanguageModel = class {
6184
6239
  customProviderToolNames,
6185
6240
  supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
6186
6241
  });
6242
+ const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
6243
+ modelCapabilities,
6244
+ options: openaiOptions
6245
+ });
6187
6246
  const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
6188
6247
  prompt,
6248
+ configurationUpdateUnsupportedReason,
6189
6249
  toolNameMapping,
6190
6250
  systemMessageMode: (_c = openaiOptions == null ? void 0 : openaiOptions.systemMessageMode) != null ? _c : isReasoningModel ? "developer" : modelCapabilities.systemMessageMode,
6191
6251
  providerOptionsName,
@@ -6203,18 +6263,27 @@ var OpenAIResponsesLanguageModel = class {
6203
6263
  });
6204
6264
  warnings.push(...inputWarnings);
6205
6265
  const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;
6206
- const configurationUpdateIsSupported = reasoningEffortUpdate == null || modelCapabilities.supportsConfigurationUpdate && (openaiOptions == null ? void 0 : openaiOptions.reasoningMode) !== "pro" && (openaiOptions == null ? void 0 : openaiOptions.truncation) !== "auto";
6207
- if (reasoningEffortUpdate != null && !configurationUpdateIsSupported) {
6266
+ if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {
6208
6267
  warnings.push({
6209
6268
  type: "unsupported",
6210
6269
  feature: "reasoningEffortUpdate",
6211
- details: !modelCapabilities.supportsConfigurationUpdate ? "reasoningEffortUpdate is only supported by GPT-6 and later models" : "reasoningEffortUpdate requires standard reasoning mode without automatic truncation"
6270
+ details: configurationUpdateUnsupportedReason
6212
6271
  });
6213
6272
  } else if (reasoningEffortUpdate != null) {
6214
- input.unshift({
6215
- type: "configuration_update",
6216
- reasoning: { effort: reasoningEffortUpdate }
6217
- });
6273
+ const firstItem = input[0];
6274
+ if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
6275
+ input.unshift({
6276
+ type: "configuration_update",
6277
+ reasoning: { effort: reasoningEffortUpdate }
6278
+ });
6279
+ }
6280
+ }
6281
+ for (let i = 1; i < input.length; i++) {
6282
+ if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
6283
+ throw new import_provider10.UnsupportedFunctionalityError({
6284
+ functionality: "Adjacent reasoning effort configuration updates"
6285
+ });
6286
+ }
6218
6287
  }
6219
6288
  const strictJsonSchema = (_f = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _f : true;
6220
6289
  let include = openaiOptions == null ? void 0 : openaiOptions.include;