@composio/core 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseProvider-BBnsv9kS.d.mts → BaseProvider-Brb3o86-.d.mts} +80 -80
- package/dist/{CustomTool-DEB4BQPl.mjs → CustomTool-D9qwyMrv.mjs} +1 -1
- package/dist/{CustomTool-DH18rVQu.d.mts → CustomTool-DLf7JeKt.d.mts} +1 -1
- package/dist/CustomTool-NpHpqdnU.d.mts +74 -0
- package/dist/{composio-CHnEggnv.d.mts → composio-BHSQwOUz.d.mts} +503 -319
- package/dist/composio-DfPD7BAi.d.mts +5666 -0
- package/dist/{customTool.types-DpIdOJjL.d.mts → customTool.types-9yFqPjdw.d.mts} +448 -76
- package/dist/customTool.types-D-6YqFdW.d.mts +2826 -0
- package/dist/docs/error-consistency.md +97 -0
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +306 -0
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +205 -0
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +488 -0
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +94 -0
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +67 -0
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +304 -0
- package/dist/docs/reference/sdk-reference/typescript/meta.json +17 -0
- package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +107 -0
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +163 -0
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +252 -0
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +155 -0
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +169 -0
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +453 -0
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +434 -0
- package/dist/{errors-D5f4pfvI.mjs → errors-DSIlYfl5.mjs} +2 -2
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +36 -6
- package/dist/index.mjs +455 -123
- package/dist/{jsonSchema-daqF3S3d.mjs → jsonSchema-CFKdONpP.mjs} +1 -1
- package/dist/{types-CaI5Z4PA.d.mts → types-BJLCRj9q.d.mts} +2 -2
- package/dist/types-CCh8qvui.d.mts +12 -0
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/docs/error-consistency.md +97 -0
- package/package.json +4 -3
- package/src/composio.ts +509 -0
- package/src/errors/AuthConfigErrors.ts +23 -0
- package/src/errors/ComposioError.ts +408 -0
- package/src/errors/ConnectedAccountsErrors.ts +158 -0
- package/src/errors/ConnectionRequestErrors.ts +32 -0
- package/src/errors/FileModifierErrors.ts +100 -0
- package/src/errors/PusherErrors.ts +28 -0
- package/src/errors/RemoteFileErrors.ts +62 -0
- package/src/errors/SDKErrors.ts +92 -0
- package/src/errors/ToolErrors.ts +244 -0
- package/src/errors/ToolkitErrors.ts +39 -0
- package/src/errors/TriggerErrors.ts +120 -0
- package/src/errors/ValidationErrors.ts +99 -0
- package/src/errors/index.ts +41 -0
- package/src/experimental/index.ts +28 -0
- package/src/index.ts +64 -0
- package/src/lib/toolRouterConstants.ts +1 -0
- package/src/lib/toolRouterParams.ts +306 -0
- package/src/lib/toolRouterSessionDelete.ts +30 -0
- package/src/models/AuthConfigs.ts +398 -0
- package/src/models/AuthScheme.ts +206 -0
- package/src/models/ConnectedAccounts.ts +735 -0
- package/src/models/ConnectionRequest.ts +150 -0
- package/src/models/CustomTool.ts +676 -0
- package/src/models/Experimental.ts +202 -0
- package/src/models/Files.node.ts +93 -0
- package/src/models/Files.workerd.ts +49 -0
- package/src/models/MCP.ts +478 -0
- package/src/models/RemoteFile.ts +172 -0
- package/src/models/SessionContext.ts +147 -0
- package/src/models/Sessions.ts +21 -0
- package/src/models/ToolRouter.ts +406 -0
- package/src/models/ToolRouterSession.ts +839 -0
- package/src/models/ToolRouterSessionFileMount.ts +389 -0
- package/src/models/Toolkits.ts +412 -0
- package/src/models/Tools.ts +1260 -0
- package/src/models/Triggers.ts +1381 -0
- package/src/models/customToolExecution.ts +118 -0
- package/src/models/inlineCustomToolsPayload.ts +17 -0
- package/src/models/proxyParamsTransform.ts +26 -0
- package/src/provider/BaseProvider.ts +138 -0
- package/src/provider/ComposioProvider.ts +29 -0
- package/src/provider/OpenAIProvider.ts +547 -0
- package/src/services/internal/InternalService.ts +50 -0
- package/src/services/internal/InternalService.types.ts +14 -0
- package/src/services/pusher/Pusher.ts +230 -0
- package/src/services/telemetry/TelemetryService.ts +48 -0
- package/src/services/telemetry/TelemetryService.types.ts +67 -0
- package/src/telemetry/BatchProcessor.ts +77 -0
- package/src/telemetry/README.md +123 -0
- package/src/telemetry/Telemetry.ts +356 -0
- package/src/types/ToolRouterSessionFilesMount.types.ts +96 -0
- package/src/types/authConfigs.types.ts +174 -0
- package/src/types/composio.types.ts +1 -0
- package/src/types/connectedAccountAuthStates.types.ts +852 -0
- package/src/types/connectedAccounts.types.ts +395 -0
- package/src/types/connectionRequest.types.ts +16 -0
- package/src/types/customTool.types.ts +261 -0
- package/src/types/files.types.ts +15 -0
- package/src/types/mcp.experimental.types.ts +163 -0
- package/src/types/mcp.types.ts +362 -0
- package/src/types/modifiers.types.ts +663 -0
- package/src/types/org.types.ts +0 -0
- package/src/types/provider.types.ts +41 -0
- package/src/types/pusher.types.ts +18 -0
- package/src/types/requestOptions.types.ts +62 -0
- package/src/types/telemetry.types.ts +89 -0
- package/src/types/tool.types.ts +408 -0
- package/src/types/toolRouter.types.ts +774 -0
- package/src/types/toolkit.types.ts +130 -0
- package/src/types/triggers.types.ts +401 -0
- package/src/types/webhookEvents.types.ts +219 -0
- package/src/utils/buffer.ts +30 -0
- package/src/utils/cancellation.ts +22 -0
- package/src/utils/config-defaults/ConfigDefaults.node.ts +7 -0
- package/src/utils/config-defaults/ConfigDefaults.workerd.ts +10 -0
- package/src/utils/config-defaults/index.ts +1 -0
- package/src/utils/config-defaults/types.ts +14 -0
- package/src/utils/constants.ts +22 -0
- package/src/utils/crypto.ts +34 -0
- package/src/utils/env.ts +34 -0
- package/src/utils/fileDirs.ts +81 -0
- package/src/utils/fileUtils.node.ts +458 -0
- package/src/utils/json-schema.ts +1 -0
- package/src/utils/jsonSchema.ts +355 -0
- package/src/utils/logger.ts +99 -0
- package/src/utils/mime.ts +75 -0
- package/src/utils/modifiers/FileToolModifier.node.ts +477 -0
- package/src/utils/modifiers/FileToolModifier.utils.neutral.ts +132 -0
- package/src/utils/modifiers/FileToolModifier.workerd.ts +51 -0
- package/src/utils/pagination.ts +73 -0
- package/src/utils/pusher.ts +286 -0
- package/src/utils/schemaPropertyKeys.ts +433 -0
- package/src/utils/sdk.ts +110 -0
- package/src/utils/sensitiveFileUploadPaths.node.ts +105 -0
- package/src/utils/session.ts +114 -0
- package/src/utils/toolArguments.ts +73 -0
- package/src/utils/toolkitVersion.ts +26 -0
- package/src/utils/transform.ts +42 -0
- package/src/utils/transformers/authConfigs.ts +107 -0
- package/src/utils/transformers/connectedAccounts.ts +119 -0
- package/src/utils/transformers/mcp.ts +164 -0
- package/src/utils/transformers/toolRouterResponseTransform.ts +160 -0
- package/src/utils/transformers/toolkits.ts +100 -0
- package/src/utils/transformers/triggers.ts +118 -0
- package/src/utils/uploadDirAllowlist.node.ts +178 -0
- package/src/utils/uuid.ts +7 -0
- package/src/utils/version.ts +58 -0
- package/src/utils/zodSchema.ts +90 -0
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as getEnvVariable, a as ComposioSensitiveFilePathBlockedError, c as logger, d as DEFAULT_BASE_URL, f as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, g as constants_exports, h as USER_DATA_FILE_NAME, i as ComposioFileUploadPathNotAllowedError, l as COMPOSIO_DIR, m as TEMP_FILES_DIRECTORY_NAME, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, p as IS_DEVELOPMENT_OR_CI, r as ComposioFileUploadError, s as ComposioError, t as ComposioFileNotFoundError, u as COMPOSIO_LOG_LEVEL, v as getEnvsWithPrefix } from "./FileModifierErrors-3fSwIWoa.mjs";
|
|
2
|
-
import { A as ComposioInvalidToolArgumentsError, B as ComposioLegacyConnectedAccountsEndpointRetiredError, C as JsonSchemaRefResolutionError, D as ComposioGlobalExecuteToolFnNotSetError, E as ValidationErrorCodes, F as ToolErrorCodes, H as ComposioSharedAccessDeniedError, I as handleToolExecutionError, L as ComposioAclOnlyForSharedError, M as ComposioToolExecutionError, N as ComposioToolNotFoundError, O as ComposioInvalidExecuteFunctionError, P as ComposioToolVersionRequiredError, R as ComposioConnectedAccountNotFoundError, S as isRequestAbortError, T as ValidationError, U as ComposioSharedConnectionNotAccessibleError, V as ComposioMultipleConnectedAccountsError, W as ConnectedAccountErrorCodes, _ as AuthConfigErrorCodes, a as ComposioFailedToSubscribeToPusherChannelError, b as ComposioRequestCancelledError, c as ComposioWebhookPayloadError, d as ComposioToolkitFetchError, f as ComposioToolkitNotFoundError, g as ConnectionRequestTimeoutError, h as ConnectionRequestFailedError, i as ComposioFailedToGetSDKRealtimeCredentialsError, j as ComposioProviderNotDefinedError, k as ComposioInvalidModifierError, l as ComposioWebhookSignatureVerificationError, m as ConnectionRequestErrorCodes, n as RemoteFileErrorCodes, o as ComposioFailedToUnsubscribeFromPusherChannelError, p as ToolkitErrorCodes, r as ComposioFailedToCreatePusherClientError, s as ComposioTriggerTypeNotFoundError, t as RemoteFileDownloadError, u as TriggerErrorCodes, v as ComposioAuthConfigNotFoundError, w as JsonSchemaToZodError, x as SDKErrorCodes, y as ComposioNoAPIKeyError, z as ComposioFailedToCreateConnectedAccountLink } from "./errors-
|
|
2
|
+
import { A as ComposioInvalidToolArgumentsError, B as ComposioLegacyConnectedAccountsEndpointRetiredError, C as JsonSchemaRefResolutionError, D as ComposioGlobalExecuteToolFnNotSetError, E as ValidationErrorCodes, F as ToolErrorCodes, H as ComposioSharedAccessDeniedError, I as handleToolExecutionError, L as ComposioAclOnlyForSharedError, M as ComposioToolExecutionError, N as ComposioToolNotFoundError, O as ComposioInvalidExecuteFunctionError, P as ComposioToolVersionRequiredError, R as ComposioConnectedAccountNotFoundError, S as isRequestAbortError, T as ValidationError, U as ComposioSharedConnectionNotAccessibleError, V as ComposioMultipleConnectedAccountsError, W as ConnectedAccountErrorCodes, _ as AuthConfigErrorCodes, a as ComposioFailedToSubscribeToPusherChannelError, b as ComposioRequestCancelledError, c as ComposioWebhookPayloadError, d as ComposioToolkitFetchError, f as ComposioToolkitNotFoundError, g as ConnectionRequestTimeoutError, h as ConnectionRequestFailedError, i as ComposioFailedToGetSDKRealtimeCredentialsError, j as ComposioProviderNotDefinedError, k as ComposioInvalidModifierError, l as ComposioWebhookSignatureVerificationError, m as ConnectionRequestErrorCodes, n as RemoteFileErrorCodes, o as ComposioFailedToUnsubscribeFromPusherChannelError, p as ToolkitErrorCodes, r as ComposioFailedToCreatePusherClientError, s as ComposioTriggerTypeNotFoundError, t as RemoteFileDownloadError, u as TriggerErrorCodes, v as ComposioAuthConfigNotFoundError, w as JsonSchemaToZodError, x as SDKErrorCodes, y as ComposioNoAPIKeyError, z as ComposioFailedToCreateConnectedAccountLink } from "./errors-DSIlYfl5.mjs";
|
|
3
3
|
import { t as telemetry } from "./Telemetry-DhGI_J4G.mjs";
|
|
4
4
|
import { i as getRandomShortId, t as arrayBufferToBase64 } from "./buffer-PcbMMsgm.mjs";
|
|
5
5
|
import { r as schemaHasFileUploadable, t as isPlainObject } from "./FileToolModifier.utils.neutral-B5rT711M.mjs";
|
|
6
|
-
import { i as withCancellation, n as jsonSchemaToZodSchema, r as removeNonRequiredProperties, t as dereferenceJsonSchema } from "./jsonSchema-
|
|
7
|
-
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-
|
|
6
|
+
import { i as withCancellation, n as jsonSchemaToZodSchema, r as removeNonRequiredProperties, t as dereferenceJsonSchema } from "./jsonSchema-CFKdONpP.mjs";
|
|
7
|
+
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-D9qwyMrv.mjs";
|
|
8
8
|
import ComposioClient, { APIError, BadRequestError } from "@composio/client";
|
|
9
9
|
import { FileToolModifier } from "#file_tool_modifier";
|
|
10
10
|
import z$1, { z } from "zod/v3";
|
|
@@ -1658,11 +1658,8 @@ var Tools = class {
|
|
|
1658
1658
|
parameters: body.customAuthParams.parameters
|
|
1659
1659
|
} : void 0,
|
|
1660
1660
|
/**
|
|
1661
|
-
* @deprecated
|
|
1662
|
-
*
|
|
1663
|
-
* This parameter is deprecated and will be removed in the future.
|
|
1664
|
-
* Please use custom_connection_data instead.
|
|
1665
|
-
*
|
|
1661
|
+
* @deprecated The `customConnectionData` execute param is deprecated and will be
|
|
1662
|
+
* removed in a future release. Use `customAuthParams` instead.
|
|
1666
1663
|
*/
|
|
1667
1664
|
custom_connection_data: body.customConnectionData,
|
|
1668
1665
|
arguments: body.arguments,
|
|
@@ -1901,11 +1898,8 @@ var Tools = class {
|
|
|
1901
1898
|
connected_account_id: toolProxyParams.data.connectedAccountId,
|
|
1902
1899
|
parameters,
|
|
1903
1900
|
/**
|
|
1904
|
-
* @deprecated
|
|
1905
|
-
*
|
|
1906
|
-
* This parameter is deprecated and will be removed in the future.
|
|
1907
|
-
* Please use custom_auth_params instead.
|
|
1908
|
-
*
|
|
1901
|
+
* @deprecated The `customConnectionData` proxy param is deprecated and will be
|
|
1902
|
+
* removed in a future release. Use `customAuthParams` instead.
|
|
1909
1903
|
*/
|
|
1910
1904
|
custom_connection_data: toolProxyParams.data.customConnectionData
|
|
1911
1905
|
};
|
|
@@ -2503,7 +2497,7 @@ const CreateConnectedAccountResponseSchema = z.object({
|
|
|
2503
2497
|
});
|
|
2504
2498
|
const ConnectedAccountAuthConfigSchema = z.object({
|
|
2505
2499
|
id: z.string(),
|
|
2506
|
-
/** @deprecated
|
|
2500
|
+
/** @deprecated Use `connectedAccount.state.authScheme` instead. */
|
|
2507
2501
|
authScheme: AuthSchemeEnum.optional(),
|
|
2508
2502
|
isComposioManaged: z.boolean(),
|
|
2509
2503
|
isDisabled: z.boolean()
|
|
@@ -2514,11 +2508,11 @@ const ConnectedAccountRetrieveResponseSchema = z.object({
|
|
|
2514
2508
|
wordId: z.string().nullable().optional(),
|
|
2515
2509
|
alias: z.string().nullable().optional(),
|
|
2516
2510
|
/**
|
|
2517
|
-
* @deprecated
|
|
2511
|
+
* @deprecated Use `connectedAccount.state` instead — `data` is a legacy raw credential field.
|
|
2518
2512
|
*/
|
|
2519
2513
|
data: z.record(z.string(), z.unknown()).optional(),
|
|
2520
2514
|
/**
|
|
2521
|
-
* @deprecated
|
|
2515
|
+
* @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field.
|
|
2522
2516
|
*/
|
|
2523
2517
|
params: z.record(z.string(), z.unknown()).optional(),
|
|
2524
2518
|
status: ConnectedAccountStatusSchema,
|
|
@@ -2791,16 +2785,17 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
|
|
|
2791
2785
|
* @fileoverview The `composio.experimental` namespace. Houses experimental
|
|
2792
2786
|
* SDK methods whose shape may change in future releases.
|
|
2793
2787
|
*
|
|
2794
|
-
*
|
|
2795
|
-
*
|
|
2796
|
-
*
|
|
2788
|
+
* Domain-specific mounts remain preferred when they exist (for example
|
|
2789
|
+
* `composio.connectedAccounts.updateAcl(...)`). This namespace keeps
|
|
2790
|
+
* compatibility aliases while those APIs are experimental. For experimental
|
|
2791
|
+
* stateless factories (e.g. `experimental_createTool`), see the top-level
|
|
2792
|
+
* `experimental_*` exports from `@composio/core`.
|
|
2797
2793
|
*/
|
|
2798
2794
|
/**
|
|
2799
2795
|
* Server-side 400 message the API uses to reject ACL writes against a
|
|
2800
|
-
* PRIVATE connection. Substring-matched in `updateAcl`
|
|
2801
|
-
*
|
|
2802
|
-
*
|
|
2803
|
-
* requires one edit.
|
|
2796
|
+
* PRIVATE connection. Substring-matched in `updateAcl` and in the sibling
|
|
2797
|
+
* `connectedAccounts.link()` / `session.authorize()` call sites — kept as
|
|
2798
|
+
* a single constant so a server-side message tweak only requires one edit.
|
|
2804
2799
|
*/
|
|
2805
2800
|
const ACL_ONLY_FOR_SHARED_ERROR_FRAGMENT = "acl_config_for_shared is only valid on SHARED";
|
|
2806
2801
|
/**
|
|
@@ -2832,10 +2827,21 @@ function serializeExperimentalForWire(experimental) {
|
|
|
2832
2827
|
return wire;
|
|
2833
2828
|
}
|
|
2834
2829
|
/**
|
|
2835
|
-
* `composio.experimental` namespace.
|
|
2836
|
-
*
|
|
2837
|
-
*
|
|
2830
|
+
* `composio.experimental` namespace. Keeps compatibility aliases for
|
|
2831
|
+
* experimental surfaces while domain-specific mounts graduate. **Shape may
|
|
2832
|
+
* change in future releases.**
|
|
2838
2833
|
*/
|
|
2834
|
+
async function updateConnectedAccountAcl(client, nanoid, params) {
|
|
2835
|
+
const parsedParams = UpdateConnectedAccountAclParamsSchema.safeParse(params);
|
|
2836
|
+
if (!parsedParams.success) throw new ValidationError("Failed to parse connected account ACL update params", { cause: parsedParams.error });
|
|
2837
|
+
const body = { experimental: { acl_config_for_shared: serializeAclConfigForWire(parsedParams.data) } };
|
|
2838
|
+
try {
|
|
2839
|
+
return await client.connectedAccounts.patch(nanoid, body);
|
|
2840
|
+
} catch (error) {
|
|
2841
|
+
if (error instanceof BadRequestError && typeof error.message === "string" && error.message.includes("acl_config_for_shared is only valid on SHARED")) throw new ComposioAclOnlyForSharedError(error.message, { cause: error });
|
|
2842
|
+
throw error;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2839
2845
|
var Experimental = class {
|
|
2840
2846
|
client;
|
|
2841
2847
|
constructor(client) {
|
|
@@ -2843,6 +2849,7 @@ var Experimental = class {
|
|
|
2843
2849
|
telemetry.instrument(this, "Experimental");
|
|
2844
2850
|
}
|
|
2845
2851
|
/**
|
|
2852
|
+
* Compatibility alias for `composio.connectedAccounts.updateAcl(...)`.
|
|
2846
2853
|
* Update the per-user ACL on a SHARED connected account.
|
|
2847
2854
|
* **Experimental — shape may change in future releases.**
|
|
2848
2855
|
*
|
|
@@ -2867,21 +2874,21 @@ var Experimental = class {
|
|
|
2867
2874
|
* const composio = new Composio({ apiKey: '...' });
|
|
2868
2875
|
*
|
|
2869
2876
|
* // Allow every userId to use this connection
|
|
2870
|
-
* await composio.
|
|
2877
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', { allowAllUsers: true });
|
|
2871
2878
|
*
|
|
2872
2879
|
* // Everyone except a specific user
|
|
2873
|
-
* await composio.
|
|
2880
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', {
|
|
2874
2881
|
* allowAllUsers: true,
|
|
2875
2882
|
* notAllowedUserIds: ['user_bob'],
|
|
2876
2883
|
* });
|
|
2877
2884
|
*
|
|
2878
2885
|
* // Targeted allow
|
|
2879
|
-
* await composio.
|
|
2886
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', {
|
|
2880
2887
|
* allowedUserIds: ['user_alice', 'user_bob'],
|
|
2881
2888
|
* });
|
|
2882
2889
|
*
|
|
2883
2890
|
* // Revoke a previously-granted allow list (back to deny-by-default)
|
|
2884
|
-
* await composio.
|
|
2891
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', { allowedUserIds: [] });
|
|
2885
2892
|
* ```
|
|
2886
2893
|
*
|
|
2887
2894
|
* **Empty-array semantics — read carefully.** Passing `[]` for either
|
|
@@ -2897,17 +2904,11 @@ var Experimental = class {
|
|
|
2897
2904
|
* the updated ACL block, call
|
|
2898
2905
|
* `composio.connectedAccounts.get(nanoid)` after the promise
|
|
2899
2906
|
* resolves and inspect `account.experimental?.aclConfigForShared`.
|
|
2907
|
+
*
|
|
2908
|
+
* @deprecated Use `composio.connectedAccounts.updateAcl(...)` instead — ACL updates graduated onto the `connectedAccounts` mount. This experimental alias is kept only for backwards compatibility and will be removed once the API graduates. Prefer the `connectedAccounts` mount; do not generate new code against this alias.
|
|
2900
2909
|
*/
|
|
2901
2910
|
async updateAcl(nanoid, params) {
|
|
2902
|
-
|
|
2903
|
-
if (!parsedParams.success) throw new ValidationError("Failed to parse connected account ACL update params", { cause: parsedParams.error });
|
|
2904
|
-
const body = { experimental: { acl_config_for_shared: serializeAclConfigForWire(parsedParams.data) } };
|
|
2905
|
-
try {
|
|
2906
|
-
return await this.client.connectedAccounts.patch(nanoid, body);
|
|
2907
|
-
} catch (error) {
|
|
2908
|
-
if (error instanceof BadRequestError && typeof error.message === "string" && error.message.includes("acl_config_for_shared is only valid on SHARED")) throw new ComposioAclOnlyForSharedError(error.message, { cause: error });
|
|
2909
|
-
throw error;
|
|
2910
|
-
}
|
|
2911
|
+
return updateConnectedAccountAcl(this.client, nanoid, params);
|
|
2911
2912
|
}
|
|
2912
2913
|
};
|
|
2913
2914
|
|
|
@@ -3088,7 +3089,7 @@ var ConnectedAccounts = class {
|
|
|
3088
3089
|
*
|
|
3089
3090
|
* @param userId {string} - The external user ID to create the connected account for.
|
|
3090
3091
|
* @param authConfigId {string} - The auth config ID to create the connected account for.
|
|
3091
|
-
* @param options {
|
|
3092
|
+
* @param options {CreateConnectedAccountLinkOptions} - Options for creating a new connected account link.
|
|
3092
3093
|
* @param options.callbackUrl {string} - The url to redirect the user to post connecting their account.
|
|
3093
3094
|
* @returns {ConnectionRequest} Connection request object
|
|
3094
3095
|
*
|
|
@@ -3119,14 +3120,14 @@ var ConnectedAccounts = class {
|
|
|
3119
3120
|
async link(userId, authConfigId, options, requestOptions) {
|
|
3120
3121
|
const parsedLinkOptions = CreateConnectedAccountLinkOptionsSchema.safeParse(options || {});
|
|
3121
3122
|
if (!parsedLinkOptions.success) throw new ValidationError("Failed to parse create connected account link options", { cause: parsedLinkOptions.error });
|
|
3123
|
+
const opts = parsedLinkOptions.data;
|
|
3122
3124
|
const existing = await this.list({
|
|
3123
3125
|
userIds: [userId],
|
|
3124
3126
|
authConfigIds: [authConfigId],
|
|
3125
3127
|
statuses: [ConnectedAccountStatuses.ACTIVE]
|
|
3126
3128
|
}, requestOptions);
|
|
3127
|
-
if (existing.items.length > 0 && !
|
|
3129
|
+
if (existing.items.length > 0 && !opts.allowMultiple) throw new ComposioMultipleConnectedAccountsError(`Multiple connected accounts found for user ${userId} in auth config ${authConfigId}. Please use the allowMultiple option to allow multiple connected accounts.`);
|
|
3128
3130
|
else if (existing.items.length > 0) logger.warn(`[Warn:AllowMultiple] Multiple connected accounts found for user ${userId} in auth config ${authConfigId}`);
|
|
3129
|
-
const opts = parsedLinkOptions.data;
|
|
3130
3131
|
const experimentalWire = serializeExperimentalForWire(opts.experimental);
|
|
3131
3132
|
const body = {
|
|
3132
3133
|
auth_config_id: authConfigId,
|
|
@@ -3297,10 +3298,42 @@ var ConnectedAccounts = class {
|
|
|
3297
3298
|
return withCancellation(() => this.client.connectedAccounts.updateStatus(nanoid, { enabled: false }, requestOptions), requestOptions?.signal);
|
|
3298
3299
|
}
|
|
3299
3300
|
/**
|
|
3301
|
+
* Update the per-user ACL on a SHARED connected account.
|
|
3302
|
+
* **Experimental — shape may change in future releases.**
|
|
3303
|
+
*
|
|
3304
|
+
* Only meaningful for SHARED connections — calling this on a PRIVATE
|
|
3305
|
+
* connection raises `ComposioAclOnlyForSharedError` (400). ACL writes
|
|
3306
|
+
* require the connection's creator or an API key.
|
|
3307
|
+
*
|
|
3308
|
+
* PATCH semantics: omit a field to leave it unchanged; pass an empty
|
|
3309
|
+
* array to clear an allow/deny list. At least one field must be
|
|
3310
|
+
* provided.
|
|
3311
|
+
*
|
|
3312
|
+
* @param {string} nanoid - The unique identifier of the connected account
|
|
3313
|
+
* @param {UpdateConnectedAccountAclParams} params - The ACL fields to patch
|
|
3314
|
+
* @returns {Promise<ConnectedAccountPatchResponse>} The PATCH response
|
|
3315
|
+
*
|
|
3316
|
+
* @example
|
|
3317
|
+
* ```typescript
|
|
3318
|
+
* // Allow every userId to use this SHARED connection
|
|
3319
|
+
* await composio.connectedAccounts.updateAcl('ca_abc123', { allowAllUsers: true });
|
|
3320
|
+
*
|
|
3321
|
+
* // Targeted allow list
|
|
3322
|
+
* await composio.connectedAccounts.updateAcl('ca_abc123', {
|
|
3323
|
+
* allowedUserIds: ['user_alice', 'user_bob'],
|
|
3324
|
+
* });
|
|
3325
|
+
*
|
|
3326
|
+
* // Clear the allow list (back to deny-by-default unless allowAllUsers is true)
|
|
3327
|
+
* await composio.connectedAccounts.updateAcl('ca_abc123', { allowedUserIds: [] });
|
|
3328
|
+
* ```
|
|
3329
|
+
*/
|
|
3330
|
+
async updateAcl(nanoid, params) {
|
|
3331
|
+
return updateConnectedAccountAcl(this.client, nanoid, params);
|
|
3332
|
+
}
|
|
3333
|
+
/**
|
|
3300
3334
|
* Enable or disable a connected account. Accepts `{ enabled: boolean }`.
|
|
3301
3335
|
*
|
|
3302
|
-
*
|
|
3303
|
-
* `composio.experimental.updateAcl()`.
|
|
3336
|
+
* Use `updateAcl()` for ACL writes on SHARED connections.
|
|
3304
3337
|
*
|
|
3305
3338
|
* @param {string} nanoid - The unique identifier of the connected account
|
|
3306
3339
|
* @param {UpdateConnectedAccountParams} params - The update parameters
|
|
@@ -3722,6 +3755,19 @@ const WebhookVersions = {
|
|
|
3722
3755
|
V2: "V2",
|
|
3723
3756
|
V3: "V3"
|
|
3724
3757
|
};
|
|
3758
|
+
const DefaultWebhookSubscriptionEvents = ["composio.trigger.message"];
|
|
3759
|
+
const SetWebhookSubscriptionParamsSchema = z.object({
|
|
3760
|
+
/** HTTPS URL to receive webhook events. */
|
|
3761
|
+
webhookUrl: z.string().min(1),
|
|
3762
|
+
/** Event types to subscribe to. Defaults to trigger messages. */
|
|
3763
|
+
enabledEvents: z.array(z.string()).min(1).optional(),
|
|
3764
|
+
/** Webhook payload version. Defaults to V3. */
|
|
3765
|
+
version: z.enum([
|
|
3766
|
+
"V1",
|
|
3767
|
+
"V2",
|
|
3768
|
+
"V3"
|
|
3769
|
+
]).optional()
|
|
3770
|
+
});
|
|
3725
3771
|
/**
|
|
3726
3772
|
* Parameters for verifying a webhook signature
|
|
3727
3773
|
*/
|
|
@@ -4069,6 +4115,67 @@ const toStringOrDefault = (value, defaultValue) => {
|
|
|
4069
4115
|
const str = String(value);
|
|
4070
4116
|
return str.length > 0 ? str : defaultValue;
|
|
4071
4117
|
};
|
|
4118
|
+
const WEBHOOK_SUBSCRIPTIONS_PATH = "/api/v3.1/webhook_subscriptions";
|
|
4119
|
+
const asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
4120
|
+
const firstString = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
|
|
4121
|
+
const stringArray = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
4122
|
+
const transformWebhookSubscription = (subscription) => {
|
|
4123
|
+
const raw = asRecord(subscription);
|
|
4124
|
+
return {
|
|
4125
|
+
id: firstString(raw.id) ?? "",
|
|
4126
|
+
webhookUrl: firstString(raw.webhook_url) ?? firstString(raw.webhookUrl) ?? "",
|
|
4127
|
+
version: firstString(raw.version) ?? WebhookVersions.V3,
|
|
4128
|
+
enabledEvents: stringArray(raw.enabled_events).length ? stringArray(raw.enabled_events) : stringArray(raw.enabledEvents),
|
|
4129
|
+
secret: firstString(raw.secret),
|
|
4130
|
+
createdAt: firstString(raw.created_at) ?? firstString(raw.createdAt),
|
|
4131
|
+
updatedAt: firstString(raw.updated_at) ?? firstString(raw.updatedAt)
|
|
4132
|
+
};
|
|
4133
|
+
};
|
|
4134
|
+
const firstWebhookSubscriptionId = (response) => {
|
|
4135
|
+
return firstString(asRecord(Array.isArray(response.items) ? response.items[0] : void 0).id);
|
|
4136
|
+
};
|
|
4137
|
+
/**
|
|
4138
|
+
* The signature header names Composio sends with every webhook delivery.
|
|
4139
|
+
* @private
|
|
4140
|
+
*/
|
|
4141
|
+
const WEBHOOK_HEADERS = {
|
|
4142
|
+
id: "webhook-id",
|
|
4143
|
+
timestamp: "webhook-timestamp",
|
|
4144
|
+
signature: "webhook-signature"
|
|
4145
|
+
};
|
|
4146
|
+
/**
|
|
4147
|
+
* Returns true if the value is a Fetch API `Request`.
|
|
4148
|
+
* @private
|
|
4149
|
+
*/
|
|
4150
|
+
const isFetchRequest = (request) => typeof Request !== "undefined" && request instanceof Request;
|
|
4151
|
+
/**
|
|
4152
|
+
* Reads a single header value case-insensitively from either a `Headers`
|
|
4153
|
+
* instance or a plain record (where values may be `string | string[]`).
|
|
4154
|
+
* Returns `undefined` when the header is missing.
|
|
4155
|
+
* @private
|
|
4156
|
+
*/
|
|
4157
|
+
const getHeader = (headers, name) => {
|
|
4158
|
+
if (typeof Headers !== "undefined" && headers instanceof Headers) return headers.get(name) ?? void 0;
|
|
4159
|
+
if (headers === null || typeof headers !== "object") return;
|
|
4160
|
+
const target = name.toLowerCase();
|
|
4161
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
4162
|
+
if (key.toLowerCase() !== target) continue;
|
|
4163
|
+
if (Array.isArray(value)) return value.find((item) => typeof item === "string");
|
|
4164
|
+
return typeof value === "string" ? value : void 0;
|
|
4165
|
+
}
|
|
4166
|
+
};
|
|
4167
|
+
/**
|
|
4168
|
+
* Coerces an object request body (string, Buffer/Uint8Array, or already-parsed
|
|
4169
|
+
* value) into the raw string form expected by signature verification.
|
|
4170
|
+
* @private
|
|
4171
|
+
*/
|
|
4172
|
+
const bodyToString = (body) => {
|
|
4173
|
+
if (typeof body === "string") return body;
|
|
4174
|
+
if (body instanceof Uint8Array) return new TextDecoder().decode(body);
|
|
4175
|
+
if (body === null || body === void 0) return "";
|
|
4176
|
+
if (typeof body === "object") return JSON.stringify(body);
|
|
4177
|
+
return String(body);
|
|
4178
|
+
};
|
|
4072
4179
|
/**
|
|
4073
4180
|
* Trigger (Instance) class
|
|
4074
4181
|
* /api/v3/trigger_instances
|
|
@@ -4085,6 +4192,30 @@ var Triggers = class {
|
|
|
4085
4192
|
telemetry.instrument(this, "Triggers");
|
|
4086
4193
|
}
|
|
4087
4194
|
/**
|
|
4195
|
+
* Create or update the project webhook subscription used for webhook delivery.
|
|
4196
|
+
*
|
|
4197
|
+
* If a subscription already exists, the first subscription is updated. Otherwise a new
|
|
4198
|
+
* subscription is created. By default this subscribes to V3 trigger message events.
|
|
4199
|
+
*
|
|
4200
|
+
* @example
|
|
4201
|
+
* ```ts
|
|
4202
|
+
* await composio.triggers.setWebhookSubscription({
|
|
4203
|
+
* webhookUrl: `${APP_URL}/webhooks/composio`,
|
|
4204
|
+
* });
|
|
4205
|
+
* ```
|
|
4206
|
+
*/
|
|
4207
|
+
async setWebhookSubscription(params) {
|
|
4208
|
+
const parsedParams = SetWebhookSubscriptionParamsSchema.safeParse(params);
|
|
4209
|
+
if (!parsedParams.success) throw new ValidationError(`Invalid parameters passed to set webhook subscription`, { cause: parsedParams.error });
|
|
4210
|
+
const body = {
|
|
4211
|
+
webhook_url: parsedParams.data.webhookUrl,
|
|
4212
|
+
enabled_events: parsedParams.data.enabledEvents ?? [...DefaultWebhookSubscriptionEvents],
|
|
4213
|
+
version: parsedParams.data.version ?? WebhookVersions.V3
|
|
4214
|
+
};
|
|
4215
|
+
const subscriptionId = firstWebhookSubscriptionId(await this.client.get(WEBHOOK_SUBSCRIPTIONS_PATH, { query: { limit: 1 } }));
|
|
4216
|
+
return transformWebhookSubscription(subscriptionId ? await this.client.patch(`${WEBHOOK_SUBSCRIPTIONS_PATH}/${encodeURIComponent(subscriptionId)}`, { body }) : await this.client.post(WEBHOOK_SUBSCRIPTIONS_PATH, { body }));
|
|
4217
|
+
}
|
|
4218
|
+
/**
|
|
4088
4219
|
* Fetch list of all the active triggers
|
|
4089
4220
|
*
|
|
4090
4221
|
* @param {TriggerInstanceListActiveParams} query - The query parameters to filter the trigger instances
|
|
@@ -4418,6 +4549,114 @@ var Triggers = class {
|
|
|
4418
4549
|
await this.pusherService.unsubscribe();
|
|
4419
4550
|
}
|
|
4420
4551
|
/**
|
|
4552
|
+
* Parse an incoming webhook HTTP request into a typed, normalized trigger payload.
|
|
4553
|
+
*
|
|
4554
|
+
* Dump the incoming request in and get back the parsed Composio trigger event.
|
|
4555
|
+
* When `verifySecret` is provided, the request signature is verified before the
|
|
4556
|
+
* payload is returned (delegating to {@link verifyWebhook}); without it, the body
|
|
4557
|
+
* is parsed without verification.
|
|
4558
|
+
*
|
|
4559
|
+
* The `request` may be either a Fetch API `Request` (Next.js App Router, Hono,
|
|
4560
|
+
* Remix) or a plain `{ body, headers }` object (Express with `express.raw`,
|
|
4561
|
+
* Next.js Pages Router `req`). The signature headers (`webhook-id`,
|
|
4562
|
+
* `webhook-timestamp`, `webhook-signature`) are read case-insensitively.
|
|
4563
|
+
*
|
|
4564
|
+
* @param {WebhookRequestLike} request - The incoming webhook HTTP request
|
|
4565
|
+
* @param {ParseWebhookOptions} [options] - Parse options
|
|
4566
|
+
* @param {string} [options.verifySecret] - Webhook secret; when set, the signature is verified
|
|
4567
|
+
* @param {number} [options.tolerance=300] - Max webhook age in seconds (only used when verifying)
|
|
4568
|
+
* @returns {Promise<VerifyWebhookResult>} The parsed (and optionally verified) webhook payload
|
|
4569
|
+
*
|
|
4570
|
+
* @throws {ValidationError} If `verifySecret` is set but the signature headers are missing
|
|
4571
|
+
* @throws {ComposioWebhookSignatureVerificationError} If signature verification fails
|
|
4572
|
+
* @throws {ComposioWebhookPayloadError} If the payload cannot be parsed
|
|
4573
|
+
*
|
|
4574
|
+
* @example
|
|
4575
|
+
* ```ts
|
|
4576
|
+
* // Express with express.raw (verify the signature)
|
|
4577
|
+
* app.post('/webhooks/composio', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
4578
|
+
* try {
|
|
4579
|
+
* const result = await composio.triggers.parse(req, {
|
|
4580
|
+
* verifySecret: process.env.COMPOSIO_WEBHOOK_SECRET,
|
|
4581
|
+
* });
|
|
4582
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
4583
|
+
* console.log('Event data:', result.payload.payload);
|
|
4584
|
+
* res.sendStatus(200);
|
|
4585
|
+
* } catch (error) {
|
|
4586
|
+
* res.sendStatus(401);
|
|
4587
|
+
* }
|
|
4588
|
+
* });
|
|
4589
|
+
*
|
|
4590
|
+
* // Express without verifying (parse only)
|
|
4591
|
+
* app.post('/webhooks/composio', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
4592
|
+
* const result = await composio.triggers.parse(req);
|
|
4593
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
4594
|
+
* res.sendStatus(200);
|
|
4595
|
+
* });
|
|
4596
|
+
* ```
|
|
4597
|
+
*
|
|
4598
|
+
* @example
|
|
4599
|
+
* ```ts
|
|
4600
|
+
* // Next.js App Router (Request) — verify the signature
|
|
4601
|
+
* export async function POST(request: Request) {
|
|
4602
|
+
* try {
|
|
4603
|
+
* const result = await composio.triggers.parse(request, {
|
|
4604
|
+
* verifySecret: process.env.COMPOSIO_WEBHOOK_SECRET,
|
|
4605
|
+
* });
|
|
4606
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
4607
|
+
* console.log('Event data:', result.payload.payload);
|
|
4608
|
+
* return new Response('OK', { status: 200 });
|
|
4609
|
+
* } catch (error) {
|
|
4610
|
+
* return new Response('Unauthorized', { status: 401 });
|
|
4611
|
+
* }
|
|
4612
|
+
* }
|
|
4613
|
+
*
|
|
4614
|
+
* // Next.js App Router — parse only (no verification)
|
|
4615
|
+
* export async function POST(request: Request) {
|
|
4616
|
+
* const result = await composio.triggers.parse(request);
|
|
4617
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
4618
|
+
* return new Response('OK', { status: 200 });
|
|
4619
|
+
* }
|
|
4620
|
+
* ```
|
|
4621
|
+
*/
|
|
4622
|
+
async parse(request, options) {
|
|
4623
|
+
let body;
|
|
4624
|
+
let headers;
|
|
4625
|
+
if (isFetchRequest(request)) {
|
|
4626
|
+
body = await request.text();
|
|
4627
|
+
headers = request.headers;
|
|
4628
|
+
} else {
|
|
4629
|
+
body = bodyToString(request.body);
|
|
4630
|
+
headers = request.headers;
|
|
4631
|
+
}
|
|
4632
|
+
const verifySecret = options?.verifySecret;
|
|
4633
|
+
if (options === void 0 || !("verifySecret" in options)) {
|
|
4634
|
+
const { version, rawPayload, normalizedPayload } = this.parseWebhookPayload(body);
|
|
4635
|
+
return {
|
|
4636
|
+
version,
|
|
4637
|
+
payload: normalizedPayload,
|
|
4638
|
+
rawPayload
|
|
4639
|
+
};
|
|
4640
|
+
}
|
|
4641
|
+
if (!verifySecret) throw new ValidationError("Cannot verify webhook: 'verifySecret' was provided but is empty — your COMPOSIO_WEBHOOK_SECRET is likely unset. Set the secret, or omit 'verifySecret' entirely to parse without verification.");
|
|
4642
|
+
const id = getHeader(headers, WEBHOOK_HEADERS.id);
|
|
4643
|
+
const timestamp = getHeader(headers, WEBHOOK_HEADERS.timestamp);
|
|
4644
|
+
const signature = getHeader(headers, WEBHOOK_HEADERS.signature);
|
|
4645
|
+
if (!id || !timestamp || !signature) throw new ValidationError(`Cannot verify webhook: missing signature header(s) ${[
|
|
4646
|
+
!id ? `'${WEBHOOK_HEADERS.id}'` : void 0,
|
|
4647
|
+
!timestamp ? `'${WEBHOOK_HEADERS.timestamp}'` : void 0,
|
|
4648
|
+
!signature ? `'${WEBHOOK_HEADERS.signature}'` : void 0
|
|
4649
|
+
].filter((header) => header !== void 0).join(", ")}. Pass the raw, unparsed request body and ensure the Composio signature headers (${WEBHOOK_HEADERS.id}, ${WEBHOOK_HEADERS.timestamp}, ${WEBHOOK_HEADERS.signature}) are forwarded to triggers.parse(). To parse without verifying, omit 'verifySecret'.`);
|
|
4650
|
+
return this.verifyWebhook({
|
|
4651
|
+
payload: body,
|
|
4652
|
+
signature,
|
|
4653
|
+
id,
|
|
4654
|
+
timestamp,
|
|
4655
|
+
secret: verifySecret,
|
|
4656
|
+
tolerance: options?.tolerance
|
|
4657
|
+
});
|
|
4658
|
+
}
|
|
4659
|
+
/**
|
|
4421
4660
|
* Verify an incoming webhook payload and signature.
|
|
4422
4661
|
*
|
|
4423
4662
|
* This method validates that the webhook request is authentic by:
|
|
@@ -4798,6 +5037,12 @@ function transformMCPItemResponse(response) {
|
|
|
4798
5037
|
* MCP (Model Control Protocol) class
|
|
4799
5038
|
* Handles MCP server operations.
|
|
4800
5039
|
* When `config.experimental.mcp` is enabled, this class augments the features of `composio.mcp`.
|
|
5040
|
+
*
|
|
5041
|
+
* @deprecated Use a session's MCP endpoint instead: `composio.create(userId, { mcp: true })`
|
|
5042
|
+
* returns a session that exposes `session.mcp.url` / `session.mcp.headers`. MCP is now
|
|
5043
|
+
* opt-in per session; the standalone `composio.mcp` server-management API is kept only for
|
|
5044
|
+
* backwards compatibility. Prefer the session MCP endpoint; do not generate new code against
|
|
5045
|
+
* `composio.mcp`. See https://docs.composio.dev/docs/sessions-via-mcp
|
|
4801
5046
|
*/
|
|
4802
5047
|
var MCP = class {
|
|
4803
5048
|
client;
|
|
@@ -5745,7 +5990,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
5745
5990
|
|
|
5746
5991
|
//#endregion
|
|
5747
5992
|
//#region package.json
|
|
5748
|
-
var version = "0.
|
|
5993
|
+
var version = "0.13.1";
|
|
5749
5994
|
|
|
5750
5995
|
//#endregion
|
|
5751
5996
|
//#region src/utils/session.ts
|
|
@@ -5791,7 +6036,7 @@ const getDefaultHeaders = (headers, provider) => {
|
|
|
5791
6036
|
const SessionPreset = { DIRECT_TOOLS: "direct_tools" };
|
|
5792
6037
|
const MCPServerTypeSchema = z$1.enum(["http", "sse"]);
|
|
5793
6038
|
/**
|
|
5794
|
-
* Sandbox compute tier for the
|
|
6039
|
+
* Sandbox compute tier for the session sandbox.
|
|
5795
6040
|
*
|
|
5796
6041
|
* | Tier | vCPU | RAM |
|
|
5797
6042
|
* | -------- | ---- | ----- |
|
|
@@ -5808,6 +6053,12 @@ const SandboxSizeSchema = z$1.enum([
|
|
|
5808
6053
|
"large",
|
|
5809
6054
|
"xlarge"
|
|
5810
6055
|
]);
|
|
6056
|
+
const ToolRouterSandboxConfigSchema = z$1.object({
|
|
6057
|
+
enable: z$1.boolean().default(true).describe("Whether to enable the sandbox entirely. Defaults to true. When set to false, no code execution tools (COMPOSIO_REMOTE_WORKBENCH, COMPOSIO_REMOTE_BASH_TOOL) are available in the session."),
|
|
6058
|
+
enableProxyExecution: z$1.boolean().optional().describe("Whether to enable proxy execution in the session sandbox"),
|
|
6059
|
+
autoOffloadThreshold: z$1.number().optional().describe("The auto offload threshold in characters for tool execution to move into the sandbox"),
|
|
6060
|
+
sandboxSize: SandboxSizeSchema.optional().describe("Sandbox compute tier. One of \"standard\" (1 vCPU / 1 GB), \"medium\" (2 vCPU / 2 GB), \"large\" (4 vCPU / 4 GB), or \"xlarge\" (8 vCPU / 8 GB). Defaults to \"standard\" server-side. Changing this on an existing session recreates the session sandbox on next access; the in-memory FS is lost, but /mnt/files/ persists.")
|
|
6061
|
+
});
|
|
5811
6062
|
const ToolRouterConfigManageConnectionsSchema = z$1.object({
|
|
5812
6063
|
enable: z$1.boolean().default(true).optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually"),
|
|
5813
6064
|
callbackUrl: z$1.string().optional().describe("The callback uri to use in the tool router session"),
|
|
@@ -5871,6 +6122,7 @@ const ToolRouterConfigToolsSchema = z$1.union([
|
|
|
5871
6122
|
});
|
|
5872
6123
|
const ToolRouterCreateSessionConfigBaseSchema = z$1.object({
|
|
5873
6124
|
sessionPreset: z$1.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."),
|
|
6125
|
+
mcp: z$1.boolean().optional().describe("When true, the returned session surfaces its hosted MCP endpoint (`session.mcp.url` / `session.mcp.headers`) in the type. 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"),
|
|
5874
6126
|
tools: z$1.record(z$1.string(), z$1.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional().describe("The tools to use in the tool router session"),
|
|
5875
6127
|
tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
|
|
5876
6128
|
toolkits: z$1.union([
|
|
@@ -5881,12 +6133,8 @@ const ToolRouterCreateSessionConfigBaseSchema = z$1.object({
|
|
|
5881
6133
|
authConfigs: z$1.record(z$1.string(), z$1.string()).describe("The auth configs to use in the tool router session. The key is the toolkit slug, the value is the auth config id.").default({}),
|
|
5882
6134
|
connectedAccounts: z$1.record(z$1.string(), z$1.union([z$1.string(), z$1.array(z$1.string())])).describe("The connected accounts to use in the tool router session. The key is the toolkit slug, the value is a connected account id or an array of ids. Only one account per toolkit is allowed when multi-account mode is disabled.").default({}),
|
|
5883
6135
|
manageConnections: z$1.union([z$1.boolean(), ToolRouterConfigManageConnectionsSchema]).optional().default(true).describe("The config for the manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually. If set to an object, you can configure the manage connections settings."),
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
enableProxyExecution: z$1.boolean().optional().describe("Whether to enable proxy execution in the tool router session"),
|
|
5887
|
-
autoOffloadThreshold: z$1.number().optional().describe("The auto offload threshold in characters for the tool execution to be moved into workbench"),
|
|
5888
|
-
sandboxSize: SandboxSizeSchema.optional().describe("Sandbox compute tier for the workbench. One of \"standard\" (1 vCPU / 1 GB), \"medium\" (2 vCPU / 2 GB), \"large\" (4 vCPU / 4 GB), or \"xlarge\" (8 vCPU / 8 GB). Defaults to \"standard\" server-side. Changing this on an existing session recreates the session's workbench sandbox on next access; the in-memory FS is lost, but /mnt/files/ persists.")
|
|
5889
|
-
}).optional().describe("The workbench config for the tool router session"),
|
|
6136
|
+
sandbox: ToolRouterSandboxConfigSchema.optional().describe("The sandbox config for this session. Prefer this over workbench."),
|
|
6137
|
+
workbench: ToolRouterSandboxConfigSchema.optional().describe("Deprecated alias for sandbox. Accepted for backwards compatibility."),
|
|
5890
6138
|
multiAccount: z$1.object({
|
|
5891
6139
|
enable: z$1.boolean().default(false).describe("When true, enables multi-account mode for this session. Defaults to false."),
|
|
5892
6140
|
maxAccountsPerToolkit: z$1.number().int().min(2).max(10).optional().describe("Maximum number of connected accounts allowed per toolkit. Defaults to 5 when multi-account is enabled."),
|
|
@@ -5898,15 +6146,22 @@ const ToolRouterCreateSessionConfigBaseSchema = z$1.object({
|
|
|
5898
6146
|
customTools: z$1.array(z$1.custom()).optional().describe("Custom tools to include in this session. Created via createCustomTool() from @composio/core/experimental."),
|
|
5899
6147
|
customToolkits: z$1.array(z$1.custom()).optional().describe("Custom toolkits to include in this session. Created via createCustomToolkit() from @composio/core/experimental.")
|
|
5900
6148
|
}).optional().describe("Experimental features configuration - not stable, may be modified or removed")
|
|
5901
|
-
}).partial().
|
|
6149
|
+
}).partial().superRefine((config, ctx) => {
|
|
6150
|
+
if (config.sandbox !== void 0 && config.workbench !== void 0) ctx.addIssue({
|
|
6151
|
+
code: z$1.ZodIssueCode.custom,
|
|
6152
|
+
message: "Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.",
|
|
6153
|
+
path: ["sandbox"]
|
|
6154
|
+
});
|
|
6155
|
+
}).describe("The config for the tool router session");
|
|
5902
6156
|
const applyDirectToolsPresetDefaults = (value) => {
|
|
5903
6157
|
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
5904
6158
|
const config = value;
|
|
5905
6159
|
if (config.sessionPreset !== SessionPreset.DIRECT_TOOLS) return value;
|
|
6160
|
+
const hasSandboxConfig = config.sandbox !== void 0 || config.workbench !== void 0;
|
|
5906
6161
|
return {
|
|
5907
6162
|
...config,
|
|
5908
6163
|
manageConnections: config.manageConnections === void 0 ? false : config.manageConnections,
|
|
5909
|
-
|
|
6164
|
+
...hasSandboxConfig ? {} : { sandbox: { enable: false } },
|
|
5910
6165
|
preload: config.preload === void 0 ? { tools: "all" } : config.preload
|
|
5911
6166
|
};
|
|
5912
6167
|
};
|
|
@@ -6049,19 +6304,25 @@ const ToolRouterUpdateSessionConfigSchema = z$1.object({
|
|
|
6049
6304
|
return out;
|
|
6050
6305
|
}).optional(),
|
|
6051
6306
|
manageConnections: z$1.union([z$1.boolean(), ToolRouterConfigManageConnectionsSchema]).nullable().optional(),
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
enableProxyExecution: z$1.boolean().optional(),
|
|
6055
|
-
autoOffloadThreshold: z$1.number().optional(),
|
|
6056
|
-
sandboxSize: SandboxSizeSchema.optional()
|
|
6057
|
-
}).nullable().optional(),
|
|
6307
|
+
sandbox: ToolRouterSandboxConfigSchema.partial().nullable().optional(),
|
|
6308
|
+
workbench: ToolRouterSandboxConfigSchema.partial().nullable().optional(),
|
|
6058
6309
|
multiAccount: z$1.object({
|
|
6059
6310
|
enable: z$1.boolean().optional(),
|
|
6060
6311
|
maxAccountsPerToolkit: z$1.number().int().min(2).max(10).optional(),
|
|
6061
6312
|
requireExplicitSelection: z$1.boolean().optional()
|
|
6062
6313
|
}).nullable().optional(),
|
|
6063
6314
|
preload: z$1.object({ tools: z$1.union([z$1.array(z$1.string()), z$1.literal("all")]).optional() }).strict().optional()
|
|
6064
|
-
}).partial()
|
|
6315
|
+
}).partial().superRefine((config, ctx) => {
|
|
6316
|
+
if (config.sandbox !== void 0 && config.workbench !== void 0) ctx.addIssue({
|
|
6317
|
+
code: z$1.ZodIssueCode.custom,
|
|
6318
|
+
message: "Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.",
|
|
6319
|
+
path: ["sandbox"]
|
|
6320
|
+
});
|
|
6321
|
+
});
|
|
6322
|
+
const ToolRouterSessionDeleteResponseSchema = z$1.object({
|
|
6323
|
+
sessionId: z$1.string(),
|
|
6324
|
+
deleted: z$1.literal(true)
|
|
6325
|
+
});
|
|
6065
6326
|
|
|
6066
6327
|
//#endregion
|
|
6067
6328
|
//#region src/lib/toolRouterParams.ts
|
|
@@ -6105,7 +6366,11 @@ const transformToolRouterManageConnectionsParams = (params) => {
|
|
|
6105
6366
|
enable_wait_for_connections: config.waitForConnections
|
|
6106
6367
|
};
|
|
6107
6368
|
};
|
|
6108
|
-
const
|
|
6369
|
+
const resolveToolRouterSandboxConfig = (config) => {
|
|
6370
|
+
if (config.sandbox !== void 0 && config.workbench !== void 0) throw new ValidationError("Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.");
|
|
6371
|
+
return config.sandbox ?? config.workbench;
|
|
6372
|
+
};
|
|
6373
|
+
const transformToolRouterSandboxParams = (params) => {
|
|
6109
6374
|
if (!params) return;
|
|
6110
6375
|
return {
|
|
6111
6376
|
enable: params.enable ?? true,
|
|
@@ -6130,10 +6395,10 @@ const transformToolRouterUpdateManageConnectionsParams = (params) => {
|
|
|
6130
6395
|
return result;
|
|
6131
6396
|
};
|
|
6132
6397
|
/**
|
|
6133
|
-
* PATCH-safe variant of
|
|
6398
|
+
* PATCH-safe variant of transformToolRouterSandboxParams.
|
|
6134
6399
|
* Does NOT apply `enable ?? true` default — only includes fields explicitly present.
|
|
6135
6400
|
*/
|
|
6136
|
-
const
|
|
6401
|
+
const transformToolRouterUpdateSandboxParams = (params) => {
|
|
6137
6402
|
const result = {};
|
|
6138
6403
|
if (params.enable !== void 0) result.enable = params.enable;
|
|
6139
6404
|
if (params.enableProxyExecution !== void 0) result.enable_proxy_execution = params.enableProxyExecution;
|
|
@@ -6169,8 +6434,9 @@ const transformToolRouterUpdateParams = (config) => {
|
|
|
6169
6434
|
}
|
|
6170
6435
|
if (config.manageConnections !== void 0) if (config.manageConnections === null) params.manage_connections = null;
|
|
6171
6436
|
else params.manage_connections = transformToolRouterUpdateManageConnectionsParams(config.manageConnections);
|
|
6172
|
-
|
|
6173
|
-
|
|
6437
|
+
const sandboxConfig = config.sandbox !== void 0 ? config.sandbox : config.workbench;
|
|
6438
|
+
if (sandboxConfig !== void 0) if (sandboxConfig === null) params.workbench = null;
|
|
6439
|
+
else params.workbench = transformToolRouterUpdateSandboxParams(sandboxConfig);
|
|
6174
6440
|
if (config.multiAccount !== void 0) if (config.multiAccount === null) params.multi_account = null;
|
|
6175
6441
|
else {
|
|
6176
6442
|
const ma = {};
|
|
@@ -6520,6 +6786,11 @@ function getExtensionFromMimeType(mimeType) {
|
|
|
6520
6786
|
|
|
6521
6787
|
//#endregion
|
|
6522
6788
|
//#region src/models/ToolRouterSessionFileMount.ts
|
|
6789
|
+
/**
|
|
6790
|
+
* File mount for a Composio session, reached via `session.experimental.files`
|
|
6791
|
+
* on a session created with `composio.sessions.create(...)`. Upload, list,
|
|
6792
|
+
* download, and delete files scoped to a single session.
|
|
6793
|
+
*/
|
|
6523
6794
|
var ToolRouterSessionFilesMount = class {
|
|
6524
6795
|
sessionId;
|
|
6525
6796
|
client;
|
|
@@ -6848,6 +7119,11 @@ function inlineCustomToolsExperimental(payload) {
|
|
|
6848
7119
|
* When `customToolsMap` is provided, `execute()` checks local tools first
|
|
6849
7120
|
* before falling back to the backend API. This allows tool A to call tool B
|
|
6850
7121
|
* via `session.execute('B', ...)` without hitting the network.
|
|
7122
|
+
*
|
|
7123
|
+
* @internal Internal implementation detail. Not exported from `@composio/core`
|
|
7124
|
+
* and not part of the public API surface — custom tools receive a
|
|
7125
|
+
* `SessionContext` instance via their execute function; they never reference
|
|
7126
|
+
* this class directly. Excluded from the generated SDK reference.
|
|
6851
7127
|
*/
|
|
6852
7128
|
var SessionContextImpl = class {
|
|
6853
7129
|
client;
|
|
@@ -6923,6 +7199,16 @@ var SessionContextImpl = class {
|
|
|
6923
7199
|
}
|
|
6924
7200
|
};
|
|
6925
7201
|
|
|
7202
|
+
//#endregion
|
|
7203
|
+
//#region src/lib/toolRouterSessionDelete.ts
|
|
7204
|
+
async function deleteToolRouterSession(client, sessionId, requestOptions) {
|
|
7205
|
+
const response = await withCancellation(() => client.delete(`/api/v3.1/tool_router/session/${encodeURIComponent(sessionId)}`, requestOptions), requestOptions?.signal);
|
|
7206
|
+
return ToolRouterSessionDeleteResponseSchema.parse({
|
|
7207
|
+
sessionId: response.session_id,
|
|
7208
|
+
deleted: response.deleted
|
|
7209
|
+
});
|
|
7210
|
+
}
|
|
7211
|
+
|
|
6926
7212
|
//#endregion
|
|
6927
7213
|
//#region src/models/ToolRouterSession.ts
|
|
6928
7214
|
const COMPOSIO_MULTI_EXECUTE_TOOL = "COMPOSIO_MULTI_EXECUTE_TOOL";
|
|
@@ -6940,15 +7226,31 @@ const AuthorizeOptionsSchema = z.object({
|
|
|
6940
7226
|
alias: z.string().optional(),
|
|
6941
7227
|
experimental: ConnectedAccountExperimentalSchema.optional()
|
|
6942
7228
|
});
|
|
7229
|
+
/**
|
|
7230
|
+
* A Composio session — the object returned by `composio.sessions.create(...)`
|
|
7231
|
+
* and `composio.sessions.use(...)` (also reachable via the top-level
|
|
7232
|
+
* `composio.create(...)` / `composio.use(...)` aliases).
|
|
7233
|
+
*
|
|
7234
|
+
* This is the canonical session surface. Use it to fetch session-scoped tools,
|
|
7235
|
+
* authorize toolkits, search, and execute tools. The public return type is
|
|
7236
|
+
* `Session` (with `mcp` surfaced, returned when `{ mcp: true }` is passed) or
|
|
7237
|
+
* `SessionWithoutMcp` (the default, with `mcp` omitted from the type); this
|
|
7238
|
+
* class is the concrete runtime form behind both.
|
|
7239
|
+
*
|
|
7240
|
+
* @see {@link Sessions} for the `composio.sessions` factory.
|
|
7241
|
+
*/
|
|
6943
7242
|
var ToolRouterSession = class {
|
|
6944
7243
|
client;
|
|
6945
7244
|
config;
|
|
6946
7245
|
customToolsMap;
|
|
6947
7246
|
userId;
|
|
6948
7247
|
sessionId;
|
|
7248
|
+
/** Hosted MCP endpoint (`session.mcp.url` / `session.mcp.headers`). Exists on every session at runtime, but only surfaced in the type when the session is created with `{ mcp: true }` (which returns `Session`); the default `SessionWithoutMcp` omits `mcp`, so MCP is an explicit opt-in. See https://docs.composio.dev/docs/sessions-via-mcp */
|
|
6949
7249
|
mcp;
|
|
6950
7250
|
experimental;
|
|
6951
7251
|
preload;
|
|
7252
|
+
/** Resolved sandbox (code-execution) config returned by the API. `enable` defaults to `true` server-side. */
|
|
7253
|
+
sandbox;
|
|
6952
7254
|
configVersion;
|
|
6953
7255
|
warnings;
|
|
6954
7256
|
preloadedCustomToolSlugs;
|
|
@@ -6968,6 +7270,7 @@ var ToolRouterSession = class {
|
|
|
6968
7270
|
files: new ToolRouterSessionFilesMount(client, sessionId)
|
|
6969
7271
|
};
|
|
6970
7272
|
this.preload = metadata?.preload ?? { tools: [] };
|
|
7273
|
+
this.sandbox = metadata?.workbench;
|
|
6971
7274
|
this.configVersion = metadata?.configVersion;
|
|
6972
7275
|
this.warnings = metadata?.warnings ?? [];
|
|
6973
7276
|
this.preloadedCustomToolSlugs = metadata?.preloadedCustomToolSlugs ?? [];
|
|
@@ -6976,6 +7279,17 @@ var ToolRouterSession = class {
|
|
|
6976
7279
|
telemetry.instrument(this, "ToolRouterSession");
|
|
6977
7280
|
}
|
|
6978
7281
|
/**
|
|
7282
|
+
* Resolved sandbox config for the session.
|
|
7283
|
+
*
|
|
7284
|
+
* @deprecated Use `session.sandbox` instead. `workbench` is a backwards-compatible alias and will be removed in a future release.
|
|
7285
|
+
*/
|
|
7286
|
+
get workbench() {
|
|
7287
|
+
return this.sandbox;
|
|
7288
|
+
}
|
|
7289
|
+
set workbench(value) {
|
|
7290
|
+
this.sandbox = value;
|
|
7291
|
+
}
|
|
7292
|
+
/**
|
|
6979
7293
|
* Get the tools available in the session, formatted for your AI framework.
|
|
6980
7294
|
* Requires a provider to be configured in the Composio constructor.
|
|
6981
7295
|
*
|
|
@@ -7247,8 +7561,18 @@ var ToolRouterSession = class {
|
|
|
7247
7561
|
const response = await withCancellation(() => this.client.toolRouter.session.patch(this.sessionId, params, requestOptions), requestOptions?.signal);
|
|
7248
7562
|
this.configVersion = response.config_version;
|
|
7249
7563
|
this.preload = response.config.preload;
|
|
7564
|
+
this.sandbox = response.config.workbench;
|
|
7250
7565
|
this.warnings = response.warnings ?? [];
|
|
7251
7566
|
}
|
|
7567
|
+
/**
|
|
7568
|
+
* Delete this session.
|
|
7569
|
+
*
|
|
7570
|
+
* Deleted sessions immediately stop being retrievable or executable. Deleting
|
|
7571
|
+
* an already-deleted session surfaces the backend 404.
|
|
7572
|
+
*/
|
|
7573
|
+
async delete(requestOptions) {
|
|
7574
|
+
return deleteToolRouterSession(this.client, this.sessionId, requestOptions);
|
|
7575
|
+
}
|
|
7252
7576
|
/** Check if this session has any custom tools bound. */
|
|
7253
7577
|
hasCustomTools() {
|
|
7254
7578
|
return (this.customToolsMap?.byFinalSlug.size ?? 0) > 0;
|
|
@@ -7360,6 +7684,7 @@ var ToolRouterSession = class {
|
|
|
7360
7684
|
function getSessionMetadata(session) {
|
|
7361
7685
|
return {
|
|
7362
7686
|
preload: session.config.preload,
|
|
7687
|
+
workbench: session.config.workbench,
|
|
7363
7688
|
configVersion: session.config_version,
|
|
7364
7689
|
warnings: "warnings" in session ? session.warnings ?? [] : []
|
|
7365
7690
|
};
|
|
@@ -7392,31 +7717,6 @@ var ToolRouter = class {
|
|
|
7392
7717
|
headers: { ...this.config?.apiKey ? { "x-api-key": this.config.apiKey } : {} }
|
|
7393
7718
|
};
|
|
7394
7719
|
}
|
|
7395
|
-
/**
|
|
7396
|
-
* Creates a new tool router session for a user.
|
|
7397
|
-
* Use `sessionPreset: SessionPreset.DIRECT_TOOLS` when all needed tools
|
|
7398
|
-
* should be exposed directly; see `ToolRouterCreateSessionConfig`.
|
|
7399
|
-
*
|
|
7400
|
-
* @param userId {string} The user id to create the session for
|
|
7401
|
-
* @param config {ToolRouterCreateSessionConfig} The config for the tool router session
|
|
7402
|
-
* @returns {Promise<Session<TToolCollection, TTool, TProvider>>} The tool router session
|
|
7403
|
-
*
|
|
7404
|
-
* @example
|
|
7405
|
-
* ```typescript
|
|
7406
|
-
* import { Composio } from '@composio/core';
|
|
7407
|
-
*
|
|
7408
|
-
* const composio = new Composio();
|
|
7409
|
-
*
|
|
7410
|
-
* const session = await composio.create('user_123', {
|
|
7411
|
-
* toolkits: ['gmail'],
|
|
7412
|
-
* manageConnections: true,
|
|
7413
|
-
* experimental: {
|
|
7414
|
-
* customTools: [myCustomTool],
|
|
7415
|
-
* customToolkits: [myToolkit],
|
|
7416
|
-
* },
|
|
7417
|
-
* });
|
|
7418
|
-
* ```
|
|
7419
|
-
*/
|
|
7420
7720
|
async create(userId, config, requestOptions) {
|
|
7421
7721
|
const routerConfig = ToolRouterCreateSessionConfigSchema.parse(config ?? {});
|
|
7422
7722
|
const isDirectToolsPreset = routerConfig.sessionPreset === SessionPreset.DIRECT_TOOLS;
|
|
@@ -7434,6 +7734,7 @@ var ToolRouter = class {
|
|
|
7434
7734
|
if (inlineCustomToolsPayload?.custom_tools) experimentalPayload.custom_tools = inlineCustomToolsPayload.custom_tools;
|
|
7435
7735
|
if (inlineCustomToolsPayload?.custom_toolkits) experimentalPayload.custom_toolkits = inlineCustomToolsPayload.custom_toolkits;
|
|
7436
7736
|
const multiAccountPayload = transformToolRouterMultiAccountParams(routerConfig.multiAccount);
|
|
7737
|
+
const sandboxPayload = transformToolRouterSandboxParams(resolveToolRouterSandboxConfig(routerConfig));
|
|
7437
7738
|
const connectedAccountsPayload = routerConfig.connectedAccounts === void 0 ? void 0 : Object.fromEntries(Object.entries(routerConfig.connectedAccounts).map(([toolkit, ids]) => [toolkit, typeof ids === "string" ? [ids] : ids]));
|
|
7438
7739
|
const payload = {
|
|
7439
7740
|
user_id: userId,
|
|
@@ -7443,7 +7744,7 @@ var ToolRouter = class {
|
|
|
7443
7744
|
tools: transformToolRouterToolsParams(routerConfig.tools),
|
|
7444
7745
|
tags: transformToolRouterTagsParams(routerConfig.tags),
|
|
7445
7746
|
manage_connections: transformToolRouterManageConnectionsParams(routerConfig.manageConnections),
|
|
7446
|
-
workbench:
|
|
7747
|
+
workbench: sandboxPayload,
|
|
7447
7748
|
multi_account: multiAccountPayload,
|
|
7448
7749
|
preload: routerConfig.preload,
|
|
7449
7750
|
...isDirectToolsPreset && {
|
|
@@ -7463,23 +7764,6 @@ var ToolRouter = class {
|
|
|
7463
7764
|
const assistivePrompt = session.experimental?.assistive_prompt;
|
|
7464
7765
|
return new ToolRouterSession(this.client, this.config, session.session_id, this.createMCPServerConfig(session.mcp), { assistivePrompt }, customToolsMap, userId, metadata);
|
|
7465
7766
|
}
|
|
7466
|
-
/**
|
|
7467
|
-
* Use an existing session
|
|
7468
|
-
* @param id {string} The id of the session to use
|
|
7469
|
-
* @returns {Promise<Session<TToolCollection, TTool, TProvider>>} The tool router session
|
|
7470
|
-
*
|
|
7471
|
-
* @example
|
|
7472
|
-
* ```typescript
|
|
7473
|
-
* import { Composio } from '@composio/core';
|
|
7474
|
-
*
|
|
7475
|
-
* const composio = new Composio();
|
|
7476
|
-
* const id = 'session_123';
|
|
7477
|
-
* const session = await composio.toolRouter.use(id);
|
|
7478
|
-
*
|
|
7479
|
-
* console.log(session.mcp.url);
|
|
7480
|
-
* console.log(session.mcp.headers);
|
|
7481
|
-
* ```
|
|
7482
|
-
*/
|
|
7483
7767
|
async use(id, options, requestOptions) {
|
|
7484
7768
|
const customTools = options?.customTools;
|
|
7485
7769
|
const customToolkits = options?.customToolkits;
|
|
@@ -7513,6 +7797,30 @@ var ToolRouter = class {
|
|
|
7513
7797
|
};
|
|
7514
7798
|
return new ToolRouterSession(this.client, this.config, session.session_id, this.createMCPServerConfig(session.mcp), void 0, customToolsMap, userId, metadata);
|
|
7515
7799
|
}
|
|
7800
|
+
/**
|
|
7801
|
+
* Delete a tool router session by ID.
|
|
7802
|
+
*
|
|
7803
|
+
* Deleted sessions immediately stop being retrievable or executable. Deleting
|
|
7804
|
+
* a missing or already-deleted session surfaces the backend 404.
|
|
7805
|
+
*/
|
|
7806
|
+
async delete(id, requestOptions) {
|
|
7807
|
+
return deleteToolRouterSession(this.client, id, requestOptions);
|
|
7808
|
+
}
|
|
7809
|
+
};
|
|
7810
|
+
|
|
7811
|
+
//#endregion
|
|
7812
|
+
//#region src/models/Sessions.ts
|
|
7813
|
+
/**
|
|
7814
|
+
* First-class API for creating and reusing Composio sessions.
|
|
7815
|
+
*
|
|
7816
|
+
* `composio.sessions.create(...)` is the canonical session creation entrypoint.
|
|
7817
|
+
* The top-level `composio.create(...)` method remains as a backwards-compatible
|
|
7818
|
+
* alias for `composio.sessions.create(...)`.
|
|
7819
|
+
*/
|
|
7820
|
+
var Sessions = class extends ToolRouter {
|
|
7821
|
+
constructor(client, config) {
|
|
7822
|
+
super(client, config);
|
|
7823
|
+
}
|
|
7516
7824
|
};
|
|
7517
7825
|
|
|
7518
7826
|
//#endregion
|
|
@@ -7551,17 +7859,33 @@ var Composio = class Composio {
|
|
|
7551
7859
|
connectedAccounts;
|
|
7552
7860
|
/**
|
|
7553
7861
|
* Experimental SDK methods whose shape may change in future releases.
|
|
7554
|
-
*
|
|
7555
|
-
*
|
|
7556
|
-
*
|
|
7862
|
+
* Prefer domain-specific mounts (for example
|
|
7863
|
+
* `composio.connectedAccounts.updateAcl(...)`) when available; this
|
|
7864
|
+
* namespace keeps compatibility aliases while APIs are experimental.
|
|
7865
|
+
* Stateless experimental factories (e.g. `experimental_createTool`) stay
|
|
7866
|
+
* at the top level.
|
|
7557
7867
|
* @experimental
|
|
7558
7868
|
*/
|
|
7559
7869
|
experimental;
|
|
7560
|
-
/**
|
|
7870
|
+
/**
|
|
7871
|
+
* Model Context Protocol server management.
|
|
7872
|
+
* @deprecated Use a session's MCP endpoint instead: `composio.create(userId, { mcp: true })`
|
|
7873
|
+
* returns a session that exposes `session.mcp.url` / `session.mcp.headers`. MCP is now opt-in
|
|
7874
|
+
* per session; this standalone server-management API is kept only for backwards compatibility.
|
|
7875
|
+
* Prefer the session MCP endpoint; do not generate new code against `composio.mcp`.
|
|
7876
|
+
* See https://docs.composio.dev/docs/sessions-via-mcp
|
|
7877
|
+
*/
|
|
7561
7878
|
mcp;
|
|
7562
7879
|
/**
|
|
7563
|
-
*
|
|
7564
|
-
*
|
|
7880
|
+
* Create and reuse Composio sessions.
|
|
7881
|
+
*
|
|
7882
|
+
* Prefer `composio.sessions.create(...)` for new code. The top-level
|
|
7883
|
+
* `composio.create(...)` method is kept as an alias.
|
|
7884
|
+
*/
|
|
7885
|
+
sessions;
|
|
7886
|
+
/**
|
|
7887
|
+
* Legacy alias for `composio.sessions`.
|
|
7888
|
+
* @deprecated Use `composio.sessions` instead — `toolRouter` was renamed to `sessions` and is kept only for backwards compatibility. Prefer `composio.sessions`; do not generate new code against `composio.toolRouter`.
|
|
7565
7889
|
*/
|
|
7566
7890
|
toolRouter;
|
|
7567
7891
|
/**
|
|
@@ -7580,7 +7904,12 @@ var Composio = class Composio {
|
|
|
7580
7904
|
* const composio = new Composio();
|
|
7581
7905
|
* const userId = 'user_123';
|
|
7582
7906
|
*
|
|
7583
|
-
* const session = await composio.create(userId, {
|
|
7907
|
+
* const session = await composio.sessions.create(userId, {
|
|
7908
|
+
* manageConnections: true,
|
|
7909
|
+
* });
|
|
7910
|
+
*
|
|
7911
|
+
* // Backwards-compatible alias:
|
|
7912
|
+
* const same = await composio.create(userId, {
|
|
7584
7913
|
* manageConnections: true,
|
|
7585
7914
|
* });
|
|
7586
7915
|
*
|
|
@@ -7679,13 +8008,14 @@ var Composio = class Composio {
|
|
|
7679
8008
|
});
|
|
7680
8009
|
this.connectedAccounts = new ConnectedAccounts(this.client);
|
|
7681
8010
|
this.experimental = new Experimental(this.client);
|
|
7682
|
-
this.
|
|
8011
|
+
this.sessions = new Sessions(this.client, this.config);
|
|
8012
|
+
this.toolRouter = this.sessions;
|
|
7683
8013
|
/**
|
|
7684
|
-
* Initialize
|
|
7685
|
-
* Properly bind the methods to maintain the correct 'this' context
|
|
8014
|
+
* Initialize session aliases.
|
|
8015
|
+
* Properly bind the methods to maintain the correct 'this' context.
|
|
7686
8016
|
*/
|
|
7687
|
-
this.create = this.
|
|
7688
|
-
this.use = this.
|
|
8017
|
+
this.create = this.sessions.create.bind(this.sessions);
|
|
8018
|
+
this.use = this.sessions.use.bind(this.sessions);
|
|
7689
8019
|
/**
|
|
7690
8020
|
* Initialize the client telemetry.
|
|
7691
8021
|
*/
|
|
@@ -7736,7 +8066,9 @@ var Composio = class Composio {
|
|
|
7736
8066
|
* The new instance inherits all configuration from the parent instance (apiKey, baseURL, provider, etc.)
|
|
7737
8067
|
* but allows you to specify custom request options that will be used for all API calls made through this session.
|
|
7738
8068
|
*
|
|
7739
|
-
* @deprecated
|
|
8069
|
+
* @deprecated Will be removed in a future version of the SDK. Instead, construct a new
|
|
8070
|
+
* instance directly with the headers you need: `new Composio({ ...existingConfig, defaultHeaders })`.
|
|
8071
|
+
* For one-off overrides, pass per-call `requestOptions` where supported.
|
|
7740
8072
|
*
|
|
7741
8073
|
* @param {MergedRequestInit} fetchOptions - Custom request options to be used for all API calls in this session.
|
|
7742
8074
|
* This follows the Fetch API RequestInit interface with additional options.
|
|
@@ -8598,4 +8930,4 @@ const ComposioMcpUpdateResponseSchema = z.object({
|
|
|
8598
8930
|
});
|
|
8599
8931
|
|
|
8600
8932
|
//#endregion
|
|
8601
|
-
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioSensitiveFilePathBlockedError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, DefaultCreateConnectedAccountParamsSchema, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, SingleConnectedAccountDetailedResponseSchema, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSession, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookTriggerPayloadV3Schema, WebhookVersions, constants_exports as constants, createConnectionRequest, dereferenceJsonSchema, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry };
|
|
8933
|
+
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioSensitiveFilePathBlockedError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookTriggerPayloadV3Schema, WebhookVersions, constants_exports as constants, createConnectionRequest, dereferenceJsonSchema, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry };
|