@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
@@ -9,7 +9,8 @@ zod_to_json_schema = require_chunk.__toESM(zod_to_json_schema);
9
9
  const ConnectedAccountErrorCodes = {
10
10
  CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND",
11
11
  MULTIPLE_CONNECTED_ACCOUNTS: "MULTIPLE_CONNECTED_ACCOUNTS",
12
- FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK: "FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK"
12
+ FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK: "FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK",
13
+ LEGACY_CONNECTED_ACCOUNTS_ENDPOINT_RETIRED: "LEGACY_CONNECTED_ACCOUNTS_ENDPOINT_RETIRED"
13
14
  };
14
15
  var ComposioConnectedAccountNotFoundError = class extends require_FileModifierErrors.ComposioError {
15
16
  constructor(message = "Connected account not found", options = {}) {
@@ -41,6 +42,30 @@ var ComposioFailedToCreateConnectedAccountLink = class extends require_FileModif
41
42
  this.name = "ComposioFailedToCreateConnectedAccountLink";
42
43
  }
43
44
  };
45
+ /**
46
+ * Thrown by `composio.connectedAccounts.initiate()` when the legacy
47
+ * `POST /api/v3/connected_accounts` endpoint rejects a Composio-managed
48
+ * OAuth (OAuth1, OAuth2, DCR_OAUTH) auth-config request.
49
+ *
50
+ * The retiring path is being phased out — new orgs from 2026-05-08 and
51
+ * all remaining orgs from 2026-07-03. Migrate the call to
52
+ * `composio.connectedAccounts.link()`, which works for every redirectable
53
+ * scheme regardless of whether the auth config is Composio-managed or
54
+ * custom.
55
+ *
56
+ * See: https://docs.composio.dev/docs/changelog/2026/04/24
57
+ */
58
+ var ComposioLegacyConnectedAccountsEndpointRetiredError = class extends require_FileModifierErrors.ComposioError {
59
+ constructor(message = "POST /api/v3/connected_accounts is no longer supported for Composio-managed OAuth auth configs. Use composio.connectedAccounts.link() instead.", options = {}) {
60
+ super(message, {
61
+ ...options,
62
+ code: ConnectedAccountErrorCodes.LEGACY_CONNECTED_ACCOUNTS_ENDPOINT_RETIRED,
63
+ statusCode: 400,
64
+ 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"]
65
+ });
66
+ this.name = "ComposioLegacyConnectedAccountsEndpointRetiredError";
67
+ }
68
+ };
44
69
 
45
70
  //#endregion
46
71
  //#region src/errors/ToolErrors.ts
@@ -294,7 +319,8 @@ var ComposioToolkitFetchError = class extends require_FileModifierErrors.Composi
294
319
  */
295
320
  const ValidationErrorCodes = {
296
321
  VALIDATION_ERROR: "VALIDATION_ERROR",
297
- JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR"
322
+ JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR",
323
+ JSON_SCHEMA_REF_RESOLUTION_ERROR: "JSON_SCHEMA_REF_RESOLUTION_ERROR"
298
324
  };
299
325
  var ValidationError = class extends require_FileModifierErrors.ComposioError {
300
326
  constructor(message = "Input validation failed", options = {}) {
@@ -334,6 +360,19 @@ var JsonSchemaToZodError = class extends require_FileModifierErrors.ComposioErro
334
360
  });
335
361
  }
336
362
  };
363
+ /**
364
+ * Thrown when a JSON Schema `$ref` pointer cannot be resolved against the
365
+ * document. Used by `dereferenceJsonSchema` to surface malformed pointers,
366
+ * missing `$defs`/`definitions` targets, or chains exceeding the depth cap.
367
+ */
368
+ var JsonSchemaRefResolutionError = class extends require_FileModifierErrors.ComposioError {
369
+ constructor(message = "Failed to resolve JSON Schema $ref", options = {}) {
370
+ super(message, {
371
+ ...options,
372
+ code: options.code || ValidationErrorCodes.JSON_SCHEMA_REF_RESOLUTION_ERROR
373
+ });
374
+ }
375
+ };
337
376
 
338
377
  //#endregion
339
378
  //#region src/errors/SDKErrors.ts
@@ -478,6 +517,10 @@ var RemoteFileDownloadError = class extends require_FileModifierErrors.ComposioE
478
517
  }
479
518
  };
480
519
 
520
+ //#endregion
521
+ //#region src/lib/toolRouterConstants.ts
522
+ const PRELOAD_TOOLS_ALL = "all";
523
+
481
524
  //#endregion
482
525
  //#region src/types/customTool.types.ts
483
526
  /**
@@ -494,7 +537,8 @@ const CustomToolSlugSchema = zod_v3.z.string().min(1, "slug is required").regex(
494
537
  const CreateCustomToolBaseSchema = zod_v3.z.object({
495
538
  name: zod_v3.z.string().min(1, "createCustomTool: name is required"),
496
539
  description: zod_v3.z.string().min(1, "createCustomTool: description is required"),
497
- extendsToolkit: zod_v3.z.string().optional()
540
+ extendsToolkit: zod_v3.z.string().optional(),
541
+ preload: zod_v3.z.boolean().optional().describe("When true, include this custom tool in session.tools() so it can be called without searching first.")
498
542
  });
499
543
  /**
500
544
  * Zod schema for validating the string/scalar fields of createCustomToolkit() options.
@@ -502,7 +546,8 @@ const CreateCustomToolBaseSchema = zod_v3.z.object({
502
546
  */
503
547
  const CreateCustomToolkitBaseSchema = zod_v3.z.object({
504
548
  name: zod_v3.z.string().min(1, "createCustomToolkit: name is required"),
505
- description: zod_v3.z.string().min(1, "createCustomToolkit: description is required")
549
+ description: zod_v3.z.string().min(1, "createCustomToolkit: description is required"),
550
+ preload: zod_v3.z.boolean().optional().describe("When true, include tools from this custom toolkit in session.tools(). Tool-level preload values override this default.")
506
551
  });
507
552
 
508
553
  //#endregion
@@ -616,6 +661,7 @@ function createCustomTool(slug, options) {
616
661
  name: validated.name,
617
662
  description: validated.description,
618
663
  extendsToolkit: validated.extendsToolkit,
664
+ preload: validated.preload,
619
665
  inputSchema,
620
666
  outputSchema,
621
667
  inputParams,
@@ -657,26 +703,103 @@ function createCustomToolkit(slug, options) {
657
703
  slug: slugResult.data,
658
704
  name: validated.name,
659
705
  description: validated.description,
706
+ preload: validated.preload,
660
707
  tools: options.tools
661
708
  };
662
709
  }
663
710
  /**
664
- * Serialize custom tools into the format expected by the backend session creation API.
665
- *
666
- * Maps `extendsToolkit` → `extends_toolkit` for backend. Omitted for standalone tools.
711
+ * Build the final slug for a custom tool given its context.
712
+ * @internal
713
+ */
714
+ function buildFinalSlug(toolSlug, toolkitSlug) {
715
+ const upper = toolSlug.toUpperCase();
716
+ return toolkitSlug ? `${LOCAL_TOOL_PREFIX}${toolkitSlug.toUpperCase()}_${upper}` : `${LOCAL_TOOL_PREFIX}${upper}`;
717
+ }
718
+ const qualifiedOriginalSlugKey = (toolkit, originalSlug) => `${toolkit?.toUpperCase() ?? ""}::${originalSlug.toUpperCase()}`;
719
+ const canShareOriginalSlug = (existing, next) => !!existing.toolkit && !!next.toolkit && existing.toolkit.toLowerCase() !== next.toolkit.toLowerCase();
720
+ const addOriginalSlugAlias = (params) => {
721
+ const originalSlugKey = params.originalSlug.toUpperCase();
722
+ if (params.ambiguousOriginalSlugs.has(originalSlugKey)) return;
723
+ const existing = params.byOriginalSlug.get(originalSlugKey);
724
+ if (!existing) {
725
+ params.byOriginalSlug.set(originalSlugKey, params.entry);
726
+ return;
727
+ }
728
+ if (existing.finalSlug.toUpperCase() === params.entry.finalSlug.toUpperCase()) return;
729
+ if (canShareOriginalSlug(existing, params.entry)) {
730
+ params.byOriginalSlug.delete(originalSlugKey);
731
+ params.ambiguousOriginalSlugs.add(originalSlugKey);
732
+ return;
733
+ }
734
+ 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}".`);
735
+ };
736
+ /**
737
+ * Build a CustomToolsMap from custom tools and toolkits.
738
+ * Used internally by ToolRouter.create() to construct the per-session routing map.
667
739
  *
668
740
  * @internal
669
- * @param tools - The custom tools to serialize
670
- * @returns Array of CustomToolDefinition for the API payload
741
+ * @param tools - Standalone custom tools
742
+ * @param toolkits - Custom toolkits containing grouped tools
743
+ * @returns Maps for O(1) lookup by both final and original slug
744
+ * @throws If duplicate slugs or cross-group collisions
671
745
  */
672
- function serializeCustomTools(tools) {
746
+ function buildCustomToolsMap(tools, toolkits) {
747
+ const byFinalSlug = /* @__PURE__ */ new Map();
748
+ const byOriginalSlug = /* @__PURE__ */ new Map();
749
+ const byToolkitAndOriginalSlug = /* @__PURE__ */ new Map();
750
+ const ambiguousOriginalSlugs = /* @__PURE__ */ new Set();
751
+ const addEntry = (handle, finalSlug, toolkit) => {
752
+ const originalSlug = handle.slug.toUpperCase();
753
+ const finalSlugKey = finalSlug.toUpperCase();
754
+ if (finalSlug.length > MAX_SLUG_LENGTH) throw new ValidationError(`Custom tool slug "${handle.slug}" produces final slug "${finalSlug}" which exceeds ${MAX_SLUG_LENGTH} characters.`);
755
+ if (byFinalSlug.has(finalSlugKey)) throw new ValidationError(`Custom tool slug collision: "${finalSlug}" is already registered.`);
756
+ const qualifiedKey = qualifiedOriginalSlugKey(toolkit, originalSlug);
757
+ if (byToolkitAndOriginalSlug.has(qualifiedKey)) throw new ValidationError(`Custom tool slug collision: original slug "${handle.slug}" is already registered for toolkit "${toolkit ?? "custom"}".`);
758
+ const entry = {
759
+ handle,
760
+ finalSlug,
761
+ toolkit
762
+ };
763
+ byFinalSlug.set(finalSlugKey, entry);
764
+ byToolkitAndOriginalSlug.set(qualifiedKey, entry);
765
+ addOriginalSlugAlias({
766
+ byOriginalSlug,
767
+ ambiguousOriginalSlugs,
768
+ originalSlug,
769
+ entry
770
+ });
771
+ };
772
+ for (const handle of tools) addEntry(handle, buildFinalSlug(handle.slug, handle.extendsToolkit), handle.extendsToolkit);
773
+ if (toolkits) for (const toolkit of toolkits) for (const handle of toolkit.tools) addEntry(handle, buildFinalSlug(handle.slug, toolkit.slug), toolkit.slug);
774
+ return {
775
+ byFinalSlug,
776
+ byOriginalSlug,
777
+ byToolkitAndOriginalSlug,
778
+ ...ambiguousOriginalSlugs.size ? { ambiguousOriginalSlugs } : {},
779
+ toolkits,
780
+ tools: tools.length ? tools : void 0
781
+ };
782
+ }
783
+ function shouldSerializePreload(preload, inheritedPreload, defaultPreload) {
784
+ const inheritedOrDefault = inheritedPreload ?? defaultPreload;
785
+ if (preload !== void 0) return preload || inheritedOrDefault ? preload : void 0;
786
+ if (inheritedPreload !== void 0) return inheritedPreload || defaultPreload ? inheritedPreload : void 0;
787
+ return defaultPreload ? true : void 0;
788
+ }
789
+ function preloadWireProperty(preload, inheritedPreload, defaultPreload) {
790
+ const serializedPreload = shouldSerializePreload(preload, inheritedPreload, defaultPreload);
791
+ return serializedPreload === void 0 ? {} : { preload: serializedPreload };
792
+ }
793
+ function serializeCustomTools(tools, options = {}) {
794
+ const defaultPreload = options.defaultPreload ?? false;
673
795
  return tools.map((handle) => ({
674
796
  slug: handle.slug,
675
797
  name: handle.name,
676
798
  description: handle.description,
677
799
  input_schema: handle.inputSchema,
678
800
  ...handle.outputSchema ? { output_schema: handle.outputSchema } : {},
679
- ...handle.extendsToolkit ? { extends_toolkit: handle.extendsToolkit } : {}
801
+ ...handle.extendsToolkit ? { extends_toolkit: handle.extendsToolkit } : {},
802
+ ...preloadWireProperty(handle.preload, void 0, defaultPreload)
680
803
  }));
681
804
  }
682
805
  /**
@@ -686,17 +809,20 @@ function serializeCustomTools(tools) {
686
809
  * @param toolkits - The custom toolkits to serialize
687
810
  * @returns Array of CustomToolkitDefinition for the API payload
688
811
  */
689
- function serializeCustomToolkits(toolkits) {
812
+ function serializeCustomToolkits(toolkits, options = {}) {
813
+ const defaultPreload = options.defaultPreload ?? false;
690
814
  return toolkits.map((tk) => ({
691
815
  slug: tk.slug,
692
816
  name: tk.name,
693
817
  description: tk.description,
818
+ ...preloadWireProperty(tk.preload, void 0, defaultPreload),
694
819
  tools: tk.tools.map((t) => ({
695
820
  slug: t.slug,
696
821
  name: t.name,
697
822
  description: t.description,
698
823
  input_schema: t.inputSchema,
699
- ...t.outputSchema ? { output_schema: t.outputSchema } : {}
824
+ ...t.outputSchema ? { output_schema: t.outputSchema } : {},
825
+ ...preloadWireProperty(t.preload, tk.preload, defaultPreload)
700
826
  }))
701
827
  }));
702
828
  }
@@ -713,34 +839,113 @@ function serializeCustomToolkits(toolkits) {
713
839
  function buildCustomToolsMapFromResponse(tools, toolkits, experimental) {
714
840
  const byFinalSlug = /* @__PURE__ */ new Map();
715
841
  const byOriginalSlug = /* @__PURE__ */ new Map();
842
+ const byToolkitAndOriginalSlug = /* @__PURE__ */ new Map();
843
+ const ambiguousOriginalSlugs = /* @__PURE__ */ new Set();
844
+ const handlesByQualifiedOriginalSlug = /* @__PURE__ */ new Map();
716
845
  const handlesByOriginalSlug = /* @__PURE__ */ new Map();
717
- for (const handle of tools) handlesByOriginalSlug.set(handle.slug.toUpperCase(), {
718
- handle,
719
- toolkit: handle.extendsToolkit
720
- });
721
- if (toolkits) for (const tk of toolkits) for (const handle of tk.tools) handlesByOriginalSlug.set(handle.slug.toUpperCase(), {
722
- handle,
723
- toolkit: tk.slug
724
- });
846
+ const registerHandle = (handle, toolkit) => {
847
+ const originalSlug = handle.slug.toUpperCase();
848
+ const match = {
849
+ handle,
850
+ toolkit
851
+ };
852
+ handlesByQualifiedOriginalSlug.set(qualifiedOriginalSlugKey(toolkit, originalSlug), match);
853
+ const existing = handlesByOriginalSlug.get(originalSlug) ?? [];
854
+ existing.push(match);
855
+ handlesByOriginalSlug.set(originalSlug, existing);
856
+ };
857
+ for (const handle of tools) registerHandle(handle, handle.extendsToolkit);
858
+ if (toolkits) for (const tk of toolkits) for (const handle of tk.tools) registerHandle(handle, tk.slug);
859
+ const findHandle = (originalSlug, toolkit) => {
860
+ const originalSlugKey = originalSlug.toUpperCase();
861
+ const qualifiedMatch = handlesByQualifiedOriginalSlug.get(qualifiedOriginalSlugKey(toolkit, originalSlugKey));
862
+ if (qualifiedMatch) return qualifiedMatch;
863
+ const bareMatches = handlesByOriginalSlug.get(originalSlugKey) ?? [];
864
+ return bareMatches.length === 1 ? bareMatches[0] : void 0;
865
+ };
725
866
  const addEntry = (finalSlug, originalSlug, toolkit) => {
726
- const match = handlesByOriginalSlug.get(originalSlug.toUpperCase());
867
+ const resolvedToolkit = toolkit ?? void 0;
868
+ const match = findHandle(originalSlug, resolvedToolkit);
727
869
  if (!match) return;
870
+ const finalSlugKey = finalSlug.toUpperCase();
871
+ if (byFinalSlug.has(finalSlugKey)) throw new ValidationError(`Custom tool slug collision: "${finalSlug}" is already registered.`);
728
872
  const entry = {
729
873
  handle: match.handle,
730
874
  finalSlug,
731
- toolkit: toolkit ?? match.toolkit
875
+ toolkit: resolvedToolkit ?? match.toolkit
732
876
  };
733
- byFinalSlug.set(finalSlug, entry);
734
- byOriginalSlug.set(originalSlug.toUpperCase(), entry);
877
+ byFinalSlug.set(finalSlugKey, entry);
878
+ byToolkitAndOriginalSlug.set(qualifiedOriginalSlugKey(entry.toolkit, originalSlug), entry);
879
+ addOriginalSlugAlias({
880
+ byOriginalSlug,
881
+ ambiguousOriginalSlugs,
882
+ originalSlug,
883
+ entry
884
+ });
735
885
  };
736
886
  if (experimental?.custom_tools) for (const ct of experimental.custom_tools) addEntry(ct.slug, ct.original_slug, ct.extends_toolkit);
737
887
  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);
738
888
  return {
739
889
  byFinalSlug,
740
890
  byOriginalSlug,
741
- toolkits
891
+ byToolkitAndOriginalSlug,
892
+ ...ambiguousOriginalSlugs.size ? { ambiguousOriginalSlugs } : {},
893
+ toolkits,
894
+ tools: tools.length ? tools : void 0
742
895
  };
743
896
  }
897
+ /**
898
+ * Find a custom tool entry by final slug only.
899
+ *
900
+ * @internal
901
+ */
902
+ function findCustomToolMapEntryByFinalSlug(customToolsMap, slug) {
903
+ return customToolsMap?.byFinalSlug.get(slug.toUpperCase());
904
+ }
905
+ /**
906
+ * Find a custom toolkit tool entry by toolkit slug and original tool slug.
907
+ *
908
+ * @internal
909
+ */
910
+ function findCustomToolMapEntryByToolkitAndOriginalSlug(customToolsMap, toolkit, slug) {
911
+ return customToolsMap?.byToolkitAndOriginalSlug?.get(qualifiedOriginalSlugKey(toolkit, slug));
912
+ }
913
+ /**
914
+ * Reject legacy attempts to preload custom tools through top-level preload.tools.
915
+ *
916
+ * Custom tool direct exposure is controlled by CustomTool.preload /
917
+ * CustomToolkit.preload so it follows the current SDK-provided custom
918
+ * definitions instead of stale session config.
919
+ *
920
+ * @internal
921
+ */
922
+ function assertNoCustomToolSlugsInPreload(preloadTools, customToolsMap) {
923
+ if (!preloadTools || preloadTools === PRELOAD_TOOLS_ALL) return;
924
+ const customPreloadSlugs = preloadTools.filter((slug) => {
925
+ const normalized = slug.toUpperCase();
926
+ return normalized.startsWith(LOCAL_TOOL_PREFIX) || customToolsMap?.byOriginalSlug.has(normalized) || customToolsMap?.ambiguousOriginalSlugs?.has(normalized) || customToolsMap?.byFinalSlug.has(normalized);
927
+ });
928
+ 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.`);
929
+ }
930
+ /**
931
+ * Resolve custom tools that the SDK should expose directly from session.tools().
932
+ *
933
+ * @internal
934
+ */
935
+ function getPreloadedCustomToolSlugs(customToolsMap, defaultPreload = false) {
936
+ if (!customToolsMap) return [];
937
+ const seen = /* @__PURE__ */ new Set();
938
+ const customToolSlugs = [];
939
+ for (const entry of customToolsMap.byFinalSlug.values()) {
940
+ const toolkit = customToolsMap.toolkits?.find((tk) => entry.toolkit && tk.slug.toLowerCase() === entry.toolkit.toLowerCase());
941
+ if (!(entry.handle.preload ?? toolkit?.preload ?? defaultPreload)) continue;
942
+ const finalSlugKey = entry.finalSlug.toUpperCase();
943
+ if (seen.has(finalSlugKey)) continue;
944
+ seen.add(finalSlugKey);
945
+ customToolSlugs.push(entry.finalSlug);
946
+ }
947
+ return customToolSlugs;
948
+ }
744
949
 
745
950
  //#endregion
746
951
  Object.defineProperty(exports, 'AuthConfigErrorCodes', {
@@ -815,6 +1020,12 @@ Object.defineProperty(exports, 'ComposioInvalidModifierError', {
815
1020
  return ComposioInvalidModifierError;
816
1021
  }
817
1022
  });
1023
+ Object.defineProperty(exports, 'ComposioLegacyConnectedAccountsEndpointRetiredError', {
1024
+ enumerable: true,
1025
+ get: function () {
1026
+ return ComposioLegacyConnectedAccountsEndpointRetiredError;
1027
+ }
1028
+ });
818
1029
  Object.defineProperty(exports, 'ComposioMultipleConnectedAccountsError', {
819
1030
  enumerable: true,
820
1031
  get: function () {
@@ -923,12 +1134,24 @@ Object.defineProperty(exports, 'CustomToolSlugSchema', {
923
1134
  return CustomToolSlugSchema;
924
1135
  }
925
1136
  });
1137
+ Object.defineProperty(exports, 'JsonSchemaRefResolutionError', {
1138
+ enumerable: true,
1139
+ get: function () {
1140
+ return JsonSchemaRefResolutionError;
1141
+ }
1142
+ });
926
1143
  Object.defineProperty(exports, 'JsonSchemaToZodError', {
927
1144
  enumerable: true,
928
1145
  get: function () {
929
1146
  return JsonSchemaToZodError;
930
1147
  }
931
1148
  });
1149
+ Object.defineProperty(exports, 'PRELOAD_TOOLS_ALL', {
1150
+ enumerable: true,
1151
+ get: function () {
1152
+ return PRELOAD_TOOLS_ALL;
1153
+ }
1154
+ });
932
1155
  Object.defineProperty(exports, 'RemoteFileDownloadError', {
933
1156
  enumerable: true,
934
1157
  get: function () {
@@ -977,6 +1200,18 @@ Object.defineProperty(exports, 'ValidationErrorCodes', {
977
1200
  return ValidationErrorCodes;
978
1201
  }
979
1202
  });
1203
+ Object.defineProperty(exports, 'assertNoCustomToolSlugsInPreload', {
1204
+ enumerable: true,
1205
+ get: function () {
1206
+ return assertNoCustomToolSlugsInPreload;
1207
+ }
1208
+ });
1209
+ Object.defineProperty(exports, 'buildCustomToolsMap', {
1210
+ enumerable: true,
1211
+ get: function () {
1212
+ return buildCustomToolsMap;
1213
+ }
1214
+ });
980
1215
  Object.defineProperty(exports, 'buildCustomToolsMapFromResponse', {
981
1216
  enumerable: true,
982
1217
  get: function () {
@@ -995,6 +1230,24 @@ Object.defineProperty(exports, 'createCustomToolkit', {
995
1230
  return createCustomToolkit;
996
1231
  }
997
1232
  });
1233
+ Object.defineProperty(exports, 'findCustomToolMapEntryByFinalSlug', {
1234
+ enumerable: true,
1235
+ get: function () {
1236
+ return findCustomToolMapEntryByFinalSlug;
1237
+ }
1238
+ });
1239
+ Object.defineProperty(exports, 'findCustomToolMapEntryByToolkitAndOriginalSlug', {
1240
+ enumerable: true,
1241
+ get: function () {
1242
+ return findCustomToolMapEntryByToolkitAndOriginalSlug;
1243
+ }
1244
+ });
1245
+ Object.defineProperty(exports, 'getPreloadedCustomToolSlugs', {
1246
+ enumerable: true,
1247
+ get: function () {
1248
+ return getPreloadedCustomToolSlugs;
1249
+ }
1250
+ });
998
1251
  Object.defineProperty(exports, 'handleToolExecutionError', {
999
1252
  enumerable: true,
1000
1253
  get: function () {