@composio/core 0.8.0 → 0.9.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 (355) hide show
  1. package/dist/{CustomTool-DCrZcOUW.d.cts → CustomTool-87USJ2u0.d.cts} +1 -1
  2. package/dist/{CustomTool-DJVmDusu.d.mts → CustomTool-BNxqr6BI.d.mts} +1 -1
  3. package/dist/{CustomTool-CVwF_isu.mjs → CustomTool-DOE7hgw6.mjs} +232 -27
  4. package/dist/{CustomTool-DnCSEC6t.cjs → CustomTool-Dj4fNvsu.cjs} +279 -26
  5. package/dist/{composio-DH5gDW5F.d.mts → composio-BJW2NaoA.d.mts} +110 -79
  6. package/dist/{composio-Dzaqn_PS.d.cts → composio-DTntXzL-.d.cts} +110 -79
  7. package/dist/{customTool.types-Xk-tbwbc.d.mts → customTool.types-B3HG185y.d.mts} +401 -32
  8. package/dist/{customTool.types-BqC41wRt.d.cts → customTool.types-Bd8ylotX.d.cts} +401 -32
  9. package/dist/experimental/index.cjs +1 -1
  10. package/dist/experimental/index.d.cts +2 -2
  11. package/dist/experimental/index.d.mts +3 -3
  12. package/dist/experimental/index.mjs +1 -1
  13. package/dist/index.cjs +574 -85
  14. package/dist/index.d.cts +84 -8
  15. package/dist/index.d.mts +84 -8
  16. package/dist/index.mjs +570 -88
  17. package/dist/{tool.types-Cb-o48UU.d.mts → tool.types-CB_4JKhV.d.mts} +601 -38
  18. package/dist/{tool.types-B4k2Bnxc.d.cts → tool.types-CwbAy9l_.d.cts} +601 -38
  19. package/dist/{types-BR-1DJRJ.d.mts → types-BClz5lKM.d.mts} +2 -2
  20. package/dist/{types-gjJ_hDol.d.cts → types-jsOgjrWN.d.cts} +2 -2
  21. package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +2 -2
  22. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +4 -4
  23. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +2 -2
  24. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +4 -4
  25. package/dist/utils/modifiers/FileToolModifier.node.d.cts +1 -1
  26. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  27. package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +1 -1
  28. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  29. package/package.json +2 -2
  30. package/generated/ably.ts +0 -20
  31. package/generated/accelo.ts +0 -8
  32. package/generated/acculynx.ts +0 -17
  33. package/generated/active_campaign.ts +0 -30
  34. package/generated/adobe.ts +0 -8
  35. package/generated/adyntel.ts +0 -12
  36. package/generated/aero_workflow.ts +0 -8
  37. package/generated/affinity.ts +0 -29
  38. package/generated/agencyzoom.ts +0 -108
  39. package/generated/ahrefs.ts +0 -49
  40. package/generated/airtable.ts +0 -26
  41. package/generated/alchemy.ts +0 -16
  42. package/generated/algolia.ts +0 -39
  43. package/generated/altoviz.ts +0 -18
  44. package/generated/amazon.ts +0 -8
  45. package/generated/amcards.ts +0 -11
  46. package/generated/amplitude.ts +0 -25
  47. package/generated/anthropic_administrator.ts +0 -13
  48. package/generated/apaleo.ts +0 -38
  49. package/generated/apollo.ts +0 -40
  50. package/generated/appdrag.ts +0 -8
  51. package/generated/appsflyer.ts +0 -8
  52. package/generated/asana.ts +0 -95
  53. package/generated/ashby.ts +0 -8
  54. package/generated/atlassian.ts +0 -8
  55. package/generated/attio.ts +0 -20
  56. package/generated/auth0.ts +0 -8
  57. package/generated/axonaut.ts +0 -8
  58. package/generated/bamboohr.ts +0 -168
  59. package/generated/bannerbear.ts +0 -17
  60. package/generated/baserow.ts +0 -11
  61. package/generated/battlenet.ts +0 -8
  62. package/generated/beeminder.ts +0 -14
  63. package/generated/bigmailer.ts +0 -12
  64. package/generated/bigml.ts +0 -15
  65. package/generated/bill.ts +0 -218
  66. package/generated/bitbucket.ts +0 -25
  67. package/generated/bitwarden.ts +0 -8
  68. package/generated/blackbaud.ts +0 -8
  69. package/generated/blackboard.ts +0 -323
  70. package/generated/boldsign.ts +0 -8
  71. package/generated/bolna.ts +0 -24
  72. package/generated/borneo.ts +0 -162
  73. package/generated/botbaba.ts +0 -8
  74. package/generated/box.ts +0 -282
  75. package/generated/braintree.ts +0 -8
  76. package/generated/brandfetch.ts +0 -15
  77. package/generated/breezy_hr.ts +0 -8
  78. package/generated/brevo.ts +0 -28
  79. package/generated/brex.ts +0 -8
  80. package/generated/brex_staging.ts +0 -8
  81. package/generated/brightpearl.ts +0 -8
  82. package/generated/brilliant_directories.ts +0 -15
  83. package/generated/browseai.ts +0 -18
  84. package/generated/browserbase_tool.ts +0 -10
  85. package/generated/browserhub.ts +0 -8
  86. package/generated/browserless.ts +0 -16
  87. package/generated/bubble.ts +0 -8
  88. package/generated/bugbug.ts +0 -13
  89. package/generated/builtwith.ts +0 -21
  90. package/generated/cal.ts +0 -150
  91. package/generated/calendly.ts +0 -51
  92. package/generated/canva.ts +0 -41
  93. package/generated/canvas.ts +0 -100
  94. package/generated/chatwork.ts +0 -17
  95. package/generated/chmeetings.ts +0 -8
  96. package/generated/clickup.ts +0 -153
  97. package/generated/clockify.ts +0 -23
  98. package/generated/close.ts +0 -15
  99. package/generated/cloudflare.ts +0 -10
  100. package/generated/coda.ts +0 -115
  101. package/generated/codeinterpreter.ts +0 -14
  102. package/generated/coinbase.ts +0 -15
  103. package/generated/coinmarketcal.ts +0 -8
  104. package/generated/composio.ts +0 -34
  105. package/generated/composio_search.ts +0 -22
  106. package/generated/confluence.ts +0 -199
  107. package/generated/contentful.ts +0 -12
  108. package/generated/crustdata.ts +0 -23
  109. package/generated/customer_io.ts +0 -8
  110. package/generated/cutt_ly.ts +0 -10
  111. package/generated/d2lbrightspace.ts +0 -54
  112. package/generated/dailybot.ts +0 -15
  113. package/generated/datadog.ts +0 -47
  114. package/generated/datagma.ts +0 -8
  115. package/generated/datarobot.ts +0 -8
  116. package/generated/deel.ts +0 -8
  117. package/generated/demio.ts +0 -8
  118. package/generated/dialpad.ts +0 -201
  119. package/generated/digicert.ts +0 -15
  120. package/generated/discord.ts +0 -17
  121. package/generated/discordbot.ts +0 -173
  122. package/generated/docmosis.ts +0 -8
  123. package/generated/docusign.ts +0 -351
  124. package/generated/dropbox.ts +0 -20
  125. package/generated/dropbox_sign.ts +0 -8
  126. package/generated/dynamics365.ts +0 -25
  127. package/generated/echtpost.ts +0 -10
  128. package/generated/elevenlabs.ts +0 -70
  129. package/generated/emailoctopus.ts +0 -16
  130. package/generated/enigma.ts +0 -11
  131. package/generated/entelligence.ts +0 -11
  132. package/generated/epic_games.ts +0 -8
  133. package/generated/eventbrite.ts +0 -12
  134. package/generated/exa.ts +0 -13
  135. package/generated/excel.ts +0 -34
  136. package/generated/exist.ts +0 -8
  137. package/generated/facebook.ts +0 -8
  138. package/generated/factorial.ts +0 -8
  139. package/generated/figma.ts +0 -59
  140. package/generated/finage.ts +0 -19
  141. package/generated/firecrawl.ts +0 -16
  142. package/generated/fireflies.ts +0 -21
  143. package/generated/fitbit.ts +0 -8
  144. package/generated/flutterwave.ts +0 -33
  145. package/generated/fomo.ts +0 -10
  146. package/generated/formcarry.ts +0 -10
  147. package/generated/formsite.ts +0 -14
  148. package/generated/foursquare.ts +0 -14
  149. package/generated/freshbooks.ts +0 -11
  150. package/generated/freshdesk.ts +0 -16
  151. package/generated/front.ts +0 -8
  152. package/generated/github.ts +0 -967
  153. package/generated/gitlab.ts +0 -82
  154. package/generated/gmail.d.ts +0 -86
  155. package/generated/gmail.js +0 -13
  156. package/generated/gmail.ts +0 -95
  157. package/generated/go_to_webinar.ts +0 -8
  158. package/generated/gong.ts +0 -63
  159. package/generated/google_analytics.ts +0 -13
  160. package/generated/google_maps.ts +0 -16
  161. package/generated/googleads.ts +0 -14
  162. package/generated/googlebigquery.ts +0 -10
  163. package/generated/googlecalendar.ts +0 -39
  164. package/generated/googledocs.ts +0 -41
  165. package/generated/googledrive.ts +0 -62
  166. package/generated/googlemeet.ts +0 -18
  167. package/generated/googlephotos.ts +0 -22
  168. package/generated/googlesheets.ts +0 -40
  169. package/generated/googleslides.ts +0 -8
  170. package/generated/googlesuper.ts +0 -230
  171. package/generated/googletasks.ts +0 -23
  172. package/generated/gorgias.ts +0 -41
  173. package/generated/gumroad.ts +0 -14
  174. package/generated/guru.ts +0 -8
  175. package/generated/hackernews.ts +0 -15
  176. package/generated/hackerrank_work.ts +0 -8
  177. package/generated/harvest.ts +0 -56
  178. package/generated/helcim.ts +0 -8
  179. package/generated/heygen.ts +0 -44
  180. package/generated/highlevel.ts +0 -8
  181. package/generated/hubspot.ts +0 -252
  182. package/generated/humanloop.ts +0 -13
  183. package/generated/icims_talent_cloud.ts +0 -8
  184. package/generated/idea_scale.ts +0 -8
  185. package/generated/index.ts +0 -151
  186. package/generated/insighto_ai.ts +0 -19
  187. package/generated/intercom.ts +0 -52
  188. package/generated/interzoid.ts +0 -8
  189. package/generated/jira.ts +0 -59
  190. package/generated/jotform.ts +0 -15
  191. package/generated/junglescout.ts +0 -15
  192. package/generated/keap.ts +0 -8
  193. package/generated/kibana.ts +0 -58
  194. package/generated/kit.ts +0 -38
  195. package/generated/klaviyo.ts +0 -240
  196. package/generated/klipfolio.ts +0 -20
  197. package/generated/kommo.ts +0 -24
  198. package/generated/lastpass.ts +0 -8
  199. package/generated/launch_darkly.ts +0 -16
  200. package/generated/leadfeeder.ts +0 -13
  201. package/generated/leadoku.ts +0 -10
  202. package/generated/lever.ts +0 -8
  203. package/generated/lever_sandbox.ts +0 -8
  204. package/generated/lexoffice.ts +0 -8
  205. package/generated/linear.ts +0 -31
  206. package/generated/linkedin.ts +0 -13
  207. package/generated/linkhut.ts +0 -14
  208. package/generated/linkup.ts +0 -11
  209. package/generated/listennotes.ts +0 -35
  210. package/generated/lmnt.ts +0 -16
  211. package/generated/lodgify.ts +0 -10
  212. package/generated/mailchimp.ts +0 -285
  213. package/generated/mailerlite.ts +0 -8
  214. package/generated/maintainx.ts +0 -20
  215. package/generated/make.ts +0 -12
  216. package/generated/mboum.ts +0 -8
  217. package/generated/mem0.ts +0 -52
  218. package/generated/metaads.ts +0 -25
  219. package/generated/metatextai.ts +0 -8
  220. package/generated/microsoft_clarity.ts +0 -10
  221. package/generated/microsoft_teams.ts +0 -22
  222. package/generated/microsoft_tenant.ts +0 -8
  223. package/generated/miro.ts +0 -23
  224. package/generated/mixpanel.ts +0 -30
  225. package/generated/mocean.ts +0 -8
  226. package/generated/monday.ts +0 -30
  227. package/generated/mopinion.ts +0 -8
  228. package/generated/more_trees.ts +0 -10
  229. package/generated/moxie.ts +0 -8
  230. package/generated/moz.ts +0 -8
  231. package/generated/mural.ts +0 -14
  232. package/generated/nasdaq.ts +0 -15
  233. package/generated/ncscale.ts +0 -8
  234. package/generated/neon.ts +0 -78
  235. package/generated/netsuite.ts +0 -8
  236. package/generated/nextdns.ts +0 -11
  237. package/generated/ngrok.ts +0 -18
  238. package/generated/notion.ts +0 -40
  239. package/generated/oncehub.ts +0 -8
  240. package/generated/one_drive.ts +0 -49
  241. package/generated/onepage.ts +0 -11
  242. package/generated/open_sea.ts +0 -33
  243. package/generated/outlook.ts +0 -37
  244. package/generated/pagerduty.ts +0 -362
  245. package/generated/pandadoc.ts +0 -23
  246. package/generated/peopledatalabs.ts +0 -24
  247. package/generated/perplexityai.ts +0 -10
  248. package/generated/piggy.ts +0 -8
  249. package/generated/pipedrive.ts +0 -288
  250. package/generated/placekey.ts +0 -12
  251. package/generated/posthog.ts +0 -367
  252. package/generated/precoro.ts +0 -8
  253. package/generated/printnode.ts +0 -8
  254. package/generated/process_street.ts +0 -14
  255. package/generated/productboard.ts +0 -8
  256. package/generated/qualaroo.ts +0 -8
  257. package/generated/quickbooks.ts +0 -22
  258. package/generated/rafflys.ts +0 -8
  259. package/generated/ragic.ts +0 -10
  260. package/generated/ramp.ts +0 -17
  261. package/generated/ravenseotools.ts +0 -8
  262. package/generated/recallai.ts +0 -17
  263. package/generated/reddit.ts +0 -19
  264. package/generated/resend.ts +0 -27
  265. package/generated/retellai.ts +0 -19
  266. package/generated/retently.ts +0 -24
  267. package/generated/ring_central.ts +0 -8
  268. package/generated/rippling.ts +0 -8
  269. package/generated/rocket_reach.ts +0 -8
  270. package/generated/rocketlane.ts +0 -42
  271. package/generated/rootly.ts +0 -12
  272. package/generated/rosette_text_analytics.ts +0 -12
  273. package/generated/sage.ts +0 -8
  274. package/generated/salesforce.ts +0 -46
  275. package/generated/scrape_do.ts +0 -28
  276. package/generated/scrapingant.ts +0 -14
  277. package/generated/screenshotone.ts +0 -10
  278. package/generated/seismic.ts +0 -8
  279. package/generated/semanticscholar.ts +0 -23
  280. package/generated/semrush.ts +0 -45
  281. package/generated/sendgrid.ts +0 -384
  282. package/generated/sentry.ts +0 -185
  283. package/generated/serpapi.ts +0 -32
  284. package/generated/servicem8.ts +0 -37
  285. package/generated/servicenow.ts +0 -14
  286. package/generated/share_point.ts +0 -15
  287. package/generated/shopify.ts +0 -37
  288. package/generated/shortcut.ts +0 -131
  289. package/generated/simplesat.ts +0 -11
  290. package/generated/slack.d.ts +0 -16
  291. package/generated/slack.js +0 -11
  292. package/generated/slack.ts +0 -24
  293. package/generated/slackbot.ts +0 -205
  294. package/generated/smartrecruiters.ts +0 -8
  295. package/generated/smugmug.ts +0 -14
  296. package/generated/snowflake.ts +0 -15
  297. package/generated/sourcegraph.ts +0 -16
  298. package/generated/square.ts +0 -8
  299. package/generated/stack_exchange.ts +0 -17
  300. package/generated/starton.ts +0 -11
  301. package/generated/storeganise.ts +0 -12
  302. package/generated/stripe.ts +0 -50
  303. package/generated/supabase.ts +0 -86
  304. package/generated/survey_monkey.ts +0 -8
  305. package/generated/tally.ts +0 -25
  306. package/generated/tapfiliate.ts +0 -11
  307. package/generated/tapform.ts +0 -8
  308. package/generated/tavily.ts +0 -10
  309. package/generated/terminus.ts +0 -8
  310. package/generated/text_to_pdf.ts +0 -10
  311. package/generated/textrazor.ts +0 -22
  312. package/generated/timecamp.ts +0 -10
  313. package/generated/timekit.ts +0 -8
  314. package/generated/timely.ts +0 -11
  315. package/generated/tinypng.ts +0 -15
  316. package/generated/tinyurl.ts +0 -10
  317. package/generated/tisane.ts +0 -15
  318. package/generated/todoist.ts +0 -19
  319. package/generated/toneden.ts +0 -8
  320. package/generated/tpscheck.ts +0 -10
  321. package/generated/trello.ts +0 -360
  322. package/generated/twitch.ts +0 -8
  323. package/generated/twitter.ts +0 -82
  324. package/generated/twitter_media.ts +0 -10
  325. package/generated/typefully.ts +0 -14
  326. package/generated/venly.ts +0 -8
  327. package/generated/vero.ts +0 -8
  328. package/generated/visme.ts +0 -8
  329. package/generated/waboxapp.ts +0 -8
  330. package/generated/wakatime.ts +0 -8
  331. package/generated/wave_accounting.ts +0 -8
  332. package/generated/weathermap.ts +0 -10
  333. package/generated/webex.ts +0 -37
  334. package/generated/webflow.ts +0 -30
  335. package/generated/whatsapp.ts +0 -14
  336. package/generated/wiz.ts +0 -8
  337. package/generated/workiom.ts +0 -12
  338. package/generated/wrike.ts +0 -47
  339. package/generated/xero.ts +0 -13
  340. package/generated/yandex.ts +0 -13
  341. package/generated/ynab.ts +0 -8
  342. package/generated/yousearch.ts +0 -10
  343. package/generated/youtube.ts +0 -26
  344. package/generated/zendesk.ts +0 -23
  345. package/generated/zenrows.ts +0 -25
  346. package/generated/zenserp.ts +0 -20
  347. package/generated/zoho.ts +0 -33
  348. package/generated/zoho_bigin.ts +0 -21
  349. package/generated/zoho_books.ts +0 -8
  350. package/generated/zoho_desk.ts +0 -8
  351. package/generated/zoho_inventory.ts +0 -8
  352. package/generated/zoho_invoice.ts +0 -15
  353. package/generated/zoho_mail.ts +0 -8
  354. package/generated/zoom.ts +0 -181
  355. package/generated/zoominfo.ts +0 -26
@@ -1,4 +1,4 @@
1
- import { a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams } from "./customTool.types-BqC41wRt.cjs";
1
+ import { a as CustomTool, h as CustomToolkit, i as CreateCustomToolkitParams, n as CreateCustomToolParams } from "./customTool.types-Bd8ylotX.cjs";
2
2
  import { z } from "zod/v3";
3
3
  import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
4
4
 
@@ -1,4 +1,4 @@
1
- import { a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams } from "./customTool.types-Xk-tbwbc.mjs";
1
+ import { a as CustomTool, h as CustomToolkit, i as CreateCustomToolkitParams, n as CreateCustomToolParams } from "./customTool.types-B3HG185y.mjs";
2
2
  import { z as z$1 } from "zod/v3";
3
3
  import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
4
4
 
@@ -7,7 +7,8 @@ import * as zodToJsonSchema from "zod-to-json-schema";
7
7
  const ConnectedAccountErrorCodes = {
8
8
  CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND",
9
9
  MULTIPLE_CONNECTED_ACCOUNTS: "MULTIPLE_CONNECTED_ACCOUNTS",
10
- FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK: "FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK"
10
+ FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK: "FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK",
11
+ LEGACY_CONNECTED_ACCOUNTS_ENDPOINT_RETIRED: "LEGACY_CONNECTED_ACCOUNTS_ENDPOINT_RETIRED"
11
12
  };
12
13
  var ComposioConnectedAccountNotFoundError = class extends ComposioError$1 {
13
14
  constructor(message = "Connected account not found", options = {}) {
@@ -39,6 +40,30 @@ var ComposioFailedToCreateConnectedAccountLink = class extends ComposioError$1 {
39
40
  this.name = "ComposioFailedToCreateConnectedAccountLink";
40
41
  }
41
42
  };
43
+ /**
44
+ * Thrown by `composio.connectedAccounts.initiate()` when the legacy
45
+ * `POST /api/v3/connected_accounts` endpoint rejects a Composio-managed
46
+ * OAuth (OAuth1, OAuth2, DCR_OAUTH) auth-config request.
47
+ *
48
+ * The retiring path is being phased out — new orgs from 2026-05-08 and
49
+ * all remaining orgs from 2026-07-03. Migrate the call to
50
+ * `composio.connectedAccounts.link()`, which works for every redirectable
51
+ * scheme regardless of whether the auth config is Composio-managed or
52
+ * custom.
53
+ *
54
+ * See: https://docs.composio.dev/docs/changelog/2026/04/24
55
+ */
56
+ var ComposioLegacyConnectedAccountsEndpointRetiredError = class extends ComposioError$1 {
57
+ constructor(message = "POST /api/v3/connected_accounts is no longer supported for Composio-managed OAuth auth configs. Use composio.connectedAccounts.link() instead.", options = {}) {
58
+ super(message, {
59
+ ...options,
60
+ code: ConnectedAccountErrorCodes.LEGACY_CONNECTED_ACCOUNTS_ENDPOINT_RETIRED,
61
+ statusCode: 400,
62
+ possibleFixes: options.possibleFixes || ["Replace `composio.connectedAccounts.initiate(userId, authConfigId, options)` with `composio.connectedAccounts.link(userId, authConfigId, options)`. The return shape (id, redirectUrl, waitForConnection()) is the same.", "Migration guide: https://docs.composio.dev/docs/changelog/2026/04/24"]
63
+ });
64
+ this.name = "ComposioLegacyConnectedAccountsEndpointRetiredError";
65
+ }
66
+ };
42
67
 
43
68
  //#endregion
44
69
  //#region src/errors/ToolErrors.ts
@@ -292,7 +317,8 @@ var ComposioToolkitFetchError = class extends ComposioError$1 {
292
317
  */
293
318
  const ValidationErrorCodes = {
294
319
  VALIDATION_ERROR: "VALIDATION_ERROR",
295
- JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR"
320
+ JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR",
321
+ JSON_SCHEMA_REF_RESOLUTION_ERROR: "JSON_SCHEMA_REF_RESOLUTION_ERROR"
296
322
  };
297
323
  var ValidationError = class extends ComposioError$1 {
298
324
  constructor(message = "Input validation failed", options = {}) {
@@ -332,6 +358,19 @@ var JsonSchemaToZodError = class extends ComposioError$1 {
332
358
  });
333
359
  }
334
360
  };
361
+ /**
362
+ * Thrown when a JSON Schema `$ref` pointer cannot be resolved against the
363
+ * document. Used by `dereferenceJsonSchema` to surface malformed pointers,
364
+ * missing `$defs`/`definitions` targets, or chains exceeding the depth cap.
365
+ */
366
+ var JsonSchemaRefResolutionError = class extends ComposioError$1 {
367
+ constructor(message = "Failed to resolve JSON Schema $ref", options = {}) {
368
+ super(message, {
369
+ ...options,
370
+ code: options.code || ValidationErrorCodes.JSON_SCHEMA_REF_RESOLUTION_ERROR
371
+ });
372
+ }
373
+ };
335
374
 
336
375
  //#endregion
337
376
  //#region src/errors/SDKErrors.ts
@@ -476,6 +515,10 @@ var RemoteFileDownloadError = class extends ComposioError$1 {
476
515
  }
477
516
  };
478
517
 
518
+ //#endregion
519
+ //#region src/lib/toolRouterConstants.ts
520
+ const PRELOAD_TOOLS_ALL = "all";
521
+
479
522
  //#endregion
480
523
  //#region src/types/customTool.types.ts
481
524
  /**
@@ -492,7 +535,8 @@ const CustomToolSlugSchema = z$1.string().min(1, "slug is required").regex(/^[A-
492
535
  const CreateCustomToolBaseSchema = z$1.object({
493
536
  name: z$1.string().min(1, "createCustomTool: name is required"),
494
537
  description: z$1.string().min(1, "createCustomTool: description is required"),
495
- extendsToolkit: z$1.string().optional()
538
+ extendsToolkit: z$1.string().optional(),
539
+ preload: z$1.boolean().optional().describe("When true, include this custom tool in session.tools() so it can be called without searching first.")
496
540
  });
497
541
  /**
498
542
  * Zod schema for validating the string/scalar fields of createCustomToolkit() options.
@@ -500,7 +544,8 @@ const CreateCustomToolBaseSchema = z$1.object({
500
544
  */
501
545
  const CreateCustomToolkitBaseSchema = z$1.object({
502
546
  name: z$1.string().min(1, "createCustomToolkit: name is required"),
503
- description: z$1.string().min(1, "createCustomToolkit: description is required")
547
+ description: z$1.string().min(1, "createCustomToolkit: description is required"),
548
+ preload: z$1.boolean().optional().describe("When true, include tools from this custom toolkit in session.tools(). Tool-level preload values override this default.")
504
549
  });
505
550
 
506
551
  //#endregion
@@ -614,6 +659,7 @@ function createCustomTool(slug, options) {
614
659
  name: validated.name,
615
660
  description: validated.description,
616
661
  extendsToolkit: validated.extendsToolkit,
662
+ preload: validated.preload,
617
663
  inputSchema,
618
664
  outputSchema,
619
665
  inputParams,
@@ -655,26 +701,103 @@ function createCustomToolkit(slug, options) {
655
701
  slug: slugResult.data,
656
702
  name: validated.name,
657
703
  description: validated.description,
704
+ preload: validated.preload,
658
705
  tools: options.tools
659
706
  };
660
707
  }
661
708
  /**
662
- * Serialize custom tools into the format expected by the backend session creation API.
663
- *
664
- * Maps `extendsToolkit` → `extends_toolkit` for backend. Omitted for standalone tools.
709
+ * Build the final slug for a custom tool given its context.
710
+ * @internal
711
+ */
712
+ function buildFinalSlug(toolSlug, toolkitSlug) {
713
+ const upper = toolSlug.toUpperCase();
714
+ return toolkitSlug ? `${LOCAL_TOOL_PREFIX}${toolkitSlug.toUpperCase()}_${upper}` : `${LOCAL_TOOL_PREFIX}${upper}`;
715
+ }
716
+ const qualifiedOriginalSlugKey = (toolkit, originalSlug) => `${toolkit?.toUpperCase() ?? ""}::${originalSlug.toUpperCase()}`;
717
+ const canShareOriginalSlug = (existing, next) => !!existing.toolkit && !!next.toolkit && existing.toolkit.toLowerCase() !== next.toolkit.toLowerCase();
718
+ const addOriginalSlugAlias = (params) => {
719
+ const originalSlugKey = params.originalSlug.toUpperCase();
720
+ if (params.ambiguousOriginalSlugs.has(originalSlugKey)) return;
721
+ const existing = params.byOriginalSlug.get(originalSlugKey);
722
+ if (!existing) {
723
+ params.byOriginalSlug.set(originalSlugKey, params.entry);
724
+ return;
725
+ }
726
+ if (existing.finalSlug.toUpperCase() === params.entry.finalSlug.toUpperCase()) return;
727
+ if (canShareOriginalSlug(existing, params.entry)) {
728
+ params.byOriginalSlug.delete(originalSlugKey);
729
+ params.ambiguousOriginalSlugs.add(originalSlugKey);
730
+ return;
731
+ }
732
+ throw new ValidationError(`Custom tool slug collision: original slug "${params.originalSlug}" maps to multiple final slugs. "${existing.finalSlug}" and "${params.entry.finalSlug}" both resolve from "${originalSlugKey}".`);
733
+ };
734
+ /**
735
+ * Build a CustomToolsMap from custom tools and toolkits.
736
+ * Used internally by ToolRouter.create() to construct the per-session routing map.
665
737
  *
666
738
  * @internal
667
- * @param tools - The custom tools to serialize
668
- * @returns Array of CustomToolDefinition for the API payload
739
+ * @param tools - Standalone custom tools
740
+ * @param toolkits - Custom toolkits containing grouped tools
741
+ * @returns Maps for O(1) lookup by both final and original slug
742
+ * @throws If duplicate slugs or cross-group collisions
669
743
  */
670
- function serializeCustomTools(tools) {
744
+ function buildCustomToolsMap(tools, toolkits) {
745
+ const byFinalSlug = /* @__PURE__ */ new Map();
746
+ const byOriginalSlug = /* @__PURE__ */ new Map();
747
+ const byToolkitAndOriginalSlug = /* @__PURE__ */ new Map();
748
+ const ambiguousOriginalSlugs = /* @__PURE__ */ new Set();
749
+ const addEntry = (handle, finalSlug, toolkit) => {
750
+ const originalSlug = handle.slug.toUpperCase();
751
+ const finalSlugKey = finalSlug.toUpperCase();
752
+ if (finalSlug.length > MAX_SLUG_LENGTH) throw new ValidationError(`Custom tool slug "${handle.slug}" produces final slug "${finalSlug}" which exceeds ${MAX_SLUG_LENGTH} characters.`);
753
+ if (byFinalSlug.has(finalSlugKey)) throw new ValidationError(`Custom tool slug collision: "${finalSlug}" is already registered.`);
754
+ const qualifiedKey = qualifiedOriginalSlugKey(toolkit, originalSlug);
755
+ if (byToolkitAndOriginalSlug.has(qualifiedKey)) throw new ValidationError(`Custom tool slug collision: original slug "${handle.slug}" is already registered for toolkit "${toolkit ?? "custom"}".`);
756
+ const entry = {
757
+ handle,
758
+ finalSlug,
759
+ toolkit
760
+ };
761
+ byFinalSlug.set(finalSlugKey, entry);
762
+ byToolkitAndOriginalSlug.set(qualifiedKey, entry);
763
+ addOriginalSlugAlias({
764
+ byOriginalSlug,
765
+ ambiguousOriginalSlugs,
766
+ originalSlug,
767
+ entry
768
+ });
769
+ };
770
+ for (const handle of tools) addEntry(handle, buildFinalSlug(handle.slug, handle.extendsToolkit), handle.extendsToolkit);
771
+ if (toolkits) for (const toolkit of toolkits) for (const handle of toolkit.tools) addEntry(handle, buildFinalSlug(handle.slug, toolkit.slug), toolkit.slug);
772
+ return {
773
+ byFinalSlug,
774
+ byOriginalSlug,
775
+ byToolkitAndOriginalSlug,
776
+ ...ambiguousOriginalSlugs.size ? { ambiguousOriginalSlugs } : {},
777
+ toolkits,
778
+ tools: tools.length ? tools : void 0
779
+ };
780
+ }
781
+ function shouldSerializePreload(preload, inheritedPreload, defaultPreload) {
782
+ const inheritedOrDefault = inheritedPreload ?? defaultPreload;
783
+ if (preload !== void 0) return preload || inheritedOrDefault ? preload : void 0;
784
+ if (inheritedPreload !== void 0) return inheritedPreload || defaultPreload ? inheritedPreload : void 0;
785
+ return defaultPreload ? true : void 0;
786
+ }
787
+ function preloadWireProperty(preload, inheritedPreload, defaultPreload) {
788
+ const serializedPreload = shouldSerializePreload(preload, inheritedPreload, defaultPreload);
789
+ return serializedPreload === void 0 ? {} : { preload: serializedPreload };
790
+ }
791
+ function serializeCustomTools(tools, options = {}) {
792
+ const defaultPreload = options.defaultPreload ?? false;
671
793
  return tools.map((handle) => ({
672
794
  slug: handle.slug,
673
795
  name: handle.name,
674
796
  description: handle.description,
675
797
  input_schema: handle.inputSchema,
676
798
  ...handle.outputSchema ? { output_schema: handle.outputSchema } : {},
677
- ...handle.extendsToolkit ? { extends_toolkit: handle.extendsToolkit } : {}
799
+ ...handle.extendsToolkit ? { extends_toolkit: handle.extendsToolkit } : {},
800
+ ...preloadWireProperty(handle.preload, void 0, defaultPreload)
678
801
  }));
679
802
  }
680
803
  /**
@@ -684,17 +807,20 @@ function serializeCustomTools(tools) {
684
807
  * @param toolkits - The custom toolkits to serialize
685
808
  * @returns Array of CustomToolkitDefinition for the API payload
686
809
  */
687
- function serializeCustomToolkits(toolkits) {
810
+ function serializeCustomToolkits(toolkits, options = {}) {
811
+ const defaultPreload = options.defaultPreload ?? false;
688
812
  return toolkits.map((tk) => ({
689
813
  slug: tk.slug,
690
814
  name: tk.name,
691
815
  description: tk.description,
816
+ ...preloadWireProperty(tk.preload, void 0, defaultPreload),
692
817
  tools: tk.tools.map((t) => ({
693
818
  slug: t.slug,
694
819
  name: t.name,
695
820
  description: t.description,
696
821
  input_schema: t.inputSchema,
697
- ...t.outputSchema ? { output_schema: t.outputSchema } : {}
822
+ ...t.outputSchema ? { output_schema: t.outputSchema } : {},
823
+ ...preloadWireProperty(t.preload, tk.preload, defaultPreload)
698
824
  }))
699
825
  }));
700
826
  }
@@ -711,34 +837,113 @@ function serializeCustomToolkits(toolkits) {
711
837
  function buildCustomToolsMapFromResponse(tools, toolkits, experimental) {
712
838
  const byFinalSlug = /* @__PURE__ */ new Map();
713
839
  const byOriginalSlug = /* @__PURE__ */ new Map();
840
+ const byToolkitAndOriginalSlug = /* @__PURE__ */ new Map();
841
+ const ambiguousOriginalSlugs = /* @__PURE__ */ new Set();
842
+ const handlesByQualifiedOriginalSlug = /* @__PURE__ */ new Map();
714
843
  const handlesByOriginalSlug = /* @__PURE__ */ new Map();
715
- for (const handle of tools) handlesByOriginalSlug.set(handle.slug.toUpperCase(), {
716
- handle,
717
- toolkit: handle.extendsToolkit
718
- });
719
- if (toolkits) for (const tk of toolkits) for (const handle of tk.tools) handlesByOriginalSlug.set(handle.slug.toUpperCase(), {
720
- handle,
721
- toolkit: tk.slug
722
- });
844
+ const registerHandle = (handle, toolkit) => {
845
+ const originalSlug = handle.slug.toUpperCase();
846
+ const match = {
847
+ handle,
848
+ toolkit
849
+ };
850
+ handlesByQualifiedOriginalSlug.set(qualifiedOriginalSlugKey(toolkit, originalSlug), match);
851
+ const existing = handlesByOriginalSlug.get(originalSlug) ?? [];
852
+ existing.push(match);
853
+ handlesByOriginalSlug.set(originalSlug, existing);
854
+ };
855
+ for (const handle of tools) registerHandle(handle, handle.extendsToolkit);
856
+ if (toolkits) for (const tk of toolkits) for (const handle of tk.tools) registerHandle(handle, tk.slug);
857
+ const findHandle = (originalSlug, toolkit) => {
858
+ const originalSlugKey = originalSlug.toUpperCase();
859
+ const qualifiedMatch = handlesByQualifiedOriginalSlug.get(qualifiedOriginalSlugKey(toolkit, originalSlugKey));
860
+ if (qualifiedMatch) return qualifiedMatch;
861
+ const bareMatches = handlesByOriginalSlug.get(originalSlugKey) ?? [];
862
+ return bareMatches.length === 1 ? bareMatches[0] : void 0;
863
+ };
723
864
  const addEntry = (finalSlug, originalSlug, toolkit) => {
724
- const match = handlesByOriginalSlug.get(originalSlug.toUpperCase());
865
+ const resolvedToolkit = toolkit ?? void 0;
866
+ const match = findHandle(originalSlug, resolvedToolkit);
725
867
  if (!match) return;
868
+ const finalSlugKey = finalSlug.toUpperCase();
869
+ if (byFinalSlug.has(finalSlugKey)) throw new ValidationError(`Custom tool slug collision: "${finalSlug}" is already registered.`);
726
870
  const entry = {
727
871
  handle: match.handle,
728
872
  finalSlug,
729
- toolkit: toolkit ?? match.toolkit
873
+ toolkit: resolvedToolkit ?? match.toolkit
730
874
  };
731
- byFinalSlug.set(finalSlug, entry);
732
- byOriginalSlug.set(originalSlug.toUpperCase(), entry);
875
+ byFinalSlug.set(finalSlugKey, entry);
876
+ byToolkitAndOriginalSlug.set(qualifiedOriginalSlugKey(entry.toolkit, originalSlug), entry);
877
+ addOriginalSlugAlias({
878
+ byOriginalSlug,
879
+ ambiguousOriginalSlugs,
880
+ originalSlug,
881
+ entry
882
+ });
733
883
  };
734
884
  if (experimental?.custom_tools) for (const ct of experimental.custom_tools) addEntry(ct.slug, ct.original_slug, ct.extends_toolkit);
735
885
  if (experimental?.custom_toolkits) for (const ctk of experimental.custom_toolkits) for (const ct of ctk.tools) addEntry(ct.slug, ct.original_slug, ctk.slug);
736
886
  return {
737
887
  byFinalSlug,
738
888
  byOriginalSlug,
739
- toolkits
889
+ byToolkitAndOriginalSlug,
890
+ ...ambiguousOriginalSlugs.size ? { ambiguousOriginalSlugs } : {},
891
+ toolkits,
892
+ tools: tools.length ? tools : void 0
740
893
  };
741
894
  }
895
+ /**
896
+ * Find a custom tool entry by final slug only.
897
+ *
898
+ * @internal
899
+ */
900
+ function findCustomToolMapEntryByFinalSlug(customToolsMap, slug) {
901
+ return customToolsMap?.byFinalSlug.get(slug.toUpperCase());
902
+ }
903
+ /**
904
+ * Find a custom toolkit tool entry by toolkit slug and original tool slug.
905
+ *
906
+ * @internal
907
+ */
908
+ function findCustomToolMapEntryByToolkitAndOriginalSlug(customToolsMap, toolkit, slug) {
909
+ return customToolsMap?.byToolkitAndOriginalSlug?.get(qualifiedOriginalSlugKey(toolkit, slug));
910
+ }
911
+ /**
912
+ * Reject legacy attempts to preload custom tools through top-level preload.tools.
913
+ *
914
+ * Custom tool direct exposure is controlled by CustomTool.preload /
915
+ * CustomToolkit.preload so it follows the current SDK-provided custom
916
+ * definitions instead of stale session config.
917
+ *
918
+ * @internal
919
+ */
920
+ function assertNoCustomToolSlugsInPreload(preloadTools, customToolsMap) {
921
+ if (!preloadTools || preloadTools === PRELOAD_TOOLS_ALL) return;
922
+ const customPreloadSlugs = preloadTools.filter((slug) => {
923
+ const normalized = slug.toUpperCase();
924
+ return normalized.startsWith(LOCAL_TOOL_PREFIX) || customToolsMap?.byOriginalSlug.has(normalized) || customToolsMap?.ambiguousOriginalSlugs?.has(normalized) || customToolsMap?.byFinalSlug.has(normalized);
925
+ });
926
+ if (customPreloadSlugs.length) throw new ValidationError(`Custom tool slugs are not supported in preload.tools: ${customPreloadSlugs.join(", ")}. Set preload: true on the SDK custom tool or custom toolkit definition instead.`);
927
+ }
928
+ /**
929
+ * Resolve custom tools that the SDK should expose directly from session.tools().
930
+ *
931
+ * @internal
932
+ */
933
+ function getPreloadedCustomToolSlugs(customToolsMap, defaultPreload = false) {
934
+ if (!customToolsMap) return [];
935
+ const seen = /* @__PURE__ */ new Set();
936
+ const customToolSlugs = [];
937
+ for (const entry of customToolsMap.byFinalSlug.values()) {
938
+ const toolkit = customToolsMap.toolkits?.find((tk) => entry.toolkit && tk.slug.toLowerCase() === entry.toolkit.toLowerCase());
939
+ if (!(entry.handle.preload ?? toolkit?.preload ?? defaultPreload)) continue;
940
+ const finalSlugKey = entry.finalSlug.toUpperCase();
941
+ if (seen.has(finalSlugKey)) continue;
942
+ seen.add(finalSlugKey);
943
+ customToolSlugs.push(entry.finalSlug);
944
+ }
945
+ return customToolSlugs;
946
+ }
742
947
 
743
948
  //#endregion
744
- export { AuthConfigErrorCodes as A, ToolErrorCodes as B, ValidationErrorCodes as C, ConnectionRequestErrorCodes as D, ToolkitErrorCodes as E, ComposioInvalidModifierError as F, ConnectedAccountErrorCodes as G, ComposioConnectedAccountNotFoundError as H, ComposioProviderNotDefinedError as I, ComposioToolExecutionError as L, ComposioCustomToolsNotInitializedError as M, ComposioGlobalExecuteToolFnNotSetError as N, ConnectionRequestFailedError as O, ComposioInvalidExecuteFunctionError as P, ComposioToolNotFoundError as R, ValidationError as S, ComposioToolkitNotFoundError as T, ComposioFailedToCreateConnectedAccountLink as U, handleToolExecutionError as V, ComposioMultipleConnectedAccountsError as W, ComposioWebhookSignatureVerificationError as _, serializeCustomTools as a, SDKErrorCodes as b, CustomToolSlugSchema as c, ComposioFailedToCreatePusherClientError as d, ComposioFailedToGetSDKRealtimeCredentialsError as f, ComposioWebhookPayloadError as g, ComposioTriggerTypeNotFoundError as h, serializeCustomToolkits as i, ComposioAuthConfigNotFoundError as j, ConnectionRequestTimeoutError as k, RemoteFileDownloadError as l, ComposioFailedToUnsubscribeFromPusherChannelError as m, createCustomTool as n, CreateCustomToolBaseSchema as o, ComposioFailedToSubscribeToPusherChannelError as p, createCustomToolkit as r, CreateCustomToolkitBaseSchema as s, buildCustomToolsMapFromResponse as t, RemoteFileErrorCodes as u, TriggerErrorCodes as v, ComposioToolkitFetchError as w, JsonSchemaToZodError as x, ComposioNoAPIKeyError as y, ComposioToolVersionRequiredError as z };
949
+ export { ConnectedAccountErrorCodes as $, ValidationErrorCodes as A, ComposioGlobalExecuteToolFnNotSetError as B, ComposioWebhookSignatureVerificationError as C, JsonSchemaRefResolutionError as D, SDKErrorCodes as E, ConnectionRequestFailedError as F, ComposioToolNotFoundError as G, ComposioInvalidModifierError as H, ConnectionRequestTimeoutError as I, handleToolExecutionError as J, ComposioToolVersionRequiredError as K, AuthConfigErrorCodes as L, ComposioToolkitNotFoundError as M, ToolkitErrorCodes as N, JsonSchemaToZodError as O, ConnectionRequestErrorCodes as P, ComposioMultipleConnectedAccountsError as Q, ComposioAuthConfigNotFoundError as R, ComposioWebhookPayloadError as S, ComposioNoAPIKeyError as T, ComposioProviderNotDefinedError as U, ComposioInvalidExecuteFunctionError as V, ComposioToolExecutionError as W, ComposioFailedToCreateConnectedAccountLink as X, ComposioConnectedAccountNotFoundError as Y, ComposioLegacyConnectedAccountsEndpointRetiredError as Z, ComposioFailedToCreatePusherClientError as _, createCustomToolkit as a, ComposioFailedToUnsubscribeFromPusherChannelError as b, getPreloadedCustomToolSlugs as c, CreateCustomToolBaseSchema as d, CreateCustomToolkitBaseSchema as f, RemoteFileErrorCodes as g, RemoteFileDownloadError as h, createCustomTool as i, ComposioToolkitFetchError as j, ValidationError as k, serializeCustomToolkits as l, PRELOAD_TOOLS_ALL as m, buildCustomToolsMap as n, findCustomToolMapEntryByFinalSlug as o, CustomToolSlugSchema as p, ToolErrorCodes as q, buildCustomToolsMapFromResponse as r, findCustomToolMapEntryByToolkitAndOriginalSlug as s, assertNoCustomToolSlugsInPreload as t, serializeCustomTools as u, ComposioFailedToGetSDKRealtimeCredentialsError as v, TriggerErrorCodes as w, ComposioTriggerTypeNotFoundError as x, ComposioFailedToSubscribeToPusherChannelError as y, ComposioCustomToolsNotInitializedError as z };