@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,361 +0,0 @@
1
- import {
2
- createProviderHttpClient
3
- } from "./chunk-E6JCVKW6.js";
4
- import {
5
- asJsonObject,
6
- booleanValue,
7
- compactDefined,
8
- integerValue,
9
- trimmedText
10
- } from "./chunk-JXHMDBAY.js";
11
- import {
12
- createProviderPlugin,
13
- requireApiKey,
14
- upstreamError
15
- } from "./chunk-ATK45BXV.js";
16
- import {
17
- assertPublicHttpUrl
18
- } from "./chunk-U7B6DS2O.js";
19
- import {
20
- TBError,
21
- external_exports
22
- } from "./chunk-UZM2RXZH.js";
23
- import "./chunk-U67V476Y.js";
24
-
25
- // ../plugins/src/opengraph_io/api.ts
26
- var SERVICE = "opengraph_io";
27
- var API_BASE = "https://opengraph.io";
28
- var http = createProviderHttpClient({ baseUrl: `${API_BASE}/`, service: SERVICE });
29
- function errorMessage(payload) {
30
- if (typeof payload === "string" && payload.trim() !== "") return payload;
31
- const body = asJsonObject(payload);
32
- if (body === void 0) return "OpenGraph.io request failed";
33
- for (const key of ["error_description", "error_message", "error", "message", "detail"]) {
34
- const found = trimmedText(body[key]);
35
- if (found !== void 0) return found;
36
- }
37
- return "OpenGraph.io request failed";
38
- }
39
- async function request(ctx, path, query) {
40
- const apiKey = requireApiKey(ctx, SERVICE);
41
- const requestQuery = [["app_id", apiKey], ...Object.entries(query)];
42
- const { data } = await http.request({
43
- path,
44
- query: requestQuery,
45
- headers: { accept: "application/json" },
46
- invalidJson: "text",
47
- mapError: ({ data: payload, status }) => upstreamError(status, errorMessage(payload)),
48
- mapTransportError: ({ message }) => upstreamError(
49
- 502,
50
- message === void 0 ? "OpenGraph.io request failed" : `OpenGraph.io request failed: ${message}`
51
- )
52
- });
53
- return data ?? null;
54
- }
55
- function unwrap(payload) {
56
- const body = asJsonObject(payload);
57
- if (body === void 0) return payload;
58
- return typeof body.successful === "boolean" && body.data !== void 0 ? body.data : payload;
59
- }
60
- function requireObject(payload, context) {
61
- const body = asJsonObject(unwrap(payload));
62
- if (body === void 0) throw upstreamError(502, `OpenGraph.io ${context} response was not a JSON object`);
63
- return body;
64
- }
65
- function normalizeRequestInfo(payload) {
66
- const body = asJsonObject(payload);
67
- if (body === void 0) return void 0;
68
- const normalized = compactDefined({
69
- host: trimmedText(body.host),
70
- redirects: integerValue(body.redirects),
71
- responseCode: integerValue(body.responseCode ?? body.response_code),
72
- responseContentType: trimmedText(body.responseContentType ?? body.response_content_type)
73
- });
74
- return Object.keys(normalized).length > 0 ? normalized : void 0;
75
- }
76
- function normalizeSiteResult(payload) {
77
- const body = requireObject(payload, "site");
78
- const tags = Array.isArray(body.tags) ? body.tags.map((item) => asJsonObject(item)).filter((item) => item !== void 0) : void 0;
79
- return compactDefined({
80
- hybridGraph: asJsonObject(body.hybridGraph ?? body.hybrid_graph),
81
- openGraph: asJsonObject(body.openGraph ?? body.open_graph),
82
- twitterCard: asJsonObject(body.twitterCard ?? body.twitter_card),
83
- htmlInferred: asJsonObject(body.htmlInferred ?? body.html_inferred),
84
- oEmbed: asJsonObject(body.oEmbed ?? body.oembed),
85
- requestUrl: trimmedText(body.requestUrl ?? body.request_url),
86
- requestInfo: normalizeRequestInfo(body.requestInfo ?? body.request_info),
87
- cached: booleanValue(body.cached),
88
- // createdAt 的 null 是有信息的("非缓存结果"),不能被 compact 当缺失丢掉。
89
- createdAt: (body.createdAt ?? body.created_at) === null ? null : trimmedText(body.createdAt ?? body.created_at),
90
- retryInfo: asJsonObject(body.retryInfo ?? body.retry_info),
91
- aiSafety: asJsonObject(body.aiSafety ?? body.ai_safety ?? body.AI_SAFETY),
92
- domain: trimmedText(body.domain),
93
- tags: tags !== void 0 && tags.length > 0 ? tags : void 0
94
- });
95
- }
96
- function targetPath(family, target, field) {
97
- let normalized;
98
- try {
99
- normalized = assertPublicHttpUrl(target).toString();
100
- } catch {
101
- throw new TBError("invalid_argument", `${field} \u5FC5\u987B\u662F\u516C\u7F51\u53EF\u8FBE\u7684 http(s) \u5730\u5740`);
102
- }
103
- return `/api/1.1/${family}/${encodeURIComponent(normalized)}`;
104
- }
105
- function siteQuery(input) {
106
- return {
107
- cache_ok: input.cacheOk,
108
- full_render: input.fullRender,
109
- use_proxy: input.useProxy,
110
- use_premium: input.usePremium,
111
- use_superior: input.useSuperior,
112
- use_ai: input.useAi,
113
- max_cache_age: input.maxCacheAge,
114
- accept_lang: input.acceptLang,
115
- auto_proxy: input.autoProxy,
116
- auto_render: input.autoRender,
117
- retry: input.retry,
118
- max_retries: input.maxRetries,
119
- retry_escalate: input.retryEscalate,
120
- proxy_country: input.proxyCountry
121
- };
122
- }
123
- async function extractSiteMetadata(input, ctx) {
124
- const payload = await request(ctx, targetPath("site", input.site, "site"), siteQuery(input));
125
- return normalizeSiteResult(payload);
126
- }
127
- async function extractSite(input, ctx) {
128
- return extractSiteMetadata(input, ctx);
129
- }
130
- async function scrapeSite(input, ctx) {
131
- return extractSiteMetadata(input, ctx);
132
- }
133
- async function scrapeUrl(input, ctx) {
134
- const payload = await request(ctx, targetPath("scrape", input.url, "url"), {
135
- cache_ok: input.cacheOk,
136
- full_render: input.fullRender,
137
- use_proxy: input.useProxy,
138
- use_premium: input.usePremium,
139
- use_superior: input.useSuperior,
140
- accept_lang: input.acceptLang,
141
- auto_proxy: input.autoProxy,
142
- auto_render: input.autoRender,
143
- retry: input.retry
144
- });
145
- const unwrapped = unwrap(payload);
146
- if (typeof unwrapped === "string") return { htmlContent: unwrapped };
147
- const body = requireObject(unwrapped, "scrape");
148
- const htmlContent = trimmedText(body.htmlContent ?? body.html_content ?? body.html);
149
- if (htmlContent === void 0) {
150
- throw upstreamError(502, "OpenGraph.io scrape response did not include html content");
151
- }
152
- return compactDefined({
153
- htmlContent,
154
- requestInfo: normalizeRequestInfo(body.requestInfo ?? body.request_info),
155
- retryInfo: asJsonObject(body.retryInfo ?? body.retry_info)
156
- });
157
- }
158
- async function captureScreenshot(input, ctx) {
159
- const payload = await request(ctx, targetPath("screenshot", input.url, "url"), {
160
- format: input.format,
161
- quality: input.quality,
162
- cache_ok: input.cacheOk,
163
- selector: input.selector,
164
- dark_mode: input.darkMode,
165
- full_page: input.fullPage,
166
- use_proxy: input.useProxy,
167
- dimensions: input.dimensions,
168
- capture_delay: input.captureDelay,
169
- exclude_selectors: input.excludeSelectors,
170
- navigation_timeout: input.navigationTimeout,
171
- block_cookie_banner: input.blockCookieBanner
172
- });
173
- const body = requireObject(payload, "screenshot");
174
- const screenshotUrl = trimmedText(body.screenshotUrl ?? body.screenshot_url);
175
- if (screenshotUrl === void 0) {
176
- throw upstreamError(502, "OpenGraph.io screenshot response did not include screenshotUrl");
177
- }
178
- const dimensions = asJsonObject(body.dimensions);
179
- const width = integerValue(dimensions?.width);
180
- const height = integerValue(dimensions?.height);
181
- if (width === void 0 || height === void 0) {
182
- throw upstreamError(502, "OpenGraph.io screenshot response did not include dimensions");
183
- }
184
- return compactDefined({
185
- screenshotUrl,
186
- dimensions: { width, height },
187
- requestInfo: normalizeRequestInfo(body.requestInfo ?? body.request_info)
188
- });
189
- }
190
-
191
- // ../plugins/src/opengraph_io/schema.ts
192
- var extractSiteInput = external_exports.strictObject({
193
- site: external_exports.url().describe("The site URL to inspect."),
194
- cacheOk: external_exports.boolean().describe("Whether cached results may be returned when available.").optional(),
195
- fullRender: external_exports.boolean().describe("Whether the page should be rendered in a browser before extraction.").optional(),
196
- useProxy: external_exports.boolean().describe("Whether a proxy should be used for the request.").optional(),
197
- usePremium: external_exports.boolean().describe("Whether a residential proxy should be used when available.").optional(),
198
- useSuperior: external_exports.boolean().describe("Whether a mobile-grade proxy should be used when available.").optional(),
199
- useAi: external_exports.boolean().describe("Whether AI-enhanced metadata extraction should be enabled.").optional(),
200
- maxCacheAge: external_exports.int().min(0).describe("The maximum accepted cache age in seconds.").optional(),
201
- acceptLang: external_exports.string().min(1).describe("The Accept-Language header value sent to the target site.").optional(),
202
- autoProxy: external_exports.boolean().describe("Whether OpenGraph.io may automatically decide whether to use a proxy.").optional(),
203
- autoRender: external_exports.boolean().describe("Whether OpenGraph.io may automatically decide whether full rendering is needed.").optional(),
204
- retry: external_exports.boolean().describe("Whether OpenGraph.io should retry with fallback transport strategies.").optional(),
205
- maxRetries: external_exports.int().min(0).describe("The maximum number of retry attempts.").optional(),
206
- retryEscalate: external_exports.boolean().describe("Whether retries may escalate to more expensive fallback strategies.").optional(),
207
- proxyCountry: external_exports.string().min(1).describe("The ISO 3166-1 alpha-2 country code to use for proxy egress.").optional()
208
- }).describe("The input payload for extracting OpenGraph.io site metadata.");
209
- var extractSiteOutput = external_exports.looseObject({
210
- hybridGraph: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
211
- openGraph: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
212
- twitterCard: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
213
- htmlInferred: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
214
- oEmbed: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
215
- requestUrl: external_exports.string().describe("The final URL that OpenGraph.io resolved after redirects.").optional(),
216
- requestInfo: external_exports.looseObject({
217
- host: external_exports.string().describe("The host that responded to the request.").optional(),
218
- redirects: external_exports.int().describe("The number of redirects followed while fetching the URL.").optional(),
219
- responseCode: external_exports.int().describe("The HTTP response code returned upstream.").optional(),
220
- responseContentType: external_exports.string().describe("The upstream response Content-Type header when available.").optional()
221
- }).describe("Information about the upstream request performed by OpenGraph.io.").optional(),
222
- cached: external_exports.boolean().describe("Whether the result came from cache.").optional(),
223
- createdAt: external_exports.string().describe("The ISO 8601 timestamp when the cached result was created.").nullable().optional(),
224
- retryInfo: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
225
- aiSafety: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
226
- domain: external_exports.string().describe("The domain extracted from the requested URL.").optional(),
227
- tags: external_exports.array(external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.")).describe("Additional tag-level extraction results when returned by the API.").optional()
228
- }).describe("The normalized metadata payload returned by the OpenGraph.io Site endpoint.");
229
- var scrapeSiteInput = external_exports.strictObject({
230
- site: external_exports.url().describe("The site URL to inspect."),
231
- cacheOk: external_exports.boolean().describe("Whether cached results may be returned when available.").optional(),
232
- fullRender: external_exports.boolean().describe("Whether the page should be rendered in a browser before extraction.").optional(),
233
- useProxy: external_exports.boolean().describe("Whether a proxy should be used for the request.").optional(),
234
- usePremium: external_exports.boolean().describe("Whether a residential proxy should be used when available.").optional(),
235
- useSuperior: external_exports.boolean().describe("Whether a mobile-grade proxy should be used when available.").optional(),
236
- useAi: external_exports.boolean().describe("Whether AI-enhanced metadata extraction should be enabled.").optional(),
237
- maxCacheAge: external_exports.int().min(0).describe("The maximum accepted cache age in seconds.").optional(),
238
- acceptLang: external_exports.string().min(1).describe("The Accept-Language header value sent to the target site.").optional(),
239
- autoProxy: external_exports.boolean().describe("Whether OpenGraph.io may automatically decide whether to use a proxy.").optional(),
240
- autoRender: external_exports.boolean().describe("Whether OpenGraph.io may automatically decide whether full rendering is needed.").optional(),
241
- retry: external_exports.boolean().describe("Whether OpenGraph.io should retry with fallback transport strategies.").optional(),
242
- maxRetries: external_exports.int().min(0).describe("The maximum number of retry attempts.").optional(),
243
- retryEscalate: external_exports.boolean().describe("Whether retries may escalate to more expensive fallback strategies.").optional(),
244
- proxyCountry: external_exports.string().min(1).describe("The ISO 3166-1 alpha-2 country code to use for proxy egress.").optional(),
245
- scrape: external_exports.boolean().describe("A reserved compatibility flag. The current official Site endpoint does not expose a separate scrape mode, so this value is ignored.").optional()
246
- }).describe("The input payload for retrieving OpenGraph.io site metadata.");
247
- var scrapeSiteOutput = external_exports.looseObject({
248
- hybridGraph: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
249
- openGraph: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
250
- twitterCard: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
251
- htmlInferred: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
252
- oEmbed: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
253
- requestUrl: external_exports.string().describe("The final URL that OpenGraph.io resolved after redirects.").optional(),
254
- requestInfo: external_exports.looseObject({
255
- host: external_exports.string().describe("The host that responded to the request.").optional(),
256
- redirects: external_exports.int().describe("The number of redirects followed while fetching the URL.").optional(),
257
- responseCode: external_exports.int().describe("The HTTP response code returned upstream.").optional(),
258
- responseContentType: external_exports.string().describe("The upstream response Content-Type header when available.").optional()
259
- }).describe("Information about the upstream request performed by OpenGraph.io.").optional(),
260
- cached: external_exports.boolean().describe("Whether the result came from cache.").optional(),
261
- createdAt: external_exports.string().describe("The ISO 8601 timestamp when the cached result was created.").nullable().optional(),
262
- retryInfo: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
263
- aiSafety: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional(),
264
- domain: external_exports.string().describe("The domain extracted from the requested URL.").optional(),
265
- tags: external_exports.array(external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.")).describe("Additional tag-level extraction results when returned by the API.").optional()
266
- }).describe("The normalized metadata payload returned by the OpenGraph.io Site endpoint.");
267
- var scrapeUrlInput = external_exports.strictObject({
268
- url: external_exports.url().describe("The page URL to scrape for raw HTML."),
269
- cacheOk: external_exports.boolean().describe("Whether cached results may be returned when available.").optional(),
270
- fullRender: external_exports.boolean().describe("Whether the page should be rendered in a browser before scraping.").optional(),
271
- useProxy: external_exports.boolean().describe("Whether a proxy should be used for the request.").optional(),
272
- usePremium: external_exports.boolean().describe("Whether a residential proxy should be used when available.").optional(),
273
- useSuperior: external_exports.boolean().describe("Whether a mobile-grade proxy should be used when available.").optional(),
274
- acceptLang: external_exports.string().min(1).describe("The Accept-Language header value sent to the target site.").optional(),
275
- autoProxy: external_exports.boolean().describe("Whether OpenGraph.io may automatically decide whether to use a proxy.").optional(),
276
- autoRender: external_exports.boolean().describe("Whether OpenGraph.io may automatically decide whether full rendering is needed.").optional(),
277
- retry: external_exports.boolean().describe("Whether OpenGraph.io should retry with fallback transport strategies.").optional()
278
- }).describe("The input payload for scraping a URL with OpenGraph.io.");
279
- var scrapeUrlOutput = external_exports.looseObject({
280
- htmlContent: external_exports.string().describe("The raw HTML content returned for the page.").optional(),
281
- requestInfo: external_exports.looseObject({
282
- host: external_exports.string().describe("The host that responded to the request.").optional(),
283
- redirects: external_exports.int().describe("The number of redirects followed while fetching the URL.").optional(),
284
- responseCode: external_exports.int().describe("The HTTP response code returned upstream.").optional(),
285
- responseContentType: external_exports.string().describe("The upstream response Content-Type header when available.").optional()
286
- }).describe("Information about the upstream request performed by OpenGraph.io.").optional(),
287
- retryInfo: external_exports.looseObject({}).describe("A loose JSON object returned by OpenGraph.io.").optional()
288
- }).describe("The normalized output payload returned by the OpenGraph.io Scrape endpoint.");
289
- var captureScreenshotInput = external_exports.strictObject({
290
- url: external_exports.url().describe("The page URL to capture as an image."),
291
- format: external_exports.enum(["jpeg", "png", "webp"]).describe("The output image format.").optional(),
292
- quality: external_exports.int().min(10).max(80).describe("The image quality from 10 to 80.").optional(),
293
- cacheOk: external_exports.boolean().describe("Whether cached screenshots may be returned when available.").optional(),
294
- selector: external_exports.string().min(1).describe("An optional CSS selector that limits the capture to a specific element.").optional(),
295
- darkMode: external_exports.boolean().describe("Whether the page should be rendered with a dark color-scheme preference.").optional(),
296
- fullPage: external_exports.boolean().describe("Whether the entire scrollable page should be captured.").optional(),
297
- useProxy: external_exports.boolean().describe("Whether a proxy should be used for the request.").optional(),
298
- dimensions: external_exports.enum(["xs", "sm", "md", "lg"]).describe("A viewport size preset.").optional(),
299
- captureDelay: external_exports.int().min(0).max(1e4).describe("The delay in milliseconds before taking the screenshot.").optional(),
300
- excludeSelectors: external_exports.string().min(1).describe("Comma-separated CSS selectors for elements that should be hidden.").optional(),
301
- navigationTimeout: external_exports.int().min(1e3).max(6e4).describe("The navigation timeout in milliseconds.").optional(),
302
- blockCookieBanner: external_exports.boolean().describe("Whether known cookie consent banners should be blocked.").optional()
303
- }).describe("The input payload for capturing a screenshot with OpenGraph.io.");
304
- var captureScreenshotOutput = external_exports.looseObject({
305
- screenshotUrl: external_exports.url().describe("The URL of the generated screenshot image.").optional(),
306
- dimensions: external_exports.strictObject({
307
- width: external_exports.int().describe("The screenshot width in pixels.").optional(),
308
- height: external_exports.int().describe("The screenshot height in pixels.").optional()
309
- }).describe("The dimensions of the captured screenshot.").optional(),
310
- requestInfo: external_exports.looseObject({
311
- host: external_exports.string().describe("The host that responded to the request.").optional(),
312
- redirects: external_exports.int().describe("The number of redirects followed while fetching the URL.").optional(),
313
- responseCode: external_exports.int().describe("The HTTP response code returned upstream.").optional(),
314
- responseContentType: external_exports.string().describe("The upstream response Content-Type header when available.").optional()
315
- }).describe("Information about the upstream request performed by OpenGraph.io.").optional()
316
- }).describe("The normalized output payload returned by the OpenGraph.io Screenshot endpoint.");
317
- var opengraphIoActions = {
318
- extract_site: {
319
- description: "Extract Open Graph, Twitter Card, oEmbed, and inferred metadata for a site through the OpenGraph.io Site endpoint.",
320
- effect: "write",
321
- inputSchema: extractSiteInput,
322
- outputSchema: external_exports.toJSONSchema(extractSiteOutput, { io: "output", unrepresentable: "any" })
323
- },
324
- scrape_site: {
325
- description: "Retrieve a site's metadata through the OpenGraph.io Site endpoint with cache, proxy, render, and retry controls.",
326
- effect: "write",
327
- inputSchema: scrapeSiteInput,
328
- outputSchema: external_exports.toJSONSchema(scrapeSiteOutput, { io: "output", unrepresentable: "any" })
329
- },
330
- scrape_url: {
331
- description: "Fetch the raw HTML for a page through the OpenGraph.io Scrape endpoint with optional render and proxy controls.",
332
- effect: "write",
333
- inputSchema: scrapeUrlInput,
334
- outputSchema: external_exports.toJSONSchema(scrapeUrlOutput, { io: "output", unrepresentable: "any" })
335
- },
336
- capture_screenshot: {
337
- description: "Capture a webpage screenshot through the OpenGraph.io Screenshot endpoint with configurable viewport, delay, and element selection.",
338
- effect: "write",
339
- inputSchema: captureScreenshotInput,
340
- outputSchema: external_exports.toJSONSchema(captureScreenshotOutput, { io: "output", unrepresentable: "any" })
341
- }
342
- };
343
-
344
- // ../plugins/src/opengraph_io/index.ts
345
- function createOpengraphIoPlugin() {
346
- return createProviderPlugin({
347
- description: "OpenGraph.io",
348
- actions: opengraphIoActions,
349
- handlers: {
350
- extract_site: extractSite,
351
- scrape_site: scrapeSite,
352
- scrape_url: scrapeUrl,
353
- capture_screenshot: captureScreenshot
354
- }
355
- });
356
- }
357
- var opengraph_io_default = createOpengraphIoPlugin();
358
- export {
359
- createOpengraphIoPlugin,
360
- opengraph_io_default as default
361
- };