@composio/core 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CustomTool-Bz0f52QR.mjs → CustomTool-BMlZfJVz.mjs} +1 -1
- package/dist/{CustomTool-VRfWzMix.d.mts → CustomTool-CB5vm1Jc.d.mts} +1 -1
- package/dist/{FileModifierErrors-CwB-Inm9.mjs → FileModifierErrors-BqFmpRsm.mjs} +1 -1
- package/dist/{FileToolModifier.utils.neutral-D_YkHwZP.mjs → FileToolModifier.utils.neutral-DWFpnsj2.mjs} +4 -2
- package/dist/{SsrfErrors-xhdVE4yw.mjs → SsrfErrors-C91YhASE.mjs} +14 -10
- package/dist/{Telemetry-Dw9W5RSp.mjs → Telemetry-HlftxMx6.mjs} +2 -2
- package/dist/{cancellation-P5YUlcfz.mjs → cancellation-CXpfmiVo.mjs} +7 -5
- package/dist/{composio-Cb3d1jFe.d.mts → composio-DLGaeN70.d.mts} +327 -26
- package/dist/{customTool.types-B6ej_8XZ.d.mts → customTool.types-BAmEh3MB.d.mts} +95 -4
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +3 -13
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +46 -3
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +4 -4
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +33 -23
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +3 -2
- package/dist/{errors-Ue9wMrPK.mjs → errors-BuEKehbI.mjs} +23 -3
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-KE5Fa-af.mjs → fileUtils.node-L7XD8UPr.mjs} +8 -6
- package/dist/index.d.mts +160 -101
- package/dist/index.mjs +336 -127
- package/dist/models/Files.node.d.mts +2 -3
- package/dist/models/Files.node.mjs +2 -2
- package/dist/models/Files.workerd.d.mts +2 -3
- package/dist/platform/node.d.mts +2 -3
- package/dist/platform/workerd.d.mts +2 -3
- package/dist/{sensitiveFileUploadPaths-QN7w4n8v.mjs → sensitiveFileUploadPaths-B6pBt9lO.mjs} +10 -7
- package/dist/{ssrfGuard.node-BLX6b-Rf.mjs → ssrfGuard.node-B9xQB4za.mjs} +104 -14
- package/dist/{types-CGdgK442.d.mts → types-CxLPO0Xq.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +3 -4
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +3 -4
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +3 -4
- package/dist/utils/modifiers/FileToolModifier.node.mjs +6 -6
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +3 -4
- package/dist/utils/modifiers/FileToolModifier.workerd.mjs +1 -1
- package/dist/utils/ssrfGuard.node.d.mts +19 -10
- package/dist/utils/ssrfGuard.node.mjs +1 -1
- package/dist/utils/ssrfGuard.workerd.d.mts +12 -4
- package/dist/utils/ssrfGuard.workerd.mjs +2 -2
- package/package.json +8 -8
- package/src/errors/ToolErrors.ts +24 -0
- package/src/index.ts +4 -0
- package/src/models/MCP.ts +29 -15
- package/src/models/ToolRouter.ts +1 -0
- package/src/models/ToolRouterSession.ts +106 -9
- package/src/models/Toolkits.ts +1 -2
- package/src/models/Tools.ts +55 -25
- package/src/models/Triggers.ts +7 -2
- package/src/services/pusher/Pusher.ts +29 -10
- package/src/types/toolRouter.types.ts +54 -3
- package/src/types/toolkit.types.ts +17 -0
- package/src/utils/jsonSchema.ts +4 -1
- package/src/utils/ssrfGuard.node.ts +127 -13
- package/src/utils/ssrfGuard.workerd.ts +11 -1
- package/src/utils/transformers/toolkits.ts +79 -2
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { c as DEFAULT_BASE_URL, d as TEMP_FILES_DIRECTORY_NAME, f as USER_DATA_FILE_NAME, h as getEnvsWithPrefix, i as logger, l as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, m as getEnvVariable, n as SsrfErrorCodes, o as COMPOSIO_DIR, p as constants_exports, r as ComposioError, s as COMPOSIO_LOG_LEVEL, t as ComposioBlockedInternalUrlError, u as IS_DEVELOPMENT_OR_CI } from "./SsrfErrors-
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as ComposioSensitiveFilePathBlockedError, i as ComposioFileUploadPathNotAllowedError, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, r as ComposioFileUploadError, t as ComposioFileNotFoundError } from "./FileModifierErrors-
|
|
4
|
-
import { n as dropEmptyFileUploads, o as isPlainObject, s as schemaHasFileUploadable } from "./FileToolModifier.utils.neutral-
|
|
5
|
-
import { a as jsonSchemaToZodSchema, c as toStrictJsonSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as omitNullToolArguments, r as dereferenceJsonSchema, s as removeNonRequiredProperties, t as withCancellation } from "./cancellation-
|
|
6
|
-
import { t as telemetry } from "./Telemetry-
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-
|
|
1
|
+
import { c as DEFAULT_BASE_URL, d as TEMP_FILES_DIRECTORY_NAME, f as USER_DATA_FILE_NAME, h as getEnvsWithPrefix, i as logger, l as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, m as getEnvVariable, n as SsrfErrorCodes, o as COMPOSIO_DIR, p as constants_exports, r as ComposioError, s as COMPOSIO_LOG_LEVEL, t as ComposioBlockedInternalUrlError, u as IS_DEVELOPMENT_OR_CI } from "./SsrfErrors-C91YhASE.mjs";
|
|
2
|
+
import { A as ComposioToolVersionRequiredError, B as ComposioMultipleConnectedAccountsError, C as ComposioInvalidExecuteFunctionError, D as ComposioToolExecutionError, E as ComposioProviderNotDefinedError, F as ConnectionRequestTimeoutError, G as ComposioAuthConfigNotFoundError, H as ComposioSharedConnectionNotAccessibleError, I as ComposioAclOnlyForSharedError, L as ComposioConnectedAccountNotFoundError, M as handleToolExecutionError, N as ConnectionRequestErrorCodes, O as ComposioToolFetchError, P as ConnectionRequestFailedError, R as ComposioFailedToCreateConnectedAccountLink, S as ComposioGlobalExecuteToolFnNotSetError, T as ComposioInvalidToolArgumentsError, U as ConnectedAccountErrorCodes, V as ComposioSharedAccessDeniedError, W as AuthConfigErrorCodes, _ as ValidationError, a as ComposioFailedToSubscribeToPusherChannelError, b as ComposioToolkitNotFoundError, c as ComposioWebhookPayloadError, d as ComposioNoAPIKeyError, f as ComposioRequestCancelledError, g as JsonSchemaToZodError, h as JsonSchemaRefResolutionError, i as ComposioFailedToGetSDKRealtimeCredentialsError, j as ToolErrorCodes, k as ComposioToolNotFoundError, l as ComposioWebhookSignatureVerificationError, m as isRequestAbortError, n as RemoteFileErrorCodes, o as ComposioFailedToUnsubscribeFromPusherChannelError, p as SDKErrorCodes, r as ComposioFailedToCreatePusherClientError, s as ComposioTriggerTypeNotFoundError, t as RemoteFileDownloadError, u as TriggerErrorCodes, v as ValidationErrorCodes, w as ComposioInvalidModifierError, x as ToolkitErrorCodes, y as ComposioToolkitFetchError, z as ComposioLegacyConnectedAccountsEndpointRetiredError } from "./errors-BuEKehbI.mjs";
|
|
3
|
+
import { a as ComposioSensitiveFilePathBlockedError, i as ComposioFileUploadPathNotAllowedError, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, r as ComposioFileUploadError, t as ComposioFileNotFoundError } from "./FileModifierErrors-BqFmpRsm.mjs";
|
|
4
|
+
import { n as dropEmptyFileUploads, o as isPlainObject, s as schemaHasFileUploadable } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
|
|
5
|
+
import { a as jsonSchemaToZodSchema, c as toStrictJsonSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as omitNullToolArguments, r as dereferenceJsonSchema, s as removeNonRequiredProperties, t as withCancellation } from "./cancellation-CXpfmiVo.mjs";
|
|
6
|
+
import { t as telemetry } from "./Telemetry-HlftxMx6.mjs";
|
|
7
|
+
import { a as readResponseBodyWithLimit, i as MAX_URL_UPLOAD_SIZE_BYTES, l as getRandomShortId, n as assertSafeFileUploadPath, o as arrayBufferToBase64, r as isBlockedSensitiveFileUploadPath, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-B6pBt9lO.mjs";
|
|
8
|
+
import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-BMlZfJVz.mjs";
|
|
9
9
|
import ComposioClient, { APIError, BadRequestError } from "@composio/client";
|
|
10
10
|
import { FileToolModifier } from "#file_tool_modifier";
|
|
11
11
|
import z, { z as z$1 } from "zod/v3";
|
|
12
12
|
import { CONFIG_DEFAULTS } from "#config_defaults";
|
|
13
13
|
import { platform } from "#platform";
|
|
14
|
-
import { APIError as APIError$1 } from "openai";
|
|
15
14
|
import semver from "semver";
|
|
16
15
|
import { Files } from "#files";
|
|
17
16
|
import { ssrfSafeFetch, ssrfSafeFetchWhereSupported } from "#ssrf_guard";
|
|
@@ -1333,14 +1332,16 @@ var Tools = class {
|
|
|
1333
1332
|
toolkitSlug,
|
|
1334
1333
|
params
|
|
1335
1334
|
}, modifiers?.beforeFileUpload, requestOptions);
|
|
1336
|
-
if (modifiers?.beforeExecute)
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1335
|
+
if (modifiers?.beforeExecute) {
|
|
1336
|
+
if (typeof modifiers.beforeExecute === "function") {
|
|
1337
|
+
modifiedParams = await modifiers.beforeExecute({
|
|
1338
|
+
toolSlug,
|
|
1339
|
+
toolkitSlug,
|
|
1340
|
+
params: modifiedParams
|
|
1341
|
+
});
|
|
1342
|
+
if (requestOptions?.signal?.aborted) throw new ComposioRequestCancelledError();
|
|
1343
|
+
} else throw new ComposioInvalidModifierError("Invalid beforeExecute modifier. Not a function.");
|
|
1344
|
+
}
|
|
1344
1345
|
return modifiedParams;
|
|
1345
1346
|
}
|
|
1346
1347
|
/**
|
|
@@ -1389,12 +1390,14 @@ var Tools = class {
|
|
|
1389
1390
|
result: modifiedResult,
|
|
1390
1391
|
signal: requestOptions?.signal
|
|
1391
1392
|
});
|
|
1392
|
-
if (modifier)
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1393
|
+
if (modifier) {
|
|
1394
|
+
if (typeof modifier === "function") modifiedResult = await modifier({
|
|
1395
|
+
toolSlug,
|
|
1396
|
+
toolkitSlug,
|
|
1397
|
+
result: modifiedResult
|
|
1398
|
+
});
|
|
1399
|
+
else throw new ComposioInvalidModifierError("Invalid afterExecute modifier. Not a function.");
|
|
1400
|
+
}
|
|
1398
1401
|
return modifiedResult;
|
|
1399
1402
|
}
|
|
1400
1403
|
/**
|
|
@@ -1593,7 +1596,14 @@ var Tools = class {
|
|
|
1593
1596
|
tool = await withCancellation(() => this.client.tools.retrieve(slug, retrieveParams, requestOptions), requestOptions?.signal);
|
|
1594
1597
|
} catch (error) {
|
|
1595
1598
|
if (error instanceof ComposioRequestCancelledError) throw error;
|
|
1596
|
-
throw new ComposioToolNotFoundError(`
|
|
1599
|
+
if (error instanceof APIError && (error.status === 404 || error.status === 400)) throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`, {
|
|
1600
|
+
meta: { slug },
|
|
1601
|
+
cause: error
|
|
1602
|
+
});
|
|
1603
|
+
throw new ComposioToolFetchError(`Unable to retrieve tool with slug ${slug}`, {
|
|
1604
|
+
meta: { slug },
|
|
1605
|
+
cause: error
|
|
1606
|
+
});
|
|
1597
1607
|
}
|
|
1598
1608
|
let [modifiedTool] = await this.applyDefaultSchemaModifiers([this.transformToolCases(tool)]);
|
|
1599
1609
|
if (options?.modifySchema) {
|
|
@@ -1801,6 +1811,10 @@ var Tools = class {
|
|
|
1801
1811
|
*
|
|
1802
1812
|
* @example Execute with a specific version (recommended for production)
|
|
1803
1813
|
* ```typescript
|
|
1814
|
+
* // Look up the tool's current version once, then pin that string in your code or config
|
|
1815
|
+
* const { version } = await composio.tools.getRawComposioToolBySlug('GITHUB_GET_REPOS');
|
|
1816
|
+
* console.log(version); // e.g. '20250909_00'
|
|
1817
|
+
*
|
|
1804
1818
|
* const result = await composio.tools.execute('GITHUB_GET_REPOS', {
|
|
1805
1819
|
* userId: 'default',
|
|
1806
1820
|
* version: '20250909_00',
|
|
@@ -1926,47 +1940,62 @@ var Tools = class {
|
|
|
1926
1940
|
return withCancellation(() => this.client.tools.retrieveEnum(requestOptions), requestOptions?.signal);
|
|
1927
1941
|
}
|
|
1928
1942
|
/**
|
|
1929
|
-
*
|
|
1943
|
+
* Generates arguments for a tool from a natural-language description of the task.
|
|
1930
1944
|
*
|
|
1931
|
-
*
|
|
1945
|
+
* Composio uses an LLM to fill the tool's input parameters from `text`. Review the
|
|
1946
|
+
* generated arguments before passing them to `tools.execute()`.
|
|
1932
1947
|
*
|
|
1933
|
-
* @param {string} slug - The
|
|
1934
|
-
* @param {ToolGetInputParams} body - The
|
|
1935
|
-
* @
|
|
1948
|
+
* @param {string} slug - The slug of the tool to generate arguments for
|
|
1949
|
+
* @param {ToolGetInputParams} body - The generation request
|
|
1950
|
+
* @param {string} body.text - What you want the tool to do, in natural language
|
|
1951
|
+
* @param {string} [body.custom_description] - Extra context about the tool for the LLM
|
|
1952
|
+
* @param {string} [body.system_prompt] - System prompt that steers the LLM
|
|
1953
|
+
* @param {string} [body.version] - Tool version to generate arguments for
|
|
1954
|
+
* @returns {Promise<ToolGetInputResponse>} The generated `arguments`, or an `error` when generation fails
|
|
1936
1955
|
*
|
|
1937
1956
|
* @example
|
|
1938
1957
|
* ```typescript
|
|
1939
|
-
*
|
|
1940
|
-
*
|
|
1941
|
-
*
|
|
1958
|
+
* const { arguments: args, error } = await composio.tools.getInput('GITHUB_CREATE_ISSUE', {
|
|
1959
|
+
* text: 'Open an issue in composiohq/composio titled "Docs typo" describing the broken link',
|
|
1960
|
+
* version: '20250909_00',
|
|
1942
1961
|
* });
|
|
1943
|
-
*
|
|
1962
|
+
* if (error) throw new Error(error);
|
|
1963
|
+
* console.log(args); // { owner: 'composiohq', repo: 'composio', title: 'Docs typo', ... }
|
|
1944
1964
|
* ```
|
|
1945
1965
|
*/
|
|
1946
1966
|
async getInput(slug, body, requestOptions) {
|
|
1947
1967
|
return withCancellation(() => this.client.tools.getInput(slug, body, requestOptions), requestOptions?.signal);
|
|
1948
1968
|
}
|
|
1949
1969
|
/**
|
|
1950
|
-
*
|
|
1970
|
+
* Sends an HTTP request to a toolkit's API, authenticated as a connected account.
|
|
1971
|
+
*
|
|
1972
|
+
* Use it to call an endpoint that no predefined tool covers. Composio injects the
|
|
1973
|
+
* connected account's credentials on the server side.
|
|
1951
1974
|
*
|
|
1952
|
-
*
|
|
1953
|
-
*
|
|
1975
|
+
* A relative `endpoint` is appended to the toolkit's base URL, and that base URL can
|
|
1976
|
+
* already include a path. Google Calendar's base URL is
|
|
1977
|
+
* `https://www.googleapis.com/calendar/v3`, so pass `/users/me/calendarList`, not
|
|
1978
|
+
* `/calendar/v3/users/me/calendarList` (which resolves to `/calendar/v3/calendar/v3/...`
|
|
1979
|
+
* and returns a 404 from Google). An absolute URL on the same domain is sent as-is.
|
|
1954
1980
|
*
|
|
1955
|
-
* @param {ToolProxyParams} body - The
|
|
1956
|
-
* @
|
|
1981
|
+
* @param {ToolProxyParams} body - The proxy request
|
|
1982
|
+
* @param {string} body.endpoint - Path relative to the toolkit's base URL, or an absolute URL
|
|
1983
|
+
* @param {'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'} body.method - HTTP method
|
|
1984
|
+
* @param {string} [body.connectedAccountId] - The connected account to authenticate as
|
|
1985
|
+
* @param {unknown} [body.body] - JSON request body
|
|
1986
|
+
* @param {Array<{ in: 'query' | 'header'; name: string; value: string | number }>} [body.parameters] - Extra query parameters or headers
|
|
1987
|
+
* @returns {Promise<ToolProxyResponse>} The upstream status, headers, and parsed body
|
|
1957
1988
|
*
|
|
1958
1989
|
* @example
|
|
1959
1990
|
* ```typescript
|
|
1960
|
-
* //
|
|
1961
|
-
* const
|
|
1962
|
-
*
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1965
|
-
*
|
|
1966
|
-
* method: 'GET'
|
|
1967
|
-
* }
|
|
1991
|
+
* // Google Calendar's base URL is https://www.googleapis.com/calendar/v3
|
|
1992
|
+
* const { status, data } = await composio.tools.proxyExecute({
|
|
1993
|
+
* endpoint: '/users/me/calendarList',
|
|
1994
|
+
* method: 'GET',
|
|
1995
|
+
* connectedAccountId: 'ca_...',
|
|
1996
|
+
* parameters: [{ in: 'query', name: 'maxResults', value: 10 }],
|
|
1968
1997
|
* });
|
|
1969
|
-
* console.log(
|
|
1998
|
+
* console.log(status, data);
|
|
1970
1999
|
* ```
|
|
1971
2000
|
*/
|
|
1972
2001
|
async proxyExecute(body, requestOptions) {
|
|
@@ -2052,11 +2081,28 @@ const ToolkitAuthFieldSchema = z$1.object({
|
|
|
2052
2081
|
required: z$1.boolean(),
|
|
2053
2082
|
name: z$1.string(),
|
|
2054
2083
|
type: z$1.string(),
|
|
2055
|
-
default: z$1.string().nullable().optional()
|
|
2084
|
+
default: z$1.string().nullable().optional(),
|
|
2085
|
+
/**
|
|
2086
|
+
* Whether this field holds a secret/credential value. Clients use it to
|
|
2087
|
+
* decide whether to mask the input when collecting the value in their own
|
|
2088
|
+
* UI. The property is absent when the API omits the flag for the field.
|
|
2089
|
+
*/
|
|
2090
|
+
isSecret: z$1.boolean().optional(),
|
|
2091
|
+
/**
|
|
2092
|
+
* The legacy template name the API reports for this field, mapped from
|
|
2093
|
+
* `legacy_template_name`. The API declares it as an optional string without
|
|
2094
|
+
* further documenting its semantics.
|
|
2095
|
+
*/
|
|
2096
|
+
legacyTemplateName: z$1.string().optional()
|
|
2056
2097
|
});
|
|
2057
2098
|
const ToolkitAuthConfigDetailsSchema = z$1.object({
|
|
2058
2099
|
name: z$1.string(),
|
|
2059
2100
|
mode: z$1.string(),
|
|
2101
|
+
/**
|
|
2102
|
+
* URL to a page where users can obtain or configure credentials for this
|
|
2103
|
+
* authentication method, e.g. `https://github.com/settings/tokens`.
|
|
2104
|
+
*/
|
|
2105
|
+
authHintUrl: z$1.string().nullable().optional(),
|
|
2060
2106
|
fields: z$1.object({
|
|
2061
2107
|
authConfigCreation: z$1.object({
|
|
2062
2108
|
optional: z$1.array(ToolkitAuthFieldSchema),
|
|
@@ -2252,7 +2298,8 @@ var AuthConfigs = class {
|
|
|
2252
2298
|
show_disabled: parsedQuery?.showDisabled,
|
|
2253
2299
|
toolkit_slug: parsedQuery?.toolkit
|
|
2254
2300
|
};
|
|
2255
|
-
|
|
2301
|
+
const result = await withCancellation(() => this.client.authConfigs.list(listParams, requestOptions), requestOptions?.signal);
|
|
2302
|
+
return transformAuthConfigListResponse(result);
|
|
2256
2303
|
}
|
|
2257
2304
|
/**
|
|
2258
2305
|
* Create a new auth config
|
|
@@ -2296,7 +2343,8 @@ var AuthConfigs = class {
|
|
|
2296
2343
|
tool_access_config: parsedOptions.data.toolAccessConfig ? { tools_for_connected_account_creation: parsedOptions.data.toolAccessConfig.toolsForConnectedAccountCreation } : void 0
|
|
2297
2344
|
}
|
|
2298
2345
|
};
|
|
2299
|
-
|
|
2346
|
+
const result = await withCancellation(() => this.client.authConfigs.create(createBody, requestOptions), requestOptions?.signal);
|
|
2347
|
+
return transformCreateAuthConfigResponse(result);
|
|
2300
2348
|
}
|
|
2301
2349
|
/**
|
|
2302
2350
|
* Retrieves a specific authentication configuration by its ID.
|
|
@@ -2318,7 +2366,8 @@ var AuthConfigs = class {
|
|
|
2318
2366
|
* ```
|
|
2319
2367
|
*/
|
|
2320
2368
|
async get(nanoid, requestOptions) {
|
|
2321
|
-
|
|
2369
|
+
const result = await withCancellation(() => this.client.authConfigs.retrieve(nanoid, requestOptions), requestOptions?.signal);
|
|
2370
|
+
return transformAuthConfigRetrieveResponse(result);
|
|
2322
2371
|
}
|
|
2323
2372
|
/**
|
|
2324
2373
|
* Updates an existing authentication configuration.
|
|
@@ -3065,7 +3114,8 @@ var ConnectedAccounts = class {
|
|
|
3065
3114
|
...parsedQuery.data.accountType !== void 0 && { account_type: parsedQuery.data.accountType }
|
|
3066
3115
|
};
|
|
3067
3116
|
}
|
|
3068
|
-
|
|
3117
|
+
const result = await withCancellation(() => this.client.connectedAccounts.list(rawQuery, requestOptions), requestOptions?.signal);
|
|
3118
|
+
return transformConnectedAccountListResponse(result);
|
|
3069
3119
|
}
|
|
3070
3120
|
/**
|
|
3071
3121
|
* Compound function to create a new connected account.
|
|
@@ -3280,7 +3330,8 @@ var ConnectedAccounts = class {
|
|
|
3280
3330
|
* ```
|
|
3281
3331
|
*/
|
|
3282
3332
|
async get(nanoid, requestOptions) {
|
|
3283
|
-
|
|
3333
|
+
const response = await withCancellation(() => this.client.connectedAccounts.retrieve(nanoid, requestOptions), requestOptions?.signal);
|
|
3334
|
+
return transformConnectedAccountResponse(response);
|
|
3284
3335
|
}
|
|
3285
3336
|
/**
|
|
3286
3337
|
* Deletes a connected account.
|
|
@@ -3445,6 +3496,32 @@ var ConnectedAccounts = class {
|
|
|
3445
3496
|
|
|
3446
3497
|
//#endregion
|
|
3447
3498
|
//#region src/utils/transformers/toolkits.ts
|
|
3499
|
+
const transformToolkitAuthField = (field) => ({
|
|
3500
|
+
name: field.name,
|
|
3501
|
+
displayName: field.displayName,
|
|
3502
|
+
description: field.description,
|
|
3503
|
+
type: field.type,
|
|
3504
|
+
required: field.required,
|
|
3505
|
+
...field.default !== void 0 && { default: field.default },
|
|
3506
|
+
...field.is_secret !== void 0 && { isSecret: field.is_secret },
|
|
3507
|
+
...field.legacy_template_name !== void 0 && { legacyTemplateName: field.legacy_template_name }
|
|
3508
|
+
});
|
|
3509
|
+
/**
|
|
3510
|
+
* Normalize one field group to empty lists when the API omits it, the way this
|
|
3511
|
+
* repo's own docs pipeline does (`docs/lib/toolkit-api.ts` defaults a missing
|
|
3512
|
+
* group to `{ required: [], optional: [] }`).
|
|
3513
|
+
*
|
|
3514
|
+
* The generated client declares both groups and both lists as required, but a
|
|
3515
|
+
* response that omits one reached zod and failed validation there. Mapping it
|
|
3516
|
+
* eagerly would instead throw a `TypeError` on the property access, before
|
|
3517
|
+
* validation, turning a handled validation error into a crash of
|
|
3518
|
+
* `toolkits.get()`. Normalizing also leaves the other group usable, which is
|
|
3519
|
+
* typically the one the caller asked for.
|
|
3520
|
+
*/
|
|
3521
|
+
const transformToolkitAuthFieldGroup = (group) => ({
|
|
3522
|
+
required: (group?.required ?? []).map(transformToolkitAuthField),
|
|
3523
|
+
optional: (group?.optional ?? []).map(transformToolkitAuthField)
|
|
3524
|
+
});
|
|
3448
3525
|
const transformToolkitListResponse = (response) => {
|
|
3449
3526
|
return transform(response).with(ToolKitListResponseSchema).using((response) => response.items.map((item) => ({
|
|
3450
3527
|
name: item.name,
|
|
@@ -3490,9 +3567,10 @@ const transformToolkitRetrieveResponse = (response) => {
|
|
|
3490
3567
|
authConfigDetails: response.auth_config_details?.map((authConfig) => ({
|
|
3491
3568
|
name: authConfig.name,
|
|
3492
3569
|
mode: authConfig.mode,
|
|
3570
|
+
...authConfig.auth_hint_url !== void 0 && { authHintUrl: authConfig.auth_hint_url },
|
|
3493
3571
|
fields: {
|
|
3494
|
-
authConfigCreation: authConfig.fields
|
|
3495
|
-
connectedAccountInitiation: authConfig.fields
|
|
3572
|
+
authConfigCreation: transformToolkitAuthFieldGroup(authConfig.fields?.auth_config_creation),
|
|
3573
|
+
connectedAccountInitiation: transformToolkitAuthFieldGroup(authConfig.fields?.connected_account_initiation)
|
|
3496
3574
|
},
|
|
3497
3575
|
proxy: { baseUrl: authConfig.proxy?.base_url }
|
|
3498
3576
|
})),
|
|
@@ -3549,7 +3627,8 @@ var Toolkits = class {
|
|
|
3549
3627
|
cursor: parsedQuery.data.cursor,
|
|
3550
3628
|
limit: parsedQuery.data.limit
|
|
3551
3629
|
};
|
|
3552
|
-
|
|
3630
|
+
const result = await withCancellation(() => this.client.toolkits.list(listParams, requestOptions), requestOptions?.signal);
|
|
3631
|
+
return transformToolkitListResponse(result);
|
|
3553
3632
|
} catch (error) {
|
|
3554
3633
|
if (error instanceof ComposioRequestCancelledError) throw error;
|
|
3555
3634
|
throw new ComposioToolkitFetchError("Failed to fetch toolkits", { cause: error });
|
|
@@ -3570,10 +3649,11 @@ var Toolkits = class {
|
|
|
3570
3649
|
*/
|
|
3571
3650
|
async getToolkitBySlug(slug, requestOptions) {
|
|
3572
3651
|
try {
|
|
3573
|
-
|
|
3652
|
+
const result = await withCancellation(() => this.client.toolkits.retrieve(slug, void 0, requestOptions), requestOptions?.signal);
|
|
3653
|
+
return transformToolkitRetrieveResponse(result);
|
|
3574
3654
|
} catch (error) {
|
|
3575
3655
|
if (error instanceof ComposioRequestCancelledError) throw error;
|
|
3576
|
-
if (error instanceof APIError
|
|
3656
|
+
if (error instanceof APIError && (error.status === 404 || error.status === 400)) throw new ComposioToolkitNotFoundError(`Toolkit with slug ${slug} not found`, {
|
|
3577
3657
|
meta: { slug },
|
|
3578
3658
|
cause: error
|
|
3579
3659
|
});
|
|
@@ -3650,7 +3730,8 @@ var Toolkits = class {
|
|
|
3650
3730
|
* ```
|
|
3651
3731
|
*/
|
|
3652
3732
|
async listCategories(requestOptions) {
|
|
3653
|
-
|
|
3733
|
+
const result = await withCancellation(() => this.client.toolkits.retrieveCategories(requestOptions), requestOptions?.signal);
|
|
3734
|
+
return transformToolkitRetrieveCategoriesResponse(result);
|
|
3654
3735
|
}
|
|
3655
3736
|
/**
|
|
3656
3737
|
* Authorizes a user to use a toolkit.
|
|
@@ -3670,20 +3751,22 @@ var Toolkits = class {
|
|
|
3670
3751
|
const composioAuthConfig = new AuthConfigs(this.client);
|
|
3671
3752
|
let authConfigIdToUse = authConfigId;
|
|
3672
3753
|
if (!authConfigIdToUse) authConfigIdToUse = (await composioAuthConfig.list({ toolkit: toolkitSlug }, requestOptions)).items[0]?.id;
|
|
3673
|
-
if (!authConfigIdToUse)
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3754
|
+
if (!authConfigIdToUse) {
|
|
3755
|
+
if (toolkit.authConfigDetails && toolkit.authConfigDetails.length > 0) try {
|
|
3756
|
+
authConfigIdToUse = (await composioAuthConfig.create(toolkitSlug, {
|
|
3757
|
+
type: "use_composio_managed_auth",
|
|
3758
|
+
name: `${toolkit.name} Auth Config`
|
|
3759
|
+
}, requestOptions)).id;
|
|
3760
|
+
} catch (error) {
|
|
3761
|
+
if (error instanceof ComposioClient.APIError && error.status === 400) throw new ComposioAuthConfigNotFoundError(`No Default auth config found for toolkit ${toolkitSlug}`, {
|
|
3762
|
+
meta: { toolkitSlug },
|
|
3763
|
+
cause: error,
|
|
3764
|
+
possibleFixes: [`Please Create an auth config for the toolkit ${toolkitSlug} via the dashboard`]
|
|
3765
|
+
});
|
|
3766
|
+
throw error;
|
|
3767
|
+
}
|
|
3768
|
+
else throw new ComposioAuthConfigNotFoundError(`No auth configs found for toolkit ${toolkitSlug}`, { meta: { toolkitSlug } });
|
|
3685
3769
|
}
|
|
3686
|
-
else throw new ComposioAuthConfigNotFoundError(`No auth configs found for toolkit ${toolkitSlug}`, { meta: { toolkitSlug } });
|
|
3687
3770
|
return await new ConnectedAccounts(this.client).initiate(userId, authConfigIdToUse, { allowMultiple: true }, requestOptions);
|
|
3688
3771
|
}
|
|
3689
3772
|
};
|
|
@@ -4048,14 +4131,28 @@ var PusherService = class {
|
|
|
4048
4131
|
* @param channelName - The name of the Pusher channel to subscribe to
|
|
4049
4132
|
* @param event - The event to subscribe to
|
|
4050
4133
|
* @param fn - The function to call when the event is received
|
|
4134
|
+
* @param onSubscriptionError - Optional callback invoked with the raw payload when the
|
|
4135
|
+
* Pusher subscription fails (for example on auth or permission rejection). Errors thrown
|
|
4136
|
+
* from — or promises rejected by — this callback are contained and logged, never rethrown.
|
|
4051
4137
|
*/
|
|
4052
|
-
async subscribe(fn) {
|
|
4138
|
+
async subscribe(fn, onSubscriptionError) {
|
|
4053
4139
|
try {
|
|
4054
4140
|
logger.debug(`[PusherService] Subscribing to channel: ${this.pusherChannel}`);
|
|
4055
4141
|
const channel = await (await this.getPusherClient()).subscribe(this.pusherChannel);
|
|
4142
|
+
const logCallbackFailure = (callbackError) => {
|
|
4143
|
+
const errorMessage = callbackError instanceof Error ? callbackError.message : String(callbackError);
|
|
4144
|
+
logger.error("❌ Error in subscription error callback:", errorMessage);
|
|
4145
|
+
};
|
|
4056
4146
|
channel.bind("pusher:subscription_error", (data) => {
|
|
4057
|
-
|
|
4058
|
-
|
|
4147
|
+
logger.error("Trigger subscription error:", data);
|
|
4148
|
+
try {
|
|
4149
|
+
Promise.resolve(onSubscriptionError?.(data)).catch(logCallbackFailure);
|
|
4150
|
+
} catch (callbackError) {
|
|
4151
|
+
logCallbackFailure(callbackError);
|
|
4152
|
+
}
|
|
4153
|
+
});
|
|
4154
|
+
channel.bind("pusher:subscription_succeeded", () => {
|
|
4155
|
+
logger.info(`✅ Subscribed to triggers. You should start receiving events now.`);
|
|
4059
4156
|
});
|
|
4060
4157
|
const safeCallback = (data) => {
|
|
4061
4158
|
try {
|
|
@@ -4066,7 +4163,6 @@ var PusherService = class {
|
|
|
4066
4163
|
}
|
|
4067
4164
|
};
|
|
4068
4165
|
this.bindWithChunking(channel, "trigger_to_client", safeCallback);
|
|
4069
|
-
logger.info(`✅ Subscribed to triggers. You should start receiving events now.`);
|
|
4070
4166
|
} catch (error) {
|
|
4071
4167
|
throw new ComposioFailedToSubscribeToPusherChannelError("Failed to subscribe to Pusher channel", { cause: error });
|
|
4072
4168
|
}
|
|
@@ -4182,7 +4278,8 @@ async function hmacSha256Base64(secret, message) {
|
|
|
4182
4278
|
hash: "SHA-256"
|
|
4183
4279
|
}, false, ["sign"]);
|
|
4184
4280
|
const signatureData = encoder.encode(message);
|
|
4185
|
-
|
|
4281
|
+
const signatureBuffer = await globalThis.crypto.subtle.sign("HMAC", key, signatureData);
|
|
4282
|
+
return arrayBufferToBase64(signatureBuffer);
|
|
4186
4283
|
}
|
|
4187
4284
|
/**
|
|
4188
4285
|
* Constant-time comparison of two strings to prevent timing attacks
|
|
@@ -4338,7 +4435,8 @@ var Triggers = class {
|
|
|
4338
4435
|
trigger_ids: parsedParams.data.triggerIds,
|
|
4339
4436
|
trigger_names: parsedParams.data.triggerNames
|
|
4340
4437
|
} : void 0;
|
|
4341
|
-
|
|
4438
|
+
const result = await withCancellation(() => this.client.triggerInstances.listActive(listParams, requestOptions), requestOptions?.signal);
|
|
4439
|
+
return transformTriggerInstanceListActiveResponse(result);
|
|
4342
4440
|
}
|
|
4343
4441
|
/**
|
|
4344
4442
|
* Create a new trigger instance for a user
|
|
@@ -4431,7 +4529,8 @@ var Triggers = class {
|
|
|
4431
4529
|
toolkit_slugs: parsedQuery.toolkits,
|
|
4432
4530
|
toolkit_versions: this.toolkitVersions
|
|
4433
4531
|
};
|
|
4434
|
-
|
|
4532
|
+
const result = await withCancellation(() => this.client.triggersTypes.list(listParams, requestOptions), requestOptions?.signal);
|
|
4533
|
+
return transformTriggerTypeListResponse(result);
|
|
4435
4534
|
}
|
|
4436
4535
|
/**
|
|
4437
4536
|
* Retrieve a trigger type by its slug for the provided version of the app
|
|
@@ -4442,7 +4541,8 @@ var Triggers = class {
|
|
|
4442
4541
|
*/
|
|
4443
4542
|
async getType(slug, requestOptions) {
|
|
4444
4543
|
const retrieveParams = { toolkit_versions: this.toolkitVersions };
|
|
4445
|
-
|
|
4544
|
+
const result = await withCancellation(() => this.client.triggersTypes.retrieve(slug, retrieveParams, requestOptions), requestOptions?.signal);
|
|
4545
|
+
return transformTriggerTypeRetrieveResponse(result);
|
|
4446
4546
|
}
|
|
4447
4547
|
/**
|
|
4448
4548
|
* Fetches the list of all the available trigger enums
|
|
@@ -4495,6 +4595,10 @@ var Triggers = class {
|
|
|
4495
4595
|
*
|
|
4496
4596
|
* @param fn - The function to call when a trigger is received
|
|
4497
4597
|
* @param filters - The filters to apply to the triggers
|
|
4598
|
+
* @param onSubscriptionError - Optional callback invoked with the raw Pusher payload when
|
|
4599
|
+
* the underlying subscription fails (for example on auth or permission rejection). The
|
|
4600
|
+
* subscribe promise still resolves; this is the only programmatic signal of the failure.
|
|
4601
|
+
* Errors thrown from — or promises rejected by — the callback are contained and logged.
|
|
4498
4602
|
*
|
|
4499
4603
|
* @example
|
|
4500
4604
|
* ```ts
|
|
@@ -4504,7 +4608,7 @@ var Triggers = class {
|
|
|
4504
4608
|
* }, );
|
|
4505
4609
|
* ```
|
|
4506
4610
|
*/
|
|
4507
|
-
async subscribe(fn, filters = {}) {
|
|
4611
|
+
async subscribe(fn, filters = {}, onSubscriptionError) {
|
|
4508
4612
|
if (!fn) throw new Error("Function is required for trigger subscription");
|
|
4509
4613
|
const parsedFilters = TriggerSubscribeParamSchema.safeParse(filters);
|
|
4510
4614
|
if (!parsedFilters.success) throw new ValidationError(`Invalid parameters passed to subscribe to triggers`, { cause: parsedFilters.error });
|
|
@@ -4518,7 +4622,7 @@ var Triggers = class {
|
|
|
4518
4622
|
logger.error("❌ Error in trigger callback:", error);
|
|
4519
4623
|
}
|
|
4520
4624
|
else logger.debug("Trigger does not match filters", JSON.stringify(parsedFilters.data, null, 2));
|
|
4521
|
-
});
|
|
4625
|
+
}, onSubscriptionError);
|
|
4522
4626
|
}
|
|
4523
4627
|
/**
|
|
4524
4628
|
* Tries to parse data as V1, V2, or V3 webhook payload format.
|
|
@@ -4711,11 +4815,14 @@ var Triggers = class {
|
|
|
4711
4815
|
const id = getHeader(headers, WEBHOOK_HEADERS.id);
|
|
4712
4816
|
const timestamp = getHeader(headers, WEBHOOK_HEADERS.timestamp);
|
|
4713
4817
|
const signature = getHeader(headers, WEBHOOK_HEADERS.signature);
|
|
4714
|
-
if (!id || !timestamp || !signature)
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4818
|
+
if (!id || !timestamp || !signature) {
|
|
4819
|
+
const missing = [
|
|
4820
|
+
!id ? `'${WEBHOOK_HEADERS.id}'` : void 0,
|
|
4821
|
+
!timestamp ? `'${WEBHOOK_HEADERS.timestamp}'` : void 0,
|
|
4822
|
+
!signature ? `'${WEBHOOK_HEADERS.signature}'` : void 0
|
|
4823
|
+
].filter((header) => header !== void 0);
|
|
4824
|
+
throw new ValidationError(`Cannot verify webhook: missing signature header(s) ${missing.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'.`);
|
|
4825
|
+
}
|
|
4719
4826
|
return this.verifyWebhook({
|
|
4720
4827
|
payload: body,
|
|
4721
4828
|
signature,
|
|
@@ -4963,7 +5070,8 @@ var Triggers = class {
|
|
|
4963
5070
|
if (version === "v1" && value) v1Signatures.push(value);
|
|
4964
5071
|
}
|
|
4965
5072
|
if (v1Signatures.length === 0) throw new ComposioWebhookSignatureVerificationError("No valid v1 signature found in the webhook-signature header. Expected format: 'v1,base64EncodedSignature'");
|
|
4966
|
-
const
|
|
5073
|
+
const toSign = `${webhookId}.${webhookTimestamp}.${payload}`;
|
|
5074
|
+
const expectedSignature = await hmacSha256Base64(secret, toSign);
|
|
4967
5075
|
let isValid = false;
|
|
4968
5076
|
for (const providedSignature of v1Signatures) if (timingSafeEqual(providedSignature, expectedSignature)) {
|
|
4969
5077
|
isValid = true;
|
|
@@ -5150,17 +5258,19 @@ var MCP = class {
|
|
|
5150
5258
|
if (config.error) throw new ValidationError("Invalid parameters passed to create mcp config", { cause: config.error });
|
|
5151
5259
|
const toolkits = [];
|
|
5152
5260
|
const auth_config_ids = [];
|
|
5153
|
-
const
|
|
5261
|
+
const allowed_tools = config.data.allowedTools ?? [];
|
|
5154
5262
|
config.data.toolkits.forEach((toolkit) => {
|
|
5155
5263
|
if (typeof toolkit === "string") toolkits.push(toolkit);
|
|
5156
|
-
else
|
|
5157
|
-
|
|
5264
|
+
else {
|
|
5265
|
+
if (toolkit.toolkit) toolkits.push(toolkit.toolkit);
|
|
5266
|
+
if (toolkit.authConfigId) auth_config_ids.push(toolkit.authConfigId);
|
|
5267
|
+
}
|
|
5158
5268
|
});
|
|
5159
5269
|
const createBody = {
|
|
5160
5270
|
name,
|
|
5161
5271
|
toolkits,
|
|
5162
5272
|
auth_config_ids,
|
|
5163
|
-
|
|
5273
|
+
allowed_tools,
|
|
5164
5274
|
managed_auth_via_composio: config.data.manuallyManageConnections ? false : true
|
|
5165
5275
|
};
|
|
5166
5276
|
const server = await withCancellation(() => this.client.mcp.custom.create(createBody, requestOptions), requestOptions?.signal);
|
|
@@ -5220,7 +5330,8 @@ var MCP = class {
|
|
|
5220
5330
|
auth_config_ids: params.authConfigs?.length > 0 ? params.authConfigs.join(",") : void 0,
|
|
5221
5331
|
name: params.name
|
|
5222
5332
|
};
|
|
5223
|
-
|
|
5333
|
+
const listResponse = await withCancellation(() => this.client.mcp.list(listParams, requestOptions), requestOptions?.signal);
|
|
5334
|
+
return transform(listResponse).with(MCPListResponseSchema).using((raw) => ({
|
|
5224
5335
|
currentPage: raw.current_page,
|
|
5225
5336
|
totalPages: raw.total_pages,
|
|
5226
5337
|
items: raw.items.map((item) => ({
|
|
@@ -5373,20 +5484,21 @@ var MCP = class {
|
|
|
5373
5484
|
if (error) throw new ValidationError("Failed to validate update params", { cause: error });
|
|
5374
5485
|
const toolkits = [];
|
|
5375
5486
|
const auth_config_ids = [];
|
|
5376
|
-
const custom_tools = params.allowedTools ?? void 0;
|
|
5377
5487
|
params.toolkits?.forEach((toolkit) => {
|
|
5378
5488
|
if (typeof toolkit === "string") toolkits.push(toolkit);
|
|
5379
|
-
else
|
|
5380
|
-
|
|
5489
|
+
else {
|
|
5490
|
+
if (toolkit.toolkit) toolkits.push(toolkit.toolkit);
|
|
5491
|
+
if (toolkit.authConfigId) auth_config_ids.push(toolkit.authConfigId);
|
|
5492
|
+
}
|
|
5381
5493
|
});
|
|
5382
5494
|
const updateBody = {
|
|
5383
|
-
name: params.name
|
|
5384
|
-
...params.toolkits ? {
|
|
5385
|
-
custom_tools,
|
|
5495
|
+
...params.name !== void 0 ? { name: params.name } : {},
|
|
5496
|
+
...params.toolkits !== void 0 ? {
|
|
5386
5497
|
toolkits,
|
|
5387
5498
|
auth_config_ids
|
|
5388
5499
|
} : {},
|
|
5389
|
-
|
|
5500
|
+
...params.allowedTools !== void 0 ? { allowed_tools: params.allowedTools } : {},
|
|
5501
|
+
...params.manuallyManageConnections !== void 0 ? { managed_auth_via_composio: !params.manuallyManageConnections } : {}
|
|
5390
5502
|
};
|
|
5391
5503
|
return transformMCPItemResponse(await withCancellation(() => this.client.mcp.update(serverId, updateBody, requestOptions), requestOptions?.signal));
|
|
5392
5504
|
}
|
|
@@ -6017,7 +6129,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
6017
6129
|
|
|
6018
6130
|
//#endregion
|
|
6019
6131
|
//#region package.json
|
|
6020
|
-
var version = "0.
|
|
6132
|
+
var version = "0.19.0";
|
|
6021
6133
|
|
|
6022
6134
|
//#endregion
|
|
6023
6135
|
//#region src/utils/session.ts
|
|
@@ -6350,6 +6462,13 @@ const ToolRouterSessionDeleteResponseSchema = z.object({
|
|
|
6350
6462
|
sessionId: z.string(),
|
|
6351
6463
|
deleted: z.literal(true)
|
|
6352
6464
|
});
|
|
6465
|
+
const ToolRouterSessionEnsureConnectedOptionsSchema = z.object({
|
|
6466
|
+
callbackUrl: z.string().optional(),
|
|
6467
|
+
alias: z.string().optional(),
|
|
6468
|
+
experimental: ConnectedAccountExperimentalSchema.optional(),
|
|
6469
|
+
/** Max time to wait for a newly-initiated connection to become active, in milliseconds. Defaults to 60000. */
|
|
6470
|
+
timeout: z.number().int().positive().optional()
|
|
6471
|
+
});
|
|
6353
6472
|
|
|
6354
6473
|
//#endregion
|
|
6355
6474
|
//#region src/lib/toolRouterParams.ts
|
|
@@ -6459,18 +6578,24 @@ const transformToolRouterUpdateParams = (config) => {
|
|
|
6459
6578
|
for (const [k, v] of Object.entries(config.connectedAccounts)) coerced[k] = typeof v === "string" ? [v] : v;
|
|
6460
6579
|
params.connected_accounts = coerced;
|
|
6461
6580
|
}
|
|
6462
|
-
if (config.manageConnections !== void 0)
|
|
6463
|
-
|
|
6581
|
+
if (config.manageConnections !== void 0) {
|
|
6582
|
+
if (config.manageConnections === null) params.manage_connections = null;
|
|
6583
|
+
else params.manage_connections = transformToolRouterUpdateManageConnectionsParams(config.manageConnections);
|
|
6584
|
+
}
|
|
6464
6585
|
const sandboxConfig = config.sandbox !== void 0 ? config.sandbox : config.workbench;
|
|
6465
|
-
if (sandboxConfig !== void 0)
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
if (config.multiAccount
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6586
|
+
if (sandboxConfig !== void 0) {
|
|
6587
|
+
if (sandboxConfig === null) params.workbench = null;
|
|
6588
|
+
else params.workbench = transformToolRouterUpdateSandboxParams(sandboxConfig);
|
|
6589
|
+
}
|
|
6590
|
+
if (config.multiAccount !== void 0) {
|
|
6591
|
+
if (config.multiAccount === null) params.multi_account = null;
|
|
6592
|
+
else {
|
|
6593
|
+
const ma = {};
|
|
6594
|
+
if (config.multiAccount.enable !== void 0) ma.enable = config.multiAccount.enable;
|
|
6595
|
+
if (config.multiAccount.maxAccountsPerToolkit !== void 0) ma.max_accounts_per_toolkit = config.multiAccount.maxAccountsPerToolkit;
|
|
6596
|
+
if (config.multiAccount.requireExplicitSelection !== void 0) ma.require_explicit_selection = config.multiAccount.requireExplicitSelection;
|
|
6597
|
+
params.multi_account = ma;
|
|
6598
|
+
}
|
|
6474
6599
|
}
|
|
6475
6600
|
if (config.preload !== void 0) params.preload = config.preload;
|
|
6476
6601
|
return params;
|
|
@@ -7287,13 +7412,19 @@ const AuthorizeOptionsSchema = z$1.object({
|
|
|
7287
7412
|
*/
|
|
7288
7413
|
var ToolRouterSession = class {
|
|
7289
7414
|
client;
|
|
7290
|
-
|
|
7415
|
+
sdkConfig;
|
|
7291
7416
|
customToolsMap;
|
|
7292
7417
|
userId;
|
|
7293
7418
|
sessionId;
|
|
7294
7419
|
/** 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 */
|
|
7295
7420
|
mcp;
|
|
7296
7421
|
experimental;
|
|
7422
|
+
/**
|
|
7423
|
+
* Server-side session configuration (toolkit/tool allowlists, tags, preload,
|
|
7424
|
+
* sandbox, manage_connections) as returned by the API. Refreshed in place by
|
|
7425
|
+
* `update()`.
|
|
7426
|
+
*/
|
|
7427
|
+
config;
|
|
7297
7428
|
preload;
|
|
7298
7429
|
/** Resolved sandbox (code-execution) config returned by the API. `enable` defaults to `true` server-side. */
|
|
7299
7430
|
sandbox;
|
|
@@ -7303,11 +7434,17 @@ var ToolRouterSession = class {
|
|
|
7303
7434
|
inlineCustomToolsPayload;
|
|
7304
7435
|
/** Singleton session context — shared across all custom tool executions */
|
|
7305
7436
|
sessionContext;
|
|
7306
|
-
constructor(client,
|
|
7437
|
+
constructor(client, sdkConfig, sessionId, mcp, experimentalOverrides, customToolsMap, userId, metadata) {
|
|
7307
7438
|
this.client = client;
|
|
7308
|
-
this.
|
|
7439
|
+
this.sdkConfig = sdkConfig;
|
|
7309
7440
|
this.customToolsMap = customToolsMap;
|
|
7310
7441
|
this.userId = userId;
|
|
7442
|
+
const config = metadata?.config ?? {
|
|
7443
|
+
user_id: userId ?? "",
|
|
7444
|
+
execute: {},
|
|
7445
|
+
search: {},
|
|
7446
|
+
preload: { tools: [] }
|
|
7447
|
+
};
|
|
7311
7448
|
if (customToolsMap && !userId) throw new Error("userId is required when custom tools are bound to a session.");
|
|
7312
7449
|
this.sessionId = sessionId;
|
|
7313
7450
|
this.mcp = mcp;
|
|
@@ -7315,8 +7452,9 @@ var ToolRouterSession = class {
|
|
|
7315
7452
|
assistivePrompt: experimentalOverrides?.assistivePrompt,
|
|
7316
7453
|
files: new ToolRouterSessionFilesMount(client, sessionId)
|
|
7317
7454
|
};
|
|
7318
|
-
this.
|
|
7319
|
-
this.
|
|
7455
|
+
this.config = config;
|
|
7456
|
+
this.preload = metadata?.preload ?? config.preload;
|
|
7457
|
+
this.sandbox = metadata?.workbench ?? config.workbench;
|
|
7320
7458
|
this.configVersion = metadata?.configVersion;
|
|
7321
7459
|
this.warnings = metadata?.warnings ?? [];
|
|
7322
7460
|
this.preloadedCustomToolSlugs = metadata?.preloadedCustomToolSlugs ?? [];
|
|
@@ -7343,7 +7481,7 @@ var ToolRouterSession = class {
|
|
|
7343
7481
|
* is intercepted: local tools are executed in-process, remote tools are sent to the backend.
|
|
7344
7482
|
*/
|
|
7345
7483
|
async tools(modifiers, requestOptions) {
|
|
7346
|
-
const ToolsModel = new Tools(this.client, this.
|
|
7484
|
+
const ToolsModel = new Tools(this.client, this.sdkConfig);
|
|
7347
7485
|
const rawTools = await ToolsModel.getRawToolRouterSessionTools(this.sessionId, void 0, requestOptions);
|
|
7348
7486
|
const tools = await this.applySchemaModifier(rawTools, modifiers?.modifySchema);
|
|
7349
7487
|
const sessionTools = await this.addPreloadedCustomTools(tools, modifiers);
|
|
@@ -7356,8 +7494,8 @@ var ToolRouterSession = class {
|
|
|
7356
7494
|
assertUnambiguousCustomToolSlug(this.customToolsMap, toolSlug);
|
|
7357
7495
|
return this.executeBackendSessionTool(ToolsModel, toolSlug, input, modifiers, rawToolBySlug.get(toolSlug.toUpperCase()));
|
|
7358
7496
|
};
|
|
7359
|
-
if (!this.
|
|
7360
|
-
return this.
|
|
7497
|
+
if (!this.sdkConfig?.provider) throw new Error("A provider is required when using custom tools with session.tools(). Pass a provider in the Composio constructor.");
|
|
7498
|
+
return this.sdkConfig.provider.wrapTools(sessionTools, routingExecuteFn);
|
|
7361
7499
|
}
|
|
7362
7500
|
return modifiers?.modifySchema ? ToolsModel.wrapToolsForToolRouter(this.sessionId, sessionTools, modifiers, rawTools) : ToolsModel.wrapToolsForToolRouter(this.sessionId, sessionTools, modifiers);
|
|
7363
7501
|
}
|
|
@@ -7496,6 +7634,69 @@ var ToolRouterSession = class {
|
|
|
7496
7634
|
return createConnectionRequest(this.client, response.connected_account_id, ConnectedAccountStatuses.INITIATED, response.redirect_url);
|
|
7497
7635
|
}
|
|
7498
7636
|
/**
|
|
7637
|
+
* Ensure a toolkit has an active connection in this session, reconciling
|
|
7638
|
+
* `authorize()`/`session.link` with the session's active connection state.
|
|
7639
|
+
*
|
|
7640
|
+
* If the session already resolves an ACTIVE connection (or the toolkit is
|
|
7641
|
+
* no-auth), this returns immediately without creating a link — unlike
|
|
7642
|
+
* `authorize()`, which always starts a new link flow, even when one is
|
|
7643
|
+
* already connected. Otherwise it starts the authorization flow and waits
|
|
7644
|
+
* for the new connection to become ACTIVE.
|
|
7645
|
+
*
|
|
7646
|
+
* For interactive flows that should surface the redirect URL instead of
|
|
7647
|
+
* blocking, use `authorize()` and its `waitForConnection()` directly.
|
|
7648
|
+
*
|
|
7649
|
+
* @param toolkit - The toolkit slug to ensure a connection for (e.g. 'github')
|
|
7650
|
+
* @param options - Optional authorization options plus `timeout` (ms to wait
|
|
7651
|
+
* for a newly-initiated connection, default 60000)
|
|
7652
|
+
* @returns The toolkit's canonical slug, whether it was already connected,
|
|
7653
|
+
* and the active connected account (omitted for no-auth toolkits)
|
|
7654
|
+
* @throws {ValidationError} If the options fail validation
|
|
7655
|
+
* @throws {ConnectionRequestTimeoutError} If a newly-initiated connection does
|
|
7656
|
+
* not become active within `timeout`
|
|
7657
|
+
* @throws {ConnectionRequestFailedError} If the new connection enters a failed,
|
|
7658
|
+
* expired, or revoked state
|
|
7659
|
+
*
|
|
7660
|
+
* @example
|
|
7661
|
+
* ```typescript
|
|
7662
|
+
* const session = await composio.sessions.create({ toolkits: ['github'] });
|
|
7663
|
+
* const { wasConnected, connectedAccount } = await session.ensureConnected('github');
|
|
7664
|
+
* if (!wasConnected) console.log('Newly linked:', connectedAccount?.id);
|
|
7665
|
+
* ```
|
|
7666
|
+
*/
|
|
7667
|
+
async ensureConnected(toolkit, options, requestOptions) {
|
|
7668
|
+
const parsedOptions = ToolRouterSessionEnsureConnectedOptionsSchema.safeParse(options ?? {});
|
|
7669
|
+
if (!parsedOptions.success) throw new ValidationError("Failed to parse tool router ensureConnected options", { cause: parsedOptions.error });
|
|
7670
|
+
const { callbackUrl, alias, experimental, timeout } = parsedOptions.data;
|
|
7671
|
+
const existing = (await this.toolkits({ toolkits: [toolkit] }, requestOptions)).items.find((item) => item.slug.toLowerCase() === toolkit.toLowerCase());
|
|
7672
|
+
if (existing?.isNoAuth) return {
|
|
7673
|
+
toolkit: existing.slug,
|
|
7674
|
+
wasConnected: true
|
|
7675
|
+
};
|
|
7676
|
+
const activeAccount = existing?.connection?.connectedAccount;
|
|
7677
|
+
if (existing?.connection?.isActive && activeAccount) return {
|
|
7678
|
+
toolkit: existing.slug,
|
|
7679
|
+
wasConnected: true,
|
|
7680
|
+
connectedAccount: {
|
|
7681
|
+
id: activeAccount.id,
|
|
7682
|
+
status: activeAccount.status
|
|
7683
|
+
}
|
|
7684
|
+
};
|
|
7685
|
+
const account = await (await this.authorize(toolkit, {
|
|
7686
|
+
...callbackUrl !== void 0 && { callbackUrl },
|
|
7687
|
+
...alias !== void 0 && { alias },
|
|
7688
|
+
...experimental !== void 0 && { experimental }
|
|
7689
|
+
}, requestOptions)).waitForConnection(timeout);
|
|
7690
|
+
return {
|
|
7691
|
+
toolkit: existing?.slug ?? toolkit,
|
|
7692
|
+
wasConnected: false,
|
|
7693
|
+
connectedAccount: {
|
|
7694
|
+
id: account.id,
|
|
7695
|
+
status: account.status
|
|
7696
|
+
}
|
|
7697
|
+
};
|
|
7698
|
+
}
|
|
7699
|
+
/**
|
|
7499
7700
|
* Query the connection state of toolkits in the session.
|
|
7500
7701
|
* Supports pagination and filtering by toolkit slugs.
|
|
7501
7702
|
*/
|
|
@@ -7546,7 +7747,8 @@ var ToolRouterSession = class {
|
|
|
7546
7747
|
...params.toolkits?.length ? { toolkits: params.toolkits } : {},
|
|
7547
7748
|
...experimental ? { experimental } : {}
|
|
7548
7749
|
};
|
|
7549
|
-
const
|
|
7750
|
+
const response = await withCancellation(() => this.client.toolRouter.session.search(this.sessionId, searchParams, requestOptions), requestOptions?.signal);
|
|
7751
|
+
const transformed = transformSearchResponse(response);
|
|
7550
7752
|
return ToolRouterSessionSearchResponseSchema.parse(transformed);
|
|
7551
7753
|
}
|
|
7552
7754
|
/**
|
|
@@ -7560,7 +7762,7 @@ var ToolRouterSession = class {
|
|
|
7560
7762
|
* @param toolSlug - The tool slug to execute
|
|
7561
7763
|
* @param arguments_ - Optional tool arguments
|
|
7562
7764
|
* @param options - Optional execution options
|
|
7563
|
-
* @param options.account - Account identifier for direct app tool execution in multi-account sessions. Helper/meta tools either ignore this top-level field or define their own account-selection fields.
|
|
7765
|
+
* @param options.account - Account identifier for direct app tool execution. Accepted on every project: in multi-account sessions it picks the account; on single-account projects it must match one of the session's active connections for the toolkit. Helper/meta tools either ignore this top-level field or define their own account-selection fields.
|
|
7564
7766
|
* @returns The tool execution result
|
|
7565
7767
|
*/
|
|
7566
7768
|
async execute(toolSlug, arguments_, options, requestOptions) {
|
|
@@ -7582,7 +7784,8 @@ var ToolRouterSession = class {
|
|
|
7582
7784
|
if (options?.account) executeParams.account = options.account;
|
|
7583
7785
|
const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
|
|
7584
7786
|
if (experimental) executeParams.experimental = experimental;
|
|
7585
|
-
const
|
|
7787
|
+
const response = await withCancellation(() => this.client.toolRouter.session.execute(this.sessionId, executeParams, requestOptions), requestOptions?.signal);
|
|
7788
|
+
const transformed = transformExecuteResponse(response);
|
|
7586
7789
|
return ToolRouterSessionExecuteResponseSchema.parse(transformed);
|
|
7587
7790
|
}
|
|
7588
7791
|
/**
|
|
@@ -7612,15 +7815,19 @@ var ToolRouterSession = class {
|
|
|
7612
7815
|
/**
|
|
7613
7816
|
* Partially update the session configuration.
|
|
7614
7817
|
* Only the fields provided will be changed; omitted fields are preserved.
|
|
7615
|
-
* Mutates this session's `configVersion`, `preload`,
|
|
7818
|
+
* Mutates this session's `config`, `configVersion`, `preload`, `sandbox`,
|
|
7819
|
+
* and `warnings` in-place, and resolves to the updated session `config`.
|
|
7616
7820
|
*/
|
|
7617
7821
|
async update(config, requestOptions) {
|
|
7618
|
-
const
|
|
7822
|
+
const parsed = ToolRouterUpdateSessionConfigSchema.parse(config);
|
|
7823
|
+
const params = transformToolRouterUpdateParams(parsed);
|
|
7619
7824
|
const response = await withCancellation(() => this.client.toolRouter.session.patch(this.sessionId, params, requestOptions), requestOptions?.signal);
|
|
7620
7825
|
this.configVersion = response.config_version;
|
|
7826
|
+
this.config = response.config;
|
|
7621
7827
|
this.preload = response.config.preload;
|
|
7622
7828
|
this.sandbox = response.config.workbench;
|
|
7623
7829
|
this.warnings = response.warnings ?? [];
|
|
7830
|
+
return this.config;
|
|
7624
7831
|
}
|
|
7625
7832
|
/**
|
|
7626
7833
|
* Delete this session.
|
|
@@ -7757,6 +7964,7 @@ var ToolRouterSession = class {
|
|
|
7757
7964
|
//#region src/models/ToolRouter.ts
|
|
7758
7965
|
function getSessionMetadata(session) {
|
|
7759
7966
|
return {
|
|
7967
|
+
config: session.config,
|
|
7760
7968
|
preload: session.config.preload,
|
|
7761
7969
|
workbench: session.config.workbench,
|
|
7762
7970
|
configVersion: session.config_version,
|
|
@@ -7768,7 +7976,8 @@ function preloadsAllCustomTools(preload) {
|
|
|
7768
7976
|
}
|
|
7769
7977
|
function prepareInlineCustomTools(options) {
|
|
7770
7978
|
const { customTools, customToolkits, defaultPreload = false, preloadTools } = options;
|
|
7771
|
-
|
|
7979
|
+
const localCustomToolsMap = !!(customTools?.length || customToolkits?.length) ? buildCustomToolsMap(customTools ?? [], customToolkits) : void 0;
|
|
7980
|
+
assertNoCustomToolSlugsInPreload(preloadTools, localCustomToolsMap);
|
|
7772
7981
|
const serializedTools = customTools?.length ? serializeCustomTools(customTools, { defaultPreload }) : void 0;
|
|
7773
7982
|
const serializedToolkits = customToolkits?.length ? serializeCustomToolkits(customToolkits, { defaultPreload }) : void 0;
|
|
7774
7983
|
return serializedTools || serializedToolkits ? {
|
|
@@ -9004,4 +9213,4 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
|
|
|
9004
9213
|
});
|
|
9005
9214
|
|
|
9006
9215
|
//#endregion
|
|
9007
|
-
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, 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, SsrfErrorCodes, 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, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };
|
|
9216
|
+
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, 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, ComposioToolFetchError, 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, MAX_URL_UPLOAD_SIZE_BYTES, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionEnsureConnectedOptionsSchema, 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, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };
|