@composio/core 0.29.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 (70) hide show
  1. package/README.md +23 -0
  2. package/dist/{CustomTool-Bd1KdWvo.mjs → CustomTool-9Vlb4XaS.mjs} +4 -7
  3. package/dist/{CustomTool-CMW-d2ZN.d.mts → CustomTool-Dzk3iqfP.d.mts} +2 -4
  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-D5UV5HXN.d.mts → composio-DaokW5sV.d.mts} +229 -284
  9. package/dist/{customTool.types-B9fs34dv.d.mts → customTool.types-CpJbzxT6.d.mts} +182 -245
  10. package/dist/docs/error-consistency.md +3 -3
  11. package/dist/docs/reference/sdk-reference/typescript/composio.mdx +1 -0
  12. package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +6 -11
  13. package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +1 -1
  14. package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
  15. package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +1 -1
  16. package/dist/{errors-BK6Xc7Ia.mjs → errors-xC13uvaA.mjs} +56 -139
  17. package/dist/experimental/index.d.mts +16 -2
  18. package/dist/experimental/index.mjs +1 -1
  19. package/dist/{fileUtils.node-ILI1IjnZ.mjs → fileUtils.node-CAwIbWYH.mjs} +6 -8
  20. package/dist/{files.types-DeMC_mAW.d.mts → files.types-Dg6HcEzs.d.mts} +0 -2
  21. package/dist/index.d.mts +40 -75
  22. package/dist/index.mjs +281 -243
  23. package/dist/{cancellation-BoJjs34Y.mjs → jsonSchema-Cc4EtHRw.mjs} +5 -22
  24. package/dist/models/Files.node.d.mts +32 -13
  25. package/dist/models/Files.node.mjs +36 -19
  26. package/dist/models/Files.workerd.d.mts +8 -3
  27. package/dist/models/Files.workerd.mjs +1 -2
  28. package/dist/platform/node.d.mts +2 -4
  29. package/dist/platform/node.mjs +15 -16
  30. package/dist/platform/workerd.d.mts +2 -4
  31. package/dist/platform/workerd.mjs +1 -2
  32. package/dist/requestOptions.types-DWrTcbss.d.mts +38 -0
  33. package/dist/rolldown-runtime-ad2WFvuA.mjs +17 -0
  34. package/dist/{sensitiveFileUploadPaths-BaEORC7-.mjs → sensitiveFileUploadPaths-CSyJ3Ku8.mjs} +22 -12
  35. package/dist/{ssrfGuard.node-BZ270bcu.mjs → ssrfGuard.node-CdIkwqVu.mjs} +3 -5
  36. package/dist/{types-CaP2SytR.d.mts → types-DQdUb7OG.d.mts} +2 -4
  37. package/dist/{types-DuVZKrXO.d.mts → types-Ds6XbK1m.d.mts} +0 -2
  38. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +2 -4
  39. package/dist/utils/config-defaults/ConfigDefaults.node.mjs +1 -2
  40. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +2 -4
  41. package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +1 -2
  42. package/dist/utils/modifiers/FileToolModifier.node.d.mts +2 -4
  43. package/dist/utils/modifiers/FileToolModifier.node.mjs +7 -8
  44. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +2 -4
  45. package/dist/utils/modifiers/FileToolModifier.workerd.mjs +2 -3
  46. package/dist/utils/ssrfGuard.node.d.mts +1 -3
  47. package/dist/utils/ssrfGuard.node.mjs +1 -1
  48. package/dist/utils/ssrfGuard.workerd.d.mts +1 -3
  49. package/dist/utils/ssrfGuard.workerd.mjs +2 -3
  50. package/docs/error-consistency.md +3 -3
  51. package/package.json +12 -13
  52. package/src/composio.ts +12 -0
  53. package/src/errors/ComposioError.ts +40 -16
  54. package/src/errors/ConnectedAccountsErrors.ts +2 -2
  55. package/src/errors/ToolErrors.ts +107 -30
  56. package/src/errors/apiErrorDetails.ts +40 -0
  57. package/src/models/ConnectionRequest.ts +12 -4
  58. package/src/models/CustomToolkits.ts +11 -17
  59. package/src/models/Experimental.ts +2 -7
  60. package/src/models/Files.node.ts +68 -37
  61. package/src/models/RemoteFile.ts +22 -16
  62. package/src/models/SessionContext.ts +6 -7
  63. package/src/models/ToolRouterSession.ts +16 -23
  64. package/src/models/Tools.ts +218 -20
  65. package/src/models/Triggers.ts +8 -2
  66. package/src/types/customToolkits.types.ts +4 -9
  67. package/src/utils/cancellation.ts +5 -1
  68. package/dist/FileModifierErrors-CdGSABoq.mjs +0 -97
  69. package/dist/rolldown-runtime-w6R9maHv.mjs +0 -18
  70. 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 ComposioMultipleConnectedAccountsError, A as ComposioInvalidModifierError, B as handleToolExecutionError, C as ValidationError, D as ToolkitErrorCodes, E as ComposioToolkitNotFoundError, F as ComposioToolFetchError, G as ConnectionRequestFailedError, H as getRetryAfterSeconds, I as ComposioToolFetchRateLimitError, J as ComposioConnectedAccountNotFoundError, K as ConnectionRequestTimeoutError, L as ComposioToolNotFoundError, M as ComposioProviderNotDefinedError, N as ComposioToolExecutionError, O as ComposioGlobalExecuteToolFnNotSetError, P as ComposioToolExecutionRateLimitError, Q as ComposioLegacyConnectedAccountsEndpointRetiredError, R as ComposioToolVersionRequiredError, S as JsonSchemaToZodError, T as ComposioToolkitFetchError, U as isRateLimitResponse, V as isComposioRateLimitError, W as ConnectionRequestErrorCodes, X as ComposioConnectedAccountRevocationNotSupportedError, Y as ComposioConnectedAccountNotRevokableError, Z as ComposioFailedToCreateConnectedAccountLink, _ as ComposioRequestCancelledError, a as RemoteFileDownloadError, b as isRequestAbortError, c as ComposioFailedToGetSDKRealtimeCredentialsError, d as ComposioTriggerTypeNotFoundError, et as ComposioSharedAccessDeniedError, f as ComposioWebhookPayloadError, g as ComposioNoAPIKeyError, h as ComposioAPIKeyKindError, i as ToolRouterErrorCodes, it as ComposioAuthConfigNotFoundError, j as ComposioInvalidToolArgumentsError, k as ComposioInvalidExecuteFunctionError, l as ComposioFailedToSubscribeToPusherChannelError, m as TriggerErrorCodes, n as ComposioSessionConfigConflictError, nt as ConnectedAccountErrorCodes, o as RemoteFileErrorCodes, p as ComposioWebhookSignatureVerificationError, q as ComposioAclOnlyForSharedError, r as ComposioToolInputRequiredError, rt as AuthConfigErrorCodes, s as ComposioFailedToCreatePusherClientError, t as ComposioMCPDestinationError, tt as ComposioSharedConnectionNotAccessibleError, u as ComposioFailedToUnsubscribeFromPusherChannelError, v as ComposioScopeConfigError, w as ValidationErrorCodes, x as JsonSchemaRefResolutionError, y as SDKErrorCodes, z as ToolErrorCodes } from "./errors-BK6Xc7Ia.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-BoJjs34Y.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-Bd1KdWvo.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,24 +1368,97 @@ 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
  }
1396
1463
  /** How long `execute()` reuses a schema fetched for `latest`, which can change at any release. */
1397
1464
  const LATEST_TOOL_SCHEMA_TTL_MS = 3e5;
@@ -1415,6 +1482,8 @@ var Tools = class {
1415
1482
  * Scoped per-instance so a fresh `Composio` starts with a clean slate.
1416
1483
  */
1417
1484
  warnedAutoUploadDisabledForTool = /* @__PURE__ */ new Set();
1485
+ /** Tools whose parameters were dropped by `transformToolCases`; warn once each. */
1486
+ warnedMalformedToolParametersSlugs = /* @__PURE__ */ new Set();
1418
1487
  /**
1419
1488
  * Schemas `execute()` already fetched, so repeated executions don't each spend a request.
1420
1489
  * Holds what `getRawComposioToolBySlug` returned with no `modifySchema`, so a caller's schema
@@ -1447,19 +1516,49 @@ var Tools = class {
1447
1516
  * making them more consistent with JavaScript/TypeScript conventions.
1448
1517
  *
1449
1518
  * @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool object to transform
1450
- * @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
1451
1521
  *
1452
1522
  * @private
1453
1523
  */
1454
1524
  transformToolCases(tool) {
1455
- return ToolSchema.parse({
1525
+ const candidate = {
1456
1526
  ...tool,
1457
1527
  inputParameters: normalizeRawToolParameters(tool.input_parameters),
1458
1528
  outputParameters: normalizeRawToolParameters(tool.output_parameters),
1459
1529
  availableVersions: tool.available_versions,
1460
1530
  isDeprecated: tool.deprecated?.is_deprecated ?? false,
1461
1531
  isNoAuth: tool.no_auth
1462
- });
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("; ")}`);
1463
1562
  }
1464
1563
  /**
1465
1564
  * Transforms tool execution response from snake_case API format to camelCase.
@@ -1669,7 +1768,7 @@ var Tools = class {
1669
1768
  logger.debug(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
1670
1769
  const tools = await withCancellation(() => this.client.tools.list(filters, requestOptions), requestOptions?.signal);
1671
1770
  if (!tools) return [];
1672
- const caseTransformedTools = tools.items.map((tool) => this.transformToolCases(tool));
1771
+ const caseTransformedTools = tools.items.map((tool) => this.transformToolCases(tool)).filter((tool) => tool !== void 0);
1673
1772
  let modifiedTools = await this.applyDefaultSchemaModifiers(caseTransformedTools);
1674
1773
  if (options?.modifySchema) {
1675
1774
  const modifier = options.modifySchema;
@@ -1709,7 +1808,7 @@ var Tools = class {
1709
1808
  ...cursor ? { cursor } : {}
1710
1809
  };
1711
1810
  const response = await withCancellation(() => this.client.toolRouter.session.tools(sessionId, sessionToolsParams, requestOptions), requestOptions?.signal);
1712
- tools.push(...response.items.map((tool) => this.transformToolCases(tool)));
1811
+ tools.push(...response.items.map((tool) => this.transformToolCases(tool)).filter((tool) => tool !== void 0));
1713
1812
  cursor = response.next_cursor;
1714
1813
  } while (cursor);
1715
1814
  let modifiedTools = tools;
@@ -1783,17 +1882,23 @@ var Tools = class {
1783
1882
  tool = await withCancellation(() => this.client.tools.retrieve(slug, retrieveParams, requestOptions), requestOptions?.signal);
1784
1883
  } catch (error) {
1785
1884
  if (error instanceof ComposioRequestCancelledError) throw error;
1786
- if (isRateLimitResponse(error)) throw new ComposioToolFetchRateLimitError(`Rate limited while retrieving tool with slug ${slug}`, error, { slug });
1787
- 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), {
1788
1887
  meta: { slug },
1789
- cause: error
1888
+ cause: error,
1889
+ possibleFixes: apiErrorSuggestedFixes(error.details)
1790
1890
  });
1791
- 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), {
1792
1894
  meta: { slug },
1793
- cause: error
1895
+ cause: error,
1896
+ possibleFixes: apiErrorSuggestedFixes(details)
1794
1897
  });
1795
1898
  }
1796
- 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]);
1797
1902
  if (options?.modifySchema) {
1798
1903
  const modifier = options.modifySchema;
1799
1904
  if (typeof modifier === "function") modifiedTool = await modifier({
@@ -2113,7 +2218,9 @@ var Tools = class {
2113
2218
  enable_auto_workbench_offload: true
2114
2219
  };
2115
2220
  if (options?.experimental) executePayload.experimental = options.experimental;
2116
- 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
+ });
2117
2224
  const { data, error, logId, resultType, instantCharge } = transformExecuteResponse(response, toolSlug);
2118
2225
  let result = {
2119
2226
  data,
@@ -2237,8 +2344,7 @@ var Tools = class {
2237
2344
  }
2238
2345
  };
2239
2346
 
2240
- //#endregion
2241
- //#region src/types/toolkit.types.ts
2347
+ // src/types/toolkit.types.ts
2242
2348
  /**
2243
2349
  * Toolkit list params
2244
2350
  */
@@ -2471,8 +2577,7 @@ const ToolkitListGrantContextsResponseSchema = z$1.object({
2471
2577
  });
2472
2578
  const ToolkitAuthFieldsResponseSchema = z$1.array(ToolkitAuthFieldSchema.extend({ required: z$1.boolean().optional() }));
2473
2579
 
2474
- //#endregion
2475
- //#region src/utils/transform.ts
2580
+ // src/utils/transform.ts
2476
2581
  function transform(raw) {
2477
2582
  return { with(schema) {
2478
2583
  return { using(transformer, options) {
@@ -2489,8 +2594,7 @@ function transform(raw) {
2489
2594
  } };
2490
2595
  }
2491
2596
 
2492
- //#endregion
2493
- //#region src/utils/transformers/authConfigs.ts
2597
+ // src/utils/transformers/authConfigs.ts
2494
2598
  /**
2495
2599
  * Transforms an auth config response from API format to SDK format.
2496
2600
  *
@@ -2565,8 +2669,7 @@ function transformCreateAuthConfigResponse(response) {
2565
2669
  }));
2566
2670
  }
2567
2671
 
2568
- //#endregion
2569
- //#region src/models/AuthConfigs.ts
2672
+ // src/models/AuthConfigs.ts
2570
2673
  /**
2571
2674
  * AuthConfigs class
2572
2675
  *
@@ -2830,8 +2933,7 @@ var AuthConfigs = class {
2830
2933
  }
2831
2934
  };
2832
2935
 
2833
- //#endregion
2834
- //#region src/types/connectedAccounts.types.ts
2936
+ // src/types/connectedAccounts.types.ts
2835
2937
  /**
2836
2938
  * Connected Account create parameters
2837
2939
  */
@@ -3114,8 +3216,7 @@ const ConnectedAccountCompleteAuthResponseSchema = z$1.object({
3114
3216
  toolkitSlug: z$1.string()
3115
3217
  });
3116
3218
 
3117
- //#endregion
3118
- //#region src/utils/transformers/connectedAccounts.ts
3219
+ // src/utils/transformers/connectedAccounts.ts
3119
3220
  /**
3120
3221
  * Transforms the raw connected account response from the Composio API to the SDK format.
3121
3222
  *
@@ -3201,8 +3302,7 @@ const transformConnectedAccountCompleteAuthResponse = (response) => {
3201
3302
  }));
3202
3303
  };
3203
3304
 
3204
- //#endregion
3205
- //#region src/models/ConnectionRequest.ts
3305
+ // src/models/ConnectionRequest.ts
3206
3306
  /**
3207
3307
  * @fileoverview Connection request function for Composio SDK, used to manage an initiated connection request.
3208
3308
  *
@@ -3243,8 +3343,9 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
3243
3343
  * either becomes active, enters a terminal error state, or times out. The delay between polls
3244
3344
  * grows from 1 second to 5 seconds, so a connection can be up to 5 seconds old when this returns.
3245
3345
  * A rate-limited poll doesn't fail the wait: once the client's own retries run out, it waits as
3246
- * long as the response asks, up to the timeout, and polls again. The client's retries can carry
3247
- * the wait past the timeout, because they aren't bound by it.
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.
3248
3349
  *
3249
3350
  * @param {number} [timeout=60000] - Maximum time to wait in milliseconds before timing out (default: 60 seconds)
3250
3351
  * @returns {Promise<ConnectedAccountRetrieveResponse>} The final connected account response when successful
@@ -3283,6 +3384,7 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
3283
3384
  let pollDelay = INITIAL_POLL_DELAY_MS;
3284
3385
  while (true) {
3285
3386
  let delay = pollDelay;
3387
+ let rateLimited = false;
3286
3388
  try {
3287
3389
  const response = await client.connectedAccounts.retrieve(request.id);
3288
3390
  request.status = response.status;
@@ -3291,19 +3393,21 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
3291
3393
  } catch (error) {
3292
3394
  if (error instanceof ComposioClient.NotFoundError) throw new ComposioConnectedAccountNotFoundError(`Connected account with id ${request.id} not found`, { meta: { connectedAccountId: request.id } });
3293
3395
  if (!isRateLimitResponse(error)) throw error;
3396
+ rateLimited = true;
3294
3397
  delay = Math.max(delay, (getRetryAfterSeconds(error) ?? 0) * 1e3);
3295
3398
  }
3296
3399
  const remaining = deadline - Date.now();
3297
- if (!(remaining > 0)) throw new ConnectionRequestTimeoutError(`Connection request timed out for ${request.id}`);
3400
+ if (!(remaining > 0)) break;
3298
3401
  await new Promise((resolve) => setTimeout(resolve, Math.min(delay, remaining)));
3402
+ if (rateLimited && Date.now() >= deadline) break;
3299
3403
  pollDelay = Math.min(pollDelay * POLL_DELAY_GROWTH, MAX_POLL_DELAY_MS);
3300
3404
  }
3405
+ throw new ConnectionRequestTimeoutError(`Connection request timed out for ${request.id}`);
3301
3406
  }
3302
3407
  return request;
3303
3408
  }
3304
3409
 
3305
- //#endregion
3306
- //#region src/types/usage.types.ts
3410
+ // src/types/usage.types.ts
3307
3411
  /**
3308
3412
  * Filters shared by the usage summary and breakdown queries.
3309
3413
  * **Experimental — shape may change in future releases.**
@@ -3376,8 +3480,7 @@ const UsageBreakdownResponseSchema = z$1.object({
3376
3480
  groups: z$1.array(UsageBreakdownGroupSchema)
3377
3481
  });
3378
3482
 
3379
- //#endregion
3380
- //#region src/utils/transformers/usage.ts
3483
+ // src/utils/transformers/usage.ts
3381
3484
  const transformUsageFilters = (filters) => filters ? {
3382
3485
  user_id: filters.userId,
3383
3486
  session_id: filters.sessionId
@@ -3421,8 +3524,7 @@ const transformUsageBreakdownResponse = (response) => {
3421
3524
  }));
3422
3525
  };
3423
3526
 
3424
- //#endregion
3425
- //#region src/models/Usage.ts
3527
+ // src/models/Usage.ts
3426
3528
  /**
3427
3529
  * `composio.experimental.usage` — metering for the project the API key
3428
3530
  * belongs to. **Experimental — shape may change in future releases.**
@@ -3494,15 +3596,13 @@ var Usage = class {
3494
3596
  }
3495
3597
  };
3496
3598
 
3497
- //#endregion
3498
- //#region src/types/customToolkits.types.ts
3599
+ // src/types/customToolkits.types.ts
3499
3600
  const CustomToolkitApiKeyFieldSchema = z$1.object({
3500
3601
  displayName: z$1.string().min(1).max(100).optional(),
3501
3602
  description: z$1.string().min(1).max(500).optional()
3502
3603
  });
3503
3604
  /**
3504
3605
  * How end users authenticate to a custom toolkit.
3505
- * **Experimental — custom toolkits are in pilot; shape may change.**
3506
3606
  */
3507
3607
  const CustomToolkitAuthSchemeSchema = z$1.discriminatedUnion("mode", [
3508
3608
  z$1.object({ mode: z$1.literal("NO_AUTH") }),
@@ -3536,8 +3636,7 @@ const CustomToolkitLogoFileSchema = z$1.object({
3536
3636
  mimeType: z$1.enum(["image/png", "image/jpeg"])
3537
3637
  });
3538
3638
  /**
3539
- * Params for `composio.experimental.customToolkits.create()`.
3540
- * **Experimental — custom toolkits are in pilot; shape may change.**
3639
+ * Params for `composio.customToolkits.create()`.
3541
3640
  */
3542
3641
  const CustomToolkitCreateParamsSchema = z$1.object({
3543
3642
  /** Human-readable toolkit name. */
@@ -3570,8 +3669,7 @@ const CustomToolkitCreateResponseSchema = z$1.object({
3570
3669
  }).nullable()
3571
3670
  });
3572
3671
  /**
3573
- * Params for `composio.experimental.customToolkits.update()`.
3574
- * **Experimental — custom toolkits are in pilot; shape may change.**
3672
+ * Params for `composio.customToolkits.update()`.
3575
3673
  */
3576
3674
  const CustomToolkitUpdateParamsSchema = z$1.object({
3577
3675
  name: z$1.string().min(1).max(200).optional(),
@@ -3590,8 +3688,7 @@ const CustomToolkitUpdateParamsSchema = z$1.object({
3590
3688
  ].some((value) => value !== void 0), { message: "Provide at least one of name, logoFile, apiKeyField" });
3591
3689
  const CustomToolkitUpdateResponseSchema = z$1.object({ success: z$1.literal(true) });
3592
3690
  /**
3593
- * Params for `composio.experimental.customToolkits.upsert()`.
3594
- * **Experimental — custom toolkits are in pilot; shape may change.**
3691
+ * Params for `composio.customToolkits.upsert()`.
3595
3692
  *
3596
3693
  * @deprecated Use `CustomToolkitCreateParams` with `create()`.
3597
3694
  */
@@ -3616,8 +3713,7 @@ const CustomToolkitUpsertResponseSchema = z$1.object({
3616
3713
  /** Slug of the created or updated toolkit. */
3617
3714
  slug: z$1.string() });
3618
3715
  /**
3619
- * Params for `composio.experimental.customToolkits.sync()`.
3620
- * **Experimental — custom toolkits are in pilot; shape may change.**
3716
+ * Params for `composio.customToolkits.sync()`.
3621
3717
  */
3622
3718
  const CustomToolkitSyncParamsSchema = z$1.object({
3623
3719
  /** Connected account to use when fetching the remote tool definitions. */
@@ -3639,8 +3735,7 @@ const CustomToolkitDeleteResponseSchema = z$1.object({
3639
3735
  connectedAccountsDeleted: z$1.number()
3640
3736
  });
3641
3737
 
3642
- //#endregion
3643
- //#region src/utils/transformers/customToolkits.ts
3738
+ // src/utils/transformers/customToolkits.ts
3644
3739
  const transformCustomToolkitLogoFile = (logoFile) => logoFile && {
3645
3740
  content: logoFile.content,
3646
3741
  mime_type: logoFile.mimeType
@@ -3727,14 +3822,13 @@ const transformCustomToolkitDeleteResponse = (response) => {
3727
3822
  }));
3728
3823
  };
3729
3824
 
3730
- //#endregion
3731
- //#region src/models/CustomToolkits.ts
3732
- 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.";
3733
3827
  let _upsertDeprecationWarned = false;
3734
3828
  /**
3735
- * `composio.experimental.customToolkits` — toolkits your project registers
3829
+ * `composio.customToolkits` — toolkits your project registers
3736
3830
  * from its own app or MCP server, with their own auth configs and connected
3737
- * accounts. **Experimental — custom toolkits are in pilot; shape may change.**
3831
+ * accounts.
3738
3832
  *
3739
3833
  * These live on the Composio platform. They are unrelated to the in-process
3740
3834
  * toolkits built with `experimental_createToolkit()`, which run inside your
@@ -3742,13 +3836,13 @@ let _upsertDeprecationWarned = false;
3742
3836
  *
3743
3837
  * @example
3744
3838
  * ```typescript
3745
- * const { slug } = await composio.experimental.customToolkits.create({
3839
+ * const { slug } = await composio.customToolkits.create({
3746
3840
  * name: 'My Toolkit',
3747
3841
  * mcpUrl: 'https://mcp.example.com/mcp',
3748
3842
  * authSchemes: [{ mode: 'DCR_OAUTH', discoveryUrl: 'https://mcp.example.com/.well-known/oauth-authorization-server' }],
3749
3843
  * userId: 'all',
3750
3844
  * });
3751
- * await composio.experimental.customToolkits.update(slug, { name: 'My Renamed Toolkit' });
3845
+ * await composio.customToolkits.update(slug, { name: 'My Renamed Toolkit' });
3752
3846
  * ```
3753
3847
  */
3754
3848
  var CustomToolkits = class {
@@ -3759,7 +3853,6 @@ var CustomToolkits = class {
3759
3853
  }
3760
3854
  /**
3761
3855
  * Creates a custom MCP toolkit and returns its generated slug.
3762
- * **Experimental — custom toolkits are in pilot; shape may change.**
3763
3856
  *
3764
3857
  * Set `userId` to `'all'` to share the toolkit with every user in the
3765
3858
  * project, or to a user ID to make it private to that user. `mcpUrl`,
@@ -3773,7 +3866,7 @@ var CustomToolkits = class {
3773
3866
  *
3774
3867
  * @example
3775
3868
  * ```typescript
3776
- * const { slug, connectLink } = await composio.experimental.customToolkits.create({
3869
+ * const { slug, connectLink } = await composio.customToolkits.create({
3777
3870
  * name: 'Internal API',
3778
3871
  * mcpUrl: 'https://mcp.internal.example.com/mcp',
3779
3872
  * authSchemes: [
@@ -3793,7 +3886,6 @@ var CustomToolkits = class {
3793
3886
  /**
3794
3887
  * Updates a custom toolkit's name, logo or API key field copy. Omitted
3795
3888
  * fields keep their current value.
3796
- * **Experimental — custom toolkits are in pilot; shape may change.**
3797
3889
  *
3798
3890
  * On a project with 2FA enabled, updating a private toolkit requires the
3799
3891
  * `userId` it is private to.
@@ -3805,7 +3897,7 @@ var CustomToolkits = class {
3805
3897
  *
3806
3898
  * @example
3807
3899
  * ```typescript
3808
- * await composio.experimental.customToolkits.update('CUSTOM_INTERNAL_API_K7F2Q', {
3900
+ * await composio.customToolkits.update('CUSTOM_INTERNAL_API_K7F2Q', {
3809
3901
  * name: 'Internal API (prod)',
3810
3902
  * userId: 'user_123',
3811
3903
  * });
@@ -3821,7 +3913,6 @@ var CustomToolkits = class {
3821
3913
  /**
3822
3914
  * Creates a custom toolkit, or updates its display metadata (name, API key
3823
3915
  * field copy) when the project already owns a toolkit with this slug.
3824
- * **Experimental — custom toolkits are in pilot; shape may change.**
3825
3916
  *
3826
3917
  * `mcpUrl` and `authSchemes` cannot change on an existing toolkit:
3827
3918
  * re-sending them unchanged is a no-op, and changing them fails with a 409.
@@ -3833,7 +3924,7 @@ var CustomToolkits = class {
3833
3924
  *
3834
3925
  * @example
3835
3926
  * ```typescript
3836
- * await composio.experimental.customToolkits.upsert({
3927
+ * await composio.customToolkits.upsert({
3837
3928
  * slug: 'INTERNAL_API',
3838
3929
  * toolkitConfig: {
3839
3930
  * name: 'Internal API',
@@ -3863,7 +3954,6 @@ var CustomToolkits = class {
3863
3954
  /**
3864
3955
  * Re-fetches the tool definitions of a custom toolkit from its remote MCP
3865
3956
  * server. Call it when automatic sync fails or the remote tools change.
3866
- * **Experimental — custom toolkits are in pilot; shape may change.**
3867
3957
  *
3868
3958
  * @param {string} slug - The custom toolkit slug (`CUSTOM_...`)
3869
3959
  * @param {CustomToolkitSyncParams} [params] - Optional connected account to fetch the definitions with
@@ -3872,7 +3962,7 @@ var CustomToolkits = class {
3872
3962
  *
3873
3963
  * @example
3874
3964
  * ```typescript
3875
- * const { version, syncedCount } = await composio.experimental.customToolkits.sync(
3965
+ * const { version, syncedCount } = await composio.customToolkits.sync(
3876
3966
  * 'CUSTOM_MY_TOOLKIT',
3877
3967
  * { connectedAccountId: 'ca_abc123' }
3878
3968
  * );
@@ -3889,7 +3979,6 @@ var CustomToolkits = class {
3889
3979
  * Deletes a custom toolkit owned by the project, with its tools, auth
3890
3980
  * configs and connected accounts. The credentials behind those connected
3891
3981
  * accounts are revoked in background jobs (`revokeJobIds`).
3892
- * **Experimental — custom toolkits are in pilot; shape may change.**
3893
3982
  *
3894
3983
  * Composio-managed toolkits cannot be deleted; the API answers 403.
3895
3984
  *
@@ -3898,7 +3987,7 @@ var CustomToolkits = class {
3898
3987
  *
3899
3988
  * @example
3900
3989
  * ```typescript
3901
- * const result = await composio.experimental.customToolkits.delete('CUSTOM_MY_TOOLKIT');
3990
+ * const result = await composio.customToolkits.delete('CUSTOM_MY_TOOLKIT');
3902
3991
  * console.log(result.connectedAccountsDeleted);
3903
3992
  * ```
3904
3993
  */
@@ -3908,8 +3997,7 @@ var CustomToolkits = class {
3908
3997
  }
3909
3998
  };
3910
3999
 
3911
- //#endregion
3912
- //#region src/models/Experimental.ts
4000
+ // src/models/Experimental.ts
3913
4001
  /**
3914
4002
  * @fileoverview The `composio.experimental` namespace. Houses experimental
3915
4003
  * SDK methods whose shape may change in future releases.
@@ -3985,13 +4073,8 @@ var Experimental = class {
3985
4073
  */
3986
4074
  usage;
3987
4075
  /**
3988
- * Register and manage project-owned custom toolkits (`create()` / `update()` / `sync()` / `delete()`).
3989
- * **Experimental — custom toolkits are in pilot; shape may change.**
3990
- *
3991
- * @example
3992
- * ```typescript
3993
- * await composio.experimental.customToolkits.sync('CUSTOM_MY_TOOLKIT');
3994
- * ```
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.
3995
4078
  */
3996
4079
  customToolkits;
3997
4080
  constructor(client) {
@@ -4064,8 +4147,7 @@ var Experimental = class {
4064
4147
  }
4065
4148
  };
4066
4149
 
4067
- //#endregion
4068
- //#region src/models/ConnectedAccounts.ts
4150
+ // src/models/ConnectedAccounts.ts
4069
4151
  /**
4070
4152
  * @fileoverview Connected accounts class for Composio SDK, used to manage connected accounts of a user.
4071
4153
  *
@@ -4581,8 +4663,7 @@ var ConnectedAccounts = class {
4581
4663
  }
4582
4664
  };
4583
4665
 
4584
- //#endregion
4585
- //#region src/utils/transformers/toolkits.ts
4666
+ // src/utils/transformers/toolkits.ts
4586
4667
  const transformToolkitAuthField = (field) => ({
4587
4668
  name: field.name,
4588
4669
  displayName: field.displayName,
@@ -4736,8 +4817,7 @@ const transformToolkitListGrantContextsResponse = (response) => {
4736
4817
  }));
4737
4818
  };
4738
4819
 
4739
- //#endregion
4740
- //#region src/models/Toolkits.ts
4820
+ // src/models/Toolkits.ts
4741
4821
  /**
4742
4822
  * Toolkits class
4743
4823
  *
@@ -5036,8 +5116,7 @@ var Toolkits = class {
5036
5116
  }
5037
5117
  };
5038
5118
 
5039
- //#endregion
5040
- //#region src/types/triggers.types.ts
5119
+ // src/types/triggers.types.ts
5041
5120
  const TriggerStatuses = {
5042
5121
  ENABLE: "enable",
5043
5122
  DISABLE: "disable"
@@ -5268,8 +5347,7 @@ const VerifyWebhookParamsSchema = z$1.object({
5268
5347
  tolerance: z$1.number().optional().default(300)
5269
5348
  });
5270
5349
 
5271
- //#endregion
5272
- //#region src/types/webhooks.types.ts
5350
+ // src/types/webhooks.types.ts
5273
5351
  /**
5274
5352
  * Webhook payload versions accepted by the webhook subscription endpoints.
5275
5353
  */
@@ -5361,8 +5439,7 @@ const WebhookEndpointUpdateParamsSchema = z$1.object({
5361
5439
  /** Key-value pairs to merge into the setup fields. Omitted fields are preserved. */
5362
5440
  data: z$1.record(z$1.string(), z$1.string()) });
5363
5441
 
5364
- //#endregion
5365
- //#region src/utils/transformers/webhooks.ts
5442
+ // src/utils/transformers/webhooks.ts
5366
5443
  const transformWebhookSubscription = (response) => {
5367
5444
  return transform(response).with(WebhookSubscriptionSchema).using((response) => ({
5368
5445
  id: response.id,
@@ -5417,8 +5494,7 @@ const transformWebhookEndpointListResponse = (response) => {
5417
5494
  })) }));
5418
5495
  };
5419
5496
 
5420
- //#endregion
5421
- //#region src/models/Webhooks.ts
5497
+ // src/models/Webhooks.ts
5422
5498
  /**
5423
5499
  * The only part of the `list({ limit: 1 })` probe the upsert needs: the id of
5424
5500
  * the first (and, since the API allows one subscription per project, only)
@@ -5741,16 +5817,14 @@ var Webhooks = class {
5741
5817
  }
5742
5818
  };
5743
5819
 
5744
- //#endregion
5745
- //#region src/services/internal/InternalService.types.ts
5820
+ // src/services/internal/InternalService.types.ts
5746
5821
  const SDKRealtimeCredentialsResponseSchema = z$1.object({
5747
5822
  projectId: z$1.string().describe("The project ID"),
5748
5823
  pusherKey: z$1.string().describe("The Pusher key"),
5749
5824
  pusherCluster: z$1.string().describe("The Pusher cluster")
5750
5825
  });
5751
5826
 
5752
- //#endregion
5753
- //#region src/services/internal/InternalService.ts
5827
+ // src/services/internal/InternalService.ts
5754
5828
  const SDK_REALTIME_CREDENTIALS_ENDPOINT = "/api/v3/internal/sdk/realtime/credentials";
5755
5829
  var InternalService = class {
5756
5830
  client;
@@ -5775,8 +5849,7 @@ var InternalService = class {
5775
5849
  }
5776
5850
  };
5777
5851
 
5778
- //#endregion
5779
- //#region src/utils/userCallback.ts
5852
+ // src/utils/userCallback.ts
5780
5853
  /**
5781
5854
  * Describes a thrown or rejected value for a log line without ever throwing.
5782
5855
  *
@@ -5816,8 +5889,7 @@ function invokeUserCallback(label, callback) {
5816
5889
  }
5817
5890
  }
5818
5891
 
5819
- //#endregion
5820
- //#region src/utils/sdk.ts
5892
+ // src/utils/sdk.ts
5821
5893
  /**
5822
5894
  * Header that carries a Composio user API key (`uak_...`) instead of a project
5823
5895
  * API key. It is the only default header the credential resolver reads.
@@ -6214,8 +6286,7 @@ function getToolkitVersionsFromEnv(defaultVersions) {
6214
6286
  return toolkitVersions;
6215
6287
  }
6216
6288
 
6217
- //#endregion
6218
- //#region src/services/pusher/Pusher.ts
6289
+ // src/services/pusher/Pusher.ts
6219
6290
  /**
6220
6291
  * Owns the realtime connection that delivers trigger events.
6221
6292
  *
@@ -6425,8 +6496,7 @@ var PusherService = class {
6425
6496
  }
6426
6497
  };
6427
6498
 
6428
- //#endregion
6429
- //#region src/utils/transformers/triggers.ts
6499
+ // src/utils/transformers/triggers.ts
6430
6500
  function transformIncomingTriggerPayload(response) {
6431
6501
  return transform(response).with(IncomingTriggerPayloadSchema).using((response) => ({
6432
6502
  id: response.metadata.nanoId,
@@ -6513,8 +6583,7 @@ function transformTriggerInstanceListActiveResponse(response) {
6513
6583
  }));
6514
6584
  }
6515
6585
 
6516
- //#endregion
6517
- //#region src/utils/crypto.ts
6586
+ // src/utils/crypto.ts
6518
6587
  /**
6519
6588
  * Computes HMAC-SHA256 using Web Crypto API
6520
6589
  */
@@ -6539,8 +6608,7 @@ function timingSafeEqual(a, b) {
6539
6608
  return result === 0;
6540
6609
  }
6541
6610
 
6542
- //#endregion
6543
- //#region src/models/Triggers.ts
6611
+ // src/models/Triggers.ts
6544
6612
  /**
6545
6613
  * Safely converts a value to a string, returning the default if the value is null, undefined, or empty.
6546
6614
  * This prevents runtime crashes when calling string methods like `.toLowerCase()` on non-string values.
@@ -6794,7 +6862,9 @@ var Triggers = class {
6794
6862
  * @returns True if the trigger data matches the filters, false otherwise
6795
6863
  */
6796
6864
  shouldSendTriggerAfterFilters(filters, data) {
6797
- 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}_`))) {
6798
6868
  logger.debug("Trigger does not match toolkits filter", JSON.stringify(filters.toolkits, null, 2));
6799
6869
  return false;
6800
6870
  }
@@ -7328,8 +7398,7 @@ var Triggers = class {
7328
7398
  }
7329
7399
  };
7330
7400
 
7331
- //#endregion
7332
- //#region src/types/mcp.experimental.types.ts
7401
+ // src/types/mcp.experimental.types.ts
7333
7402
  const MCPServerInstanceSchema = z.object({
7334
7403
  id: z.string(),
7335
7404
  name: z.string(),
@@ -7431,8 +7500,7 @@ const MCPServerConnectedAccountsSchema = z.record(z.string(), z.array(z.object({
7431
7500
  connectedAccountId: z.string()
7432
7501
  })));
7433
7502
 
7434
- //#endregion
7435
- //#region src/models/MCP.ts
7503
+ // src/models/MCP.ts
7436
7504
  function transformMCPItemResponse(response) {
7437
7505
  return transform(response).with(MCPItemSchema).using((raw) => ({
7438
7506
  name: raw.name,
@@ -7785,8 +7853,7 @@ var MCP = class {
7785
7853
  }
7786
7854
  };
7787
7855
 
7788
- //#endregion
7789
- //#region src/types/logs.types.ts
7856
+ // src/types/logs.types.ts
7790
7857
  /**
7791
7858
  * Fields a tool-execution log search can filter on.
7792
7859
  */
@@ -7884,8 +7951,7 @@ const ToolExecutionLogDetailSchema = ToolExecutionLogSchema.extend({
7884
7951
  data: z$1.record(z$1.string(), z$1.unknown())
7885
7952
  });
7886
7953
 
7887
- //#endregion
7888
- //#region src/utils/transformers/logs.ts
7954
+ // src/utils/transformers/logs.ts
7889
7955
  const transformLogSearchParams = (params) => ({
7890
7956
  limit: params.limit,
7891
7957
  cursor: params.cursor,
@@ -7946,8 +8012,7 @@ const transformToolExecutionLogDetail = (response) => {
7946
8012
  }));
7947
8013
  };
7948
8014
 
7949
- //#endregion
7950
- //#region src/models/Logs.ts
8015
+ // src/models/Logs.ts
7951
8016
  /**
7952
8017
  * `composio.logs` — tool-execution logs.
7953
8018
  *
@@ -8011,8 +8076,7 @@ var Logs = class {
8011
8076
  }
8012
8077
  };
8013
8078
 
8014
- //#endregion
8015
- //#region src/lib/sessionConfigConflict.ts
8079
+ // src/lib/sessionConfigConflict.ts
8016
8080
  const SESSION_CONFIG_CONFLICT_MARKER = "sessionConfigConflict";
8017
8081
  /**
8018
8082
  * Adds the issue raised when a saved Session config (`experimental.sessionConfigId`)
@@ -8040,8 +8104,7 @@ const parseSessionConfigInput = (schema, input) => {
8040
8104
  throw result.error;
8041
8105
  };
8042
8106
 
8043
- //#endregion
8044
- //#region src/types/toolRouter.types.ts
8107
+ // src/types/toolRouter.types.ts
8045
8108
  const SessionPreset = { DIRECT_TOOLS: "direct_tools" };
8046
8109
  const MCPServerTypeSchema = z.enum(["http", "sse"]);
8047
8110
  /**
@@ -8583,8 +8646,7 @@ const ToolRouterSessionEnsureConnectedOptionsSchema = z.object({
8583
8646
  timeout: z.number().int().positive().optional()
8584
8647
  });
8585
8648
 
8586
- //#endregion
8587
- //#region src/types/sessionConfigs.types.ts
8649
+ // src/types/sessionConfigs.types.ts
8588
8650
  /**
8589
8651
  * Params for `composio.sessionConfigs.list()`. The backend owns the defaults:
8590
8652
  * active configs only, 20 per page, at most 100.
@@ -8675,8 +8737,7 @@ const SessionConfigSchema = SessionConfigSummarySchema.extend({
8675
8737
  config: SessionConfigPolicySchema
8676
8738
  });
8677
8739
 
8678
- //#endregion
8679
- //#region src/utils/transformers/sessionConfigs.ts
8740
+ // src/utils/transformers/sessionConfigs.ts
8680
8741
  const transformSessionConfigSummary = (response) => {
8681
8742
  return transform(response).with(SessionConfigSummarySchema).using((response) => ({
8682
8743
  id: response.id,
@@ -8704,8 +8765,7 @@ const transformSessionConfig = (response) => {
8704
8765
  }));
8705
8766
  };
8706
8767
 
8707
- //#endregion
8708
- //#region src/models/SessionConfigs.ts
8768
+ // src/models/SessionConfigs.ts
8709
8769
  /**
8710
8770
  * `composio.sessionConfigs` — saved, reusable Session configs.
8711
8771
  *
@@ -8786,8 +8846,7 @@ var SessionConfigs = class {
8786
8846
  }
8787
8847
  };
8788
8848
 
8789
- //#endregion
8790
- //#region src/types/keyring.types.ts
8849
+ // src/types/keyring.types.ts
8791
8850
  /**
8792
8851
  * A public JWK a secret can be sealed to. Fields keep their JWK names so a
8793
8852
  * key can be handed straight to WebCrypto or a JOSE library.
@@ -8816,8 +8875,7 @@ const KeyringTransferKeysResponseSchema = z$1.object({
8816
8875
  keys: z$1.array(KeyringTransferKeySchema)
8817
8876
  });
8818
8877
 
8819
- //#endregion
8820
- //#region src/utils/transformers/keyring.ts
8878
+ // src/utils/transformers/keyring.ts
8821
8879
  const transformKeyringTransferKeysResponse = (response) => {
8822
8880
  return transform(response).with(KeyringTransferKeysResponseSchema).using((response) => ({
8823
8881
  activeKid: response.active_kid,
@@ -8832,8 +8890,7 @@ const transformKeyringTransferKeysResponse = (response) => {
8832
8890
  }));
8833
8891
  };
8834
8892
 
8835
- //#endregion
8836
- //#region src/models/Keyring.ts
8893
+ // src/models/Keyring.ts
8837
8894
  /**
8838
8895
  * `composio.keyring` — the organization's customer-managed keyring.
8839
8896
  *
@@ -8880,8 +8937,7 @@ var Keyring = class {
8880
8937
  }
8881
8938
  };
8882
8939
 
8883
- //#endregion
8884
- //#region src/utils/version.ts
8940
+ // src/utils/version.ts
8885
8941
  const VERSION_CHECK_TIMEOUT_MS = 2e3;
8886
8942
  /**
8887
8943
  * Checks for the latest version of the Composio SDK from NPM.
@@ -8910,8 +8966,7 @@ async function checkForLatestVersionFromNPM(currentVersion) {
8910
8966
  } catch (_error) {}
8911
8967
  }
8912
8968
 
8913
- //#endregion
8914
- //#region src/provider/BaseProvider.ts
8969
+ // src/provider/BaseProvider.ts
8915
8970
  /**
8916
8971
  * @internal
8917
8972
  * Base class for all providers.
@@ -8987,8 +9042,7 @@ var BaseAgenticProvider = class extends BaseProvider {
8987
9042
  _isAgentic = true;
8988
9043
  };
8989
9044
 
8990
- //#endregion
8991
- //#region src/utils/toolArguments.ts
9045
+ // src/utils/toolArguments.ts
8992
9046
  /**
8993
9047
  * Tool-argument normalization.
8994
9048
  *
@@ -9044,8 +9098,7 @@ function describeTool(toolSlug) {
9044
9098
  return toolSlug ? `Tool '${toolSlug}'` : "Tool";
9045
9099
  }
9046
9100
 
9047
- //#endregion
9048
- //#region src/provider/OpenAIProvider.ts
9101
+ // src/provider/OpenAIProvider.ts
9049
9102
  var OpenAIProvider = class extends BaseNonAgenticProvider {
9050
9103
  name = "openai";
9051
9104
  /**
@@ -9184,12 +9237,10 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
9184
9237
  }
9185
9238
  };
9186
9239
 
9187
- //#endregion
9188
- //#region package.json
9189
- var version = "0.29.0";
9240
+ // package.json
9241
+ var version = "0.30.0";
9190
9242
 
9191
- //#endregion
9192
- //#region src/utils/session.ts
9243
+ // src/utils/session.ts
9193
9244
  /**
9194
9245
  * Detect the JavaScript runtime environment without importing any external modules.
9195
9246
  * Uses only built-in globals to avoid breaking in different environments.
@@ -9236,8 +9287,7 @@ function getClientIdentity(provider) {
9236
9287
  };
9237
9288
  }
9238
9289
 
9239
- //#endregion
9240
- //#region src/lib/toolRouterParams.ts
9290
+ // src/lib/toolRouterParams.ts
9241
9291
  /** `require_approval` when the caller set an approval list, nothing otherwise. */
9242
9292
  const requireApprovalParam = (requireApproval) => requireApproval !== void 0 ? { require_approval: requireApproval } : {};
9243
9293
  const transformToolRouterToolsParams = (params) => {
@@ -9429,8 +9479,7 @@ const transformToolRouterUpdateParams = (config) => {
9429
9479
  return params;
9430
9480
  };
9431
9481
 
9432
- //#endregion
9433
- //#region src/lib/toolRouterMcp.ts
9482
+ // src/lib/toolRouterMcp.ts
9434
9483
  /**
9435
9484
  * Returns the tuple origin (`scheme://host[:port]`) of an absolute URL.
9436
9485
  *
@@ -9507,8 +9556,7 @@ const buildMCPServerConfig = (input) => {
9507
9556
  };
9508
9557
  };
9509
9558
 
9510
- //#endregion
9511
- //#region src/lib/toolRouterSourceSessionConfig.ts
9559
+ // src/lib/toolRouterSourceSessionConfig.ts
9512
9560
  /**
9513
9561
  * Reads the saved Session config most recently applied to a session from a
9514
9562
  * create, retrieve, attach or patch response. Copies only `id`.
@@ -9518,8 +9566,7 @@ const getSourceSessionConfig = (response) => {
9518
9566
  return source ? { id: source.id } : void 0;
9519
9567
  };
9520
9568
 
9521
- //#endregion
9522
- //#region src/types/ToolRouterSessionFilesMount.types.ts
9569
+ // src/types/ToolRouterSessionFilesMount.types.ts
9523
9570
  const ToolRouterSessionFilesMountListOptionsSchema = z.object({
9524
9571
  path: z.string().optional(),
9525
9572
  mountId: z.string().default(DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID),
@@ -9574,8 +9621,7 @@ const FileDeleteResponseSchema = z.object({
9574
9621
  sandboxMountPrefix: data.sandbox_mount_prefix
9575
9622
  }));
9576
9623
 
9577
- //#endregion
9578
- //#region src/utils/safePath.ts
9624
+ // src/utils/safePath.ts
9579
9625
  /**
9580
9626
  * Filename containment for untrusted input.
9581
9627
  *
@@ -9770,8 +9816,7 @@ function safeBasename(name, label = "filename") {
9770
9816
  return portable === basename ? portable : tagWithOriginal(portable, basename);
9771
9817
  }
9772
9818
 
9773
- //#endregion
9774
- //#region src/models/RemoteFile.ts
9819
+ // src/models/RemoteFile.ts
9775
9820
  const existingFileError = z$2.object({ code: z$2.literal("EEXIST") });
9776
9821
  function getParentDir(filePath) {
9777
9822
  const lastSep = Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\"));
@@ -9907,7 +9952,8 @@ var RemoteFile = class RemoteFile {
9907
9952
  * Downloads and saves the file to the local filesystem.
9908
9953
  * Requires a Node.js runtime with file system support (not available in Cloudflare Workers/Edge).
9909
9954
  *
9910
- * @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.
9911
9957
  * An existing default destination gets a copy number before its extension.
9912
9958
  * @returns The absolute path where the file was saved
9913
9959
  * @throws Error if file system is not supported or the save fails
@@ -9915,18 +9961,20 @@ var RemoteFile = class RemoteFile {
9915
9961
  */
9916
9962
  async save(path) {
9917
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
+ }
9918
9971
  const homeDir = platform.homedir();
9919
9972
  if (!homeDir) throw new Error("Cannot determine save location: home directory is not available");
9920
9973
  const defaultDir = platform.joinPath(homeDir, COMPOSIO_DIR, TEMP_FILES_DIRECTORY_NAME);
9921
- const defaultName = path == null ? safeBasename(this.mountRelativePath, "mount path") : "";
9922
- const savePath = path ?? platform.joinPath(defaultDir, defaultName);
9974
+ const defaultName = safeBasename(this.mountRelativePath, "mount path");
9975
+ const savePath = platform.joinPath(defaultDir, defaultName);
9923
9976
  const content = await this.buffer();
9924
- const dir = path != null ? getParentDir(savePath) : defaultDir;
9925
- if (dir && !platform.existsSync(dir)) platform.mkdirSync(dir);
9926
- if (path != null) {
9927
- platform.writeFileSync(savePath, content);
9928
- return savePath;
9929
- }
9977
+ if (!platform.existsSync(defaultDir)) platform.mkdirSync(defaultDir);
9930
9978
  for (let copy = 0;; copy++) {
9931
9979
  const destination = copy === 0 ? savePath : platform.joinPath(defaultDir, numberedBasename(defaultName, copy));
9932
9980
  try {
@@ -9939,8 +9987,7 @@ var RemoteFile = class RemoteFile {
9939
9987
  }
9940
9988
  };
9941
9989
 
9942
- //#endregion
9943
- //#region src/models/ToolRouterSessionFileMount.ts
9990
+ // src/models/ToolRouterSessionFileMount.ts
9944
9991
  /**
9945
9992
  * File mount for a Composio session, reached via `session.experimental.files`
9946
9993
  * on a session created with `composio.sessions.create(...)`. Upload, list,
@@ -10180,8 +10227,7 @@ var ToolRouterSessionFilesMount = class {
10180
10227
  }
10181
10228
  };
10182
10229
 
10183
- //#endregion
10184
- //#region src/models/proxyParamsTransform.ts
10230
+ // src/models/proxyParamsTransform.ts
10185
10231
  /**
10186
10232
  * Transform SDK session proxy params to the official client request format.
10187
10233
  * Converts SDK-facing `toolkit` → `toolkit_slug` and `parameters[].in` → `parameters[].type`.
@@ -10201,8 +10247,7 @@ function transformProxyParams(params) {
10201
10247
  };
10202
10248
  }
10203
10249
 
10204
- //#endregion
10205
- //#region src/models/customToolExecution.ts
10250
+ // src/models/customToolExecution.ts
10206
10251
  /**
10207
10252
  * Find a custom tool entry by slug.
10208
10253
  * Checks both the final slug map (LOCAL_X — agent/LLM path) and original slug map (X — programmatic path).
@@ -10267,14 +10312,7 @@ async function executeCustomTool(entry, arguments_, sessionContext, options) {
10267
10312
  }
10268
10313
  }
10269
10314
 
10270
- //#endregion
10271
- //#region src/models/inlineCustomToolsPayload.ts
10272
- function inlineCustomToolsExperimental(payload) {
10273
- return payload;
10274
- }
10275
-
10276
- //#endregion
10277
- //#region src/models/SessionContext.ts
10315
+ // src/models/SessionContext.ts
10278
10316
  /**
10279
10317
  * Concrete implementation of SessionContext.
10280
10318
  * One instance is created per session (or per multi-execute batch) and shared
@@ -10334,9 +10372,10 @@ var SessionContextImpl = class {
10334
10372
  tool_slug: toolSlug,
10335
10373
  arguments: arguments_
10336
10374
  };
10337
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10338
- if (experimental) executeParams.experimental = experimental;
10339
- 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
+ });
10340
10379
  return ToolRouterSessionExecuteResponseSchema.parse(transformExecuteResponse(response, toolSlug));
10341
10380
  }
10342
10381
  /**
@@ -10354,8 +10393,7 @@ var SessionContextImpl = class {
10354
10393
  }
10355
10394
  };
10356
10395
 
10357
- //#endregion
10358
- //#region src/lib/toolRouterSessionDelete.ts
10396
+ // src/lib/toolRouterSessionDelete.ts
10359
10397
  async function deleteToolRouterSession(client, sessionId, requestOptions) {
10360
10398
  const response = await withCancellation(() => client.toolRouter.session.delete(sessionId, requestOptions), requestOptions?.signal);
10361
10399
  return ToolRouterSessionDeleteResponseSchema.parse({
@@ -10364,8 +10402,7 @@ async function deleteToolRouterSession(client, sessionId, requestOptions) {
10364
10402
  });
10365
10403
  }
10366
10404
 
10367
- //#endregion
10368
- //#region src/models/ToolRouterSession.ts
10405
+ // src/models/ToolRouterSession.ts
10369
10406
  const COMPOSIO_MULTI_EXECUTE_TOOL = "COMPOSIO_MULTI_EXECUTE_TOOL";
10370
10407
  /** The request fields that carry the user's answers to an earlier `input_required` call. */
10371
10408
  function inputResponseParams(options) {
@@ -10751,11 +10788,10 @@ var ToolRouterSession = class {
10751
10788
  * Returns relevant tools for the given query with schemas and guidance.
10752
10789
  */
10753
10790
  async search(params, requestOptions) {
10754
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10755
10791
  const searchParams = {
10756
10792
  queries: [{ use_case: params.query }],
10757
10793
  ...params.toolkits?.length ? { toolkits: params.toolkits } : {},
10758
- ...experimental ? { experimental } : {}
10794
+ ...this.inlineCustomToolsPayload && { experimental: this.inlineCustomToolsPayload }
10759
10795
  };
10760
10796
  const response = await withCancellation(() => this.client.toolRouter.session.search(this.sessionId, searchParams, requestOptions), requestOptions?.signal);
10761
10797
  const transformed = transformSearchResponse(response);
@@ -10797,9 +10833,10 @@ var ToolRouterSession = class {
10797
10833
  ...inputResponseParams(options)
10798
10834
  };
10799
10835
  if (options?.account) executeParams.account = options.account;
10800
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10801
- if (experimental) executeParams.experimental = experimental;
10802
- 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
+ });
10803
10840
  const transformed = transformExecuteResponse(response, toolSlug);
10804
10841
  return ToolRouterSessionExecuteResponseSchema.parse(transformed);
10805
10842
  }
@@ -10830,9 +10867,10 @@ var ToolRouterSession = class {
10830
10867
  arguments: arguments_ ?? {},
10831
10868
  ...inputResponseParams(options)
10832
10869
  };
10833
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10834
- if (experimental) executeMetaParams.experimental = experimental;
10835
- 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
+ });
10836
10874
  const transformed = transformExecuteResponse(response, slug);
10837
10875
  return ToolRouterSessionExecuteResponseSchema.parse(transformed);
10838
10876
  }
@@ -10980,8 +11018,7 @@ var ToolRouterSession = class {
10980
11018
  sessionId: this.sessionId,
10981
11019
  arguments: input
10982
11020
  };
10983
- const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
10984
- if (experimental) return ToolsModel.executeSessionTool(toolSlug, body, modifiers, tool, { experimental });
11021
+ if (this.inlineCustomToolsPayload) return ToolsModel.executeSessionTool(toolSlug, body, modifiers, tool, { experimental: this.inlineCustomToolsPayload });
10985
11022
  return ToolsModel.executeSessionTool(toolSlug, body, modifiers, tool);
10986
11023
  }
10987
11024
  /** Parse an individual tool item from COMPOSIO_MULTI_EXECUTE_TOOL's tools array */
@@ -11095,8 +11132,7 @@ var ToolRouterSession = class {
11095
11132
  }
11096
11133
  };
11097
11134
 
11098
- //#endregion
11099
- //#region src/models/ToolRouter.ts
11135
+ // src/models/ToolRouter.ts
11100
11136
  function getSessionMetadata(session) {
11101
11137
  return {
11102
11138
  config: session.config,
@@ -11249,8 +11285,7 @@ var ToolRouter = class {
11249
11285
  }
11250
11286
  };
11251
11287
 
11252
- //#endregion
11253
- //#region src/models/Sessions.ts
11288
+ // src/models/Sessions.ts
11254
11289
  /**
11255
11290
  * First-class API for creating and reusing Composio sessions.
11256
11291
  *
@@ -11264,8 +11299,7 @@ var Sessions = class extends ToolRouter {
11264
11299
  }
11265
11300
  };
11266
11301
 
11267
- //#endregion
11268
- //#region src/utils/toolkitDeprecation.ts
11302
+ // src/utils/toolkitDeprecation.ts
11269
11303
  /**
11270
11304
  * Toolkit version deprecation warnings.
11271
11305
  *
@@ -11489,8 +11523,7 @@ function createToolkitDeprecationFetch(baseFetch) {
11489
11523
  };
11490
11524
  }
11491
11525
 
11492
- //#endregion
11493
- //#region src/composio.ts
11526
+ // src/composio.ts
11494
11527
  /**
11495
11528
  * Level for the API client given the SDK level. The client logs each request's
11496
11529
  * lifecycle at `info`, which is debug-grade for SDK users, so the client stays
@@ -11556,6 +11589,16 @@ var Composio = class Composio {
11556
11589
  /** Public transfer keys of the organization's customer-managed keyring */
11557
11590
  keyring;
11558
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
+ /**
11559
11602
  * Experimental SDK methods whose shape may change in future releases.
11560
11603
  * Prefer domain-specific mounts (for example
11561
11604
  * `composio.connectedAccounts.updateAcl(...)`) when available; this
@@ -11747,6 +11790,7 @@ var Composio = class Composio {
11747
11790
  this.logs = new Logs(this.client);
11748
11791
  this.keyring = new Keyring(this.client);
11749
11792
  this.experimental = new Experimental(this.client);
11793
+ this.customToolkits = this.experimental.customToolkits;
11750
11794
  this.sessions = new Sessions(this.client, this.config);
11751
11795
  this.toolRouter = this.sessions;
11752
11796
  this.sessionConfigs = new SessionConfigs(this.client);
@@ -11872,8 +11916,7 @@ var Composio = class Composio {
11872
11916
  }
11873
11917
  };
11874
11918
 
11875
- //#endregion
11876
- //#region src/provider/ComposioProvider.ts
11919
+ // src/provider/ComposioProvider.ts
11877
11920
  var ComposioProvider = class extends BaseNonAgenticProvider {
11878
11921
  name = "ComposioProvider";
11879
11922
  constructor() {
@@ -11887,8 +11930,7 @@ var ComposioProvider = class extends BaseNonAgenticProvider {
11887
11930
  }
11888
11931
  };
11889
11932
 
11890
- //#endregion
11891
- //#region src/utils/schemaPropertyKeys.ts
11933
+ // src/utils/schemaPropertyKeys.ts
11892
11934
  /**
11893
11935
  * JSON-schema property-key sanitization.
11894
11936
  *
@@ -12164,8 +12206,7 @@ function restoreOriginalKeys(value, mapping, depth = 0) {
12164
12206
  return value;
12165
12207
  }
12166
12208
 
12167
- //#endregion
12168
- //#region src/models/AuthScheme.ts
12209
+ // src/models/AuthScheme.ts
12169
12210
  var AuthScheme = class {
12170
12211
  /**
12171
12212
  * Creates a ConnectionData object for OAuth2 authentication.
@@ -12315,8 +12356,7 @@ var AuthScheme = class {
12315
12356
  }
12316
12357
  };
12317
12358
 
12318
- //#endregion
12319
- //#region src/types/webhookEvents.types.ts
12359
+ // src/types/webhookEvents.types.ts
12320
12360
  const WebhookEventTypes = {
12321
12361
  CONNECTION_EXPIRED: "composio.connected_account.expired",
12322
12362
  TRIGGER_MESSAGE: "composio.trigger.message"
@@ -12473,8 +12513,7 @@ const ConnectionExpiredEventSchema = z$1.object({
12473
12513
  */
12474
12514
  const WebhookEventSchema = z$1.discriminatedUnion("type", [ConnectionExpiredEventSchema]);
12475
12515
 
12476
- //#endregion
12477
- //#region src/types/mcp.types.ts
12516
+ // src/types/mcp.types.ts
12478
12517
  /**
12479
12518
  * @deprecated
12480
12519
  */
@@ -12668,5 +12707,4 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
12668
12707
  tools: z$1.array(z$1.string()).optional()
12669
12708
  });
12670
12709
 
12671
- //#endregion
12672
- 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, 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 };
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 };