@composio/core 0.6.11 → 0.8.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/README.md +1 -1
- package/dist/{CustomTool-D8cxWvi9.mjs → CustomTool-CVwF_isu.mjs} +1 -1
- package/dist/{CustomTool-B1b2MXbO.d.cts → CustomTool-DCrZcOUW.d.cts} +1 -1
- package/dist/{CustomTool-VQMc17af.d.mts → CustomTool-DJVmDusu.d.mts} +1 -1
- package/dist/{CustomTool-Cywkgg64.cjs → CustomTool-DnCSEC6t.cjs} +1 -1
- package/dist/{FileModifierErrors-DuKpNYju.cjs → FileModifierErrors-BYJBHiay.cjs} +57 -1
- package/dist/{FileModifierErrors-LQwvd6pa.mjs → FileModifierErrors-C7z16Dfi.mjs} +46 -2
- package/dist/{Telemetry-JZNofztq.cjs → Telemetry-Dm-0sewu.cjs} +1 -1
- package/dist/{Telemetry-BJ2KYlDT.mjs → Telemetry-kgWlkavX.mjs} +1 -1
- package/dist/{composio-D8u53qsy.d.mts → composio-DH5gDW5F.d.mts} +261 -206
- package/dist/{composio-ruMDVx1b.d.cts → composio-Dzaqn_PS.d.cts} +261 -206
- package/dist/{customTool.types-9jJUADW-.d.cts → customTool.types-BqC41wRt.d.cts} +21 -21
- package/dist/{customTool.types-C6-M75bi.d.mts → customTool.types-Xk-tbwbc.d.mts} +21 -21
- package/dist/experimental/index.cjs +2 -2
- package/dist/experimental/index.d.cts +2 -2
- package/dist/experimental/index.d.mts +3 -3
- package/dist/experimental/index.mjs +2 -2
- package/dist/{fileUtils.node-mlBa5nwX.mjs → fileUtils.node-Dq7ebZPC.mjs} +177 -12
- package/dist/{fileUtils.node-DsDsZfEl.cjs → fileUtils.node-DtnSRMWa.cjs} +177 -12
- package/dist/index.cjs +132 -17
- package/dist/index.d.cts +28 -7
- package/dist/index.d.mts +28 -7
- package/dist/index.mjs +131 -18
- package/dist/models/Files.node.cjs +10 -9
- package/dist/models/Files.node.d.cts +3 -2
- package/dist/models/Files.node.d.mts +3 -2
- package/dist/models/Files.node.mjs +10 -9
- package/dist/platform/node.cjs +6 -0
- package/dist/platform/node.d.cts +1 -1
- package/dist/platform/node.d.mts +1 -1
- package/dist/platform/node.mjs +6 -0
- package/dist/platform/workerd.cjs +6 -0
- package/dist/platform/workerd.d.cts +1 -1
- package/dist/platform/workerd.d.mts +1 -1
- package/dist/platform/workerd.mjs +6 -0
- package/dist/{tool.types-C5DMrBdm.d.cts → tool.types-B4k2Bnxc.d.cts} +49 -32
- package/dist/{tool.types-BGrE7Vqc.d.mts → tool.types-Cb-o48UU.d.mts} +49 -32
- package/dist/{types-WkBTUiQh.d.mts → types-BR-1DJRJ.d.mts} +3 -3
- package/dist/{types-DiL6FAZi.d.cts → types-HpJQ8K9l.d.mts} +10 -0
- package/dist/{types-DZaf5VcY.d.cts → types-gjJ_hDol.d.cts} +3 -3
- package/dist/{types-CXR6l5Sj.d.mts → types-pDNm1lYs.d.cts} +10 -0
- package/dist/utils/config-defaults/ConfigDefaults.node.cjs +1 -1
- 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.node.mjs +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.cjs +1 -1
- 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/config-defaults/ConfigDefaults.workerd.mjs +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.cjs +21 -17
- package/dist/utils/modifiers/FileToolModifier.node.d.cts +2 -2
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +2 -2
- package/dist/utils/modifiers/FileToolModifier.node.mjs +21 -17
- package/dist/utils/modifiers/FileToolModifier.workerd.cjs +3 -3
- package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.mjs +3 -3
- package/generated/ably.ts +20 -0
- package/generated/accelo.ts +8 -0
- package/generated/acculynx.ts +17 -0
- package/generated/active_campaign.ts +30 -0
- package/generated/adobe.ts +8 -0
- package/generated/adyntel.ts +12 -0
- package/generated/aero_workflow.ts +8 -0
- package/generated/affinity.ts +29 -0
- package/generated/agencyzoom.ts +108 -0
- package/generated/ahrefs.ts +49 -0
- package/generated/airtable.ts +26 -0
- package/generated/alchemy.ts +16 -0
- package/generated/algolia.ts +39 -0
- package/generated/altoviz.ts +18 -0
- package/generated/amazon.ts +8 -0
- package/generated/amcards.ts +11 -0
- package/generated/amplitude.ts +25 -0
- package/generated/anthropic_administrator.ts +13 -0
- package/generated/apaleo.ts +38 -0
- package/generated/apollo.ts +40 -0
- package/generated/appdrag.ts +8 -0
- package/generated/appsflyer.ts +8 -0
- package/generated/asana.ts +95 -0
- package/generated/ashby.ts +8 -0
- package/generated/atlassian.ts +8 -0
- package/generated/attio.ts +20 -0
- package/generated/auth0.ts +8 -0
- package/generated/axonaut.ts +8 -0
- package/generated/bamboohr.ts +168 -0
- package/generated/bannerbear.ts +17 -0
- package/generated/baserow.ts +11 -0
- package/generated/battlenet.ts +8 -0
- package/generated/beeminder.ts +14 -0
- package/generated/bigmailer.ts +12 -0
- package/generated/bigml.ts +15 -0
- package/generated/bill.ts +218 -0
- package/generated/bitbucket.ts +25 -0
- package/generated/bitwarden.ts +8 -0
- package/generated/blackbaud.ts +8 -0
- package/generated/blackboard.ts +323 -0
- package/generated/boldsign.ts +8 -0
- package/generated/bolna.ts +24 -0
- package/generated/borneo.ts +162 -0
- package/generated/botbaba.ts +8 -0
- package/generated/box.ts +282 -0
- package/generated/braintree.ts +8 -0
- package/generated/brandfetch.ts +15 -0
- package/generated/breezy_hr.ts +8 -0
- package/generated/brevo.ts +28 -0
- package/generated/brex.ts +8 -0
- package/generated/brex_staging.ts +8 -0
- package/generated/brightpearl.ts +8 -0
- package/generated/brilliant_directories.ts +15 -0
- package/generated/browseai.ts +18 -0
- package/generated/browserbase_tool.ts +10 -0
- package/generated/browserhub.ts +8 -0
- package/generated/browserless.ts +16 -0
- package/generated/bubble.ts +8 -0
- package/generated/bugbug.ts +13 -0
- package/generated/builtwith.ts +21 -0
- package/generated/cal.ts +150 -0
- package/generated/calendly.ts +51 -0
- package/generated/canva.ts +41 -0
- package/generated/canvas.ts +100 -0
- package/generated/chatwork.ts +17 -0
- package/generated/chmeetings.ts +8 -0
- package/generated/clickup.ts +153 -0
- package/generated/clockify.ts +23 -0
- package/generated/close.ts +15 -0
- package/generated/cloudflare.ts +10 -0
- package/generated/coda.ts +115 -0
- package/generated/codeinterpreter.ts +14 -0
- package/generated/coinbase.ts +15 -0
- package/generated/coinmarketcal.ts +8 -0
- package/generated/composio.ts +34 -0
- package/generated/composio_search.ts +22 -0
- package/generated/confluence.ts +199 -0
- package/generated/contentful.ts +12 -0
- package/generated/crustdata.ts +23 -0
- package/generated/customer_io.ts +8 -0
- package/generated/cutt_ly.ts +10 -0
- package/generated/d2lbrightspace.ts +54 -0
- package/generated/dailybot.ts +15 -0
- package/generated/datadog.ts +47 -0
- package/generated/datagma.ts +8 -0
- package/generated/datarobot.ts +8 -0
- package/generated/deel.ts +8 -0
- package/generated/demio.ts +8 -0
- package/generated/dialpad.ts +201 -0
- package/generated/digicert.ts +15 -0
- package/generated/discord.ts +17 -0
- package/generated/discordbot.ts +173 -0
- package/generated/docmosis.ts +8 -0
- package/generated/docusign.ts +351 -0
- package/generated/dropbox.ts +20 -0
- package/generated/dropbox_sign.ts +8 -0
- package/generated/dynamics365.ts +25 -0
- package/generated/echtpost.ts +10 -0
- package/generated/elevenlabs.ts +70 -0
- package/generated/emailoctopus.ts +16 -0
- package/generated/enigma.ts +11 -0
- package/generated/entelligence.ts +11 -0
- package/generated/epic_games.ts +8 -0
- package/generated/eventbrite.ts +12 -0
- package/generated/exa.ts +13 -0
- package/generated/excel.ts +34 -0
- package/generated/exist.ts +8 -0
- package/generated/facebook.ts +8 -0
- package/generated/factorial.ts +8 -0
- package/generated/figma.ts +59 -0
- package/generated/finage.ts +19 -0
- package/generated/firecrawl.ts +16 -0
- package/generated/fireflies.ts +21 -0
- package/generated/fitbit.ts +8 -0
- package/generated/flutterwave.ts +33 -0
- package/generated/fomo.ts +10 -0
- package/generated/formcarry.ts +10 -0
- package/generated/formsite.ts +14 -0
- package/generated/foursquare.ts +14 -0
- package/generated/freshbooks.ts +11 -0
- package/generated/freshdesk.ts +16 -0
- package/generated/front.ts +8 -0
- package/generated/github.ts +967 -0
- package/generated/gitlab.ts +82 -0
- package/generated/gmail.d.ts +86 -0
- package/generated/gmail.js +13 -0
- package/generated/gmail.ts +95 -0
- package/generated/go_to_webinar.ts +8 -0
- package/generated/gong.ts +63 -0
- package/generated/google_analytics.ts +13 -0
- package/generated/google_maps.ts +16 -0
- package/generated/googleads.ts +14 -0
- package/generated/googlebigquery.ts +10 -0
- package/generated/googlecalendar.ts +39 -0
- package/generated/googledocs.ts +41 -0
- package/generated/googledrive.ts +62 -0
- package/generated/googlemeet.ts +18 -0
- package/generated/googlephotos.ts +22 -0
- package/generated/googlesheets.ts +40 -0
- package/generated/googleslides.ts +8 -0
- package/generated/googlesuper.ts +230 -0
- package/generated/googletasks.ts +23 -0
- package/generated/gorgias.ts +41 -0
- package/generated/gumroad.ts +14 -0
- package/generated/guru.ts +8 -0
- package/generated/hackernews.ts +15 -0
- package/generated/hackerrank_work.ts +8 -0
- package/generated/harvest.ts +56 -0
- package/generated/helcim.ts +8 -0
- package/generated/heygen.ts +44 -0
- package/generated/highlevel.ts +8 -0
- package/generated/hubspot.ts +252 -0
- package/generated/humanloop.ts +13 -0
- package/generated/icims_talent_cloud.ts +8 -0
- package/generated/idea_scale.ts +8 -0
- package/generated/index.ts +151 -0
- package/generated/insighto_ai.ts +19 -0
- package/generated/intercom.ts +52 -0
- package/generated/interzoid.ts +8 -0
- package/generated/jira.ts +59 -0
- package/generated/jotform.ts +15 -0
- package/generated/junglescout.ts +15 -0
- package/generated/keap.ts +8 -0
- package/generated/kibana.ts +58 -0
- package/generated/kit.ts +38 -0
- package/generated/klaviyo.ts +240 -0
- package/generated/klipfolio.ts +20 -0
- package/generated/kommo.ts +24 -0
- package/generated/lastpass.ts +8 -0
- package/generated/launch_darkly.ts +16 -0
- package/generated/leadfeeder.ts +13 -0
- package/generated/leadoku.ts +10 -0
- package/generated/lever.ts +8 -0
- package/generated/lever_sandbox.ts +8 -0
- package/generated/lexoffice.ts +8 -0
- package/generated/linear.ts +31 -0
- package/generated/linkedin.ts +13 -0
- package/generated/linkhut.ts +14 -0
- package/generated/linkup.ts +11 -0
- package/generated/listennotes.ts +35 -0
- package/generated/lmnt.ts +16 -0
- package/generated/lodgify.ts +10 -0
- package/generated/mailchimp.ts +285 -0
- package/generated/mailerlite.ts +8 -0
- package/generated/maintainx.ts +20 -0
- package/generated/make.ts +12 -0
- package/generated/mboum.ts +8 -0
- package/generated/mem0.ts +52 -0
- package/generated/metaads.ts +25 -0
- package/generated/metatextai.ts +8 -0
- package/generated/microsoft_clarity.ts +10 -0
- package/generated/microsoft_teams.ts +22 -0
- package/generated/microsoft_tenant.ts +8 -0
- package/generated/miro.ts +23 -0
- package/generated/mixpanel.ts +30 -0
- package/generated/mocean.ts +8 -0
- package/generated/monday.ts +30 -0
- package/generated/mopinion.ts +8 -0
- package/generated/more_trees.ts +10 -0
- package/generated/moxie.ts +8 -0
- package/generated/moz.ts +8 -0
- package/generated/mural.ts +14 -0
- package/generated/nasdaq.ts +15 -0
- package/generated/ncscale.ts +8 -0
- package/generated/neon.ts +78 -0
- package/generated/netsuite.ts +8 -0
- package/generated/nextdns.ts +11 -0
- package/generated/ngrok.ts +18 -0
- package/generated/notion.ts +40 -0
- package/generated/oncehub.ts +8 -0
- package/generated/one_drive.ts +49 -0
- package/generated/onepage.ts +11 -0
- package/generated/open_sea.ts +33 -0
- package/generated/outlook.ts +37 -0
- package/generated/pagerduty.ts +362 -0
- package/generated/pandadoc.ts +23 -0
- package/generated/peopledatalabs.ts +24 -0
- package/generated/perplexityai.ts +10 -0
- package/generated/piggy.ts +8 -0
- package/generated/pipedrive.ts +288 -0
- package/generated/placekey.ts +12 -0
- package/generated/posthog.ts +367 -0
- package/generated/precoro.ts +8 -0
- package/generated/printnode.ts +8 -0
- package/generated/process_street.ts +14 -0
- package/generated/productboard.ts +8 -0
- package/generated/qualaroo.ts +8 -0
- package/generated/quickbooks.ts +22 -0
- package/generated/rafflys.ts +8 -0
- package/generated/ragic.ts +10 -0
- package/generated/ramp.ts +17 -0
- package/generated/ravenseotools.ts +8 -0
- package/generated/recallai.ts +17 -0
- package/generated/reddit.ts +19 -0
- package/generated/resend.ts +27 -0
- package/generated/retellai.ts +19 -0
- package/generated/retently.ts +24 -0
- package/generated/ring_central.ts +8 -0
- package/generated/rippling.ts +8 -0
- package/generated/rocket_reach.ts +8 -0
- package/generated/rocketlane.ts +42 -0
- package/generated/rootly.ts +12 -0
- package/generated/rosette_text_analytics.ts +12 -0
- package/generated/sage.ts +8 -0
- package/generated/salesforce.ts +46 -0
- package/generated/scrape_do.ts +28 -0
- package/generated/scrapingant.ts +14 -0
- package/generated/screenshotone.ts +10 -0
- package/generated/seismic.ts +8 -0
- package/generated/semanticscholar.ts +23 -0
- package/generated/semrush.ts +45 -0
- package/generated/sendgrid.ts +384 -0
- package/generated/sentry.ts +185 -0
- package/generated/serpapi.ts +32 -0
- package/generated/servicem8.ts +37 -0
- package/generated/servicenow.ts +14 -0
- package/generated/share_point.ts +15 -0
- package/generated/shopify.ts +37 -0
- package/generated/shortcut.ts +131 -0
- package/generated/simplesat.ts +11 -0
- package/generated/slack.d.ts +16 -0
- package/generated/slack.js +11 -0
- package/generated/slack.ts +24 -0
- package/generated/slackbot.ts +205 -0
- package/generated/smartrecruiters.ts +8 -0
- package/generated/smugmug.ts +14 -0
- package/generated/snowflake.ts +15 -0
- package/generated/sourcegraph.ts +16 -0
- package/generated/square.ts +8 -0
- package/generated/stack_exchange.ts +17 -0
- package/generated/starton.ts +11 -0
- package/generated/storeganise.ts +12 -0
- package/generated/stripe.ts +50 -0
- package/generated/supabase.ts +86 -0
- package/generated/survey_monkey.ts +8 -0
- package/generated/tally.ts +25 -0
- package/generated/tapfiliate.ts +11 -0
- package/generated/tapform.ts +8 -0
- package/generated/tavily.ts +10 -0
- package/generated/terminus.ts +8 -0
- package/generated/text_to_pdf.ts +10 -0
- package/generated/textrazor.ts +22 -0
- package/generated/timecamp.ts +10 -0
- package/generated/timekit.ts +8 -0
- package/generated/timely.ts +11 -0
- package/generated/tinypng.ts +15 -0
- package/generated/tinyurl.ts +10 -0
- package/generated/tisane.ts +15 -0
- package/generated/todoist.ts +19 -0
- package/generated/toneden.ts +8 -0
- package/generated/tpscheck.ts +10 -0
- package/generated/trello.ts +360 -0
- package/generated/twitch.ts +8 -0
- package/generated/twitter.ts +82 -0
- package/generated/twitter_media.ts +10 -0
- package/generated/typefully.ts +14 -0
- package/generated/venly.ts +8 -0
- package/generated/vero.ts +8 -0
- package/generated/visme.ts +8 -0
- package/generated/waboxapp.ts +8 -0
- package/generated/wakatime.ts +8 -0
- package/generated/wave_accounting.ts +8 -0
- package/generated/weathermap.ts +10 -0
- package/generated/webex.ts +37 -0
- package/generated/webflow.ts +30 -0
- package/generated/whatsapp.ts +14 -0
- package/generated/wiz.ts +8 -0
- package/generated/workiom.ts +12 -0
- package/generated/wrike.ts +47 -0
- package/generated/xero.ts +13 -0
- package/generated/yandex.ts +13 -0
- package/generated/ynab.ts +8 -0
- package/generated/yousearch.ts +10 -0
- package/generated/youtube.ts +26 -0
- package/generated/zendesk.ts +23 -0
- package/generated/zenrows.ts +25 -0
- package/generated/zenserp.ts +20 -0
- package/generated/zoho.ts +33 -0
- package/generated/zoho_bigin.ts +21 -0
- package/generated/zoho_books.ts +8 -0
- package/generated/zoho_desk.ts +8 -0
- package/generated/zoho_inventory.ts +8 -0
- package/generated/zoho_invoice.ts +15 -0
- package/generated/zoho_mail.ts +8 -0
- package/generated/zoom.ts +181 -0
- package/generated/zoominfo.ts +26 -0
- package/package.json +1 -1
- package/src/platform/node.ts +8 -0
- package/src/platform/types.ts +12 -0
- package/src/platform/workerd.ts +12 -0
- /package/dist/{FileToolModifier.utils.neutral-BcIR-cVE.mjs → FileToolModifier.utils.neutral-B7P7wn-b.mjs} +0 -0
- /package/dist/{FileToolModifier.utils.neutral-BdMpiyie.cjs → FileToolModifier.utils.neutral-Dfwqgimk.cjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as SessionMetaToolOptions, nn as ConnectionDataSchema, o as Tool, q as BaseComposioProvider, tn as ConnectionData, v as ToolProxyParams } from "./tool.types-B4k2Bnxc.cjs";
|
|
2
2
|
import z$1, { z } from "zod/v3";
|
|
3
3
|
import { ConnectedAccountUpdateStatusParams as UpdateConnectedAccountParams } from "@composio/client/resources/connected-accounts";
|
|
4
4
|
import { Composio } from "@composio/client";
|
|
@@ -1067,12 +1067,12 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
|
|
|
1067
1067
|
mode: z$1.ZodString;
|
|
1068
1068
|
isComposioManaged: z$1.ZodBoolean;
|
|
1069
1069
|
}, "strip", z$1.ZodTypeAny, {
|
|
1070
|
-
id: string;
|
|
1071
1070
|
mode: string;
|
|
1071
|
+
id: string;
|
|
1072
1072
|
isComposioManaged: boolean;
|
|
1073
1073
|
}, {
|
|
1074
|
-
id: string;
|
|
1075
1074
|
mode: string;
|
|
1075
|
+
id: string;
|
|
1076
1076
|
isComposioManaged: boolean;
|
|
1077
1077
|
}>>>;
|
|
1078
1078
|
connectedAccount: z$1.ZodOptional<z$1.ZodObject<{
|
|
@@ -1088,8 +1088,8 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
|
|
|
1088
1088
|
}, "strip", z$1.ZodTypeAny, {
|
|
1089
1089
|
isActive: boolean;
|
|
1090
1090
|
authConfig?: {
|
|
1091
|
-
id: string;
|
|
1092
1091
|
mode: string;
|
|
1092
|
+
id: string;
|
|
1093
1093
|
isComposioManaged: boolean;
|
|
1094
1094
|
} | null | undefined;
|
|
1095
1095
|
connectedAccount?: {
|
|
@@ -1099,8 +1099,8 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
|
|
|
1099
1099
|
}, {
|
|
1100
1100
|
isActive: boolean;
|
|
1101
1101
|
authConfig?: {
|
|
1102
|
-
id: string;
|
|
1103
1102
|
mode: string;
|
|
1103
|
+
id: string;
|
|
1104
1104
|
isComposioManaged: boolean;
|
|
1105
1105
|
} | null | undefined;
|
|
1106
1106
|
connectedAccount?: {
|
|
@@ -1109,15 +1109,15 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
|
|
|
1109
1109
|
} | undefined;
|
|
1110
1110
|
}>>;
|
|
1111
1111
|
}, "strip", z$1.ZodTypeAny, {
|
|
1112
|
-
name: string;
|
|
1113
1112
|
slug: string;
|
|
1113
|
+
name: string;
|
|
1114
1114
|
isNoAuth: boolean;
|
|
1115
1115
|
logo?: string | undefined;
|
|
1116
1116
|
connection?: {
|
|
1117
1117
|
isActive: boolean;
|
|
1118
1118
|
authConfig?: {
|
|
1119
|
-
id: string;
|
|
1120
1119
|
mode: string;
|
|
1120
|
+
id: string;
|
|
1121
1121
|
isComposioManaged: boolean;
|
|
1122
1122
|
} | null | undefined;
|
|
1123
1123
|
connectedAccount?: {
|
|
@@ -1126,15 +1126,15 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
|
|
|
1126
1126
|
} | undefined;
|
|
1127
1127
|
} | undefined;
|
|
1128
1128
|
}, {
|
|
1129
|
-
name: string;
|
|
1130
1129
|
slug: string;
|
|
1130
|
+
name: string;
|
|
1131
1131
|
logo?: string | undefined;
|
|
1132
1132
|
isNoAuth?: boolean | undefined;
|
|
1133
1133
|
connection?: {
|
|
1134
1134
|
isActive: boolean;
|
|
1135
1135
|
authConfig?: {
|
|
1136
|
-
id: string;
|
|
1137
1136
|
mode: string;
|
|
1137
|
+
id: string;
|
|
1138
1138
|
isComposioManaged: boolean;
|
|
1139
1139
|
} | null | undefined;
|
|
1140
1140
|
connectedAccount?: {
|
|
@@ -1156,12 +1156,12 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1156
1156
|
mode: z$1.ZodString;
|
|
1157
1157
|
isComposioManaged: z$1.ZodBoolean;
|
|
1158
1158
|
}, "strip", z$1.ZodTypeAny, {
|
|
1159
|
-
id: string;
|
|
1160
1159
|
mode: string;
|
|
1160
|
+
id: string;
|
|
1161
1161
|
isComposioManaged: boolean;
|
|
1162
1162
|
}, {
|
|
1163
|
-
id: string;
|
|
1164
1163
|
mode: string;
|
|
1164
|
+
id: string;
|
|
1165
1165
|
isComposioManaged: boolean;
|
|
1166
1166
|
}>>>;
|
|
1167
1167
|
connectedAccount: z$1.ZodOptional<z$1.ZodObject<{
|
|
@@ -1177,8 +1177,8 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1177
1177
|
}, "strip", z$1.ZodTypeAny, {
|
|
1178
1178
|
isActive: boolean;
|
|
1179
1179
|
authConfig?: {
|
|
1180
|
-
id: string;
|
|
1181
1180
|
mode: string;
|
|
1181
|
+
id: string;
|
|
1182
1182
|
isComposioManaged: boolean;
|
|
1183
1183
|
} | null | undefined;
|
|
1184
1184
|
connectedAccount?: {
|
|
@@ -1188,8 +1188,8 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1188
1188
|
}, {
|
|
1189
1189
|
isActive: boolean;
|
|
1190
1190
|
authConfig?: {
|
|
1191
|
-
id: string;
|
|
1192
1191
|
mode: string;
|
|
1192
|
+
id: string;
|
|
1193
1193
|
isComposioManaged: boolean;
|
|
1194
1194
|
} | null | undefined;
|
|
1195
1195
|
connectedAccount?: {
|
|
@@ -1198,15 +1198,15 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1198
1198
|
} | undefined;
|
|
1199
1199
|
}>>;
|
|
1200
1200
|
}, "strip", z$1.ZodTypeAny, {
|
|
1201
|
-
name: string;
|
|
1202
1201
|
slug: string;
|
|
1202
|
+
name: string;
|
|
1203
1203
|
isNoAuth: boolean;
|
|
1204
1204
|
logo?: string | undefined;
|
|
1205
1205
|
connection?: {
|
|
1206
1206
|
isActive: boolean;
|
|
1207
1207
|
authConfig?: {
|
|
1208
|
-
id: string;
|
|
1209
1208
|
mode: string;
|
|
1209
|
+
id: string;
|
|
1210
1210
|
isComposioManaged: boolean;
|
|
1211
1211
|
} | null | undefined;
|
|
1212
1212
|
connectedAccount?: {
|
|
@@ -1215,15 +1215,15 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1215
1215
|
} | undefined;
|
|
1216
1216
|
} | undefined;
|
|
1217
1217
|
}, {
|
|
1218
|
-
name: string;
|
|
1219
1218
|
slug: string;
|
|
1219
|
+
name: string;
|
|
1220
1220
|
logo?: string | undefined;
|
|
1221
1221
|
isNoAuth?: boolean | undefined;
|
|
1222
1222
|
connection?: {
|
|
1223
1223
|
isActive: boolean;
|
|
1224
1224
|
authConfig?: {
|
|
1225
|
-
id: string;
|
|
1226
1225
|
mode: string;
|
|
1226
|
+
id: string;
|
|
1227
1227
|
isComposioManaged: boolean;
|
|
1228
1228
|
} | null | undefined;
|
|
1229
1229
|
connectedAccount?: {
|
|
@@ -1236,15 +1236,15 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1236
1236
|
totalPages: z$1.ZodNumber;
|
|
1237
1237
|
}, "strip", z$1.ZodTypeAny, {
|
|
1238
1238
|
items: {
|
|
1239
|
-
name: string;
|
|
1240
1239
|
slug: string;
|
|
1240
|
+
name: string;
|
|
1241
1241
|
isNoAuth: boolean;
|
|
1242
1242
|
logo?: string | undefined;
|
|
1243
1243
|
connection?: {
|
|
1244
1244
|
isActive: boolean;
|
|
1245
1245
|
authConfig?: {
|
|
1246
|
-
id: string;
|
|
1247
1246
|
mode: string;
|
|
1247
|
+
id: string;
|
|
1248
1248
|
isComposioManaged: boolean;
|
|
1249
1249
|
} | null | undefined;
|
|
1250
1250
|
connectedAccount?: {
|
|
@@ -1257,15 +1257,15 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
|
|
|
1257
1257
|
cursor?: string | undefined;
|
|
1258
1258
|
}, {
|
|
1259
1259
|
items: {
|
|
1260
|
-
name: string;
|
|
1261
1260
|
slug: string;
|
|
1261
|
+
name: string;
|
|
1262
1262
|
logo?: string | undefined;
|
|
1263
1263
|
isNoAuth?: boolean | undefined;
|
|
1264
1264
|
connection?: {
|
|
1265
1265
|
isActive: boolean;
|
|
1266
1266
|
authConfig?: {
|
|
1267
|
-
id: string;
|
|
1268
1267
|
mode: string;
|
|
1268
|
+
id: string;
|
|
1269
1269
|
isComposioManaged: boolean;
|
|
1270
1270
|
} | null | undefined;
|
|
1271
1271
|
connectedAccount?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as SessionMetaToolOptions, nn as ConnectionDataSchema, o as Tool, q as BaseComposioProvider, tn as ConnectionData, v as ToolProxyParams } from "./tool.types-Cb-o48UU.mjs";
|
|
2
2
|
import { Composio } from "@composio/client";
|
|
3
3
|
import z, { z as z$1 } from "zod/v3";
|
|
4
4
|
import { ConnectedAccountUpdateStatusParams as UpdateConnectedAccountParams } from "@composio/client/resources/connected-accounts";
|
|
@@ -1067,12 +1067,12 @@ declare const ToolkitConnectionStateSchema: z.ZodObject<{
|
|
|
1067
1067
|
mode: z.ZodString;
|
|
1068
1068
|
isComposioManaged: z.ZodBoolean;
|
|
1069
1069
|
}, "strip", z.ZodTypeAny, {
|
|
1070
|
-
id: string;
|
|
1071
1070
|
mode: string;
|
|
1071
|
+
id: string;
|
|
1072
1072
|
isComposioManaged: boolean;
|
|
1073
1073
|
}, {
|
|
1074
|
-
id: string;
|
|
1075
1074
|
mode: string;
|
|
1075
|
+
id: string;
|
|
1076
1076
|
isComposioManaged: boolean;
|
|
1077
1077
|
}>>>;
|
|
1078
1078
|
connectedAccount: z.ZodOptional<z.ZodObject<{
|
|
@@ -1088,8 +1088,8 @@ declare const ToolkitConnectionStateSchema: z.ZodObject<{
|
|
|
1088
1088
|
}, "strip", z.ZodTypeAny, {
|
|
1089
1089
|
isActive: boolean;
|
|
1090
1090
|
authConfig?: {
|
|
1091
|
-
id: string;
|
|
1092
1091
|
mode: string;
|
|
1092
|
+
id: string;
|
|
1093
1093
|
isComposioManaged: boolean;
|
|
1094
1094
|
} | null | undefined;
|
|
1095
1095
|
connectedAccount?: {
|
|
@@ -1099,8 +1099,8 @@ declare const ToolkitConnectionStateSchema: z.ZodObject<{
|
|
|
1099
1099
|
}, {
|
|
1100
1100
|
isActive: boolean;
|
|
1101
1101
|
authConfig?: {
|
|
1102
|
-
id: string;
|
|
1103
1102
|
mode: string;
|
|
1103
|
+
id: string;
|
|
1104
1104
|
isComposioManaged: boolean;
|
|
1105
1105
|
} | null | undefined;
|
|
1106
1106
|
connectedAccount?: {
|
|
@@ -1109,15 +1109,15 @@ declare const ToolkitConnectionStateSchema: z.ZodObject<{
|
|
|
1109
1109
|
} | undefined;
|
|
1110
1110
|
}>>;
|
|
1111
1111
|
}, "strip", z.ZodTypeAny, {
|
|
1112
|
-
name: string;
|
|
1113
1112
|
slug: string;
|
|
1113
|
+
name: string;
|
|
1114
1114
|
isNoAuth: boolean;
|
|
1115
1115
|
logo?: string | undefined;
|
|
1116
1116
|
connection?: {
|
|
1117
1117
|
isActive: boolean;
|
|
1118
1118
|
authConfig?: {
|
|
1119
|
-
id: string;
|
|
1120
1119
|
mode: string;
|
|
1120
|
+
id: string;
|
|
1121
1121
|
isComposioManaged: boolean;
|
|
1122
1122
|
} | null | undefined;
|
|
1123
1123
|
connectedAccount?: {
|
|
@@ -1126,15 +1126,15 @@ declare const ToolkitConnectionStateSchema: z.ZodObject<{
|
|
|
1126
1126
|
} | undefined;
|
|
1127
1127
|
} | undefined;
|
|
1128
1128
|
}, {
|
|
1129
|
-
name: string;
|
|
1130
1129
|
slug: string;
|
|
1130
|
+
name: string;
|
|
1131
1131
|
logo?: string | undefined;
|
|
1132
1132
|
isNoAuth?: boolean | undefined;
|
|
1133
1133
|
connection?: {
|
|
1134
1134
|
isActive: boolean;
|
|
1135
1135
|
authConfig?: {
|
|
1136
|
-
id: string;
|
|
1137
1136
|
mode: string;
|
|
1137
|
+
id: string;
|
|
1138
1138
|
isComposioManaged: boolean;
|
|
1139
1139
|
} | null | undefined;
|
|
1140
1140
|
connectedAccount?: {
|
|
@@ -1156,12 +1156,12 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1156
1156
|
mode: z.ZodString;
|
|
1157
1157
|
isComposioManaged: z.ZodBoolean;
|
|
1158
1158
|
}, "strip", z.ZodTypeAny, {
|
|
1159
|
-
id: string;
|
|
1160
1159
|
mode: string;
|
|
1160
|
+
id: string;
|
|
1161
1161
|
isComposioManaged: boolean;
|
|
1162
1162
|
}, {
|
|
1163
|
-
id: string;
|
|
1164
1163
|
mode: string;
|
|
1164
|
+
id: string;
|
|
1165
1165
|
isComposioManaged: boolean;
|
|
1166
1166
|
}>>>;
|
|
1167
1167
|
connectedAccount: z.ZodOptional<z.ZodObject<{
|
|
@@ -1177,8 +1177,8 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1177
1177
|
}, "strip", z.ZodTypeAny, {
|
|
1178
1178
|
isActive: boolean;
|
|
1179
1179
|
authConfig?: {
|
|
1180
|
-
id: string;
|
|
1181
1180
|
mode: string;
|
|
1181
|
+
id: string;
|
|
1182
1182
|
isComposioManaged: boolean;
|
|
1183
1183
|
} | null | undefined;
|
|
1184
1184
|
connectedAccount?: {
|
|
@@ -1188,8 +1188,8 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1188
1188
|
}, {
|
|
1189
1189
|
isActive: boolean;
|
|
1190
1190
|
authConfig?: {
|
|
1191
|
-
id: string;
|
|
1192
1191
|
mode: string;
|
|
1192
|
+
id: string;
|
|
1193
1193
|
isComposioManaged: boolean;
|
|
1194
1194
|
} | null | undefined;
|
|
1195
1195
|
connectedAccount?: {
|
|
@@ -1198,15 +1198,15 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1198
1198
|
} | undefined;
|
|
1199
1199
|
}>>;
|
|
1200
1200
|
}, "strip", z.ZodTypeAny, {
|
|
1201
|
-
name: string;
|
|
1202
1201
|
slug: string;
|
|
1202
|
+
name: string;
|
|
1203
1203
|
isNoAuth: boolean;
|
|
1204
1204
|
logo?: string | undefined;
|
|
1205
1205
|
connection?: {
|
|
1206
1206
|
isActive: boolean;
|
|
1207
1207
|
authConfig?: {
|
|
1208
|
-
id: string;
|
|
1209
1208
|
mode: string;
|
|
1209
|
+
id: string;
|
|
1210
1210
|
isComposioManaged: boolean;
|
|
1211
1211
|
} | null | undefined;
|
|
1212
1212
|
connectedAccount?: {
|
|
@@ -1215,15 +1215,15 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1215
1215
|
} | undefined;
|
|
1216
1216
|
} | undefined;
|
|
1217
1217
|
}, {
|
|
1218
|
-
name: string;
|
|
1219
1218
|
slug: string;
|
|
1219
|
+
name: string;
|
|
1220
1220
|
logo?: string | undefined;
|
|
1221
1221
|
isNoAuth?: boolean | undefined;
|
|
1222
1222
|
connection?: {
|
|
1223
1223
|
isActive: boolean;
|
|
1224
1224
|
authConfig?: {
|
|
1225
|
-
id: string;
|
|
1226
1225
|
mode: string;
|
|
1226
|
+
id: string;
|
|
1227
1227
|
isComposioManaged: boolean;
|
|
1228
1228
|
} | null | undefined;
|
|
1229
1229
|
connectedAccount?: {
|
|
@@ -1236,15 +1236,15 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1236
1236
|
totalPages: z.ZodNumber;
|
|
1237
1237
|
}, "strip", z.ZodTypeAny, {
|
|
1238
1238
|
items: {
|
|
1239
|
-
name: string;
|
|
1240
1239
|
slug: string;
|
|
1240
|
+
name: string;
|
|
1241
1241
|
isNoAuth: boolean;
|
|
1242
1242
|
logo?: string | undefined;
|
|
1243
1243
|
connection?: {
|
|
1244
1244
|
isActive: boolean;
|
|
1245
1245
|
authConfig?: {
|
|
1246
|
-
id: string;
|
|
1247
1246
|
mode: string;
|
|
1247
|
+
id: string;
|
|
1248
1248
|
isComposioManaged: boolean;
|
|
1249
1249
|
} | null | undefined;
|
|
1250
1250
|
connectedAccount?: {
|
|
@@ -1257,15 +1257,15 @@ declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
|
|
|
1257
1257
|
cursor?: string | undefined;
|
|
1258
1258
|
}, {
|
|
1259
1259
|
items: {
|
|
1260
|
-
name: string;
|
|
1261
1260
|
slug: string;
|
|
1261
|
+
name: string;
|
|
1262
1262
|
logo?: string | undefined;
|
|
1263
1263
|
isNoAuth?: boolean | undefined;
|
|
1264
1264
|
connection?: {
|
|
1265
1265
|
isActive: boolean;
|
|
1266
1266
|
authConfig?: {
|
|
1267
|
-
id: string;
|
|
1268
1267
|
mode: string;
|
|
1268
|
+
id: string;
|
|
1269
1269
|
isComposioManaged: boolean;
|
|
1270
1270
|
} | null | undefined;
|
|
1271
1271
|
connectedAccount?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('../FileModifierErrors-
|
|
2
|
-
const require_CustomTool = require('../CustomTool-
|
|
1
|
+
require('../FileModifierErrors-BYJBHiay.cjs');
|
|
2
|
+
const require_CustomTool = require('../CustomTool-DnCSEC6t.cjs');
|
|
3
3
|
|
|
4
4
|
exports.experimental_createTool = require_CustomTool.createCustomTool;
|
|
5
5
|
exports.experimental_createToolkit = require_CustomTool.createCustomToolkit;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-
|
|
2
|
-
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-
|
|
1
|
+
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-BqC41wRt.cjs";
|
|
2
|
+
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-DCrZcOUW.cjs";
|
|
3
3
|
export { type CreateCustomToolParams, type CreateCustomToolkitParams, type CustomTool, type CustomToolExecuteFn, type CustomToolkit, type SessionContext, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../tool.types-
|
|
2
|
-
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-
|
|
3
|
-
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-
|
|
1
|
+
import "../tool.types-Cb-o48UU.mjs";
|
|
2
|
+
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-Xk-tbwbc.mjs";
|
|
3
|
+
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-DJVmDusu.mjs";
|
|
4
4
|
export { type CreateCustomToolParams, type CreateCustomToolkitParams, type CustomTool, type CustomToolExecuteFn, type CustomToolkit, type SessionContext, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-CWQeghP5.mjs";
|
|
2
|
-
import "../FileModifierErrors-
|
|
3
|
-
import { n as createCustomTool, r as createCustomToolkit } from "../CustomTool-
|
|
2
|
+
import "../FileModifierErrors-C7z16Dfi.mjs";
|
|
3
|
+
import { n as createCustomTool, r as createCustomToolkit } from "../CustomTool-CVwF_isu.mjs";
|
|
4
4
|
|
|
5
5
|
export { createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ComposioSensitiveFilePathBlockedError, c as logger_default, i as ComposioFileUploadPathNotAllowedError, l as COMPOSIO_DIR, m as TEMP_FILES_DIRECTORY_NAME, t as ComposioFileNotFoundError } from "./FileModifierErrors-C7z16Dfi.mjs";
|
|
2
2
|
import { i as getRandomShortId, n as base64ToUint8Array, r as uint8ArrayToBase64 } from "./buffer-yOtEsT4J.mjs";
|
|
3
3
|
import { platform } from "#platform";
|
|
4
4
|
import fs from "node:fs";
|
|
@@ -63,6 +63,151 @@ function assertSafeFileUploadPath(filePath, options) {
|
|
|
63
63
|
} });
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/utils/uploadDirAllowlist.node.ts
|
|
68
|
+
/**
|
|
69
|
+
* Allowlist for automatic file upload during tool execution.
|
|
70
|
+
*
|
|
71
|
+
* This is only consulted when `dangerouslyAllowAutoUploadDownloadFiles` is enabled.
|
|
72
|
+
* Manual `composio.files.upload()` calls are not subject to the allowlist.
|
|
73
|
+
*
|
|
74
|
+
* - A local path is accepted iff its real (symlink-resolved, absolute) path is
|
|
75
|
+
* inside one of the allowed directories on a path-component boundary.
|
|
76
|
+
* `/tmp/foo` allows `/tmp/foo/bar` but NOT `/tmp/foo-bar`.
|
|
77
|
+
* - URLs (`http(s)://…`) and `File`/`Blob` values never hit this check.
|
|
78
|
+
* - User-provided `fileUploadDirs` fully replaces the default `[~/.composio/temp]`.
|
|
79
|
+
* - On Windows, path comparisons are case-insensitive.
|
|
80
|
+
*/
|
|
81
|
+
function normalizeForCompare(p) {
|
|
82
|
+
return process.platform === "win32" ? p.toLowerCase() : p;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* True if `child` is equal to `parent` or nested inside it on a component
|
|
86
|
+
* boundary. Assumes both paths are absolute and normalized.
|
|
87
|
+
*/
|
|
88
|
+
function isInsideDir(child, parent) {
|
|
89
|
+
const a = normalizeForCompare(child);
|
|
90
|
+
const b = normalizeForCompare(parent);
|
|
91
|
+
if (a === b) return true;
|
|
92
|
+
const sep = path.sep;
|
|
93
|
+
const bWithSep = b.endsWith(sep) ? b : b + sep;
|
|
94
|
+
return a.startsWith(bWithSep);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns the real (symlink-resolved) absolute path when the target exists,
|
|
98
|
+
* else `null`. Mirrors the semantics of the sensitive-path util.
|
|
99
|
+
*/
|
|
100
|
+
function tryRealpath(absPath) {
|
|
101
|
+
try {
|
|
102
|
+
if (fs.existsSync(absPath)) return fs.realpathSync(absPath);
|
|
103
|
+
} catch {}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
function formatAllowlist(dirs) {
|
|
107
|
+
if (dirs.length === 0) return " (none configured — all local paths are blocked)";
|
|
108
|
+
return dirs.map((d) => ` - ${d}`).join("\n");
|
|
109
|
+
}
|
|
110
|
+
function buildHelpFooter(allowlist) {
|
|
111
|
+
return [
|
|
112
|
+
"",
|
|
113
|
+
"Allowed upload directories (fileUploadDirs):",
|
|
114
|
+
formatAllowlist(allowlist),
|
|
115
|
+
"",
|
|
116
|
+
"Fix one of the following:",
|
|
117
|
+
"",
|
|
118
|
+
" 1. Recommended — move the file under an allowed directory, or add your",
|
|
119
|
+
" directory to the allowlist:",
|
|
120
|
+
" new Composio({",
|
|
121
|
+
" fileUploadDirs: ['/abs/path/to/uploads', '~/.composio/temp'],",
|
|
122
|
+
" })",
|
|
123
|
+
" Note: user-provided `fileUploadDirs` REPLACES the default",
|
|
124
|
+
" `~/.composio/temp`. Include it explicitly if you want staged uploads",
|
|
125
|
+
" to keep working.",
|
|
126
|
+
"",
|
|
127
|
+
" 2. Pass the file by URL or as a File/Blob object instead of a filesystem",
|
|
128
|
+
" path. URLs and File objects are never path-checked.",
|
|
129
|
+
"",
|
|
130
|
+
" 3. (Dangerous) Bypass the allowlist entirely by opting into automatic",
|
|
131
|
+
" file upload/download from any readable path:",
|
|
132
|
+
" new Composio({ dangerouslyAllowAutoUploadDownloadFiles: true })",
|
|
133
|
+
" WARNING: This lets a prompt-injected or misbehaving tool read ANY",
|
|
134
|
+
" file the process can access. Only enable it in trusted, sandboxed",
|
|
135
|
+
" environments. The built-in sensitive-path denylist (.ssh, .aws,",
|
|
136
|
+
" .env, private SSH keys, etc.) still applies unless you also set",
|
|
137
|
+
" `sensitiveFileUploadProtection: false`."
|
|
138
|
+
].join("\n");
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @throws {ComposioFileNotFoundError} when `filePath` does not exist on disk.
|
|
142
|
+
* @throws {ComposioFileUploadPathNotAllowedError} when the resolved path is
|
|
143
|
+
* outside every entry of `allowlist`.
|
|
144
|
+
*/
|
|
145
|
+
function assertPathInsideUploadDirs(filePath, allowlist) {
|
|
146
|
+
const attempted = filePath;
|
|
147
|
+
const abs = path.resolve(filePath);
|
|
148
|
+
const real = tryRealpath(abs);
|
|
149
|
+
if (!real) {
|
|
150
|
+
const cwd = process.cwd();
|
|
151
|
+
const parent = path.dirname(abs);
|
|
152
|
+
const parentExists = (() => {
|
|
153
|
+
try {
|
|
154
|
+
return fs.existsSync(parent);
|
|
155
|
+
} catch {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
})();
|
|
159
|
+
throw new ComposioFileNotFoundError([
|
|
160
|
+
`Refusing to auto-upload "${attempted}": the file does not exist on disk.`,
|
|
161
|
+
"",
|
|
162
|
+
`Path attempted: ${attempted}`,
|
|
163
|
+
`Resolved to: ${abs}`,
|
|
164
|
+
`Process cwd: ${cwd}`,
|
|
165
|
+
`Parent exists: ${parentExists ? "yes (" + parent + ")" : "no (" + parent + ")"}`,
|
|
166
|
+
"",
|
|
167
|
+
"Common causes:",
|
|
168
|
+
" - Typo in the filename passed to the tool.",
|
|
169
|
+
" - Relative path resolved against the wrong working directory",
|
|
170
|
+
" (relative paths use process.cwd() at the moment of upload).",
|
|
171
|
+
" - File was deleted between the tool being called and the upload starting.",
|
|
172
|
+
"",
|
|
173
|
+
buildHelpFooter(allowlist)
|
|
174
|
+
].join("\n"), { meta: {
|
|
175
|
+
attempted,
|
|
176
|
+
resolved: abs,
|
|
177
|
+
cwd,
|
|
178
|
+
allowlist
|
|
179
|
+
} });
|
|
180
|
+
}
|
|
181
|
+
if (allowlist.length === 0) throw new ComposioFileUploadPathNotAllowedError([
|
|
182
|
+
`Refusing to auto-upload "${attempted}": no upload directories are configured.`,
|
|
183
|
+
"",
|
|
184
|
+
`Path attempted: ${attempted}`,
|
|
185
|
+
`Resolved to: ${real}`,
|
|
186
|
+
"",
|
|
187
|
+
"Automatic file upload during tool execution is locked down by default",
|
|
188
|
+
"to prevent a prompt-injected tool from exfiltrating server files",
|
|
189
|
+
"(source code, .env, SSH keys, etc.).",
|
|
190
|
+
buildHelpFooter(allowlist)
|
|
191
|
+
].join("\n"), { meta: {
|
|
192
|
+
attempted,
|
|
193
|
+
resolved: real,
|
|
194
|
+
allowlist
|
|
195
|
+
} });
|
|
196
|
+
for (const dir of allowlist) if (isInsideDir(real, tryRealpath(dir) ?? path.resolve(dir))) return;
|
|
197
|
+
throw new ComposioFileUploadPathNotAllowedError([
|
|
198
|
+
`Refusing to auto-upload "${attempted}": resolved path is not inside any`,
|
|
199
|
+
"directory in the configured `fileUploadDirs` allowlist.",
|
|
200
|
+
"",
|
|
201
|
+
`Path attempted: ${attempted}`,
|
|
202
|
+
`Resolved to: ${real}`,
|
|
203
|
+
buildHelpFooter(allowlist)
|
|
204
|
+
].join("\n"), { meta: {
|
|
205
|
+
attempted,
|
|
206
|
+
resolved: real,
|
|
207
|
+
allowlist
|
|
208
|
+
} });
|
|
209
|
+
}
|
|
210
|
+
|
|
66
211
|
//#endregion
|
|
67
212
|
//#region src/utils/fileUtils.node.ts
|
|
68
213
|
const getExtensionFromMimeType = (mimeType) => {
|
|
@@ -195,9 +340,11 @@ const readFile = async (file) => {
|
|
|
195
340
|
else return await readFileContent(file);
|
|
196
341
|
throw new Error("Invalid file type");
|
|
197
342
|
};
|
|
198
|
-
const getFileDataAfterUploadingToS3 = async (file, { toolSlug, toolkitSlug, client, sensitiveFileUploadProtection, fileUploadPathDenySegments }) => {
|
|
343
|
+
const getFileDataAfterUploadingToS3 = async (file, { toolSlug, toolkitSlug, client, sensitiveFileUploadProtection, fileUploadPathDenySegments, fileUploadAllowlist }) => {
|
|
199
344
|
if (!file) throw new Error("Either path or blob must be provided");
|
|
200
|
-
|
|
345
|
+
const isLocalPath = typeof file === "string" && !file.startsWith("http");
|
|
346
|
+
if (isLocalPath && fileUploadAllowlist !== void 0) assertPathInsideUploadDirs(file, fileUploadAllowlist);
|
|
347
|
+
if (sensitiveFileUploadProtection !== false && isLocalPath) assertSafeFileUploadPath(file, { additionalDenySegments: fileUploadPathDenySegments });
|
|
201
348
|
const fileData = await readFile(file);
|
|
202
349
|
logger_default.debug(`Uploading file to S3...`);
|
|
203
350
|
const s3key = await uploadFileToS3(platform.basename(fileData.fileName), fileData.content, toolSlug, toolkitSlug, fileData.mimeType, client);
|
|
@@ -208,7 +355,7 @@ const getFileDataAfterUploadingToS3 = async (file, { toolSlug, toolkitSlug, clie
|
|
|
208
355
|
s3key
|
|
209
356
|
};
|
|
210
357
|
};
|
|
211
|
-
const downloadFileFromS3 = async ({ toolSlug, s3Url, mimeType }) => {
|
|
358
|
+
const downloadFileFromS3 = async ({ toolSlug, s3Url, mimeType, fileDownloadDir }) => {
|
|
212
359
|
const response = await fetch(s3Url);
|
|
213
360
|
if (!response.ok) throw new Error(`Failed to download file: ${response.statusText}`);
|
|
214
361
|
const data = await response.arrayBuffer();
|
|
@@ -217,7 +364,10 @@ const downloadFileFromS3 = async ({ toolSlug, s3Url, mimeType }) => {
|
|
|
217
364
|
name: fileName,
|
|
218
365
|
mimeType,
|
|
219
366
|
s3Url,
|
|
220
|
-
filePath: saveFile(fileName, new Uint8Array(data),
|
|
367
|
+
filePath: saveFile(fileName, new Uint8Array(data), {
|
|
368
|
+
isTempFile: fileDownloadDir === void 0,
|
|
369
|
+
outputDir: fileDownloadDir
|
|
370
|
+
})
|
|
221
371
|
};
|
|
222
372
|
};
|
|
223
373
|
/**
|
|
@@ -253,19 +403,34 @@ const getComposioTempFilesDir = (createDirIfNotExists = false) => {
|
|
|
253
403
|
}
|
|
254
404
|
};
|
|
255
405
|
/**
|
|
256
|
-
* Saves a file to
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
406
|
+
* Saves a file to a local directory.
|
|
407
|
+
*
|
|
408
|
+
* Directory precedence (highest first):
|
|
409
|
+
* 1. `options.outputDir` (explicit, absolute or relative; created if missing)
|
|
410
|
+
* 2. `options.isTempFile === true` → `<home>/.composio/files`
|
|
411
|
+
* 3. fallback → `<home>/.composio`
|
|
412
|
+
*
|
|
413
|
+
* @returns The absolute path to the saved file, or `null` if the runtime has
|
|
414
|
+
* no filesystem (e.g. Cloudflare Workers) or the save failed.
|
|
261
415
|
*/
|
|
262
|
-
const saveFile = (file, content,
|
|
416
|
+
const saveFile = (file, content, options = {}) => {
|
|
417
|
+
const opts = typeof options === "boolean" ? { isTempFile: options } : options;
|
|
263
418
|
try {
|
|
264
419
|
if (!platform.supportsFileSystem) {
|
|
265
420
|
logger_default.debug("File system operations are not supported in this runtime environment");
|
|
266
421
|
return null;
|
|
267
422
|
}
|
|
268
|
-
|
|
423
|
+
let composioFilesDir;
|
|
424
|
+
if (opts.outputDir) {
|
|
425
|
+
const absDir = platform.joinPath(opts.outputDir);
|
|
426
|
+
try {
|
|
427
|
+
if (!platform.existsSync(absDir)) platform.mkdirSync(absDir);
|
|
428
|
+
composioFilesDir = absDir;
|
|
429
|
+
} catch (err) {
|
|
430
|
+
logger_default.warn(`fileDownloadDir "${absDir}" is not writable, falling back to the default (~/.composio/files). Error: ${err}`);
|
|
431
|
+
composioFilesDir = getComposioTempFilesDir(true);
|
|
432
|
+
}
|
|
433
|
+
} else composioFilesDir = opts.isTempFile ? getComposioTempFilesDir(true) : getComposioDir(true);
|
|
269
434
|
if (!composioFilesDir) return null;
|
|
270
435
|
const filePath = platform.joinPath(composioFilesDir, platform.basename(file));
|
|
271
436
|
logger_default.info(`Saving file to: ${filePath}`);
|