@tool-bridge/server 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/airtable-V6446SVY.js +792 -0
  2. package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
  3. package/dist/amap-TTTVB6WS.js +755 -0
  4. package/dist/anthropic-JH3RA363.js +224 -0
  5. package/dist/apify-ETNN7ITU.js +262 -0
  6. package/dist/brave_search-3DDR2MMB.js +322 -0
  7. package/dist/chunk-CSJEZHQO.js +252 -0
  8. package/dist/chunk-JLTYA2B3.js +20121 -0
  9. package/dist/chunk-K7FVSFUX.js +333 -0
  10. package/dist/{chunk-6SMIQ6QU.js → chunk-KGYJEEBI.js} +2770 -21574
  11. package/dist/circleci-MX3TX3HC.js +409 -0
  12. package/dist/clerk-MRPORVF4.js +1036 -0
  13. package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
  14. package/dist/cohere-GPECP66S.js +197 -0
  15. package/dist/confluence-BN7LZ6BC.js +436 -0
  16. package/dist/convertapi-SBEOFOFQ.js +161 -0
  17. package/dist/currencyapi-P2YY7Y7P.js +306 -0
  18. package/dist/deepseek-MWB3NYIN.js +205 -0
  19. package/dist/docker_hub-3JSCIGQ3.js +946 -0
  20. package/dist/dropbox-RFIBDAXO.js +1308 -0
  21. package/dist/dub-YVP57ELQ.js +706 -0
  22. package/dist/e2b-NFSUHTZR.js +305 -0
  23. package/dist/exa-KTDY6IV3.js +360 -0
  24. package/dist/fal_ai-OCUENLNQ.js +405 -0
  25. package/dist/feishu-5CWBQ7E5.js +225 -0
  26. package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
  27. package/dist/figma-YULGANSA.js +798 -0
  28. package/dist/firehydrant-2V6YSYAP.js +573 -0
  29. package/dist/fixer-LTCDB3CJ.js +171 -0
  30. package/dist/fly-IXPKMAML.js +478 -0
  31. package/dist/front-KRFB4M5X.js +379 -0
  32. package/dist/geocodio-VVURKYHQ.js +236 -0
  33. package/dist/ghost-6J2RIOUB.js +341 -0
  34. package/dist/github-5Z6KQRYH.js +5410 -0
  35. package/dist/gmail-KU4NZ7VA.js +1894 -0
  36. package/dist/googlecalendar-X44DFFXG.js +2539 -0
  37. package/dist/googledocs-WSGLPKSF.js +1322 -0
  38. package/dist/grafana-4PKSSDXY.js +817 -0
  39. package/dist/graphhopper-DF65ZNGK.js +336 -0
  40. package/dist/index.d.ts +181 -2
  41. package/dist/index.js +2 -1
  42. package/dist/ip2proxy-UCAQ5P2J.js +118 -0
  43. package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
  44. package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
  45. package/dist/jina_ai-MRHPCSV5.js +119 -0
  46. package/dist/jira-EG7ZPOIW.js +627 -0
  47. package/dist/langsmith-FNO3RCOZ.js +597 -0
  48. package/dist/lemlist-SN6BJHSG.js +298 -0
  49. package/dist/linear-H3VU4PSD.js +2163 -0
  50. package/dist/logsnag-OY2JJT2H.js +167 -0
  51. package/dist/main.js +246 -2
  52. package/dist/mattermost-C5SQ7PGD.js +320 -0
  53. package/dist/mem0-LMLE5BFC.js +567 -0
  54. package/dist/memos-UWFAMBZC.js +781 -0
  55. package/dist/metabase-SRYDSDJ6.js +365 -0
  56. package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
  57. package/dist/mother_duck-CPGOFEXE.js +322 -0
  58. package/dist/ngrok-CDJFBSOM.js +375 -0
  59. package/dist/notes-DIVFH3P3.js +109 -0
  60. package/dist/notion-HGDKS4HK.js +945 -0
  61. package/dist/open_exchange_rates-COHHYJDD.js +216 -0
  62. package/dist/openai-4TRT66GW.js +795 -0
  63. package/dist/opengraph_io-YKVW4PXI.js +377 -0
  64. package/dist/openrouter-6CV7B7V5.js +444 -0
  65. package/dist/outline-YWDUK5F7.js +604 -0
  66. package/dist/paddle-MEU7HWDZ.js +464 -0
  67. package/dist/perplexity-MRQUDBIC.js +238 -0
  68. package/dist/pinecone-JI7X2TAF.js +599 -0
  69. package/dist/pipedrive-6JQPAW23.js +453 -0
  70. package/dist/polar-7BF56CMC.js +400 -0
  71. package/dist/posthog-YPU5ADEN.js +3462 -0
  72. package/dist/postmark-BEU5OFKU.js +441 -0
  73. package/dist/prerender-UT5GOOZH.js +180 -0
  74. package/dist/pubmed-3SGOE24Q.js +1052 -0
  75. package/dist/railway-CEK4GLRQ.js +452 -0
  76. package/dist/readwise-DXQUQU67.js +482 -0
  77. package/dist/render-7TGAU5AW.js +473 -0
  78. package/dist/replicate-VICFSQ5A.js +347 -0
  79. package/dist/resend-3E76WK3O.js +100 -0
  80. package/dist/rootly-36GY46BY.js +345 -0
  81. package/dist/scrapfly-VDVUYAHX.js +289 -0
  82. package/dist/scrapingbee-3KTPMAVY.js +247 -0
  83. package/dist/screenshot_fyi-LKG62C3J.js +116 -0
  84. package/dist/semantic_scholar-4WREECYO.js +626 -0
  85. package/dist/sentry-HUQTGXOV.js +1139 -0
  86. package/dist/shodan-SGRKU4KS.js +303 -0
  87. package/dist/shopify-YCZ4L5HT.js +620 -0
  88. package/dist/stripe-OEBKMELB.js +583 -0
  89. package/dist/supabase-I3DBY7L4.js +937 -0
  90. package/dist/tavily-B2YHCNRD.js +349 -0
  91. package/dist/telegram-2VYJELZX.js +1773 -0
  92. package/dist/telnyx-HHXD3CXL.js +237 -0
  93. package/dist/todoist-PHFDEEIS.js +672 -0
  94. package/dist/trello-WUSAK6YN.js +1091 -0
  95. package/dist/turso-FW56U2B3.js +432 -0
  96. package/dist/twilio-M5JI7XHA.js +321 -0
  97. package/dist/umami-HAYODRC4.js +411 -0
  98. package/dist/unsplash-EDPTNEHJ.js +364 -0
  99. package/dist/upstash_redis-GC2CLIWD.js +299 -0
  100. package/dist/uptimerobot-XMSNYLIT.js +481 -0
  101. package/dist/v2ex-KU4ECD65.js +672 -0
  102. package/dist/vercel-THPCEFHW.js +1096 -0
  103. package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
  104. package/dist/wordpress-O6TQEQNF.js +822 -0
  105. package/dist/workos-A3VHHWI3.js +681 -0
  106. package/dist/zhihu-BJAI64YJ.js +273 -0
  107. package/package.json +5 -4
@@ -0,0 +1,321 @@
1
+ import {
2
+ createProviderPlugin,
3
+ guardedFetch,
4
+ requireCredential,
5
+ upstreamError
6
+ } from "./chunk-CSJEZHQO.js";
7
+ import "./chunk-K7FVSFUX.js";
8
+ import {
9
+ TBError,
10
+ external_exports
11
+ } from "./chunk-JLTYA2B3.js";
12
+ import "./chunk-MLKGABMK.js";
13
+
14
+ // ../plugins/src/twilio/api.ts
15
+ var SERVICE = "twilio";
16
+ var API_BASE = "https://api.twilio.com/2010-04-01";
17
+ function text(value) {
18
+ if (typeof value !== "string") return void 0;
19
+ const trimmed = value.trim();
20
+ return trimmed === "" ? void 0 : trimmed;
21
+ }
22
+ function record(value) {
23
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
24
+ }
25
+ function integer(value) {
26
+ return typeof value === "number" && Number.isInteger(value) ? value : void 0;
27
+ }
28
+ function requireText(value, field) {
29
+ const result = text(value);
30
+ if (result === void 0) throw new TBError("invalid_argument", `${field} is required.`);
31
+ return result;
32
+ }
33
+ function basicAuthHeader(ctx) {
34
+ const accountSid = requireCredential(ctx, SERVICE, "accountSid");
35
+ const authToken = requireCredential(ctx, SERVICE, "authToken");
36
+ const bytes = new TextEncoder().encode(`${accountSid}:${authToken}`);
37
+ let binary = "";
38
+ for (const byte of bytes) binary += String.fromCharCode(byte);
39
+ return `Basic ${btoa(binary)}`;
40
+ }
41
+ function errorMessage(payload, raw, status) {
42
+ const body = record(payload);
43
+ if (body === void 0) {
44
+ const trimmed = raw.trim();
45
+ return trimmed === "" ? `Twilio request failed with ${status}` : trimmed;
46
+ }
47
+ const message = text(body.message) ?? text(body.detail) ?? `Twilio request failed with ${status}`;
48
+ const code = text(body.code) ?? integer(body.code)?.toString();
49
+ return code === void 0 ? message : `${message} (${code})`;
50
+ }
51
+ async function request(ctx, options) {
52
+ const url = new URL(`${API_BASE}${options.path}`);
53
+ for (const [key, value] of Object.entries(options.query ?? {})) {
54
+ if (value !== void 0) url.searchParams.set(key, String(value));
55
+ }
56
+ const headers = {
57
+ accept: "application/json",
58
+ authorization: basicAuthHeader(ctx)
59
+ };
60
+ if (options.form !== void 0) headers["content-type"] = "application/x-www-form-urlencoded";
61
+ let response;
62
+ try {
63
+ response = await guardedFetch(url.toString(), {
64
+ method: options.form === void 0 ? "GET" : "POST",
65
+ headers,
66
+ ...options.form === void 0 ? {} : { body: options.form.toString() }
67
+ });
68
+ } catch (error) {
69
+ if (error instanceof TBError) throw error;
70
+ throw upstreamError(
71
+ 502,
72
+ error instanceof Error ? `Twilio request failed: ${error.message}` : "Twilio request failed"
73
+ );
74
+ }
75
+ const raw = await response.text().catch(() => "");
76
+ let payload = null;
77
+ if (raw.trim() !== "") {
78
+ try {
79
+ payload = JSON.parse(raw);
80
+ } catch {
81
+ if (response.ok) throw new TBError("unavailable", "Twilio \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
82
+ }
83
+ }
84
+ if (!response.ok) throw upstreamError(response.status, errorMessage(payload, raw, response.status));
85
+ return payload;
86
+ }
87
+ function accountPath(ctx, suffix) {
88
+ const accountSid = requireCredential(ctx, SERVICE, "accountSid");
89
+ return `/Accounts/${encodeURIComponent(accountSid)}${suffix}`;
90
+ }
91
+ function normalizeAccount(payload) {
92
+ const account = record(payload) ?? {};
93
+ return {
94
+ accountSid: text(account.sid) ?? "",
95
+ friendlyName: text(account.friendly_name) ?? null,
96
+ status: text(account.status) ?? null,
97
+ type: text(account.type) ?? null
98
+ };
99
+ }
100
+ function normalizeUsageRecord(value) {
101
+ const usage = record(value) ?? {};
102
+ return {
103
+ accountSid: text(usage.account_sid) ?? null,
104
+ category: text(usage.category) ?? null,
105
+ count: text(usage.count) ?? null,
106
+ countUnit: text(usage.count_unit) ?? null,
107
+ usage: text(usage.usage) ?? null,
108
+ usageUnit: text(usage.usage_unit) ?? null,
109
+ price: text(usage.price) ?? null,
110
+ priceUnit: text(usage.price_unit) ?? null,
111
+ startDate: text(usage.start_date) ?? null,
112
+ endDate: text(usage.end_date) ?? null
113
+ };
114
+ }
115
+ function normalizeMessage(payload) {
116
+ const message = record(payload) ?? {};
117
+ return {
118
+ messageSid: text(message.sid) ?? "",
119
+ accountSid: text(message.account_sid) ?? null,
120
+ status: text(message.status) ?? null,
121
+ to: text(message.to) ?? null,
122
+ from: text(message.from) ?? null,
123
+ body: text(message.body) ?? null
124
+ };
125
+ }
126
+ function list(value) {
127
+ return Array.isArray(value) ? value : [];
128
+ }
129
+ async function getAccount(_input, ctx) {
130
+ return normalizeAccount(await request(ctx, { path: accountPath(ctx, ".json") }));
131
+ }
132
+ async function listUsageRecords(input, ctx) {
133
+ const payload = record(await request(ctx, {
134
+ path: accountPath(ctx, "/Usage/Records.json"),
135
+ query: {
136
+ Category: text(input.category),
137
+ StartDate: text(input.startDate),
138
+ EndDate: text(input.endDate),
139
+ PageSize: input.pageSize
140
+ }
141
+ })) ?? {};
142
+ return {
143
+ usageRecords: list(payload.usage_records).map((item) => normalizeUsageRecord(item)),
144
+ page: integer(payload.page) ?? null,
145
+ pageSize: integer(payload.page_size) ?? null,
146
+ nextPageUri: text(payload.next_page_uri) ?? null
147
+ };
148
+ }
149
+ async function listMessages(input, ctx) {
150
+ const payload = record(await request(ctx, {
151
+ path: accountPath(ctx, "/Messages.json"),
152
+ query: {
153
+ To: text(input.to),
154
+ From: text(input.from),
155
+ PageSize: input.pageSize,
156
+ PageToken: text(input.pageToken)
157
+ }
158
+ })) ?? {};
159
+ return {
160
+ messages: list(payload.messages).map((item) => normalizeMessage(item)),
161
+ nextPageUri: text(payload.next_page_uri) ?? null
162
+ };
163
+ }
164
+ async function getMessage(input, ctx) {
165
+ const messageSid = requireText(input.messageSid, "messageSid");
166
+ return normalizeMessage(await request(ctx, {
167
+ path: accountPath(ctx, `/Messages/${encodeURIComponent(messageSid)}.json`)
168
+ }));
169
+ }
170
+ async function sendMessage(input, ctx) {
171
+ const form = new URLSearchParams();
172
+ form.append("To", requireText(input.to, "to"));
173
+ form.append("From", requireText(input.from, "from"));
174
+ form.append("Body", requireText(input.body, "body"));
175
+ return normalizeMessage(await request(ctx, {
176
+ path: accountPath(ctx, "/Messages.json"),
177
+ form
178
+ }));
179
+ }
180
+
181
+ // ../plugins/src/twilio/schema.ts
182
+ var getAccountInput = external_exports.strictObject({}).describe("No input is required for this action.");
183
+ var getAccountOutput = external_exports.strictObject({
184
+ accountSid: external_exports.string().describe("The Twilio account SID."),
185
+ friendlyName: external_exports.string().describe("The friendly name of the Twilio account.").nullable(),
186
+ status: external_exports.string().describe("The current status of the Twilio account.").nullable(),
187
+ type: external_exports.string().describe("The Twilio account type.").nullable()
188
+ }).describe("The normalized Twilio account payload.");
189
+ var listUsageRecordsInput = external_exports.strictObject({
190
+ category: external_exports.string().describe("The Twilio usage category to filter by.").optional(),
191
+ startDate: external_exports.iso.date().describe("The inclusive start date in YYYY-MM-DD format.").optional(),
192
+ endDate: external_exports.iso.date().describe("The inclusive end date in YYYY-MM-DD format.").optional(),
193
+ pageSize: external_exports.int().min(1).describe("The maximum number of records to return in one page.").optional()
194
+ }).describe("The input payload for listing Twilio usage records.");
195
+ var listUsageRecordsOutput = external_exports.strictObject({
196
+ usageRecords: external_exports.array(external_exports.strictObject({
197
+ accountSid: external_exports.string().describe("The Twilio account SID that owns the usage.").nullable().optional(),
198
+ category: external_exports.string().describe("The Twilio usage category.").nullable().optional(),
199
+ count: external_exports.string().describe("The number of units consumed in the record.").nullable().optional(),
200
+ countUnit: external_exports.string().describe("The unit for the usage count.").nullable().optional(),
201
+ usage: external_exports.string().describe("The aggregated usage amount.").nullable().optional(),
202
+ usageUnit: external_exports.string().describe("The unit for the aggregated usage amount.").nullable().optional(),
203
+ price: external_exports.string().describe("The billed price for the usage record.").nullable().optional(),
204
+ priceUnit: external_exports.string().describe("The currency unit for the billed price.").nullable().optional(),
205
+ startDate: external_exports.string().describe("The inclusive start date of the usage record.").nullable().optional(),
206
+ endDate: external_exports.string().describe("The inclusive end date of the usage record.").nullable().optional()
207
+ }).describe("One normalized Twilio usage record.")).describe("The normalized usage records returned by Twilio."),
208
+ page: external_exports.int().describe("The current Twilio result page.").nullable(),
209
+ pageSize: external_exports.int().describe("The Twilio page size for this result.").nullable(),
210
+ nextPageUri: external_exports.string().describe("The next page URI returned by Twilio, if any.").nullable()
211
+ }).describe("The output payload for listing Twilio usage records.");
212
+ var listMessagesInput = external_exports.strictObject({
213
+ to: external_exports.string().describe("Only include messages sent to this phone number.").optional(),
214
+ from: external_exports.string().describe("Only include messages sent from this phone number.").optional(),
215
+ pageSize: external_exports.int().min(1).describe("The maximum number of records to return in one page.").optional(),
216
+ pageToken: external_exports.string().describe("The Twilio page token used to continue a previous listing.").optional()
217
+ }).describe("The input payload for listing Twilio messages.");
218
+ var listMessagesOutput = external_exports.strictObject({
219
+ messages: external_exports.array(external_exports.strictObject({
220
+ messageSid: external_exports.string().describe("The Twilio message SID.").optional(),
221
+ accountSid: external_exports.string().describe("The Twilio account SID that owns the message.").nullable().optional(),
222
+ status: external_exports.string().describe("The delivery status of the message.").nullable().optional(),
223
+ to: external_exports.string().describe("The destination phone number.").nullable().optional(),
224
+ from: external_exports.string().describe("The sender phone number.").nullable().optional(),
225
+ body: external_exports.string().describe("The text body of the message.").nullable().optional()
226
+ }).describe("The normalized Twilio message payload.")).describe("The normalized Twilio messages."),
227
+ nextPageUri: external_exports.string().describe("The next page URI returned by Twilio, if any.").nullable()
228
+ }).describe("The output payload for listing Twilio messages.");
229
+ var getMessageInput = external_exports.strictObject({
230
+ messageSid: external_exports.string().min(1).describe("The Twilio message SID to fetch.")
231
+ }).describe("The input payload for fetching one Twilio message.");
232
+ var getMessageOutput = external_exports.strictObject({
233
+ messageSid: external_exports.string().describe("The Twilio message SID.").optional(),
234
+ accountSid: external_exports.string().describe("The Twilio account SID that owns the message.").nullable().optional(),
235
+ status: external_exports.string().describe("The delivery status of the message.").nullable().optional(),
236
+ to: external_exports.string().describe("The destination phone number.").nullable().optional(),
237
+ from: external_exports.string().describe("The sender phone number.").nullable().optional(),
238
+ body: external_exports.string().describe("The text body of the message.").nullable().optional()
239
+ }).describe("The normalized Twilio message payload.");
240
+ var sendMessageInput = external_exports.strictObject({
241
+ to: external_exports.string().min(1).describe("The destination phone number in E.164 format."),
242
+ from: external_exports.string().min(1).describe("The Twilio phone number sending the message."),
243
+ body: external_exports.string().min(1).describe("The text body of the outbound message.")
244
+ }).describe("The input payload for sending a Twilio message.");
245
+ var sendMessageOutput = external_exports.strictObject({
246
+ messageSid: external_exports.string().describe("The Twilio message SID.").optional(),
247
+ accountSid: external_exports.string().describe("The Twilio account SID that owns the message.").nullable().optional(),
248
+ status: external_exports.string().describe("The delivery status of the message.").nullable().optional(),
249
+ to: external_exports.string().describe("The destination phone number.").nullable().optional(),
250
+ from: external_exports.string().describe("The sender phone number.").nullable().optional(),
251
+ body: external_exports.string().describe("The text body of the message.").nullable().optional()
252
+ }).describe("The normalized Twilio message payload.");
253
+ var twilioActions = {
254
+ get_account: {
255
+ description: "Fetch the current Twilio account profile for the connected credential.",
256
+ effect: "read",
257
+ inputSchema: getAccountInput,
258
+ outputSchema: external_exports.toJSONSchema(getAccountOutput, { io: "output", unrepresentable: "any" })
259
+ },
260
+ list_usage_records: {
261
+ description: "List Twilio usage records for the connected account.",
262
+ effect: "read",
263
+ inputSchema: listUsageRecordsInput,
264
+ outputSchema: external_exports.toJSONSchema(listUsageRecordsOutput, { io: "output", unrepresentable: "any" })
265
+ },
266
+ list_messages: {
267
+ description: "List SMS or MMS messages for the connected Twilio account.",
268
+ effect: "read",
269
+ inputSchema: listMessagesInput,
270
+ outputSchema: external_exports.toJSONSchema(listMessagesOutput, { io: "output", unrepresentable: "any" })
271
+ },
272
+ get_message: {
273
+ description: "Fetch one Twilio message by message SID.",
274
+ effect: "read",
275
+ inputSchema: getMessageInput,
276
+ outputSchema: external_exports.toJSONSchema(getMessageOutput, { io: "output", unrepresentable: "any" })
277
+ },
278
+ send_message: {
279
+ description: "Send an outbound SMS or MMS message with Twilio.",
280
+ effect: "write",
281
+ inputSchema: sendMessageInput,
282
+ outputSchema: external_exports.toJSONSchema(sendMessageOutput, { io: "output", unrepresentable: "any" })
283
+ }
284
+ };
285
+
286
+ // ../plugins/src/twilio/index.ts
287
+ function createTwilioPlugin() {
288
+ return createProviderPlugin({
289
+ description: "Twilio",
290
+ credentialFields: [
291
+ {
292
+ key: "accountSid",
293
+ label: "Account SID",
294
+ required: true,
295
+ secret: false,
296
+ description: "Twilio Account SID(AC \u5F00\u5934),\u4F5C\u4E3A\u8D26\u6237\u6807\u8BC6\u62FC\u8FDB API \u8DEF\u5F84;\u89C1 https://www.twilio.com/console \u7684 Account Info"
297
+ },
298
+ {
299
+ key: "authToken",
300
+ label: "Auth Token",
301
+ required: true,
302
+ secret: true,
303
+ description: "Twilio Auth Token,\u4E0E accountSid \u4E00\u8D77\u4EE5 HTTP Basic \u53D1\u9001(\u4E0D\u662F Bearer);\u53EF\u5728 https://www.twilio.com/console \u67E5\u770B\u6216\u8F6E\u6362"
304
+ }
305
+ ],
306
+ credentialProbe: "get_account",
307
+ actions: twilioActions,
308
+ handlers: {
309
+ get_account: getAccount,
310
+ list_usage_records: listUsageRecords,
311
+ list_messages: listMessages,
312
+ get_message: getMessage,
313
+ send_message: sendMessage
314
+ }
315
+ });
316
+ }
317
+ var twilio_default = createTwilioPlugin();
318
+ export {
319
+ createTwilioPlugin,
320
+ twilio_default as default
321
+ };