@composio/core 0.12.0 → 0.13.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/BaseProvider-Brb3o86-.d.mts +29425 -0
- package/dist/{CustomTool-DEB4BQPl.mjs → CustomTool-D9qwyMrv.mjs} +1 -1
- package/dist/{CustomTool-DH18rVQu.d.mts → CustomTool-Dmi6ti3I.d.mts} +1 -1
- package/dist/CustomTool-DrJpOhY2.d.mts +74 -0
- package/dist/{composio-CHnEggnv.d.mts → composio-DHIKRdeG.d.mts} +253 -37
- package/dist/composio-vMwhASRc.d.mts +5698 -0
- package/dist/{customTool.types-DpIdOJjL.d.mts → customTool.types-CKH2R2ia.d.mts} +344 -25
- package/dist/customTool.types-DXin7Cfc.d.mts +2773 -0
- package/dist/docs/error-consistency.md +97 -0
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +306 -0
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +205 -0
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +488 -0
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +94 -0
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +67 -0
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +304 -0
- package/dist/docs/reference/sdk-reference/typescript/meta.json +17 -0
- package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +107 -0
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +163 -0
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +229 -0
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +131 -0
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +169 -0
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +453 -0
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +434 -0
- package/dist/{errors-D5f4pfvI.mjs → errors-DSIlYfl5.mjs} +2 -2
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +27 -4
- package/dist/index.mjs +423 -123
- package/dist/{jsonSchema-daqF3S3d.mjs → jsonSchema-CFKdONpP.mjs} +1 -1
- package/dist/{types-CaI5Z4PA.d.mts → types-D4Id3wXA.d.mts} +1 -1
- package/dist/types-qTbYYBJw.d.mts +12 -0
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
- package/docs/error-consistency.md +97 -0
- package/package.json +4 -3
- package/src/composio.ts +509 -0
- package/src/errors/AuthConfigErrors.ts +23 -0
- package/src/errors/ComposioError.ts +408 -0
- package/src/errors/ConnectedAccountsErrors.ts +158 -0
- package/src/errors/ConnectionRequestErrors.ts +32 -0
- package/src/errors/FileModifierErrors.ts +100 -0
- package/src/errors/PusherErrors.ts +28 -0
- package/src/errors/RemoteFileErrors.ts +62 -0
- package/src/errors/SDKErrors.ts +92 -0
- package/src/errors/ToolErrors.ts +244 -0
- package/src/errors/ToolkitErrors.ts +39 -0
- package/src/errors/TriggerErrors.ts +120 -0
- package/src/errors/ValidationErrors.ts +99 -0
- package/src/errors/index.ts +41 -0
- package/src/experimental/index.ts +28 -0
- package/src/index.ts +64 -0
- package/src/lib/toolRouterConstants.ts +1 -0
- package/src/lib/toolRouterParams.ts +306 -0
- package/src/models/AuthConfigs.ts +398 -0
- package/src/models/AuthScheme.ts +206 -0
- package/src/models/ConnectedAccounts.ts +735 -0
- package/src/models/ConnectionRequest.ts +150 -0
- package/src/models/CustomTool.ts +676 -0
- package/src/models/Experimental.ts +202 -0
- package/src/models/Files.node.ts +93 -0
- package/src/models/Files.workerd.ts +49 -0
- package/src/models/MCP.ts +478 -0
- package/src/models/RemoteFile.ts +172 -0
- package/src/models/SessionContext.ts +147 -0
- package/src/models/Sessions.ts +21 -0
- package/src/models/ToolRouter.ts +391 -0
- package/src/models/ToolRouterSession.ts +827 -0
- package/src/models/ToolRouterSessionFileMount.ts +389 -0
- package/src/models/Toolkits.ts +412 -0
- package/src/models/Tools.ts +1260 -0
- package/src/models/Triggers.ts +1381 -0
- package/src/models/customToolExecution.ts +118 -0
- package/src/models/inlineCustomToolsPayload.ts +17 -0
- package/src/models/proxyParamsTransform.ts +26 -0
- package/src/provider/BaseProvider.ts +138 -0
- package/src/provider/ComposioProvider.ts +29 -0
- package/src/provider/OpenAIProvider.ts +547 -0
- package/src/services/internal/InternalService.ts +50 -0
- package/src/services/internal/InternalService.types.ts +14 -0
- package/src/services/pusher/Pusher.ts +230 -0
- package/src/services/telemetry/TelemetryService.ts +48 -0
- package/src/services/telemetry/TelemetryService.types.ts +67 -0
- package/src/telemetry/BatchProcessor.ts +77 -0
- package/src/telemetry/README.md +123 -0
- package/src/telemetry/Telemetry.ts +356 -0
- package/src/types/ToolRouterSessionFilesMount.types.ts +96 -0
- package/src/types/authConfigs.types.ts +174 -0
- package/src/types/composio.types.ts +1 -0
- package/src/types/connectedAccountAuthStates.types.ts +852 -0
- package/src/types/connectedAccounts.types.ts +395 -0
- package/src/types/connectionRequest.types.ts +16 -0
- package/src/types/customTool.types.ts +261 -0
- package/src/types/files.types.ts +15 -0
- package/src/types/mcp.experimental.types.ts +163 -0
- package/src/types/mcp.types.ts +362 -0
- package/src/types/modifiers.types.ts +663 -0
- package/src/types/org.types.ts +0 -0
- package/src/types/provider.types.ts +41 -0
- package/src/types/pusher.types.ts +18 -0
- package/src/types/requestOptions.types.ts +62 -0
- package/src/types/telemetry.types.ts +89 -0
- package/src/types/tool.types.ts +408 -0
- package/src/types/toolRouter.types.ts +761 -0
- package/src/types/toolkit.types.ts +130 -0
- package/src/types/triggers.types.ts +401 -0
- package/src/types/webhookEvents.types.ts +219 -0
- package/src/utils/buffer.ts +30 -0
- package/src/utils/cancellation.ts +22 -0
- package/src/utils/config-defaults/ConfigDefaults.node.ts +7 -0
- package/src/utils/config-defaults/ConfigDefaults.workerd.ts +10 -0
- package/src/utils/config-defaults/index.ts +1 -0
- package/src/utils/config-defaults/types.ts +14 -0
- package/src/utils/constants.ts +22 -0
- package/src/utils/crypto.ts +34 -0
- package/src/utils/env.ts +34 -0
- package/src/utils/fileDirs.ts +81 -0
- package/src/utils/fileUtils.node.ts +458 -0
- package/src/utils/json-schema.ts +1 -0
- package/src/utils/jsonSchema.ts +355 -0
- package/src/utils/logger.ts +99 -0
- package/src/utils/mime.ts +75 -0
- package/src/utils/modifiers/FileToolModifier.node.ts +477 -0
- package/src/utils/modifiers/FileToolModifier.utils.neutral.ts +132 -0
- package/src/utils/modifiers/FileToolModifier.workerd.ts +51 -0
- package/src/utils/pagination.ts +73 -0
- package/src/utils/pusher.ts +286 -0
- package/src/utils/schemaPropertyKeys.ts +433 -0
- package/src/utils/sdk.ts +110 -0
- package/src/utils/sensitiveFileUploadPaths.node.ts +105 -0
- package/src/utils/session.ts +114 -0
- package/src/utils/toolArguments.ts +73 -0
- package/src/utils/toolkitVersion.ts +26 -0
- package/src/utils/transform.ts +42 -0
- package/src/utils/transformers/authConfigs.ts +107 -0
- package/src/utils/transformers/connectedAccounts.ts +119 -0
- package/src/utils/transformers/mcp.ts +164 -0
- package/src/utils/transformers/toolRouterResponseTransform.ts +160 -0
- package/src/utils/transformers/toolkits.ts +100 -0
- package/src/utils/transformers/triggers.ts +118 -0
- package/src/utils/uploadDirAllowlist.node.ts +178 -0
- package/src/utils/uuid.ts +7 -0
- package/src/utils/version.ts +58 -0
- package/src/utils/zodSchema.ts +90 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-
|
|
1
|
+
import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-CKH2R2ia.mjs";
|
|
2
2
|
import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/models/CustomTool.d.ts
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-DXin7Cfc.mjs";
|
|
2
|
+
import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/models/CustomTool.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a custom tool for use in tool router sessions.
|
|
7
|
+
*
|
|
8
|
+
* The returned object is a lightweight reference containing the tool's metadata
|
|
9
|
+
* and execute function. Pass it to `composio.create(userId, { experimental: { customTools: [...] } })`
|
|
10
|
+
* to bind it to a session.
|
|
11
|
+
*
|
|
12
|
+
* Just return the result data from `execute`, or throw an error.
|
|
13
|
+
* The SDK wraps it into the standard response format internally.
|
|
14
|
+
*
|
|
15
|
+
* **Slug naming:** The slug you provide is automatically prefixed with `LOCAL_` when
|
|
16
|
+
* exposed to the agent (e.g. `'GREP'` becomes `LOCAL_GREP`). If the tool is inside a
|
|
17
|
+
* custom toolkit, the toolkit slug is also included (e.g. `LOCAL_DEV_TOOLS_GREP`).
|
|
18
|
+
* The `LOCAL_` prefix is reserved and cannot be used in your slug.
|
|
19
|
+
*
|
|
20
|
+
* @param slug - Unique tool identifier (alphanumeric, underscores, hyphens; no LOCAL_ or COMPOSIO_ prefix)
|
|
21
|
+
* @param options - Tool definition including name, schema, and execute function
|
|
22
|
+
* @returns A CustomTool to pass to session creation
|
|
23
|
+
*
|
|
24
|
+
* @example Standalone tool (no auth)
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const grep = createCustomTool('GREP', {
|
|
27
|
+
* name: 'Grep Search',
|
|
28
|
+
* description: 'Search for patterns in files',
|
|
29
|
+
* inputParams: z.object({ pattern: z.string(), path: z.string() }),
|
|
30
|
+
* execute: async (input) => ({ matches: [] }),
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Tool extending a Composio toolkit (inherits auth)
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const getImportant = createCustomTool('GET_IMPORTANT_EMAILS', {
|
|
37
|
+
* name: 'Get Important Emails',
|
|
38
|
+
* description: 'Fetch high-priority emails',
|
|
39
|
+
* extendsToolkit: 'gmail',
|
|
40
|
+
* inputParams: z.object({ limit: z.number().default(10) }),
|
|
41
|
+
* execute: async (input, ctx) => {
|
|
42
|
+
* // Same response shape as session.execute(): { data, error, logId }
|
|
43
|
+
* const result = await ctx.execute('GMAIL_SEARCH', { query: 'is:important' });
|
|
44
|
+
* return { emails: result.data };
|
|
45
|
+
* },
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
declare function createCustomTool<T extends AnyZodSchema>(slug: string, options: CreateCustomToolParams<T>): CustomTool;
|
|
50
|
+
/**
|
|
51
|
+
* Create a custom toolkit that groups related tools.
|
|
52
|
+
*
|
|
53
|
+
* Tools passed here must NOT have `extendsToolkit` set — they inherit the toolkit identity instead.
|
|
54
|
+
*
|
|
55
|
+
* **Slug naming:** The toolkit slug becomes part of the final tool slug exposed to the agent.
|
|
56
|
+
* For example, a toolkit `'DEV_TOOLS'` with a tool `'GREP'` produces `LOCAL_DEV_TOOLS_GREP`.
|
|
57
|
+
* The `LOCAL_` prefix is reserved and cannot be used in your slug.
|
|
58
|
+
*
|
|
59
|
+
* @param slug - Unique toolkit identifier (alphanumeric, underscores, hyphens; no LOCAL_ or COMPOSIO_ prefix)
|
|
60
|
+
* @param options - Toolkit definition including name, description, and tools
|
|
61
|
+
* @returns A CustomToolkit to pass to session creation
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const devTools = createCustomToolkit('DEV_TOOLS', {
|
|
66
|
+
* name: 'Dev Tools',
|
|
67
|
+
* description: 'Local dev utilities',
|
|
68
|
+
* tools: [grepTool, sedTool],
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare function createCustomToolkit(slug: string, options: CreateCustomToolkitParams): CustomToolkit;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { createCustomToolkit as n, createCustomTool as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $t as ExecuteToolModifiers, An as ToolRetrievalOptions, Cn as ToolList, Ln as ToolkitVersionParam, On as ToolProxyParams, X as McpServerGetResponse, _n as ToolExecuteMetaParams, at as ExecuteToolFnOptions, gn as Tool, hn as SchemaModifierOptions, n as BaseComposioProvider, nn as SessionExecuteMetaModifiers, r as BaseNonAgenticProvider, tn as ProviderOptions, tt as McpUrlResponse, wn as ToolListParams, xn as ToolExecuteResponse, yn as ToolExecuteParams } from "./BaseProvider-BBnsv9kS.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Cn as UpdateConnectedAccountAclParams, D as Session, M as SessionWithoutMcp, Qt as ConnectedAccountListResponse, Rt as ConnectionRequest, Tn as UpdateConnectedAccountParams, Xt as ConnectedAccountListParams, f as CustomToolkit, fn as CreateConnectedAccountLinkOptions, gn as CreateConnectedAccountOptions, o as CustomTool, rn as ConnectedAccountRetrieveResponse, tn as ConnectedAccountRefreshOptions, z as ToolRouterCreateSessionConfig } from "./customTool.types-CKH2R2ia.mjs";
|
|
3
3
|
import ComposioClient, { Composio } from "@composio/client";
|
|
4
4
|
import z$1, { z } from "zod/v3";
|
|
5
5
|
import { OpenAI } from "openai";
|
|
@@ -2046,13 +2046,13 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
|
|
|
2046
2046
|
noOfConnections: number;
|
|
2047
2047
|
createdAt?: string | undefined;
|
|
2048
2048
|
authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
|
|
2049
|
-
isComposioManaged?: boolean | undefined;
|
|
2050
2049
|
credentials?: Record<string, unknown> | undefined;
|
|
2051
2050
|
toolAccessConfig?: {
|
|
2052
2051
|
toolsForConnectedAccountCreation?: string[] | undefined;
|
|
2053
2052
|
toolsAvailableForExecution?: string[] | undefined;
|
|
2054
2053
|
} | undefined;
|
|
2055
2054
|
isEnabledForToolRouter?: boolean | undefined;
|
|
2055
|
+
isComposioManaged?: boolean | undefined;
|
|
2056
2056
|
expectedInputFields?: unknown[] | undefined;
|
|
2057
2057
|
restrictToFollowingTools?: string[] | undefined;
|
|
2058
2058
|
createdBy?: string | undefined;
|
|
@@ -2068,13 +2068,13 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
|
|
|
2068
2068
|
noOfConnections: number;
|
|
2069
2069
|
createdAt?: string | undefined;
|
|
2070
2070
|
authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
|
|
2071
|
-
isComposioManaged?: boolean | undefined;
|
|
2072
2071
|
credentials?: Record<string, unknown> | undefined;
|
|
2073
2072
|
toolAccessConfig?: {
|
|
2074
2073
|
toolsForConnectedAccountCreation?: string[] | undefined;
|
|
2075
2074
|
toolsAvailableForExecution?: string[] | undefined;
|
|
2076
2075
|
} | undefined;
|
|
2077
2076
|
isEnabledForToolRouter?: boolean | undefined;
|
|
2077
|
+
isComposioManaged?: boolean | undefined;
|
|
2078
2078
|
expectedInputFields?: unknown[] | undefined;
|
|
2079
2079
|
restrictToFollowingTools?: string[] | undefined;
|
|
2080
2080
|
createdBy?: string | undefined;
|
|
@@ -2153,13 +2153,13 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2153
2153
|
noOfConnections: number;
|
|
2154
2154
|
createdAt?: string | undefined;
|
|
2155
2155
|
authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
|
|
2156
|
-
isComposioManaged?: boolean | undefined;
|
|
2157
2156
|
credentials?: Record<string, unknown> | undefined;
|
|
2158
2157
|
toolAccessConfig?: {
|
|
2159
2158
|
toolsForConnectedAccountCreation?: string[] | undefined;
|
|
2160
2159
|
toolsAvailableForExecution?: string[] | undefined;
|
|
2161
2160
|
} | undefined;
|
|
2162
2161
|
isEnabledForToolRouter?: boolean | undefined;
|
|
2162
|
+
isComposioManaged?: boolean | undefined;
|
|
2163
2163
|
expectedInputFields?: unknown[] | undefined;
|
|
2164
2164
|
restrictToFollowingTools?: string[] | undefined;
|
|
2165
2165
|
createdBy?: string | undefined;
|
|
@@ -2175,13 +2175,13 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2175
2175
|
noOfConnections: number;
|
|
2176
2176
|
createdAt?: string | undefined;
|
|
2177
2177
|
authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
|
|
2178
|
-
isComposioManaged?: boolean | undefined;
|
|
2179
2178
|
credentials?: Record<string, unknown> | undefined;
|
|
2180
2179
|
toolAccessConfig?: {
|
|
2181
2180
|
toolsForConnectedAccountCreation?: string[] | undefined;
|
|
2182
2181
|
toolsAvailableForExecution?: string[] | undefined;
|
|
2183
2182
|
} | undefined;
|
|
2184
2183
|
isEnabledForToolRouter?: boolean | undefined;
|
|
2184
|
+
isComposioManaged?: boolean | undefined;
|
|
2185
2185
|
expectedInputFields?: unknown[] | undefined;
|
|
2186
2186
|
restrictToFollowingTools?: string[] | undefined;
|
|
2187
2187
|
createdBy?: string | undefined;
|
|
@@ -2201,13 +2201,13 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2201
2201
|
noOfConnections: number;
|
|
2202
2202
|
createdAt?: string | undefined;
|
|
2203
2203
|
authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
|
|
2204
|
-
isComposioManaged?: boolean | undefined;
|
|
2205
2204
|
credentials?: Record<string, unknown> | undefined;
|
|
2206
2205
|
toolAccessConfig?: {
|
|
2207
2206
|
toolsForConnectedAccountCreation?: string[] | undefined;
|
|
2208
2207
|
toolsAvailableForExecution?: string[] | undefined;
|
|
2209
2208
|
} | undefined;
|
|
2210
2209
|
isEnabledForToolRouter?: boolean | undefined;
|
|
2210
|
+
isComposioManaged?: boolean | undefined;
|
|
2211
2211
|
expectedInputFields?: unknown[] | undefined;
|
|
2212
2212
|
restrictToFollowingTools?: string[] | undefined;
|
|
2213
2213
|
createdBy?: string | undefined;
|
|
@@ -2227,13 +2227,13 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2227
2227
|
noOfConnections: number;
|
|
2228
2228
|
createdAt?: string | undefined;
|
|
2229
2229
|
authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
|
|
2230
|
-
isComposioManaged?: boolean | undefined;
|
|
2231
2230
|
credentials?: Record<string, unknown> | undefined;
|
|
2232
2231
|
toolAccessConfig?: {
|
|
2233
2232
|
toolsForConnectedAccountCreation?: string[] | undefined;
|
|
2234
2233
|
toolsAvailableForExecution?: string[] | undefined;
|
|
2235
2234
|
} | undefined;
|
|
2236
2235
|
isEnabledForToolRouter?: boolean | undefined;
|
|
2236
|
+
isComposioManaged?: boolean | undefined;
|
|
2237
2237
|
expectedInputFields?: unknown[] | undefined;
|
|
2238
2238
|
restrictToFollowingTools?: string[] | undefined;
|
|
2239
2239
|
createdBy?: string | undefined;
|
|
@@ -3313,6 +3313,30 @@ declare const WebhookVersions: {
|
|
|
3313
3313
|
readonly V3: "V3";
|
|
3314
3314
|
};
|
|
3315
3315
|
type WebhookVersion = (typeof WebhookVersions)[keyof typeof WebhookVersions];
|
|
3316
|
+
declare const DefaultWebhookSubscriptionEvents: readonly ["composio.trigger.message"];
|
|
3317
|
+
declare const SetWebhookSubscriptionParamsSchema: z.ZodObject<{
|
|
3318
|
+
/** HTTPS URL to receive webhook events. */webhookUrl: z.ZodString; /** Event types to subscribe to. Defaults to trigger messages. */
|
|
3319
|
+
enabledEvents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; /** Webhook payload version. Defaults to V3. */
|
|
3320
|
+
version: z.ZodOptional<z.ZodEnum<["V1", "V2", "V3"]>>;
|
|
3321
|
+
}, "strip", z.ZodTypeAny, {
|
|
3322
|
+
webhookUrl: string;
|
|
3323
|
+
version?: "V1" | "V2" | "V3" | undefined;
|
|
3324
|
+
enabledEvents?: string[] | undefined;
|
|
3325
|
+
}, {
|
|
3326
|
+
webhookUrl: string;
|
|
3327
|
+
version?: "V1" | "V2" | "V3" | undefined;
|
|
3328
|
+
enabledEvents?: string[] | undefined;
|
|
3329
|
+
}>;
|
|
3330
|
+
type SetWebhookSubscriptionParams = z.infer<typeof SetWebhookSubscriptionParamsSchema>;
|
|
3331
|
+
type WebhookSubscription = {
|
|
3332
|
+
id: string;
|
|
3333
|
+
webhookUrl: string;
|
|
3334
|
+
version: WebhookVersion;
|
|
3335
|
+
enabledEvents: string[];
|
|
3336
|
+
secret?: string;
|
|
3337
|
+
createdAt?: string;
|
|
3338
|
+
updatedAt?: string;
|
|
3339
|
+
};
|
|
3316
3340
|
/**
|
|
3317
3341
|
* Parameters for verifying a webhook signature
|
|
3318
3342
|
*/
|
|
@@ -3357,6 +3381,37 @@ declare const VerifyWebhookParamsSchema: z.ZodObject<{
|
|
|
3357
3381
|
tolerance?: number | undefined;
|
|
3358
3382
|
}>;
|
|
3359
3383
|
type VerifyWebhookParams = z.input<typeof VerifyWebhookParamsSchema>;
|
|
3384
|
+
/**
|
|
3385
|
+
* An incoming HTTP request that carries a Composio webhook.
|
|
3386
|
+
*
|
|
3387
|
+
* Accepts either:
|
|
3388
|
+
* - A Fetch API `Request` (Next.js App Router, Hono, Remix, Cloudflare Workers).
|
|
3389
|
+
* - A plain object `{ body, headers }` (Express with `express.raw`, Next.js
|
|
3390
|
+
* Pages Router `req`). `body` may be a string, a Buffer/Uint8Array, or an
|
|
3391
|
+
* already-parsed object; `headers` may be a `Headers` instance or a plain
|
|
3392
|
+
* record of `string | string[] | undefined`.
|
|
3393
|
+
*/
|
|
3394
|
+
type WebhookRequestLike = Request | {
|
|
3395
|
+
body: unknown;
|
|
3396
|
+
headers: unknown;
|
|
3397
|
+
};
|
|
3398
|
+
/**
|
|
3399
|
+
* Options for {@link Triggers.parse}.
|
|
3400
|
+
*/
|
|
3401
|
+
type ParseWebhookOptions = {
|
|
3402
|
+
/**
|
|
3403
|
+
* The webhook secret used to sign the payload (from the Composio dashboard).
|
|
3404
|
+
* When provided, the request signature is verified before the payload is
|
|
3405
|
+
* returned. When omitted, the payload is parsed without verification.
|
|
3406
|
+
*/
|
|
3407
|
+
verifySecret?: string;
|
|
3408
|
+
/**
|
|
3409
|
+
* Maximum allowed age of the webhook in seconds (default: 300 = 5 minutes).
|
|
3410
|
+
* Only used when `verifySecret` is provided. Set to 0 to disable timestamp
|
|
3411
|
+
* validation.
|
|
3412
|
+
*/
|
|
3413
|
+
tolerance?: number;
|
|
3414
|
+
};
|
|
3360
3415
|
/**
|
|
3361
3416
|
* Result of a successful webhook verification.
|
|
3362
3417
|
* Contains the parsed payload along with version information.
|
|
@@ -3378,6 +3433,20 @@ declare class Triggers<TProvider extends BaseComposioProvider<unknown, unknown,
|
|
|
3378
3433
|
private pusherService;
|
|
3379
3434
|
private toolkitVersions;
|
|
3380
3435
|
constructor(client: ComposioClient, config?: ComposioConfig<TProvider>);
|
|
3436
|
+
/**
|
|
3437
|
+
* Create or update the project webhook subscription used for webhook delivery.
|
|
3438
|
+
*
|
|
3439
|
+
* If a subscription already exists, the first subscription is updated. Otherwise a new
|
|
3440
|
+
* subscription is created. By default this subscribes to V3 trigger message events.
|
|
3441
|
+
*
|
|
3442
|
+
* @example
|
|
3443
|
+
* ```ts
|
|
3444
|
+
* await composio.triggers.setWebhookSubscription({
|
|
3445
|
+
* webhookUrl: `${APP_URL}/webhooks/composio`,
|
|
3446
|
+
* });
|
|
3447
|
+
* ```
|
|
3448
|
+
*/
|
|
3449
|
+
setWebhookSubscription(params: SetWebhookSubscriptionParams): Promise<WebhookSubscription>;
|
|
3381
3450
|
/**
|
|
3382
3451
|
* Fetch list of all the active triggers
|
|
3383
3452
|
*
|
|
@@ -3509,6 +3578,78 @@ declare class Triggers<TProvider extends BaseComposioProvider<unknown, unknown,
|
|
|
3509
3578
|
* ```
|
|
3510
3579
|
*/
|
|
3511
3580
|
unsubscribe(): Promise<void>;
|
|
3581
|
+
/**
|
|
3582
|
+
* Parse an incoming webhook HTTP request into a typed, normalized trigger payload.
|
|
3583
|
+
*
|
|
3584
|
+
* Dump the incoming request in and get back the parsed Composio trigger event.
|
|
3585
|
+
* When `verifySecret` is provided, the request signature is verified before the
|
|
3586
|
+
* payload is returned (delegating to {@link verifyWebhook}); without it, the body
|
|
3587
|
+
* is parsed without verification.
|
|
3588
|
+
*
|
|
3589
|
+
* The `request` may be either a Fetch API `Request` (Next.js App Router, Hono,
|
|
3590
|
+
* Remix) or a plain `{ body, headers }` object (Express with `express.raw`,
|
|
3591
|
+
* Next.js Pages Router `req`). The signature headers (`webhook-id`,
|
|
3592
|
+
* `webhook-timestamp`, `webhook-signature`) are read case-insensitively.
|
|
3593
|
+
*
|
|
3594
|
+
* @param {WebhookRequestLike} request - The incoming webhook HTTP request
|
|
3595
|
+
* @param {ParseWebhookOptions} [options] - Parse options
|
|
3596
|
+
* @param {string} [options.verifySecret] - Webhook secret; when set, the signature is verified
|
|
3597
|
+
* @param {number} [options.tolerance=300] - Max webhook age in seconds (only used when verifying)
|
|
3598
|
+
* @returns {Promise<VerifyWebhookResult>} The parsed (and optionally verified) webhook payload
|
|
3599
|
+
*
|
|
3600
|
+
* @throws {ValidationError} If `verifySecret` is set but the signature headers are missing
|
|
3601
|
+
* @throws {ComposioWebhookSignatureVerificationError} If signature verification fails
|
|
3602
|
+
* @throws {ComposioWebhookPayloadError} If the payload cannot be parsed
|
|
3603
|
+
*
|
|
3604
|
+
* @example
|
|
3605
|
+
* ```ts
|
|
3606
|
+
* // Express with express.raw (verify the signature)
|
|
3607
|
+
* app.post('/webhooks/composio', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
3608
|
+
* try {
|
|
3609
|
+
* const result = await composio.triggers.parse(req, {
|
|
3610
|
+
* verifySecret: process.env.COMPOSIO_WEBHOOK_SECRET,
|
|
3611
|
+
* });
|
|
3612
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
3613
|
+
* console.log('Event data:', result.payload.payload);
|
|
3614
|
+
* res.sendStatus(200);
|
|
3615
|
+
* } catch (error) {
|
|
3616
|
+
* res.sendStatus(401);
|
|
3617
|
+
* }
|
|
3618
|
+
* });
|
|
3619
|
+
*
|
|
3620
|
+
* // Express without verifying (parse only)
|
|
3621
|
+
* app.post('/webhooks/composio', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
3622
|
+
* const result = await composio.triggers.parse(req);
|
|
3623
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
3624
|
+
* res.sendStatus(200);
|
|
3625
|
+
* });
|
|
3626
|
+
* ```
|
|
3627
|
+
*
|
|
3628
|
+
* @example
|
|
3629
|
+
* ```ts
|
|
3630
|
+
* // Next.js App Router (Request) — verify the signature
|
|
3631
|
+
* export async function POST(request: Request) {
|
|
3632
|
+
* try {
|
|
3633
|
+
* const result = await composio.triggers.parse(request, {
|
|
3634
|
+
* verifySecret: process.env.COMPOSIO_WEBHOOK_SECRET,
|
|
3635
|
+
* });
|
|
3636
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
3637
|
+
* console.log('Event data:', result.payload.payload);
|
|
3638
|
+
* return new Response('OK', { status: 200 });
|
|
3639
|
+
* } catch (error) {
|
|
3640
|
+
* return new Response('Unauthorized', { status: 401 });
|
|
3641
|
+
* }
|
|
3642
|
+
* }
|
|
3643
|
+
*
|
|
3644
|
+
* // Next.js App Router — parse only (no verification)
|
|
3645
|
+
* export async function POST(request: Request) {
|
|
3646
|
+
* const result = await composio.triggers.parse(request);
|
|
3647
|
+
* console.log('Trigger:', result.payload.triggerSlug);
|
|
3648
|
+
* return new Response('OK', { status: 200 });
|
|
3649
|
+
* }
|
|
3650
|
+
* ```
|
|
3651
|
+
*/
|
|
3652
|
+
parse(request: WebhookRequestLike, options?: ParseWebhookOptions): Promise<VerifyWebhookResult>;
|
|
3512
3653
|
/**
|
|
3513
3654
|
* Verify an incoming webhook payload and signature.
|
|
3514
3655
|
*
|
|
@@ -3898,7 +4039,7 @@ declare class ConnectedAccounts {
|
|
|
3898
4039
|
*
|
|
3899
4040
|
* @param userId {string} - The external user ID to create the connected account for.
|
|
3900
4041
|
* @param authConfigId {string} - The auth config ID to create the connected account for.
|
|
3901
|
-
* @param options {
|
|
4042
|
+
* @param options {CreateConnectedAccountLinkOptions} - Options for creating a new connected account link.
|
|
3902
4043
|
* @param options.callbackUrl {string} - The url to redirect the user to post connecting their account.
|
|
3903
4044
|
* @returns {ConnectionRequest} Connection request object
|
|
3904
4045
|
*
|
|
@@ -4056,11 +4197,41 @@ declare class ConnectedAccounts {
|
|
|
4056
4197
|
* ```
|
|
4057
4198
|
*/
|
|
4058
4199
|
disable(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
4200
|
+
/**
|
|
4201
|
+
* Update the per-user ACL on a SHARED connected account.
|
|
4202
|
+
* **Experimental — shape may change in future releases.**
|
|
4203
|
+
*
|
|
4204
|
+
* Only meaningful for SHARED connections — calling this on a PRIVATE
|
|
4205
|
+
* connection raises `ComposioAclOnlyForSharedError` (400). ACL writes
|
|
4206
|
+
* require the connection's creator or an API key.
|
|
4207
|
+
*
|
|
4208
|
+
* PATCH semantics: omit a field to leave it unchanged; pass an empty
|
|
4209
|
+
* array to clear an allow/deny list. At least one field must be
|
|
4210
|
+
* provided.
|
|
4211
|
+
*
|
|
4212
|
+
* @param {string} nanoid - The unique identifier of the connected account
|
|
4213
|
+
* @param {UpdateConnectedAccountAclParams} params - The ACL fields to patch
|
|
4214
|
+
* @returns {Promise<ConnectedAccountPatchResponse>} The PATCH response
|
|
4215
|
+
*
|
|
4216
|
+
* @example
|
|
4217
|
+
* ```typescript
|
|
4218
|
+
* // Allow every userId to use this SHARED connection
|
|
4219
|
+
* await composio.connectedAccounts.updateAcl('ca_abc123', { allowAllUsers: true });
|
|
4220
|
+
*
|
|
4221
|
+
* // Targeted allow list
|
|
4222
|
+
* await composio.connectedAccounts.updateAcl('ca_abc123', {
|
|
4223
|
+
* allowedUserIds: ['user_alice', 'user_bob'],
|
|
4224
|
+
* });
|
|
4225
|
+
*
|
|
4226
|
+
* // Clear the allow list (back to deny-by-default unless allowAllUsers is true)
|
|
4227
|
+
* await composio.connectedAccounts.updateAcl('ca_abc123', { allowedUserIds: [] });
|
|
4228
|
+
* ```
|
|
4229
|
+
*/
|
|
4230
|
+
updateAcl(nanoid: string, params: UpdateConnectedAccountAclParams): Promise<ConnectedAccountPatchResponse>;
|
|
4059
4231
|
/**
|
|
4060
4232
|
* Enable or disable a connected account. Accepts `{ enabled: boolean }`.
|
|
4061
4233
|
*
|
|
4062
|
-
*
|
|
4063
|
-
* `composio.experimental.updateAcl()`.
|
|
4234
|
+
* Use `updateAcl()` for ACL writes on SHARED connections.
|
|
4064
4235
|
*
|
|
4065
4236
|
* @param {string} nanoid - The unique identifier of the connected account
|
|
4066
4237
|
* @param {UpdateConnectedAccountParams} params - The update parameters
|
|
@@ -4076,15 +4247,11 @@ declare class ConnectedAccounts {
|
|
|
4076
4247
|
}
|
|
4077
4248
|
//#endregion
|
|
4078
4249
|
//#region src/models/Experimental.d.ts
|
|
4079
|
-
/**
|
|
4080
|
-
* `composio.experimental` namespace. Mirrors the Python SDK's
|
|
4081
|
-
* `composio.experimental` mount, with one method per experimental
|
|
4082
|
-
* surface. **Shape may change in future releases.**
|
|
4083
|
-
*/
|
|
4084
4250
|
declare class Experimental {
|
|
4085
4251
|
private client;
|
|
4086
4252
|
constructor(client: ComposioClient);
|
|
4087
4253
|
/**
|
|
4254
|
+
* Compatibility alias for `composio.connectedAccounts.updateAcl(...)`.
|
|
4088
4255
|
* Update the per-user ACL on a SHARED connected account.
|
|
4089
4256
|
* **Experimental — shape may change in future releases.**
|
|
4090
4257
|
*
|
|
@@ -4109,21 +4276,21 @@ declare class Experimental {
|
|
|
4109
4276
|
* const composio = new Composio({ apiKey: '...' });
|
|
4110
4277
|
*
|
|
4111
4278
|
* // Allow every userId to use this connection
|
|
4112
|
-
* await composio.
|
|
4279
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', { allowAllUsers: true });
|
|
4113
4280
|
*
|
|
4114
4281
|
* // Everyone except a specific user
|
|
4115
|
-
* await composio.
|
|
4282
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', {
|
|
4116
4283
|
* allowAllUsers: true,
|
|
4117
4284
|
* notAllowedUserIds: ['user_bob'],
|
|
4118
4285
|
* });
|
|
4119
4286
|
*
|
|
4120
4287
|
* // Targeted allow
|
|
4121
|
-
* await composio.
|
|
4288
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', {
|
|
4122
4289
|
* allowedUserIds: ['user_alice', 'user_bob'],
|
|
4123
4290
|
* });
|
|
4124
4291
|
*
|
|
4125
4292
|
* // Revoke a previously-granted allow list (back to deny-by-default)
|
|
4126
|
-
* await composio.
|
|
4293
|
+
* await composio.connectedAccounts.updateAcl('ca_abc', { allowedUserIds: [] });
|
|
4127
4294
|
* ```
|
|
4128
4295
|
*
|
|
4129
4296
|
* **Empty-array semantics — read carefully.** Passing `[]` for either
|
|
@@ -4139,6 +4306,8 @@ declare class Experimental {
|
|
|
4139
4306
|
* the updated ACL block, call
|
|
4140
4307
|
* `composio.connectedAccounts.get(nanoid)` after the promise
|
|
4141
4308
|
* resolves and inspect `account.experimental?.aclConfigForShared`.
|
|
4309
|
+
*
|
|
4310
|
+
* @deprecated Use `composio.connectedAccounts.updateAcl(...)` instead — ACL updates graduated onto the `connectedAccounts` mount. This experimental alias is kept only for backwards compatibility and will be removed once the API graduates. Prefer the `connectedAccounts` mount; do not generate new code against this alias.
|
|
4142
4311
|
*/
|
|
4143
4312
|
updateAcl(nanoid: string, params: UpdateConnectedAccountAclParams): Promise<ConnectedAccountPatchResponse>;
|
|
4144
4313
|
}
|
|
@@ -4543,6 +4712,12 @@ type MCPUpdateParams = z$1.infer<typeof MCPUpdateParamsSchema>;
|
|
|
4543
4712
|
* MCP (Model Control Protocol) class
|
|
4544
4713
|
* Handles MCP server operations.
|
|
4545
4714
|
* When `config.experimental.mcp` is enabled, this class augments the features of `composio.mcp`.
|
|
4715
|
+
*
|
|
4716
|
+
* @deprecated Use a session's MCP endpoint instead: `composio.create(userId, { mcp: true })`
|
|
4717
|
+
* returns a session that exposes `session.mcp.url` / `session.mcp.headers`. MCP is now
|
|
4718
|
+
* opt-in per session; the standalone `composio.mcp` server-management API is kept only for
|
|
4719
|
+
* backwards compatibility. Prefer the session MCP endpoint; do not generate new code against
|
|
4720
|
+
* `composio.mcp`. See https://docs.composio.dev/docs/sessions-via-mcp
|
|
4546
4721
|
*/
|
|
4547
4722
|
declare class MCP {
|
|
4548
4723
|
client: Composio;
|
|
@@ -5105,7 +5280,7 @@ declare class ToolRouter<TToolCollection, TTool, TProvider extends BaseComposioP
|
|
|
5105
5280
|
*
|
|
5106
5281
|
* const composio = new Composio();
|
|
5107
5282
|
*
|
|
5108
|
-
* const session = await composio.create('user_123', {
|
|
5283
|
+
* const session = await composio.sessions.create('user_123', {
|
|
5109
5284
|
* toolkits: ['gmail'],
|
|
5110
5285
|
* manageConnections: true,
|
|
5111
5286
|
* experimental: {
|
|
@@ -5115,7 +5290,10 @@ declare class ToolRouter<TToolCollection, TTool, TProvider extends BaseComposioP
|
|
|
5115
5290
|
* });
|
|
5116
5291
|
* ```
|
|
5117
5292
|
*/
|
|
5118
|
-
create(userId: string, config
|
|
5293
|
+
create(userId: string, config: ToolRouterCreateSessionConfig & {
|
|
5294
|
+
mcp: true;
|
|
5295
|
+
}, requestOptions?: ComposioRequestOptions): Promise<Session<TToolCollection, TTool, TProvider>>;
|
|
5296
|
+
create(userId: string, config?: ToolRouterCreateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<SessionWithoutMcp<TToolCollection, TTool, TProvider>>;
|
|
5119
5297
|
/**
|
|
5120
5298
|
* Use an existing session
|
|
5121
5299
|
* @param id {string} The id of the session to use
|
|
@@ -5127,16 +5305,34 @@ declare class ToolRouter<TToolCollection, TTool, TProvider extends BaseComposioP
|
|
|
5127
5305
|
*
|
|
5128
5306
|
* const composio = new Composio();
|
|
5129
5307
|
* const id = 'session_123';
|
|
5130
|
-
* const session = await composio.
|
|
5308
|
+
* const session = await composio.sessions.use(id);
|
|
5131
5309
|
*
|
|
5132
5310
|
* console.log(session.mcp.url);
|
|
5133
5311
|
* console.log(session.mcp.headers);
|
|
5134
5312
|
* ```
|
|
5135
5313
|
*/
|
|
5136
|
-
use(id: string, options
|
|
5314
|
+
use(id: string, options: {
|
|
5137
5315
|
customTools?: CustomTool[];
|
|
5138
5316
|
customToolkits?: CustomToolkit[];
|
|
5317
|
+
mcp: true;
|
|
5139
5318
|
}, requestOptions?: ComposioRequestOptions): Promise<Session<TToolCollection, TTool, TProvider>>;
|
|
5319
|
+
use(id: string, options?: {
|
|
5320
|
+
customTools?: CustomTool[];
|
|
5321
|
+
customToolkits?: CustomToolkit[];
|
|
5322
|
+
mcp?: boolean;
|
|
5323
|
+
}, requestOptions?: ComposioRequestOptions): Promise<SessionWithoutMcp<TToolCollection, TTool, TProvider>>;
|
|
5324
|
+
}
|
|
5325
|
+
//#endregion
|
|
5326
|
+
//#region src/models/Sessions.d.ts
|
|
5327
|
+
/**
|
|
5328
|
+
* First-class API for creating and reusing Composio sessions.
|
|
5329
|
+
*
|
|
5330
|
+
* `composio.sessions.create(...)` is the canonical session creation entrypoint.
|
|
5331
|
+
* The top-level `composio.create(...)` method remains as a backwards-compatible
|
|
5332
|
+
* alias for `composio.sessions.create(...)`.
|
|
5333
|
+
*/
|
|
5334
|
+
declare class Sessions<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> extends ToolRouter<TToolCollection, TTool, TProvider> {
|
|
5335
|
+
constructor(client: Composio, config?: ComposioConfig<TProvider>);
|
|
5140
5336
|
}
|
|
5141
5337
|
//#endregion
|
|
5142
5338
|
//#region src/composio.d.ts
|
|
@@ -5306,17 +5502,33 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
5306
5502
|
connectedAccounts: ConnectedAccounts;
|
|
5307
5503
|
/**
|
|
5308
5504
|
* Experimental SDK methods whose shape may change in future releases.
|
|
5309
|
-
*
|
|
5310
|
-
*
|
|
5311
|
-
*
|
|
5505
|
+
* Prefer domain-specific mounts (for example
|
|
5506
|
+
* `composio.connectedAccounts.updateAcl(...)`) when available; this
|
|
5507
|
+
* namespace keeps compatibility aliases while APIs are experimental.
|
|
5508
|
+
* Stateless experimental factories (e.g. `experimental_createTool`) stay
|
|
5509
|
+
* at the top level.
|
|
5312
5510
|
* @experimental
|
|
5313
5511
|
*/
|
|
5314
5512
|
experimental: Experimental;
|
|
5315
|
-
/**
|
|
5513
|
+
/**
|
|
5514
|
+
* Model Context Protocol server management.
|
|
5515
|
+
* @deprecated Use a session's MCP endpoint instead: `composio.create(userId, { mcp: true })`
|
|
5516
|
+
* returns a session that exposes `session.mcp.url` / `session.mcp.headers`. MCP is now opt-in
|
|
5517
|
+
* per session; this standalone server-management API is kept only for backwards compatibility.
|
|
5518
|
+
* Prefer the session MCP endpoint; do not generate new code against `composio.mcp`.
|
|
5519
|
+
* See https://docs.composio.dev/docs/sessions-via-mcp
|
|
5520
|
+
*/
|
|
5316
5521
|
mcp: MCP;
|
|
5317
5522
|
/**
|
|
5318
|
-
*
|
|
5319
|
-
*
|
|
5523
|
+
* Create and reuse Composio sessions.
|
|
5524
|
+
*
|
|
5525
|
+
* Prefer `composio.sessions.create(...)` for new code. The top-level
|
|
5526
|
+
* `composio.create(...)` method is kept as an alias.
|
|
5527
|
+
*/
|
|
5528
|
+
sessions: Sessions<unknown, unknown, TProvider>;
|
|
5529
|
+
/**
|
|
5530
|
+
* Legacy alias for `composio.sessions`.
|
|
5531
|
+
* @deprecated Use `composio.sessions` instead — `toolRouter` was renamed to `sessions` and is kept only for backwards compatibility. Prefer `composio.sessions`; do not generate new code against `composio.toolRouter`.
|
|
5320
5532
|
*/
|
|
5321
5533
|
toolRouter: ToolRouter<unknown, unknown, TProvider>;
|
|
5322
5534
|
/**
|
|
@@ -5335,7 +5547,12 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
5335
5547
|
* const composio = new Composio();
|
|
5336
5548
|
* const userId = 'user_123';
|
|
5337
5549
|
*
|
|
5338
|
-
* const session = await composio.create(userId, {
|
|
5550
|
+
* const session = await composio.sessions.create(userId, {
|
|
5551
|
+
* manageConnections: true,
|
|
5552
|
+
* });
|
|
5553
|
+
*
|
|
5554
|
+
* // Backwards-compatible alias:
|
|
5555
|
+
* const same = await composio.create(userId, {
|
|
5339
5556
|
* manageConnections: true,
|
|
5340
5557
|
* });
|
|
5341
5558
|
*
|
|
@@ -5344,7 +5561,7 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
5344
5561
|
* console.log(session.tools());
|
|
5345
5562
|
* ```
|
|
5346
5563
|
*/
|
|
5347
|
-
create:
|
|
5564
|
+
create: Sessions<unknown, unknown, TProvider>['create'];
|
|
5348
5565
|
/**
|
|
5349
5566
|
* Use an existing tool router session
|
|
5350
5567
|
*
|
|
@@ -5356,10 +5573,7 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
5356
5573
|
* their own per-call requestOptions.
|
|
5357
5574
|
* @returns {Promise<Session<TToolCollection, TTool, TProvider>>} The tool router session
|
|
5358
5575
|
*/
|
|
5359
|
-
use:
|
|
5360
|
-
customTools?: CustomTool[];
|
|
5361
|
-
customToolkits?: CustomToolkit[];
|
|
5362
|
-
}, requestOptions?: ComposioRequestOptions) => Promise<Session<unknown, unknown, TProvider>>;
|
|
5576
|
+
use: Sessions<unknown, unknown, TProvider>['use'];
|
|
5363
5577
|
/**
|
|
5364
5578
|
* Creates a new instance of the Composio SDK.
|
|
5365
5579
|
*
|
|
@@ -5420,7 +5634,9 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
5420
5634
|
* The new instance inherits all configuration from the parent instance (apiKey, baseURL, provider, etc.)
|
|
5421
5635
|
* but allows you to specify custom request options that will be used for all API calls made through this session.
|
|
5422
5636
|
*
|
|
5423
|
-
* @deprecated
|
|
5637
|
+
* @deprecated Will be removed in a future version of the SDK. Instead, construct a new
|
|
5638
|
+
* instance directly with the headers you need: `new Composio({ ...existingConfig, defaultHeaders })`.
|
|
5639
|
+
* For one-off overrides, pass per-call `requestOptions` where supported.
|
|
5424
5640
|
*
|
|
5425
5641
|
* @param {MergedRequestInit} fetchOptions - Custom request options to be used for all API calls in this session.
|
|
5426
5642
|
* This follows the Fetch API RequestInit interface with additional options.
|
|
@@ -5479,4 +5695,4 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
5479
5695
|
flush(): Promise<void>;
|
|
5480
5696
|
}
|
|
5481
5697
|
//#endregion
|
|
5482
|
-
export {
|
|
5698
|
+
export { WebhookPayloadV3 as $, ToolkitsListParamsSchema as $t, TriggerInstanceUpsertResponse as A, ToolKitItem as At, TriggersTypeListParamsSchema as B, ToolkitAuthFieldsResponse as Bt, TriggerInstanceManageDeleteResponseSchema as C, AuthSchemeTypes as Ct, TriggerInstanceManageUpdateResponseSchema as D, CreateAuthConfigResponseSchema as Dt, TriggerInstanceManageUpdateResponse as E, CreateAuthConfigResponse as Et, TriggerSubscribeParamSchema as F, ToolKitMetaSchema as Ft, VerifyWebhookParamsSchema as G, ToolkitMangedByEnum as Gt, TriggersTypeListResponseSchema as H, ToolkitCategory as Ht, TriggerSubscribeParams as I, ToolkitAuthConfigDetails as It, WebhookPayloadSchema as J, ToolkitRetrieveCategoriesResponseSchema as Jt, VerifyWebhookResult as K, ToolkitMangedByEnumSchema as Kt, TriggerType as L, ToolkitAuthConfigDetailsSchema as Lt, TriggerStatusEnum as M, ToolKitListResponse as Mt, TriggerStatusType as N, ToolKitListResponseSchema as Nt, TriggerInstanceUpsertParams as O, CreateComposioManagedAuthConfigParamsSchema as Ot, TriggerStatuses as P, ToolKitMeta as Pt, WebhookPayloadV2Schema as Q, ToolkitSortByEnumSchema as Qt, TriggerTypeSchema as R, ToolkitAuthField as Rt, TriggerInstanceManageDeleteResponse as S, AuthSchemeType as St, TriggerInstanceManageUpdateParamsSchema as T, CreateAuthConfigParamsSchema as Tt, TriggersTypeRetrieveResponse as U, ToolkitCategorySchema as Ut, TriggersTypeListResponse as V, ToolkitAuthFieldsResponseSchema as Vt, VerifyWebhookParams as W, ToolkitListParams as Wt, WebhookPayloadV1Schema as X, ToolkitRetrieveResponseSchema as Xt, WebhookPayloadV1 as Y, ToolkitRetrieveResponse as Yt, WebhookPayloadV2 as Z, ToolkitSortByEnum as Zt, TriggerInstanceListActiveParamsSchema as _, AuthConfigUpdateParams as _t, MCP as a, WebhookVersion as at, TriggerInstanceListActiveResponseItemSchema as b, AuthDefaultConfigUpdateParamsSchema as bt, IncomingTriggerPayload as c, AuthConfigListParams as ct, SetWebhookSubscriptionParams as d, AuthConfigListResponseSchema as dt, ComposioRequestOptions as en, WebhookPayloadV3Schema as et, SetWebhookSubscriptionParamsSchema as f, AuthConfigRetrieveResponse as ft, TriggerInstanceListActiveParams as g, AuthConfigTypes as gt, TriggerEventData as h, AuthConfigType as ht, OpenAIProvider as i, WebhookTriggerPayloadV3Schema as it, TriggerInstanceUpsertResponseSchema as j, ToolKitItemSchema as jt, TriggerInstanceUpsertParamsSchema as k, CreateCustomAuthConfigParamsSchema as kt, IncomingTriggerPayloadSchema as l, AuthConfigListParamsSchema as lt, TriggerEvent as m, AuthConfigToolAccessConfigSchema as mt, ComposioConfig as n, WebhookSubscription as nt, Experimental as o, WebhookVersions as ot, TriggerData as p, AuthConfigRetrieveResponseSchema as pt, WebhookPayload as q, ToolkitRetrieveCategoriesResponse as qt, Sessions as r, WebhookTriggerPayloadV3 as rt, DefaultWebhookSubscriptionEvents as s, AuthConfigCreationToolAccessConfigSchema as st, Composio$1 as t, WebhookRequestLike as tt, ParseWebhookOptions as u, AuthConfigListResponse as ut, TriggerInstanceListActiveResponse as v, AuthConfigUpdateParamsSchema as vt, TriggerInstanceManageUpdateParams as w, CreateAuthConfigParams as wt, TriggerInstanceListActiveResponseSchema as x, AuthSchemeEnum as xt, TriggerInstanceListActiveResponseItem as y, AuthCustomConfigUpdateParamsSchema as yt, TriggersTypeListParams as z, ToolkitAuthFieldSchema as zt };
|