@ai-sdk/openai 3.0.0-beta.72 → 3.0.0-beta.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ __export(src_exports, {
27
27
  module.exports = __toCommonJS(src_exports);
28
28
 
29
29
  // src/openai-provider.ts
30
- var import_provider_utils31 = require("@ai-sdk/provider-utils");
30
+ var import_provider_utils32 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/chat/openai-chat-language-model.ts
33
33
  var import_provider3 = require("@ai-sdk/provider");
@@ -1753,42 +1753,84 @@ var OpenAIImageModel = class {
1753
1753
  }
1754
1754
  };
1755
1755
 
1756
- // src/tool/code-interpreter.ts
1756
+ // src/tool/apply-patch.ts
1757
1757
  var import_provider_utils14 = require("@ai-sdk/provider-utils");
1758
1758
  var import_v49 = require("zod/v4");
1759
- var codeInterpreterInputSchema = (0, import_provider_utils14.lazySchema)(
1759
+ var applyPatchInputSchema = (0, import_provider_utils14.lazySchema)(
1760
1760
  () => (0, import_provider_utils14.zodSchema)(
1761
1761
  import_v49.z.object({
1762
- code: import_v49.z.string().nullish(),
1763
- containerId: import_v49.z.string()
1762
+ callId: import_v49.z.string(),
1763
+ operation: import_v49.z.discriminatedUnion("type", [
1764
+ import_v49.z.object({
1765
+ type: import_v49.z.literal("create_file"),
1766
+ path: import_v49.z.string(),
1767
+ diff: import_v49.z.string()
1768
+ }),
1769
+ import_v49.z.object({
1770
+ type: import_v49.z.literal("delete_file"),
1771
+ path: import_v49.z.string()
1772
+ }),
1773
+ import_v49.z.object({
1774
+ type: import_v49.z.literal("update_file"),
1775
+ path: import_v49.z.string(),
1776
+ diff: import_v49.z.string()
1777
+ })
1778
+ ])
1764
1779
  })
1765
1780
  )
1766
1781
  );
1767
- var codeInterpreterOutputSchema = (0, import_provider_utils14.lazySchema)(
1782
+ var applyPatchOutputSchema = (0, import_provider_utils14.lazySchema)(
1768
1783
  () => (0, import_provider_utils14.zodSchema)(
1769
1784
  import_v49.z.object({
1770
- outputs: import_v49.z.array(
1771
- import_v49.z.discriminatedUnion("type", [
1772
- import_v49.z.object({ type: import_v49.z.literal("logs"), logs: import_v49.z.string() }),
1773
- import_v49.z.object({ type: import_v49.z.literal("image"), url: import_v49.z.string() })
1785
+ status: import_v49.z.enum(["completed", "failed"]),
1786
+ output: import_v49.z.string().optional()
1787
+ })
1788
+ )
1789
+ );
1790
+ var applyPatchArgsSchema = (0, import_provider_utils14.lazySchema)(() => (0, import_provider_utils14.zodSchema)(import_v49.z.object({})));
1791
+ var applyPatchToolFactory = (0, import_provider_utils14.createProviderToolFactoryWithOutputSchema)({
1792
+ id: "openai.apply_patch",
1793
+ inputSchema: applyPatchInputSchema,
1794
+ outputSchema: applyPatchOutputSchema
1795
+ });
1796
+ var applyPatch = () => applyPatchToolFactory({});
1797
+
1798
+ // src/tool/code-interpreter.ts
1799
+ var import_provider_utils15 = require("@ai-sdk/provider-utils");
1800
+ var import_v410 = require("zod/v4");
1801
+ var codeInterpreterInputSchema = (0, import_provider_utils15.lazySchema)(
1802
+ () => (0, import_provider_utils15.zodSchema)(
1803
+ import_v410.z.object({
1804
+ code: import_v410.z.string().nullish(),
1805
+ containerId: import_v410.z.string()
1806
+ })
1807
+ )
1808
+ );
1809
+ var codeInterpreterOutputSchema = (0, import_provider_utils15.lazySchema)(
1810
+ () => (0, import_provider_utils15.zodSchema)(
1811
+ import_v410.z.object({
1812
+ outputs: import_v410.z.array(
1813
+ import_v410.z.discriminatedUnion("type", [
1814
+ import_v410.z.object({ type: import_v410.z.literal("logs"), logs: import_v410.z.string() }),
1815
+ import_v410.z.object({ type: import_v410.z.literal("image"), url: import_v410.z.string() })
1774
1816
  ])
1775
1817
  ).nullish()
1776
1818
  })
1777
1819
  )
1778
1820
  );
1779
- var codeInterpreterArgsSchema = (0, import_provider_utils14.lazySchema)(
1780
- () => (0, import_provider_utils14.zodSchema)(
1781
- import_v49.z.object({
1782
- container: import_v49.z.union([
1783
- import_v49.z.string(),
1784
- import_v49.z.object({
1785
- fileIds: import_v49.z.array(import_v49.z.string()).optional()
1821
+ var codeInterpreterArgsSchema = (0, import_provider_utils15.lazySchema)(
1822
+ () => (0, import_provider_utils15.zodSchema)(
1823
+ import_v410.z.object({
1824
+ container: import_v410.z.union([
1825
+ import_v410.z.string(),
1826
+ import_v410.z.object({
1827
+ fileIds: import_v410.z.array(import_v410.z.string()).optional()
1786
1828
  })
1787
1829
  ]).optional()
1788
1830
  })
1789
1831
  )
1790
1832
  );
1791
- var codeInterpreterToolFactory = (0, import_provider_utils14.createProviderDefinedToolFactoryWithOutputSchema)({
1833
+ var codeInterpreterToolFactory = (0, import_provider_utils15.createProviderToolFactoryWithOutputSchema)({
1792
1834
  id: "openai.code_interpreter",
1793
1835
  inputSchema: codeInterpreterInputSchema,
1794
1836
  outputSchema: codeInterpreterOutputSchema
@@ -1798,81 +1840,81 @@ var codeInterpreter = (args = {}) => {
1798
1840
  };
1799
1841
 
1800
1842
  // src/tool/file-search.ts
1801
- var import_provider_utils15 = require("@ai-sdk/provider-utils");
1802
- var import_v410 = require("zod/v4");
1803
- var comparisonFilterSchema = import_v410.z.object({
1804
- key: import_v410.z.string(),
1805
- type: import_v410.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
1806
- value: import_v410.z.union([import_v410.z.string(), import_v410.z.number(), import_v410.z.boolean()])
1843
+ var import_provider_utils16 = require("@ai-sdk/provider-utils");
1844
+ var import_v411 = require("zod/v4");
1845
+ var comparisonFilterSchema = import_v411.z.object({
1846
+ key: import_v411.z.string(),
1847
+ type: import_v411.z.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
1848
+ value: import_v411.z.union([import_v411.z.string(), import_v411.z.number(), import_v411.z.boolean()])
1807
1849
  });
1808
- var compoundFilterSchema = import_v410.z.object({
1809
- type: import_v410.z.enum(["and", "or"]),
1810
- filters: import_v410.z.array(
1811
- import_v410.z.union([comparisonFilterSchema, import_v410.z.lazy(() => compoundFilterSchema)])
1850
+ var compoundFilterSchema = import_v411.z.object({
1851
+ type: import_v411.z.enum(["and", "or"]),
1852
+ filters: import_v411.z.array(
1853
+ import_v411.z.union([comparisonFilterSchema, import_v411.z.lazy(() => compoundFilterSchema)])
1812
1854
  )
1813
1855
  });
1814
- var fileSearchArgsSchema = (0, import_provider_utils15.lazySchema)(
1815
- () => (0, import_provider_utils15.zodSchema)(
1816
- import_v410.z.object({
1817
- vectorStoreIds: import_v410.z.array(import_v410.z.string()),
1818
- maxNumResults: import_v410.z.number().optional(),
1819
- ranking: import_v410.z.object({
1820
- ranker: import_v410.z.string().optional(),
1821
- scoreThreshold: import_v410.z.number().optional()
1856
+ var fileSearchArgsSchema = (0, import_provider_utils16.lazySchema)(
1857
+ () => (0, import_provider_utils16.zodSchema)(
1858
+ import_v411.z.object({
1859
+ vectorStoreIds: import_v411.z.array(import_v411.z.string()),
1860
+ maxNumResults: import_v411.z.number().optional(),
1861
+ ranking: import_v411.z.object({
1862
+ ranker: import_v411.z.string().optional(),
1863
+ scoreThreshold: import_v411.z.number().optional()
1822
1864
  }).optional(),
1823
- filters: import_v410.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
1865
+ filters: import_v411.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
1824
1866
  })
1825
1867
  )
1826
1868
  );
1827
- var fileSearchOutputSchema = (0, import_provider_utils15.lazySchema)(
1828
- () => (0, import_provider_utils15.zodSchema)(
1829
- import_v410.z.object({
1830
- queries: import_v410.z.array(import_v410.z.string()),
1831
- results: import_v410.z.array(
1832
- import_v410.z.object({
1833
- attributes: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()),
1834
- fileId: import_v410.z.string(),
1835
- filename: import_v410.z.string(),
1836
- score: import_v410.z.number(),
1837
- text: import_v410.z.string()
1869
+ var fileSearchOutputSchema = (0, import_provider_utils16.lazySchema)(
1870
+ () => (0, import_provider_utils16.zodSchema)(
1871
+ import_v411.z.object({
1872
+ queries: import_v411.z.array(import_v411.z.string()),
1873
+ results: import_v411.z.array(
1874
+ import_v411.z.object({
1875
+ attributes: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()),
1876
+ fileId: import_v411.z.string(),
1877
+ filename: import_v411.z.string(),
1878
+ score: import_v411.z.number(),
1879
+ text: import_v411.z.string()
1838
1880
  })
1839
1881
  ).nullable()
1840
1882
  })
1841
1883
  )
1842
1884
  );
1843
- var fileSearch = (0, import_provider_utils15.createProviderDefinedToolFactoryWithOutputSchema)({
1885
+ var fileSearch = (0, import_provider_utils16.createProviderToolFactoryWithOutputSchema)({
1844
1886
  id: "openai.file_search",
1845
- inputSchema: import_v410.z.object({}),
1887
+ inputSchema: import_v411.z.object({}),
1846
1888
  outputSchema: fileSearchOutputSchema
1847
1889
  });
1848
1890
 
1849
1891
  // src/tool/image-generation.ts
1850
- var import_provider_utils16 = require("@ai-sdk/provider-utils");
1851
- var import_v411 = require("zod/v4");
1852
- var imageGenerationArgsSchema = (0, import_provider_utils16.lazySchema)(
1853
- () => (0, import_provider_utils16.zodSchema)(
1854
- import_v411.z.object({
1855
- background: import_v411.z.enum(["auto", "opaque", "transparent"]).optional(),
1856
- inputFidelity: import_v411.z.enum(["low", "high"]).optional(),
1857
- inputImageMask: import_v411.z.object({
1858
- fileId: import_v411.z.string().optional(),
1859
- imageUrl: import_v411.z.string().optional()
1892
+ var import_provider_utils17 = require("@ai-sdk/provider-utils");
1893
+ var import_v412 = require("zod/v4");
1894
+ var imageGenerationArgsSchema = (0, import_provider_utils17.lazySchema)(
1895
+ () => (0, import_provider_utils17.zodSchema)(
1896
+ import_v412.z.object({
1897
+ background: import_v412.z.enum(["auto", "opaque", "transparent"]).optional(),
1898
+ inputFidelity: import_v412.z.enum(["low", "high"]).optional(),
1899
+ inputImageMask: import_v412.z.object({
1900
+ fileId: import_v412.z.string().optional(),
1901
+ imageUrl: import_v412.z.string().optional()
1860
1902
  }).optional(),
1861
- model: import_v411.z.string().optional(),
1862
- moderation: import_v411.z.enum(["auto"]).optional(),
1863
- outputCompression: import_v411.z.number().int().min(0).max(100).optional(),
1864
- outputFormat: import_v411.z.enum(["png", "jpeg", "webp"]).optional(),
1865
- partialImages: import_v411.z.number().int().min(0).max(3).optional(),
1866
- quality: import_v411.z.enum(["auto", "low", "medium", "high"]).optional(),
1867
- size: import_v411.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
1903
+ model: import_v412.z.string().optional(),
1904
+ moderation: import_v412.z.enum(["auto"]).optional(),
1905
+ outputCompression: import_v412.z.number().int().min(0).max(100).optional(),
1906
+ outputFormat: import_v412.z.enum(["png", "jpeg", "webp"]).optional(),
1907
+ partialImages: import_v412.z.number().int().min(0).max(3).optional(),
1908
+ quality: import_v412.z.enum(["auto", "low", "medium", "high"]).optional(),
1909
+ size: import_v412.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
1868
1910
  }).strict()
1869
1911
  )
1870
1912
  );
1871
- var imageGenerationInputSchema = (0, import_provider_utils16.lazySchema)(() => (0, import_provider_utils16.zodSchema)(import_v411.z.object({})));
1872
- var imageGenerationOutputSchema = (0, import_provider_utils16.lazySchema)(
1873
- () => (0, import_provider_utils16.zodSchema)(import_v411.z.object({ result: import_v411.z.string() }))
1913
+ var imageGenerationInputSchema = (0, import_provider_utils17.lazySchema)(() => (0, import_provider_utils17.zodSchema)(import_v412.z.object({})));
1914
+ var imageGenerationOutputSchema = (0, import_provider_utils17.lazySchema)(
1915
+ () => (0, import_provider_utils17.zodSchema)(import_v412.z.object({ result: import_v412.z.string() }))
1874
1916
  );
1875
- var imageGenerationToolFactory = (0, import_provider_utils16.createProviderDefinedToolFactoryWithOutputSchema)({
1917
+ var imageGenerationToolFactory = (0, import_provider_utils17.createProviderToolFactoryWithOutputSchema)({
1876
1918
  id: "openai.image_generation",
1877
1919
  inputSchema: imageGenerationInputSchema,
1878
1920
  outputSchema: imageGenerationOutputSchema
@@ -1882,91 +1924,39 @@ var imageGeneration = (args = {}) => {
1882
1924
  };
1883
1925
 
1884
1926
  // src/tool/local-shell.ts
1885
- var import_provider_utils17 = require("@ai-sdk/provider-utils");
1886
- var import_v412 = require("zod/v4");
1887
- var localShellInputSchema = (0, import_provider_utils17.lazySchema)(
1888
- () => (0, import_provider_utils17.zodSchema)(
1889
- import_v412.z.object({
1890
- action: import_v412.z.object({
1891
- type: import_v412.z.literal("exec"),
1892
- command: import_v412.z.array(import_v412.z.string()),
1893
- timeoutMs: import_v412.z.number().optional(),
1894
- user: import_v412.z.string().optional(),
1895
- workingDirectory: import_v412.z.string().optional(),
1896
- env: import_v412.z.record(import_v412.z.string(), import_v412.z.string()).optional()
1927
+ var import_provider_utils18 = require("@ai-sdk/provider-utils");
1928
+ var import_v413 = require("zod/v4");
1929
+ var localShellInputSchema = (0, import_provider_utils18.lazySchema)(
1930
+ () => (0, import_provider_utils18.zodSchema)(
1931
+ import_v413.z.object({
1932
+ action: import_v413.z.object({
1933
+ type: import_v413.z.literal("exec"),
1934
+ command: import_v413.z.array(import_v413.z.string()),
1935
+ timeoutMs: import_v413.z.number().optional(),
1936
+ user: import_v413.z.string().optional(),
1937
+ workingDirectory: import_v413.z.string().optional(),
1938
+ env: import_v413.z.record(import_v413.z.string(), import_v413.z.string()).optional()
1897
1939
  })
1898
1940
  })
1899
1941
  )
1900
1942
  );
1901
- var localShellOutputSchema = (0, import_provider_utils17.lazySchema)(
1902
- () => (0, import_provider_utils17.zodSchema)(import_v412.z.object({ output: import_v412.z.string() }))
1943
+ var localShellOutputSchema = (0, import_provider_utils18.lazySchema)(
1944
+ () => (0, import_provider_utils18.zodSchema)(import_v413.z.object({ output: import_v413.z.string() }))
1903
1945
  );
1904
- var localShell = (0, import_provider_utils17.createProviderDefinedToolFactoryWithOutputSchema)({
1946
+ var localShell = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
1905
1947
  id: "openai.local_shell",
1906
1948
  inputSchema: localShellInputSchema,
1907
1949
  outputSchema: localShellOutputSchema
1908
1950
  });
1909
1951
 
1910
1952
  // src/tool/web-search.ts
1911
- var import_provider_utils18 = require("@ai-sdk/provider-utils");
1912
- var import_v413 = require("zod/v4");
1913
- var webSearchArgsSchema = (0, import_provider_utils18.lazySchema)(
1914
- () => (0, import_provider_utils18.zodSchema)(
1915
- import_v413.z.object({
1916
- externalWebAccess: import_v413.z.boolean().optional(),
1917
- filters: import_v413.z.object({ allowedDomains: import_v413.z.array(import_v413.z.string()).optional() }).optional(),
1918
- searchContextSize: import_v413.z.enum(["low", "medium", "high"]).optional(),
1919
- userLocation: import_v413.z.object({
1920
- type: import_v413.z.literal("approximate"),
1921
- country: import_v413.z.string().optional(),
1922
- city: import_v413.z.string().optional(),
1923
- region: import_v413.z.string().optional(),
1924
- timezone: import_v413.z.string().optional()
1925
- }).optional()
1926
- })
1927
- )
1928
- );
1929
- var webSearchInputSchema = (0, import_provider_utils18.lazySchema)(() => (0, import_provider_utils18.zodSchema)(import_v413.z.object({})));
1930
- var webSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
1931
- () => (0, import_provider_utils18.zodSchema)(
1932
- import_v413.z.object({
1933
- action: import_v413.z.discriminatedUnion("type", [
1934
- import_v413.z.object({
1935
- type: import_v413.z.literal("search"),
1936
- query: import_v413.z.string().optional()
1937
- }),
1938
- import_v413.z.object({
1939
- type: import_v413.z.literal("openPage"),
1940
- url: import_v413.z.string()
1941
- }),
1942
- import_v413.z.object({
1943
- type: import_v413.z.literal("find"),
1944
- url: import_v413.z.string(),
1945
- pattern: import_v413.z.string()
1946
- })
1947
- ]),
1948
- sources: import_v413.z.array(
1949
- import_v413.z.discriminatedUnion("type", [
1950
- import_v413.z.object({ type: import_v413.z.literal("url"), url: import_v413.z.string() }),
1951
- import_v413.z.object({ type: import_v413.z.literal("api"), name: import_v413.z.string() })
1952
- ])
1953
- ).optional()
1954
- })
1955
- )
1956
- );
1957
- var webSearchToolFactory = (0, import_provider_utils18.createProviderDefinedToolFactoryWithOutputSchema)({
1958
- id: "openai.web_search",
1959
- inputSchema: webSearchInputSchema,
1960
- outputSchema: webSearchOutputSchema
1961
- });
1962
- var webSearch = (args = {}) => webSearchToolFactory(args);
1963
-
1964
- // src/tool/web-search-preview.ts
1965
1953
  var import_provider_utils19 = require("@ai-sdk/provider-utils");
1966
1954
  var import_v414 = require("zod/v4");
1967
- var webSearchPreviewArgsSchema = (0, import_provider_utils19.lazySchema)(
1955
+ var webSearchArgsSchema = (0, import_provider_utils19.lazySchema)(
1968
1956
  () => (0, import_provider_utils19.zodSchema)(
1969
1957
  import_v414.z.object({
1958
+ externalWebAccess: import_v414.z.boolean().optional(),
1959
+ filters: import_v414.z.object({ allowedDomains: import_v414.z.array(import_v414.z.string()).optional() }).optional(),
1970
1960
  searchContextSize: import_v414.z.enum(["low", "medium", "high"]).optional(),
1971
1961
  userLocation: import_v414.z.object({
1972
1962
  type: import_v414.z.literal("approximate"),
@@ -1978,10 +1968,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils19.lazySchema)(
1978
1968
  })
1979
1969
  )
1980
1970
  );
1981
- var webSearchPreviewInputSchema = (0, import_provider_utils19.lazySchema)(
1982
- () => (0, import_provider_utils19.zodSchema)(import_v414.z.object({}))
1983
- );
1984
- var webSearchPreviewOutputSchema = (0, import_provider_utils19.lazySchema)(
1971
+ var webSearchInputSchema = (0, import_provider_utils19.lazySchema)(() => (0, import_provider_utils19.zodSchema)(import_v414.z.object({})));
1972
+ var webSearchOutputSchema = (0, import_provider_utils19.lazySchema)(
1985
1973
  () => (0, import_provider_utils19.zodSchema)(
1986
1974
  import_v414.z.object({
1987
1975
  action: import_v414.z.discriminatedUnion("type", [
@@ -1998,43 +1986,97 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils19.lazySchema)(
1998
1986
  url: import_v414.z.string(),
1999
1987
  pattern: import_v414.z.string()
2000
1988
  })
1989
+ ]),
1990
+ sources: import_v414.z.array(
1991
+ import_v414.z.discriminatedUnion("type", [
1992
+ import_v414.z.object({ type: import_v414.z.literal("url"), url: import_v414.z.string() }),
1993
+ import_v414.z.object({ type: import_v414.z.literal("api"), name: import_v414.z.string() })
1994
+ ])
1995
+ ).optional()
1996
+ })
1997
+ )
1998
+ );
1999
+ var webSearchToolFactory = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
2000
+ id: "openai.web_search",
2001
+ inputSchema: webSearchInputSchema,
2002
+ outputSchema: webSearchOutputSchema
2003
+ });
2004
+ var webSearch = (args = {}) => webSearchToolFactory(args);
2005
+
2006
+ // src/tool/web-search-preview.ts
2007
+ var import_provider_utils20 = require("@ai-sdk/provider-utils");
2008
+ var import_v415 = require("zod/v4");
2009
+ var webSearchPreviewArgsSchema = (0, import_provider_utils20.lazySchema)(
2010
+ () => (0, import_provider_utils20.zodSchema)(
2011
+ import_v415.z.object({
2012
+ searchContextSize: import_v415.z.enum(["low", "medium", "high"]).optional(),
2013
+ userLocation: import_v415.z.object({
2014
+ type: import_v415.z.literal("approximate"),
2015
+ country: import_v415.z.string().optional(),
2016
+ city: import_v415.z.string().optional(),
2017
+ region: import_v415.z.string().optional(),
2018
+ timezone: import_v415.z.string().optional()
2019
+ }).optional()
2020
+ })
2021
+ )
2022
+ );
2023
+ var webSearchPreviewInputSchema = (0, import_provider_utils20.lazySchema)(
2024
+ () => (0, import_provider_utils20.zodSchema)(import_v415.z.object({}))
2025
+ );
2026
+ var webSearchPreviewOutputSchema = (0, import_provider_utils20.lazySchema)(
2027
+ () => (0, import_provider_utils20.zodSchema)(
2028
+ import_v415.z.object({
2029
+ action: import_v415.z.discriminatedUnion("type", [
2030
+ import_v415.z.object({
2031
+ type: import_v415.z.literal("search"),
2032
+ query: import_v415.z.string().optional()
2033
+ }),
2034
+ import_v415.z.object({
2035
+ type: import_v415.z.literal("openPage"),
2036
+ url: import_v415.z.string()
2037
+ }),
2038
+ import_v415.z.object({
2039
+ type: import_v415.z.literal("find"),
2040
+ url: import_v415.z.string(),
2041
+ pattern: import_v415.z.string()
2042
+ })
2001
2043
  ])
2002
2044
  })
2003
2045
  )
2004
2046
  );
2005
- var webSearchPreview = (0, import_provider_utils19.createProviderDefinedToolFactoryWithOutputSchema)({
2047
+ var webSearchPreview = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
2006
2048
  id: "openai.web_search_preview",
2007
2049
  inputSchema: webSearchPreviewInputSchema,
2008
2050
  outputSchema: webSearchPreviewOutputSchema
2009
2051
  });
2010
2052
 
2011
2053
  // src/tool/mcp.ts
2012
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
2013
- var import_v415 = require("zod/v4");
2014
- var jsonValueSchema = import_v415.z.lazy(
2015
- () => import_v415.z.union([
2016
- import_v415.z.string(),
2017
- import_v415.z.number(),
2018
- import_v415.z.boolean(),
2019
- import_v415.z.null(),
2020
- import_v415.z.array(jsonValueSchema),
2021
- import_v415.z.record(import_v415.z.string(), jsonValueSchema)
2054
+ var import_provider_utils21 = require("@ai-sdk/provider-utils");
2055
+ var import_v416 = require("zod/v4");
2056
+ var jsonValueSchema = import_v416.z.lazy(
2057
+ () => import_v416.z.union([
2058
+ import_v416.z.string(),
2059
+ import_v416.z.number(),
2060
+ import_v416.z.boolean(),
2061
+ import_v416.z.null(),
2062
+ import_v416.z.array(jsonValueSchema),
2063
+ import_v416.z.record(import_v416.z.string(), jsonValueSchema)
2022
2064
  ])
2023
2065
  );
2024
- var mcpArgsSchema = (0, import_provider_utils20.lazySchema)(
2025
- () => (0, import_provider_utils20.zodSchema)(
2026
- import_v415.z.object({
2027
- serverLabel: import_v415.z.string(),
2028
- allowedTools: import_v415.z.union([
2029
- import_v415.z.array(import_v415.z.string()),
2030
- import_v415.z.object({
2031
- readOnly: import_v415.z.boolean().optional(),
2032
- toolNames: import_v415.z.array(import_v415.z.string()).optional()
2066
+ var mcpArgsSchema = (0, import_provider_utils21.lazySchema)(
2067
+ () => (0, import_provider_utils21.zodSchema)(
2068
+ import_v416.z.object({
2069
+ serverLabel: import_v416.z.string(),
2070
+ allowedTools: import_v416.z.union([
2071
+ import_v416.z.array(import_v416.z.string()),
2072
+ import_v416.z.object({
2073
+ readOnly: import_v416.z.boolean().optional(),
2074
+ toolNames: import_v416.z.array(import_v416.z.string()).optional()
2033
2075
  })
2034
2076
  ]).optional(),
2035
- authorization: import_v415.z.string().optional(),
2036
- connectorId: import_v415.z.string().optional(),
2037
- headers: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional(),
2077
+ authorization: import_v416.z.string().optional(),
2078
+ connectorId: import_v416.z.string().optional(),
2079
+ headers: import_v416.z.record(import_v416.z.string(), import_v416.z.string()).optional(),
2038
2080
  // TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
2039
2081
  // requireApproval: z
2040
2082
  // .union([
@@ -2045,50 +2087,50 @@ var mcpArgsSchema = (0, import_provider_utils20.lazySchema)(
2045
2087
  // }),
2046
2088
  // ])
2047
2089
  // .optional(),
2048
- serverDescription: import_v415.z.string().optional(),
2049
- serverUrl: import_v415.z.string().optional()
2090
+ serverDescription: import_v416.z.string().optional(),
2091
+ serverUrl: import_v416.z.string().optional()
2050
2092
  }).refine(
2051
2093
  (v) => v.serverUrl != null || v.connectorId != null,
2052
2094
  "One of serverUrl or connectorId must be provided."
2053
2095
  )
2054
2096
  )
2055
2097
  );
2056
- var mcpInputSchema = (0, import_provider_utils20.lazySchema)(() => (0, import_provider_utils20.zodSchema)(import_v415.z.object({})));
2057
- var mcpOutputSchema = (0, import_provider_utils20.lazySchema)(
2058
- () => (0, import_provider_utils20.zodSchema)(
2059
- import_v415.z.discriminatedUnion("type", [
2060
- import_v415.z.object({
2061
- type: import_v415.z.literal("call"),
2062
- serverLabel: import_v415.z.string(),
2063
- name: import_v415.z.string(),
2064
- arguments: import_v415.z.string(),
2065
- output: import_v415.z.string().nullable().optional(),
2066
- error: import_v415.z.union([import_v415.z.string(), jsonValueSchema]).optional()
2098
+ var mcpInputSchema = (0, import_provider_utils21.lazySchema)(() => (0, import_provider_utils21.zodSchema)(import_v416.z.object({})));
2099
+ var mcpOutputSchema = (0, import_provider_utils21.lazySchema)(
2100
+ () => (0, import_provider_utils21.zodSchema)(
2101
+ import_v416.z.discriminatedUnion("type", [
2102
+ import_v416.z.object({
2103
+ type: import_v416.z.literal("call"),
2104
+ serverLabel: import_v416.z.string(),
2105
+ name: import_v416.z.string(),
2106
+ arguments: import_v416.z.string(),
2107
+ output: import_v416.z.string().nullable().optional(),
2108
+ error: import_v416.z.union([import_v416.z.string(), jsonValueSchema]).optional()
2067
2109
  }),
2068
- import_v415.z.object({
2069
- type: import_v415.z.literal("listTools"),
2070
- serverLabel: import_v415.z.string(),
2071
- tools: import_v415.z.array(
2072
- import_v415.z.object({
2073
- name: import_v415.z.string(),
2074
- description: import_v415.z.string().optional(),
2110
+ import_v416.z.object({
2111
+ type: import_v416.z.literal("listTools"),
2112
+ serverLabel: import_v416.z.string(),
2113
+ tools: import_v416.z.array(
2114
+ import_v416.z.object({
2115
+ name: import_v416.z.string(),
2116
+ description: import_v416.z.string().optional(),
2075
2117
  inputSchema: jsonValueSchema,
2076
- annotations: import_v415.z.record(import_v415.z.string(), jsonValueSchema).optional()
2118
+ annotations: import_v416.z.record(import_v416.z.string(), jsonValueSchema).optional()
2077
2119
  })
2078
2120
  ),
2079
- error: import_v415.z.union([import_v415.z.string(), jsonValueSchema]).optional()
2121
+ error: import_v416.z.union([import_v416.z.string(), jsonValueSchema]).optional()
2080
2122
  }),
2081
- import_v415.z.object({
2082
- type: import_v415.z.literal("approvalRequest"),
2083
- serverLabel: import_v415.z.string(),
2084
- name: import_v415.z.string(),
2085
- arguments: import_v415.z.string(),
2086
- approvalRequestId: import_v415.z.string()
2123
+ import_v416.z.object({
2124
+ type: import_v416.z.literal("approvalRequest"),
2125
+ serverLabel: import_v416.z.string(),
2126
+ name: import_v416.z.string(),
2127
+ arguments: import_v416.z.string(),
2128
+ approvalRequestId: import_v416.z.string()
2087
2129
  })
2088
2130
  ])
2089
2131
  )
2090
2132
  );
2091
- var mcpToolFactory = (0, import_provider_utils20.createProviderDefinedToolFactoryWithOutputSchema)({
2133
+ var mcpToolFactory = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
2092
2134
  id: "openai.mcp",
2093
2135
  inputSchema: mcpInputSchema,
2094
2136
  outputSchema: mcpOutputSchema
@@ -2097,6 +2139,14 @@ var mcp = (args) => mcpToolFactory(args);
2097
2139
 
2098
2140
  // src/openai-tools.ts
2099
2141
  var openaiTools = {
2142
+ /**
2143
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
2144
+ * codebase using structured diffs. Instead of just suggesting edits, the model
2145
+ * emits patch operations that your application applies and then reports back on,
2146
+ * enabling iterative, multi-step code editing workflows.
2147
+ *
2148
+ */
2149
+ applyPatch,
2100
2150
  /**
2101
2151
  * The Code Interpreter tool allows models to write and run Python code in a
2102
2152
  * sandboxed environment to solve complex problems in domains like data analysis,
@@ -2175,12 +2225,12 @@ var openaiTools = {
2175
2225
 
2176
2226
  // src/responses/openai-responses-language-model.ts
2177
2227
  var import_provider8 = require("@ai-sdk/provider");
2178
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
2228
+ var import_provider_utils26 = require("@ai-sdk/provider-utils");
2179
2229
 
2180
2230
  // src/responses/convert-to-openai-responses-input.ts
2181
2231
  var import_provider6 = require("@ai-sdk/provider");
2182
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
2183
- var import_v416 = require("zod/v4");
2232
+ var import_provider_utils22 = require("@ai-sdk/provider-utils");
2233
+ var import_v417 = require("zod/v4");
2184
2234
  function isFileId(data, prefixes) {
2185
2235
  if (!prefixes) return false;
2186
2236
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -2191,7 +2241,8 @@ async function convertToOpenAIResponsesInput({
2191
2241
  systemMessageMode,
2192
2242
  fileIdPrefixes,
2193
2243
  store,
2194
- hasLocalShellTool = false
2244
+ hasLocalShellTool = false,
2245
+ hasApplyPatchTool = false
2195
2246
  }) {
2196
2247
  var _a, _b, _c, _d, _e;
2197
2248
  const input = [];
@@ -2239,7 +2290,7 @@ async function convertToOpenAIResponsesInput({
2239
2290
  return {
2240
2291
  type: "input_image",
2241
2292
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2242
- image_url: `data:${mediaType};base64,${(0, import_provider_utils21.convertToBase64)(part.data)}`
2293
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils22.convertToBase64)(part.data)}`
2243
2294
  },
2244
2295
  detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b2.imageDetail
2245
2296
  };
@@ -2254,7 +2305,7 @@ async function convertToOpenAIResponsesInput({
2254
2305
  type: "input_file",
2255
2306
  ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2256
2307
  filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
2257
- file_data: `data:application/pdf;base64,${(0, import_provider_utils21.convertToBase64)(part.data)}`
2308
+ file_data: `data:application/pdf;base64,${(0, import_provider_utils22.convertToBase64)(part.data)}`
2258
2309
  }
2259
2310
  };
2260
2311
  } else {
@@ -2298,7 +2349,7 @@ async function convertToOpenAIResponsesInput({
2298
2349
  part.toolName
2299
2350
  );
2300
2351
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
2301
- const parsedInput = await (0, import_provider_utils21.validateTypes)({
2352
+ const parsedInput = await (0, import_provider_utils22.validateTypes)({
2302
2353
  value: part.input,
2303
2354
  schema: localShellInputSchema
2304
2355
  });
@@ -2339,7 +2390,7 @@ async function convertToOpenAIResponsesInput({
2339
2390
  break;
2340
2391
  }
2341
2392
  case "reasoning": {
2342
- const providerOptions = await (0, import_provider_utils21.parseProviderOptions)({
2393
+ const providerOptions = await (0, import_provider_utils22.parseProviderOptions)({
2343
2394
  provider: "openai",
2344
2395
  providerOptions: part.providerOptions,
2345
2396
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -2403,7 +2454,7 @@ async function convertToOpenAIResponsesInput({
2403
2454
  part.toolName
2404
2455
  );
2405
2456
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
2406
- const parsedOutput = await (0, import_provider_utils21.validateTypes)({
2457
+ const parsedOutput = await (0, import_provider_utils22.validateTypes)({
2407
2458
  value: output.value,
2408
2459
  schema: localShellOutputSchema
2409
2460
  });
@@ -2414,6 +2465,19 @@ async function convertToOpenAIResponsesInput({
2414
2465
  });
2415
2466
  break;
2416
2467
  }
2468
+ if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
2469
+ const parsedOutput = await (0, import_provider_utils22.validateTypes)({
2470
+ value: output.value,
2471
+ schema: applyPatchOutputSchema
2472
+ });
2473
+ input.push({
2474
+ type: "apply_patch_call_output",
2475
+ call_id: part.toolCallId,
2476
+ status: parsedOutput.status,
2477
+ output: parsedOutput.output
2478
+ });
2479
+ break;
2480
+ }
2417
2481
  let contentValue;
2418
2482
  switch (output.type) {
2419
2483
  case "text":
@@ -2455,7 +2519,7 @@ async function convertToOpenAIResponsesInput({
2455
2519
  return void 0;
2456
2520
  }
2457
2521
  }
2458
- }).filter(import_provider_utils21.isNonNullable);
2522
+ }).filter(import_provider_utils22.isNonNullable);
2459
2523
  break;
2460
2524
  }
2461
2525
  input.push({
@@ -2474,9 +2538,9 @@ async function convertToOpenAIResponsesInput({
2474
2538
  }
2475
2539
  return { input, warnings };
2476
2540
  }
2477
- var openaiResponsesReasoningProviderOptionsSchema = import_v416.z.object({
2478
- itemId: import_v416.z.string().nullish(),
2479
- reasoningEncryptedContent: import_v416.z.string().nullish()
2541
+ var openaiResponsesReasoningProviderOptionsSchema = import_v417.z.object({
2542
+ itemId: import_v417.z.string().nullish(),
2543
+ reasoningEncryptedContent: import_v417.z.string().nullish()
2480
2544
  });
2481
2545
 
2482
2546
  // src/responses/map-openai-responses-finish-reason.ts
@@ -2498,349 +2562,393 @@ function mapOpenAIResponseFinishReason({
2498
2562
  }
2499
2563
 
2500
2564
  // src/responses/openai-responses-api.ts
2501
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
2502
- var import_v417 = require("zod/v4");
2503
- var openaiResponsesChunkSchema = (0, import_provider_utils22.lazySchema)(
2504
- () => (0, import_provider_utils22.zodSchema)(
2505
- import_v417.z.union([
2506
- import_v417.z.object({
2507
- type: import_v417.z.literal("response.output_text.delta"),
2508
- item_id: import_v417.z.string(),
2509
- delta: import_v417.z.string(),
2510
- logprobs: import_v417.z.array(
2511
- import_v417.z.object({
2512
- token: import_v417.z.string(),
2513
- logprob: import_v417.z.number(),
2514
- top_logprobs: import_v417.z.array(
2515
- import_v417.z.object({
2516
- token: import_v417.z.string(),
2517
- logprob: import_v417.z.number()
2565
+ var import_provider_utils23 = require("@ai-sdk/provider-utils");
2566
+ var import_v418 = require("zod/v4");
2567
+ var openaiResponsesChunkSchema = (0, import_provider_utils23.lazySchema)(
2568
+ () => (0, import_provider_utils23.zodSchema)(
2569
+ import_v418.z.union([
2570
+ import_v418.z.object({
2571
+ type: import_v418.z.literal("response.output_text.delta"),
2572
+ item_id: import_v418.z.string(),
2573
+ delta: import_v418.z.string(),
2574
+ logprobs: import_v418.z.array(
2575
+ import_v418.z.object({
2576
+ token: import_v418.z.string(),
2577
+ logprob: import_v418.z.number(),
2578
+ top_logprobs: import_v418.z.array(
2579
+ import_v418.z.object({
2580
+ token: import_v418.z.string(),
2581
+ logprob: import_v418.z.number()
2518
2582
  })
2519
2583
  )
2520
2584
  })
2521
2585
  ).nullish()
2522
2586
  }),
2523
- import_v417.z.object({
2524
- type: import_v417.z.enum(["response.completed", "response.incomplete"]),
2525
- response: import_v417.z.object({
2526
- incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
2527
- usage: import_v417.z.object({
2528
- input_tokens: import_v417.z.number(),
2529
- input_tokens_details: import_v417.z.object({ cached_tokens: import_v417.z.number().nullish() }).nullish(),
2530
- output_tokens: import_v417.z.number(),
2531
- output_tokens_details: import_v417.z.object({ reasoning_tokens: import_v417.z.number().nullish() }).nullish()
2587
+ import_v418.z.object({
2588
+ type: import_v418.z.enum(["response.completed", "response.incomplete"]),
2589
+ response: import_v418.z.object({
2590
+ incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
2591
+ usage: import_v418.z.object({
2592
+ input_tokens: import_v418.z.number(),
2593
+ input_tokens_details: import_v418.z.object({ cached_tokens: import_v418.z.number().nullish() }).nullish(),
2594
+ output_tokens: import_v418.z.number(),
2595
+ output_tokens_details: import_v418.z.object({ reasoning_tokens: import_v418.z.number().nullish() }).nullish()
2532
2596
  }),
2533
- service_tier: import_v417.z.string().nullish()
2597
+ service_tier: import_v418.z.string().nullish()
2534
2598
  })
2535
2599
  }),
2536
- import_v417.z.object({
2537
- type: import_v417.z.literal("response.created"),
2538
- response: import_v417.z.object({
2539
- id: import_v417.z.string(),
2540
- created_at: import_v417.z.number(),
2541
- model: import_v417.z.string(),
2542
- service_tier: import_v417.z.string().nullish()
2600
+ import_v418.z.object({
2601
+ type: import_v418.z.literal("response.created"),
2602
+ response: import_v418.z.object({
2603
+ id: import_v418.z.string(),
2604
+ created_at: import_v418.z.number(),
2605
+ model: import_v418.z.string(),
2606
+ service_tier: import_v418.z.string().nullish()
2543
2607
  })
2544
2608
  }),
2545
- import_v417.z.object({
2546
- type: import_v417.z.literal("response.output_item.added"),
2547
- output_index: import_v417.z.number(),
2548
- item: import_v417.z.discriminatedUnion("type", [
2549
- import_v417.z.object({
2550
- type: import_v417.z.literal("message"),
2551
- id: import_v417.z.string()
2609
+ import_v418.z.object({
2610
+ type: import_v418.z.literal("response.output_item.added"),
2611
+ output_index: import_v418.z.number(),
2612
+ item: import_v418.z.discriminatedUnion("type", [
2613
+ import_v418.z.object({
2614
+ type: import_v418.z.literal("message"),
2615
+ id: import_v418.z.string()
2552
2616
  }),
2553
- import_v417.z.object({
2554
- type: import_v417.z.literal("reasoning"),
2555
- id: import_v417.z.string(),
2556
- encrypted_content: import_v417.z.string().nullish()
2617
+ import_v418.z.object({
2618
+ type: import_v418.z.literal("reasoning"),
2619
+ id: import_v418.z.string(),
2620
+ encrypted_content: import_v418.z.string().nullish()
2557
2621
  }),
2558
- import_v417.z.object({
2559
- type: import_v417.z.literal("function_call"),
2560
- id: import_v417.z.string(),
2561
- call_id: import_v417.z.string(),
2562
- name: import_v417.z.string(),
2563
- arguments: import_v417.z.string()
2622
+ import_v418.z.object({
2623
+ type: import_v418.z.literal("function_call"),
2624
+ id: import_v418.z.string(),
2625
+ call_id: import_v418.z.string(),
2626
+ name: import_v418.z.string(),
2627
+ arguments: import_v418.z.string()
2564
2628
  }),
2565
- import_v417.z.object({
2566
- type: import_v417.z.literal("web_search_call"),
2567
- id: import_v417.z.string(),
2568
- status: import_v417.z.string()
2629
+ import_v418.z.object({
2630
+ type: import_v418.z.literal("web_search_call"),
2631
+ id: import_v418.z.string(),
2632
+ status: import_v418.z.string()
2569
2633
  }),
2570
- import_v417.z.object({
2571
- type: import_v417.z.literal("computer_call"),
2572
- id: import_v417.z.string(),
2573
- status: import_v417.z.string()
2634
+ import_v418.z.object({
2635
+ type: import_v418.z.literal("computer_call"),
2636
+ id: import_v418.z.string(),
2637
+ status: import_v418.z.string()
2574
2638
  }),
2575
- import_v417.z.object({
2576
- type: import_v417.z.literal("file_search_call"),
2577
- id: import_v417.z.string()
2639
+ import_v418.z.object({
2640
+ type: import_v418.z.literal("file_search_call"),
2641
+ id: import_v418.z.string()
2578
2642
  }),
2579
- import_v417.z.object({
2580
- type: import_v417.z.literal("image_generation_call"),
2581
- id: import_v417.z.string()
2643
+ import_v418.z.object({
2644
+ type: import_v418.z.literal("image_generation_call"),
2645
+ id: import_v418.z.string()
2582
2646
  }),
2583
- import_v417.z.object({
2584
- type: import_v417.z.literal("code_interpreter_call"),
2585
- id: import_v417.z.string(),
2586
- container_id: import_v417.z.string(),
2587
- code: import_v417.z.string().nullable(),
2588
- outputs: import_v417.z.array(
2589
- import_v417.z.discriminatedUnion("type", [
2590
- import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
2591
- import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
2647
+ import_v418.z.object({
2648
+ type: import_v418.z.literal("code_interpreter_call"),
2649
+ id: import_v418.z.string(),
2650
+ container_id: import_v418.z.string(),
2651
+ code: import_v418.z.string().nullable(),
2652
+ outputs: import_v418.z.array(
2653
+ import_v418.z.discriminatedUnion("type", [
2654
+ import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
2655
+ import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
2592
2656
  ])
2593
2657
  ).nullable(),
2594
- status: import_v417.z.string()
2658
+ status: import_v418.z.string()
2659
+ }),
2660
+ import_v418.z.object({
2661
+ type: import_v418.z.literal("mcp_call"),
2662
+ id: import_v418.z.string(),
2663
+ status: import_v418.z.string()
2595
2664
  }),
2596
- import_v417.z.object({
2597
- type: import_v417.z.literal("mcp_call"),
2598
- id: import_v417.z.string(),
2599
- status: import_v417.z.string()
2665
+ import_v418.z.object({
2666
+ type: import_v418.z.literal("mcp_list_tools"),
2667
+ id: import_v418.z.string()
2600
2668
  }),
2601
- import_v417.z.object({
2602
- type: import_v417.z.literal("mcp_list_tools"),
2603
- id: import_v417.z.string()
2669
+ import_v418.z.object({
2670
+ type: import_v418.z.literal("mcp_approval_request"),
2671
+ id: import_v418.z.string()
2604
2672
  }),
2605
- import_v417.z.object({
2606
- type: import_v417.z.literal("mcp_approval_request"),
2607
- id: import_v417.z.string()
2673
+ import_v418.z.object({
2674
+ type: import_v418.z.literal("apply_patch_call"),
2675
+ id: import_v418.z.string(),
2676
+ call_id: import_v418.z.string(),
2677
+ status: import_v418.z.enum(["in_progress", "completed"]),
2678
+ operation: import_v418.z.discriminatedUnion("type", [
2679
+ import_v418.z.object({
2680
+ type: import_v418.z.literal("create_file"),
2681
+ path: import_v418.z.string(),
2682
+ diff: import_v418.z.string()
2683
+ }),
2684
+ import_v418.z.object({
2685
+ type: import_v418.z.literal("delete_file"),
2686
+ path: import_v418.z.string()
2687
+ }),
2688
+ import_v418.z.object({
2689
+ type: import_v418.z.literal("update_file"),
2690
+ path: import_v418.z.string(),
2691
+ diff: import_v418.z.string()
2692
+ })
2693
+ ])
2608
2694
  })
2609
2695
  ])
2610
2696
  }),
2611
- import_v417.z.object({
2612
- type: import_v417.z.literal("response.output_item.done"),
2613
- output_index: import_v417.z.number(),
2614
- item: import_v417.z.discriminatedUnion("type", [
2615
- import_v417.z.object({
2616
- type: import_v417.z.literal("message"),
2617
- id: import_v417.z.string()
2697
+ import_v418.z.object({
2698
+ type: import_v418.z.literal("response.output_item.done"),
2699
+ output_index: import_v418.z.number(),
2700
+ item: import_v418.z.discriminatedUnion("type", [
2701
+ import_v418.z.object({
2702
+ type: import_v418.z.literal("message"),
2703
+ id: import_v418.z.string()
2618
2704
  }),
2619
- import_v417.z.object({
2620
- type: import_v417.z.literal("reasoning"),
2621
- id: import_v417.z.string(),
2622
- encrypted_content: import_v417.z.string().nullish()
2705
+ import_v418.z.object({
2706
+ type: import_v418.z.literal("reasoning"),
2707
+ id: import_v418.z.string(),
2708
+ encrypted_content: import_v418.z.string().nullish()
2623
2709
  }),
2624
- import_v417.z.object({
2625
- type: import_v417.z.literal("function_call"),
2626
- id: import_v417.z.string(),
2627
- call_id: import_v417.z.string(),
2628
- name: import_v417.z.string(),
2629
- arguments: import_v417.z.string(),
2630
- status: import_v417.z.literal("completed")
2710
+ import_v418.z.object({
2711
+ type: import_v418.z.literal("function_call"),
2712
+ id: import_v418.z.string(),
2713
+ call_id: import_v418.z.string(),
2714
+ name: import_v418.z.string(),
2715
+ arguments: import_v418.z.string(),
2716
+ status: import_v418.z.literal("completed")
2631
2717
  }),
2632
- import_v417.z.object({
2633
- type: import_v417.z.literal("code_interpreter_call"),
2634
- id: import_v417.z.string(),
2635
- code: import_v417.z.string().nullable(),
2636
- container_id: import_v417.z.string(),
2637
- outputs: import_v417.z.array(
2638
- import_v417.z.discriminatedUnion("type", [
2639
- import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
2640
- import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
2718
+ import_v418.z.object({
2719
+ type: import_v418.z.literal("code_interpreter_call"),
2720
+ id: import_v418.z.string(),
2721
+ code: import_v418.z.string().nullable(),
2722
+ container_id: import_v418.z.string(),
2723
+ outputs: import_v418.z.array(
2724
+ import_v418.z.discriminatedUnion("type", [
2725
+ import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
2726
+ import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
2641
2727
  ])
2642
2728
  ).nullable()
2643
2729
  }),
2644
- import_v417.z.object({
2645
- type: import_v417.z.literal("image_generation_call"),
2646
- id: import_v417.z.string(),
2647
- result: import_v417.z.string()
2730
+ import_v418.z.object({
2731
+ type: import_v418.z.literal("image_generation_call"),
2732
+ id: import_v418.z.string(),
2733
+ result: import_v418.z.string()
2648
2734
  }),
2649
- import_v417.z.object({
2650
- type: import_v417.z.literal("web_search_call"),
2651
- id: import_v417.z.string(),
2652
- status: import_v417.z.string(),
2653
- action: import_v417.z.discriminatedUnion("type", [
2654
- import_v417.z.object({
2655
- type: import_v417.z.literal("search"),
2656
- query: import_v417.z.string().nullish(),
2657
- sources: import_v417.z.array(
2658
- import_v417.z.discriminatedUnion("type", [
2659
- import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
2660
- import_v417.z.object({ type: import_v417.z.literal("api"), name: import_v417.z.string() })
2735
+ import_v418.z.object({
2736
+ type: import_v418.z.literal("web_search_call"),
2737
+ id: import_v418.z.string(),
2738
+ status: import_v418.z.string(),
2739
+ action: import_v418.z.discriminatedUnion("type", [
2740
+ import_v418.z.object({
2741
+ type: import_v418.z.literal("search"),
2742
+ query: import_v418.z.string().nullish(),
2743
+ sources: import_v418.z.array(
2744
+ import_v418.z.discriminatedUnion("type", [
2745
+ import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
2746
+ import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
2661
2747
  ])
2662
2748
  ).nullish()
2663
2749
  }),
2664
- import_v417.z.object({
2665
- type: import_v417.z.literal("open_page"),
2666
- url: import_v417.z.string()
2750
+ import_v418.z.object({
2751
+ type: import_v418.z.literal("open_page"),
2752
+ url: import_v418.z.string()
2667
2753
  }),
2668
- import_v417.z.object({
2669
- type: import_v417.z.literal("find"),
2670
- url: import_v417.z.string(),
2671
- pattern: import_v417.z.string()
2754
+ import_v418.z.object({
2755
+ type: import_v418.z.literal("find"),
2756
+ url: import_v418.z.string(),
2757
+ pattern: import_v418.z.string()
2672
2758
  })
2673
2759
  ])
2674
2760
  }),
2675
- import_v417.z.object({
2676
- type: import_v417.z.literal("file_search_call"),
2677
- id: import_v417.z.string(),
2678
- queries: import_v417.z.array(import_v417.z.string()),
2679
- results: import_v417.z.array(
2680
- import_v417.z.object({
2681
- attributes: import_v417.z.record(
2682
- import_v417.z.string(),
2683
- import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
2761
+ import_v418.z.object({
2762
+ type: import_v418.z.literal("file_search_call"),
2763
+ id: import_v418.z.string(),
2764
+ queries: import_v418.z.array(import_v418.z.string()),
2765
+ results: import_v418.z.array(
2766
+ import_v418.z.object({
2767
+ attributes: import_v418.z.record(
2768
+ import_v418.z.string(),
2769
+ import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
2684
2770
  ),
2685
- file_id: import_v417.z.string(),
2686
- filename: import_v417.z.string(),
2687
- score: import_v417.z.number(),
2688
- text: import_v417.z.string()
2771
+ file_id: import_v418.z.string(),
2772
+ filename: import_v418.z.string(),
2773
+ score: import_v418.z.number(),
2774
+ text: import_v418.z.string()
2689
2775
  })
2690
2776
  ).nullish()
2691
2777
  }),
2692
- import_v417.z.object({
2693
- type: import_v417.z.literal("local_shell_call"),
2694
- id: import_v417.z.string(),
2695
- call_id: import_v417.z.string(),
2696
- action: import_v417.z.object({
2697
- type: import_v417.z.literal("exec"),
2698
- command: import_v417.z.array(import_v417.z.string()),
2699
- timeout_ms: import_v417.z.number().optional(),
2700
- user: import_v417.z.string().optional(),
2701
- working_directory: import_v417.z.string().optional(),
2702
- env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
2778
+ import_v418.z.object({
2779
+ type: import_v418.z.literal("local_shell_call"),
2780
+ id: import_v418.z.string(),
2781
+ call_id: import_v418.z.string(),
2782
+ action: import_v418.z.object({
2783
+ type: import_v418.z.literal("exec"),
2784
+ command: import_v418.z.array(import_v418.z.string()),
2785
+ timeout_ms: import_v418.z.number().optional(),
2786
+ user: import_v418.z.string().optional(),
2787
+ working_directory: import_v418.z.string().optional(),
2788
+ env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
2703
2789
  })
2704
2790
  }),
2705
- import_v417.z.object({
2706
- type: import_v417.z.literal("computer_call"),
2707
- id: import_v417.z.string(),
2708
- status: import_v417.z.literal("completed")
2791
+ import_v418.z.object({
2792
+ type: import_v418.z.literal("computer_call"),
2793
+ id: import_v418.z.string(),
2794
+ status: import_v418.z.literal("completed")
2709
2795
  }),
2710
- import_v417.z.object({
2711
- type: import_v417.z.literal("mcp_call"),
2712
- id: import_v417.z.string(),
2713
- status: import_v417.z.string(),
2714
- arguments: import_v417.z.string(),
2715
- name: import_v417.z.string(),
2716
- server_label: import_v417.z.string(),
2717
- output: import_v417.z.string().nullish(),
2718
- error: import_v417.z.union([
2719
- import_v417.z.string(),
2720
- import_v417.z.object({
2721
- type: import_v417.z.string().optional(),
2722
- code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
2723
- message: import_v417.z.string().optional()
2796
+ import_v418.z.object({
2797
+ type: import_v418.z.literal("mcp_call"),
2798
+ id: import_v418.z.string(),
2799
+ status: import_v418.z.string(),
2800
+ arguments: import_v418.z.string(),
2801
+ name: import_v418.z.string(),
2802
+ server_label: import_v418.z.string(),
2803
+ output: import_v418.z.string().nullish(),
2804
+ error: import_v418.z.union([
2805
+ import_v418.z.string(),
2806
+ import_v418.z.object({
2807
+ type: import_v418.z.string().optional(),
2808
+ code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
2809
+ message: import_v418.z.string().optional()
2724
2810
  }).loose()
2725
2811
  ]).nullish()
2726
2812
  }),
2727
- import_v417.z.object({
2728
- type: import_v417.z.literal("mcp_list_tools"),
2729
- id: import_v417.z.string(),
2730
- server_label: import_v417.z.string(),
2731
- tools: import_v417.z.array(
2732
- import_v417.z.object({
2733
- name: import_v417.z.string(),
2734
- description: import_v417.z.string().optional(),
2735
- input_schema: import_v417.z.any(),
2736
- annotations: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
2813
+ import_v418.z.object({
2814
+ type: import_v418.z.literal("mcp_list_tools"),
2815
+ id: import_v418.z.string(),
2816
+ server_label: import_v418.z.string(),
2817
+ tools: import_v418.z.array(
2818
+ import_v418.z.object({
2819
+ name: import_v418.z.string(),
2820
+ description: import_v418.z.string().optional(),
2821
+ input_schema: import_v418.z.any(),
2822
+ annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
2737
2823
  })
2738
2824
  ),
2739
- error: import_v417.z.union([
2740
- import_v417.z.string(),
2741
- import_v417.z.object({
2742
- type: import_v417.z.string().optional(),
2743
- code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
2744
- message: import_v417.z.string().optional()
2825
+ error: import_v418.z.union([
2826
+ import_v418.z.string(),
2827
+ import_v418.z.object({
2828
+ type: import_v418.z.string().optional(),
2829
+ code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
2830
+ message: import_v418.z.string().optional()
2745
2831
  }).loose()
2746
2832
  ]).optional()
2747
2833
  }),
2748
- import_v417.z.object({
2749
- type: import_v417.z.literal("mcp_approval_request"),
2750
- id: import_v417.z.string(),
2751
- server_label: import_v417.z.string(),
2752
- name: import_v417.z.string(),
2753
- arguments: import_v417.z.string(),
2754
- approval_request_id: import_v417.z.string()
2834
+ import_v418.z.object({
2835
+ type: import_v418.z.literal("mcp_approval_request"),
2836
+ id: import_v418.z.string(),
2837
+ server_label: import_v418.z.string(),
2838
+ name: import_v418.z.string(),
2839
+ arguments: import_v418.z.string(),
2840
+ approval_request_id: import_v418.z.string()
2841
+ }),
2842
+ import_v418.z.object({
2843
+ type: import_v418.z.literal("apply_patch_call"),
2844
+ id: import_v418.z.string(),
2845
+ call_id: import_v418.z.string(),
2846
+ status: import_v418.z.enum(["in_progress", "completed"]),
2847
+ operation: import_v418.z.discriminatedUnion("type", [
2848
+ import_v418.z.object({
2849
+ type: import_v418.z.literal("create_file"),
2850
+ path: import_v418.z.string(),
2851
+ diff: import_v418.z.string()
2852
+ }),
2853
+ import_v418.z.object({
2854
+ type: import_v418.z.literal("delete_file"),
2855
+ path: import_v418.z.string()
2856
+ }),
2857
+ import_v418.z.object({
2858
+ type: import_v418.z.literal("update_file"),
2859
+ path: import_v418.z.string(),
2860
+ diff: import_v418.z.string()
2861
+ })
2862
+ ])
2755
2863
  })
2756
2864
  ])
2757
2865
  }),
2758
- import_v417.z.object({
2759
- type: import_v417.z.literal("response.function_call_arguments.delta"),
2760
- item_id: import_v417.z.string(),
2761
- output_index: import_v417.z.number(),
2762
- delta: import_v417.z.string()
2866
+ import_v418.z.object({
2867
+ type: import_v418.z.literal("response.function_call_arguments.delta"),
2868
+ item_id: import_v418.z.string(),
2869
+ output_index: import_v418.z.number(),
2870
+ delta: import_v418.z.string()
2763
2871
  }),
2764
- import_v417.z.object({
2765
- type: import_v417.z.literal("response.image_generation_call.partial_image"),
2766
- item_id: import_v417.z.string(),
2767
- output_index: import_v417.z.number(),
2768
- partial_image_b64: import_v417.z.string()
2872
+ import_v418.z.object({
2873
+ type: import_v418.z.literal("response.image_generation_call.partial_image"),
2874
+ item_id: import_v418.z.string(),
2875
+ output_index: import_v418.z.number(),
2876
+ partial_image_b64: import_v418.z.string()
2769
2877
  }),
2770
- import_v417.z.object({
2771
- type: import_v417.z.literal("response.code_interpreter_call_code.delta"),
2772
- item_id: import_v417.z.string(),
2773
- output_index: import_v417.z.number(),
2774
- delta: import_v417.z.string()
2878
+ import_v418.z.object({
2879
+ type: import_v418.z.literal("response.code_interpreter_call_code.delta"),
2880
+ item_id: import_v418.z.string(),
2881
+ output_index: import_v418.z.number(),
2882
+ delta: import_v418.z.string()
2775
2883
  }),
2776
- import_v417.z.object({
2777
- type: import_v417.z.literal("response.code_interpreter_call_code.done"),
2778
- item_id: import_v417.z.string(),
2779
- output_index: import_v417.z.number(),
2780
- code: import_v417.z.string()
2884
+ import_v418.z.object({
2885
+ type: import_v418.z.literal("response.code_interpreter_call_code.done"),
2886
+ item_id: import_v418.z.string(),
2887
+ output_index: import_v418.z.number(),
2888
+ code: import_v418.z.string()
2781
2889
  }),
2782
- import_v417.z.object({
2783
- type: import_v417.z.literal("response.output_text.annotation.added"),
2784
- annotation: import_v417.z.discriminatedUnion("type", [
2785
- import_v417.z.object({
2786
- type: import_v417.z.literal("url_citation"),
2787
- start_index: import_v417.z.number(),
2788
- end_index: import_v417.z.number(),
2789
- url: import_v417.z.string(),
2790
- title: import_v417.z.string()
2890
+ import_v418.z.object({
2891
+ type: import_v418.z.literal("response.output_text.annotation.added"),
2892
+ annotation: import_v418.z.discriminatedUnion("type", [
2893
+ import_v418.z.object({
2894
+ type: import_v418.z.literal("url_citation"),
2895
+ start_index: import_v418.z.number(),
2896
+ end_index: import_v418.z.number(),
2897
+ url: import_v418.z.string(),
2898
+ title: import_v418.z.string()
2791
2899
  }),
2792
- import_v417.z.object({
2793
- type: import_v417.z.literal("file_citation"),
2794
- file_id: import_v417.z.string(),
2795
- filename: import_v417.z.string().nullish(),
2796
- index: import_v417.z.number().nullish(),
2797
- start_index: import_v417.z.number().nullish(),
2798
- end_index: import_v417.z.number().nullish(),
2799
- quote: import_v417.z.string().nullish()
2900
+ import_v418.z.object({
2901
+ type: import_v418.z.literal("file_citation"),
2902
+ file_id: import_v418.z.string(),
2903
+ filename: import_v418.z.string().nullish(),
2904
+ index: import_v418.z.number().nullish(),
2905
+ start_index: import_v418.z.number().nullish(),
2906
+ end_index: import_v418.z.number().nullish(),
2907
+ quote: import_v418.z.string().nullish()
2800
2908
  }),
2801
- import_v417.z.object({
2802
- type: import_v417.z.literal("container_file_citation"),
2803
- container_id: import_v417.z.string(),
2804
- file_id: import_v417.z.string(),
2805
- filename: import_v417.z.string().nullish(),
2806
- start_index: import_v417.z.number().nullish(),
2807
- end_index: import_v417.z.number().nullish(),
2808
- index: import_v417.z.number().nullish()
2909
+ import_v418.z.object({
2910
+ type: import_v418.z.literal("container_file_citation"),
2911
+ container_id: import_v418.z.string(),
2912
+ file_id: import_v418.z.string(),
2913
+ filename: import_v418.z.string().nullish(),
2914
+ start_index: import_v418.z.number().nullish(),
2915
+ end_index: import_v418.z.number().nullish(),
2916
+ index: import_v418.z.number().nullish()
2809
2917
  }),
2810
- import_v417.z.object({
2811
- type: import_v417.z.literal("file_path"),
2812
- file_id: import_v417.z.string(),
2813
- index: import_v417.z.number().nullish()
2918
+ import_v418.z.object({
2919
+ type: import_v418.z.literal("file_path"),
2920
+ file_id: import_v418.z.string(),
2921
+ index: import_v418.z.number().nullish()
2814
2922
  })
2815
2923
  ])
2816
2924
  }),
2817
- import_v417.z.object({
2818
- type: import_v417.z.literal("response.reasoning_summary_part.added"),
2819
- item_id: import_v417.z.string(),
2820
- summary_index: import_v417.z.number()
2925
+ import_v418.z.object({
2926
+ type: import_v418.z.literal("response.reasoning_summary_part.added"),
2927
+ item_id: import_v418.z.string(),
2928
+ summary_index: import_v418.z.number()
2821
2929
  }),
2822
- import_v417.z.object({
2823
- type: import_v417.z.literal("response.reasoning_summary_text.delta"),
2824
- item_id: import_v417.z.string(),
2825
- summary_index: import_v417.z.number(),
2826
- delta: import_v417.z.string()
2930
+ import_v418.z.object({
2931
+ type: import_v418.z.literal("response.reasoning_summary_text.delta"),
2932
+ item_id: import_v418.z.string(),
2933
+ summary_index: import_v418.z.number(),
2934
+ delta: import_v418.z.string()
2827
2935
  }),
2828
- import_v417.z.object({
2829
- type: import_v417.z.literal("response.reasoning_summary_part.done"),
2830
- item_id: import_v417.z.string(),
2831
- summary_index: import_v417.z.number()
2936
+ import_v418.z.object({
2937
+ type: import_v418.z.literal("response.reasoning_summary_part.done"),
2938
+ item_id: import_v418.z.string(),
2939
+ summary_index: import_v418.z.number()
2832
2940
  }),
2833
- import_v417.z.object({
2834
- type: import_v417.z.literal("error"),
2835
- sequence_number: import_v417.z.number(),
2836
- error: import_v417.z.object({
2837
- type: import_v417.z.string(),
2838
- code: import_v417.z.string(),
2839
- message: import_v417.z.string(),
2840
- param: import_v417.z.string().nullish()
2941
+ import_v418.z.object({
2942
+ type: import_v418.z.literal("error"),
2943
+ sequence_number: import_v418.z.number(),
2944
+ error: import_v418.z.object({
2945
+ type: import_v418.z.string(),
2946
+ code: import_v418.z.string(),
2947
+ message: import_v418.z.string(),
2948
+ param: import_v418.z.string().nullish()
2841
2949
  })
2842
2950
  }),
2843
- import_v417.z.object({ type: import_v417.z.string() }).loose().transform((value) => ({
2951
+ import_v418.z.object({ type: import_v418.z.string() }).loose().transform((value) => ({
2844
2952
  type: "unknown_chunk",
2845
2953
  message: value.type
2846
2954
  }))
@@ -2848,236 +2956,258 @@ var openaiResponsesChunkSchema = (0, import_provider_utils22.lazySchema)(
2848
2956
  ])
2849
2957
  )
2850
2958
  );
2851
- var openaiResponsesResponseSchema = (0, import_provider_utils22.lazySchema)(
2852
- () => (0, import_provider_utils22.zodSchema)(
2853
- import_v417.z.object({
2854
- id: import_v417.z.string().optional(),
2855
- created_at: import_v417.z.number().optional(),
2856
- error: import_v417.z.object({
2857
- message: import_v417.z.string(),
2858
- type: import_v417.z.string(),
2859
- param: import_v417.z.string().nullish(),
2860
- code: import_v417.z.string()
2959
+ var openaiResponsesResponseSchema = (0, import_provider_utils23.lazySchema)(
2960
+ () => (0, import_provider_utils23.zodSchema)(
2961
+ import_v418.z.object({
2962
+ id: import_v418.z.string().optional(),
2963
+ created_at: import_v418.z.number().optional(),
2964
+ error: import_v418.z.object({
2965
+ message: import_v418.z.string(),
2966
+ type: import_v418.z.string(),
2967
+ param: import_v418.z.string().nullish(),
2968
+ code: import_v418.z.string()
2861
2969
  }).nullish(),
2862
- model: import_v417.z.string().optional(),
2863
- output: import_v417.z.array(
2864
- import_v417.z.discriminatedUnion("type", [
2865
- import_v417.z.object({
2866
- type: import_v417.z.literal("message"),
2867
- role: import_v417.z.literal("assistant"),
2868
- id: import_v417.z.string(),
2869
- content: import_v417.z.array(
2870
- import_v417.z.object({
2871
- type: import_v417.z.literal("output_text"),
2872
- text: import_v417.z.string(),
2873
- logprobs: import_v417.z.array(
2874
- import_v417.z.object({
2875
- token: import_v417.z.string(),
2876
- logprob: import_v417.z.number(),
2877
- top_logprobs: import_v417.z.array(
2878
- import_v417.z.object({
2879
- token: import_v417.z.string(),
2880
- logprob: import_v417.z.number()
2970
+ model: import_v418.z.string().optional(),
2971
+ output: import_v418.z.array(
2972
+ import_v418.z.discriminatedUnion("type", [
2973
+ import_v418.z.object({
2974
+ type: import_v418.z.literal("message"),
2975
+ role: import_v418.z.literal("assistant"),
2976
+ id: import_v418.z.string(),
2977
+ content: import_v418.z.array(
2978
+ import_v418.z.object({
2979
+ type: import_v418.z.literal("output_text"),
2980
+ text: import_v418.z.string(),
2981
+ logprobs: import_v418.z.array(
2982
+ import_v418.z.object({
2983
+ token: import_v418.z.string(),
2984
+ logprob: import_v418.z.number(),
2985
+ top_logprobs: import_v418.z.array(
2986
+ import_v418.z.object({
2987
+ token: import_v418.z.string(),
2988
+ logprob: import_v418.z.number()
2881
2989
  })
2882
2990
  )
2883
2991
  })
2884
2992
  ).nullish(),
2885
- annotations: import_v417.z.array(
2886
- import_v417.z.discriminatedUnion("type", [
2887
- import_v417.z.object({
2888
- type: import_v417.z.literal("url_citation"),
2889
- start_index: import_v417.z.number(),
2890
- end_index: import_v417.z.number(),
2891
- url: import_v417.z.string(),
2892
- title: import_v417.z.string()
2993
+ annotations: import_v418.z.array(
2994
+ import_v418.z.discriminatedUnion("type", [
2995
+ import_v418.z.object({
2996
+ type: import_v418.z.literal("url_citation"),
2997
+ start_index: import_v418.z.number(),
2998
+ end_index: import_v418.z.number(),
2999
+ url: import_v418.z.string(),
3000
+ title: import_v418.z.string()
2893
3001
  }),
2894
- import_v417.z.object({
2895
- type: import_v417.z.literal("file_citation"),
2896
- file_id: import_v417.z.string(),
2897
- filename: import_v417.z.string().nullish(),
2898
- index: import_v417.z.number().nullish(),
2899
- start_index: import_v417.z.number().nullish(),
2900
- end_index: import_v417.z.number().nullish(),
2901
- quote: import_v417.z.string().nullish()
3002
+ import_v418.z.object({
3003
+ type: import_v418.z.literal("file_citation"),
3004
+ file_id: import_v418.z.string(),
3005
+ filename: import_v418.z.string().nullish(),
3006
+ index: import_v418.z.number().nullish(),
3007
+ start_index: import_v418.z.number().nullish(),
3008
+ end_index: import_v418.z.number().nullish(),
3009
+ quote: import_v418.z.string().nullish()
2902
3010
  }),
2903
- import_v417.z.object({
2904
- type: import_v417.z.literal("container_file_citation"),
2905
- container_id: import_v417.z.string(),
2906
- file_id: import_v417.z.string(),
2907
- filename: import_v417.z.string().nullish(),
2908
- start_index: import_v417.z.number().nullish(),
2909
- end_index: import_v417.z.number().nullish(),
2910
- index: import_v417.z.number().nullish()
3011
+ import_v418.z.object({
3012
+ type: import_v418.z.literal("container_file_citation"),
3013
+ container_id: import_v418.z.string(),
3014
+ file_id: import_v418.z.string(),
3015
+ filename: import_v418.z.string().nullish(),
3016
+ start_index: import_v418.z.number().nullish(),
3017
+ end_index: import_v418.z.number().nullish(),
3018
+ index: import_v418.z.number().nullish()
2911
3019
  }),
2912
- import_v417.z.object({
2913
- type: import_v417.z.literal("file_path"),
2914
- file_id: import_v417.z.string(),
2915
- index: import_v417.z.number().nullish()
3020
+ import_v418.z.object({
3021
+ type: import_v418.z.literal("file_path"),
3022
+ file_id: import_v418.z.string(),
3023
+ index: import_v418.z.number().nullish()
2916
3024
  })
2917
3025
  ])
2918
3026
  )
2919
3027
  })
2920
3028
  )
2921
3029
  }),
2922
- import_v417.z.object({
2923
- type: import_v417.z.literal("web_search_call"),
2924
- id: import_v417.z.string(),
2925
- status: import_v417.z.string(),
2926
- action: import_v417.z.discriminatedUnion("type", [
2927
- import_v417.z.object({
2928
- type: import_v417.z.literal("search"),
2929
- query: import_v417.z.string().nullish(),
2930
- sources: import_v417.z.array(
2931
- import_v417.z.discriminatedUnion("type", [
2932
- import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
2933
- import_v417.z.object({ type: import_v417.z.literal("api"), name: import_v417.z.string() })
3030
+ import_v418.z.object({
3031
+ type: import_v418.z.literal("web_search_call"),
3032
+ id: import_v418.z.string(),
3033
+ status: import_v418.z.string(),
3034
+ action: import_v418.z.discriminatedUnion("type", [
3035
+ import_v418.z.object({
3036
+ type: import_v418.z.literal("search"),
3037
+ query: import_v418.z.string().nullish(),
3038
+ sources: import_v418.z.array(
3039
+ import_v418.z.discriminatedUnion("type", [
3040
+ import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
3041
+ import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
2934
3042
  ])
2935
3043
  ).nullish()
2936
3044
  }),
2937
- import_v417.z.object({
2938
- type: import_v417.z.literal("open_page"),
2939
- url: import_v417.z.string()
3045
+ import_v418.z.object({
3046
+ type: import_v418.z.literal("open_page"),
3047
+ url: import_v418.z.string()
2940
3048
  }),
2941
- import_v417.z.object({
2942
- type: import_v417.z.literal("find"),
2943
- url: import_v417.z.string(),
2944
- pattern: import_v417.z.string()
3049
+ import_v418.z.object({
3050
+ type: import_v418.z.literal("find"),
3051
+ url: import_v418.z.string(),
3052
+ pattern: import_v418.z.string()
2945
3053
  })
2946
3054
  ])
2947
3055
  }),
2948
- import_v417.z.object({
2949
- type: import_v417.z.literal("file_search_call"),
2950
- id: import_v417.z.string(),
2951
- queries: import_v417.z.array(import_v417.z.string()),
2952
- results: import_v417.z.array(
2953
- import_v417.z.object({
2954
- attributes: import_v417.z.record(
2955
- import_v417.z.string(),
2956
- import_v417.z.union([import_v417.z.string(), import_v417.z.number(), import_v417.z.boolean()])
3056
+ import_v418.z.object({
3057
+ type: import_v418.z.literal("file_search_call"),
3058
+ id: import_v418.z.string(),
3059
+ queries: import_v418.z.array(import_v418.z.string()),
3060
+ results: import_v418.z.array(
3061
+ import_v418.z.object({
3062
+ attributes: import_v418.z.record(
3063
+ import_v418.z.string(),
3064
+ import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
2957
3065
  ),
2958
- file_id: import_v417.z.string(),
2959
- filename: import_v417.z.string(),
2960
- score: import_v417.z.number(),
2961
- text: import_v417.z.string()
3066
+ file_id: import_v418.z.string(),
3067
+ filename: import_v418.z.string(),
3068
+ score: import_v418.z.number(),
3069
+ text: import_v418.z.string()
2962
3070
  })
2963
3071
  ).nullish()
2964
3072
  }),
2965
- import_v417.z.object({
2966
- type: import_v417.z.literal("code_interpreter_call"),
2967
- id: import_v417.z.string(),
2968
- code: import_v417.z.string().nullable(),
2969
- container_id: import_v417.z.string(),
2970
- outputs: import_v417.z.array(
2971
- import_v417.z.discriminatedUnion("type", [
2972
- import_v417.z.object({ type: import_v417.z.literal("logs"), logs: import_v417.z.string() }),
2973
- import_v417.z.object({ type: import_v417.z.literal("image"), url: import_v417.z.string() })
3073
+ import_v418.z.object({
3074
+ type: import_v418.z.literal("code_interpreter_call"),
3075
+ id: import_v418.z.string(),
3076
+ code: import_v418.z.string().nullable(),
3077
+ container_id: import_v418.z.string(),
3078
+ outputs: import_v418.z.array(
3079
+ import_v418.z.discriminatedUnion("type", [
3080
+ import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
3081
+ import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
2974
3082
  ])
2975
3083
  ).nullable()
2976
3084
  }),
2977
- import_v417.z.object({
2978
- type: import_v417.z.literal("image_generation_call"),
2979
- id: import_v417.z.string(),
2980
- result: import_v417.z.string()
3085
+ import_v418.z.object({
3086
+ type: import_v418.z.literal("image_generation_call"),
3087
+ id: import_v418.z.string(),
3088
+ result: import_v418.z.string()
2981
3089
  }),
2982
- import_v417.z.object({
2983
- type: import_v417.z.literal("local_shell_call"),
2984
- id: import_v417.z.string(),
2985
- call_id: import_v417.z.string(),
2986
- action: import_v417.z.object({
2987
- type: import_v417.z.literal("exec"),
2988
- command: import_v417.z.array(import_v417.z.string()),
2989
- timeout_ms: import_v417.z.number().optional(),
2990
- user: import_v417.z.string().optional(),
2991
- working_directory: import_v417.z.string().optional(),
2992
- env: import_v417.z.record(import_v417.z.string(), import_v417.z.string()).optional()
3090
+ import_v418.z.object({
3091
+ type: import_v418.z.literal("local_shell_call"),
3092
+ id: import_v418.z.string(),
3093
+ call_id: import_v418.z.string(),
3094
+ action: import_v418.z.object({
3095
+ type: import_v418.z.literal("exec"),
3096
+ command: import_v418.z.array(import_v418.z.string()),
3097
+ timeout_ms: import_v418.z.number().optional(),
3098
+ user: import_v418.z.string().optional(),
3099
+ working_directory: import_v418.z.string().optional(),
3100
+ env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
2993
3101
  })
2994
3102
  }),
2995
- import_v417.z.object({
2996
- type: import_v417.z.literal("function_call"),
2997
- call_id: import_v417.z.string(),
2998
- name: import_v417.z.string(),
2999
- arguments: import_v417.z.string(),
3000
- id: import_v417.z.string()
3103
+ import_v418.z.object({
3104
+ type: import_v418.z.literal("function_call"),
3105
+ call_id: import_v418.z.string(),
3106
+ name: import_v418.z.string(),
3107
+ arguments: import_v418.z.string(),
3108
+ id: import_v418.z.string()
3001
3109
  }),
3002
- import_v417.z.object({
3003
- type: import_v417.z.literal("computer_call"),
3004
- id: import_v417.z.string(),
3005
- status: import_v417.z.string().optional()
3110
+ import_v418.z.object({
3111
+ type: import_v418.z.literal("computer_call"),
3112
+ id: import_v418.z.string(),
3113
+ status: import_v418.z.string().optional()
3006
3114
  }),
3007
- import_v417.z.object({
3008
- type: import_v417.z.literal("reasoning"),
3009
- id: import_v417.z.string(),
3010
- encrypted_content: import_v417.z.string().nullish(),
3011
- summary: import_v417.z.array(
3012
- import_v417.z.object({
3013
- type: import_v417.z.literal("summary_text"),
3014
- text: import_v417.z.string()
3115
+ import_v418.z.object({
3116
+ type: import_v418.z.literal("reasoning"),
3117
+ id: import_v418.z.string(),
3118
+ encrypted_content: import_v418.z.string().nullish(),
3119
+ summary: import_v418.z.array(
3120
+ import_v418.z.object({
3121
+ type: import_v418.z.literal("summary_text"),
3122
+ text: import_v418.z.string()
3015
3123
  })
3016
3124
  )
3017
3125
  }),
3018
- import_v417.z.object({
3019
- type: import_v417.z.literal("mcp_call"),
3020
- id: import_v417.z.string(),
3021
- status: import_v417.z.string(),
3022
- arguments: import_v417.z.string(),
3023
- name: import_v417.z.string(),
3024
- server_label: import_v417.z.string(),
3025
- output: import_v417.z.string().nullish(),
3026
- error: import_v417.z.union([
3027
- import_v417.z.string(),
3028
- import_v417.z.object({
3029
- type: import_v417.z.string().optional(),
3030
- code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
3031
- message: import_v417.z.string().optional()
3126
+ import_v418.z.object({
3127
+ type: import_v418.z.literal("mcp_call"),
3128
+ id: import_v418.z.string(),
3129
+ status: import_v418.z.string(),
3130
+ arguments: import_v418.z.string(),
3131
+ name: import_v418.z.string(),
3132
+ server_label: import_v418.z.string(),
3133
+ output: import_v418.z.string().nullish(),
3134
+ error: import_v418.z.union([
3135
+ import_v418.z.string(),
3136
+ import_v418.z.object({
3137
+ type: import_v418.z.string().optional(),
3138
+ code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
3139
+ message: import_v418.z.string().optional()
3032
3140
  }).loose()
3033
3141
  ]).nullish()
3034
3142
  }),
3035
- import_v417.z.object({
3036
- type: import_v417.z.literal("mcp_list_tools"),
3037
- id: import_v417.z.string(),
3038
- server_label: import_v417.z.string(),
3039
- tools: import_v417.z.array(
3040
- import_v417.z.object({
3041
- name: import_v417.z.string(),
3042
- description: import_v417.z.string().optional(),
3043
- input_schema: import_v417.z.any(),
3044
- annotations: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
3143
+ import_v418.z.object({
3144
+ type: import_v418.z.literal("mcp_list_tools"),
3145
+ id: import_v418.z.string(),
3146
+ server_label: import_v418.z.string(),
3147
+ tools: import_v418.z.array(
3148
+ import_v418.z.object({
3149
+ name: import_v418.z.string(),
3150
+ description: import_v418.z.string().optional(),
3151
+ input_schema: import_v418.z.any(),
3152
+ annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
3045
3153
  })
3046
3154
  ),
3047
- error: import_v417.z.union([
3048
- import_v417.z.string(),
3049
- import_v417.z.object({
3050
- type: import_v417.z.string().optional(),
3051
- code: import_v417.z.union([import_v417.z.number(), import_v417.z.string()]).optional(),
3052
- message: import_v417.z.string().optional()
3155
+ error: import_v418.z.union([
3156
+ import_v418.z.string(),
3157
+ import_v418.z.object({
3158
+ type: import_v418.z.string().optional(),
3159
+ code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
3160
+ message: import_v418.z.string().optional()
3053
3161
  }).loose()
3054
3162
  ]).optional()
3055
3163
  }),
3056
- import_v417.z.object({
3057
- type: import_v417.z.literal("mcp_approval_request"),
3058
- id: import_v417.z.string(),
3059
- server_label: import_v417.z.string(),
3060
- name: import_v417.z.string(),
3061
- arguments: import_v417.z.string(),
3062
- approval_request_id: import_v417.z.string()
3164
+ import_v418.z.object({
3165
+ type: import_v418.z.literal("mcp_approval_request"),
3166
+ id: import_v418.z.string(),
3167
+ server_label: import_v418.z.string(),
3168
+ name: import_v418.z.string(),
3169
+ arguments: import_v418.z.string(),
3170
+ approval_request_id: import_v418.z.string()
3171
+ }),
3172
+ import_v418.z.object({
3173
+ type: import_v418.z.literal("apply_patch_call"),
3174
+ id: import_v418.z.string(),
3175
+ call_id: import_v418.z.string(),
3176
+ status: import_v418.z.enum(["in_progress", "completed"]),
3177
+ operation: import_v418.z.discriminatedUnion("type", [
3178
+ import_v418.z.object({
3179
+ type: import_v418.z.literal("create_file"),
3180
+ path: import_v418.z.string(),
3181
+ diff: import_v418.z.string()
3182
+ }),
3183
+ import_v418.z.object({
3184
+ type: import_v418.z.literal("delete_file"),
3185
+ path: import_v418.z.string()
3186
+ }),
3187
+ import_v418.z.object({
3188
+ type: import_v418.z.literal("update_file"),
3189
+ path: import_v418.z.string(),
3190
+ diff: import_v418.z.string()
3191
+ })
3192
+ ])
3063
3193
  })
3064
3194
  ])
3065
3195
  ).optional(),
3066
- service_tier: import_v417.z.string().nullish(),
3067
- incomplete_details: import_v417.z.object({ reason: import_v417.z.string() }).nullish(),
3068
- usage: import_v417.z.object({
3069
- input_tokens: import_v417.z.number(),
3070
- input_tokens_details: import_v417.z.object({ cached_tokens: import_v417.z.number().nullish() }).nullish(),
3071
- output_tokens: import_v417.z.number(),
3072
- output_tokens_details: import_v417.z.object({ reasoning_tokens: import_v417.z.number().nullish() }).nullish()
3196
+ service_tier: import_v418.z.string().nullish(),
3197
+ incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
3198
+ usage: import_v418.z.object({
3199
+ input_tokens: import_v418.z.number(),
3200
+ input_tokens_details: import_v418.z.object({ cached_tokens: import_v418.z.number().nullish() }).nullish(),
3201
+ output_tokens: import_v418.z.number(),
3202
+ output_tokens_details: import_v418.z.object({ reasoning_tokens: import_v418.z.number().nullish() }).nullish()
3073
3203
  }).optional()
3074
3204
  })
3075
3205
  )
3076
3206
  );
3077
3207
 
3078
3208
  // src/responses/openai-responses-options.ts
3079
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
3080
- var import_v418 = require("zod/v4");
3209
+ var import_provider_utils24 = require("@ai-sdk/provider-utils");
3210
+ var import_v419 = require("zod/v4");
3081
3211
  var TOP_LOGPROBS_MAX = 20;
3082
3212
  var openaiResponsesReasoningModelIds = [
3083
3213
  "o1",
@@ -3144,19 +3274,19 @@ var openaiResponsesModelIds = [
3144
3274
  "gpt-5-chat-latest",
3145
3275
  ...openaiResponsesReasoningModelIds
3146
3276
  ];
3147
- var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazySchema)(
3148
- () => (0, import_provider_utils23.zodSchema)(
3149
- import_v418.z.object({
3150
- conversation: import_v418.z.string().nullish(),
3151
- include: import_v418.z.array(
3152
- import_v418.z.enum([
3277
+ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils24.lazySchema)(
3278
+ () => (0, import_provider_utils24.zodSchema)(
3279
+ import_v419.z.object({
3280
+ conversation: import_v419.z.string().nullish(),
3281
+ include: import_v419.z.array(
3282
+ import_v419.z.enum([
3153
3283
  "reasoning.encrypted_content",
3154
3284
  // handled internally by default, only needed for unknown reasoning models
3155
3285
  "file_search_call.results",
3156
3286
  "message.output_text.logprobs"
3157
3287
  ])
3158
3288
  ).nullish(),
3159
- instructions: import_v418.z.string().nullish(),
3289
+ instructions: import_v419.z.string().nullish(),
3160
3290
  /**
3161
3291
  * Return the log probabilities of the tokens.
3162
3292
  *
@@ -3169,17 +3299,17 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazySchem
3169
3299
  * @see https://platform.openai.com/docs/api-reference/responses/create
3170
3300
  * @see https://cookbook.openai.com/examples/using_logprobs
3171
3301
  */
3172
- logprobs: import_v418.z.union([import_v418.z.boolean(), import_v418.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3302
+ logprobs: import_v419.z.union([import_v419.z.boolean(), import_v419.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
3173
3303
  /**
3174
3304
  * The maximum number of total calls to built-in tools that can be processed in a response.
3175
3305
  * This maximum number applies across all built-in tool calls, not per individual tool.
3176
3306
  * Any further attempts to call a tool by the model will be ignored.
3177
3307
  */
3178
- maxToolCalls: import_v418.z.number().nullish(),
3179
- metadata: import_v418.z.any().nullish(),
3180
- parallelToolCalls: import_v418.z.boolean().nullish(),
3181
- previousResponseId: import_v418.z.string().nullish(),
3182
- promptCacheKey: import_v418.z.string().nullish(),
3308
+ maxToolCalls: import_v419.z.number().nullish(),
3309
+ metadata: import_v419.z.any().nullish(),
3310
+ parallelToolCalls: import_v419.z.boolean().nullish(),
3311
+ previousResponseId: import_v419.z.string().nullish(),
3312
+ promptCacheKey: import_v419.z.string().nullish(),
3183
3313
  /**
3184
3314
  * The retention policy for the prompt cache.
3185
3315
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -3188,23 +3318,23 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils23.lazySchem
3188
3318
  *
3189
3319
  * @default 'in_memory'
3190
3320
  */
3191
- promptCacheRetention: import_v418.z.enum(["in_memory", "24h"]).nullish(),
3192
- reasoningEffort: import_v418.z.string().nullish(),
3193
- reasoningSummary: import_v418.z.string().nullish(),
3194
- safetyIdentifier: import_v418.z.string().nullish(),
3195
- serviceTier: import_v418.z.enum(["auto", "flex", "priority", "default"]).nullish(),
3196
- store: import_v418.z.boolean().nullish(),
3197
- strictJsonSchema: import_v418.z.boolean().nullish(),
3198
- textVerbosity: import_v418.z.enum(["low", "medium", "high"]).nullish(),
3199
- truncation: import_v418.z.enum(["auto", "disabled"]).nullish(),
3200
- user: import_v418.z.string().nullish()
3321
+ promptCacheRetention: import_v419.z.enum(["in_memory", "24h"]).nullish(),
3322
+ reasoningEffort: import_v419.z.string().nullish(),
3323
+ reasoningSummary: import_v419.z.string().nullish(),
3324
+ safetyIdentifier: import_v419.z.string().nullish(),
3325
+ serviceTier: import_v419.z.enum(["auto", "flex", "priority", "default"]).nullish(),
3326
+ store: import_v419.z.boolean().nullish(),
3327
+ strictJsonSchema: import_v419.z.boolean().nullish(),
3328
+ textVerbosity: import_v419.z.enum(["low", "medium", "high"]).nullish(),
3329
+ truncation: import_v419.z.enum(["auto", "disabled"]).nullish(),
3330
+ user: import_v419.z.string().nullish()
3201
3331
  })
3202
3332
  )
3203
3333
  );
3204
3334
 
3205
3335
  // src/responses/openai-responses-prepare-tools.ts
3206
3336
  var import_provider7 = require("@ai-sdk/provider");
3207
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
3337
+ var import_provider_utils25 = require("@ai-sdk/provider-utils");
3208
3338
  async function prepareResponsesTools({
3209
3339
  tools,
3210
3340
  toolChoice,
@@ -3227,10 +3357,10 @@ async function prepareResponsesTools({
3227
3357
  strict: strictJsonSchema
3228
3358
  });
3229
3359
  break;
3230
- case "provider-defined": {
3360
+ case "provider": {
3231
3361
  switch (tool.id) {
3232
3362
  case "openai.file_search": {
3233
- const args = await (0, import_provider_utils24.validateTypes)({
3363
+ const args = await (0, import_provider_utils25.validateTypes)({
3234
3364
  value: tool.args,
3235
3365
  schema: fileSearchArgsSchema
3236
3366
  });
@@ -3252,8 +3382,14 @@ async function prepareResponsesTools({
3252
3382
  });
3253
3383
  break;
3254
3384
  }
3385
+ case "openai.apply_patch": {
3386
+ openaiTools2.push({
3387
+ type: "apply_patch"
3388
+ });
3389
+ break;
3390
+ }
3255
3391
  case "openai.web_search_preview": {
3256
- const args = await (0, import_provider_utils24.validateTypes)({
3392
+ const args = await (0, import_provider_utils25.validateTypes)({
3257
3393
  value: tool.args,
3258
3394
  schema: webSearchPreviewArgsSchema
3259
3395
  });
@@ -3265,7 +3401,7 @@ async function prepareResponsesTools({
3265
3401
  break;
3266
3402
  }
3267
3403
  case "openai.web_search": {
3268
- const args = await (0, import_provider_utils24.validateTypes)({
3404
+ const args = await (0, import_provider_utils25.validateTypes)({
3269
3405
  value: tool.args,
3270
3406
  schema: webSearchArgsSchema
3271
3407
  });
@@ -3279,7 +3415,7 @@ async function prepareResponsesTools({
3279
3415
  break;
3280
3416
  }
3281
3417
  case "openai.code_interpreter": {
3282
- const args = await (0, import_provider_utils24.validateTypes)({
3418
+ const args = await (0, import_provider_utils25.validateTypes)({
3283
3419
  value: tool.args,
3284
3420
  schema: codeInterpreterArgsSchema
3285
3421
  });
@@ -3290,7 +3426,7 @@ async function prepareResponsesTools({
3290
3426
  break;
3291
3427
  }
3292
3428
  case "openai.image_generation": {
3293
- const args = await (0, import_provider_utils24.validateTypes)({
3429
+ const args = await (0, import_provider_utils25.validateTypes)({
3294
3430
  value: tool.args,
3295
3431
  schema: imageGenerationArgsSchema
3296
3432
  });
@@ -3313,7 +3449,7 @@ async function prepareResponsesTools({
3313
3449
  break;
3314
3450
  }
3315
3451
  case "openai.mcp": {
3316
- const args = await (0, import_provider_utils24.validateTypes)({
3452
+ const args = await (0, import_provider_utils25.validateTypes)({
3317
3453
  value: tool.args,
3318
3454
  schema: mcpArgsSchema
3319
3455
  });
@@ -3356,7 +3492,7 @@ async function prepareResponsesTools({
3356
3492
  case "tool":
3357
3493
  return {
3358
3494
  tools: openaiTools2,
3359
- toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
3495
+ toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" || toolChoice.toolName === "apply_patch" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
3360
3496
  toolWarnings
3361
3497
  };
3362
3498
  default: {
@@ -3415,7 +3551,7 @@ var OpenAIResponsesLanguageModel = class {
3415
3551
  if (stopSequences != null) {
3416
3552
  warnings.push({ type: "unsupported", feature: "stopSequences" });
3417
3553
  }
3418
- const openaiOptions = await (0, import_provider_utils25.parseProviderOptions)({
3554
+ const openaiOptions = await (0, import_provider_utils26.parseProviderOptions)({
3419
3555
  provider: "openai",
3420
3556
  providerOptions,
3421
3557
  schema: openaiResponsesProviderOptionsSchema
@@ -3427,7 +3563,7 @@ var OpenAIResponsesLanguageModel = class {
3427
3563
  details: "conversation and previousResponseId cannot be used together"
3428
3564
  });
3429
3565
  }
3430
- const toolNameMapping = (0, import_provider_utils25.createToolNameMapping)({
3566
+ const toolNameMapping = (0, import_provider_utils26.createToolNameMapping)({
3431
3567
  tools,
3432
3568
  providerToolNames: {
3433
3569
  "openai.code_interpreter": "code_interpreter",
@@ -3436,7 +3572,8 @@ var OpenAIResponsesLanguageModel = class {
3436
3572
  "openai.local_shell": "local_shell",
3437
3573
  "openai.web_search": "web_search",
3438
3574
  "openai.web_search_preview": "web_search_preview",
3439
- "openai.mcp": "mcp"
3575
+ "openai.mcp": "mcp",
3576
+ "openai.apply_patch": "apply_patch"
3440
3577
  }
3441
3578
  });
3442
3579
  const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
@@ -3445,7 +3582,8 @@ var OpenAIResponsesLanguageModel = class {
3445
3582
  systemMessageMode: modelConfig.systemMessageMode,
3446
3583
  fileIdPrefixes: this.config.fileIdPrefixes,
3447
3584
  store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
3448
- hasLocalShellTool: hasOpenAITool("openai.local_shell")
3585
+ hasLocalShellTool: hasOpenAITool("openai.local_shell"),
3586
+ hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
3449
3587
  });
3450
3588
  warnings.push(...inputWarnings);
3451
3589
  const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
@@ -3458,16 +3596,14 @@ var OpenAIResponsesLanguageModel = class {
3458
3596
  }
3459
3597
  }
3460
3598
  function hasOpenAITool(id) {
3461
- return (tools == null ? void 0 : tools.find(
3462
- (tool) => tool.type === "provider-defined" && tool.id === id
3463
- )) != null;
3599
+ return (tools == null ? void 0 : tools.find((tool) => tool.type === "provider" && tool.id === id)) != null;
3464
3600
  }
3465
3601
  const topLogprobs = typeof (openaiOptions == null ? void 0 : openaiOptions.logprobs) === "number" ? openaiOptions == null ? void 0 : openaiOptions.logprobs : (openaiOptions == null ? void 0 : openaiOptions.logprobs) === true ? TOP_LOGPROBS_MAX : void 0;
3466
3602
  if (topLogprobs) {
3467
3603
  addInclude("message.output_text.logprobs");
3468
3604
  }
3469
3605
  const webSearchToolName = (_c = tools == null ? void 0 : tools.find(
3470
- (tool) => tool.type === "provider-defined" && (tool.id === "openai.web_search" || tool.id === "openai.web_search_preview")
3606
+ (tool) => tool.type === "provider" && (tool.id === "openai.web_search" || tool.id === "openai.web_search_preview")
3471
3607
  )) == null ? void 0 : _c.name;
3472
3608
  if (webSearchToolName) {
3473
3609
  addInclude("web_search_call.action.sources");
@@ -3616,12 +3752,12 @@ var OpenAIResponsesLanguageModel = class {
3616
3752
  responseHeaders,
3617
3753
  value: response,
3618
3754
  rawValue: rawResponse
3619
- } = await (0, import_provider_utils25.postJsonToApi)({
3755
+ } = await (0, import_provider_utils26.postJsonToApi)({
3620
3756
  url,
3621
- headers: (0, import_provider_utils25.combineHeaders)(this.config.headers(), options.headers),
3757
+ headers: (0, import_provider_utils26.combineHeaders)(this.config.headers(), options.headers),
3622
3758
  body,
3623
3759
  failedResponseHandler: openaiFailedResponseHandler,
3624
- successfulResponseHandler: (0, import_provider_utils25.createJsonResponseHandler)(
3760
+ successfulResponseHandler: (0, import_provider_utils26.createJsonResponseHandler)(
3625
3761
  openaiResponsesResponseSchema
3626
3762
  ),
3627
3763
  abortSignal: options.abortSignal,
@@ -3718,7 +3854,7 @@ var OpenAIResponsesLanguageModel = class {
3718
3854
  content.push({
3719
3855
  type: "source",
3720
3856
  sourceType: "url",
3721
- id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils25.generateId)(),
3857
+ id: (_f = (_e = (_d = this.config).generateId) == null ? void 0 : _e.call(_d)) != null ? _f : (0, import_provider_utils26.generateId)(),
3722
3858
  url: annotation.url,
3723
3859
  title: annotation.title
3724
3860
  });
@@ -3726,7 +3862,7 @@ var OpenAIResponsesLanguageModel = class {
3726
3862
  content.push({
3727
3863
  type: "source",
3728
3864
  sourceType: "document",
3729
- id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils25.generateId)(),
3865
+ id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils26.generateId)(),
3730
3866
  mediaType: "text/plain",
3731
3867
  title: (_k = (_j = annotation.quote) != null ? _j : annotation.filename) != null ? _k : "Document",
3732
3868
  filename: (_l = annotation.filename) != null ? _l : annotation.file_id,
@@ -3742,7 +3878,7 @@ var OpenAIResponsesLanguageModel = class {
3742
3878
  content.push({
3743
3879
  type: "source",
3744
3880
  sourceType: "document",
3745
- id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils25.generateId)(),
3881
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils26.generateId)(),
3746
3882
  mediaType: "text/plain",
3747
3883
  title: (_q = (_p = annotation.filename) != null ? _p : annotation.file_id) != null ? _q : "Document",
3748
3884
  filename: (_r = annotation.filename) != null ? _r : annotation.file_id,
@@ -3758,7 +3894,7 @@ var OpenAIResponsesLanguageModel = class {
3758
3894
  content.push({
3759
3895
  type: "source",
3760
3896
  sourceType: "document",
3761
- id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0, import_provider_utils25.generateId)(),
3897
+ id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : (0, import_provider_utils26.generateId)(),
3762
3898
  mediaType: "application/octet-stream",
3763
3899
  title: annotation.file_id,
3764
3900
  filename: annotation.file_id,
@@ -3948,6 +4084,23 @@ var OpenAIResponsesLanguageModel = class {
3948
4084
  });
3949
4085
  break;
3950
4086
  }
4087
+ case "apply_patch_call": {
4088
+ content.push({
4089
+ type: "tool-call",
4090
+ toolCallId: part.call_id,
4091
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4092
+ input: JSON.stringify({
4093
+ callId: part.call_id,
4094
+ operation: part.operation
4095
+ }),
4096
+ providerMetadata: {
4097
+ [providerKey]: {
4098
+ itemId: part.id
4099
+ }
4100
+ }
4101
+ });
4102
+ break;
4103
+ }
3951
4104
  }
3952
4105
  }
3953
4106
  const providerMetadata = {
@@ -3993,18 +4146,18 @@ var OpenAIResponsesLanguageModel = class {
3993
4146
  toolNameMapping,
3994
4147
  store
3995
4148
  } = await this.getArgs(options);
3996
- const { responseHeaders, value: response } = await (0, import_provider_utils25.postJsonToApi)({
4149
+ const { responseHeaders, value: response } = await (0, import_provider_utils26.postJsonToApi)({
3997
4150
  url: this.config.url({
3998
4151
  path: "/responses",
3999
4152
  modelId: this.modelId
4000
4153
  }),
4001
- headers: (0, import_provider_utils25.combineHeaders)(this.config.headers(), options.headers),
4154
+ headers: (0, import_provider_utils26.combineHeaders)(this.config.headers(), options.headers),
4002
4155
  body: {
4003
4156
  ...body,
4004
4157
  stream: true
4005
4158
  },
4006
4159
  failedResponseHandler: openaiFailedResponseHandler,
4007
- successfulResponseHandler: (0, import_provider_utils25.createEventSourceResponseHandler)(
4160
+ successfulResponseHandler: (0, import_provider_utils26.createEventSourceResponseHandler)(
4008
4161
  openaiResponsesChunkSchema
4009
4162
  ),
4010
4163
  abortSignal: options.abortSignal,
@@ -4135,6 +4288,27 @@ var OpenAIResponsesLanguageModel = class {
4135
4288
  input: "{}",
4136
4289
  providerExecuted: true
4137
4290
  });
4291
+ } else if (value.item.type === "apply_patch_call") {
4292
+ ongoingToolCalls[value.output_index] = {
4293
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4294
+ toolCallId: value.item.call_id
4295
+ };
4296
+ if (value.item.status === "completed") {
4297
+ controller.enqueue({
4298
+ type: "tool-call",
4299
+ toolCallId: value.item.call_id,
4300
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4301
+ input: JSON.stringify({
4302
+ callId: value.item.call_id,
4303
+ operation: value.item.operation
4304
+ }),
4305
+ providerMetadata: {
4306
+ [providerKey]: {
4307
+ itemId: value.item.id
4308
+ }
4309
+ }
4310
+ });
4311
+ }
4138
4312
  } else if (value.item.type === "message") {
4139
4313
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
4140
4314
  controller.enqueue({
@@ -4298,6 +4472,24 @@ var OpenAIResponsesLanguageModel = class {
4298
4472
  ...value.item.error != null ? { error: value.item.error } : {}
4299
4473
  }
4300
4474
  });
4475
+ } else if (value.item.type === "apply_patch_call") {
4476
+ ongoingToolCalls[value.output_index] = void 0;
4477
+ if (value.item.status === "completed") {
4478
+ controller.enqueue({
4479
+ type: "tool-call",
4480
+ toolCallId: value.item.call_id,
4481
+ toolName: toolNameMapping.toCustomToolName("apply_patch"),
4482
+ input: JSON.stringify({
4483
+ callId: value.item.call_id,
4484
+ operation: value.item.operation
4485
+ }),
4486
+ providerMetadata: {
4487
+ [providerKey]: {
4488
+ itemId: value.item.id
4489
+ }
4490
+ }
4491
+ });
4492
+ }
4301
4493
  } else if (value.item.type === "mcp_approval_request") {
4302
4494
  ongoingToolCalls[value.output_index] = void 0;
4303
4495
  controller.enqueue({
@@ -4495,7 +4687,7 @@ var OpenAIResponsesLanguageModel = class {
4495
4687
  controller.enqueue({
4496
4688
  type: "source",
4497
4689
  sourceType: "url",
4498
- id: (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : (0, import_provider_utils25.generateId)(),
4690
+ id: (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : (0, import_provider_utils26.generateId)(),
4499
4691
  url: value.annotation.url,
4500
4692
  title: value.annotation.title
4501
4693
  });
@@ -4503,7 +4695,7 @@ var OpenAIResponsesLanguageModel = class {
4503
4695
  controller.enqueue({
4504
4696
  type: "source",
4505
4697
  sourceType: "document",
4506
- id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : (0, import_provider_utils25.generateId)(),
4698
+ id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : (0, import_provider_utils26.generateId)(),
4507
4699
  mediaType: "text/plain",
4508
4700
  title: (_u = (_t = value.annotation.quote) != null ? _t : value.annotation.filename) != null ? _u : "Document",
4509
4701
  filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id,
@@ -4519,7 +4711,7 @@ var OpenAIResponsesLanguageModel = class {
4519
4711
  controller.enqueue({
4520
4712
  type: "source",
4521
4713
  sourceType: "document",
4522
- id: (_y = (_x = (_w = self.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : (0, import_provider_utils25.generateId)(),
4714
+ id: (_y = (_x = (_w = self.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : (0, import_provider_utils26.generateId)(),
4523
4715
  mediaType: "text/plain",
4524
4716
  title: (_A = (_z = value.annotation.filename) != null ? _z : value.annotation.file_id) != null ? _A : "Document",
4525
4717
  filename: (_B = value.annotation.filename) != null ? _B : value.annotation.file_id,
@@ -4535,7 +4727,7 @@ var OpenAIResponsesLanguageModel = class {
4535
4727
  controller.enqueue({
4536
4728
  type: "source",
4537
4729
  sourceType: "document",
4538
- id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : (0, import_provider_utils25.generateId)(),
4730
+ id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : (0, import_provider_utils26.generateId)(),
4539
4731
  mediaType: "application/octet-stream",
4540
4732
  title: value.annotation.file_id,
4541
4733
  filename: value.annotation.file_id,
@@ -4641,16 +4833,16 @@ function mapWebSearchOutput(action) {
4641
4833
  }
4642
4834
 
4643
4835
  // src/speech/openai-speech-model.ts
4644
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
4836
+ var import_provider_utils28 = require("@ai-sdk/provider-utils");
4645
4837
 
4646
4838
  // src/speech/openai-speech-options.ts
4647
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
4648
- var import_v419 = require("zod/v4");
4649
- var openaiSpeechProviderOptionsSchema = (0, import_provider_utils26.lazySchema)(
4650
- () => (0, import_provider_utils26.zodSchema)(
4651
- import_v419.z.object({
4652
- instructions: import_v419.z.string().nullish(),
4653
- speed: import_v419.z.number().min(0.25).max(4).default(1).nullish()
4839
+ var import_provider_utils27 = require("@ai-sdk/provider-utils");
4840
+ var import_v420 = require("zod/v4");
4841
+ var openaiSpeechProviderOptionsSchema = (0, import_provider_utils27.lazySchema)(
4842
+ () => (0, import_provider_utils27.zodSchema)(
4843
+ import_v420.z.object({
4844
+ instructions: import_v420.z.string().nullish(),
4845
+ speed: import_v420.z.number().min(0.25).max(4).default(1).nullish()
4654
4846
  })
4655
4847
  )
4656
4848
  );
@@ -4675,7 +4867,7 @@ var OpenAISpeechModel = class {
4675
4867
  providerOptions
4676
4868
  }) {
4677
4869
  const warnings = [];
4678
- const openAIOptions = await (0, import_provider_utils27.parseProviderOptions)({
4870
+ const openAIOptions = await (0, import_provider_utils28.parseProviderOptions)({
4679
4871
  provider: "openai",
4680
4872
  providerOptions,
4681
4873
  schema: openaiSpeechProviderOptionsSchema
@@ -4728,15 +4920,15 @@ var OpenAISpeechModel = class {
4728
4920
  value: audio,
4729
4921
  responseHeaders,
4730
4922
  rawValue: rawResponse
4731
- } = await (0, import_provider_utils27.postJsonToApi)({
4923
+ } = await (0, import_provider_utils28.postJsonToApi)({
4732
4924
  url: this.config.url({
4733
4925
  path: "/audio/speech",
4734
4926
  modelId: this.modelId
4735
4927
  }),
4736
- headers: (0, import_provider_utils27.combineHeaders)(this.config.headers(), options.headers),
4928
+ headers: (0, import_provider_utils28.combineHeaders)(this.config.headers(), options.headers),
4737
4929
  body: requestBody,
4738
4930
  failedResponseHandler: openaiFailedResponseHandler,
4739
- successfulResponseHandler: (0, import_provider_utils27.createBinaryResponseHandler)(),
4931
+ successfulResponseHandler: (0, import_provider_utils28.createBinaryResponseHandler)(),
4740
4932
  abortSignal: options.abortSignal,
4741
4933
  fetch: this.config.fetch
4742
4934
  });
@@ -4757,36 +4949,36 @@ var OpenAISpeechModel = class {
4757
4949
  };
4758
4950
 
4759
4951
  // src/transcription/openai-transcription-model.ts
4760
- var import_provider_utils30 = require("@ai-sdk/provider-utils");
4952
+ var import_provider_utils31 = require("@ai-sdk/provider-utils");
4761
4953
 
4762
4954
  // src/transcription/openai-transcription-api.ts
4763
- var import_provider_utils28 = require("@ai-sdk/provider-utils");
4764
- var import_v420 = require("zod/v4");
4765
- var openaiTranscriptionResponseSchema = (0, import_provider_utils28.lazySchema)(
4766
- () => (0, import_provider_utils28.zodSchema)(
4767
- import_v420.z.object({
4768
- text: import_v420.z.string(),
4769
- language: import_v420.z.string().nullish(),
4770
- duration: import_v420.z.number().nullish(),
4771
- words: import_v420.z.array(
4772
- import_v420.z.object({
4773
- word: import_v420.z.string(),
4774
- start: import_v420.z.number(),
4775
- end: import_v420.z.number()
4955
+ var import_provider_utils29 = require("@ai-sdk/provider-utils");
4956
+ var import_v421 = require("zod/v4");
4957
+ var openaiTranscriptionResponseSchema = (0, import_provider_utils29.lazySchema)(
4958
+ () => (0, import_provider_utils29.zodSchema)(
4959
+ import_v421.z.object({
4960
+ text: import_v421.z.string(),
4961
+ language: import_v421.z.string().nullish(),
4962
+ duration: import_v421.z.number().nullish(),
4963
+ words: import_v421.z.array(
4964
+ import_v421.z.object({
4965
+ word: import_v421.z.string(),
4966
+ start: import_v421.z.number(),
4967
+ end: import_v421.z.number()
4776
4968
  })
4777
4969
  ).nullish(),
4778
- segments: import_v420.z.array(
4779
- import_v420.z.object({
4780
- id: import_v420.z.number(),
4781
- seek: import_v420.z.number(),
4782
- start: import_v420.z.number(),
4783
- end: import_v420.z.number(),
4784
- text: import_v420.z.string(),
4785
- tokens: import_v420.z.array(import_v420.z.number()),
4786
- temperature: import_v420.z.number(),
4787
- avg_logprob: import_v420.z.number(),
4788
- compression_ratio: import_v420.z.number(),
4789
- no_speech_prob: import_v420.z.number()
4970
+ segments: import_v421.z.array(
4971
+ import_v421.z.object({
4972
+ id: import_v421.z.number(),
4973
+ seek: import_v421.z.number(),
4974
+ start: import_v421.z.number(),
4975
+ end: import_v421.z.number(),
4976
+ text: import_v421.z.string(),
4977
+ tokens: import_v421.z.array(import_v421.z.number()),
4978
+ temperature: import_v421.z.number(),
4979
+ avg_logprob: import_v421.z.number(),
4980
+ compression_ratio: import_v421.z.number(),
4981
+ no_speech_prob: import_v421.z.number()
4790
4982
  })
4791
4983
  ).nullish()
4792
4984
  })
@@ -4794,33 +4986,33 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils28.lazySchema)(
4794
4986
  );
4795
4987
 
4796
4988
  // src/transcription/openai-transcription-options.ts
4797
- var import_provider_utils29 = require("@ai-sdk/provider-utils");
4798
- var import_v421 = require("zod/v4");
4799
- var openAITranscriptionProviderOptions = (0, import_provider_utils29.lazySchema)(
4800
- () => (0, import_provider_utils29.zodSchema)(
4801
- import_v421.z.object({
4989
+ var import_provider_utils30 = require("@ai-sdk/provider-utils");
4990
+ var import_v422 = require("zod/v4");
4991
+ var openAITranscriptionProviderOptions = (0, import_provider_utils30.lazySchema)(
4992
+ () => (0, import_provider_utils30.zodSchema)(
4993
+ import_v422.z.object({
4802
4994
  /**
4803
4995
  * Additional information to include in the transcription response.
4804
4996
  */
4805
- include: import_v421.z.array(import_v421.z.string()).optional(),
4997
+ include: import_v422.z.array(import_v422.z.string()).optional(),
4806
4998
  /**
4807
4999
  * The language of the input audio in ISO-639-1 format.
4808
5000
  */
4809
- language: import_v421.z.string().optional(),
5001
+ language: import_v422.z.string().optional(),
4810
5002
  /**
4811
5003
  * An optional text to guide the model's style or continue a previous audio segment.
4812
5004
  */
4813
- prompt: import_v421.z.string().optional(),
5005
+ prompt: import_v422.z.string().optional(),
4814
5006
  /**
4815
5007
  * The sampling temperature, between 0 and 1.
4816
5008
  * @default 0
4817
5009
  */
4818
- temperature: import_v421.z.number().min(0).max(1).default(0).optional(),
5010
+ temperature: import_v422.z.number().min(0).max(1).default(0).optional(),
4819
5011
  /**
4820
5012
  * The timestamp granularities to populate for this transcription.
4821
5013
  * @default ['segment']
4822
5014
  */
4823
- timestampGranularities: import_v421.z.array(import_v421.z.enum(["word", "segment"])).default(["segment"]).optional()
5015
+ timestampGranularities: import_v422.z.array(import_v422.z.enum(["word", "segment"])).default(["segment"]).optional()
4824
5016
  })
4825
5017
  )
4826
5018
  );
@@ -4900,15 +5092,15 @@ var OpenAITranscriptionModel = class {
4900
5092
  providerOptions
4901
5093
  }) {
4902
5094
  const warnings = [];
4903
- const openAIOptions = await (0, import_provider_utils30.parseProviderOptions)({
5095
+ const openAIOptions = await (0, import_provider_utils31.parseProviderOptions)({
4904
5096
  provider: "openai",
4905
5097
  providerOptions,
4906
5098
  schema: openAITranscriptionProviderOptions
4907
5099
  });
4908
5100
  const formData = new FormData();
4909
- const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils30.convertBase64ToUint8Array)(audio)]);
5101
+ const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils31.convertBase64ToUint8Array)(audio)]);
4910
5102
  formData.append("model", this.modelId);
4911
- const fileExtension = (0, import_provider_utils30.mediaTypeToExtension)(mediaType);
5103
+ const fileExtension = (0, import_provider_utils31.mediaTypeToExtension)(mediaType);
4912
5104
  formData.append(
4913
5105
  "file",
4914
5106
  new File([blob], "audio", { type: mediaType }),
@@ -4953,15 +5145,15 @@ var OpenAITranscriptionModel = class {
4953
5145
  value: response,
4954
5146
  responseHeaders,
4955
5147
  rawValue: rawResponse
4956
- } = await (0, import_provider_utils30.postFormDataToApi)({
5148
+ } = await (0, import_provider_utils31.postFormDataToApi)({
4957
5149
  url: this.config.url({
4958
5150
  path: "/audio/transcriptions",
4959
5151
  modelId: this.modelId
4960
5152
  }),
4961
- headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
5153
+ headers: (0, import_provider_utils31.combineHeaders)(this.config.headers(), options.headers),
4962
5154
  formData,
4963
5155
  failedResponseHandler: openaiFailedResponseHandler,
4964
- successfulResponseHandler: (0, import_provider_utils30.createJsonResponseHandler)(
5156
+ successfulResponseHandler: (0, import_provider_utils31.createJsonResponseHandler)(
4965
5157
  openaiTranscriptionResponseSchema
4966
5158
  ),
4967
5159
  abortSignal: options.abortSignal,
@@ -4993,21 +5185,21 @@ var OpenAITranscriptionModel = class {
4993
5185
  };
4994
5186
 
4995
5187
  // src/version.ts
4996
- var VERSION = true ? "3.0.0-beta.72" : "0.0.0-test";
5188
+ var VERSION = true ? "3.0.0-beta.74" : "0.0.0-test";
4997
5189
 
4998
5190
  // src/openai-provider.ts
4999
5191
  function createOpenAI(options = {}) {
5000
5192
  var _a, _b;
5001
- const baseURL = (_a = (0, import_provider_utils31.withoutTrailingSlash)(
5002
- (0, import_provider_utils31.loadOptionalSetting)({
5193
+ const baseURL = (_a = (0, import_provider_utils32.withoutTrailingSlash)(
5194
+ (0, import_provider_utils32.loadOptionalSetting)({
5003
5195
  settingValue: options.baseURL,
5004
5196
  environmentVariableName: "OPENAI_BASE_URL"
5005
5197
  })
5006
5198
  )) != null ? _a : "https://api.openai.com/v1";
5007
5199
  const providerName = (_b = options.name) != null ? _b : "openai";
5008
- const getHeaders = () => (0, import_provider_utils31.withUserAgentSuffix)(
5200
+ const getHeaders = () => (0, import_provider_utils32.withUserAgentSuffix)(
5009
5201
  {
5010
- Authorization: `Bearer ${(0, import_provider_utils31.loadApiKey)({
5202
+ Authorization: `Bearer ${(0, import_provider_utils32.loadApiKey)({
5011
5203
  apiKey: options.apiKey,
5012
5204
  environmentVariableName: "OPENAI_API_KEY",
5013
5205
  description: "OpenAI"