@ai-sdk/openai 3.0.36 → 3.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ __export(src_exports, {
27
27
  module.exports = __toCommonJS(src_exports);
28
28
 
29
29
  // src/openai-provider.ts
30
- var import_provider_utils33 = require("@ai-sdk/provider-utils");
30
+ var import_provider_utils34 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/chat/openai-chat-language-model.ts
33
33
  var import_provider3 = require("@ai-sdk/provider");
@@ -56,7 +56,7 @@ var openaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorRespo
56
56
  function getOpenAILanguageModelCapabilities(modelId) {
57
57
  const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
58
58
  const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
59
- const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("codex-mini") || modelId.startsWith("computer-use-preview") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
59
+ const isReasoningModel = modelId.startsWith("o1") || modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
60
60
  const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1") || modelId.startsWith("gpt-5.2");
61
61
  const systemMessageMode = isReasoningModel ? "developer" : "system";
62
62
  return {
@@ -2043,82 +2043,110 @@ var codeInterpreter = (args = {}) => {
2043
2043
  return codeInterpreterToolFactory(args);
2044
2044
  };
2045
2045
 
2046
- // src/tool/file-search.ts
2046
+ // src/tool/custom.ts
2047
2047
  var import_provider_utils16 = require("@ai-sdk/provider-utils");
2048
2048
  var import_v411 = require("zod/v4");
2049
- var comparisonFilterSchema = import_v411.z.object({
2050
- key: import_v411.z.string(),
2051
- type: import_v411.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2052
- value: import_v411.z.union([import_v411.z.string(), import_v411.z.number(), import_v411.z.boolean(), import_v411.z.array(import_v411.z.string())])
2049
+ var customArgsSchema = (0, import_provider_utils16.lazySchema)(
2050
+ () => (0, import_provider_utils16.zodSchema)(
2051
+ import_v411.z.object({
2052
+ name: import_v411.z.string(),
2053
+ description: import_v411.z.string().optional(),
2054
+ format: import_v411.z.union([
2055
+ import_v411.z.object({
2056
+ type: import_v411.z.literal("grammar"),
2057
+ syntax: import_v411.z.enum(["regex", "lark"]),
2058
+ definition: import_v411.z.string()
2059
+ }),
2060
+ import_v411.z.object({
2061
+ type: import_v411.z.literal("text")
2062
+ })
2063
+ ]).optional()
2064
+ })
2065
+ )
2066
+ );
2067
+ var customInputSchema = (0, import_provider_utils16.lazySchema)(() => (0, import_provider_utils16.zodSchema)(import_v411.z.string()));
2068
+ var customToolFactory = (0, import_provider_utils16.createProviderToolFactory)({
2069
+ id: "openai.custom",
2070
+ inputSchema: customInputSchema
2053
2071
  });
2054
- var compoundFilterSchema = import_v411.z.object({
2055
- type: import_v411.z.enum(["and", "or"]),
2056
- filters: import_v411.z.array(
2057
- import_v411.z.union([comparisonFilterSchema, import_v411.z.lazy(() => compoundFilterSchema)])
2072
+ var customTool = (args) => customToolFactory(args);
2073
+
2074
+ // src/tool/file-search.ts
2075
+ var import_provider_utils17 = require("@ai-sdk/provider-utils");
2076
+ var import_v412 = require("zod/v4");
2077
+ var comparisonFilterSchema = import_v412.z.object({
2078
+ key: import_v412.z.string(),
2079
+ type: import_v412.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2080
+ value: import_v412.z.union([import_v412.z.string(), import_v412.z.number(), import_v412.z.boolean(), import_v412.z.array(import_v412.z.string())])
2081
+ });
2082
+ var compoundFilterSchema = import_v412.z.object({
2083
+ type: import_v412.z.enum(["and", "or"]),
2084
+ filters: import_v412.z.array(
2085
+ import_v412.z.union([comparisonFilterSchema, import_v412.z.lazy(() => compoundFilterSchema)])
2058
2086
  )
2059
2087
  });
2060
- var fileSearchArgsSchema = (0, import_provider_utils16.lazySchema)(
2061
- () => (0, import_provider_utils16.zodSchema)(
2062
- import_v411.z.object({
2063
- vectorStoreIds: import_v411.z.array(import_v411.z.string()),
2064
- maxNumResults: import_v411.z.number().optional(),
2065
- ranking: import_v411.z.object({
2066
- ranker: import_v411.z.string().optional(),
2067
- scoreThreshold: import_v411.z.number().optional()
2088
+ var fileSearchArgsSchema = (0, import_provider_utils17.lazySchema)(
2089
+ () => (0, import_provider_utils17.zodSchema)(
2090
+ import_v412.z.object({
2091
+ vectorStoreIds: import_v412.z.array(import_v412.z.string()),
2092
+ maxNumResults: import_v412.z.number().optional(),
2093
+ ranking: import_v412.z.object({
2094
+ ranker: import_v412.z.string().optional(),
2095
+ scoreThreshold: import_v412.z.number().optional()
2068
2096
  }).optional(),
2069
- filters: import_v411.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2097
+ filters: import_v412.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2070
2098
  })
2071
2099
  )
2072
2100
  );
2073
- var fileSearchOutputSchema = (0, import_provider_utils16.lazySchema)(
2074
- () => (0, import_provider_utils16.zodSchema)(
2075
- import_v411.z.object({
2076
- queries: import_v411.z.array(import_v411.z.string()),
2077
- results: import_v411.z.array(
2078
- import_v411.z.object({
2079
- attributes: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()),
2080
- fileId: import_v411.z.string(),
2081
- filename: import_v411.z.string(),
2082
- score: import_v411.z.number(),
2083
- text: import_v411.z.string()
2101
+ var fileSearchOutputSchema = (0, import_provider_utils17.lazySchema)(
2102
+ () => (0, import_provider_utils17.zodSchema)(
2103
+ import_v412.z.object({
2104
+ queries: import_v412.z.array(import_v412.z.string()),
2105
+ results: import_v412.z.array(
2106
+ import_v412.z.object({
2107
+ attributes: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()),
2108
+ fileId: import_v412.z.string(),
2109
+ filename: import_v412.z.string(),
2110
+ score: import_v412.z.number(),
2111
+ text: import_v412.z.string()
2084
2112
  })
2085
2113
  ).nullable()
2086
2114
  })
2087
2115
  )
2088
2116
  );
2089
- var fileSearch = (0, import_provider_utils16.createProviderToolFactoryWithOutputSchema)({
2117
+ var fileSearch = (0, import_provider_utils17.createProviderToolFactoryWithOutputSchema)({
2090
2118
  id: "openai.file_search",
2091
- inputSchema: import_v411.z.object({}),
2119
+ inputSchema: import_v412.z.object({}),
2092
2120
  outputSchema: fileSearchOutputSchema
2093
2121
  });
2094
2122
 
2095
2123
  // src/tool/image-generation.ts
2096
- var import_provider_utils17 = require("@ai-sdk/provider-utils");
2097
- var import_v412 = require("zod/v4");
2098
- var imageGenerationArgsSchema = (0, import_provider_utils17.lazySchema)(
2099
- () => (0, import_provider_utils17.zodSchema)(
2100
- import_v412.z.object({
2101
- background: import_v412.z.enum(["auto", "opaque", "transparent"]).optional(),
2102
- inputFidelity: import_v412.z.enum(["low", "high"]).optional(),
2103
- inputImageMask: import_v412.z.object({
2104
- fileId: import_v412.z.string().optional(),
2105
- imageUrl: import_v412.z.string().optional()
2124
+ var import_provider_utils18 = require("@ai-sdk/provider-utils");
2125
+ var import_v413 = require("zod/v4");
2126
+ var imageGenerationArgsSchema = (0, import_provider_utils18.lazySchema)(
2127
+ () => (0, import_provider_utils18.zodSchema)(
2128
+ import_v413.z.object({
2129
+ background: import_v413.z.enum(["auto", "opaque", "transparent"]).optional(),
2130
+ inputFidelity: import_v413.z.enum(["low", "high"]).optional(),
2131
+ inputImageMask: import_v413.z.object({
2132
+ fileId: import_v413.z.string().optional(),
2133
+ imageUrl: import_v413.z.string().optional()
2106
2134
  }).optional(),
2107
- model: import_v412.z.string().optional(),
2108
- moderation: import_v412.z.enum(["auto"]).optional(),
2109
- outputCompression: import_v412.z.number().int().min(0).max(100).optional(),
2110
- outputFormat: import_v412.z.enum(["png", "jpeg", "webp"]).optional(),
2111
- partialImages: import_v412.z.number().int().min(0).max(3).optional(),
2112
- quality: import_v412.z.enum(["auto", "low", "medium", "high"]).optional(),
2113
- size: import_v412.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2135
+ model: import_v413.z.string().optional(),
2136
+ moderation: import_v413.z.enum(["auto"]).optional(),
2137
+ outputCompression: import_v413.z.number().int().min(0).max(100).optional(),
2138
+ outputFormat: import_v413.z.enum(["png", "jpeg", "webp"]).optional(),
2139
+ partialImages: import_v413.z.number().int().min(0).max(3).optional(),
2140
+ quality: import_v413.z.enum(["auto", "low", "medium", "high"]).optional(),
2141
+ size: import_v413.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2114
2142
  }).strict()
2115
2143
  )
2116
2144
  );
2117
- var imageGenerationInputSchema = (0, import_provider_utils17.lazySchema)(() => (0, import_provider_utils17.zodSchema)(import_v412.z.object({})));
2118
- var imageGenerationOutputSchema = (0, import_provider_utils17.lazySchema)(
2119
- () => (0, import_provider_utils17.zodSchema)(import_v412.z.object({ result: import_v412.z.string() }))
2145
+ var imageGenerationInputSchema = (0, import_provider_utils18.lazySchema)(() => (0, import_provider_utils18.zodSchema)(import_v413.z.object({})));
2146
+ var imageGenerationOutputSchema = (0, import_provider_utils18.lazySchema)(
2147
+ () => (0, import_provider_utils18.zodSchema)(import_v413.z.object({ result: import_v413.z.string() }))
2120
2148
  );
2121
- var imageGenerationToolFactory = (0, import_provider_utils17.createProviderToolFactoryWithOutputSchema)({
2149
+ var imageGenerationToolFactory = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
2122
2150
  id: "openai.image_generation",
2123
2151
  inputSchema: imageGenerationInputSchema,
2124
2152
  outputSchema: imageGenerationOutputSchema
@@ -2128,115 +2156,115 @@ var imageGeneration = (args = {}) => {
2128
2156
  };
2129
2157
 
2130
2158
  // src/tool/local-shell.ts
2131
- var import_provider_utils18 = require("@ai-sdk/provider-utils");
2132
- var import_v413 = require("zod/v4");
2133
- var localShellInputSchema = (0, import_provider_utils18.lazySchema)(
2134
- () => (0, import_provider_utils18.zodSchema)(
2135
- import_v413.z.object({
2136
- action: import_v413.z.object({
2137
- type: import_v413.z.literal("exec"),
2138
- command: import_v413.z.array(import_v413.z.string()),
2139
- timeoutMs: import_v413.z.number().optional(),
2140
- user: import_v413.z.string().optional(),
2141
- workingDirectory: import_v413.z.string().optional(),
2142
- env: import_v413.z.record(import_v413.z.string(), import_v413.z.string()).optional()
2159
+ var import_provider_utils19 = require("@ai-sdk/provider-utils");
2160
+ var import_v414 = require("zod/v4");
2161
+ var localShellInputSchema = (0, import_provider_utils19.lazySchema)(
2162
+ () => (0, import_provider_utils19.zodSchema)(
2163
+ import_v414.z.object({
2164
+ action: import_v414.z.object({
2165
+ type: import_v414.z.literal("exec"),
2166
+ command: import_v414.z.array(import_v414.z.string()),
2167
+ timeoutMs: import_v414.z.number().optional(),
2168
+ user: import_v414.z.string().optional(),
2169
+ workingDirectory: import_v414.z.string().optional(),
2170
+ env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
2143
2171
  })
2144
2172
  })
2145
2173
  )
2146
2174
  );
2147
- var localShellOutputSchema = (0, import_provider_utils18.lazySchema)(
2148
- () => (0, import_provider_utils18.zodSchema)(import_v413.z.object({ output: import_v413.z.string() }))
2175
+ var localShellOutputSchema = (0, import_provider_utils19.lazySchema)(
2176
+ () => (0, import_provider_utils19.zodSchema)(import_v414.z.object({ output: import_v414.z.string() }))
2149
2177
  );
2150
- var localShell = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
2178
+ var localShell = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
2151
2179
  id: "openai.local_shell",
2152
2180
  inputSchema: localShellInputSchema,
2153
2181
  outputSchema: localShellOutputSchema
2154
2182
  });
2155
2183
 
2156
2184
  // src/tool/shell.ts
2157
- var import_provider_utils19 = require("@ai-sdk/provider-utils");
2158
- var import_v414 = require("zod/v4");
2159
- var shellInputSchema = (0, import_provider_utils19.lazySchema)(
2160
- () => (0, import_provider_utils19.zodSchema)(
2161
- import_v414.z.object({
2162
- action: import_v414.z.object({
2163
- commands: import_v414.z.array(import_v414.z.string()),
2164
- timeoutMs: import_v414.z.number().optional(),
2165
- maxOutputLength: import_v414.z.number().optional()
2185
+ var import_provider_utils20 = require("@ai-sdk/provider-utils");
2186
+ var import_v415 = require("zod/v4");
2187
+ var shellInputSchema = (0, import_provider_utils20.lazySchema)(
2188
+ () => (0, import_provider_utils20.zodSchema)(
2189
+ import_v415.z.object({
2190
+ action: import_v415.z.object({
2191
+ commands: import_v415.z.array(import_v415.z.string()),
2192
+ timeoutMs: import_v415.z.number().optional(),
2193
+ maxOutputLength: import_v415.z.number().optional()
2166
2194
  })
2167
2195
  })
2168
2196
  )
2169
2197
  );
2170
- var shellOutputSchema = (0, import_provider_utils19.lazySchema)(
2171
- () => (0, import_provider_utils19.zodSchema)(
2172
- import_v414.z.object({
2173
- output: import_v414.z.array(
2174
- import_v414.z.object({
2175
- stdout: import_v414.z.string(),
2176
- stderr: import_v414.z.string(),
2177
- outcome: import_v414.z.discriminatedUnion("type", [
2178
- import_v414.z.object({ type: import_v414.z.literal("timeout") }),
2179
- import_v414.z.object({ type: import_v414.z.literal("exit"), exitCode: import_v414.z.number() })
2198
+ var shellOutputSchema = (0, import_provider_utils20.lazySchema)(
2199
+ () => (0, import_provider_utils20.zodSchema)(
2200
+ import_v415.z.object({
2201
+ output: import_v415.z.array(
2202
+ import_v415.z.object({
2203
+ stdout: import_v415.z.string(),
2204
+ stderr: import_v415.z.string(),
2205
+ outcome: import_v415.z.discriminatedUnion("type", [
2206
+ import_v415.z.object({ type: import_v415.z.literal("timeout") }),
2207
+ import_v415.z.object({ type: import_v415.z.literal("exit"), exitCode: import_v415.z.number() })
2180
2208
  ])
2181
2209
  })
2182
2210
  )
2183
2211
  })
2184
2212
  )
2185
2213
  );
2186
- var shellSkillsSchema = import_v414.z.array(
2187
- import_v414.z.discriminatedUnion("type", [
2188
- import_v414.z.object({
2189
- type: import_v414.z.literal("skillReference"),
2190
- skillId: import_v414.z.string(),
2191
- version: import_v414.z.string().optional()
2214
+ var shellSkillsSchema = import_v415.z.array(
2215
+ import_v415.z.discriminatedUnion("type", [
2216
+ import_v415.z.object({
2217
+ type: import_v415.z.literal("skillReference"),
2218
+ skillId: import_v415.z.string(),
2219
+ version: import_v415.z.string().optional()
2192
2220
  }),
2193
- import_v414.z.object({
2194
- type: import_v414.z.literal("inline"),
2195
- name: import_v414.z.string(),
2196
- description: import_v414.z.string(),
2197
- source: import_v414.z.object({
2198
- type: import_v414.z.literal("base64"),
2199
- mediaType: import_v414.z.literal("application/zip"),
2200
- data: import_v414.z.string()
2221
+ import_v415.z.object({
2222
+ type: import_v415.z.literal("inline"),
2223
+ name: import_v415.z.string(),
2224
+ description: import_v415.z.string(),
2225
+ source: import_v415.z.object({
2226
+ type: import_v415.z.literal("base64"),
2227
+ mediaType: import_v415.z.literal("application/zip"),
2228
+ data: import_v415.z.string()
2201
2229
  })
2202
2230
  })
2203
2231
  ])
2204
2232
  ).optional();
2205
- var shellArgsSchema = (0, import_provider_utils19.lazySchema)(
2206
- () => (0, import_provider_utils19.zodSchema)(
2207
- import_v414.z.object({
2208
- environment: import_v414.z.union([
2209
- import_v414.z.object({
2210
- type: import_v414.z.literal("containerAuto"),
2211
- fileIds: import_v414.z.array(import_v414.z.string()).optional(),
2212
- memoryLimit: import_v414.z.enum(["1g", "4g", "16g", "64g"]).optional(),
2213
- networkPolicy: import_v414.z.discriminatedUnion("type", [
2214
- import_v414.z.object({ type: import_v414.z.literal("disabled") }),
2215
- import_v414.z.object({
2216
- type: import_v414.z.literal("allowlist"),
2217
- allowedDomains: import_v414.z.array(import_v414.z.string()),
2218
- domainSecrets: import_v414.z.array(
2219
- import_v414.z.object({
2220
- domain: import_v414.z.string(),
2221
- name: import_v414.z.string(),
2222
- value: import_v414.z.string()
2233
+ var shellArgsSchema = (0, import_provider_utils20.lazySchema)(
2234
+ () => (0, import_provider_utils20.zodSchema)(
2235
+ import_v415.z.object({
2236
+ environment: import_v415.z.union([
2237
+ import_v415.z.object({
2238
+ type: import_v415.z.literal("containerAuto"),
2239
+ fileIds: import_v415.z.array(import_v415.z.string()).optional(),
2240
+ memoryLimit: import_v415.z.enum(["1g", "4g", "16g", "64g"]).optional(),
2241
+ networkPolicy: import_v415.z.discriminatedUnion("type", [
2242
+ import_v415.z.object({ type: import_v415.z.literal("disabled") }),
2243
+ import_v415.z.object({
2244
+ type: import_v415.z.literal("allowlist"),
2245
+ allowedDomains: import_v415.z.array(import_v415.z.string()),
2246
+ domainSecrets: import_v415.z.array(
2247
+ import_v415.z.object({
2248
+ domain: import_v415.z.string(),
2249
+ name: import_v415.z.string(),
2250
+ value: import_v415.z.string()
2223
2251
  })
2224
2252
  ).optional()
2225
2253
  })
2226
2254
  ]).optional(),
2227
2255
  skills: shellSkillsSchema
2228
2256
  }),
2229
- import_v414.z.object({
2230
- type: import_v414.z.literal("containerReference"),
2231
- containerId: import_v414.z.string()
2257
+ import_v415.z.object({
2258
+ type: import_v415.z.literal("containerReference"),
2259
+ containerId: import_v415.z.string()
2232
2260
  }),
2233
- import_v414.z.object({
2234
- type: import_v414.z.literal("local").optional(),
2235
- skills: import_v414.z.array(
2236
- import_v414.z.object({
2237
- name: import_v414.z.string(),
2238
- description: import_v414.z.string(),
2239
- path: import_v414.z.string()
2261
+ import_v415.z.object({
2262
+ type: import_v415.z.literal("local").optional(),
2263
+ skills: import_v415.z.array(
2264
+ import_v415.z.object({
2265
+ name: import_v415.z.string(),
2266
+ description: import_v415.z.string(),
2267
+ path: import_v415.z.string()
2240
2268
  })
2241
2269
  ).optional()
2242
2270
  })
@@ -2244,72 +2272,20 @@ var shellArgsSchema = (0, import_provider_utils19.lazySchema)(
2244
2272
  })
2245
2273
  )
2246
2274
  );
2247
- var shell = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
2275
+ var shell = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
2248
2276
  id: "openai.shell",
2249
2277
  inputSchema: shellInputSchema,
2250
2278
  outputSchema: shellOutputSchema
2251
2279
  });
2252
2280
 
2253
2281
  // src/tool/web-search.ts
2254
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
2255
- var import_v415 = require("zod/v4");
2256
- var webSearchArgsSchema = (0, import_provider_utils20.lazySchema)(
2257
- () => (0, import_provider_utils20.zodSchema)(
2258
- import_v415.z.object({
2259
- externalWebAccess: import_v415.z.boolean().optional(),
2260
- filters: import_v415.z.object({ allowedDomains: import_v415.z.array(import_v415.z.string()).optional() }).optional(),
2261
- searchContextSize: import_v415.z.enum(["low", "medium", "high"]).optional(),
2262
- userLocation: import_v415.z.object({
2263
- type: import_v415.z.literal("approximate"),
2264
- country: import_v415.z.string().optional(),
2265
- city: import_v415.z.string().optional(),
2266
- region: import_v415.z.string().optional(),
2267
- timezone: import_v415.z.string().optional()
2268
- }).optional()
2269
- })
2270
- )
2271
- );
2272
- var webSearchInputSchema = (0, import_provider_utils20.lazySchema)(() => (0, import_provider_utils20.zodSchema)(import_v415.z.object({})));
2273
- var webSearchOutputSchema = (0, import_provider_utils20.lazySchema)(
2274
- () => (0, import_provider_utils20.zodSchema)(
2275
- import_v415.z.object({
2276
- action: import_v415.z.discriminatedUnion("type", [
2277
- import_v415.z.object({
2278
- type: import_v415.z.literal("search"),
2279
- query: import_v415.z.string().optional()
2280
- }),
2281
- import_v415.z.object({
2282
- type: import_v415.z.literal("openPage"),
2283
- url: import_v415.z.string().nullish()
2284
- }),
2285
- import_v415.z.object({
2286
- type: import_v415.z.literal("findInPage"),
2287
- url: import_v415.z.string().nullish(),
2288
- pattern: import_v415.z.string().nullish()
2289
- })
2290
- ]).optional(),
2291
- sources: import_v415.z.array(
2292
- import_v415.z.discriminatedUnion("type", [
2293
- import_v415.z.object({ type: import_v415.z.literal("url"), url: import_v415.z.string() }),
2294
- import_v415.z.object({ type: import_v415.z.literal("api"), name: import_v415.z.string() })
2295
- ])
2296
- ).optional()
2297
- })
2298
- )
2299
- );
2300
- var webSearchToolFactory = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
2301
- id: "openai.web_search",
2302
- inputSchema: webSearchInputSchema,
2303
- outputSchema: webSearchOutputSchema
2304
- });
2305
- var webSearch = (args = {}) => webSearchToolFactory(args);
2306
-
2307
- // src/tool/web-search-preview.ts
2308
2282
  var import_provider_utils21 = require("@ai-sdk/provider-utils");
2309
2283
  var import_v416 = require("zod/v4");
2310
- var webSearchPreviewArgsSchema = (0, import_provider_utils21.lazySchema)(
2284
+ var webSearchArgsSchema = (0, import_provider_utils21.lazySchema)(
2311
2285
  () => (0, import_provider_utils21.zodSchema)(
2312
2286
  import_v416.z.object({
2287
+ externalWebAccess: import_v416.z.boolean().optional(),
2288
+ filters: import_v416.z.object({ allowedDomains: import_v416.z.array(import_v416.z.string()).optional() }).optional(),
2313
2289
  searchContextSize: import_v416.z.enum(["low", "medium", "high"]).optional(),
2314
2290
  userLocation: import_v416.z.object({
2315
2291
  type: import_v416.z.literal("approximate"),
@@ -2321,10 +2297,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils21.lazySchema)(
2321
2297
  })
2322
2298
  )
2323
2299
  );
2324
- var webSearchPreviewInputSchema = (0, import_provider_utils21.lazySchema)(
2325
- () => (0, import_provider_utils21.zodSchema)(import_v416.z.object({}))
2326
- );
2327
- var webSearchPreviewOutputSchema = (0, import_provider_utils21.lazySchema)(
2300
+ var webSearchInputSchema = (0, import_provider_utils21.lazySchema)(() => (0, import_provider_utils21.zodSchema)(import_v416.z.object({})));
2301
+ var webSearchOutputSchema = (0, import_provider_utils21.lazySchema)(
2328
2302
  () => (0, import_provider_utils21.zodSchema)(
2329
2303
  import_v416.z.object({
2330
2304
  action: import_v416.z.discriminatedUnion("type", [
@@ -2341,73 +2315,127 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils21.lazySchema)(
2341
2315
  url: import_v416.z.string().nullish(),
2342
2316
  pattern: import_v416.z.string().nullish()
2343
2317
  })
2318
+ ]).optional(),
2319
+ sources: import_v416.z.array(
2320
+ import_v416.z.discriminatedUnion("type", [
2321
+ import_v416.z.object({ type: import_v416.z.literal("url"), url: import_v416.z.string() }),
2322
+ import_v416.z.object({ type: import_v416.z.literal("api"), name: import_v416.z.string() })
2323
+ ])
2324
+ ).optional()
2325
+ })
2326
+ )
2327
+ );
2328
+ var webSearchToolFactory = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
2329
+ id: "openai.web_search",
2330
+ inputSchema: webSearchInputSchema,
2331
+ outputSchema: webSearchOutputSchema
2332
+ });
2333
+ var webSearch = (args = {}) => webSearchToolFactory(args);
2334
+
2335
+ // src/tool/web-search-preview.ts
2336
+ var import_provider_utils22 = require("@ai-sdk/provider-utils");
2337
+ var import_v417 = require("zod/v4");
2338
+ var webSearchPreviewArgsSchema = (0, import_provider_utils22.lazySchema)(
2339
+ () => (0, import_provider_utils22.zodSchema)(
2340
+ import_v417.z.object({
2341
+ searchContextSize: import_v417.z.enum(["low", "medium", "high"]).optional(),
2342
+ userLocation: import_v417.z.object({
2343
+ type: import_v417.z.literal("approximate"),
2344
+ country: import_v417.z.string().optional(),
2345
+ city: import_v417.z.string().optional(),
2346
+ region: import_v417.z.string().optional(),
2347
+ timezone: import_v417.z.string().optional()
2348
+ }).optional()
2349
+ })
2350
+ )
2351
+ );
2352
+ var webSearchPreviewInputSchema = (0, import_provider_utils22.lazySchema)(
2353
+ () => (0, import_provider_utils22.zodSchema)(import_v417.z.object({}))
2354
+ );
2355
+ var webSearchPreviewOutputSchema = (0, import_provider_utils22.lazySchema)(
2356
+ () => (0, import_provider_utils22.zodSchema)(
2357
+ import_v417.z.object({
2358
+ action: import_v417.z.discriminatedUnion("type", [
2359
+ import_v417.z.object({
2360
+ type: import_v417.z.literal("search"),
2361
+ query: import_v417.z.string().optional()
2362
+ }),
2363
+ import_v417.z.object({
2364
+ type: import_v417.z.literal("openPage"),
2365
+ url: import_v417.z.string().nullish()
2366
+ }),
2367
+ import_v417.z.object({
2368
+ type: import_v417.z.literal("findInPage"),
2369
+ url: import_v417.z.string().nullish(),
2370
+ pattern: import_v417.z.string().nullish()
2371
+ })
2344
2372
  ]).optional()
2345
2373
  })
2346
2374
  )
2347
2375
  );
2348
- var webSearchPreview = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
2376
+ var webSearchPreview = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
2349
2377
  id: "openai.web_search_preview",
2350
2378
  inputSchema: webSearchPreviewInputSchema,
2351
2379
  outputSchema: webSearchPreviewOutputSchema
2352
2380
  });
2353
2381
 
2354
2382
  // src/tool/mcp.ts
2355
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
2356
- var import_v417 = require("zod/v4");
2357
- var jsonValueSchema = import_v417.z.lazy(
2358
- () => import_v417.z.union([
2359
- import_v417.z.string(),
2360
- import_v417.z.number(),
2361
- import_v417.z.boolean(),
2362
- import_v417.z.null(),
2363
- import_v417.z.array(jsonValueSchema),
2364
- import_v417.z.record(import_v417.z.string(), jsonValueSchema)
2383
+ var import_provider_utils23 = require("@ai-sdk/provider-utils");
2384
+ var import_v418 = require("zod/v4");
2385
+ var jsonValueSchema = import_v418.z.lazy(
2386
+ () => import_v418.z.union([
2387
+ import_v418.z.string(),
2388
+ import_v418.z.number(),
2389
+ import_v418.z.boolean(),
2390
+ import_v418.z.null(),
2391
+ import_v418.z.array(jsonValueSchema),
2392
+ import_v418.z.record(import_v418.z.string(), jsonValueSchema)
2365
2393
  ])
2366
2394
  );
2367
- var mcpArgsSchema = (0, import_provider_utils22.lazySchema)(
2368
- () => (0, import_provider_utils22.zodSchema)(
2369
- import_v417.z.object({
2370
- serverLabel: import_v417.z.string(),
2371
- allowedTools: import_v417.z.union([
2372
- import_v417.z.array(import_v417.z.string()),
2373
- import_v417.z.object({
2374
- readOnly: import_v417.z.boolean().optional(),
2375
- toolNames: import_v417.z.array(import_v417.z.string()).optional()
2395
+ var mcpArgsSchema = (0, import_provider_utils23.lazySchema)(
2396
+ () => (0, import_provider_utils23.zodSchema)(
2397
+ import_v418.z.object({
2398
+ serverLabel: import_v418.z.string(),
2399
+ allowedTools: import_v418.z.union([
2400
+ import_v418.z.array(import_v418.z.string()),
2401
+ import_v418.z.object({
2402
+ readOnly: import_v418.z.boolean().optional(),
2403
+ toolNames: import_v418.z.array(import_v418.z.string()).optional()
2376
2404
  })
2377
2405
  ]).optional(),
2378
- authorization: import_v417.z.string().optional(),
2379
- connectorId: import_v417.z.string().optional(),
2380
- headers: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional(),
2381
- requireApproval: import_v417.z.union([
2382
- import_v417.z.enum(["always", "never"]),
2383
- import_v417.z.object({
2384
- never: import_v417.z.object({
2385
- toolNames: import_v417.z.array(import_v417.z.string()).optional()
2406
+ authorization: import_v418.z.string().optional(),
2407
+ connectorId: import_v418.z.string().optional(),
2408
+ headers: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional(),
2409
+ requireApproval: import_v418.z.union([
2410
+ import_v418.z.enum(["always", "never"]),
2411
+ import_v418.z.object({
2412
+ never: import_v418.z.object({
2413
+ toolNames: import_v418.z.array(import_v418.z.string()).optional()
2386
2414
  }).optional()
2387
2415
  })
2388
2416
  ]).optional(),
2389
- serverDescription: import_v417.z.string().optional(),
2390
- serverUrl: import_v417.z.string().optional()
2417
+ serverDescription: import_v418.z.string().optional(),
2418
+ serverUrl: import_v418.z.string().optional()
2391
2419
  }).refine(
2392
2420
  (v) => v.serverUrl != null || v.connectorId != null,
2393
2421
  "One of serverUrl or connectorId must be provided."
2394
2422
  )
2395
2423
  )
2396
2424
  );
2397
- var mcpInputSchema = (0, import_provider_utils22.lazySchema)(() => (0, import_provider_utils22.zodSchema)(import_v417.z.object({})));
2398
- var mcpOutputSchema = (0, import_provider_utils22.lazySchema)(
2399
- () => (0, import_provider_utils22.zodSchema)(
2400
- import_v417.z.object({
2401
- type: import_v417.z.literal("call"),
2402
- serverLabel: import_v417.z.string(),
2403
- name: import_v417.z.string(),
2404
- arguments: import_v417.z.string(),
2405
- output: import_v417.z.string().nullish(),
2406
- error: import_v417.z.union([import_v417.z.string(), jsonValueSchema]).optional()
2425
+ var mcpInputSchema = (0, import_provider_utils23.lazySchema)(() => (0, import_provider_utils23.zodSchema)(import_v418.z.object({})));
2426
+ var mcpOutputSchema = (0, import_provider_utils23.lazySchema)(
2427
+ () => (0, import_provider_utils23.zodSchema)(
2428
+ import_v418.z.object({
2429
+ type: import_v418.z.literal("call"),
2430
+ serverLabel: import_v418.z.string(),
2431
+ name: import_v418.z.string(),
2432
+ arguments: import_v418.z.string(),
2433
+ output: import_v418.z.string().nullish(),
2434
+ error: import_v418.z.union([import_v418.z.string(), jsonValueSchema]).optional()
2407
2435
  })
2408
2436
  )
2409
2437
  );
2410
- var mcpToolFactory = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
2438
+ var mcpToolFactory = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
2411
2439
  id: "openai.mcp",
2412
2440
  inputSchema: mcpInputSchema,
2413
2441
  outputSchema: mcpOutputSchema
@@ -2424,6 +2452,16 @@ var openaiTools = {
2424
2452
  *
2425
2453
  */
2426
2454
  applyPatch,
2455
+ /**
2456
+ * Custom tools let callers constrain model output to a grammar (regex or
2457
+ * Lark syntax). The model returns a `custom_tool_call` output item whose
2458
+ * `input` field is a string matching the specified grammar.
2459
+ *
2460
+ * @param name - The name of the custom tool.
2461
+ * @param description - An optional description of the tool.
2462
+ * @param format - The output format constraint (grammar type, syntax, and definition).
2463
+ */
2464
+ customTool,
2427
2465
  /**
2428
2466
  * The Code Interpreter tool allows models to write and run Python code in a
2429
2467
  * sandboxed environment to solve complex problems in domains like data analysis,
@@ -2464,7 +2502,7 @@ var openaiTools = {
2464
2502
  * Local shell is a tool that allows agents to run shell commands locally
2465
2503
  * on a machine you or the user provides.
2466
2504
  *
2467
- * Supported models: `gpt-5-codex` and `codex-mini-latest`
2505
+ * Supported models: `gpt-5-codex`
2468
2506
  */
2469
2507
  localShell,
2470
2508
  /**
@@ -2514,7 +2552,7 @@ var openaiTools = {
2514
2552
 
2515
2553
  // src/responses/openai-responses-language-model.ts
2516
2554
  var import_provider8 = require("@ai-sdk/provider");
2517
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
2555
+ var import_provider_utils28 = require("@ai-sdk/provider-utils");
2518
2556
 
2519
2557
  // src/responses/convert-openai-responses-usage.ts
2520
2558
  function convertOpenAIResponsesUsage(usage) {
@@ -2557,8 +2595,8 @@ function convertOpenAIResponsesUsage(usage) {
2557
2595
 
2558
2596
  // src/responses/convert-to-openai-responses-input.ts
2559
2597
  var import_provider6 = require("@ai-sdk/provider");
2560
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
2561
- var import_v418 = require("zod/v4");
2598
+ var import_provider_utils24 = require("@ai-sdk/provider-utils");
2599
+ var import_v419 = require("zod/v4");
2562
2600
  function isFileId(data, prefixes) {
2563
2601
  if (!prefixes) return false;
2564
2602
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -2573,9 +2611,10 @@ async function convertToOpenAIResponsesInput({
2573
2611
  hasConversation = false,
2574
2612
  hasLocalShellTool = false,
2575
2613
  hasShellTool = false,
2576
- hasApplyPatchTool = false
2614
+ hasApplyPatchTool = false,
2615
+ customProviderToolNames
2577
2616
  }) {
2578
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
2617
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2579
2618
  const input = [];
2580
2619
  const warnings = [];
2581
2620
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -2622,7 +2661,7 @@ async function convertToOpenAIResponsesInput({
2622
2661
  return {
2623
2662
  type: "input_image",
2624
2663
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2625
- image_url: `data:${mediaType};base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
2664
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils24.convertToBase64)(part.data)}`
2626
2665
  },
2627
2666
  detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail
2628
2667
  };
@@ -2637,7 +2676,7 @@ async function convertToOpenAIResponsesInput({
2637
2676
  type: "input_file",
2638
2677
  ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2639
2678
  filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
2640
- file_data: `data:application/pdf;base64,${(0, import_provider_utils23.convertToBase64)(part.data)}`
2679
+ file_data: `data:application/pdf;base64,${(0, import_provider_utils24.convertToBase64)(part.data)}`
2641
2680
  }
2642
2681
  };
2643
2682
  } else {
@@ -2693,7 +2732,7 @@ async function convertToOpenAIResponsesInput({
2693
2732
  part.toolName
2694
2733
  );
2695
2734
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
2696
- const parsedInput = await (0, import_provider_utils23.validateTypes)({
2735
+ const parsedInput = await (0, import_provider_utils24.validateTypes)({
2697
2736
  value: part.input,
2698
2737
  schema: localShellInputSchema
2699
2738
  });
@@ -2713,7 +2752,7 @@ async function convertToOpenAIResponsesInput({
2713
2752
  break;
2714
2753
  }
2715
2754
  if (hasShellTool && resolvedToolName === "shell") {
2716
- const parsedInput = await (0, import_provider_utils23.validateTypes)({
2755
+ const parsedInput = await (0, import_provider_utils24.validateTypes)({
2717
2756
  value: part.input,
2718
2757
  schema: shellInputSchema
2719
2758
  });
@@ -2731,7 +2770,7 @@ async function convertToOpenAIResponsesInput({
2731
2770
  break;
2732
2771
  }
2733
2772
  if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
2734
- const parsedInput = await (0, import_provider_utils23.validateTypes)({
2773
+ const parsedInput = await (0, import_provider_utils24.validateTypes)({
2735
2774
  value: part.input,
2736
2775
  schema: applyPatchInputSchema
2737
2776
  });
@@ -2744,6 +2783,16 @@ async function convertToOpenAIResponsesInput({
2744
2783
  });
2745
2784
  break;
2746
2785
  }
2786
+ if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
2787
+ input.push({
2788
+ type: "custom_tool_call",
2789
+ call_id: part.toolCallId,
2790
+ name: resolvedToolName,
2791
+ input: typeof part.input === "string" ? part.input : JSON.stringify(part.input),
2792
+ id
2793
+ });
2794
+ break;
2795
+ }
2747
2796
  input.push({
2748
2797
  type: "function_call",
2749
2798
  call_id: part.toolCallId,
@@ -2766,7 +2815,7 @@ async function convertToOpenAIResponsesInput({
2766
2815
  );
2767
2816
  if (hasShellTool && resolvedResultToolName === "shell") {
2768
2817
  if (part.output.type === "json") {
2769
- const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2818
+ const parsedOutput = await (0, import_provider_utils24.validateTypes)({
2770
2819
  value: part.output.value,
2771
2820
  schema: shellOutputSchema
2772
2821
  });
@@ -2797,7 +2846,7 @@ async function convertToOpenAIResponsesInput({
2797
2846
  break;
2798
2847
  }
2799
2848
  case "reasoning": {
2800
- const providerOptions = await (0, import_provider_utils23.parseProviderOptions)({
2849
+ const providerOptions = await (0, import_provider_utils24.parseProviderOptions)({
2801
2850
  provider: providerOptionsName,
2802
2851
  providerOptions: part.providerOptions,
2803
2852
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -2905,7 +2954,7 @@ async function convertToOpenAIResponsesInput({
2905
2954
  part.toolName
2906
2955
  );
2907
2956
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
2908
- const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2957
+ const parsedOutput = await (0, import_provider_utils24.validateTypes)({
2909
2958
  value: output.value,
2910
2959
  schema: localShellOutputSchema
2911
2960
  });
@@ -2917,7 +2966,7 @@ async function convertToOpenAIResponsesInput({
2917
2966
  continue;
2918
2967
  }
2919
2968
  if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
2920
- const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2969
+ const parsedOutput = await (0, import_provider_utils24.validateTypes)({
2921
2970
  value: output.value,
2922
2971
  schema: shellOutputSchema
2923
2972
  });
@@ -2936,7 +2985,7 @@ async function convertToOpenAIResponsesInput({
2936
2985
  continue;
2937
2986
  }
2938
2987
  if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
2939
- const parsedOutput = await (0, import_provider_utils23.validateTypes)({
2988
+ const parsedOutput = await (0, import_provider_utils24.validateTypes)({
2940
2989
  value: output.value,
2941
2990
  schema: applyPatchOutputSchema
2942
2991
  });
@@ -2948,6 +2997,61 @@ async function convertToOpenAIResponsesInput({
2948
2997
  });
2949
2998
  continue;
2950
2999
  }
3000
+ if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
3001
+ let outputValue;
3002
+ switch (output.type) {
3003
+ case "text":
3004
+ case "error-text":
3005
+ outputValue = output.value;
3006
+ break;
3007
+ case "execution-denied":
3008
+ outputValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
3009
+ break;
3010
+ case "json":
3011
+ case "error-json":
3012
+ outputValue = JSON.stringify(output.value);
3013
+ break;
3014
+ case "content":
3015
+ outputValue = output.value.map((item) => {
3016
+ var _a2;
3017
+ switch (item.type) {
3018
+ case "text":
3019
+ return { type: "input_text", text: item.text };
3020
+ case "image-data":
3021
+ return {
3022
+ type: "input_image",
3023
+ image_url: `data:${item.mediaType};base64,${item.data}`
3024
+ };
3025
+ case "image-url":
3026
+ return {
3027
+ type: "input_image",
3028
+ image_url: item.url
3029
+ };
3030
+ case "file-data":
3031
+ return {
3032
+ type: "input_file",
3033
+ filename: (_a2 = item.filename) != null ? _a2 : "data",
3034
+ file_data: `data:${item.mediaType};base64,${item.data}`
3035
+ };
3036
+ default:
3037
+ warnings.push({
3038
+ type: "other",
3039
+ message: `unsupported custom tool content part type: ${item.type}`
3040
+ });
3041
+ return void 0;
3042
+ }
3043
+ }).filter(import_provider_utils24.isNonNullable);
3044
+ break;
3045
+ default:
3046
+ outputValue = "";
3047
+ }
3048
+ input.push({
3049
+ type: "custom_tool_call_output",
3050
+ call_id: part.toolCallId,
3051
+ output: outputValue
3052
+ });
3053
+ continue;
3054
+ }
2951
3055
  let contentValue;
2952
3056
  switch (output.type) {
2953
3057
  case "text":
@@ -2955,7 +3059,7 @@ async function convertToOpenAIResponsesInput({
2955
3059
  contentValue = output.value;
2956
3060
  break;
2957
3061
  case "execution-denied":
2958
- contentValue = (_l = output.reason) != null ? _l : "Tool execution denied.";
3062
+ contentValue = (_m = output.reason) != null ? _m : "Tool execution denied.";
2959
3063
  break;
2960
3064
  case "json":
2961
3065
  case "error-json":
@@ -2995,7 +3099,7 @@ async function convertToOpenAIResponsesInput({
2995
3099
  return void 0;
2996
3100
  }
2997
3101
  }
2998
- }).filter(import_provider_utils23.isNonNullable);
3102
+ }).filter(import_provider_utils24.isNonNullable);
2999
3103
  break;
3000
3104
  }
3001
3105
  input.push({
@@ -3014,9 +3118,9 @@ async function convertToOpenAIResponsesInput({
3014
3118
  }
3015
3119
  return { input, warnings };
3016
3120
  }
3017
- var openaiResponsesReasoningProviderOptionsSchema = import_v418.z.object({
3018
- itemId: import_v418.z.string().nullish(),
3019
- reasoningEncryptedContent: import_v418.z.string().nullish()
3121
+ var openaiResponsesReasoningProviderOptionsSchema = import_v419.z.object({
3122
+ itemId: import_v419.z.string().nullish(),
3123
+ reasoningEncryptedContent: import_v419.z.string().nullish()
3020
3124
  });
3021
3125
 
3022
3126
  // src/responses/map-openai-responses-finish-reason.ts
@@ -3038,161 +3142,168 @@ function mapOpenAIResponseFinishReason({
3038
3142
  }
3039
3143
 
3040
3144
  // src/responses/openai-responses-api.ts
3041
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
3042
- var import_v419 = require("zod/v4");
3043
- var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3044
- () => (0, import_provider_utils24.zodSchema)(
3045
- import_v419.z.union([
3046
- import_v419.z.object({
3047
- type: import_v419.z.literal("response.output_text.delta"),
3048
- item_id: import_v419.z.string(),
3049
- delta: import_v419.z.string(),
3050
- logprobs: import_v419.z.array(
3051
- import_v419.z.object({
3052
- token: import_v419.z.string(),
3053
- logprob: import_v419.z.number(),
3054
- top_logprobs: import_v419.z.array(
3055
- import_v419.z.object({
3056
- token: import_v419.z.string(),
3057
- logprob: import_v419.z.number()
3145
+ var import_provider_utils25 = require("@ai-sdk/provider-utils");
3146
+ var import_v420 = require("zod/v4");
3147
+ var openaiResponsesChunkSchema = (0, import_provider_utils25.lazySchema)(
3148
+ () => (0, import_provider_utils25.zodSchema)(
3149
+ import_v420.z.union([
3150
+ import_v420.z.object({
3151
+ type: import_v420.z.literal("response.output_text.delta"),
3152
+ item_id: import_v420.z.string(),
3153
+ delta: import_v420.z.string(),
3154
+ logprobs: import_v420.z.array(
3155
+ import_v420.z.object({
3156
+ token: import_v420.z.string(),
3157
+ logprob: import_v420.z.number(),
3158
+ top_logprobs: import_v420.z.array(
3159
+ import_v420.z.object({
3160
+ token: import_v420.z.string(),
3161
+ logprob: import_v420.z.number()
3058
3162
  })
3059
3163
  )
3060
3164
  })
3061
3165
  ).nullish()
3062
3166
  }),
3063
- import_v419.z.object({
3064
- type: import_v419.z.enum(["response.completed", "response.incomplete"]),
3065
- response: import_v419.z.object({
3066
- incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
3067
- usage: import_v419.z.object({
3068
- input_tokens: import_v419.z.number(),
3069
- input_tokens_details: import_v419.z.object({ cached_tokens: import_v419.z.number().nullish() }).nullish(),
3070
- output_tokens: import_v419.z.number(),
3071
- output_tokens_details: import_v419.z.object({ reasoning_tokens: import_v419.z.number().nullish() }).nullish()
3167
+ import_v420.z.object({
3168
+ type: import_v420.z.enum(["response.completed", "response.incomplete"]),
3169
+ response: import_v420.z.object({
3170
+ incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
3171
+ usage: import_v420.z.object({
3172
+ input_tokens: import_v420.z.number(),
3173
+ input_tokens_details: import_v420.z.object({ cached_tokens: import_v420.z.number().nullish() }).nullish(),
3174
+ output_tokens: import_v420.z.number(),
3175
+ output_tokens_details: import_v420.z.object({ reasoning_tokens: import_v420.z.number().nullish() }).nullish()
3072
3176
  }),
3073
- service_tier: import_v419.z.string().nullish()
3177
+ service_tier: import_v420.z.string().nullish()
3074
3178
  })
3075
3179
  }),
3076
- import_v419.z.object({
3077
- type: import_v419.z.literal("response.created"),
3078
- response: import_v419.z.object({
3079
- id: import_v419.z.string(),
3080
- created_at: import_v419.z.number(),
3081
- model: import_v419.z.string(),
3082
- service_tier: import_v419.z.string().nullish()
3180
+ import_v420.z.object({
3181
+ type: import_v420.z.literal("response.created"),
3182
+ response: import_v420.z.object({
3183
+ id: import_v420.z.string(),
3184
+ created_at: import_v420.z.number(),
3185
+ model: import_v420.z.string(),
3186
+ service_tier: import_v420.z.string().nullish()
3083
3187
  })
3084
3188
  }),
3085
- import_v419.z.object({
3086
- type: import_v419.z.literal("response.output_item.added"),
3087
- output_index: import_v419.z.number(),
3088
- item: import_v419.z.discriminatedUnion("type", [
3089
- import_v419.z.object({
3090
- type: import_v419.z.literal("message"),
3091
- id: import_v419.z.string(),
3092
- phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
3189
+ import_v420.z.object({
3190
+ type: import_v420.z.literal("response.output_item.added"),
3191
+ output_index: import_v420.z.number(),
3192
+ item: import_v420.z.discriminatedUnion("type", [
3193
+ import_v420.z.object({
3194
+ type: import_v420.z.literal("message"),
3195
+ id: import_v420.z.string(),
3196
+ phase: import_v420.z.enum(["commentary", "final_answer"]).nullish()
3093
3197
  }),
3094
- import_v419.z.object({
3095
- type: import_v419.z.literal("reasoning"),
3096
- id: import_v419.z.string(),
3097
- encrypted_content: import_v419.z.string().nullish()
3198
+ import_v420.z.object({
3199
+ type: import_v420.z.literal("reasoning"),
3200
+ id: import_v420.z.string(),
3201
+ encrypted_content: import_v420.z.string().nullish()
3098
3202
  }),
3099
- import_v419.z.object({
3100
- type: import_v419.z.literal("function_call"),
3101
- id: import_v419.z.string(),
3102
- call_id: import_v419.z.string(),
3103
- name: import_v419.z.string(),
3104
- arguments: import_v419.z.string()
3203
+ import_v420.z.object({
3204
+ type: import_v420.z.literal("function_call"),
3205
+ id: import_v420.z.string(),
3206
+ call_id: import_v420.z.string(),
3207
+ name: import_v420.z.string(),
3208
+ arguments: import_v420.z.string()
3105
3209
  }),
3106
- import_v419.z.object({
3107
- type: import_v419.z.literal("web_search_call"),
3108
- id: import_v419.z.string(),
3109
- status: import_v419.z.string()
3210
+ import_v420.z.object({
3211
+ type: import_v420.z.literal("web_search_call"),
3212
+ id: import_v420.z.string(),
3213
+ status: import_v420.z.string()
3110
3214
  }),
3111
- import_v419.z.object({
3112
- type: import_v419.z.literal("computer_call"),
3113
- id: import_v419.z.string(),
3114
- status: import_v419.z.string()
3215
+ import_v420.z.object({
3216
+ type: import_v420.z.literal("computer_call"),
3217
+ id: import_v420.z.string(),
3218
+ status: import_v420.z.string()
3115
3219
  }),
3116
- import_v419.z.object({
3117
- type: import_v419.z.literal("file_search_call"),
3118
- id: import_v419.z.string()
3220
+ import_v420.z.object({
3221
+ type: import_v420.z.literal("file_search_call"),
3222
+ id: import_v420.z.string()
3119
3223
  }),
3120
- import_v419.z.object({
3121
- type: import_v419.z.literal("image_generation_call"),
3122
- id: import_v419.z.string()
3224
+ import_v420.z.object({
3225
+ type: import_v420.z.literal("image_generation_call"),
3226
+ id: import_v420.z.string()
3123
3227
  }),
3124
- import_v419.z.object({
3125
- type: import_v419.z.literal("code_interpreter_call"),
3126
- id: import_v419.z.string(),
3127
- container_id: import_v419.z.string(),
3128
- code: import_v419.z.string().nullable(),
3129
- outputs: import_v419.z.array(
3130
- import_v419.z.discriminatedUnion("type", [
3131
- import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
3132
- import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
3228
+ import_v420.z.object({
3229
+ type: import_v420.z.literal("code_interpreter_call"),
3230
+ id: import_v420.z.string(),
3231
+ container_id: import_v420.z.string(),
3232
+ code: import_v420.z.string().nullable(),
3233
+ outputs: import_v420.z.array(
3234
+ import_v420.z.discriminatedUnion("type", [
3235
+ import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
3236
+ import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
3133
3237
  ])
3134
3238
  ).nullable(),
3135
- status: import_v419.z.string()
3239
+ status: import_v420.z.string()
3136
3240
  }),
3137
- import_v419.z.object({
3138
- type: import_v419.z.literal("mcp_call"),
3139
- id: import_v419.z.string(),
3140
- status: import_v419.z.string(),
3141
- approval_request_id: import_v419.z.string().nullish()
3241
+ import_v420.z.object({
3242
+ type: import_v420.z.literal("mcp_call"),
3243
+ id: import_v420.z.string(),
3244
+ status: import_v420.z.string(),
3245
+ approval_request_id: import_v420.z.string().nullish()
3142
3246
  }),
3143
- import_v419.z.object({
3144
- type: import_v419.z.literal("mcp_list_tools"),
3145
- id: import_v419.z.string()
3247
+ import_v420.z.object({
3248
+ type: import_v420.z.literal("mcp_list_tools"),
3249
+ id: import_v420.z.string()
3146
3250
  }),
3147
- import_v419.z.object({
3148
- type: import_v419.z.literal("mcp_approval_request"),
3149
- id: import_v419.z.string()
3251
+ import_v420.z.object({
3252
+ type: import_v420.z.literal("mcp_approval_request"),
3253
+ id: import_v420.z.string()
3150
3254
  }),
3151
- import_v419.z.object({
3152
- type: import_v419.z.literal("apply_patch_call"),
3153
- id: import_v419.z.string(),
3154
- call_id: import_v419.z.string(),
3155
- status: import_v419.z.enum(["in_progress", "completed"]),
3156
- operation: import_v419.z.discriminatedUnion("type", [
3157
- import_v419.z.object({
3158
- type: import_v419.z.literal("create_file"),
3159
- path: import_v419.z.string(),
3160
- diff: import_v419.z.string()
3255
+ import_v420.z.object({
3256
+ type: import_v420.z.literal("apply_patch_call"),
3257
+ id: import_v420.z.string(),
3258
+ call_id: import_v420.z.string(),
3259
+ status: import_v420.z.enum(["in_progress", "completed"]),
3260
+ operation: import_v420.z.discriminatedUnion("type", [
3261
+ import_v420.z.object({
3262
+ type: import_v420.z.literal("create_file"),
3263
+ path: import_v420.z.string(),
3264
+ diff: import_v420.z.string()
3161
3265
  }),
3162
- import_v419.z.object({
3163
- type: import_v419.z.literal("delete_file"),
3164
- path: import_v419.z.string()
3266
+ import_v420.z.object({
3267
+ type: import_v420.z.literal("delete_file"),
3268
+ path: import_v420.z.string()
3165
3269
  }),
3166
- import_v419.z.object({
3167
- type: import_v419.z.literal("update_file"),
3168
- path: import_v419.z.string(),
3169
- diff: import_v419.z.string()
3270
+ import_v420.z.object({
3271
+ type: import_v420.z.literal("update_file"),
3272
+ path: import_v420.z.string(),
3273
+ diff: import_v420.z.string()
3170
3274
  })
3171
3275
  ])
3172
3276
  }),
3173
- import_v419.z.object({
3174
- type: import_v419.z.literal("shell_call"),
3175
- id: import_v419.z.string(),
3176
- call_id: import_v419.z.string(),
3177
- status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
3178
- action: import_v419.z.object({
3179
- commands: import_v419.z.array(import_v419.z.string())
3277
+ import_v420.z.object({
3278
+ type: import_v420.z.literal("custom_tool_call"),
3279
+ id: import_v420.z.string(),
3280
+ call_id: import_v420.z.string(),
3281
+ name: import_v420.z.string(),
3282
+ input: import_v420.z.string()
3283
+ }),
3284
+ import_v420.z.object({
3285
+ type: import_v420.z.literal("shell_call"),
3286
+ id: import_v420.z.string(),
3287
+ call_id: import_v420.z.string(),
3288
+ status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
3289
+ action: import_v420.z.object({
3290
+ commands: import_v420.z.array(import_v420.z.string())
3180
3291
  })
3181
3292
  }),
3182
- import_v419.z.object({
3183
- type: import_v419.z.literal("shell_call_output"),
3184
- id: import_v419.z.string(),
3185
- call_id: import_v419.z.string(),
3186
- status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
3187
- output: import_v419.z.array(
3188
- import_v419.z.object({
3189
- stdout: import_v419.z.string(),
3190
- stderr: import_v419.z.string(),
3191
- outcome: import_v419.z.discriminatedUnion("type", [
3192
- import_v419.z.object({ type: import_v419.z.literal("timeout") }),
3193
- import_v419.z.object({
3194
- type: import_v419.z.literal("exit"),
3195
- exit_code: import_v419.z.number()
3293
+ import_v420.z.object({
3294
+ type: import_v420.z.literal("shell_call_output"),
3295
+ id: import_v420.z.string(),
3296
+ call_id: import_v420.z.string(),
3297
+ status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
3298
+ output: import_v420.z.array(
3299
+ import_v420.z.object({
3300
+ stdout: import_v420.z.string(),
3301
+ stderr: import_v420.z.string(),
3302
+ outcome: import_v420.z.discriminatedUnion("type", [
3303
+ import_v420.z.object({ type: import_v420.z.literal("timeout") }),
3304
+ import_v420.z.object({
3305
+ type: import_v420.z.literal("exit"),
3306
+ exit_code: import_v420.z.number()
3196
3307
  })
3197
3308
  ])
3198
3309
  })
@@ -3200,198 +3311,206 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3200
3311
  })
3201
3312
  ])
3202
3313
  }),
3203
- import_v419.z.object({
3204
- type: import_v419.z.literal("response.output_item.done"),
3205
- output_index: import_v419.z.number(),
3206
- item: import_v419.z.discriminatedUnion("type", [
3207
- import_v419.z.object({
3208
- type: import_v419.z.literal("message"),
3209
- id: import_v419.z.string(),
3210
- phase: import_v419.z.enum(["commentary", "final_answer"]).nullish()
3314
+ import_v420.z.object({
3315
+ type: import_v420.z.literal("response.output_item.done"),
3316
+ output_index: import_v420.z.number(),
3317
+ item: import_v420.z.discriminatedUnion("type", [
3318
+ import_v420.z.object({
3319
+ type: import_v420.z.literal("message"),
3320
+ id: import_v420.z.string(),
3321
+ phase: import_v420.z.enum(["commentary", "final_answer"]).nullish()
3211
3322
  }),
3212
- import_v419.z.object({
3213
- type: import_v419.z.literal("reasoning"),
3214
- id: import_v419.z.string(),
3215
- encrypted_content: import_v419.z.string().nullish()
3323
+ import_v420.z.object({
3324
+ type: import_v420.z.literal("reasoning"),
3325
+ id: import_v420.z.string(),
3326
+ encrypted_content: import_v420.z.string().nullish()
3216
3327
  }),
3217
- import_v419.z.object({
3218
- type: import_v419.z.literal("function_call"),
3219
- id: import_v419.z.string(),
3220
- call_id: import_v419.z.string(),
3221
- name: import_v419.z.string(),
3222
- arguments: import_v419.z.string(),
3223
- status: import_v419.z.literal("completed")
3328
+ import_v420.z.object({
3329
+ type: import_v420.z.literal("function_call"),
3330
+ id: import_v420.z.string(),
3331
+ call_id: import_v420.z.string(),
3332
+ name: import_v420.z.string(),
3333
+ arguments: import_v420.z.string(),
3334
+ status: import_v420.z.literal("completed")
3224
3335
  }),
3225
- import_v419.z.object({
3226
- type: import_v419.z.literal("code_interpreter_call"),
3227
- id: import_v419.z.string(),
3228
- code: import_v419.z.string().nullable(),
3229
- container_id: import_v419.z.string(),
3230
- outputs: import_v419.z.array(
3231
- import_v419.z.discriminatedUnion("type", [
3232
- import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
3233
- import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
3336
+ import_v420.z.object({
3337
+ type: import_v420.z.literal("custom_tool_call"),
3338
+ id: import_v420.z.string(),
3339
+ call_id: import_v420.z.string(),
3340
+ name: import_v420.z.string(),
3341
+ input: import_v420.z.string(),
3342
+ status: import_v420.z.literal("completed")
3343
+ }),
3344
+ import_v420.z.object({
3345
+ type: import_v420.z.literal("code_interpreter_call"),
3346
+ id: import_v420.z.string(),
3347
+ code: import_v420.z.string().nullable(),
3348
+ container_id: import_v420.z.string(),
3349
+ outputs: import_v420.z.array(
3350
+ import_v420.z.discriminatedUnion("type", [
3351
+ import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
3352
+ import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
3234
3353
  ])
3235
3354
  ).nullable()
3236
3355
  }),
3237
- import_v419.z.object({
3238
- type: import_v419.z.literal("image_generation_call"),
3239
- id: import_v419.z.string(),
3240
- result: import_v419.z.string()
3356
+ import_v420.z.object({
3357
+ type: import_v420.z.literal("image_generation_call"),
3358
+ id: import_v420.z.string(),
3359
+ result: import_v420.z.string()
3241
3360
  }),
3242
- import_v419.z.object({
3243
- type: import_v419.z.literal("web_search_call"),
3244
- id: import_v419.z.string(),
3245
- status: import_v419.z.string(),
3246
- action: import_v419.z.discriminatedUnion("type", [
3247
- import_v419.z.object({
3248
- type: import_v419.z.literal("search"),
3249
- query: import_v419.z.string().nullish(),
3250
- sources: import_v419.z.array(
3251
- import_v419.z.discriminatedUnion("type", [
3252
- import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
3253
- import_v419.z.object({ type: import_v419.z.literal("api"), name: import_v419.z.string() })
3361
+ import_v420.z.object({
3362
+ type: import_v420.z.literal("web_search_call"),
3363
+ id: import_v420.z.string(),
3364
+ status: import_v420.z.string(),
3365
+ action: import_v420.z.discriminatedUnion("type", [
3366
+ import_v420.z.object({
3367
+ type: import_v420.z.literal("search"),
3368
+ query: import_v420.z.string().nullish(),
3369
+ sources: import_v420.z.array(
3370
+ import_v420.z.discriminatedUnion("type", [
3371
+ import_v420.z.object({ type: import_v420.z.literal("url"), url: import_v420.z.string() }),
3372
+ import_v420.z.object({ type: import_v420.z.literal("api"), name: import_v420.z.string() })
3254
3373
  ])
3255
3374
  ).nullish()
3256
3375
  }),
3257
- import_v419.z.object({
3258
- type: import_v419.z.literal("open_page"),
3259
- url: import_v419.z.string().nullish()
3376
+ import_v420.z.object({
3377
+ type: import_v420.z.literal("open_page"),
3378
+ url: import_v420.z.string().nullish()
3260
3379
  }),
3261
- import_v419.z.object({
3262
- type: import_v419.z.literal("find_in_page"),
3263
- url: import_v419.z.string().nullish(),
3264
- pattern: import_v419.z.string().nullish()
3380
+ import_v420.z.object({
3381
+ type: import_v420.z.literal("find_in_page"),
3382
+ url: import_v420.z.string().nullish(),
3383
+ pattern: import_v420.z.string().nullish()
3265
3384
  })
3266
3385
  ]).nullish()
3267
3386
  }),
3268
- import_v419.z.object({
3269
- type: import_v419.z.literal("file_search_call"),
3270
- id: import_v419.z.string(),
3271
- queries: import_v419.z.array(import_v419.z.string()),
3272
- results: import_v419.z.array(
3273
- import_v419.z.object({
3274
- attributes: import_v419.z.record(
3275
- import_v419.z.string(),
3276
- import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
3387
+ import_v420.z.object({
3388
+ type: import_v420.z.literal("file_search_call"),
3389
+ id: import_v420.z.string(),
3390
+ queries: import_v420.z.array(import_v420.z.string()),
3391
+ results: import_v420.z.array(
3392
+ import_v420.z.object({
3393
+ attributes: import_v420.z.record(
3394
+ import_v420.z.string(),
3395
+ import_v420.z.union([import_v420.z.string(), import_v420.z.number(), import_v420.z.boolean()])
3277
3396
  ),
3278
- file_id: import_v419.z.string(),
3279
- filename: import_v419.z.string(),
3280
- score: import_v419.z.number(),
3281
- text: import_v419.z.string()
3397
+ file_id: import_v420.z.string(),
3398
+ filename: import_v420.z.string(),
3399
+ score: import_v420.z.number(),
3400
+ text: import_v420.z.string()
3282
3401
  })
3283
3402
  ).nullish()
3284
3403
  }),
3285
- import_v419.z.object({
3286
- type: import_v419.z.literal("local_shell_call"),
3287
- id: import_v419.z.string(),
3288
- call_id: import_v419.z.string(),
3289
- action: import_v419.z.object({
3290
- type: import_v419.z.literal("exec"),
3291
- command: import_v419.z.array(import_v419.z.string()),
3292
- timeout_ms: import_v419.z.number().optional(),
3293
- user: import_v419.z.string().optional(),
3294
- working_directory: import_v419.z.string().optional(),
3295
- env: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional()
3404
+ import_v420.z.object({
3405
+ type: import_v420.z.literal("local_shell_call"),
3406
+ id: import_v420.z.string(),
3407
+ call_id: import_v420.z.string(),
3408
+ action: import_v420.z.object({
3409
+ type: import_v420.z.literal("exec"),
3410
+ command: import_v420.z.array(import_v420.z.string()),
3411
+ timeout_ms: import_v420.z.number().optional(),
3412
+ user: import_v420.z.string().optional(),
3413
+ working_directory: import_v420.z.string().optional(),
3414
+ env: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional()
3296
3415
  })
3297
3416
  }),
3298
- import_v419.z.object({
3299
- type: import_v419.z.literal("computer_call"),
3300
- id: import_v419.z.string(),
3301
- status: import_v419.z.literal("completed")
3417
+ import_v420.z.object({
3418
+ type: import_v420.z.literal("computer_call"),
3419
+ id: import_v420.z.string(),
3420
+ status: import_v420.z.literal("completed")
3302
3421
  }),
3303
- import_v419.z.object({
3304
- type: import_v419.z.literal("mcp_call"),
3305
- id: import_v419.z.string(),
3306
- status: import_v419.z.string(),
3307
- arguments: import_v419.z.string(),
3308
- name: import_v419.z.string(),
3309
- server_label: import_v419.z.string(),
3310
- output: import_v419.z.string().nullish(),
3311
- error: import_v419.z.union([
3312
- import_v419.z.string(),
3313
- import_v419.z.object({
3314
- type: import_v419.z.string().optional(),
3315
- code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
3316
- message: import_v419.z.string().optional()
3422
+ import_v420.z.object({
3423
+ type: import_v420.z.literal("mcp_call"),
3424
+ id: import_v420.z.string(),
3425
+ status: import_v420.z.string(),
3426
+ arguments: import_v420.z.string(),
3427
+ name: import_v420.z.string(),
3428
+ server_label: import_v420.z.string(),
3429
+ output: import_v420.z.string().nullish(),
3430
+ error: import_v420.z.union([
3431
+ import_v420.z.string(),
3432
+ import_v420.z.object({
3433
+ type: import_v420.z.string().optional(),
3434
+ code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
3435
+ message: import_v420.z.string().optional()
3317
3436
  }).loose()
3318
3437
  ]).nullish(),
3319
- approval_request_id: import_v419.z.string().nullish()
3438
+ approval_request_id: import_v420.z.string().nullish()
3320
3439
  }),
3321
- import_v419.z.object({
3322
- type: import_v419.z.literal("mcp_list_tools"),
3323
- id: import_v419.z.string(),
3324
- server_label: import_v419.z.string(),
3325
- tools: import_v419.z.array(
3326
- import_v419.z.object({
3327
- name: import_v419.z.string(),
3328
- description: import_v419.z.string().optional(),
3329
- input_schema: import_v419.z.any(),
3330
- annotations: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()).optional()
3440
+ import_v420.z.object({
3441
+ type: import_v420.z.literal("mcp_list_tools"),
3442
+ id: import_v420.z.string(),
3443
+ server_label: import_v420.z.string(),
3444
+ tools: import_v420.z.array(
3445
+ import_v420.z.object({
3446
+ name: import_v420.z.string(),
3447
+ description: import_v420.z.string().optional(),
3448
+ input_schema: import_v420.z.any(),
3449
+ annotations: import_v420.z.record(import_v420.z.string(), import_v420.z.unknown()).optional()
3331
3450
  })
3332
3451
  ),
3333
- error: import_v419.z.union([
3334
- import_v419.z.string(),
3335
- import_v419.z.object({
3336
- type: import_v419.z.string().optional(),
3337
- code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
3338
- message: import_v419.z.string().optional()
3452
+ error: import_v420.z.union([
3453
+ import_v420.z.string(),
3454
+ import_v420.z.object({
3455
+ type: import_v420.z.string().optional(),
3456
+ code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
3457
+ message: import_v420.z.string().optional()
3339
3458
  }).loose()
3340
3459
  ]).optional()
3341
3460
  }),
3342
- import_v419.z.object({
3343
- type: import_v419.z.literal("mcp_approval_request"),
3344
- id: import_v419.z.string(),
3345
- server_label: import_v419.z.string(),
3346
- name: import_v419.z.string(),
3347
- arguments: import_v419.z.string(),
3348
- approval_request_id: import_v419.z.string().optional()
3461
+ import_v420.z.object({
3462
+ type: import_v420.z.literal("mcp_approval_request"),
3463
+ id: import_v420.z.string(),
3464
+ server_label: import_v420.z.string(),
3465
+ name: import_v420.z.string(),
3466
+ arguments: import_v420.z.string(),
3467
+ approval_request_id: import_v420.z.string().optional()
3349
3468
  }),
3350
- import_v419.z.object({
3351
- type: import_v419.z.literal("apply_patch_call"),
3352
- id: import_v419.z.string(),
3353
- call_id: import_v419.z.string(),
3354
- status: import_v419.z.enum(["in_progress", "completed"]),
3355
- operation: import_v419.z.discriminatedUnion("type", [
3356
- import_v419.z.object({
3357
- type: import_v419.z.literal("create_file"),
3358
- path: import_v419.z.string(),
3359
- diff: import_v419.z.string()
3469
+ import_v420.z.object({
3470
+ type: import_v420.z.literal("apply_patch_call"),
3471
+ id: import_v420.z.string(),
3472
+ call_id: import_v420.z.string(),
3473
+ status: import_v420.z.enum(["in_progress", "completed"]),
3474
+ operation: import_v420.z.discriminatedUnion("type", [
3475
+ import_v420.z.object({
3476
+ type: import_v420.z.literal("create_file"),
3477
+ path: import_v420.z.string(),
3478
+ diff: import_v420.z.string()
3360
3479
  }),
3361
- import_v419.z.object({
3362
- type: import_v419.z.literal("delete_file"),
3363
- path: import_v419.z.string()
3480
+ import_v420.z.object({
3481
+ type: import_v420.z.literal("delete_file"),
3482
+ path: import_v420.z.string()
3364
3483
  }),
3365
- import_v419.z.object({
3366
- type: import_v419.z.literal("update_file"),
3367
- path: import_v419.z.string(),
3368
- diff: import_v419.z.string()
3484
+ import_v420.z.object({
3485
+ type: import_v420.z.literal("update_file"),
3486
+ path: import_v420.z.string(),
3487
+ diff: import_v420.z.string()
3369
3488
  })
3370
3489
  ])
3371
3490
  }),
3372
- import_v419.z.object({
3373
- type: import_v419.z.literal("shell_call"),
3374
- id: import_v419.z.string(),
3375
- call_id: import_v419.z.string(),
3376
- status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
3377
- action: import_v419.z.object({
3378
- commands: import_v419.z.array(import_v419.z.string())
3491
+ import_v420.z.object({
3492
+ type: import_v420.z.literal("shell_call"),
3493
+ id: import_v420.z.string(),
3494
+ call_id: import_v420.z.string(),
3495
+ status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
3496
+ action: import_v420.z.object({
3497
+ commands: import_v420.z.array(import_v420.z.string())
3379
3498
  })
3380
3499
  }),
3381
- import_v419.z.object({
3382
- type: import_v419.z.literal("shell_call_output"),
3383
- id: import_v419.z.string(),
3384
- call_id: import_v419.z.string(),
3385
- status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
3386
- output: import_v419.z.array(
3387
- import_v419.z.object({
3388
- stdout: import_v419.z.string(),
3389
- stderr: import_v419.z.string(),
3390
- outcome: import_v419.z.discriminatedUnion("type", [
3391
- import_v419.z.object({ type: import_v419.z.literal("timeout") }),
3392
- import_v419.z.object({
3393
- type: import_v419.z.literal("exit"),
3394
- exit_code: import_v419.z.number()
3500
+ import_v420.z.object({
3501
+ type: import_v420.z.literal("shell_call_output"),
3502
+ id: import_v420.z.string(),
3503
+ call_id: import_v420.z.string(),
3504
+ status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
3505
+ output: import_v420.z.array(
3506
+ import_v420.z.object({
3507
+ stdout: import_v420.z.string(),
3508
+ stderr: import_v420.z.string(),
3509
+ outcome: import_v420.z.discriminatedUnion("type", [
3510
+ import_v420.z.object({ type: import_v420.z.literal("timeout") }),
3511
+ import_v420.z.object({
3512
+ type: import_v420.z.literal("exit"),
3513
+ exit_code: import_v420.z.number()
3395
3514
  })
3396
3515
  ])
3397
3516
  })
@@ -3399,101 +3518,107 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3399
3518
  })
3400
3519
  ])
3401
3520
  }),
3402
- import_v419.z.object({
3403
- type: import_v419.z.literal("response.function_call_arguments.delta"),
3404
- item_id: import_v419.z.string(),
3405
- output_index: import_v419.z.number(),
3406
- delta: import_v419.z.string()
3521
+ import_v420.z.object({
3522
+ type: import_v420.z.literal("response.function_call_arguments.delta"),
3523
+ item_id: import_v420.z.string(),
3524
+ output_index: import_v420.z.number(),
3525
+ delta: import_v420.z.string()
3526
+ }),
3527
+ import_v420.z.object({
3528
+ type: import_v420.z.literal("response.custom_tool_call_input.delta"),
3529
+ item_id: import_v420.z.string(),
3530
+ output_index: import_v420.z.number(),
3531
+ delta: import_v420.z.string()
3407
3532
  }),
3408
- import_v419.z.object({
3409
- type: import_v419.z.literal("response.image_generation_call.partial_image"),
3410
- item_id: import_v419.z.string(),
3411
- output_index: import_v419.z.number(),
3412
- partial_image_b64: import_v419.z.string()
3533
+ import_v420.z.object({
3534
+ type: import_v420.z.literal("response.image_generation_call.partial_image"),
3535
+ item_id: import_v420.z.string(),
3536
+ output_index: import_v420.z.number(),
3537
+ partial_image_b64: import_v420.z.string()
3413
3538
  }),
3414
- import_v419.z.object({
3415
- type: import_v419.z.literal("response.code_interpreter_call_code.delta"),
3416
- item_id: import_v419.z.string(),
3417
- output_index: import_v419.z.number(),
3418
- delta: import_v419.z.string()
3539
+ import_v420.z.object({
3540
+ type: import_v420.z.literal("response.code_interpreter_call_code.delta"),
3541
+ item_id: import_v420.z.string(),
3542
+ output_index: import_v420.z.number(),
3543
+ delta: import_v420.z.string()
3419
3544
  }),
3420
- import_v419.z.object({
3421
- type: import_v419.z.literal("response.code_interpreter_call_code.done"),
3422
- item_id: import_v419.z.string(),
3423
- output_index: import_v419.z.number(),
3424
- code: import_v419.z.string()
3545
+ import_v420.z.object({
3546
+ type: import_v420.z.literal("response.code_interpreter_call_code.done"),
3547
+ item_id: import_v420.z.string(),
3548
+ output_index: import_v420.z.number(),
3549
+ code: import_v420.z.string()
3425
3550
  }),
3426
- import_v419.z.object({
3427
- type: import_v419.z.literal("response.output_text.annotation.added"),
3428
- annotation: import_v419.z.discriminatedUnion("type", [
3429
- import_v419.z.object({
3430
- type: import_v419.z.literal("url_citation"),
3431
- start_index: import_v419.z.number(),
3432
- end_index: import_v419.z.number(),
3433
- url: import_v419.z.string(),
3434
- title: import_v419.z.string()
3551
+ import_v420.z.object({
3552
+ type: import_v420.z.literal("response.output_text.annotation.added"),
3553
+ annotation: import_v420.z.discriminatedUnion("type", [
3554
+ import_v420.z.object({
3555
+ type: import_v420.z.literal("url_citation"),
3556
+ start_index: import_v420.z.number(),
3557
+ end_index: import_v420.z.number(),
3558
+ url: import_v420.z.string(),
3559
+ title: import_v420.z.string()
3435
3560
  }),
3436
- import_v419.z.object({
3437
- type: import_v419.z.literal("file_citation"),
3438
- file_id: import_v419.z.string(),
3439
- filename: import_v419.z.string(),
3440
- index: import_v419.z.number()
3561
+ import_v420.z.object({
3562
+ type: import_v420.z.literal("file_citation"),
3563
+ file_id: import_v420.z.string(),
3564
+ filename: import_v420.z.string(),
3565
+ index: import_v420.z.number()
3441
3566
  }),
3442
- import_v419.z.object({
3443
- type: import_v419.z.literal("container_file_citation"),
3444
- container_id: import_v419.z.string(),
3445
- file_id: import_v419.z.string(),
3446
- filename: import_v419.z.string(),
3447
- start_index: import_v419.z.number(),
3448
- end_index: import_v419.z.number()
3567
+ import_v420.z.object({
3568
+ type: import_v420.z.literal("container_file_citation"),
3569
+ container_id: import_v420.z.string(),
3570
+ file_id: import_v420.z.string(),
3571
+ filename: import_v420.z.string(),
3572
+ start_index: import_v420.z.number(),
3573
+ end_index: import_v420.z.number()
3449
3574
  }),
3450
- import_v419.z.object({
3451
- type: import_v419.z.literal("file_path"),
3452
- file_id: import_v419.z.string(),
3453
- index: import_v419.z.number()
3575
+ import_v420.z.object({
3576
+ type: import_v420.z.literal("file_path"),
3577
+ file_id: import_v420.z.string(),
3578
+ index: import_v420.z.number()
3454
3579
  })
3455
3580
  ])
3456
3581
  }),
3457
- import_v419.z.object({
3458
- type: import_v419.z.literal("response.reasoning_summary_part.added"),
3459
- item_id: import_v419.z.string(),
3460
- summary_index: import_v419.z.number()
3582
+ import_v420.z.object({
3583
+ type: import_v420.z.literal("response.reasoning_summary_part.added"),
3584
+ item_id: import_v420.z.string(),
3585
+ summary_index: import_v420.z.number()
3461
3586
  }),
3462
- import_v419.z.object({
3463
- type: import_v419.z.literal("response.reasoning_summary_text.delta"),
3464
- item_id: import_v419.z.string(),
3465
- summary_index: import_v419.z.number(),
3466
- delta: import_v419.z.string()
3587
+ import_v420.z.object({
3588
+ type: import_v420.z.literal("response.reasoning_summary_text.delta"),
3589
+ item_id: import_v420.z.string(),
3590
+ summary_index: import_v420.z.number(),
3591
+ delta: import_v420.z.string()
3467
3592
  }),
3468
- import_v419.z.object({
3469
- type: import_v419.z.literal("response.reasoning_summary_part.done"),
3470
- item_id: import_v419.z.string(),
3471
- summary_index: import_v419.z.number()
3593
+ import_v420.z.object({
3594
+ type: import_v420.z.literal("response.reasoning_summary_part.done"),
3595
+ item_id: import_v420.z.string(),
3596
+ summary_index: import_v420.z.number()
3472
3597
  }),
3473
- import_v419.z.object({
3474
- type: import_v419.z.literal("response.apply_patch_call_operation_diff.delta"),
3475
- item_id: import_v419.z.string(),
3476
- output_index: import_v419.z.number(),
3477
- delta: import_v419.z.string(),
3478
- obfuscation: import_v419.z.string().nullish()
3598
+ import_v420.z.object({
3599
+ type: import_v420.z.literal("response.apply_patch_call_operation_diff.delta"),
3600
+ item_id: import_v420.z.string(),
3601
+ output_index: import_v420.z.number(),
3602
+ delta: import_v420.z.string(),
3603
+ obfuscation: import_v420.z.string().nullish()
3479
3604
  }),
3480
- import_v419.z.object({
3481
- type: import_v419.z.literal("response.apply_patch_call_operation_diff.done"),
3482
- item_id: import_v419.z.string(),
3483
- output_index: import_v419.z.number(),
3484
- diff: import_v419.z.string()
3605
+ import_v420.z.object({
3606
+ type: import_v420.z.literal("response.apply_patch_call_operation_diff.done"),
3607
+ item_id: import_v420.z.string(),
3608
+ output_index: import_v420.z.number(),
3609
+ diff: import_v420.z.string()
3485
3610
  }),
3486
- import_v419.z.object({
3487
- type: import_v419.z.literal("error"),
3488
- sequence_number: import_v419.z.number(),
3489
- error: import_v419.z.object({
3490
- type: import_v419.z.string(),
3491
- code: import_v419.z.string(),
3492
- message: import_v419.z.string(),
3493
- param: import_v419.z.string().nullish()
3611
+ import_v420.z.object({
3612
+ type: import_v420.z.literal("error"),
3613
+ sequence_number: import_v420.z.number(),
3614
+ error: import_v420.z.object({
3615
+ type: import_v420.z.string(),
3616
+ code: import_v420.z.string(),
3617
+ message: import_v420.z.string(),
3618
+ param: import_v420.z.string().nullish()
3494
3619
  })
3495
3620
  }),
3496
- import_v419.z.object({ type: import_v419.z.string() }).loose().transform((value) => ({
3621
+ import_v420.z.object({ type: import_v420.z.string() }).loose().transform((value) => ({
3497
3622
  type: "unknown_chunk",
3498
3623
  message: value.type
3499
3624
  }))
@@ -3501,265 +3626,272 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
3501
3626
  ])
3502
3627
  )
3503
3628
  );
3504
- var openaiResponsesResponseSchema = (0, import_provider_utils24.lazySchema)(
3505
- () => (0, import_provider_utils24.zodSchema)(
3506
- import_v419.z.object({
3507
- id: import_v419.z.string().optional(),
3508
- created_at: import_v419.z.number().optional(),
3509
- error: import_v419.z.object({
3510
- message: import_v419.z.string(),
3511
- type: import_v419.z.string(),
3512
- param: import_v419.z.string().nullish(),
3513
- code: import_v419.z.string()
3629
+ var openaiResponsesResponseSchema = (0, import_provider_utils25.lazySchema)(
3630
+ () => (0, import_provider_utils25.zodSchema)(
3631
+ import_v420.z.object({
3632
+ id: import_v420.z.string().optional(),
3633
+ created_at: import_v420.z.number().optional(),
3634
+ error: import_v420.z.object({
3635
+ message: import_v420.z.string(),
3636
+ type: import_v420.z.string(),
3637
+ param: import_v420.z.string().nullish(),
3638
+ code: import_v420.z.string()
3514
3639
  }).nullish(),
3515
- model: import_v419.z.string().optional(),
3516
- output: import_v419.z.array(
3517
- import_v419.z.discriminatedUnion("type", [
3518
- import_v419.z.object({
3519
- type: import_v419.z.literal("message"),
3520
- role: import_v419.z.literal("assistant"),
3521
- id: import_v419.z.string(),
3522
- phase: import_v419.z.enum(["commentary", "final_answer"]).nullish(),
3523
- content: import_v419.z.array(
3524
- import_v419.z.object({
3525
- type: import_v419.z.literal("output_text"),
3526
- text: import_v419.z.string(),
3527
- logprobs: import_v419.z.array(
3528
- import_v419.z.object({
3529
- token: import_v419.z.string(),
3530
- logprob: import_v419.z.number(),
3531
- top_logprobs: import_v419.z.array(
3532
- import_v419.z.object({
3533
- token: import_v419.z.string(),
3534
- logprob: import_v419.z.number()
3640
+ model: import_v420.z.string().optional(),
3641
+ output: import_v420.z.array(
3642
+ import_v420.z.discriminatedUnion("type", [
3643
+ import_v420.z.object({
3644
+ type: import_v420.z.literal("message"),
3645
+ role: import_v420.z.literal("assistant"),
3646
+ id: import_v420.z.string(),
3647
+ phase: import_v420.z.enum(["commentary", "final_answer"]).nullish(),
3648
+ content: import_v420.z.array(
3649
+ import_v420.z.object({
3650
+ type: import_v420.z.literal("output_text"),
3651
+ text: import_v420.z.string(),
3652
+ logprobs: import_v420.z.array(
3653
+ import_v420.z.object({
3654
+ token: import_v420.z.string(),
3655
+ logprob: import_v420.z.number(),
3656
+ top_logprobs: import_v420.z.array(
3657
+ import_v420.z.object({
3658
+ token: import_v420.z.string(),
3659
+ logprob: import_v420.z.number()
3535
3660
  })
3536
3661
  )
3537
3662
  })
3538
3663
  ).nullish(),
3539
- annotations: import_v419.z.array(
3540
- import_v419.z.discriminatedUnion("type", [
3541
- import_v419.z.object({
3542
- type: import_v419.z.literal("url_citation"),
3543
- start_index: import_v419.z.number(),
3544
- end_index: import_v419.z.number(),
3545
- url: import_v419.z.string(),
3546
- title: import_v419.z.string()
3664
+ annotations: import_v420.z.array(
3665
+ import_v420.z.discriminatedUnion("type", [
3666
+ import_v420.z.object({
3667
+ type: import_v420.z.literal("url_citation"),
3668
+ start_index: import_v420.z.number(),
3669
+ end_index: import_v420.z.number(),
3670
+ url: import_v420.z.string(),
3671
+ title: import_v420.z.string()
3547
3672
  }),
3548
- import_v419.z.object({
3549
- type: import_v419.z.literal("file_citation"),
3550
- file_id: import_v419.z.string(),
3551
- filename: import_v419.z.string(),
3552
- index: import_v419.z.number()
3673
+ import_v420.z.object({
3674
+ type: import_v420.z.literal("file_citation"),
3675
+ file_id: import_v420.z.string(),
3676
+ filename: import_v420.z.string(),
3677
+ index: import_v420.z.number()
3553
3678
  }),
3554
- import_v419.z.object({
3555
- type: import_v419.z.literal("container_file_citation"),
3556
- container_id: import_v419.z.string(),
3557
- file_id: import_v419.z.string(),
3558
- filename: import_v419.z.string(),
3559
- start_index: import_v419.z.number(),
3560
- end_index: import_v419.z.number()
3679
+ import_v420.z.object({
3680
+ type: import_v420.z.literal("container_file_citation"),
3681
+ container_id: import_v420.z.string(),
3682
+ file_id: import_v420.z.string(),
3683
+ filename: import_v420.z.string(),
3684
+ start_index: import_v420.z.number(),
3685
+ end_index: import_v420.z.number()
3561
3686
  }),
3562
- import_v419.z.object({
3563
- type: import_v419.z.literal("file_path"),
3564
- file_id: import_v419.z.string(),
3565
- index: import_v419.z.number()
3687
+ import_v420.z.object({
3688
+ type: import_v420.z.literal("file_path"),
3689
+ file_id: import_v420.z.string(),
3690
+ index: import_v420.z.number()
3566
3691
  })
3567
3692
  ])
3568
3693
  )
3569
3694
  })
3570
3695
  )
3571
3696
  }),
3572
- import_v419.z.object({
3573
- type: import_v419.z.literal("web_search_call"),
3574
- id: import_v419.z.string(),
3575
- status: import_v419.z.string(),
3576
- action: import_v419.z.discriminatedUnion("type", [
3577
- import_v419.z.object({
3578
- type: import_v419.z.literal("search"),
3579
- query: import_v419.z.string().nullish(),
3580
- sources: import_v419.z.array(
3581
- import_v419.z.discriminatedUnion("type", [
3582
- import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
3583
- import_v419.z.object({
3584
- type: import_v419.z.literal("api"),
3585
- name: import_v419.z.string()
3697
+ import_v420.z.object({
3698
+ type: import_v420.z.literal("web_search_call"),
3699
+ id: import_v420.z.string(),
3700
+ status: import_v420.z.string(),
3701
+ action: import_v420.z.discriminatedUnion("type", [
3702
+ import_v420.z.object({
3703
+ type: import_v420.z.literal("search"),
3704
+ query: import_v420.z.string().nullish(),
3705
+ sources: import_v420.z.array(
3706
+ import_v420.z.discriminatedUnion("type", [
3707
+ import_v420.z.object({ type: import_v420.z.literal("url"), url: import_v420.z.string() }),
3708
+ import_v420.z.object({
3709
+ type: import_v420.z.literal("api"),
3710
+ name: import_v420.z.string()
3586
3711
  })
3587
3712
  ])
3588
3713
  ).nullish()
3589
3714
  }),
3590
- import_v419.z.object({
3591
- type: import_v419.z.literal("open_page"),
3592
- url: import_v419.z.string().nullish()
3715
+ import_v420.z.object({
3716
+ type: import_v420.z.literal("open_page"),
3717
+ url: import_v420.z.string().nullish()
3593
3718
  }),
3594
- import_v419.z.object({
3595
- type: import_v419.z.literal("find_in_page"),
3596
- url: import_v419.z.string().nullish(),
3597
- pattern: import_v419.z.string().nullish()
3719
+ import_v420.z.object({
3720
+ type: import_v420.z.literal("find_in_page"),
3721
+ url: import_v420.z.string().nullish(),
3722
+ pattern: import_v420.z.string().nullish()
3598
3723
  })
3599
3724
  ]).nullish()
3600
3725
  }),
3601
- import_v419.z.object({
3602
- type: import_v419.z.literal("file_search_call"),
3603
- id: import_v419.z.string(),
3604
- queries: import_v419.z.array(import_v419.z.string()),
3605
- results: import_v419.z.array(
3606
- import_v419.z.object({
3607
- attributes: import_v419.z.record(
3608
- import_v419.z.string(),
3609
- import_v419.z.union([import_v419.z.string(), import_v419.z.number(), import_v419.z.boolean()])
3726
+ import_v420.z.object({
3727
+ type: import_v420.z.literal("file_search_call"),
3728
+ id: import_v420.z.string(),
3729
+ queries: import_v420.z.array(import_v420.z.string()),
3730
+ results: import_v420.z.array(
3731
+ import_v420.z.object({
3732
+ attributes: import_v420.z.record(
3733
+ import_v420.z.string(),
3734
+ import_v420.z.union([import_v420.z.string(), import_v420.z.number(), import_v420.z.boolean()])
3610
3735
  ),
3611
- file_id: import_v419.z.string(),
3612
- filename: import_v419.z.string(),
3613
- score: import_v419.z.number(),
3614
- text: import_v419.z.string()
3736
+ file_id: import_v420.z.string(),
3737
+ filename: import_v420.z.string(),
3738
+ score: import_v420.z.number(),
3739
+ text: import_v420.z.string()
3615
3740
  })
3616
3741
  ).nullish()
3617
3742
  }),
3618
- import_v419.z.object({
3619
- type: import_v419.z.literal("code_interpreter_call"),
3620
- id: import_v419.z.string(),
3621
- code: import_v419.z.string().nullable(),
3622
- container_id: import_v419.z.string(),
3623
- outputs: import_v419.z.array(
3624
- import_v419.z.discriminatedUnion("type", [
3625
- import_v419.z.object({ type: import_v419.z.literal("logs"), logs: import_v419.z.string() }),
3626
- import_v419.z.object({ type: import_v419.z.literal("image"), url: import_v419.z.string() })
3743
+ import_v420.z.object({
3744
+ type: import_v420.z.literal("code_interpreter_call"),
3745
+ id: import_v420.z.string(),
3746
+ code: import_v420.z.string().nullable(),
3747
+ container_id: import_v420.z.string(),
3748
+ outputs: import_v420.z.array(
3749
+ import_v420.z.discriminatedUnion("type", [
3750
+ import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
3751
+ import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
3627
3752
  ])
3628
3753
  ).nullable()
3629
3754
  }),
3630
- import_v419.z.object({
3631
- type: import_v419.z.literal("image_generation_call"),
3632
- id: import_v419.z.string(),
3633
- result: import_v419.z.string()
3755
+ import_v420.z.object({
3756
+ type: import_v420.z.literal("image_generation_call"),
3757
+ id: import_v420.z.string(),
3758
+ result: import_v420.z.string()
3634
3759
  }),
3635
- import_v419.z.object({
3636
- type: import_v419.z.literal("local_shell_call"),
3637
- id: import_v419.z.string(),
3638
- call_id: import_v419.z.string(),
3639
- action: import_v419.z.object({
3640
- type: import_v419.z.literal("exec"),
3641
- command: import_v419.z.array(import_v419.z.string()),
3642
- timeout_ms: import_v419.z.number().optional(),
3643
- user: import_v419.z.string().optional(),
3644
- working_directory: import_v419.z.string().optional(),
3645
- env: import_v419.z.record(import_v419.z.string(), import_v419.z.string()).optional()
3760
+ import_v420.z.object({
3761
+ type: import_v420.z.literal("local_shell_call"),
3762
+ id: import_v420.z.string(),
3763
+ call_id: import_v420.z.string(),
3764
+ action: import_v420.z.object({
3765
+ type: import_v420.z.literal("exec"),
3766
+ command: import_v420.z.array(import_v420.z.string()),
3767
+ timeout_ms: import_v420.z.number().optional(),
3768
+ user: import_v420.z.string().optional(),
3769
+ working_directory: import_v420.z.string().optional(),
3770
+ env: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional()
3646
3771
  })
3647
3772
  }),
3648
- import_v419.z.object({
3649
- type: import_v419.z.literal("function_call"),
3650
- call_id: import_v419.z.string(),
3651
- name: import_v419.z.string(),
3652
- arguments: import_v419.z.string(),
3653
- id: import_v419.z.string()
3773
+ import_v420.z.object({
3774
+ type: import_v420.z.literal("function_call"),
3775
+ call_id: import_v420.z.string(),
3776
+ name: import_v420.z.string(),
3777
+ arguments: import_v420.z.string(),
3778
+ id: import_v420.z.string()
3654
3779
  }),
3655
- import_v419.z.object({
3656
- type: import_v419.z.literal("computer_call"),
3657
- id: import_v419.z.string(),
3658
- status: import_v419.z.string().optional()
3780
+ import_v420.z.object({
3781
+ type: import_v420.z.literal("custom_tool_call"),
3782
+ call_id: import_v420.z.string(),
3783
+ name: import_v420.z.string(),
3784
+ input: import_v420.z.string(),
3785
+ id: import_v420.z.string()
3659
3786
  }),
3660
- import_v419.z.object({
3661
- type: import_v419.z.literal("reasoning"),
3662
- id: import_v419.z.string(),
3663
- encrypted_content: import_v419.z.string().nullish(),
3664
- summary: import_v419.z.array(
3665
- import_v419.z.object({
3666
- type: import_v419.z.literal("summary_text"),
3667
- text: import_v419.z.string()
3787
+ import_v420.z.object({
3788
+ type: import_v420.z.literal("computer_call"),
3789
+ id: import_v420.z.string(),
3790
+ status: import_v420.z.string().optional()
3791
+ }),
3792
+ import_v420.z.object({
3793
+ type: import_v420.z.literal("reasoning"),
3794
+ id: import_v420.z.string(),
3795
+ encrypted_content: import_v420.z.string().nullish(),
3796
+ summary: import_v420.z.array(
3797
+ import_v420.z.object({
3798
+ type: import_v420.z.literal("summary_text"),
3799
+ text: import_v420.z.string()
3668
3800
  })
3669
3801
  )
3670
3802
  }),
3671
- import_v419.z.object({
3672
- type: import_v419.z.literal("mcp_call"),
3673
- id: import_v419.z.string(),
3674
- status: import_v419.z.string(),
3675
- arguments: import_v419.z.string(),
3676
- name: import_v419.z.string(),
3677
- server_label: import_v419.z.string(),
3678
- output: import_v419.z.string().nullish(),
3679
- error: import_v419.z.union([
3680
- import_v419.z.string(),
3681
- import_v419.z.object({
3682
- type: import_v419.z.string().optional(),
3683
- code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
3684
- message: import_v419.z.string().optional()
3803
+ import_v420.z.object({
3804
+ type: import_v420.z.literal("mcp_call"),
3805
+ id: import_v420.z.string(),
3806
+ status: import_v420.z.string(),
3807
+ arguments: import_v420.z.string(),
3808
+ name: import_v420.z.string(),
3809
+ server_label: import_v420.z.string(),
3810
+ output: import_v420.z.string().nullish(),
3811
+ error: import_v420.z.union([
3812
+ import_v420.z.string(),
3813
+ import_v420.z.object({
3814
+ type: import_v420.z.string().optional(),
3815
+ code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
3816
+ message: import_v420.z.string().optional()
3685
3817
  }).loose()
3686
3818
  ]).nullish(),
3687
- approval_request_id: import_v419.z.string().nullish()
3819
+ approval_request_id: import_v420.z.string().nullish()
3688
3820
  }),
3689
- import_v419.z.object({
3690
- type: import_v419.z.literal("mcp_list_tools"),
3691
- id: import_v419.z.string(),
3692
- server_label: import_v419.z.string(),
3693
- tools: import_v419.z.array(
3694
- import_v419.z.object({
3695
- name: import_v419.z.string(),
3696
- description: import_v419.z.string().optional(),
3697
- input_schema: import_v419.z.any(),
3698
- annotations: import_v419.z.record(import_v419.z.string(), import_v419.z.unknown()).optional()
3821
+ import_v420.z.object({
3822
+ type: import_v420.z.literal("mcp_list_tools"),
3823
+ id: import_v420.z.string(),
3824
+ server_label: import_v420.z.string(),
3825
+ tools: import_v420.z.array(
3826
+ import_v420.z.object({
3827
+ name: import_v420.z.string(),
3828
+ description: import_v420.z.string().optional(),
3829
+ input_schema: import_v420.z.any(),
3830
+ annotations: import_v420.z.record(import_v420.z.string(), import_v420.z.unknown()).optional()
3699
3831
  })
3700
3832
  ),
3701
- error: import_v419.z.union([
3702
- import_v419.z.string(),
3703
- import_v419.z.object({
3704
- type: import_v419.z.string().optional(),
3705
- code: import_v419.z.union([import_v419.z.number(), import_v419.z.string()]).optional(),
3706
- message: import_v419.z.string().optional()
3833
+ error: import_v420.z.union([
3834
+ import_v420.z.string(),
3835
+ import_v420.z.object({
3836
+ type: import_v420.z.string().optional(),
3837
+ code: import_v420.z.union([import_v420.z.number(), import_v420.z.string()]).optional(),
3838
+ message: import_v420.z.string().optional()
3707
3839
  }).loose()
3708
3840
  ]).optional()
3709
3841
  }),
3710
- import_v419.z.object({
3711
- type: import_v419.z.literal("mcp_approval_request"),
3712
- id: import_v419.z.string(),
3713
- server_label: import_v419.z.string(),
3714
- name: import_v419.z.string(),
3715
- arguments: import_v419.z.string(),
3716
- approval_request_id: import_v419.z.string().optional()
3842
+ import_v420.z.object({
3843
+ type: import_v420.z.literal("mcp_approval_request"),
3844
+ id: import_v420.z.string(),
3845
+ server_label: import_v420.z.string(),
3846
+ name: import_v420.z.string(),
3847
+ arguments: import_v420.z.string(),
3848
+ approval_request_id: import_v420.z.string().optional()
3717
3849
  }),
3718
- import_v419.z.object({
3719
- type: import_v419.z.literal("apply_patch_call"),
3720
- id: import_v419.z.string(),
3721
- call_id: import_v419.z.string(),
3722
- status: import_v419.z.enum(["in_progress", "completed"]),
3723
- operation: import_v419.z.discriminatedUnion("type", [
3724
- import_v419.z.object({
3725
- type: import_v419.z.literal("create_file"),
3726
- path: import_v419.z.string(),
3727
- diff: import_v419.z.string()
3850
+ import_v420.z.object({
3851
+ type: import_v420.z.literal("apply_patch_call"),
3852
+ id: import_v420.z.string(),
3853
+ call_id: import_v420.z.string(),
3854
+ status: import_v420.z.enum(["in_progress", "completed"]),
3855
+ operation: import_v420.z.discriminatedUnion("type", [
3856
+ import_v420.z.object({
3857
+ type: import_v420.z.literal("create_file"),
3858
+ path: import_v420.z.string(),
3859
+ diff: import_v420.z.string()
3728
3860
  }),
3729
- import_v419.z.object({
3730
- type: import_v419.z.literal("delete_file"),
3731
- path: import_v419.z.string()
3861
+ import_v420.z.object({
3862
+ type: import_v420.z.literal("delete_file"),
3863
+ path: import_v420.z.string()
3732
3864
  }),
3733
- import_v419.z.object({
3734
- type: import_v419.z.literal("update_file"),
3735
- path: import_v419.z.string(),
3736
- diff: import_v419.z.string()
3865
+ import_v420.z.object({
3866
+ type: import_v420.z.literal("update_file"),
3867
+ path: import_v420.z.string(),
3868
+ diff: import_v420.z.string()
3737
3869
  })
3738
3870
  ])
3739
3871
  }),
3740
- import_v419.z.object({
3741
- type: import_v419.z.literal("shell_call"),
3742
- id: import_v419.z.string(),
3743
- call_id: import_v419.z.string(),
3744
- status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
3745
- action: import_v419.z.object({
3746
- commands: import_v419.z.array(import_v419.z.string())
3872
+ import_v420.z.object({
3873
+ type: import_v420.z.literal("shell_call"),
3874
+ id: import_v420.z.string(),
3875
+ call_id: import_v420.z.string(),
3876
+ status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
3877
+ action: import_v420.z.object({
3878
+ commands: import_v420.z.array(import_v420.z.string())
3747
3879
  })
3748
3880
  }),
3749
- import_v419.z.object({
3750
- type: import_v419.z.literal("shell_call_output"),
3751
- id: import_v419.z.string(),
3752
- call_id: import_v419.z.string(),
3753
- status: import_v419.z.enum(["in_progress", "completed", "incomplete"]),
3754
- output: import_v419.z.array(
3755
- import_v419.z.object({
3756
- stdout: import_v419.z.string(),
3757
- stderr: import_v419.z.string(),
3758
- outcome: import_v419.z.discriminatedUnion("type", [
3759
- import_v419.z.object({ type: import_v419.z.literal("timeout") }),
3760
- import_v419.z.object({
3761
- type: import_v419.z.literal("exit"),
3762
- exit_code: import_v419.z.number()
3881
+ import_v420.z.object({
3882
+ type: import_v420.z.literal("shell_call_output"),
3883
+ id: import_v420.z.string(),
3884
+ call_id: import_v420.z.string(),
3885
+ status: import_v420.z.enum(["in_progress", "completed", "incomplete"]),
3886
+ output: import_v420.z.array(
3887
+ import_v420.z.object({
3888
+ stdout: import_v420.z.string(),
3889
+ stderr: import_v420.z.string(),
3890
+ outcome: import_v420.z.discriminatedUnion("type", [
3891
+ import_v420.z.object({ type: import_v420.z.literal("timeout") }),
3892
+ import_v420.z.object({
3893
+ type: import_v420.z.literal("exit"),
3894
+ exit_code: import_v420.z.number()
3763
3895
  })
3764
3896
  ])
3765
3897
  })
@@ -3767,37 +3899,31 @@ var openaiResponsesResponseSchema = (0, import_provider_utils24.lazySchema)(
3767
3899
  })
3768
3900
  ])
3769
3901
  ).optional(),
3770
- service_tier: import_v419.z.string().nullish(),
3771
- incomplete_details: import_v419.z.object({ reason: import_v419.z.string() }).nullish(),
3772
- usage: import_v419.z.object({
3773
- input_tokens: import_v419.z.number(),
3774
- input_tokens_details: import_v419.z.object({ cached_tokens: import_v419.z.number().nullish() }).nullish(),
3775
- output_tokens: import_v419.z.number(),
3776
- output_tokens_details: import_v419.z.object({ reasoning_tokens: import_v419.z.number().nullish() }).nullish()
3902
+ service_tier: import_v420.z.string().nullish(),
3903
+ incomplete_details: import_v420.z.object({ reason: import_v420.z.string() }).nullish(),
3904
+ usage: import_v420.z.object({
3905
+ input_tokens: import_v420.z.number(),
3906
+ input_tokens_details: import_v420.z.object({ cached_tokens: import_v420.z.number().nullish() }).nullish(),
3907
+ output_tokens: import_v420.z.number(),
3908
+ output_tokens_details: import_v420.z.object({ reasoning_tokens: import_v420.z.number().nullish() }).nullish()
3777
3909
  }).optional()
3778
3910
  })
3779
3911
  )
3780
3912
  );
3781
3913
 
3782
3914
  // src/responses/openai-responses-options.ts
3783
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
3784
- var import_v420 = require("zod/v4");
3915
+ var import_provider_utils26 = require("@ai-sdk/provider-utils");
3916
+ var import_v421 = require("zod/v4");
3785
3917
  var TOP_LOGPROBS_MAX = 20;
3786
3918
  var openaiResponsesReasoningModelIds = [
3787
3919
  "o1",
3788
3920
  "o1-2024-12-17",
3789
3921
  "o3",
3790
3922
  "o3-2025-04-16",
3791
- "o3-deep-research",
3792
- "o3-deep-research-2025-06-26",
3793
3923
  "o3-mini",
3794
3924
  "o3-mini-2025-01-31",
3795
3925
  "o4-mini",
3796
3926
  "o4-mini-2025-04-16",
3797
- "o4-mini-deep-research",
3798
- "o4-mini-deep-research-2025-06-26",
3799
- "codex-mini-latest",
3800
- "computer-use-preview",
3801
3927
  "gpt-5",
3802
3928
  "gpt-5-2025-08-07",
3803
3929
  "gpt-5-codex",
@@ -3830,7 +3956,6 @@ var openaiResponsesModelIds = [
3830
3956
  "gpt-4o-2024-08-06",
3831
3957
  "gpt-4o-2024-11-20",
3832
3958
  "gpt-4o-audio-preview",
3833
- "gpt-4o-audio-preview-2024-10-01",
3834
3959
  "gpt-4o-audio-preview-2024-12-17",
3835
3960
  "gpt-4o-search-preview",
3836
3961
  "gpt-4o-search-preview-2025-03-11",
@@ -3838,25 +3963,15 @@ var openaiResponsesModelIds = [
3838
3963
  "gpt-4o-mini-search-preview-2025-03-11",
3839
3964
  "gpt-4o-mini",
3840
3965
  "gpt-4o-mini-2024-07-18",
3841
- "gpt-4-turbo",
3842
- "gpt-4-turbo-2024-04-09",
3843
- "gpt-4-turbo-preview",
3844
- "gpt-4-0125-preview",
3845
- "gpt-4-1106-preview",
3846
- "gpt-4",
3847
- "gpt-4-0613",
3848
- "gpt-4.5-preview",
3849
- "gpt-4.5-preview-2025-02-27",
3850
3966
  "gpt-3.5-turbo-0125",
3851
3967
  "gpt-3.5-turbo",
3852
3968
  "gpt-3.5-turbo-1106",
3853
- "chatgpt-4o-latest",
3854
3969
  "gpt-5-chat-latest",
3855
3970
  ...openaiResponsesReasoningModelIds
3856
3971
  ];
3857
- var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazySchema)(
3858
- () => (0, import_provider_utils25.zodSchema)(
3859
- import_v420.z.object({
3972
+ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils26.lazySchema)(
3973
+ () => (0, import_provider_utils26.zodSchema)(
3974
+ import_v421.z.object({
3860
3975
  /**
3861
3976
  * The ID of the OpenAI Conversation to continue.
3862
3977
  * You must create a conversation first via the OpenAI API.
@@ -3864,13 +3979,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3864
3979
  * Defaults to `undefined`.
3865
3980
  * @see https://platform.openai.com/docs/api-reference/conversations/create
3866
3981
  */
3867
- conversation: import_v420.z.string().nullish(),
3982
+ conversation: import_v421.z.string().nullish(),
3868
3983
  /**
3869
3984
  * The set of extra fields to include in the response (advanced, usually not needed).
3870
3985
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
3871
3986
  */
3872
- include: import_v420.z.array(
3873
- import_v420.z.enum([
3987
+ include: import_v421.z.array(
3988
+ import_v421.z.enum([
3874
3989
  "reasoning.encrypted_content",
3875
3990
  // handled internally by default, only needed for unknown reasoning models
3876
3991
  "file_search_call.results",
@@ -3882,7 +3997,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3882
3997
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
3883
3998
  * Defaults to `undefined`.
3884
3999
  */
3885
- instructions: import_v420.z.string().nullish(),
4000
+ instructions: import_v421.z.string().nullish(),
3886
4001
  /**
3887
4002
  * Return the log probabilities of the tokens. Including logprobs will increase
3888
4003
  * the response size and can slow down response times. However, it can
@@ -3897,30 +4012,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3897
4012
  * @see https://platform.openai.com/docs/api-reference/responses/create
3898
4013
  * @see https://cookbook.openai.com/examples/using_logprobs
3899
4014
  */
3900
- logprobs: import_v420.z.union([import_v420.z.boolean(), import_v420.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4015
+ logprobs: import_v421.z.union([import_v421.z.boolean(), import_v421.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3901
4016
  /**
3902
4017
  * The maximum number of total calls to built-in tools that can be processed in a response.
3903
4018
  * This maximum number applies across all built-in tool calls, not per individual tool.
3904
4019
  * Any further attempts to call a tool by the model will be ignored.
3905
4020
  */
3906
- maxToolCalls: import_v420.z.number().nullish(),
4021
+ maxToolCalls: import_v421.z.number().nullish(),
3907
4022
  /**
3908
4023
  * Additional metadata to store with the generation.
3909
4024
  */
3910
- metadata: import_v420.z.any().nullish(),
4025
+ metadata: import_v421.z.any().nullish(),
3911
4026
  /**
3912
4027
  * Whether to use parallel tool calls. Defaults to `true`.
3913
4028
  */
3914
- parallelToolCalls: import_v420.z.boolean().nullish(),
4029
+ parallelToolCalls: import_v421.z.boolean().nullish(),
3915
4030
  /**
3916
4031
  * The ID of the previous response. You can use it to continue a conversation.
3917
4032
  * Defaults to `undefined`.
3918
4033
  */
3919
- previousResponseId: import_v420.z.string().nullish(),
4034
+ previousResponseId: import_v421.z.string().nullish(),
3920
4035
  /**
3921
4036
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
3922
4037
  */
3923
- promptCacheKey: import_v420.z.string().nullish(),
4038
+ promptCacheKey: import_v421.z.string().nullish(),
3924
4039
  /**
3925
4040
  * The retention policy for the prompt cache.
3926
4041
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -3929,7 +4044,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3929
4044
  *
3930
4045
  * @default 'in_memory'
3931
4046
  */
3932
- promptCacheRetention: import_v420.z.enum(["in_memory", "24h"]).nullish(),
4047
+ promptCacheRetention: import_v421.z.enum(["in_memory", "24h"]).nullish(),
3933
4048
  /**
3934
4049
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
3935
4050
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -3940,17 +4055,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3940
4055
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
3941
4056
  * an error.
3942
4057
  */
3943
- reasoningEffort: import_v420.z.string().nullish(),
4058
+ reasoningEffort: import_v421.z.string().nullish(),
3944
4059
  /**
3945
4060
  * Controls reasoning summary output from the model.
3946
4061
  * Set to "auto" to automatically receive the richest level available,
3947
4062
  * or "detailed" for comprehensive summaries.
3948
4063
  */
3949
- reasoningSummary: import_v420.z.string().nullish(),
4064
+ reasoningSummary: import_v421.z.string().nullish(),
3950
4065
  /**
3951
4066
  * The identifier for safety monitoring and tracking.
3952
4067
  */
3953
- safetyIdentifier: import_v420.z.string().nullish(),
4068
+ safetyIdentifier: import_v421.z.string().nullish(),
3954
4069
  /**
3955
4070
  * Service tier for the request.
3956
4071
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -3958,34 +4073,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3958
4073
  *
3959
4074
  * Defaults to 'auto'.
3960
4075
  */
3961
- serviceTier: import_v420.z.enum(["auto", "flex", "priority", "default"]).nullish(),
4076
+ serviceTier: import_v421.z.enum(["auto", "flex", "priority", "default"]).nullish(),
3962
4077
  /**
3963
4078
  * Whether to store the generation. Defaults to `true`.
3964
4079
  */
3965
- store: import_v420.z.boolean().nullish(),
4080
+ store: import_v421.z.boolean().nullish(),
3966
4081
  /**
3967
4082
  * Whether to use strict JSON schema validation.
3968
4083
  * Defaults to `true`.
3969
4084
  */
3970
- strictJsonSchema: import_v420.z.boolean().nullish(),
4085
+ strictJsonSchema: import_v421.z.boolean().nullish(),
3971
4086
  /**
3972
4087
  * Controls the verbosity of the model's responses. Lower values ('low') will result
3973
4088
  * in more concise responses, while higher values ('high') will result in more verbose responses.
3974
4089
  * Valid values: 'low', 'medium', 'high'.
3975
4090
  */
3976
- textVerbosity: import_v420.z.enum(["low", "medium", "high"]).nullish(),
4091
+ textVerbosity: import_v421.z.enum(["low", "medium", "high"]).nullish(),
3977
4092
  /**
3978
4093
  * Controls output truncation. 'auto' (default) performs truncation automatically;
3979
4094
  * 'disabled' turns truncation off.
3980
4095
  */
3981
- truncation: import_v420.z.enum(["auto", "disabled"]).nullish(),
4096
+ truncation: import_v421.z.enum(["auto", "disabled"]).nullish(),
3982
4097
  /**
3983
4098
  * A unique identifier representing your end-user, which can help OpenAI to
3984
4099
  * monitor and detect abuse.
3985
4100
  * Defaults to `undefined`.
3986
4101
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
3987
4102
  */
3988
- user: import_v420.z.string().nullish(),
4103
+ user: import_v421.z.string().nullish(),
3989
4104
  /**
3990
4105
  * Override the system message mode for this model.
3991
4106
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -3994,7 +4109,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
3994
4109
  *
3995
4110
  * If not specified, the mode is automatically determined based on the model.
3996
4111
  */
3997
- systemMessageMode: import_v420.z.enum(["system", "developer", "remove"]).optional(),
4112
+ systemMessageMode: import_v421.z.enum(["system", "developer", "remove"]).optional(),
3998
4113
  /**
3999
4114
  * Force treating this model as a reasoning model.
4000
4115
  *
@@ -4004,24 +4119,28 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
4004
4119
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
4005
4120
  * and defaults `systemMessageMode` to `developer` unless overridden.
4006
4121
  */
4007
- forceReasoning: import_v420.z.boolean().optional()
4122
+ forceReasoning: import_v421.z.boolean().optional()
4008
4123
  })
4009
4124
  )
4010
4125
  );
4011
4126
 
4012
4127
  // src/responses/openai-responses-prepare-tools.ts
4013
4128
  var import_provider7 = require("@ai-sdk/provider");
4014
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
4129
+ var import_provider_utils27 = require("@ai-sdk/provider-utils");
4015
4130
  async function prepareResponsesTools({
4016
4131
  tools,
4017
- toolChoice
4132
+ toolChoice,
4133
+ toolNameMapping,
4134
+ customProviderToolNames
4018
4135
  }) {
4136
+ var _a;
4019
4137
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
4020
4138
  const toolWarnings = [];
4021
4139
  if (tools == null) {
4022
4140
  return { tools: void 0, toolChoice: void 0, toolWarnings };
4023
4141
  }
4024
4142
  const openaiTools2 = [];
4143
+ const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();
4025
4144
  for (const tool of tools) {
4026
4145
  switch (tool.type) {
4027
4146
  case "function":
@@ -4036,7 +4155,7 @@ async function prepareResponsesTools({
4036
4155
  case "provider": {
4037
4156
  switch (tool.id) {
4038
4157
  case "openai.file_search": {
4039
- const args = await (0, import_provider_utils26.validateTypes)({
4158
+ const args = await (0, import_provider_utils27.validateTypes)({
4040
4159
  value: tool.args,
4041
4160
  schema: fileSearchArgsSchema
4042
4161
  });
@@ -4059,7 +4178,7 @@ async function prepareResponsesTools({
4059
4178
  break;
4060
4179
  }
4061
4180
  case "openai.shell": {
4062
- const args = await (0, import_provider_utils26.validateTypes)({
4181
+ const args = await (0, import_provider_utils27.validateTypes)({
4063
4182
  value: tool.args,
4064
4183
  schema: shellArgsSchema
4065
4184
  });
@@ -4078,7 +4197,7 @@ async function prepareResponsesTools({
4078
4197
  break;
4079
4198
  }
4080
4199
  case "openai.web_search_preview": {
4081
- const args = await (0, import_provider_utils26.validateTypes)({
4200
+ const args = await (0, import_provider_utils27.validateTypes)({
4082
4201
  value: tool.args,
4083
4202
  schema: webSearchPreviewArgsSchema
4084
4203
  });
@@ -4090,7 +4209,7 @@ async function prepareResponsesTools({
4090
4209
  break;
4091
4210
  }
4092
4211
  case "openai.web_search": {
4093
- const args = await (0, import_provider_utils26.validateTypes)({
4212
+ const args = await (0, import_provider_utils27.validateTypes)({
4094
4213
  value: tool.args,
4095
4214
  schema: webSearchArgsSchema
4096
4215
  });
@@ -4104,7 +4223,7 @@ async function prepareResponsesTools({
4104
4223
  break;
4105
4224
  }
4106
4225
  case "openai.code_interpreter": {
4107
- const args = await (0, import_provider_utils26.validateTypes)({
4226
+ const args = await (0, import_provider_utils27.validateTypes)({
4108
4227
  value: tool.args,
4109
4228
  schema: codeInterpreterArgsSchema
4110
4229
  });
@@ -4115,7 +4234,7 @@ async function prepareResponsesTools({
4115
4234
  break;
4116
4235
  }
4117
4236
  case "openai.image_generation": {
4118
- const args = await (0, import_provider_utils26.validateTypes)({
4237
+ const args = await (0, import_provider_utils27.validateTypes)({
4119
4238
  value: tool.args,
4120
4239
  schema: imageGenerationArgsSchema
4121
4240
  });
@@ -4138,7 +4257,7 @@ async function prepareResponsesTools({
4138
4257
  break;
4139
4258
  }
4140
4259
  case "openai.mcp": {
4141
- const args = await (0, import_provider_utils26.validateTypes)({
4260
+ const args = await (0, import_provider_utils27.validateTypes)({
4142
4261
  value: tool.args,
4143
4262
  schema: mcpArgsSchema
4144
4263
  });
@@ -4163,6 +4282,20 @@ async function prepareResponsesTools({
4163
4282
  });
4164
4283
  break;
4165
4284
  }
4285
+ case "openai.custom": {
4286
+ const args = await (0, import_provider_utils27.validateTypes)({
4287
+ value: tool.args,
4288
+ schema: customArgsSchema
4289
+ });
4290
+ openaiTools2.push({
4291
+ type: "custom",
4292
+ name: args.name,
4293
+ description: args.description,
4294
+ format: args.format
4295
+ });
4296
+ resolvedCustomProviderToolNames.add(args.name);
4297
+ break;
4298
+ }
4166
4299
  }
4167
4300
  break;
4168
4301
  }
@@ -4183,12 +4316,14 @@ async function prepareResponsesTools({
4183
4316
  case "none":
4184
4317
  case "required":
4185
4318
  return { tools: openaiTools2, toolChoice: type, toolWarnings };
4186
- case "tool":
4319
+ case "tool": {
4320
+ const resolvedToolName = (_a = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _a : toolChoice.toolName;
4187
4321
  return {
4188
4322
  tools: openaiTools2,
4189
- toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" || toolChoice.toolName === "apply_patch" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
4323
+ toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
4190
4324
  toolWarnings
4191
4325
  };
4326
+ }
4192
4327
  default: {
4193
4328
  const _exhaustiveCheck = type;
4194
4329
  throw new import_provider7.UnsupportedFunctionalityError({
@@ -4307,13 +4442,13 @@ var OpenAIResponsesLanguageModel = class {
4307
4442
  warnings.push({ type: "unsupported", feature: "stopSequences" });
4308
4443
  }
4309
4444
  const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
4310
- let openaiOptions = await (0, import_provider_utils27.parseProviderOptions)({
4445
+ let openaiOptions = await (0, import_provider_utils28.parseProviderOptions)({
4311
4446
  provider: providerOptionsName,
4312
4447
  providerOptions,
4313
4448
  schema: openaiLanguageModelResponsesOptionsSchema
4314
4449
  });
4315
4450
  if (openaiOptions == null && providerOptionsName !== "openai") {
4316
- openaiOptions = await (0, import_provider_utils27.parseProviderOptions)({
4451
+ openaiOptions = await (0, import_provider_utils28.parseProviderOptions)({
4317
4452
  provider: "openai",
4318
4453
  providerOptions,
4319
4454
  schema: openaiLanguageModelResponsesOptionsSchema
@@ -4327,7 +4462,7 @@ var OpenAIResponsesLanguageModel = class {
4327
4462
  details: "conversation and previousResponseId cannot be used together"
4328
4463
  });
4329
4464
  }
4330
- const toolNameMapping = (0, import_provider_utils27.createToolNameMapping)({
4465
+ const toolNameMapping = (0, import_provider_utils28.createToolNameMapping)({
4331
4466
  tools,
4332
4467
  providerToolNames: {
4333
4468
  "openai.code_interpreter": "code_interpreter",
@@ -4339,7 +4474,19 @@ var OpenAIResponsesLanguageModel = class {
4339
4474
  "openai.web_search_preview": "web_search_preview",
4340
4475
  "openai.mcp": "mcp",
4341
4476
  "openai.apply_patch": "apply_patch"
4342
- }
4477
+ },
4478
+ resolveProviderToolName: (tool) => tool.id === "openai.custom" ? tool.args.name : void 0
4479
+ });
4480
+ const customProviderToolNames = /* @__PURE__ */ new Set();
4481
+ const {
4482
+ tools: openaiTools2,
4483
+ toolChoice: openaiToolChoice,
4484
+ toolWarnings
4485
+ } = await prepareResponsesTools({
4486
+ tools,
4487
+ toolChoice,
4488
+ toolNameMapping,
4489
+ customProviderToolNames
4343
4490
  });
4344
4491
  const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
4345
4492
  prompt,
@@ -4351,7 +4498,8 @@ var OpenAIResponsesLanguageModel = class {
4351
4498
  hasConversation: (openaiOptions == null ? void 0 : openaiOptions.conversation) != null,
4352
4499
  hasLocalShellTool: hasOpenAITool("openai.local_shell"),
4353
4500
  hasShellTool: hasOpenAITool("openai.shell"),
4354
- hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
4501
+ hasApplyPatchTool: hasOpenAITool("openai.apply_patch"),
4502
+ customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0
4355
4503
  });
4356
4504
  warnings.push(...inputWarnings);
4357
4505
  const strictJsonSchema = (_d = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _d : true;
@@ -4484,14 +4632,6 @@ var OpenAIResponsesLanguageModel = class {
4484
4632
  });
4485
4633
  delete baseArgs.service_tier;
4486
4634
  }
4487
- const {
4488
- tools: openaiTools2,
4489
- toolChoice: openaiToolChoice,
4490
- toolWarnings
4491
- } = await prepareResponsesTools({
4492
- tools,
4493
- toolChoice
4494
- });
4495
4635
  const shellToolEnvType = (_i = (_h = (_g = tools == null ? void 0 : tools.find(
4496
4636
  (tool) => tool.type === "provider" && tool.id === "openai.shell"
4497
4637
  )) == null ? void 0 : _g.args) == null ? void 0 : _h.environment) == null ? void 0 : _i.type;
@@ -4529,12 +4669,12 @@ var OpenAIResponsesLanguageModel = class {
4529
4669
  responseHeaders,
4530
4670
  value: response,
4531
4671
  rawValue: rawResponse
4532
- } = await (0, import_provider_utils27.postJsonToApi)({
4672
+ } = await (0, import_provider_utils28.postJsonToApi)({
4533
4673
  url,
4534
- headers: (0, import_provider_utils27.combineHeaders)(this.config.headers(), options.headers),
4674
+ headers: (0, import_provider_utils28.combineHeaders)(this.config.headers(), options.headers),
4535
4675
  body,
4536
4676
  failedResponseHandler: openaiFailedResponseHandler,
4537
- successfulResponseHandler: (0, import_provider_utils27.createJsonResponseHandler)(
4677
+ successfulResponseHandler: (0, import_provider_utils28.createJsonResponseHandler)(
4538
4678
  openaiResponsesResponseSchema
4539
4679
  ),
4540
4680
  abortSignal: options.abortSignal,
@@ -4669,7 +4809,7 @@ var OpenAIResponsesLanguageModel = class {
4669
4809
  content.push({
4670
4810
  type: "source",
4671
4811
  sourceType: "url",
4672
- id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils27.generateId)(),
4812
+ id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils28.generateId)(),
4673
4813
  url: annotation.url,
4674
4814
  title: annotation.title
4675
4815
  });
@@ -4677,7 +4817,7 @@ var OpenAIResponsesLanguageModel = class {
4677
4817
  content.push({
4678
4818
  type: "source",
4679
4819
  sourceType: "document",
4680
- id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils27.generateId)(),
4820
+ id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils28.generateId)(),
4681
4821
  mediaType: "text/plain",
4682
4822
  title: annotation.filename,
4683
4823
  filename: annotation.filename,
@@ -4693,7 +4833,7 @@ var OpenAIResponsesLanguageModel = class {
4693
4833
  content.push({
4694
4834
  type: "source",
4695
4835
  sourceType: "document",
4696
- id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils27.generateId)(),
4836
+ id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils28.generateId)(),
4697
4837
  mediaType: "text/plain",
4698
4838
  title: annotation.filename,
4699
4839
  filename: annotation.filename,
@@ -4709,7 +4849,7 @@ var OpenAIResponsesLanguageModel = class {
4709
4849
  content.push({
4710
4850
  type: "source",
4711
4851
  sourceType: "document",
4712
- id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils27.generateId)(),
4852
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils28.generateId)(),
4713
4853
  mediaType: "application/octet-stream",
4714
4854
  title: annotation.file_id,
4715
4855
  filename: annotation.file_id,
@@ -4741,6 +4881,22 @@ var OpenAIResponsesLanguageModel = class {
4741
4881
  });
4742
4882
  break;
4743
4883
  }
4884
+ case "custom_tool_call": {
4885
+ hasFunctionCall = true;
4886
+ const toolName = toolNameMapping.toCustomToolName(part.name);
4887
+ content.push({
4888
+ type: "tool-call",
4889
+ toolCallId: part.call_id,
4890
+ toolName,
4891
+ input: JSON.stringify(part.input),
4892
+ providerMetadata: {
4893
+ [providerOptionsName]: {
4894
+ itemId: part.id
4895
+ }
4896
+ }
4897
+ });
4898
+ break;
4899
+ }
4744
4900
  case "web_search_call": {
4745
4901
  content.push({
4746
4902
  type: "tool-call",
@@ -4797,7 +4953,7 @@ var OpenAIResponsesLanguageModel = class {
4797
4953
  }
4798
4954
  case "mcp_approval_request": {
4799
4955
  const approvalRequestId = (_q = part.approval_request_id) != null ? _q : part.id;
4800
- const dummyToolCallId = (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : (0, import_provider_utils27.generateId)();
4956
+ const dummyToolCallId = (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : (0, import_provider_utils28.generateId)();
4801
4957
  const toolName = `mcp.${part.name}`;
4802
4958
  content.push({
4803
4959
  type: "tool-call",
@@ -4938,18 +5094,18 @@ var OpenAIResponsesLanguageModel = class {
4938
5094
  providerOptionsName,
4939
5095
  isShellProviderExecuted
4940
5096
  } = await this.getArgs(options);
4941
- const { responseHeaders, value: response } = await (0, import_provider_utils27.postJsonToApi)({
5097
+ const { responseHeaders, value: response } = await (0, import_provider_utils28.postJsonToApi)({
4942
5098
  url: this.config.url({
4943
5099
  path: "/responses",
4944
5100
  modelId: this.modelId
4945
5101
  }),
4946
- headers: (0, import_provider_utils27.combineHeaders)(this.config.headers(), options.headers),
5102
+ headers: (0, import_provider_utils28.combineHeaders)(this.config.headers(), options.headers),
4947
5103
  body: {
4948
5104
  ...body,
4949
5105
  stream: true
4950
5106
  },
4951
5107
  failedResponseHandler: openaiFailedResponseHandler,
4952
- successfulResponseHandler: (0, import_provider_utils27.createEventSourceResponseHandler)(
5108
+ successfulResponseHandler: (0, import_provider_utils28.createEventSourceResponseHandler)(
4953
5109
  openaiResponsesChunkSchema
4954
5110
  ),
4955
5111
  abortSignal: options.abortSignal,
@@ -4999,6 +5155,19 @@ var OpenAIResponsesLanguageModel = class {
4999
5155
  id: value.item.call_id,
5000
5156
  toolName: value.item.name
5001
5157
  });
5158
+ } else if (value.item.type === "custom_tool_call") {
5159
+ const toolName = toolNameMapping.toCustomToolName(
5160
+ value.item.name
5161
+ );
5162
+ ongoingToolCalls[value.output_index] = {
5163
+ toolName,
5164
+ toolCallId: value.item.call_id
5165
+ };
5166
+ controller.enqueue({
5167
+ type: "tool-input-start",
5168
+ id: value.item.call_id,
5169
+ toolName
5170
+ });
5002
5171
  } else if (value.item.type === "web_search_call") {
5003
5172
  ongoingToolCalls[value.output_index] = {
5004
5173
  toolName: toolNameMapping.toCustomToolName(
@@ -5183,6 +5352,27 @@ var OpenAIResponsesLanguageModel = class {
5183
5352
  }
5184
5353
  }
5185
5354
  });
5355
+ } else if (value.item.type === "custom_tool_call") {
5356
+ ongoingToolCalls[value.output_index] = void 0;
5357
+ hasFunctionCall = true;
5358
+ const toolName = toolNameMapping.toCustomToolName(
5359
+ value.item.name
5360
+ );
5361
+ controller.enqueue({
5362
+ type: "tool-input-end",
5363
+ id: value.item.call_id
5364
+ });
5365
+ controller.enqueue({
5366
+ type: "tool-call",
5367
+ toolCallId: value.item.call_id,
5368
+ toolName,
5369
+ input: JSON.stringify(value.item.input),
5370
+ providerMetadata: {
5371
+ [providerOptionsName]: {
5372
+ itemId: value.item.id
5373
+ }
5374
+ }
5375
+ });
5186
5376
  } else if (value.item.type === "web_search_call") {
5187
5377
  ongoingToolCalls[value.output_index] = void 0;
5188
5378
  controller.enqueue({
@@ -5326,7 +5516,7 @@ var OpenAIResponsesLanguageModel = class {
5326
5516
  ongoingToolCalls[value.output_index] = void 0;
5327
5517
  } else if (value.item.type === "mcp_approval_request") {
5328
5518
  ongoingToolCalls[value.output_index] = void 0;
5329
- const dummyToolCallId = (_k = (_j = (_i = self.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : (0, import_provider_utils27.generateId)();
5519
+ const dummyToolCallId = (_k = (_j = (_i = self.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : (0, import_provider_utils28.generateId)();
5330
5520
  const approvalRequestId = (_l = value.item.approval_request_id) != null ? _l : value.item.id;
5331
5521
  approvalRequestIdToDummyToolCallIdFromStream.set(
5332
5522
  approvalRequestId,
@@ -5432,6 +5622,15 @@ var OpenAIResponsesLanguageModel = class {
5432
5622
  delta: value.delta
5433
5623
  });
5434
5624
  }
5625
+ } else if (isResponseCustomToolCallInputDeltaChunk(value)) {
5626
+ const toolCall = ongoingToolCalls[value.output_index];
5627
+ if (toolCall != null) {
5628
+ controller.enqueue({
5629
+ type: "tool-input-delta",
5630
+ id: toolCall.toolCallId,
5631
+ delta: value.delta
5632
+ });
5633
+ }
5435
5634
  } else if (isResponseApplyPatchCallOperationDiffDeltaChunk(value)) {
5436
5635
  const toolCall = ongoingToolCalls[value.output_index];
5437
5636
  if (toolCall == null ? void 0 : toolCall.applyPatch) {
@@ -5598,7 +5797,7 @@ var OpenAIResponsesLanguageModel = class {
5598
5797
  controller.enqueue({
5599
5798
  type: "source",
5600
5799
  sourceType: "url",
5601
- id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils27.generateId)(),
5800
+ id: (_w = (_v = (_u = self.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils28.generateId)(),
5602
5801
  url: value.annotation.url,
5603
5802
  title: value.annotation.title
5604
5803
  });
@@ -5606,7 +5805,7 @@ var OpenAIResponsesLanguageModel = class {
5606
5805
  controller.enqueue({
5607
5806
  type: "source",
5608
5807
  sourceType: "document",
5609
- id: (_z = (_y = (_x = self.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : (0, import_provider_utils27.generateId)(),
5808
+ id: (_z = (_y = (_x = self.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : (0, import_provider_utils28.generateId)(),
5610
5809
  mediaType: "text/plain",
5611
5810
  title: value.annotation.filename,
5612
5811
  filename: value.annotation.filename,
@@ -5622,7 +5821,7 @@ var OpenAIResponsesLanguageModel = class {
5622
5821
  controller.enqueue({
5623
5822
  type: "source",
5624
5823
  sourceType: "document",
5625
- id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils27.generateId)(),
5824
+ id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils28.generateId)(),
5626
5825
  mediaType: "text/plain",
5627
5826
  title: value.annotation.filename,
5628
5827
  filename: value.annotation.filename,
@@ -5638,7 +5837,7 @@ var OpenAIResponsesLanguageModel = class {
5638
5837
  controller.enqueue({
5639
5838
  type: "source",
5640
5839
  sourceType: "document",
5641
- id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils27.generateId)(),
5840
+ id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils28.generateId)(),
5642
5841
  mediaType: "application/octet-stream",
5643
5842
  title: value.annotation.file_id,
5644
5843
  filename: value.annotation.file_id,
@@ -5692,6 +5891,9 @@ function isResponseCreatedChunk(chunk) {
5692
5891
  function isResponseFunctionCallArgumentsDeltaChunk(chunk) {
5693
5892
  return chunk.type === "response.function_call_arguments.delta";
5694
5893
  }
5894
+ function isResponseCustomToolCallInputDeltaChunk(chunk) {
5895
+ return chunk.type === "response.custom_tool_call_input.delta";
5896
+ }
5695
5897
  function isResponseImageGenerationCallPartialImageChunk(chunk) {
5696
5898
  return chunk.type === "response.image_generation_call.partial_image";
5697
5899
  }
@@ -5745,16 +5947,16 @@ function escapeJSONDelta(delta) {
5745
5947
  }
5746
5948
 
5747
5949
  // src/speech/openai-speech-model.ts
5748
- var import_provider_utils29 = require("@ai-sdk/provider-utils");
5950
+ var import_provider_utils30 = require("@ai-sdk/provider-utils");
5749
5951
 
5750
5952
  // src/speech/openai-speech-options.ts
5751
- var import_provider_utils28 = require("@ai-sdk/provider-utils");
5752
- var import_v421 = require("zod/v4");
5753
- var openaiSpeechModelOptionsSchema = (0, import_provider_utils28.lazySchema)(
5754
- () => (0, import_provider_utils28.zodSchema)(
5755
- import_v421.z.object({
5756
- instructions: import_v421.z.string().nullish(),
5757
- speed: import_v421.z.number().min(0.25).max(4).default(1).nullish()
5953
+ var import_provider_utils29 = require("@ai-sdk/provider-utils");
5954
+ var import_v422 = require("zod/v4");
5955
+ var openaiSpeechModelOptionsSchema = (0, import_provider_utils29.lazySchema)(
5956
+ () => (0, import_provider_utils29.zodSchema)(
5957
+ import_v422.z.object({
5958
+ instructions: import_v422.z.string().nullish(),
5959
+ speed: import_v422.z.number().min(0.25).max(4).default(1).nullish()
5758
5960
  })
5759
5961
  )
5760
5962
  );
@@ -5779,7 +5981,7 @@ var OpenAISpeechModel = class {
5779
5981
  providerOptions
5780
5982
  }) {
5781
5983
  const warnings = [];
5782
- const openAIOptions = await (0, import_provider_utils29.parseProviderOptions)({
5984
+ const openAIOptions = await (0, import_provider_utils30.parseProviderOptions)({
5783
5985
  provider: "openai",
5784
5986
  providerOptions,
5785
5987
  schema: openaiSpeechModelOptionsSchema
@@ -5832,15 +6034,15 @@ var OpenAISpeechModel = class {
5832
6034
  value: audio,
5833
6035
  responseHeaders,
5834
6036
  rawValue: rawResponse
5835
- } = await (0, import_provider_utils29.postJsonToApi)({
6037
+ } = await (0, import_provider_utils30.postJsonToApi)({
5836
6038
  url: this.config.url({
5837
6039
  path: "/audio/speech",
5838
6040
  modelId: this.modelId
5839
6041
  }),
5840
- headers: (0, import_provider_utils29.combineHeaders)(this.config.headers(), options.headers),
6042
+ headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
5841
6043
  body: requestBody,
5842
6044
  failedResponseHandler: openaiFailedResponseHandler,
5843
- successfulResponseHandler: (0, import_provider_utils29.createBinaryResponseHandler)(),
6045
+ successfulResponseHandler: (0, import_provider_utils30.createBinaryResponseHandler)(),
5844
6046
  abortSignal: options.abortSignal,
5845
6047
  fetch: this.config.fetch
5846
6048
  });
@@ -5861,36 +6063,36 @@ var OpenAISpeechModel = class {
5861
6063
  };
5862
6064
 
5863
6065
  // src/transcription/openai-transcription-model.ts
5864
- var import_provider_utils32 = require("@ai-sdk/provider-utils");
6066
+ var import_provider_utils33 = require("@ai-sdk/provider-utils");
5865
6067
 
5866
6068
  // src/transcription/openai-transcription-api.ts
5867
- var import_provider_utils30 = require("@ai-sdk/provider-utils");
5868
- var import_v422 = require("zod/v4");
5869
- var openaiTranscriptionResponseSchema = (0, import_provider_utils30.lazySchema)(
5870
- () => (0, import_provider_utils30.zodSchema)(
5871
- import_v422.z.object({
5872
- text: import_v422.z.string(),
5873
- language: import_v422.z.string().nullish(),
5874
- duration: import_v422.z.number().nullish(),
5875
- words: import_v422.z.array(
5876
- import_v422.z.object({
5877
- word: import_v422.z.string(),
5878
- start: import_v422.z.number(),
5879
- end: import_v422.z.number()
6069
+ var import_provider_utils31 = require("@ai-sdk/provider-utils");
6070
+ var import_v423 = require("zod/v4");
6071
+ var openaiTranscriptionResponseSchema = (0, import_provider_utils31.lazySchema)(
6072
+ () => (0, import_provider_utils31.zodSchema)(
6073
+ import_v423.z.object({
6074
+ text: import_v423.z.string(),
6075
+ language: import_v423.z.string().nullish(),
6076
+ duration: import_v423.z.number().nullish(),
6077
+ words: import_v423.z.array(
6078
+ import_v423.z.object({
6079
+ word: import_v423.z.string(),
6080
+ start: import_v423.z.number(),
6081
+ end: import_v423.z.number()
5880
6082
  })
5881
6083
  ).nullish(),
5882
- segments: import_v422.z.array(
5883
- import_v422.z.object({
5884
- id: import_v422.z.number(),
5885
- seek: import_v422.z.number(),
5886
- start: import_v422.z.number(),
5887
- end: import_v422.z.number(),
5888
- text: import_v422.z.string(),
5889
- tokens: import_v422.z.array(import_v422.z.number()),
5890
- temperature: import_v422.z.number(),
5891
- avg_logprob: import_v422.z.number(),
5892
- compression_ratio: import_v422.z.number(),
5893
- no_speech_prob: import_v422.z.number()
6084
+ segments: import_v423.z.array(
6085
+ import_v423.z.object({
6086
+ id: import_v423.z.number(),
6087
+ seek: import_v423.z.number(),
6088
+ start: import_v423.z.number(),
6089
+ end: import_v423.z.number(),
6090
+ text: import_v423.z.string(),
6091
+ tokens: import_v423.z.array(import_v423.z.number()),
6092
+ temperature: import_v423.z.number(),
6093
+ avg_logprob: import_v423.z.number(),
6094
+ compression_ratio: import_v423.z.number(),
6095
+ no_speech_prob: import_v423.z.number()
5894
6096
  })
5895
6097
  ).nullish()
5896
6098
  })
@@ -5898,33 +6100,33 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils30.lazySchema)(
5898
6100
  );
5899
6101
 
5900
6102
  // src/transcription/openai-transcription-options.ts
5901
- var import_provider_utils31 = require("@ai-sdk/provider-utils");
5902
- var import_v423 = require("zod/v4");
5903
- var openAITranscriptionModelOptions = (0, import_provider_utils31.lazySchema)(
5904
- () => (0, import_provider_utils31.zodSchema)(
5905
- import_v423.z.object({
6103
+ var import_provider_utils32 = require("@ai-sdk/provider-utils");
6104
+ var import_v424 = require("zod/v4");
6105
+ var openAITranscriptionModelOptions = (0, import_provider_utils32.lazySchema)(
6106
+ () => (0, import_provider_utils32.zodSchema)(
6107
+ import_v424.z.object({
5906
6108
  /**
5907
6109
  * Additional information to include in the transcription response.
5908
6110
  */
5909
- include: import_v423.z.array(import_v423.z.string()).optional(),
6111
+ include: import_v424.z.array(import_v424.z.string()).optional(),
5910
6112
  /**
5911
6113
  * The language of the input audio in ISO-639-1 format.
5912
6114
  */
5913
- language: import_v423.z.string().optional(),
6115
+ language: import_v424.z.string().optional(),
5914
6116
  /**
5915
6117
  * An optional text to guide the model's style or continue a previous audio segment.
5916
6118
  */
5917
- prompt: import_v423.z.string().optional(),
6119
+ prompt: import_v424.z.string().optional(),
5918
6120
  /**
5919
6121
  * The sampling temperature, between 0 and 1.
5920
6122
  * @default 0
5921
6123
  */
5922
- temperature: import_v423.z.number().min(0).max(1).default(0).optional(),
6124
+ temperature: import_v424.z.number().min(0).max(1).default(0).optional(),
5923
6125
  /**
5924
6126
  * The timestamp granularities to populate for this transcription.
5925
6127
  * @default ['segment']
5926
6128
  */
5927
- timestampGranularities: import_v423.z.array(import_v423.z.enum(["word", "segment"])).default(["segment"]).optional()
6129
+ timestampGranularities: import_v424.z.array(import_v424.z.enum(["word", "segment"])).default(["segment"]).optional()
5928
6130
  })
5929
6131
  )
5930
6132
  );
@@ -6004,15 +6206,15 @@ var OpenAITranscriptionModel = class {
6004
6206
  providerOptions
6005
6207
  }) {
6006
6208
  const warnings = [];
6007
- const openAIOptions = await (0, import_provider_utils32.parseProviderOptions)({
6209
+ const openAIOptions = await (0, import_provider_utils33.parseProviderOptions)({
6008
6210
  provider: "openai",
6009
6211
  providerOptions,
6010
6212
  schema: openAITranscriptionModelOptions
6011
6213
  });
6012
6214
  const formData = new FormData();
6013
- const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils32.convertBase64ToUint8Array)(audio)]);
6215
+ const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils33.convertBase64ToUint8Array)(audio)]);
6014
6216
  formData.append("model", this.modelId);
6015
- const fileExtension = (0, import_provider_utils32.mediaTypeToExtension)(mediaType);
6217
+ const fileExtension = (0, import_provider_utils33.mediaTypeToExtension)(mediaType);
6016
6218
  formData.append(
6017
6219
  "file",
6018
6220
  new File([blob], "audio", { type: mediaType }),
@@ -6057,15 +6259,15 @@ var OpenAITranscriptionModel = class {
6057
6259
  value: response,
6058
6260
  responseHeaders,
6059
6261
  rawValue: rawResponse
6060
- } = await (0, import_provider_utils32.postFormDataToApi)({
6262
+ } = await (0, import_provider_utils33.postFormDataToApi)({
6061
6263
  url: this.config.url({
6062
6264
  path: "/audio/transcriptions",
6063
6265
  modelId: this.modelId
6064
6266
  }),
6065
- headers: (0, import_provider_utils32.combineHeaders)(this.config.headers(), options.headers),
6267
+ headers: (0, import_provider_utils33.combineHeaders)(this.config.headers(), options.headers),
6066
6268
  formData,
6067
6269
  failedResponseHandler: openaiFailedResponseHandler,
6068
- successfulResponseHandler: (0, import_provider_utils32.createJsonResponseHandler)(
6270
+ successfulResponseHandler: (0, import_provider_utils33.createJsonResponseHandler)(
6069
6271
  openaiTranscriptionResponseSchema
6070
6272
  ),
6071
6273
  abortSignal: options.abortSignal,
@@ -6097,21 +6299,21 @@ var OpenAITranscriptionModel = class {
6097
6299
  };
6098
6300
 
6099
6301
  // src/version.ts
6100
- var VERSION = true ? "3.0.36" : "0.0.0-test";
6302
+ var VERSION = true ? "3.0.38" : "0.0.0-test";
6101
6303
 
6102
6304
  // src/openai-provider.ts
6103
6305
  function createOpenAI(options = {}) {
6104
6306
  var _a, _b;
6105
- const baseURL = (_a = (0, import_provider_utils33.withoutTrailingSlash)(
6106
- (0, import_provider_utils33.loadOptionalSetting)({
6307
+ const baseURL = (_a = (0, import_provider_utils34.withoutTrailingSlash)(
6308
+ (0, import_provider_utils34.loadOptionalSetting)({
6107
6309
  settingValue: options.baseURL,
6108
6310
  environmentVariableName: "OPENAI_BASE_URL"
6109
6311
  })
6110
6312
  )) != null ? _a : "https://api.openai.com/v1";
6111
6313
  const providerName = (_b = options.name) != null ? _b : "openai";
6112
- const getHeaders = () => (0, import_provider_utils33.withUserAgentSuffix)(
6314
+ const getHeaders = () => (0, import_provider_utils34.withUserAgentSuffix)(
6113
6315
  {
6114
- Authorization: `Bearer ${(0, import_provider_utils33.loadApiKey)({
6316
+ Authorization: `Bearer ${(0, import_provider_utils34.loadApiKey)({
6115
6317
  apiKey: options.apiKey,
6116
6318
  environmentVariableName: "OPENAI_API_KEY",
6117
6319
  description: "OpenAI"