@ai-sdk/openai 3.0.55 → 3.0.57

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.mjs CHANGED
@@ -1742,6 +1742,7 @@ import {
1742
1742
  convertToFormData,
1743
1743
  createJsonResponseHandler as createJsonResponseHandler4,
1744
1744
  downloadBlob,
1745
+ parseProviderOptions as parseProviderOptions4,
1745
1746
  postFormDataToApi,
1746
1747
  postJsonToApi as postJsonToApi4
1747
1748
  } from "@ai-sdk/provider-utils";
@@ -1776,7 +1777,12 @@ var openaiImageResponseSchema = lazySchema7(
1776
1777
  )
1777
1778
  );
1778
1779
 
1779
- // src/image/openai-image-options.ts
1780
+ // src/image/openai-image-model-options.ts
1781
+ import {
1782
+ lazySchema as lazySchema8,
1783
+ zodSchema as zodSchema8
1784
+ } from "@ai-sdk/provider-utils";
1785
+ import { z as z9 } from "zod/v4";
1780
1786
  var modelMaxImagesPerCall = {
1781
1787
  "dall-e-3": 1,
1782
1788
  "dall-e-2": 10,
@@ -1798,6 +1804,65 @@ function hasDefaultResponseFormat(modelId) {
1798
1804
  (prefix) => modelId.startsWith(prefix)
1799
1805
  );
1800
1806
  }
1807
+ var baseImageModelOptionsObject = z9.object({
1808
+ /**
1809
+ * Quality of the generated image(s).
1810
+ *
1811
+ * Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
1812
+ */
1813
+ quality: z9.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
1814
+ /**
1815
+ * Background behavior for the generated image(s).
1816
+ *
1817
+ * If `transparent`, the output format must support transparency
1818
+ * (i.e. `png` or `webp`).
1819
+ */
1820
+ background: z9.enum(["transparent", "opaque", "auto"]).optional(),
1821
+ /**
1822
+ * Format in which the generated image(s) are returned.
1823
+ */
1824
+ outputFormat: z9.enum(["png", "jpeg", "webp"]).optional(),
1825
+ /**
1826
+ * Compression level (0-100) for the generated image(s). Applies to the
1827
+ * `jpeg` and `webp` output formats.
1828
+ */
1829
+ outputCompression: z9.number().int().min(0).max(100).optional(),
1830
+ /**
1831
+ * A unique identifier representing your end-user, which can help OpenAI
1832
+ * to monitor and detect abuse.
1833
+ */
1834
+ user: z9.string().optional()
1835
+ });
1836
+ var openaiImageModelOptions = lazySchema8(
1837
+ () => zodSchema8(baseImageModelOptionsObject)
1838
+ );
1839
+ var openaiImageModelGenerationOptions = lazySchema8(
1840
+ () => zodSchema8(
1841
+ baseImageModelOptionsObject.extend({
1842
+ /**
1843
+ * Style of the generated image. `vivid` produces hyper-real and
1844
+ * dramatic images; `natural` produces more subdued, less hyper-real
1845
+ * looking images.
1846
+ */
1847
+ style: z9.enum(["vivid", "natural"]).optional(),
1848
+ /**
1849
+ * Content moderation level for the generated image(s). `low` applies
1850
+ * less restrictive filtering.
1851
+ */
1852
+ moderation: z9.enum(["auto", "low"]).optional()
1853
+ })
1854
+ )
1855
+ );
1856
+ var openaiImageModelEditOptions = lazySchema8(
1857
+ () => zodSchema8(
1858
+ baseImageModelOptionsObject.extend({
1859
+ /**
1860
+ * Fidelity of the output image(s) to the input image(s).
1861
+ */
1862
+ inputFidelity: z9.enum(["high", "low"]).optional()
1863
+ })
1864
+ )
1865
+ );
1801
1866
 
1802
1867
  // src/image/openai-image-model.ts
1803
1868
  var OpenAIImageModel = class {
@@ -1839,6 +1904,11 @@ var OpenAIImageModel = class {
1839
1904
  }
1840
1905
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
1841
1906
  if (files != null) {
1907
+ const openaiOptions2 = (_d = await parseProviderOptions4({
1908
+ provider: "openai",
1909
+ providerOptions,
1910
+ schema: openaiImageModelEditOptions
1911
+ })) != null ? _d : {};
1842
1912
  const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({
1843
1913
  url: this.config.url({
1844
1914
  path: "/images/edits",
@@ -1865,7 +1935,12 @@ var OpenAIImageModel = class {
1865
1935
  mask: mask != null ? await fileToBlob(mask) : void 0,
1866
1936
  n,
1867
1937
  size,
1868
- ...(_d = providerOptions.openai) != null ? _d : {}
1938
+ quality: openaiOptions2.quality,
1939
+ background: openaiOptions2.background,
1940
+ output_format: openaiOptions2.outputFormat,
1941
+ output_compression: openaiOptions2.outputCompression,
1942
+ input_fidelity: openaiOptions2.inputFidelity,
1943
+ user: openaiOptions2.user
1869
1944
  }),
1870
1945
  failedResponseHandler: openaiFailedResponseHandler,
1871
1946
  successfulResponseHandler: createJsonResponseHandler4(
@@ -1909,6 +1984,11 @@ var OpenAIImageModel = class {
1909
1984
  }
1910
1985
  };
1911
1986
  }
1987
+ const openaiOptions = (_h = await parseProviderOptions4({
1988
+ provider: "openai",
1989
+ providerOptions,
1990
+ schema: openaiImageModelGenerationOptions
1991
+ })) != null ? _h : {};
1912
1992
  const { value: response, responseHeaders } = await postJsonToApi4({
1913
1993
  url: this.config.url({
1914
1994
  path: "/images/generations",
@@ -1920,7 +2000,13 @@ var OpenAIImageModel = class {
1920
2000
  prompt,
1921
2001
  n,
1922
2002
  size,
1923
- ...(_h = providerOptions.openai) != null ? _h : {},
2003
+ quality: openaiOptions.quality,
2004
+ style: openaiOptions.style,
2005
+ background: openaiOptions.background,
2006
+ moderation: openaiOptions.moderation,
2007
+ output_format: openaiOptions.outputFormat,
2008
+ output_compression: openaiOptions.outputCompression,
2009
+ user: openaiOptions.user,
1924
2010
  ...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
1925
2011
  },
1926
2012
  failedResponseHandler: openaiFailedResponseHandler,
@@ -1995,42 +2081,42 @@ async function fileToBlob(file) {
1995
2081
  // src/tool/apply-patch.ts
1996
2082
  import {
1997
2083
  createProviderToolFactoryWithOutputSchema,
1998
- lazySchema as lazySchema8,
1999
- zodSchema as zodSchema8
2084
+ lazySchema as lazySchema9,
2085
+ zodSchema as zodSchema9
2000
2086
  } from "@ai-sdk/provider-utils";
2001
- import { z as z9 } from "zod/v4";
2002
- var applyPatchInputSchema = lazySchema8(
2003
- () => zodSchema8(
2004
- z9.object({
2005
- callId: z9.string(),
2006
- operation: z9.discriminatedUnion("type", [
2007
- z9.object({
2008
- type: z9.literal("create_file"),
2009
- path: z9.string(),
2010
- diff: z9.string()
2087
+ import { z as z10 } from "zod/v4";
2088
+ var applyPatchInputSchema = lazySchema9(
2089
+ () => zodSchema9(
2090
+ z10.object({
2091
+ callId: z10.string(),
2092
+ operation: z10.discriminatedUnion("type", [
2093
+ z10.object({
2094
+ type: z10.literal("create_file"),
2095
+ path: z10.string(),
2096
+ diff: z10.string()
2011
2097
  }),
2012
- z9.object({
2013
- type: z9.literal("delete_file"),
2014
- path: z9.string()
2098
+ z10.object({
2099
+ type: z10.literal("delete_file"),
2100
+ path: z10.string()
2015
2101
  }),
2016
- z9.object({
2017
- type: z9.literal("update_file"),
2018
- path: z9.string(),
2019
- diff: z9.string()
2102
+ z10.object({
2103
+ type: z10.literal("update_file"),
2104
+ path: z10.string(),
2105
+ diff: z10.string()
2020
2106
  })
2021
2107
  ])
2022
2108
  })
2023
2109
  )
2024
2110
  );
2025
- var applyPatchOutputSchema = lazySchema8(
2026
- () => zodSchema8(
2027
- z9.object({
2028
- status: z9.enum(["completed", "failed"]),
2029
- output: z9.string().optional()
2111
+ var applyPatchOutputSchema = lazySchema9(
2112
+ () => zodSchema9(
2113
+ z10.object({
2114
+ status: z10.enum(["completed", "failed"]),
2115
+ output: z10.string().optional()
2030
2116
  })
2031
2117
  )
2032
2118
  );
2033
- var applyPatchArgsSchema = lazySchema8(() => zodSchema8(z9.object({})));
2119
+ var applyPatchArgsSchema = lazySchema9(() => zodSchema9(z10.object({})));
2034
2120
  var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
2035
2121
  id: "openai.apply_patch",
2036
2122
  inputSchema: applyPatchInputSchema,
@@ -2041,37 +2127,37 @@ var applyPatch = applyPatchToolFactory;
2041
2127
  // src/tool/code-interpreter.ts
2042
2128
  import {
2043
2129
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
2044
- lazySchema as lazySchema9,
2045
- zodSchema as zodSchema9
2130
+ lazySchema as lazySchema10,
2131
+ zodSchema as zodSchema10
2046
2132
  } from "@ai-sdk/provider-utils";
2047
- import { z as z10 } from "zod/v4";
2048
- var codeInterpreterInputSchema = lazySchema9(
2049
- () => zodSchema9(
2050
- z10.object({
2051
- code: z10.string().nullish(),
2052
- containerId: z10.string()
2133
+ import { z as z11 } from "zod/v4";
2134
+ var codeInterpreterInputSchema = lazySchema10(
2135
+ () => zodSchema10(
2136
+ z11.object({
2137
+ code: z11.string().nullish(),
2138
+ containerId: z11.string()
2053
2139
  })
2054
2140
  )
2055
2141
  );
2056
- var codeInterpreterOutputSchema = lazySchema9(
2057
- () => zodSchema9(
2058
- z10.object({
2059
- outputs: z10.array(
2060
- z10.discriminatedUnion("type", [
2061
- z10.object({ type: z10.literal("logs"), logs: z10.string() }),
2062
- z10.object({ type: z10.literal("image"), url: z10.string() })
2142
+ var codeInterpreterOutputSchema = lazySchema10(
2143
+ () => zodSchema10(
2144
+ z11.object({
2145
+ outputs: z11.array(
2146
+ z11.discriminatedUnion("type", [
2147
+ z11.object({ type: z11.literal("logs"), logs: z11.string() }),
2148
+ z11.object({ type: z11.literal("image"), url: z11.string() })
2063
2149
  ])
2064
2150
  ).nullish()
2065
2151
  })
2066
2152
  )
2067
2153
  );
2068
- var codeInterpreterArgsSchema = lazySchema9(
2069
- () => zodSchema9(
2070
- z10.object({
2071
- container: z10.union([
2072
- z10.string(),
2073
- z10.object({
2074
- fileIds: z10.array(z10.string()).optional()
2154
+ var codeInterpreterArgsSchema = lazySchema10(
2155
+ () => zodSchema10(
2156
+ z11.object({
2157
+ container: z11.union([
2158
+ z11.string(),
2159
+ z11.object({
2160
+ fileIds: z11.array(z11.string()).optional()
2075
2161
  })
2076
2162
  ]).optional()
2077
2163
  })
@@ -2089,29 +2175,29 @@ var codeInterpreter = (args = {}) => {
2089
2175
  // src/tool/custom.ts
2090
2176
  import {
2091
2177
  createProviderToolFactory,
2092
- lazySchema as lazySchema10,
2093
- zodSchema as zodSchema10
2178
+ lazySchema as lazySchema11,
2179
+ zodSchema as zodSchema11
2094
2180
  } from "@ai-sdk/provider-utils";
2095
- import { z as z11 } from "zod/v4";
2096
- var customArgsSchema = lazySchema10(
2097
- () => zodSchema10(
2098
- z11.object({
2099
- name: z11.string(),
2100
- description: z11.string().optional(),
2101
- format: z11.union([
2102
- z11.object({
2103
- type: z11.literal("grammar"),
2104
- syntax: z11.enum(["regex", "lark"]),
2105
- definition: z11.string()
2181
+ import { z as z12 } from "zod/v4";
2182
+ var customArgsSchema = lazySchema11(
2183
+ () => zodSchema11(
2184
+ z12.object({
2185
+ name: z12.string(),
2186
+ description: z12.string().optional(),
2187
+ format: z12.union([
2188
+ z12.object({
2189
+ type: z12.literal("grammar"),
2190
+ syntax: z12.enum(["regex", "lark"]),
2191
+ definition: z12.string()
2106
2192
  }),
2107
- z11.object({
2108
- type: z11.literal("text")
2193
+ z12.object({
2194
+ type: z12.literal("text")
2109
2195
  })
2110
2196
  ]).optional()
2111
2197
  })
2112
2198
  )
2113
2199
  );
2114
- var customInputSchema = lazySchema10(() => zodSchema10(z11.string()));
2200
+ var customInputSchema = lazySchema11(() => zodSchema11(z12.string()));
2115
2201
  var customToolFactory = createProviderToolFactory({
2116
2202
  id: "openai.custom",
2117
2203
  inputSchema: customInputSchema
@@ -2121,45 +2207,45 @@ var customTool = (args) => customToolFactory(args);
2121
2207
  // src/tool/file-search.ts
2122
2208
  import {
2123
2209
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
2124
- lazySchema as lazySchema11,
2125
- zodSchema as zodSchema11
2210
+ lazySchema as lazySchema12,
2211
+ zodSchema as zodSchema12
2126
2212
  } from "@ai-sdk/provider-utils";
2127
- import { z as z12 } from "zod/v4";
2128
- var comparisonFilterSchema = z12.object({
2129
- key: z12.string(),
2130
- type: z12.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2131
- value: z12.union([z12.string(), z12.number(), z12.boolean(), z12.array(z12.string())])
2213
+ import { z as z13 } from "zod/v4";
2214
+ var comparisonFilterSchema = z13.object({
2215
+ key: z13.string(),
2216
+ type: z13.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2217
+ value: z13.union([z13.string(), z13.number(), z13.boolean(), z13.array(z13.string())])
2132
2218
  });
2133
- var compoundFilterSchema = z12.object({
2134
- type: z12.enum(["and", "or"]),
2135
- filters: z12.array(
2136
- z12.union([comparisonFilterSchema, z12.lazy(() => compoundFilterSchema)])
2219
+ var compoundFilterSchema = z13.object({
2220
+ type: z13.enum(["and", "or"]),
2221
+ filters: z13.array(
2222
+ z13.union([comparisonFilterSchema, z13.lazy(() => compoundFilterSchema)])
2137
2223
  )
2138
2224
  });
2139
- var fileSearchArgsSchema = lazySchema11(
2140
- () => zodSchema11(
2141
- z12.object({
2142
- vectorStoreIds: z12.array(z12.string()),
2143
- maxNumResults: z12.number().optional(),
2144
- ranking: z12.object({
2145
- ranker: z12.string().optional(),
2146
- scoreThreshold: z12.number().optional()
2225
+ var fileSearchArgsSchema = lazySchema12(
2226
+ () => zodSchema12(
2227
+ z13.object({
2228
+ vectorStoreIds: z13.array(z13.string()),
2229
+ maxNumResults: z13.number().optional(),
2230
+ ranking: z13.object({
2231
+ ranker: z13.string().optional(),
2232
+ scoreThreshold: z13.number().optional()
2147
2233
  }).optional(),
2148
- filters: z12.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2234
+ filters: z13.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2149
2235
  })
2150
2236
  )
2151
2237
  );
2152
- var fileSearchOutputSchema = lazySchema11(
2153
- () => zodSchema11(
2154
- z12.object({
2155
- queries: z12.array(z12.string()),
2156
- results: z12.array(
2157
- z12.object({
2158
- attributes: z12.record(z12.string(), z12.unknown()),
2159
- fileId: z12.string(),
2160
- filename: z12.string(),
2161
- score: z12.number(),
2162
- text: z12.string()
2238
+ var fileSearchOutputSchema = lazySchema12(
2239
+ () => zodSchema12(
2240
+ z13.object({
2241
+ queries: z13.array(z13.string()),
2242
+ results: z13.array(
2243
+ z13.object({
2244
+ attributes: z13.record(z13.string(), z13.unknown()),
2245
+ fileId: z13.string(),
2246
+ filename: z13.string(),
2247
+ score: z13.number(),
2248
+ text: z13.string()
2163
2249
  })
2164
2250
  ).nullable()
2165
2251
  })
@@ -2167,39 +2253,39 @@ var fileSearchOutputSchema = lazySchema11(
2167
2253
  );
2168
2254
  var fileSearch = createProviderToolFactoryWithOutputSchema3({
2169
2255
  id: "openai.file_search",
2170
- inputSchema: z12.object({}),
2256
+ inputSchema: z13.object({}),
2171
2257
  outputSchema: fileSearchOutputSchema
2172
2258
  });
2173
2259
 
2174
2260
  // src/tool/image-generation.ts
2175
2261
  import {
2176
2262
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2177
- lazySchema as lazySchema12,
2178
- zodSchema as zodSchema12
2263
+ lazySchema as lazySchema13,
2264
+ zodSchema as zodSchema13
2179
2265
  } from "@ai-sdk/provider-utils";
2180
- import { z as z13 } from "zod/v4";
2181
- var imageGenerationArgsSchema = lazySchema12(
2182
- () => zodSchema12(
2183
- z13.object({
2184
- background: z13.enum(["auto", "opaque", "transparent"]).optional(),
2185
- inputFidelity: z13.enum(["low", "high"]).optional(),
2186
- inputImageMask: z13.object({
2187
- fileId: z13.string().optional(),
2188
- imageUrl: z13.string().optional()
2266
+ import { z as z14 } from "zod/v4";
2267
+ var imageGenerationArgsSchema = lazySchema13(
2268
+ () => zodSchema13(
2269
+ z14.object({
2270
+ background: z14.enum(["auto", "opaque", "transparent"]).optional(),
2271
+ inputFidelity: z14.enum(["low", "high"]).optional(),
2272
+ inputImageMask: z14.object({
2273
+ fileId: z14.string().optional(),
2274
+ imageUrl: z14.string().optional()
2189
2275
  }).optional(),
2190
- model: z13.string().optional(),
2191
- moderation: z13.enum(["auto"]).optional(),
2192
- outputCompression: z13.number().int().min(0).max(100).optional(),
2193
- outputFormat: z13.enum(["png", "jpeg", "webp"]).optional(),
2194
- partialImages: z13.number().int().min(0).max(3).optional(),
2195
- quality: z13.enum(["auto", "low", "medium", "high"]).optional(),
2196
- size: z13.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2276
+ model: z14.string().optional(),
2277
+ moderation: z14.enum(["auto"]).optional(),
2278
+ outputCompression: z14.number().int().min(0).max(100).optional(),
2279
+ outputFormat: z14.enum(["png", "jpeg", "webp"]).optional(),
2280
+ partialImages: z14.number().int().min(0).max(3).optional(),
2281
+ quality: z14.enum(["auto", "low", "medium", "high"]).optional(),
2282
+ size: z14.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2197
2283
  }).strict()
2198
2284
  )
2199
2285
  );
2200
- var imageGenerationInputSchema = lazySchema12(() => zodSchema12(z13.object({})));
2201
- var imageGenerationOutputSchema = lazySchema12(
2202
- () => zodSchema12(z13.object({ result: z13.string() }))
2286
+ var imageGenerationInputSchema = lazySchema13(() => zodSchema13(z14.object({})));
2287
+ var imageGenerationOutputSchema = lazySchema13(
2288
+ () => zodSchema13(z14.object({ result: z14.string() }))
2203
2289
  );
2204
2290
  var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({
2205
2291
  id: "openai.image_generation",
@@ -2213,26 +2299,26 @@ var imageGeneration = (args = {}) => {
2213
2299
  // src/tool/local-shell.ts
2214
2300
  import {
2215
2301
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
2216
- lazySchema as lazySchema13,
2217
- zodSchema as zodSchema13
2302
+ lazySchema as lazySchema14,
2303
+ zodSchema as zodSchema14
2218
2304
  } from "@ai-sdk/provider-utils";
2219
- import { z as z14 } from "zod/v4";
2220
- var localShellInputSchema = lazySchema13(
2221
- () => zodSchema13(
2222
- z14.object({
2223
- action: z14.object({
2224
- type: z14.literal("exec"),
2225
- command: z14.array(z14.string()),
2226
- timeoutMs: z14.number().optional(),
2227
- user: z14.string().optional(),
2228
- workingDirectory: z14.string().optional(),
2229
- env: z14.record(z14.string(), z14.string()).optional()
2305
+ import { z as z15 } from "zod/v4";
2306
+ var localShellInputSchema = lazySchema14(
2307
+ () => zodSchema14(
2308
+ z15.object({
2309
+ action: z15.object({
2310
+ type: z15.literal("exec"),
2311
+ command: z15.array(z15.string()),
2312
+ timeoutMs: z15.number().optional(),
2313
+ user: z15.string().optional(),
2314
+ workingDirectory: z15.string().optional(),
2315
+ env: z15.record(z15.string(), z15.string()).optional()
2230
2316
  })
2231
2317
  })
2232
2318
  )
2233
2319
  );
2234
- var localShellOutputSchema = lazySchema13(
2235
- () => zodSchema13(z14.object({ output: z14.string() }))
2320
+ var localShellOutputSchema = lazySchema14(
2321
+ () => zodSchema14(z15.object({ output: z15.string() }))
2236
2322
  );
2237
2323
  var localShell = createProviderToolFactoryWithOutputSchema5({
2238
2324
  id: "openai.local_shell",
@@ -2243,91 +2329,91 @@ var localShell = createProviderToolFactoryWithOutputSchema5({
2243
2329
  // src/tool/shell.ts
2244
2330
  import {
2245
2331
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
2246
- lazySchema as lazySchema14,
2247
- zodSchema as zodSchema14
2332
+ lazySchema as lazySchema15,
2333
+ zodSchema as zodSchema15
2248
2334
  } from "@ai-sdk/provider-utils";
2249
- import { z as z15 } from "zod/v4";
2250
- var shellInputSchema = lazySchema14(
2251
- () => zodSchema14(
2252
- z15.object({
2253
- action: z15.object({
2254
- commands: z15.array(z15.string()),
2255
- timeoutMs: z15.number().optional(),
2256
- maxOutputLength: z15.number().optional()
2335
+ import { z as z16 } from "zod/v4";
2336
+ var shellInputSchema = lazySchema15(
2337
+ () => zodSchema15(
2338
+ z16.object({
2339
+ action: z16.object({
2340
+ commands: z16.array(z16.string()),
2341
+ timeoutMs: z16.number().optional(),
2342
+ maxOutputLength: z16.number().optional()
2257
2343
  })
2258
2344
  })
2259
2345
  )
2260
2346
  );
2261
- var shellOutputSchema = lazySchema14(
2262
- () => zodSchema14(
2263
- z15.object({
2264
- output: z15.array(
2265
- z15.object({
2266
- stdout: z15.string(),
2267
- stderr: z15.string(),
2268
- outcome: z15.discriminatedUnion("type", [
2269
- z15.object({ type: z15.literal("timeout") }),
2270
- z15.object({ type: z15.literal("exit"), exitCode: z15.number() })
2347
+ var shellOutputSchema = lazySchema15(
2348
+ () => zodSchema15(
2349
+ z16.object({
2350
+ output: z16.array(
2351
+ z16.object({
2352
+ stdout: z16.string(),
2353
+ stderr: z16.string(),
2354
+ outcome: z16.discriminatedUnion("type", [
2355
+ z16.object({ type: z16.literal("timeout") }),
2356
+ z16.object({ type: z16.literal("exit"), exitCode: z16.number() })
2271
2357
  ])
2272
2358
  })
2273
2359
  )
2274
2360
  })
2275
2361
  )
2276
2362
  );
2277
- var shellSkillsSchema = z15.array(
2278
- z15.discriminatedUnion("type", [
2279
- z15.object({
2280
- type: z15.literal("skillReference"),
2281
- skillId: z15.string(),
2282
- version: z15.string().optional()
2363
+ var shellSkillsSchema = z16.array(
2364
+ z16.discriminatedUnion("type", [
2365
+ z16.object({
2366
+ type: z16.literal("skillReference"),
2367
+ skillId: z16.string(),
2368
+ version: z16.string().optional()
2283
2369
  }),
2284
- z15.object({
2285
- type: z15.literal("inline"),
2286
- name: z15.string(),
2287
- description: z15.string(),
2288
- source: z15.object({
2289
- type: z15.literal("base64"),
2290
- mediaType: z15.literal("application/zip"),
2291
- data: z15.string()
2370
+ z16.object({
2371
+ type: z16.literal("inline"),
2372
+ name: z16.string(),
2373
+ description: z16.string(),
2374
+ source: z16.object({
2375
+ type: z16.literal("base64"),
2376
+ mediaType: z16.literal("application/zip"),
2377
+ data: z16.string()
2292
2378
  })
2293
2379
  })
2294
2380
  ])
2295
2381
  ).optional();
2296
- var shellArgsSchema = lazySchema14(
2297
- () => zodSchema14(
2298
- z15.object({
2299
- environment: z15.union([
2300
- z15.object({
2301
- type: z15.literal("containerAuto"),
2302
- fileIds: z15.array(z15.string()).optional(),
2303
- memoryLimit: z15.enum(["1g", "4g", "16g", "64g"]).optional(),
2304
- networkPolicy: z15.discriminatedUnion("type", [
2305
- z15.object({ type: z15.literal("disabled") }),
2306
- z15.object({
2307
- type: z15.literal("allowlist"),
2308
- allowedDomains: z15.array(z15.string()),
2309
- domainSecrets: z15.array(
2310
- z15.object({
2311
- domain: z15.string(),
2312
- name: z15.string(),
2313
- value: z15.string()
2382
+ var shellArgsSchema = lazySchema15(
2383
+ () => zodSchema15(
2384
+ z16.object({
2385
+ environment: z16.union([
2386
+ z16.object({
2387
+ type: z16.literal("containerAuto"),
2388
+ fileIds: z16.array(z16.string()).optional(),
2389
+ memoryLimit: z16.enum(["1g", "4g", "16g", "64g"]).optional(),
2390
+ networkPolicy: z16.discriminatedUnion("type", [
2391
+ z16.object({ type: z16.literal("disabled") }),
2392
+ z16.object({
2393
+ type: z16.literal("allowlist"),
2394
+ allowedDomains: z16.array(z16.string()),
2395
+ domainSecrets: z16.array(
2396
+ z16.object({
2397
+ domain: z16.string(),
2398
+ name: z16.string(),
2399
+ value: z16.string()
2314
2400
  })
2315
2401
  ).optional()
2316
2402
  })
2317
2403
  ]).optional(),
2318
2404
  skills: shellSkillsSchema
2319
2405
  }),
2320
- z15.object({
2321
- type: z15.literal("containerReference"),
2322
- containerId: z15.string()
2406
+ z16.object({
2407
+ type: z16.literal("containerReference"),
2408
+ containerId: z16.string()
2323
2409
  }),
2324
- z15.object({
2325
- type: z15.literal("local").optional(),
2326
- skills: z15.array(
2327
- z15.object({
2328
- name: z15.string(),
2329
- description: z15.string(),
2330
- path: z15.string()
2410
+ z16.object({
2411
+ type: z16.literal("local").optional(),
2412
+ skills: z16.array(
2413
+ z16.object({
2414
+ name: z16.string(),
2415
+ description: z16.string(),
2416
+ path: z16.string()
2331
2417
  })
2332
2418
  ).optional()
2333
2419
  })
@@ -2344,31 +2430,31 @@ var shell = createProviderToolFactoryWithOutputSchema6({
2344
2430
  // src/tool/tool-search.ts
2345
2431
  import {
2346
2432
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
2347
- lazySchema as lazySchema15,
2348
- zodSchema as zodSchema15
2433
+ lazySchema as lazySchema16,
2434
+ zodSchema as zodSchema16
2349
2435
  } from "@ai-sdk/provider-utils";
2350
- import { z as z16 } from "zod/v4";
2351
- var toolSearchArgsSchema = lazySchema15(
2352
- () => zodSchema15(
2353
- z16.object({
2354
- execution: z16.enum(["server", "client"]).optional(),
2355
- description: z16.string().optional(),
2356
- parameters: z16.record(z16.string(), z16.unknown()).optional()
2436
+ import { z as z17 } from "zod/v4";
2437
+ var toolSearchArgsSchema = lazySchema16(
2438
+ () => zodSchema16(
2439
+ z17.object({
2440
+ execution: z17.enum(["server", "client"]).optional(),
2441
+ description: z17.string().optional(),
2442
+ parameters: z17.record(z17.string(), z17.unknown()).optional()
2357
2443
  })
2358
2444
  )
2359
2445
  );
2360
- var toolSearchInputSchema = lazySchema15(
2361
- () => zodSchema15(
2362
- z16.object({
2363
- arguments: z16.unknown().optional(),
2364
- call_id: z16.string().nullish()
2446
+ var toolSearchInputSchema = lazySchema16(
2447
+ () => zodSchema16(
2448
+ z17.object({
2449
+ arguments: z17.unknown().optional(),
2450
+ call_id: z17.string().nullish()
2365
2451
  })
2366
2452
  )
2367
2453
  );
2368
- var toolSearchOutputSchema = lazySchema15(
2369
- () => zodSchema15(
2370
- z16.object({
2371
- tools: z16.array(z16.record(z16.string(), z16.unknown()))
2454
+ var toolSearchOutputSchema = lazySchema16(
2455
+ () => zodSchema16(
2456
+ z17.object({
2457
+ tools: z17.array(z17.record(z17.string(), z17.unknown()))
2372
2458
  })
2373
2459
  )
2374
2460
  );
@@ -2382,71 +2468,15 @@ var toolSearch = (args = {}) => toolSearchToolFactory(args);
2382
2468
  // src/tool/web-search.ts
2383
2469
  import {
2384
2470
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
2385
- lazySchema as lazySchema16,
2386
- zodSchema as zodSchema16
2387
- } from "@ai-sdk/provider-utils";
2388
- import { z as z17 } from "zod/v4";
2389
- var webSearchArgsSchema = lazySchema16(
2390
- () => zodSchema16(
2391
- z17.object({
2392
- externalWebAccess: z17.boolean().optional(),
2393
- filters: z17.object({ allowedDomains: z17.array(z17.string()).optional() }).optional(),
2394
- searchContextSize: z17.enum(["low", "medium", "high"]).optional(),
2395
- userLocation: z17.object({
2396
- type: z17.literal("approximate"),
2397
- country: z17.string().optional(),
2398
- city: z17.string().optional(),
2399
- region: z17.string().optional(),
2400
- timezone: z17.string().optional()
2401
- }).optional()
2402
- })
2403
- )
2404
- );
2405
- var webSearchInputSchema = lazySchema16(() => zodSchema16(z17.object({})));
2406
- var webSearchOutputSchema = lazySchema16(
2407
- () => zodSchema16(
2408
- z17.object({
2409
- action: z17.discriminatedUnion("type", [
2410
- z17.object({
2411
- type: z17.literal("search"),
2412
- query: z17.string().optional()
2413
- }),
2414
- z17.object({
2415
- type: z17.literal("openPage"),
2416
- url: z17.string().nullish()
2417
- }),
2418
- z17.object({
2419
- type: z17.literal("findInPage"),
2420
- url: z17.string().nullish(),
2421
- pattern: z17.string().nullish()
2422
- })
2423
- ]).optional(),
2424
- sources: z17.array(
2425
- z17.discriminatedUnion("type", [
2426
- z17.object({ type: z17.literal("url"), url: z17.string() }),
2427
- z17.object({ type: z17.literal("api"), name: z17.string() })
2428
- ])
2429
- ).optional()
2430
- })
2431
- )
2432
- );
2433
- var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
2434
- id: "openai.web_search",
2435
- inputSchema: webSearchInputSchema,
2436
- outputSchema: webSearchOutputSchema
2437
- });
2438
- var webSearch = (args = {}) => webSearchToolFactory(args);
2439
-
2440
- // src/tool/web-search-preview.ts
2441
- import {
2442
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
2443
2471
  lazySchema as lazySchema17,
2444
2472
  zodSchema as zodSchema17
2445
2473
  } from "@ai-sdk/provider-utils";
2446
2474
  import { z as z18 } from "zod/v4";
2447
- var webSearchPreviewArgsSchema = lazySchema17(
2475
+ var webSearchArgsSchema = lazySchema17(
2448
2476
  () => zodSchema17(
2449
2477
  z18.object({
2478
+ externalWebAccess: z18.boolean().optional(),
2479
+ filters: z18.object({ allowedDomains: z18.array(z18.string()).optional() }).optional(),
2450
2480
  searchContextSize: z18.enum(["low", "medium", "high"]).optional(),
2451
2481
  userLocation: z18.object({
2452
2482
  type: z18.literal("approximate"),
@@ -2458,10 +2488,8 @@ var webSearchPreviewArgsSchema = lazySchema17(
2458
2488
  })
2459
2489
  )
2460
2490
  );
2461
- var webSearchPreviewInputSchema = lazySchema17(
2462
- () => zodSchema17(z18.object({}))
2463
- );
2464
- var webSearchPreviewOutputSchema = lazySchema17(
2491
+ var webSearchInputSchema = lazySchema17(() => zodSchema17(z18.object({})));
2492
+ var webSearchOutputSchema = lazySchema17(
2465
2493
  () => zodSchema17(
2466
2494
  z18.object({
2467
2495
  action: z18.discriminatedUnion("type", [
@@ -2478,6 +2506,64 @@ var webSearchPreviewOutputSchema = lazySchema17(
2478
2506
  url: z18.string().nullish(),
2479
2507
  pattern: z18.string().nullish()
2480
2508
  })
2509
+ ]).optional(),
2510
+ sources: z18.array(
2511
+ z18.discriminatedUnion("type", [
2512
+ z18.object({ type: z18.literal("url"), url: z18.string() }),
2513
+ z18.object({ type: z18.literal("api"), name: z18.string() })
2514
+ ])
2515
+ ).optional()
2516
+ })
2517
+ )
2518
+ );
2519
+ var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
2520
+ id: "openai.web_search",
2521
+ inputSchema: webSearchInputSchema,
2522
+ outputSchema: webSearchOutputSchema
2523
+ });
2524
+ var webSearch = (args = {}) => webSearchToolFactory(args);
2525
+
2526
+ // src/tool/web-search-preview.ts
2527
+ import {
2528
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
2529
+ lazySchema as lazySchema18,
2530
+ zodSchema as zodSchema18
2531
+ } from "@ai-sdk/provider-utils";
2532
+ import { z as z19 } from "zod/v4";
2533
+ var webSearchPreviewArgsSchema = lazySchema18(
2534
+ () => zodSchema18(
2535
+ z19.object({
2536
+ searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
2537
+ userLocation: z19.object({
2538
+ type: z19.literal("approximate"),
2539
+ country: z19.string().optional(),
2540
+ city: z19.string().optional(),
2541
+ region: z19.string().optional(),
2542
+ timezone: z19.string().optional()
2543
+ }).optional()
2544
+ })
2545
+ )
2546
+ );
2547
+ var webSearchPreviewInputSchema = lazySchema18(
2548
+ () => zodSchema18(z19.object({}))
2549
+ );
2550
+ var webSearchPreviewOutputSchema = lazySchema18(
2551
+ () => zodSchema18(
2552
+ z19.object({
2553
+ action: z19.discriminatedUnion("type", [
2554
+ z19.object({
2555
+ type: z19.literal("search"),
2556
+ query: z19.string().optional()
2557
+ }),
2558
+ z19.object({
2559
+ type: z19.literal("openPage"),
2560
+ url: z19.string().nullish()
2561
+ }),
2562
+ z19.object({
2563
+ type: z19.literal("findInPage"),
2564
+ url: z19.string().nullish(),
2565
+ pattern: z19.string().nullish()
2566
+ })
2481
2567
  ]).optional()
2482
2568
  })
2483
2569
  )
@@ -2491,60 +2577,60 @@ var webSearchPreview = createProviderToolFactoryWithOutputSchema9({
2491
2577
  // src/tool/mcp.ts
2492
2578
  import {
2493
2579
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
2494
- lazySchema as lazySchema18,
2495
- zodSchema as zodSchema18
2580
+ lazySchema as lazySchema19,
2581
+ zodSchema as zodSchema19
2496
2582
  } from "@ai-sdk/provider-utils";
2497
- import { z as z19 } from "zod/v4";
2498
- var jsonValueSchema = z19.lazy(
2499
- () => z19.union([
2500
- z19.string(),
2501
- z19.number(),
2502
- z19.boolean(),
2503
- z19.null(),
2504
- z19.array(jsonValueSchema),
2505
- z19.record(z19.string(), jsonValueSchema)
2583
+ import { z as z20 } from "zod/v4";
2584
+ var jsonValueSchema = z20.lazy(
2585
+ () => z20.union([
2586
+ z20.string(),
2587
+ z20.number(),
2588
+ z20.boolean(),
2589
+ z20.null(),
2590
+ z20.array(jsonValueSchema),
2591
+ z20.record(z20.string(), jsonValueSchema)
2506
2592
  ])
2507
2593
  );
2508
- var mcpArgsSchema = lazySchema18(
2509
- () => zodSchema18(
2510
- z19.object({
2511
- serverLabel: z19.string(),
2512
- allowedTools: z19.union([
2513
- z19.array(z19.string()),
2514
- z19.object({
2515
- readOnly: z19.boolean().optional(),
2516
- toolNames: z19.array(z19.string()).optional()
2594
+ var mcpArgsSchema = lazySchema19(
2595
+ () => zodSchema19(
2596
+ z20.object({
2597
+ serverLabel: z20.string(),
2598
+ allowedTools: z20.union([
2599
+ z20.array(z20.string()),
2600
+ z20.object({
2601
+ readOnly: z20.boolean().optional(),
2602
+ toolNames: z20.array(z20.string()).optional()
2517
2603
  })
2518
2604
  ]).optional(),
2519
- authorization: z19.string().optional(),
2520
- connectorId: z19.string().optional(),
2521
- headers: z19.record(z19.string(), z19.string()).optional(),
2522
- requireApproval: z19.union([
2523
- z19.enum(["always", "never"]),
2524
- z19.object({
2525
- never: z19.object({
2526
- toolNames: z19.array(z19.string()).optional()
2605
+ authorization: z20.string().optional(),
2606
+ connectorId: z20.string().optional(),
2607
+ headers: z20.record(z20.string(), z20.string()).optional(),
2608
+ requireApproval: z20.union([
2609
+ z20.enum(["always", "never"]),
2610
+ z20.object({
2611
+ never: z20.object({
2612
+ toolNames: z20.array(z20.string()).optional()
2527
2613
  }).optional()
2528
2614
  })
2529
2615
  ]).optional(),
2530
- serverDescription: z19.string().optional(),
2531
- serverUrl: z19.string().optional()
2616
+ serverDescription: z20.string().optional(),
2617
+ serverUrl: z20.string().optional()
2532
2618
  }).refine(
2533
2619
  (v) => v.serverUrl != null || v.connectorId != null,
2534
2620
  "One of serverUrl or connectorId must be provided."
2535
2621
  )
2536
2622
  )
2537
2623
  );
2538
- var mcpInputSchema = lazySchema18(() => zodSchema18(z19.object({})));
2539
- var mcpOutputSchema = lazySchema18(
2540
- () => zodSchema18(
2541
- z19.object({
2542
- type: z19.literal("call"),
2543
- serverLabel: z19.string(),
2544
- name: z19.string(),
2545
- arguments: z19.string(),
2546
- output: z19.string().nullish(),
2547
- error: z19.union([z19.string(), jsonValueSchema]).optional()
2624
+ var mcpInputSchema = lazySchema19(() => zodSchema19(z20.object({})));
2625
+ var mcpOutputSchema = lazySchema19(
2626
+ () => zodSchema19(
2627
+ z20.object({
2628
+ type: z20.literal("call"),
2629
+ serverLabel: z20.string(),
2630
+ name: z20.string(),
2631
+ arguments: z20.string(),
2632
+ output: z20.string().nullish(),
2633
+ error: z20.union([z20.string(), jsonValueSchema]).optional()
2548
2634
  })
2549
2635
  )
2550
2636
  );
@@ -2683,7 +2769,7 @@ import {
2683
2769
  createJsonResponseHandler as createJsonResponseHandler5,
2684
2770
  createToolNameMapping,
2685
2771
  generateId as generateId2,
2686
- parseProviderOptions as parseProviderOptions5,
2772
+ parseProviderOptions as parseProviderOptions6,
2687
2773
  postJsonToApi as postJsonToApi5
2688
2774
  } from "@ai-sdk/provider-utils";
2689
2775
 
@@ -2734,10 +2820,10 @@ import {
2734
2820
  convertToBase64 as convertToBase642,
2735
2821
  isNonNullable,
2736
2822
  parseJSON,
2737
- parseProviderOptions as parseProviderOptions4,
2823
+ parseProviderOptions as parseProviderOptions5,
2738
2824
  validateTypes
2739
2825
  } from "@ai-sdk/provider-utils";
2740
- import { z as z20 } from "zod/v4";
2826
+ import { z as z21 } from "zod/v4";
2741
2827
  function serializeToolCallArguments2(input) {
2742
2828
  return JSON.stringify(input === void 0 ? {} : input);
2743
2829
  }
@@ -3033,7 +3119,7 @@ async function convertToOpenAIResponsesInput({
3033
3119
  break;
3034
3120
  }
3035
3121
  case "reasoning": {
3036
- const providerOptions = await parseProviderOptions4({
3122
+ const providerOptions = await parseProviderOptions5({
3037
3123
  provider: providerOptionsName,
3038
3124
  providerOptions: part.providerOptions,
3039
3125
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -3341,9 +3427,9 @@ async function convertToOpenAIResponsesInput({
3341
3427
  }
3342
3428
  return { input, warnings };
3343
3429
  }
3344
- var openaiResponsesReasoningProviderOptionsSchema = z20.object({
3345
- itemId: z20.string().nullish(),
3346
- reasoningEncryptedContent: z20.string().nullish()
3430
+ var openaiResponsesReasoningProviderOptionsSchema = z21.object({
3431
+ itemId: z21.string().nullish(),
3432
+ reasoningEncryptedContent: z21.string().nullish()
3347
3433
  });
3348
3434
 
3349
3435
  // src/responses/map-openai-responses-finish-reason.ts
@@ -3366,544 +3452,544 @@ function mapOpenAIResponseFinishReason({
3366
3452
 
3367
3453
  // src/responses/openai-responses-api.ts
3368
3454
  import {
3369
- lazySchema as lazySchema19,
3370
- zodSchema as zodSchema19
3455
+ lazySchema as lazySchema20,
3456
+ zodSchema as zodSchema20
3371
3457
  } from "@ai-sdk/provider-utils";
3372
- import { z as z21 } from "zod/v4";
3373
- var jsonValueSchema2 = z21.lazy(
3374
- () => z21.union([
3375
- z21.string(),
3376
- z21.number(),
3377
- z21.boolean(),
3378
- z21.null(),
3379
- z21.array(jsonValueSchema2),
3380
- z21.record(z21.string(), jsonValueSchema2.optional())
3458
+ import { z as z22 } from "zod/v4";
3459
+ var jsonValueSchema2 = z22.lazy(
3460
+ () => z22.union([
3461
+ z22.string(),
3462
+ z22.number(),
3463
+ z22.boolean(),
3464
+ z22.null(),
3465
+ z22.array(jsonValueSchema2),
3466
+ z22.record(z22.string(), jsonValueSchema2.optional())
3381
3467
  ])
3382
3468
  );
3383
- var openaiResponsesChunkSchema = lazySchema19(
3384
- () => zodSchema19(
3385
- z21.union([
3386
- z21.object({
3387
- type: z21.literal("response.output_text.delta"),
3388
- item_id: z21.string(),
3389
- delta: z21.string(),
3390
- logprobs: z21.array(
3391
- z21.object({
3392
- token: z21.string(),
3393
- logprob: z21.number(),
3394
- top_logprobs: z21.array(
3395
- z21.object({
3396
- token: z21.string(),
3397
- logprob: z21.number()
3469
+ var openaiResponsesChunkSchema = lazySchema20(
3470
+ () => zodSchema20(
3471
+ z22.union([
3472
+ z22.object({
3473
+ type: z22.literal("response.output_text.delta"),
3474
+ item_id: z22.string(),
3475
+ delta: z22.string(),
3476
+ logprobs: z22.array(
3477
+ z22.object({
3478
+ token: z22.string(),
3479
+ logprob: z22.number(),
3480
+ top_logprobs: z22.array(
3481
+ z22.object({
3482
+ token: z22.string(),
3483
+ logprob: z22.number()
3398
3484
  })
3399
3485
  )
3400
3486
  })
3401
3487
  ).nullish()
3402
3488
  }),
3403
- z21.object({
3404
- type: z21.enum(["response.completed", "response.incomplete"]),
3405
- response: z21.object({
3406
- incomplete_details: z21.object({ reason: z21.string() }).nullish(),
3407
- usage: z21.object({
3408
- input_tokens: z21.number(),
3409
- input_tokens_details: z21.object({ cached_tokens: z21.number().nullish() }).nullish(),
3410
- output_tokens: z21.number(),
3411
- output_tokens_details: z21.object({ reasoning_tokens: z21.number().nullish() }).nullish()
3489
+ z22.object({
3490
+ type: z22.enum(["response.completed", "response.incomplete"]),
3491
+ response: z22.object({
3492
+ incomplete_details: z22.object({ reason: z22.string() }).nullish(),
3493
+ usage: z22.object({
3494
+ input_tokens: z22.number(),
3495
+ input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
3496
+ output_tokens: z22.number(),
3497
+ output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
3412
3498
  }),
3413
- service_tier: z21.string().nullish()
3499
+ service_tier: z22.string().nullish()
3414
3500
  })
3415
3501
  }),
3416
- z21.object({
3417
- type: z21.literal("response.failed"),
3418
- response: z21.object({
3419
- error: z21.object({
3420
- code: z21.string().nullish(),
3421
- message: z21.string()
3502
+ z22.object({
3503
+ type: z22.literal("response.failed"),
3504
+ response: z22.object({
3505
+ error: z22.object({
3506
+ code: z22.string().nullish(),
3507
+ message: z22.string()
3422
3508
  }).nullish(),
3423
- incomplete_details: z21.object({ reason: z21.string() }).nullish(),
3424
- usage: z21.object({
3425
- input_tokens: z21.number(),
3426
- input_tokens_details: z21.object({ cached_tokens: z21.number().nullish() }).nullish(),
3427
- output_tokens: z21.number(),
3428
- output_tokens_details: z21.object({ reasoning_tokens: z21.number().nullish() }).nullish()
3509
+ incomplete_details: z22.object({ reason: z22.string() }).nullish(),
3510
+ usage: z22.object({
3511
+ input_tokens: z22.number(),
3512
+ input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
3513
+ output_tokens: z22.number(),
3514
+ output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
3429
3515
  }).nullish(),
3430
- service_tier: z21.string().nullish()
3516
+ service_tier: z22.string().nullish()
3431
3517
  })
3432
3518
  }),
3433
- z21.object({
3434
- type: z21.literal("response.created"),
3435
- response: z21.object({
3436
- id: z21.string(),
3437
- created_at: z21.number(),
3438
- model: z21.string(),
3439
- service_tier: z21.string().nullish()
3519
+ z22.object({
3520
+ type: z22.literal("response.created"),
3521
+ response: z22.object({
3522
+ id: z22.string(),
3523
+ created_at: z22.number(),
3524
+ model: z22.string(),
3525
+ service_tier: z22.string().nullish()
3440
3526
  })
3441
3527
  }),
3442
- z21.object({
3443
- type: z21.literal("response.output_item.added"),
3444
- output_index: z21.number(),
3445
- item: z21.discriminatedUnion("type", [
3446
- z21.object({
3447
- type: z21.literal("message"),
3448
- id: z21.string(),
3449
- phase: z21.enum(["commentary", "final_answer"]).nullish()
3528
+ z22.object({
3529
+ type: z22.literal("response.output_item.added"),
3530
+ output_index: z22.number(),
3531
+ item: z22.discriminatedUnion("type", [
3532
+ z22.object({
3533
+ type: z22.literal("message"),
3534
+ id: z22.string(),
3535
+ phase: z22.enum(["commentary", "final_answer"]).nullish()
3450
3536
  }),
3451
- z21.object({
3452
- type: z21.literal("reasoning"),
3453
- id: z21.string(),
3454
- encrypted_content: z21.string().nullish()
3537
+ z22.object({
3538
+ type: z22.literal("reasoning"),
3539
+ id: z22.string(),
3540
+ encrypted_content: z22.string().nullish()
3455
3541
  }),
3456
- z21.object({
3457
- type: z21.literal("function_call"),
3458
- id: z21.string(),
3459
- call_id: z21.string(),
3460
- name: z21.string(),
3461
- arguments: z21.string()
3542
+ z22.object({
3543
+ type: z22.literal("function_call"),
3544
+ id: z22.string(),
3545
+ call_id: z22.string(),
3546
+ name: z22.string(),
3547
+ arguments: z22.string()
3462
3548
  }),
3463
- z21.object({
3464
- type: z21.literal("web_search_call"),
3465
- id: z21.string(),
3466
- status: z21.string()
3549
+ z22.object({
3550
+ type: z22.literal("web_search_call"),
3551
+ id: z22.string(),
3552
+ status: z22.string()
3467
3553
  }),
3468
- z21.object({
3469
- type: z21.literal("computer_call"),
3470
- id: z21.string(),
3471
- status: z21.string()
3554
+ z22.object({
3555
+ type: z22.literal("computer_call"),
3556
+ id: z22.string(),
3557
+ status: z22.string()
3472
3558
  }),
3473
- z21.object({
3474
- type: z21.literal("file_search_call"),
3475
- id: z21.string()
3559
+ z22.object({
3560
+ type: z22.literal("file_search_call"),
3561
+ id: z22.string()
3476
3562
  }),
3477
- z21.object({
3478
- type: z21.literal("image_generation_call"),
3479
- id: z21.string()
3563
+ z22.object({
3564
+ type: z22.literal("image_generation_call"),
3565
+ id: z22.string()
3480
3566
  }),
3481
- z21.object({
3482
- type: z21.literal("code_interpreter_call"),
3483
- id: z21.string(),
3484
- container_id: z21.string(),
3485
- code: z21.string().nullable(),
3486
- outputs: z21.array(
3487
- z21.discriminatedUnion("type", [
3488
- z21.object({ type: z21.literal("logs"), logs: z21.string() }),
3489
- z21.object({ type: z21.literal("image"), url: z21.string() })
3567
+ z22.object({
3568
+ type: z22.literal("code_interpreter_call"),
3569
+ id: z22.string(),
3570
+ container_id: z22.string(),
3571
+ code: z22.string().nullable(),
3572
+ outputs: z22.array(
3573
+ z22.discriminatedUnion("type", [
3574
+ z22.object({ type: z22.literal("logs"), logs: z22.string() }),
3575
+ z22.object({ type: z22.literal("image"), url: z22.string() })
3490
3576
  ])
3491
3577
  ).nullable(),
3492
- status: z21.string()
3578
+ status: z22.string()
3493
3579
  }),
3494
- z21.object({
3495
- type: z21.literal("mcp_call"),
3496
- id: z21.string(),
3497
- status: z21.string(),
3498
- approval_request_id: z21.string().nullish()
3580
+ z22.object({
3581
+ type: z22.literal("mcp_call"),
3582
+ id: z22.string(),
3583
+ status: z22.string(),
3584
+ approval_request_id: z22.string().nullish()
3499
3585
  }),
3500
- z21.object({
3501
- type: z21.literal("mcp_list_tools"),
3502
- id: z21.string()
3586
+ z22.object({
3587
+ type: z22.literal("mcp_list_tools"),
3588
+ id: z22.string()
3503
3589
  }),
3504
- z21.object({
3505
- type: z21.literal("mcp_approval_request"),
3506
- id: z21.string()
3590
+ z22.object({
3591
+ type: z22.literal("mcp_approval_request"),
3592
+ id: z22.string()
3507
3593
  }),
3508
- z21.object({
3509
- type: z21.literal("apply_patch_call"),
3510
- id: z21.string(),
3511
- call_id: z21.string(),
3512
- status: z21.enum(["in_progress", "completed"]),
3513
- operation: z21.discriminatedUnion("type", [
3514
- z21.object({
3515
- type: z21.literal("create_file"),
3516
- path: z21.string(),
3517
- diff: z21.string()
3594
+ z22.object({
3595
+ type: z22.literal("apply_patch_call"),
3596
+ id: z22.string(),
3597
+ call_id: z22.string(),
3598
+ status: z22.enum(["in_progress", "completed"]),
3599
+ operation: z22.discriminatedUnion("type", [
3600
+ z22.object({
3601
+ type: z22.literal("create_file"),
3602
+ path: z22.string(),
3603
+ diff: z22.string()
3518
3604
  }),
3519
- z21.object({
3520
- type: z21.literal("delete_file"),
3521
- path: z21.string()
3605
+ z22.object({
3606
+ type: z22.literal("delete_file"),
3607
+ path: z22.string()
3522
3608
  }),
3523
- z21.object({
3524
- type: z21.literal("update_file"),
3525
- path: z21.string(),
3526
- diff: z21.string()
3609
+ z22.object({
3610
+ type: z22.literal("update_file"),
3611
+ path: z22.string(),
3612
+ diff: z22.string()
3527
3613
  })
3528
3614
  ])
3529
3615
  }),
3530
- z21.object({
3531
- type: z21.literal("custom_tool_call"),
3532
- id: z21.string(),
3533
- call_id: z21.string(),
3534
- name: z21.string(),
3535
- input: z21.string()
3616
+ z22.object({
3617
+ type: z22.literal("custom_tool_call"),
3618
+ id: z22.string(),
3619
+ call_id: z22.string(),
3620
+ name: z22.string(),
3621
+ input: z22.string()
3536
3622
  }),
3537
- z21.object({
3538
- type: z21.literal("shell_call"),
3539
- id: z21.string(),
3540
- call_id: z21.string(),
3541
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3542
- action: z21.object({
3543
- commands: z21.array(z21.string())
3623
+ z22.object({
3624
+ type: z22.literal("shell_call"),
3625
+ id: z22.string(),
3626
+ call_id: z22.string(),
3627
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3628
+ action: z22.object({
3629
+ commands: z22.array(z22.string())
3544
3630
  })
3545
3631
  }),
3546
- z21.object({
3547
- type: z21.literal("shell_call_output"),
3548
- id: z21.string(),
3549
- call_id: z21.string(),
3550
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3551
- output: z21.array(
3552
- z21.object({
3553
- stdout: z21.string(),
3554
- stderr: z21.string(),
3555
- outcome: z21.discriminatedUnion("type", [
3556
- z21.object({ type: z21.literal("timeout") }),
3557
- z21.object({
3558
- type: z21.literal("exit"),
3559
- exit_code: z21.number()
3632
+ z22.object({
3633
+ type: z22.literal("shell_call_output"),
3634
+ id: z22.string(),
3635
+ call_id: z22.string(),
3636
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3637
+ output: z22.array(
3638
+ z22.object({
3639
+ stdout: z22.string(),
3640
+ stderr: z22.string(),
3641
+ outcome: z22.discriminatedUnion("type", [
3642
+ z22.object({ type: z22.literal("timeout") }),
3643
+ z22.object({
3644
+ type: z22.literal("exit"),
3645
+ exit_code: z22.number()
3560
3646
  })
3561
3647
  ])
3562
3648
  })
3563
3649
  )
3564
3650
  }),
3565
- z21.object({
3566
- type: z21.literal("tool_search_call"),
3567
- id: z21.string(),
3568
- execution: z21.enum(["server", "client"]),
3569
- call_id: z21.string().nullable(),
3570
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3571
- arguments: z21.unknown()
3651
+ z22.object({
3652
+ type: z22.literal("tool_search_call"),
3653
+ id: z22.string(),
3654
+ execution: z22.enum(["server", "client"]),
3655
+ call_id: z22.string().nullable(),
3656
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3657
+ arguments: z22.unknown()
3572
3658
  }),
3573
- z21.object({
3574
- type: z21.literal("tool_search_output"),
3575
- id: z21.string(),
3576
- execution: z21.enum(["server", "client"]),
3577
- call_id: z21.string().nullable(),
3578
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3579
- tools: z21.array(z21.record(z21.string(), jsonValueSchema2.optional()))
3659
+ z22.object({
3660
+ type: z22.literal("tool_search_output"),
3661
+ id: z22.string(),
3662
+ execution: z22.enum(["server", "client"]),
3663
+ call_id: z22.string().nullable(),
3664
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3665
+ tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
3580
3666
  })
3581
3667
  ])
3582
3668
  }),
3583
- z21.object({
3584
- type: z21.literal("response.output_item.done"),
3585
- output_index: z21.number(),
3586
- item: z21.discriminatedUnion("type", [
3587
- z21.object({
3588
- type: z21.literal("message"),
3589
- id: z21.string(),
3590
- phase: z21.enum(["commentary", "final_answer"]).nullish()
3669
+ z22.object({
3670
+ type: z22.literal("response.output_item.done"),
3671
+ output_index: z22.number(),
3672
+ item: z22.discriminatedUnion("type", [
3673
+ z22.object({
3674
+ type: z22.literal("message"),
3675
+ id: z22.string(),
3676
+ phase: z22.enum(["commentary", "final_answer"]).nullish()
3591
3677
  }),
3592
- z21.object({
3593
- type: z21.literal("reasoning"),
3594
- id: z21.string(),
3595
- encrypted_content: z21.string().nullish()
3678
+ z22.object({
3679
+ type: z22.literal("reasoning"),
3680
+ id: z22.string(),
3681
+ encrypted_content: z22.string().nullish()
3596
3682
  }),
3597
- z21.object({
3598
- type: z21.literal("function_call"),
3599
- id: z21.string(),
3600
- call_id: z21.string(),
3601
- name: z21.string(),
3602
- arguments: z21.string(),
3603
- status: z21.literal("completed")
3683
+ z22.object({
3684
+ type: z22.literal("function_call"),
3685
+ id: z22.string(),
3686
+ call_id: z22.string(),
3687
+ name: z22.string(),
3688
+ arguments: z22.string(),
3689
+ status: z22.literal("completed")
3604
3690
  }),
3605
- z21.object({
3606
- type: z21.literal("custom_tool_call"),
3607
- id: z21.string(),
3608
- call_id: z21.string(),
3609
- name: z21.string(),
3610
- input: z21.string(),
3611
- status: z21.literal("completed")
3691
+ z22.object({
3692
+ type: z22.literal("custom_tool_call"),
3693
+ id: z22.string(),
3694
+ call_id: z22.string(),
3695
+ name: z22.string(),
3696
+ input: z22.string(),
3697
+ status: z22.literal("completed")
3612
3698
  }),
3613
- z21.object({
3614
- type: z21.literal("code_interpreter_call"),
3615
- id: z21.string(),
3616
- code: z21.string().nullable(),
3617
- container_id: z21.string(),
3618
- outputs: z21.array(
3619
- z21.discriminatedUnion("type", [
3620
- z21.object({ type: z21.literal("logs"), logs: z21.string() }),
3621
- z21.object({ type: z21.literal("image"), url: z21.string() })
3699
+ z22.object({
3700
+ type: z22.literal("code_interpreter_call"),
3701
+ id: z22.string(),
3702
+ code: z22.string().nullable(),
3703
+ container_id: z22.string(),
3704
+ outputs: z22.array(
3705
+ z22.discriminatedUnion("type", [
3706
+ z22.object({ type: z22.literal("logs"), logs: z22.string() }),
3707
+ z22.object({ type: z22.literal("image"), url: z22.string() })
3622
3708
  ])
3623
3709
  ).nullable()
3624
3710
  }),
3625
- z21.object({
3626
- type: z21.literal("image_generation_call"),
3627
- id: z21.string(),
3628
- result: z21.string()
3711
+ z22.object({
3712
+ type: z22.literal("image_generation_call"),
3713
+ id: z22.string(),
3714
+ result: z22.string()
3629
3715
  }),
3630
- z21.object({
3631
- type: z21.literal("web_search_call"),
3632
- id: z21.string(),
3633
- status: z21.string(),
3634
- action: z21.discriminatedUnion("type", [
3635
- z21.object({
3636
- type: z21.literal("search"),
3637
- query: z21.string().nullish(),
3638
- sources: z21.array(
3639
- z21.discriminatedUnion("type", [
3640
- z21.object({ type: z21.literal("url"), url: z21.string() }),
3641
- z21.object({ type: z21.literal("api"), name: z21.string() })
3716
+ z22.object({
3717
+ type: z22.literal("web_search_call"),
3718
+ id: z22.string(),
3719
+ status: z22.string(),
3720
+ action: z22.discriminatedUnion("type", [
3721
+ z22.object({
3722
+ type: z22.literal("search"),
3723
+ query: z22.string().nullish(),
3724
+ sources: z22.array(
3725
+ z22.discriminatedUnion("type", [
3726
+ z22.object({ type: z22.literal("url"), url: z22.string() }),
3727
+ z22.object({ type: z22.literal("api"), name: z22.string() })
3642
3728
  ])
3643
3729
  ).nullish()
3644
3730
  }),
3645
- z21.object({
3646
- type: z21.literal("open_page"),
3647
- url: z21.string().nullish()
3731
+ z22.object({
3732
+ type: z22.literal("open_page"),
3733
+ url: z22.string().nullish()
3648
3734
  }),
3649
- z21.object({
3650
- type: z21.literal("find_in_page"),
3651
- url: z21.string().nullish(),
3652
- pattern: z21.string().nullish()
3735
+ z22.object({
3736
+ type: z22.literal("find_in_page"),
3737
+ url: z22.string().nullish(),
3738
+ pattern: z22.string().nullish()
3653
3739
  })
3654
3740
  ]).nullish()
3655
3741
  }),
3656
- z21.object({
3657
- type: z21.literal("file_search_call"),
3658
- id: z21.string(),
3659
- queries: z21.array(z21.string()),
3660
- results: z21.array(
3661
- z21.object({
3662
- attributes: z21.record(
3663
- z21.string(),
3664
- z21.union([z21.string(), z21.number(), z21.boolean()])
3742
+ z22.object({
3743
+ type: z22.literal("file_search_call"),
3744
+ id: z22.string(),
3745
+ queries: z22.array(z22.string()),
3746
+ results: z22.array(
3747
+ z22.object({
3748
+ attributes: z22.record(
3749
+ z22.string(),
3750
+ z22.union([z22.string(), z22.number(), z22.boolean()])
3665
3751
  ),
3666
- file_id: z21.string(),
3667
- filename: z21.string(),
3668
- score: z21.number(),
3669
- text: z21.string()
3752
+ file_id: z22.string(),
3753
+ filename: z22.string(),
3754
+ score: z22.number(),
3755
+ text: z22.string()
3670
3756
  })
3671
3757
  ).nullish()
3672
3758
  }),
3673
- z21.object({
3674
- type: z21.literal("local_shell_call"),
3675
- id: z21.string(),
3676
- call_id: z21.string(),
3677
- action: z21.object({
3678
- type: z21.literal("exec"),
3679
- command: z21.array(z21.string()),
3680
- timeout_ms: z21.number().optional(),
3681
- user: z21.string().optional(),
3682
- working_directory: z21.string().optional(),
3683
- env: z21.record(z21.string(), z21.string()).optional()
3759
+ z22.object({
3760
+ type: z22.literal("local_shell_call"),
3761
+ id: z22.string(),
3762
+ call_id: z22.string(),
3763
+ action: z22.object({
3764
+ type: z22.literal("exec"),
3765
+ command: z22.array(z22.string()),
3766
+ timeout_ms: z22.number().optional(),
3767
+ user: z22.string().optional(),
3768
+ working_directory: z22.string().optional(),
3769
+ env: z22.record(z22.string(), z22.string()).optional()
3684
3770
  })
3685
3771
  }),
3686
- z21.object({
3687
- type: z21.literal("computer_call"),
3688
- id: z21.string(),
3689
- status: z21.literal("completed")
3772
+ z22.object({
3773
+ type: z22.literal("computer_call"),
3774
+ id: z22.string(),
3775
+ status: z22.literal("completed")
3690
3776
  }),
3691
- z21.object({
3692
- type: z21.literal("mcp_call"),
3693
- id: z21.string(),
3694
- status: z21.string(),
3695
- arguments: z21.string(),
3696
- name: z21.string(),
3697
- server_label: z21.string(),
3698
- output: z21.string().nullish(),
3699
- error: z21.union([
3700
- z21.string(),
3701
- z21.object({
3702
- type: z21.string().optional(),
3703
- code: z21.union([z21.number(), z21.string()]).optional(),
3704
- message: z21.string().optional()
3777
+ z22.object({
3778
+ type: z22.literal("mcp_call"),
3779
+ id: z22.string(),
3780
+ status: z22.string(),
3781
+ arguments: z22.string(),
3782
+ name: z22.string(),
3783
+ server_label: z22.string(),
3784
+ output: z22.string().nullish(),
3785
+ error: z22.union([
3786
+ z22.string(),
3787
+ z22.object({
3788
+ type: z22.string().optional(),
3789
+ code: z22.union([z22.number(), z22.string()]).optional(),
3790
+ message: z22.string().optional()
3705
3791
  }).loose()
3706
3792
  ]).nullish(),
3707
- approval_request_id: z21.string().nullish()
3793
+ approval_request_id: z22.string().nullish()
3708
3794
  }),
3709
- z21.object({
3710
- type: z21.literal("mcp_list_tools"),
3711
- id: z21.string(),
3712
- server_label: z21.string(),
3713
- tools: z21.array(
3714
- z21.object({
3715
- name: z21.string(),
3716
- description: z21.string().optional(),
3717
- input_schema: z21.any(),
3718
- annotations: z21.record(z21.string(), z21.unknown()).optional()
3795
+ z22.object({
3796
+ type: z22.literal("mcp_list_tools"),
3797
+ id: z22.string(),
3798
+ server_label: z22.string(),
3799
+ tools: z22.array(
3800
+ z22.object({
3801
+ name: z22.string(),
3802
+ description: z22.string().optional(),
3803
+ input_schema: z22.any(),
3804
+ annotations: z22.record(z22.string(), z22.unknown()).optional()
3719
3805
  })
3720
3806
  ),
3721
- error: z21.union([
3722
- z21.string(),
3723
- z21.object({
3724
- type: z21.string().optional(),
3725
- code: z21.union([z21.number(), z21.string()]).optional(),
3726
- message: z21.string().optional()
3807
+ error: z22.union([
3808
+ z22.string(),
3809
+ z22.object({
3810
+ type: z22.string().optional(),
3811
+ code: z22.union([z22.number(), z22.string()]).optional(),
3812
+ message: z22.string().optional()
3727
3813
  }).loose()
3728
3814
  ]).optional()
3729
3815
  }),
3730
- z21.object({
3731
- type: z21.literal("mcp_approval_request"),
3732
- id: z21.string(),
3733
- server_label: z21.string(),
3734
- name: z21.string(),
3735
- arguments: z21.string(),
3736
- approval_request_id: z21.string().optional()
3816
+ z22.object({
3817
+ type: z22.literal("mcp_approval_request"),
3818
+ id: z22.string(),
3819
+ server_label: z22.string(),
3820
+ name: z22.string(),
3821
+ arguments: z22.string(),
3822
+ approval_request_id: z22.string().optional()
3737
3823
  }),
3738
- z21.object({
3739
- type: z21.literal("apply_patch_call"),
3740
- id: z21.string(),
3741
- call_id: z21.string(),
3742
- status: z21.enum(["in_progress", "completed"]),
3743
- operation: z21.discriminatedUnion("type", [
3744
- z21.object({
3745
- type: z21.literal("create_file"),
3746
- path: z21.string(),
3747
- diff: z21.string()
3824
+ z22.object({
3825
+ type: z22.literal("apply_patch_call"),
3826
+ id: z22.string(),
3827
+ call_id: z22.string(),
3828
+ status: z22.enum(["in_progress", "completed"]),
3829
+ operation: z22.discriminatedUnion("type", [
3830
+ z22.object({
3831
+ type: z22.literal("create_file"),
3832
+ path: z22.string(),
3833
+ diff: z22.string()
3748
3834
  }),
3749
- z21.object({
3750
- type: z21.literal("delete_file"),
3751
- path: z21.string()
3835
+ z22.object({
3836
+ type: z22.literal("delete_file"),
3837
+ path: z22.string()
3752
3838
  }),
3753
- z21.object({
3754
- type: z21.literal("update_file"),
3755
- path: z21.string(),
3756
- diff: z21.string()
3839
+ z22.object({
3840
+ type: z22.literal("update_file"),
3841
+ path: z22.string(),
3842
+ diff: z22.string()
3757
3843
  })
3758
3844
  ])
3759
3845
  }),
3760
- z21.object({
3761
- type: z21.literal("shell_call"),
3762
- id: z21.string(),
3763
- call_id: z21.string(),
3764
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3765
- action: z21.object({
3766
- commands: z21.array(z21.string())
3846
+ z22.object({
3847
+ type: z22.literal("shell_call"),
3848
+ id: z22.string(),
3849
+ call_id: z22.string(),
3850
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3851
+ action: z22.object({
3852
+ commands: z22.array(z22.string())
3767
3853
  })
3768
3854
  }),
3769
- z21.object({
3770
- type: z21.literal("shell_call_output"),
3771
- id: z21.string(),
3772
- call_id: z21.string(),
3773
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3774
- output: z21.array(
3775
- z21.object({
3776
- stdout: z21.string(),
3777
- stderr: z21.string(),
3778
- outcome: z21.discriminatedUnion("type", [
3779
- z21.object({ type: z21.literal("timeout") }),
3780
- z21.object({
3781
- type: z21.literal("exit"),
3782
- exit_code: z21.number()
3855
+ z22.object({
3856
+ type: z22.literal("shell_call_output"),
3857
+ id: z22.string(),
3858
+ call_id: z22.string(),
3859
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3860
+ output: z22.array(
3861
+ z22.object({
3862
+ stdout: z22.string(),
3863
+ stderr: z22.string(),
3864
+ outcome: z22.discriminatedUnion("type", [
3865
+ z22.object({ type: z22.literal("timeout") }),
3866
+ z22.object({
3867
+ type: z22.literal("exit"),
3868
+ exit_code: z22.number()
3783
3869
  })
3784
3870
  ])
3785
3871
  })
3786
3872
  )
3787
3873
  }),
3788
- z21.object({
3789
- type: z21.literal("tool_search_call"),
3790
- id: z21.string(),
3791
- execution: z21.enum(["server", "client"]),
3792
- call_id: z21.string().nullable(),
3793
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3794
- arguments: z21.unknown()
3874
+ z22.object({
3875
+ type: z22.literal("tool_search_call"),
3876
+ id: z22.string(),
3877
+ execution: z22.enum(["server", "client"]),
3878
+ call_id: z22.string().nullable(),
3879
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3880
+ arguments: z22.unknown()
3795
3881
  }),
3796
- z21.object({
3797
- type: z21.literal("tool_search_output"),
3798
- id: z21.string(),
3799
- execution: z21.enum(["server", "client"]),
3800
- call_id: z21.string().nullable(),
3801
- status: z21.enum(["in_progress", "completed", "incomplete"]),
3802
- tools: z21.array(z21.record(z21.string(), jsonValueSchema2.optional()))
3882
+ z22.object({
3883
+ type: z22.literal("tool_search_output"),
3884
+ id: z22.string(),
3885
+ execution: z22.enum(["server", "client"]),
3886
+ call_id: z22.string().nullable(),
3887
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
3888
+ tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
3803
3889
  })
3804
3890
  ])
3805
3891
  }),
3806
- z21.object({
3807
- type: z21.literal("response.function_call_arguments.delta"),
3808
- item_id: z21.string(),
3809
- output_index: z21.number(),
3810
- delta: z21.string()
3892
+ z22.object({
3893
+ type: z22.literal("response.function_call_arguments.delta"),
3894
+ item_id: z22.string(),
3895
+ output_index: z22.number(),
3896
+ delta: z22.string()
3811
3897
  }),
3812
- z21.object({
3813
- type: z21.literal("response.custom_tool_call_input.delta"),
3814
- item_id: z21.string(),
3815
- output_index: z21.number(),
3816
- delta: z21.string()
3898
+ z22.object({
3899
+ type: z22.literal("response.custom_tool_call_input.delta"),
3900
+ item_id: z22.string(),
3901
+ output_index: z22.number(),
3902
+ delta: z22.string()
3817
3903
  }),
3818
- z21.object({
3819
- type: z21.literal("response.image_generation_call.partial_image"),
3820
- item_id: z21.string(),
3821
- output_index: z21.number(),
3822
- partial_image_b64: z21.string()
3904
+ z22.object({
3905
+ type: z22.literal("response.image_generation_call.partial_image"),
3906
+ item_id: z22.string(),
3907
+ output_index: z22.number(),
3908
+ partial_image_b64: z22.string()
3823
3909
  }),
3824
- z21.object({
3825
- type: z21.literal("response.code_interpreter_call_code.delta"),
3826
- item_id: z21.string(),
3827
- output_index: z21.number(),
3828
- delta: z21.string()
3910
+ z22.object({
3911
+ type: z22.literal("response.code_interpreter_call_code.delta"),
3912
+ item_id: z22.string(),
3913
+ output_index: z22.number(),
3914
+ delta: z22.string()
3829
3915
  }),
3830
- z21.object({
3831
- type: z21.literal("response.code_interpreter_call_code.done"),
3832
- item_id: z21.string(),
3833
- output_index: z21.number(),
3834
- code: z21.string()
3916
+ z22.object({
3917
+ type: z22.literal("response.code_interpreter_call_code.done"),
3918
+ item_id: z22.string(),
3919
+ output_index: z22.number(),
3920
+ code: z22.string()
3835
3921
  }),
3836
- z21.object({
3837
- type: z21.literal("response.output_text.annotation.added"),
3838
- annotation: z21.discriminatedUnion("type", [
3839
- z21.object({
3840
- type: z21.literal("url_citation"),
3841
- start_index: z21.number(),
3842
- end_index: z21.number(),
3843
- url: z21.string(),
3844
- title: z21.string()
3922
+ z22.object({
3923
+ type: z22.literal("response.output_text.annotation.added"),
3924
+ annotation: z22.discriminatedUnion("type", [
3925
+ z22.object({
3926
+ type: z22.literal("url_citation"),
3927
+ start_index: z22.number(),
3928
+ end_index: z22.number(),
3929
+ url: z22.string(),
3930
+ title: z22.string()
3845
3931
  }),
3846
- z21.object({
3847
- type: z21.literal("file_citation"),
3848
- file_id: z21.string(),
3849
- filename: z21.string(),
3850
- index: z21.number()
3932
+ z22.object({
3933
+ type: z22.literal("file_citation"),
3934
+ file_id: z22.string(),
3935
+ filename: z22.string(),
3936
+ index: z22.number()
3851
3937
  }),
3852
- z21.object({
3853
- type: z21.literal("container_file_citation"),
3854
- container_id: z21.string(),
3855
- file_id: z21.string(),
3856
- filename: z21.string(),
3857
- start_index: z21.number(),
3858
- end_index: z21.number()
3938
+ z22.object({
3939
+ type: z22.literal("container_file_citation"),
3940
+ container_id: z22.string(),
3941
+ file_id: z22.string(),
3942
+ filename: z22.string(),
3943
+ start_index: z22.number(),
3944
+ end_index: z22.number()
3859
3945
  }),
3860
- z21.object({
3861
- type: z21.literal("file_path"),
3862
- file_id: z21.string(),
3863
- index: z21.number()
3946
+ z22.object({
3947
+ type: z22.literal("file_path"),
3948
+ file_id: z22.string(),
3949
+ index: z22.number()
3864
3950
  })
3865
3951
  ])
3866
3952
  }),
3867
- z21.object({
3868
- type: z21.literal("response.reasoning_summary_part.added"),
3869
- item_id: z21.string(),
3870
- summary_index: z21.number()
3953
+ z22.object({
3954
+ type: z22.literal("response.reasoning_summary_part.added"),
3955
+ item_id: z22.string(),
3956
+ summary_index: z22.number()
3871
3957
  }),
3872
- z21.object({
3873
- type: z21.literal("response.reasoning_summary_text.delta"),
3874
- item_id: z21.string(),
3875
- summary_index: z21.number(),
3876
- delta: z21.string()
3958
+ z22.object({
3959
+ type: z22.literal("response.reasoning_summary_text.delta"),
3960
+ item_id: z22.string(),
3961
+ summary_index: z22.number(),
3962
+ delta: z22.string()
3877
3963
  }),
3878
- z21.object({
3879
- type: z21.literal("response.reasoning_summary_part.done"),
3880
- item_id: z21.string(),
3881
- summary_index: z21.number()
3964
+ z22.object({
3965
+ type: z22.literal("response.reasoning_summary_part.done"),
3966
+ item_id: z22.string(),
3967
+ summary_index: z22.number()
3882
3968
  }),
3883
- z21.object({
3884
- type: z21.literal("response.apply_patch_call_operation_diff.delta"),
3885
- item_id: z21.string(),
3886
- output_index: z21.number(),
3887
- delta: z21.string(),
3888
- obfuscation: z21.string().nullish()
3969
+ z22.object({
3970
+ type: z22.literal("response.apply_patch_call_operation_diff.delta"),
3971
+ item_id: z22.string(),
3972
+ output_index: z22.number(),
3973
+ delta: z22.string(),
3974
+ obfuscation: z22.string().nullish()
3889
3975
  }),
3890
- z21.object({
3891
- type: z21.literal("response.apply_patch_call_operation_diff.done"),
3892
- item_id: z21.string(),
3893
- output_index: z21.number(),
3894
- diff: z21.string()
3976
+ z22.object({
3977
+ type: z22.literal("response.apply_patch_call_operation_diff.done"),
3978
+ item_id: z22.string(),
3979
+ output_index: z22.number(),
3980
+ diff: z22.string()
3895
3981
  }),
3896
- z21.object({
3897
- type: z21.literal("error"),
3898
- sequence_number: z21.number(),
3899
- error: z21.object({
3900
- type: z21.string(),
3901
- code: z21.string(),
3902
- message: z21.string(),
3903
- param: z21.string().nullish()
3982
+ z22.object({
3983
+ type: z22.literal("error"),
3984
+ sequence_number: z22.number(),
3985
+ error: z22.object({
3986
+ type: z22.string(),
3987
+ code: z22.string(),
3988
+ message: z22.string(),
3989
+ param: z22.string().nullish()
3904
3990
  })
3905
3991
  }),
3906
- z21.object({ type: z21.string() }).loose().transform((value) => ({
3992
+ z22.object({ type: z22.string() }).loose().transform((value) => ({
3907
3993
  type: "unknown_chunk",
3908
3994
  message: value.type
3909
3995
  }))
@@ -3911,302 +3997,302 @@ var openaiResponsesChunkSchema = lazySchema19(
3911
3997
  ])
3912
3998
  )
3913
3999
  );
3914
- var openaiResponsesResponseSchema = lazySchema19(
3915
- () => zodSchema19(
3916
- z21.object({
3917
- id: z21.string().optional(),
3918
- created_at: z21.number().optional(),
3919
- error: z21.object({
3920
- message: z21.string(),
3921
- type: z21.string(),
3922
- param: z21.string().nullish(),
3923
- code: z21.string()
4000
+ var openaiResponsesResponseSchema = lazySchema20(
4001
+ () => zodSchema20(
4002
+ z22.object({
4003
+ id: z22.string().optional(),
4004
+ created_at: z22.number().optional(),
4005
+ error: z22.object({
4006
+ message: z22.string(),
4007
+ type: z22.string(),
4008
+ param: z22.string().nullish(),
4009
+ code: z22.string()
3924
4010
  }).nullish(),
3925
- model: z21.string().optional(),
3926
- output: z21.array(
3927
- z21.discriminatedUnion("type", [
3928
- z21.object({
3929
- type: z21.literal("message"),
3930
- role: z21.literal("assistant"),
3931
- id: z21.string(),
3932
- phase: z21.enum(["commentary", "final_answer"]).nullish(),
3933
- content: z21.array(
3934
- z21.object({
3935
- type: z21.literal("output_text"),
3936
- text: z21.string(),
3937
- logprobs: z21.array(
3938
- z21.object({
3939
- token: z21.string(),
3940
- logprob: z21.number(),
3941
- top_logprobs: z21.array(
3942
- z21.object({
3943
- token: z21.string(),
3944
- logprob: z21.number()
4011
+ model: z22.string().optional(),
4012
+ output: z22.array(
4013
+ z22.discriminatedUnion("type", [
4014
+ z22.object({
4015
+ type: z22.literal("message"),
4016
+ role: z22.literal("assistant"),
4017
+ id: z22.string(),
4018
+ phase: z22.enum(["commentary", "final_answer"]).nullish(),
4019
+ content: z22.array(
4020
+ z22.object({
4021
+ type: z22.literal("output_text"),
4022
+ text: z22.string(),
4023
+ logprobs: z22.array(
4024
+ z22.object({
4025
+ token: z22.string(),
4026
+ logprob: z22.number(),
4027
+ top_logprobs: z22.array(
4028
+ z22.object({
4029
+ token: z22.string(),
4030
+ logprob: z22.number()
3945
4031
  })
3946
4032
  )
3947
4033
  })
3948
4034
  ).nullish(),
3949
- annotations: z21.array(
3950
- z21.discriminatedUnion("type", [
3951
- z21.object({
3952
- type: z21.literal("url_citation"),
3953
- start_index: z21.number(),
3954
- end_index: z21.number(),
3955
- url: z21.string(),
3956
- title: z21.string()
4035
+ annotations: z22.array(
4036
+ z22.discriminatedUnion("type", [
4037
+ z22.object({
4038
+ type: z22.literal("url_citation"),
4039
+ start_index: z22.number(),
4040
+ end_index: z22.number(),
4041
+ url: z22.string(),
4042
+ title: z22.string()
3957
4043
  }),
3958
- z21.object({
3959
- type: z21.literal("file_citation"),
3960
- file_id: z21.string(),
3961
- filename: z21.string(),
3962
- index: z21.number()
4044
+ z22.object({
4045
+ type: z22.literal("file_citation"),
4046
+ file_id: z22.string(),
4047
+ filename: z22.string(),
4048
+ index: z22.number()
3963
4049
  }),
3964
- z21.object({
3965
- type: z21.literal("container_file_citation"),
3966
- container_id: z21.string(),
3967
- file_id: z21.string(),
3968
- filename: z21.string(),
3969
- start_index: z21.number(),
3970
- end_index: z21.number()
4050
+ z22.object({
4051
+ type: z22.literal("container_file_citation"),
4052
+ container_id: z22.string(),
4053
+ file_id: z22.string(),
4054
+ filename: z22.string(),
4055
+ start_index: z22.number(),
4056
+ end_index: z22.number()
3971
4057
  }),
3972
- z21.object({
3973
- type: z21.literal("file_path"),
3974
- file_id: z21.string(),
3975
- index: z21.number()
4058
+ z22.object({
4059
+ type: z22.literal("file_path"),
4060
+ file_id: z22.string(),
4061
+ index: z22.number()
3976
4062
  })
3977
4063
  ])
3978
4064
  )
3979
4065
  })
3980
4066
  )
3981
4067
  }),
3982
- z21.object({
3983
- type: z21.literal("web_search_call"),
3984
- id: z21.string(),
3985
- status: z21.string(),
3986
- action: z21.discriminatedUnion("type", [
3987
- z21.object({
3988
- type: z21.literal("search"),
3989
- query: z21.string().nullish(),
3990
- sources: z21.array(
3991
- z21.discriminatedUnion("type", [
3992
- z21.object({ type: z21.literal("url"), url: z21.string() }),
3993
- z21.object({
3994
- type: z21.literal("api"),
3995
- name: z21.string()
4068
+ z22.object({
4069
+ type: z22.literal("web_search_call"),
4070
+ id: z22.string(),
4071
+ status: z22.string(),
4072
+ action: z22.discriminatedUnion("type", [
4073
+ z22.object({
4074
+ type: z22.literal("search"),
4075
+ query: z22.string().nullish(),
4076
+ sources: z22.array(
4077
+ z22.discriminatedUnion("type", [
4078
+ z22.object({ type: z22.literal("url"), url: z22.string() }),
4079
+ z22.object({
4080
+ type: z22.literal("api"),
4081
+ name: z22.string()
3996
4082
  })
3997
4083
  ])
3998
4084
  ).nullish()
3999
4085
  }),
4000
- z21.object({
4001
- type: z21.literal("open_page"),
4002
- url: z21.string().nullish()
4086
+ z22.object({
4087
+ type: z22.literal("open_page"),
4088
+ url: z22.string().nullish()
4003
4089
  }),
4004
- z21.object({
4005
- type: z21.literal("find_in_page"),
4006
- url: z21.string().nullish(),
4007
- pattern: z21.string().nullish()
4090
+ z22.object({
4091
+ type: z22.literal("find_in_page"),
4092
+ url: z22.string().nullish(),
4093
+ pattern: z22.string().nullish()
4008
4094
  })
4009
4095
  ]).nullish()
4010
4096
  }),
4011
- z21.object({
4012
- type: z21.literal("file_search_call"),
4013
- id: z21.string(),
4014
- queries: z21.array(z21.string()),
4015
- results: z21.array(
4016
- z21.object({
4017
- attributes: z21.record(
4018
- z21.string(),
4019
- z21.union([z21.string(), z21.number(), z21.boolean()])
4097
+ z22.object({
4098
+ type: z22.literal("file_search_call"),
4099
+ id: z22.string(),
4100
+ queries: z22.array(z22.string()),
4101
+ results: z22.array(
4102
+ z22.object({
4103
+ attributes: z22.record(
4104
+ z22.string(),
4105
+ z22.union([z22.string(), z22.number(), z22.boolean()])
4020
4106
  ),
4021
- file_id: z21.string(),
4022
- filename: z21.string(),
4023
- score: z21.number(),
4024
- text: z21.string()
4107
+ file_id: z22.string(),
4108
+ filename: z22.string(),
4109
+ score: z22.number(),
4110
+ text: z22.string()
4025
4111
  })
4026
4112
  ).nullish()
4027
4113
  }),
4028
- z21.object({
4029
- type: z21.literal("code_interpreter_call"),
4030
- id: z21.string(),
4031
- code: z21.string().nullable(),
4032
- container_id: z21.string(),
4033
- outputs: z21.array(
4034
- z21.discriminatedUnion("type", [
4035
- z21.object({ type: z21.literal("logs"), logs: z21.string() }),
4036
- z21.object({ type: z21.literal("image"), url: z21.string() })
4114
+ z22.object({
4115
+ type: z22.literal("code_interpreter_call"),
4116
+ id: z22.string(),
4117
+ code: z22.string().nullable(),
4118
+ container_id: z22.string(),
4119
+ outputs: z22.array(
4120
+ z22.discriminatedUnion("type", [
4121
+ z22.object({ type: z22.literal("logs"), logs: z22.string() }),
4122
+ z22.object({ type: z22.literal("image"), url: z22.string() })
4037
4123
  ])
4038
4124
  ).nullable()
4039
4125
  }),
4040
- z21.object({
4041
- type: z21.literal("image_generation_call"),
4042
- id: z21.string(),
4043
- result: z21.string()
4126
+ z22.object({
4127
+ type: z22.literal("image_generation_call"),
4128
+ id: z22.string(),
4129
+ result: z22.string()
4044
4130
  }),
4045
- z21.object({
4046
- type: z21.literal("local_shell_call"),
4047
- id: z21.string(),
4048
- call_id: z21.string(),
4049
- action: z21.object({
4050
- type: z21.literal("exec"),
4051
- command: z21.array(z21.string()),
4052
- timeout_ms: z21.number().optional(),
4053
- user: z21.string().optional(),
4054
- working_directory: z21.string().optional(),
4055
- env: z21.record(z21.string(), z21.string()).optional()
4131
+ z22.object({
4132
+ type: z22.literal("local_shell_call"),
4133
+ id: z22.string(),
4134
+ call_id: z22.string(),
4135
+ action: z22.object({
4136
+ type: z22.literal("exec"),
4137
+ command: z22.array(z22.string()),
4138
+ timeout_ms: z22.number().optional(),
4139
+ user: z22.string().optional(),
4140
+ working_directory: z22.string().optional(),
4141
+ env: z22.record(z22.string(), z22.string()).optional()
4056
4142
  })
4057
4143
  }),
4058
- z21.object({
4059
- type: z21.literal("function_call"),
4060
- call_id: z21.string(),
4061
- name: z21.string(),
4062
- arguments: z21.string(),
4063
- id: z21.string()
4144
+ z22.object({
4145
+ type: z22.literal("function_call"),
4146
+ call_id: z22.string(),
4147
+ name: z22.string(),
4148
+ arguments: z22.string(),
4149
+ id: z22.string()
4064
4150
  }),
4065
- z21.object({
4066
- type: z21.literal("custom_tool_call"),
4067
- call_id: z21.string(),
4068
- name: z21.string(),
4069
- input: z21.string(),
4070
- id: z21.string()
4151
+ z22.object({
4152
+ type: z22.literal("custom_tool_call"),
4153
+ call_id: z22.string(),
4154
+ name: z22.string(),
4155
+ input: z22.string(),
4156
+ id: z22.string()
4071
4157
  }),
4072
- z21.object({
4073
- type: z21.literal("computer_call"),
4074
- id: z21.string(),
4075
- status: z21.string().optional()
4158
+ z22.object({
4159
+ type: z22.literal("computer_call"),
4160
+ id: z22.string(),
4161
+ status: z22.string().optional()
4076
4162
  }),
4077
- z21.object({
4078
- type: z21.literal("reasoning"),
4079
- id: z21.string(),
4080
- encrypted_content: z21.string().nullish(),
4081
- summary: z21.array(
4082
- z21.object({
4083
- type: z21.literal("summary_text"),
4084
- text: z21.string()
4163
+ z22.object({
4164
+ type: z22.literal("reasoning"),
4165
+ id: z22.string(),
4166
+ encrypted_content: z22.string().nullish(),
4167
+ summary: z22.array(
4168
+ z22.object({
4169
+ type: z22.literal("summary_text"),
4170
+ text: z22.string()
4085
4171
  })
4086
4172
  )
4087
4173
  }),
4088
- z21.object({
4089
- type: z21.literal("mcp_call"),
4090
- id: z21.string(),
4091
- status: z21.string(),
4092
- arguments: z21.string(),
4093
- name: z21.string(),
4094
- server_label: z21.string(),
4095
- output: z21.string().nullish(),
4096
- error: z21.union([
4097
- z21.string(),
4098
- z21.object({
4099
- type: z21.string().optional(),
4100
- code: z21.union([z21.number(), z21.string()]).optional(),
4101
- message: z21.string().optional()
4174
+ z22.object({
4175
+ type: z22.literal("mcp_call"),
4176
+ id: z22.string(),
4177
+ status: z22.string(),
4178
+ arguments: z22.string(),
4179
+ name: z22.string(),
4180
+ server_label: z22.string(),
4181
+ output: z22.string().nullish(),
4182
+ error: z22.union([
4183
+ z22.string(),
4184
+ z22.object({
4185
+ type: z22.string().optional(),
4186
+ code: z22.union([z22.number(), z22.string()]).optional(),
4187
+ message: z22.string().optional()
4102
4188
  }).loose()
4103
4189
  ]).nullish(),
4104
- approval_request_id: z21.string().nullish()
4190
+ approval_request_id: z22.string().nullish()
4105
4191
  }),
4106
- z21.object({
4107
- type: z21.literal("mcp_list_tools"),
4108
- id: z21.string(),
4109
- server_label: z21.string(),
4110
- tools: z21.array(
4111
- z21.object({
4112
- name: z21.string(),
4113
- description: z21.string().optional(),
4114
- input_schema: z21.any(),
4115
- annotations: z21.record(z21.string(), z21.unknown()).optional()
4192
+ z22.object({
4193
+ type: z22.literal("mcp_list_tools"),
4194
+ id: z22.string(),
4195
+ server_label: z22.string(),
4196
+ tools: z22.array(
4197
+ z22.object({
4198
+ name: z22.string(),
4199
+ description: z22.string().optional(),
4200
+ input_schema: z22.any(),
4201
+ annotations: z22.record(z22.string(), z22.unknown()).optional()
4116
4202
  })
4117
4203
  ),
4118
- error: z21.union([
4119
- z21.string(),
4120
- z21.object({
4121
- type: z21.string().optional(),
4122
- code: z21.union([z21.number(), z21.string()]).optional(),
4123
- message: z21.string().optional()
4204
+ error: z22.union([
4205
+ z22.string(),
4206
+ z22.object({
4207
+ type: z22.string().optional(),
4208
+ code: z22.union([z22.number(), z22.string()]).optional(),
4209
+ message: z22.string().optional()
4124
4210
  }).loose()
4125
4211
  ]).optional()
4126
4212
  }),
4127
- z21.object({
4128
- type: z21.literal("mcp_approval_request"),
4129
- id: z21.string(),
4130
- server_label: z21.string(),
4131
- name: z21.string(),
4132
- arguments: z21.string(),
4133
- approval_request_id: z21.string().optional()
4213
+ z22.object({
4214
+ type: z22.literal("mcp_approval_request"),
4215
+ id: z22.string(),
4216
+ server_label: z22.string(),
4217
+ name: z22.string(),
4218
+ arguments: z22.string(),
4219
+ approval_request_id: z22.string().optional()
4134
4220
  }),
4135
- z21.object({
4136
- type: z21.literal("apply_patch_call"),
4137
- id: z21.string(),
4138
- call_id: z21.string(),
4139
- status: z21.enum(["in_progress", "completed"]),
4140
- operation: z21.discriminatedUnion("type", [
4141
- z21.object({
4142
- type: z21.literal("create_file"),
4143
- path: z21.string(),
4144
- diff: z21.string()
4221
+ z22.object({
4222
+ type: z22.literal("apply_patch_call"),
4223
+ id: z22.string(),
4224
+ call_id: z22.string(),
4225
+ status: z22.enum(["in_progress", "completed"]),
4226
+ operation: z22.discriminatedUnion("type", [
4227
+ z22.object({
4228
+ type: z22.literal("create_file"),
4229
+ path: z22.string(),
4230
+ diff: z22.string()
4145
4231
  }),
4146
- z21.object({
4147
- type: z21.literal("delete_file"),
4148
- path: z21.string()
4232
+ z22.object({
4233
+ type: z22.literal("delete_file"),
4234
+ path: z22.string()
4149
4235
  }),
4150
- z21.object({
4151
- type: z21.literal("update_file"),
4152
- path: z21.string(),
4153
- diff: z21.string()
4236
+ z22.object({
4237
+ type: z22.literal("update_file"),
4238
+ path: z22.string(),
4239
+ diff: z22.string()
4154
4240
  })
4155
4241
  ])
4156
4242
  }),
4157
- z21.object({
4158
- type: z21.literal("shell_call"),
4159
- id: z21.string(),
4160
- call_id: z21.string(),
4161
- status: z21.enum(["in_progress", "completed", "incomplete"]),
4162
- action: z21.object({
4163
- commands: z21.array(z21.string())
4243
+ z22.object({
4244
+ type: z22.literal("shell_call"),
4245
+ id: z22.string(),
4246
+ call_id: z22.string(),
4247
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
4248
+ action: z22.object({
4249
+ commands: z22.array(z22.string())
4164
4250
  })
4165
4251
  }),
4166
- z21.object({
4167
- type: z21.literal("shell_call_output"),
4168
- id: z21.string(),
4169
- call_id: z21.string(),
4170
- status: z21.enum(["in_progress", "completed", "incomplete"]),
4171
- output: z21.array(
4172
- z21.object({
4173
- stdout: z21.string(),
4174
- stderr: z21.string(),
4175
- outcome: z21.discriminatedUnion("type", [
4176
- z21.object({ type: z21.literal("timeout") }),
4177
- z21.object({
4178
- type: z21.literal("exit"),
4179
- exit_code: z21.number()
4252
+ z22.object({
4253
+ type: z22.literal("shell_call_output"),
4254
+ id: z22.string(),
4255
+ call_id: z22.string(),
4256
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
4257
+ output: z22.array(
4258
+ z22.object({
4259
+ stdout: z22.string(),
4260
+ stderr: z22.string(),
4261
+ outcome: z22.discriminatedUnion("type", [
4262
+ z22.object({ type: z22.literal("timeout") }),
4263
+ z22.object({
4264
+ type: z22.literal("exit"),
4265
+ exit_code: z22.number()
4180
4266
  })
4181
4267
  ])
4182
4268
  })
4183
4269
  )
4184
4270
  }),
4185
- z21.object({
4186
- type: z21.literal("tool_search_call"),
4187
- id: z21.string(),
4188
- execution: z21.enum(["server", "client"]),
4189
- call_id: z21.string().nullable(),
4190
- status: z21.enum(["in_progress", "completed", "incomplete"]),
4191
- arguments: z21.unknown()
4271
+ z22.object({
4272
+ type: z22.literal("tool_search_call"),
4273
+ id: z22.string(),
4274
+ execution: z22.enum(["server", "client"]),
4275
+ call_id: z22.string().nullable(),
4276
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
4277
+ arguments: z22.unknown()
4192
4278
  }),
4193
- z21.object({
4194
- type: z21.literal("tool_search_output"),
4195
- id: z21.string(),
4196
- execution: z21.enum(["server", "client"]),
4197
- call_id: z21.string().nullable(),
4198
- status: z21.enum(["in_progress", "completed", "incomplete"]),
4199
- tools: z21.array(z21.record(z21.string(), jsonValueSchema2.optional()))
4279
+ z22.object({
4280
+ type: z22.literal("tool_search_output"),
4281
+ id: z22.string(),
4282
+ execution: z22.enum(["server", "client"]),
4283
+ call_id: z22.string().nullable(),
4284
+ status: z22.enum(["in_progress", "completed", "incomplete"]),
4285
+ tools: z22.array(z22.record(z22.string(), jsonValueSchema2.optional()))
4200
4286
  })
4201
4287
  ])
4202
4288
  ).optional(),
4203
- service_tier: z21.string().nullish(),
4204
- incomplete_details: z21.object({ reason: z21.string() }).nullish(),
4205
- usage: z21.object({
4206
- input_tokens: z21.number(),
4207
- input_tokens_details: z21.object({ cached_tokens: z21.number().nullish() }).nullish(),
4208
- output_tokens: z21.number(),
4209
- output_tokens_details: z21.object({ reasoning_tokens: z21.number().nullish() }).nullish()
4289
+ service_tier: z22.string().nullish(),
4290
+ incomplete_details: z22.object({ reason: z22.string() }).nullish(),
4291
+ usage: z22.object({
4292
+ input_tokens: z22.number(),
4293
+ input_tokens_details: z22.object({ cached_tokens: z22.number().nullish() }).nullish(),
4294
+ output_tokens: z22.number(),
4295
+ output_tokens_details: z22.object({ reasoning_tokens: z22.number().nullish() }).nullish()
4210
4296
  }).optional()
4211
4297
  })
4212
4298
  )
@@ -4214,10 +4300,10 @@ var openaiResponsesResponseSchema = lazySchema19(
4214
4300
 
4215
4301
  // src/responses/openai-responses-options.ts
4216
4302
  import {
4217
- lazySchema as lazySchema20,
4218
- zodSchema as zodSchema20
4303
+ lazySchema as lazySchema21,
4304
+ zodSchema as zodSchema21
4219
4305
  } from "@ai-sdk/provider-utils";
4220
- import { z as z22 } from "zod/v4";
4306
+ import { z as z23 } from "zod/v4";
4221
4307
  var TOP_LOGPROBS_MAX = 20;
4222
4308
  var openaiResponsesReasoningModelIds = [
4223
4309
  "o1",
@@ -4282,9 +4368,9 @@ var openaiResponsesModelIds = [
4282
4368
  "gpt-5-chat-latest",
4283
4369
  ...openaiResponsesReasoningModelIds
4284
4370
  ];
4285
- var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4286
- () => zodSchema20(
4287
- z22.object({
4371
+ var openaiLanguageModelResponsesOptionsSchema = lazySchema21(
4372
+ () => zodSchema21(
4373
+ z23.object({
4288
4374
  /**
4289
4375
  * The ID of the OpenAI Conversation to continue.
4290
4376
  * You must create a conversation first via the OpenAI API.
@@ -4292,13 +4378,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4292
4378
  * Defaults to `undefined`.
4293
4379
  * @see https://platform.openai.com/docs/api-reference/conversations/create
4294
4380
  */
4295
- conversation: z22.string().nullish(),
4381
+ conversation: z23.string().nullish(),
4296
4382
  /**
4297
4383
  * The set of extra fields to include in the response (advanced, usually not needed).
4298
4384
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
4299
4385
  */
4300
- include: z22.array(
4301
- z22.enum([
4386
+ include: z23.array(
4387
+ z23.enum([
4302
4388
  "reasoning.encrypted_content",
4303
4389
  // handled internally by default, only needed for unknown reasoning models
4304
4390
  "file_search_call.results",
@@ -4310,7 +4396,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4310
4396
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
4311
4397
  * Defaults to `undefined`.
4312
4398
  */
4313
- instructions: z22.string().nullish(),
4399
+ instructions: z23.string().nullish(),
4314
4400
  /**
4315
4401
  * Return the log probabilities of the tokens. Including logprobs will increase
4316
4402
  * the response size and can slow down response times. However, it can
@@ -4325,30 +4411,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4325
4411
  * @see https://platform.openai.com/docs/api-reference/responses/create
4326
4412
  * @see https://cookbook.openai.com/examples/using_logprobs
4327
4413
  */
4328
- logprobs: z22.union([z22.boolean(), z22.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4414
+ logprobs: z23.union([z23.boolean(), z23.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4329
4415
  /**
4330
4416
  * The maximum number of total calls to built-in tools that can be processed in a response.
4331
4417
  * This maximum number applies across all built-in tool calls, not per individual tool.
4332
4418
  * Any further attempts to call a tool by the model will be ignored.
4333
4419
  */
4334
- maxToolCalls: z22.number().nullish(),
4420
+ maxToolCalls: z23.number().nullish(),
4335
4421
  /**
4336
4422
  * Additional metadata to store with the generation.
4337
4423
  */
4338
- metadata: z22.any().nullish(),
4424
+ metadata: z23.any().nullish(),
4339
4425
  /**
4340
4426
  * Whether to use parallel tool calls. Defaults to `true`.
4341
4427
  */
4342
- parallelToolCalls: z22.boolean().nullish(),
4428
+ parallelToolCalls: z23.boolean().nullish(),
4343
4429
  /**
4344
4430
  * The ID of the previous response. You can use it to continue a conversation.
4345
4431
  * Defaults to `undefined`.
4346
4432
  */
4347
- previousResponseId: z22.string().nullish(),
4433
+ previousResponseId: z23.string().nullish(),
4348
4434
  /**
4349
4435
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
4350
4436
  */
4351
- promptCacheKey: z22.string().nullish(),
4437
+ promptCacheKey: z23.string().nullish(),
4352
4438
  /**
4353
4439
  * The retention policy for the prompt cache.
4354
4440
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -4357,7 +4443,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4357
4443
  *
4358
4444
  * @default 'in_memory'
4359
4445
  */
4360
- promptCacheRetention: z22.enum(["in_memory", "24h"]).nullish(),
4446
+ promptCacheRetention: z23.enum(["in_memory", "24h"]).nullish(),
4361
4447
  /**
4362
4448
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
4363
4449
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -4368,17 +4454,17 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4368
4454
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
4369
4455
  * an error.
4370
4456
  */
4371
- reasoningEffort: z22.string().nullish(),
4457
+ reasoningEffort: z23.string().nullish(),
4372
4458
  /**
4373
4459
  * Controls reasoning summary output from the model.
4374
4460
  * Set to "auto" to automatically receive the richest level available,
4375
4461
  * or "detailed" for comprehensive summaries.
4376
4462
  */
4377
- reasoningSummary: z22.string().nullish(),
4463
+ reasoningSummary: z23.string().nullish(),
4378
4464
  /**
4379
4465
  * The identifier for safety monitoring and tracking.
4380
4466
  */
4381
- safetyIdentifier: z22.string().nullish(),
4467
+ safetyIdentifier: z23.string().nullish(),
4382
4468
  /**
4383
4469
  * Service tier for the request.
4384
4470
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -4386,34 +4472,34 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4386
4472
  *
4387
4473
  * Defaults to 'auto'.
4388
4474
  */
4389
- serviceTier: z22.enum(["auto", "flex", "priority", "default"]).nullish(),
4475
+ serviceTier: z23.enum(["auto", "flex", "priority", "default"]).nullish(),
4390
4476
  /**
4391
4477
  * Whether to store the generation. Defaults to `true`.
4392
4478
  */
4393
- store: z22.boolean().nullish(),
4479
+ store: z23.boolean().nullish(),
4394
4480
  /**
4395
4481
  * Whether to use strict JSON schema validation.
4396
4482
  * Defaults to `true`.
4397
4483
  */
4398
- strictJsonSchema: z22.boolean().nullish(),
4484
+ strictJsonSchema: z23.boolean().nullish(),
4399
4485
  /**
4400
4486
  * Controls the verbosity of the model's responses. Lower values ('low') will result
4401
4487
  * in more concise responses, while higher values ('high') will result in more verbose responses.
4402
4488
  * Valid values: 'low', 'medium', 'high'.
4403
4489
  */
4404
- textVerbosity: z22.enum(["low", "medium", "high"]).nullish(),
4490
+ textVerbosity: z23.enum(["low", "medium", "high"]).nullish(),
4405
4491
  /**
4406
4492
  * Controls output truncation. 'auto' (default) performs truncation automatically;
4407
4493
  * 'disabled' turns truncation off.
4408
4494
  */
4409
- truncation: z22.enum(["auto", "disabled"]).nullish(),
4495
+ truncation: z23.enum(["auto", "disabled"]).nullish(),
4410
4496
  /**
4411
4497
  * A unique identifier representing your end-user, which can help OpenAI to
4412
4498
  * monitor and detect abuse.
4413
4499
  * Defaults to `undefined`.
4414
4500
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
4415
4501
  */
4416
- user: z22.string().nullish(),
4502
+ user: z23.string().nullish(),
4417
4503
  /**
4418
4504
  * Override the system message mode for this model.
4419
4505
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -4422,7 +4508,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4422
4508
  *
4423
4509
  * If not specified, the mode is automatically determined based on the model.
4424
4510
  */
4425
- systemMessageMode: z22.enum(["system", "developer", "remove"]).optional(),
4511
+ systemMessageMode: z23.enum(["system", "developer", "remove"]).optional(),
4426
4512
  /**
4427
4513
  * Force treating this model as a reasoning model.
4428
4514
  *
@@ -4432,7 +4518,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema20(
4432
4518
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
4433
4519
  * and defaults `systemMessageMode` to `developer` unless overridden.
4434
4520
  */
4435
- forceReasoning: z22.boolean().optional()
4521
+ forceReasoning: z23.boolean().optional()
4436
4522
  })
4437
4523
  )
4438
4524
  );
@@ -4774,13 +4860,13 @@ var OpenAIResponsesLanguageModel = class {
4774
4860
  warnings.push({ type: "unsupported", feature: "stopSequences" });
4775
4861
  }
4776
4862
  const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
4777
- let openaiOptions = await parseProviderOptions5({
4863
+ let openaiOptions = await parseProviderOptions6({
4778
4864
  provider: providerOptionsName,
4779
4865
  providerOptions,
4780
4866
  schema: openaiLanguageModelResponsesOptionsSchema
4781
4867
  });
4782
4868
  if (openaiOptions == null && providerOptionsName !== "openai") {
4783
- openaiOptions = await parseProviderOptions5({
4869
+ openaiOptions = await parseProviderOptions6({
4784
4870
  provider: "openai",
4785
4871
  providerOptions,
4786
4872
  schema: openaiLanguageModelResponsesOptionsSchema
@@ -6406,21 +6492,21 @@ function escapeJSONDelta(delta) {
6406
6492
  import {
6407
6493
  combineHeaders as combineHeaders6,
6408
6494
  createBinaryResponseHandler,
6409
- parseProviderOptions as parseProviderOptions6,
6495
+ parseProviderOptions as parseProviderOptions7,
6410
6496
  postJsonToApi as postJsonToApi6
6411
6497
  } from "@ai-sdk/provider-utils";
6412
6498
 
6413
6499
  // src/speech/openai-speech-options.ts
6414
6500
  import {
6415
- lazySchema as lazySchema21,
6416
- zodSchema as zodSchema21
6501
+ lazySchema as lazySchema22,
6502
+ zodSchema as zodSchema22
6417
6503
  } from "@ai-sdk/provider-utils";
6418
- import { z as z23 } from "zod/v4";
6419
- var openaiSpeechModelOptionsSchema = lazySchema21(
6420
- () => zodSchema21(
6421
- z23.object({
6422
- instructions: z23.string().nullish(),
6423
- speed: z23.number().min(0.25).max(4).default(1).nullish()
6504
+ import { z as z24 } from "zod/v4";
6505
+ var openaiSpeechModelOptionsSchema = lazySchema22(
6506
+ () => zodSchema22(
6507
+ z24.object({
6508
+ instructions: z24.string().nullish(),
6509
+ speed: z24.number().min(0.25).max(4).default(1).nullish()
6424
6510
  })
6425
6511
  )
6426
6512
  );
@@ -6445,7 +6531,7 @@ var OpenAISpeechModel = class {
6445
6531
  providerOptions
6446
6532
  }) {
6447
6533
  const warnings = [];
6448
- const openAIOptions = await parseProviderOptions6({
6534
+ const openAIOptions = await parseProviderOptions7({
6449
6535
  provider: "openai",
6450
6536
  providerOptions,
6451
6537
  schema: openaiSpeechModelOptionsSchema
@@ -6532,38 +6618,38 @@ import {
6532
6618
  convertBase64ToUint8Array as convertBase64ToUint8Array2,
6533
6619
  createJsonResponseHandler as createJsonResponseHandler6,
6534
6620
  mediaTypeToExtension,
6535
- parseProviderOptions as parseProviderOptions7,
6621
+ parseProviderOptions as parseProviderOptions8,
6536
6622
  postFormDataToApi as postFormDataToApi2
6537
6623
  } from "@ai-sdk/provider-utils";
6538
6624
 
6539
6625
  // src/transcription/openai-transcription-api.ts
6540
- import { lazySchema as lazySchema22, zodSchema as zodSchema22 } from "@ai-sdk/provider-utils";
6541
- import { z as z24 } from "zod/v4";
6542
- var openaiTranscriptionResponseSchema = lazySchema22(
6543
- () => zodSchema22(
6544
- z24.object({
6545
- text: z24.string(),
6546
- language: z24.string().nullish(),
6547
- duration: z24.number().nullish(),
6548
- words: z24.array(
6549
- z24.object({
6550
- word: z24.string(),
6551
- start: z24.number(),
6552
- end: z24.number()
6626
+ import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
6627
+ import { z as z25 } from "zod/v4";
6628
+ var openaiTranscriptionResponseSchema = lazySchema23(
6629
+ () => zodSchema23(
6630
+ z25.object({
6631
+ text: z25.string(),
6632
+ language: z25.string().nullish(),
6633
+ duration: z25.number().nullish(),
6634
+ words: z25.array(
6635
+ z25.object({
6636
+ word: z25.string(),
6637
+ start: z25.number(),
6638
+ end: z25.number()
6553
6639
  })
6554
6640
  ).nullish(),
6555
- segments: z24.array(
6556
- z24.object({
6557
- id: z24.number(),
6558
- seek: z24.number(),
6559
- start: z24.number(),
6560
- end: z24.number(),
6561
- text: z24.string(),
6562
- tokens: z24.array(z24.number()),
6563
- temperature: z24.number(),
6564
- avg_logprob: z24.number(),
6565
- compression_ratio: z24.number(),
6566
- no_speech_prob: z24.number()
6641
+ segments: z25.array(
6642
+ z25.object({
6643
+ id: z25.number(),
6644
+ seek: z25.number(),
6645
+ start: z25.number(),
6646
+ end: z25.number(),
6647
+ text: z25.string(),
6648
+ tokens: z25.array(z25.number()),
6649
+ temperature: z25.number(),
6650
+ avg_logprob: z25.number(),
6651
+ compression_ratio: z25.number(),
6652
+ no_speech_prob: z25.number()
6567
6653
  })
6568
6654
  ).nullish()
6569
6655
  })
@@ -6572,35 +6658,35 @@ var openaiTranscriptionResponseSchema = lazySchema22(
6572
6658
 
6573
6659
  // src/transcription/openai-transcription-options.ts
6574
6660
  import {
6575
- lazySchema as lazySchema23,
6576
- zodSchema as zodSchema23
6661
+ lazySchema as lazySchema24,
6662
+ zodSchema as zodSchema24
6577
6663
  } from "@ai-sdk/provider-utils";
6578
- import { z as z25 } from "zod/v4";
6579
- var openAITranscriptionModelOptions = lazySchema23(
6580
- () => zodSchema23(
6581
- z25.object({
6664
+ import { z as z26 } from "zod/v4";
6665
+ var openAITranscriptionModelOptions = lazySchema24(
6666
+ () => zodSchema24(
6667
+ z26.object({
6582
6668
  /**
6583
6669
  * Additional information to include in the transcription response.
6584
6670
  */
6585
- include: z25.array(z25.string()).optional(),
6671
+ include: z26.array(z26.string()).optional(),
6586
6672
  /**
6587
6673
  * The language of the input audio in ISO-639-1 format.
6588
6674
  */
6589
- language: z25.string().optional(),
6675
+ language: z26.string().optional(),
6590
6676
  /**
6591
6677
  * An optional text to guide the model's style or continue a previous audio segment.
6592
6678
  */
6593
- prompt: z25.string().optional(),
6679
+ prompt: z26.string().optional(),
6594
6680
  /**
6595
6681
  * The sampling temperature, between 0 and 1.
6596
6682
  * @default 0
6597
6683
  */
6598
- temperature: z25.number().min(0).max(1).default(0).optional(),
6684
+ temperature: z26.number().min(0).max(1).default(0).optional(),
6599
6685
  /**
6600
6686
  * The timestamp granularities to populate for this transcription.
6601
6687
  * @default ['segment']
6602
6688
  */
6603
- timestampGranularities: z25.array(z25.enum(["word", "segment"])).default(["segment"]).optional()
6689
+ timestampGranularities: z26.array(z26.enum(["word", "segment"])).default(["segment"]).optional()
6604
6690
  })
6605
6691
  )
6606
6692
  );
@@ -6680,7 +6766,7 @@ var OpenAITranscriptionModel = class {
6680
6766
  providerOptions
6681
6767
  }) {
6682
6768
  const warnings = [];
6683
- const openAIOptions = await parseProviderOptions7({
6769
+ const openAIOptions = await parseProviderOptions8({
6684
6770
  provider: "openai",
6685
6771
  providerOptions,
6686
6772
  schema: openAITranscriptionModelOptions
@@ -6773,7 +6859,7 @@ var OpenAITranscriptionModel = class {
6773
6859
  };
6774
6860
 
6775
6861
  // src/version.ts
6776
- var VERSION = true ? "3.0.55" : "0.0.0-test";
6862
+ var VERSION = true ? "3.0.57" : "0.0.0-test";
6777
6863
 
6778
6864
  // src/openai-provider.ts
6779
6865
  function createOpenAI(options = {}) {