@ai-sdk/gateway 3.0.201 → 3.0.202

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
@@ -1918,22 +1918,140 @@ var gatewayTranscriptionResponseSchema = z14.object({
1918
1918
  providerMetadata: z14.record(z14.string(), providerMetadataEntrySchema4).optional()
1919
1919
  });
1920
1920
 
1921
- // src/tool/exa-search.ts
1921
+ // src/tool/browserbase-fetch.ts
1922
1922
  import {
1923
1923
  createProviderToolFactoryWithOutputSchema,
1924
1924
  lazySchema as lazySchema10,
1925
1925
  zodSchema as zodSchema10
1926
1926
  } from "@ai-sdk/provider-utils";
1927
1927
  import { z as z15 } from "zod";
1928
- var exaSearchInputSchema = lazySchema10(
1928
+ var jsonObjectSchema = z15.record(z15.string(), z15.unknown());
1929
+ var browserbaseFetchInputSchema = lazySchema10(
1929
1930
  () => zodSchema10(
1930
1931
  z15.object({
1931
- query: z15.string().describe("Natural-language web search query. This is required."),
1932
- type: z15.enum(["auto", "fast", "instant"]).optional().describe(
1932
+ url: z15.string().url().describe("URL of the page to fetch."),
1933
+ allow_redirects: z15.boolean().optional().describe("Whether to follow HTTP redirects (default: false)."),
1934
+ allow_insecure_ssl: z15.boolean().optional().describe(
1935
+ "Whether to bypass TLS certificate verification (default: false). Only use for trusted hosts."
1936
+ ),
1937
+ proxies: z15.boolean().optional().describe(
1938
+ "Whether to route the request through Browserbase proxies (default: false)."
1939
+ ),
1940
+ format: z15.enum(["raw", "json", "markdown"]).optional().describe(
1941
+ "Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema."
1942
+ ),
1943
+ schema: jsonObjectSchema.optional().describe(
1944
+ "JSON Schema for structured extraction. Only use with format set to json."
1945
+ )
1946
+ })
1947
+ )
1948
+ );
1949
+ var browserbaseFetchOutputSchema = lazySchema10(
1950
+ () => zodSchema10(
1951
+ z15.union([
1952
+ z15.object({
1953
+ id: z15.string(),
1954
+ content: z15.union([z15.string(), jsonObjectSchema]),
1955
+ contentType: z15.string(),
1956
+ encoding: z15.string(),
1957
+ headers: z15.record(z15.string(), z15.string()),
1958
+ statusCode: z15.number()
1959
+ }),
1960
+ z15.object({
1961
+ error: z15.enum([
1962
+ "api_error",
1963
+ "configuration_error",
1964
+ "execution_error",
1965
+ "invalid_input",
1966
+ "rate_limit",
1967
+ "timeout",
1968
+ "unknown"
1969
+ ]),
1970
+ statusCode: z15.number().optional(),
1971
+ message: z15.string()
1972
+ })
1973
+ ])
1974
+ )
1975
+ );
1976
+ var browserbaseFetchToolFactory = createProviderToolFactoryWithOutputSchema({
1977
+ id: "gateway.browserbase_fetch",
1978
+ inputSchema: browserbaseFetchInputSchema,
1979
+ outputSchema: browserbaseFetchOutputSchema
1980
+ });
1981
+ var browserbaseFetch = (config = {}) => browserbaseFetchToolFactory(config);
1982
+
1983
+ // src/tool/browserbase-search.ts
1984
+ import {
1985
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
1986
+ lazySchema as lazySchema11,
1987
+ zodSchema as zodSchema11
1988
+ } from "@ai-sdk/provider-utils";
1989
+ import { z as z16 } from "zod";
1990
+ var browserbaseSearchInputSchema = lazySchema11(
1991
+ () => zodSchema11(
1992
+ z16.object({
1993
+ query: z16.string().min(1).max(200).describe("Web search query. Must be between 1 and 200 characters."),
1994
+ num_results: z16.number().int().min(1).max(25).optional().describe("Maximum number of results to return (1-25, default: 10).")
1995
+ })
1996
+ )
1997
+ );
1998
+ var browserbaseSearchOutputSchema = lazySchema11(
1999
+ () => zodSchema11(
2000
+ z16.union([
2001
+ z16.object({
2002
+ query: z16.string(),
2003
+ requestId: z16.string(),
2004
+ results: z16.array(
2005
+ z16.object({
2006
+ id: z16.string(),
2007
+ title: z16.string(),
2008
+ url: z16.string(),
2009
+ author: z16.string().optional(),
2010
+ favicon: z16.string().optional(),
2011
+ image: z16.string().optional(),
2012
+ publishedDate: z16.string().optional()
2013
+ })
2014
+ )
2015
+ }),
2016
+ z16.object({
2017
+ error: z16.enum([
2018
+ "api_error",
2019
+ "configuration_error",
2020
+ "execution_error",
2021
+ "invalid_input",
2022
+ "rate_limit",
2023
+ "timeout",
2024
+ "unknown"
2025
+ ]),
2026
+ statusCode: z16.number().optional(),
2027
+ message: z16.string()
2028
+ })
2029
+ ])
2030
+ )
2031
+ );
2032
+ var browserbaseSearchToolFactory = createProviderToolFactoryWithOutputSchema2({
2033
+ id: "gateway.browserbase_search",
2034
+ inputSchema: browserbaseSearchInputSchema,
2035
+ outputSchema: browserbaseSearchOutputSchema
2036
+ });
2037
+ var browserbaseSearch = (config = {}) => browserbaseSearchToolFactory(config);
2038
+
2039
+ // src/tool/exa-search.ts
2040
+ import {
2041
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
2042
+ lazySchema as lazySchema12,
2043
+ zodSchema as zodSchema12
2044
+ } from "@ai-sdk/provider-utils";
2045
+ import { z as z17 } from "zod";
2046
+ var exaSearchInputSchema = lazySchema12(
2047
+ () => zodSchema12(
2048
+ z17.object({
2049
+ query: z17.string().describe("Natural-language web search query. This is required."),
2050
+ type: z17.enum(["auto", "fast", "instant"]).optional().describe(
1933
2051
  "Search method. Use auto for the default balance of speed and quality."
1934
2052
  ),
1935
- num_results: z15.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),
1936
- category: z15.enum([
2053
+ num_results: z17.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),
2054
+ category: z17.enum([
1937
2055
  "company",
1938
2056
  "people",
1939
2057
  "research paper",
@@ -1941,20 +2059,20 @@ var exaSearchInputSchema = lazySchema10(
1941
2059
  "personal site",
1942
2060
  "financial report"
1943
2061
  ]).optional().describe("Optional content category to focus results."),
1944
- user_location: z15.string().optional().describe("Two-letter ISO country code such as 'US'."),
1945
- include_domains: z15.array(z15.string()).optional().describe("Only return results from these domains."),
1946
- exclude_domains: z15.array(z15.string()).optional().describe("Exclude results from these domains."),
1947
- start_published_date: z15.string().optional().describe("Only return links published after this ISO 8601 date."),
1948
- end_published_date: z15.string().optional().describe("Only return links published before this ISO 8601 date."),
1949
- contents: z15.object({
1950
- text: z15.union([
1951
- z15.boolean(),
1952
- z15.object({
1953
- max_characters: z15.number().optional(),
1954
- include_html_tags: z15.boolean().optional(),
1955
- verbosity: z15.enum(["compact", "standard", "full"]).optional(),
1956
- include_sections: z15.array(
1957
- z15.enum([
2062
+ user_location: z17.string().optional().describe("Two-letter ISO country code such as 'US'."),
2063
+ include_domains: z17.array(z17.string()).optional().describe("Only return results from these domains."),
2064
+ exclude_domains: z17.array(z17.string()).optional().describe("Exclude results from these domains."),
2065
+ start_published_date: z17.string().optional().describe("Only return links published after this ISO 8601 date."),
2066
+ end_published_date: z17.string().optional().describe("Only return links published before this ISO 8601 date."),
2067
+ contents: z17.object({
2068
+ text: z17.union([
2069
+ z17.boolean(),
2070
+ z17.object({
2071
+ max_characters: z17.number().optional(),
2072
+ include_html_tags: z17.boolean().optional(),
2073
+ verbosity: z17.enum(["compact", "standard", "full"]).optional(),
2074
+ include_sections: z17.array(
2075
+ z17.enum([
1958
2076
  "header",
1959
2077
  "navigation",
1960
2078
  "banner",
@@ -1964,8 +2082,8 @@ var exaSearchInputSchema = lazySchema10(
1964
2082
  "metadata"
1965
2083
  ])
1966
2084
  ).optional(),
1967
- exclude_sections: z15.array(
1968
- z15.enum([
2085
+ exclude_sections: z17.array(
2086
+ z17.enum([
1969
2087
  "header",
1970
2088
  "navigation",
1971
2089
  "banner",
@@ -1977,59 +2095,59 @@ var exaSearchInputSchema = lazySchema10(
1977
2095
  ).optional()
1978
2096
  })
1979
2097
  ]).optional(),
1980
- highlights: z15.union([
1981
- z15.boolean(),
1982
- z15.object({
1983
- query: z15.string().optional(),
1984
- max_characters: z15.number().optional()
2098
+ highlights: z17.union([
2099
+ z17.boolean(),
2100
+ z17.object({
2101
+ query: z17.string().optional(),
2102
+ max_characters: z17.number().optional()
1985
2103
  })
1986
2104
  ]).optional(),
1987
- max_age_hours: z15.number().optional(),
1988
- livecrawl_timeout: z15.number().optional(),
1989
- subpages: z15.number().optional(),
1990
- subpage_target: z15.union([z15.string(), z15.array(z15.string())]).optional(),
1991
- extras: z15.object({
1992
- links: z15.number().optional(),
1993
- image_links: z15.number().optional()
2105
+ max_age_hours: z17.number().optional(),
2106
+ livecrawl_timeout: z17.number().optional(),
2107
+ subpages: z17.number().optional(),
2108
+ subpage_target: z17.union([z17.string(), z17.array(z17.string())]).optional(),
2109
+ extras: z17.object({
2110
+ links: z17.number().optional(),
2111
+ image_links: z17.number().optional()
1994
2112
  }).optional()
1995
2113
  }).optional().describe("Controls extracted page content and freshness.")
1996
2114
  })
1997
2115
  )
1998
2116
  );
1999
- var exaSearchOutputSchema = lazySchema10(
2000
- () => zodSchema10(
2001
- z15.union([
2002
- z15.object({
2003
- requestId: z15.string(),
2004
- searchType: z15.string().optional(),
2005
- resolvedSearchType: z15.string().optional(),
2006
- results: z15.array(
2007
- z15.object({
2008
- title: z15.string(),
2009
- url: z15.string(),
2010
- id: z15.string(),
2011
- publishedDate: z15.string().nullable().optional(),
2012
- author: z15.string().nullable().optional(),
2013
- image: z15.string().nullable().optional(),
2014
- favicon: z15.string().nullable().optional(),
2015
- text: z15.string().optional(),
2016
- highlights: z15.array(z15.string()).optional(),
2017
- highlightScores: z15.array(z15.number()).optional(),
2018
- summary: z15.string().optional(),
2019
- subpages: z15.array(z15.any()).optional(),
2020
- extras: z15.object({
2021
- links: z15.array(z15.string()).optional(),
2022
- imageLinks: z15.array(z15.string()).optional()
2117
+ var exaSearchOutputSchema = lazySchema12(
2118
+ () => zodSchema12(
2119
+ z17.union([
2120
+ z17.object({
2121
+ requestId: z17.string(),
2122
+ searchType: z17.string().optional(),
2123
+ resolvedSearchType: z17.string().optional(),
2124
+ results: z17.array(
2125
+ z17.object({
2126
+ title: z17.string(),
2127
+ url: z17.string(),
2128
+ id: z17.string(),
2129
+ publishedDate: z17.string().nullable().optional(),
2130
+ author: z17.string().nullable().optional(),
2131
+ image: z17.string().nullable().optional(),
2132
+ favicon: z17.string().nullable().optional(),
2133
+ text: z17.string().optional(),
2134
+ highlights: z17.array(z17.string()).optional(),
2135
+ highlightScores: z17.array(z17.number()).optional(),
2136
+ summary: z17.string().optional(),
2137
+ subpages: z17.array(z17.any()).optional(),
2138
+ extras: z17.object({
2139
+ links: z17.array(z17.string()).optional(),
2140
+ imageLinks: z17.array(z17.string()).optional()
2023
2141
  }).optional()
2024
2142
  })
2025
2143
  ),
2026
- costDollars: z15.object({
2027
- total: z15.number().optional(),
2028
- search: z15.record(z15.number()).optional()
2144
+ costDollars: z17.object({
2145
+ total: z17.number().optional(),
2146
+ search: z17.record(z17.number()).optional()
2029
2147
  }).optional()
2030
2148
  }),
2031
- z15.object({
2032
- error: z15.enum([
2149
+ z17.object({
2150
+ error: z17.enum([
2033
2151
  "api_error",
2034
2152
  "rate_limit",
2035
2153
  "timeout",
@@ -2038,13 +2156,13 @@ var exaSearchOutputSchema = lazySchema10(
2038
2156
  "execution_error",
2039
2157
  "unknown"
2040
2158
  ]),
2041
- statusCode: z15.number().optional(),
2042
- message: z15.string()
2159
+ statusCode: z17.number().optional(),
2160
+ message: z17.string()
2043
2161
  })
2044
2162
  ])
2045
2163
  )
2046
2164
  );
2047
- var exaSearchToolFactory = createProviderToolFactoryWithOutputSchema({
2165
+ var exaSearchToolFactory = createProviderToolFactoryWithOutputSchema3({
2048
2166
  id: "gateway.exa_search",
2049
2167
  inputSchema: exaSearchInputSchema,
2050
2168
  outputSchema: exaSearchOutputSchema
@@ -2053,70 +2171,70 @@ var exaSearch = (config = {}) => exaSearchToolFactory(config);
2053
2171
 
2054
2172
  // src/tool/parallel-search.ts
2055
2173
  import {
2056
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
2057
- lazySchema as lazySchema11,
2058
- zodSchema as zodSchema11
2174
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2175
+ lazySchema as lazySchema13,
2176
+ zodSchema as zodSchema13
2059
2177
  } from "@ai-sdk/provider-utils";
2060
- import { z as z16 } from "zod";
2061
- var parallelSearchInputSchema = lazySchema11(
2062
- () => zodSchema11(
2063
- z16.object({
2064
- objective: z16.string().describe(
2178
+ import { z as z18 } from "zod";
2179
+ var parallelSearchInputSchema = lazySchema13(
2180
+ () => zodSchema13(
2181
+ z18.object({
2182
+ objective: z18.string().describe(
2065
2183
  "Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
2066
2184
  ),
2067
- search_queries: z16.array(z16.string()).optional().describe(
2185
+ search_queries: z18.array(z18.string()).optional().describe(
2068
2186
  "Optional search queries to supplement the objective. Maximum 200 characters per query."
2069
2187
  ),
2070
- mode: z16.enum(["one-shot", "agentic"]).optional().describe(
2188
+ mode: z18.enum(["one-shot", "agentic"]).optional().describe(
2071
2189
  'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
2072
2190
  ),
2073
- max_results: z16.number().optional().describe(
2191
+ max_results: z18.number().optional().describe(
2074
2192
  "Maximum number of results to return (1-20). Defaults to 10 if not specified."
2075
2193
  ),
2076
- source_policy: z16.object({
2077
- include_domains: z16.array(z16.string()).optional().describe(
2194
+ source_policy: z18.object({
2195
+ include_domains: z18.array(z18.string()).optional().describe(
2078
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)."
2079
2197
  ),
2080
- exclude_domains: z16.array(z16.string()).optional().describe(
2198
+ exclude_domains: z18.array(z18.string()).optional().describe(
2081
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)."
2082
2200
  ),
2083
- after_date: z16.string().optional().describe(
2201
+ after_date: z18.string().optional().describe(
2084
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."
2085
2203
  )
2086
2204
  }).optional().describe(
2087
2205
  "Source policy for controlling which domains to include/exclude and freshness."
2088
2206
  ),
2089
- excerpts: z16.object({
2090
- max_chars_per_result: z16.number().optional().describe("Maximum characters per result."),
2091
- max_chars_total: z16.number().optional().describe("Maximum total characters across all results.")
2207
+ excerpts: z18.object({
2208
+ 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.")
2092
2210
  }).optional().describe("Excerpt configuration for controlling result length."),
2093
- fetch_policy: z16.object({
2094
- max_age_seconds: z16.number().optional().describe(
2211
+ fetch_policy: z18.object({
2212
+ max_age_seconds: z18.number().optional().describe(
2095
2213
  "Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
2096
2214
  )
2097
2215
  }).optional().describe("Fetch policy for controlling content freshness.")
2098
2216
  })
2099
2217
  )
2100
2218
  );
2101
- var parallelSearchOutputSchema = lazySchema11(
2102
- () => zodSchema11(
2103
- z16.union([
2219
+ var parallelSearchOutputSchema = lazySchema13(
2220
+ () => zodSchema13(
2221
+ z18.union([
2104
2222
  // Success response
2105
- z16.object({
2106
- searchId: z16.string(),
2107
- results: z16.array(
2108
- z16.object({
2109
- url: z16.string(),
2110
- title: z16.string(),
2111
- excerpt: z16.string(),
2112
- publishDate: z16.string().nullable().optional(),
2113
- relevanceScore: z16.number().optional()
2223
+ z18.object({
2224
+ searchId: z18.string(),
2225
+ results: z18.array(
2226
+ z18.object({
2227
+ url: z18.string(),
2228
+ title: z18.string(),
2229
+ excerpt: z18.string(),
2230
+ publishDate: z18.string().nullable().optional(),
2231
+ relevanceScore: z18.number().optional()
2114
2232
  })
2115
2233
  )
2116
2234
  }),
2117
2235
  // Error response
2118
- z16.object({
2119
- error: z16.enum([
2236
+ z18.object({
2237
+ error: z18.enum([
2120
2238
  "api_error",
2121
2239
  "rate_limit",
2122
2240
  "timeout",
@@ -2124,13 +2242,13 @@ var parallelSearchOutputSchema = lazySchema11(
2124
2242
  "configuration_error",
2125
2243
  "unknown"
2126
2244
  ]),
2127
- statusCode: z16.number().optional(),
2128
- message: z16.string()
2245
+ statusCode: z18.number().optional(),
2246
+ message: z18.string()
2129
2247
  })
2130
2248
  ])
2131
2249
  )
2132
2250
  );
2133
- var parallelSearchToolFactory = createProviderToolFactoryWithOutputSchema2({
2251
+ var parallelSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
2134
2252
  id: "gateway.parallel_search",
2135
2253
  inputSchema: parallelSearchInputSchema,
2136
2254
  outputSchema: parallelSearchOutputSchema
@@ -2139,85 +2257,85 @@ var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
2139
2257
 
2140
2258
  // src/tool/perplexity-search.ts
2141
2259
  import {
2142
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
2143
- lazySchema as lazySchema12,
2144
- zodSchema as zodSchema12
2260
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
2261
+ lazySchema as lazySchema14,
2262
+ zodSchema as zodSchema14
2145
2263
  } from "@ai-sdk/provider-utils";
2146
- import { z as z17 } from "zod";
2147
- var perplexitySearchInputSchema = lazySchema12(
2148
- () => zodSchema12(
2149
- z17.object({
2150
- query: z17.union([z17.string(), z17.array(z17.string())]).describe(
2264
+ import { z as z19 } from "zod";
2265
+ var perplexitySearchInputSchema = lazySchema14(
2266
+ () => zodSchema14(
2267
+ z19.object({
2268
+ query: z19.union([z19.string(), z19.array(z19.string())]).describe(
2151
2269
  "Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
2152
2270
  ),
2153
- max_results: z17.number().optional().describe(
2271
+ max_results: z19.number().optional().describe(
2154
2272
  "Maximum number of search results to return (1-20, default: 10)"
2155
2273
  ),
2156
- max_tokens_per_page: z17.number().optional().describe(
2274
+ max_tokens_per_page: z19.number().optional().describe(
2157
2275
  "Maximum number of tokens to extract per search result page (256-2048, default: 2048)"
2158
2276
  ),
2159
- max_tokens: z17.number().optional().describe(
2277
+ max_tokens: z19.number().optional().describe(
2160
2278
  "Maximum total tokens across all search results (default: 25000, max: 1000000)"
2161
2279
  ),
2162
- country: z17.string().optional().describe(
2280
+ country: z19.string().optional().describe(
2163
2281
  "Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"
2164
2282
  ),
2165
- search_domain_filter: z17.array(z17.string()).optional().describe(
2283
+ search_domain_filter: z19.array(z19.string()).optional().describe(
2166
2284
  "List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"
2167
2285
  ),
2168
- search_language_filter: z17.array(z17.string()).optional().describe(
2286
+ search_language_filter: z19.array(z19.string()).optional().describe(
2169
2287
  "List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"
2170
2288
  ),
2171
- search_after_date: z17.string().optional().describe(
2289
+ search_after_date: z19.string().optional().describe(
2172
2290
  "Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
2173
2291
  ),
2174
- search_before_date: z17.string().optional().describe(
2292
+ search_before_date: z19.string().optional().describe(
2175
2293
  "Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
2176
2294
  ),
2177
- last_updated_after_filter: z17.string().optional().describe(
2295
+ last_updated_after_filter: z19.string().optional().describe(
2178
2296
  "Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
2179
2297
  ),
2180
- last_updated_before_filter: z17.string().optional().describe(
2298
+ last_updated_before_filter: z19.string().optional().describe(
2181
2299
  "Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
2182
2300
  ),
2183
- search_recency_filter: z17.enum(["day", "week", "month", "year"]).optional().describe(
2301
+ search_recency_filter: z19.enum(["day", "week", "month", "year"]).optional().describe(
2184
2302
  "Filter results by relative time period. Cannot be used with search_after_date or search_before_date."
2185
2303
  )
2186
2304
  })
2187
2305
  )
2188
2306
  );
2189
- var perplexitySearchOutputSchema = lazySchema12(
2190
- () => zodSchema12(
2191
- z17.union([
2307
+ var perplexitySearchOutputSchema = lazySchema14(
2308
+ () => zodSchema14(
2309
+ z19.union([
2192
2310
  // Success response
2193
- z17.object({
2194
- results: z17.array(
2195
- z17.object({
2196
- title: z17.string(),
2197
- url: z17.string(),
2198
- snippet: z17.string(),
2199
- date: z17.string().optional(),
2200
- lastUpdated: z17.string().optional()
2311
+ z19.object({
2312
+ results: z19.array(
2313
+ z19.object({
2314
+ title: z19.string(),
2315
+ url: z19.string(),
2316
+ snippet: z19.string(),
2317
+ date: z19.string().optional(),
2318
+ lastUpdated: z19.string().optional()
2201
2319
  })
2202
2320
  ),
2203
- id: z17.string()
2321
+ id: z19.string()
2204
2322
  }),
2205
2323
  // Error response
2206
- z17.object({
2207
- error: z17.enum([
2324
+ z19.object({
2325
+ error: z19.enum([
2208
2326
  "api_error",
2209
2327
  "rate_limit",
2210
2328
  "timeout",
2211
2329
  "invalid_input",
2212
2330
  "unknown"
2213
2331
  ]),
2214
- statusCode: z17.number().optional(),
2215
- message: z17.string()
2332
+ statusCode: z19.number().optional(),
2333
+ message: z19.string()
2216
2334
  })
2217
2335
  ])
2218
2336
  )
2219
2337
  );
2220
- var perplexitySearchToolFactory = createProviderToolFactoryWithOutputSchema3({
2338
+ var perplexitySearchToolFactory = createProviderToolFactoryWithOutputSchema5({
2221
2339
  id: "gateway.perplexity_search",
2222
2340
  inputSchema: perplexitySearchInputSchema,
2223
2341
  outputSchema: perplexitySearchOutputSchema
@@ -2226,195 +2344,195 @@ var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
2226
2344
 
2227
2345
  // src/tool/tako-search.ts
2228
2346
  import {
2229
- createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2230
- lazySchema as lazySchema13,
2231
- zodSchema as zodSchema13
2347
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
2348
+ lazySchema as lazySchema15,
2349
+ zodSchema as zodSchema15
2232
2350
  } from "@ai-sdk/provider-utils";
2233
- import { z as z18 } from "zod";
2234
- var takoDataSourceInputSchema = z18.object({
2235
- count: z18.number().optional().describe(
2351
+ import { z as z20 } from "zod";
2352
+ var takoDataSourceInputSchema = z20.object({
2353
+ count: z20.number().optional().describe(
2236
2354
  "Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge."
2237
2355
  ),
2238
- include_contents: z18.boolean().optional().describe(
2356
+ include_contents: z20.boolean().optional().describe(
2239
2357
  "Inline rows for each data result. This adds a data surcharge based on row count and dataset source. To estimate cost, search with include_contents disabled and inspect cards.content.export_pricing. This applies to every returned card; limit sources.data.count and sources.data.max_rows to control cost."
2240
2358
  ),
2241
- mode: z18.enum(["inline", "url"]).optional().describe(
2359
+ mode: z20.enum(["inline", "url"]).optional().describe(
2242
2360
  "Requested data delivery mode. Search card data is always inline."
2243
2361
  ),
2244
- content_format: z18.enum(["card_json", "csv", "json_compact", "json_records"]).optional().describe("Serialization for inlined card data."),
2245
- max_rows: z18.number().optional().describe(
2362
+ content_format: z20.enum(["card_json", "csv", "json_compact", "json_records"]).optional().describe("Serialization for inlined card data."),
2363
+ max_rows: z20.number().optional().describe(
2246
2364
  "Maximum rows to inline per result. Omit to use the allowance in cards.content.export_pricing. A data surcharge applies per 1,000 exported rows; lower values reduce cost."
2247
2365
  ),
2248
- node_ids: z18.array(z18.string()).optional().describe("Data Graph node IDs to prioritize. Maximum 20."),
2249
- strict: z18.boolean().optional().describe(
2366
+ node_ids: z20.array(z20.string()).optional().describe("Data Graph node IDs to prioritize. Maximum 20."),
2367
+ strict: z20.boolean().optional().describe(
2250
2368
  "Only return cards matching node_ids. Requires a non-empty node_ids."
2251
2369
  )
2252
2370
  });
2253
- var takoWebSourceInputSchema = z18.object({
2254
- count: z18.number().optional().describe("Maximum number of web results to return (1-20)."),
2255
- include_contents: z18.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
2256
- category: z18.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
2257
- include_domains: z18.array(z18.string()).optional().describe("Only return results from these bare domains."),
2258
- exclude_domains: z18.array(z18.string()).optional().describe("Exclude results from these bare domains."),
2259
- snippet_max_chars: z18.number().optional().describe("Maximum characters in each web-result snippet."),
2260
- highlights: z18.boolean().optional().describe(
2371
+ var takoWebSourceInputSchema = z20.object({
2372
+ count: z20.number().optional().describe("Maximum number of web results to return (1-20)."),
2373
+ include_contents: z20.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
2374
+ category: z20.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
2375
+ include_domains: z20.array(z20.string()).optional().describe("Only return results from these bare domains."),
2376
+ exclude_domains: z20.array(z20.string()).optional().describe("Exclude results from these bare domains."),
2377
+ snippet_max_chars: z20.number().optional().describe("Maximum characters in each web-result snippet."),
2378
+ highlights: z20.boolean().optional().describe(
2261
2379
  "Include highlighted passages in web results. Defaults to true in AI Gateway."
2262
2380
  ),
2263
- article_content_max_chars: z18.number().optional().describe(
2381
+ article_content_max_chars: z20.number().optional().describe(
2264
2382
  "Maximum extracted characters per web page when including contents."
2265
2383
  ),
2266
- published_after: z18.string().optional().describe("Keep results published on or after this ISO date (YYYY-MM-DD)."),
2267
- published_before: z18.string().optional().describe(
2384
+ published_after: z20.string().optional().describe("Keep results published on or after this ISO date (YYYY-MM-DD)."),
2385
+ published_before: z20.string().optional().describe(
2268
2386
  "Keep results published on or before this ISO date (YYYY-MM-DD)."
2269
2387
  )
2270
2388
  });
2271
- var takoSearchInputSchema = lazySchema13(
2272
- () => zodSchema13(
2273
- z18.object({
2274
- query: z18.string().describe(
2389
+ var takoSearchInputSchema = lazySchema15(
2390
+ () => zodSchema15(
2391
+ z20.object({
2392
+ query: z20.string().describe(
2275
2393
  '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.'
2276
2394
  ),
2277
- effort: z18.enum(["deep", "fast", "instant"]).optional().describe(
2395
+ effort: z20.enum(["deep", "fast", "instant"]).optional().describe(
2278
2396
  "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."
2279
2397
  ),
2280
- sources: z18.object({
2398
+ sources: z20.object({
2281
2399
  data: takoDataSourceInputSchema.optional(),
2282
2400
  web: takoWebSourceInputSchema.optional()
2283
2401
  }).optional().describe(
2284
2402
  "Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched."
2285
2403
  ),
2286
- location: z18.object({
2287
- latitude: z18.number().describe("Latitude between -90 and 90."),
2288
- longitude: z18.number().describe("Longitude between -180 and 180.")
2404
+ location: z20.object({
2405
+ latitude: z20.number().describe("Latitude between -90 and 90."),
2406
+ longitude: z20.number().describe("Longitude between -180 and 180.")
2289
2407
  }).optional().describe("End-user coordinates for localized results."),
2290
- country_code: z18.string().optional().describe("Two-letter ISO 3166-1 country code, such as 'US'."),
2291
- locale: z18.string().optional().describe("BCP-47 locale, such as 'en-US'."),
2292
- timezone: z18.string().optional().describe("IANA timezone, such as 'America/New_York'."),
2293
- output_settings: z18.object({
2294
- image_dark_mode: z18.boolean().optional().describe("Render card preview images in dark mode."),
2295
- force_refresh: z18.boolean().optional().describe(
2408
+ country_code: z20.string().optional().describe("Two-letter ISO 3166-1 country code, such as 'US'."),
2409
+ locale: z20.string().optional().describe("BCP-47 locale, such as 'en-US'."),
2410
+ timezone: z20.string().optional().describe("IANA timezone, such as 'America/New_York'."),
2411
+ output_settings: z20.object({
2412
+ image_dark_mode: z20.boolean().optional().describe("Render card preview images in dark mode."),
2413
+ force_refresh: z20.boolean().optional().describe(
2296
2414
  "Instant-effort only. Request a refreshed instant result."
2297
2415
  )
2298
2416
  }).optional().describe("Controls card rendering in the search response."),
2299
- include_related: z18.number().optional().describe("Maximum related search suggestions to include (1-20).")
2417
+ include_related: z20.number().optional().describe("Maximum related search suggestions to include (1-20).")
2300
2418
  })
2301
2419
  )
2302
2420
  );
2303
- var takoDatasetCellSchema = z18.union([z18.boolean(), z18.number(), z18.string()]).nullable();
2304
- var takoResultContentSchema = z18.object({
2305
- content_format: z18.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
2306
- cost: z18.number().optional(),
2307
- data: z18.string().nullish(),
2308
- records: z18.array(z18.record(z18.string(), takoDatasetCellSchema)).nullish(),
2309
- dataset: z18.object({
2310
- columns: z18.array(
2311
- z18.object({
2312
- name: z18.string(),
2313
- type: z18.enum(["boolean", "date", "datetime", "number", "string"]),
2314
- unit: z18.string().nullish()
2421
+ var takoDatasetCellSchema = z20.union([z20.boolean(), z20.number(), z20.string()]).nullable();
2422
+ var takoResultContentSchema = z20.object({
2423
+ content_format: z20.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
2424
+ cost: z20.number().optional(),
2425
+ data: z20.string().nullish(),
2426
+ records: z20.array(z20.record(z20.string(), takoDatasetCellSchema)).nullish(),
2427
+ dataset: z20.object({
2428
+ columns: z20.array(
2429
+ z20.object({
2430
+ name: z20.string(),
2431
+ type: z20.enum(["boolean", "date", "datetime", "number", "string"]),
2432
+ unit: z20.string().nullish()
2315
2433
  })
2316
2434
  ),
2317
- rows: z18.array(z18.array(takoDatasetCellSchema)),
2318
- total_rows: z18.number(),
2319
- truncated: z18.boolean(),
2320
- ref: z18.string(),
2321
- sources: z18.array(
2322
- z18.object({
2323
- name: z18.string(),
2324
- index: z18.enum(["data", "web"]).optional()
2435
+ rows: z20.array(z20.array(takoDatasetCellSchema)),
2436
+ total_rows: z20.number(),
2437
+ truncated: z20.boolean(),
2438
+ ref: z20.string(),
2439
+ sources: z20.array(
2440
+ z20.object({
2441
+ name: z20.string(),
2442
+ index: z20.enum(["data", "web"]).optional()
2325
2443
  })
2326
2444
  ),
2327
- provenance: z18.enum(["query", "web_extraction"]).optional()
2445
+ provenance: z20.enum(["query", "web_extraction"]).optional()
2328
2446
  }).nullish(),
2329
- card_data: z18.object({}).passthrough().nullish(),
2330
- card_data_schema: z18.object({}).passthrough().nullish(),
2331
- url: z18.string().nullish(),
2332
- expires_at: z18.string().nullish(),
2333
- total_rows: z18.number().nullish(),
2334
- truncated: z18.boolean().optional(),
2335
- export_pricing: z18.object({
2336
- baseline_usd: z18.number(),
2337
- free_rows: z18.number(),
2338
- max_rows_ceiling: z18.number(),
2339
- row_cpm_usd: z18.number()
2447
+ card_data: z20.object({}).passthrough().nullish(),
2448
+ card_data_schema: z20.object({}).passthrough().nullish(),
2449
+ url: z20.string().nullish(),
2450
+ expires_at: z20.string().nullish(),
2451
+ total_rows: z20.number().nullish(),
2452
+ truncated: z20.boolean().optional(),
2453
+ export_pricing: z20.object({
2454
+ baseline_usd: z20.number(),
2455
+ free_rows: z20.number(),
2456
+ max_rows_ceiling: z20.number(),
2457
+ row_cpm_usd: z20.number()
2340
2458
  }).nullish(),
2341
- manifest: z18.array(
2342
- z18.object({
2343
- dtype: z18.enum(["boolean", "date", "datetime", "number", "string"]).nullish(),
2344
- entity: z18.string().nullish(),
2345
- metric: z18.string().nullish(),
2346
- name: z18.string().nullish(),
2347
- unit: z18.string().nullish()
2459
+ manifest: z20.array(
2460
+ z20.object({
2461
+ dtype: z20.enum(["boolean", "date", "datetime", "number", "string"]).nullish(),
2462
+ entity: z20.string().nullish(),
2463
+ metric: z20.string().nullish(),
2464
+ name: z20.string().nullish(),
2465
+ unit: z20.string().nullish()
2348
2466
  })
2349
2467
  ).nullish()
2350
2468
  }).passthrough();
2351
- var takoCardSchema = z18.object({
2352
- card_id: z18.string().nullish(),
2353
- title: z18.string().nullish(),
2354
- description: z18.string().nullish(),
2355
- semantic_description: z18.string().nullish(),
2356
- webpage_url: z18.string().nullish(),
2357
- image_url: z18.string().nullish(),
2358
- embed_url: z18.string().nullish(),
2359
- sources: z18.array(
2360
- z18.object({
2361
- source_name: z18.string().nullish(),
2362
- source_description: z18.string().nullish(),
2363
- source_index: z18.enum(["data", "web"]),
2364
- source_text: z18.string().nullish(),
2365
- url: z18.string().nullish()
2469
+ var takoCardSchema = z20.object({
2470
+ card_id: z20.string().nullish(),
2471
+ title: z20.string().nullish(),
2472
+ description: z20.string().nullish(),
2473
+ semantic_description: z20.string().nullish(),
2474
+ webpage_url: z20.string().nullish(),
2475
+ image_url: z20.string().nullish(),
2476
+ embed_url: z20.string().nullish(),
2477
+ sources: z20.array(
2478
+ z20.object({
2479
+ source_name: z20.string().nullish(),
2480
+ source_description: z20.string().nullish(),
2481
+ source_index: z20.enum(["data", "web"]),
2482
+ source_text: z20.string().nullish(),
2483
+ url: z20.string().nullish()
2366
2484
  })
2367
2485
  ).nullish(),
2368
- methodologies: z18.array(
2369
- z18.object({
2370
- methodology_name: z18.string().nullable(),
2371
- methodology_description: z18.string().nullable()
2486
+ methodologies: z20.array(
2487
+ z20.object({
2488
+ methodology_name: z20.string().nullable(),
2489
+ methodology_description: z20.string().nullable()
2372
2490
  })
2373
2491
  ).nullish(),
2374
- source_indexes: z18.array(z18.enum(["data", "web"])).nullish(),
2375
- card_type: z18.string().nullish(),
2376
- relevance: z18.enum(["High", "Low", "Medium"]).nullish(),
2492
+ source_indexes: z20.array(z20.enum(["data", "web"])).nullish(),
2493
+ card_type: z20.string().nullish(),
2494
+ relevance: z20.enum(["High", "Low", "Medium"]).nullish(),
2377
2495
  content: takoResultContentSchema.nullish(),
2378
- exportable: z18.boolean().optional(),
2379
- nodes: z18.array(
2380
- z18.object({
2381
- id: z18.string(),
2382
- type: z18.enum(["entity", "metric"]),
2383
- name: z18.string(),
2384
- description: z18.string().nullish()
2496
+ exportable: z20.boolean().optional(),
2497
+ nodes: z20.array(
2498
+ z20.object({
2499
+ id: z20.string(),
2500
+ type: z20.enum(["entity", "metric"]),
2501
+ name: z20.string(),
2502
+ description: z20.string().nullish()
2385
2503
  })
2386
2504
  ).nullish(),
2387
- metric_definitions: z18.array(z18.object({ name: z18.string(), definition: z18.string() })).nullish(),
2388
- data_freshness: z18.object({
2389
- coverage_end: z18.string().nullish(),
2390
- data_as_of: z18.string().nullish(),
2391
- last_updated: z18.string().nullish()
2505
+ metric_definitions: z20.array(z20.object({ name: z20.string(), definition: z20.string() })).nullish(),
2506
+ data_freshness: z20.object({
2507
+ coverage_end: z20.string().nullish(),
2508
+ data_as_of: z20.string().nullish(),
2509
+ last_updated: z20.string().nullish()
2392
2510
  }).nullish()
2393
2511
  }).passthrough();
2394
- var takoWebResultSchema = z18.object({
2395
- title: z18.string(),
2396
- url: z18.string(),
2397
- snippet: z18.string().nullish(),
2398
- source_name: z18.string().nullish(),
2399
- publish_date: z18.string().nullish(),
2512
+ var takoWebResultSchema = z20.object({
2513
+ title: z20.string(),
2514
+ url: z20.string(),
2515
+ snippet: z20.string().nullish(),
2516
+ source_name: z20.string().nullish(),
2517
+ publish_date: z20.string().nullish(),
2400
2518
  content: takoResultContentSchema.nullish()
2401
2519
  }).passthrough();
2402
- var takoSearchOutputSchema = lazySchema13(
2403
- () => zodSchema13(
2404
- z18.union([
2405
- z18.object({
2406
- request_id: z18.string(),
2407
- cards: z18.array(takoCardSchema).optional(),
2408
- web_results: z18.array(takoWebResultSchema).optional(),
2409
- usage: z18.object({
2410
- total_cost_usd: z18.number(),
2411
- compute: z18.object({ cost_usd: z18.number() }).nullish(),
2412
- data: z18.object({ cost_usd: z18.number(), datasets: z18.number() }).nullish()
2520
+ var takoSearchOutputSchema = lazySchema15(
2521
+ () => zodSchema15(
2522
+ z20.union([
2523
+ z20.object({
2524
+ request_id: z20.string(),
2525
+ cards: z20.array(takoCardSchema).optional(),
2526
+ web_results: z20.array(takoWebResultSchema).optional(),
2527
+ usage: z20.object({
2528
+ total_cost_usd: z20.number(),
2529
+ compute: z20.object({ cost_usd: z20.number() }).nullish(),
2530
+ data: z20.object({ cost_usd: z20.number(), datasets: z20.number() }).nullish()
2413
2531
  }).nullish(),
2414
- related: z18.array(z18.object({}).passthrough()).nullish()
2532
+ related: z20.array(z20.object({}).passthrough()).nullish()
2415
2533
  }).passthrough(),
2416
- z18.object({
2417
- error: z18.enum([
2534
+ z20.object({
2535
+ error: z20.enum([
2418
2536
  "api_error",
2419
2537
  "configuration_error",
2420
2538
  "execution_error",
@@ -2423,13 +2541,13 @@ var takoSearchOutputSchema = lazySchema13(
2423
2541
  "timeout",
2424
2542
  "unknown_tool"
2425
2543
  ]),
2426
- statusCode: z18.number().optional(),
2427
- message: z18.string()
2544
+ statusCode: z20.number().optional(),
2545
+ message: z20.string()
2428
2546
  })
2429
2547
  ])
2430
2548
  )
2431
2549
  );
2432
- var takoSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
2550
+ var takoSearchToolFactory = createProviderToolFactoryWithOutputSchema6({
2433
2551
  id: "gateway.tako_search",
2434
2552
  inputSchema: takoSearchInputSchema,
2435
2553
  outputSchema: takoSearchOutputSchema
@@ -2438,6 +2556,20 @@ var takoSearch = (config = {}) => takoSearchToolFactory(config);
2438
2556
 
2439
2557
  // src/gateway-tools.ts
2440
2558
  var gatewayTools = {
2559
+ /**
2560
+ * Fetch page content using Browserbase's lightweight Fetch API.
2561
+ *
2562
+ * Supports raw, Markdown, and schema-driven JSON output as well as redirects,
2563
+ * proxy routing, and TLS controls.
2564
+ */
2565
+ browserbaseFetch,
2566
+ /**
2567
+ * Search the web using Browserbase's Search API for fast, structured results.
2568
+ *
2569
+ * Returns titles, URLs, and available publication metadata without requiring
2570
+ * a browser session.
2571
+ */
2572
+ browserbaseSearch,
2441
2573
  /**
2442
2574
  * Search the web using Exa for current information and token-efficient
2443
2575
  * excerpts optimized for agent workflows.
@@ -2483,7 +2615,7 @@ async function getVercelRequestId() {
2483
2615
  }
2484
2616
 
2485
2617
  // src/version.ts
2486
- var VERSION = true ? "3.0.201" : "0.0.0-test";
2618
+ var VERSION = true ? "3.0.202" : "0.0.0-test";
2487
2619
 
2488
2620
  // src/gateway-provider.ts
2489
2621
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";