@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.
- package/dist/{CustomTool-DCrZcOUW.d.cts → CustomTool-87USJ2u0.d.cts} +1 -1
- package/dist/{CustomTool-DJVmDusu.d.mts → CustomTool-BNxqr6BI.d.mts} +1 -1
- package/dist/{CustomTool-CVwF_isu.mjs → CustomTool-DOE7hgw6.mjs} +232 -27
- package/dist/{CustomTool-DnCSEC6t.cjs → CustomTool-Dj4fNvsu.cjs} +279 -26
- package/dist/{composio-DH5gDW5F.d.mts → composio-BJW2NaoA.d.mts} +110 -79
- package/dist/{composio-Dzaqn_PS.d.cts → composio-DTntXzL-.d.cts} +110 -79
- package/dist/{customTool.types-Xk-tbwbc.d.mts → customTool.types-B3HG185y.d.mts} +401 -32
- package/dist/{customTool.types-BqC41wRt.d.cts → customTool.types-Bd8ylotX.d.cts} +401 -32
- package/dist/experimental/index.cjs +1 -1
- package/dist/experimental/index.d.cts +2 -2
- package/dist/experimental/index.d.mts +3 -3
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.cjs +574 -85
- package/dist/index.d.cts +84 -8
- package/dist/index.d.mts +84 -8
- package/dist/index.mjs +570 -88
- package/dist/{tool.types-Cb-o48UU.d.mts → tool.types-CB_4JKhV.d.mts} +601 -38
- package/dist/{tool.types-B4k2Bnxc.d.cts → tool.types-CwbAy9l_.d.cts} +601 -38
- package/dist/{types-BR-1DJRJ.d.mts → types-BClz5lKM.d.mts} +2 -2
- package/dist/{types-gjJ_hDol.d.cts → types-jsOgjrWN.d.cts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +4 -4
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +4 -4
- package/dist/utils/modifiers/FileToolModifier.node.d.cts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +1 -1
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +2 -2
- package/generated/ably.ts +0 -20
- package/generated/accelo.ts +0 -8
- package/generated/acculynx.ts +0 -17
- package/generated/active_campaign.ts +0 -30
- package/generated/adobe.ts +0 -8
- package/generated/adyntel.ts +0 -12
- package/generated/aero_workflow.ts +0 -8
- package/generated/affinity.ts +0 -29
- package/generated/agencyzoom.ts +0 -108
- package/generated/ahrefs.ts +0 -49
- package/generated/airtable.ts +0 -26
- package/generated/alchemy.ts +0 -16
- package/generated/algolia.ts +0 -39
- package/generated/altoviz.ts +0 -18
- package/generated/amazon.ts +0 -8
- package/generated/amcards.ts +0 -11
- package/generated/amplitude.ts +0 -25
- package/generated/anthropic_administrator.ts +0 -13
- package/generated/apaleo.ts +0 -38
- package/generated/apollo.ts +0 -40
- package/generated/appdrag.ts +0 -8
- package/generated/appsflyer.ts +0 -8
- package/generated/asana.ts +0 -95
- package/generated/ashby.ts +0 -8
- package/generated/atlassian.ts +0 -8
- package/generated/attio.ts +0 -20
- package/generated/auth0.ts +0 -8
- package/generated/axonaut.ts +0 -8
- package/generated/bamboohr.ts +0 -168
- package/generated/bannerbear.ts +0 -17
- package/generated/baserow.ts +0 -11
- package/generated/battlenet.ts +0 -8
- package/generated/beeminder.ts +0 -14
- package/generated/bigmailer.ts +0 -12
- package/generated/bigml.ts +0 -15
- package/generated/bill.ts +0 -218
- package/generated/bitbucket.ts +0 -25
- package/generated/bitwarden.ts +0 -8
- package/generated/blackbaud.ts +0 -8
- package/generated/blackboard.ts +0 -323
- package/generated/boldsign.ts +0 -8
- package/generated/bolna.ts +0 -24
- package/generated/borneo.ts +0 -162
- package/generated/botbaba.ts +0 -8
- package/generated/box.ts +0 -282
- package/generated/braintree.ts +0 -8
- package/generated/brandfetch.ts +0 -15
- package/generated/breezy_hr.ts +0 -8
- package/generated/brevo.ts +0 -28
- package/generated/brex.ts +0 -8
- package/generated/brex_staging.ts +0 -8
- package/generated/brightpearl.ts +0 -8
- package/generated/brilliant_directories.ts +0 -15
- package/generated/browseai.ts +0 -18
- package/generated/browserbase_tool.ts +0 -10
- package/generated/browserhub.ts +0 -8
- package/generated/browserless.ts +0 -16
- package/generated/bubble.ts +0 -8
- package/generated/bugbug.ts +0 -13
- package/generated/builtwith.ts +0 -21
- package/generated/cal.ts +0 -150
- package/generated/calendly.ts +0 -51
- package/generated/canva.ts +0 -41
- package/generated/canvas.ts +0 -100
- package/generated/chatwork.ts +0 -17
- package/generated/chmeetings.ts +0 -8
- package/generated/clickup.ts +0 -153
- package/generated/clockify.ts +0 -23
- package/generated/close.ts +0 -15
- package/generated/cloudflare.ts +0 -10
- package/generated/coda.ts +0 -115
- package/generated/codeinterpreter.ts +0 -14
- package/generated/coinbase.ts +0 -15
- package/generated/coinmarketcal.ts +0 -8
- package/generated/composio.ts +0 -34
- package/generated/composio_search.ts +0 -22
- package/generated/confluence.ts +0 -199
- package/generated/contentful.ts +0 -12
- package/generated/crustdata.ts +0 -23
- package/generated/customer_io.ts +0 -8
- package/generated/cutt_ly.ts +0 -10
- package/generated/d2lbrightspace.ts +0 -54
- package/generated/dailybot.ts +0 -15
- package/generated/datadog.ts +0 -47
- package/generated/datagma.ts +0 -8
- package/generated/datarobot.ts +0 -8
- package/generated/deel.ts +0 -8
- package/generated/demio.ts +0 -8
- package/generated/dialpad.ts +0 -201
- package/generated/digicert.ts +0 -15
- package/generated/discord.ts +0 -17
- package/generated/discordbot.ts +0 -173
- package/generated/docmosis.ts +0 -8
- package/generated/docusign.ts +0 -351
- package/generated/dropbox.ts +0 -20
- package/generated/dropbox_sign.ts +0 -8
- package/generated/dynamics365.ts +0 -25
- package/generated/echtpost.ts +0 -10
- package/generated/elevenlabs.ts +0 -70
- package/generated/emailoctopus.ts +0 -16
- package/generated/enigma.ts +0 -11
- package/generated/entelligence.ts +0 -11
- package/generated/epic_games.ts +0 -8
- package/generated/eventbrite.ts +0 -12
- package/generated/exa.ts +0 -13
- package/generated/excel.ts +0 -34
- package/generated/exist.ts +0 -8
- package/generated/facebook.ts +0 -8
- package/generated/factorial.ts +0 -8
- package/generated/figma.ts +0 -59
- package/generated/finage.ts +0 -19
- package/generated/firecrawl.ts +0 -16
- package/generated/fireflies.ts +0 -21
- package/generated/fitbit.ts +0 -8
- package/generated/flutterwave.ts +0 -33
- package/generated/fomo.ts +0 -10
- package/generated/formcarry.ts +0 -10
- package/generated/formsite.ts +0 -14
- package/generated/foursquare.ts +0 -14
- package/generated/freshbooks.ts +0 -11
- package/generated/freshdesk.ts +0 -16
- package/generated/front.ts +0 -8
- package/generated/github.ts +0 -967
- package/generated/gitlab.ts +0 -82
- package/generated/gmail.d.ts +0 -86
- package/generated/gmail.js +0 -13
- package/generated/gmail.ts +0 -95
- package/generated/go_to_webinar.ts +0 -8
- package/generated/gong.ts +0 -63
- package/generated/google_analytics.ts +0 -13
- package/generated/google_maps.ts +0 -16
- package/generated/googleads.ts +0 -14
- package/generated/googlebigquery.ts +0 -10
- package/generated/googlecalendar.ts +0 -39
- package/generated/googledocs.ts +0 -41
- package/generated/googledrive.ts +0 -62
- package/generated/googlemeet.ts +0 -18
- package/generated/googlephotos.ts +0 -22
- package/generated/googlesheets.ts +0 -40
- package/generated/googleslides.ts +0 -8
- package/generated/googlesuper.ts +0 -230
- package/generated/googletasks.ts +0 -23
- package/generated/gorgias.ts +0 -41
- package/generated/gumroad.ts +0 -14
- package/generated/guru.ts +0 -8
- package/generated/hackernews.ts +0 -15
- package/generated/hackerrank_work.ts +0 -8
- package/generated/harvest.ts +0 -56
- package/generated/helcim.ts +0 -8
- package/generated/heygen.ts +0 -44
- package/generated/highlevel.ts +0 -8
- package/generated/hubspot.ts +0 -252
- package/generated/humanloop.ts +0 -13
- package/generated/icims_talent_cloud.ts +0 -8
- package/generated/idea_scale.ts +0 -8
- package/generated/index.ts +0 -151
- package/generated/insighto_ai.ts +0 -19
- package/generated/intercom.ts +0 -52
- package/generated/interzoid.ts +0 -8
- package/generated/jira.ts +0 -59
- package/generated/jotform.ts +0 -15
- package/generated/junglescout.ts +0 -15
- package/generated/keap.ts +0 -8
- package/generated/kibana.ts +0 -58
- package/generated/kit.ts +0 -38
- package/generated/klaviyo.ts +0 -240
- package/generated/klipfolio.ts +0 -20
- package/generated/kommo.ts +0 -24
- package/generated/lastpass.ts +0 -8
- package/generated/launch_darkly.ts +0 -16
- package/generated/leadfeeder.ts +0 -13
- package/generated/leadoku.ts +0 -10
- package/generated/lever.ts +0 -8
- package/generated/lever_sandbox.ts +0 -8
- package/generated/lexoffice.ts +0 -8
- package/generated/linear.ts +0 -31
- package/generated/linkedin.ts +0 -13
- package/generated/linkhut.ts +0 -14
- package/generated/linkup.ts +0 -11
- package/generated/listennotes.ts +0 -35
- package/generated/lmnt.ts +0 -16
- package/generated/lodgify.ts +0 -10
- package/generated/mailchimp.ts +0 -285
- package/generated/mailerlite.ts +0 -8
- package/generated/maintainx.ts +0 -20
- package/generated/make.ts +0 -12
- package/generated/mboum.ts +0 -8
- package/generated/mem0.ts +0 -52
- package/generated/metaads.ts +0 -25
- package/generated/metatextai.ts +0 -8
- package/generated/microsoft_clarity.ts +0 -10
- package/generated/microsoft_teams.ts +0 -22
- package/generated/microsoft_tenant.ts +0 -8
- package/generated/miro.ts +0 -23
- package/generated/mixpanel.ts +0 -30
- package/generated/mocean.ts +0 -8
- package/generated/monday.ts +0 -30
- package/generated/mopinion.ts +0 -8
- package/generated/more_trees.ts +0 -10
- package/generated/moxie.ts +0 -8
- package/generated/moz.ts +0 -8
- package/generated/mural.ts +0 -14
- package/generated/nasdaq.ts +0 -15
- package/generated/ncscale.ts +0 -8
- package/generated/neon.ts +0 -78
- package/generated/netsuite.ts +0 -8
- package/generated/nextdns.ts +0 -11
- package/generated/ngrok.ts +0 -18
- package/generated/notion.ts +0 -40
- package/generated/oncehub.ts +0 -8
- package/generated/one_drive.ts +0 -49
- package/generated/onepage.ts +0 -11
- package/generated/open_sea.ts +0 -33
- package/generated/outlook.ts +0 -37
- package/generated/pagerduty.ts +0 -362
- package/generated/pandadoc.ts +0 -23
- package/generated/peopledatalabs.ts +0 -24
- package/generated/perplexityai.ts +0 -10
- package/generated/piggy.ts +0 -8
- package/generated/pipedrive.ts +0 -288
- package/generated/placekey.ts +0 -12
- package/generated/posthog.ts +0 -367
- package/generated/precoro.ts +0 -8
- package/generated/printnode.ts +0 -8
- package/generated/process_street.ts +0 -14
- package/generated/productboard.ts +0 -8
- package/generated/qualaroo.ts +0 -8
- package/generated/quickbooks.ts +0 -22
- package/generated/rafflys.ts +0 -8
- package/generated/ragic.ts +0 -10
- package/generated/ramp.ts +0 -17
- package/generated/ravenseotools.ts +0 -8
- package/generated/recallai.ts +0 -17
- package/generated/reddit.ts +0 -19
- package/generated/resend.ts +0 -27
- package/generated/retellai.ts +0 -19
- package/generated/retently.ts +0 -24
- package/generated/ring_central.ts +0 -8
- package/generated/rippling.ts +0 -8
- package/generated/rocket_reach.ts +0 -8
- package/generated/rocketlane.ts +0 -42
- package/generated/rootly.ts +0 -12
- package/generated/rosette_text_analytics.ts +0 -12
- package/generated/sage.ts +0 -8
- package/generated/salesforce.ts +0 -46
- package/generated/scrape_do.ts +0 -28
- package/generated/scrapingant.ts +0 -14
- package/generated/screenshotone.ts +0 -10
- package/generated/seismic.ts +0 -8
- package/generated/semanticscholar.ts +0 -23
- package/generated/semrush.ts +0 -45
- package/generated/sendgrid.ts +0 -384
- package/generated/sentry.ts +0 -185
- package/generated/serpapi.ts +0 -32
- package/generated/servicem8.ts +0 -37
- package/generated/servicenow.ts +0 -14
- package/generated/share_point.ts +0 -15
- package/generated/shopify.ts +0 -37
- package/generated/shortcut.ts +0 -131
- package/generated/simplesat.ts +0 -11
- package/generated/slack.d.ts +0 -16
- package/generated/slack.js +0 -11
- package/generated/slack.ts +0 -24
- package/generated/slackbot.ts +0 -205
- package/generated/smartrecruiters.ts +0 -8
- package/generated/smugmug.ts +0 -14
- package/generated/snowflake.ts +0 -15
- package/generated/sourcegraph.ts +0 -16
- package/generated/square.ts +0 -8
- package/generated/stack_exchange.ts +0 -17
- package/generated/starton.ts +0 -11
- package/generated/storeganise.ts +0 -12
- package/generated/stripe.ts +0 -50
- package/generated/supabase.ts +0 -86
- package/generated/survey_monkey.ts +0 -8
- package/generated/tally.ts +0 -25
- package/generated/tapfiliate.ts +0 -11
- package/generated/tapform.ts +0 -8
- package/generated/tavily.ts +0 -10
- package/generated/terminus.ts +0 -8
- package/generated/text_to_pdf.ts +0 -10
- package/generated/textrazor.ts +0 -22
- package/generated/timecamp.ts +0 -10
- package/generated/timekit.ts +0 -8
- package/generated/timely.ts +0 -11
- package/generated/tinypng.ts +0 -15
- package/generated/tinyurl.ts +0 -10
- package/generated/tisane.ts +0 -15
- package/generated/todoist.ts +0 -19
- package/generated/toneden.ts +0 -8
- package/generated/tpscheck.ts +0 -10
- package/generated/trello.ts +0 -360
- package/generated/twitch.ts +0 -8
- package/generated/twitter.ts +0 -82
- package/generated/twitter_media.ts +0 -10
- package/generated/typefully.ts +0 -14
- package/generated/venly.ts +0 -8
- package/generated/vero.ts +0 -8
- package/generated/visme.ts +0 -8
- package/generated/waboxapp.ts +0 -8
- package/generated/wakatime.ts +0 -8
- package/generated/wave_accounting.ts +0 -8
- package/generated/weathermap.ts +0 -10
- package/generated/webex.ts +0 -37
- package/generated/webflow.ts +0 -30
- package/generated/whatsapp.ts +0 -14
- package/generated/wiz.ts +0 -8
- package/generated/workiom.ts +0 -12
- package/generated/wrike.ts +0 -47
- package/generated/xero.ts +0 -13
- package/generated/yandex.ts +0 -13
- package/generated/ynab.ts +0 -8
- package/generated/yousearch.ts +0 -10
- package/generated/youtube.ts +0 -26
- package/generated/zendesk.ts +0 -23
- package/generated/zenrows.ts +0 -25
- package/generated/zenserp.ts +0 -20
- package/generated/zoho.ts +0 -33
- package/generated/zoho_bigin.ts +0 -21
- package/generated/zoho_books.ts +0 -8
- package/generated/zoho_desk.ts +0 -8
- package/generated/zoho_inventory.ts +0 -8
- package/generated/zoho_invoice.ts +0 -15
- package/generated/zoho_mail.ts +0 -8
- package/generated/zoom.ts +0 -181
- package/generated/zoominfo.ts +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CustomTool,
|
|
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,
|
|
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
|
-
*
|
|
663
|
-
*
|
|
664
|
-
|
|
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 -
|
|
668
|
-
* @
|
|
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
|
|
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
|
-
|
|
716
|
-
handle
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
toolkit
|
|
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
|
|
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:
|
|
873
|
+
toolkit: resolvedToolkit ?? match.toolkit
|
|
730
874
|
};
|
|
731
|
-
byFinalSlug.set(
|
|
732
|
-
|
|
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
|
-
|
|
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 {
|
|
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 };
|