@composio/core 0.1.50 → 0.1.52
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/README.md +1 -0
- package/dist/index.cjs +308 -143
- package/dist/index.d.cts +6648 -13446
- package/dist/index.d.ts +6648 -13446
- package/dist/index.js +305 -142
- package/package.json +3 -3
- 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 -205
- package/generated/gmail.js +0 -150
- package/generated/gmail.ts +0 -223
- 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.d.ts +0 -377
- package/generated/index.js +0 -168
- package/generated/index.ts +0 -273
- 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 -8
- package/generated/slack.ts +0 -18
- 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
package/dist/index.cjs
CHANGED
|
@@ -52,12 +52,12 @@ __export(index_exports, {
|
|
|
52
52
|
ComposioCustomCreateResponseSchema: () => ComposioCustomCreateResponseSchema,
|
|
53
53
|
ComposioCustomToolsNotInitializedError: () => ComposioCustomToolsNotInitializedError,
|
|
54
54
|
ComposioError: () => ComposioError,
|
|
55
|
+
ComposioFailedToCreateConnectedAccountLink: () => ComposioFailedToCreateConnectedAccountLink,
|
|
55
56
|
ComposioGenerateURLParamsSchema: () => ComposioGenerateURLParamsSchema,
|
|
56
57
|
ComposioGenerateURLResponseSchema: () => ComposioGenerateURLResponseSchema,
|
|
57
58
|
ComposioGlobalExecuteToolFnNotSetError: () => ComposioGlobalExecuteToolFnNotSetError,
|
|
58
59
|
ComposioInvalidExecuteFunctionError: () => ComposioInvalidExecuteFunctionError,
|
|
59
60
|
ComposioInvalidModifierError: () => ComposioInvalidModifierError,
|
|
60
|
-
ComposioLinkConnectionDataSchema: () => ComposioLinkConnectionDataSchema,
|
|
61
61
|
ComposioMcpDeleteResponseSchema: () => ComposioMcpDeleteResponseSchema,
|
|
62
62
|
ComposioMcpListResponseSchema: () => ComposioMcpListResponseSchema,
|
|
63
63
|
ComposioMcpRetrieveResponseSchema: () => ComposioMcpRetrieveResponseSchema,
|
|
@@ -86,6 +86,8 @@ __export(index_exports, {
|
|
|
86
86
|
CreateAuthConfigParamsSchema: () => CreateAuthConfigParamsSchema,
|
|
87
87
|
CreateAuthConfigResponseSchema: () => CreateAuthConfigResponseSchema,
|
|
88
88
|
CreateComposioManagedAuthConfigParamsSchema: () => CreateComposioManagedAuthConfigParamsSchema,
|
|
89
|
+
CreateConnectedAccountLinkOptionsSchema: () => CreateConnectedAccountLinkOptionsSchema,
|
|
90
|
+
CreateConnectedAccountLinkResponseSchema: () => CreateConnectedAccountLinkResponseSchema,
|
|
89
91
|
CreateConnectedAccountOptionsSchema: () => CreateConnectedAccountOptionsSchema,
|
|
90
92
|
CreateConnectedAccountParamsSchema: () => CreateConnectedAccountParamsSchema,
|
|
91
93
|
CreateConnectedAccountResponseSchema: () => CreateConnectedAccountResponseSchema,
|
|
@@ -204,7 +206,6 @@ var AuthSchemeTypes = {
|
|
|
204
206
|
GOOGLE_SERVICE_ACCOUNT: "GOOGLE_SERVICE_ACCOUNT",
|
|
205
207
|
NO_AUTH: "NO_AUTH",
|
|
206
208
|
BASIC_WITH_JWT: "BASIC_WITH_JWT",
|
|
207
|
-
COMPOSIO_LINK: "COMPOSIO_LINK",
|
|
208
209
|
CALCOM_AUTH: "CALCOM_AUTH"
|
|
209
210
|
};
|
|
210
211
|
var AuthConfigCreationToolAccessConfigSchema = import_zod.z.object({
|
|
@@ -224,7 +225,6 @@ var AuthSchemeEnum = import_zod.z.enum([
|
|
|
224
225
|
"GOOGLE_SERVICE_ACCOUNT",
|
|
225
226
|
"NO_AUTH",
|
|
226
227
|
"BASIC_WITH_JWT",
|
|
227
|
-
"COMPOSIO_LINK",
|
|
228
228
|
"CALCOM_AUTH"
|
|
229
229
|
]);
|
|
230
230
|
var CreateCustomAuthConfigParamsSchema = import_zod.z.object({
|
|
@@ -322,8 +322,7 @@ var ConnectionStatuses = {
|
|
|
322
322
|
};
|
|
323
323
|
var RedirectableAuthSchemeSchema = import_zod2.z.enum([
|
|
324
324
|
AuthSchemeTypes.OAUTH1,
|
|
325
|
-
AuthSchemeTypes.OAUTH2
|
|
326
|
-
AuthSchemeTypes.COMPOSIO_LINK
|
|
325
|
+
AuthSchemeTypes.OAUTH2
|
|
327
326
|
]);
|
|
328
327
|
var BaseSchemeRaw = import_zod2.z.object({
|
|
329
328
|
// for posthog, freshdesk, zendesk, clickup and others
|
|
@@ -473,31 +472,6 @@ var CustomOauth1ConnectionDataSchema = Oauth1ActiveConnectionDataSchema.omit({
|
|
|
473
472
|
oauth_token_secret: import_zod2.z.string(),
|
|
474
473
|
oauth_token: import_zod2.z.string()
|
|
475
474
|
});
|
|
476
|
-
var ComposioLinkInitiatingSchema = BaseSchemeRaw.extend({
|
|
477
|
-
status: import_zod2.z.literal(ConnectionStatuses.INITIALIZING)
|
|
478
|
-
}).catchall(import_zod2.z.unknown());
|
|
479
|
-
var ComposioLinkConnectionDataSchema = import_zod2.z.discriminatedUnion("status", [
|
|
480
|
-
ComposioLinkInitiatingSchema,
|
|
481
|
-
ComposioLinkInitiatingSchema.extend({
|
|
482
|
-
status: import_zod2.z.literal(ConnectionStatuses.INITIATED),
|
|
483
|
-
redirectUrl: import_zod2.z.string()
|
|
484
|
-
}).catchall(import_zod2.z.unknown()),
|
|
485
|
-
ComposioLinkInitiatingSchema.extend({
|
|
486
|
-
status: import_zod2.z.literal(ConnectionStatuses.ACTIVE)
|
|
487
|
-
}).catchall(import_zod2.z.unknown()),
|
|
488
|
-
ComposioLinkInitiatingSchema.extend({
|
|
489
|
-
status: import_zod2.z.literal(ConnectionStatuses.FAILED),
|
|
490
|
-
error: import_zod2.z.string().optional(),
|
|
491
|
-
error_description: import_zod2.z.string().optional()
|
|
492
|
-
}).catchall(import_zod2.z.unknown()),
|
|
493
|
-
ComposioLinkInitiatingSchema.extend({
|
|
494
|
-
status: import_zod2.z.literal(ConnectionStatuses.EXPIRED),
|
|
495
|
-
expired_at: import_zod2.z.string().optional()
|
|
496
|
-
}).catchall(import_zod2.z.unknown()),
|
|
497
|
-
ComposioLinkInitiatingSchema.extend({
|
|
498
|
-
status: import_zod2.z.literal(ConnectionStatuses.INACTIVE)
|
|
499
|
-
}).catchall(import_zod2.z.unknown())
|
|
500
|
-
]);
|
|
501
475
|
var BillcomAuthInitiatingSchema = BaseSchemeRaw.extend({
|
|
502
476
|
status: import_zod2.z.literal(ConnectionStatuses.INITIALIZING)
|
|
503
477
|
}).catchall(import_zod2.z.unknown());
|
|
@@ -689,13 +663,6 @@ var ConnectionDataSchema = import_zod2.z.discriminatedUnion("authScheme", [
|
|
|
689
663
|
*/
|
|
690
664
|
val: Oauth2ConnectionDataSchema
|
|
691
665
|
}),
|
|
692
|
-
import_zod2.z.object({
|
|
693
|
-
authScheme: import_zod2.z.literal(AuthSchemeTypes.COMPOSIO_LINK),
|
|
694
|
-
/**
|
|
695
|
-
* the main connection data discriminated by auth scheme
|
|
696
|
-
*/
|
|
697
|
-
val: ComposioLinkConnectionDataSchema
|
|
698
|
-
}),
|
|
699
666
|
import_zod2.z.object({
|
|
700
667
|
authScheme: import_zod2.z.literal(AuthSchemeTypes.API_KEY),
|
|
701
668
|
/**
|
|
@@ -882,10 +849,11 @@ var ToolSchema = import_zod3.z.object({
|
|
|
882
849
|
description: import_zod3.z.string().optional().describe("The description of the tool"),
|
|
883
850
|
inputParameters: ParametersSchema.optional().describe("The input parameters of the tool"),
|
|
884
851
|
outputParameters: ParametersSchema.optional().describe("The output parameters of the tool"),
|
|
885
|
-
tags: import_zod3.z.
|
|
886
|
-
toolkit:
|
|
887
|
-
version: import_zod3.z.
|
|
888
|
-
|
|
852
|
+
tags: import_zod3.z.array(import_zod3.z.string()).describe("The tags of the tool. eg: Important").default([]).optional(),
|
|
853
|
+
toolkit: ToolkitSchema.describe("The toolkit of the tool").optional(),
|
|
854
|
+
version: import_zod3.z.string().describe('The version of the tool, e.g. "20250909_00"').optional(),
|
|
855
|
+
availableVersions: import_zod3.z.array(import_zod3.z.string()).describe("Available versions of the tool.").default([]).optional(),
|
|
856
|
+
scopes: import_zod3.z.array(import_zod3.z.string()).describe('The scopes of the tool. eg: ["task:add"]').optional()
|
|
889
857
|
});
|
|
890
858
|
var ToolListResponseSchema = import_zod3.z.object({
|
|
891
859
|
items: import_zod3.z.array(ToolSchema),
|
|
@@ -919,8 +887,8 @@ var ToolExecuteParamsSchema = import_zod3.z.object({
|
|
|
919
887
|
customConnectionData: CustomConnectionDataSchema.optional(),
|
|
920
888
|
arguments: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()).optional(),
|
|
921
889
|
userId: import_zod3.z.string().optional(),
|
|
922
|
-
//
|
|
923
|
-
version: import_zod3.z.string().optional(),
|
|
890
|
+
// we have no auth apps which can be execute
|
|
891
|
+
version: import_zod3.z.union([import_zod3.z.literal("latest"), import_zod3.z.string()]).optional(),
|
|
924
892
|
text: import_zod3.z.string().optional()
|
|
925
893
|
});
|
|
926
894
|
var ToolExecuteResponseSchema = import_zod3.z.object({
|
|
@@ -973,6 +941,19 @@ var getEnvVariable = (name, defaultValue = void 0) => {
|
|
|
973
941
|
return defaultValue;
|
|
974
942
|
}
|
|
975
943
|
};
|
|
944
|
+
var getEnvsWithPrefix = (prefix) => {
|
|
945
|
+
try {
|
|
946
|
+
if (process && process.env) {
|
|
947
|
+
return Object.fromEntries(
|
|
948
|
+
Object.entries(process.env).filter(([key]) => key.startsWith(prefix))
|
|
949
|
+
);
|
|
950
|
+
} else {
|
|
951
|
+
return {};
|
|
952
|
+
}
|
|
953
|
+
} catch (error) {
|
|
954
|
+
return {};
|
|
955
|
+
}
|
|
956
|
+
};
|
|
976
957
|
|
|
977
958
|
// src/utils/constants.ts
|
|
978
959
|
var COMPOSIO_DIR = ".composio";
|
|
@@ -1399,7 +1380,8 @@ var ComposioGlobalExecuteToolFnNotSetError = class extends ComposioError {
|
|
|
1399
1380
|
// src/errors/ConnectedAccountsErrors.ts
|
|
1400
1381
|
var ConnectedAccountErrorCodes = {
|
|
1401
1382
|
CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND",
|
|
1402
|
-
MULTIPLE_CONNECTED_ACCOUNTS: "MULTIPLE_CONNECTED_ACCOUNTS"
|
|
1383
|
+
MULTIPLE_CONNECTED_ACCOUNTS: "MULTIPLE_CONNECTED_ACCOUNTS",
|
|
1384
|
+
FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK: "FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK"
|
|
1403
1385
|
};
|
|
1404
1386
|
var ComposioConnectedAccountNotFoundError = class extends ComposioError {
|
|
1405
1387
|
constructor(message = "Connected account not found", options = {}) {
|
|
@@ -1425,6 +1407,15 @@ var ComposioMultipleConnectedAccountsError = class extends ComposioError {
|
|
|
1425
1407
|
this.name = "ComposioMultipleConnectedAccountsError";
|
|
1426
1408
|
}
|
|
1427
1409
|
};
|
|
1410
|
+
var ComposioFailedToCreateConnectedAccountLink = class extends ComposioError {
|
|
1411
|
+
constructor(message = "Failed to create connected account link", options = {}) {
|
|
1412
|
+
super(message, {
|
|
1413
|
+
...options,
|
|
1414
|
+
code: ConnectedAccountErrorCodes.FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK
|
|
1415
|
+
});
|
|
1416
|
+
this.name = "ComposioFailedToCreateConnectedAccountLink";
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1428
1419
|
|
|
1429
1420
|
// src/telemetry/Telemetry.ts
|
|
1430
1421
|
var import_client2 = require("@composio/client");
|
|
@@ -1943,6 +1934,21 @@ var ConnectedAccountListResponseSchema = import_zod6.z.object({
|
|
|
1943
1934
|
nextCursor: import_zod6.z.string().nullish().describe("The next cursor to paginate through the connected accounts"),
|
|
1944
1935
|
totalPages: import_zod6.z.number().describe("The total number of pages of connected accounts")
|
|
1945
1936
|
});
|
|
1937
|
+
var CreateConnectedAccountLinkOptionsSchema = import_zod6.z.object({
|
|
1938
|
+
/**
|
|
1939
|
+
* The url to redirect the user to post connecting their account.
|
|
1940
|
+
*
|
|
1941
|
+
* For sucessfull connections, you will get a query param called status=success
|
|
1942
|
+
* And for failed connections you will get a query param called satus=failed
|
|
1943
|
+
*
|
|
1944
|
+
* @example https://your-app.com/callback
|
|
1945
|
+
*
|
|
1946
|
+
*/
|
|
1947
|
+
callbackUrl: import_zod6.z.string().optional()
|
|
1948
|
+
});
|
|
1949
|
+
var CreateConnectedAccountLinkResponseSchema = import_zod6.z.object({
|
|
1950
|
+
redirectUrl: import_zod6.z.string()
|
|
1951
|
+
});
|
|
1946
1952
|
|
|
1947
1953
|
// src/utils/transform.ts
|
|
1948
1954
|
function transform(raw) {
|
|
@@ -1965,6 +1971,16 @@ function transform(raw) {
|
|
|
1965
1971
|
|
|
1966
1972
|
// src/utils/transformers/connectedAccounts.ts
|
|
1967
1973
|
function transformConnectedAccountResponse(response) {
|
|
1974
|
+
const parseState = (state) => {
|
|
1975
|
+
try {
|
|
1976
|
+
return state ? ConnectionDataSchema.parse(state) : void 0;
|
|
1977
|
+
} catch (error) {
|
|
1978
|
+
logger_default.warn("Unsupported auth scheme in connected account state, ignoring state field", {
|
|
1979
|
+
error
|
|
1980
|
+
});
|
|
1981
|
+
return void 0;
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1968
1984
|
return transform(response).with(ConnectedAccountRetrieveResponseSchema).using((response2) => ({
|
|
1969
1985
|
...response2,
|
|
1970
1986
|
authConfig: {
|
|
@@ -1974,7 +1990,7 @@ function transformConnectedAccountResponse(response) {
|
|
|
1974
1990
|
isDisabled: response2.auth_config.is_disabled
|
|
1975
1991
|
},
|
|
1976
1992
|
data: response2.data ?? void 0,
|
|
1977
|
-
state: response2.state,
|
|
1993
|
+
state: parseState(response2.state),
|
|
1978
1994
|
status: response2.status,
|
|
1979
1995
|
statusReason: response2.status_reason,
|
|
1980
1996
|
isDisabled: response2.is_disabled,
|
|
@@ -2677,13 +2693,26 @@ var FileToolModifier = class {
|
|
|
2677
2693
|
}
|
|
2678
2694
|
};
|
|
2679
2695
|
|
|
2696
|
+
// src/utils/toolkitVersion.ts
|
|
2697
|
+
var getToolkitVersion = (toolkitSlug, toolkitVersions) => {
|
|
2698
|
+
if (typeof toolkitVersions === "string") {
|
|
2699
|
+
return toolkitVersions;
|
|
2700
|
+
}
|
|
2701
|
+
const hasToolkitVersion = toolkitVersions && Object.keys(toolkitVersions).length > 0;
|
|
2702
|
+
if (hasToolkitVersion) {
|
|
2703
|
+
return toolkitVersions[toolkitSlug] ?? "latest";
|
|
2704
|
+
}
|
|
2705
|
+
return "latest";
|
|
2706
|
+
};
|
|
2707
|
+
|
|
2680
2708
|
// src/models/Tools.ts
|
|
2681
2709
|
var Tools = class {
|
|
2682
2710
|
client;
|
|
2683
2711
|
customTools;
|
|
2684
2712
|
provider;
|
|
2685
2713
|
autoUploadDownloadFiles;
|
|
2686
|
-
|
|
2714
|
+
toolkitVersions;
|
|
2715
|
+
constructor(client, provider, config) {
|
|
2687
2716
|
if (!client) {
|
|
2688
2717
|
throw new Error("ComposioClient is required");
|
|
2689
2718
|
}
|
|
@@ -2693,7 +2722,8 @@ var Tools = class {
|
|
|
2693
2722
|
this.client = client;
|
|
2694
2723
|
this.customTools = new CustomTools(client);
|
|
2695
2724
|
this.provider = provider;
|
|
2696
|
-
this.autoUploadDownloadFiles =
|
|
2725
|
+
this.autoUploadDownloadFiles = config?.autoUploadDownloadFiles ?? true;
|
|
2726
|
+
this.toolkitVersions = config?.toolkitVersions ?? "latest";
|
|
2697
2727
|
this.execute = this.execute.bind(this);
|
|
2698
2728
|
this.provider._setExecuteToolFn(this.execute);
|
|
2699
2729
|
this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
|
|
@@ -2715,7 +2745,8 @@ var Tools = class {
|
|
|
2715
2745
|
return ToolSchema.parse({
|
|
2716
2746
|
...tool,
|
|
2717
2747
|
inputParameters: tool.input_parameters,
|
|
2718
|
-
outputParameters: tool.output_parameters
|
|
2748
|
+
outputParameters: tool.output_parameters,
|
|
2749
|
+
availableVersions: tool.available_versions
|
|
2719
2750
|
});
|
|
2720
2751
|
}
|
|
2721
2752
|
/**
|
|
@@ -2738,46 +2769,6 @@ var Tools = class {
|
|
|
2738
2769
|
sessionInfo: response.session_info
|
|
2739
2770
|
});
|
|
2740
2771
|
}
|
|
2741
|
-
/**
|
|
2742
|
-
* Check if the connected account exists for the given tools.
|
|
2743
|
-
* @param {string} userId - The user id.
|
|
2744
|
-
* @param {ToolList} tools - The tools to check.
|
|
2745
|
-
* @returns {Promise<boolean>} True if the connected account exists for the given tools, false otherwise.
|
|
2746
|
-
*/
|
|
2747
|
-
async checkIfConnectedAccountExistsForTools(userIds, tools) {
|
|
2748
|
-
if (!tools.length) {
|
|
2749
|
-
return true;
|
|
2750
|
-
}
|
|
2751
|
-
const connectedAccounts = await this.client.connectedAccounts.list({
|
|
2752
|
-
user_ids: userIds
|
|
2753
|
-
});
|
|
2754
|
-
if (connectedAccounts.items.length === 0) {
|
|
2755
|
-
return false;
|
|
2756
|
-
}
|
|
2757
|
-
const connectedToolkitSlugs = connectedAccounts.items.reduce(
|
|
2758
|
-
(acc, account) => {
|
|
2759
|
-
if (account.toolkit.slug) {
|
|
2760
|
-
acc[account.toolkit.slug] = true;
|
|
2761
|
-
}
|
|
2762
|
-
return acc;
|
|
2763
|
-
},
|
|
2764
|
-
{}
|
|
2765
|
-
);
|
|
2766
|
-
const toolSlugs = tools.reduce(
|
|
2767
|
-
(acc, tool) => {
|
|
2768
|
-
acc[tool.slug] = true;
|
|
2769
|
-
return acc;
|
|
2770
|
-
},
|
|
2771
|
-
{}
|
|
2772
|
-
);
|
|
2773
|
-
for (const tool of Object.keys(toolSlugs)) {
|
|
2774
|
-
if (!connectedToolkitSlugs[tool]) {
|
|
2775
|
-
logger_default.warn(`Tool ${tool} requires a connected account but no connected account was found`);
|
|
2776
|
-
return false;
|
|
2777
|
-
}
|
|
2778
|
-
}
|
|
2779
|
-
return true;
|
|
2780
|
-
}
|
|
2781
2772
|
/**
|
|
2782
2773
|
* Get the connected account id for a given tool
|
|
2783
2774
|
* @param {string} userId - The user id
|
|
@@ -2903,32 +2894,59 @@ var Tools = class {
|
|
|
2903
2894
|
*
|
|
2904
2895
|
* This method fetches tools from the Composio API in raw format and combines them with
|
|
2905
2896
|
* any registered custom tools. The response can be filtered and modified as needed.
|
|
2897
|
+
* It provides access to the underlying tool data without provider-specific wrapping.
|
|
2906
2898
|
*
|
|
2907
|
-
* @param {ToolListParams}
|
|
2908
|
-
* @param {
|
|
2899
|
+
* @param {ToolListParams} query - Query parameters to filter the tools (required)
|
|
2900
|
+
* @param {GetRawComposioToolsOptions} [options] - Optional configuration for tool retrieval
|
|
2901
|
+
* @param {TransformToolSchemaModifier} [options.modifySchema] - Function to transform tool schemas
|
|
2909
2902
|
* @returns {Promise<ToolList>} List of tools matching the query criteria
|
|
2910
2903
|
*
|
|
2911
2904
|
* @example
|
|
2912
2905
|
* ```typescript
|
|
2913
|
-
* // Get
|
|
2914
|
-
* const
|
|
2906
|
+
* // Get tools from specific toolkits
|
|
2907
|
+
* const githubTools = await composio.tools.getRawComposioTools({
|
|
2908
|
+
* toolkits: ['github'],
|
|
2909
|
+
* limit: 10
|
|
2910
|
+
* });
|
|
2911
|
+
*
|
|
2912
|
+
* // Get specific tools by slug
|
|
2913
|
+
* const specificTools = await composio.tools.getRawComposioTools({
|
|
2914
|
+
* tools: ['GITHUB_GET_REPOS', 'HACKERNEWS_GET_USER']
|
|
2915
|
+
* });
|
|
2915
2916
|
*
|
|
2916
|
-
* // Get tools
|
|
2917
|
+
* // Get tools from specific toolkits
|
|
2917
2918
|
* const githubTools = await composio.tools.getRawComposioTools({
|
|
2918
2919
|
* toolkits: ['github'],
|
|
2919
2920
|
* limit: 10
|
|
2920
2921
|
* });
|
|
2921
2922
|
*
|
|
2922
2923
|
* // Get tools with schema transformation
|
|
2923
|
-
* const
|
|
2924
|
-
*
|
|
2924
|
+
* const customizedTools = await composio.tools.getRawComposioTools({
|
|
2925
|
+
* toolkits: ['github'],
|
|
2926
|
+
* limit: 5
|
|
2927
|
+
* }, {
|
|
2928
|
+
* modifySchema: ({ toolSlug, toolkitSlug, schema }) => {
|
|
2925
2929
|
* // Add custom properties to tool schema
|
|
2926
|
-
* return {
|
|
2930
|
+
* return {
|
|
2931
|
+
* ...schema,
|
|
2932
|
+
* customProperty: `Modified ${toolSlug} from ${toolkitSlug}`,
|
|
2933
|
+
* tags: [...(schema.tags || []), 'customized']
|
|
2934
|
+
* };
|
|
2927
2935
|
* }
|
|
2928
|
-
* );
|
|
2936
|
+
* });
|
|
2937
|
+
*
|
|
2938
|
+
* // Search for tools
|
|
2939
|
+
* const searchResults = await composio.tools.getRawComposioTools({
|
|
2940
|
+
* search: 'user management'
|
|
2941
|
+
* });
|
|
2942
|
+
*
|
|
2943
|
+
* // Get tools by authentication config
|
|
2944
|
+
* const authSpecificTools = await composio.tools.getRawComposioTools({
|
|
2945
|
+
* authConfigIds: ['auth_config_123']
|
|
2946
|
+
* });
|
|
2929
2947
|
* ```
|
|
2930
2948
|
*/
|
|
2931
|
-
async getRawComposioTools(query,
|
|
2949
|
+
async getRawComposioTools(query, options) {
|
|
2932
2950
|
if ("tools" in query && "toolkits" in query) {
|
|
2933
2951
|
throw new ValidationError(
|
|
2934
2952
|
"Invalid tool list parameters. You should not use tools and toolkits filter together."
|
|
@@ -2956,7 +2974,8 @@ var Tools = class {
|
|
|
2956
2974
|
..."tags" in queryParams.data ? { tags: queryParams.data.tags } : {},
|
|
2957
2975
|
..."scopes" in queryParams.data ? { scopes: queryParams.data.scopes } : {},
|
|
2958
2976
|
..."search" in queryParams.data ? { search: queryParams.data.search } : {},
|
|
2959
|
-
..."authConfigIds" in queryParams.data ? { auth_config_ids: queryParams.data.authConfigIds } : {}
|
|
2977
|
+
..."authConfigIds" in queryParams.data ? { auth_config_ids: queryParams.data.authConfigIds } : {},
|
|
2978
|
+
...{ toolkit_versions: this.toolkitVersions }
|
|
2960
2979
|
};
|
|
2961
2980
|
logger_default.debug(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
|
|
2962
2981
|
const tools = await this.client.tools.list(filters);
|
|
@@ -2971,7 +2990,8 @@ var Tools = class {
|
|
|
2971
2990
|
...caseTransformedTools,
|
|
2972
2991
|
...customTools
|
|
2973
2992
|
]);
|
|
2974
|
-
if (
|
|
2993
|
+
if (options?.modifySchema) {
|
|
2994
|
+
const modifier = options.modifySchema;
|
|
2975
2995
|
if (typeof modifier === "function") {
|
|
2976
2996
|
const modifiedPromises = modifiedTools.map(
|
|
2977
2997
|
(tool) => modifier({
|
|
@@ -2988,17 +3008,56 @@ var Tools = class {
|
|
|
2988
3008
|
return modifiedTools;
|
|
2989
3009
|
}
|
|
2990
3010
|
/**
|
|
2991
|
-
* Retrieves a tool by its
|
|
2992
|
-
*
|
|
2993
|
-
*
|
|
2994
|
-
*
|
|
3011
|
+
* Retrieves a specific tool by its slug from the Composio API.
|
|
3012
|
+
*
|
|
3013
|
+
* This method fetches a single tool in raw format without provider-specific wrapping,
|
|
3014
|
+
* providing direct access to the tool's schema and metadata. Tool versions are controlled
|
|
3015
|
+
* at the Composio SDK initialization level through the `toolkitVersions` configuration.
|
|
3016
|
+
*
|
|
3017
|
+
* @param {string} slug - The unique identifier of the tool (e.g., 'GITHUB_GET_REPOS')
|
|
3018
|
+
* @param {GetRawComposioToolBySlugOptions} [options] - Optional configuration for tool retrieval
|
|
3019
|
+
* @param {TransformToolSchemaModifier} [options.modifySchema] - Function to transform the tool schema
|
|
3020
|
+
* @returns {Promise<Tool>} The requested tool with its complete schema and metadata
|
|
2995
3021
|
*
|
|
2996
3022
|
* @example
|
|
2997
|
-
* ```
|
|
2998
|
-
*
|
|
3023
|
+
* ```typescript
|
|
3024
|
+
* // Get a tool by slug
|
|
3025
|
+
* const tool = await composio.tools.getRawComposioToolBySlug('GITHUB_GET_REPOS');
|
|
3026
|
+
* console.log(tool.name, tool.description);
|
|
3027
|
+
*
|
|
3028
|
+
* // Get a tool with schema transformation
|
|
3029
|
+
* const customizedTool = await composio.tools.getRawComposioToolBySlug(
|
|
3030
|
+
* 'SLACK_SEND_MESSAGE',
|
|
3031
|
+
* {
|
|
3032
|
+
* modifySchema: ({ toolSlug, toolkitSlug, schema }) => {
|
|
3033
|
+
* return {
|
|
3034
|
+
* ...schema,
|
|
3035
|
+
* description: `Enhanced ${schema.description} with custom modifications`,
|
|
3036
|
+
* customMetadata: {
|
|
3037
|
+
* lastModified: new Date().toISOString(),
|
|
3038
|
+
* toolkit: toolkitSlug
|
|
3039
|
+
* }
|
|
3040
|
+
* };
|
|
3041
|
+
* }
|
|
3042
|
+
* }
|
|
3043
|
+
* );
|
|
3044
|
+
*
|
|
3045
|
+
* // Get a custom tool (will check custom tools first)
|
|
3046
|
+
* const customTool = await composio.tools.getRawComposioToolBySlug('MY_CUSTOM_TOOL');
|
|
3047
|
+
*
|
|
3048
|
+
* // Access tool properties
|
|
3049
|
+
* const githubTool = await composio.tools.getRawComposioToolBySlug('GITHUB_CREATE_ISSUE');
|
|
3050
|
+
* console.log({
|
|
3051
|
+
* slug: githubTool.slug,
|
|
3052
|
+
* name: githubTool.name,
|
|
3053
|
+
* toolkit: githubTool.toolkit?.name,
|
|
3054
|
+
* version: githubTool.version,
|
|
3055
|
+
* availableVersions: githubTool.availableVersions,
|
|
3056
|
+
* inputParameters: githubTool.inputParameters
|
|
3057
|
+
* });
|
|
2999
3058
|
* ```
|
|
3000
3059
|
*/
|
|
3001
|
-
async getRawComposioToolBySlug(slug,
|
|
3060
|
+
async getRawComposioToolBySlug(slug, options) {
|
|
3002
3061
|
const customTool = await this.customTools.getCustomToolBySlug(slug);
|
|
3003
3062
|
if (customTool) {
|
|
3004
3063
|
logger_default.debug(`Found ${slug} to be a custom tool`, JSON.stringify(customTool, null, 2));
|
|
@@ -3008,14 +3067,17 @@ var Tools = class {
|
|
|
3008
3067
|
}
|
|
3009
3068
|
let tool;
|
|
3010
3069
|
try {
|
|
3011
|
-
tool = await this.client.tools.retrieve(slug
|
|
3070
|
+
tool = await this.client.tools.retrieve(slug, {
|
|
3071
|
+
toolkit_versions: this.toolkitVersions
|
|
3072
|
+
});
|
|
3012
3073
|
} catch (error) {
|
|
3013
3074
|
throw new ComposioToolNotFoundError(`Unable to retrieve tool with slug ${slug}`, {
|
|
3014
3075
|
cause: error
|
|
3015
3076
|
});
|
|
3016
3077
|
}
|
|
3017
3078
|
let [modifiedTool] = await this.applyDefaultSchemaModifiers([this.transformToolCases(tool)]);
|
|
3018
|
-
if (
|
|
3079
|
+
if (options?.modifySchema) {
|
|
3080
|
+
const modifier = options.modifySchema;
|
|
3019
3081
|
if (typeof modifier === "function") {
|
|
3020
3082
|
modifiedTool = await modifier({
|
|
3021
3083
|
toolSlug: slug,
|
|
@@ -3030,20 +3092,26 @@ var Tools = class {
|
|
|
3030
3092
|
}
|
|
3031
3093
|
/**
|
|
3032
3094
|
* Get a tool or list of tools based on the provided arguments.
|
|
3033
|
-
* This is an implementation method that handles
|
|
3095
|
+
* This is an implementation method that handles all overloads.
|
|
3034
3096
|
*
|
|
3035
3097
|
* @param {string} userId - The user id to get the tool(s) for
|
|
3036
3098
|
* @param {ToolListParams | string} arg2 - Either a slug string or filters object
|
|
3037
|
-
* @param {ProviderOptions<TProvider>} [
|
|
3099
|
+
* @param {ProviderOptions<TProvider> | ToolkitVersion} [arg3] - Optional provider options or version string
|
|
3100
|
+
* @param {ProviderOptions<TProvider>} [arg4] - Optional provider options (when arg3 is version)
|
|
3038
3101
|
* @returns {Promise<TToolCollection>} The tool collection
|
|
3039
3102
|
*/
|
|
3040
|
-
async get(userId, arg2,
|
|
3103
|
+
async get(userId, arg2, arg3) {
|
|
3104
|
+
const options = arg3;
|
|
3041
3105
|
const executeToolFn = this.createExecuteToolFn(userId, options);
|
|
3042
3106
|
if (typeof arg2 === "string") {
|
|
3043
|
-
const tool = await this.getRawComposioToolBySlug(arg2,
|
|
3107
|
+
const tool = await this.getRawComposioToolBySlug(arg2, {
|
|
3108
|
+
modifySchema: options?.modifySchema
|
|
3109
|
+
});
|
|
3044
3110
|
return this.provider.wrapTools([tool], executeToolFn);
|
|
3045
3111
|
} else {
|
|
3046
|
-
const tools = await this.getRawComposioTools(arg2,
|
|
3112
|
+
const tools = await this.getRawComposioTools(arg2, {
|
|
3113
|
+
modifySchema: options?.modifySchema
|
|
3114
|
+
});
|
|
3047
3115
|
return this.provider.wrapTools(tools, executeToolFn);
|
|
3048
3116
|
}
|
|
3049
3117
|
}
|
|
@@ -3133,7 +3201,7 @@ var Tools = class {
|
|
|
3133
3201
|
custom_connection_data: body.customConnectionData,
|
|
3134
3202
|
arguments: body.arguments,
|
|
3135
3203
|
user_id: body.userId,
|
|
3136
|
-
version: body.version,
|
|
3204
|
+
version: body.version ?? getToolkitVersion(tool.toolkit?.slug ?? "unknown", this.toolkitVersions),
|
|
3137
3205
|
text: body.text
|
|
3138
3206
|
});
|
|
3139
3207
|
result = this.transformToolExecuteResponse(result);
|
|
@@ -3193,25 +3261,34 @@ var Tools = class {
|
|
|
3193
3261
|
"CustomTools not initialized. Make sure Tools class is properly constructed."
|
|
3194
3262
|
);
|
|
3195
3263
|
}
|
|
3264
|
+
const executeParams = ToolExecuteParamsSchema.safeParse(body);
|
|
3265
|
+
if (!executeParams.success) {
|
|
3266
|
+
throw new ValidationError("Invalid tool execute parameters", { cause: executeParams.error });
|
|
3267
|
+
}
|
|
3196
3268
|
try {
|
|
3197
3269
|
const customTool = await this.customTools.getCustomToolBySlug(slug);
|
|
3198
3270
|
if (customTool) {
|
|
3199
|
-
return this.handleCustomToolExecution(customTool,
|
|
3271
|
+
return this.handleCustomToolExecution(customTool, executeParams.data, modifiers);
|
|
3200
3272
|
} else {
|
|
3201
3273
|
const composioTool = await this.getRawComposioToolBySlug(slug);
|
|
3202
3274
|
if (!composioTool) {
|
|
3203
|
-
throw new ComposioToolNotFoundError(
|
|
3275
|
+
throw new ComposioToolNotFoundError(
|
|
3276
|
+
`Tool with slug ${slug} version:${executeParams.data.version} not found`
|
|
3277
|
+
);
|
|
3204
3278
|
}
|
|
3205
|
-
return this.handleComposioToolExecution(composioTool,
|
|
3279
|
+
return this.handleComposioToolExecution(composioTool, executeParams.data, modifiers);
|
|
3206
3280
|
}
|
|
3207
3281
|
} catch (error) {
|
|
3208
|
-
throw new ComposioToolExecutionError(
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3282
|
+
throw new ComposioToolExecutionError(
|
|
3283
|
+
`Error executing tool ${slug} version:${executeParams.data.version}`,
|
|
3284
|
+
{
|
|
3285
|
+
originalError: error,
|
|
3286
|
+
meta: {
|
|
3287
|
+
toolSlug: slug,
|
|
3288
|
+
body
|
|
3289
|
+
}
|
|
3213
3290
|
}
|
|
3214
|
-
|
|
3291
|
+
);
|
|
3215
3292
|
}
|
|
3216
3293
|
}
|
|
3217
3294
|
/**
|
|
@@ -3958,6 +4035,70 @@ var ConnectedAccounts = class {
|
|
|
3958
4035
|
redirectUrl
|
|
3959
4036
|
);
|
|
3960
4037
|
}
|
|
4038
|
+
/**
|
|
4039
|
+
* @description Create a Composio Connect Link for a user to connect their account to a given auth config. This method will return an external link which you can use the user to connect their account.
|
|
4040
|
+
*
|
|
4041
|
+
* @docs https://docs.composio.dev/reference/connected-accounts/create-connected-account#create-a-composio-connect-link
|
|
4042
|
+
*
|
|
4043
|
+
* @param userId {string} - The external user ID to create the connected account for.
|
|
4044
|
+
* @param authConfigId {string} - The auth config ID to create the connected account for.
|
|
4045
|
+
* @param options {CreateConnectedAccountOptions} - Options for creating a new connected account.
|
|
4046
|
+
* @param options.callbackUrl {string} - The url to redirect the user to post connecting their account.
|
|
4047
|
+
* @returns {ConnectionRequest} Connection request object
|
|
4048
|
+
*
|
|
4049
|
+
* @example
|
|
4050
|
+
* ```typescript
|
|
4051
|
+
* // create a connection request and redirect the user to the redirect url
|
|
4052
|
+
* const connectionRequest = await composio.connectedAccounts.link('user_123', 'auth_config_123');
|
|
4053
|
+
* const redirectUrl = connectionRequest.redirectUrl;
|
|
4054
|
+
* console.log(`Visit: ${redirectUrl} to authenticate your account`);
|
|
4055
|
+
*
|
|
4056
|
+
* // Wait for the connection to be established
|
|
4057
|
+
* const connectedAccount = await connectionRequest.waitForConnection()
|
|
4058
|
+
* ```
|
|
4059
|
+
*
|
|
4060
|
+
* @example
|
|
4061
|
+
* ```typescript
|
|
4062
|
+
* // create a connection request and redirect the user to the redirect url
|
|
4063
|
+
* const connectionRequest = await composio.connectedAccounts.link('user_123', 'auth_config_123', {
|
|
4064
|
+
* callbackUrl: 'https://your-app.com/callback'
|
|
4065
|
+
* });
|
|
4066
|
+
* const redirectUrl = connectionRequest.redirectUrl;
|
|
4067
|
+
* console.log(`Visit: ${redirectUrl} to authenticate your account`);
|
|
4068
|
+
*
|
|
4069
|
+
* // Wait for the connection to be established
|
|
4070
|
+
* const connectedAccount = await composio.connectedAccounts.waitForConnection(connectionRequest.id);
|
|
4071
|
+
* ```
|
|
4072
|
+
*/
|
|
4073
|
+
async link(userId, authConfigId, options) {
|
|
4074
|
+
const requestOptions = await CreateConnectedAccountLinkOptionsSchema.safeParse(options || {});
|
|
4075
|
+
if (!requestOptions.success) {
|
|
4076
|
+
throw new ValidationError("Failed to parse create connected account link options", {
|
|
4077
|
+
cause: requestOptions.error
|
|
4078
|
+
});
|
|
4079
|
+
}
|
|
4080
|
+
try {
|
|
4081
|
+
const response = await this.client.link.create({
|
|
4082
|
+
auth_config_id: authConfigId,
|
|
4083
|
+
user_id: userId,
|
|
4084
|
+
...requestOptions?.data.callbackUrl && { callback_url: requestOptions.data.callbackUrl }
|
|
4085
|
+
});
|
|
4086
|
+
const connectionRequest = createConnectionRequest(
|
|
4087
|
+
this.client,
|
|
4088
|
+
response.connected_account_id,
|
|
4089
|
+
ConnectedAccountStatuses.INITIATED,
|
|
4090
|
+
response.redirect_url
|
|
4091
|
+
);
|
|
4092
|
+
return connectionRequest;
|
|
4093
|
+
} catch (error) {
|
|
4094
|
+
throw new ComposioFailedToCreateConnectedAccountLink(
|
|
4095
|
+
"Failed to create connected account link",
|
|
4096
|
+
{
|
|
4097
|
+
cause: error
|
|
4098
|
+
}
|
|
4099
|
+
);
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
3961
4102
|
/**
|
|
3962
4103
|
* Waits for a connection request to complete and become active.
|
|
3963
4104
|
*
|
|
@@ -4369,6 +4510,7 @@ var Toolkits = class {
|
|
|
4369
4510
|
* ```typescript
|
|
4370
4511
|
* const connectionRequest = await composio.toolkits.authorize(userId, 'github');
|
|
4371
4512
|
* ```
|
|
4513
|
+
*
|
|
4372
4514
|
*/
|
|
4373
4515
|
async authorize(userId, toolkitSlug, authConfigId) {
|
|
4374
4516
|
const toolkit = await this.getToolkitBySlug(toolkitSlug);
|
|
@@ -6171,6 +6313,31 @@ function getSDKConfig(baseUrl, apiKey) {
|
|
|
6171
6313
|
logger_default.debug("Environment", `Base URL: ${baseURLParsed}`);
|
|
6172
6314
|
return { baseURL: baseURLParsed, apiKey: apiKeyParsed };
|
|
6173
6315
|
}
|
|
6316
|
+
function getToolkitVersionsFromEnv(defaultVersions) {
|
|
6317
|
+
if (defaultVersions && typeof defaultVersions === "string") {
|
|
6318
|
+
return defaultVersions;
|
|
6319
|
+
}
|
|
6320
|
+
const envPrefixedVersions = getEnvsWithPrefix(`COMPOSIO_TOOLKIT_VERSION_`);
|
|
6321
|
+
const toolkitVersionsFromEnv = Object.entries(envPrefixedVersions).reduce((acc, [key, value]) => {
|
|
6322
|
+
const toolkitName = key.replace("COMPOSIO_TOOLKIT_VERSION_", "");
|
|
6323
|
+
acc[toolkitName.toLowerCase()] = value;
|
|
6324
|
+
return acc;
|
|
6325
|
+
}, {});
|
|
6326
|
+
let userProvidedToolkitVersions = {};
|
|
6327
|
+
if (defaultVersions && typeof defaultVersions === "object") {
|
|
6328
|
+
userProvidedToolkitVersions = Object.fromEntries(
|
|
6329
|
+
Object.entries(defaultVersions).map(([key, value]) => [key.toLowerCase(), value])
|
|
6330
|
+
);
|
|
6331
|
+
}
|
|
6332
|
+
const toolkitVersions = {
|
|
6333
|
+
...toolkitVersionsFromEnv,
|
|
6334
|
+
...userProvidedToolkitVersions
|
|
6335
|
+
};
|
|
6336
|
+
if (Object.keys(toolkitVersions).length === 0) {
|
|
6337
|
+
return "latest";
|
|
6338
|
+
}
|
|
6339
|
+
return toolkitVersions;
|
|
6340
|
+
}
|
|
6174
6341
|
|
|
6175
6342
|
// src/utils/version.ts
|
|
6176
6343
|
var import_semver = __toESM(require("semver"), 1);
|
|
@@ -6692,7 +6859,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
6692
6859
|
};
|
|
6693
6860
|
|
|
6694
6861
|
// package.json
|
|
6695
|
-
var version = "0.1.
|
|
6862
|
+
var version = "0.1.52";
|
|
6696
6863
|
|
|
6697
6864
|
// src/models/Files.ts
|
|
6698
6865
|
var Files = class {
|
|
@@ -6815,7 +6982,11 @@ var Composio = class _Composio {
|
|
|
6815
6982
|
}
|
|
6816
6983
|
this.config = {
|
|
6817
6984
|
...config,
|
|
6818
|
-
|
|
6985
|
+
baseURL: baseURLParsed,
|
|
6986
|
+
apiKey: apiKeyParsed,
|
|
6987
|
+
toolkitVersions: getToolkitVersionsFromEnv(config?.toolkitVersions),
|
|
6988
|
+
allowTracking: config?.allowTracking ?? true,
|
|
6989
|
+
autoUploadDownloadFiles: config?.autoUploadDownloadFiles ?? true
|
|
6819
6990
|
};
|
|
6820
6991
|
this.provider = config?.provider ?? new OpenAIProvider();
|
|
6821
6992
|
const defaultHeaders = getDefaultHeaders(this.config.defaultHeaders, this.provider);
|
|
@@ -6825,9 +6996,7 @@ var Composio = class _Composio {
|
|
|
6825
6996
|
defaultHeaders,
|
|
6826
6997
|
logLevel: COMPOSIO_LOG_LEVEL
|
|
6827
6998
|
});
|
|
6828
|
-
this.tools = new Tools(this.client, this.provider,
|
|
6829
|
-
autoUploadDownloadFiles: config?.autoUploadDownloadFiles ?? true
|
|
6830
|
-
});
|
|
6999
|
+
this.tools = new Tools(this.client, this.provider, this.config);
|
|
6831
7000
|
this.mcp = new MCP(this.client, this.provider);
|
|
6832
7001
|
this.toolkits = new Toolkits(this.client);
|
|
6833
7002
|
this.triggers = new Triggers(this.client);
|
|
@@ -6861,6 +7030,13 @@ var Composio = class _Composio {
|
|
|
6861
7030
|
}
|
|
6862
7031
|
return this.client;
|
|
6863
7032
|
}
|
|
7033
|
+
/**
|
|
7034
|
+
* Get the configuration SDK is initialized with
|
|
7035
|
+
* @returns {ComposioConfig<TProvider>} The configuration SDK is initialized with
|
|
7036
|
+
*/
|
|
7037
|
+
getConfig() {
|
|
7038
|
+
return this.config;
|
|
7039
|
+
}
|
|
6864
7040
|
/**
|
|
6865
7041
|
* Creates a new instance of the Composio SDK with custom request options while preserving the existing configuration.
|
|
6866
7042
|
* This method is particularly useful when you need to:
|
|
@@ -6980,19 +7156,6 @@ var AuthScheme = class {
|
|
|
6980
7156
|
}
|
|
6981
7157
|
};
|
|
6982
7158
|
}
|
|
6983
|
-
/**
|
|
6984
|
-
* Creates a ConnectionData object for Composio Link authentication
|
|
6985
|
-
* @returns ConnectionData object
|
|
6986
|
-
*/
|
|
6987
|
-
static ComposioLink(params) {
|
|
6988
|
-
return {
|
|
6989
|
-
authScheme: AuthSchemeTypes.COMPOSIO_LINK,
|
|
6990
|
-
val: {
|
|
6991
|
-
status: ConnectionStatuses.INITIALIZING,
|
|
6992
|
-
...params ?? {}
|
|
6993
|
-
}
|
|
6994
|
-
};
|
|
6995
|
-
}
|
|
6996
7159
|
/**
|
|
6997
7160
|
* Creates a ConnectionData object for API Key authentication
|
|
6998
7161
|
* @param params The API key parameters
|
|
@@ -7128,12 +7291,12 @@ var AuthScheme = class {
|
|
|
7128
7291
|
ComposioCustomCreateResponseSchema,
|
|
7129
7292
|
ComposioCustomToolsNotInitializedError,
|
|
7130
7293
|
ComposioError,
|
|
7294
|
+
ComposioFailedToCreateConnectedAccountLink,
|
|
7131
7295
|
ComposioGenerateURLParamsSchema,
|
|
7132
7296
|
ComposioGenerateURLResponseSchema,
|
|
7133
7297
|
ComposioGlobalExecuteToolFnNotSetError,
|
|
7134
7298
|
ComposioInvalidExecuteFunctionError,
|
|
7135
7299
|
ComposioInvalidModifierError,
|
|
7136
|
-
ComposioLinkConnectionDataSchema,
|
|
7137
7300
|
ComposioMcpDeleteResponseSchema,
|
|
7138
7301
|
ComposioMcpListResponseSchema,
|
|
7139
7302
|
ComposioMcpRetrieveResponseSchema,
|
|
@@ -7162,6 +7325,8 @@ var AuthScheme = class {
|
|
|
7162
7325
|
CreateAuthConfigParamsSchema,
|
|
7163
7326
|
CreateAuthConfigResponseSchema,
|
|
7164
7327
|
CreateComposioManagedAuthConfigParamsSchema,
|
|
7328
|
+
CreateConnectedAccountLinkOptionsSchema,
|
|
7329
|
+
CreateConnectedAccountLinkResponseSchema,
|
|
7165
7330
|
CreateConnectedAccountOptionsSchema,
|
|
7166
7331
|
CreateConnectedAccountParamsSchema,
|
|
7167
7332
|
CreateConnectedAccountResponseSchema,
|