@composio/core 0.14.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{BaseProvider-Dc5yKZhk.d.mts → BaseProvider-D7p2OPEx.d.mts} +267 -200
  2. package/dist/{CustomTool-4nVuwLzO.d.mts → CustomTool-Bk38kFp0.d.mts} +1 -1
  3. package/dist/{Telemetry-CF0rNHu2.mjs → Telemetry-DuGJSwUt.mjs} +2 -2
  4. package/dist/{cancellation-BbJ-UQ__.mjs → cancellation-NVtGf3St.mjs} +69 -1
  5. package/dist/{composio-ChU3eD9F.d.mts → composio-DSs-1AhC.d.mts} +8 -3
  6. package/dist/{customTool.types-CX2-LbfI.d.mts → customTool.types-cGHcIBX-.d.mts} +1 -1
  7. package/dist/experimental/index.d.mts +2 -2
  8. package/dist/{fileUtils.node-DOkW4PBg.mjs → fileUtils.node-BQ0fWge3.mjs} +5 -2
  9. package/dist/index.d.mts +20 -7
  10. package/dist/index.mjs +85 -43
  11. package/dist/models/Files.node.mjs +2 -2
  12. package/dist/platform/node.d.mts +1 -1
  13. package/dist/platform/node.mjs +24 -0
  14. package/dist/platform/workerd.d.mts +1 -1
  15. package/dist/platform/workerd.mjs +3 -0
  16. package/dist/{sensitiveFileUploadPaths-C43dHP7S.mjs → sensitiveFileUploadPaths-BVEt0peg.mjs} +12 -7
  17. package/dist/{types-D5N60gUD.d.mts → types-B4k-qoOf.d.mts} +2 -2
  18. package/dist/{types-DY1r-kN9.d.mts → types-D5A2wzBl.d.mts} +8 -0
  19. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
  20. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
  21. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  22. package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
  23. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  24. package/dist/utils/ssrfGuard.node.d.mts +2 -2
  25. package/dist/utils/ssrfGuard.node.mjs +3 -2
  26. package/package.json +6 -5
  27. package/src/index.ts +1 -0
  28. package/src/models/ToolRouterSessionFileMount.ts +3 -0
  29. package/src/models/Tools.ts +108 -77
  30. package/src/platform/node.ts +40 -0
  31. package/src/platform/types.ts +9 -0
  32. package/src/platform/workerd.ts +5 -0
  33. package/src/telemetry/redact.ts +6 -1
  34. package/src/types/tool.types.ts +60 -10
  35. package/src/utils/fileUtils.node.ts +3 -0
  36. package/src/utils/jsonSchema.ts +86 -1
  37. package/src/utils/modifiers/FileToolModifier.node.ts +3 -3
  38. package/src/utils/modifiers/FileToolModifier.utils.neutral.ts +6 -4
  39. package/src/utils/sdk.ts +2 -2
  40. package/src/utils/sensitiveFileUploadPaths.ts +12 -9
  41. package/src/utils/ssrfGuard.node.ts +6 -2
  42. package/src/utils/version.ts +21 -20
package/dist/index.mjs CHANGED
@@ -2,9 +2,9 @@ import { a as COMPOSIO_DIR, c as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, d a
2
2
  import { A as ToolErrorCodes, B as ComposioSharedAccessDeniedError, C as ComposioInvalidExecuteFunctionError, D as ComposioToolExecutionError, E as ComposioProviderNotDefinedError, F as ComposioAclOnlyForSharedError, H as ConnectedAccountErrorCodes, I as ComposioConnectedAccountNotFoundError, L as ComposioFailedToCreateConnectedAccountLink, M as ConnectionRequestErrorCodes, N as ConnectionRequestFailedError, O as ComposioToolNotFoundError, P as ConnectionRequestTimeoutError, R as ComposioLegacyConnectedAccountsEndpointRetiredError, S as ComposioGlobalExecuteToolFnNotSetError, T as ComposioInvalidToolArgumentsError, U as AuthConfigErrorCodes, V as ComposioSharedConnectionNotAccessibleError, W as ComposioAuthConfigNotFoundError, _ as ValidationError, a as ComposioFailedToSubscribeToPusherChannelError, b as ComposioToolkitNotFoundError, c as ComposioWebhookPayloadError, d as ComposioNoAPIKeyError, f as ComposioRequestCancelledError, g as JsonSchemaToZodError, h as JsonSchemaRefResolutionError, i as ComposioFailedToGetSDKRealtimeCredentialsError, j as handleToolExecutionError, k as ComposioToolVersionRequiredError, l as ComposioWebhookSignatureVerificationError, m as isRequestAbortError, n as RemoteFileErrorCodes, o as ComposioFailedToUnsubscribeFromPusherChannelError, p as SDKErrorCodes, r as ComposioFailedToCreatePusherClientError, s as ComposioTriggerTypeNotFoundError, t as RemoteFileDownloadError, u as TriggerErrorCodes, v as ValidationErrorCodes, w as ComposioInvalidModifierError, x as ToolkitErrorCodes, y as ComposioToolkitFetchError, z as ComposioMultipleConnectedAccountsError } from "./errors-BcEUHZbq.mjs";
3
3
  import { a as ComposioSensitiveFilePathBlockedError, i as ComposioFileUploadPathNotAllowedError, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, r as ComposioFileUploadError, t as ComposioFileNotFoundError } from "./FileModifierErrors-B8V8_3VE.mjs";
4
4
  import { r as schemaHasFileUploadable, t as isPlainObject } from "./FileToolModifier.utils.neutral-B5rT711M.mjs";
5
- import { a as removeNonRequiredProperties, i as jsonSchemaToZodSchema, n as deduplicateJsonSchemaRequiredArrays, r as dereferenceJsonSchema, t as withCancellation } from "./cancellation-BbJ-UQ__.mjs";
6
- import { t as telemetry } from "./Telemetry-CF0rNHu2.mjs";
7
- import { a as arrayBufferToBase64, c as getRandomShortId, i as readResponseBodyWithLimit, n as assertSafeFileUploadPath, r as isBlockedSensitiveFileUploadPath, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-C43dHP7S.mjs";
5
+ import { a as jsonSchemaToZodSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as removeNonRequiredProperties, r as dereferenceJsonSchema, t as withCancellation } from "./cancellation-NVtGf3St.mjs";
6
+ import { t as telemetry } from "./Telemetry-DuGJSwUt.mjs";
7
+ import { a as arrayBufferToBase64, c as getRandomShortId, i as readResponseBodyWithLimit, n as assertSafeFileUploadPath, r as isBlockedSensitiveFileUploadPath, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-BVEt0peg.mjs";
8
8
  import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-l-j5HtEf.mjs";
9
9
  import ComposioClient, { APIError, BadRequestError } from "@composio/client";
10
10
  import { FileToolModifier } from "#file_tool_modifier";
@@ -878,15 +878,15 @@ const JSONSchemaPropertySchema = z$1.object({
878
878
  allOf: z$1.lazy(() => z$1.array(JSONSchemaPropertySchema)).optional(),
879
879
  not: z$1.lazy(() => JSONSchemaPropertySchema).optional(),
880
880
  title: z$1.string().optional(),
881
- default: z$1.any().optional(),
881
+ default: z$1.unknown().optional(),
882
882
  nullable: z$1.boolean().optional(),
883
883
  properties: z$1.lazy(() => z$1.record(z$1.string(), JSONSchemaPropertySchema)).optional(),
884
884
  required: z$1.array(z$1.string()).optional(),
885
885
  file_uploadable: z$1.boolean().optional(),
886
886
  file_downloadable: z$1.boolean().optional(),
887
887
  items: z$1.lazy(() => z$1.union([JSONSchemaPropertySchema, z$1.array(JSONSchemaPropertySchema)])).optional(),
888
- enum: z$1.array(z$1.any()).optional(),
889
- const: z$1.any().optional(),
888
+ enum: z$1.array(z$1.unknown()).optional(),
889
+ const: z$1.unknown().optional(),
890
890
  minimum: z$1.number().optional(),
891
891
  maximum: z$1.number().optional(),
892
892
  exclusiveMinimum: z$1.number().optional(),
@@ -903,7 +903,7 @@ const JSONSchemaPropertySchema = z$1.object({
903
903
  maxProperties: z$1.number().optional(),
904
904
  patternProperties: z$1.lazy(() => z$1.record(z$1.string(), JSONSchemaPropertySchema)).optional(),
905
905
  additionalProperties: z$1.union([z$1.boolean(), z$1.lazy(() => JSONSchemaPropertySchema)]).optional(),
906
- examples: z$1.array(z$1.any()).optional(),
906
+ examples: z$1.array(z$1.unknown()).optional(),
907
907
  readOnly: z$1.boolean().optional(),
908
908
  writeOnly: z$1.boolean().optional(),
909
909
  if: z$1.lazy(() => JSONSchemaPropertySchema).optional(),
@@ -919,13 +919,14 @@ const ParametersSchema = z$1.preprocess(deduplicateJsonSchemaRequiredArrays, z$1
919
919
  oneOf: z$1.array(JSONSchemaPropertySchema).optional(),
920
920
  allOf: z$1.array(JSONSchemaPropertySchema).optional(),
921
921
  not: JSONSchemaPropertySchema.optional(),
922
- properties: z$1.record(z$1.string(), JSONSchemaPropertySchema),
922
+ properties: z$1.record(z$1.string(), JSONSchemaPropertySchema).optional(),
923
923
  required: z$1.array(z$1.string()).optional(),
924
924
  title: z$1.string().optional(),
925
- default: z$1.any().optional(),
925
+ default: z$1.unknown().optional(),
926
926
  nullable: z$1.boolean().optional(),
927
927
  description: z$1.string().optional(),
928
- additionalProperties: z$1.boolean().default(false).optional(),
928
+ patternProperties: z$1.record(z$1.string(), JSONSchemaPropertySchema).optional(),
929
+ additionalProperties: z$1.union([z$1.boolean(), JSONSchemaPropertySchema]).optional(),
929
930
  $defs: z$1.record(z$1.string(), z$1.lazy(() => JSONSchemaPropertySchema)).optional(),
930
931
  definitions: z$1.record(z$1.string(), z$1.lazy(() => JSONSchemaPropertySchema)).optional()
931
932
  }));
@@ -1592,13 +1593,26 @@ var Tools = class {
1592
1593
  const requestOptions = options?.signal != null ? { signal: options.signal } : void 0;
1593
1594
  const { signal: _, ...modifiers } = options ?? {};
1594
1595
  if (typeof arg2 === "string") {
1595
- const tool = await this.getRawComposioToolBySlug(arg2, { modifySchema: options?.modifySchema }, requestOptions);
1596
- return this.wrapToolsForProvider(userId, [tool], modifiers);
1596
+ const rawTool = await this.getRawComposioToolBySlug(arg2, void 0, requestOptions);
1597
+ const [tool] = await this.applySchemaModifiers([rawTool], options?.modifySchema);
1598
+ return this.wrapToolsForProvider(userId, [tool], modifiers, [rawTool]);
1597
1599
  } else {
1598
- const tools = await this.getRawComposioTools(arg2, { modifySchema: options?.modifySchema }, requestOptions);
1599
- return this.wrapToolsForProvider(userId, tools, modifiers);
1600
+ const rawTools = await this.getRawComposioTools(arg2, void 0, requestOptions);
1601
+ const tools = await this.applySchemaModifiers(rawTools, options?.modifySchema);
1602
+ return this.wrapToolsForProvider(userId, tools, modifiers, rawTools);
1600
1603
  }
1601
1604
  }
1605
+ async applySchemaModifiers(tools, modifier) {
1606
+ if (modifier && typeof modifier !== "function") throw new ComposioInvalidModifierError("Invalid schema modifier. Not a function.");
1607
+ return Promise.all(tools.map((tool) => {
1608
+ const schema = ToolSchema.parse(tool);
1609
+ return modifier ? modifier({
1610
+ toolSlug: tool.slug,
1611
+ toolkitSlug: tool.toolkit?.slug ?? "unknown",
1612
+ schema
1613
+ }) : schema;
1614
+ }));
1615
+ }
1602
1616
  /**
1603
1617
  * @internal
1604
1618
  * Creates a global execute tool function.
@@ -1621,10 +1635,11 @@ var Tools = class {
1621
1635
  * @param userId - The user id to get the tools for
1622
1636
  * @param tools - The tools to wrap
1623
1637
  * @param modifiers - The modifiers to be applied to the tools
1638
+ * @param rawTools - The fetched schemas used during execution
1624
1639
  * @returns The wrapped tools
1625
1640
  */
1626
- wrapToolsForProvider(userId, tools, modifiers) {
1627
- const executeToolFn = this.createExecuteToolFn(userId, modifiers);
1641
+ wrapToolsForProvider(userId, tools, modifiers, rawTools = tools.map((tool) => ToolSchema.parse(tool))) {
1642
+ const executeToolFn = this.createExecuteToolFn(userId, modifiers, rawTools);
1628
1643
  return this.provider.wrapTools(tools, executeToolFn);
1629
1644
  }
1630
1645
  /**
@@ -1648,15 +1663,19 @@ var Tools = class {
1648
1663
  *
1649
1664
  * @param {string} userId - The user id
1650
1665
  * @param {ExecuteToolModifiers} modifiers - The modifiers to be applied to the tool
1666
+ * @param {Tool[]} tools - The fetched tools available to the provider
1651
1667
  * @returns {ExecuteToolFn} The execute tool function
1652
1668
  */
1653
- createExecuteToolFn(userId, modifiers) {
1669
+ createExecuteToolFn(userId, modifiers, tools) {
1670
+ const toolBySlug = new Map(tools.map((tool) => [tool.slug.toUpperCase(), tool]));
1654
1671
  const executeToolFn = async (toolSlug, input) => {
1655
- return await this.execute(toolSlug, {
1672
+ const body = {
1656
1673
  userId,
1657
1674
  arguments: input,
1658
1675
  dangerouslySkipVersionCheck: true
1659
- }, modifiers);
1676
+ };
1677
+ const tool = toolBySlug.get(toolSlug.toUpperCase());
1678
+ return tool ? this.executeWithTool(toolSlug, this.parseToolExecuteParams(body), modifiers, tool) : this.execute(toolSlug, body, modifiers);
1660
1679
  };
1661
1680
  return executeToolFn;
1662
1681
  }
@@ -1714,6 +1733,28 @@ var Tools = class {
1714
1733
  throw handleToolExecutionError(tool.slug, error);
1715
1734
  }
1716
1735
  }
1736
+ async executeWithTool(slug, body, options, tool) {
1737
+ const requestOptions = options?.signal != null ? { signal: options.signal } : void 0;
1738
+ const { signal: _, ...modifiers } = options ?? {};
1739
+ const toolkitSlug = tool.toolkit?.slug ?? "unknown";
1740
+ const params = await this.applyBeforeExecuteModifiers(tool, {
1741
+ toolSlug: slug,
1742
+ toolkitSlug,
1743
+ params: body
1744
+ }, modifiers, requestOptions);
1745
+ let result = await this.executeComposioTool(tool, params, requestOptions);
1746
+ result = await this.applyAfterExecuteModifiers(tool, {
1747
+ toolSlug: slug,
1748
+ toolkitSlug,
1749
+ result
1750
+ }, modifiers.afterExecute, requestOptions);
1751
+ return result;
1752
+ }
1753
+ parseToolExecuteParams(body) {
1754
+ const executeParams = ToolExecuteParamsSchema.safeParse(body);
1755
+ if (!executeParams.success) throw new ValidationError("Invalid tool execute parameters", { cause: executeParams.error });
1756
+ return executeParams.data;
1757
+ }
1717
1758
  /**
1718
1759
  * Executes a given tool with the provided parameters.
1719
1760
  *
@@ -1795,24 +1836,10 @@ var Tools = class {
1795
1836
  * ```
1796
1837
  */
1797
1838
  async execute(slug, body, options) {
1798
- const executeParams = ToolExecuteParamsSchema.safeParse(body);
1799
- if (!executeParams.success) throw new ValidationError("Invalid tool execute parameters", { cause: executeParams.error });
1839
+ const executeParams = this.parseToolExecuteParams(body);
1800
1840
  const requestOptions = options?.signal != null ? { signal: options.signal } : void 0;
1801
- const { signal: _, ...modifiers } = options ?? {};
1802
- const tool = await this.getRawComposioToolBySlug(slug, { version: body.version }, requestOptions);
1803
- const toolkitSlug = tool.toolkit?.slug ?? "unknown";
1804
- const params = await this.applyBeforeExecuteModifiers(tool, {
1805
- toolSlug: slug,
1806
- toolkitSlug,
1807
- params: executeParams.data
1808
- }, modifiers, requestOptions);
1809
- let result = await this.executeComposioTool(tool, params, requestOptions);
1810
- result = await this.applyAfterExecuteModifiers(tool, {
1811
- toolSlug: slug,
1812
- toolkitSlug,
1813
- result
1814
- }, modifiers.afterExecute, requestOptions);
1815
- return result;
1841
+ const tool = await this.getRawComposioToolBySlug(slug, { version: executeParams.version }, requestOptions);
1842
+ return this.executeWithTool(slug, executeParams, options, tool);
1816
1843
  }
1817
1844
  /**
1818
1845
  * Executes a tool based on a tool router session.
@@ -5421,8 +5448,8 @@ function getSDKConfig(baseUrl, apiKey) {
5421
5448
  *
5422
5449
  * Priority order:
5423
5450
  * 1. If defaultVersions is a string, use it as global version for all toolkits
5424
- * 2. Environment variables (COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>)
5425
- * 3. User-provided toolkit version mappings (defaultVersions object)
5451
+ * 2. User-provided toolkit version mappings (defaultVersions object)
5452
+ * 3. Environment variables (COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>)
5426
5453
  * 4. Fallback to 'latest' if no versions are configured
5427
5454
  *
5428
5455
  * @param defaultVersions - Optional default versions configuration (string for global version or object mapping toolkit names to versions)
@@ -5448,9 +5475,13 @@ function getToolkitVersionsFromEnv(defaultVersions) {
5448
5475
 
5449
5476
  //#endregion
5450
5477
  //#region src/utils/version.ts
5478
+ const VERSION_CHECK_TIMEOUT_MS = 2e3;
5451
5479
  /**
5452
5480
  * Checks for the latest version of the Composio SDK from NPM.
5453
5481
  * If a newer version is available, it logs a warning to the console.
5482
+ *
5483
+ * Best-effort: never throws. The npm registry request is aborted after
5484
+ * {@link VERSION_CHECK_TIMEOUT_MS} milliseconds.
5454
5485
  */
5455
5486
  async function checkForLatestVersionFromNPM(currentVersion) {
5456
5487
  try {
@@ -5459,8 +5490,16 @@ async function checkForLatestVersionFromNPM(currentVersion) {
5459
5490
  if (!semver.valid(currentVersionFromPackageJson)) return;
5460
5491
  const prerelease = semver.prerelease(currentVersionFromPackageJson);
5461
5492
  if (prerelease && (String(prerelease[0]).includes("alpha") || String(prerelease[0]).includes("beta"))) return;
5462
- const latestVersion = (await (await fetch(`https://registry.npmjs.org/${packageName}/latest`)).json()).version;
5463
- if (semver.gt(latestVersion, currentVersionFromPackageJson) && !IS_DEVELOPMENT_OR_CI) logger.info(`🚀 Upgrade available! Your composio-core version (${currentVersionFromPackageJson}) is behind. Latest version: ${latestVersion}.`);
5493
+ const controller = new AbortController();
5494
+ const timer = setTimeout(() => controller.abort(), VERSION_CHECK_TIMEOUT_MS);
5495
+ let data;
5496
+ try {
5497
+ data = await (await fetch(`https://registry.npmjs.org/${packageName}/latest`, { signal: controller.signal })).json();
5498
+ } finally {
5499
+ clearTimeout(timer);
5500
+ }
5501
+ const latestVersion = data.version;
5502
+ if (semver.gt(latestVersion, currentVersionFromPackageJson) && !IS_DEVELOPMENT_OR_CI) logger.info(`🚀 Upgrade available! Your ${packageName} version (${currentVersionFromPackageJson}) is behind. Latest version: ${latestVersion}.`);
5464
5503
  } catch (_error) {}
5465
5504
  }
5466
5505
 
@@ -6006,7 +6045,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
6006
6045
 
6007
6046
  //#endregion
6008
6047
  //#region package.json
6009
- var version = "0.14.1";
6048
+ var version = "0.16.0";
6010
6049
 
6011
6050
  //#endregion
6012
6051
  //#region src/utils/session.ts
@@ -6864,7 +6903,10 @@ var ToolRouterSessionFilesMount = class {
6864
6903
  if (typeof input === "string") {
6865
6904
  if (input.startsWith("http://") || input.startsWith("https://")) {
6866
6905
  const response = await ssrfSafeFetch(input);
6867
- if (!response.ok) throw new Error(`Failed to fetch file from URL: ${response.statusText}`);
6906
+ if (!response.ok) {
6907
+ await response.body?.cancel().catch(() => void 0);
6908
+ throw new Error(`Failed to fetch file from URL: ${response.statusText}`);
6909
+ }
6868
6910
  const content = await readResponseBodyWithLimit(response);
6869
6911
  const mimeType = (response.headers.get("content-type") || "application/octet-stream").split(";")[0].trim();
6870
6912
  const segments = new URL(input).pathname.split("/").filter(Boolean);
@@ -8964,4 +9006,4 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
8964
9006
  });
8965
9007
 
8966
9008
  //#endregion
8967
- export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioSensitiveFilePathBlockedError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookTriggerPayloadV3Schema, WebhookVersions, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry };
9009
+ export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioSensitiveFilePathBlockedError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookTriggerPayloadV3Schema, WebhookVersions, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry };
@@ -1,5 +1,5 @@
1
- import { t as telemetry } from "../Telemetry-CF0rNHu2.mjs";
2
- import { n as getFileDataAfterUploadingToS3, t as downloadFileFromS3 } from "../fileUtils.node-DOkW4PBg.mjs";
1
+ import { t as telemetry } from "../Telemetry-DuGJSwUt.mjs";
2
+ import { n as getFileDataAfterUploadingToS3, t as downloadFileFromS3 } from "../fileUtils.node-BQ0fWge3.mjs";
3
3
 
4
4
  //#region src/models/Files.node.ts
5
5
  var Files = class {
@@ -1,4 +1,4 @@
1
- import { t as Platform } from "../types-DY1r-kN9.mjs";
1
+ import { t as Platform } from "../types-D5A2wzBl.mjs";
2
2
  //#region src/platform/node.d.ts
3
3
  /**
4
4
  * Node.js platform implementation.
@@ -1,8 +1,25 @@
1
1
  import * as fs$1 from "node:fs";
2
2
  import * as os from "node:os";
3
3
  import * as path from "node:path";
4
+ import { isFsCaseSensitive } from "is-fs-case-sensitive";
4
5
 
5
6
  //#region src/platform/node.ts
7
+ const findNearestExistingDirectory = (filePath) => {
8
+ let candidate = path.resolve(filePath);
9
+ try {
10
+ if (!fs$1.statSync(candidate).isDirectory()) candidate = path.dirname(candidate);
11
+ } catch {
12
+ candidate = path.dirname(candidate);
13
+ }
14
+ while (true) {
15
+ try {
16
+ if (fs$1.statSync(candidate).isDirectory()) return candidate;
17
+ } catch {}
18
+ const parent = path.dirname(candidate);
19
+ if (parent === candidate) return candidate;
20
+ candidate = parent;
21
+ }
22
+ };
6
23
  /**
7
24
  * Node.js platform implementation.
8
25
  * Provides full file system and OS operations using Node.js built-in modules.
@@ -34,6 +51,13 @@ const platform = {
34
51
  realpathSync(filePath) {
35
52
  return fs$1.realpathSync(filePath);
36
53
  },
54
+ isFileSystemCaseSensitive(filePath) {
55
+ try {
56
+ return isFsCaseSensitive(findNearestExistingDirectory(filePath));
57
+ } catch {
58
+ return false;
59
+ }
60
+ },
37
61
  mkdirSync(dirPath) {
38
62
  fs$1.mkdirSync(dirPath, { recursive: true });
39
63
  },
@@ -1,4 +1,4 @@
1
- import { t as Platform } from "../types-DY1r-kN9.mjs";
1
+ import { t as Platform } from "../types-D5A2wzBl.mjs";
2
2
  //#region src/platform/workerd.d.ts
3
3
  /**
4
4
  * Cloudflare Workers / Edge runtime platform implementation.
@@ -55,6 +55,9 @@ const platform = {
55
55
  realpathSync(filePath) {
56
56
  return filePath;
57
57
  },
58
+ isFileSystemCaseSensitive(_filePath) {
59
+ return true;
60
+ },
58
61
  mkdirSync(_dirPath) {},
59
62
  readFileSync(_filePath, _encoding) {
60
63
  throw new Error("File system operations are not supported in this runtime environment (Cloudflare Workers/Edge). Use environment variables or external storage services instead.");
@@ -95,7 +95,8 @@ const readResponseBodyWithLimit = async (response, maxBytes = MAX_URL_UPLOAD_SIZ
95
95
  */
96
96
  /**
97
97
  * Path segments (a single path component) that indicate a sensitive directory when
98
- * they appear anywhere in a resolved local path. Compared case-insensitively on Windows.
98
+ * they appear anywhere in a resolved local path. Matching follows the case sensitivity
99
+ * of the filesystem containing that path.
99
100
  */
100
101
  const BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS = [
101
102
  ".ssh",
@@ -111,17 +112,19 @@ const BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS = [
111
112
  const SECRET_LIKE_BASENAME = /^(\.env(\.|$)|\.netrc$|\.pgpass$)/i;
112
113
  /** Default SSH private key basenames (public keys like id_rsa.pub are allowed). */
113
114
  const DEFAULT_PRIVATE_KEY_BASENAME = /^id_(rsa|ed25519|ecdsa|dsa|ecdsa_sk)(\.old)?$/i;
114
- const isWindows = typeof process !== "undefined" && process.platform === "win32";
115
115
  /**
116
116
  * Returns normalized path segments, resolving symlinks when the path exists.
117
117
  */
118
- function normalizePathSegments(filePath) {
118
+ function normalizePath(filePath) {
119
119
  const absolute = platform.resolvePath(filePath);
120
120
  let resolved = absolute;
121
121
  try {
122
122
  if (platform.existsSync(absolute)) resolved = platform.realpathSync(absolute);
123
123
  } catch {}
124
- return resolved.split(/[/\\]+/).filter(Boolean);
124
+ return {
125
+ resolvedPath: resolved,
126
+ segments: resolved.split(/[/\\]+/).filter(Boolean)
127
+ };
125
128
  }
126
129
  /**
127
130
  * True if the path is under a built-in or extra deny segment, or the basename
@@ -131,9 +134,11 @@ function isBlockedSensitiveFileUploadPath(filePath, additionalDenySegments) {
131
134
  return getSensitiveFileUploadPathBlockReason(filePath, additionalDenySegments) != null;
132
135
  }
133
136
  function getSensitiveFileUploadPathBlockReason(filePath, additionalDenySegments) {
134
- const segments = normalizePathSegments(filePath);
135
- const deny = new Set([...BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, ...(additionalDenySegments ?? []).map((s) => s.trim()).filter(Boolean)].map((s) => isWindows ? s.toLowerCase() : s));
136
- const segmentsForMatch = isWindows ? segments.map((s) => s.toLowerCase()) : segments;
137
+ const { resolvedPath, segments } = normalizePath(filePath);
138
+ const isCaseSensitive = platform.isFileSystemCaseSensitive?.(resolvedPath) ?? true;
139
+ const normalizeSegment = (segment) => isCaseSensitive ? segment : segment.toLowerCase();
140
+ const deny = new Set([...BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, ...(additionalDenySegments ?? []).map((s) => s.trim()).filter(Boolean)].map(normalizeSegment));
141
+ const segmentsForMatch = isCaseSensitive ? segments : segments.map(normalizeSegment);
137
142
  for (let i = 0; i < segments.length; i++) if (deny.has(segmentsForMatch[i])) return `path segment "${segments[i]}" is in the sensitive file upload denylist`;
138
143
  const basename = segments.length > 0 ? segments[segments.length - 1] : "";
139
144
  if (basename) {
@@ -1,5 +1,5 @@
1
- import { n as BaseComposioProvider } from "./BaseProvider-Dc5yKZhk.mjs";
2
- import { n as ComposioConfig } from "./composio-ChU3eD9F.mjs";
1
+ import { n as BaseComposioProvider } from "./BaseProvider-D7p2OPEx.mjs";
2
+ import { n as ComposioConfig } from "./composio-DSs-1AhC.mjs";
3
3
  //#region src/utils/config-defaults/types.d.ts
4
4
  /**
5
5
  * Configuration defaults for Composio.
@@ -46,6 +46,14 @@ interface Platform {
46
46
  * @returns The resolved path, or the input path if it cannot be resolved.
47
47
  */
48
48
  realpathSync(filePath: string): string;
49
+ /**
50
+ * Returns whether paths on the filesystem containing `filePath` are
51
+ * case-sensitive. Node checks the nearest existing directory so the result
52
+ * follows the target mount rather than the operating-system default.
53
+ * Runtimes without a filesystem return true to preserve exact path matching.
54
+ * @param filePath - A file or directory on the filesystem to inspect.
55
+ */
56
+ isFileSystemCaseSensitive?(filePath: string): boolean;
49
57
  /**
50
58
  * Creates a directory at the given path, including parent directories if needed.
51
59
  * @param dirPath - The directory path to create.
@@ -1,4 +1,4 @@
1
- import { t as ConfigDefaults } from "../../types-D5N60gUD.mjs";
1
+ import { t as ConfigDefaults } from "../../types-B4k-qoOf.mjs";
2
2
  //#region src/utils/config-defaults/ConfigDefaults.node.d.ts
3
3
  declare const CONFIG_DEFAULTS: ConfigDefaults;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as ConfigDefaults } from "../../types-D5N60gUD.mjs";
1
+ import { t as ConfigDefaults } from "../../types-B4k-qoOf.mjs";
2
2
  //#region src/utils/config-defaults/ConfigDefaults.workerd.d.ts
3
3
  declare const CONFIG_DEFAULTS: ConfigDefaults;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { gn as Tool, xn as ToolExecuteResponse, yn as ToolExecuteParams } from "../../BaseProvider-Dc5yKZhk.mjs";
1
+ import { gn as Tool, xn as ToolExecuteResponse, yn as ToolExecuteParams } from "../../BaseProvider-D7p2OPEx.mjs";
2
2
  import ComposioClient from "@composio/client";
3
3
  //#region src/utils/modifiers/FileToolModifier.node.d.ts
4
4
  declare class FileToolModifier {
@@ -2,8 +2,8 @@ import { i as logger } from "../../SsrfErrors-DNJt57GL.mjs";
2
2
  import { f as ComposioRequestCancelledError } from "../../errors-BcEUHZbq.mjs";
3
3
  import { a as ComposioSensitiveFilePathBlockedError, i as ComposioFileUploadPathNotAllowedError, n as ComposioFileUploadAbortedError, r as ComposioFileUploadError, t as ComposioFileNotFoundError } from "../../FileModifierErrors-B8V8_3VE.mjs";
4
4
  import { i as transformProperties, n as schemaHasFileProperty, t as isPlainObject } from "../../FileToolModifier.utils.neutral-B5rT711M.mjs";
5
- import { r as dereferenceJsonSchema, t as withCancellation } from "../../cancellation-BbJ-UQ__.mjs";
6
- import { n as getFileDataAfterUploadingToS3, r as isHttpUrl, t as downloadFileFromS3 } from "../../fileUtils.node-DOkW4PBg.mjs";
5
+ import { r as dereferenceJsonSchema, t as withCancellation } from "../../cancellation-NVtGf3St.mjs";
6
+ import { n as getFileDataAfterUploadingToS3, r as isHttpUrl, t as downloadFileFromS3 } from "../../fileUtils.node-BQ0fWge3.mjs";
7
7
 
8
8
  //#region src/utils/modifiers/FileToolModifier.node.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { gn as Tool, xn as ToolExecuteResponse, yn as ToolExecuteParams } from "../../BaseProvider-Dc5yKZhk.mjs";
1
+ import { gn as Tool, xn as ToolExecuteResponse, yn as ToolExecuteParams } from "../../BaseProvider-D7p2OPEx.mjs";
2
2
  import ComposioClient from "@composio/client";
3
3
  //#region src/utils/modifiers/FileToolModifier.workerd.d.ts
4
4
  declare class FileToolModifier {
@@ -14,8 +14,8 @@ declare const assertSafeFetchTarget: (rawUrl: string) => Promise<void>;
14
14
  /**
15
15
  * Drop-in replacement for `fetch` that blocks SSRF. Validates the target before
16
16
  * connecting and re-validates every redirect hop (redirects are followed
17
- * manually up to {@link MAX_REDIRECTS}). Non-redirect responses are returned
18
- * unchanged.
17
+ * manually up to {@link MAX_REDIRECTS}). Intermediate redirect bodies are
18
+ * cancelled; non-redirect responses are returned unchanged.
19
19
  */
20
20
  declare const ssrfSafeFetch: (rawUrl: string, init?: RequestInit, maxRedirects?: number) => Promise<Response>;
21
21
  //#endregion
@@ -131,8 +131,8 @@ const assertSafeFetchTarget = async (rawUrl) => {
131
131
  /**
132
132
  * Drop-in replacement for `fetch` that blocks SSRF. Validates the target before
133
133
  * connecting and re-validates every redirect hop (redirects are followed
134
- * manually up to {@link MAX_REDIRECTS}). Non-redirect responses are returned
135
- * unchanged.
134
+ * manually up to {@link MAX_REDIRECTS}). Intermediate redirect bodies are
135
+ * cancelled; non-redirect responses are returned unchanged.
136
136
  */
137
137
  const ssrfSafeFetch = async (rawUrl, init = {}, maxRedirects = MAX_REDIRECTS) => {
138
138
  let currentUrl = rawUrl;
@@ -143,6 +143,7 @@ const ssrfSafeFetch = async (rawUrl, init = {}, maxRedirects = MAX_REDIRECTS) =>
143
143
  redirect: "manual"
144
144
  });
145
145
  if (!(response.status >= 300 && response.status < 400 && response.headers.has("location"))) return response;
146
+ await response.body?.cancel().catch(() => void 0);
146
147
  currentUrl = new URL(response.headers.get("location"), currentUrl).toString();
147
148
  }
148
149
  throw new ComposioBlockedInternalUrlError(`Refusing to fetch: too many redirects (max ${maxRedirects})`, { url: rawUrl });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@composio/core",
3
3
  "type": "module",
4
- "version": "0.14.1",
4
+ "version": "0.16.0",
5
5
  "description": "",
6
6
  "main": "dist/index.mjs",
7
7
  "publishConfig": {
@@ -90,9 +90,9 @@
90
90
  "license": "ISC",
91
91
  "devDependencies": {
92
92
  "@type-challenges/utils": "^0.1.1",
93
- "@types/semver": "^7.7.1",
93
+ "@types/semver": "^7.8.0",
94
94
  "tsdown": "^0.22.14",
95
- "tsx": "^4.23.1",
95
+ "tsx": "^4.23.5",
96
96
  "typedoc": "^0.28.20",
97
97
  "typescript": "npm:@typescript/typescript6@^6.0.2",
98
98
  "vitest": "^4.1.10",
@@ -104,12 +104,13 @@
104
104
  "dependencies": {
105
105
  "@composio/client": "0.1.0-alpha.76",
106
106
  "@types/json-schema": "^7.0.15",
107
- "openai": "^6.49.0",
107
+ "is-fs-case-sensitive": "^2.0.0",
108
+ "openai": "^7.2.0",
108
109
  "picocolors": "^1.1.1",
109
110
  "pusher-js": "^8.6.0",
110
111
  "semver": "^7.8.5",
111
112
  "zod-to-json-schema": "^3.25.2",
112
- "@composio/json-schema-to-zod": "0.2.1"
113
+ "@composio/json-schema-to-zod": "0.3.0"
113
114
  },
114
115
  "gitHead": "4fae6e54d5c150fba955cc5fa314281da5a1e064",
115
116
  "repository": {
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export type { BaseComposioProvider } from './provider/BaseProvider';
7
7
  export {
8
8
  dereferenceJsonSchema,
9
9
  deduplicateJsonSchemaRequiredArrays,
10
+ ensureObjectTypeOnProperties,
10
11
  jsonSchemaToZodSchema,
11
12
  removeNonRequiredProperties,
12
13
  } from './utils/jsonSchema';
@@ -114,6 +114,9 @@ export class ToolRouterSessionFilesMount {
114
114
  if (input.startsWith('http://') || input.startsWith('https://')) {
115
115
  const response = await ssrfSafeFetch(input);
116
116
  if (!response.ok) {
117
+ // The error path never reads the body, so release it explicitly (mirrors
118
+ // `readResponseBodyWithLimit`) instead of leaving it to the garbage collector.
119
+ await response.body?.cancel().catch(() => undefined);
117
120
  throw new Error(`Failed to fetch file from URL: ${response.statusText}`);
118
121
  }
119
122
  const content = await readResponseBodyWithLimit(response);