@tool-bridge/server 0.16.0 → 0.19.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 (115) hide show
  1. package/dist/{airtable-S3T4TAN7.js → airtable-23JBIM6X.js} +106 -114
  2. package/dist/{alt_text_generator_ai-4DIRIDKL.js → alt_text_generator_ai-ADWBTCIH.js} +25 -16
  3. package/dist/{amap-LGVGNPML.js → amap-CYQCYW2Z.js} +114 -123
  4. package/dist/{anthropic-27RFZO35.js → anthropic-5P62HDNR.js} +34 -56
  5. package/dist/{apify-6WLYAIAS.js → apify-54RZUAGW.js} +31 -49
  6. package/dist/{brave_search-K2SVJ66F.js → brave_search-AHJ6FTD5.js} +52 -77
  7. package/dist/{chunk-VK3V2WTY.js → chunk-B4P6YZFS.js} +4 -6
  8. package/dist/{chunk-BB6ZLMTU.js → chunk-CLEZ6YQ6.js} +2600 -481
  9. package/dist/chunk-JXHMDBAY.js +45 -0
  10. package/dist/chunk-LMLX3DJF.js +50 -0
  11. package/dist/{chunk-YB2FLNWI.js → chunk-OKRZPQ3R.js} +2558 -1926
  12. package/dist/chunk-SWBNHIO4.js +977 -0
  13. package/dist/chunk-U67V476Y.js +35 -0
  14. package/dist/chunk-VLOIDU5U.js +283 -0
  15. package/dist/{circleci-WV3ITU7Q.js → circleci-UM3NSQJ3.js} +36 -55
  16. package/dist/{clerk-NFQEFKS4.js → clerk-FE5LQ2CZ.js} +60 -80
  17. package/dist/{cloudflare_dns-2RK5ASBJ.js → cloudflare_dns-KEZABKUT.js} +90 -113
  18. package/dist/{cohere-5KEW7LWT.js → cohere-4IPJADXP.js} +33 -49
  19. package/dist/{confluence-SZE63S46.js → confluence-56QEKNQI.js} +79 -115
  20. package/dist/{convertapi-QPG2JC5K.js → convertapi-3QRM5K5T.js} +13 -16
  21. package/dist/{currencyapi-UO2APQRY.js → currencyapi-L6G4OND5.js} +30 -53
  22. package/dist/{deepseek-LJELIMM3.js → deepseek-LGC6HBFG.js} +30 -38
  23. package/dist/{docker_hub-2MFXSBOF.js → docker_hub-XDMK3BIU.js} +141 -157
  24. package/dist/{dropbox-GQYNTTVA.js → dropbox-4QARMFZU.js} +134 -141
  25. package/dist/{dub-KI2LHXST.js → dub-C6JSJKOT.js} +61 -93
  26. package/dist/{e2b-WO6ISY3C.js → e2b-6A6TVACJ.js} +39 -69
  27. package/dist/{exa-IZ7B3BPT.js → exa-SIWWW6AA.js} +49 -77
  28. package/dist/{fal_ai-LTMF36GJ.js → fal_ai-3IJXOKSP.js} +37 -44
  29. package/dist/{feishu-WM7SLSFD.js → feishu-L4KDA4DC.js} +4 -6
  30. package/dist/{feishu_custom_bot-66W3MXH2.js → feishu_custom_bot-SDM75H4P.js} +4 -5
  31. package/dist/{figma-2Z274VQZ.js → figma-6DD436DN.js} +56 -81
  32. package/dist/{firehydrant-IFI4R65V.js → firehydrant-SYSGYB3R.js} +40 -53
  33. package/dist/{fixer-BCCZEB3D.js → fixer-FZG7ASTF.js} +31 -43
  34. package/dist/{fly-755FXYB5.js → fly-HMRCZBUC.js} +50 -66
  35. package/dist/{front-4FZKKXXK.js → front-FAFSD7I3.js} +43 -66
  36. package/dist/{geocodio-WYKDJ3DP.js → geocodio-4D3TWENM.js} +37 -63
  37. package/dist/{ghost-5BNQTCOH.js → ghost-OSO2FOZS.js} +51 -57
  38. package/dist/{github-ULELF5VX.js → github-OR4I4RHE.js} +48 -41
  39. package/dist/{gmail-G34WT64J.js → gmail-5AOPJ63E.js} +26 -36
  40. package/dist/{googlecalendar-BQU255SC.js → googlecalendar-SOJIJUWH.js} +57 -78
  41. package/dist/{googledocs-HPCNQXYJ.js → googledocs-QSKN5TLN.js} +14 -22
  42. package/dist/{grafana-VOV24FIC.js → grafana-R3AIZM7M.js} +95 -122
  43. package/dist/{graphhopper-D5RXW6AP.js → graphhopper-4CR3QOAX.js} +32 -46
  44. package/dist/index.d.ts +108 -56
  45. package/dist/index.js +4 -3
  46. package/dist/{ip2proxy-DAYO7EKZ.js → ip2proxy-OBCG6X6J.js} +35 -42
  47. package/dist/{ipgeolocation_io-XD4PSLII.js → ipgeolocation_io-NHH3DTQW.js} +40 -60
  48. package/dist/{ipqualityscore-K27QEAWK.js → ipqualityscore-7POMCBEC.js} +30 -42
  49. package/dist/{jina_ai-E6UXFV2P.js → jina_ai-YXVKROV4.js} +32 -58
  50. package/dist/{jira-ZDSXGQ6W.js → jira-LADO3VJU.js} +116 -126
  51. package/dist/{langsmith-TIFJRREW.js → langsmith-XZ6UAQFU.js} +101 -121
  52. package/dist/{lemlist-DASEMJMA.js → lemlist-P74GLNE7.js} +57 -68
  53. package/dist/{linear-KE6UP4SP.js → linear-CXJ7D37A.js} +109 -118
  54. package/dist/{logsnag-IMNDN4R5.js → logsnag-EVVHWFLK.js} +31 -48
  55. package/dist/main.js +103 -102
  56. package/dist/{mattermost-HHHMUXQA.js → mattermost-WG2MRGBD.js} +45 -62
  57. package/dist/{mem0-D2FGGOIY.js → mem0-HQWUKG6U.js} +72 -98
  58. package/dist/{memos-4OVIGFPH.js → memos-SQMJIFOE.js} +68 -122
  59. package/dist/{metabase-33WCX5YD.js → metabase-E27G2DZI.js} +47 -60
  60. package/dist/{mistral_ai-QIMZ2JYL.js → mistral_ai-MIL63NIT.js} +35 -40
  61. package/dist/{mother_duck-M6VWS2VH.js → mother_duck-AIZVCBNR.js} +42 -62
  62. package/dist/{ngrok-Z2PKQBHH.js → ngrok-XS4DVIQS.js} +42 -58
  63. package/dist/{notes-SS4RPC4K.js → notes-JEOUSL2Y.js} +3 -5
  64. package/dist/{notion-FJCNQ6I7.js → notion-U4EZVDW2.js} +83 -97
  65. package/dist/{open_exchange_rates-WU57WTT5.js → open_exchange_rates-AZSQEYEJ.js} +35 -39
  66. package/dist/{openai-JODZ4GKT.js → openai-HW3SYMTQ.js} +51 -55
  67. package/dist/{opengraph_io-SQRAUSV5.js → opengraph_io-QX74MAEL.js} +61 -79
  68. package/dist/{openrouter-Q5XXEJZ7.js → openrouter-OXSKYL6N.js} +41 -55
  69. package/dist/{outline-RT2EHJ2X.js → outline-CCQAPDSW.js} +89 -104
  70. package/dist/{paddle-OF2V7GAC.js → paddle-6KQPSSCK.js} +34 -49
  71. package/dist/{perplexity-LNZEWLHG.js → perplexity-2TXO7IQE.js} +33 -50
  72. package/dist/{pinecone-JSJIXZYN.js → pinecone-YOO7NULI.js} +65 -91
  73. package/dist/{pipedrive-D4CKVUXR.js → pipedrive-Q6RIFIFP.js} +37 -59
  74. package/dist/{polar-M7ZYP6UR.js → polar-KUMGCES3.js} +43 -53
  75. package/dist/{posthog-YV7CZOH4.js → posthog-VXQHBSMB.js} +58 -77
  76. package/dist/{postmark-KYHLECRG.js → postmark-YLIPF52S.js} +52 -71
  77. package/dist/{prerender-HCMHBKV2.js → prerender-CRY7UJN5.js} +32 -50
  78. package/dist/{pubmed-WYVLCCN3.js → pubmed-3Z4T5AM7.js} +28 -60
  79. package/dist/{railway-TWIRD5KR.js → railway-BP37IGFL.js} +32 -39
  80. package/dist/{readwise-UZ467IQ7.js → readwise-HTKICF4K.js} +62 -78
  81. package/dist/{render-MECUC5CC.js → render-WIVTUXJH.js} +48 -64
  82. package/dist/{replicate-A5MEK3SW.js → replicate-JJYPA43D.js} +41 -58
  83. package/dist/{resend-BC6EAWJQ.js → resend-TKHZVG7A.js} +27 -37
  84. package/dist/{rootly-ZM3QDUIS.js → rootly-FRSZLG5U.js} +64 -76
  85. package/dist/{scrapfly-WAML42QJ.js → scrapfly-M5WXGQWE.js} +45 -51
  86. package/dist/{scrapingbee-DG7PET3V.js → scrapingbee-PMXNLLBK.js} +25 -33
  87. package/dist/{screenshot_fyi-HY6WTHIO.js → screenshot_fyi-HFW4TAOH.js} +29 -47
  88. package/dist/{semantic_scholar-C5IZA7IP.js → semantic_scholar-KXVH2VZQ.js} +37 -56
  89. package/dist/{sentry-OKBPSTDM.js → sentry-WWOT2LRX.js} +66 -85
  90. package/dist/{shodan-PPC6DYU4.js → shodan-FY635H35.js} +42 -53
  91. package/dist/{shopify-EWGUHBXO.js → shopify-HQLBVSA5.js} +32 -49
  92. package/dist/{stripe-6RPDPC5W.js → stripe-GJN2GOHB.js} +4 -5
  93. package/dist/{supabase-SK7DQ42N.js → supabase-BBNZGQU6.js} +69 -88
  94. package/dist/{tavily-YCG5VQMH.js → tavily-DPENIBOG.js} +37 -62
  95. package/dist/{telegram-2OES5FYB.js → telegram-L4NONG6H.js} +168 -177
  96. package/dist/{telnyx-POOSBBR4.js → telnyx-H67MAEZS.js} +30 -50
  97. package/dist/{todoist-M7YD6YSS.js → todoist-G2BSP4DX.js} +77 -89
  98. package/dist/{trello-IS6V5W3E.js → trello-7WMVFDG2.js} +108 -122
  99. package/dist/{turso-RCFHUFVH.js → turso-ZUAESFC2.js} +52 -64
  100. package/dist/{twilio-OS2RXFGO.js → twilio-EYFYIX3B.js} +48 -55
  101. package/dist/{umami-PQ2SJ2LN.js → umami-AXAUDUVF.js} +49 -69
  102. package/dist/{unsplash-C6BPZO4E.js → unsplash-UCQAWPLR.js} +35 -52
  103. package/dist/{upstash_redis-WH6UER7H.js → upstash_redis-ZPZ4ASU6.js} +28 -40
  104. package/dist/{uptimerobot-M3YZGS6Z.js → uptimerobot-4QVKKUD5.js} +11 -12
  105. package/dist/{v2ex-R4JWTEHN.js → v2ex-VGEFJTYC.js} +36 -61
  106. package/dist/{vercel-FZVYUOQD.js → vercel-JME4TSCN.js} +124 -150
  107. package/dist/{webapi-VLM4IKVB.js → webapi-GW5QXWXE.js} +1 -1
  108. package/dist/{wolfram_alpha_api-2KOLO5DC.js → wolfram_alpha_api-TRGU2MDG.js} +26 -34
  109. package/dist/{wordpress-XRWGO6LG.js → wordpress-WRUKLCZR.js} +87 -104
  110. package/dist/{workos-WR4NKOYL.js → workos-ZDW4EHS4.js} +37 -56
  111. package/dist/{zhihu-BKZIB3WA.js → zhihu-4VI67CWU.js} +35 -57
  112. package/package.json +3 -3
  113. package/dist/chunk-2O27H4Y2.js +0 -183
  114. package/dist/chunk-GKX72JMJ.js +0 -378
  115. package/dist/chunk-MLKGABMK.js +0 -9
@@ -1,72 +1,55 @@
1
+ import {
2
+ createProviderHttpClient
3
+ } from "./chunk-VLOIDU5U.js";
4
+ import {
5
+ messageFrom
6
+ } from "./chunk-JXHMDBAY.js";
1
7
  import {
2
8
  createProviderPlugin,
3
9
  requireApiKey,
4
10
  upstreamError
5
- } from "./chunk-VK3V2WTY.js";
6
- import {
7
- guardedFetch
8
- } from "./chunk-2O27H4Y2.js";
9
- import "./chunk-GKX72JMJ.js";
11
+ } from "./chunk-B4P6YZFS.js";
12
+ import "./chunk-SWBNHIO4.js";
10
13
  import {
11
14
  external_exports
12
- } from "./chunk-YB2FLNWI.js";
13
- import "./chunk-MLKGABMK.js";
15
+ } from "./chunk-OKRZPQ3R.js";
16
+ import "./chunk-U67V476Y.js";
14
17
 
15
18
  // ../plugins/src/logsnag/api.ts
16
19
  var SERVICE = "logsnag";
17
- var API_BASE = "https://api.logsnag.com/v1";
18
- async function readPayload(response) {
19
- const text2 = await response.text().catch(() => "");
20
- if (text2 === "") return void 0;
21
- if (response.headers.get("content-type")?.includes("json") !== true) return text2;
22
- try {
23
- return JSON.parse(text2);
24
- } catch {
25
- return text2;
26
- }
27
- }
28
- function text(value) {
29
- if (typeof value !== "string") return void 0;
30
- return value.trim() || void 0;
31
- }
32
- function errorMessage(payload, status) {
33
- const direct = text(payload);
34
- if (direct !== void 0) return direct;
35
- if (typeof payload === "object" && payload !== null && !Array.isArray(payload)) {
36
- const record = payload;
37
- for (const key of ["message", "error", "detail"]) {
38
- const value = text(record[key]);
39
- if (value !== void 0) return value;
40
- }
41
- }
42
- return `LogSnag request failed with ${status}`;
43
- }
20
+ var http = createProviderHttpClient({ baseUrl: "https://api.logsnag.com/v1/", service: SERVICE });
44
21
  async function request(path, method, body, ctx) {
45
- const response = await guardedFetch(`${API_BASE}/${path}`, {
22
+ const result = await http.request({
23
+ path,
46
24
  method,
47
25
  headers: {
48
- "accept": "application/json",
49
- "authorization": `Bearer ${requireApiKey(ctx, SERVICE)}`,
50
- "content-type": "application/json"
26
+ accept: "application/json",
27
+ authorization: `Bearer ${requireApiKey(ctx, SERVICE)}`
51
28
  },
52
- body: JSON.stringify(body)
29
+ json: body,
30
+ responseType: "auto",
31
+ invalidJson: "text",
32
+ mapError: ({ data, status }) => upstreamError(
33
+ status,
34
+ messageFrom(data, ["message", "error", "detail"], `LogSnag request failed with ${status}`)
35
+ )
53
36
  });
54
- const payload = await readPayload(response);
55
- if (!response.ok) {
56
- throw upstreamError(response.status, errorMessage(payload, response.status));
57
- }
58
- return { ok: true, status: response.status, ...payload === void 0 ? {} : { payload } };
37
+ return {
38
+ ok: true,
39
+ status: result.status,
40
+ ...result.data === void 0 ? {} : { payload: result.data }
41
+ };
59
42
  }
60
- async function publishEvent(input, ctx) {
43
+ function publishEvent(input, ctx) {
61
44
  return request("log", "POST", input, ctx);
62
45
  }
63
- async function identifyUser(input, ctx) {
46
+ function identifyUser(input, ctx) {
64
47
  return request("identify", "POST", input, ctx);
65
48
  }
66
- async function publishInsight(input, ctx) {
49
+ function publishInsight(input, ctx) {
67
50
  return request("insight", "POST", input, ctx);
68
51
  }
69
- async function mutateInsight(input, ctx) {
52
+ function mutateInsight(input, ctx) {
70
53
  return request("insight", "PATCH", input, ctx);
71
54
  }
72
55
 
package/dist/main.js CHANGED
@@ -2,111 +2,112 @@
2
2
  import {
3
3
  configFromEnv,
4
4
  createTbServer
5
- } from "./chunk-BB6ZLMTU.js";
6
- import "./chunk-YB2FLNWI.js";
7
- import "./chunk-MLKGABMK.js";
5
+ } from "./chunk-CLEZ6YQ6.js";
6
+ import "./chunk-SWBNHIO4.js";
7
+ import "./chunk-OKRZPQ3R.js";
8
+ import "./chunk-U67V476Y.js";
8
9
 
9
10
  // ../plugins/src/registry.generated.ts
10
11
  var BUILTIN_PLUGIN_LOADERS = {
11
- airtable: () => import("./airtable-S3T4TAN7.js"),
12
- alt_text_generator_ai: () => import("./alt_text_generator_ai-4DIRIDKL.js"),
13
- amap: () => import("./amap-LGVGNPML.js"),
14
- anthropic: () => import("./anthropic-27RFZO35.js"),
15
- apify: () => import("./apify-6WLYAIAS.js"),
16
- brave_search: () => import("./brave_search-K2SVJ66F.js"),
17
- circleci: () => import("./circleci-WV3ITU7Q.js"),
18
- clerk: () => import("./clerk-NFQEFKS4.js"),
19
- cloudflare_dns: () => import("./cloudflare_dns-2RK5ASBJ.js"),
20
- cohere: () => import("./cohere-5KEW7LWT.js"),
21
- confluence: () => import("./confluence-SZE63S46.js"),
22
- convertapi: () => import("./convertapi-QPG2JC5K.js"),
23
- currencyapi: () => import("./currencyapi-UO2APQRY.js"),
24
- deepseek: () => import("./deepseek-LJELIMM3.js"),
25
- docker_hub: () => import("./docker_hub-2MFXSBOF.js"),
26
- dropbox: () => import("./dropbox-GQYNTTVA.js"),
27
- dub: () => import("./dub-KI2LHXST.js"),
28
- e2b: () => import("./e2b-WO6ISY3C.js"),
29
- exa: () => import("./exa-IZ7B3BPT.js"),
30
- fal_ai: () => import("./fal_ai-LTMF36GJ.js"),
31
- feishu: () => import("./feishu-WM7SLSFD.js"),
32
- feishu_custom_bot: () => import("./feishu_custom_bot-66W3MXH2.js"),
33
- figma: () => import("./figma-2Z274VQZ.js"),
34
- firehydrant: () => import("./firehydrant-IFI4R65V.js"),
35
- fixer: () => import("./fixer-BCCZEB3D.js"),
36
- fly: () => import("./fly-755FXYB5.js"),
37
- front: () => import("./front-4FZKKXXK.js"),
38
- geocodio: () => import("./geocodio-WYKDJ3DP.js"),
39
- ghost: () => import("./ghost-5BNQTCOH.js"),
40
- github: () => import("./github-ULELF5VX.js"),
41
- gmail: () => import("./gmail-G34WT64J.js"),
42
- googlecalendar: () => import("./googlecalendar-BQU255SC.js"),
43
- googledocs: () => import("./googledocs-HPCNQXYJ.js"),
44
- grafana: () => import("./grafana-VOV24FIC.js"),
45
- graphhopper: () => import("./graphhopper-D5RXW6AP.js"),
46
- ip2proxy: () => import("./ip2proxy-DAYO7EKZ.js"),
47
- ipgeolocation_io: () => import("./ipgeolocation_io-XD4PSLII.js"),
48
- ipqualityscore: () => import("./ipqualityscore-K27QEAWK.js"),
49
- jina_ai: () => import("./jina_ai-E6UXFV2P.js"),
50
- jira: () => import("./jira-ZDSXGQ6W.js"),
51
- langsmith: () => import("./langsmith-TIFJRREW.js"),
52
- lemlist: () => import("./lemlist-DASEMJMA.js"),
53
- linear: () => import("./linear-KE6UP4SP.js"),
54
- logsnag: () => import("./logsnag-IMNDN4R5.js"),
55
- mattermost: () => import("./mattermost-HHHMUXQA.js"),
56
- mem0: () => import("./mem0-D2FGGOIY.js"),
57
- memos: () => import("./memos-4OVIGFPH.js"),
58
- metabase: () => import("./metabase-33WCX5YD.js"),
59
- mistral_ai: () => import("./mistral_ai-QIMZ2JYL.js"),
60
- mother_duck: () => import("./mother_duck-M6VWS2VH.js"),
61
- ngrok: () => import("./ngrok-Z2PKQBHH.js"),
62
- notes: () => import("./notes-SS4RPC4K.js"),
63
- notion: () => import("./notion-FJCNQ6I7.js"),
64
- open_exchange_rates: () => import("./open_exchange_rates-WU57WTT5.js"),
65
- openai: () => import("./openai-JODZ4GKT.js"),
66
- opengraph_io: () => import("./opengraph_io-SQRAUSV5.js"),
67
- openrouter: () => import("./openrouter-Q5XXEJZ7.js"),
68
- outline: () => import("./outline-RT2EHJ2X.js"),
69
- paddle: () => import("./paddle-OF2V7GAC.js"),
70
- perplexity: () => import("./perplexity-LNZEWLHG.js"),
71
- pinecone: () => import("./pinecone-JSJIXZYN.js"),
72
- pipedrive: () => import("./pipedrive-D4CKVUXR.js"),
73
- polar: () => import("./polar-M7ZYP6UR.js"),
74
- posthog: () => import("./posthog-YV7CZOH4.js"),
75
- postmark: () => import("./postmark-KYHLECRG.js"),
76
- prerender: () => import("./prerender-HCMHBKV2.js"),
77
- pubmed: () => import("./pubmed-WYVLCCN3.js"),
78
- railway: () => import("./railway-TWIRD5KR.js"),
79
- readwise: () => import("./readwise-UZ467IQ7.js"),
80
- render: () => import("./render-MECUC5CC.js"),
81
- replicate: () => import("./replicate-A5MEK3SW.js"),
82
- resend: () => import("./resend-BC6EAWJQ.js"),
83
- rootly: () => import("./rootly-ZM3QDUIS.js"),
84
- scrapfly: () => import("./scrapfly-WAML42QJ.js"),
85
- scrapingbee: () => import("./scrapingbee-DG7PET3V.js"),
86
- screenshot_fyi: () => import("./screenshot_fyi-HY6WTHIO.js"),
87
- semantic_scholar: () => import("./semantic_scholar-C5IZA7IP.js"),
88
- sentry: () => import("./sentry-OKBPSTDM.js"),
89
- shodan: () => import("./shodan-PPC6DYU4.js"),
90
- shopify: () => import("./shopify-EWGUHBXO.js"),
91
- stripe: () => import("./stripe-6RPDPC5W.js"),
92
- supabase: () => import("./supabase-SK7DQ42N.js"),
93
- tavily: () => import("./tavily-YCG5VQMH.js"),
94
- telegram: () => import("./telegram-2OES5FYB.js"),
95
- telnyx: () => import("./telnyx-POOSBBR4.js"),
96
- todoist: () => import("./todoist-M7YD6YSS.js"),
97
- trello: () => import("./trello-IS6V5W3E.js"),
98
- turso: () => import("./turso-RCFHUFVH.js"),
99
- twilio: () => import("./twilio-OS2RXFGO.js"),
100
- umami: () => import("./umami-PQ2SJ2LN.js"),
101
- unsplash: () => import("./unsplash-C6BPZO4E.js"),
102
- upstash_redis: () => import("./upstash_redis-WH6UER7H.js"),
103
- uptimerobot: () => import("./uptimerobot-M3YZGS6Z.js"),
104
- v2ex: () => import("./v2ex-R4JWTEHN.js"),
105
- vercel: () => import("./vercel-FZVYUOQD.js"),
106
- wolfram_alpha_api: () => import("./wolfram_alpha_api-2KOLO5DC.js"),
107
- wordpress: () => import("./wordpress-XRWGO6LG.js"),
108
- workos: () => import("./workos-WR4NKOYL.js"),
109
- zhihu: () => import("./zhihu-BKZIB3WA.js")
12
+ airtable: () => import("./airtable-23JBIM6X.js"),
13
+ alt_text_generator_ai: () => import("./alt_text_generator_ai-ADWBTCIH.js"),
14
+ amap: () => import("./amap-CYQCYW2Z.js"),
15
+ anthropic: () => import("./anthropic-5P62HDNR.js"),
16
+ apify: () => import("./apify-54RZUAGW.js"),
17
+ brave_search: () => import("./brave_search-AHJ6FTD5.js"),
18
+ circleci: () => import("./circleci-UM3NSQJ3.js"),
19
+ clerk: () => import("./clerk-FE5LQ2CZ.js"),
20
+ cloudflare_dns: () => import("./cloudflare_dns-KEZABKUT.js"),
21
+ cohere: () => import("./cohere-4IPJADXP.js"),
22
+ confluence: () => import("./confluence-56QEKNQI.js"),
23
+ convertapi: () => import("./convertapi-3QRM5K5T.js"),
24
+ currencyapi: () => import("./currencyapi-L6G4OND5.js"),
25
+ deepseek: () => import("./deepseek-LGC6HBFG.js"),
26
+ docker_hub: () => import("./docker_hub-XDMK3BIU.js"),
27
+ dropbox: () => import("./dropbox-4QARMFZU.js"),
28
+ dub: () => import("./dub-C6JSJKOT.js"),
29
+ e2b: () => import("./e2b-6A6TVACJ.js"),
30
+ exa: () => import("./exa-SIWWW6AA.js"),
31
+ fal_ai: () => import("./fal_ai-3IJXOKSP.js"),
32
+ feishu: () => import("./feishu-L4KDA4DC.js"),
33
+ feishu_custom_bot: () => import("./feishu_custom_bot-SDM75H4P.js"),
34
+ figma: () => import("./figma-6DD436DN.js"),
35
+ firehydrant: () => import("./firehydrant-SYSGYB3R.js"),
36
+ fixer: () => import("./fixer-FZG7ASTF.js"),
37
+ fly: () => import("./fly-HMRCZBUC.js"),
38
+ front: () => import("./front-FAFSD7I3.js"),
39
+ geocodio: () => import("./geocodio-4D3TWENM.js"),
40
+ ghost: () => import("./ghost-OSO2FOZS.js"),
41
+ github: () => import("./github-OR4I4RHE.js"),
42
+ gmail: () => import("./gmail-5AOPJ63E.js"),
43
+ googlecalendar: () => import("./googlecalendar-SOJIJUWH.js"),
44
+ googledocs: () => import("./googledocs-QSKN5TLN.js"),
45
+ grafana: () => import("./grafana-R3AIZM7M.js"),
46
+ graphhopper: () => import("./graphhopper-4CR3QOAX.js"),
47
+ ip2proxy: () => import("./ip2proxy-OBCG6X6J.js"),
48
+ ipgeolocation_io: () => import("./ipgeolocation_io-NHH3DTQW.js"),
49
+ ipqualityscore: () => import("./ipqualityscore-7POMCBEC.js"),
50
+ jina_ai: () => import("./jina_ai-YXVKROV4.js"),
51
+ jira: () => import("./jira-LADO3VJU.js"),
52
+ langsmith: () => import("./langsmith-XZ6UAQFU.js"),
53
+ lemlist: () => import("./lemlist-P74GLNE7.js"),
54
+ linear: () => import("./linear-CXJ7D37A.js"),
55
+ logsnag: () => import("./logsnag-EVVHWFLK.js"),
56
+ mattermost: () => import("./mattermost-WG2MRGBD.js"),
57
+ mem0: () => import("./mem0-HQWUKG6U.js"),
58
+ memos: () => import("./memos-SQMJIFOE.js"),
59
+ metabase: () => import("./metabase-E27G2DZI.js"),
60
+ mistral_ai: () => import("./mistral_ai-MIL63NIT.js"),
61
+ mother_duck: () => import("./mother_duck-AIZVCBNR.js"),
62
+ ngrok: () => import("./ngrok-XS4DVIQS.js"),
63
+ notes: () => import("./notes-JEOUSL2Y.js"),
64
+ notion: () => import("./notion-U4EZVDW2.js"),
65
+ open_exchange_rates: () => import("./open_exchange_rates-AZSQEYEJ.js"),
66
+ openai: () => import("./openai-HW3SYMTQ.js"),
67
+ opengraph_io: () => import("./opengraph_io-QX74MAEL.js"),
68
+ openrouter: () => import("./openrouter-OXSKYL6N.js"),
69
+ outline: () => import("./outline-CCQAPDSW.js"),
70
+ paddle: () => import("./paddle-6KQPSSCK.js"),
71
+ perplexity: () => import("./perplexity-2TXO7IQE.js"),
72
+ pinecone: () => import("./pinecone-YOO7NULI.js"),
73
+ pipedrive: () => import("./pipedrive-Q6RIFIFP.js"),
74
+ polar: () => import("./polar-KUMGCES3.js"),
75
+ posthog: () => import("./posthog-VXQHBSMB.js"),
76
+ postmark: () => import("./postmark-YLIPF52S.js"),
77
+ prerender: () => import("./prerender-CRY7UJN5.js"),
78
+ pubmed: () => import("./pubmed-3Z4T5AM7.js"),
79
+ railway: () => import("./railway-BP37IGFL.js"),
80
+ readwise: () => import("./readwise-HTKICF4K.js"),
81
+ render: () => import("./render-WIVTUXJH.js"),
82
+ replicate: () => import("./replicate-JJYPA43D.js"),
83
+ resend: () => import("./resend-TKHZVG7A.js"),
84
+ rootly: () => import("./rootly-FRSZLG5U.js"),
85
+ scrapfly: () => import("./scrapfly-M5WXGQWE.js"),
86
+ scrapingbee: () => import("./scrapingbee-PMXNLLBK.js"),
87
+ screenshot_fyi: () => import("./screenshot_fyi-HFW4TAOH.js"),
88
+ semantic_scholar: () => import("./semantic_scholar-KXVH2VZQ.js"),
89
+ sentry: () => import("./sentry-WWOT2LRX.js"),
90
+ shodan: () => import("./shodan-FY635H35.js"),
91
+ shopify: () => import("./shopify-HQLBVSA5.js"),
92
+ stripe: () => import("./stripe-GJN2GOHB.js"),
93
+ supabase: () => import("./supabase-BBNZGQU6.js"),
94
+ tavily: () => import("./tavily-DPENIBOG.js"),
95
+ telegram: () => import("./telegram-L4NONG6H.js"),
96
+ telnyx: () => import("./telnyx-H67MAEZS.js"),
97
+ todoist: () => import("./todoist-G2BSP4DX.js"),
98
+ trello: () => import("./trello-7WMVFDG2.js"),
99
+ turso: () => import("./turso-ZUAESFC2.js"),
100
+ twilio: () => import("./twilio-EYFYIX3B.js"),
101
+ umami: () => import("./umami-AXAUDUVF.js"),
102
+ unsplash: () => import("./unsplash-UCQAWPLR.js"),
103
+ upstash_redis: () => import("./upstash_redis-ZPZ4ASU6.js"),
104
+ uptimerobot: () => import("./uptimerobot-4QVKKUD5.js"),
105
+ v2ex: () => import("./v2ex-VGEFJTYC.js"),
106
+ vercel: () => import("./vercel-JME4TSCN.js"),
107
+ wolfram_alpha_api: () => import("./wolfram_alpha_api-TRGU2MDG.js"),
108
+ wordpress: () => import("./wordpress-WRUKLCZR.js"),
109
+ workos: () => import("./workos-ZDW4EHS4.js"),
110
+ zhihu: () => import("./zhihu-4VI67CWU.js")
110
111
  };
111
112
 
112
113
  // ../plugins/src/catalog.generated.ts
@@ -1,37 +1,35 @@
1
+ import {
2
+ createProviderHttpClient
3
+ } from "./chunk-VLOIDU5U.js";
4
+ import {
5
+ asJsonObject,
6
+ trimmedText
7
+ } from "./chunk-JXHMDBAY.js";
1
8
  import {
2
9
  createProviderPlugin,
3
10
  requireCredential,
4
11
  upstreamError
5
- } from "./chunk-VK3V2WTY.js";
12
+ } from "./chunk-B4P6YZFS.js";
6
13
  import {
7
- assertPublicHttpUrl,
8
- guardedFetch
9
- } from "./chunk-2O27H4Y2.js";
10
- import "./chunk-GKX72JMJ.js";
14
+ assertPublicHttpUrl
15
+ } from "./chunk-SWBNHIO4.js";
11
16
  import {
12
17
  TBError,
13
18
  external_exports
14
- } from "./chunk-YB2FLNWI.js";
15
- import "./chunk-MLKGABMK.js";
19
+ } from "./chunk-OKRZPQ3R.js";
20
+ import "./chunk-U67V476Y.js";
16
21
 
17
22
  // ../plugins/src/mattermost/api.ts
18
23
  var SERVICE = "mattermost";
19
24
  var API_PATH_PREFIX = "/api/v4";
20
25
  var REQUEST_TIMEOUT_MS = 3e4;
26
+ var http = createProviderHttpClient({ service: SERVICE });
21
27
  var SINCE_CONFLICTING_FIELDS = ["page", "perPage", "beforePostId", "afterPostId"];
22
- function text(value) {
23
- if (typeof value !== "string") return void 0;
24
- const trimmed = value.trim();
25
- return trimmed === "" ? void 0 : trimmed;
26
- }
27
- function record(value) {
28
- return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
29
- }
30
28
  function invalidResponse(message) {
31
29
  return new TBError("unavailable", message, { retryable: true });
32
30
  }
33
31
  function requireRecord(value, label) {
34
- const result = record(value);
32
+ const result = asJsonObject(value);
35
33
  if (result === void 0) throw invalidResponse(`${label}\u4E0D\u662F\u5BF9\u8C61`);
36
34
  return result;
37
35
  }
@@ -40,7 +38,7 @@ function requireRecordArray(value, label) {
40
38
  return value.map((item, index) => requireRecord(item, `${label} \u7684\u7B2C ${index} \u9879`));
41
39
  }
42
40
  function requireText(value, field) {
43
- const result = text(value);
41
+ const result = trimmedText(value);
44
42
  if (result === void 0) throw new TBError("invalid_argument", `${field} \u662F\u5FC5\u586B\u7684`);
45
43
  return result;
46
44
  }
@@ -66,49 +64,34 @@ function apiBaseUrl(ctx) {
66
64
  url.pathname = path.endsWith(API_PATH_PREFIX) ? path.slice(0, -API_PATH_PREFIX.length) : path;
67
65
  return `${url.toString().replace(/\/$/, "")}${API_PATH_PREFIX}`;
68
66
  }
69
- async function readPayload(response) {
70
- const body = await response.text();
71
- if (body === "") return null;
72
- try {
73
- return JSON.parse(body);
74
- } catch {
75
- if (response.ok) throw invalidResponse("Mattermost \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94");
76
- return { message: body };
77
- }
67
+ function responsePayload(data, bodyKind) {
68
+ if (bodyKind === "empty") return null;
69
+ return bodyKind === "invalid-json" ? { message: data } : data;
78
70
  }
79
71
  function errorMessage(payload, status) {
80
- const body = record(payload);
81
- return text(body?.message) ?? text(body?.error) ?? text(body?.details) ?? text(body?.id) ?? `Mattermost \u8FD4\u56DE HTTP ${status}`;
72
+ const body = asJsonObject(payload);
73
+ return trimmedText(body?.message) ?? trimmedText(body?.error) ?? trimmedText(body?.details) ?? trimmedText(body?.id) ?? `Mattermost \u8FD4\u56DE HTTP ${status}`;
82
74
  }
83
75
  async function request(ctx, input) {
84
- const url = new URL(`${apiBaseUrl(ctx)}${input.path}`);
85
- for (const [key, value] of Object.entries(input.query ?? {})) {
86
- if (value !== void 0) url.searchParams.set(key, String(value));
87
- }
88
- const headers = {
89
- accept: "application/json",
90
- authorization: `Bearer ${requireCredential(ctx, SERVICE, "apiKey")}`
91
- };
92
- if (input.body !== void 0) headers["content-type"] = "application/json";
93
- let response;
94
- try {
95
- response = await guardedFetch(url.toString(), {
96
- method: input.method ?? "GET",
97
- headers,
98
- body: input.body === void 0 ? void 0 : JSON.stringify(input.body),
99
- signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
100
- });
101
- } catch (error) {
102
- if (error instanceof TBError) throw error;
103
- if (error instanceof Error && error.name === "TimeoutError") {
104
- throw upstreamError(504, `Mattermost \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`);
105
- }
106
- const message = error instanceof Error ? error.message : "unknown network error";
107
- throw upstreamError(502, `Mattermost \u8BF7\u6C42\u5931\u8D25:${message}`);
108
- }
109
- const payload = await readPayload(response);
110
- if (!response.ok) throw upstreamError(response.status, errorMessage(payload, response.status));
111
- return payload;
76
+ const result = await http.request({
77
+ baseUrl: `${apiBaseUrl(ctx)}/`,
78
+ path: input.path,
79
+ method: input.method ?? "GET",
80
+ query: Object.entries(input.query ?? {}),
81
+ headers: {
82
+ accept: "application/json",
83
+ authorization: `Bearer ${requireCredential(ctx, SERVICE, "apiKey")}`
84
+ },
85
+ ...input.body === void 0 ? {} : { json: input.body },
86
+ timeoutMs: REQUEST_TIMEOUT_MS,
87
+ invalidJsonMessage: "Mattermost \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94",
88
+ mapError: ({ bodyKind, data, status }) => upstreamError(
89
+ status,
90
+ errorMessage(responsePayload(data, bodyKind), status)
91
+ ),
92
+ mapTransportError: ({ kind, message }) => kind === "timeout" ? upstreamError(504, `Mattermost \u8BF7\u6C42\u8D85\u65F6(${REQUEST_TIMEOUT_MS / 1e3} \u79D2)`) : upstreamError(502, `Mattermost \u8BF7\u6C42\u5931\u8D25:${message ?? "unknown network error"}`)
93
+ });
94
+ return responsePayload(result.data, result.bodyKind);
112
95
  }
113
96
  async function getCurrentUser(_input, ctx) {
114
97
  const payload = await request(ctx, { path: "/users/me" });
@@ -136,8 +119,8 @@ async function getChannel(input, ctx) {
136
119
  function normalizePostList(payload) {
137
120
  const raw = requireRecord(payload, "Mattermost \u5E16\u5B50\u5217\u8868");
138
121
  const order = Array.isArray(raw.order) ? raw.order.filter((item) => typeof item === "string") : [];
139
- const postsById = record(raw.posts);
140
- const posts = postsById !== void 0 && order.length > 0 ? order.map((id) => record(postsById[id]) ?? { id }) : Object.values(postsById ?? {}).map((item) => record(item) ?? { value: item });
122
+ const postsById = asJsonObject(raw.posts);
123
+ const posts = postsById !== void 0 && order.length > 0 ? order.map((id) => asJsonObject(postsById[id]) ?? { id }) : Object.values(postsById ?? {}).map((item) => asJsonObject(item) ?? { value: item });
141
124
  return { posts, order, raw };
142
125
  }
143
126
  async function listChannelPosts(input, ctx) {
@@ -157,15 +140,15 @@ async function listChannelPosts(input, ctx) {
157
140
  page: input.page,
158
141
  per_page: input.perPage,
159
142
  since: input.since,
160
- before: text(input.beforePostId),
161
- after: text(input.afterPostId)
143
+ before: trimmedText(input.beforePostId),
144
+ after: trimmedText(input.afterPostId)
162
145
  }
163
146
  });
164
147
  return normalizePostList(payload);
165
148
  }
166
149
  async function createPost(input, ctx) {
167
- const rootId = text(input.rootId);
168
- const props = record(input.props);
150
+ const rootId = trimmedText(input.rootId);
151
+ const props = asJsonObject(input.props);
169
152
  const payload = await request(ctx, {
170
153
  path: "/posts",
171
154
  method: "POST",