@ai-sdk/gateway 3.0.218 → 3.0.220

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1128,7 +1128,7 @@ var GatewayEmbeddingModel = class {
1128
1128
  };
1129
1129
  }
1130
1130
  };
1131
- var gatewayEmbeddingWarningSchema = z9.discriminatedUnion("type", [
1131
+ var gatewayEmbeddingWarningSchema = () => z9.discriminatedUnion("type", [
1132
1132
  z9.object({
1133
1133
  type: z9.literal("unsupported"),
1134
1134
  feature: z9.string(),
@@ -1149,7 +1149,7 @@ var gatewayEmbeddingResponseSchema = lazySchema8(
1149
1149
  z9.object({
1150
1150
  embeddings: z9.array(z9.array(z9.number())),
1151
1151
  usage: z9.object({ tokens: z9.number() }).nullish(),
1152
- warnings: z9.array(gatewayEmbeddingWarningSchema).optional(),
1152
+ warnings: z9.array(gatewayEmbeddingWarningSchema()).optional(),
1153
1153
  providerMetadata: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())).optional()
1154
1154
  })
1155
1155
  )
@@ -1157,6 +1157,8 @@ var gatewayEmbeddingResponseSchema = lazySchema8(
1157
1157
 
1158
1158
  // src/gateway-image-model.ts
1159
1159
  import {
1160
+ lazySchema as lazySchema9,
1161
+ zodSchema as zodSchema9,
1160
1162
  combineHeaders as combineHeaders3,
1161
1163
  convertUint8ArrayToBase64,
1162
1164
  createJsonErrorResponseHandler as createJsonErrorResponseHandler6,
@@ -1282,10 +1284,10 @@ function maybeEncodeImageFile(file) {
1282
1284
  }
1283
1285
  return file;
1284
1286
  }
1285
- var providerMetadataEntrySchema = z10.object({
1287
+ var providerMetadataEntrySchema = () => z10.object({
1286
1288
  images: z10.array(z10.unknown()).optional()
1287
1289
  }).catchall(z10.unknown());
1288
- var gatewayImageWarningSchema = z10.discriminatedUnion("type", [
1290
+ var gatewayImageWarningSchema = () => z10.discriminatedUnion("type", [
1289
1291
  z10.object({
1290
1292
  type: z10.literal("unsupported"),
1291
1293
  feature: z10.string(),
@@ -1306,25 +1308,31 @@ var gatewayImageWarningSchema = z10.discriminatedUnion("type", [
1306
1308
  message: z10.string()
1307
1309
  })
1308
1310
  ]);
1309
- var gatewayImageUsageSchema = z10.object({
1311
+ var gatewayImageUsageSchema = () => z10.object({
1310
1312
  inputTokens: z10.number().nullish(),
1311
1313
  outputTokens: z10.number().nullish(),
1312
1314
  totalTokens: z10.number().nullish()
1313
1315
  });
1314
- var gatewayImageResponseSchema = z10.object({
1315
- images: z10.array(z10.string()),
1316
- // Always base64 strings over the wire
1317
- isRetryable: z10.boolean().optional(),
1318
- warnings: z10.array(gatewayImageWarningSchema).optional(),
1319
- providerMetadata: z10.record(z10.string(), providerMetadataEntrySchema).optional(),
1320
- usage: gatewayImageUsageSchema.optional()
1321
- });
1316
+ var gatewayImageResponseSchema = lazySchema9(
1317
+ () => zodSchema9(
1318
+ z10.object({
1319
+ images: z10.array(z10.string()),
1320
+ // Always base64 strings over the wire
1321
+ isRetryable: z10.boolean().optional(),
1322
+ warnings: z10.array(gatewayImageWarningSchema()).optional(),
1323
+ providerMetadata: z10.record(z10.string(), providerMetadataEntrySchema()).optional(),
1324
+ usage: gatewayImageUsageSchema().optional()
1325
+ })
1326
+ )
1327
+ );
1322
1328
 
1323
1329
  // src/gateway-video-model.ts
1324
1330
  import {
1325
1331
  APICallError as APICallError2
1326
1332
  } from "@ai-sdk/provider";
1327
1333
  import {
1334
+ lazySchema as lazySchema10,
1335
+ zodSchema as zodSchema10,
1328
1336
  combineHeaders as combineHeaders4,
1329
1337
  convertUint8ArrayToBase64 as convertUint8ArrayToBase642,
1330
1338
  createJsonErrorResponseHandler as createJsonErrorResponseHandler7,
@@ -1502,10 +1510,10 @@ function maybeEncodeVideoFile(file) {
1502
1510
  }
1503
1511
  return file;
1504
1512
  }
1505
- var providerMetadataEntrySchema2 = z11.object({
1513
+ var providerMetadataEntrySchema2 = () => z11.object({
1506
1514
  videos: z11.array(z11.unknown()).optional()
1507
1515
  }).catchall(z11.unknown());
1508
- var gatewayVideoDataSchema = z11.union([
1516
+ var gatewayVideoDataSchema = () => z11.union([
1509
1517
  z11.object({
1510
1518
  type: z11.literal("url"),
1511
1519
  url: z11.string(),
@@ -1517,7 +1525,7 @@ var gatewayVideoDataSchema = z11.union([
1517
1525
  mediaType: z11.string()
1518
1526
  })
1519
1527
  ]);
1520
- var gatewayVideoWarningSchema = z11.discriminatedUnion("type", [
1528
+ var gatewayVideoWarningSchema = () => z11.discriminatedUnion("type", [
1521
1529
  z11.object({
1522
1530
  type: z11.literal("unsupported"),
1523
1531
  feature: z11.string(),
@@ -1538,21 +1546,25 @@ var gatewayVideoWarningSchema = z11.discriminatedUnion("type", [
1538
1546
  message: z11.string()
1539
1547
  })
1540
1548
  ]);
1541
- var gatewayVideoEventSchema = z11.discriminatedUnion("type", [
1542
- z11.object({
1543
- type: z11.literal("result"),
1544
- videos: z11.array(gatewayVideoDataSchema),
1545
- warnings: z11.array(gatewayVideoWarningSchema).optional(),
1546
- providerMetadata: z11.record(z11.string(), providerMetadataEntrySchema2).optional()
1547
- }),
1548
- z11.object({
1549
- type: z11.literal("error"),
1550
- message: z11.string(),
1551
- errorType: z11.string(),
1552
- statusCode: z11.number(),
1553
- param: z11.unknown().nullable()
1554
- })
1555
- ]);
1549
+ var gatewayVideoEventSchema = lazySchema10(
1550
+ () => zodSchema10(
1551
+ z11.discriminatedUnion("type", [
1552
+ z11.object({
1553
+ type: z11.literal("result"),
1554
+ videos: z11.array(gatewayVideoDataSchema()),
1555
+ warnings: z11.array(gatewayVideoWarningSchema()).optional(),
1556
+ providerMetadata: z11.record(z11.string(), providerMetadataEntrySchema2()).optional()
1557
+ }),
1558
+ z11.object({
1559
+ type: z11.literal("error"),
1560
+ message: z11.string(),
1561
+ errorType: z11.string(),
1562
+ statusCode: z11.number(),
1563
+ param: z11.unknown().nullable()
1564
+ })
1565
+ ])
1566
+ )
1567
+ );
1556
1568
 
1557
1569
  // src/gateway-reranking-model.ts
1558
1570
  import {
@@ -1560,10 +1572,10 @@ import {
1560
1572
  createJsonErrorResponseHandler as createJsonErrorResponseHandler8,
1561
1573
  createJsonResponseHandler as createJsonResponseHandler7,
1562
1574
  getErrorMessage as getErrorMessage8,
1563
- lazySchema as lazySchema9,
1575
+ lazySchema as lazySchema11,
1564
1576
  postJsonToApi as postJsonToApi5,
1565
1577
  resolve as resolve8,
1566
- zodSchema as zodSchema9
1578
+ zodSchema as zodSchema11
1567
1579
  } from "@ai-sdk/provider-utils";
1568
1580
  import { z as z12 } from "zod/v4";
1569
1581
  var GatewayRerankingModel = class {
@@ -1637,7 +1649,7 @@ var GatewayRerankingModel = class {
1637
1649
  };
1638
1650
  }
1639
1651
  };
1640
- var gatewayRerankingWarningSchema = z12.discriminatedUnion("type", [
1652
+ var gatewayRerankingWarningSchema = () => z12.discriminatedUnion("type", [
1641
1653
  z12.object({
1642
1654
  type: z12.literal("unsupported"),
1643
1655
  feature: z12.string(),
@@ -1653,8 +1665,8 @@ var gatewayRerankingWarningSchema = z12.discriminatedUnion("type", [
1653
1665
  message: z12.string()
1654
1666
  })
1655
1667
  ]);
1656
- var gatewayRerankingResponseSchema = lazySchema9(
1657
- () => zodSchema9(
1668
+ var gatewayRerankingResponseSchema = lazySchema11(
1669
+ () => zodSchema11(
1658
1670
  z12.object({
1659
1671
  ranking: z12.array(
1660
1672
  z12.object({
@@ -1662,7 +1674,7 @@ var gatewayRerankingResponseSchema = lazySchema9(
1662
1674
  relevanceScore: z12.number()
1663
1675
  })
1664
1676
  ),
1665
- warnings: z12.array(gatewayRerankingWarningSchema).optional(),
1677
+ warnings: z12.array(gatewayRerankingWarningSchema()).optional(),
1666
1678
  providerMetadata: z12.record(z12.string(), z12.record(z12.string(), z12.unknown())).optional()
1667
1679
  })
1668
1680
  )
@@ -1670,6 +1682,8 @@ var gatewayRerankingResponseSchema = lazySchema9(
1670
1682
 
1671
1683
  // src/gateway-speech-model.ts
1672
1684
  import {
1685
+ lazySchema as lazySchema12,
1686
+ zodSchema as zodSchema12,
1673
1687
  combineHeaders as combineHeaders6,
1674
1688
  createJsonErrorResponseHandler as createJsonErrorResponseHandler9,
1675
1689
  createJsonResponseHandler as createJsonResponseHandler8,
@@ -1762,8 +1776,8 @@ var GatewaySpeechModel = class {
1762
1776
  };
1763
1777
  }
1764
1778
  };
1765
- var providerMetadataEntrySchema3 = z13.object({}).catchall(z13.unknown());
1766
- var gatewaySpeechWarningSchema = z13.discriminatedUnion("type", [
1779
+ var providerMetadataEntrySchema3 = () => z13.object({}).catchall(z13.unknown());
1780
+ var gatewaySpeechWarningSchema = () => z13.discriminatedUnion("type", [
1767
1781
  z13.object({
1768
1782
  type: z13.literal("unsupported"),
1769
1783
  feature: z13.string(),
@@ -1784,14 +1798,20 @@ var gatewaySpeechWarningSchema = z13.discriminatedUnion("type", [
1784
1798
  message: z13.string()
1785
1799
  })
1786
1800
  ]);
1787
- var gatewaySpeechResponseSchema = z13.object({
1788
- audio: z13.string(),
1789
- warnings: z13.array(gatewaySpeechWarningSchema).optional(),
1790
- providerMetadata: z13.record(z13.string(), providerMetadataEntrySchema3).optional()
1791
- });
1801
+ var gatewaySpeechResponseSchema = lazySchema12(
1802
+ () => zodSchema12(
1803
+ z13.object({
1804
+ audio: z13.string(),
1805
+ warnings: z13.array(gatewaySpeechWarningSchema()).optional(),
1806
+ providerMetadata: z13.record(z13.string(), providerMetadataEntrySchema3()).optional()
1807
+ })
1808
+ )
1809
+ );
1792
1810
 
1793
1811
  // src/gateway-transcription-model.ts
1794
1812
  import {
1813
+ lazySchema as lazySchema13,
1814
+ zodSchema as zodSchema13,
1795
1815
  combineHeaders as combineHeaders7,
1796
1816
  convertUint8ArrayToBase64 as convertUint8ArrayToBase643,
1797
1817
  createJsonErrorResponseHandler as createJsonErrorResponseHandler10,
@@ -1881,8 +1901,8 @@ var GatewayTranscriptionModel = class {
1881
1901
  };
1882
1902
  }
1883
1903
  };
1884
- var providerMetadataEntrySchema4 = z14.object({}).catchall(z14.unknown());
1885
- var gatewayTranscriptionWarningSchema = z14.discriminatedUnion("type", [
1904
+ var providerMetadataEntrySchema4 = () => z14.object({}).catchall(z14.unknown());
1905
+ var gatewayTranscriptionWarningSchema = () => z14.discriminatedUnion("type", [
1886
1906
  z14.object({
1887
1907
  type: z14.literal("unsupported"),
1888
1908
  feature: z14.string(),
@@ -1903,31 +1923,35 @@ var gatewayTranscriptionWarningSchema = z14.discriminatedUnion("type", [
1903
1923
  message: z14.string()
1904
1924
  })
1905
1925
  ]);
1906
- var gatewayTranscriptionResponseSchema = z14.object({
1907
- text: z14.string(),
1908
- segments: z14.array(
1926
+ var gatewayTranscriptionResponseSchema = lazySchema13(
1927
+ () => zodSchema13(
1909
1928
  z14.object({
1910
1929
  text: z14.string(),
1911
- startSecond: z14.number(),
1912
- endSecond: z14.number()
1930
+ segments: z14.array(
1931
+ z14.object({
1932
+ text: z14.string(),
1933
+ startSecond: z14.number(),
1934
+ endSecond: z14.number()
1935
+ })
1936
+ ).optional(),
1937
+ language: z14.string().nullish(),
1938
+ durationInSeconds: z14.number().nullish(),
1939
+ warnings: z14.array(gatewayTranscriptionWarningSchema()).optional(),
1940
+ providerMetadata: z14.record(z14.string(), providerMetadataEntrySchema4()).optional()
1913
1941
  })
1914
- ).optional(),
1915
- language: z14.string().nullish(),
1916
- durationInSeconds: z14.number().nullish(),
1917
- warnings: z14.array(gatewayTranscriptionWarningSchema).optional(),
1918
- providerMetadata: z14.record(z14.string(), providerMetadataEntrySchema4).optional()
1919
- });
1942
+ )
1943
+ );
1920
1944
 
1921
1945
  // src/tool/browserbase-fetch.ts
1922
1946
  import {
1923
1947
  createProviderToolFactoryWithOutputSchema,
1924
- lazySchema as lazySchema10,
1925
- zodSchema as zodSchema10
1948
+ lazySchema as lazySchema14,
1949
+ zodSchema as zodSchema14
1926
1950
  } from "@ai-sdk/provider-utils";
1927
1951
  import { z as z15 } from "zod";
1928
- var jsonObjectSchema = z15.record(z15.string(), z15.unknown());
1929
- var browserbaseFetchInputSchema = lazySchema10(
1930
- () => zodSchema10(
1952
+ var jsonObjectSchema = () => z15.record(z15.string(), z15.unknown());
1953
+ var browserbaseFetchInputSchema = lazySchema14(
1954
+ () => zodSchema14(
1931
1955
  z15.object({
1932
1956
  url: z15.string().url().describe("URL of the page to fetch."),
1933
1957
  allow_redirects: z15.boolean().optional().describe("Whether to follow HTTP redirects (default: false)."),
@@ -1940,18 +1964,18 @@ var browserbaseFetchInputSchema = lazySchema10(
1940
1964
  format: z15.enum(["raw", "json", "markdown"]).optional().describe(
1941
1965
  "Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema."
1942
1966
  ),
1943
- schema: jsonObjectSchema.optional().describe(
1967
+ schema: jsonObjectSchema().optional().describe(
1944
1968
  "JSON Schema for structured extraction. Only use with format set to json."
1945
1969
  )
1946
1970
  })
1947
1971
  )
1948
1972
  );
1949
- var browserbaseFetchOutputSchema = lazySchema10(
1950
- () => zodSchema10(
1973
+ var browserbaseFetchOutputSchema = lazySchema14(
1974
+ () => zodSchema14(
1951
1975
  z15.union([
1952
1976
  z15.object({
1953
1977
  id: z15.string(),
1954
- content: z15.union([z15.string(), jsonObjectSchema]),
1978
+ content: z15.union([z15.string(), jsonObjectSchema()]),
1955
1979
  contentType: z15.string(),
1956
1980
  encoding: z15.string(),
1957
1981
  headers: z15.record(z15.string(), z15.string()),
@@ -1983,20 +2007,20 @@ var browserbaseFetch = (config = {}) => browserbaseFetchToolFactory(config);
1983
2007
  // src/tool/browserbase-search.ts
1984
2008
  import {
1985
2009
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
1986
- lazySchema as lazySchema11,
1987
- zodSchema as zodSchema11
2010
+ lazySchema as lazySchema15,
2011
+ zodSchema as zodSchema15
1988
2012
  } from "@ai-sdk/provider-utils";
1989
2013
  import { z as z16 } from "zod";
1990
- var browserbaseSearchInputSchema = lazySchema11(
1991
- () => zodSchema11(
2014
+ var browserbaseSearchInputSchema = lazySchema15(
2015
+ () => zodSchema15(
1992
2016
  z16.object({
1993
2017
  query: z16.string().min(1).max(200).describe("Web search query. Must be between 1 and 200 characters."),
1994
2018
  num_results: z16.number().int().min(1).max(25).optional().describe("Maximum number of results to return (1-25, default: 10).")
1995
2019
  })
1996
2020
  )
1997
2021
  );
1998
- var browserbaseSearchOutputSchema = lazySchema11(
1999
- () => zodSchema11(
2022
+ var browserbaseSearchOutputSchema = lazySchema15(
2023
+ () => zodSchema15(
2000
2024
  z16.union([
2001
2025
  z16.object({
2002
2026
  query: z16.string(),
@@ -2039,12 +2063,12 @@ var browserbaseSearch = (config = {}) => browserbaseSearchToolFactory(config);
2039
2063
  // src/tool/exa-search.ts
2040
2064
  import {
2041
2065
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
2042
- lazySchema as lazySchema12,
2043
- zodSchema as zodSchema12
2066
+ lazySchema as lazySchema16,
2067
+ zodSchema as zodSchema16
2044
2068
  } from "@ai-sdk/provider-utils";
2045
2069
  import { z as z17 } from "zod";
2046
- var exaSearchInputSchema = lazySchema12(
2047
- () => zodSchema12(
2070
+ var exaSearchInputSchema = lazySchema16(
2071
+ () => zodSchema16(
2048
2072
  z17.object({
2049
2073
  query: z17.string().describe("Natural-language web search query. This is required."),
2050
2074
  type: z17.enum(["auto", "fast", "instant"]).optional().describe(
@@ -2114,8 +2138,8 @@ var exaSearchInputSchema = lazySchema12(
2114
2138
  })
2115
2139
  )
2116
2140
  );
2117
- var exaSearchOutputSchema = lazySchema12(
2118
- () => zodSchema12(
2141
+ var exaSearchOutputSchema = lazySchema16(
2142
+ () => zodSchema16(
2119
2143
  z17.union([
2120
2144
  z17.object({
2121
2145
  requestId: z17.string(),
@@ -2172,75 +2196,104 @@ var exaSearch = (config = {}) => exaSearchToolFactory(config);
2172
2196
  // src/tool/parallel-search.ts
2173
2197
  import {
2174
2198
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2175
- lazySchema as lazySchema13,
2176
- zodSchema as zodSchema13
2199
+ lazySchema as lazySchema17,
2200
+ zodSchema as zodSchema17
2177
2201
  } from "@ai-sdk/provider-utils";
2178
2202
  import { z as z18 } from "zod";
2179
- var parallelSearchInputSchema = lazySchema13(
2180
- () => zodSchema13(
2203
+ var parallelSearchModes = [
2204
+ "turbo",
2205
+ "fast",
2206
+ "basic",
2207
+ "advanced",
2208
+ "one-shot",
2209
+ "agentic"
2210
+ ];
2211
+ var parallelSearchInputSchema = lazySchema17(
2212
+ () => zodSchema17(
2181
2213
  z18.object({
2182
2214
  objective: z18.string().describe(
2183
2215
  "Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
2184
2216
  ),
2185
2217
  search_queries: z18.array(z18.string()).optional().describe(
2186
- "Optional search queries to supplement the objective. Maximum 200 characters per query."
2218
+ "Provide 2-3 concise keyword queries, 3-6 words each (max 5, 200 chars each). Strongly recommended; the search runs on these queries."
2187
2219
  ),
2188
- mode: z18.enum(["one-shot", "agentic"]).optional().describe(
2189
- 'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
2220
+ mode: z18.enum(parallelSearchModes).optional().describe(
2221
+ 'Search mode: "turbo" and "fast" return quickly with shorter excerpts, "basic" is balanced (default), "advanced" is the most thorough. "turbo" supports English and Japanese only. "one-shot" and "agentic" are deprecated aliases of "basic" and "advanced".'
2190
2222
  ),
2191
2223
  max_results: z18.number().optional().describe(
2192
2224
  "Maximum number of results to return (1-20). Defaults to 10 if not specified."
2193
2225
  ),
2194
2226
  source_policy: z18.object({
2195
2227
  include_domains: z18.array(z18.string()).optional().describe(
2196
- "Limit results to these domains. Use plain domain names only \u2014 e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."
2228
+ "Domains or domain/path prefixes to restrict results to, without scheme or port. Example: ['wikipedia.org', 'docs.python.org/3']."
2197
2229
  ),
2198
2230
  exclude_domains: z18.array(z18.string()).optional().describe(
2199
- "Exclude results from these domains. Use plain domain names only \u2014 e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."
2231
+ "Domains or domain/path prefixes to exclude, without scheme or port. Example: ['reddit.com']."
2200
2232
  ),
2201
2233
  after_date: z18.string().optional().describe(
2202
- "Only include results published after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time."
2234
+ "Only include results published on or after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time."
2203
2235
  )
2204
2236
  }).optional().describe(
2205
2237
  "Source policy for controlling which domains to include/exclude and freshness."
2206
2238
  ),
2207
2239
  excerpts: z18.object({
2208
2240
  max_chars_per_result: z18.number().optional().describe("Maximum characters per result."),
2209
- max_chars_total: z18.number().optional().describe("Maximum total characters across all results.")
2241
+ max_chars_total: z18.number().optional().describe("Deprecated: use the top-level max_chars_total.")
2210
2242
  }).optional().describe("Excerpt configuration for controlling result length."),
2243
+ max_chars_total: z18.number().optional().describe("Maximum total characters across all result excerpts."),
2211
2244
  fetch_policy: z18.object({
2212
2245
  max_age_seconds: z18.number().optional().describe(
2213
- "Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
2246
+ "Maximum age of cached content in seconds before a live fetch, minimum 600."
2247
+ ),
2248
+ timeout_seconds: z18.number().optional().describe(
2249
+ "Timeout in seconds for a live fetch when content is not cached. Capped by the gateway tool timeout."
2250
+ ),
2251
+ disable_cache_fallback: z18.boolean().optional().describe(
2252
+ "Return an error instead of older cached content when a live fetch fails."
2214
2253
  )
2215
- }).optional().describe("Fetch policy for controlling content freshness.")
2254
+ }).optional().describe("Fetch policy for controlling content freshness."),
2255
+ location: z18.string().optional().describe(
2256
+ 'ISO 3166-1 alpha-2 country code to localize results, e.g. "us".'
2257
+ )
2216
2258
  })
2217
2259
  )
2218
2260
  );
2219
- var parallelSearchOutputSchema = lazySchema13(
2220
- () => zodSchema13(
2261
+ var parallelSearchOutputSchema = lazySchema17(
2262
+ () => zodSchema17(
2221
2263
  z18.union([
2222
- // Success response
2264
+ // Success response (Parallel's response, passed through by the gateway)
2223
2265
  z18.object({
2224
- searchId: z18.string(),
2266
+ search_id: z18.string(),
2225
2267
  results: z18.array(
2226
2268
  z18.object({
2227
2269
  url: z18.string(),
2228
- title: z18.string(),
2229
- excerpt: z18.string(),
2230
- publishDate: z18.string().nullable().optional(),
2231
- relevanceScore: z18.number().optional()
2270
+ title: z18.string().nullable().optional(),
2271
+ publish_date: z18.string().nullable().optional(),
2272
+ excerpts: z18.array(z18.string())
2232
2273
  })
2233
- )
2274
+ ),
2275
+ warnings: z18.array(
2276
+ z18.object({
2277
+ type: z18.string(),
2278
+ message: z18.string(),
2279
+ detail: z18.record(z18.string(), z18.unknown()).nullable().optional()
2280
+ })
2281
+ ).nullable().optional(),
2282
+ usage: z18.array(z18.object({ name: z18.string(), count: z18.number().optional() })).nullable().optional(),
2283
+ session_id: z18.string().optional()
2234
2284
  }),
2235
2285
  // Error response
2236
2286
  z18.object({
2237
2287
  error: z18.enum([
2238
2288
  "api_error",
2289
+ "configuration_error",
2290
+ "execution_error",
2291
+ "gateway_rate_limit",
2292
+ "invalid_input",
2239
2293
  "rate_limit",
2240
2294
  "timeout",
2241
- "invalid_input",
2242
- "configuration_error",
2243
- "unknown"
2295
+ "unknown",
2296
+ "unknown_tool"
2244
2297
  ]),
2245
2298
  statusCode: z18.number().optional(),
2246
2299
  message: z18.string()
@@ -2258,12 +2311,12 @@ var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
2258
2311
  // src/tool/perplexity-search.ts
2259
2312
  import {
2260
2313
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
2261
- lazySchema as lazySchema14,
2262
- zodSchema as zodSchema14
2314
+ lazySchema as lazySchema18,
2315
+ zodSchema as zodSchema18
2263
2316
  } from "@ai-sdk/provider-utils";
2264
2317
  import { z as z19 } from "zod";
2265
- var perplexitySearchInputSchema = lazySchema14(
2266
- () => zodSchema14(
2318
+ var perplexitySearchInputSchema = lazySchema18(
2319
+ () => zodSchema18(
2267
2320
  z19.object({
2268
2321
  query: z19.union([z19.string(), z19.array(z19.string())]).describe(
2269
2322
  "Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
@@ -2304,8 +2357,8 @@ var perplexitySearchInputSchema = lazySchema14(
2304
2357
  })
2305
2358
  )
2306
2359
  );
2307
- var perplexitySearchOutputSchema = lazySchema14(
2308
- () => zodSchema14(
2360
+ var perplexitySearchOutputSchema = lazySchema18(
2361
+ () => zodSchema18(
2309
2362
  z19.union([
2310
2363
  // Success response
2311
2364
  z19.object({
@@ -2345,11 +2398,11 @@ var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
2345
2398
  // src/tool/tako-search.ts
2346
2399
  import {
2347
2400
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
2348
- lazySchema as lazySchema15,
2349
- zodSchema as zodSchema15
2401
+ lazySchema as lazySchema19,
2402
+ zodSchema as zodSchema19
2350
2403
  } from "@ai-sdk/provider-utils";
2351
2404
  import { z as z20 } from "zod";
2352
- var takoDataSourceInputSchema = z20.object({
2405
+ var takoDataSourceInputSchema = () => z20.object({
2353
2406
  count: z20.number().optional().describe(
2354
2407
  "Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge."
2355
2408
  ),
@@ -2368,7 +2421,7 @@ var takoDataSourceInputSchema = z20.object({
2368
2421
  "Only return cards matching node_ids. Requires a non-empty node_ids."
2369
2422
  )
2370
2423
  });
2371
- var takoWebSourceInputSchema = z20.object({
2424
+ var takoWebSourceInputSchema = () => z20.object({
2372
2425
  count: z20.number().optional().describe("Maximum number of web results to return (1-20)."),
2373
2426
  include_contents: z20.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
2374
2427
  category: z20.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
@@ -2381,13 +2434,15 @@ var takoWebSourceInputSchema = z20.object({
2381
2434
  article_content_max_chars: z20.number().optional().describe(
2382
2435
  "Maximum extracted characters per web page when including contents."
2383
2436
  ),
2384
- published_after: z20.string().optional().describe("Keep results published on or after this ISO date (YYYY-MM-DD)."),
2437
+ published_after: z20.string().optional().describe(
2438
+ "Keep results published on or after this ISO date (YYYY-MM-DD)."
2439
+ ),
2385
2440
  published_before: z20.string().optional().describe(
2386
2441
  "Keep results published on or before this ISO date (YYYY-MM-DD)."
2387
2442
  )
2388
2443
  });
2389
- var takoSearchInputSchema = lazySchema15(
2390
- () => zodSchema15(
2444
+ var takoSearchInputSchema = lazySchema19(
2445
+ () => zodSchema19(
2391
2446
  z20.object({
2392
2447
  query: z20.string().describe(
2393
2448
  'Natural-language search query. Include the entity, metric, and time period. Quote a phrase to force it to one entity, for example "Tesla":PRODUCT price.'
@@ -2396,8 +2451,8 @@ var takoSearchInputSchema = lazySchema15(
2396
2451
  "Search effort. fast is the balanced default, instant favors cached results and low latency, and deep broadens retrieval with reranking at higher cost and latency."
2397
2452
  ),
2398
2453
  sources: z20.object({
2399
- data: takoDataSourceInputSchema.optional(),
2400
- web: takoWebSourceInputSchema.optional()
2454
+ data: takoDataSourceInputSchema().optional(),
2455
+ web: takoWebSourceInputSchema().optional()
2401
2456
  }).optional().describe(
2402
2457
  "Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched."
2403
2458
  ),
@@ -2418,12 +2473,12 @@ var takoSearchInputSchema = lazySchema15(
2418
2473
  })
2419
2474
  )
2420
2475
  );
2421
- var takoDatasetCellSchema = z20.union([z20.boolean(), z20.number(), z20.string()]).nullable();
2422
- var takoResultContentSchema = z20.object({
2476
+ var takoDatasetCellSchema = () => z20.union([z20.boolean(), z20.number(), z20.string()]).nullable();
2477
+ var takoResultContentSchema = () => z20.object({
2423
2478
  content_format: z20.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
2424
2479
  cost: z20.number().optional(),
2425
2480
  data: z20.string().nullish(),
2426
- records: z20.array(z20.record(z20.string(), takoDatasetCellSchema)).nullish(),
2481
+ records: z20.array(z20.record(z20.string(), takoDatasetCellSchema())).nullish(),
2427
2482
  dataset: z20.object({
2428
2483
  columns: z20.array(
2429
2484
  z20.object({
@@ -2432,7 +2487,7 @@ var takoResultContentSchema = z20.object({
2432
2487
  unit: z20.string().nullish()
2433
2488
  })
2434
2489
  ),
2435
- rows: z20.array(z20.array(takoDatasetCellSchema)),
2490
+ rows: z20.array(z20.array(takoDatasetCellSchema())),
2436
2491
  total_rows: z20.number(),
2437
2492
  truncated: z20.boolean(),
2438
2493
  ref: z20.string(),
@@ -2466,7 +2521,7 @@ var takoResultContentSchema = z20.object({
2466
2521
  })
2467
2522
  ).nullish()
2468
2523
  }).passthrough();
2469
- var takoCardSchema = z20.object({
2524
+ var takoCardSchema = () => z20.object({
2470
2525
  card_id: z20.string().nullish(),
2471
2526
  title: z20.string().nullish(),
2472
2527
  description: z20.string().nullish(),
@@ -2492,7 +2547,7 @@ var takoCardSchema = z20.object({
2492
2547
  source_indexes: z20.array(z20.enum(["data", "web"])).nullish(),
2493
2548
  card_type: z20.string().nullish(),
2494
2549
  relevance: z20.enum(["High", "Low", "Medium"]).nullish(),
2495
- content: takoResultContentSchema.nullish(),
2550
+ content: takoResultContentSchema().nullish(),
2496
2551
  exportable: z20.boolean().optional(),
2497
2552
  nodes: z20.array(
2498
2553
  z20.object({
@@ -2509,21 +2564,21 @@ var takoCardSchema = z20.object({
2509
2564
  last_updated: z20.string().nullish()
2510
2565
  }).nullish()
2511
2566
  }).passthrough();
2512
- var takoWebResultSchema = z20.object({
2567
+ var takoWebResultSchema = () => z20.object({
2513
2568
  title: z20.string(),
2514
2569
  url: z20.string(),
2515
2570
  snippet: z20.string().nullish(),
2516
2571
  source_name: z20.string().nullish(),
2517
2572
  publish_date: z20.string().nullish(),
2518
- content: takoResultContentSchema.nullish()
2573
+ content: takoResultContentSchema().nullish()
2519
2574
  }).passthrough();
2520
- var takoSearchOutputSchema = lazySchema15(
2521
- () => zodSchema15(
2575
+ var takoSearchOutputSchema = lazySchema19(
2576
+ () => zodSchema19(
2522
2577
  z20.union([
2523
2578
  z20.object({
2524
2579
  request_id: z20.string(),
2525
- cards: z20.array(takoCardSchema).optional(),
2526
- web_results: z20.array(takoWebResultSchema).optional(),
2580
+ cards: z20.array(takoCardSchema()).optional(),
2581
+ web_results: z20.array(takoWebResultSchema()).optional(),
2527
2582
  usage: z20.object({
2528
2583
  total_cost_usd: z20.number(),
2529
2584
  compute: z20.object({ cost_usd: z20.number() }).nullish(),
@@ -2615,7 +2670,7 @@ async function getVercelRequestId() {
2615
2670
  }
2616
2671
 
2617
2672
  // src/version.ts
2618
- var VERSION = true ? "3.0.218" : "0.0.0-test";
2673
+ var VERSION = true ? "3.0.220" : "0.0.0-test";
2619
2674
 
2620
2675
  // src/gateway-provider.ts
2621
2676
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";