@composio/core 0.28.0 → 0.30.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 (85) hide show
  1. package/README.md +25 -0
  2. package/dist/{CustomTool-BYHB7sPs.mjs → CustomTool-9Vlb4XaS.mjs} +12 -14
  3. package/dist/{CustomTool-DyypijT6.d.mts → CustomTool-Dzk3iqfP.d.mts} +10 -11
  4. package/dist/FileModifierErrors-WrqokuIF.mjs +199 -0
  5. package/dist/{FileToolModifier.utils.neutral-DWFpnsj2.mjs → FileToolModifier.utils.neutral-BQP85ZJj.mjs} +1 -2
  6. package/dist/{SsrfErrors-DiQldIdC.mjs → SsrfErrors-BSVMW915.mjs} +49 -26
  7. package/dist/{Telemetry-D2PJwXKx.mjs → Telemetry-a7SOQXcg.mjs} +6 -10
  8. package/dist/{composio-CwHMpKXb.d.mts → composio-DaokW5sV.d.mts} +220 -254
  9. package/dist/{customTool.types-DoItUHkO.d.mts → customTool.types-CpJbzxT6.d.mts} +255 -274
  10. package/dist/docs/error-consistency.md +3 -3
  11. package/dist/docs/reference/sdk-reference/typescript/composio.mdx +2 -1
  12. package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +2 -2
  13. package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +88 -10
  14. package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +1 -1
  15. package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
  16. package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +1 -1
  17. package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +1 -1
  18. package/dist/docs/reference/sdk-reference/typescript/session.mdx +48 -10
  19. package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
  20. package/dist/docs/reference/sdk-reference/typescript/tools.mdx +4 -4
  21. package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +5 -1
  22. package/dist/{errors-Cly0vXFh.mjs → errors-xC13uvaA.mjs} +116 -135
  23. package/dist/experimental/index.d.mts +17 -3
  24. package/dist/experimental/index.mjs +1 -1
  25. package/dist/{fileUtils.node-ILI1IjnZ.mjs → fileUtils.node-CAwIbWYH.mjs} +6 -8
  26. package/dist/{files.types-DeMC_mAW.d.mts → files.types-Dg6HcEzs.d.mts} +0 -2
  27. package/dist/index.d.mts +73 -78
  28. package/dist/index.mjs +393 -290
  29. package/dist/{cancellation-ZoRh6EJQ.mjs → jsonSchema-Cc4EtHRw.mjs} +5 -22
  30. package/dist/models/Files.node.d.mts +32 -13
  31. package/dist/models/Files.node.mjs +36 -19
  32. package/dist/models/Files.workerd.d.mts +8 -3
  33. package/dist/models/Files.workerd.mjs +1 -2
  34. package/dist/platform/node.d.mts +2 -4
  35. package/dist/platform/node.mjs +15 -16
  36. package/dist/platform/workerd.d.mts +2 -4
  37. package/dist/platform/workerd.mjs +1 -2
  38. package/dist/requestOptions.types-DWrTcbss.d.mts +38 -0
  39. package/dist/rolldown-runtime-ad2WFvuA.mjs +17 -0
  40. package/dist/{sensitiveFileUploadPaths-BaEORC7-.mjs → sensitiveFileUploadPaths-CSyJ3Ku8.mjs} +22 -12
  41. package/dist/{ssrfGuard.node-BZ270bcu.mjs → ssrfGuard.node-CdIkwqVu.mjs} +3 -5
  42. package/dist/{types-DWZWePfZ.d.mts → types-DQdUb7OG.d.mts} +2 -4
  43. package/dist/{types-DuVZKrXO.d.mts → types-Ds6XbK1m.d.mts} +0 -2
  44. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +2 -4
  45. package/dist/utils/config-defaults/ConfigDefaults.node.mjs +1 -2
  46. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +2 -4
  47. package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +1 -2
  48. package/dist/utils/modifiers/FileToolModifier.node.d.mts +2 -4
  49. package/dist/utils/modifiers/FileToolModifier.node.mjs +7 -8
  50. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +2 -4
  51. package/dist/utils/modifiers/FileToolModifier.workerd.mjs +2 -3
  52. package/dist/utils/ssrfGuard.node.d.mts +1 -3
  53. package/dist/utils/ssrfGuard.node.mjs +1 -1
  54. package/dist/utils/ssrfGuard.workerd.d.mts +1 -3
  55. package/dist/utils/ssrfGuard.workerd.mjs +2 -3
  56. package/docs/error-consistency.md +3 -3
  57. package/package.json +12 -13
  58. package/src/composio.ts +12 -0
  59. package/src/errors/ComposioError.ts +40 -16
  60. package/src/errors/ConnectedAccountsErrors.ts +2 -2
  61. package/src/errors/ToolErrors.ts +177 -28
  62. package/src/errors/apiErrorDetails.ts +40 -0
  63. package/src/experimental/index.ts +6 -1
  64. package/src/lib/toolRouterParams.ts +40 -0
  65. package/src/models/ConnectedAccounts.ts +2 -2
  66. package/src/models/ConnectionRequest.ts +44 -32
  67. package/src/models/CustomTool.ts +25 -30
  68. package/src/models/CustomToolkits.ts +16 -22
  69. package/src/models/Experimental.ts +2 -7
  70. package/src/models/Files.node.ts +68 -37
  71. package/src/models/RemoteFile.ts +22 -16
  72. package/src/models/SessionContext.ts +6 -7
  73. package/src/models/ToolRouter.ts +24 -14
  74. package/src/models/ToolRouterSession.ts +38 -31
  75. package/src/models/Tools.ts +274 -30
  76. package/src/models/Triggers.ts +8 -2
  77. package/src/types/customTool.types.ts +49 -28
  78. package/src/types/customToolkits.types.ts +7 -12
  79. package/src/types/toolRouter.types.ts +39 -17
  80. package/src/utils/cancellation.ts +5 -1
  81. package/src/utils/rateLimit.ts +25 -0
  82. package/src/utils/transformers/customToolkits.ts +2 -2
  83. package/dist/FileModifierErrors-CdGSABoq.mjs +0 -97
  84. package/dist/rolldown-runtime-w6R9maHv.mjs +0 -18
  85. package/src/models/inlineCustomToolsPayload.ts +0 -17
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { c as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, d as USER_DATA_FILE_NAME, f as constants_exports, i as logger, l as IS_DEVELOPMENT_OR_CI, m as getEnvsWithPrefix, n as SsrfErrorCodes, o as COMPOSIO_DIR, p as getEnvVariable, r as ComposioError, s as DEFAULT_BASE_URL, t as ComposioBlockedInternalUrlError, u as TEMP_FILES_DIRECTORY_NAME } from "./SsrfErrors-DiQldIdC.mjs";
2
- import { $ as ComposioAuthConfigNotFoundError, A as ComposioInvalidModifierError, B as ConnectionRequestFailedError, C as ValidationError, D as ToolkitErrorCodes, E as ComposioToolkitNotFoundError, F as ComposioToolNotFoundError, G as ComposioConnectedAccountRevocationNotSupportedError, H as ComposioAclOnlyForSharedError, I as ComposioToolVersionRequiredError, J as ComposioMultipleConnectedAccountsError, K as ComposioFailedToCreateConnectedAccountLink, L as ToolErrorCodes, M as ComposioProviderNotDefinedError, N as ComposioToolExecutionError, O as ComposioGlobalExecuteToolFnNotSetError, P as ComposioToolFetchError, Q as AuthConfigErrorCodes, R as handleToolExecutionError, S as JsonSchemaToZodError, T as ComposioToolkitFetchError, U as ComposioConnectedAccountNotFoundError, V as ConnectionRequestTimeoutError, W as ComposioConnectedAccountNotRevokableError, X as ComposioSharedConnectionNotAccessibleError, Y as ComposioSharedAccessDeniedError, Z as ConnectedAccountErrorCodes, _ as ComposioRequestCancelledError, a as RemoteFileDownloadError, b as isRequestAbortError, c as ComposioFailedToGetSDKRealtimeCredentialsError, d as ComposioTriggerTypeNotFoundError, f as ComposioWebhookPayloadError, g as ComposioNoAPIKeyError, h as ComposioAPIKeyKindError, i as ToolRouterErrorCodes, j as ComposioInvalidToolArgumentsError, k as ComposioInvalidExecuteFunctionError, l as ComposioFailedToSubscribeToPusherChannelError, m as TriggerErrorCodes, n as ComposioSessionConfigConflictError, o as RemoteFileErrorCodes, p as ComposioWebhookSignatureVerificationError, q as ComposioLegacyConnectedAccountsEndpointRetiredError, r as ComposioToolInputRequiredError, s as ComposioFailedToCreatePusherClientError, t as ComposioMCPDestinationError, u as ComposioFailedToUnsubscribeFromPusherChannelError, v as ComposioScopeConfigError, w as ValidationErrorCodes, x as JsonSchemaRefResolutionError, y as SDKErrorCodes, z as ConnectionRequestErrorCodes } from "./errors-Cly0vXFh.mjs";
3
- import { a as ComposioSensitiveFilePathBlockedError, i as ComposioFileUploadPathNotAllowedError, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, r as ComposioFileUploadError, t as ComposioFileNotFoundError } from "./FileModifierErrors-CdGSABoq.mjs";
4
- import { n as dropEmptyFileUploads, o as isPlainObject, s as schemaHasFileUploadable } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
5
- import { a as jsonSchemaToZodSchema, c as toStrictJsonSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as omitNullToolArguments, r as dereferenceJsonSchema, s as removeNonRequiredProperties, t as withCancellation } from "./cancellation-ZoRh6EJQ.mjs";
6
- import { t as telemetry } from "./Telemetry-D2PJwXKx.mjs";
7
- import { c as arrayBufferToBase64, d as getRandomShortId, i as getExtensionFromMimeType, n as assertSafeFileUploadPath, o as MAX_URL_UPLOAD_SIZE_BYTES, r as isBlockedSensitiveFileUploadPath, s as readResponseBodyWithLimit, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-BaEORC7-.mjs";
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-BYHB7sPs.mjs";
1
+ import { _ as getEnvsWithPrefix, d as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, f as IS_DEVELOPMENT_OR_CI, g as getEnvVariable, h as constants_exports, i as apiErrorSuggestedFixes, l as COMPOSIO_DIR, m as USER_DATA_FILE_NAME, n as SsrfErrorCodes, o as withApiErrorMessage, p as TEMP_FILES_DIRECTORY_NAME, r as ComposioError, s as logger, t as ComposioBlockedInternalUrlError, u as DEFAULT_BASE_URL } from "./SsrfErrors-BSVMW915.mjs";
2
+ import { a as omitNullToolArguments, i as jsonSchemaToZodSchema, n as dereferenceJsonSchema, o as removeNonRequiredProperties, r as ensureObjectTypeOnProperties, s as toStrictJsonSchema, t as deduplicateJsonSchemaRequiredArrays } from "./jsonSchema-Cc4EtHRw.mjs";
3
+ import { $ as ComposioAuthConfigNotFoundError, A as ComposioToolFetchRateLimitError, B as ConnectionRequestFailedError, C as ComposioInvalidExecuteFunctionError, D as ComposioToolExecutionError, E as ComposioProviderNotDefinedError, F as handleToolExecutionError, G as ComposioConnectedAccountRevocationNotSupportedError, H as ComposioAclOnlyForSharedError, I as isComposioRateLimitError, J as ComposioMultipleConnectedAccountsError, K as ComposioFailedToCreateConnectedAccountLink, L as getRetryAfterSeconds, M as ComposioToolSchemaInvalidError, N as ComposioToolVersionRequiredError, O as ComposioToolExecutionRateLimitError, P as ToolErrorCodes, Q as AuthConfigErrorCodes, R as isRateLimitResponse, S as ComposioGlobalExecuteToolFnNotSetError, T as ComposioInvalidToolArgumentsError, U as ComposioConnectedAccountNotFoundError, V as ConnectionRequestTimeoutError, W as ComposioConnectedAccountNotRevokableError, X as ComposioSharedConnectionNotAccessibleError, Y as ComposioSharedAccessDeniedError, Z as ConnectedAccountErrorCodes, _ as ValidationError, a as RemoteFileDownloadError, b as ComposioToolkitNotFoundError, c as ComposioFailedToGetSDKRealtimeCredentialsError, d as ComposioTriggerTypeNotFoundError, f as ComposioWebhookPayloadError, g as JsonSchemaToZodError, h as JsonSchemaRefResolutionError, i as ToolRouterErrorCodes, j as ComposioToolNotFoundError, k as ComposioToolFetchError, l as ComposioFailedToSubscribeToPusherChannelError, m as TriggerErrorCodes, n as ComposioSessionConfigConflictError, o as RemoteFileErrorCodes, p as ComposioWebhookSignatureVerificationError, q as ComposioLegacyConnectedAccountsEndpointRetiredError, r as ComposioToolInputRequiredError, s as ComposioFailedToCreatePusherClientError, t as ComposioMCPDestinationError, u as ComposioFailedToUnsubscribeFromPusherChannelError, v as ValidationErrorCodes, w as ComposioInvalidModifierError, x as ToolkitErrorCodes, y as ComposioToolkitFetchError, z as ConnectionRequestErrorCodes } from "./errors-xC13uvaA.mjs";
4
+ import { t as telemetry } from "./Telemetry-a7SOQXcg.mjs";
5
+ import { n as dropEmptyFileUploads, o as isPlainObject, s as schemaHasFileUploadable } from "./FileToolModifier.utils.neutral-BQP85ZJj.mjs";
6
+ import { c as arrayBufferToBase64, d as withCancellation, f as getRandomShortId, i as getExtensionFromMimeType, n as assertSafeFileUploadPath, o as MAX_URL_UPLOAD_SIZE_BYTES, r as isBlockedSensitiveFileUploadPath, s as readResponseBodyWithLimit, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-CSyJ3Ku8.mjs";
7
+ import { a as ComposioSensitiveFilePathBlockedError, c as ComposioNoAPIKeyError, d as SDKErrorCodes, f as isRequestAbortError, i as ComposioFileUploadPathNotAllowedError, l as ComposioRequestCancelledError, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, r as ComposioFileUploadError, s as ComposioAPIKeyKindError, t as ComposioFileNotFoundError, u as ComposioScopeConfigError } from "./FileModifierErrors-WrqokuIF.mjs";
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-9Vlb4XaS.mjs";
9
9
  import ComposioClient, { APIError, Auth, BadRequestError, ConflictError, createFetchTransport } from "@composio/client";
10
10
  import { FileToolModifier } from "#file_tool_modifier";
11
11
  import z, { z as z$1 } from "zod/v3";
@@ -17,7 +17,7 @@ import manifest from "#client_identity" with { type: "json" };
17
17
  import { ssrfSafeFetch, ssrfSafeFetchWhereSupported } from "#ssrf_guard";
18
18
  import { z as z$2 } from "zod";
19
19
 
20
- //#region src/types/authConfigs.types.ts
20
+ // src/types/authConfigs.types.ts
21
21
  const AuthConfigTypes = {
22
22
  CUSTOM: "use_custom_auth",
23
23
  COMPOSIO_MANAGED: "use_composio_managed_auth"
@@ -158,8 +158,7 @@ const AuthDefaultConfigUpdateParamsSchema = z$1.object({
158
158
  });
159
159
  const AuthConfigUpdateParamsSchema = z$1.discriminatedUnion("type", [AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema]);
160
160
 
161
- //#endregion
162
- //#region src/types/connectedAccountAuthStates.types.ts
161
+ // src/types/connectedAccountAuthStates.types.ts
163
162
  const ConnectionStatuses = {
164
163
  INITIALIZING: "INITIALIZING",
165
164
  INITIATED: "INITIATED",
@@ -851,8 +850,7 @@ const CustomConnectionDataSchema = z$1.discriminatedUnion("authScheme", [
851
850
  })
852
851
  ]);
853
852
 
854
- //#endregion
855
- //#region src/types/tool.types.ts
853
+ // src/types/tool.types.ts
856
854
  /**
857
855
  * Toolkit is the collection of tools,
858
856
  * A toolkit can be thought of as an app which provides a set of tools/actions/triggers.
@@ -1081,8 +1079,7 @@ const ToolProxyParamsSchema = z$1.object({
1081
1079
  customConnectionData: CustomConnectionDataSchema.describe("DEPRECATED: This field is deprecated and will be removed in the future.").optional()
1082
1080
  });
1083
1081
 
1084
- //#endregion
1085
- //#region src/utils/toolkitVersion.ts
1082
+ // src/utils/toolkitVersion.ts
1086
1083
  /**
1087
1084
  * Canonicalizes a toolkit slug into the form used as a version-map key.
1088
1085
  *
@@ -1112,8 +1109,7 @@ const getToolkitVersion = (toolkitSlug, toolkitVersions) => {
1112
1109
  return "latest";
1113
1110
  };
1114
1111
 
1115
- //#endregion
1116
- //#region src/utils/fileDirs.ts
1112
+ // src/utils/fileDirs.ts
1117
1113
  /**
1118
1114
  * Runtime-neutral helpers for normalizing user-provided filesystem paths.
1119
1115
  *
@@ -1188,8 +1184,7 @@ function resolveEffectiveUploadAllowlist(userDirs) {
1188
1184
  return Array.isArray(resolved) ? resolved : [];
1189
1185
  }
1190
1186
 
1191
- //#endregion
1192
- //#region src/utils/retries.ts
1187
+ // src/utils/retries.ts
1193
1188
  /**
1194
1189
  * Request options for a call that executes a tool or proxies an API call: the
1195
1190
  * caller's options with retries disabled.
@@ -1210,8 +1205,7 @@ function withoutRetries(requestOptions) {
1210
1205
  };
1211
1206
  }
1212
1207
 
1213
- //#endregion
1214
- //#region src/utils/transformers/toolRouterResponseTransform.ts
1208
+ // src/utils/transformers/toolRouterResponseTransform.ts
1215
1209
  /**
1216
1210
  * The `result_type` values of a call that ran. `input_required` and `blocked`
1217
1211
  * are handled before this is read.
@@ -1374,25 +1368,104 @@ function transformProxyExecuteResponse(raw, subject) {
1374
1368
  };
1375
1369
  }
1376
1370
 
1377
- //#endregion
1378
- //#region src/models/Tools.ts
1371
+ // src/models/Tools.ts
1379
1372
  const TOOL_ROUTER_SESSION_TOOLS_PAGE_LIMIT = 500;
1373
+ const isSchemaRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1374
+ /**
1375
+ * Flatten a value for interpolation into a log line.
1376
+ *
1377
+ * The logger writes straight to the console sink, and the slug and the zod
1378
+ * issue paths here are built from property names a remote toolkit controls. A
1379
+ * name carrying a newline could otherwise forge or erase a line in the host's
1380
+ * log, and an ANSI clear-line sequence could hide what came before it.
1381
+ */
1382
+ const sanitizeForLog = (value) => value.replace(/[\u0000-\u001F\u007F-\u009F]/g, " ");
1383
+ /**
1384
+ * Rewrite one JSON-Schema node into the strict subset `ParametersSchema`
1385
+ * accepts, preserving its meaning:
1386
+ *
1387
+ * - boolean nodes (`items: true` / `items: false`) become `{}` / `{ not: {} }`
1388
+ * — the strict subset's way to express "anything" and "nothing", so the
1389
+ * meaning survives; booleans are still valid JSON Schema (draft-04 style)
1390
+ * that MCP toolkits emit;
1391
+ * - draft-04 boolean `exclusiveMinimum`/`exclusiveMaximum` (paired with
1392
+ * `minimum`/`maximum`) become the numeric form draft-07+ uses;
1393
+ *
1394
+ * Children are rewritten recursively. `additionalProperties` legitimately
1395
+ * accepts a boolean, so it is only recursed into when it is a schema.
1396
+ */
1397
+ function sanitizeJsonSchemaNode(node) {
1398
+ if (typeof node === "boolean") return node ? {} : { not: {} };
1399
+ if (Array.isArray(node)) return node.map(sanitizeJsonSchemaNode);
1400
+ if (!isSchemaRecord(node)) return node;
1401
+ const schema = { ...node };
1402
+ for (const [bound, limit] of [["exclusiveMinimum", "minimum"], ["exclusiveMaximum", "maximum"]]) {
1403
+ if (typeof schema[bound] !== "boolean") continue;
1404
+ if (schema[bound] && typeof schema[limit] === "number") schema[bound] = schema[limit];
1405
+ else delete schema[bound];
1406
+ }
1407
+ for (const key of [
1408
+ "items",
1409
+ "not",
1410
+ "if",
1411
+ "then",
1412
+ "else",
1413
+ "additionalProperties"
1414
+ ]) {
1415
+ const child = schema[key];
1416
+ if (child === void 0) continue;
1417
+ if (key === "additionalProperties" && typeof child === "boolean") continue;
1418
+ schema[key] = sanitizeJsonSchemaNode(child);
1419
+ }
1420
+ for (const key of [
1421
+ "anyOf",
1422
+ "oneOf",
1423
+ "allOf"
1424
+ ]) if (Array.isArray(schema[key])) schema[key] = sanitizeJsonSchemaNode(schema[key]);
1425
+ for (const key of [
1426
+ "properties",
1427
+ "patternProperties",
1428
+ "$defs",
1429
+ "definitions"
1430
+ ]) {
1431
+ const children = schema[key];
1432
+ if (!isSchemaRecord(children)) continue;
1433
+ const mapped = {};
1434
+ for (const [name, child] of Object.entries(children)) mapped[name] = sanitizeJsonSchemaNode(child);
1435
+ schema[key] = mapped;
1436
+ }
1437
+ return schema;
1438
+ }
1380
1439
  /**
1381
1440
  * Normalize a raw `input_parameters` / `output_parameters` payload returned by
1382
1441
  * the Composio API. Maps `null`, `undefined`, and empty `{}` — all of which
1383
1442
  * mean "no declared schema" — to `undefined` so the strict `ParametersSchema`
1384
- * validator never sees them. Non-empty objects pass through unchanged and
1385
- * remain subject to strict Zod validation.
1443
+ * validator never sees them, and rewrites the valid-but-unusual JSON Schema
1444
+ * shapes MCP toolkits ship (boolean nodes, draft-04 boolean bounds, a bare
1445
+ * combinator root) into the strict subset.
1386
1446
  *
1387
1447
  * MCP-backed toolkits (granola_mcp, apify_mcp, tavily_mcp, …) have no
1388
1448
  * declared output schema and the API serializes that as `{}`, which would
1389
1449
  * otherwise trip `ParametersSchema`. See
1390
- * https://github.com/ComposioHQ/composio/issues/3354.
1450
+ * https://github.com/ComposioHQ/composio/issues/3354. The malformed-shape
1451
+ * handling covers the toolkits listed in
1452
+ * https://github.com/ComposioHQ/composio/issues/4757.
1391
1453
  */
1392
1454
  function normalizeRawToolParameters(params) {
1393
1455
  if (params == null || Object.keys(params).length === 0) return void 0;
1394
- return params;
1456
+ const sanitized = sanitizeJsonSchemaNode(params);
1457
+ if (isSchemaRecord(sanitized) && sanitized.type === void 0 && (Array.isArray(sanitized.anyOf) || Array.isArray(sanitized.oneOf) || Array.isArray(sanitized.allOf))) return {
1458
+ ...sanitized,
1459
+ type: "object"
1460
+ };
1461
+ return sanitized;
1395
1462
  }
1463
+ /** How long `execute()` reuses a schema fetched for `latest`, which can change at any release. */
1464
+ const LATEST_TOOL_SCHEMA_TTL_MS = 3e5;
1465
+ /** How long `execute()` reuses a schema fetched for a pinned toolkit version. */
1466
+ const PINNED_TOOL_SCHEMA_TTL_MS = 36e5;
1467
+ /** Most schemas `execute()` keeps per `Tools` instance; the oldest is dropped first. */
1468
+ const MAX_CACHED_TOOL_SCHEMAS = 500;
1396
1469
  /**
1397
1470
  * This class is used to manage tools in the Composio SDK.
1398
1471
  * It provides methods to list, get, and execute tools.
@@ -1409,6 +1482,14 @@ var Tools = class {
1409
1482
  * Scoped per-instance so a fresh `Composio` starts with a clean slate.
1410
1483
  */
1411
1484
  warnedAutoUploadDisabledForTool = /* @__PURE__ */ new Set();
1485
+ /** Tools whose parameters were dropped by `transformToolCases`; warn once each. */
1486
+ warnedMalformedToolParametersSlugs = /* @__PURE__ */ new Set();
1487
+ /**
1488
+ * Schemas `execute()` already fetched, so repeated executions don't each spend a request.
1489
+ * Holds what `getRawComposioToolBySlug` returned with no `modifySchema`, so a caller's schema
1490
+ * modifiers never reach it.
1491
+ */
1492
+ executeToolSchemas = /* @__PURE__ */ new Map();
1412
1493
  constructor(client, config) {
1413
1494
  if (!client) throw new Error("ComposioClient is required");
1414
1495
  if (!config?.provider) throw new ComposioProviderNotDefinedError("Provider not passed into Tools instance");
@@ -1435,19 +1516,49 @@ var Tools = class {
1435
1516
  * making them more consistent with JavaScript/TypeScript conventions.
1436
1517
  *
1437
1518
  * @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool object to transform
1438
- * @returns {Tool} The transformed tool with camelCase properties
1519
+ * @returns {Tool} The transformed tool with camelCase properties, or
1520
+ * `undefined` when its input schema is unrepairable and the tool is skipped
1439
1521
  *
1440
1522
  * @private
1441
1523
  */
1442
1524
  transformToolCases(tool) {
1443
- return ToolSchema.parse({
1525
+ const candidate = {
1444
1526
  ...tool,
1445
1527
  inputParameters: normalizeRawToolParameters(tool.input_parameters),
1446
1528
  outputParameters: normalizeRawToolParameters(tool.output_parameters),
1447
1529
  availableVersions: tool.available_versions,
1448
1530
  isDeprecated: tool.deprecated?.is_deprecated ?? false,
1449
1531
  isNoAuth: tool.no_auth
1450
- });
1532
+ };
1533
+ const parsed = ToolSchema.safeParse(candidate);
1534
+ if (parsed.success) return parsed.data;
1535
+ const failingSides = /* @__PURE__ */ new Set();
1536
+ let hasNonParameterIssue = false;
1537
+ for (const issue of parsed.error.issues) {
1538
+ const root = issue.path[0];
1539
+ if (root === "inputParameters" || root === "outputParameters") failingSides.add(root);
1540
+ else hasNonParameterIssue = true;
1541
+ }
1542
+ if (hasNonParameterIssue || failingSides.size === 0) throw parsed.error;
1543
+ this.warnMalformedToolParameters(tool, parsed.error, [...failingSides]);
1544
+ if (failingSides.has("inputParameters")) return void 0;
1545
+ const degradedCandidate = { ...candidate };
1546
+ for (const side of failingSides) degradedCandidate[side] = void 0;
1547
+ const degraded = ToolSchema.safeParse(degradedCandidate);
1548
+ if (degraded.success) return degraded.data;
1549
+ throw parsed.error;
1550
+ }
1551
+ /**
1552
+ * Warn once per tool that its declared parameters could not be parsed and
1553
+ * were dropped, so a caller sees why a tool carries no schema instead of a
1554
+ * bare TypeError from deep inside Zod.
1555
+ */
1556
+ warnMalformedToolParameters(tool, error, droppedSides) {
1557
+ const slug = String(tool.slug ?? "");
1558
+ if (slug && this.warnedMalformedToolParametersSlugs.has(slug)) return;
1559
+ if (slug) this.warnedMalformedToolParametersSlugs.add(slug);
1560
+ const inputFailed = droppedSides.includes("inputParameters");
1561
+ logger.warn(`Tool "${sanitizeForLog(slug) || "(unknown slug)"}" has ${droppedSides.join(" and ")} that do not match the expected schema, so the tool was ${inputFailed ? "skipped" : "returned without those parameters"}. ${inputFailed ? "It cannot be offered without an input schema." : "The tool still executes, but LLM callers will not see those parameters."} Issues: ${error.issues.map((issue) => `${sanitizeForLog(issue.path.join("."))}: ${sanitizeForLog(issue.message)}`).join("; ")}`);
1451
1562
  }
1452
1563
  /**
1453
1564
  * Transforms tool execution response from snake_case API format to camelCase.
@@ -1579,9 +1690,9 @@ var Tools = class {
1579
1690
  * Lists Composio API tools available to the SDK.
1580
1691
  *
1581
1692
  * This method fetches remote Composio tools from the API in raw format. The response can be
1582
- * filtered and modified as needed. Local experimental custom tools are session-scoped; attach
1693
+ * filtered and modified as needed. Experimental local tools are session-scoped; attach
1583
1694
  * them when creating or reusing a Tool Router session, then use `session.tools()`,
1584
- * `session.customTools()`, or `session.execute()`.
1695
+ * `session.localTools()`, or `session.execute()`.
1585
1696
  * It provides access to the underlying tool data without provider-specific wrapping.
1586
1697
  *
1587
1698
  * @param {ToolListParams} query - Query parameters to filter the tools (required)
@@ -1657,7 +1768,7 @@ var Tools = class {
1657
1768
  logger.debug(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
1658
1769
  const tools = await withCancellation(() => this.client.tools.list(filters, requestOptions), requestOptions?.signal);
1659
1770
  if (!tools) return [];
1660
- const caseTransformedTools = tools.items.map((tool) => this.transformToolCases(tool));
1771
+ const caseTransformedTools = tools.items.map((tool) => this.transformToolCases(tool)).filter((tool) => tool !== void 0);
1661
1772
  let modifiedTools = await this.applyDefaultSchemaModifiers(caseTransformedTools);
1662
1773
  if (options?.modifySchema) {
1663
1774
  const modifier = options.modifySchema;
@@ -1697,7 +1808,7 @@ var Tools = class {
1697
1808
  ...cursor ? { cursor } : {}
1698
1809
  };
1699
1810
  const response = await withCancellation(() => this.client.toolRouter.session.tools(sessionId, sessionToolsParams, requestOptions), requestOptions?.signal);
1700
- tools.push(...response.items.map((tool) => this.transformToolCases(tool)));
1811
+ tools.push(...response.items.map((tool) => this.transformToolCases(tool)).filter((tool) => tool !== void 0));
1701
1812
  cursor = response.next_cursor;
1702
1813
  } while (cursor);
1703
1814
  let modifiedTools = tools;
@@ -1720,8 +1831,8 @@ var Tools = class {
1720
1831
  * This method fetches a single tool in raw format without provider-specific wrapping,
1721
1832
  * providing direct access to the tool's schema and metadata. Tool versions are controlled
1722
1833
  * at the Composio SDK initialization level through the `toolkitVersions` configuration.
1723
- * Local experimental custom tools are session-scoped; attach them when creating or reusing a
1724
- * Tool Router session, then use `session.tools()`, `session.customTools()`, or
1834
+ * Experimental local tools are session-scoped; attach them when creating or reusing a
1835
+ * Tool Router session, then use `session.tools()`, `session.localTools()`, or
1725
1836
  * `session.execute()`.
1726
1837
  *
1727
1838
  * @param {string} slug - The unique identifier of the tool (e.g., 'GITHUB_GET_REPOS')
@@ -1771,16 +1882,23 @@ var Tools = class {
1771
1882
  tool = await withCancellation(() => this.client.tools.retrieve(slug, retrieveParams, requestOptions), requestOptions?.signal);
1772
1883
  } catch (error) {
1773
1884
  if (error instanceof ComposioRequestCancelledError) throw error;
1774
- if (error instanceof APIError && (error.status === 404 || error.status === 400)) throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`, {
1885
+ if (isRateLimitResponse(error)) throw new ComposioToolFetchRateLimitError(withApiErrorMessage(`Rate limited while retrieving tool with slug ${slug}`, error.details), error, { slug });
1886
+ if (error instanceof APIError && (error.status === 404 || error.status === 400)) throw new ComposioToolNotFoundError(withApiErrorMessage(`Tool with slug ${slug} not found`, error.details), {
1775
1887
  meta: { slug },
1776
- cause: error
1888
+ cause: error,
1889
+ possibleFixes: apiErrorSuggestedFixes(error.details)
1777
1890
  });
1778
- throw new ComposioToolFetchError(`Unable to retrieve tool with slug ${slug}`, {
1891
+ const details = error instanceof APIError ? error.details : void 0;
1892
+ const originalMessage = error instanceof APIError && error.status !== void 0 ? void 0 : error instanceof Error ? error.message : void 0;
1893
+ throw new ComposioToolFetchError(withApiErrorMessage(`Unable to retrieve tool with slug ${slug}`, details, originalMessage), {
1779
1894
  meta: { slug },
1780
- cause: error
1895
+ cause: error,
1896
+ possibleFixes: apiErrorSuggestedFixes(details)
1781
1897
  });
1782
1898
  }
1783
- let [modifiedTool] = await this.applyDefaultSchemaModifiers([this.transformToolCases(tool)]);
1899
+ const transformedTool = this.transformToolCases(tool);
1900
+ if (transformedTool === void 0) throw new ComposioToolSchemaInvalidError(`Tool with slug ${slug} has an unusable input schema`, { meta: { slug } });
1901
+ let [modifiedTool] = await this.applyDefaultSchemaModifiers([transformedTool]);
1784
1902
  if (options?.modifySchema) {
1785
1903
  const modifier = options.modifySchema;
1786
1904
  if (typeof modifier === "function") modifiedTool = await modifier({
@@ -2046,9 +2164,27 @@ var Tools = class {
2046
2164
  async execute(slug, body, options) {
2047
2165
  const executeParams = this.parseToolExecuteParams(body);
2048
2166
  const requestOptions = options?.signal != null ? { signal: options.signal } : void 0;
2049
- const tool = await this.getRawComposioToolBySlug(slug, { version: executeParams.version }, requestOptions);
2167
+ const tool = await this.getToolSchemaForExecute(slug, executeParams.version, requestOptions);
2050
2168
  return this.executeWithTool(slug, executeParams, options, tool);
2051
2169
  }
2170
+ /** The tool's schema for `execute()`, fetched only if no unexpired copy is cached. Failures aren't cached. */
2171
+ async getToolSchemaForExecute(slug, version, requestOptions) {
2172
+ const key = `${slug}\0${version ?? ""}`;
2173
+ const cached = this.executeToolSchemas.get(key);
2174
+ if (cached && cached.expiresAt > Date.now()) return cached.tool;
2175
+ const tool = await this.getRawComposioToolBySlug(slug, { version }, requestOptions);
2176
+ const ttlMs = (version ?? getToolkitVersion(tool.toolkit?.slug ?? "unknown", this.toolkitVersions)) === "latest" ? LATEST_TOOL_SCHEMA_TTL_MS : PINNED_TOOL_SCHEMA_TTL_MS;
2177
+ this.executeToolSchemas.delete(key);
2178
+ if (this.executeToolSchemas.size >= MAX_CACHED_TOOL_SCHEMAS) {
2179
+ const oldestKey = this.executeToolSchemas.keys().next().value;
2180
+ if (oldestKey !== void 0) this.executeToolSchemas.delete(oldestKey);
2181
+ }
2182
+ this.executeToolSchemas.set(key, {
2183
+ tool,
2184
+ expiresAt: Date.now() + ttlMs
2185
+ });
2186
+ return tool;
2187
+ }
2052
2188
  /**
2053
2189
  * Executes a tool based on a tool router session.
2054
2190
  *
@@ -2082,7 +2218,9 @@ var Tools = class {
2082
2218
  enable_auto_workbench_offload: true
2083
2219
  };
2084
2220
  if (options?.experimental) executePayload.experimental = options.experimental;
2085
- const response = await withCancellation(() => this.client.toolRouter.session.execute(body.sessionId, executePayload, withoutRetries(requestOptions)), requestOptions?.signal);
2221
+ const response = await withCancellation(() => this.client.toolRouter.session.execute(body.sessionId, executePayload, withoutRetries(requestOptions)), requestOptions?.signal).catch((error) => {
2222
+ throw handleToolExecutionError(toolSlug, error);
2223
+ });
2086
2224
  const { data, error, logId, resultType, instantCharge } = transformExecuteResponse(response, toolSlug);
2087
2225
  let result = {
2088
2226
  data,
@@ -2206,8 +2344,7 @@ var Tools = class {
2206
2344
  }
2207
2345
  };
2208
2346
 
2209
- //#endregion
2210
- //#region src/types/toolkit.types.ts
2347
+ // src/types/toolkit.types.ts
2211
2348
  /**
2212
2349
  * Toolkit list params
2213
2350
  */
@@ -2440,8 +2577,7 @@ const ToolkitListGrantContextsResponseSchema = z$1.object({
2440
2577
  });
2441
2578
  const ToolkitAuthFieldsResponseSchema = z$1.array(ToolkitAuthFieldSchema.extend({ required: z$1.boolean().optional() }));
2442
2579
 
2443
- //#endregion
2444
- //#region src/utils/transform.ts
2580
+ // src/utils/transform.ts
2445
2581
  function transform(raw) {
2446
2582
  return { with(schema) {
2447
2583
  return { using(transformer, options) {
@@ -2458,8 +2594,7 @@ function transform(raw) {
2458
2594
  } };
2459
2595
  }
2460
2596
 
2461
- //#endregion
2462
- //#region src/utils/transformers/authConfigs.ts
2597
+ // src/utils/transformers/authConfigs.ts
2463
2598
  /**
2464
2599
  * Transforms an auth config response from API format to SDK format.
2465
2600
  *
@@ -2534,8 +2669,7 @@ function transformCreateAuthConfigResponse(response) {
2534
2669
  }));
2535
2670
  }
2536
2671
 
2537
- //#endregion
2538
- //#region src/models/AuthConfigs.ts
2672
+ // src/models/AuthConfigs.ts
2539
2673
  /**
2540
2674
  * AuthConfigs class
2541
2675
  *
@@ -2799,8 +2933,7 @@ var AuthConfigs = class {
2799
2933
  }
2800
2934
  };
2801
2935
 
2802
- //#endregion
2803
- //#region src/types/connectedAccounts.types.ts
2936
+ // src/types/connectedAccounts.types.ts
2804
2937
  /**
2805
2938
  * Connected Account create parameters
2806
2939
  */
@@ -3083,8 +3216,7 @@ const ConnectedAccountCompleteAuthResponseSchema = z$1.object({
3083
3216
  toolkitSlug: z$1.string()
3084
3217
  });
3085
3218
 
3086
- //#endregion
3087
- //#region src/utils/transformers/connectedAccounts.ts
3219
+ // src/utils/transformers/connectedAccounts.ts
3088
3220
  /**
3089
3221
  * Transforms the raw connected account response from the Composio API to the SDK format.
3090
3222
  *
@@ -3170,8 +3302,7 @@ const transformConnectedAccountCompleteAuthResponse = (response) => {
3170
3302
  }));
3171
3303
  };
3172
3304
 
3173
- //#endregion
3174
- //#region src/models/ConnectionRequest.ts
3305
+ // src/models/ConnectionRequest.ts
3175
3306
  /**
3176
3307
  * @fileoverview Connection request function for Composio SDK, used to manage an initiated connection request.
3177
3308
  *
@@ -3179,6 +3310,9 @@ const transformConnectedAccountCompleteAuthResponse = (response) => {
3179
3310
  * @date 2025-05-05
3180
3311
  * @module ConnectionRequest
3181
3312
  */
3313
+ const INITIAL_POLL_DELAY_MS = 1e3;
3314
+ const MAX_POLL_DELAY_MS = 5e3;
3315
+ const POLL_DELAY_GROWTH = 1.5;
3182
3316
  /**
3183
3317
  * Creates a connection request object with methods to manage the connection lifecycle.
3184
3318
  *
@@ -3205,8 +3339,13 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
3205
3339
  /**
3206
3340
  * Waits for the connection request to complete and become active.
3207
3341
  *
3208
- * This method continuously polls the Composio API to check the status of the connection request
3209
- * until it either becomes active, enters a terminal error state, or times out.
3342
+ * This method polls the Composio API to check the status of the connection request until it
3343
+ * either becomes active, enters a terminal error state, or times out. The delay between polls
3344
+ * grows from 1 second to 5 seconds, so a connection can be up to 5 seconds old when this returns.
3345
+ * A rate-limited poll doesn't fail the wait: once the client's own retries run out, it waits as
3346
+ * long as the response asks before polling again. If that delay reaches the timeout, the wait
3347
+ * times out without another poll. The client's retries can carry the wait past the timeout,
3348
+ * because they aren't bound by it.
3210
3349
  *
3211
3350
  * @param {number} [timeout=60000] - Maximum time to wait in milliseconds before timing out (default: 60 seconds)
3212
3351
  * @returns {Promise<ConnectedAccountRetrieveResponse>} The final connected account response when successful
@@ -3241,33 +3380,34 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
3241
3380
  statusReason: response.status_reason
3242
3381
  } });
3243
3382
  };
3244
- try {
3245
- const response = await client.connectedAccounts.retrieve(request.id);
3246
- request.status = response.status;
3247
- if (response.status === ConnectedAccountStatuses.ACTIVE) return transformConnectedAccountResponse(response);
3248
- failIfTerminal(response);
3249
- } catch (error) {
3250
- if (error instanceof ComposioClient.NotFoundError) throw new ComposioConnectedAccountNotFoundError(`Connected account with id ${request.id} not found`, { meta: { connectedAccountId: request.id } });
3251
- else throw error;
3252
- }
3253
- const start = Date.now();
3254
- const pollInterval = 1e3;
3255
- while (Date.now() - start < timeout) try {
3256
- const response = await client.connectedAccounts.retrieve(request.id);
3257
- request.status = response.status;
3258
- if (response.status === ConnectedAccountStatuses.ACTIVE) return transformConnectedAccountResponse(response);
3259
- failIfTerminal(response);
3260
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
3261
- } catch (error) {
3262
- throw error;
3383
+ const deadline = Date.now() + timeout;
3384
+ let pollDelay = INITIAL_POLL_DELAY_MS;
3385
+ while (true) {
3386
+ let delay = pollDelay;
3387
+ let rateLimited = false;
3388
+ try {
3389
+ const response = await client.connectedAccounts.retrieve(request.id);
3390
+ request.status = response.status;
3391
+ if (response.status === ConnectedAccountStatuses.ACTIVE) return transformConnectedAccountResponse(response);
3392
+ failIfTerminal(response);
3393
+ } catch (error) {
3394
+ if (error instanceof ComposioClient.NotFoundError) throw new ComposioConnectedAccountNotFoundError(`Connected account with id ${request.id} not found`, { meta: { connectedAccountId: request.id } });
3395
+ if (!isRateLimitResponse(error)) throw error;
3396
+ rateLimited = true;
3397
+ delay = Math.max(delay, (getRetryAfterSeconds(error) ?? 0) * 1e3);
3398
+ }
3399
+ const remaining = deadline - Date.now();
3400
+ if (!(remaining > 0)) break;
3401
+ await new Promise((resolve) => setTimeout(resolve, Math.min(delay, remaining)));
3402
+ if (rateLimited && Date.now() >= deadline) break;
3403
+ pollDelay = Math.min(pollDelay * POLL_DELAY_GROWTH, MAX_POLL_DELAY_MS);
3263
3404
  }
3264
3405
  throw new ConnectionRequestTimeoutError(`Connection request timed out for ${request.id}`);
3265
3406
  }
3266
3407
  return request;
3267
3408
  }
3268
3409
 
3269
- //#endregion
3270
- //#region src/types/usage.types.ts
3410
+ // src/types/usage.types.ts
3271
3411
  /**
3272
3412
  * Filters shared by the usage summary and breakdown queries.
3273
3413
  * **Experimental — shape may change in future releases.**
@@ -3340,8 +3480,7 @@ const UsageBreakdownResponseSchema = z$1.object({
3340
3480
  groups: z$1.array(UsageBreakdownGroupSchema)
3341
3481
  });
3342
3482
 
3343
- //#endregion
3344
- //#region src/utils/transformers/usage.ts
3483
+ // src/utils/transformers/usage.ts
3345
3484
  const transformUsageFilters = (filters) => filters ? {
3346
3485
  user_id: filters.userId,
3347
3486
  session_id: filters.sessionId
@@ -3385,8 +3524,7 @@ const transformUsageBreakdownResponse = (response) => {
3385
3524
  }));
3386
3525
  };
3387
3526
 
3388
- //#endregion
3389
- //#region src/models/Usage.ts
3527
+ // src/models/Usage.ts
3390
3528
  /**
3391
3529
  * `composio.experimental.usage` — metering for the project the API key
3392
3530
  * belongs to. **Experimental — shape may change in future releases.**
@@ -3458,15 +3596,13 @@ var Usage = class {
3458
3596
  }
3459
3597
  };
3460
3598
 
3461
- //#endregion
3462
- //#region src/types/customToolkits.types.ts
3599
+ // src/types/customToolkits.types.ts
3463
3600
  const CustomToolkitApiKeyFieldSchema = z$1.object({
3464
3601
  displayName: z$1.string().min(1).max(100).optional(),
3465
3602
  description: z$1.string().min(1).max(500).optional()
3466
3603
  });
3467
3604
  /**
3468
3605
  * How end users authenticate to a custom toolkit.
3469
- * **Experimental — custom toolkits are in pilot; shape may change.**
3470
3606
  */
3471
3607
  const CustomToolkitAuthSchemeSchema = z$1.discriminatedUnion("mode", [
3472
3608
  z$1.object({ mode: z$1.literal("NO_AUTH") }),
@@ -3500,14 +3636,13 @@ const CustomToolkitLogoFileSchema = z$1.object({
3500
3636
  mimeType: z$1.enum(["image/png", "image/jpeg"])
3501
3637
  });
3502
3638
  /**
3503
- * Params for `composio.experimental.customToolkits.create()`.
3504
- * **Experimental — custom toolkits are in pilot; shape may change.**
3639
+ * Params for `composio.customToolkits.create()`.
3505
3640
  */
3506
3641
  const CustomToolkitCreateParamsSchema = z$1.object({
3507
3642
  /** Human-readable toolkit name. */
3508
3643
  name: z$1.string().min(1).max(200),
3509
3644
  /** The MCP server URL. Must use https. */
3510
- appUrl: z$1.string().url(),
3645
+ mcpUrl: z$1.string().url(),
3511
3646
  /** Square PNG or JPEG logo (256-1024px, max 3MB), base64-encoded. Defaults to the MCP logo. */
3512
3647
  logoFile: CustomToolkitLogoFileSchema.optional(),
3513
3648
  /** At least one scheme. Cannot be changed after create. */
@@ -3534,8 +3669,7 @@ const CustomToolkitCreateResponseSchema = z$1.object({
3534
3669
  }).nullable()
3535
3670
  });
3536
3671
  /**
3537
- * Params for `composio.experimental.customToolkits.update()`.
3538
- * **Experimental — custom toolkits are in pilot; shape may change.**
3672
+ * Params for `composio.customToolkits.update()`.
3539
3673
  */
3540
3674
  const CustomToolkitUpdateParamsSchema = z$1.object({
3541
3675
  name: z$1.string().min(1).max(200).optional(),
@@ -3554,8 +3688,7 @@ const CustomToolkitUpdateParamsSchema = z$1.object({
3554
3688
  ].some((value) => value !== void 0), { message: "Provide at least one of name, logoFile, apiKeyField" });
3555
3689
  const CustomToolkitUpdateResponseSchema = z$1.object({ success: z$1.literal(true) });
3556
3690
  /**
3557
- * Params for `composio.experimental.customToolkits.upsert()`.
3558
- * **Experimental — custom toolkits are in pilot; shape may change.**
3691
+ * Params for `composio.customToolkits.upsert()`.
3559
3692
  *
3560
3693
  * @deprecated Use `CustomToolkitCreateParams` with `create()`.
3561
3694
  */
@@ -3568,8 +3701,8 @@ const CustomToolkitUpsertParamsSchema = z$1.object({
3568
3701
  toolkitConfig: z$1.object({
3569
3702
  /** Human-readable toolkit name. */
3570
3703
  name: z$1.string().min(1).max(200),
3571
- /** The app URL. For an MCP app, the MCP server URL. */
3572
- appUrl: z$1.string().url(),
3704
+ /** The MCP server URL. Must use https. */
3705
+ mcpUrl: z$1.string().url(),
3573
3706
  /** Square PNG or JPEG logo (256-1024px, max 3MB), base64-encoded. Defaults to the Composio logo. */
3574
3707
  logoFile: CustomToolkitLogoFileSchema.optional(),
3575
3708
  /** At least one scheme. The schemes cannot change once the toolkit exists. */
@@ -3580,8 +3713,7 @@ const CustomToolkitUpsertResponseSchema = z$1.object({
3580
3713
  /** Slug of the created or updated toolkit. */
3581
3714
  slug: z$1.string() });
3582
3715
  /**
3583
- * Params for `composio.experimental.customToolkits.sync()`.
3584
- * **Experimental — custom toolkits are in pilot; shape may change.**
3716
+ * Params for `composio.customToolkits.sync()`.
3585
3717
  */
3586
3718
  const CustomToolkitSyncParamsSchema = z$1.object({
3587
3719
  /** Connected account to use when fetching the remote tool definitions. */
@@ -3603,8 +3735,7 @@ const CustomToolkitDeleteResponseSchema = z$1.object({
3603
3735
  connectedAccountsDeleted: z$1.number()
3604
3736
  });
3605
3737
 
3606
- //#endregion
3607
- //#region src/utils/transformers/customToolkits.ts
3738
+ // src/utils/transformers/customToolkits.ts
3608
3739
  const transformCustomToolkitLogoFile = (logoFile) => logoFile && {
3609
3740
  content: logoFile.content,
3610
3741
  mime_type: logoFile.mimeType
@@ -3633,7 +3764,7 @@ const transformCustomToolkitAuthScheme = (scheme) => {
3633
3764
  };
3634
3765
  const transformCustomToolkitCreateParams = (params) => ({
3635
3766
  name: params.name,
3636
- app_url: params.appUrl,
3767
+ mcp_url: params.mcpUrl,
3637
3768
  logo_file: transformCustomToolkitLogoFile(params.logoFile),
3638
3769
  auth_schemes: params.authSchemes.map(transformCustomToolkitAuthScheme),
3639
3770
  user_id: params.userId,
@@ -3662,7 +3793,7 @@ const transformCustomToolkitUpsertParams = (params) => ({
3662
3793
  slug: params.slug,
3663
3794
  toolkit_config: {
3664
3795
  name: params.toolkitConfig.name,
3665
- app_url: params.toolkitConfig.appUrl,
3796
+ mcp_url: params.toolkitConfig.mcpUrl,
3666
3797
  logo_file: transformCustomToolkitLogoFile(params.toolkitConfig.logoFile),
3667
3798
  auth_schemes: params.toolkitConfig.authSchemes.map(transformCustomToolkitAuthScheme)
3668
3799
  }
@@ -3691,14 +3822,13 @@ const transformCustomToolkitDeleteResponse = (response) => {
3691
3822
  }));
3692
3823
  };
3693
3824
 
3694
- //#endregion
3695
- //#region src/models/CustomToolkits.ts
3696
- const UPSERT_DEPRECATION = "[Deprecation] composio.experimental.customToolkits.upsert() is deprecated. Use create() for a new toolkit and update(slug, ...) to change its name, logo or API key field.";
3825
+ // src/models/CustomToolkits.ts
3826
+ const UPSERT_DEPRECATION = "[Deprecation] composio.customToolkits.upsert() is deprecated. Use create() for a new toolkit and update(slug, ...) to change its name, logo or API key field.";
3697
3827
  let _upsertDeprecationWarned = false;
3698
3828
  /**
3699
- * `composio.experimental.customToolkits` — toolkits your project registers
3829
+ * `composio.customToolkits` — toolkits your project registers
3700
3830
  * from its own app or MCP server, with their own auth configs and connected
3701
- * accounts. **Experimental — custom toolkits are in pilot; shape may change.**
3831
+ * accounts.
3702
3832
  *
3703
3833
  * These live on the Composio platform. They are unrelated to the in-process
3704
3834
  * toolkits built with `experimental_createToolkit()`, which run inside your
@@ -3706,13 +3836,13 @@ let _upsertDeprecationWarned = false;
3706
3836
  *
3707
3837
  * @example
3708
3838
  * ```typescript
3709
- * const { slug } = await composio.experimental.customToolkits.create({
3839
+ * const { slug } = await composio.customToolkits.create({
3710
3840
  * name: 'My Toolkit',
3711
- * appUrl: 'https://mcp.example.com/mcp',
3841
+ * mcpUrl: 'https://mcp.example.com/mcp',
3712
3842
  * authSchemes: [{ mode: 'DCR_OAUTH', discoveryUrl: 'https://mcp.example.com/.well-known/oauth-authorization-server' }],
3713
3843
  * userId: 'all',
3714
3844
  * });
3715
- * await composio.experimental.customToolkits.update(slug, { name: 'My Renamed Toolkit' });
3845
+ * await composio.customToolkits.update(slug, { name: 'My Renamed Toolkit' });
3716
3846
  * ```
3717
3847
  */
3718
3848
  var CustomToolkits = class {
@@ -3723,10 +3853,9 @@ var CustomToolkits = class {
3723
3853
  }
3724
3854
  /**
3725
3855
  * Creates a custom MCP toolkit and returns its generated slug.
3726
- * **Experimental — custom toolkits are in pilot; shape may change.**
3727
3856
  *
3728
3857
  * Set `userId` to `'all'` to share the toolkit with every user in the
3729
- * project, or to a user ID to make it private to that user. `appUrl`,
3858
+ * project, or to a user ID to make it private to that user. `mcpUrl`,
3730
3859
  * `authSchemes` and `userId` cannot change later: delete and re-create the
3731
3860
  * toolkit instead. For a private toolkit, `connectLink` is where to send
3732
3861
  * that user to connect.
@@ -3737,9 +3866,9 @@ var CustomToolkits = class {
3737
3866
  *
3738
3867
  * @example
3739
3868
  * ```typescript
3740
- * const { slug, connectLink } = await composio.experimental.customToolkits.create({
3869
+ * const { slug, connectLink } = await composio.customToolkits.create({
3741
3870
  * name: 'Internal API',
3742
- * appUrl: 'https://mcp.internal.example.com/mcp',
3871
+ * mcpUrl: 'https://mcp.internal.example.com/mcp',
3743
3872
  * authSchemes: [
3744
3873
  * { mode: 'API_KEY', headers: { Authorization: 'Bearer {{generic_api_key}}' } },
3745
3874
  * ],
@@ -3757,7 +3886,6 @@ var CustomToolkits = class {
3757
3886
  /**
3758
3887
  * Updates a custom toolkit's name, logo or API key field copy. Omitted
3759
3888
  * fields keep their current value.
3760
- * **Experimental — custom toolkits are in pilot; shape may change.**
3761
3889
  *
3762
3890
  * On a project with 2FA enabled, updating a private toolkit requires the
3763
3891
  * `userId` it is private to.
@@ -3769,7 +3897,7 @@ var CustomToolkits = class {
3769
3897
  *
3770
3898
  * @example
3771
3899
  * ```typescript
3772
- * await composio.experimental.customToolkits.update('CUSTOM_INTERNAL_API_K7F2Q', {
3900
+ * await composio.customToolkits.update('CUSTOM_INTERNAL_API_K7F2Q', {
3773
3901
  * name: 'Internal API (prod)',
3774
3902
  * userId: 'user_123',
3775
3903
  * });
@@ -3785,9 +3913,8 @@ var CustomToolkits = class {
3785
3913
  /**
3786
3914
  * Creates a custom toolkit, or updates its display metadata (name, API key
3787
3915
  * field copy) when the project already owns a toolkit with this slug.
3788
- * **Experimental — custom toolkits are in pilot; shape may change.**
3789
3916
  *
3790
- * `appUrl` and `authSchemes` cannot change on an existing toolkit:
3917
+ * `mcpUrl` and `authSchemes` cannot change on an existing toolkit:
3791
3918
  * re-sending them unchanged is a no-op, and changing them fails with a 409.
3792
3919
  * Delete and re-register the toolkit instead, which revokes its connections.
3793
3920
  *
@@ -3797,11 +3924,11 @@ var CustomToolkits = class {
3797
3924
  *
3798
3925
  * @example
3799
3926
  * ```typescript
3800
- * await composio.experimental.customToolkits.upsert({
3927
+ * await composio.customToolkits.upsert({
3801
3928
  * slug: 'INTERNAL_API',
3802
3929
  * toolkitConfig: {
3803
3930
  * name: 'Internal API',
3804
- * appUrl: 'https://mcp.internal.example.com/mcp',
3931
+ * mcpUrl: 'https://mcp.internal.example.com/mcp',
3805
3932
  * authSchemes: [
3806
3933
  * { mode: 'API_KEY', headers: { Authorization: 'Bearer {{generic_api_key}}' } },
3807
3934
  * ],
@@ -3827,7 +3954,6 @@ var CustomToolkits = class {
3827
3954
  /**
3828
3955
  * Re-fetches the tool definitions of a custom toolkit from its remote MCP
3829
3956
  * server. Call it when automatic sync fails or the remote tools change.
3830
- * **Experimental — custom toolkits are in pilot; shape may change.**
3831
3957
  *
3832
3958
  * @param {string} slug - The custom toolkit slug (`CUSTOM_...`)
3833
3959
  * @param {CustomToolkitSyncParams} [params] - Optional connected account to fetch the definitions with
@@ -3836,7 +3962,7 @@ var CustomToolkits = class {
3836
3962
  *
3837
3963
  * @example
3838
3964
  * ```typescript
3839
- * const { version, syncedCount } = await composio.experimental.customToolkits.sync(
3965
+ * const { version, syncedCount } = await composio.customToolkits.sync(
3840
3966
  * 'CUSTOM_MY_TOOLKIT',
3841
3967
  * { connectedAccountId: 'ca_abc123' }
3842
3968
  * );
@@ -3853,7 +3979,6 @@ var CustomToolkits = class {
3853
3979
  * Deletes a custom toolkit owned by the project, with its tools, auth
3854
3980
  * configs and connected accounts. The credentials behind those connected
3855
3981
  * accounts are revoked in background jobs (`revokeJobIds`).
3856
- * **Experimental — custom toolkits are in pilot; shape may change.**
3857
3982
  *
3858
3983
  * Composio-managed toolkits cannot be deleted; the API answers 403.
3859
3984
  *
@@ -3862,7 +3987,7 @@ var CustomToolkits = class {
3862
3987
  *
3863
3988
  * @example
3864
3989
  * ```typescript
3865
- * const result = await composio.experimental.customToolkits.delete('CUSTOM_MY_TOOLKIT');
3990
+ * const result = await composio.customToolkits.delete('CUSTOM_MY_TOOLKIT');
3866
3991
  * console.log(result.connectedAccountsDeleted);
3867
3992
  * ```
3868
3993
  */
@@ -3872,8 +3997,7 @@ var CustomToolkits = class {
3872
3997
  }
3873
3998
  };
3874
3999
 
3875
- //#endregion
3876
- //#region src/models/Experimental.ts
4000
+ // src/models/Experimental.ts
3877
4001
  /**
3878
4002
  * @fileoverview The `composio.experimental` namespace. Houses experimental
3879
4003
  * SDK methods whose shape may change in future releases.
@@ -3949,13 +4073,8 @@ var Experimental = class {
3949
4073
  */
3950
4074
  usage;
3951
4075
  /**
3952
- * Register and manage project-owned custom toolkits (`create()` / `update()` / `sync()` / `delete()`).
3953
- * **Experimental — custom toolkits are in pilot; shape may change.**
3954
- *
3955
- * @example
3956
- * ```typescript
3957
- * await composio.experimental.customToolkits.sync('CUSTOM_MY_TOOLKIT');
3958
- * ```
4076
+ * Same object as `composio.customToolkits`.
4077
+ * @deprecated Use `composio.customToolkits` instead. Custom toolkits are no longer experimental; this alias is kept for backwards compatibility.
3959
4078
  */
3960
4079
  customToolkits;
3961
4080
  constructor(client) {
@@ -4028,8 +4147,7 @@ var Experimental = class {
4028
4147
  }
4029
4148
  };
4030
4149
 
4031
- //#endregion
4032
- //#region src/models/ConnectedAccounts.ts
4150
+ // src/models/ConnectedAccounts.ts
4033
4151
  /**
4034
4152
  * @fileoverview Connected accounts class for Composio SDK, used to manage connected accounts of a user.
4035
4153
  *
@@ -4265,8 +4383,8 @@ var ConnectedAccounts = class {
4265
4383
  /**
4266
4384
  * Waits for a connection request to complete and become active.
4267
4385
  *
4268
- * This method continuously polls the Composio API to check the status of a connection
4269
- * until it either becomes active, enters a terminal error state, or times out.
4386
+ * This method polls the Composio API, backing off from 1 second to 5 seconds between polls,
4387
+ * to check the status of a connection until it either becomes active, enters a terminal error state, or times out.
4270
4388
  *
4271
4389
  * @param {string} connectedAccountId - The ID of the connected account to wait for
4272
4390
  * @param {number} [timeout=60000] - Maximum time to wait in milliseconds (default: 60 seconds)
@@ -4545,8 +4663,7 @@ var ConnectedAccounts = class {
4545
4663
  }
4546
4664
  };
4547
4665
 
4548
- //#endregion
4549
- //#region src/utils/transformers/toolkits.ts
4666
+ // src/utils/transformers/toolkits.ts
4550
4667
  const transformToolkitAuthField = (field) => ({
4551
4668
  name: field.name,
4552
4669
  displayName: field.displayName,
@@ -4700,8 +4817,7 @@ const transformToolkitListGrantContextsResponse = (response) => {
4700
4817
  }));
4701
4818
  };
4702
4819
 
4703
- //#endregion
4704
- //#region src/models/Toolkits.ts
4820
+ // src/models/Toolkits.ts
4705
4821
  /**
4706
4822
  * Toolkits class
4707
4823
  *
@@ -5000,8 +5116,7 @@ var Toolkits = class {
5000
5116
  }
5001
5117
  };
5002
5118
 
5003
- //#endregion
5004
- //#region src/types/triggers.types.ts
5119
+ // src/types/triggers.types.ts
5005
5120
  const TriggerStatuses = {
5006
5121
  ENABLE: "enable",
5007
5122
  DISABLE: "disable"
@@ -5232,8 +5347,7 @@ const VerifyWebhookParamsSchema = z$1.object({
5232
5347
  tolerance: z$1.number().optional().default(300)
5233
5348
  });
5234
5349
 
5235
- //#endregion
5236
- //#region src/types/webhooks.types.ts
5350
+ // src/types/webhooks.types.ts
5237
5351
  /**
5238
5352
  * Webhook payload versions accepted by the webhook subscription endpoints.
5239
5353
  */
@@ -5325,8 +5439,7 @@ const WebhookEndpointUpdateParamsSchema = z$1.object({
5325
5439
  /** Key-value pairs to merge into the setup fields. Omitted fields are preserved. */
5326
5440
  data: z$1.record(z$1.string(), z$1.string()) });
5327
5441
 
5328
- //#endregion
5329
- //#region src/utils/transformers/webhooks.ts
5442
+ // src/utils/transformers/webhooks.ts
5330
5443
  const transformWebhookSubscription = (response) => {
5331
5444
  return transform(response).with(WebhookSubscriptionSchema).using((response) => ({
5332
5445
  id: response.id,
@@ -5381,8 +5494,7 @@ const transformWebhookEndpointListResponse = (response) => {
5381
5494
  })) }));
5382
5495
  };
5383
5496
 
5384
- //#endregion
5385
- //#region src/models/Webhooks.ts
5497
+ // src/models/Webhooks.ts
5386
5498
  /**
5387
5499
  * The only part of the `list({ limit: 1 })` probe the upsert needs: the id of
5388
5500
  * the first (and, since the API allows one subscription per project, only)
@@ -5705,16 +5817,14 @@ var Webhooks = class {
5705
5817
  }
5706
5818
  };
5707
5819
 
5708
- //#endregion
5709
- //#region src/services/internal/InternalService.types.ts
5820
+ // src/services/internal/InternalService.types.ts
5710
5821
  const SDKRealtimeCredentialsResponseSchema = z$1.object({
5711
5822
  projectId: z$1.string().describe("The project ID"),
5712
5823
  pusherKey: z$1.string().describe("The Pusher key"),
5713
5824
  pusherCluster: z$1.string().describe("The Pusher cluster")
5714
5825
  });
5715
5826
 
5716
- //#endregion
5717
- //#region src/services/internal/InternalService.ts
5827
+ // src/services/internal/InternalService.ts
5718
5828
  const SDK_REALTIME_CREDENTIALS_ENDPOINT = "/api/v3/internal/sdk/realtime/credentials";
5719
5829
  var InternalService = class {
5720
5830
  client;
@@ -5739,8 +5849,7 @@ var InternalService = class {
5739
5849
  }
5740
5850
  };
5741
5851
 
5742
- //#endregion
5743
- //#region src/utils/userCallback.ts
5852
+ // src/utils/userCallback.ts
5744
5853
  /**
5745
5854
  * Describes a thrown or rejected value for a log line without ever throwing.
5746
5855
  *
@@ -5780,8 +5889,7 @@ function invokeUserCallback(label, callback) {
5780
5889
  }
5781
5890
  }
5782
5891
 
5783
- //#endregion
5784
- //#region src/utils/sdk.ts
5892
+ // src/utils/sdk.ts
5785
5893
  /**
5786
5894
  * Header that carries a Composio user API key (`uak_...`) instead of a project
5787
5895
  * API key. It is the only default header the credential resolver reads.
@@ -6178,8 +6286,7 @@ function getToolkitVersionsFromEnv(defaultVersions) {
6178
6286
  return toolkitVersions;
6179
6287
  }
6180
6288
 
6181
- //#endregion
6182
- //#region src/services/pusher/Pusher.ts
6289
+ // src/services/pusher/Pusher.ts
6183
6290
  /**
6184
6291
  * Owns the realtime connection that delivers trigger events.
6185
6292
  *
@@ -6389,8 +6496,7 @@ var PusherService = class {
6389
6496
  }
6390
6497
  };
6391
6498
 
6392
- //#endregion
6393
- //#region src/utils/transformers/triggers.ts
6499
+ // src/utils/transformers/triggers.ts
6394
6500
  function transformIncomingTriggerPayload(response) {
6395
6501
  return transform(response).with(IncomingTriggerPayloadSchema).using((response) => ({
6396
6502
  id: response.metadata.nanoId,
@@ -6477,8 +6583,7 @@ function transformTriggerInstanceListActiveResponse(response) {
6477
6583
  }));
6478
6584
  }
6479
6585
 
6480
- //#endregion
6481
- //#region src/utils/crypto.ts
6586
+ // src/utils/crypto.ts
6482
6587
  /**
6483
6588
  * Computes HMAC-SHA256 using Web Crypto API
6484
6589
  */
@@ -6503,8 +6608,7 @@ function timingSafeEqual(a, b) {
6503
6608
  return result === 0;
6504
6609
  }
6505
6610
 
6506
- //#endregion
6507
- //#region src/models/Triggers.ts
6611
+ // src/models/Triggers.ts
6508
6612
  /**
6509
6613
  * Safely converts a value to a string, returning the default if the value is null, undefined, or empty.
6510
6614
  * This prevents runtime crashes when calling string methods like `.toLowerCase()` on non-string values.
@@ -6758,7 +6862,9 @@ var Triggers = class {
6758
6862
  * @returns True if the trigger data matches the filters, false otherwise
6759
6863
  */
6760
6864
  shouldSendTriggerAfterFilters(filters, data) {
6761
- if (filters.toolkits?.length && !filters.toolkits.map((toolkit) => toolkit.toLowerCase()).includes(data.toolkitSlug.toLowerCase())) {
6865
+ const toolkitSlug = data.toolkitSlug.toLowerCase();
6866
+ const triggerSlug = data.triggerSlug.toLowerCase();
6867
+ if (filters.toolkits?.length && !filters.toolkits.map((toolkit) => toolkit.toLowerCase()).some((toolkit) => toolkit === toolkitSlug || triggerSlug.startsWith(`${toolkit}_`))) {
6762
6868
  logger.debug("Trigger does not match toolkits filter", JSON.stringify(filters.toolkits, null, 2));
6763
6869
  return false;
6764
6870
  }
@@ -7292,8 +7398,7 @@ var Triggers = class {
7292
7398
  }
7293
7399
  };
7294
7400
 
7295
- //#endregion
7296
- //#region src/types/mcp.experimental.types.ts
7401
+ // src/types/mcp.experimental.types.ts
7297
7402
  const MCPServerInstanceSchema = z.object({
7298
7403
  id: z.string(),
7299
7404
  name: z.string(),
@@ -7395,8 +7500,7 @@ const MCPServerConnectedAccountsSchema = z.record(z.string(), z.array(z.object({
7395
7500
  connectedAccountId: z.string()
7396
7501
  })));
7397
7502
 
7398
- //#endregion
7399
- //#region src/models/MCP.ts
7503
+ // src/models/MCP.ts
7400
7504
  function transformMCPItemResponse(response) {
7401
7505
  return transform(response).with(MCPItemSchema).using((raw) => ({
7402
7506
  name: raw.name,
@@ -7749,8 +7853,7 @@ var MCP = class {
7749
7853
  }
7750
7854
  };
7751
7855
 
7752
- //#endregion
7753
- //#region src/types/logs.types.ts
7856
+ // src/types/logs.types.ts
7754
7857
  /**
7755
7858
  * Fields a tool-execution log search can filter on.
7756
7859
  */
@@ -7848,8 +7951,7 @@ const ToolExecutionLogDetailSchema = ToolExecutionLogSchema.extend({
7848
7951
  data: z$1.record(z$1.string(), z$1.unknown())
7849
7952
  });
7850
7953
 
7851
- //#endregion
7852
- //#region src/utils/transformers/logs.ts
7954
+ // src/utils/transformers/logs.ts
7853
7955
  const transformLogSearchParams = (params) => ({
7854
7956
  limit: params.limit,
7855
7957
  cursor: params.cursor,
@@ -7910,8 +8012,7 @@ const transformToolExecutionLogDetail = (response) => {
7910
8012
  }));
7911
8013
  };
7912
8014
 
7913
- //#endregion
7914
- //#region src/models/Logs.ts
8015
+ // src/models/Logs.ts
7915
8016
  /**
7916
8017
  * `composio.logs` — tool-execution logs.
7917
8018
  *
@@ -7975,8 +8076,7 @@ var Logs = class {
7975
8076
  }
7976
8077
  };
7977
8078
 
7978
- //#endregion
7979
- //#region src/lib/sessionConfigConflict.ts
8079
+ // src/lib/sessionConfigConflict.ts
7980
8080
  const SESSION_CONFIG_CONFLICT_MARKER = "sessionConfigConflict";
7981
8081
  /**
7982
8082
  * Adds the issue raised when a saved Session config (`experimental.sessionConfigId`)
@@ -8004,8 +8104,7 @@ const parseSessionConfigInput = (schema, input) => {
8004
8104
  throw result.error;
8005
8105
  };
8006
8106
 
8007
- //#endregion
8008
- //#region src/types/toolRouter.types.ts
8107
+ // src/types/toolRouter.types.ts
8009
8108
  const SessionPreset = { DIRECT_TOOLS: "direct_tools" };
8010
8109
  const MCPServerTypeSchema = z.enum(["http", "sse"]);
8011
8110
  /**
@@ -8218,9 +8317,13 @@ const ToolRouterCreateSessionConfigBaseSchema = z.object({
8218
8317
  preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional().describe("Tool slugs to preload into session.tools() and the MCP tool list, or \"all\" to preload every app tool allowed by the session filters. \"all\" requires a positive filter such as toolkits, tools, or tags; the backend validates and caps the final tool set.") }).strict().optional().describe("Preload configuration for tools that should be exposed without search."),
8219
8318
  experimental: z.object({
8220
8319
  assistivePrompt: z.object({ userTimezone: z.string().optional().describe("IANA timezone identifier (e.g., \"America/New_York\", \"Europe/London\") for timezone-aware assistive prompts") }).optional().describe("Configuration for assistive prompt generation"),
8221
- customTools: z.array(z.custom()).optional().describe("Custom tools to include in this session. Created via createCustomTool() from @composio/core/experimental."),
8222
- customToolkits: z.array(z.custom()).optional().describe("Custom toolkits to include in this session. Created via createCustomToolkit() from @composio/core/experimental."),
8223
- sessionConfigId: z.string().min(1).optional().describe("ID of a saved Session config (`sc_…`) to apply when the session is created. Cannot be combined with toolkits, tools, tags, customTools or customToolkits."),
8320
+ localTools: z.array(z.custom()).optional().describe("Local tools to include in this session. They run in your process. Created via experimental_createTool() from @composio/core."),
8321
+ localToolkits: z.array(z.custom()).optional().describe("Toolkits of local tools to include in this session. Created via experimental_createToolkit() from @composio/core."),
8322
+ /** @deprecated Use `localTools` instead. */
8323
+ customTools: z.array(z.custom()).optional().describe("Deprecated alias for localTools. Accepted for backwards compatibility."),
8324
+ /** @deprecated Use `localToolkits` instead. */
8325
+ customToolkits: z.array(z.custom()).optional().describe("Deprecated alias for localToolkits. Accepted for backwards compatibility."),
8326
+ sessionConfigId: z.string().min(1).optional().describe("ID of a saved Session config (`sc_…`) to apply when the session is created. Cannot be combined with toolkits, tools, tags, localTools or localToolkits."),
8224
8327
  /**
8225
8328
  * What happens to a call that needs the user's approval when the
8226
8329
  * session's MCP client can't ask the user: `deny` (the default) or
@@ -8235,6 +8338,8 @@ const ToolRouterCreateSessionConfigBaseSchema = z.object({
8235
8338
  config.tools !== void 0 && "tools",
8236
8339
  config.tags !== void 0 && "tags",
8237
8340
  config.hooks !== void 0 && "hooks",
8341
+ config.experimental.localTools !== void 0 && "experimental.localTools",
8342
+ config.experimental.localToolkits !== void 0 && "experimental.localToolkits",
8238
8343
  config.experimental.customTools !== void 0 && "experimental.customTools",
8239
8344
  config.experimental.customToolkits !== void 0 && "experimental.customToolkits"
8240
8345
  ].filter((field) => field !== false));
@@ -8541,8 +8646,7 @@ const ToolRouterSessionEnsureConnectedOptionsSchema = z.object({
8541
8646
  timeout: z.number().int().positive().optional()
8542
8647
  });
8543
8648
 
8544
- //#endregion
8545
- //#region src/types/sessionConfigs.types.ts
8649
+ // src/types/sessionConfigs.types.ts
8546
8650
  /**
8547
8651
  * Params for `composio.sessionConfigs.list()`. The backend owns the defaults:
8548
8652
  * active configs only, 20 per page, at most 100.
@@ -8633,8 +8737,7 @@ const SessionConfigSchema = SessionConfigSummarySchema.extend({
8633
8737
  config: SessionConfigPolicySchema
8634
8738
  });
8635
8739
 
8636
- //#endregion
8637
- //#region src/utils/transformers/sessionConfigs.ts
8740
+ // src/utils/transformers/sessionConfigs.ts
8638
8741
  const transformSessionConfigSummary = (response) => {
8639
8742
  return transform(response).with(SessionConfigSummarySchema).using((response) => ({
8640
8743
  id: response.id,
@@ -8662,8 +8765,7 @@ const transformSessionConfig = (response) => {
8662
8765
  }));
8663
8766
  };
8664
8767
 
8665
- //#endregion
8666
- //#region src/models/SessionConfigs.ts
8768
+ // src/models/SessionConfigs.ts
8667
8769
  /**
8668
8770
  * `composio.sessionConfigs` — saved, reusable Session configs.
8669
8771
  *
@@ -8744,8 +8846,7 @@ var SessionConfigs = class {
8744
8846
  }
8745
8847
  };
8746
8848
 
8747
- //#endregion
8748
- //#region src/types/keyring.types.ts
8849
+ // src/types/keyring.types.ts
8749
8850
  /**
8750
8851
  * A public JWK a secret can be sealed to. Fields keep their JWK names so a
8751
8852
  * key can be handed straight to WebCrypto or a JOSE library.
@@ -8774,8 +8875,7 @@ const KeyringTransferKeysResponseSchema = z$1.object({
8774
8875
  keys: z$1.array(KeyringTransferKeySchema)
8775
8876
  });
8776
8877
 
8777
- //#endregion
8778
- //#region src/utils/transformers/keyring.ts
8878
+ // src/utils/transformers/keyring.ts
8779
8879
  const transformKeyringTransferKeysResponse = (response) => {
8780
8880
  return transform(response).with(KeyringTransferKeysResponseSchema).using((response) => ({
8781
8881
  activeKid: response.active_kid,
@@ -8790,8 +8890,7 @@ const transformKeyringTransferKeysResponse = (response) => {
8790
8890
  }));
8791
8891
  };
8792
8892
 
8793
- //#endregion
8794
- //#region src/models/Keyring.ts
8893
+ // src/models/Keyring.ts
8795
8894
  /**
8796
8895
  * `composio.keyring` — the organization's customer-managed keyring.
8797
8896
  *
@@ -8838,8 +8937,7 @@ var Keyring = class {
8838
8937
  }
8839
8938
  };
8840
8939
 
8841
- //#endregion
8842
- //#region src/utils/version.ts
8940
+ // src/utils/version.ts
8843
8941
  const VERSION_CHECK_TIMEOUT_MS = 2e3;
8844
8942
  /**
8845
8943
  * Checks for the latest version of the Composio SDK from NPM.
@@ -8868,8 +8966,7 @@ async function checkForLatestVersionFromNPM(currentVersion) {
8868
8966
  } catch (_error) {}
8869
8967
  }
8870
8968
 
8871
- //#endregion
8872
- //#region src/provider/BaseProvider.ts
8969
+ // src/provider/BaseProvider.ts
8873
8970
  /**
8874
8971
  * @internal
8875
8972
  * Base class for all providers.
@@ -8945,8 +9042,7 @@ var BaseAgenticProvider = class extends BaseProvider {
8945
9042
  _isAgentic = true;
8946
9043
  };
8947
9044
 
8948
- //#endregion
8949
- //#region src/utils/toolArguments.ts
9045
+ // src/utils/toolArguments.ts
8950
9046
  /**
8951
9047
  * Tool-argument normalization.
8952
9048
  *
@@ -9002,8 +9098,7 @@ function describeTool(toolSlug) {
9002
9098
  return toolSlug ? `Tool '${toolSlug}'` : "Tool";
9003
9099
  }
9004
9100
 
9005
- //#endregion
9006
- //#region src/provider/OpenAIProvider.ts
9101
+ // src/provider/OpenAIProvider.ts
9007
9102
  var OpenAIProvider = class extends BaseNonAgenticProvider {
9008
9103
  name = "openai";
9009
9104
  /**
@@ -9142,12 +9237,10 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
9142
9237
  }
9143
9238
  };
9144
9239
 
9145
- //#endregion
9146
- //#region package.json
9147
- var version = "0.28.0";
9240
+ // package.json
9241
+ var version = "0.30.0";
9148
9242
 
9149
- //#endregion
9150
- //#region src/utils/session.ts
9243
+ // src/utils/session.ts
9151
9244
  /**
9152
9245
  * Detect the JavaScript runtime environment without importing any external modules.
9153
9246
  * Uses only built-in globals to avoid breaking in different environments.
@@ -9194,8 +9287,7 @@ function getClientIdentity(provider) {
9194
9287
  };
9195
9288
  }
9196
9289
 
9197
- //#endregion
9198
- //#region src/lib/toolRouterParams.ts
9290
+ // src/lib/toolRouterParams.ts
9199
9291
  /** `require_approval` when the caller set an approval list, nothing otherwise. */
9200
9292
  const requireApprovalParam = (requireApproval) => requireApproval !== void 0 ? { require_approval: requireApproval } : {};
9201
9293
  const transformToolRouterToolsParams = (params) => {
@@ -9252,6 +9344,19 @@ const resolveToolRouterSandboxConfig = (config) => {
9252
9344
  if (config.sandbox !== void 0 && config.workbench !== void 0) throw new ValidationError("Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.");
9253
9345
  return config.sandbox ?? config.workbench;
9254
9346
  };
9347
+ /**
9348
+ * Resolves local tools and toolkits from `localTools` / `localToolkits` or
9349
+ * their deprecated `customTools` / `customToolkits` aliases. `source` picks
9350
+ * the option path named in the error: `experimental.*` on create, bare on use.
9351
+ */
9352
+ const resolveLocalToolsOptions = (options, source) => {
9353
+ if (options?.localTools !== void 0 && options.customTools !== void 0) throw new ValidationError(source === "create" ? "Pass either experimental.localTools or experimental.customTools, not both. experimental.customTools is a deprecated alias for experimental.localTools." : "Pass either localTools or customTools, not both. customTools is a deprecated alias for localTools.");
9354
+ if (options?.localToolkits !== void 0 && options.customToolkits !== void 0) throw new ValidationError(source === "create" ? "Pass either experimental.localToolkits or experimental.customToolkits, not both. experimental.customToolkits is a deprecated alias for experimental.localToolkits." : "Pass either localToolkits or customToolkits, not both. customToolkits is a deprecated alias for localToolkits.");
9355
+ return {
9356
+ tools: options?.localTools ?? options?.customTools,
9357
+ toolkits: options?.localToolkits ?? options?.customToolkits
9358
+ };
9359
+ };
9255
9360
  const transformToolRouterSandboxParams = (params) => {
9256
9361
  if (!params) return;
9257
9362
  return {
@@ -9374,8 +9479,7 @@ const transformToolRouterUpdateParams = (config) => {
9374
9479
  return params;
9375
9480
  };
9376
9481
 
9377
- //#endregion
9378
- //#region src/lib/toolRouterMcp.ts
9482
+ // src/lib/toolRouterMcp.ts
9379
9483
  /**
9380
9484
  * Returns the tuple origin (`scheme://host[:port]`) of an absolute URL.
9381
9485
  *
@@ -9452,8 +9556,7 @@ const buildMCPServerConfig = (input) => {
9452
9556
  };
9453
9557
  };
9454
9558
 
9455
- //#endregion
9456
- //#region src/lib/toolRouterSourceSessionConfig.ts
9559
+ // src/lib/toolRouterSourceSessionConfig.ts
9457
9560
  /**
9458
9561
  * Reads the saved Session config most recently applied to a session from a
9459
9562
  * create, retrieve, attach or patch response. Copies only `id`.
@@ -9463,8 +9566,7 @@ const getSourceSessionConfig = (response) => {
9463
9566
  return source ? { id: source.id } : void 0;
9464
9567
  };
9465
9568
 
9466
- //#endregion
9467
- //#region src/types/ToolRouterSessionFilesMount.types.ts
9569
+ // src/types/ToolRouterSessionFilesMount.types.ts
9468
9570
  const ToolRouterSessionFilesMountListOptionsSchema = z.object({
9469
9571
  path: z.string().optional(),
9470
9572
  mountId: z.string().default(DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID),
@@ -9519,8 +9621,7 @@ const FileDeleteResponseSchema = z.object({
9519
9621
  sandboxMountPrefix: data.sandbox_mount_prefix
9520
9622
  }));
9521
9623
 
9522
- //#endregion
9523
- //#region src/utils/safePath.ts
9624
+ // src/utils/safePath.ts
9524
9625
  /**
9525
9626
  * Filename containment for untrusted input.
9526
9627
  *
@@ -9715,8 +9816,7 @@ function safeBasename(name, label = "filename") {
9715
9816
  return portable === basename ? portable : tagWithOriginal(portable, basename);
9716
9817
  }
9717
9818
 
9718
- //#endregion
9719
- //#region src/models/RemoteFile.ts
9819
+ // src/models/RemoteFile.ts
9720
9820
  const existingFileError = z$2.object({ code: z$2.literal("EEXIST") });
9721
9821
  function getParentDir(filePath) {
9722
9822
  const lastSep = Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\"));
@@ -9852,7 +9952,8 @@ var RemoteFile = class RemoteFile {
9852
9952
  * Downloads and saves the file to the local filesystem.
9853
9953
  * Requires a Node.js runtime with file system support (not available in Cloudflare Workers/Edge).
9854
9954
  *
9855
- * @param path - Local path to save the file. If omitted, saves to the Composio temp directory using the filename from the mount path.
9955
+ * @param path - Local path to save the file. An explicit path does not require a home directory.
9956
+ * If omitted, saves to the Composio temp directory using the filename from the mount path.
9856
9957
  * An existing default destination gets a copy number before its extension.
9857
9958
  * @returns The absolute path where the file was saved
9858
9959
  * @throws Error if file system is not supported or the save fails
@@ -9860,18 +9961,20 @@ var RemoteFile = class RemoteFile {
9860
9961
  */
9861
9962
  async save(path) {
9862
9963
  if (!platform.supportsFileSystem) throw new Error("File system operations are not supported in this runtime (e.g. Cloudflare Workers). Use buffer(), text(), or blob() to work with the file content in memory, or run in Node.js.");
9964
+ if (path != null) {
9965
+ const content = await this.buffer();
9966
+ const dir = getParentDir(path);
9967
+ if (dir && !platform.existsSync(dir)) platform.mkdirSync(dir);
9968
+ platform.writeFileSync(path, content);
9969
+ return path;
9970
+ }
9863
9971
  const homeDir = platform.homedir();
9864
9972
  if (!homeDir) throw new Error("Cannot determine save location: home directory is not available");
9865
9973
  const defaultDir = platform.joinPath(homeDir, COMPOSIO_DIR, TEMP_FILES_DIRECTORY_NAME);
9866
- const defaultName = path == null ? safeBasename(this.mountRelativePath, "mount path") : "";
9867
- const savePath = path ?? platform.joinPath(defaultDir, defaultName);
9974
+ const defaultName = safeBasename(this.mountRelativePath, "mount path");
9975
+ const savePath = platform.joinPath(defaultDir, defaultName);
9868
9976
  const content = await this.buffer();
9869
- const dir = path != null ? getParentDir(savePath) : defaultDir;
9870
- if (dir && !platform.existsSync(dir)) platform.mkdirSync(dir);
9871
- if (path != null) {
9872
- platform.writeFileSync(savePath, content);
9873
- return savePath;
9874
- }
9977
+ if (!platform.existsSync(defaultDir)) platform.mkdirSync(defaultDir);
9875
9978
  for (let copy = 0;; copy++) {
9876
9979
  const destination = copy === 0 ? savePath : platform.joinPath(defaultDir, numberedBasename(defaultName, copy));
9877
9980
  try {
@@ -9884,8 +9987,7 @@ var RemoteFile = class RemoteFile {
9884
9987
  }
9885
9988
  };
9886
9989
 
9887
- //#endregion
9888
- //#region src/models/ToolRouterSessionFileMount.ts
9990
+ // src/models/ToolRouterSessionFileMount.ts
9889
9991
  /**
9890
9992
  * File mount for a Composio session, reached via `session.experimental.files`
9891
9993
  * on a session created with `composio.sessions.create(...)`. Upload, list,
@@ -10125,8 +10227,7 @@ var ToolRouterSessionFilesMount = class {
10125
10227
  }
10126
10228
  };
10127
10229
 
10128
- //#endregion
10129
- //#region src/models/proxyParamsTransform.ts
10230
+ // src/models/proxyParamsTransform.ts
10130
10231
  /**
10131
10232
  * Transform SDK session proxy params to the official client request format.
10132
10233
  * Converts SDK-facing `toolkit` → `toolkit_slug` and `parameters[].in` → `parameters[].type`.
@@ -10146,8 +10247,7 @@ function transformProxyParams(params) {
10146
10247
  };
10147
10248
  }
10148
10249
 
10149
- //#endregion
10150
- //#region src/models/customToolExecution.ts
10250
+ // src/models/customToolExecution.ts
10151
10251
  /**
10152
10252
  * Find a custom tool entry by slug.
10153
10253
  * Checks both the final slug map (LOCAL_X — agent/LLM path) and original slug map (X — programmatic path).
@@ -10212,14 +10312,7 @@ async function executeCustomTool(entry, arguments_, sessionContext, options) {
10212
10312
  }
10213
10313
  }
10214
10314
 
10215
- //#endregion
10216
- //#region src/models/inlineCustomToolsPayload.ts
10217
- function inlineCustomToolsExperimental(payload) {
10218
- return payload;
10219
- }
10220
-
10221
- //#endregion
10222
- //#region src/models/SessionContext.ts
10315
+ // src/models/SessionContext.ts
10223
10316
  /**
10224
10317
  * Concrete implementation of SessionContext.
10225
10318
  * One instance is created per session (or per multi-execute batch) and shared
@@ -10279,9 +10372,10 @@ var SessionContextImpl = class {
10279
10372
  tool_slug: toolSlug,
10280
10373
  arguments: arguments_
10281
10374
  };
10282
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10283
- if (experimental) executeParams.experimental = experimental;
10284
- const response = await withCancellation(() => this.client.toolRouter.session.execute(this.sessionId, executeParams, withoutRetries(requestOptions)), requestOptions?.signal);
10375
+ if (this.inlineCustomToolsPayload) executeParams.experimental = this.inlineCustomToolsPayload;
10376
+ const response = await withCancellation(() => this.client.toolRouter.session.execute(this.sessionId, executeParams, withoutRetries(requestOptions)), requestOptions?.signal).catch((error) => {
10377
+ throw handleToolExecutionError(toolSlug, error);
10378
+ });
10285
10379
  return ToolRouterSessionExecuteResponseSchema.parse(transformExecuteResponse(response, toolSlug));
10286
10380
  }
10287
10381
  /**
@@ -10299,8 +10393,7 @@ var SessionContextImpl = class {
10299
10393
  }
10300
10394
  };
10301
10395
 
10302
- //#endregion
10303
- //#region src/lib/toolRouterSessionDelete.ts
10396
+ // src/lib/toolRouterSessionDelete.ts
10304
10397
  async function deleteToolRouterSession(client, sessionId, requestOptions) {
10305
10398
  const response = await withCancellation(() => client.toolRouter.session.delete(sessionId, requestOptions), requestOptions?.signal);
10306
10399
  return ToolRouterSessionDeleteResponseSchema.parse({
@@ -10309,8 +10402,7 @@ async function deleteToolRouterSession(client, sessionId, requestOptions) {
10309
10402
  });
10310
10403
  }
10311
10404
 
10312
- //#endregion
10313
- //#region src/models/ToolRouterSession.ts
10405
+ // src/models/ToolRouterSession.ts
10314
10406
  const COMPOSIO_MULTI_EXECUTE_TOOL = "COMPOSIO_MULTI_EXECUTE_TOOL";
10315
10407
  /** The request fields that carry the user's answers to an earlier `input_required` call. */
10316
10408
  function inputResponseParams(options) {
@@ -10496,13 +10588,13 @@ var ToolRouterSession = class {
10496
10588
  };
10497
10589
  }
10498
10590
  /**
10499
- * List all custom tools registered in this session.
10591
+ * List all local tools registered in this session.
10500
10592
  * Returns tools with their final slugs, schemas, and resolved toolkit.
10501
10593
  *
10502
10594
  * @param options.toolkit - Filter by toolkit slug (e.g. 'gmail', 'DEV_TOOLS')
10503
- * @returns Array of registered custom tools
10595
+ * @returns Array of registered local tools
10504
10596
  */
10505
- customTools(options) {
10597
+ localTools(options) {
10506
10598
  if (!this.customToolsMap) return [];
10507
10599
  const entries = Array.from(this.customToolsMap.byFinalSlug.values());
10508
10600
  return (options?.toolkit ? entries.filter((e) => e.toolkit?.toLowerCase() === options.toolkit.toLowerCase()) : entries).map((entry) => ({
@@ -10515,12 +10607,18 @@ var ToolRouterSession = class {
10515
10607
  }));
10516
10608
  }
10517
10609
  /**
10518
- * List all custom toolkits registered in this session.
10610
+ * @deprecated Use `localTools()` instead.
10611
+ */
10612
+ customTools(options) {
10613
+ return this.localTools(options);
10614
+ }
10615
+ /**
10616
+ * List all toolkits of local tools registered in this session.
10519
10617
  * Returns toolkits with their tools showing final slugs.
10520
10618
  *
10521
- * @returns Array of registered custom toolkits
10619
+ * @returns Array of registered toolkits of local tools
10522
10620
  */
10523
- customToolkits() {
10621
+ localToolkits() {
10524
10622
  const toolkits = this.customToolsMap?.toolkits;
10525
10623
  if (!toolkits?.length) return [];
10526
10624
  return toolkits.map((tk) => ({
@@ -10541,6 +10639,12 @@ var ToolRouterSession = class {
10541
10639
  }));
10542
10640
  }
10543
10641
  /**
10642
+ * @deprecated Use `localToolkits()` instead.
10643
+ */
10644
+ customToolkits() {
10645
+ return this.localToolkits();
10646
+ }
10647
+ /**
10544
10648
  * Initiate an authorization flow for a toolkit.
10545
10649
  * Returns a ConnectionRequest with a redirect URL for the user.
10546
10650
  *
@@ -10684,11 +10788,10 @@ var ToolRouterSession = class {
10684
10788
  * Returns relevant tools for the given query with schemas and guidance.
10685
10789
  */
10686
10790
  async search(params, requestOptions) {
10687
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10688
10791
  const searchParams = {
10689
10792
  queries: [{ use_case: params.query }],
10690
10793
  ...params.toolkits?.length ? { toolkits: params.toolkits } : {},
10691
- ...experimental ? { experimental } : {}
10794
+ ...this.inlineCustomToolsPayload && { experimental: this.inlineCustomToolsPayload }
10692
10795
  };
10693
10796
  const response = await withCancellation(() => this.client.toolRouter.session.search(this.sessionId, searchParams, requestOptions), requestOptions?.signal);
10694
10797
  const transformed = transformSearchResponse(response);
@@ -10730,9 +10833,10 @@ var ToolRouterSession = class {
10730
10833
  ...inputResponseParams(options)
10731
10834
  };
10732
10835
  if (options?.account) executeParams.account = options.account;
10733
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10734
- if (experimental) executeParams.experimental = experimental;
10735
- const response = await withCancellation(() => this.client.toolRouter.session.execute(this.sessionId, executeParams, withoutRetries(requestOptions)), requestOptions?.signal);
10836
+ if (this.inlineCustomToolsPayload) executeParams.experimental = this.inlineCustomToolsPayload;
10837
+ const response = await withCancellation(() => this.client.toolRouter.session.execute(this.sessionId, executeParams, withoutRetries(requestOptions)), requestOptions?.signal).catch((error) => {
10838
+ throw handleToolExecutionError(toolSlug, error);
10839
+ });
10736
10840
  const transformed = transformExecuteResponse(response, toolSlug);
10737
10841
  return ToolRouterSessionExecuteResponseSchema.parse(transformed);
10738
10842
  }
@@ -10763,9 +10867,10 @@ var ToolRouterSession = class {
10763
10867
  arguments: arguments_ ?? {},
10764
10868
  ...inputResponseParams(options)
10765
10869
  };
10766
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10767
- if (experimental) executeMetaParams.experimental = experimental;
10768
- const response = await withCancellation(() => this.client.toolRouter.session.executeMeta(this.sessionId, executeMetaParams, withoutRetries(requestOptions)), requestOptions?.signal);
10870
+ if (this.inlineCustomToolsPayload) executeMetaParams.experimental = this.inlineCustomToolsPayload;
10871
+ const response = await withCancellation(() => this.client.toolRouter.session.executeMeta(this.sessionId, executeMetaParams, withoutRetries(requestOptions)), requestOptions?.signal).catch((error) => {
10872
+ throw handleToolExecutionError(slug, error);
10873
+ });
10769
10874
  const transformed = transformExecuteResponse(response, slug);
10770
10875
  return ToolRouterSessionExecuteResponseSchema.parse(transformed);
10771
10876
  }
@@ -10913,8 +11018,7 @@ var ToolRouterSession = class {
10913
11018
  sessionId: this.sessionId,
10914
11019
  arguments: input
10915
11020
  };
10916
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10917
- if (experimental) return ToolsModel.executeSessionTool(toolSlug, body, modifiers, tool, { experimental });
11021
+ if (this.inlineCustomToolsPayload) return ToolsModel.executeSessionTool(toolSlug, body, modifiers, tool, { experimental: this.inlineCustomToolsPayload });
10918
11022
  return ToolsModel.executeSessionTool(toolSlug, body, modifiers, tool);
10919
11023
  }
10920
11024
  /** Parse an individual tool item from COMPOSIO_MULTI_EXECUTE_TOOL's tools array */
@@ -11028,8 +11132,7 @@ var ToolRouterSession = class {
11028
11132
  }
11029
11133
  };
11030
11134
 
11031
- //#endregion
11032
- //#region src/models/ToolRouter.ts
11135
+ // src/models/ToolRouter.ts
11033
11136
  function getSessionMetadata(session) {
11034
11137
  return {
11035
11138
  config: session.config,
@@ -11088,8 +11191,7 @@ var ToolRouter = class {
11088
11191
  async create(userId, config, requestOptions) {
11089
11192
  const routerConfig = parseSessionConfigInput(ToolRouterCreateSessionConfigSchema, config ?? {});
11090
11193
  const isDirectToolsPreset = routerConfig.sessionPreset === SessionPreset.DIRECT_TOOLS;
11091
- const customTools = routerConfig.experimental?.customTools;
11092
- const customToolkits = routerConfig.experimental?.customToolkits;
11194
+ const { tools: customTools, toolkits: customToolkits } = resolveLocalToolsOptions(routerConfig.experimental, "create");
11093
11195
  const defaultCustomPreload = preloadsAllCustomTools(routerConfig.preload);
11094
11196
  const inlineCustomToolsPayload = prepareInlineCustomTools({
11095
11197
  customTools,
@@ -11141,8 +11243,7 @@ var ToolRouter = class {
11141
11243
  }, customToolsMap, userId, metadata);
11142
11244
  }
11143
11245
  async use(id, options, requestOptions) {
11144
- const customTools = options?.customTools;
11145
- const customToolkits = options?.customToolkits;
11246
+ const { tools: customTools, toolkits: customToolkits } = resolveLocalToolsOptions(options, "use");
11146
11247
  const hasCustoms = !!(customTools?.length || customToolkits?.length);
11147
11248
  let session;
11148
11249
  const attachInlineCustomToolsPayload = prepareInlineCustomTools({
@@ -11184,8 +11285,7 @@ var ToolRouter = class {
11184
11285
  }
11185
11286
  };
11186
11287
 
11187
- //#endregion
11188
- //#region src/models/Sessions.ts
11288
+ // src/models/Sessions.ts
11189
11289
  /**
11190
11290
  * First-class API for creating and reusing Composio sessions.
11191
11291
  *
@@ -11199,8 +11299,7 @@ var Sessions = class extends ToolRouter {
11199
11299
  }
11200
11300
  };
11201
11301
 
11202
- //#endregion
11203
- //#region src/utils/toolkitDeprecation.ts
11302
+ // src/utils/toolkitDeprecation.ts
11204
11303
  /**
11205
11304
  * Toolkit version deprecation warnings.
11206
11305
  *
@@ -11424,8 +11523,7 @@ function createToolkitDeprecationFetch(baseFetch) {
11424
11523
  };
11425
11524
  }
11426
11525
 
11427
- //#endregion
11428
- //#region src/composio.ts
11526
+ // src/composio.ts
11429
11527
  /**
11430
11528
  * Level for the API client given the SDK level. The client logs each request's
11431
11529
  * lifecycle at `info`, which is debug-grade for SDK users, so the client stays
@@ -11491,6 +11589,16 @@ var Composio = class Composio {
11491
11589
  /** Public transfer keys of the organization's customer-managed keyring */
11492
11590
  keyring;
11493
11591
  /**
11592
+ * Register and manage project-owned custom toolkits, such as a remote MCP
11593
+ * server (`create()` / `update()` / `sync()` / `delete()`).
11594
+ *
11595
+ * @example
11596
+ * ```typescript
11597
+ * await composio.customToolkits.sync('CUSTOM_MY_TOOLKIT');
11598
+ * ```
11599
+ */
11600
+ customToolkits;
11601
+ /**
11494
11602
  * Experimental SDK methods whose shape may change in future releases.
11495
11603
  * Prefer domain-specific mounts (for example
11496
11604
  * `composio.connectedAccounts.updateAcl(...)`) when available; this
@@ -11682,6 +11790,7 @@ var Composio = class Composio {
11682
11790
  this.logs = new Logs(this.client);
11683
11791
  this.keyring = new Keyring(this.client);
11684
11792
  this.experimental = new Experimental(this.client);
11793
+ this.customToolkits = this.experimental.customToolkits;
11685
11794
  this.sessions = new Sessions(this.client, this.config);
11686
11795
  this.toolRouter = this.sessions;
11687
11796
  this.sessionConfigs = new SessionConfigs(this.client);
@@ -11807,8 +11916,7 @@ var Composio = class Composio {
11807
11916
  }
11808
11917
  };
11809
11918
 
11810
- //#endregion
11811
- //#region src/provider/ComposioProvider.ts
11919
+ // src/provider/ComposioProvider.ts
11812
11920
  var ComposioProvider = class extends BaseNonAgenticProvider {
11813
11921
  name = "ComposioProvider";
11814
11922
  constructor() {
@@ -11822,8 +11930,7 @@ var ComposioProvider = class extends BaseNonAgenticProvider {
11822
11930
  }
11823
11931
  };
11824
11932
 
11825
- //#endregion
11826
- //#region src/utils/schemaPropertyKeys.ts
11933
+ // src/utils/schemaPropertyKeys.ts
11827
11934
  /**
11828
11935
  * JSON-schema property-key sanitization.
11829
11936
  *
@@ -12099,8 +12206,7 @@ function restoreOriginalKeys(value, mapping, depth = 0) {
12099
12206
  return value;
12100
12207
  }
12101
12208
 
12102
- //#endregion
12103
- //#region src/models/AuthScheme.ts
12209
+ // src/models/AuthScheme.ts
12104
12210
  var AuthScheme = class {
12105
12211
  /**
12106
12212
  * Creates a ConnectionData object for OAuth2 authentication.
@@ -12250,8 +12356,7 @@ var AuthScheme = class {
12250
12356
  }
12251
12357
  };
12252
12358
 
12253
- //#endregion
12254
- //#region src/types/webhookEvents.types.ts
12359
+ // src/types/webhookEvents.types.ts
12255
12360
  const WebhookEventTypes = {
12256
12361
  CONNECTION_EXPIRED: "composio.connected_account.expired",
12257
12362
  TRIGGER_MESSAGE: "composio.trigger.message"
@@ -12408,8 +12513,7 @@ const ConnectionExpiredEventSchema = z$1.object({
12408
12513
  */
12409
12514
  const WebhookEventSchema = z$1.discriminatedUnion("type", [ConnectionExpiredEventSchema]);
12410
12515
 
12411
- //#endregion
12412
- //#region src/types/mcp.types.ts
12516
+ // src/types/mcp.types.ts
12413
12517
  /**
12414
12518
  * @deprecated
12415
12519
  */
@@ -12603,5 +12707,4 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
12603
12707
  tools: z$1.array(z$1.string()).optional()
12604
12708
  });
12605
12709
 
12606
- //#endregion
12607
- export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIKeyKindError, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioConnectedAccountNotRevokableError, ComposioConnectedAccountRevocationNotSupportedError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMCPDestinationError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioScopeConfigError, ComposioSensitiveFilePathBlockedError, ComposioSessionConfigConflictError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolFetchError, ComposioToolInputRequiredError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountCompleteAuthParamsSchema, ConnectedAccountCompleteAuthResponseSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountRevokeResponseSchema, ConnectedAccountRevokedTokenSchema, 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, CustomToolkitAuthSchemeSchema, CustomToolkitCreateParamsSchema, CustomToolkitCreateResponseSchema, CustomToolkitDeleteResponseSchema, CustomToolkitSyncParamsSchema, CustomToolkitSyncResponseSchema, CustomToolkitUpdateParamsSchema, CustomToolkitUpdateResponseSchema, CustomToolkitUpsertParamsSchema, CustomToolkitUpsertResponseSchema, CustomToolkits, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, Keyring, KeyringTransferKeySchema, KeyringTransferKeysResponseSchema, LogSearchFilterFieldSchema, LogSearchFilterOperatorSchema, LogSearchFilterSchema, LogSearchParamsSchema, LogSearchResponseSchema, LogSearchTimeRangeSchema, Logs, MAX_URL_UPLOAD_SIZE_BYTES, 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, SessionConfigListParamsSchema, SessionConfigListResponseSchema, SessionConfigPolicySchema, SessionConfigSchema, SessionConfigSummarySchema, SessionConfigs, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolExecutionLogDetailSchema, ToolExecutionLogLevelSchema, ToolExecutionLogMetadataSchema, ToolExecutionLogParentSchema, ToolExecutionLogSchema, ToolExecutionLogStatusSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterBlockReasonSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterErrorCodes, ToolRouterHookAppliesToSchema, ToolRouterHookConditionCheckHandlerSchema, ToolRouterHookPromptInjectionCheckHandlerSchema, ToolRouterHookResultSchema, ToolRouterHookSchema, ToolRouterInstantSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterProxyExecuteConfigSchema, ToolRouterProxyExecuteSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionEnsureConnectedOptionsSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionListConfigHistoryOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateExperimentalSchema, ToolRouterUpdateManageConnectionsSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitChangelogItemSchema, ToolkitChangelogResponseSchema, ToolkitConditionalScopeSchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitGetManySlugsSchema, ToolkitGrantContextDimensionSchema, ToolkitLatestVersionSchema, ToolkitListGrantContextsParamsSchema, ToolkitListGrantContextsResponseSchema, ToolkitMangedByEnumSchema, ToolkitRecommendScopesParamsSchema, ToolkitRecommendScopesResponseSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionChangelogSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsGetManyParamsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceTypeSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, Usage, UsageBreakdownGroupSchema, UsageBreakdownParamsSchema, UsageBreakdownResponseSchema, UsageEntitySummarySchema, UsageFiltersSchema, UsageOrderBySchema, UsageOrderDirectionSchema, UsageSummaryParamsSchema, UsageSummaryResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEndpointCreateParamsSchema, WebhookEndpointListItemSchema, WebhookEndpointListParamsSchema, WebhookEndpointListResponseSchema, WebhookEndpointReplaceParamsSchema, WebhookEndpointSchema, WebhookEndpointUpdateParamsSchema, WebhookEndpoints, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookSubscriptionDeleteResponseSchema, WebhookSubscriptionEventTypeSchema, WebhookSubscriptionEventTypesResponseSchema, WebhookSubscriptionListParamsSchema, WebhookSubscriptionListResponseSchema, WebhookSubscriptionRotateSecretResponseSchema, WebhookSubscriptionSchema, WebhookSubscriptionSetParamsSchema, WebhookSubscriptionUpdateParamsSchema, WebhookSubscriptions, WebhookTriggerPayloadV3Schema, WebhookVersionSchema, WebhookVersions, Webhooks, 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, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };
12710
+ export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIKeyKindError, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioConnectedAccountNotRevokableError, ComposioConnectedAccountRevocationNotSupportedError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMCPDestinationError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioScopeConfigError, ComposioSensitiveFilePathBlockedError, ComposioSessionConfigConflictError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolExecutionRateLimitError, ComposioToolFetchError, ComposioToolFetchRateLimitError, ComposioToolInputRequiredError, ComposioToolNotFoundError, ComposioToolSchemaInvalidError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountCompleteAuthParamsSchema, ConnectedAccountCompleteAuthResponseSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountRevokeResponseSchema, ConnectedAccountRevokedTokenSchema, 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, CustomToolkitAuthSchemeSchema, CustomToolkitCreateParamsSchema, CustomToolkitCreateResponseSchema, CustomToolkitDeleteResponseSchema, CustomToolkitSyncParamsSchema, CustomToolkitSyncResponseSchema, CustomToolkitUpdateParamsSchema, CustomToolkitUpdateResponseSchema, CustomToolkitUpsertParamsSchema, CustomToolkitUpsertResponseSchema, CustomToolkits, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, Keyring, KeyringTransferKeySchema, KeyringTransferKeysResponseSchema, LogSearchFilterFieldSchema, LogSearchFilterOperatorSchema, LogSearchFilterSchema, LogSearchParamsSchema, LogSearchResponseSchema, LogSearchTimeRangeSchema, Logs, MAX_URL_UPLOAD_SIZE_BYTES, 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, SessionConfigListParamsSchema, SessionConfigListResponseSchema, SessionConfigPolicySchema, SessionConfigSchema, SessionConfigSummarySchema, SessionConfigs, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolExecutionLogDetailSchema, ToolExecutionLogLevelSchema, ToolExecutionLogMetadataSchema, ToolExecutionLogParentSchema, ToolExecutionLogSchema, ToolExecutionLogStatusSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterBlockReasonSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterErrorCodes, ToolRouterHookAppliesToSchema, ToolRouterHookConditionCheckHandlerSchema, ToolRouterHookPromptInjectionCheckHandlerSchema, ToolRouterHookResultSchema, ToolRouterHookSchema, ToolRouterInstantSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterProxyExecuteConfigSchema, ToolRouterProxyExecuteSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionEnsureConnectedOptionsSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionListConfigHistoryOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateExperimentalSchema, ToolRouterUpdateManageConnectionsSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitChangelogItemSchema, ToolkitChangelogResponseSchema, ToolkitConditionalScopeSchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitGetManySlugsSchema, ToolkitGrantContextDimensionSchema, ToolkitLatestVersionSchema, ToolkitListGrantContextsParamsSchema, ToolkitListGrantContextsResponseSchema, ToolkitMangedByEnumSchema, ToolkitRecommendScopesParamsSchema, ToolkitRecommendScopesResponseSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionChangelogSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsGetManyParamsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceTypeSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, Usage, UsageBreakdownGroupSchema, UsageBreakdownParamsSchema, UsageBreakdownResponseSchema, UsageEntitySummarySchema, UsageFiltersSchema, UsageOrderBySchema, UsageOrderDirectionSchema, UsageSummaryParamsSchema, UsageSummaryResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEndpointCreateParamsSchema, WebhookEndpointListItemSchema, WebhookEndpointListParamsSchema, WebhookEndpointListResponseSchema, WebhookEndpointReplaceParamsSchema, WebhookEndpointSchema, WebhookEndpointUpdateParamsSchema, WebhookEndpoints, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookSubscriptionDeleteResponseSchema, WebhookSubscriptionEventTypeSchema, WebhookSubscriptionEventTypesResponseSchema, WebhookSubscriptionListParamsSchema, WebhookSubscriptionListResponseSchema, WebhookSubscriptionRotateSecretResponseSchema, WebhookSubscriptionSchema, WebhookSubscriptionSetParamsSchema, WebhookSubscriptionUpdateParamsSchema, WebhookSubscriptions, WebhookTriggerPayloadV3Schema, WebhookVersionSchema, WebhookVersions, Webhooks, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isComposioRateLimitError, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };