@tool-bridge/server 0.21.1 → 0.22.1

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 (178) hide show
  1. package/dist/admin.js +170 -0
  2. package/dist/airtable-ML2GIGCH.js +790 -0
  3. package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
  4. package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
  5. package/dist/anthropic-6ZK24TBB.js +203 -0
  6. package/dist/apify-VDGYHP6W.js +248 -0
  7. package/dist/brave_search-TAATLZOS.js +302 -0
  8. package/dist/chunk-2IAI3XQM.js +302 -0
  9. package/dist/chunk-7ISGFRC6.js +161 -0
  10. package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
  11. package/dist/chunk-HA4BGL6C.js +8429 -0
  12. package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
  13. package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
  14. package/dist/chunk-U7PTOA3U.js +7320 -0
  15. package/dist/chunk-UY6ANCOY.js +378 -0
  16. package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
  17. package/dist/circleci-BQ2UWXL2.js +389 -0
  18. package/dist/clerk-2JYWQNOI.js +1019 -0
  19. package/dist/cohere-6MI7AQM4.js +185 -0
  20. package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
  21. package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
  22. package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
  23. package/dist/deepseek-OSPASO7O.js +210 -0
  24. package/dist/docker_hub-3ATQOY5L.js +933 -0
  25. package/dist/dropbox-LSA4GM2Y.js +1305 -0
  26. package/dist/dub-VZPJSPI6.js +680 -0
  27. package/dist/e2b-6SDYQZL2.js +278 -0
  28. package/dist/exa-B6EUYDVP.js +332 -0
  29. package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
  30. package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
  31. package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
  32. package/dist/figma-OUKSZLD5.js +777 -0
  33. package/dist/firehydrant-7MOYL7QH.js +563 -0
  34. package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
  35. package/dist/fly-PXKY6PNH.js +469 -0
  36. package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
  37. package/dist/geocodio-NSYO7TFP.js +213 -0
  38. package/dist/ghost-QBKKQQMF.js +338 -0
  39. package/dist/github-ENLSJ4CL.js +5421 -0
  40. package/dist/gmail-KQSDEB47.js +1887 -0
  41. package/dist/googlecalendar-5YCX4SZF.js +2524 -0
  42. package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
  43. package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
  44. package/dist/graphhopper-CURBVHYK.js +325 -0
  45. package/dist/index.d.ts +1132 -332
  46. package/dist/index.js +31 -14
  47. package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
  48. package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
  49. package/dist/ipqualityscore-OT63L4TI.js +279 -0
  50. package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
  51. package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
  52. package/dist/langsmith-IM5N4YAU.js +593 -0
  53. package/dist/lemlist-277SHUQF.js +289 -0
  54. package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
  55. package/dist/logsnag-VEWRAGBG.js +150 -0
  56. package/dist/main.js +57 -280
  57. package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
  58. package/dist/mem0-AXS7GZGI.js +544 -0
  59. package/dist/memos-7TXG4ZTU.js +744 -0
  60. package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
  61. package/dist/mistral_ai-YZ52RGD4.js +1196 -0
  62. package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
  63. package/dist/ngrok-4O4W3WZW.js +356 -0
  64. package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
  65. package/dist/notion-4W4O7J7V.js +940 -0
  66. package/dist/open_exchange_rates-23QJXVO5.js +215 -0
  67. package/dist/openai-ZS7GLSLH.js +800 -0
  68. package/dist/opengraph_io-PMVH7OYI.js +362 -0
  69. package/dist/openrouter-ONRGFNB6.js +441 -0
  70. package/dist/outline-UCUYZZ7J.js +599 -0
  71. package/dist/paddle-35HTKTUL.js +454 -0
  72. package/dist/perplexity-NVOBYN24.js +220 -0
  73. package/dist/pinecone-55CJY73C.js +571 -0
  74. package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
  75. package/dist/polar-SM4ZM53B.js +395 -0
  76. package/dist/posthog-NWCXVXNJ.js +3464 -0
  77. package/dist/postmark-QJV5PHUQ.js +427 -0
  78. package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
  79. package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
  80. package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
  81. package/dist/readwise-AGHTQB42.js +470 -0
  82. package/dist/render-O4HBROCK.js +461 -0
  83. package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
  84. package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
  85. package/dist/rootly-XGCUDW6X.js +336 -0
  86. package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
  87. package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
  88. package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
  89. package/dist/semantic_scholar-3UJRLKES.js +611 -0
  90. package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
  91. package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
  92. package/dist/shopify-LJ2EV2HH.js +610 -0
  93. package/dist/stripe-3LHMV55K.js +585 -0
  94. package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
  95. package/dist/tavily-FBEWGH3Z.js +326 -0
  96. package/dist/telegram-MYYO3JND.js +1767 -0
  97. package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
  98. package/dist/todoist-OBWICA5Q.js +664 -0
  99. package/dist/trello-GUFUJRWO.js +1080 -0
  100. package/dist/turso-NIAK4UMS.js +416 -0
  101. package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
  102. package/dist/umami-42RS2EPS.js +389 -0
  103. package/dist/unsplash-V7TOTETT.js +351 -0
  104. package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
  105. package/dist/uptimerobot-AZC2DHOT.js +483 -0
  106. package/dist/v2ex-4TVRNMLS.js +667 -0
  107. package/dist/vercel-DPHTJ3XR.js +1076 -0
  108. package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
  109. package/dist/wordpress-KMPKVGUX.js +812 -0
  110. package/dist/workos-PKB2YR7S.js +664 -0
  111. package/dist/zhihu-Y4H4XYPB.js +254 -0
  112. package/package.json +18 -9
  113. package/dist/airtable-LLZDFN7M.js +0 -789
  114. package/dist/anthropic-G23NN3X5.js +0 -202
  115. package/dist/apify-Y3SS734K.js +0 -247
  116. package/dist/brave_search-ZC7OAPSZ.js +0 -301
  117. package/dist/chunk-R6P4XAE5.js +0 -248
  118. package/dist/chunk-U7B6DS2O.js +0 -977
  119. package/dist/chunk-UZM2RXZH.js +0 -23436
  120. package/dist/circleci-3BAX5FCG.js +0 -388
  121. package/dist/clerk-6LEM6TNU.js +0 -1019
  122. package/dist/cloudflare_dns-KINYTJUD.js +0 -588
  123. package/dist/cohere-XCJ5AJ6B.js +0 -185
  124. package/dist/deepseek-PC5YGNC5.js +0 -209
  125. package/dist/docker_hub-C3MA5FU6.js +0 -932
  126. package/dist/dropbox-XBV7Z2IR.js +0 -1304
  127. package/dist/dub-LDOFG3HC.js +0 -679
  128. package/dist/e2b-JMCPSVBW.js +0 -277
  129. package/dist/exa-RAK7O7RD.js +0 -331
  130. package/dist/figma-E6IX5DTH.js +0 -773
  131. package/dist/firehydrant-ZBLPQREE.js +0 -562
  132. package/dist/fly-ZH3HFCZJ.js +0 -468
  133. package/dist/geocodio-YGNI7DA4.js +0 -212
  134. package/dist/ghost-EVSGKH2Q.js +0 -337
  135. package/dist/github-MA2BGRCJ.js +0 -5420
  136. package/dist/gmail-E5E6AADE.js +0 -1886
  137. package/dist/googlecalendar-BTLFPXTD.js +0 -2523
  138. package/dist/graphhopper-WSMB3TCD.js +0 -324
  139. package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
  140. package/dist/ipqualityscore-BHJXVTJT.js +0 -277
  141. package/dist/langsmith-5W6SCT6F.js +0 -592
  142. package/dist/lemlist-HJWH6UMK.js +0 -288
  143. package/dist/logsnag-4KFOHL37.js +0 -150
  144. package/dist/mem0-CAW43CIC.js +0 -543
  145. package/dist/memos-TWEGPKFM.js +0 -740
  146. package/dist/mistral_ai-64BGZQHP.js +0 -1195
  147. package/dist/ngrok-GQCUGZKJ.js +0 -356
  148. package/dist/notion-DQWZWP4N.js +0 -936
  149. package/dist/open_exchange_rates-QMMD735E.js +0 -214
  150. package/dist/openai-W6PX32NZ.js +0 -799
  151. package/dist/opengraph_io-HNDBXYNW.js +0 -361
  152. package/dist/openrouter-JJYMEAUL.js +0 -437
  153. package/dist/outline-MCBNQZYY.js +0 -595
  154. package/dist/paddle-D2SKLUDN.js +0 -453
  155. package/dist/perplexity-XIFMKUAE.js +0 -219
  156. package/dist/pinecone-HUFTALV2.js +0 -570
  157. package/dist/polar-TYTOMOSR.js +0 -394
  158. package/dist/posthog-43JAR3VW.js +0 -3463
  159. package/dist/postmark-KL2QJYSG.js +0 -426
  160. package/dist/readwise-CI4GIMMJ.js +0 -469
  161. package/dist/render-SUBJ6YRZ.js +0 -460
  162. package/dist/rootly-CD2LJHPI.js +0 -336
  163. package/dist/semantic_scholar-T4A252KW.js +0 -610
  164. package/dist/shopify-Y2HN2MCQ.js +0 -609
  165. package/dist/stripe-VE3CD3AY.js +0 -584
  166. package/dist/tavily-KCZHK6HE.js +0 -326
  167. package/dist/telegram-3URFBCMY.js +0 -1766
  168. package/dist/todoist-HNPWNYTD.js +0 -663
  169. package/dist/trello-3W2MIXRP.js +0 -1079
  170. package/dist/turso-2EQF7C2Z.js +0 -415
  171. package/dist/umami-5REN7TGP.js +0 -388
  172. package/dist/unsplash-EIXL424F.js +0 -350
  173. package/dist/uptimerobot-KNJ3EYLY.js +0 -482
  174. package/dist/v2ex-RHJ234PZ.js +0 -666
  175. package/dist/vercel-AS6NCIC7.js +0 -1075
  176. package/dist/wordpress-KNDAAUV7.js +0 -811
  177. package/dist/workos-R6UITSJ7.js +0 -663
  178. package/dist/zhihu-AGK4HILK.js +0 -253
@@ -1,277 +0,0 @@
1
- import {
2
- createAuthedClient
3
- } from "./chunk-XYBU3WZH.js";
4
- import "./chunk-E6JCVKW6.js";
5
- import {
6
- asJsonObject,
7
- compactDefined,
8
- trimmedText
9
- } from "./chunk-JXHMDBAY.js";
10
- import {
11
- createProviderPlugin,
12
- upstreamError
13
- } from "./chunk-ATK45BXV.js";
14
- import "./chunk-U7B6DS2O.js";
15
- import {
16
- TBError,
17
- external_exports
18
- } from "./chunk-UZM2RXZH.js";
19
- import "./chunk-U67V476Y.js";
20
-
21
- // ../plugins/src/e2b/api.ts
22
- var SERVICE = "e2b";
23
- var API_BASE = "https://api.e2b.app";
24
- var REQUEST_TIMEOUT_MS = 3e4;
25
- var http = createAuthedClient({
26
- baseUrl: API_BASE,
27
- service: SERVICE,
28
- auth: { kind: "header", name: "x-api-key" },
29
- headers: { accept: "application/json" },
30
- // E2B 的错误文案:纯文本 body 直接用,JSON 则依次看 message / error / detail。
31
- errorMessage: {
32
- keys: ["message", "error", "detail"],
33
- fallback: (status) => `E2B request failed with status ${status}`
34
- },
35
- mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `E2B ${REQUEST_TIMEOUT_MS / 1e3}s \u5185\u6CA1\u6709\u8FD4\u56DE`) : upstreamError(502, message === void 0 ? "E2B request failed" : `E2B request failed: ${message}`)
36
- });
37
- function requireText(value, field) {
38
- const result = trimmedText(value);
39
- if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
40
- return result;
41
- }
42
- function requireRecord(value, label) {
43
- const result = asJsonObject(value);
44
- if (result === void 0) throw upstreamError(502, `${label} was not an object`);
45
- return result;
46
- }
47
- function stringArray(value) {
48
- if (!Array.isArray(value)) return void 0;
49
- const items = value.filter((item) => typeof item === "string" && item !== "");
50
- return items.length > 0 ? items : void 0;
51
- }
52
- async function request(ctx, options) {
53
- const query = Object.entries(options.query ?? {}).map(([key, value]) => [
54
- key,
55
- // 数组 query 拼成一个逗号串:E2B 不认重复的同名参数。
56
- Array.isArray(value) ? value.join(",") : value
57
- ]);
58
- const { data } = await http.request(ctx, {
59
- path: options.path,
60
- method: options.method ?? "GET",
61
- query,
62
- ...options.body === void 0 ? {} : { json: options.body },
63
- timeoutMs: REQUEST_TIMEOUT_MS,
64
- invalidJsonMessage: "E2B returned invalid JSON"
65
- });
66
- return data === void 0 ? options.emptySuccess ?? null : data;
67
- }
68
- async function requestSandboxArray(ctx, options) {
69
- const payload = await request(ctx, options);
70
- if (!Array.isArray(payload)) throw upstreamError(502, "E2B returned a non-array sandboxes payload");
71
- return payload.map((sandbox) => requireRecord(sandbox, "E2B sandbox"));
72
- }
73
- async function createSandbox(input, ctx) {
74
- const payload = await request(ctx, {
75
- // 创建走的是 v1 路径,不是列表那个 /v2/sandboxes。
76
- path: "/sandboxes",
77
- method: "POST",
78
- body: compactDefined({
79
- templateID: requireText(input.templateID, "templateID"),
80
- timeout: input.timeout,
81
- autoPause: input.autoPause,
82
- autoPauseMemory: input.autoPauseMemory,
83
- autoResume: input.autoResume,
84
- secure: input.secure,
85
- allow_internet_access: input.allow_internet_access,
86
- network: input.network,
87
- metadata: input.metadata,
88
- envVars: input.envVars,
89
- // `mcp: null` 是"显式关掉 MCP",与"没给这个字段"不是一回事,故不能被 compact 掉。
90
- mcp: input.mcp === null ? null : asJsonObject(input.mcp),
91
- volumeMounts: input.volumeMounts
92
- })
93
- });
94
- return { sandbox: requireRecord(payload, "E2B create sandbox response") };
95
- }
96
- async function listSandboxes(input, ctx) {
97
- const sandboxes = await requestSandboxArray(ctx, {
98
- path: "/v2/sandboxes",
99
- query: compactDefined({
100
- metadata: trimmedText(input.metadata),
101
- state: stringArray(input.state),
102
- nextToken: trimmedText(input.nextToken),
103
- limit: input.limit
104
- })
105
- });
106
- return { sandboxes };
107
- }
108
- async function getSandbox(input, ctx) {
109
- const sandboxID = requireText(input.sandboxID, "sandboxID");
110
- const payload = await request(ctx, { path: `/sandboxes/${encodeURIComponent(sandboxID)}` });
111
- return { sandbox: requireRecord(payload, "E2B get sandbox response") };
112
- }
113
- async function deleteSandbox(input, ctx) {
114
- const sandboxID = requireText(input.sandboxID, "sandboxID");
115
- await request(ctx, {
116
- path: `/sandboxes/${encodeURIComponent(sandboxID)}`,
117
- method: "DELETE",
118
- // 删除成功是 204 空 body,出参 schema 要的这个形状由本层合成。
119
- emptySuccess: { sandboxID, success: true }
120
- });
121
- return { sandboxID, success: true };
122
- }
123
-
124
- // ../plugins/src/e2b/schema.ts
125
- var createSandboxInput = external_exports.strictObject({
126
- templateID: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The E2B template identifier used to create the sandbox."),
127
- timeout: external_exports.int().min(0).describe("Time to live for the sandbox in seconds.").optional(),
128
- autoPause: external_exports.boolean().describe("Whether E2B should automatically pause the sandbox after timeout.").optional(),
129
- autoPauseMemory: external_exports.boolean().describe("Whether auto-pause should preserve the sandbox memory snapshot when autoPause is true.").optional(),
130
- autoResume: external_exports.strictObject({
131
- enabled: external_exports.boolean().describe("Whether auto-resume is enabled for paused sandboxes.").optional()
132
- }).describe("Auto-resume configuration for paused sandboxes.").optional(),
133
- secure: external_exports.boolean().describe("Whether E2B should secure all system communication with the sandbox.").optional(),
134
- allow_internet_access: external_exports.boolean().describe("Whether the sandbox can access the internet.").optional(),
135
- network: external_exports.looseObject({
136
- allowPublicTraffic: external_exports.boolean().describe("Whether sandbox URLs are publicly accessible.").optional(),
137
- allowOut: external_exports.array(external_exports.string().describe("One allowed destination such as a CIDR block, IP address, or domain.")).describe("Allowed outbound destinations for sandbox egress traffic.").optional(),
138
- denyOut: external_exports.array(external_exports.string().describe("One denied CIDR block or IP address.")).describe("Denied outbound CIDR blocks or IP addresses for sandbox egress traffic.").optional(),
139
- egressProxy: external_exports.looseObject({}).describe("The egress proxy configuration returned or accepted by E2B.").nullable().optional(),
140
- maskRequestHost: external_exports.string().describe("The host mask used for sandbox requests.").optional(),
141
- rules: external_exports.looseObject({}).describe("Per-domain outbound request transform rules.").optional()
142
- }).describe("The E2B sandbox network configuration object.").optional(),
143
- metadata: external_exports.record(external_exports.string(), external_exports.string().describe("One sandbox metadata value.")).describe("String metadata attached to the sandbox.").optional(),
144
- envVars: external_exports.record(external_exports.string(), external_exports.string().describe("One sandbox environment variable value.")).describe("Environment variables passed to the sandbox.").optional(),
145
- mcp: external_exports.looseObject({}).describe("MCP configuration for the sandbox.").nullable().optional(),
146
- volumeMounts: external_exports.array(external_exports.strictObject({
147
- name: external_exports.string().describe("The volume name.").optional(),
148
- path: external_exports.string().describe("The volume mount path inside the sandbox.").optional()
149
- }).describe("An E2B sandbox volume mount.")).describe("Volume mounts to attach to the sandbox.").optional()
150
- }).describe("The input payload for creating an E2B sandbox.");
151
- var createSandboxOutput = external_exports.strictObject({
152
- sandbox: external_exports.looseObject({
153
- templateID: external_exports.string().describe("Identifier of the template from which the sandbox was created.").optional(),
154
- sandboxID: external_exports.string().describe("Identifier of the sandbox.").optional(),
155
- alias: external_exports.string().describe("Alias of the template when returned by E2B.").optional(),
156
- clientID: external_exports.string().describe("Deprecated E2B client identifier.").optional(),
157
- envdVersion: external_exports.string().describe("Version of envd running in the sandbox.").optional(),
158
- envdAccessToken: external_exports.string().describe("Access token for envd requests when the sandbox is secure.").nullable().optional(),
159
- trafficAccessToken: external_exports.string().describe("Token required for accessing the sandbox through the E2B proxy when returned.").nullable().optional(),
160
- domain: external_exports.string().describe("Deprecated E2B sandbox domain field.").nullable().optional()
161
- }).describe("The E2B sandbox created by the API.").optional()
162
- }).describe("The response returned when creating an E2B sandbox.");
163
- var listSandboxesInput = external_exports.strictObject({
164
- metadata: external_exports.string().min(1).describe('Metadata query used to filter sandboxes, such as "user=abc&app=prod". Keys and values must already be URL encoded.').optional(),
165
- state: external_exports.array(external_exports.enum(["running", "paused"]).describe("The E2B sandbox lifecycle state.")).min(1).describe("Sandbox states used to filter the list.").optional(),
166
- nextToken: external_exports.string().min(1).describe("Cursor returned by E2B for the next page.").optional(),
167
- limit: external_exports.int().min(1).max(100).describe("Maximum number of sandboxes to return per page.").optional()
168
- }).describe("The input payload for listing E2B sandboxes.");
169
- var listSandboxesOutput = external_exports.strictObject({
170
- sandboxes: external_exports.array(external_exports.looseObject({
171
- templateID: external_exports.string().describe("Identifier of the template from which the sandbox was created.").optional(),
172
- alias: external_exports.string().describe("Alias of the template when returned by E2B.").optional(),
173
- sandboxID: external_exports.string().describe("Identifier of the sandbox.").optional(),
174
- clientID: external_exports.string().describe("Deprecated E2B client identifier.").optional(),
175
- startedAt: external_exports.iso.datetime({ offset: true }).describe("Time when the sandbox was started.").optional(),
176
- endAt: external_exports.iso.datetime({ offset: true }).describe("Time when the sandbox will expire.").optional(),
177
- cpuCount: external_exports.int().describe("CPU cores allocated to the sandbox.").optional(),
178
- memoryMB: external_exports.int().describe("Memory allocated to the sandbox in MiB.").optional(),
179
- diskSizeMB: external_exports.int().describe("Disk size allocated to the sandbox in MiB.").optional(),
180
- metadata: external_exports.record(external_exports.string(), external_exports.string().describe("One sandbox metadata value.")).describe("String metadata attached to the sandbox.").optional(),
181
- state: external_exports.enum(["running", "paused"]).describe("The E2B sandbox lifecycle state.").optional(),
182
- envdVersion: external_exports.string().describe("Version of envd running in the sandbox.").optional(),
183
- volumeMounts: external_exports.array(external_exports.strictObject({
184
- name: external_exports.string().describe("The volume name.").optional(),
185
- path: external_exports.string().describe("The volume mount path inside the sandbox.").optional()
186
- }).describe("An E2B sandbox volume mount.")).describe("Volume mounts attached to the sandbox.").optional()
187
- }).describe("An E2B sandbox returned by the sandbox list endpoint.")).describe("The sandboxes returned by E2B.").optional()
188
- }).describe("The response returned when listing E2B sandboxes.");
189
- var getSandboxInput = external_exports.strictObject({
190
- sandboxID: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The E2B sandbox identifier.").optional()
191
- }).describe("The input payload for selecting an E2B sandbox.");
192
- var getSandboxOutput = external_exports.strictObject({
193
- sandbox: external_exports.looseObject({
194
- templateID: external_exports.string().describe("Identifier of the template from which the sandbox was created.").optional(),
195
- alias: external_exports.string().describe("Alias of the template when returned by E2B.").optional(),
196
- sandboxID: external_exports.string().describe("Identifier of the sandbox.").optional(),
197
- clientID: external_exports.string().describe("Deprecated E2B client identifier.").optional(),
198
- startedAt: external_exports.iso.datetime({ offset: true }).describe("Time when the sandbox was started.").optional(),
199
- endAt: external_exports.iso.datetime({ offset: true }).describe("Time when the sandbox will expire.").optional(),
200
- envdVersion: external_exports.string().describe("Version of envd running in the sandbox.").optional(),
201
- envdAccessToken: external_exports.string().describe("Access token for envd requests when the sandbox is secure.").nullable().optional(),
202
- trafficAccessToken: external_exports.string().describe("Token required for accessing the sandbox through the E2B proxy when returned.").nullable().optional(),
203
- domain: external_exports.string().describe("Deprecated E2B sandbox domain field.").nullable().optional(),
204
- allowInternetAccess: external_exports.boolean().describe("Whether internet access was explicitly enabled or disabled for the sandbox.").nullable().optional(),
205
- cpuCount: external_exports.int().describe("CPU cores allocated to the sandbox.").optional(),
206
- memoryMB: external_exports.int().describe("Memory allocated to the sandbox in MiB.").optional(),
207
- diskSizeMB: external_exports.int().describe("Disk size allocated to the sandbox in MiB.").optional(),
208
- metadata: external_exports.record(external_exports.string(), external_exports.string().describe("One sandbox metadata value.")).describe("String metadata attached to the sandbox.").optional(),
209
- state: external_exports.enum(["running", "paused"]).describe("The E2B sandbox lifecycle state.").optional(),
210
- network: external_exports.looseObject({
211
- allowPublicTraffic: external_exports.boolean().describe("Whether sandbox URLs are publicly accessible.").optional(),
212
- allowOut: external_exports.array(external_exports.string().describe("One allowed destination such as a CIDR block, IP address, or domain.")).describe("Allowed outbound destinations for sandbox egress traffic.").optional(),
213
- denyOut: external_exports.array(external_exports.string().describe("One denied CIDR block or IP address.")).describe("Denied outbound CIDR blocks or IP addresses for sandbox egress traffic.").optional(),
214
- egressProxy: external_exports.looseObject({}).describe("The egress proxy configuration returned or accepted by E2B.").nullable().optional(),
215
- maskRequestHost: external_exports.string().describe("The host mask used for sandbox requests.").optional(),
216
- rules: external_exports.looseObject({}).describe("Per-domain outbound request transform rules.").optional()
217
- }).describe("The E2B sandbox network configuration object.").optional(),
218
- lifecycle: external_exports.looseObject({}).describe("Sandbox lifecycle configuration returned by E2B.").optional(),
219
- volumeMounts: external_exports.array(external_exports.strictObject({
220
- name: external_exports.string().describe("The volume name.").optional(),
221
- path: external_exports.string().describe("The volume mount path inside the sandbox.").optional()
222
- }).describe("An E2B sandbox volume mount.")).describe("Volume mounts attached to the sandbox.").optional()
223
- }).describe("Detailed E2B sandbox information.").optional()
224
- }).describe("The response returned when retrieving an E2B sandbox.");
225
- var deleteSandboxInput = external_exports.strictObject({
226
- sandboxID: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The E2B sandbox identifier.").optional()
227
- }).describe("The input payload for selecting an E2B sandbox.");
228
- var deleteSandboxOutput = external_exports.strictObject({
229
- sandboxID: external_exports.string().min(1).regex(new RegExp("\\S")).describe("The E2B sandbox identifier.").optional(),
230
- success: external_exports.boolean().describe("Whether the sandbox delete request completed successfully.").optional()
231
- }).describe("The response returned after deleting an E2B sandbox.");
232
- var e2bActions = {
233
- create_sandbox: {
234
- description: "Create an E2B sandbox from a template.",
235
- effect: "write",
236
- inputSchema: createSandboxInput,
237
- outputSchema: external_exports.toJSONSchema(createSandboxOutput, { io: "output", unrepresentable: "any" })
238
- },
239
- list_sandboxes: {
240
- description: "List E2B sandboxes visible to the current API key.",
241
- effect: "read",
242
- inputSchema: listSandboxesInput,
243
- outputSchema: external_exports.toJSONSchema(listSandboxesOutput, { io: "output", unrepresentable: "any" })
244
- },
245
- get_sandbox: {
246
- description: "Get one E2B sandbox by sandbox identifier.",
247
- effect: "read",
248
- inputSchema: getSandboxInput,
249
- outputSchema: external_exports.toJSONSchema(getSandboxOutput, { io: "output", unrepresentable: "any" })
250
- },
251
- delete_sandbox: {
252
- description: "Kill an E2B sandbox by sandbox identifier.",
253
- effect: "destructive",
254
- inputSchema: deleteSandboxInput,
255
- outputSchema: external_exports.toJSONSchema(deleteSandboxOutput, { io: "output", unrepresentable: "any" })
256
- }
257
- };
258
-
259
- // ../plugins/src/e2b/index.ts
260
- function createE2bPlugin() {
261
- return createProviderPlugin({
262
- description: "E2B",
263
- credentialProbe: "list_sandboxes",
264
- actions: e2bActions,
265
- handlers: {
266
- create_sandbox: createSandbox,
267
- list_sandboxes: listSandboxes,
268
- get_sandbox: getSandbox,
269
- delete_sandbox: deleteSandbox
270
- }
271
- });
272
- }
273
- var e2b_default = createE2bPlugin();
274
- export {
275
- createE2bPlugin,
276
- e2b_default as default
277
- };
@@ -1,331 +0,0 @@
1
- import {
2
- createAuthedClient
3
- } from "./chunk-XYBU3WZH.js";
4
- import "./chunk-E6JCVKW6.js";
5
- import {
6
- asJsonObject,
7
- compactDefined,
8
- trimmedText
9
- } from "./chunk-JXHMDBAY.js";
10
- import {
11
- createProviderPlugin,
12
- upstreamError
13
- } from "./chunk-ATK45BXV.js";
14
- import "./chunk-U7B6DS2O.js";
15
- import {
16
- TBError,
17
- external_exports
18
- } from "./chunk-UZM2RXZH.js";
19
- import "./chunk-U67V476Y.js";
20
-
21
- // ../plugins/src/exa/api.ts
22
- var SERVICE = "exa";
23
- var API_BASE = "https://api.exa.ai";
24
- var http = createAuthedClient({
25
- baseUrl: API_BASE,
26
- service: SERVICE,
27
- auth: { kind: "header", name: "x-api-key" },
28
- headers: { accept: "application/json" },
29
- errorMessage: {
30
- keys: ["error", "message", "detail"],
31
- fallback: (status, statusText) => statusText || `exa \u8FD4\u56DE HTTP ${status}`
32
- },
33
- mapTransportError: ({ message }) => upstreamError(
34
- 502,
35
- message === void 0 ? "exa \u8BF7\u6C42\u5931\u8D25" : `exa \u8BF7\u6C42\u5931\u8D25: ${message}`
36
- )
37
- });
38
- var SEARCH_PATH = "/search";
39
- var CONTENTS_PATH = "/contents";
40
- var ANSWER_PATH = "/answer";
41
- var FIND_SIMILAR_PATH = "/findSimilar";
42
- async function request(ctx, path, body) {
43
- const { bodyKind, data } = await http.request(ctx, {
44
- path,
45
- method: "POST",
46
- json: body,
47
- invalidJson: "text"
48
- });
49
- if (bodyKind === "empty") return {};
50
- if (bodyKind === "invalid-json") throw upstreamError(502, "exa \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94");
51
- return data;
52
- }
53
- function responseText(value, field) {
54
- const text = trimmedText(value);
55
- if (text === void 0) throw upstreamError(502, `exa \u54CD\u5E94\u7F3A\u5C11 ${field}`);
56
- return text;
57
- }
58
- function responseRecord(payload, field) {
59
- const object = asJsonObject(payload);
60
- if (object === void 0) throw upstreamError(502, `exa ${field} \u54CD\u5E94\u4E0D\u662F\u5BF9\u8C61`);
61
- return object;
62
- }
63
- function responseArray(value, field) {
64
- if (!Array.isArray(value)) throw upstreamError(502, `exa \u54CD\u5E94\u7684 ${field} \u4E0D\u662F\u6570\u7EC4`);
65
- return value;
66
- }
67
- function resultItems(value, field) {
68
- return responseArray(value, field).map((item) => responseRecord(item, `${field} \u7ED3\u679C\u9879`));
69
- }
70
- function assertDomainFilters(input) {
71
- if (input.includeDomains !== void 0 && input.excludeDomains !== void 0) {
72
- throw new TBError("invalid_argument", "includeDomains \u4E0E excludeDomains \u4E0D\u80FD\u540C\u65F6\u63D0\u4F9B");
73
- }
74
- }
75
- function normalizeResults(object, extra = {}) {
76
- return compactDefined({
77
- requestId: responseText(object.requestId, "requestId"),
78
- results: resultItems(object.results, "results"),
79
- ...extra,
80
- costDollars: asJsonObject(object.costDollars)
81
- });
82
- }
83
- async function search(input, ctx) {
84
- assertDomainFilters(input);
85
- const object = responseRecord(await request(ctx, SEARCH_PATH, compactDefined(input)), "\u641C\u7D22");
86
- return normalizeResults(object, {
87
- searchType: trimmedText(object.searchType),
88
- output: asJsonObject(object.output)
89
- });
90
- }
91
- async function getContents(input, ctx) {
92
- const object = responseRecord(await request(ctx, CONTENTS_PATH, compactDefined(input)), "contents");
93
- return compactDefined({
94
- requestId: responseText(object.requestId, "requestId"),
95
- results: resultItems(object.results, "results"),
96
- // statuses 是可选的:字段缺席与"空数组"不是一回事,前者不该被伪造成后者。
97
- statuses: object.statuses === void 0 ? void 0 : resultItems(object.statuses, "statuses"),
98
- costDollars: asJsonObject(object.costDollars)
99
- });
100
- }
101
- async function answer(input, ctx) {
102
- const object = responseRecord(await request(ctx, ANSWER_PATH, compactDefined(input)), "answer");
103
- return compactDefined({
104
- // answer 既可能是一段文本,也可能是结构化对象(取决于 Exa 选的答案形态)。
105
- // 文本这里**不 trim**:它是内容而非标识符,首尾空白由调用方自己决定怎么处理。
106
- answer: typeof object.answer === "string" ? object.answer : asJsonObject(object.answer),
107
- citations: resultItems(object.citations, "citations"),
108
- costDollars: asJsonObject(object.costDollars)
109
- });
110
- }
111
- async function findSimilar(input, ctx) {
112
- assertDomainFilters(input);
113
- return normalizeResults(responseRecord(await request(ctx, FIND_SIMILAR_PATH, compactDefined(input)), "\u641C\u7D22"));
114
- }
115
-
116
- // ../plugins/src/exa/schema.ts
117
- var searchInput = external_exports.strictObject({
118
- query: external_exports.string().min(1).describe("The search query to send to Exa."),
119
- additionalQueries: external_exports.array(external_exports.string().min(1)).min(1).describe("Additional query variations to use with deep or deep-reasoning search.").optional(),
120
- type: external_exports.enum(["neural", "fast", "auto", "deep", "deep-reasoning", "instant"]).describe("The Exa search mode to execute.").optional(),
121
- category: external_exports.enum(["company", "research paper", "news", "pdf", "github", "personal site", "people", "financial report"]).describe("The Exa category used to narrow search results.").optional(),
122
- numResults: external_exports.int().min(1).max(100).describe("The number of search results to return, up to 100.").optional(),
123
- userLocation: external_exports.string().min(2).max(2).describe("A two-letter ISO country code used to localize search results.").optional(),
124
- includeDomains: external_exports.array(external_exports.string().min(1)).min(1).describe("Only return results from these domains.").optional(),
125
- excludeDomains: external_exports.array(external_exports.string().min(1)).min(1).describe("Exclude results from these domains.").optional(),
126
- startCrawlDate: external_exports.iso.datetime({ offset: true }).describe("Only return results crawled after this timestamp.").optional(),
127
- endCrawlDate: external_exports.iso.datetime({ offset: true }).describe("Only return results crawled before this timestamp.").optional(),
128
- startPublishedDate: external_exports.iso.datetime({ offset: true }).describe("Only return results published after this timestamp.").optional(),
129
- endPublishedDate: external_exports.iso.datetime({ offset: true }).describe("Only return results published before this timestamp.").optional(),
130
- includeText: external_exports.array(external_exports.string().min(1)).min(1).describe("Phrases that must appear in the result text.").optional(),
131
- excludeText: external_exports.array(external_exports.string().min(1)).min(1).describe("Phrases that must not appear in the result text.").optional(),
132
- moderation: external_exports.boolean().describe("Whether Exa should filter unsafe content from results.").optional(),
133
- contents: external_exports.strictObject({
134
- text: external_exports.union([external_exports.boolean().describe("Whether Exa should return extracted text."), external_exports.strictObject({
135
- maxCharacters: external_exports.int().min(1).describe("The maximum number of characters to return for extracted text.").optional(),
136
- includeHtmlTags: external_exports.boolean().describe("Whether Exa should preserve HTML tags in extracted text.").optional(),
137
- verbosity: external_exports.enum(["compact", "standard", "full"]).describe("The verbosity level for extracted page text.").optional(),
138
- includeSections: external_exports.array(external_exports.enum(["header", "navigation", "banner", "body", "sidebar", "footer", "metadata"]).describe("A semantic page section used by Exa content extraction.")).min(1).describe("Only include content from these semantic page sections.").optional(),
139
- excludeSections: external_exports.array(external_exports.enum(["header", "navigation", "banner", "body", "sidebar", "footer", "metadata"]).describe("A semantic page section used by Exa content extraction.")).min(1).describe("Exclude content from these semantic page sections.").optional()
140
- }).describe("Advanced configuration for Exa text extraction.")]).optional(),
141
- highlights: external_exports.union([external_exports.boolean().describe("Whether Exa should return highlights."), external_exports.strictObject({
142
- maxCharacters: external_exports.int().min(1).describe("The maximum number of characters to return across highlights.").optional(),
143
- numSentences: external_exports.int().min(1).describe("Deprecated by Exa. The number of sentences to include in each highlight snippet.").optional(),
144
- highlightsPerUrl: external_exports.int().min(1).describe("Deprecated by Exa. The number of highlight snippets to return per URL.").optional(),
145
- query: external_exports.string().min(1).describe("A custom query that guides Exa highlight selection.").optional()
146
- }).describe("Advanced configuration for Exa highlights.")]).optional(),
147
- summary: external_exports.strictObject({
148
- query: external_exports.string().min(1).describe("A custom query that guides Exa summary generation.").optional(),
149
- schema: external_exports.looseObject({}).describe("A JSON Schema object used for structured Exa summaries.").optional()
150
- }).describe("Configuration for an Exa summary response.").optional(),
151
- livecrawlTimeout: external_exports.int().min(0).describe("The livecrawl timeout in milliseconds.").optional(),
152
- maxAgeHours: external_exports.union([external_exports.literal(-1), external_exports.int().min(0).describe("A non-negative cache age in hours.")]).describe("Maximum age of cached content in hours. Use -1 to always use cache, 0 to always livecrawl, or a positive integer to require fresher content.").optional(),
153
- subpages: external_exports.int().min(0).describe("The maximum number of subpages Exa should crawl per result.").optional(),
154
- subpageTarget: external_exports.union([external_exports.string().min(1).describe("A single keyword used to locate relevant subpages."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of keywords used to locate relevant subpages.")]).describe("Keywords Exa should use when selecting subpages.").optional(),
155
- extras: external_exports.strictObject({
156
- links: external_exports.int().min(0).describe("The maximum number of webpage links to return for each result.").optional(),
157
- imageLinks: external_exports.int().min(0).describe("The maximum number of image links to return for each result.").optional()
158
- }).describe("Additional Exa extraction options.").optional()
159
- }).describe("The Exa contents request object.").optional()
160
- }).describe("The input payload for an Exa search request. includeDomains and excludeDomains cannot be provided together.");
161
- var searchOutput = external_exports.strictObject({
162
- requestId: external_exports.string().describe("The unique identifier for this Exa request."),
163
- results: external_exports.array(external_exports.looseObject({
164
- id: external_exports.string().describe("The temporary Exa document identifier.").optional(),
165
- url: external_exports.string().describe("The result URL.").optional(),
166
- title: external_exports.string().describe("The result title.").optional(),
167
- publishedDate: external_exports.string().describe("The estimated publication timestamp for the result.").nullable().optional(),
168
- author: external_exports.string().describe("The result author.").nullable().optional(),
169
- score: external_exports.number().describe("The result relevance score.").nullable().optional()
170
- }).describe("An Exa search or contents result object.")).describe("The Exa search results."),
171
- searchType: external_exports.string().describe("The search type Exa selected for the request.").optional(),
172
- output: external_exports.looseObject({}).describe("The Exa deep search output object.").optional(),
173
- costDollars: external_exports.looseObject({
174
- total: external_exports.number().describe("The total request cost in US dollars.").optional()
175
- }).describe("The Exa costDollars object.").optional()
176
- }).describe("The response payload for exa.search.");
177
- var getContentsInput = external_exports.strictObject({
178
- urls: external_exports.array(external_exports.url().describe("One URL to retrieve content for.")).min(1).describe("The list of URLs to retrieve content for."),
179
- ids: external_exports.array(external_exports.string().min(1)).min(1).describe("Deprecated. A backward-compatibility list of Exa document IDs.").optional(),
180
- text: external_exports.union([external_exports.boolean().describe("Whether Exa should return extracted text."), external_exports.strictObject({
181
- maxCharacters: external_exports.int().min(1).describe("The maximum number of characters to return for extracted text.").optional(),
182
- includeHtmlTags: external_exports.boolean().describe("Whether Exa should preserve HTML tags in extracted text.").optional(),
183
- verbosity: external_exports.enum(["compact", "standard", "full"]).describe("The verbosity level for extracted page text.").optional(),
184
- includeSections: external_exports.array(external_exports.enum(["header", "navigation", "banner", "body", "sidebar", "footer", "metadata"]).describe("A semantic page section used by Exa content extraction.")).min(1).describe("Only include content from these semantic page sections.").optional(),
185
- excludeSections: external_exports.array(external_exports.enum(["header", "navigation", "banner", "body", "sidebar", "footer", "metadata"]).describe("A semantic page section used by Exa content extraction.")).min(1).describe("Exclude content from these semantic page sections.").optional()
186
- }).describe("Advanced configuration for Exa text extraction.")]).optional(),
187
- highlights: external_exports.union([external_exports.boolean().describe("Whether Exa should return highlights."), external_exports.strictObject({
188
- maxCharacters: external_exports.int().min(1).describe("The maximum number of characters to return across highlights.").optional(),
189
- numSentences: external_exports.int().min(1).describe("Deprecated by Exa. The number of sentences to include in each highlight snippet.").optional(),
190
- highlightsPerUrl: external_exports.int().min(1).describe("Deprecated by Exa. The number of highlight snippets to return per URL.").optional(),
191
- query: external_exports.string().min(1).describe("A custom query that guides Exa highlight selection.").optional()
192
- }).describe("Advanced configuration for Exa highlights.")]).optional(),
193
- summary: external_exports.strictObject({
194
- query: external_exports.string().min(1).describe("A custom query that guides Exa summary generation.").optional(),
195
- schema: external_exports.looseObject({}).describe("A JSON Schema object used for structured Exa summaries.").optional()
196
- }).describe("Configuration for an Exa summary response.").optional(),
197
- livecrawlTimeout: external_exports.int().min(0).describe("The livecrawl timeout in milliseconds.").optional(),
198
- maxAgeHours: external_exports.union([external_exports.literal(-1), external_exports.int().min(0).describe("A non-negative cache age in hours.")]).describe("Maximum age of cached content in hours. Use -1 to always use cache, 0 to always livecrawl, or a positive integer to require fresher content.").optional(),
199
- subpages: external_exports.int().min(0).describe("The maximum number of subpages Exa should crawl per result.").optional(),
200
- subpageTarget: external_exports.union([external_exports.string().min(1).describe("A single keyword used to locate relevant subpages."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of keywords used to locate relevant subpages.")]).describe("Keywords Exa should use when selecting subpages.").optional(),
201
- extras: external_exports.strictObject({
202
- links: external_exports.int().min(0).describe("The maximum number of webpage links to return for each result.").optional(),
203
- imageLinks: external_exports.int().min(0).describe("The maximum number of image links to return for each result.").optional()
204
- }).describe("Additional Exa extraction options.").optional()
205
- }).describe("The input payload for fetching Exa contents by URL.");
206
- var getContentsOutput = external_exports.strictObject({
207
- requestId: external_exports.string().describe("The unique identifier for this Exa request."),
208
- results: external_exports.array(external_exports.looseObject({
209
- id: external_exports.string().describe("The temporary Exa document identifier.").optional(),
210
- url: external_exports.string().describe("The result URL.").optional(),
211
- title: external_exports.string().describe("The result title.").optional(),
212
- publishedDate: external_exports.string().describe("The estimated publication timestamp for the result.").nullable().optional(),
213
- author: external_exports.string().describe("The result author.").nullable().optional(),
214
- score: external_exports.number().describe("The result relevance score.").nullable().optional()
215
- }).describe("An Exa search or contents result object.")).describe("The Exa content results returned successfully."),
216
- statuses: external_exports.array(external_exports.looseObject({}).describe("One Exa content status.")).describe("The fetch status for each requested input item.").optional(),
217
- costDollars: external_exports.looseObject({
218
- total: external_exports.number().describe("The total request cost in US dollars.").optional()
219
- }).describe("The Exa costDollars object.").optional()
220
- }).describe("The response payload for exa.get_contents.");
221
- var answerInput = external_exports.strictObject({
222
- query: external_exports.string().min(1).describe("The question or prompt Exa should answer."),
223
- text: external_exports.boolean().describe("Whether citations should include the full source text.").optional()
224
- }).describe("The input payload for an Exa answer request.");
225
- var answerOutput = external_exports.strictObject({
226
- answer: external_exports.union([external_exports.string().describe("The text answer returned by Exa."), external_exports.looseObject({}).describe("The structured answer returned by Exa.")]).optional(),
227
- citations: external_exports.array(external_exports.looseObject({}).describe("An Exa answer citation.")).describe("The citations supporting the Exa answer."),
228
- costDollars: external_exports.looseObject({
229
- total: external_exports.number().describe("The total request cost in US dollars.").optional()
230
- }).describe("The Exa costDollars object.").optional()
231
- }).describe("The response payload for exa.answer.");
232
- var findSimilarInput = external_exports.strictObject({
233
- url: external_exports.url().describe("The URL used to find similar pages."),
234
- excludeSourceDomain: external_exports.boolean().describe("Whether to exclude results from the same domain as the input URL.").optional(),
235
- numResults: external_exports.int().min(1).max(100).describe("The number of similar results to return, up to 100.").optional(),
236
- includeDomains: external_exports.array(external_exports.string().min(1)).min(1).describe("Only return results from these domains.").optional(),
237
- excludeDomains: external_exports.array(external_exports.string().min(1)).min(1).describe("Exclude results from these domains.").optional(),
238
- startCrawlDate: external_exports.iso.datetime({ offset: true }).describe("Only return results crawled after this timestamp.").optional(),
239
- endCrawlDate: external_exports.iso.datetime({ offset: true }).describe("Only return results crawled before this timestamp.").optional(),
240
- startPublishedDate: external_exports.iso.datetime({ offset: true }).describe("Only return results published after this timestamp.").optional(),
241
- endPublishedDate: external_exports.iso.datetime({ offset: true }).describe("Only return results published before this timestamp.").optional(),
242
- includeText: external_exports.array(external_exports.string().min(1)).min(1).describe("Phrases that must appear in the result text.").optional(),
243
- excludeText: external_exports.array(external_exports.string().min(1)).min(1).describe("Phrases that must not appear in the result text.").optional(),
244
- moderation: external_exports.boolean().describe("Whether Exa should filter unsafe content from results.").optional(),
245
- contents: external_exports.strictObject({
246
- text: external_exports.union([external_exports.boolean().describe("Whether Exa should return extracted text."), external_exports.strictObject({
247
- maxCharacters: external_exports.int().min(1).describe("The maximum number of characters to return for extracted text.").optional(),
248
- includeHtmlTags: external_exports.boolean().describe("Whether Exa should preserve HTML tags in extracted text.").optional(),
249
- verbosity: external_exports.enum(["compact", "standard", "full"]).describe("The verbosity level for extracted page text.").optional(),
250
- includeSections: external_exports.array(external_exports.enum(["header", "navigation", "banner", "body", "sidebar", "footer", "metadata"]).describe("A semantic page section used by Exa content extraction.")).min(1).describe("Only include content from these semantic page sections.").optional(),
251
- excludeSections: external_exports.array(external_exports.enum(["header", "navigation", "banner", "body", "sidebar", "footer", "metadata"]).describe("A semantic page section used by Exa content extraction.")).min(1).describe("Exclude content from these semantic page sections.").optional()
252
- }).describe("Advanced configuration for Exa text extraction.")]).optional(),
253
- highlights: external_exports.union([external_exports.boolean().describe("Whether Exa should return highlights."), external_exports.strictObject({
254
- maxCharacters: external_exports.int().min(1).describe("The maximum number of characters to return across highlights.").optional(),
255
- numSentences: external_exports.int().min(1).describe("Deprecated by Exa. The number of sentences to include in each highlight snippet.").optional(),
256
- highlightsPerUrl: external_exports.int().min(1).describe("Deprecated by Exa. The number of highlight snippets to return per URL.").optional(),
257
- query: external_exports.string().min(1).describe("A custom query that guides Exa highlight selection.").optional()
258
- }).describe("Advanced configuration for Exa highlights.")]).optional(),
259
- summary: external_exports.strictObject({
260
- query: external_exports.string().min(1).describe("A custom query that guides Exa summary generation.").optional(),
261
- schema: external_exports.looseObject({}).describe("A JSON Schema object used for structured Exa summaries.").optional()
262
- }).describe("Configuration for an Exa summary response.").optional(),
263
- livecrawlTimeout: external_exports.int().min(0).describe("The livecrawl timeout in milliseconds.").optional(),
264
- maxAgeHours: external_exports.union([external_exports.literal(-1), external_exports.int().min(0).describe("A non-negative cache age in hours.")]).describe("Maximum age of cached content in hours. Use -1 to always use cache, 0 to always livecrawl, or a positive integer to require fresher content.").optional(),
265
- subpages: external_exports.int().min(0).describe("The maximum number of subpages Exa should crawl per result.").optional(),
266
- subpageTarget: external_exports.union([external_exports.string().min(1).describe("A single keyword used to locate relevant subpages."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of keywords used to locate relevant subpages.")]).describe("Keywords Exa should use when selecting subpages.").optional(),
267
- extras: external_exports.strictObject({
268
- links: external_exports.int().min(0).describe("The maximum number of webpage links to return for each result.").optional(),
269
- imageLinks: external_exports.int().min(0).describe("The maximum number of image links to return for each result.").optional()
270
- }).describe("Additional Exa extraction options.").optional()
271
- }).describe("The Exa contents request object.").optional()
272
- }).describe("The input payload for an Exa findSimilar request. includeDomains and excludeDomains cannot be provided together.");
273
- var findSimilarOutput = external_exports.strictObject({
274
- requestId: external_exports.string().describe("The unique identifier for this Exa request."),
275
- results: external_exports.array(external_exports.looseObject({
276
- id: external_exports.string().describe("The temporary Exa document identifier.").optional(),
277
- url: external_exports.string().describe("The result URL.").optional(),
278
- title: external_exports.string().describe("The result title.").optional(),
279
- publishedDate: external_exports.string().describe("The estimated publication timestamp for the result.").nullable().optional(),
280
- author: external_exports.string().describe("The result author.").nullable().optional(),
281
- score: external_exports.number().describe("The result relevance score.").nullable().optional()
282
- }).describe("An Exa search or contents result object.")).describe("The Exa similar-page results."),
283
- costDollars: external_exports.looseObject({
284
- total: external_exports.number().describe("The total request cost in US dollars.").optional()
285
- }).describe("The Exa costDollars object.").optional()
286
- }).describe("The response payload for exa.find_similar.");
287
- var exaActions = {
288
- search: {
289
- description: "Search the web with Exa and optionally enrich each result with contents.",
290
- effect: "write",
291
- inputSchema: searchInput,
292
- outputSchema: external_exports.toJSONSchema(searchOutput, { io: "output", unrepresentable: "any" })
293
- },
294
- get_contents: {
295
- description: "Fetch text, highlights, or summaries from Exa for URLs or document IDs.",
296
- effect: "read",
297
- inputSchema: getContentsInput,
298
- outputSchema: external_exports.toJSONSchema(getContentsOutput, { io: "output", unrepresentable: "any" })
299
- },
300
- answer: {
301
- description: "Generate a citation-backed answer from Exa search results.",
302
- effect: "write",
303
- inputSchema: answerInput,
304
- outputSchema: external_exports.toJSONSchema(answerOutput, { io: "output", unrepresentable: "any" })
305
- },
306
- find_similar: {
307
- description: "Find pages similar to a given URL and optionally enrich them with contents.",
308
- effect: "read",
309
- inputSchema: findSimilarInput,
310
- outputSchema: external_exports.toJSONSchema(findSimilarOutput, { io: "output", unrepresentable: "any" })
311
- }
312
- };
313
-
314
- // ../plugins/src/exa/index.ts
315
- function createExaPlugin() {
316
- return createProviderPlugin({
317
- description: "Exa",
318
- actions: exaActions,
319
- handlers: {
320
- search,
321
- get_contents: getContents,
322
- answer,
323
- find_similar: findSimilar
324
- }
325
- });
326
- }
327
- var exa_default = createExaPlugin();
328
- export {
329
- createExaPlugin,
330
- exa_default as default
331
- };