UNPKG

@composio/core

Version:

![Composio Banner](https://github.com/user-attachments/assets/9ba0e9c1-85a4-4b51-ae60-f9fe7992e819)

579 lines (578 loc) 40 kB
import { $ as McpUpdateResponse, $t as SessionExecuteMetaModifiers, A as MCPServer, An as ToolkitLatestVersionSchema, At as Oauth1InitiatedConnectionData, B as MCPToolkitConfig, Bt as Oauth2FailedConnectionData, C as MCPGenerateURLParams, Cn as ToolListResponseSchema, Ct as Oauth1ConnectionDataSchema, D as MCPInstanceParams, Dn as ToolSchema, Dt as Oauth1FailedConnectionDataSchema, E as MCPGetServerParamsSchema, En as ToolRetrievalOptions, Et as Oauth1FailedConnectionData, F as MCPServerSchema, Fn as ToolkitVersionSchema, Ft as Oauth2ActiveConnectionDataSchema, G as McpListResponse, Gt as Oauth2InitiatedConnectionDataSchema, H as MCPToolkitConfigsArraySchema, Ht as Oauth2InactiveConnectionData, I as MCPServerUpdateParams, In as ToolkitVersions, It as Oauth2ConnectionData, J as McpRetrieveResponseSchema, Jt as RedirectableAuthSchemeSchema, K as McpListResponseSchema, Kt as Oauth2InitiatingConnectionData, L as MCPServerUpdateParamsSchema, Ln as ToolkitVersionsSchema, Lt as Oauth2ConnectionDataSchema, M as MCPServerCreateResponseSchema, Mn as ToolkitVersion, Mt as Oauth1InitiatingConnectionData, N as MCPServerListResponse, Nn as ToolkitVersionParam, Nt as Oauth1InitiatingConnectionDataSchema, O as MCPMultiAppServer, On as Toolkit, Ot as Oauth1InactiveConnectionData, P as MCPServerListResponseSchema, Pn as ToolkitVersionParamSchema, Pt as Oauth2ActiveConnectionData, Q as McpToolkitConnectionStatus, Qt as ProviderOptions, R as MCPSingleAppServer, Rt as Oauth2ExpiredConnectionData, S as MCPCreateMethodResponse, Sn as ToolListResponse, St as Oauth1ConnectionData, T as MCPGetServerParams, Tn as ToolProxyParamsSchema, Tt as Oauth1ExpiredConnectionDataSchema, U as McpDeleteResponse, Ut as Oauth2InactiveConnectionDataSchema, V as MCPToolkitConfigSchema, Vt as Oauth2FailedConnectionDataSchema, W as McpDeleteResponseSchema, Wt as Oauth2InitiatedConnectionData, X as McpServerGetResponse, Xt as ExecuteToolModifiers, Y as McpServerCreateResponse, Yt as AgenticToolOptions, Z as McpServerUrlInfo, Zt as MetaToolArguments, _ as GenerateURLResponse, _n as ToolExecuteResponse, _t as CustomOauth1ConnectionDataSchema, a as ComposioGenerateURLParamsSchema, an as beforeExecuteMetaModifier, at as ExecuteToolFnOptions, b as MCPAuthOptions, bn as ToolListParams, bt as Oauth1ActiveConnectionData, c as ComposioMcpListResponseSchema, cn as CustomAuthParamsSchema, ct as BaseConnectionFields, d as ConnectionStatus, dn as SchemaModifierOptions, dt as ConnectionDataSchema, en as SessionMetaToolOptions, et as McpUpdateResponseSchema, f as CustomCreateResponse, fn as Tool, ft as ConnectionStatusEnum, g as GenerateURLParamsSchema, gn as ToolExecuteParamsSchema, gt as CustomOauth1ConnectionData, h as GenerateURLParams, hn as ToolExecuteParams, ht as CustomConnectionDataSchema, i as ComposioCustomCreateResponseSchema, in as afterExecuteModifier, it as ExecuteToolFn, j as MCPServerCreateResponse, jn as ToolkitSchema, jt as Oauth1InitiatedConnectionDataSchema, k as MCPMultiAppServerSchema, kn as ToolkitLatestVersion, kt as Oauth1InactiveConnectionDataSchema, l as ComposioMcpRetrieveResponseSchema, ln as JSONSchemaProperty, lt as BillcomAuthConnectionDataSchema, m as CustomCreateResponseValidated, mn as ToolExecuteMetaParamsSchema, mt as CustomConnectionData, n as BaseComposioProvider, nn as TransformToolSchemaModifier, nt as McpUrlResponseCamelCase, o as ComposioGenerateURLResponseSchema, on as beforeExecuteModifier, ot as GlobalExecuteToolFn, p as CustomCreateResponseSchema, pn as ToolExecuteMetaParams, pt as ConnectionStatuses, q as McpRetrieveResponse, qt as Oauth2InitiatingConnectionDataSchema, r as BaseNonAgenticProvider, rn as afterExecuteMetaModifier, rt as McpUserConnectionStatus, s as ComposioMcpDeleteResponseSchema, sn as CustomAuthParams, st as Provider, t as BaseAgenticProvider, tn as ToolOptions, tt as McpUrlResponse, u as ComposioMcpUpdateResponseSchema, un as JSONSchemaPropertySchema, ut as ConnectionData, v as GenerateURLResponseSchema, vn as ToolExecuteResponseSchema, vt as CustomOauth2ConnectionData, w as MCPGenerateURLParamsSchema, wn as ToolProxyParams, wt as Oauth1ExpiredConnectionData, x as MCPAuthOptionsSchema, xn as ToolListParamsSchema, xt as Oauth1ActiveConnectionDataSchema, y as GenerateURLResponseValidated, yn as ToolList, yt as CustomOauth2ConnectionDataSchema, z as MCPSingleAppServerSchema, zt as Oauth2ExpiredConnectionDataSchema } from "./BaseProvider-X7JCCvcK.cjs"; import { $ as TriggerInstanceUpsertParamsSchema, $n as InputParamsSchema, $t as ConnectedAccountAuthConfigSchema, A as ToolkitConnectionStateSchema, An as ToolkitAuthConfigDetails, At as AuthConfigListResponse, B as TriggerInstanceListActiveParams, Bn as ToolkitMangedByEnumSchema, Bt as AuthDefaultConfigUpdateParamsSchema, C as ToolRouterToolkitsOptions, Cn as DefaultCreateConnectedAccountParamsSchema, Ct as WebhookPayloadV3, D as ToolRouterToolsParam, Dn as ToolKitListResponseSchema, Dt as AuthConfigCreationToolAccessConfigSchema, E as ToolRouterToolsFn, En as ToolKitListResponse, Et as WebhookVersions, F as IncomingTriggerPayload, Fn as ToolkitAuthFieldsResponseSchema, Ft as AuthConfigType, G as TriggerInstanceListActiveResponseSchema, Gn as ToolkitSortByEnum, Gt as CreateAuthConfigParamsSchema, H as TriggerInstanceListActiveResponse, Hn as ToolkitRetrieveCategoriesResponseSchema, Ht as AuthSchemeType, I as IncomingTriggerPayloadSchema, In as ToolkitCategory, It as AuthConfigTypes, J as TriggerInstanceManageUpdateParams, Jn as CustomToolInputParameter, Jt as CreateComposioManagedAuthConfigParamsSchema, K as TriggerInstanceManageDeleteResponse, Kn as ToolkitSortByEnumSchema, Kt as CreateAuthConfigResponse, L as TriggerData, Ln as ToolkitCategorySchema, Lt as AuthConfigUpdateParams, M as ToolkitConnectionsDetailsSchema, Mn as ToolkitAuthField, Mt as AuthConfigRetrieveResponse, N as OpenAIProvider, Nn as ToolkitAuthFieldSchema, Nt as AuthConfigRetrieveResponseSchema, O as ToolRouterToolsParamSchema, On as ToolKitMeta, Ot as AuthConfigListParams, P as MCP, Pn as ToolkitAuthFieldsResponse, Pt as AuthConfigToolAccessConfigSchema, Q as TriggerInstanceUpsertParams, Qn as ExecuteMetadata, Qt as ConnectedAccountAuthConfig, R as TriggerEvent, Rn as ToolkitListParams, Rt as AuthConfigUpdateParamsSchema, S as ToolRouterToolkitsFn, Sn as CreateConnectedAccountResponseSchema, St as WebhookPayloadV2Schema, T as ToolRouterToolkitsParamSchema, Tn as ToolKitItemSchema, Tt as WebhookVersion, U as TriggerInstanceListActiveResponseItem, Un as ToolkitRetrieveResponse, Ut as AuthSchemeTypes, V as TriggerInstanceListActiveParamsSchema, Vn as ToolkitRetrieveCategoriesResponse, Vt as AuthSchemeEnum, W as TriggerInstanceListActiveResponseItemSchema, Wn as ToolkitRetrieveResponseSchema, Wt as CreateAuthConfigParams, X as TriggerInstanceManageUpdateResponse, Xn as CustomToolRegistry, Xt as ConnectionRequest, Y as TriggerInstanceManageUpdateParamsSchema, Yn as CustomToolOptions, Yt as CreateCustomAuthConfigParamsSchema, Z as TriggerInstanceManageUpdateResponseSchema, Zn as CustomToolRegistryItem, Zt as ConnectionRequestState, _ as ToolRouterSessionExperimental, _n as CreateConnectedAccountOptions, _t as WebhookPayload, a as ToolRouterAuthorizeFn, an as ConnectedAccountRefreshOptions, at as TriggerSubscribeParamSchema, b as ToolRouterToolkitsDisabledConfigSchema, bn as CreateConnectedAccountParamsSchema, bt as WebhookPayloadV1Schema, c as ToolRouterConfigTagsSchema, cn as ConnectedAccountRetrieveResponseSchema, ct as TriggerTypeSchema, d as ToolRouterCreateSessionConfig, dn as ConnectedAccountStatusSchema, dt as TriggersTypeListResponse, en as ConnectedAccountListParams, et as TriggerInstanceUpsertResponse, f as ToolRouterCreateSessionConfigSchema, fn as ConnectedAccountStatuses, ft as TriggersTypeListResponseSchema, g as ToolRouterSession, gn as CreateConnectedAccountLinkResponseSchema, gt as VerifyWebhookResult, h as ToolRouterManageConnectionsConfigSchema, hn as CreateConnectedAccountLinkResponse, ht as VerifyWebhookParamsSchema, i as MCPServerTypeSchema, in as ConnectedAccountListResponseSchema, it as TriggerStatuses, j as ToolkitConnectionsDetails, jn as ToolkitAuthConfigDetailsSchema, jt as AuthConfigListResponseSchema, k as ToolkitConnectionState, kn as ToolKitMetaSchema, kt as AuthConfigListParamsSchema, l as ToolRouterConfigTools, ln as ConnectedAccountStatus, lt as TriggersTypeListParams, m as ToolRouterMCPServerConfigSchema, mn as CreateConnectedAccountLinkOptionsSchema, mt as VerifyWebhookParams, nn as ConnectedAccountListResponse, nt as TriggerStatusEnum, o as ToolRouterConfigManageConnectionsSchema, on as ConnectedAccountRefreshOptionsSchema, ot as TriggerSubscribeParams, p as ToolRouterMCPServerConfig, pn as CreateConnectedAccountLinkOptions, pt as TriggersTypeRetrieveResponse, q as TriggerInstanceManageDeleteResponseSchema, qn as ToolkitsListParamsSchema, qt as CreateAuthConfigResponseSchema, r as MCPServerType, rn as ConnectedAccountListResponseItem, rt as TriggerStatusType, s as ToolRouterConfigTags, sn as ConnectedAccountRetrieveResponse, st as TriggerType, t as Composio, tn as ConnectedAccountListParamsSchema, tt as TriggerInstanceUpsertResponseSchema, u as ToolRouterConfigToolsSchema, un as ConnectedAccountStatusEnum, ut as TriggersTypeListParamsSchema, v as ToolRouterTagsEnableDisableSchema, vn as CreateConnectedAccountOptionsSchema, vt as WebhookPayloadSchema, w as ToolRouterToolkitsOptionsSchema, wn as ToolKitItem, wt as WebhookPayloadV3Schema, x as ToolRouterToolkitsEnabledConfigSchema, xn as CreateConnectedAccountResponse, xt as WebhookPayloadV2, y as ToolRouterTagsParamSchema, yn as CreateConnectedAccountParams, yt as WebhookPayloadV1, z as TriggerEventData, zn as ToolkitMangedByEnum, zt as AuthCustomConfigUpdateParamsSchema } from "./composio-uGEfnO6v.cjs"; import { n as FileUploadData, t as FileDownloadData } from "./files.types-nK6eTNnc.cjs"; import "node:module"; import { z } from "zod/v3"; import ComposioClient from "@composio/client"; //#region rolldown:runtime //#endregion //#region src/provider/ComposioProvider.d.ts /** * This is a default provider implementation for Composio. * This class is used as a default provider for Composio, if the user does not provide a provider. * * This class shouldn't be used directly or to be extended. */ interface CustomTool { name: string; } declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>, CustomTool> { readonly name = "ComposioProvider"; constructor(); wrapTool: (tool: Tool) => CustomTool; wrapTools(tools: Tool[]): CustomTool[]; } //#endregion //#region src/utils/jsonSchema.d.ts /** * Removes all non-required properties from the schema * * if no items are required, the schema is returned as is * @param schema - The JSON schema to remove non-required properties from * @returns The JSON schema with all non-required properties removed */ declare const removeNonRequiredProperties: <T extends { type: "object"; properties: Record<string, unknown>; required?: string[]; additionalProperties?: boolean; }>(schema: T) => T; /** * Convert a JSON schema to a Zod schema * @param jsonSchema - The JSON schema to convert * @param strict - Eliminates all non-required properties from the schema * @returns The Zod schema * * @throws {JsonSchemaToZodError} If the JSON schema is invalid * * @example * ```ts * const zodSchema = jsonSchemaToZodSchema({ * type: 'object', * properties: { * name: { type: 'string' }, * }, * }); * * console.log(zodSchema); * ``` * * @example * ```ts * const zodSchema = jsonSchemaToZodSchema({ * type: 'object', * properties: { * name: { type: 'string' }, * age: { type: 'number' }, * }, * required: ['name'], * }, { strict: true }); * * console.log(zodSchema); * * // Output: * // z.object({ * // name: z.string(), * // }) * ``` */ declare function jsonSchemaToZodSchema<T extends z.ZodTypeAny>(jsonSchema: Record<string, unknown>, { strict }?: { strict?: boolean; }): T; //#endregion //#region src/models/AuthScheme.d.ts declare class AuthScheme { /** * Creates a ConnectionData object for OAuth2 authentication * @param params The OAuth2 parameters * @returns ConnectionData object */ static OAuth2(params: BaseConnectionFields & { access_token?: string; token_type?: string; id_token?: string; refresh_token?: string; expires_in?: number; scope?: string; webhook_signature?: string; authed_user?: { access_token?: string; scope?: string; }; code_verifier?: string; redirectUrl?: string; callback_url?: string; finalRedirectUri?: string; error?: string; error_description?: string; expired_at?: string; }): ConnectionData; /** * Creates a ConnectionData object for OAuth1 authentication * @param params The OAuth1 parameters * @returns ConnectionData object */ static OAuth1(params: BaseConnectionFields & { oauth_token?: string; consumer_key?: string; redirectUrl?: string; callback_url?: string; error?: string; error_description?: string; expired_at?: string; }): ConnectionData; /** * Creates a ConnectionData object for API Key authentication * @param params The API key parameters * @returns ConnectionData object */ static APIKey(params: BaseConnectionFields & { api_key?: string; generic_api_key?: string; }): ConnectionData; /** * Creates a ConnectionData object for Basic authentication * @param params The basic auth parameters * @returns ConnectionData object */ static Basic(params: BaseConnectionFields & { username: string; password: string; }): ConnectionData; /** * Creates a ConnectionData object for Bearer Token authentication * @param params The bearer token parameters * @returns ConnectionData object */ static BearerToken(params: BaseConnectionFields & { token: string; }): ConnectionData; /** * Creates a ConnectionData object for Google Service Account authentication * @param params The Google service account parameters * @returns ConnectionData object */ static GoogleServiceAccount(params: BaseConnectionFields & { credentials_json: string; }): ConnectionData; /** * Creates a ConnectionData object for No Auth authentication * @returns ConnectionData object */ static NoAuth(params?: BaseConnectionFields): ConnectionData; /** * Creates a ConnectionData object for Basic with JWT authentication * @param params The basic with JWT parameters * @returns ConnectionData object */ static BasicWithJWT(params: BaseConnectionFields & { username: string; password: string; }): ConnectionData; /** * Creates a ConnectionData object for Cal.com authentication * @returns ConnectionData object */ static CalcomAuth(params?: BaseConnectionFields): ConnectionData; /** * Creates a ConnectionData object for Bill.com authentication * @param params The Bill.com auth parameters * @returns ConnectionData object */ static BillcomAuth(params: BaseConnectionFields & { sessionId: string; devKey: string; }): ConnectionData; } //#endregion //#region src/models/ConnectionRequest.d.ts /** * Creates a connection request object with methods to manage the connection lifecycle. * * @param {ComposioClient} client - The Composio client instance * @param {string} connectedAccountId - The ID of the connected account * @param {ConnectedAccountStatus} [status] - Initial status of the connection * @param {string | null} [redirectUrl] - OAuth redirect URL if applicable * @returns {ConnectionRequestState & { waitForConnection: (timeout?: number) => Promise<ConnectedAccountRetrieveResponse> }} * Connection request object with state and methods */ declare function createConnectionRequest(client: ComposioClient, connectedAccountId: string, status?: ConnectedAccountStatus, redirectUrl?: string | null): ConnectionRequest; declare namespace constants_d_exports { export { CLIENT_PUSHER_KEY, COMPOSIO_DIR, COMPOSIO_LOG_LEVEL, DEFAULT_BASE_URL, DEFAULT_WEB_URL, IS_DEVELOPMENT_OR_CI, TELEMETRY_URL, TEMP_FILES_DIRECTORY_NAME, USER_DATA_FILE_NAME }; } declare const COMPOSIO_DIR = ".composio"; declare const USER_DATA_FILE_NAME = "user_data.json"; declare const TEMP_FILES_DIRECTORY_NAME = "files"; declare const DEFAULT_BASE_URL = "https://backend.composio.dev"; declare const DEFAULT_WEB_URL = "https://platform.composio.dev"; declare const TELEMETRY_URL = "https://app.composio.dev"; declare const CLIENT_PUSHER_KEY: string; declare const COMPOSIO_LOG_LEVEL: "debug" | "info" | "warn" | "error" | undefined; declare const IS_DEVELOPMENT_OR_CI: string | boolean; //#endregion //#region src/utils/logger.d.ts declare const LOG_LEVELS: { readonly silent: -1; readonly error: 0; readonly warn: 1; readonly info: 2; readonly debug: 3; }; type LogLevel = keyof typeof LOG_LEVELS; interface LoggerOptions { level?: LogLevel; includeTimestamp?: boolean; } declare class Logger { private readonly level; private readonly includeTimestamp; private readonly console; constructor(options?: LoggerOptions); private formatMessage; private shouldLog; error(...args: unknown[]): void; warn(...args: unknown[]): void; info(...args: unknown[]): void; debug(...args: unknown[]): void; } declare const logger: Logger; //#endregion //#region src/errors/ComposioError.d.ts /** * Options for error handling */ interface ErrorHandleOptions { /** Whether to include the stack trace in the output */ includeStack?: boolean; /** @deprecated Use ComposioError.handleAndThrow() instead. This option will be removed in a future version. */ exitProcess?: boolean; /** @deprecated This option is no longer used. */ exitCode?: number; } /** * Options for creating a ComposioError */ type ComposioErrorOptions = { /** Error code for categorizing errors */ code?: string; /** HTTP status code associated with the error */ statusCode?: number; /** The underlying cause of the error */ cause?: unknown; /** Additional metadata associated with the error */ meta?: Record<string, unknown>; /** Suggested fixes for the error */ possibleFixes?: string[]; /** Custom stack trace */ stack?: string; }; /** * Base error class for all Composio errors */ declare class ComposioError extends Error { /** @readonly Error name */ name: string; code?: string; possibleFixes?: string[]; errorId?: string; /** * Creates a new ComposioError * @param message Error message * @param options Additional error options */ constructor(message: string, options?: ComposioErrorOptions); /** * Helper method to define a property only if it has a value * @param propertyName Name of the property to define * @param value Value to assign to the property * @private */ private definePropertyIfExists; /** * Helper method to combine stack traces when wrapping errors * This ensures the full call chain is preserved * @param originalStack The stack of the error being wrapped * @param currentStack The stack of the wrapper error * @returns Combined stack trace * @private */ private static combineStackTraces; /** * Extract and normalize error data for formatting * @param includeStack Whether to include stack trace information * @returns Structured error data for formatting * @private */ private getErrorData; /** * Prints a user-friendly, colorful representation of the error to the logger * @param includeStack Whether to include the stack trace in the output (default: false) */ prettyPrint(includeStack?: boolean): void; /** * Static factory method to create and pretty print an error in one step * @param message Error message * @param options Error options * @param includeStack Whether to include the stack trace in the output * @returns The created error instance */ static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError; /** * Utility function to handle errors in a consistent way * This properly displays the error without throwing * @param error The error to handle * @param options Options for error handling */ static handle(error: unknown, options?: ErrorHandleOptions): void; /** * Utility function to handle errors and then throw them * This properly displays the error and then throws it, allowing callers to catch it. * Use this for fatal errors that should stop execution. * @param error The error to handle and throw * @param includeStack Whether to include the stack trace in the output * @throws ComposioError - Always throws after displaying the error */ static handleAndThrow(error: unknown, includeStack?: boolean): never; /** * Helper method to throw an error as a ComposioError * @param error The error to throw * @private */ private static throwError; /** * Helper method to handle Zod validation errors * @param error The Zod error to handle * @param includeStack Whether to include the stack trace * @private */ private static handleZodError; /** * Helper method to handle standard Error objects * @param error The standard error to handle * @param includeStack Whether to include the stack trace * @private */ private static handleStandardError; /** * Helper method to handle unknown error types * @param error The unknown error value * @private */ private static handleUnknownError; } //#endregion //#region src/errors/AuthConfigErrors.d.ts declare const AuthConfigErrorCodes: { readonly AUTH_CONFIG_NOT_FOUND: "AUTH_CONFIG_NOT_FOUND"; }; declare class ComposioAuthConfigNotFoundError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } //#endregion //#region src/errors/ConnectedAccountsErrors.d.ts declare const ConnectedAccountErrorCodes: { readonly CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND"; readonly MULTIPLE_CONNECTED_ACCOUNTS: "MULTIPLE_CONNECTED_ACCOUNTS"; readonly FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK: "FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK"; }; declare class ComposioConnectedAccountNotFoundError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } declare class ComposioMultipleConnectedAccountsError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioFailedToCreateConnectedAccountLink extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } //#endregion //#region src/errors/ConnectionRequestErrors.d.ts declare const ConnectionRequestErrorCodes: { readonly CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT"; readonly CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED"; }; declare class ConnectionRequestTimeoutError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ConnectionRequestFailedError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } //#endregion //#region src/errors/ToolErrors.d.ts declare const ToolErrorCodes: { readonly TOOLSET_NOT_DEFINED: "TOOLSET_NOT_DEFINED"; readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND"; readonly INVALID_MODIFIER: "INVALID_MODIFIER"; readonly CUSTOM_TOOLS_NOT_INITIALIZED: "CUSTOM_TOOLS_NOT_INITIALIZED"; readonly TOOL_EXECUTION_ERROR: "TOOL_EXECUTION_ERROR"; readonly INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION"; readonly GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET"; readonly TOOL_VERSION_REQUIRED: "TOOL_VERSION_REQUIRED"; }; declare class ComposioProviderNotDefinedError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioToolNotFoundError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } declare class ComposioInvalidModifierError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioCustomToolsNotInitializedError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioToolExecutionError extends ComposioError { constructor(message?: string, options?: ComposioErrorOptions); } declare class ComposioInvalidExecuteFunctionError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioGlobalExecuteToolFnNotSetError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } /** * Error thrown when toolkit version is not specified for manual tool execution. * * This error is thrown when attempting to execute a tool manually (via `tools.execute()`) * and the resolved version is "latest" without `dangerouslySkipVersionCheck` set to true. * * **Why this error exists:** * Using "latest" version in manual execution can lead to unexpected behavior when new * toolkit versions are released, potentially breaking your application. For production * use, it's recommended to pin specific toolkit versions. * * **How to fix:** * 1. Specify a concrete version in the execute call * 2. Configure toolkit versions at SDK initialization * 3. Set toolkit version via environment variable * 4. Use dangerouslySkipVersionCheck (not recommended for production) * * @example ❌ This will throw ComposioToolVersionRequiredError if toolkitVersions is 'latest' * ```typescript * await composio.tools.execute('GITHUB_GET_REPOS', { * userId: 'default', * arguments: { owner: 'composio' } * }); * ``` * * @example ✅ Fix 1: Pass specific version in execute call * ```typescript * await composio.tools.execute('GITHUB_GET_REPOS', { * userId: 'default', * version: '20250909_00', * arguments: { owner: 'composio' } * }); * ``` * * @example ✅ Fix 2: Configure toolkit versions at SDK level * ```typescript * const composio = new Composio({ * toolkitVersions: { github: '20250909_00' } * }); * await composio.tools.execute('GITHUB_GET_REPOS', { * userId: 'default', * arguments: { owner: 'composio' } * }); * ``` * * @example ✅ Fix 3: Use environment variable * ```typescript * // Set: COMPOSIO_TOOLKIT_VERSION_GITHUB=20250909_00 * await composio.tools.execute('GITHUB_GET_REPOS', { * userId: 'default', * arguments: { owner: 'composio' } * }); * ``` * * @example ⚠️ Fix 4: Skip version check (not recommended for production) * ```typescript * await composio.tools.execute('GITHUB_GET_REPOS', { * userId: 'default', * dangerouslySkipVersionCheck: true, * arguments: { owner: 'composio' } * }); * ``` */ declare class ComposioToolVersionRequiredError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } interface ComposioAPIServerErrorBody { error: { message: string; code: number; status: number; request_id: string; suggested_fix: string; }; } declare const handleToolExecutionError: (tool: string, actualError: Error) => ComposioError; //#endregion //#region src/errors/ToolkitErrors.d.ts declare const ToolkitErrorCodes: { readonly TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND"; }; declare class ComposioToolkitNotFoundError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } declare class ComposioToolkitFetchError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } //#endregion //#region src/errors/ValidationErrors.d.ts /** * Represents an input validation error using Zod. */ declare const ValidationErrorCodes: { readonly VALIDATION_ERROR: "VALIDATION_ERROR"; readonly JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR"; }; declare class ValidationError extends ComposioError { constructor(message?: string, options?: ComposioErrorOptions); private generateUserFriendlyMessage; } declare class JsonSchemaToZodError extends ComposioError { constructor(message?: string, options?: ComposioErrorOptions); } //#endregion //#region src/errors/SDKErrors.d.ts declare const SDKErrorCodes: { NO_API_KEY_PROVIDED: string; }; declare class ComposioNoAPIKeyError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } //#endregion //#region src/errors/TriggerErrors.d.ts declare const TriggerErrorCodes: { readonly TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS: "TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS"; readonly TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT: "TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT"; readonly TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL"; readonly TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL"; readonly TRIGGER_TYPE_NOT_FOUND: "TRIGGER_TYPE_NOT_FOUND"; readonly WEBHOOK_SIGNATURE_VERIFICATION_FAILED: "WEBHOOK_SIGNATURE_VERIFICATION_FAILED"; readonly WEBHOOK_PAYLOAD_INVALID: "WEBHOOK_PAYLOAD_INVALID"; }; declare class ComposioFailedToGetSDKRealtimeCredentialsError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioFailedToCreatePusherClientError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioFailedToSubscribeToPusherChannelError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioFailedToUnsubscribeFromPusherChannelError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>); } declare class ComposioTriggerTypeNotFoundError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } declare class ComposioWebhookSignatureVerificationError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } declare class ComposioWebhookPayloadError extends ComposioError { constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>); } //#endregion export { AgenticToolOptions, AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParams, AuthConfigListParamsSchema, AuthConfigListResponse, AuthConfigListResponseSchema, AuthConfigRetrieveResponse, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigType, AuthConfigTypes, AuthConfigUpdateParams, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseConnectionFields, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIServerErrorBody, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioCustomToolsNotInitializedError, ComposioError, ComposioErrorOptions, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAuthConfig, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountListParams, ConnectedAccountListParamsSchema, ConnectedAccountListResponse, ConnectedAccountListResponseItem, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptions, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponse, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatus, ConnectedAccountStatusEnum, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectionData, ConnectionDataSchema, ConnectionRequest, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestState, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatusEnum, ConnectionStatuses, CreateAuthConfigParams, CreateAuthConfigParamsSchema, CreateAuthConfigResponse, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptions, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponse, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptions, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParams, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponse, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CustomAuthParams, CustomAuthParamsSchema, CustomConnectionData, CustomConnectionDataSchema, CustomCreateResponse, CustomCreateResponseSchema, CustomCreateResponseValidated, CustomOauth1ConnectionData, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionData, CustomOauth2ConnectionDataSchema, CustomToolInputParameter, CustomToolOptions, CustomToolRegistry, CustomToolRegistryItem, DefaultCreateConnectedAccountParamsSchema, ErrorHandleOptions, ExecuteMetadata, ExecuteToolFn, ExecuteToolFnOptions, ExecuteToolModifiers, FileDownloadData, FileUploadData, GenerateURLParams, GenerateURLParamsSchema, GenerateURLResponse, GenerateURLResponseSchema, GenerateURLResponseValidated, GlobalExecuteToolFn, IncomingTriggerPayload, IncomingTriggerPayloadSchema, InputParamsSchema, JSONSchemaProperty, JSONSchemaPropertySchema, JsonSchemaToZodError, MCP, MCPAuthOptions, MCPAuthOptionsSchema, MCPCreateMethodResponse, MCPGenerateURLParams, MCPGenerateURLParamsSchema, MCPGetServerParams, MCPGetServerParamsSchema, MCPInstanceParams, MCPMultiAppServer, MCPMultiAppServerSchema, MCPServer, MCPServerCreateResponse, MCPServerCreateResponseSchema, MCPServerListResponse, MCPServerListResponseSchema, MCPServerSchema, MCPServerType, MCPServerTypeSchema, MCPServerUpdateParams, MCPServerUpdateParamsSchema, MCPSingleAppServer, MCPSingleAppServerSchema, MCPToolkitConfig, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponse, McpDeleteResponseSchema, McpListResponse, McpListResponseSchema, McpRetrieveResponse, McpRetrieveResponseSchema, McpServerCreateResponse, McpServerGetResponse, McpServerUrlInfo, McpToolkitConnectionStatus, McpUpdateResponse, McpUpdateResponseSchema, McpUrlResponse, McpUrlResponseCamelCase, McpUserConnectionStatus, MetaToolArguments, Oauth1ActiveConnectionData, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionData, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionData, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionData, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionData, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionData, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionData, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionData, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionData, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionData, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionData, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionData, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionData, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionData, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, Provider, ProviderOptions, RedirectableAuthSchemeSchema, SDKErrorCodes, SchemaModifierOptions, SessionExecuteMetaModifiers, SessionMetaToolOptions, Tool, ToolErrorCodes, ToolExecuteMetaParams, ToolExecuteMetaParamsSchema, ToolExecuteParams, ToolExecuteParamsSchema, ToolExecuteResponse, ToolExecuteResponseSchema, ToolKitItem, ToolKitItemSchema, ToolKitListResponse, ToolKitListResponseSchema, ToolKitMeta, ToolKitMetaSchema, ToolList, ToolListParams, ToolListParamsSchema, ToolListResponse, ToolListResponseSchema, ToolOptions, ToolProxyParams, ToolProxyParamsSchema, ToolRetrievalOptions, ToolRouterAuthorizeFn, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTags, ToolRouterConfigTagsSchema, ToolRouterConfigTools, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfig, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfig, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSession, ToolRouterSessionExperimental, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsFn, ToolRouterToolkitsOptions, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsFn, ToolRouterToolsParam, ToolRouterToolsParamSchema, ToolSchema, Toolkit, ToolkitAuthConfigDetails, ToolkitAuthConfigDetailsSchema, ToolkitAuthField, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponse, ToolkitAuthFieldsResponseSchema, ToolkitCategory, ToolkitCategorySchema, ToolkitConnectionState, ToolkitConnectionStateSchema, ToolkitConnectionsDetails, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersion, ToolkitLatestVersionSchema, ToolkitListParams, ToolkitMangedByEnum, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponse, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponse, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnum, ToolkitSortByEnumSchema, ToolkitVersion, ToolkitVersionParam, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersions, ToolkitVersionsSchema, ToolkitsListParamsSchema, TransformToolSchemaModifier, TriggerData, TriggerErrorCodes, TriggerEvent, TriggerEventData, TriggerInstanceListActiveParams, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponse, TriggerInstanceListActiveResponseItem, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponse, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParams, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponse, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParams, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponse, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatusType, TriggerStatuses, TriggerSubscribeParamSchema, TriggerSubscribeParams, TriggerType, TriggerTypeSchema, TriggersTypeListParams, TriggersTypeListParamsSchema, TriggersTypeListResponse, TriggersTypeListResponseSchema, TriggersTypeRetrieveResponse, ValidationError, ValidationErrorCodes, VerifyWebhookParams, VerifyWebhookParamsSchema, VerifyWebhookResult, WebhookPayload, WebhookPayloadSchema, WebhookPayloadV1, WebhookPayloadV1Schema, WebhookPayloadV2, WebhookPayloadV2Schema, WebhookPayloadV3, WebhookPayloadV3Schema, WebhookVersion, WebhookVersions, afterExecuteMetaModifier, afterExecuteModifier, beforeExecuteMetaModifier, beforeExecuteModifier, constants_d_exports as constants, createConnectionRequest, handleToolExecutionError, jsonSchemaToZodSchema, logger, removeNonRequiredProperties };