@composio/core 0.5.4 → 0.6.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 (384) hide show
  1. package/dist/BaseProvider-2__95v5V.d.cts +26875 -0
  2. package/dist/BaseProvider-D1UCDu8V.d.mts +26875 -0
  3. package/dist/FileToolModifier.utils.neutral-BN_L8usp.mjs +78 -0
  4. package/dist/FileToolModifier.utils.neutral-Bcl7LVf4.cjs +102 -0
  5. package/dist/Telemetry-Bn5VseVi.mjs +331 -0
  6. package/dist/Telemetry-DErMJqj0.cjs +337 -0
  7. package/dist/buffer-BFpVRahf.mjs +382 -0
  8. package/dist/buffer-CYf1Z6Sd.cjs +478 -0
  9. package/dist/composio-CFe2Q5BN.d.cts +6313 -0
  10. package/dist/composio-DtAsGWh4.d.mts +6313 -0
  11. package/dist/fileUtils.node-BJQeDcfa.cjs +233 -0
  12. package/dist/fileUtils.node-C6fQOgF0.mjs +220 -0
  13. package/dist/index.cjs +176 -399
  14. package/dist/index.d.cts +6 -33098
  15. package/dist/index.d.mts +6 -33098
  16. package/dist/index.mjs +85 -308
  17. package/dist/models/Files.node.cjs +6 -4
  18. package/dist/models/Files.node.d.cts +1 -1
  19. package/dist/models/Files.node.d.mts +1 -1
  20. package/dist/models/Files.node.mjs +4 -2
  21. package/dist/models/Files.workerd.cjs +1 -1
  22. package/dist/models/Files.workerd.mjs +1 -1
  23. package/dist/platform/node.cjs +6 -3
  24. package/dist/platform/node.d.cts +1 -1
  25. package/dist/platform/node.d.mts +1 -1
  26. package/dist/platform/node.mjs +6 -3
  27. package/dist/platform/workerd.d.cts +1 -1
  28. package/dist/platform/workerd.d.mts +1 -1
  29. package/dist/{types-BaUqjuX3.d.mts → types-BF2OQZRP.d.cts} +8 -5
  30. package/dist/{types-BrsW5suw.d.cts → types-Cvt_yFsu.d.mts} +8 -5
  31. package/dist/types-Do-rlwX8.d.mts +13 -0
  32. package/dist/types-Ohe4pd-1.d.cts +13 -0
  33. package/dist/utils/config-defaults/ConfigDefaults.node.cjs +10 -0
  34. package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +7 -0
  35. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +8 -0
  36. package/dist/utils/config-defaults/ConfigDefaults.node.mjs +9 -0
  37. package/dist/utils/config-defaults/ConfigDefaults.workerd.cjs +10 -0
  38. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +7 -0
  39. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +8 -0
  40. package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +9 -0
  41. package/dist/utils/modifiers/FileToolModifier.node.cjs +172 -0
  42. package/dist/utils/modifiers/FileToolModifier.node.d.cts +21 -0
  43. package/dist/utils/modifiers/FileToolModifier.node.d.mts +21 -0
  44. package/dist/utils/modifiers/FileToolModifier.node.mjs +173 -0
  45. package/dist/utils/modifiers/FileToolModifier.workerd.cjs +27 -0
  46. package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +20 -0
  47. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +20 -0
  48. package/dist/utils/modifiers/FileToolModifier.workerd.mjs +27 -0
  49. package/generated/ably.ts +20 -0
  50. package/generated/accelo.ts +8 -0
  51. package/generated/acculynx.ts +17 -0
  52. package/generated/active_campaign.ts +30 -0
  53. package/generated/adobe.ts +8 -0
  54. package/generated/adyntel.ts +12 -0
  55. package/generated/aero_workflow.ts +8 -0
  56. package/generated/affinity.ts +29 -0
  57. package/generated/agencyzoom.ts +108 -0
  58. package/generated/ahrefs.ts +49 -0
  59. package/generated/airtable.ts +26 -0
  60. package/generated/alchemy.ts +16 -0
  61. package/generated/algolia.ts +39 -0
  62. package/generated/altoviz.ts +18 -0
  63. package/generated/amazon.ts +8 -0
  64. package/generated/amcards.ts +11 -0
  65. package/generated/amplitude.ts +25 -0
  66. package/generated/anthropic_administrator.ts +13 -0
  67. package/generated/apaleo.ts +38 -0
  68. package/generated/apollo.ts +40 -0
  69. package/generated/appdrag.ts +8 -0
  70. package/generated/appsflyer.ts +8 -0
  71. package/generated/asana.ts +95 -0
  72. package/generated/ashby.ts +8 -0
  73. package/generated/atlassian.ts +8 -0
  74. package/generated/attio.ts +20 -0
  75. package/generated/auth0.ts +8 -0
  76. package/generated/axonaut.ts +8 -0
  77. package/generated/bamboohr.ts +168 -0
  78. package/generated/bannerbear.ts +17 -0
  79. package/generated/baserow.ts +11 -0
  80. package/generated/battlenet.ts +8 -0
  81. package/generated/beeminder.ts +14 -0
  82. package/generated/bigmailer.ts +12 -0
  83. package/generated/bigml.ts +15 -0
  84. package/generated/bill.ts +218 -0
  85. package/generated/bitbucket.ts +25 -0
  86. package/generated/bitwarden.ts +8 -0
  87. package/generated/blackbaud.ts +8 -0
  88. package/generated/blackboard.ts +323 -0
  89. package/generated/boldsign.ts +8 -0
  90. package/generated/bolna.ts +24 -0
  91. package/generated/borneo.ts +162 -0
  92. package/generated/botbaba.ts +8 -0
  93. package/generated/box.ts +282 -0
  94. package/generated/braintree.ts +8 -0
  95. package/generated/brandfetch.ts +15 -0
  96. package/generated/breezy_hr.ts +8 -0
  97. package/generated/brevo.ts +28 -0
  98. package/generated/brex.ts +8 -0
  99. package/generated/brex_staging.ts +8 -0
  100. package/generated/brightpearl.ts +8 -0
  101. package/generated/brilliant_directories.ts +15 -0
  102. package/generated/browseai.ts +18 -0
  103. package/generated/browserbase_tool.ts +10 -0
  104. package/generated/browserhub.ts +8 -0
  105. package/generated/browserless.ts +16 -0
  106. package/generated/bubble.ts +8 -0
  107. package/generated/bugbug.ts +13 -0
  108. package/generated/builtwith.ts +21 -0
  109. package/generated/cal.ts +150 -0
  110. package/generated/calendly.ts +51 -0
  111. package/generated/canva.ts +41 -0
  112. package/generated/canvas.ts +100 -0
  113. package/generated/chatwork.ts +17 -0
  114. package/generated/chmeetings.ts +8 -0
  115. package/generated/clickup.ts +153 -0
  116. package/generated/clockify.ts +23 -0
  117. package/generated/close.ts +15 -0
  118. package/generated/cloudflare.ts +10 -0
  119. package/generated/coda.ts +115 -0
  120. package/generated/codeinterpreter.ts +14 -0
  121. package/generated/coinbase.ts +15 -0
  122. package/generated/coinmarketcal.ts +8 -0
  123. package/generated/composio.ts +34 -0
  124. package/generated/composio_search.ts +22 -0
  125. package/generated/confluence.ts +199 -0
  126. package/generated/contentful.ts +12 -0
  127. package/generated/crustdata.ts +23 -0
  128. package/generated/customer_io.ts +8 -0
  129. package/generated/cutt_ly.ts +10 -0
  130. package/generated/d2lbrightspace.ts +54 -0
  131. package/generated/dailybot.ts +15 -0
  132. package/generated/datadog.ts +47 -0
  133. package/generated/datagma.ts +8 -0
  134. package/generated/datarobot.ts +8 -0
  135. package/generated/deel.ts +8 -0
  136. package/generated/demio.ts +8 -0
  137. package/generated/dialpad.ts +201 -0
  138. package/generated/digicert.ts +15 -0
  139. package/generated/discord.ts +17 -0
  140. package/generated/discordbot.ts +173 -0
  141. package/generated/docmosis.ts +8 -0
  142. package/generated/docusign.ts +351 -0
  143. package/generated/dropbox.ts +20 -0
  144. package/generated/dropbox_sign.ts +8 -0
  145. package/generated/dynamics365.ts +25 -0
  146. package/generated/echtpost.ts +10 -0
  147. package/generated/elevenlabs.ts +70 -0
  148. package/generated/emailoctopus.ts +16 -0
  149. package/generated/enigma.ts +11 -0
  150. package/generated/entelligence.ts +11 -0
  151. package/generated/epic_games.ts +8 -0
  152. package/generated/eventbrite.ts +12 -0
  153. package/generated/exa.ts +13 -0
  154. package/generated/excel.ts +34 -0
  155. package/generated/exist.ts +8 -0
  156. package/generated/facebook.ts +8 -0
  157. package/generated/factorial.ts +8 -0
  158. package/generated/figma.ts +59 -0
  159. package/generated/finage.ts +19 -0
  160. package/generated/firecrawl.ts +16 -0
  161. package/generated/fireflies.ts +21 -0
  162. package/generated/fitbit.ts +8 -0
  163. package/generated/flutterwave.ts +33 -0
  164. package/generated/fomo.ts +10 -0
  165. package/generated/formcarry.ts +10 -0
  166. package/generated/formsite.ts +14 -0
  167. package/generated/foursquare.ts +14 -0
  168. package/generated/freshbooks.ts +11 -0
  169. package/generated/freshdesk.ts +16 -0
  170. package/generated/front.ts +8 -0
  171. package/generated/github.ts +967 -0
  172. package/generated/gitlab.ts +82 -0
  173. package/generated/gmail.d.ts +86 -0
  174. package/generated/gmail.js +13 -0
  175. package/generated/gmail.ts +95 -0
  176. package/generated/go_to_webinar.ts +8 -0
  177. package/generated/gong.ts +63 -0
  178. package/generated/google_analytics.ts +13 -0
  179. package/generated/google_maps.ts +16 -0
  180. package/generated/googleads.ts +14 -0
  181. package/generated/googlebigquery.ts +10 -0
  182. package/generated/googlecalendar.ts +39 -0
  183. package/generated/googledocs.ts +41 -0
  184. package/generated/googledrive.ts +62 -0
  185. package/generated/googlemeet.ts +18 -0
  186. package/generated/googlephotos.ts +22 -0
  187. package/generated/googlesheets.ts +40 -0
  188. package/generated/googleslides.ts +8 -0
  189. package/generated/googlesuper.ts +230 -0
  190. package/generated/googletasks.ts +23 -0
  191. package/generated/gorgias.ts +41 -0
  192. package/generated/gumroad.ts +14 -0
  193. package/generated/guru.ts +8 -0
  194. package/generated/hackernews.ts +15 -0
  195. package/generated/hackerrank_work.ts +8 -0
  196. package/generated/harvest.ts +56 -0
  197. package/generated/helcim.ts +8 -0
  198. package/generated/heygen.ts +44 -0
  199. package/generated/highlevel.ts +8 -0
  200. package/generated/hubspot.ts +252 -0
  201. package/generated/humanloop.ts +13 -0
  202. package/generated/icims_talent_cloud.ts +8 -0
  203. package/generated/idea_scale.ts +8 -0
  204. package/generated/index.ts +151 -0
  205. package/generated/insighto_ai.ts +19 -0
  206. package/generated/intercom.ts +52 -0
  207. package/generated/interzoid.ts +8 -0
  208. package/generated/jira.ts +59 -0
  209. package/generated/jotform.ts +15 -0
  210. package/generated/junglescout.ts +15 -0
  211. package/generated/keap.ts +8 -0
  212. package/generated/kibana.ts +58 -0
  213. package/generated/kit.ts +38 -0
  214. package/generated/klaviyo.ts +240 -0
  215. package/generated/klipfolio.ts +20 -0
  216. package/generated/kommo.ts +24 -0
  217. package/generated/lastpass.ts +8 -0
  218. package/generated/launch_darkly.ts +16 -0
  219. package/generated/leadfeeder.ts +13 -0
  220. package/generated/leadoku.ts +10 -0
  221. package/generated/lever.ts +8 -0
  222. package/generated/lever_sandbox.ts +8 -0
  223. package/generated/lexoffice.ts +8 -0
  224. package/generated/linear.ts +31 -0
  225. package/generated/linkedin.ts +13 -0
  226. package/generated/linkhut.ts +14 -0
  227. package/generated/linkup.ts +11 -0
  228. package/generated/listennotes.ts +35 -0
  229. package/generated/lmnt.ts +16 -0
  230. package/generated/lodgify.ts +10 -0
  231. package/generated/mailchimp.ts +285 -0
  232. package/generated/mailerlite.ts +8 -0
  233. package/generated/maintainx.ts +20 -0
  234. package/generated/make.ts +12 -0
  235. package/generated/mboum.ts +8 -0
  236. package/generated/mem0.ts +52 -0
  237. package/generated/metaads.ts +25 -0
  238. package/generated/metatextai.ts +8 -0
  239. package/generated/microsoft_clarity.ts +10 -0
  240. package/generated/microsoft_teams.ts +22 -0
  241. package/generated/microsoft_tenant.ts +8 -0
  242. package/generated/miro.ts +23 -0
  243. package/generated/mixpanel.ts +30 -0
  244. package/generated/mocean.ts +8 -0
  245. package/generated/monday.ts +30 -0
  246. package/generated/mopinion.ts +8 -0
  247. package/generated/more_trees.ts +10 -0
  248. package/generated/moxie.ts +8 -0
  249. package/generated/moz.ts +8 -0
  250. package/generated/mural.ts +14 -0
  251. package/generated/nasdaq.ts +15 -0
  252. package/generated/ncscale.ts +8 -0
  253. package/generated/neon.ts +78 -0
  254. package/generated/netsuite.ts +8 -0
  255. package/generated/nextdns.ts +11 -0
  256. package/generated/ngrok.ts +18 -0
  257. package/generated/notion.ts +40 -0
  258. package/generated/oncehub.ts +8 -0
  259. package/generated/one_drive.ts +49 -0
  260. package/generated/onepage.ts +11 -0
  261. package/generated/open_sea.ts +33 -0
  262. package/generated/outlook.ts +37 -0
  263. package/generated/pagerduty.ts +362 -0
  264. package/generated/pandadoc.ts +23 -0
  265. package/generated/peopledatalabs.ts +24 -0
  266. package/generated/perplexityai.ts +10 -0
  267. package/generated/piggy.ts +8 -0
  268. package/generated/pipedrive.ts +288 -0
  269. package/generated/placekey.ts +12 -0
  270. package/generated/posthog.ts +367 -0
  271. package/generated/precoro.ts +8 -0
  272. package/generated/printnode.ts +8 -0
  273. package/generated/process_street.ts +14 -0
  274. package/generated/productboard.ts +8 -0
  275. package/generated/qualaroo.ts +8 -0
  276. package/generated/quickbooks.ts +22 -0
  277. package/generated/rafflys.ts +8 -0
  278. package/generated/ragic.ts +10 -0
  279. package/generated/ramp.ts +17 -0
  280. package/generated/ravenseotools.ts +8 -0
  281. package/generated/recallai.ts +17 -0
  282. package/generated/reddit.ts +19 -0
  283. package/generated/resend.ts +27 -0
  284. package/generated/retellai.ts +19 -0
  285. package/generated/retently.ts +24 -0
  286. package/generated/ring_central.ts +8 -0
  287. package/generated/rippling.ts +8 -0
  288. package/generated/rocket_reach.ts +8 -0
  289. package/generated/rocketlane.ts +42 -0
  290. package/generated/rootly.ts +12 -0
  291. package/generated/rosette_text_analytics.ts +12 -0
  292. package/generated/sage.ts +8 -0
  293. package/generated/salesforce.ts +46 -0
  294. package/generated/scrape_do.ts +28 -0
  295. package/generated/scrapingant.ts +14 -0
  296. package/generated/screenshotone.ts +10 -0
  297. package/generated/seismic.ts +8 -0
  298. package/generated/semanticscholar.ts +23 -0
  299. package/generated/semrush.ts +45 -0
  300. package/generated/sendgrid.ts +384 -0
  301. package/generated/sentry.ts +185 -0
  302. package/generated/serpapi.ts +32 -0
  303. package/generated/servicem8.ts +37 -0
  304. package/generated/servicenow.ts +14 -0
  305. package/generated/share_point.ts +15 -0
  306. package/generated/shopify.ts +37 -0
  307. package/generated/shortcut.ts +131 -0
  308. package/generated/simplesat.ts +11 -0
  309. package/generated/slack.d.ts +16 -0
  310. package/generated/slack.js +11 -0
  311. package/generated/slack.ts +24 -0
  312. package/generated/slackbot.ts +205 -0
  313. package/generated/smartrecruiters.ts +8 -0
  314. package/generated/smugmug.ts +14 -0
  315. package/generated/snowflake.ts +15 -0
  316. package/generated/sourcegraph.ts +16 -0
  317. package/generated/square.ts +8 -0
  318. package/generated/stack_exchange.ts +17 -0
  319. package/generated/starton.ts +11 -0
  320. package/generated/storeganise.ts +12 -0
  321. package/generated/stripe.ts +50 -0
  322. package/generated/supabase.ts +86 -0
  323. package/generated/survey_monkey.ts +8 -0
  324. package/generated/tally.ts +25 -0
  325. package/generated/tapfiliate.ts +11 -0
  326. package/generated/tapform.ts +8 -0
  327. package/generated/tavily.ts +10 -0
  328. package/generated/terminus.ts +8 -0
  329. package/generated/text_to_pdf.ts +10 -0
  330. package/generated/textrazor.ts +22 -0
  331. package/generated/timecamp.ts +10 -0
  332. package/generated/timekit.ts +8 -0
  333. package/generated/timely.ts +11 -0
  334. package/generated/tinypng.ts +15 -0
  335. package/generated/tinyurl.ts +10 -0
  336. package/generated/tisane.ts +15 -0
  337. package/generated/todoist.ts +19 -0
  338. package/generated/toneden.ts +8 -0
  339. package/generated/tpscheck.ts +10 -0
  340. package/generated/trello.ts +360 -0
  341. package/generated/twitch.ts +8 -0
  342. package/generated/twitter.ts +82 -0
  343. package/generated/twitter_media.ts +10 -0
  344. package/generated/typefully.ts +14 -0
  345. package/generated/venly.ts +8 -0
  346. package/generated/vero.ts +8 -0
  347. package/generated/visme.ts +8 -0
  348. package/generated/waboxapp.ts +8 -0
  349. package/generated/wakatime.ts +8 -0
  350. package/generated/wave_accounting.ts +8 -0
  351. package/generated/weathermap.ts +10 -0
  352. package/generated/webex.ts +37 -0
  353. package/generated/webflow.ts +30 -0
  354. package/generated/whatsapp.ts +14 -0
  355. package/generated/wiz.ts +8 -0
  356. package/generated/workiom.ts +12 -0
  357. package/generated/wrike.ts +47 -0
  358. package/generated/xero.ts +13 -0
  359. package/generated/yandex.ts +13 -0
  360. package/generated/ynab.ts +8 -0
  361. package/generated/yousearch.ts +10 -0
  362. package/generated/youtube.ts +26 -0
  363. package/generated/zendesk.ts +23 -0
  364. package/generated/zenrows.ts +25 -0
  365. package/generated/zenserp.ts +20 -0
  366. package/generated/zoho.ts +33 -0
  367. package/generated/zoho_bigin.ts +21 -0
  368. package/generated/zoho_books.ts +8 -0
  369. package/generated/zoho_desk.ts +8 -0
  370. package/generated/zoho_inventory.ts +8 -0
  371. package/generated/zoho_invoice.ts +15 -0
  372. package/generated/zoho_mail.ts +8 -0
  373. package/generated/zoom.ts +181 -0
  374. package/generated/zoominfo.ts +26 -0
  375. package/package.json +26 -2
  376. package/src/platform/index.ts +1 -1
  377. package/src/platform/node.ts +17 -9
  378. package/src/platform/types.ts +9 -5
  379. package/src/platform/workerd.ts +7 -3
  380. package/dist/fileUtils-BbE-aKW0.cjs +0 -983
  381. package/dist/fileUtils-BxTR8M_c.mjs +0 -904
  382. /package/dist/{chunk-0j-ceAHr.mjs → chunk-Dx2NuYGI.mjs} +0 -0
  383. /package/dist/{files.types-B7P5A1Z5.d.mts → files.types-BDqIUdfP.d.mts} +0 -0
  384. /package/dist/{files.types-D-RzIOHq.d.cts → files.types-nK6eTNnc.d.cts} +0 -0
@@ -1,5 +1,5 @@
1
1
  //#region src/models/Files.workerd.ts
2
- const UNSUPPORTED_MESSAGE = "File operations (upload/download) are not supported in Cloudflare Workers or Edge runtimes. These operations require Node.js-specific APIs (Buffer, crypto, file system) that are not available in this environment. Please use a Node.js runtime for file operations.";
2
+ const UNSUPPORTED_MESSAGE = "File operations (upload/download) are not supported in Cloudflare Workers or Edge runtimes. These operations require Node.js-specific APIs (e.g., `node:crypto`, `node:fs`) that are not available in this environment. Please use a Node.js runtime for file operations.";
3
3
  /**
4
4
  * Creates a Proxy that throws a user-friendly error when any method is accessed.
5
5
  * This ensures that users get a clear error message when attempting to use
@@ -33,11 +33,14 @@ const platform = {
33
33
  node_fs.mkdirSync(dirPath, { recursive: true });
34
34
  },
35
35
  readFileSync(filePath, encoding) {
36
- if (encoding) return node_fs.readFileSync(filePath, encoding);
37
- return node_fs.readFileSync(filePath);
36
+ if (encoding === void 0) {
37
+ const buf = node_fs.readFileSync(filePath, { encoding: null });
38
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
39
+ }
40
+ return node_fs.readFileSync(filePath, { encoding });
38
41
  },
39
42
  writeFileSync(filePath, content, encoding) {
40
- if (encoding && typeof content === "string") node_fs.writeFileSync(filePath, content, encoding);
43
+ if (encoding && typeof content === "string") node_fs.writeFileSync(filePath, content, { encoding });
41
44
  else node_fs.writeFileSync(filePath, content);
42
45
  }
43
46
  };
@@ -1,4 +1,4 @@
1
- import { t as Platform } from "../types-BrsW5suw.cjs";
1
+ import { t as Platform } from "../types-BF2OQZRP.cjs";
2
2
 
3
3
  //#region src/platform/node.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as Platform } from "../types-BaUqjuX3.mjs";
1
+ import { t as Platform } from "../types-Cvt_yFsu.mjs";
2
2
 
3
3
  //#region src/platform/node.d.ts
4
4
 
@@ -29,11 +29,14 @@ const platform = {
29
29
  fs.mkdirSync(dirPath, { recursive: true });
30
30
  },
31
31
  readFileSync(filePath, encoding) {
32
- if (encoding) return fs.readFileSync(filePath, encoding);
33
- return fs.readFileSync(filePath);
32
+ if (encoding === void 0) {
33
+ const buf = fs.readFileSync(filePath, { encoding: null });
34
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
35
+ }
36
+ return fs.readFileSync(filePath, { encoding });
34
37
  },
35
38
  writeFileSync(filePath, content, encoding) {
36
- if (encoding && typeof content === "string") fs.writeFileSync(filePath, content, encoding);
39
+ if (encoding && typeof content === "string") fs.writeFileSync(filePath, content, { encoding });
37
40
  else fs.writeFileSync(filePath, content);
38
41
  }
39
42
  };
@@ -1,4 +1,4 @@
1
- import { t as Platform } from "../types-BrsW5suw.cjs";
1
+ import { t as Platform } from "../types-BF2OQZRP.cjs";
2
2
 
3
3
  //#region src/platform/workerd.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as Platform } from "../types-BaUqjuX3.mjs";
1
+ import { t as Platform } from "../types-Cvt_yFsu.mjs";
2
2
 
3
3
  //#region src/platform/workerd.d.ts
4
4
 
@@ -35,22 +35,25 @@ interface Platform {
35
35
  /**
36
36
  * Reads a file synchronously and returns its contents.
37
37
  * @param filePath - The path to the file.
38
- * @param encoding - Optional encoding (e.g., 'utf8'). If not provided, returns a Buffer.
39
- * @returns The file contents as a string (if encoding provided) or Buffer.
38
+ * @param encoding - Optional encoding (e.g., 'utf8'). If not provided, returns an Uint8Array.
39
+ * @returns The file contents as a string (if encoding provided) or Uint8Array.
40
40
  */
41
- readFileSync(filePath: string, encoding?: BufferEncoding): string | Buffer;
41
+ readFileSync(filePath: string, encoding?: never): Uint8Array;
42
+ readFileSync(filePath: string, encoding: Uint8ArrayEncoding): string;
42
43
  /**
43
44
  * Writes content to a file synchronously.
44
45
  * @param filePath - The path to the file.
45
- * @param content - The content to write (string or Buffer).
46
+ * @param content - The content to write (string or Uint8Array).
46
47
  * @param encoding - Optional encoding for string content.
47
48
  */
48
- writeFileSync(filePath: string, content: string | Buffer, encoding?: BufferEncoding): void;
49
+ writeFileSync(filePath: string, content: Uint8Array, encoding?: never): void;
50
+ writeFileSync(filePath: string, content: string, encoding: Uint8ArrayEncoding): void;
49
51
  /**
50
52
  * Indicates whether this platform supports file system operations.
51
53
  * Edge runtimes like Cloudflare Workers return false.
52
54
  */
53
55
  readonly supportsFileSystem: boolean;
54
56
  }
57
+ type Uint8ArrayEncoding = 'utf8';
55
58
  //#endregion
56
59
  export { Platform as t };
@@ -35,22 +35,25 @@ interface Platform {
35
35
  /**
36
36
  * Reads a file synchronously and returns its contents.
37
37
  * @param filePath - The path to the file.
38
- * @param encoding - Optional encoding (e.g., 'utf8'). If not provided, returns a Buffer.
39
- * @returns The file contents as a string (if encoding provided) or Buffer.
38
+ * @param encoding - Optional encoding (e.g., 'utf8'). If not provided, returns an Uint8Array.
39
+ * @returns The file contents as a string (if encoding provided) or Uint8Array.
40
40
  */
41
- readFileSync(filePath: string, encoding?: BufferEncoding): string | Buffer;
41
+ readFileSync(filePath: string, encoding?: never): Uint8Array;
42
+ readFileSync(filePath: string, encoding: Uint8ArrayEncoding): string;
42
43
  /**
43
44
  * Writes content to a file synchronously.
44
45
  * @param filePath - The path to the file.
45
- * @param content - The content to write (string or Buffer).
46
+ * @param content - The content to write (string or Uint8Array).
46
47
  * @param encoding - Optional encoding for string content.
47
48
  */
48
- writeFileSync(filePath: string, content: string | Buffer, encoding?: BufferEncoding): void;
49
+ writeFileSync(filePath: string, content: Uint8Array, encoding?: never): void;
50
+ writeFileSync(filePath: string, content: string, encoding: Uint8ArrayEncoding): void;
49
51
  /**
50
52
  * Indicates whether this platform supports file system operations.
51
53
  * Edge runtimes like Cloudflare Workers return false.
52
54
  */
53
55
  readonly supportsFileSystem: boolean;
54
56
  }
57
+ type Uint8ArrayEncoding = 'utf8';
55
58
  //#endregion
56
59
  export { Platform as t };
@@ -0,0 +1,13 @@
1
+ import { n as BaseComposioProvider } from "./BaseProvider-D1UCDu8V.mjs";
2
+ import { n as ComposioConfig } from "./composio-DtAsGWh4.mjs";
3
+
4
+ //#region src/utils/config-defaults/types.d.ts
5
+
6
+ /**
7
+ * Configuration defaults for Composio.
8
+ * These are the required fields that must have default values.
9
+ * The provider type is set to never since defaults don't include a provider instance.
10
+ */
11
+ type ConfigDefaults = Required<Pick<ComposioConfig<BaseComposioProvider<never, never, never>>, 'autoUploadDownloadFiles' | 'allowTracking' | 'toolkitVersions'>>;
12
+ //#endregion
13
+ export { ConfigDefaults as t };
@@ -0,0 +1,13 @@
1
+ import { n as BaseComposioProvider } from "./BaseProvider-2__95v5V.cjs";
2
+ import { n as ComposioConfig } from "./composio-CFe2Q5BN.cjs";
3
+
4
+ //#region src/utils/config-defaults/types.d.ts
5
+
6
+ /**
7
+ * Configuration defaults for Composio.
8
+ * These are the required fields that must have default values.
9
+ * The provider type is set to never since defaults don't include a provider instance.
10
+ */
11
+ type ConfigDefaults = Required<Pick<ComposioConfig<BaseComposioProvider<never, never, never>>, 'autoUploadDownloadFiles' | 'allowTracking' | 'toolkitVersions'>>;
12
+ //#endregion
13
+ export { ConfigDefaults as t };
@@ -0,0 +1,10 @@
1
+
2
+ //#region src/utils/config-defaults/ConfigDefaults.node.ts
3
+ const CONFIG_DEFAULTS = {
4
+ autoUploadDownloadFiles: true,
5
+ allowTracking: true,
6
+ toolkitVersions: "latest"
7
+ };
8
+
9
+ //#endregion
10
+ exports.CONFIG_DEFAULTS = CONFIG_DEFAULTS;
@@ -0,0 +1,7 @@
1
+ import "../../composio-CFe2Q5BN.cjs";
2
+ import { t as ConfigDefaults } from "../../types-Ohe4pd-1.cjs";
3
+
4
+ //#region src/utils/config-defaults/ConfigDefaults.node.d.ts
5
+ declare const CONFIG_DEFAULTS: ConfigDefaults;
6
+ //#endregion
7
+ export { CONFIG_DEFAULTS };
@@ -0,0 +1,8 @@
1
+ import "../../BaseProvider-D1UCDu8V.mjs";
2
+ import "../../composio-DtAsGWh4.mjs";
3
+ import { t as ConfigDefaults } from "../../types-Do-rlwX8.mjs";
4
+
5
+ //#region src/utils/config-defaults/ConfigDefaults.node.d.ts
6
+ declare const CONFIG_DEFAULTS: ConfigDefaults;
7
+ //#endregion
8
+ export { CONFIG_DEFAULTS };
@@ -0,0 +1,9 @@
1
+ //#region src/utils/config-defaults/ConfigDefaults.node.ts
2
+ const CONFIG_DEFAULTS = {
3
+ autoUploadDownloadFiles: true,
4
+ allowTracking: true,
5
+ toolkitVersions: "latest"
6
+ };
7
+
8
+ //#endregion
9
+ export { CONFIG_DEFAULTS };
@@ -0,0 +1,10 @@
1
+
2
+ //#region src/utils/config-defaults/ConfigDefaults.workerd.ts
3
+ const CONFIG_DEFAULTS = {
4
+ autoUploadDownloadFiles: false,
5
+ allowTracking: true,
6
+ toolkitVersions: "latest"
7
+ };
8
+
9
+ //#endregion
10
+ exports.CONFIG_DEFAULTS = CONFIG_DEFAULTS;
@@ -0,0 +1,7 @@
1
+ import "../../composio-CFe2Q5BN.cjs";
2
+ import { t as ConfigDefaults } from "../../types-Ohe4pd-1.cjs";
3
+
4
+ //#region src/utils/config-defaults/ConfigDefaults.workerd.d.ts
5
+ declare const CONFIG_DEFAULTS: ConfigDefaults;
6
+ //#endregion
7
+ export { CONFIG_DEFAULTS };
@@ -0,0 +1,8 @@
1
+ import "../../BaseProvider-D1UCDu8V.mjs";
2
+ import "../../composio-DtAsGWh4.mjs";
3
+ import { t as ConfigDefaults } from "../../types-Do-rlwX8.mjs";
4
+
5
+ //#region src/utils/config-defaults/ConfigDefaults.workerd.d.ts
6
+ declare const CONFIG_DEFAULTS: ConfigDefaults;
7
+ //#endregion
8
+ export { CONFIG_DEFAULTS };
@@ -0,0 +1,9 @@
1
+ //#region src/utils/config-defaults/ConfigDefaults.workerd.ts
2
+ const CONFIG_DEFAULTS = {
3
+ autoUploadDownloadFiles: false,
4
+ allowTracking: true,
5
+ toolkitVersions: "latest"
6
+ };
7
+
8
+ //#endregion
9
+ export { CONFIG_DEFAULTS };
@@ -0,0 +1,172 @@
1
+ const require_buffer = require('../../buffer-CYf1Z6Sd.cjs');
2
+ const require_fileUtils_node = require('../../fileUtils.node-BJQeDcfa.cjs');
3
+ const require_FileToolModifier_utils_neutral = require('../../FileToolModifier.utils.neutral-Bcl7LVf4.cjs');
4
+
5
+ //#region src/errors/FileModifierErrors.ts
6
+ const FileModifierErrorCodes = { FILE_UPLOAD_FAILED: "FILE_UPLOAD_FAILED" };
7
+ var ComposioFileUploadError = class extends require_buffer.ComposioError {
8
+ constructor(message = "Failed to upload file", options = {}) {
9
+ super(message, {
10
+ ...options,
11
+ code: FileModifierErrorCodes.FILE_UPLOAD_FAILED,
12
+ possibleFixes: options.possibleFixes || ["Check if the file exists in the location provided"]
13
+ });
14
+ this.name = "ComposioFileUploadError";
15
+ }
16
+ };
17
+
18
+ //#endregion
19
+ //#region src/utils/modifiers/FileToolModifier.node.ts
20
+ /**
21
+ * Recursively walks a runtime value and its matching JSON-Schema node,
22
+ * uploading any string path whose schema node has `file_uploadable: true`.
23
+ * The function returns a **new** value with all substitutions applied;
24
+ * nothing is mutated in-place.
25
+ */
26
+ const hydrateFiles = async (value, schema, ctx) => {
27
+ if (schema?.file_uploadable) {
28
+ if (typeof value !== "string" && !(value instanceof File)) return value;
29
+ require_buffer.logger_default.debug(`Uploading file "${value}"`);
30
+ return require_fileUtils_node.getFileDataAfterUploadingToS3(value, {
31
+ toolSlug: ctx.toolSlug,
32
+ toolkitSlug: ctx.toolkitSlug,
33
+ client: ctx.client
34
+ });
35
+ }
36
+ const schemaVariants = [
37
+ ...schema?.anyOf ?? [],
38
+ ...schema?.oneOf ?? [],
39
+ ...schema?.allOf ?? []
40
+ ];
41
+ if (schemaVariants.length > 0) {
42
+ const uploadableVariants = schemaVariants.filter(require_FileToolModifier_utils_neutral.schemaHasFileUploadable);
43
+ if (uploadableVariants.length > 0) {
44
+ let result = value;
45
+ for (const variant of uploadableVariants) result = await hydrateFiles(result, variant, ctx);
46
+ return result;
47
+ }
48
+ }
49
+ if (schema?.type === "object" && schema.properties && require_FileToolModifier_utils_neutral.isPlainObject(value)) {
50
+ const transformed = {};
51
+ for (const [k, v] of Object.entries(value)) transformed[k] = await hydrateFiles(v, schema.properties[k], ctx);
52
+ return transformed;
53
+ }
54
+ if (schema?.type === "array" && schema.items && Array.isArray(value)) {
55
+ const itemSchema = Array.isArray(schema.items) ? schema.items[0] : schema.items;
56
+ return Promise.all(value.map((item) => hydrateFiles(item, itemSchema, ctx)));
57
+ }
58
+ return value;
59
+ };
60
+ /**
61
+ * Downloads a file from S3 and returns a replacement object.
62
+ */
63
+ const downloadS3File = async (value, ctx) => {
64
+ const { s3url, mimetype } = value;
65
+ try {
66
+ require_buffer.logger_default.debug(`Downloading from S3: ${s3url}`);
67
+ const dl = await require_fileUtils_node.downloadFileFromS3({
68
+ toolSlug: ctx.toolSlug,
69
+ s3Url: s3url,
70
+ mimeType: mimetype ?? "application/octet-stream"
71
+ });
72
+ require_buffer.logger_default.debug(`Downloaded → ${dl.filePath}`);
73
+ return {
74
+ uri: dl.filePath,
75
+ file_downloaded: dl.filePath ? true : false,
76
+ s3url,
77
+ mimeType: dl.mimeType
78
+ };
79
+ } catch (err) {
80
+ require_buffer.logger_default.error(`Download failed: ${s3url}`, { cause: err });
81
+ return {
82
+ uri: "",
83
+ file_downloaded: false,
84
+ s3url,
85
+ mimeType: mimetype ?? "application/octet-stream"
86
+ };
87
+ }
88
+ };
89
+ /**
90
+ * Recursively walks an arbitrary value and its matching JSON-Schema node.
91
+ * Whenever it encounters an object that represents a file reference
92
+ * (i.e. has an `s3url`), it downloads the file and returns a replacement:
93
+ * {
94
+ * uri: "<local-path>",
95
+ * file_downloaded: true | false,
96
+ * s3url: "<original S3 URL>",
97
+ * mimeType: "<detected-or-fallback-mime-type>"
98
+ * }
99
+ *
100
+ * The function is side-effect-free: it never mutates the input value.
101
+ */
102
+ const hydrateDownloads = async (value, schema, ctx) => {
103
+ if (require_FileToolModifier_utils_neutral.isPlainObject(value) && typeof value.s3url === "string") return downloadS3File(value, ctx);
104
+ if (schema?.file_downloadable && require_FileToolModifier_utils_neutral.isPlainObject(value) && typeof value.s3url === "string") return downloadS3File(value, ctx);
105
+ const schemaVariants = [
106
+ ...schema?.anyOf ?? [],
107
+ ...schema?.oneOf ?? [],
108
+ ...schema?.allOf ?? []
109
+ ];
110
+ if (schemaVariants.length > 0) {
111
+ const downloadableVariants = schemaVariants.filter(require_FileToolModifier_utils_neutral.schemaHasFileDownloadable);
112
+ let result = value;
113
+ for (const variant of downloadableVariants) result = await hydrateDownloads(result, variant, ctx);
114
+ if (downloadableVariants.length === 0) return hydrateDownloads(value, void 0, ctx);
115
+ return result;
116
+ }
117
+ if (require_FileToolModifier_utils_neutral.isPlainObject(value)) {
118
+ const pairs = await Promise.all(Object.entries(value).map(async ([k, v]) => [k, await hydrateDownloads(v, schema?.properties?.[k], ctx)]));
119
+ return Object.fromEntries(pairs);
120
+ }
121
+ if (Array.isArray(value)) {
122
+ const itemSchema = schema?.items ? Array.isArray(schema.items) ? schema.items[0] : schema.items : void 0;
123
+ return Promise.all(value.map((item) => hydrateDownloads(item, itemSchema, ctx)));
124
+ }
125
+ return value;
126
+ };
127
+ var FileToolModifier = class {
128
+ client;
129
+ constructor(client) {
130
+ this.client = client;
131
+ }
132
+ async modifyToolSchema(toolSlug, toolkitSlug, schema) {
133
+ if (!schema.inputParameters?.properties) return schema;
134
+ const properties = require_FileToolModifier_utils_neutral.transformProperties(schema.inputParameters.properties);
135
+ return {
136
+ ...schema,
137
+ inputParameters: {
138
+ ...schema.inputParameters,
139
+ properties
140
+ }
141
+ };
142
+ }
143
+ async fileUploadModifier(tool, options) {
144
+ const { params, toolSlug, toolkitSlug = "unknown" } = options;
145
+ const { arguments: args } = params;
146
+ if (!args || typeof args !== "object") return params;
147
+ try {
148
+ const newArgs = await hydrateFiles(args, tool.inputParameters, {
149
+ toolSlug,
150
+ toolkitSlug,
151
+ client: this.client
152
+ });
153
+ return {
154
+ ...params,
155
+ arguments: newArgs
156
+ };
157
+ } catch (error) {
158
+ throw new ComposioFileUploadError("Failed to upload file", { cause: error });
159
+ }
160
+ }
161
+ async fileDownloadModifier(tool, options) {
162
+ const { result, toolSlug } = options;
163
+ const dataWithDownloads = await hydrateDownloads(result.data, tool.outputParameters, { toolSlug });
164
+ return {
165
+ ...result,
166
+ data: dataWithDownloads
167
+ };
168
+ }
169
+ };
170
+
171
+ //#endregion
172
+ exports.FileToolModifier = FileToolModifier;
@@ -0,0 +1,21 @@
1
+ import { _n as ToolExecuteResponse, fn as Tool, hn as ToolExecuteParams } from "../../BaseProvider-2__95v5V.cjs";
2
+ import ComposioClient from "@composio/client";
3
+
4
+ //#region src/utils/modifiers/FileToolModifier.node.d.ts
5
+ declare class FileToolModifier {
6
+ private client;
7
+ constructor(client: ComposioClient);
8
+ modifyToolSchema(toolSlug: string, toolkitSlug: string, schema: Tool): Promise<Tool>;
9
+ fileUploadModifier(tool: Tool, options: {
10
+ toolSlug: string;
11
+ toolkitSlug?: string;
12
+ params: ToolExecuteParams;
13
+ }): Promise<ToolExecuteParams>;
14
+ fileDownloadModifier(tool: Tool, options: {
15
+ toolSlug: string;
16
+ toolkitSlug: string;
17
+ result: ToolExecuteResponse;
18
+ }): Promise<ToolExecuteResponse>;
19
+ }
20
+ //#endregion
21
+ export { FileToolModifier };
@@ -0,0 +1,21 @@
1
+ import { _n as ToolExecuteResponse, fn as Tool, hn as ToolExecuteParams } from "../../BaseProvider-D1UCDu8V.mjs";
2
+ import ComposioClient from "@composio/client";
3
+
4
+ //#region src/utils/modifiers/FileToolModifier.node.d.ts
5
+ declare class FileToolModifier {
6
+ private client;
7
+ constructor(client: ComposioClient);
8
+ modifyToolSchema(toolSlug: string, toolkitSlug: string, schema: Tool): Promise<Tool>;
9
+ fileUploadModifier(tool: Tool, options: {
10
+ toolSlug: string;
11
+ toolkitSlug?: string;
12
+ params: ToolExecuteParams;
13
+ }): Promise<ToolExecuteParams>;
14
+ fileDownloadModifier(tool: Tool, options: {
15
+ toolSlug: string;
16
+ toolkitSlug: string;
17
+ result: ToolExecuteResponse;
18
+ }): Promise<ToolExecuteResponse>;
19
+ }
20
+ //#endregion
21
+ export { FileToolModifier };
@@ -0,0 +1,173 @@
1
+ import "../../chunk-Dx2NuYGI.mjs";
2
+ import { o as ComposioError, s as logger_default } from "../../buffer-BFpVRahf.mjs";
3
+ import { n as getFileDataAfterUploadingToS3, t as downloadFileFromS3 } from "../../fileUtils.node-C6fQOgF0.mjs";
4
+ import { i as transformProperties, n as schemaHasFileDownloadable, r as schemaHasFileUploadable, t as isPlainObject } from "../../FileToolModifier.utils.neutral-BN_L8usp.mjs";
5
+
6
+ //#region src/errors/FileModifierErrors.ts
7
+ const FileModifierErrorCodes = { FILE_UPLOAD_FAILED: "FILE_UPLOAD_FAILED" };
8
+ var ComposioFileUploadError = class extends ComposioError {
9
+ constructor(message = "Failed to upload file", options = {}) {
10
+ super(message, {
11
+ ...options,
12
+ code: FileModifierErrorCodes.FILE_UPLOAD_FAILED,
13
+ possibleFixes: options.possibleFixes || ["Check if the file exists in the location provided"]
14
+ });
15
+ this.name = "ComposioFileUploadError";
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ //#region src/utils/modifiers/FileToolModifier.node.ts
21
+ /**
22
+ * Recursively walks a runtime value and its matching JSON-Schema node,
23
+ * uploading any string path whose schema node has `file_uploadable: true`.
24
+ * The function returns a **new** value with all substitutions applied;
25
+ * nothing is mutated in-place.
26
+ */
27
+ const hydrateFiles = async (value, schema, ctx) => {
28
+ if (schema?.file_uploadable) {
29
+ if (typeof value !== "string" && !(value instanceof File)) return value;
30
+ logger_default.debug(`Uploading file "${value}"`);
31
+ return getFileDataAfterUploadingToS3(value, {
32
+ toolSlug: ctx.toolSlug,
33
+ toolkitSlug: ctx.toolkitSlug,
34
+ client: ctx.client
35
+ });
36
+ }
37
+ const schemaVariants = [
38
+ ...schema?.anyOf ?? [],
39
+ ...schema?.oneOf ?? [],
40
+ ...schema?.allOf ?? []
41
+ ];
42
+ if (schemaVariants.length > 0) {
43
+ const uploadableVariants = schemaVariants.filter(schemaHasFileUploadable);
44
+ if (uploadableVariants.length > 0) {
45
+ let result = value;
46
+ for (const variant of uploadableVariants) result = await hydrateFiles(result, variant, ctx);
47
+ return result;
48
+ }
49
+ }
50
+ if (schema?.type === "object" && schema.properties && isPlainObject(value)) {
51
+ const transformed = {};
52
+ for (const [k, v] of Object.entries(value)) transformed[k] = await hydrateFiles(v, schema.properties[k], ctx);
53
+ return transformed;
54
+ }
55
+ if (schema?.type === "array" && schema.items && Array.isArray(value)) {
56
+ const itemSchema = Array.isArray(schema.items) ? schema.items[0] : schema.items;
57
+ return Promise.all(value.map((item) => hydrateFiles(item, itemSchema, ctx)));
58
+ }
59
+ return value;
60
+ };
61
+ /**
62
+ * Downloads a file from S3 and returns a replacement object.
63
+ */
64
+ const downloadS3File = async (value, ctx) => {
65
+ const { s3url, mimetype } = value;
66
+ try {
67
+ logger_default.debug(`Downloading from S3: ${s3url}`);
68
+ const dl = await downloadFileFromS3({
69
+ toolSlug: ctx.toolSlug,
70
+ s3Url: s3url,
71
+ mimeType: mimetype ?? "application/octet-stream"
72
+ });
73
+ logger_default.debug(`Downloaded → ${dl.filePath}`);
74
+ return {
75
+ uri: dl.filePath,
76
+ file_downloaded: dl.filePath ? true : false,
77
+ s3url,
78
+ mimeType: dl.mimeType
79
+ };
80
+ } catch (err) {
81
+ logger_default.error(`Download failed: ${s3url}`, { cause: err });
82
+ return {
83
+ uri: "",
84
+ file_downloaded: false,
85
+ s3url,
86
+ mimeType: mimetype ?? "application/octet-stream"
87
+ };
88
+ }
89
+ };
90
+ /**
91
+ * Recursively walks an arbitrary value and its matching JSON-Schema node.
92
+ * Whenever it encounters an object that represents a file reference
93
+ * (i.e. has an `s3url`), it downloads the file and returns a replacement:
94
+ * {
95
+ * uri: "<local-path>",
96
+ * file_downloaded: true | false,
97
+ * s3url: "<original S3 URL>",
98
+ * mimeType: "<detected-or-fallback-mime-type>"
99
+ * }
100
+ *
101
+ * The function is side-effect-free: it never mutates the input value.
102
+ */
103
+ const hydrateDownloads = async (value, schema, ctx) => {
104
+ if (isPlainObject(value) && typeof value.s3url === "string") return downloadS3File(value, ctx);
105
+ if (schema?.file_downloadable && isPlainObject(value) && typeof value.s3url === "string") return downloadS3File(value, ctx);
106
+ const schemaVariants = [
107
+ ...schema?.anyOf ?? [],
108
+ ...schema?.oneOf ?? [],
109
+ ...schema?.allOf ?? []
110
+ ];
111
+ if (schemaVariants.length > 0) {
112
+ const downloadableVariants = schemaVariants.filter(schemaHasFileDownloadable);
113
+ let result = value;
114
+ for (const variant of downloadableVariants) result = await hydrateDownloads(result, variant, ctx);
115
+ if (downloadableVariants.length === 0) return hydrateDownloads(value, void 0, ctx);
116
+ return result;
117
+ }
118
+ if (isPlainObject(value)) {
119
+ const pairs = await Promise.all(Object.entries(value).map(async ([k, v]) => [k, await hydrateDownloads(v, schema?.properties?.[k], ctx)]));
120
+ return Object.fromEntries(pairs);
121
+ }
122
+ if (Array.isArray(value)) {
123
+ const itemSchema = schema?.items ? Array.isArray(schema.items) ? schema.items[0] : schema.items : void 0;
124
+ return Promise.all(value.map((item) => hydrateDownloads(item, itemSchema, ctx)));
125
+ }
126
+ return value;
127
+ };
128
+ var FileToolModifier = class {
129
+ client;
130
+ constructor(client) {
131
+ this.client = client;
132
+ }
133
+ async modifyToolSchema(toolSlug, toolkitSlug, schema) {
134
+ if (!schema.inputParameters?.properties) return schema;
135
+ const properties = transformProperties(schema.inputParameters.properties);
136
+ return {
137
+ ...schema,
138
+ inputParameters: {
139
+ ...schema.inputParameters,
140
+ properties
141
+ }
142
+ };
143
+ }
144
+ async fileUploadModifier(tool, options) {
145
+ const { params, toolSlug, toolkitSlug = "unknown" } = options;
146
+ const { arguments: args } = params;
147
+ if (!args || typeof args !== "object") return params;
148
+ try {
149
+ const newArgs = await hydrateFiles(args, tool.inputParameters, {
150
+ toolSlug,
151
+ toolkitSlug,
152
+ client: this.client
153
+ });
154
+ return {
155
+ ...params,
156
+ arguments: newArgs
157
+ };
158
+ } catch (error) {
159
+ throw new ComposioFileUploadError("Failed to upload file", { cause: error });
160
+ }
161
+ }
162
+ async fileDownloadModifier(tool, options) {
163
+ const { result, toolSlug } = options;
164
+ const dataWithDownloads = await hydrateDownloads(result.data, tool.outputParameters, { toolSlug });
165
+ return {
166
+ ...result,
167
+ data: dataWithDownloads
168
+ };
169
+ }
170
+ };
171
+
172
+ //#endregion
173
+ export { FileToolModifier };
@@ -0,0 +1,27 @@
1
+ const require_FileToolModifier_utils_neutral = require('../../FileToolModifier.utils.neutral-Bcl7LVf4.cjs');
2
+
3
+ //#region src/utils/modifiers/FileToolModifier.workerd.ts
4
+ const UNSUPPORTED_MESSAGE = "File upload/download modifiers are not available on edge runtimes yet. Please set `autoUploadDownloadFiles: false` or run Composio in another JS runtime (Node.js / Bun).";
5
+ var FileToolModifier = class {
6
+ constructor(_client) {}
7
+ async modifyToolSchema(toolSlug, toolkitSlug, schema) {
8
+ if (!schema.inputParameters?.properties) return schema;
9
+ const properties = require_FileToolModifier_utils_neutral.transformProperties(schema.inputParameters.properties);
10
+ return {
11
+ ...schema,
12
+ inputParameters: {
13
+ ...schema.inputParameters,
14
+ properties
15
+ }
16
+ };
17
+ }
18
+ async fileUploadModifier(_tool, _options) {
19
+ throw new Error(UNSUPPORTED_MESSAGE);
20
+ }
21
+ async fileDownloadModifier(_tool, _options) {
22
+ throw new Error(UNSUPPORTED_MESSAGE);
23
+ }
24
+ };
25
+
26
+ //#endregion
27
+ exports.FileToolModifier = FileToolModifier;