@composio/core 0.26.0 → 0.28.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 (49) hide show
  1. package/dist/{CustomTool-DfP4ldQl.d.mts → CustomTool-DyypijT6.d.mts} +2 -2
  2. package/dist/{Telemetry-41JkqpZ7.mjs → Telemetry-D2PJwXKx.mjs} +1 -1
  3. package/dist/{composio-BMDH-1Qj.d.mts → composio-CwHMpKXb.d.mts} +748 -70
  4. package/dist/{customTool.types-BoOELgJF.d.mts → customTool.types-DoItUHkO.d.mts} +780 -23
  5. package/dist/docs/reference/sdk-reference/typescript/composio.mdx +3 -3
  6. package/dist/docs/reference/sdk-reference/typescript/session.mdx +5 -4
  7. package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +5 -1
  8. package/dist/experimental/index.d.mts +2 -2
  9. package/dist/{fileUtils.node-DNLhLg0W.mjs → fileUtils.node-ILI1IjnZ.mjs} +4 -3
  10. package/dist/index.d.mts +10 -10
  11. package/dist/index.mjs +420 -158
  12. package/dist/models/Files.node.mjs +2 -2
  13. package/dist/sensitiveFileUploadPaths-BaEORC7-.mjs +588 -0
  14. package/dist/{types-DHNV_T_z.d.mts → types-DWZWePfZ.d.mts} +2 -2
  15. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
  16. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
  17. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  18. package/dist/utils/modifiers/FileToolModifier.node.mjs +1 -1
  19. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  20. package/package.json +7 -6
  21. package/src/lib/toolRouterParams.ts +33 -15
  22. package/src/lib/toolRouterSessionDelete.ts +1 -10
  23. package/src/models/ConnectedAccounts.ts +1 -1
  24. package/src/models/CustomTool.ts +1 -1
  25. package/src/models/CustomToolkits.ts +114 -8
  26. package/src/models/Experimental.ts +1 -1
  27. package/src/models/MCP.ts +1 -2
  28. package/src/models/SessionConfigs.ts +11 -3
  29. package/src/models/SessionContext.ts +6 -21
  30. package/src/models/ToolRouter.ts +5 -1
  31. package/src/models/ToolRouterSession.ts +21 -35
  32. package/src/models/Tools.ts +3 -3
  33. package/src/models/Triggers.ts +12 -5
  34. package/src/models/inlineCustomToolsPayload.ts +3 -3
  35. package/src/models/proxyParamsTransform.ts +1 -1
  36. package/src/types/customTool.types.ts +13 -5
  37. package/src/types/customToolkits.types.ts +89 -9
  38. package/src/types/sessionConfigs.types.ts +21 -7
  39. package/src/types/toolRouter.types.ts +169 -17
  40. package/src/types/triggers.types.ts +14 -0
  41. package/src/utils/fileUtils.node.ts +5 -2
  42. package/src/utils/mime.ts +347 -1
  43. package/src/utils/transformers/connectedAccounts.ts +2 -7
  44. package/src/utils/transformers/customToolkits.ts +78 -9
  45. package/src/utils/transformers/sessionConfigs.ts +3 -3
  46. package/src/utils/transformers/toolRouterResponseTransform.ts +71 -5
  47. package/src/utils/transformers/toolkits.ts +7 -13
  48. package/src/utils/transformers/triggers.ts +28 -18
  49. package/dist/sensitiveFileUploadPaths-BlLp-Yo2.mjs +0 -189
package/dist/index.mjs CHANGED
@@ -3,8 +3,8 @@ import { $ as ComposioAuthConfigNotFoundError, A as ComposioInvalidModifierError
3
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
4
  import { n as dropEmptyFileUploads, o as isPlainObject, s as schemaHasFileUploadable } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
5
5
  import { a as jsonSchemaToZodSchema, c as toStrictJsonSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as omitNullToolArguments, r as dereferenceJsonSchema, s as removeNonRequiredProperties, t as withCancellation } from "./cancellation-ZoRh6EJQ.mjs";
6
- import { t as telemetry } from "./Telemetry-41JkqpZ7.mjs";
7
- import { a as readResponseBodyWithLimit, i as MAX_URL_UPLOAD_SIZE_BYTES, l as getRandomShortId, n as assertSafeFileUploadPath, o as arrayBufferToBase64, r as isBlockedSensitiveFileUploadPath, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-BlLp-Yo2.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
8
  import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-BYHB7sPs.mjs";
9
9
  import ComposioClient, { APIError, Auth, BadRequestError, ConflictError, createFetchTransport } from "@composio/client";
10
10
  import { FileToolModifier } from "#file_tool_modifier";
@@ -1212,8 +1212,16 @@ function withoutRetries(requestOptions) {
1212
1212
 
1213
1213
  //#endregion
1214
1214
  //#region src/utils/transformers/toolRouterResponseTransform.ts
1215
- /** The `result_type` values of a call that ran. `input_required` is raised before this is read. */
1215
+ /**
1216
+ * The `result_type` values of a call that ran. `input_required` and `blocked`
1217
+ * are handled before this is read.
1218
+ */
1216
1219
  const ExecutedResponseSchema = z.object({ result_type: z.enum(["completed", "failed"]) });
1220
+ /** The `reason` of a call a session hook blocked, in camelCase. */
1221
+ const toBlockReason = (reason) => ({
1222
+ type: reason.type,
1223
+ hookId: reason.hook_id
1224
+ });
1217
1225
  /**
1218
1226
  * Whether a session tool execution succeeded. `resultType` decides: a `failed`
1219
1227
  * execution is not successful even when its `error` is `null` or empty.
@@ -1318,6 +1326,15 @@ function transformSearchResponse(raw) {
1318
1326
  */
1319
1327
  function transformExecuteResponse(raw, toolSlug) {
1320
1328
  assertNotInputRequired(raw, `Tool ${toolSlug}`);
1329
+ if (raw.result_type === "blocked") return {
1330
+ data: {},
1331
+ error: raw.message,
1332
+ logId: raw.log_id ?? "",
1333
+ resultType: "blocked",
1334
+ blockReason: toBlockReason(raw.reason),
1335
+ ...raw.hook_results !== void 0 && { hookResults: raw.hook_results },
1336
+ ...raw.instant_charge !== void 0 && { instantCharge: raw.instant_charge }
1337
+ };
1321
1338
  const executed = ExecutedResponseSchema.safeParse(raw);
1322
1339
  if (!executed.success) throw new ValidationError(`Tool ${toolSlug} returned an execute response without a known result_type`, { cause: executed.error });
1323
1340
  return {
@@ -1325,7 +1342,35 @@ function transformExecuteResponse(raw, toolSlug) {
1325
1342
  error: raw.error,
1326
1343
  logId: raw.log_id,
1327
1344
  resultType: executed.data.result_type,
1328
- ...raw.instant_charge !== void 0 && { instantCharge: raw.instant_charge }
1345
+ ...raw.instant_charge !== void 0 && { instantCharge: raw.instant_charge },
1346
+ ...raw.hook_results !== void 0 && { hookResults: raw.hook_results }
1347
+ };
1348
+ }
1349
+ /**
1350
+ * Projects a session proxy execute response onto the SDK's shape: a request a
1351
+ * session hook blocked comes back as `resultType: 'blocked'` with no HTTP
1352
+ * response.
1353
+ */
1354
+ function transformProxyExecuteResponse(raw, subject) {
1355
+ assertNotInputRequired(raw, subject);
1356
+ if (raw.result_type === "blocked") return {
1357
+ resultType: "blocked",
1358
+ blockReason: toBlockReason(raw.reason),
1359
+ message: raw.message,
1360
+ ...raw.hook_results !== void 0 && { hookResults: raw.hook_results }
1361
+ };
1362
+ return {
1363
+ resultType: "completed",
1364
+ status: raw.status,
1365
+ data: raw.data,
1366
+ headers: raw.headers,
1367
+ ...raw.binary_data && { binaryData: {
1368
+ contentType: raw.binary_data.content_type,
1369
+ size: raw.binary_data.size,
1370
+ url: raw.binary_data.url,
1371
+ expiresAt: raw.binary_data.expires_at
1372
+ } },
1373
+ ...raw.hook_results !== void 0 && { hookResults: raw.hook_results }
1329
1374
  };
1330
1375
  }
1331
1376
 
@@ -3415,6 +3460,10 @@ var Usage = class {
3415
3460
 
3416
3461
  //#endregion
3417
3462
  //#region src/types/customToolkits.types.ts
3463
+ const CustomToolkitApiKeyFieldSchema = z$1.object({
3464
+ displayName: z$1.string().min(1).max(100).optional(),
3465
+ description: z$1.string().min(1).max(500).optional()
3466
+ });
3418
3467
  /**
3419
3468
  * How end users authenticate to a custom toolkit.
3420
3469
  * **Experimental — custom toolkits are in pilot; shape may change.**
@@ -3430,10 +3479,12 @@ const CustomToolkitAuthSchemeSchema = z$1.discriminatedUnion("mode", [
3430
3479
  */
3431
3480
  headers: z$1.record(z$1.string(), z$1.string()),
3432
3481
  /** End-user copy for the API key input on the connect page. */
3433
- apiKeyField: z$1.object({
3434
- displayName: z$1.string().min(1).max(100).optional(),
3482
+ apiKeyField: CustomToolkitApiKeyFieldSchema.optional(),
3483
+ /** Additional connect-page input used by `{{generic_id}}` in headers. */
3484
+ additionalFields: z$1.object({ genericId: z$1.object({
3485
+ displayName: z$1.string().min(1).max(100),
3435
3486
  description: z$1.string().min(1).max(500).optional()
3436
- }).optional()
3487
+ }) }).optional()
3437
3488
  }),
3438
3489
  z$1.object({
3439
3490
  mode: z$1.literal("DCR_OAUTH"),
@@ -3444,9 +3495,69 @@ const CustomToolkitAuthSchemeSchema = z$1.discriminatedUnion("mode", [
3444
3495
  discoveryUrl: z$1.string().url()
3445
3496
  })
3446
3497
  ]);
3498
+ const CustomToolkitLogoFileSchema = z$1.object({
3499
+ content: z$1.string().min(1),
3500
+ mimeType: z$1.enum(["image/png", "image/jpeg"])
3501
+ });
3502
+ /**
3503
+ * Params for `composio.experimental.customToolkits.create()`.
3504
+ * **Experimental — custom toolkits are in pilot; shape may change.**
3505
+ */
3506
+ const CustomToolkitCreateParamsSchema = z$1.object({
3507
+ /** Human-readable toolkit name. */
3508
+ name: z$1.string().min(1).max(200),
3509
+ /** The MCP server URL. Must use https. */
3510
+ appUrl: z$1.string().url(),
3511
+ /** Square PNG or JPEG logo (256-1024px, max 3MB), base64-encoded. Defaults to the MCP logo. */
3512
+ logoFile: CustomToolkitLogoFileSchema.optional(),
3513
+ /** At least one scheme. Cannot be changed after create. */
3514
+ authSchemes: z$1.array(CustomToolkitAuthSchemeSchema).min(1),
3515
+ /**
3516
+ * `'all'` to share the toolkit with every user in the project, or a user ID
3517
+ * to make it private to that user. Cannot be changed after create.
3518
+ */
3519
+ userId: z$1.string().min(1),
3520
+ /** Where to send the user after they connect. Used only for `connectLink`. */
3521
+ callbackUrl: z$1.string().url().optional()
3522
+ });
3523
+ const CustomToolkitCreateResponseSchema = z$1.object({
3524
+ /** Slug of the created toolkit. Store it to update, sync or delete the toolkit later. */
3525
+ slug: z$1.string(),
3526
+ /**
3527
+ * Hosted connect page for a private toolkit's user. `null` for shared or
3528
+ * no-auth toolkits, or if the link could not be created.
3529
+ */
3530
+ connectLink: z$1.object({
3531
+ redirectUrl: z$1.string(),
3532
+ expiresAt: z$1.string(),
3533
+ connectedAccountId: z$1.string()
3534
+ }).nullable()
3535
+ });
3536
+ /**
3537
+ * Params for `composio.experimental.customToolkits.update()`.
3538
+ * **Experimental — custom toolkits are in pilot; shape may change.**
3539
+ */
3540
+ const CustomToolkitUpdateParamsSchema = z$1.object({
3541
+ name: z$1.string().min(1).max(200).optional(),
3542
+ logoFile: CustomToolkitLogoFileSchema.optional(),
3543
+ /** End-user copy for the API key input on the connect page. API_KEY toolkits only. */
3544
+ apiKeyField: CustomToolkitApiKeyFieldSchema.optional(),
3545
+ /**
3546
+ * The user the toolkit is private to. Required to update a private toolkit
3547
+ * when the project has 2FA enabled.
3548
+ */
3549
+ userId: z$1.string().min(1).optional()
3550
+ }).refine((params) => [
3551
+ params.name,
3552
+ params.logoFile,
3553
+ params.apiKeyField
3554
+ ].some((value) => value !== void 0), { message: "Provide at least one of name, logoFile, apiKeyField" });
3555
+ const CustomToolkitUpdateResponseSchema = z$1.object({ success: z$1.literal(true) });
3447
3556
  /**
3448
3557
  * Params for `composio.experimental.customToolkits.upsert()`.
3449
3558
  * **Experimental — custom toolkits are in pilot; shape may change.**
3559
+ *
3560
+ * @deprecated Use `CustomToolkitCreateParams` with `create()`.
3450
3561
  */
3451
3562
  const CustomToolkitUpsertParamsSchema = z$1.object({
3452
3563
  /**
@@ -3460,10 +3571,7 @@ const CustomToolkitUpsertParamsSchema = z$1.object({
3460
3571
  /** The app URL. For an MCP app, the MCP server URL. */
3461
3572
  appUrl: z$1.string().url(),
3462
3573
  /** Square PNG or JPEG logo (256-1024px, max 3MB), base64-encoded. Defaults to the Composio logo. */
3463
- logoFile: z$1.object({
3464
- content: z$1.string().min(1),
3465
- mimeType: z$1.enum(["image/png", "image/jpeg"])
3466
- }).optional(),
3574
+ logoFile: CustomToolkitLogoFileSchema.optional(),
3467
3575
  /** At least one scheme. The schemes cannot change once the toolkit exists. */
3468
3576
  authSchemes: z$1.array(CustomToolkitAuthSchemeSchema).min(1)
3469
3577
  })
@@ -3497,16 +3605,25 @@ const CustomToolkitDeleteResponseSchema = z$1.object({
3497
3605
 
3498
3606
  //#endregion
3499
3607
  //#region src/utils/transformers/customToolkits.ts
3608
+ const transformCustomToolkitLogoFile = (logoFile) => logoFile && {
3609
+ content: logoFile.content,
3610
+ mime_type: logoFile.mimeType
3611
+ };
3612
+ const transformCustomToolkitApiKeyField = (apiKeyField) => apiKeyField && {
3613
+ display_name: apiKeyField.displayName,
3614
+ description: apiKeyField.description
3615
+ };
3500
3616
  const transformCustomToolkitAuthScheme = (scheme) => {
3501
3617
  switch (scheme.mode) {
3502
3618
  case "NO_AUTH": return { mode: "NO_AUTH" };
3503
3619
  case "API_KEY": return {
3504
3620
  mode: "API_KEY",
3505
3621
  headers: scheme.headers,
3506
- api_key_field: scheme.apiKeyField && {
3507
- display_name: scheme.apiKeyField.displayName,
3508
- description: scheme.apiKeyField.description
3509
- }
3622
+ api_key_field: transformCustomToolkitApiKeyField(scheme.apiKeyField),
3623
+ ...scheme.additionalFields && { additional_fields: { generic_id: {
3624
+ display_name: scheme.additionalFields.genericId.displayName,
3625
+ description: scheme.additionalFields.genericId.description
3626
+ } } }
3510
3627
  };
3511
3628
  case "DCR_OAUTH": return {
3512
3629
  mode: "DCR_OAUTH",
@@ -3514,15 +3631,39 @@ const transformCustomToolkitAuthScheme = (scheme) => {
3514
3631
  };
3515
3632
  }
3516
3633
  };
3634
+ const transformCustomToolkitCreateParams = (params) => ({
3635
+ name: params.name,
3636
+ app_url: params.appUrl,
3637
+ logo_file: transformCustomToolkitLogoFile(params.logoFile),
3638
+ auth_schemes: params.authSchemes.map(transformCustomToolkitAuthScheme),
3639
+ user_id: params.userId,
3640
+ callback_url: params.callbackUrl
3641
+ });
3642
+ const transformCustomToolkitCreateResponse = (response) => {
3643
+ return transform(response).with(CustomToolkitCreateResponseSchema).using((response) => ({
3644
+ slug: response.slug,
3645
+ connectLink: response.connect_link && {
3646
+ redirectUrl: response.connect_link.redirect_url,
3647
+ expiresAt: response.connect_link.expires_at,
3648
+ connectedAccountId: response.connect_link.connected_account_id
3649
+ }
3650
+ }));
3651
+ };
3652
+ const transformCustomToolkitUpdateParams = (params) => ({
3653
+ name: params.name,
3654
+ logo_file: transformCustomToolkitLogoFile(params.logoFile),
3655
+ api_key_field: transformCustomToolkitApiKeyField(params.apiKeyField),
3656
+ user_id: params.userId
3657
+ });
3658
+ const transformCustomToolkitUpdateResponse = (response) => {
3659
+ return transform(response).with(CustomToolkitUpdateResponseSchema).using((response) => ({ success: response.success }));
3660
+ };
3517
3661
  const transformCustomToolkitUpsertParams = (params) => ({
3518
3662
  slug: params.slug,
3519
3663
  toolkit_config: {
3520
3664
  name: params.toolkitConfig.name,
3521
3665
  app_url: params.toolkitConfig.appUrl,
3522
- logo_file: params.toolkitConfig.logoFile && {
3523
- content: params.toolkitConfig.logoFile.content,
3524
- mime_type: params.toolkitConfig.logoFile.mimeType
3525
- },
3666
+ logo_file: transformCustomToolkitLogoFile(params.toolkitConfig.logoFile),
3526
3667
  auth_schemes: params.toolkitConfig.authSchemes.map(transformCustomToolkitAuthScheme)
3527
3668
  }
3528
3669
  });
@@ -3552,6 +3693,8 @@ const transformCustomToolkitDeleteResponse = (response) => {
3552
3693
 
3553
3694
  //#endregion
3554
3695
  //#region src/models/CustomToolkits.ts
3696
+ const UPSERT_DEPRECATION = "[Deprecation] composio.experimental.customToolkits.upsert() is deprecated. Use create() for a new toolkit and update(slug, ...) to change its name, logo or API key field.";
3697
+ let _upsertDeprecationWarned = false;
3555
3698
  /**
3556
3699
  * `composio.experimental.customToolkits` — toolkits your project registers
3557
3700
  * from its own app or MCP server, with their own auth configs and connected
@@ -3563,15 +3706,13 @@ const transformCustomToolkitDeleteResponse = (response) => {
3563
3706
  *
3564
3707
  * @example
3565
3708
  * ```typescript
3566
- * const { slug } = await composio.experimental.customToolkits.upsert({
3567
- * slug: 'MY_TOOLKIT',
3568
- * toolkitConfig: {
3569
- * name: 'My Toolkit',
3570
- * appUrl: 'https://mcp.example.com/mcp',
3571
- * authSchemes: [{ mode: 'DCR_OAUTH', discoveryUrl: 'https://mcp.example.com/.well-known/oauth-authorization-server' }],
3572
- * },
3709
+ * const { slug } = await composio.experimental.customToolkits.create({
3710
+ * name: 'My Toolkit',
3711
+ * appUrl: 'https://mcp.example.com/mcp',
3712
+ * authSchemes: [{ mode: 'DCR_OAUTH', discoveryUrl: 'https://mcp.example.com/.well-known/oauth-authorization-server' }],
3713
+ * userId: 'all',
3573
3714
  * });
3574
- * await composio.experimental.customToolkits.sync(slug);
3715
+ * await composio.experimental.customToolkits.update(slug, { name: 'My Renamed Toolkit' });
3575
3716
  * ```
3576
3717
  */
3577
3718
  var CustomToolkits = class {
@@ -3581,6 +3722,67 @@ var CustomToolkits = class {
3581
3722
  telemetry.instrument(this, "CustomToolkits");
3582
3723
  }
3583
3724
  /**
3725
+ * Creates a custom MCP toolkit and returns its generated slug.
3726
+ * **Experimental — custom toolkits are in pilot; shape may change.**
3727
+ *
3728
+ * Set `userId` to `'all'` to share the toolkit with every user in the
3729
+ * project, or to a user ID to make it private to that user. `appUrl`,
3730
+ * `authSchemes` and `userId` cannot change later: delete and re-create the
3731
+ * toolkit instead. For a private toolkit, `connectLink` is where to send
3732
+ * that user to connect.
3733
+ *
3734
+ * @param {CustomToolkitCreateParams} params - The toolkit to create
3735
+ * @returns {Promise<CustomToolkitCreateResponse>} The toolkit's slug and, for a private toolkit, a connect link
3736
+ * @throws {ValidationError} If the params fail validation
3737
+ *
3738
+ * @example
3739
+ * ```typescript
3740
+ * const { slug, connectLink } = await composio.experimental.customToolkits.create({
3741
+ * name: 'Internal API',
3742
+ * appUrl: 'https://mcp.internal.example.com/mcp',
3743
+ * authSchemes: [
3744
+ * { mode: 'API_KEY', headers: { Authorization: 'Bearer {{generic_api_key}}' } },
3745
+ * ],
3746
+ * userId: 'user_123',
3747
+ * });
3748
+ * ```
3749
+ */
3750
+ async create(params, requestOptions) {
3751
+ const parsedParams = CustomToolkitCreateParamsSchema.safeParse(params);
3752
+ if (!parsedParams.success) throw new ValidationError("Failed to parse custom toolkit create params", { cause: parsedParams.error });
3753
+ const body = transformCustomToolkitCreateParams(parsedParams.data);
3754
+ const result = await withCancellation(() => this.client.custom.createToolkit(body, requestOptions), requestOptions?.signal);
3755
+ return transformCustomToolkitCreateResponse(result);
3756
+ }
3757
+ /**
3758
+ * Updates a custom toolkit's name, logo or API key field copy. Omitted
3759
+ * fields keep their current value.
3760
+ * **Experimental — custom toolkits are in pilot; shape may change.**
3761
+ *
3762
+ * On a project with 2FA enabled, updating a private toolkit requires the
3763
+ * `userId` it is private to.
3764
+ *
3765
+ * @param {string} slug - The custom toolkit slug returned by `create()`
3766
+ * @param {CustomToolkitUpdateParams} params - At least one of `name`, `logoFile`, `apiKeyField`
3767
+ * @returns {Promise<CustomToolkitUpdateResponse>} `{ success: true }`
3768
+ * @throws {ValidationError} If the params fail validation
3769
+ *
3770
+ * @example
3771
+ * ```typescript
3772
+ * await composio.experimental.customToolkits.update('CUSTOM_INTERNAL_API_K7F2Q', {
3773
+ * name: 'Internal API (prod)',
3774
+ * userId: 'user_123',
3775
+ * });
3776
+ * ```
3777
+ */
3778
+ async update(slug, params, requestOptions) {
3779
+ const parsedParams = CustomToolkitUpdateParamsSchema.safeParse(params);
3780
+ if (!parsedParams.success) throw new ValidationError("Failed to parse custom toolkit update params", { cause: parsedParams.error });
3781
+ const body = transformCustomToolkitUpdateParams(parsedParams.data);
3782
+ const result = await withCancellation(() => this.client.custom.updateToolkits(slug, body, requestOptions), requestOptions?.signal);
3783
+ return transformCustomToolkitUpdateResponse(result);
3784
+ }
3785
+ /**
3584
3786
  * Creates a custom toolkit, or updates its display metadata (name, API key
3585
3787
  * field copy) when the project already owns a toolkit with this slug.
3586
3788
  * **Experimental — custom toolkits are in pilot; shape may change.**
@@ -3606,8 +3808,16 @@ var CustomToolkits = class {
3606
3808
  * },
3607
3809
  * });
3608
3810
  * ```
3811
+ *
3812
+ * @deprecated Use `create()` for a new toolkit and `update(slug, ...)` to change
3813
+ * its name, logo or API key field. `create()` generates the slug, so store the
3814
+ * slug it returns.
3609
3815
  */
3610
3816
  async upsert(params, requestOptions) {
3817
+ if (!_upsertDeprecationWarned) {
3818
+ _upsertDeprecationWarned = true;
3819
+ logger.warn(UPSERT_DEPRECATION);
3820
+ }
3611
3821
  const parsedParams = CustomToolkitUpsertParamsSchema.safeParse(params);
3612
3822
  if (!parsedParams.success) throw new ValidationError("Failed to parse custom toolkit upsert params", { cause: parsedParams.error });
3613
3823
  const body = transformCustomToolkitUpsertParams(parsedParams.data);
@@ -3739,7 +3949,7 @@ var Experimental = class {
3739
3949
  */
3740
3950
  usage;
3741
3951
  /**
3742
- * Register and manage project-owned custom toolkits (`upsert()` / `sync()` / `delete()`).
3952
+ * Register and manage project-owned custom toolkits (`create()` / `update()` / `sync()` / `delete()`).
3743
3953
  * **Experimental — custom toolkits are in pilot; shape may change.**
3744
3954
  *
3745
3955
  * @example
@@ -4406,7 +4616,8 @@ const transformToolkitRetrieveResponse = (response) => {
4406
4616
  slug: category.slug,
4407
4617
  name: category.name
4408
4618
  })),
4409
- availableVersions: response.meta.available_versions
4619
+ availableVersions: response.meta.available_versions,
4620
+ ...response.meta.app_url != null && { appUrl: response.meta.app_url }
4410
4621
  },
4411
4622
  isLocalToolkit: response.is_local_toolkit,
4412
4623
  composioManagedAuthSchemes: response.composio_managed_auth_schemes,
@@ -4814,6 +5025,7 @@ const TriggerInstanceListActiveParamsSchema = z$1.object({
4814
5025
  triggerIds: z$1.array(z$1.string()).nullable().optional(),
4815
5026
  triggerNames: z$1.array(z$1.string()).nullable().optional()
4816
5027
  });
5028
+ const TriggerInstanceTypeSchema = z$1.enum(["webhook", "poll"]);
4817
5029
  const TriggerInstanceListActiveResponseItemSchema = z$1.object({
4818
5030
  id: z$1.string(),
4819
5031
  connectedAccountId: z$1.string(),
@@ -4823,7 +5035,10 @@ const TriggerInstanceListActiveResponseItemSchema = z$1.object({
4823
5035
  triggerName: z$1.string(),
4824
5036
  updatedAt: z$1.string(),
4825
5037
  triggerData: z$1.string().optional(),
4826
- uuid: z$1.string().optional()
5038
+ uuid: z$1.string().optional(),
5039
+ type: TriggerInstanceTypeSchema,
5040
+ fallbackReason: z$1.string().nullable(),
5041
+ pollingInterval: z$1.number().nullable()
4827
5042
  });
4828
5043
  const TriggerInstanceListActiveResponseSchema = z$1.object({
4829
5044
  items: z$1.array(TriggerInstanceListActiveResponseItemSchema),
@@ -4832,9 +5047,16 @@ const TriggerInstanceListActiveResponseSchema = z$1.object({
4832
5047
  });
4833
5048
  const TriggerInstanceUpsertParamsSchema = z$1.object({
4834
5049
  connectedAccountId: z$1.string().optional(),
4835
- triggerConfig: z$1.record(z$1.unknown()).optional()
5050
+ triggerConfig: z$1.record(z$1.unknown()).optional(),
5051
+ type: TriggerInstanceTypeSchema.optional(),
5052
+ pollingInterval: z$1.number().int().positive().optional()
5053
+ });
5054
+ const TriggerInstanceUpsertResponseSchema = z$1.object({
5055
+ triggerId: z$1.string(),
5056
+ type: TriggerInstanceTypeSchema,
5057
+ fallbackReason: z$1.string().nullable(),
5058
+ pollingInterval: z$1.number().nullable()
4836
5059
  });
4837
- const TriggerInstanceUpsertResponseSchema = z$1.object({ triggerId: z$1.string() });
4838
5060
  const TriggerInstanceManageUpdateParamsSchema = z$1.object({ status: z$1.enum(["enable", "disable"]) });
4839
5061
  const TriggerInstanceManageUpdateResponseSchema = z$1.object({ status: z$1.enum(["success"]) });
4840
5062
  const TriggerInstanceManageDeleteResponseSchema = z$1.object({ triggerId: z$1.string() });
@@ -4880,7 +5102,10 @@ const TriggerTypeSchema = z$1.object({
4880
5102
  }),
4881
5103
  payload: z$1.record(z$1.unknown()),
4882
5104
  config: z$1.record(z$1.unknown()),
4883
- version: z$1.string().optional()
5105
+ version: z$1.string().optional(),
5106
+ type: TriggerInstanceTypeSchema,
5107
+ types: z$1.array(TriggerInstanceTypeSchema),
5108
+ requiresWebhookEndpointSetup: z$1.boolean().optional()
4884
5109
  });
4885
5110
  const TriggersTypeListResponseSchema = z$1.object({
4886
5111
  items: z$1.array(TriggerTypeSchema),
@@ -6193,8 +6418,8 @@ function transformIncomingTriggerPayload(response) {
6193
6418
  }
6194
6419
  }));
6195
6420
  }
6196
- function transformTriggerTypeRetrieveResponse(response) {
6197
- return transform(response).with(TriggerTypeSchema).using((response) => ({
6421
+ function toTriggerType(response) {
6422
+ return {
6198
6423
  slug: response.slug,
6199
6424
  name: response.name,
6200
6425
  description: response.description,
@@ -6206,12 +6431,18 @@ function transformTriggerTypeRetrieveResponse(response) {
6206
6431
  },
6207
6432
  version: response.version,
6208
6433
  payload: response.payload,
6209
- config: response.config
6210
- }));
6434
+ config: response.config,
6435
+ type: response.type,
6436
+ types: response.types,
6437
+ requiresWebhookEndpointSetup: response.requires_webhook_endpoint_setup
6438
+ };
6439
+ }
6440
+ function transformTriggerTypeRetrieveResponse(response) {
6441
+ return transform(response).with(TriggerTypeSchema).using(toTriggerType);
6211
6442
  }
6212
6443
  function transformTriggerTypeListResponse(response) {
6213
6444
  return transform(response).with(TriggersTypeListResponseSchema).using((response) => ({
6214
- items: response.items,
6445
+ items: response.items.map(toTriggerType),
6215
6446
  nextCursor: response.next_cursor ?? null,
6216
6447
  totalPages: response.total_pages
6217
6448
  }));
@@ -6232,7 +6463,10 @@ function transformTriggerInstanceListActiveItem(response) {
6232
6463
  triggerName: response.trigger_name,
6233
6464
  updatedAt: response.updated_at,
6234
6465
  triggerData: response.trigger_data,
6235
- uuid: response.uuid
6466
+ uuid: response.uuid,
6467
+ type: response.type,
6468
+ fallbackReason: response.fallback_reason,
6469
+ pollingInterval: response.polling_interval
6236
6470
  }));
6237
6471
  }
6238
6472
  function transformTriggerInstanceListActiveResponse(response) {
@@ -6395,10 +6629,14 @@ var Triggers = class {
6395
6629
  * Create a new trigger instance for a user
6396
6630
  * If the connected account id is not provided, the first connected account for the user and toolkit will be used
6397
6631
  *
6632
+ * For a trigger that supports both webhook and polling, `body.type` picks one; omit it to let Composio choose.
6633
+ * `body.pollingInterval` sets the minutes between polls and wins over `triggerConfig.interval`.
6634
+ *
6398
6635
  * @param {string} userId - The user id of the trigger instance
6399
6636
  * @param {string} slug - The slug of the trigger instance
6400
6637
  * @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
6401
- * @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
6638
+ * @returns {Promise<TriggerInstanceUpsertResponse>} The trigger instance, with the type it uses, why it polls
6639
+ * when it fell back from a webhook, and its polling interval
6402
6640
  */
6403
6641
  async create(userId, slug, body, requestOptions) {
6404
6642
  if (!userId?.trim()) throw new ValidationError(`A non-empty userId is required to create a trigger`);
@@ -6420,10 +6658,18 @@ var Triggers = class {
6420
6658
  const upsertParams = {
6421
6659
  connected_account_id: parsedBody.data.connectedAccountId,
6422
6660
  trigger_config: parsedBody.data.triggerConfig,
6661
+ type: parsedBody.data.type,
6662
+ polling_interval: parsedBody.data.pollingInterval,
6423
6663
  toolkit_versions: this.toolkitVersions,
6424
6664
  user_id: userId
6425
6665
  };
6426
- return { triggerId: (await withCancellation(() => this.client.triggerInstances.upsert(slug, upsertParams, requestOptions), requestOptions?.signal)).trigger_id };
6666
+ const result = await withCancellation(() => this.client.triggerInstances.upsert(slug, upsertParams, requestOptions), requestOptions?.signal);
6667
+ return {
6668
+ triggerId: result.trigger_id,
6669
+ type: result.type,
6670
+ fallbackReason: result.fallback_reason,
6671
+ pollingInterval: result.polling_interval
6672
+ };
6427
6673
  }
6428
6674
  /**
6429
6675
  * Update an existing trigger instance
@@ -7918,6 +8164,38 @@ const ToolRouterProxyExecuteConfigSchema = z.object({ enable: z.boolean().descri
7918
8164
  * a boolean is shorthand for `{ enable: boolean }`.
7919
8165
  */
7920
8166
  const ToolRouterProxyExecuteSchema = z.union([z.boolean(), ToolRouterProxyExecuteConfigSchema]);
8167
+ /** Which tool calls a hook runs on: `'all'`, or only calls to the listed toolkits (including their proxy calls). */
8168
+ const ToolRouterHookAppliesToSchema = z.union([z.literal("all"), z.object({ toolkits: z.array(z.string()).describe("Toolkit slugs") }).strict()]);
8169
+ /** Blocks a call or result when it matches `condition`, a plain sentence describing what to block. */
8170
+ const ToolRouterHookConditionCheckHandlerSchema = z.object({
8171
+ type: z.literal("condition_check"),
8172
+ condition: z.string().describe("What to block, written as a plain sentence. For example: \"Sending email to anyone outside example.org\"."),
8173
+ action: z.literal("block")
8174
+ }).strict();
8175
+ /** A pre-defined check that blocks results with text that tries to give the agent instructions. */
8176
+ const ToolRouterHookPromptInjectionCheckHandlerSchema = z.object({
8177
+ type: z.literal("prompt_injection_check"),
8178
+ action: z.literal("block")
8179
+ }).strict();
8180
+ const toolRouterHookIdentityFields = {
8181
+ id: z.string().describe("Unique within the session. Shows up in results and logs."),
8182
+ name: z.string().optional().describe("A readable name. The agent sees it when this hook blocks a call."),
8183
+ appliesTo: ToolRouterHookAppliesToSchema
8184
+ };
8185
+ /**
8186
+ * A hook on a session's tool calls. A `before_execute` hook can block a call
8187
+ * before it runs; an `after_execute` hook can block its result before the
8188
+ * agent sees it.
8189
+ */
8190
+ const ToolRouterHookSchema = z.discriminatedUnion("type", [z.object({
8191
+ type: z.literal("before_execute"),
8192
+ ...toolRouterHookIdentityFields,
8193
+ handler: ToolRouterHookConditionCheckHandlerSchema
8194
+ }).strict(), z.object({
8195
+ type: z.literal("after_execute"),
8196
+ ...toolRouterHookIdentityFields,
8197
+ handler: z.discriminatedUnion("type", [ToolRouterHookConditionCheckHandlerSchema, ToolRouterHookPromptInjectionCheckHandlerSchema])
8198
+ }).strict()]);
7921
8199
  const ToolRouterCreateSessionConfigBaseSchema = z.object({
7922
8200
  sessionPreset: z.literal(SessionPreset.DIRECT_TOOLS).optional().describe("Shortcut to expose every tool allowed by the session filters directly in session.tools() and the MCP tool list. This disables meta tools by default (search, multi-execute, manage-connections, and workbench). Use when all tools are known upfront and helper/meta tools are not needed. Without this preset, ToolRouter uses its default configuration with meta tools enabled."),
7923
8201
  mcp: z.boolean().optional().describe("When true, the returned session surfaces its hosted MCP endpoint (`session.mcp.url` / `session.mcp.headers`) in the type, and an MCP URL that is not on the API base URL origin throws `ComposioMCPDestinationError` instead of leaving `session.mcp.headers` empty with a warning. The endpoint exists on every session at runtime regardless of this flag, but is only typed when `mcp: true` is passed. Default native tools (`session.tools()`) are unaffected. See https://docs.composio.dev/docs/sessions-via-mcp"),
@@ -7936,6 +8214,7 @@ const ToolRouterCreateSessionConfigBaseSchema = z.object({
7936
8214
  requireExplicitSelection: z.boolean().optional().describe("When true, require explicit account selection when multiple accounts are connected. When false (default), use the first/default account.")
7937
8215
  }).optional().describe("Multi-account configuration for this session"),
7938
8216
  proxyExecute: ToolRouterProxyExecuteSchema.optional().describe("Proxy execute configuration for this session; a boolean is shorthand for `{ enable }`. Rejected by the API when enable is false and sandbox.enableProxyExecution is true."),
8217
+ hooks: z.array(ToolRouterHookSchema).optional().describe("Hooks that run on this session's tool calls. A hook can block a call before it runs, or block its result before the agent sees it."),
7939
8218
  preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional().describe("Tool slugs to preload into session.tools() and the MCP tool list, or \"all\" to preload every app tool allowed by the session filters. \"all\" requires a positive filter such as toolkits, tools, or tags; the backend validates and caps the final tool set.") }).strict().optional().describe("Preload configuration for tools that should be exposed without search."),
7940
8219
  experimental: z.object({
7941
8220
  assistivePrompt: z.object({ userTimezone: z.string().optional().describe("IANA timezone identifier (e.g., \"America/New_York\", \"Europe/London\") for timezone-aware assistive prompts") }).optional().describe("Configuration for assistive prompt generation"),
@@ -7955,6 +8234,7 @@ const ToolRouterCreateSessionConfigBaseSchema = z.object({
7955
8234
  config.toolkits !== void 0 && "toolkits",
7956
8235
  config.tools !== void 0 && "tools",
7957
8236
  config.tags !== void 0 && "tags",
8237
+ config.hooks !== void 0 && "hooks",
7958
8238
  config.experimental.customTools !== void 0 && "experimental.customTools",
7959
8239
  config.experimental.customToolkits !== void 0 && "experimental.customToolkits"
7960
8240
  ].filter((field) => field !== false));
@@ -8085,18 +8365,50 @@ const ToolRouterSessionSearchResponseSchema = z.object({
8085
8365
  session: ToolRouterSessionSearchSessionSchema,
8086
8366
  timeInfo: ToolRouterSessionSearchTimeInfoSchema
8087
8367
  });
8368
+ /**
8369
+ * What one session hook decided about a call. `unavailable` means the hook
8370
+ * could not be evaluated (for example it timed out); it does not block the
8371
+ * call.
8372
+ */
8373
+ const ToolRouterHookResultSchema = z.discriminatedUnion("status", [z.object({
8374
+ id: z.string().describe("The hook id"),
8375
+ status: z.literal("evaluated"),
8376
+ outcome: z.enum(["continue", "block"]).describe("What the hook decided")
8377
+ }), z.object({
8378
+ id: z.string().describe("The hook id"),
8379
+ status: z.literal("unavailable")
8380
+ })]);
8381
+ /**
8382
+ * Why a session hook blocked a call. `request_blocked`: a `before_execute` hook
8383
+ * blocked it and the tool did not run. `response_blocked`: the tool ran and an
8384
+ * `after_execute` hook blocked its result.
8385
+ */
8386
+ const ToolRouterBlockReasonSchema = z.object({
8387
+ type: z.enum(["request_blocked", "response_blocked"]),
8388
+ hookId: z.string()
8389
+ });
8088
8390
  const ToolRouterSessionExecuteResponseSchema = z.object({
8089
8391
  data: z.record(z.string(), z.unknown()),
8090
8392
  error: z.string().nullable(),
8091
8393
  logId: z.string(),
8092
8394
  /**
8093
- * Whether the tool ran and succeeded (`completed`) or ran and failed
8094
- * (`failed`). A failed execution can carry a `null` or empty `error`, so
8095
- * read this rather than `error` to tell the two apart.
8395
+ * Whether the tool ran and succeeded (`completed`), ran and failed
8396
+ * (`failed`), or was blocked by a session hook (`blocked`). A failed
8397
+ * execution can carry a `null` or empty `error`, so read this rather than
8398
+ * `error` to tell them apart. A blocked call has empty `data` and the
8399
+ * agent-facing message in `error`.
8096
8400
  */
8097
- resultType: z.enum(["completed", "failed"]),
8401
+ resultType: z.enum([
8402
+ "completed",
8403
+ "failed",
8404
+ "blocked"
8405
+ ]),
8098
8406
  /** Actual Instant usage charge when the Session opts into returning it. */
8099
- instantCharge: z.unknown().optional()
8407
+ instantCharge: z.unknown().optional(),
8408
+ /** Set when `resultType` is `blocked`: which hook blocked the call, and at which stage. */
8409
+ blockReason: ToolRouterBlockReasonSchema.optional(),
8410
+ /** Every session hook that applied to this call. Absent when none applied. */
8411
+ hookResults: z.array(ToolRouterHookResultSchema).optional()
8100
8412
  });
8101
8413
  const SessionProxyExecuteParamsSchema = z.object({
8102
8414
  /** The toolkit whose connected account to use for auth (e.g. 'gmail', 'github') */
@@ -8189,6 +8501,7 @@ const ToolRouterUpdateSessionConfigSchema = z.object({
8189
8501
  requireExplicitSelection: z.boolean().optional()
8190
8502
  }).nullable().optional().describe("`null` removes the session override; the mode then resolves to disabled"),
8191
8503
  proxyExecute: ToolRouterProxyExecuteSchema.nullable().optional().describe("Replaces the proxy execute block; a boolean is shorthand for `{ enable }` and `null` removes it"),
8504
+ hooks: z.array(ToolRouterHookSchema).nullable().optional().describe("Replaces the whole list of hooks; `null` removes every hook"),
8192
8505
  preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional() }).strict().nullable().optional().describe("Replaces the stored preload; `null` removes it"),
8193
8506
  search: z.object({ enable: z.boolean().optional() }).strict().nullable().optional().describe("Replaces the search block; `null` removes it and restores the defaults"),
8194
8507
  execute: z.object({ enableMultiExecute: z.boolean().optional() }).strict().nullable().optional().describe("Replaces the execute block; `null` removes it and restores the defaults"),
@@ -8198,7 +8511,8 @@ const ToolRouterUpdateSessionConfigSchema = z.object({
8198
8511
  if (config.experimental?.sessionConfigId !== void 0) addSessionConfigConflictIssue(ctx, [
8199
8512
  config.toolkits !== void 0 && "toolkits",
8200
8513
  config.tools !== void 0 && "tools",
8201
- config.tags !== void 0 && "tags"
8514
+ config.tags !== void 0 && "tags",
8515
+ config.hooks !== void 0 && "hooks"
8202
8516
  ].filter((field) => field !== false));
8203
8517
  if (config.sandbox !== void 0 && config.workbench !== void 0) ctx.addIssue({
8204
8518
  code: z.ZodIssueCode.custom,
@@ -8234,7 +8548,10 @@ const ToolRouterSessionEnsureConnectedOptionsSchema = z.object({
8234
8548
  * active configs only, 20 per page, at most 100.
8235
8549
  */
8236
8550
  const SessionConfigListParamsSchema = z$1.object({
8237
- /** Case-insensitive substring match against the config name. */
8551
+ /**
8552
+ * @deprecated The Composio API no longer accepts this field. It is ignored
8553
+ * and `list()` logs a warning when it is set; filter `items` by name instead.
8554
+ */
8238
8555
  search: z$1.string().optional(),
8239
8556
  /** `true` returns only archived configs. Omitted returns active configs. */
8240
8557
  archived: z$1.boolean().optional(),
@@ -8264,20 +8581,45 @@ const SessionConfigListResponseSchema = z$1.object({
8264
8581
  });
8265
8582
  const SessionConfigTagPolicySchema = z$1.object({
8266
8583
  enable: z$1.array(ToolRouterTagsParamSchema.element).optional(),
8267
- disable: z$1.array(ToolRouterTagsParamSchema.element).optional()
8584
+ disable: z$1.array(ToolRouterTagsParamSchema.element).optional(),
8585
+ /** Tags whose tools need the user's approval before they run. */
8586
+ require_approval: z$1.array(ToolRouterTagsParamSchema.element).optional()
8268
8587
  });
8588
+ /** What in a policy entry needs the user's approval before it runs. */
8589
+ const requireApproval = { require_approval: z$1.array(z$1.string()).optional() };
8590
+ const ApprovalOnlyPolicySchema = z$1.object({ require_approval: z$1.array(z$1.string()) });
8269
8591
  /**
8270
8592
  * The access policy stored in a saved Session config, in the backend's
8271
- * `enable`/`disable` shape. Toolkit slug keys and tag names are kept exactly
8272
- * as the backend sends them.
8593
+ * `enable`/`disable`/`require_approval` shape. Toolkit slug keys and tag names
8594
+ * are kept exactly as the backend sends them.
8273
8595
  */
8274
8596
  const SessionConfigPolicySchema = z$1.object({
8275
- toolkits: z$1.union([z$1.object({ enable: z$1.array(z$1.string()) }), z$1.object({ disable: z$1.array(z$1.string()) })]).optional(),
8597
+ toolkits: z$1.union([
8598
+ z$1.object({
8599
+ enable: z$1.array(z$1.string()),
8600
+ ...requireApproval
8601
+ }),
8602
+ z$1.object({
8603
+ disable: z$1.array(z$1.string()),
8604
+ ...requireApproval
8605
+ }),
8606
+ ApprovalOnlyPolicySchema
8607
+ ]).optional(),
8276
8608
  /** Per-toolkit tool policy, keyed by toolkit slug. */
8277
8609
  tools: z$1.record(z$1.string(), z$1.union([
8278
- z$1.object({ enable: z$1.array(z$1.string()) }),
8279
- z$1.object({ disable: z$1.array(z$1.string()) }),
8280
- z$1.object({ tags: SessionConfigTagPolicySchema })
8610
+ z$1.object({
8611
+ enable: z$1.array(z$1.string()),
8612
+ ...requireApproval
8613
+ }),
8614
+ z$1.object({
8615
+ disable: z$1.array(z$1.string()),
8616
+ ...requireApproval
8617
+ }),
8618
+ z$1.object({
8619
+ tags: SessionConfigTagPolicySchema,
8620
+ ...requireApproval
8621
+ }),
8622
+ ApprovalOnlyPolicySchema
8281
8623
  ])).optional(),
8282
8624
  /** Global tag policy. */
8283
8625
  tags: SessionConfigTagPolicySchema.optional()
@@ -8335,7 +8677,7 @@ const transformSessionConfig = (response) => {
8335
8677
  *
8336
8678
  * @example
8337
8679
  * ```typescript
8338
- * const { items } = await composio.sessionConfigs.list({ search: 'support' });
8680
+ * const { items } = await composio.sessionConfigs.list();
8339
8681
  * const sessionConfig = await composio.sessionConfigs.get(items[0].id);
8340
8682
  * const session = await composio.sessions.create('user_123', {
8341
8683
  * experimental: { sessionConfigId: sessionConfig.id },
@@ -8356,7 +8698,8 @@ var SessionConfigs = class {
8356
8698
  *
8357
8699
  * Requires Session configs to be enabled for the project.
8358
8700
  *
8359
- * @param {SessionConfigListParams} [params] - `search`, `archived`, `limit` and `cursor`
8701
+ * @param {SessionConfigListParams} [params] - `archived`, `limit` and `cursor`; the
8702
+ * deprecated `search` is ignored
8360
8703
  * @returns {Promise<SessionConfigListResponse>} Config summaries and the next cursor
8361
8704
  * @throws {ValidationError} If the params fail validation
8362
8705
  *
@@ -8373,7 +8716,9 @@ var SessionConfigs = class {
8373
8716
  async list(params, requestOptions) {
8374
8717
  const parsedParams = SessionConfigListParamsSchema.safeParse(params ?? {});
8375
8718
  if (!parsedParams.success) throw new ValidationError("Failed to parse session config list params", { cause: parsedParams.error });
8376
- const result = await withCancellation(() => this.client.sessionConfigs.list(parsedParams.data, requestOptions), requestOptions?.signal);
8719
+ const { search, ...query } = parsedParams.data;
8720
+ if (search !== void 0) logger.warn("sessionConfigs.list(): the Composio API no longer accepts `search`; the option is ignored.");
8721
+ const result = await withCancellation(() => this.client.sessionConfigs.list(query, requestOptions), requestOptions?.signal);
8377
8722
  return transformSessionConfigListResponse(result);
8378
8723
  }
8379
8724
  /**
@@ -8799,7 +9144,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
8799
9144
 
8800
9145
  //#endregion
8801
9146
  //#region package.json
8802
- var version = "0.26.0";
9147
+ var version = "0.28.0";
8803
9148
 
8804
9149
  //#endregion
8805
9150
  //#region src/utils/session.ts
@@ -8916,6 +9261,14 @@ const transformToolRouterSandboxParams = (params) => {
8916
9261
  sandbox_size: params.sandboxSize
8917
9262
  };
8918
9263
  };
9264
+ /**
9265
+ * `hooks` as sent on create and update: `appliesTo` becomes `applies_to`.
9266
+ * Create and patch take the same hook shape.
9267
+ */
9268
+ const transformToolRouterHooksParams = (hooks) => hooks.map(({ appliesTo, ...hook }) => ({
9269
+ ...hook,
9270
+ applies_to: appliesTo
9271
+ }));
8919
9272
  /** `proxy_execute` as sent on create and update: a boolean becomes `{ enable }`. */
8920
9273
  const transformToolRouterProxyExecuteParams = (config) => typeof config === "boolean" ? { enable: config } : config;
8921
9274
  const transformToolRouterInstantParams = (config) => {
@@ -9013,6 +9366,7 @@ const transformToolRouterUpdateParams = (config) => {
9013
9366
  }
9014
9367
  }
9015
9368
  if (config.proxyExecute !== void 0) params.proxy_execute = config.proxyExecute === null ? null : transformToolRouterProxyExecuteParams(config.proxyExecute);
9369
+ if (config.hooks !== void 0) params.hooks = config.hooks === null ? null : transformToolRouterHooksParams(config.hooks);
9016
9370
  if (config.preload !== void 0) params.preload = config.preload;
9017
9371
  if (config.search !== void 0) params.search = config.search;
9018
9372
  if (config.execute !== void 0) params.execute = config.execute === null ? null : config.execute.enableMultiExecute === void 0 ? {} : { enable_multi_execute: config.execute.enableMultiExecute };
@@ -9530,77 +9884,6 @@ var RemoteFile = class RemoteFile {
9530
9884
  }
9531
9885
  };
9532
9886
 
9533
- //#endregion
9534
- //#region src/utils/mime.ts
9535
- /**
9536
- * Maps MIME types to file extensions.
9537
- * Used when deriving filenames from content-type headers (e.g. for URLs without path segments).
9538
- */
9539
- function getExtensionFromMimeType(mimeType) {
9540
- const mimeToExt = {
9541
- "text/plain": "txt",
9542
- "text/html": "html",
9543
- "text/css": "css",
9544
- "text/javascript": "js",
9545
- "application/json": "json",
9546
- "application/xml": "xml",
9547
- "application/pdf": "pdf",
9548
- "application/zip": "zip",
9549
- "application/x-zip-compressed": "zip",
9550
- "application/gzip": "gz",
9551
- "application/octet-stream": "bin",
9552
- "application/x-tar": "tar",
9553
- "application/msword": "doc",
9554
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
9555
- "application/vnd.ms-excel": "xls",
9556
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
9557
- "application/vnd.ms-powerpoint": "ppt",
9558
- "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
9559
- "image/jpeg": "jpg",
9560
- "image/jpg": "jpg",
9561
- "image/png": "png",
9562
- "image/gif": "gif",
9563
- "image/svg+xml": "svg",
9564
- "image/webp": "webp",
9565
- "image/bmp": "bmp",
9566
- "image/tiff": "tiff",
9567
- "audio/mpeg": "mp3",
9568
- "audio/wav": "wav",
9569
- "audio/ogg": "ogg",
9570
- "video/mp4": "mp4",
9571
- "video/mpeg": "mpeg",
9572
- "video/quicktime": "mov",
9573
- "video/x-msvideo": "avi",
9574
- "video/webm": "webm"
9575
- };
9576
- const cleanMimeType = mimeType.split(";")[0].toLowerCase().trim();
9577
- if (mimeToExt[cleanMimeType]) return mimeToExt[cleanMimeType];
9578
- const parts = cleanMimeType.split("/");
9579
- if (parts.length === 2) {
9580
- const subtype = parts[1].toLowerCase();
9581
- if (subtype.includes("+")) {
9582
- const plusParts = subtype.split("+");
9583
- const prefix = plusParts[0];
9584
- const suffix = plusParts[plusParts.length - 1];
9585
- if ([
9586
- "svg",
9587
- "atom",
9588
- "rss"
9589
- ].includes(prefix)) return prefix;
9590
- if ([
9591
- "json",
9592
- "xml",
9593
- "yaml",
9594
- "zip",
9595
- "gzip"
9596
- ].includes(suffix)) return suffix;
9597
- return suffix;
9598
- }
9599
- return subtype || "txt";
9600
- }
9601
- return "bin";
9602
- }
9603
-
9604
9887
  //#endregion
9605
9888
  //#region src/models/ToolRouterSessionFileMount.ts
9606
9889
  /**
@@ -10012,25 +10295,14 @@ var SessionContextImpl = class {
10012
10295
  const requestOptions = signal ? { signal } : void 0;
10013
10296
  const clientParams = transformProxyParams(validated.data);
10014
10297
  const response = await withCancellation(() => this.client.toolRouter.session.proxyExecute(this.sessionId, clientParams, withoutRetries(requestOptions)), requestOptions?.signal);
10015
- assertNotInputRequired(response, `${validated.data.method} proxy call for toolkit ${validated.data.toolkit}`);
10016
- return {
10017
- status: response.status,
10018
- data: response.data,
10019
- headers: response.headers,
10020
- ...response.binary_data ? { binaryData: {
10021
- contentType: response.binary_data.content_type,
10022
- size: response.binary_data.size,
10023
- url: response.binary_data.url,
10024
- expiresAt: response.binary_data.expires_at
10025
- } } : {}
10026
- };
10298
+ return transformProxyExecuteResponse(response, `${validated.data.method} proxy call for toolkit ${validated.data.toolkit}`);
10027
10299
  }
10028
10300
  };
10029
10301
 
10030
10302
  //#endregion
10031
10303
  //#region src/lib/toolRouterSessionDelete.ts
10032
10304
  async function deleteToolRouterSession(client, sessionId, requestOptions) {
10033
- const response = await withCancellation(() => client.delete(`/api/v3.1/tool_router/session/${encodeURIComponent(sessionId)}`, requestOptions), requestOptions?.signal);
10305
+ const response = await withCancellation(() => client.toolRouter.session.delete(sessionId, requestOptions), requestOptions?.signal);
10034
10306
  return ToolRouterSessionDeleteResponseSchema.parse({
10035
10307
  sessionId: response.session_id,
10036
10308
  deleted: response.deleted
@@ -10436,7 +10708,7 @@ var ToolRouterSession = class {
10436
10708
  * @param options.account - Account identifier for direct app tool execution. Accepted on every project: in multi-account sessions it picks the account; on single-account projects it must match one of the session's active connections for the toolkit. Helper/meta tools either ignore this top-level field or define their own account-selection fields.
10437
10709
  * @param options.inputResponses - Experimental. The user's answers to an earlier `ComposioToolInputRequiredError`, keyed by the IDs in its `inputRequests`. Repeat the same call with them.
10438
10710
  * @param options.requestState - Experimental. The `requestState` of that error, sent back unchanged.
10439
- * @returns The tool execution result
10711
+ * @returns The tool execution result. `resultType: 'blocked'` means a session hook blocked the call; `error` then holds the hook's message
10440
10712
  * @throws {ComposioToolInputRequiredError} If the tool needs input from the user (for example an approval) before it can run
10441
10713
  */
10442
10714
  async execute(toolSlug, arguments_, options, requestOptions) {
@@ -10502,7 +10774,7 @@ var ToolRouterSession = class {
10502
10774
  * The backend resolves the connected account from the toolkit within the session.
10503
10775
  *
10504
10776
  * @param params - Proxy request parameters (toolkit, endpoint, method, body, headers/query params)
10505
- * @returns The proxied API response with status, data, headers
10777
+ * @returns The proxied API response with status, data and headers (`resultType: 'completed'`), or `resultType: 'blocked'` with the hook's message when a session hook blocked the request
10506
10778
  * @throws {ComposioToolInputRequiredError} If the call needs input from the user before it can run
10507
10779
  */
10508
10780
  async proxyExecute(params, requestOptions) {
@@ -10510,18 +10782,7 @@ var ToolRouterSession = class {
10510
10782
  if (!validated.success) throw new ValidationError("Invalid proxy execute parameters", { cause: validated.error });
10511
10783
  const clientParams = transformProxyParams(validated.data);
10512
10784
  const response = await withCancellation(() => this.client.toolRouter.session.proxyExecute(this.sessionId, clientParams, withoutRetries(requestOptions)), requestOptions?.signal);
10513
- assertNotInputRequired(response, `${validated.data.method} proxy call for toolkit ${validated.data.toolkit}`);
10514
- return {
10515
- status: response.status,
10516
- data: response.data,
10517
- headers: response.headers,
10518
- ...response.binary_data ? { binaryData: {
10519
- contentType: response.binary_data.content_type,
10520
- size: response.binary_data.size,
10521
- url: response.binary_data.url,
10522
- expiresAt: response.binary_data.expires_at
10523
- } } : {}
10524
- };
10785
+ return transformProxyExecuteResponse(response, `${validated.data.method} proxy call for toolkit ${validated.data.toolkit}`);
10525
10786
  }
10526
10787
  /**
10527
10788
  * Partially update the session configuration.
@@ -10857,6 +11118,7 @@ var ToolRouter = class {
10857
11118
  workbench: sandboxPayload,
10858
11119
  multi_account: multiAccountPayload,
10859
11120
  ...routerConfig.proxyExecute !== void 0 && { proxy_execute: transformToolRouterProxyExecuteParams(routerConfig.proxyExecute) },
11121
+ ...routerConfig.hooks !== void 0 && { hooks: transformToolRouterHooksParams(routerConfig.hooks) },
10860
11122
  preload: routerConfig.preload,
10861
11123
  ...isDirectToolsPreset && {
10862
11124
  search: { enable: false },
@@ -12342,4 +12604,4 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
12342
12604
  });
12343
12605
 
12344
12606
  //#endregion
12345
- export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIKeyKindError, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioConnectedAccountNotRevokableError, ComposioConnectedAccountRevocationNotSupportedError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMCPDestinationError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioScopeConfigError, ComposioSensitiveFilePathBlockedError, ComposioSessionConfigConflictError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolFetchError, ComposioToolInputRequiredError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountCompleteAuthParamsSchema, ConnectedAccountCompleteAuthResponseSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountRevokeResponseSchema, ConnectedAccountRevokedTokenSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, CustomToolkitAuthSchemeSchema, CustomToolkitDeleteResponseSchema, CustomToolkitSyncParamsSchema, CustomToolkitSyncResponseSchema, 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, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterErrorCodes, 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, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, Usage, UsageBreakdownGroupSchema, UsageBreakdownParamsSchema, UsageBreakdownResponseSchema, UsageEntitySummarySchema, UsageFiltersSchema, UsageOrderBySchema, UsageOrderDirectionSchema, UsageSummaryParamsSchema, UsageSummaryResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEndpointCreateParamsSchema, WebhookEndpointListItemSchema, WebhookEndpointListParamsSchema, WebhookEndpointListResponseSchema, WebhookEndpointReplaceParamsSchema, WebhookEndpointSchema, WebhookEndpointUpdateParamsSchema, WebhookEndpoints, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookSubscriptionDeleteResponseSchema, WebhookSubscriptionEventTypeSchema, WebhookSubscriptionEventTypesResponseSchema, WebhookSubscriptionListParamsSchema, WebhookSubscriptionListResponseSchema, WebhookSubscriptionRotateSecretResponseSchema, WebhookSubscriptionSchema, WebhookSubscriptionSetParamsSchema, WebhookSubscriptionUpdateParamsSchema, WebhookSubscriptions, WebhookTriggerPayloadV3Schema, WebhookVersionSchema, WebhookVersions, Webhooks, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };
12607
+ export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIKeyKindError, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioConnectedAccountNotRevokableError, ComposioConnectedAccountRevocationNotSupportedError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMCPDestinationError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioScopeConfigError, ComposioSensitiveFilePathBlockedError, ComposioSessionConfigConflictError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolFetchError, ComposioToolInputRequiredError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountCompleteAuthParamsSchema, ConnectedAccountCompleteAuthResponseSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountRevokeResponseSchema, ConnectedAccountRevokedTokenSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, CustomToolkitAuthSchemeSchema, CustomToolkitCreateParamsSchema, CustomToolkitCreateResponseSchema, CustomToolkitDeleteResponseSchema, CustomToolkitSyncParamsSchema, CustomToolkitSyncResponseSchema, CustomToolkitUpdateParamsSchema, CustomToolkitUpdateResponseSchema, CustomToolkitUpsertParamsSchema, CustomToolkitUpsertResponseSchema, CustomToolkits, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, Keyring, KeyringTransferKeySchema, KeyringTransferKeysResponseSchema, LogSearchFilterFieldSchema, LogSearchFilterOperatorSchema, LogSearchFilterSchema, LogSearchParamsSchema, LogSearchResponseSchema, LogSearchTimeRangeSchema, Logs, MAX_URL_UPLOAD_SIZE_BYTES, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionConfigListParamsSchema, SessionConfigListResponseSchema, SessionConfigPolicySchema, SessionConfigSchema, SessionConfigSummarySchema, SessionConfigs, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolExecutionLogDetailSchema, ToolExecutionLogLevelSchema, ToolExecutionLogMetadataSchema, ToolExecutionLogParentSchema, ToolExecutionLogSchema, ToolExecutionLogStatusSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterBlockReasonSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterErrorCodes, ToolRouterHookAppliesToSchema, ToolRouterHookConditionCheckHandlerSchema, ToolRouterHookPromptInjectionCheckHandlerSchema, ToolRouterHookResultSchema, ToolRouterHookSchema, ToolRouterInstantSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterProxyExecuteConfigSchema, ToolRouterProxyExecuteSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionEnsureConnectedOptionsSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionListConfigHistoryOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateExperimentalSchema, ToolRouterUpdateManageConnectionsSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitChangelogItemSchema, ToolkitChangelogResponseSchema, ToolkitConditionalScopeSchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitGetManySlugsSchema, ToolkitGrantContextDimensionSchema, ToolkitLatestVersionSchema, ToolkitListGrantContextsParamsSchema, ToolkitListGrantContextsResponseSchema, ToolkitMangedByEnumSchema, ToolkitRecommendScopesParamsSchema, ToolkitRecommendScopesResponseSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionChangelogSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsGetManyParamsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceTypeSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, Usage, UsageBreakdownGroupSchema, UsageBreakdownParamsSchema, UsageBreakdownResponseSchema, UsageEntitySummarySchema, UsageFiltersSchema, UsageOrderBySchema, UsageOrderDirectionSchema, UsageSummaryParamsSchema, UsageSummaryResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEndpointCreateParamsSchema, WebhookEndpointListItemSchema, WebhookEndpointListParamsSchema, WebhookEndpointListResponseSchema, WebhookEndpointReplaceParamsSchema, WebhookEndpointSchema, WebhookEndpointUpdateParamsSchema, WebhookEndpoints, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookSubscriptionDeleteResponseSchema, WebhookSubscriptionEventTypeSchema, WebhookSubscriptionEventTypesResponseSchema, WebhookSubscriptionListParamsSchema, WebhookSubscriptionListResponseSchema, WebhookSubscriptionRotateSecretResponseSchema, WebhookSubscriptionSchema, WebhookSubscriptionSetParamsSchema, WebhookSubscriptionUpdateParamsSchema, WebhookSubscriptions, WebhookTriggerPayloadV3Schema, WebhookVersionSchema, WebhookVersions, Webhooks, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };