@composio/core 0.2.5 → 0.2.6

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 (333) hide show
  1. package/dist/index.cjs +54 -21
  2. package/dist/index.d.cts +27 -4
  3. package/dist/index.d.ts +27 -4
  4. package/dist/index.js +54 -21
  5. package/generated/ably.ts +20 -0
  6. package/generated/accelo.ts +8 -0
  7. package/generated/acculynx.ts +17 -0
  8. package/generated/active_campaign.ts +30 -0
  9. package/generated/adobe.ts +8 -0
  10. package/generated/adyntel.ts +12 -0
  11. package/generated/aero_workflow.ts +8 -0
  12. package/generated/affinity.ts +29 -0
  13. package/generated/agencyzoom.ts +108 -0
  14. package/generated/ahrefs.ts +49 -0
  15. package/generated/airtable.ts +26 -0
  16. package/generated/alchemy.ts +16 -0
  17. package/generated/algolia.ts +39 -0
  18. package/generated/altoviz.ts +18 -0
  19. package/generated/amazon.ts +8 -0
  20. package/generated/amcards.ts +11 -0
  21. package/generated/amplitude.ts +25 -0
  22. package/generated/anthropic_administrator.ts +13 -0
  23. package/generated/apaleo.ts +38 -0
  24. package/generated/apollo.ts +40 -0
  25. package/generated/appdrag.ts +8 -0
  26. package/generated/appsflyer.ts +8 -0
  27. package/generated/asana.ts +95 -0
  28. package/generated/ashby.ts +8 -0
  29. package/generated/atlassian.ts +8 -0
  30. package/generated/attio.ts +20 -0
  31. package/generated/auth0.ts +8 -0
  32. package/generated/axonaut.ts +8 -0
  33. package/generated/bamboohr.ts +168 -0
  34. package/generated/bannerbear.ts +17 -0
  35. package/generated/baserow.ts +11 -0
  36. package/generated/battlenet.ts +8 -0
  37. package/generated/beeminder.ts +14 -0
  38. package/generated/bigmailer.ts +12 -0
  39. package/generated/bigml.ts +15 -0
  40. package/generated/bill.ts +218 -0
  41. package/generated/bitbucket.ts +25 -0
  42. package/generated/bitwarden.ts +8 -0
  43. package/generated/blackbaud.ts +8 -0
  44. package/generated/blackboard.ts +323 -0
  45. package/generated/boldsign.ts +8 -0
  46. package/generated/bolna.ts +24 -0
  47. package/generated/borneo.ts +162 -0
  48. package/generated/botbaba.ts +8 -0
  49. package/generated/box.ts +282 -0
  50. package/generated/braintree.ts +8 -0
  51. package/generated/brandfetch.ts +15 -0
  52. package/generated/breezy_hr.ts +8 -0
  53. package/generated/brevo.ts +28 -0
  54. package/generated/brex.ts +8 -0
  55. package/generated/brex_staging.ts +8 -0
  56. package/generated/brightpearl.ts +8 -0
  57. package/generated/brilliant_directories.ts +15 -0
  58. package/generated/browseai.ts +18 -0
  59. package/generated/browserbase_tool.ts +10 -0
  60. package/generated/browserhub.ts +8 -0
  61. package/generated/browserless.ts +16 -0
  62. package/generated/bubble.ts +8 -0
  63. package/generated/bugbug.ts +13 -0
  64. package/generated/builtwith.ts +21 -0
  65. package/generated/cal.ts +150 -0
  66. package/generated/calendly.ts +51 -0
  67. package/generated/canva.ts +41 -0
  68. package/generated/canvas.ts +100 -0
  69. package/generated/chatwork.ts +17 -0
  70. package/generated/chmeetings.ts +8 -0
  71. package/generated/clickup.ts +153 -0
  72. package/generated/clockify.ts +23 -0
  73. package/generated/close.ts +15 -0
  74. package/generated/cloudflare.ts +10 -0
  75. package/generated/coda.ts +115 -0
  76. package/generated/codeinterpreter.ts +14 -0
  77. package/generated/coinbase.ts +15 -0
  78. package/generated/coinmarketcal.ts +8 -0
  79. package/generated/composio.ts +34 -0
  80. package/generated/composio_search.ts +22 -0
  81. package/generated/confluence.ts +199 -0
  82. package/generated/contentful.ts +12 -0
  83. package/generated/crustdata.ts +23 -0
  84. package/generated/customer_io.ts +8 -0
  85. package/generated/cutt_ly.ts +10 -0
  86. package/generated/d2lbrightspace.ts +54 -0
  87. package/generated/dailybot.ts +15 -0
  88. package/generated/datadog.ts +47 -0
  89. package/generated/datagma.ts +8 -0
  90. package/generated/datarobot.ts +8 -0
  91. package/generated/deel.ts +8 -0
  92. package/generated/demio.ts +8 -0
  93. package/generated/dialpad.ts +201 -0
  94. package/generated/digicert.ts +15 -0
  95. package/generated/discord.ts +17 -0
  96. package/generated/discordbot.ts +173 -0
  97. package/generated/docmosis.ts +8 -0
  98. package/generated/docusign.ts +351 -0
  99. package/generated/dropbox.ts +20 -0
  100. package/generated/dropbox_sign.ts +8 -0
  101. package/generated/dynamics365.ts +25 -0
  102. package/generated/echtpost.ts +10 -0
  103. package/generated/elevenlabs.ts +70 -0
  104. package/generated/emailoctopus.ts +16 -0
  105. package/generated/enigma.ts +11 -0
  106. package/generated/entelligence.ts +11 -0
  107. package/generated/epic_games.ts +8 -0
  108. package/generated/eventbrite.ts +12 -0
  109. package/generated/exa.ts +13 -0
  110. package/generated/excel.ts +34 -0
  111. package/generated/exist.ts +8 -0
  112. package/generated/facebook.ts +8 -0
  113. package/generated/factorial.ts +8 -0
  114. package/generated/figma.ts +59 -0
  115. package/generated/finage.ts +19 -0
  116. package/generated/firecrawl.ts +16 -0
  117. package/generated/fireflies.ts +21 -0
  118. package/generated/fitbit.ts +8 -0
  119. package/generated/flutterwave.ts +33 -0
  120. package/generated/fomo.ts +10 -0
  121. package/generated/formcarry.ts +10 -0
  122. package/generated/formsite.ts +14 -0
  123. package/generated/foursquare.ts +14 -0
  124. package/generated/freshbooks.ts +11 -0
  125. package/generated/freshdesk.ts +16 -0
  126. package/generated/front.ts +8 -0
  127. package/generated/github.ts +967 -0
  128. package/generated/gitlab.ts +82 -0
  129. package/generated/gmail.d.ts +86 -0
  130. package/generated/gmail.js +13 -0
  131. package/generated/gmail.ts +95 -0
  132. package/generated/go_to_webinar.ts +8 -0
  133. package/generated/gong.ts +63 -0
  134. package/generated/google_analytics.ts +13 -0
  135. package/generated/google_maps.ts +16 -0
  136. package/generated/googleads.ts +14 -0
  137. package/generated/googlebigquery.ts +10 -0
  138. package/generated/googlecalendar.ts +39 -0
  139. package/generated/googledocs.ts +41 -0
  140. package/generated/googledrive.ts +62 -0
  141. package/generated/googlemeet.ts +18 -0
  142. package/generated/googlephotos.ts +22 -0
  143. package/generated/googlesheets.ts +40 -0
  144. package/generated/googleslides.ts +8 -0
  145. package/generated/googlesuper.ts +230 -0
  146. package/generated/googletasks.ts +23 -0
  147. package/generated/gorgias.ts +41 -0
  148. package/generated/gumroad.ts +14 -0
  149. package/generated/guru.ts +8 -0
  150. package/generated/hackernews.ts +15 -0
  151. package/generated/hackerrank_work.ts +8 -0
  152. package/generated/harvest.ts +56 -0
  153. package/generated/helcim.ts +8 -0
  154. package/generated/heygen.ts +44 -0
  155. package/generated/highlevel.ts +8 -0
  156. package/generated/hubspot.ts +252 -0
  157. package/generated/humanloop.ts +13 -0
  158. package/generated/icims_talent_cloud.ts +8 -0
  159. package/generated/idea_scale.ts +8 -0
  160. package/generated/index.d.ts +136 -0
  161. package/generated/index.js +34 -0
  162. package/generated/index.ts +151 -0
  163. package/generated/insighto_ai.ts +19 -0
  164. package/generated/intercom.ts +52 -0
  165. package/generated/interzoid.ts +8 -0
  166. package/generated/jira.ts +59 -0
  167. package/generated/jotform.ts +15 -0
  168. package/generated/junglescout.ts +15 -0
  169. package/generated/keap.ts +8 -0
  170. package/generated/kibana.ts +58 -0
  171. package/generated/kit.ts +38 -0
  172. package/generated/klaviyo.ts +240 -0
  173. package/generated/klipfolio.ts +20 -0
  174. package/generated/kommo.ts +24 -0
  175. package/generated/lastpass.ts +8 -0
  176. package/generated/launch_darkly.ts +16 -0
  177. package/generated/leadfeeder.ts +13 -0
  178. package/generated/leadoku.ts +10 -0
  179. package/generated/lever.ts +8 -0
  180. package/generated/lever_sandbox.ts +8 -0
  181. package/generated/lexoffice.ts +8 -0
  182. package/generated/linear.ts +31 -0
  183. package/generated/linkedin.ts +13 -0
  184. package/generated/linkhut.ts +14 -0
  185. package/generated/linkup.ts +11 -0
  186. package/generated/listennotes.ts +35 -0
  187. package/generated/lmnt.ts +16 -0
  188. package/generated/lodgify.ts +10 -0
  189. package/generated/mailchimp.ts +285 -0
  190. package/generated/mailerlite.ts +8 -0
  191. package/generated/maintainx.ts +20 -0
  192. package/generated/make.ts +12 -0
  193. package/generated/mboum.ts +8 -0
  194. package/generated/mem0.ts +52 -0
  195. package/generated/metaads.ts +25 -0
  196. package/generated/metatextai.ts +8 -0
  197. package/generated/microsoft_clarity.ts +10 -0
  198. package/generated/microsoft_teams.ts +22 -0
  199. package/generated/microsoft_tenant.ts +8 -0
  200. package/generated/miro.ts +23 -0
  201. package/generated/mixpanel.ts +30 -0
  202. package/generated/mocean.ts +8 -0
  203. package/generated/monday.ts +30 -0
  204. package/generated/mopinion.ts +8 -0
  205. package/generated/more_trees.ts +10 -0
  206. package/generated/moxie.ts +8 -0
  207. package/generated/moz.ts +8 -0
  208. package/generated/mural.ts +14 -0
  209. package/generated/nasdaq.ts +15 -0
  210. package/generated/ncscale.ts +8 -0
  211. package/generated/neon.ts +78 -0
  212. package/generated/netsuite.ts +8 -0
  213. package/generated/nextdns.ts +11 -0
  214. package/generated/ngrok.ts +18 -0
  215. package/generated/notion.ts +40 -0
  216. package/generated/oncehub.ts +8 -0
  217. package/generated/one_drive.ts +49 -0
  218. package/generated/onepage.ts +11 -0
  219. package/generated/open_sea.ts +33 -0
  220. package/generated/outlook.ts +37 -0
  221. package/generated/pagerduty.ts +362 -0
  222. package/generated/pandadoc.ts +23 -0
  223. package/generated/peopledatalabs.ts +24 -0
  224. package/generated/perplexityai.ts +10 -0
  225. package/generated/piggy.ts +8 -0
  226. package/generated/pipedrive.ts +288 -0
  227. package/generated/placekey.ts +12 -0
  228. package/generated/posthog.ts +367 -0
  229. package/generated/precoro.ts +8 -0
  230. package/generated/printnode.ts +8 -0
  231. package/generated/process_street.ts +14 -0
  232. package/generated/productboard.ts +8 -0
  233. package/generated/qualaroo.ts +8 -0
  234. package/generated/quickbooks.ts +22 -0
  235. package/generated/rafflys.ts +8 -0
  236. package/generated/ragic.ts +10 -0
  237. package/generated/ramp.ts +17 -0
  238. package/generated/ravenseotools.ts +8 -0
  239. package/generated/recallai.ts +17 -0
  240. package/generated/reddit.ts +19 -0
  241. package/generated/resend.ts +27 -0
  242. package/generated/retellai.ts +19 -0
  243. package/generated/retently.ts +24 -0
  244. package/generated/ring_central.ts +8 -0
  245. package/generated/rippling.ts +8 -0
  246. package/generated/rocket_reach.ts +8 -0
  247. package/generated/rocketlane.ts +42 -0
  248. package/generated/rootly.ts +12 -0
  249. package/generated/rosette_text_analytics.ts +12 -0
  250. package/generated/sage.ts +8 -0
  251. package/generated/salesforce.ts +46 -0
  252. package/generated/scrape_do.ts +28 -0
  253. package/generated/scrapingant.ts +14 -0
  254. package/generated/screenshotone.ts +10 -0
  255. package/generated/seismic.ts +8 -0
  256. package/generated/semanticscholar.ts +23 -0
  257. package/generated/semrush.ts +45 -0
  258. package/generated/sendgrid.ts +384 -0
  259. package/generated/sentry.ts +185 -0
  260. package/generated/serpapi.ts +32 -0
  261. package/generated/servicem8.ts +37 -0
  262. package/generated/servicenow.ts +14 -0
  263. package/generated/share_point.ts +15 -0
  264. package/generated/shopify.ts +37 -0
  265. package/generated/shortcut.ts +131 -0
  266. package/generated/simplesat.ts +11 -0
  267. package/generated/slack.d.ts +16 -0
  268. package/generated/slack.js +11 -0
  269. package/generated/slack.ts +24 -0
  270. package/generated/slackbot.ts +205 -0
  271. package/generated/smartrecruiters.ts +8 -0
  272. package/generated/smugmug.ts +14 -0
  273. package/generated/snowflake.ts +15 -0
  274. package/generated/sourcegraph.ts +16 -0
  275. package/generated/square.ts +8 -0
  276. package/generated/stack_exchange.ts +17 -0
  277. package/generated/starton.ts +11 -0
  278. package/generated/storeganise.ts +12 -0
  279. package/generated/stripe.ts +50 -0
  280. package/generated/supabase.ts +86 -0
  281. package/generated/survey_monkey.ts +8 -0
  282. package/generated/tally.ts +25 -0
  283. package/generated/tapfiliate.ts +11 -0
  284. package/generated/tapform.ts +8 -0
  285. package/generated/tavily.ts +10 -0
  286. package/generated/terminus.ts +8 -0
  287. package/generated/text_to_pdf.ts +10 -0
  288. package/generated/textrazor.ts +22 -0
  289. package/generated/timecamp.ts +10 -0
  290. package/generated/timekit.ts +8 -0
  291. package/generated/timely.ts +11 -0
  292. package/generated/tinypng.ts +15 -0
  293. package/generated/tinyurl.ts +10 -0
  294. package/generated/tisane.ts +15 -0
  295. package/generated/todoist.ts +19 -0
  296. package/generated/toneden.ts +8 -0
  297. package/generated/tpscheck.ts +10 -0
  298. package/generated/trello.ts +360 -0
  299. package/generated/twitch.ts +8 -0
  300. package/generated/twitter.ts +82 -0
  301. package/generated/twitter_media.ts +10 -0
  302. package/generated/typefully.ts +14 -0
  303. package/generated/venly.ts +8 -0
  304. package/generated/vero.ts +8 -0
  305. package/generated/visme.ts +8 -0
  306. package/generated/waboxapp.ts +8 -0
  307. package/generated/wakatime.ts +8 -0
  308. package/generated/wave_accounting.ts +8 -0
  309. package/generated/weathermap.ts +10 -0
  310. package/generated/webex.ts +37 -0
  311. package/generated/webflow.ts +30 -0
  312. package/generated/whatsapp.ts +14 -0
  313. package/generated/wiz.ts +8 -0
  314. package/generated/workiom.ts +12 -0
  315. package/generated/wrike.ts +47 -0
  316. package/generated/xero.ts +13 -0
  317. package/generated/yandex.ts +13 -0
  318. package/generated/ynab.ts +8 -0
  319. package/generated/yousearch.ts +10 -0
  320. package/generated/youtube.ts +26 -0
  321. package/generated/zendesk.ts +23 -0
  322. package/generated/zenrows.ts +25 -0
  323. package/generated/zenserp.ts +20 -0
  324. package/generated/zoho.ts +33 -0
  325. package/generated/zoho_bigin.ts +21 -0
  326. package/generated/zoho_books.ts +8 -0
  327. package/generated/zoho_desk.ts +8 -0
  328. package/generated/zoho_inventory.ts +8 -0
  329. package/generated/zoho_invoice.ts +15 -0
  330. package/generated/zoho_mail.ts +8 -0
  331. package/generated/zoom.ts +181 -0
  332. package/generated/zoominfo.ts +26 -0
  333. package/package.json +3 -3
package/dist/index.cjs CHANGED
@@ -1208,12 +1208,12 @@ ${originalStackBody}`;
1208
1208
  }
1209
1209
  /**
1210
1210
  * Utility function to handle errors in a consistent way
1211
- * This properly displays the error and exits the process if needed
1211
+ * This properly displays the error without throwing
1212
1212
  * @param error The error to handle
1213
1213
  * @param options Options for error handling
1214
1214
  */
1215
1215
  static handle(error, options = {}) {
1216
- const { includeStack = false, exitProcess = false, exitCode = 1 } = options;
1216
+ const { includeStack = false, exitProcess = false } = options;
1217
1217
  if (error instanceof _ComposioError) {
1218
1218
  error.prettyPrint(includeStack);
1219
1219
  } else if (error instanceof import_v34.ZodError) {
@@ -1223,8 +1223,34 @@ ${originalStackBody}`;
1223
1223
  } else {
1224
1224
  this.handleUnknownError(error);
1225
1225
  }
1226
- if (exitProcess && typeof process !== "undefined") {
1227
- process.exit(exitCode);
1226
+ if (exitProcess) {
1227
+ this.throwError(error);
1228
+ }
1229
+ }
1230
+ /**
1231
+ * Utility function to handle errors and then throw them
1232
+ * This properly displays the error and then throws it, allowing callers to catch it.
1233
+ * Use this for fatal errors that should stop execution.
1234
+ * @param error The error to handle and throw
1235
+ * @param includeStack Whether to include the stack trace in the output
1236
+ * @throws ComposioError - Always throws after displaying the error
1237
+ */
1238
+ static handleAndThrow(error, includeStack = false) {
1239
+ this.handle(error, { includeStack });
1240
+ this.throwError(error);
1241
+ }
1242
+ /**
1243
+ * Helper method to throw an error as a ComposioError
1244
+ * @param error The error to throw
1245
+ * @private
1246
+ */
1247
+ static throwError(error) {
1248
+ if (error instanceof _ComposioError) {
1249
+ throw error;
1250
+ } else if (error instanceof Error) {
1251
+ throw new _ComposioError(error.message, { cause: error });
1252
+ } else {
1253
+ throw new _ComposioError(String(error));
1228
1254
  }
1229
1255
  }
1230
1256
  /**
@@ -2774,15 +2800,7 @@ var Tools = class {
2774
2800
  this.autoUploadDownloadFiles = config?.autoUploadDownloadFiles ?? true;
2775
2801
  this.toolkitVersions = config?.toolkitVersions ?? "latest";
2776
2802
  this.execute = this.execute.bind(this);
2777
- const providerExecuteToolFn = this.provider._isAgentic ? this.execute : (slug, body, modifiers) => this.execute(
2778
- slug,
2779
- {
2780
- ...body,
2781
- dangerouslySkipVersionCheck: body.dangerouslySkipVersionCheck ?? true
2782
- },
2783
- modifiers
2784
- );
2785
- this.provider._setExecuteToolFn(providerExecuteToolFn);
2803
+ this.provider._setExecuteToolFn(this.createExecuteFnForProviders());
2786
2804
  this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
2787
2805
  this.getRawComposioTools = this.getRawComposioTools.bind(this);
2788
2806
  telemetry.instrument(this, "Tools");
@@ -3141,6 +3159,22 @@ var Tools = class {
3141
3159
  return this.provider.wrapTools(tools, executeToolFn);
3142
3160
  }
3143
3161
  }
3162
+ /**
3163
+ * @internal
3164
+ * Creates a global execute tool function.
3165
+ * This function is used by providers to execute tools.
3166
+ * It skips the version check for provider controlled execution.
3167
+ * @returns {GlobalExecuteToolFn} The global execute tool function
3168
+ */
3169
+ createExecuteFnForProviders() {
3170
+ return async (slug, body, modifiers) => {
3171
+ return await this.execute(
3172
+ slug,
3173
+ { ...body, dangerouslySkipVersionCheck: body.dangerouslySkipVersionCheck ?? true },
3174
+ modifiers
3175
+ );
3176
+ };
3177
+ }
3144
3178
  /**
3145
3179
  * @internal
3146
3180
  * @description
@@ -3158,7 +3192,7 @@ var Tools = class {
3158
3192
  {
3159
3193
  userId,
3160
3194
  arguments: input,
3161
- // dangerously skip version check for agentic and non agentic tool execution via providers
3195
+ // dangerously skip version check for agentic tool execution via providers
3162
3196
  // this can be safe because most agentic flows users fetch latest version and then execute the tool
3163
3197
  dangerouslySkipVersionCheck: true
3164
3198
  },
@@ -6814,9 +6848,7 @@ function getSDKConfig(baseUrl, apiKey) {
6814
6848
  const baseURLParsed = baseUrl || getEnvVariable("COMPOSIO_BASE_URL") || baseURLFromUserConfig || DEFAULT_BASE_URL;
6815
6849
  const apiKeyParsed = apiKey || getEnvVariable("COMPOSIO_API_KEY") || apiKeyFromUserConfig || "";
6816
6850
  if (!apiKeyParsed) {
6817
- ComposioError.handle(new ComposioNoAPIKeyError(), {
6818
- exitProcess: true
6819
- });
6851
+ ComposioError.handleAndThrow(new ComposioNoAPIKeyError());
6820
6852
  }
6821
6853
  logger_default.debug("Environment", `API Key: ${apiKeyParsed}`);
6822
6854
  logger_default.debug("Environment", `Base URL: ${baseURLParsed}`);
@@ -6892,7 +6924,7 @@ var BaseProvider = class {
6892
6924
  /**
6893
6925
  * @public
6894
6926
  * Global function to execute a tool.
6895
- * This function is used by providerds to implement helper functions to execute tools.
6927
+ * This function is used by providers to implement helper functions to execute tools.
6896
6928
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
6897
6929
  * @param {string} toolSlug - The slug of the tool to execute.
6898
6930
  * @param {ToolExecuteParams} body - The body of the tool execution.
@@ -7368,7 +7400,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
7368
7400
  };
7369
7401
 
7370
7402
  // package.json
7371
- var version = "0.2.5";
7403
+ var version = "0.2.6";
7372
7404
 
7373
7405
  // src/models/Files.ts
7374
7406
  var Files = class {
@@ -7607,15 +7639,16 @@ var Composio = class _Composio {
7607
7639
  if (IS_DEVELOPMENT_OR_CI) {
7608
7640
  logger_default.debug(`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}`);
7609
7641
  }
7642
+ this.provider = config?.provider ?? new OpenAIProvider();
7610
7643
  this.config = {
7611
7644
  ...config,
7612
7645
  baseURL: baseURLParsed,
7613
7646
  apiKey: apiKeyParsed,
7614
7647
  toolkitVersions: getToolkitVersionsFromEnv(config?.toolkitVersions),
7615
7648
  allowTracking: config?.allowTracking ?? true,
7616
- autoUploadDownloadFiles: config?.autoUploadDownloadFiles ?? true
7649
+ autoUploadDownloadFiles: config?.autoUploadDownloadFiles ?? true,
7650
+ provider: config?.provider ?? this.provider
7617
7651
  };
7618
- this.provider = config?.provider ?? new OpenAIProvider();
7619
7652
  const defaultHeaders = getDefaultHeaders(this.config.defaultHeaders, this.provider);
7620
7653
  this.client = new import_client8.default({
7621
7654
  apiKey: apiKeyParsed,
package/dist/index.d.cts CHANGED
@@ -16836,7 +16836,7 @@ declare abstract class BaseProvider<TMcpResponse> {
16836
16836
  /**
16837
16837
  * @public
16838
16838
  * Global function to execute a tool.
16839
- * This function is used by providerds to implement helper functions to execute tools.
16839
+ * This function is used by providers to implement helper functions to execute tools.
16840
16840
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
16841
16841
  * @param {string} toolSlug - The slug of the tool to execute.
16842
16842
  * @param {ToolExecuteParams} body - The body of the tool execution.
@@ -17172,6 +17172,14 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
17172
17172
  * ```
17173
17173
  */
17174
17174
  get<T extends TProvider>(userId: string, slug: string, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
17175
+ /**
17176
+ * @internal
17177
+ * Creates a global execute tool function.
17178
+ * This function is used by providers to execute tools.
17179
+ * It skips the version check for provider controlled execution.
17180
+ * @returns {GlobalExecuteToolFn} The global execute tool function
17181
+ */
17182
+ private createExecuteFnForProviders;
17175
17183
  /**
17176
17184
  * @internal
17177
17185
  * @description
@@ -67383,9 +67391,9 @@ declare const logger: Logger;
67383
67391
  interface ErrorHandleOptions {
67384
67392
  /** Whether to include the stack trace in the output */
67385
67393
  includeStack?: boolean;
67386
- /** Whether to exit the process after handling */
67394
+ /** @deprecated Use ComposioError.handleAndThrow() instead. This option will be removed in a future version. */
67387
67395
  exitProcess?: boolean;
67388
- /** The exit code to use if exiting the process */
67396
+ /** @deprecated This option is no longer used. */
67389
67397
  exitCode?: number;
67390
67398
  }
67391
67399
  /**
@@ -67458,11 +67466,26 @@ declare class ComposioError extends Error {
67458
67466
  static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError;
67459
67467
  /**
67460
67468
  * Utility function to handle errors in a consistent way
67461
- * This properly displays the error and exits the process if needed
67469
+ * This properly displays the error without throwing
67462
67470
  * @param error The error to handle
67463
67471
  * @param options Options for error handling
67464
67472
  */
67465
67473
  static handle(error: unknown, options?: ErrorHandleOptions): void;
67474
+ /**
67475
+ * Utility function to handle errors and then throw them
67476
+ * This properly displays the error and then throws it, allowing callers to catch it.
67477
+ * Use this for fatal errors that should stop execution.
67478
+ * @param error The error to handle and throw
67479
+ * @param includeStack Whether to include the stack trace in the output
67480
+ * @throws ComposioError - Always throws after displaying the error
67481
+ */
67482
+ static handleAndThrow(error: unknown, includeStack?: boolean): never;
67483
+ /**
67484
+ * Helper method to throw an error as a ComposioError
67485
+ * @param error The error to throw
67486
+ * @private
67487
+ */
67488
+ private static throwError;
67466
67489
  /**
67467
67490
  * Helper method to handle Zod validation errors
67468
67491
  * @param error The Zod error to handle
package/dist/index.d.ts CHANGED
@@ -16836,7 +16836,7 @@ declare abstract class BaseProvider<TMcpResponse> {
16836
16836
  /**
16837
16837
  * @public
16838
16838
  * Global function to execute a tool.
16839
- * This function is used by providerds to implement helper functions to execute tools.
16839
+ * This function is used by providers to implement helper functions to execute tools.
16840
16840
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
16841
16841
  * @param {string} toolSlug - The slug of the tool to execute.
16842
16842
  * @param {ToolExecuteParams} body - The body of the tool execution.
@@ -17172,6 +17172,14 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
17172
17172
  * ```
17173
17173
  */
17174
17174
  get<T extends TProvider>(userId: string, slug: string, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
17175
+ /**
17176
+ * @internal
17177
+ * Creates a global execute tool function.
17178
+ * This function is used by providers to execute tools.
17179
+ * It skips the version check for provider controlled execution.
17180
+ * @returns {GlobalExecuteToolFn} The global execute tool function
17181
+ */
17182
+ private createExecuteFnForProviders;
17175
17183
  /**
17176
17184
  * @internal
17177
17185
  * @description
@@ -67383,9 +67391,9 @@ declare const logger: Logger;
67383
67391
  interface ErrorHandleOptions {
67384
67392
  /** Whether to include the stack trace in the output */
67385
67393
  includeStack?: boolean;
67386
- /** Whether to exit the process after handling */
67394
+ /** @deprecated Use ComposioError.handleAndThrow() instead. This option will be removed in a future version. */
67387
67395
  exitProcess?: boolean;
67388
- /** The exit code to use if exiting the process */
67396
+ /** @deprecated This option is no longer used. */
67389
67397
  exitCode?: number;
67390
67398
  }
67391
67399
  /**
@@ -67458,11 +67466,26 @@ declare class ComposioError extends Error {
67458
67466
  static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError;
67459
67467
  /**
67460
67468
  * Utility function to handle errors in a consistent way
67461
- * This properly displays the error and exits the process if needed
67469
+ * This properly displays the error without throwing
67462
67470
  * @param error The error to handle
67463
67471
  * @param options Options for error handling
67464
67472
  */
67465
67473
  static handle(error: unknown, options?: ErrorHandleOptions): void;
67474
+ /**
67475
+ * Utility function to handle errors and then throw them
67476
+ * This properly displays the error and then throws it, allowing callers to catch it.
67477
+ * Use this for fatal errors that should stop execution.
67478
+ * @param error The error to handle and throw
67479
+ * @param includeStack Whether to include the stack trace in the output
67480
+ * @throws ComposioError - Always throws after displaying the error
67481
+ */
67482
+ static handleAndThrow(error: unknown, includeStack?: boolean): never;
67483
+ /**
67484
+ * Helper method to throw an error as a ComposioError
67485
+ * @param error The error to throw
67486
+ * @private
67487
+ */
67488
+ private static throwError;
67466
67489
  /**
67467
67490
  * Helper method to handle Zod validation errors
67468
67491
  * @param error The Zod error to handle
package/dist/index.js CHANGED
@@ -1031,12 +1031,12 @@ ${originalStackBody}`;
1031
1031
  }
1032
1032
  /**
1033
1033
  * Utility function to handle errors in a consistent way
1034
- * This properly displays the error and exits the process if needed
1034
+ * This properly displays the error without throwing
1035
1035
  * @param error The error to handle
1036
1036
  * @param options Options for error handling
1037
1037
  */
1038
1038
  static handle(error, options = {}) {
1039
- const { includeStack = false, exitProcess = false, exitCode = 1 } = options;
1039
+ const { includeStack = false, exitProcess = false } = options;
1040
1040
  if (error instanceof _ComposioError) {
1041
1041
  error.prettyPrint(includeStack);
1042
1042
  } else if (error instanceof ZodError) {
@@ -1046,8 +1046,34 @@ ${originalStackBody}`;
1046
1046
  } else {
1047
1047
  this.handleUnknownError(error);
1048
1048
  }
1049
- if (exitProcess && typeof process !== "undefined") {
1050
- process.exit(exitCode);
1049
+ if (exitProcess) {
1050
+ this.throwError(error);
1051
+ }
1052
+ }
1053
+ /**
1054
+ * Utility function to handle errors and then throw them
1055
+ * This properly displays the error and then throws it, allowing callers to catch it.
1056
+ * Use this for fatal errors that should stop execution.
1057
+ * @param error The error to handle and throw
1058
+ * @param includeStack Whether to include the stack trace in the output
1059
+ * @throws ComposioError - Always throws after displaying the error
1060
+ */
1061
+ static handleAndThrow(error, includeStack = false) {
1062
+ this.handle(error, { includeStack });
1063
+ this.throwError(error);
1064
+ }
1065
+ /**
1066
+ * Helper method to throw an error as a ComposioError
1067
+ * @param error The error to throw
1068
+ * @private
1069
+ */
1070
+ static throwError(error) {
1071
+ if (error instanceof _ComposioError) {
1072
+ throw error;
1073
+ } else if (error instanceof Error) {
1074
+ throw new _ComposioError(error.message, { cause: error });
1075
+ } else {
1076
+ throw new _ComposioError(String(error));
1051
1077
  }
1052
1078
  }
1053
1079
  /**
@@ -2597,15 +2623,7 @@ var Tools = class {
2597
2623
  this.autoUploadDownloadFiles = config?.autoUploadDownloadFiles ?? true;
2598
2624
  this.toolkitVersions = config?.toolkitVersions ?? "latest";
2599
2625
  this.execute = this.execute.bind(this);
2600
- const providerExecuteToolFn = this.provider._isAgentic ? this.execute : (slug, body, modifiers) => this.execute(
2601
- slug,
2602
- {
2603
- ...body,
2604
- dangerouslySkipVersionCheck: body.dangerouslySkipVersionCheck ?? true
2605
- },
2606
- modifiers
2607
- );
2608
- this.provider._setExecuteToolFn(providerExecuteToolFn);
2626
+ this.provider._setExecuteToolFn(this.createExecuteFnForProviders());
2609
2627
  this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
2610
2628
  this.getRawComposioTools = this.getRawComposioTools.bind(this);
2611
2629
  telemetry.instrument(this, "Tools");
@@ -2964,6 +2982,22 @@ var Tools = class {
2964
2982
  return this.provider.wrapTools(tools, executeToolFn);
2965
2983
  }
2966
2984
  }
2985
+ /**
2986
+ * @internal
2987
+ * Creates a global execute tool function.
2988
+ * This function is used by providers to execute tools.
2989
+ * It skips the version check for provider controlled execution.
2990
+ * @returns {GlobalExecuteToolFn} The global execute tool function
2991
+ */
2992
+ createExecuteFnForProviders() {
2993
+ return async (slug, body, modifiers) => {
2994
+ return await this.execute(
2995
+ slug,
2996
+ { ...body, dangerouslySkipVersionCheck: body.dangerouslySkipVersionCheck ?? true },
2997
+ modifiers
2998
+ );
2999
+ };
3000
+ }
2967
3001
  /**
2968
3002
  * @internal
2969
3003
  * @description
@@ -2981,7 +3015,7 @@ var Tools = class {
2981
3015
  {
2982
3016
  userId,
2983
3017
  arguments: input,
2984
- // dangerously skip version check for agentic and non agentic tool execution via providers
3018
+ // dangerously skip version check for agentic tool execution via providers
2985
3019
  // this can be safe because most agentic flows users fetch latest version and then execute the tool
2986
3020
  dangerouslySkipVersionCheck: true
2987
3021
  },
@@ -6637,9 +6671,7 @@ function getSDKConfig(baseUrl, apiKey) {
6637
6671
  const baseURLParsed = baseUrl || getEnvVariable("COMPOSIO_BASE_URL") || baseURLFromUserConfig || DEFAULT_BASE_URL;
6638
6672
  const apiKeyParsed = apiKey || getEnvVariable("COMPOSIO_API_KEY") || apiKeyFromUserConfig || "";
6639
6673
  if (!apiKeyParsed) {
6640
- ComposioError.handle(new ComposioNoAPIKeyError(), {
6641
- exitProcess: true
6642
- });
6674
+ ComposioError.handleAndThrow(new ComposioNoAPIKeyError());
6643
6675
  }
6644
6676
  logger_default.debug("Environment", `API Key: ${apiKeyParsed}`);
6645
6677
  logger_default.debug("Environment", `Base URL: ${baseURLParsed}`);
@@ -6715,7 +6747,7 @@ var BaseProvider = class {
6715
6747
  /**
6716
6748
  * @public
6717
6749
  * Global function to execute a tool.
6718
- * This function is used by providerds to implement helper functions to execute tools.
6750
+ * This function is used by providers to implement helper functions to execute tools.
6719
6751
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
6720
6752
  * @param {string} toolSlug - The slug of the tool to execute.
6721
6753
  * @param {ToolExecuteParams} body - The body of the tool execution.
@@ -7191,7 +7223,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
7191
7223
  };
7192
7224
 
7193
7225
  // package.json
7194
- var version = "0.2.5";
7226
+ var version = "0.2.6";
7195
7227
 
7196
7228
  // src/models/Files.ts
7197
7229
  var Files = class {
@@ -7430,15 +7462,16 @@ var Composio = class _Composio {
7430
7462
  if (IS_DEVELOPMENT_OR_CI) {
7431
7463
  logger_default.debug(`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}`);
7432
7464
  }
7465
+ this.provider = config?.provider ?? new OpenAIProvider();
7433
7466
  this.config = {
7434
7467
  ...config,
7435
7468
  baseURL: baseURLParsed,
7436
7469
  apiKey: apiKeyParsed,
7437
7470
  toolkitVersions: getToolkitVersionsFromEnv(config?.toolkitVersions),
7438
7471
  allowTracking: config?.allowTracking ?? true,
7439
- autoUploadDownloadFiles: config?.autoUploadDownloadFiles ?? true
7472
+ autoUploadDownloadFiles: config?.autoUploadDownloadFiles ?? true,
7473
+ provider: config?.provider ?? this.provider
7440
7474
  };
7441
- this.provider = config?.provider ?? new OpenAIProvider();
7442
7475
  const defaultHeaders = getDefaultHeaders(this.config.defaultHeaders, this.provider);
7443
7476
  this.client = new ComposioClient4({
7444
7477
  apiKey: apiKeyParsed,
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Map of Composio's ABLY toolkit.
3
+ */
4
+ export const ABLY = {
5
+ slug: "ably",
6
+ tools: {
7
+ BATCH_PRESENCE: "ABLY_BATCH_PRESENCE",
8
+ BATCH_PRESENCE_HISTORY: "ABLY_BATCH_PRESENCE_HISTORY",
9
+ CREATE_CHANNEL: "ABLY_CREATE_CHANNEL",
10
+ DELETE_CHANNEL_SUBSCRIPTION: "ABLY_DELETE_CHANNEL_SUBSCRIPTION",
11
+ GET_CHANNEL_DETAILS: "ABLY_GET_CHANNEL_DETAILS",
12
+ GET_CHANNEL_HISTORY: "ABLY_GET_CHANNEL_HISTORY",
13
+ GET_PRESENCE_HISTORY: "ABLY_GET_PRESENCE_HISTORY",
14
+ GET_SERVICE_TIME: "ABLY_GET_SERVICE_TIME",
15
+ GET_STATS: "ABLY_GET_STATS",
16
+ LIST_PUSH_CHANNEL_SUBSCRIPTIONS: "ABLY_LIST_PUSH_CHANNEL_SUBSCRIPTIONS",
17
+ PUBLISH_MESSAGE_TO_CHANNEL: "ABLY_PUBLISH_MESSAGE_TO_CHANNEL",
18
+ },
19
+ triggerTypes: {},
20
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Map of Composio's ACCELO toolkit.
3
+ */
4
+ export const ACCELO = {
5
+ slug: "accelo",
6
+ tools: {},
7
+ triggerTypes: {},
8
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Map of Composio's ACCULYNX toolkit.
3
+ */
4
+ export const ACCULYNX = {
5
+ slug: "acculynx",
6
+ tools: {
7
+ ADD_JOB_APPOINTMENT: "ACCULYNX_ADD_JOB_APPOINTMENT",
8
+ CREATE_A_CONTACT: "ACCULYNX_CREATE_A_CONTACT",
9
+ CREATE_A_JOB: "ACCULYNX_CREATE_A_JOB",
10
+ CREATE_A_LEAD: "ACCULYNX_CREATE_A_LEAD",
11
+ JOB_APPOINTMENT_SUMMARY: "ACCULYNX_JOB_APPOINTMENT_SUMMARY",
12
+ LIST_OF_CALENDARS_FOR_THE_LOCATION: "ACCULYNX_LIST_OF_CALENDARS_FOR_THE_LOCATION",
13
+ LIST_OF_CONTACT_TYPES_RELATED_TO_THE_COMPANY: "ACCULYNX_LIST_OF_CONTACT_TYPES_RELATED_TO_THE_COMPANY",
14
+ UPDATE_COMPANY_REPRESENTATIVE: "ACCULYNX_UPDATE_COMPANY_REPRESENTATIVE",
15
+ },
16
+ triggerTypes: {},
17
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Map of Composio's ACTIVE_CAMPAIGN toolkit.
3
+ */
4
+ export const ACTIVE_CAMPAIGN = {
5
+ slug: "active_campaign",
6
+ tools: {
7
+ ADD_CONTACT_NOTE: "ACTIVE_CAMPAIGN_ADD_CONTACT_NOTE",
8
+ ADD_CONTACT_TO_AUTOMATION: "ACTIVE_CAMPAIGN_ADD_CONTACT_TO_AUTOMATION",
9
+ ADD_SECONDARY_CONTACT_TO_DEAL: "ACTIVE_CAMPAIGN_ADD_SECONDARY_CONTACT_TO_DEAL",
10
+ CREATE_ACCOUNT: "ACTIVE_CAMPAIGN_CREATE_ACCOUNT",
11
+ CREATE_CONTACT: "ACTIVE_CAMPAIGN_CREATE_CONTACT",
12
+ CREATE_CONTACT_TASK: "ACTIVE_CAMPAIGN_CREATE_CONTACT_TASK",
13
+ CREATE_DEAL_PIPELINE: "ACTIVE_CAMPAIGN_CREATE_DEAL_PIPELINE",
14
+ CREATE_DEAL_TASK_TYPE: "ACTIVE_CAMPAIGN_CREATE_DEAL_TASK_TYPE",
15
+ DELETE_ACCOUNT: "ACTIVE_CAMPAIGN_DELETE_ACCOUNT",
16
+ DELETE_DEAL_PIPELINE: "ACTIVE_CAMPAIGN_DELETE_DEAL_PIPELINE",
17
+ DELETE_DEAL_STAGE: "ACTIVE_CAMPAIGN_DELETE_DEAL_STAGE",
18
+ FIND_CONTACT: "ACTIVE_CAMPAIGN_FIND_CONTACT",
19
+ FIND_CONTACT_TASK: "ACTIVE_CAMPAIGN_FIND_CONTACT_TASK",
20
+ FIND_USER_ACTION: "ACTIVE_CAMPAIGN_FIND_USER_ACTION",
21
+ LIST_ALL_CONTACTS: "ACTIVE_CAMPAIGN_LIST_ALL_CONTACTS",
22
+ MANAGE_CONTACT_TAG: "ACTIVE_CAMPAIGN_MANAGE_CONTACT_TAG",
23
+ MANAGE_LIST_SUBSCRIPTION: "ACTIVE_CAMPAIGN_MANAGE_LIST_SUBSCRIPTION",
24
+ REMOVE_CONTACT_FROM_AUTOMATION: "ACTIVE_CAMPAIGN_REMOVE_CONTACT_FROM_AUTOMATION",
25
+ TRACK_EVENT: "ACTIVE_CAMPAIGN_TRACK_EVENT",
26
+ UPDATE_ACCOUNT: "ACTIVE_CAMPAIGN_UPDATE_ACCOUNT",
27
+ UPSERT_ACCOUNT: "ACTIVE_CAMPAIGN_UPSERT_ACCOUNT",
28
+ },
29
+ triggerTypes: {},
30
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Map of Composio's ADOBE toolkit.
3
+ */
4
+ export const ADOBE = {
5
+ slug: "adobe",
6
+ tools: {},
7
+ triggerTypes: {},
8
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Map of Composio's ADYNTEL toolkit.
3
+ */
4
+ export const ADYNTEL = {
5
+ slug: "adyntel",
6
+ tools: {
7
+ GET_GOOGLE_ADS_BY_COMPANY: "ADYNTEL_GET_GOOGLE_ADS_BY_COMPANY",
8
+ META_AD_SEARCH: "ADYNTEL_META_AD_SEARCH",
9
+ SEARCH_TIK_TOK_ADS: "ADYNTEL_SEARCH_TIK_TOK_ADS",
10
+ },
11
+ triggerTypes: {},
12
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Map of Composio's AERO_WORKFLOW toolkit.
3
+ */
4
+ export const AERO_WORKFLOW = {
5
+ slug: "aero_workflow",
6
+ tools: {},
7
+ triggerTypes: {},
8
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Map of Composio's AFFINITY toolkit.
3
+ */
4
+ export const AFFINITY = {
5
+ slug: "affinity",
6
+ tools: {
7
+ GET_ALL_COMPANIES: "AFFINITY_GET_ALL_COMPANIES",
8
+ GET_ALL_LIST_ENTRIES_ON_A_LIST: "AFFINITY_GET_ALL_LIST_ENTRIES_ON_A_LIST",
9
+ GET_ALL_LIST_ENTRIES_ON_A_SAVED_VIEW: "AFFINITY_GET_ALL_LIST_ENTRIES_ON_A_SAVED_VIEW",
10
+ GET_ALL_OPPORTUNITIES: "AFFINITY_GET_ALL_OPPORTUNITIES",
11
+ GET_ALL_PERSONS: "AFFINITY_GET_ALL_PERSONS",
12
+ GET_A_COMPANY_S_LISTS: "AFFINITY_GET_A_COMPANY_S_LISTS",
13
+ GET_A_COMPANY_S_LIST_ENTRIES: "AFFINITY_GET_A_COMPANY_S_LIST_ENTRIES",
14
+ GET_A_PERSON_S_LISTS: "AFFINITY_GET_A_PERSON_S_LISTS",
15
+ GET_A_PERSON_S_LIST_ENTRIES: "AFFINITY_GET_A_PERSON_S_LIST_ENTRIES",
16
+ GET_A_SINGLE_COMPANY: "AFFINITY_GET_A_SINGLE_COMPANY",
17
+ GET_A_SINGLE_OPPORTUNITY: "AFFINITY_GET_A_SINGLE_OPPORTUNITY",
18
+ GET_A_SINGLE_PERSON: "AFFINITY_GET_A_SINGLE_PERSON",
19
+ GET_CURRENT_USER: "AFFINITY_GET_CURRENT_USER",
20
+ GET_METADATA_ON_ALL_LISTS: "AFFINITY_GET_METADATA_ON_ALL_LISTS",
21
+ GET_METADATA_ON_A_SINGLE_LIST: "AFFINITY_GET_METADATA_ON_A_SINGLE_LIST",
22
+ GET_METADATA_ON_A_SINGLE_LIST_S_FIELDS: "AFFINITY_GET_METADATA_ON_A_SINGLE_LIST_S_FIELDS",
23
+ GET_METADATA_ON_A_SINGLE_SAVED_VIEW: "AFFINITY_GET_METADATA_ON_A_SINGLE_SAVED_VIEW",
24
+ GET_METADATA_ON_COMPANY_FIELDS: "AFFINITY_GET_METADATA_ON_COMPANY_FIELDS",
25
+ GET_METADATA_ON_PERSON_FIELDS: "AFFINITY_GET_METADATA_ON_PERSON_FIELDS",
26
+ GET_METADATA_ON_SAVED_VIEWS: "AFFINITY_GET_METADATA_ON_SAVED_VIEWS",
27
+ },
28
+ triggerTypes: {},
29
+ }