@tool-bridge/server 0.1.0 → 0.3.0

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.
Files changed (107) hide show
  1. package/dist/airtable-V6446SVY.js +792 -0
  2. package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
  3. package/dist/amap-TTTVB6WS.js +755 -0
  4. package/dist/anthropic-JH3RA363.js +224 -0
  5. package/dist/apify-ETNN7ITU.js +262 -0
  6. package/dist/brave_search-3DDR2MMB.js +322 -0
  7. package/dist/chunk-CSJEZHQO.js +252 -0
  8. package/dist/chunk-JLTYA2B3.js +20121 -0
  9. package/dist/chunk-K7FVSFUX.js +333 -0
  10. package/dist/{chunk-6SMIQ6QU.js → chunk-KGYJEEBI.js} +2770 -21574
  11. package/dist/circleci-MX3TX3HC.js +409 -0
  12. package/dist/clerk-MRPORVF4.js +1036 -0
  13. package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
  14. package/dist/cohere-GPECP66S.js +197 -0
  15. package/dist/confluence-BN7LZ6BC.js +436 -0
  16. package/dist/convertapi-SBEOFOFQ.js +161 -0
  17. package/dist/currencyapi-P2YY7Y7P.js +306 -0
  18. package/dist/deepseek-MWB3NYIN.js +205 -0
  19. package/dist/docker_hub-3JSCIGQ3.js +946 -0
  20. package/dist/dropbox-RFIBDAXO.js +1308 -0
  21. package/dist/dub-YVP57ELQ.js +706 -0
  22. package/dist/e2b-NFSUHTZR.js +305 -0
  23. package/dist/exa-KTDY6IV3.js +360 -0
  24. package/dist/fal_ai-OCUENLNQ.js +405 -0
  25. package/dist/feishu-5CWBQ7E5.js +225 -0
  26. package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
  27. package/dist/figma-YULGANSA.js +798 -0
  28. package/dist/firehydrant-2V6YSYAP.js +573 -0
  29. package/dist/fixer-LTCDB3CJ.js +171 -0
  30. package/dist/fly-IXPKMAML.js +478 -0
  31. package/dist/front-KRFB4M5X.js +379 -0
  32. package/dist/geocodio-VVURKYHQ.js +236 -0
  33. package/dist/ghost-6J2RIOUB.js +341 -0
  34. package/dist/github-5Z6KQRYH.js +5410 -0
  35. package/dist/gmail-KU4NZ7VA.js +1894 -0
  36. package/dist/googlecalendar-X44DFFXG.js +2539 -0
  37. package/dist/googledocs-WSGLPKSF.js +1322 -0
  38. package/dist/grafana-4PKSSDXY.js +817 -0
  39. package/dist/graphhopper-DF65ZNGK.js +336 -0
  40. package/dist/index.d.ts +181 -2
  41. package/dist/index.js +2 -1
  42. package/dist/ip2proxy-UCAQ5P2J.js +118 -0
  43. package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
  44. package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
  45. package/dist/jina_ai-MRHPCSV5.js +119 -0
  46. package/dist/jira-EG7ZPOIW.js +627 -0
  47. package/dist/langsmith-FNO3RCOZ.js +597 -0
  48. package/dist/lemlist-SN6BJHSG.js +298 -0
  49. package/dist/linear-H3VU4PSD.js +2163 -0
  50. package/dist/logsnag-OY2JJT2H.js +167 -0
  51. package/dist/main.js +246 -2
  52. package/dist/mattermost-C5SQ7PGD.js +320 -0
  53. package/dist/mem0-LMLE5BFC.js +567 -0
  54. package/dist/memos-UWFAMBZC.js +781 -0
  55. package/dist/metabase-SRYDSDJ6.js +365 -0
  56. package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
  57. package/dist/mother_duck-CPGOFEXE.js +322 -0
  58. package/dist/ngrok-CDJFBSOM.js +375 -0
  59. package/dist/notes-DIVFH3P3.js +109 -0
  60. package/dist/notion-HGDKS4HK.js +945 -0
  61. package/dist/open_exchange_rates-COHHYJDD.js +216 -0
  62. package/dist/openai-4TRT66GW.js +795 -0
  63. package/dist/opengraph_io-YKVW4PXI.js +377 -0
  64. package/dist/openrouter-6CV7B7V5.js +444 -0
  65. package/dist/outline-YWDUK5F7.js +604 -0
  66. package/dist/paddle-MEU7HWDZ.js +464 -0
  67. package/dist/perplexity-MRQUDBIC.js +238 -0
  68. package/dist/pinecone-JI7X2TAF.js +599 -0
  69. package/dist/pipedrive-6JQPAW23.js +453 -0
  70. package/dist/polar-7BF56CMC.js +400 -0
  71. package/dist/posthog-YPU5ADEN.js +3462 -0
  72. package/dist/postmark-BEU5OFKU.js +441 -0
  73. package/dist/prerender-UT5GOOZH.js +180 -0
  74. package/dist/pubmed-3SGOE24Q.js +1052 -0
  75. package/dist/railway-CEK4GLRQ.js +452 -0
  76. package/dist/readwise-DXQUQU67.js +482 -0
  77. package/dist/render-7TGAU5AW.js +473 -0
  78. package/dist/replicate-VICFSQ5A.js +347 -0
  79. package/dist/resend-3E76WK3O.js +100 -0
  80. package/dist/rootly-36GY46BY.js +345 -0
  81. package/dist/scrapfly-VDVUYAHX.js +289 -0
  82. package/dist/scrapingbee-3KTPMAVY.js +247 -0
  83. package/dist/screenshot_fyi-LKG62C3J.js +116 -0
  84. package/dist/semantic_scholar-4WREECYO.js +626 -0
  85. package/dist/sentry-HUQTGXOV.js +1139 -0
  86. package/dist/shodan-SGRKU4KS.js +303 -0
  87. package/dist/shopify-YCZ4L5HT.js +620 -0
  88. package/dist/stripe-OEBKMELB.js +583 -0
  89. package/dist/supabase-I3DBY7L4.js +937 -0
  90. package/dist/tavily-B2YHCNRD.js +349 -0
  91. package/dist/telegram-2VYJELZX.js +1773 -0
  92. package/dist/telnyx-HHXD3CXL.js +237 -0
  93. package/dist/todoist-PHFDEEIS.js +672 -0
  94. package/dist/trello-WUSAK6YN.js +1091 -0
  95. package/dist/turso-FW56U2B3.js +432 -0
  96. package/dist/twilio-M5JI7XHA.js +321 -0
  97. package/dist/umami-HAYODRC4.js +411 -0
  98. package/dist/unsplash-EDPTNEHJ.js +364 -0
  99. package/dist/upstash_redis-GC2CLIWD.js +299 -0
  100. package/dist/uptimerobot-XMSNYLIT.js +481 -0
  101. package/dist/v2ex-KU4ECD65.js +672 -0
  102. package/dist/vercel-THPCEFHW.js +1096 -0
  103. package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
  104. package/dist/wordpress-O6TQEQNF.js +822 -0
  105. package/dist/workos-A3VHHWI3.js +681 -0
  106. package/dist/zhihu-BJAI64YJ.js +273 -0
  107. package/package.json +5 -4
@@ -0,0 +1,349 @@
1
+ import {
2
+ createProviderPlugin,
3
+ guardedFetch,
4
+ requireApiKey,
5
+ upstreamError
6
+ } from "./chunk-CSJEZHQO.js";
7
+ import "./chunk-K7FVSFUX.js";
8
+ import {
9
+ TBError,
10
+ external_exports
11
+ } from "./chunk-JLTYA2B3.js";
12
+ import "./chunk-MLKGABMK.js";
13
+
14
+ // ../plugins/src/tavily/api.ts
15
+ var SERVICE = "tavily";
16
+ var API_BASE = "https://api.tavily.com";
17
+ var REQUEST_TIMEOUT_MS = 3e4;
18
+ function record(value) {
19
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
20
+ }
21
+ function text(value) {
22
+ if (typeof value !== "string") return void 0;
23
+ const trimmed = value.trim();
24
+ return trimmed === "" ? void 0 : trimmed;
25
+ }
26
+ function errorMessage(payload, status) {
27
+ if (typeof payload === "string" && payload.trim() !== "") return payload;
28
+ const body = record(payload);
29
+ return text(body?.detail) ?? text(body?.error) ?? text(body?.message) ?? `Tavily \u8FD4\u56DE HTTP ${status}`;
30
+ }
31
+ async function request(ctx, options) {
32
+ const headers = {
33
+ accept: "application/json",
34
+ authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
35
+ };
36
+ if (options.body !== void 0) headers["content-type"] = "application/json";
37
+ let response;
38
+ try {
39
+ response = await guardedFetch(`${API_BASE}${options.path}`, {
40
+ method: options.method,
41
+ headers,
42
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
43
+ ...options.body === void 0 ? {} : { body: JSON.stringify(options.body) }
44
+ });
45
+ } catch (error) {
46
+ if (error instanceof TBError) throw error;
47
+ if (error instanceof Error && error.name === "TimeoutError") {
48
+ throw upstreamError(504, `Tavily ${REQUEST_TIMEOUT_MS / 1e3}s \u5185\u6CA1\u6709\u8FD4\u56DE`);
49
+ }
50
+ throw upstreamError(502, error instanceof Error ? `Tavily \u8BF7\u6C42\u5931\u8D25:${error.message}` : "Tavily \u8BF7\u6C42\u5931\u8D25");
51
+ }
52
+ const raw = await response.text().catch(() => "");
53
+ let payload = null;
54
+ if (raw !== "") {
55
+ try {
56
+ payload = JSON.parse(raw);
57
+ } catch {
58
+ if (response.ok) throw upstreamError(502, "Tavily \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94");
59
+ payload = raw;
60
+ }
61
+ }
62
+ if (!response.ok) throw upstreamError(response.status, errorMessage(payload, response.status));
63
+ if (raw === "") return {};
64
+ const result = record(payload);
65
+ if (result === void 0) throw upstreamError(502, "Tavily \u54CD\u5E94\u4E0D\u662F\u5BF9\u8C61");
66
+ return result;
67
+ }
68
+ function search(input, ctx) {
69
+ return request(ctx, { method: "POST", path: "/search", body: input });
70
+ }
71
+ function extract(input, ctx) {
72
+ return request(ctx, { method: "POST", path: "/extract", body: input });
73
+ }
74
+ function map(input, ctx) {
75
+ return request(ctx, { method: "POST", path: "/map", body: input });
76
+ }
77
+ function crawl(input, ctx) {
78
+ return request(ctx, { method: "POST", path: "/crawl", body: input });
79
+ }
80
+ function createResearch(input, ctx) {
81
+ return request(ctx, { method: "POST", path: "/research", body: input });
82
+ }
83
+ function getResearch(input, ctx) {
84
+ return request(ctx, { method: "GET", path: `/research/${encodeURIComponent(input.request_id)}` });
85
+ }
86
+ function getUsage(_input, ctx) {
87
+ return request(ctx, { method: "GET", path: "/usage" });
88
+ }
89
+
90
+ // ../plugins/src/tavily/schema.ts
91
+ var searchInput = external_exports.strictObject({
92
+ query: external_exports.string().min(1).describe("The search query to execute with Tavily."),
93
+ search_depth: external_exports.enum(["advanced", "basic", "fast", "ultra-fast"]).describe("Controls the latency-versus-relevance tradeoff for Tavily Search.").optional(),
94
+ chunks_per_source: external_exports.int().min(1).max(3).describe("The maximum number of chunks to return per source.").optional(),
95
+ max_results: external_exports.int().min(0).max(20).describe("The maximum number of search results to return.").optional(),
96
+ topic: external_exports.enum(["general", "news", "finance"]).describe("The search category used by Tavily.").optional(),
97
+ time_range: external_exports.enum(["day", "week", "month", "year", "d", "w", "m", "y"]).describe("The date range shortcut used to filter results.").optional(),
98
+ start_date: external_exports.iso.date().describe("Only return results after this YYYY-MM-DD date.").optional(),
99
+ end_date: external_exports.iso.date().describe("Only return results before this YYYY-MM-DD date.").optional(),
100
+ include_answer: external_exports.union([external_exports.boolean().describe("Whether to include an answer."), external_exports.enum(["basic", "advanced"]).describe("The answer detail level.")]).optional(),
101
+ include_raw_content: external_exports.union([external_exports.boolean().describe("Whether to include raw content."), external_exports.enum(["markdown", "text"]).describe("The raw content format.")]).optional(),
102
+ include_images: external_exports.boolean().describe("Whether to include top-level and per-result images.").optional(),
103
+ include_image_descriptions: external_exports.boolean().describe("Whether to include descriptions for returned images.").optional(),
104
+ include_favicon: external_exports.boolean().describe("Whether to include favicons for returned results.").optional(),
105
+ include_domains: external_exports.array(external_exports.string().min(1).describe("A domain name to include.")).min(1).describe("Domains that Tavily should include in the search results.").optional(),
106
+ exclude_domains: external_exports.array(external_exports.string().min(1).describe("A domain name to exclude.")).min(1).describe("Domains that Tavily should exclude from the search results.").optional(),
107
+ country: external_exports.string().describe("A country name used to boost results for general searches.").optional(),
108
+ auto_parameters: external_exports.boolean().describe("Whether Tavily should auto-configure search parameters.").optional(),
109
+ exact_match: external_exports.boolean().describe("Whether Tavily should require quoted exact phrases to match exactly.").optional(),
110
+ include_usage: external_exports.boolean().describe("Whether to include credit usage details in the response.").optional()
111
+ }).describe("The input payload for a Tavily Search request.");
112
+ var searchOutput = external_exports.looseObject({
113
+ query: external_exports.string().describe("The search query that was executed."),
114
+ results: external_exports.array(external_exports.looseObject({
115
+ title: external_exports.string().describe("The source title.").optional(),
116
+ url: external_exports.string().describe("The source URL.").optional(),
117
+ content: external_exports.string().describe("The extracted snippet or summary for the source.").optional(),
118
+ score: external_exports.number().describe("The relevance score of the source.").optional(),
119
+ raw_content: external_exports.string().describe("The cleaned page content when include_raw_content is enabled.").nullable().optional(),
120
+ favicon: external_exports.string().describe("The favicon URL for the result when include_favicon is enabled.").nullable().optional(),
121
+ images: external_exports.array(external_exports.looseObject({
122
+ url: external_exports.string().describe("The image URL.").optional(),
123
+ description: external_exports.string().describe("A short description for the image.").optional()
124
+ }).describe("An image item returned by Tavily.")).describe("Images extracted from this result.").optional(),
125
+ published_date: external_exports.string().describe("The published date for the result when Tavily can determine it.").optional()
126
+ }).describe("A single Tavily search result.")).describe("The ranked search results returned by Tavily."),
127
+ response_time: external_exports.union([external_exports.number().describe("The total response time reported by Tavily."), external_exports.string().describe("The total response time reported by Tavily.")]),
128
+ request_id: external_exports.string().describe("A unique request identifier for Tavily support and debugging."),
129
+ answer: external_exports.string().describe("A Tavily-generated answer for the query."),
130
+ images: external_exports.array(external_exports.looseObject({
131
+ url: external_exports.string().describe("The image URL.").optional(),
132
+ description: external_exports.string().describe("A short description for the image.").optional()
133
+ }).describe("An image item returned by Tavily.")).describe("Query-related images returned by Tavily."),
134
+ auto_parameters: external_exports.looseObject({}).describe("Auto-selected parameters returned by Tavily when enabled."),
135
+ usage: external_exports.looseObject({
136
+ credits: external_exports.number().describe("The number of API credits consumed by the request.").optional()
137
+ }).describe("Credit usage details returned by Tavily.")
138
+ }).describe("The Tavily Search response payload.");
139
+ var extractInput = external_exports.strictObject({
140
+ urls: external_exports.array(external_exports.url().describe("A source URL.")).min(1).describe("The URLs that Tavily should extract content from."),
141
+ query: external_exports.string().describe("An optional query used to rerank extracted chunks.").optional(),
142
+ chunks_per_source: external_exports.int().min(1).max(5).describe("The maximum number of chunks to return per source when query is provided.").optional(),
143
+ extract_depth: external_exports.enum(["basic", "advanced"]).describe("Controls whether Tavily uses basic or advanced extraction.").optional(),
144
+ include_images: external_exports.boolean().describe("Whether to include images found on each page.").optional(),
145
+ include_favicon: external_exports.boolean().describe("Whether to include the favicon URL for each page.").optional(),
146
+ format: external_exports.enum(["markdown", "text"]).describe("The format of the extracted page content.").optional(),
147
+ timeout: external_exports.number().min(1).max(60).describe("The extraction timeout in seconds.").optional(),
148
+ include_usage: external_exports.boolean().describe("Whether to include credit usage details in the response.").optional()
149
+ }).describe("The input payload for a Tavily Extract request.");
150
+ var extractOutput = external_exports.looseObject({
151
+ results: external_exports.array(external_exports.looseObject({
152
+ url: external_exports.string().describe("The processed source URL.").optional(),
153
+ raw_content: external_exports.string().describe("The extracted page content in the selected format.").optional(),
154
+ images: external_exports.array(external_exports.looseObject({
155
+ url: external_exports.string().describe("The image URL.").optional(),
156
+ description: external_exports.string().describe("A short description for the image.").optional()
157
+ }).describe("An image item returned by Tavily.")).describe("Images extracted from the source.").optional(),
158
+ favicon: external_exports.string().describe("The favicon URL for the source when include_favicon is enabled.").optional()
159
+ }).describe("An extracted Tavily result item.")).describe("The successful extraction results returned by Tavily."),
160
+ failed_results: external_exports.array(external_exports.looseObject({
161
+ url: external_exports.string().describe("The source URL that failed.").optional(),
162
+ error: external_exports.string().describe("The failure reason returned by Tavily.").optional()
163
+ }).describe("A failed Tavily extraction result.")).describe("URLs that Tavily could not extract successfully."),
164
+ response_time: external_exports.number().describe("The total response time reported by Tavily."),
165
+ request_id: external_exports.string().describe("A unique request identifier for Tavily support and debugging."),
166
+ usage: external_exports.looseObject({
167
+ credits: external_exports.number().describe("The number of API credits consumed by the request.").optional()
168
+ }).describe("Credit usage details returned by Tavily.")
169
+ }).describe("The Tavily Extract response payload.");
170
+ var mapInput = external_exports.strictObject({
171
+ url: external_exports.url().describe("The root URL that Tavily should map."),
172
+ instructions: external_exports.string().describe("Natural-language instructions that guide the mapping.").optional(),
173
+ max_depth: external_exports.int().min(1).max(5).describe("The maximum mapping depth.").optional(),
174
+ max_breadth: external_exports.int().min(1).max(500).describe("The maximum number of links to follow per level.").optional(),
175
+ limit: external_exports.int().min(1).describe("The maximum number of links Tavily should process.").optional(),
176
+ select_paths: external_exports.array(external_exports.string().min(1).describe("A path selection pattern.")).min(1).describe("Regex patterns used to include only matching URL paths.").optional(),
177
+ select_domains: external_exports.array(external_exports.string().min(1).describe("A domain selection pattern.")).min(1).describe("Regex patterns used to include only matching domains.").optional(),
178
+ exclude_paths: external_exports.array(external_exports.string().min(1).describe("A path exclusion pattern.")).min(1).describe("Regex patterns used to exclude matching URL paths.").optional(),
179
+ exclude_domains: external_exports.array(external_exports.string().min(1).describe("A domain exclusion pattern.")).min(1).describe("Regex patterns used to exclude matching domains.").optional(),
180
+ allow_external: external_exports.boolean().describe("Whether external domain links can appear in the results.").optional(),
181
+ timeout: external_exports.number().min(10).max(150).describe("The mapping timeout in seconds.").optional(),
182
+ include_usage: external_exports.boolean().describe("Whether to include credit usage details in the response.").optional()
183
+ }).describe("The input payload for a Tavily Map request.");
184
+ var mapOutput = external_exports.looseObject({
185
+ base_url: external_exports.string().describe("The base URL that Tavily mapped."),
186
+ results: external_exports.array(external_exports.string().min(1)).describe("The URLs discovered during the mapping operation."),
187
+ response_time: external_exports.number().describe("The total response time reported by Tavily."),
188
+ request_id: external_exports.string().describe("A unique request identifier for Tavily support and debugging."),
189
+ usage: external_exports.looseObject({
190
+ credits: external_exports.number().describe("The number of API credits consumed by the request.").optional()
191
+ }).describe("Credit usage details returned by Tavily.")
192
+ }).describe("The Tavily Map response payload.");
193
+ var crawlInput = external_exports.strictObject({
194
+ url: external_exports.url().describe("The root URL that Tavily should crawl."),
195
+ instructions: external_exports.string().describe("Natural-language instructions that guide the crawl.").optional(),
196
+ max_depth: external_exports.int().min(1).max(5).describe("The maximum crawl depth.").optional(),
197
+ max_breadth: external_exports.int().min(1).max(500).describe("The maximum number of links to follow per crawl level.").optional(),
198
+ limit: external_exports.int().min(1).describe("The maximum number of links Tavily should process.").optional(),
199
+ select_paths: external_exports.array(external_exports.string().min(1).describe("A path selection pattern.")).min(1).describe("Regex patterns used to include only matching URL paths.").optional(),
200
+ select_domains: external_exports.array(external_exports.string().min(1).describe("A domain selection pattern.")).min(1).describe("Regex patterns used to include only matching domains.").optional(),
201
+ exclude_paths: external_exports.array(external_exports.string().min(1).describe("A path exclusion pattern.")).min(1).describe("Regex patterns used to exclude matching URL paths.").optional(),
202
+ exclude_domains: external_exports.array(external_exports.string().min(1).describe("A domain exclusion pattern.")).min(1).describe("Regex patterns used to exclude matching domains.").optional(),
203
+ allow_external: external_exports.boolean().describe("Whether external domain links can appear in the results.").optional(),
204
+ include_images: external_exports.boolean().describe("Whether to include images in crawled results.").optional(),
205
+ extract_depth: external_exports.enum(["basic", "advanced"]).describe("Controls whether Tavily uses basic or advanced extraction.").optional(),
206
+ format: external_exports.enum(["markdown", "text"]).describe("The format of the extracted page content.").optional(),
207
+ include_favicon: external_exports.boolean().describe("Whether to include a favicon URL for each crawled result.").optional(),
208
+ timeout: external_exports.number().min(10).max(150).describe("The crawl timeout in seconds.").optional(),
209
+ include_usage: external_exports.boolean().describe("Whether to include credit usage details in the response.").optional()
210
+ }).describe("The input payload for a Tavily Crawl request.");
211
+ var crawlOutput = external_exports.looseObject({
212
+ base_url: external_exports.string().describe("The base URL that Tavily crawled."),
213
+ results: external_exports.array(external_exports.looseObject({
214
+ url: external_exports.string().describe("The processed source URL.").optional(),
215
+ raw_content: external_exports.string().describe("The extracted page content in the selected format.").optional(),
216
+ images: external_exports.array(external_exports.looseObject({
217
+ url: external_exports.string().describe("The image URL.").optional(),
218
+ description: external_exports.string().describe("A short description for the image.").optional()
219
+ }).describe("An image item returned by Tavily.")).describe("Images extracted from the source.").optional(),
220
+ favicon: external_exports.string().describe("The favicon URL for the source when include_favicon is enabled.").optional()
221
+ }).describe("An extracted Tavily result item.")).describe("The extracted results returned by Tavily Crawl."),
222
+ response_time: external_exports.number().describe("The total response time reported by Tavily."),
223
+ request_id: external_exports.string().describe("A unique request identifier for Tavily support and debugging."),
224
+ usage: external_exports.looseObject({
225
+ credits: external_exports.number().describe("The number of API credits consumed by the request.").optional()
226
+ }).describe("Credit usage details returned by Tavily.")
227
+ }).describe("The Tavily Crawl response payload.");
228
+ var createResearchInput = external_exports.strictObject({
229
+ input: external_exports.string().min(1).describe("The research task or question to investigate."),
230
+ model: external_exports.enum(["mini", "pro", "auto"]).describe("Research model to use.").optional(),
231
+ stream: external_exports.literal(false).describe("Must be false or omitted. Tavily SSE streaming is not supported.").optional(),
232
+ output_schema: external_exports.looseObject({}).describe("JSON Schema for structured research output.").optional(),
233
+ citation_format: external_exports.enum(["numbered", "mla", "apa", "chicago"]).describe("The format for citations in the research report.").optional(),
234
+ include_domains: external_exports.array(external_exports.string().min(1).describe("A domain to prioritize.")).max(20).describe("Soft source preference domains.").optional(),
235
+ exclude_domains: external_exports.array(external_exports.string().min(1).describe("A domain to exclude.")).max(20).describe("Hard source blocklist domains.").optional(),
236
+ output_length: external_exports.enum(["short", "standard", "long"]).describe("The target research response length.").optional(),
237
+ files: external_exports.array(external_exports.strictObject({
238
+ name: external_exports.string().min(1).describe("The file name, including extension."),
239
+ data: external_exports.string().min(1).describe("The base64-encoded file contents."),
240
+ type: external_exports.literal("base64").describe("The encoded file content type.")
241
+ }).describe("A base64-encoded .txt, .md, or .json file attached to a Tavily Research request.")).min(1).max(5).describe("Up to 5 .txt, .md, or .json files to use as additional research sources.").optional()
242
+ }).describe("The input payload for creating a Tavily Research task.");
243
+ var createResearchOutput = external_exports.looseObject({
244
+ request_id: external_exports.string().min(1).describe("A unique identifier for the research task.").optional(),
245
+ status: external_exports.enum(["pending", "in_progress", "completed", "failed"]).describe("The current research task status.").optional(),
246
+ input: external_exports.string().describe("The research task or question investigated.").optional(),
247
+ model: external_exports.enum(["mini", "pro", "auto"]).describe("The model used by the research agent.").optional(),
248
+ content: external_exports.unknown().describe("The final research report content.").optional(),
249
+ sources: external_exports.array(external_exports.looseObject({}).describe("A source used in a Tavily Research result.")).describe("Sources used in the research.").optional(),
250
+ response_time: external_exports.number().describe("The response time reported by Tavily.").optional()
251
+ }).describe("A Tavily Research task response.");
252
+ var getResearchInput = external_exports.strictObject({
253
+ request_id: external_exports.string().min(1).describe("The unique identifier of the research task.")
254
+ }).describe("The input payload for retrieving a Tavily Research task.");
255
+ var getResearchOutput = external_exports.looseObject({
256
+ request_id: external_exports.string().min(1).describe("A unique identifier for the research task.").optional(),
257
+ status: external_exports.enum(["pending", "in_progress", "completed", "failed"]).describe("The current research task status.").optional(),
258
+ input: external_exports.string().describe("The research task or question investigated.").optional(),
259
+ model: external_exports.enum(["mini", "pro", "auto"]).describe("The model used by the research agent.").optional(),
260
+ content: external_exports.unknown().describe("The final research report content.").optional(),
261
+ sources: external_exports.array(external_exports.looseObject({}).describe("A source used in a Tavily Research result.")).describe("Sources used in the research.").optional(),
262
+ response_time: external_exports.number().describe("The response time reported by Tavily.").optional()
263
+ }).describe("A Tavily Research task response.");
264
+ var getUsageInput = external_exports.strictObject({}).describe("The input payload for a Tavily usage request.");
265
+ var getUsageOutput = external_exports.strictObject({
266
+ key: external_exports.looseObject({
267
+ usage: external_exports.number().describe("The total usage for the API key.").optional(),
268
+ limit: external_exports.number().describe("The usage limit for the API key.").optional(),
269
+ search_usage: external_exports.number().describe("Search credits consumed by the API key.").optional(),
270
+ extract_usage: external_exports.number().describe("Extract credits consumed by the API key.").optional(),
271
+ crawl_usage: external_exports.number().describe("Crawl credits consumed by the API key.").optional(),
272
+ map_usage: external_exports.number().describe("Map credits consumed by the API key.").optional(),
273
+ research_usage: external_exports.number().describe("Research credits consumed by the API key.").optional()
274
+ }).describe("Usage details for the specific API key."),
275
+ account: external_exports.looseObject({
276
+ current_plan: external_exports.string().describe("The current account plan name.").optional(),
277
+ plan_usage: external_exports.number().describe("The total plan usage for the account.").optional(),
278
+ plan_limit: external_exports.number().describe("The plan limit for the account.").optional(),
279
+ paygo_usage: external_exports.number().describe("The pay-as-you-go usage for the account.").optional(),
280
+ paygo_limit: external_exports.number().describe("The pay-as-you-go limit for the account.").optional()
281
+ }).describe("Plan and usage information for the account.")
282
+ }).describe("The Tavily usage response payload.");
283
+ var tavilyActions = {
284
+ search: {
285
+ description: "Execute a Tavily Search query and return ranked source results.",
286
+ effect: "write",
287
+ inputSchema: searchInput,
288
+ outputSchema: external_exports.toJSONSchema(searchOutput, { io: "output", unrepresentable: "any" })
289
+ },
290
+ extract: {
291
+ description: "Extract structured page content from one or more URLs with Tavily.",
292
+ effect: "write",
293
+ inputSchema: extractInput,
294
+ outputSchema: external_exports.toJSONSchema(extractOutput, { io: "output", unrepresentable: "any" })
295
+ },
296
+ map: {
297
+ description: "Discover URLs from a website with Tavily Map.",
298
+ effect: "write",
299
+ inputSchema: mapInput,
300
+ outputSchema: external_exports.toJSONSchema(mapOutput, { io: "output", unrepresentable: "any" })
301
+ },
302
+ crawl: {
303
+ description: "Crawl a website and extract content from discovered pages with Tavily.",
304
+ effect: "write",
305
+ inputSchema: crawlInput,
306
+ outputSchema: external_exports.toJSONSchema(crawlOutput, { io: "output", unrepresentable: "any" })
307
+ },
308
+ create_research: {
309
+ description: "Start an asynchronous Tavily Research task and return a request ID for polling.",
310
+ effect: "write",
311
+ inputSchema: createResearchInput,
312
+ outputSchema: external_exports.toJSONSchema(createResearchOutput, { io: "output", unrepresentable: "any" })
313
+ },
314
+ get_research: {
315
+ description: "Get the current status and result for a Tavily Research task.",
316
+ effect: "read",
317
+ inputSchema: getResearchInput,
318
+ outputSchema: external_exports.toJSONSchema(getResearchOutput, { io: "output", unrepresentable: "any" })
319
+ },
320
+ get_usage: {
321
+ description: "Get API key and account usage details from Tavily.",
322
+ effect: "read",
323
+ inputSchema: getUsageInput,
324
+ outputSchema: external_exports.toJSONSchema(getUsageOutput, { io: "output", unrepresentable: "any" })
325
+ }
326
+ };
327
+
328
+ // ../plugins/src/tavily/index.ts
329
+ function createTavilyPlugin() {
330
+ return createProviderPlugin({
331
+ description: "Tavily",
332
+ actions: tavilyActions,
333
+ credentialProbe: "get_usage",
334
+ handlers: {
335
+ search,
336
+ extract,
337
+ map,
338
+ crawl,
339
+ create_research: createResearch,
340
+ get_research: getResearch,
341
+ get_usage: getUsage
342
+ }
343
+ });
344
+ }
345
+ var tavily_default = createTavilyPlugin();
346
+ export {
347
+ createTavilyPlugin,
348
+ tavily_default as default
349
+ };