@tool-bridge/server 0.21.1 → 0.23.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 (178) hide show
  1. package/dist/admin.js +170 -0
  2. package/dist/airtable-VMQVXLHK.js +790 -0
  3. package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
  4. package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
  5. package/dist/anthropic-S67AZFZ3.js +203 -0
  6. package/dist/apify-ZE6MYQI3.js +248 -0
  7. package/dist/brave_search-TG2M2KOD.js +302 -0
  8. package/dist/chunk-2JNAI4OC.js +161 -0
  9. package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
  10. package/dist/chunk-5ICRY3VU.js +8432 -0
  11. package/dist/chunk-7CTWGTDU.js +302 -0
  12. package/dist/chunk-BADVCN6K.js +378 -0
  13. package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
  14. package/dist/chunk-U7PTOA3U.js +7320 -0
  15. package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
  16. package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
  17. package/dist/circleci-3L3WJVSK.js +389 -0
  18. package/dist/clerk-EZPF2V7T.js +1019 -0
  19. package/dist/cohere-U27DPO64.js +185 -0
  20. package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
  21. package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
  22. package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
  23. package/dist/deepseek-6HT6WF3M.js +210 -0
  24. package/dist/docker_hub-LPE3PCVB.js +933 -0
  25. package/dist/dropbox-V56ABHTA.js +1305 -0
  26. package/dist/dub-6OKQ7MHT.js +680 -0
  27. package/dist/e2b-JS2U2QFU.js +278 -0
  28. package/dist/exa-DPWVYXSP.js +332 -0
  29. package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
  30. package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
  31. package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
  32. package/dist/figma-FT5I7ITD.js +777 -0
  33. package/dist/firehydrant-EIKLKHX2.js +563 -0
  34. package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
  35. package/dist/fly-T3JYFZ2M.js +469 -0
  36. package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
  37. package/dist/geocodio-BOTD5TI5.js +213 -0
  38. package/dist/ghost-KYP7SZGB.js +338 -0
  39. package/dist/github-AGMZT3VY.js +5421 -0
  40. package/dist/gmail-BLJNJOBG.js +1887 -0
  41. package/dist/googlecalendar-GTHWNCF6.js +2524 -0
  42. package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
  43. package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
  44. package/dist/graphhopper-6OLGBDGB.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-4QN42E6T.js} +28 -27
  48. package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
  49. package/dist/ipqualityscore-6ANBPXKT.js +279 -0
  50. package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
  51. package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
  52. package/dist/langsmith-JZA345I5.js +593 -0
  53. package/dist/lemlist-43IV7DK6.js +289 -0
  54. package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
  55. package/dist/logsnag-5RMYAHIL.js +150 -0
  56. package/dist/main.js +57 -280
  57. package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
  58. package/dist/mem0-NYO4DTP6.js +544 -0
  59. package/dist/memos-37MPQOLV.js +744 -0
  60. package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
  61. package/dist/mistral_ai-6PL3K4PM.js +1196 -0
  62. package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
  63. package/dist/ngrok-UO6CDYCA.js +356 -0
  64. package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
  65. package/dist/notion-BEAJFUOE.js +940 -0
  66. package/dist/open_exchange_rates-CMF62JB4.js +215 -0
  67. package/dist/openai-IHOMKVND.js +800 -0
  68. package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
  69. package/dist/openrouter-HXLW3NR5.js +441 -0
  70. package/dist/outline-ELCP4NEU.js +599 -0
  71. package/dist/paddle-O77LALVN.js +454 -0
  72. package/dist/perplexity-JCU654QV.js +220 -0
  73. package/dist/pinecone-W5W4LRKL.js +571 -0
  74. package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
  75. package/dist/polar-R33XU4L3.js +395 -0
  76. package/dist/posthog-JVNTOLTV.js +3464 -0
  77. package/dist/postmark-6SBG7HWV.js +427 -0
  78. package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
  79. package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
  80. package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
  81. package/dist/readwise-BLATSMC3.js +470 -0
  82. package/dist/render-QYRVIXII.js +461 -0
  83. package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
  84. package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
  85. package/dist/rootly-MHCPEQ26.js +336 -0
  86. package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
  87. package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
  88. package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
  89. package/dist/semantic_scholar-LRSWA2GE.js +611 -0
  90. package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
  91. package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
  92. package/dist/shopify-64YDK5T2.js +610 -0
  93. package/dist/stripe-QAIGGOTF.js +585 -0
  94. package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
  95. package/dist/tavily-QIXCDDWO.js +326 -0
  96. package/dist/telegram-E6G7CWI6.js +1767 -0
  97. package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
  98. package/dist/todoist-DMYF3G7J.js +664 -0
  99. package/dist/trello-HY2RYIRP.js +1080 -0
  100. package/dist/turso-HAQWMGRP.js +416 -0
  101. package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
  102. package/dist/umami-DZHBLPVG.js +389 -0
  103. package/dist/unsplash-GS2OPXKE.js +351 -0
  104. package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
  105. package/dist/uptimerobot-TF5WRZ4G.js +483 -0
  106. package/dist/v2ex-2BVXAPDF.js +667 -0
  107. package/dist/vercel-YMJGQYJE.js +1076 -0
  108. package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
  109. package/dist/wordpress-R7TDFZ2P.js +812 -0
  110. package/dist/workos-HDNHWVMS.js +664 -0
  111. package/dist/zhihu-LX6AGGDS.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
@@ -0,0 +1,351 @@
1
+ import {
2
+ createAuthedClient
3
+ } from "./chunk-TDAWLMDE.js";
4
+ import "./chunk-VWRUGUSU.js";
5
+ import {
6
+ asJsonObject,
7
+ finiteNumber,
8
+ trimmedText
9
+ } from "./chunk-JXHMDBAY.js";
10
+ import {
11
+ createProviderPlugin,
12
+ requireApiKey,
13
+ upstreamError
14
+ } from "./chunk-WJHG6OK7.js";
15
+ import "./chunk-2JNAI4OC.js";
16
+ import "./chunk-BADVCN6K.js";
17
+ import {
18
+ TBError
19
+ } from "./chunk-5ICRY3VU.js";
20
+ import "./chunk-U67V476Y.js";
21
+
22
+ // ../plugins/src/unsplash/api.ts
23
+ var SERVICE = "unsplash";
24
+ var API_BASE = "https://api.unsplash.com";
25
+ function requireRecord(value, label) {
26
+ const result = asJsonObject(value);
27
+ if (result === void 0) {
28
+ throw new TBError("unavailable", `${label}\u4E0D\u662F\u5BF9\u8C61`, { retryable: true });
29
+ }
30
+ return result;
31
+ }
32
+ function objectArray(value) {
33
+ if (!Array.isArray(value)) {
34
+ throw new TBError("unavailable", "Unsplash \u54CD\u5E94\u4E0D\u662F\u6570\u7EC4", { retryable: true });
35
+ }
36
+ return value.map((item) => requireRecord(item, "Unsplash \u6570\u7EC4\u5143\u7D20"));
37
+ }
38
+ function requireText(value, field) {
39
+ const result = trimmedText(value);
40
+ if (result === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u662F\u7A7A\u767D`);
41
+ return result;
42
+ }
43
+ function csv(value) {
44
+ if (value === void 0) return void 0;
45
+ const items = value.map((item) => trimmedText(item)).filter((item) => item !== void 0);
46
+ return items.length > 0 ? items.join(",") : void 0;
47
+ }
48
+ function errorMessage(payload) {
49
+ const body = asJsonObject(payload);
50
+ if (body === void 0) return void 0;
51
+ if (Array.isArray(body.errors)) {
52
+ for (const item of body.errors) {
53
+ const message = trimmedText(item);
54
+ if (message !== void 0) return message;
55
+ }
56
+ }
57
+ return trimmedText(body.error) ?? trimmedText(body.message);
58
+ }
59
+ var http = createAuthedClient({
60
+ baseUrl: `${API_BASE}/`,
61
+ service: SERVICE,
62
+ // Unsplash 自有的方案名,不是 Bearer。
63
+ auth: { kind: "custom", headers: (ctx) => ({ authorization: `Client-ID ${requireApiKey(ctx, SERVICE)}` }) },
64
+ headers: { "accept": "application/json", "accept-version": "v1" },
65
+ mapError: ({ bodyKind, data, status }) => upstreamError(
66
+ status,
67
+ errorMessage(bodyKind === "json" ? data : null) ?? `Unsplash \u8FD4\u56DE HTTP ${status}`
68
+ )
69
+ });
70
+ async function request(ctx, path, query = {}) {
71
+ const response = await http.request(ctx, {
72
+ path,
73
+ query: Object.entries(query),
74
+ invalidJson: "text"
75
+ });
76
+ if (response.bodyKind === "invalid-json") {
77
+ throw new TBError("unavailable", "Unsplash \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
78
+ }
79
+ return response.bodyKind === "empty" ? null : response.data;
80
+ }
81
+ async function listPhotos(input, ctx) {
82
+ const payload = await request(ctx, "/photos", {
83
+ page: input.page,
84
+ per_page: input.perPage,
85
+ order_by: input.orderBy
86
+ });
87
+ return { photos: objectArray(payload) };
88
+ }
89
+ async function searchPhotos(input, ctx) {
90
+ const payload = await request(ctx, "/search/photos", {
91
+ // 参数名是 `query`,不是各家搜索 API 常见的 `q`。
92
+ query: requireText(input.query, "query"),
93
+ page: input.page,
94
+ per_page: input.perPage,
95
+ order_by: input.orderBy,
96
+ color: input.color,
97
+ orientation: input.orientation,
98
+ content_filter: input.contentFilter,
99
+ collections: csv(input.collections)
100
+ });
101
+ const result = requireRecord(payload, "Unsplash \u641C\u7D22\u54CD\u5E94");
102
+ return {
103
+ total: finiteNumber(result.total) ?? 0,
104
+ totalPages: finiteNumber(result.total_pages) ?? 0,
105
+ results: objectArray(result.results)
106
+ };
107
+ }
108
+ async function getPhoto(input, ctx) {
109
+ const id = requireText(input.id, "id");
110
+ const payload = await request(ctx, `/photos/${encodeURIComponent(id)}`);
111
+ return { photo: requireRecord(payload, "Unsplash \u7167\u7247\u54CD\u5E94") };
112
+ }
113
+ async function getRandomPhoto(input, ctx) {
114
+ const query = trimmedText(input.query);
115
+ const collections = csv(input.collections);
116
+ const topics = csv(input.topics);
117
+ if (query !== void 0 && (collections !== void 0 || topics !== void 0)) {
118
+ throw new TBError("invalid_argument", "get_random_photo \u7684 query \u4E0D\u80FD\u4E0E collections \u6216 topics \u540C\u65F6\u4F7F\u7528");
119
+ }
120
+ const payload = await request(ctx, "/photos/random", {
121
+ query,
122
+ collections,
123
+ topics,
124
+ username: trimmedText(input.username),
125
+ orientation: input.orientation,
126
+ content_filter: input.contentFilter,
127
+ count: input.count
128
+ });
129
+ return {
130
+ photos: Array.isArray(payload) ? objectArray(payload) : [requireRecord(payload, "Unsplash \u968F\u673A\u7167\u7247\u54CD\u5E94")]
131
+ };
132
+ }
133
+ async function listTopics(input, ctx) {
134
+ const payload = await request(ctx, "/topics", {
135
+ page: input.page,
136
+ per_page: input.perPage,
137
+ order_by: input.orderBy
138
+ });
139
+ return { topics: objectArray(payload) };
140
+ }
141
+ async function getTopicPhotos(input, ctx) {
142
+ const topic = requireText(input.topicIdOrSlug, "topicIdOrSlug");
143
+ const payload = await request(ctx, `/topics/${encodeURIComponent(topic)}/photos`, {
144
+ page: input.page,
145
+ per_page: input.perPage,
146
+ orientation: input.orientation,
147
+ order_by: input.orderBy
148
+ });
149
+ return { photos: objectArray(payload) };
150
+ }
151
+
152
+ // ../plugins/src/unsplash/schema.ts
153
+ import { z } from "zod/v4";
154
+ var listPhotosInput = z.strictObject({
155
+ page: z.int().min(1).describe("The 1-based page number to retrieve.").optional(),
156
+ perPage: z.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
157
+ orderBy: z.enum(["latest", "oldest", "popular"]).describe("The sort order supported by the Unsplash photo listing endpoints.").optional()
158
+ }).describe("The input payload for listing the latest public photos from Unsplash.");
159
+ var listPhotosOutput = z.strictObject({
160
+ photos: z.array(z.strictObject({
161
+ id: z.string().describe("The unique identifier of the photo."),
162
+ slug: z.string().describe("The public slug of the photo.").optional(),
163
+ description: z.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
164
+ alt_description: z.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
165
+ width: z.number().describe("The width of the photo in pixels.").optional(),
166
+ height: z.number().describe("The height of the photo in pixels.").optional(),
167
+ color: z.string().describe("The representative HEX color of the photo.").optional(),
168
+ blur_hash: z.string().describe("The blur hash value of the photo.").optional(),
169
+ urls: z.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
170
+ links: z.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
171
+ user: z.looseObject({}).describe("The user metadata attached to the photo.").optional()
172
+ }).describe("A summary photo resource returned by Unsplash.")).describe("The public photo summaries returned by Unsplash.")
173
+ }).describe("The latest public photos returned by Unsplash.");
174
+ var searchPhotosInput = z.strictObject({
175
+ query: z.string().min(1).describe("The search query to run against Unsplash photos."),
176
+ page: z.int().min(1).describe("The 1-based page number to retrieve.").optional(),
177
+ perPage: z.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
178
+ orderBy: z.enum(["relevant", "latest"]).describe("The sort order supported by the Unsplash photo search endpoint.").optional(),
179
+ color: z.enum(["black_and_white", "black", "white", "yellow", "orange", "red", "purple", "magenta", "green", "teal", "blue"]).describe("The color filter to apply to photo search results.").optional(),
180
+ orientation: z.enum(["landscape", "portrait", "squarish"]).describe("The photo orientation filter to apply.").optional(),
181
+ contentFilter: z.enum(["low", "high"]).describe("The safety filter level to apply to supported Unsplash requests.").optional(),
182
+ collections: z.array(z.string().min(1).describe("One identifier value.")).min(1).describe("The collection identifiers to filter the search results by.").optional()
183
+ }).describe("The input payload for searching photos on Unsplash.");
184
+ var searchPhotosOutput = z.strictObject({
185
+ total: z.number().describe("The total number of matching photo results."),
186
+ totalPages: z.number().describe("The total number of result pages."),
187
+ results: z.array(z.strictObject({
188
+ id: z.string().describe("The unique identifier of the photo."),
189
+ slug: z.string().describe("The public slug of the photo.").optional(),
190
+ description: z.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
191
+ alt_description: z.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
192
+ width: z.number().describe("The width of the photo in pixels.").optional(),
193
+ height: z.number().describe("The height of the photo in pixels.").optional(),
194
+ color: z.string().describe("The representative HEX color of the photo.").optional(),
195
+ blur_hash: z.string().describe("The blur hash value of the photo.").optional(),
196
+ urls: z.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
197
+ links: z.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
198
+ user: z.looseObject({}).describe("The user metadata attached to the photo.").optional()
199
+ }).describe("A summary photo resource returned by Unsplash.")).describe("The matching photo summaries returned by Unsplash.")
200
+ }).describe("The photo search results returned by Unsplash.");
201
+ var getPhotoInput = z.strictObject({
202
+ id: z.string().min(1).describe("The Unsplash photo identifier to retrieve.")
203
+ }).describe("The input payload for fetching a single Unsplash photo.");
204
+ var getPhotoOutput = z.strictObject({
205
+ photo: z.strictObject({
206
+ id: z.string().describe("The unique identifier of the photo."),
207
+ slug: z.string().describe("The public slug of the photo.").optional(),
208
+ description: z.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
209
+ alt_description: z.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
210
+ width: z.number().describe("The width of the photo in pixels.").optional(),
211
+ height: z.number().describe("The height of the photo in pixels.").optional(),
212
+ color: z.string().describe("The representative HEX color of the photo.").optional(),
213
+ blur_hash: z.string().describe("The blur hash value of the photo.").optional(),
214
+ urls: z.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
215
+ links: z.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
216
+ user: z.looseObject({}).describe("The user metadata attached to the photo.").optional(),
217
+ created_at: z.string().describe("The creation timestamp of the photo.").optional(),
218
+ liked_by_user: z.boolean().describe("Whether the authenticated user liked the photo.").optional(),
219
+ likes: z.number().describe("The total number of likes on the photo.").optional(),
220
+ current_user_collections: z.array(z.looseObject({}).describe("One current user collection reference.")).describe("The current user collections returned with the photo.").optional()
221
+ }).describe("A detailed photo resource returned by Unsplash.")
222
+ }).describe("The detailed photo payload returned by Unsplash.");
223
+ var getRandomPhotoInput = z.strictObject({
224
+ query: z.string().min(1).describe("The search query used to constrain the random photo.").optional(),
225
+ collections: z.array(z.string().min(1).describe("One identifier value.")).min(1).describe("The collection identifiers used to constrain the random photo.").optional(),
226
+ topics: z.array(z.string().min(1).describe("One identifier value.")).min(1).describe("The topic identifiers used to constrain the random photo.").optional(),
227
+ username: z.string().min(1).describe("The username used to constrain the random photo.").optional(),
228
+ orientation: z.enum(["landscape", "portrait", "squarish"]).describe("The photo orientation filter to apply.").optional(),
229
+ contentFilter: z.enum(["low", "high"]).describe("The safety filter level to apply to supported Unsplash requests.").optional(),
230
+ count: z.int().min(1).max(30).describe("The number of random photos to request, between 1 and 30.").optional()
231
+ }).describe("The input payload for fetching one or more random Unsplash photos.");
232
+ var getRandomPhotoOutput = z.strictObject({
233
+ photos: z.array(z.strictObject({
234
+ id: z.string().describe("The unique identifier of the photo."),
235
+ slug: z.string().describe("The public slug of the photo.").optional(),
236
+ description: z.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
237
+ alt_description: z.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
238
+ width: z.number().describe("The width of the photo in pixels.").optional(),
239
+ height: z.number().describe("The height of the photo in pixels.").optional(),
240
+ color: z.string().describe("The representative HEX color of the photo.").optional(),
241
+ blur_hash: z.string().describe("The blur hash value of the photo.").optional(),
242
+ urls: z.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
243
+ links: z.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
244
+ user: z.looseObject({}).describe("The user metadata attached to the photo.").optional(),
245
+ created_at: z.string().describe("The creation timestamp of the photo.").optional(),
246
+ liked_by_user: z.boolean().describe("Whether the authenticated user liked the photo.").optional(),
247
+ likes: z.number().describe("The total number of likes on the photo.").optional(),
248
+ current_user_collections: z.array(z.looseObject({}).describe("One current user collection reference.")).describe("The current user collections returned with the photo.").optional()
249
+ }).describe("A detailed photo resource returned by Unsplash.")).describe("The random photo resources returned by Unsplash.")
250
+ }).describe("The normalized random photo payload returned by Unsplash.");
251
+ var listTopicsInput = z.strictObject({
252
+ page: z.int().min(1).describe("The 1-based page number to retrieve.").optional(),
253
+ perPage: z.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
254
+ orderBy: z.enum(["position", "latest", "oldest", "popular"]).describe("The sort order supported by the Unsplash topic listing endpoint.").optional()
255
+ }).describe("The input payload for listing Unsplash topics.");
256
+ var listTopicsOutput = z.strictObject({
257
+ topics: z.array(z.strictObject({
258
+ id: z.string().describe("The unique identifier of the topic."),
259
+ slug: z.string().describe("The topic slug.").optional(),
260
+ title: z.string().describe("The display title of the topic."),
261
+ description: z.string().describe("The description of the topic when Unsplash provides it.").nullable().optional(),
262
+ featured: z.boolean().describe("Whether the topic is marked as featured.").optional(),
263
+ total_photos: z.number().describe("The total number of photos in the topic.").optional(),
264
+ links: z.looseObject({}).describe("The related links attached to the Unsplash topic resource.").optional(),
265
+ cover_photo: z.looseObject({}).describe("The cover photo attached to the topic when Unsplash provides it.").optional()
266
+ }).describe("A topic resource returned by Unsplash.")).describe("The topics returned by Unsplash.")
267
+ }).describe("The topic listing returned by Unsplash.");
268
+ var getTopicPhotosInput = z.strictObject({
269
+ topicIdOrSlug: z.string().min(1).describe("The topic identifier or slug to read photos from."),
270
+ page: z.int().min(1).describe("The 1-based page number to retrieve.").optional(),
271
+ perPage: z.int().min(1).max(30).describe("The number of items to return per page, between 1 and 30.").optional(),
272
+ orientation: z.enum(["landscape", "portrait", "squarish"]).describe("The photo orientation filter to apply.").optional(),
273
+ orderBy: z.enum(["latest", "oldest", "popular"]).describe("The sort order supported by the Unsplash photo listing endpoints.").optional()
274
+ }).describe("The input payload for listing photos from an Unsplash topic.");
275
+ var getTopicPhotosOutput = z.strictObject({
276
+ photos: z.array(z.strictObject({
277
+ id: z.string().describe("The unique identifier of the photo."),
278
+ slug: z.string().describe("The public slug of the photo.").optional(),
279
+ description: z.string().describe("The description of the photo when Unsplash provides it.").nullable().optional(),
280
+ alt_description: z.string().describe("The alternative description of the photo when Unsplash provides it.").nullable().optional(),
281
+ width: z.number().describe("The width of the photo in pixels.").optional(),
282
+ height: z.number().describe("The height of the photo in pixels.").optional(),
283
+ color: z.string().describe("The representative HEX color of the photo.").optional(),
284
+ blur_hash: z.string().describe("The blur hash value of the photo.").optional(),
285
+ urls: z.looseObject({}).describe("The photo URLs returned by Unsplash in multiple sizes.").optional(),
286
+ links: z.looseObject({}).describe("The related links attached to the Unsplash photo resource.").optional(),
287
+ user: z.looseObject({}).describe("The user metadata attached to the photo.").optional()
288
+ }).describe("A summary photo resource returned by Unsplash.")).describe("The photo summaries returned for the requested Unsplash topic.")
289
+ }).describe("The topic photo listing returned by Unsplash.");
290
+ var unsplashActions = {
291
+ list_photos: {
292
+ description: "List the latest public photos from Unsplash.",
293
+ effect: "read",
294
+ inputSchema: listPhotosInput,
295
+ outputSchema: z.toJSONSchema(listPhotosOutput, { io: "output", unrepresentable: "any" })
296
+ },
297
+ search_photos: {
298
+ description: "Search photos on Unsplash using keyword and filter inputs.",
299
+ effect: "read",
300
+ inputSchema: searchPhotosInput,
301
+ outputSchema: z.toJSONSchema(searchPhotosOutput, { io: "output", unrepresentable: "any" })
302
+ },
303
+ get_photo: {
304
+ description: "Fetch the detailed payload for a single Unsplash photo.",
305
+ effect: "read",
306
+ inputSchema: getPhotoInput,
307
+ outputSchema: z.toJSONSchema(getPhotoOutput, { io: "output", unrepresentable: "any" })
308
+ },
309
+ get_random_photo: {
310
+ description: "Fetch one or more random Unsplash photos using optional filters.",
311
+ effect: "read",
312
+ inputSchema: getRandomPhotoInput,
313
+ outputSchema: z.toJSONSchema(getRandomPhotoOutput, { io: "output", unrepresentable: "any" })
314
+ },
315
+ list_topics: {
316
+ description: "List topics curated by Unsplash.",
317
+ effect: "read",
318
+ inputSchema: listTopicsInput,
319
+ outputSchema: z.toJSONSchema(listTopicsOutput, { io: "output", unrepresentable: "any" })
320
+ },
321
+ get_topic_photos: {
322
+ description: "List photos from a specific Unsplash topic.",
323
+ effect: "read",
324
+ inputSchema: getTopicPhotosInput,
325
+ outputSchema: z.toJSONSchema(getTopicPhotosOutput, { io: "output", unrepresentable: "any" })
326
+ }
327
+ };
328
+
329
+ // ../plugins/src/unsplash/index.ts
330
+ function createUnsplashPlugin() {
331
+ return createProviderPlugin({
332
+ description: "Unsplash",
333
+ actions: unsplashActions,
334
+ // 上游 `credentialValidators.apiKey` 打的就是 `/photos?page=1&per_page=1`,
335
+ // 对应这里的 list_photos:read、无必填入参,平台空参调它即可验证 access key。
336
+ credentialProbe: "list_photos",
337
+ handlers: {
338
+ list_photos: listPhotos,
339
+ search_photos: searchPhotos,
340
+ get_photo: getPhoto,
341
+ get_random_photo: getRandomPhoto,
342
+ list_topics: listTopics,
343
+ get_topic_photos: getTopicPhotos
344
+ }
345
+ });
346
+ }
347
+ var unsplash_default = createUnsplashPlugin();
348
+ export {
349
+ createUnsplashPlugin,
350
+ unsplash_default as default
351
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAuthedClient
3
- } from "./chunk-XYBU3WZH.js";
4
- import "./chunk-E6JCVKW6.js";
3
+ } from "./chunk-TDAWLMDE.js";
4
+ import "./chunk-VWRUGUSU.js";
5
5
  import {
6
6
  asJsonObject,
7
7
  trimmedText
@@ -10,12 +10,12 @@ import {
10
10
  createProviderPlugin,
11
11
  requireCredential,
12
12
  upstreamError
13
- } from "./chunk-ATK45BXV.js";
14
- import "./chunk-U7B6DS2O.js";
13
+ } from "./chunk-WJHG6OK7.js";
14
+ import "./chunk-2JNAI4OC.js";
15
+ import "./chunk-BADVCN6K.js";
15
16
  import {
16
- TBError,
17
- external_exports
18
- } from "./chunk-UZM2RXZH.js";
17
+ TBError
18
+ } from "./chunk-5ICRY3VU.js";
19
19
  import "./chunk-U67V476Y.js";
20
20
 
21
21
  // ../plugins/src/upstash_redis/api.ts
@@ -159,98 +159,99 @@ async function scan(input, ctx) {
159
159
  }
160
160
 
161
161
  // ../plugins/src/upstash_redis/schema.ts
162
- var getInput = external_exports.strictObject({
163
- key: external_exports.string().min(1).describe("The Redis key.")
162
+ import { z } from "zod/v4";
163
+ var getInput = z.strictObject({
164
+ key: z.string().min(1).describe("The Redis key.")
164
165
  }).describe("The Redis key to retrieve.");
165
- var getOutput = external_exports.strictObject({
166
- value: external_exports.string().describe("The stored string value, or null when the key does not exist. Upstash replaces bytes that are not valid UTF-8 with U+FFFD, so only text values round-trip exactly.").nullable()
166
+ var getOutput = z.strictObject({
167
+ value: z.string().describe("The stored string value, or null when the key does not exist. Upstash replaces bytes that are not valid UTF-8 with U+FFFD, so only text values round-trip exactly.").nullable()
167
168
  }).describe("The value returned for the Redis key.");
168
- var setInput = external_exports.strictObject({
169
- key: external_exports.string().min(1).describe("The Redis key."),
170
- value: external_exports.string().min(1).describe("The string value stored for the Redis key."),
171
- expirationSeconds: external_exports.int().min(1).describe("Expiration time in seconds.").optional(),
172
- condition: external_exports.enum(["NX", "XX"]).describe("Optional Redis write condition: NX stores only a new key; XX stores only an existing key.").optional()
169
+ var setInput = z.strictObject({
170
+ key: z.string().min(1).describe("The Redis key."),
171
+ value: z.string().min(1).describe("The string value stored for the Redis key."),
172
+ expirationSeconds: z.int().min(1).describe("Expiration time in seconds.").optional(),
173
+ condition: z.enum(["NX", "XX"]).describe("Optional Redis write condition: NX stores only a new key; XX stores only an existing key.").optional()
173
174
  }).describe("The Redis string value to store.");
174
- var setOutput = external_exports.strictObject({
175
- stored: external_exports.boolean().describe("Whether Redis stored the value. False means the requested condition was not met.")
175
+ var setOutput = z.strictObject({
176
+ stored: z.boolean().describe("Whether Redis stored the value. False means the requested condition was not met.")
176
177
  }).describe("The result of the Redis SET command.");
177
- var deleteInput = external_exports.strictObject({
178
- key: external_exports.string().min(1).describe("The Redis key.")
178
+ var deleteInput = z.strictObject({
179
+ key: z.string().min(1).describe("The Redis key.")
179
180
  }).describe("The Redis key to delete.");
180
- var deleteOutput = external_exports.strictObject({
181
- deleted: external_exports.boolean().describe("Whether Redis deleted an existing key.")
181
+ var deleteOutput = z.strictObject({
182
+ deleted: z.boolean().describe("Whether Redis deleted an existing key.")
182
183
  }).describe("The result of the Redis DEL command.");
183
- var existsInput = external_exports.strictObject({
184
- key: external_exports.string().min(1).describe("The Redis key.")
184
+ var existsInput = z.strictObject({
185
+ key: z.string().min(1).describe("The Redis key.")
185
186
  }).describe("The Redis key to check.");
186
- var existsOutput = external_exports.strictObject({
187
- exists: external_exports.boolean().describe("Whether the Redis key exists.")
187
+ var existsOutput = z.strictObject({
188
+ exists: z.boolean().describe("Whether the Redis key exists.")
188
189
  }).describe("The result of the Redis EXISTS command.");
189
- var expireInput = external_exports.strictObject({
190
- key: external_exports.string().min(1).describe("The Redis key."),
191
- expirationSeconds: external_exports.int().min(1).describe("Expiration time in seconds.")
190
+ var expireInput = z.strictObject({
191
+ key: z.string().min(1).describe("The Redis key."),
192
+ expirationSeconds: z.int().min(1).describe("Expiration time in seconds.")
192
193
  }).describe("The Redis key and its new expiration time.");
193
- var expireOutput = external_exports.strictObject({
194
- updated: external_exports.boolean().describe("Whether Redis updated the expiration for an existing key.")
194
+ var expireOutput = z.strictObject({
195
+ updated: z.boolean().describe("Whether Redis updated the expiration for an existing key.")
195
196
  }).describe("The result of the Redis EXPIRE command.");
196
- var ttlInput = external_exports.strictObject({
197
- key: external_exports.string().min(1).describe("The Redis key.")
197
+ var ttlInput = z.strictObject({
198
+ key: z.string().min(1).describe("The Redis key.")
198
199
  }).describe("The Redis key whose expiration to retrieve.");
199
- var ttlOutput = external_exports.strictObject({
200
- ttlSeconds: external_exports.int().describe("Remaining expiration in seconds. -2 means the key does not exist; -1 means the key has no expiration.")
200
+ var ttlOutput = z.strictObject({
201
+ ttlSeconds: z.int().describe("Remaining expiration in seconds. -2 means the key does not exist; -1 means the key has no expiration.")
201
202
  }).describe("The result of the Redis TTL command.");
202
- var scanInput = external_exports.strictObject({
203
- cursor: external_exports.string().min(1).describe("The cursor returned by a previous scan. Omit it to start at cursor 0.").optional(),
204
- match: external_exports.string().min(1).describe("Optional Redis glob pattern used to filter keys.").optional(),
205
- count: external_exports.int().min(1).max(1e3).describe("Optional scan work hint from 1 to 1000.").optional()
203
+ var scanInput = z.strictObject({
204
+ cursor: z.string().min(1).describe("The cursor returned by a previous scan. Omit it to start at cursor 0.").optional(),
205
+ match: z.string().min(1).describe("Optional Redis glob pattern used to filter keys.").optional(),
206
+ count: z.int().min(1).max(1e3).describe("Optional scan work hint from 1 to 1000.").optional()
206
207
  }).describe("Cursor pagination and optional filters for Redis SCAN.");
207
- var scanOutput = external_exports.strictObject({
208
- nextCursor: external_exports.string().min(1).describe("Cursor to pass to the next scan request. A value of 0 means scanning is complete."),
209
- keys: external_exports.array(external_exports.string().min(1)).describe("Keys returned in this scan page."),
210
- complete: external_exports.boolean().describe("Whether this scan reached cursor 0.")
208
+ var scanOutput = z.strictObject({
209
+ nextCursor: z.string().min(1).describe("Cursor to pass to the next scan request. A value of 0 means scanning is complete."),
210
+ keys: z.array(z.string().min(1)).describe("Keys returned in this scan page."),
211
+ complete: z.boolean().describe("Whether this scan reached cursor 0.")
211
212
  }).describe("One page returned by Redis SCAN.");
212
213
  var upstashRedisActions = {
213
214
  get: {
214
215
  description: "Get the string value stored for one Redis key.",
215
216
  effect: "write",
216
217
  inputSchema: getInput,
217
- outputSchema: external_exports.toJSONSchema(getOutput, { io: "output", unrepresentable: "any" })
218
+ outputSchema: z.toJSONSchema(getOutput, { io: "output", unrepresentable: "any" })
218
219
  },
219
220
  set: {
220
221
  description: "Store a string value for one Redis key, optionally with an expiration or conditional write.",
221
222
  effect: "write",
222
223
  inputSchema: setInput,
223
- outputSchema: external_exports.toJSONSchema(setOutput, { io: "output", unrepresentable: "any" })
224
+ outputSchema: z.toJSONSchema(setOutput, { io: "output", unrepresentable: "any" })
224
225
  },
225
226
  delete: {
226
227
  description: "Delete one Redis key.",
227
228
  effect: "write",
228
229
  inputSchema: deleteInput,
229
- outputSchema: external_exports.toJSONSchema(deleteOutput, { io: "output", unrepresentable: "any" })
230
+ outputSchema: z.toJSONSchema(deleteOutput, { io: "output", unrepresentable: "any" })
230
231
  },
231
232
  exists: {
232
233
  description: "Check whether one Redis key exists.",
233
234
  effect: "write",
234
235
  inputSchema: existsInput,
235
- outputSchema: external_exports.toJSONSchema(existsOutput, { io: "output", unrepresentable: "any" })
236
+ outputSchema: z.toJSONSchema(existsOutput, { io: "output", unrepresentable: "any" })
236
237
  },
237
238
  expire: {
238
239
  description: "Set or replace the expiration time for one Redis key.",
239
240
  effect: "write",
240
241
  inputSchema: expireInput,
241
- outputSchema: external_exports.toJSONSchema(expireOutput, { io: "output", unrepresentable: "any" })
242
+ outputSchema: z.toJSONSchema(expireOutput, { io: "output", unrepresentable: "any" })
242
243
  },
243
244
  ttl: {
244
245
  description: "Get the remaining expiration time for one Redis key.",
245
246
  effect: "write",
246
247
  inputSchema: ttlInput,
247
- outputSchema: external_exports.toJSONSchema(ttlOutput, { io: "output", unrepresentable: "any" })
248
+ outputSchema: z.toJSONSchema(ttlOutput, { io: "output", unrepresentable: "any" })
248
249
  },
249
250
  scan: {
250
251
  description: "Scan one page of Redis keys without reading the full keyspace.",
251
252
  effect: "write",
252
253
  inputSchema: scanInput,
253
- outputSchema: external_exports.toJSONSchema(scanOutput, { io: "output", unrepresentable: "any" })
254
+ outputSchema: z.toJSONSchema(scanOutput, { io: "output", unrepresentable: "any" })
254
255
  }
255
256
  };
256
257