@composio/core 0.24.0 → 0.26.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-CnJxXr07.mjs → CustomTool-BYHB7sPs.mjs} +1 -1
- package/dist/{CustomTool-CNJysHMK.d.mts → CustomTool-DfP4ldQl.d.mts} +1 -1
- package/dist/{cancellation-BQibgpRG.mjs → cancellation-ZoRh6EJQ.mjs} +55 -3
- package/dist/{composio-BFTtZj82.d.mts → composio-BMDH-1Qj.d.mts} +35 -15
- package/dist/{customTool.types-D57QrTns.d.mts → customTool.types-BoOELgJF.d.mts} +346 -23
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +8 -8
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +56 -21
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +18 -18
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +25 -25
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +14 -14
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +13 -13
- package/dist/{errors-BN15NcCW.mjs → errors-Cly0vXFh.mjs} +5 -5
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +19 -11
- package/dist/index.mjs +693 -196
- package/dist/{types-q8TwAngA.d.mts → types-DHNV_T_z.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +5 -5
- package/src/composio.ts +81 -67
- package/src/errors/ToolRouterErrors.ts +5 -5
- package/src/lib/toolRouterMcp.ts +2 -0
- package/src/lib/toolRouterParams.ts +28 -16
- package/src/models/ConnectedAccounts.ts +7 -16
- package/src/models/ToolRouter.ts +8 -1
- package/src/models/ToolRouterSession.ts +17 -0
- package/src/models/Tools.ts +1 -4
- package/src/models/Triggers.ts +14 -7
- package/src/services/internal/InternalService.ts +3 -4
- package/src/services/pusher/Pusher.ts +170 -92
- package/src/types/connectedAccountAuthStates.types.ts +2 -1
- package/src/types/pusher.types.ts +2 -0
- package/src/types/requestOptions.types.ts +1 -10
- package/src/types/toolRouter.types.ts +104 -18
- package/src/utils/jsonSchema.ts +76 -4
- package/src/utils/sdk.ts +172 -11
- package/src/utils/session.ts +25 -47
- package/src/utils/toolkitDeprecation.ts +271 -0
- package/src/utils/transformers/connectedAccounts.ts +9 -20
- package/src/utils/transformers/mcp.ts +3 -10
- package/src/utils/userCallback.ts +41 -0
|
@@ -33,7 +33,7 @@ const result = await composio.mcp.list();
|
|
|
33
33
|
Create a new MCP configuration.
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
async create(name: string, mcpConfig:
|
|
36
|
+
async create(name: string, mcpConfig: MCPConfigCreationParams, requestOptions?: ComposioRequestOptions): Promise<MCPConfigCreateResponse>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
**Parameters**
|
|
@@ -41,7 +41,7 @@ async create(name: string, mcpConfig: { allowedTools?: string[]; manuallyManageC
|
|
|
41
41
|
| Name | Type |
|
|
42
42
|
|------|------|
|
|
43
43
|
| `name` | `string` |
|
|
44
|
-
| `mcpConfig` |
|
|
44
|
+
| `mcpConfig` | `MCPConfigCreationParams` |
|
|
45
45
|
| `requestOptions?` | `ComposioRequestOptions` |
|
|
46
46
|
|
|
47
47
|
**Returns**
|
|
@@ -73,7 +73,7 @@ const server = await composio.mcpConfig.create("personal-mcp-server", {
|
|
|
73
73
|
Delete an MCP server configuration permanently
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
|
-
async delete(serverId: string, requestOptions?: ComposioRequestOptions): Promise<{
|
|
76
|
+
async delete(serverId: string, requestOptions?: ComposioRequestOptions): Promise<{ id: string; deleted: boolean }>
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
**Parameters**
|
|
@@ -85,7 +85,7 @@ async delete(serverId: string, requestOptions?: ComposioRequestOptions): Promise
|
|
|
85
85
|
|
|
86
86
|
**Returns**
|
|
87
87
|
|
|
88
|
-
`Promise<\{
|
|
88
|
+
`Promise<\{ id: string; deleted: boolean \}>` — Confirmation object with server ID and deletion status
|
|
89
89
|
|
|
90
90
|
**Example**
|
|
91
91
|
|
|
@@ -122,7 +122,7 @@ Get server URLs for an existing MCP server.
|
|
|
122
122
|
The response is wrapped according to the provider's specifications.
|
|
123
123
|
|
|
124
124
|
```typescript
|
|
125
|
-
async generate(userId: string, mcpConfigId: string, options?:
|
|
125
|
+
async generate(userId: string, mcpConfigId: string, options?: MCPGetInstanceParams, requestOptions?: ComposioRequestOptions): Promise<MCPServerInstance>
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
**Parameters**
|
|
@@ -131,12 +131,12 @@ async generate(userId: string, mcpConfigId: string, options?: { manuallyManageCo
|
|
|
131
131
|
|------|------|-------------|
|
|
132
132
|
| `userId` | `string` | \{string\} external user id from your database for whom you want the server for |
|
|
133
133
|
| `mcpConfigId` | `string` | \{string\} config id of the MCPConfig for which you want to create a server for |
|
|
134
|
-
| `options?` |
|
|
134
|
+
| `options?` | `MCPGetInstanceParams` | \{object\} additional options |
|
|
135
135
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
136
136
|
|
|
137
137
|
**Returns**
|
|
138
138
|
|
|
139
|
-
`Promise
|
|
139
|
+
`Promise<MCPServerInstance>`
|
|
140
140
|
|
|
141
141
|
**Example**
|
|
142
142
|
|
|
@@ -154,7 +154,7 @@ const mcp = await composio.experimental.mcp.generate("default", "<mcp_config_id>
|
|
|
154
154
|
Retrieve detailed information about a specific MCP server by its ID
|
|
155
155
|
|
|
156
156
|
```typescript
|
|
157
|
-
async get(serverId: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
157
|
+
async get(serverId: string, requestOptions?: ComposioRequestOptions): Promise<MCPItem>
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
**Parameters**
|
|
@@ -166,7 +166,7 @@ async get(serverId: string, requestOptions?: ComposioRequestOptions): Promise<{
|
|
|
166
166
|
|
|
167
167
|
**Returns**
|
|
168
168
|
|
|
169
|
-
`Promise
|
|
169
|
+
`Promise<MCPItem>` — Complete MCP server details including configuration, tools, and metadata
|
|
170
170
|
|
|
171
171
|
**Example**
|
|
172
172
|
|
|
@@ -195,19 +195,19 @@ const mcpUrl = server.MCPUrl;
|
|
|
195
195
|
List the MCP servers with optional filtering and pagination
|
|
196
196
|
|
|
197
197
|
```typescript
|
|
198
|
-
async list(options:
|
|
198
|
+
async list(options: MCPListParams, requestOptions?: ComposioRequestOptions): Promise<MCPListResponse>
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
**Parameters**
|
|
202
202
|
|
|
203
203
|
| Name | Type | Description |
|
|
204
204
|
|------|------|-------------|
|
|
205
|
-
| `options` |
|
|
205
|
+
| `options` | `MCPListParams` | Filtering and pagination options |
|
|
206
206
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
207
207
|
|
|
208
208
|
**Returns**
|
|
209
209
|
|
|
210
|
-
`Promise
|
|
210
|
+
`Promise<MCPListResponse>` — Paginated list of MCP servers with metadata
|
|
211
211
|
|
|
212
212
|
**Example**
|
|
213
213
|
|
|
@@ -239,7 +239,7 @@ const namedServers = await composio.experimental.mcp.list({
|
|
|
239
239
|
Update an existing MCP server configuration with new settings
|
|
240
240
|
|
|
241
241
|
```typescript
|
|
242
|
-
async update(serverId: string, config:
|
|
242
|
+
async update(serverId: string, config: MCPUpdateParams, requestOptions?: ComposioRequestOptions): Promise<MCPItem>
|
|
243
243
|
```
|
|
244
244
|
|
|
245
245
|
**Parameters**
|
|
@@ -247,12 +247,12 @@ async update(serverId: string, config: { allowedTools?: string[]; manuallyManage
|
|
|
247
247
|
| Name | Type | Description |
|
|
248
248
|
|------|------|-------------|
|
|
249
249
|
| `serverId` | `string` | The unique identifier of the MCP server to update |
|
|
250
|
-
| `config` |
|
|
250
|
+
| `config` | `MCPUpdateParams` | Update configuration parameters |
|
|
251
251
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
252
252
|
|
|
253
253
|
**Returns**
|
|
254
254
|
|
|
255
|
-
`Promise
|
|
255
|
+
`Promise<MCPItem>` — Updated MCP server configuration with all details
|
|
256
256
|
|
|
257
257
|
**Example**
|
|
258
258
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"custom-toolkits",
|
|
8
8
|
"keyring",
|
|
9
9
|
"logs",
|
|
10
|
+
"session-configs",
|
|
10
11
|
"experimental",
|
|
11
12
|
"mcp",
|
|
12
13
|
"remote-file",
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
"session-files",
|
|
17
18
|
"tools",
|
|
18
19
|
"triggers",
|
|
19
|
-
"session-configs",
|
|
20
20
|
"usage",
|
|
21
21
|
"webhook-endpoints",
|
|
22
22
|
"webhooks",
|
|
@@ -22,7 +22,7 @@ policy. A missing or cross-project id surfaces as the backend's 404.
|
|
|
22
22
|
Requires Session configs to be enabled for the project.
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
|
-
async get(id: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
25
|
+
async get(id: string, requestOptions?: ComposioRequestOptions): Promise<SessionConfig>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
**Parameters**
|
|
@@ -34,7 +34,7 @@ async get(id: string, requestOptions?: ComposioRequestOptions): Promise<{ archiv
|
|
|
34
34
|
|
|
35
35
|
**Returns**
|
|
36
36
|
|
|
37
|
-
`Promise
|
|
37
|
+
`Promise<SessionConfig>` — The config and its policy
|
|
38
38
|
|
|
39
39
|
**Example**
|
|
40
40
|
|
|
@@ -55,19 +55,19 @@ archived ones. The backend defaults `limit` to 20 and caps it at 100.
|
|
|
55
55
|
Requires Session configs to be enabled for the project.
|
|
56
56
|
|
|
57
57
|
```typescript
|
|
58
|
-
async list(params?:
|
|
58
|
+
async list(params?: SessionConfigListParams, requestOptions?: ComposioRequestOptions): Promise<SessionConfigListResponse>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
**Parameters**
|
|
62
62
|
|
|
63
63
|
| Name | Type | Description |
|
|
64
64
|
|------|------|-------------|
|
|
65
|
-
| `params?` |
|
|
65
|
+
| `params?` | `SessionConfigListParams` | `search`, `archived`, `limit` and `cursor` |
|
|
66
66
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
67
67
|
|
|
68
68
|
**Returns**
|
|
69
69
|
|
|
70
|
-
`Promise
|
|
70
|
+
`Promise<SessionConfigListResponse>` — Config summaries and the next cursor
|
|
71
71
|
|
|
72
72
|
**Example**
|
|
73
73
|
|
|
@@ -13,7 +13,7 @@ Removes the file or directory from the virtual filesystem. Use with caution:
|
|
|
13
13
|
deletion is typically irreversible. Ensure the path exists and is intended for removal.
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
async delete(remotePath: string, options?:
|
|
16
|
+
async delete(remotePath: string, options?: ToolRouterSessionFilesMountDeleteOptions): Promise<FileDeleteResponse>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
**Parameters**
|
|
@@ -21,11 +21,11 @@ async delete(remotePath: string, options?: { mountId?: string }): Promise<{ moun
|
|
|
21
21
|
| Name | Type | Description |
|
|
22
22
|
|------|------|-------------|
|
|
23
23
|
| `remotePath` | `string` | The path of the file or directory to delete on the mount. |
|
|
24
|
-
| `options?` |
|
|
24
|
+
| `options?` | `ToolRouterSessionFilesMountDeleteOptions` | Optional configuration for the delete operation. |
|
|
25
25
|
|
|
26
26
|
**Returns**
|
|
27
27
|
|
|
28
|
-
`Promise
|
|
28
|
+
`Promise<FileDeleteResponse>` — Confirmation of deletion (implementation-specific).
|
|
29
29
|
|
|
30
30
|
**Example**
|
|
31
31
|
|
|
@@ -51,7 +51,7 @@ Retrieves a file stored in the session's virtual filesystem (e.g., one produced
|
|
|
51
51
|
by a tool or previously uploaded) and saves it to the specified local path.
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
|
-
async download(filePath: string, options?:
|
|
54
|
+
async download(filePath: string, options?: ToolRouterSessionFilesMountDownloadOptions): Promise<RemoteFile>
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
**Parameters**
|
|
@@ -59,7 +59,7 @@ async download(filePath: string, options?: { mountId?: string }): Promise<Remote
|
|
|
59
59
|
| Name | Type | Description |
|
|
60
60
|
|------|------|-------------|
|
|
61
61
|
| `filePath` | `string` | The path of the file on the mount to download, or the local path where the file should be saved (implementation-specific). |
|
|
62
|
-
| `options?` |
|
|
62
|
+
| `options?` | `ToolRouterSessionFilesMountDownloadOptions` | Optional configuration for the download. |
|
|
63
63
|
|
|
64
64
|
**Returns**
|
|
65
65
|
|
|
@@ -90,18 +90,18 @@ The path is relative to the mount root (e.g., `"/"` for root, `"/documents"` for
|
|
|
90
90
|
Supports cursor-based pagination via `cursor` and `limit` options.
|
|
91
91
|
|
|
92
92
|
```typescript
|
|
93
|
-
async list(options?:
|
|
93
|
+
async list(options?: ToolRouterSessionFilesMountListOptions): Promise<FileListResponse>
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
**Parameters**
|
|
97
97
|
|
|
98
98
|
| Name | Type | Description |
|
|
99
99
|
|------|------|-------------|
|
|
100
|
-
| `options?` |
|
|
100
|
+
| `options?` | `ToolRouterSessionFilesMountListOptions` | Optional configuration for the list operation. |
|
|
101
101
|
|
|
102
102
|
**Returns**
|
|
103
103
|
|
|
104
|
-
`Promise
|
|
104
|
+
`Promise<FileListResponse>` — List of files with nextCursor for pagination.
|
|
105
105
|
|
|
106
106
|
**Example**
|
|
107
107
|
|
|
@@ -130,7 +130,7 @@ URL inputs require a Node.js or Bun runtime so the destination can be DNS-valida
|
|
|
130
130
|
edge runtimes must fetch the file themselves and pass a File or ArrayBuffer.
|
|
131
131
|
|
|
132
132
|
```typescript
|
|
133
|
-
async upload(input: string | File | ArrayBuffer | Uint8Array, options?:
|
|
133
|
+
async upload(input: string | File | ArrayBuffer | Uint8Array, options?: ToolRouterSessionFilesMountUploadOptions): Promise<RemoteFile>
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
**Parameters**
|
|
@@ -138,7 +138,7 @@ async upload(input: string | File | ArrayBuffer | Uint8Array, options?: { mimety
|
|
|
138
138
|
| Name | Type | Description |
|
|
139
139
|
|------|------|-------------|
|
|
140
140
|
| `input` | `string \| File \| ArrayBuffer \| Uint8Array` | File path (string), native File, or raw buffer (ArrayBuffer \| Uint8Array). |
|
|
141
|
-
| `options?` |
|
|
141
|
+
| `options?` | `ToolRouterSessionFilesMountUploadOptions` | Optional configuration. When passing a buffer, remotePath is required. |
|
|
142
142
|
|
|
143
143
|
**Returns**
|
|
144
144
|
|
|
@@ -35,7 +35,7 @@ Experimental — shape may change in future releases.
|
|
|
35
35
|
at the SDK boundary.
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
|
-
async authorize(toolkit: string, options?: {
|
|
38
|
+
async authorize(toolkit: string, options?: { callbackUrl?: string; alias?: string; experimental?: { accountType?: ConnectedAccountType; aclConfigForShared?: ConnectedAccountAclConfig; }; }, requestOptions?: ComposioRequestOptions): Promise<ConnectionRequest>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
**Parameters**
|
|
@@ -43,7 +43,7 @@ async authorize(toolkit: string, options?: { alias?: string; callbackUrl?: strin
|
|
|
43
43
|
| Name | Type |
|
|
44
44
|
|------|------|
|
|
45
45
|
| `toolkit` | `string` |
|
|
46
|
-
| `options?` | `\{
|
|
46
|
+
| `options?` | `\{ callbackUrl?: string; alias?: string; experimental?: \{ accountType?: ConnectedAccountType; aclConfigForShared?: ConnectedAccountAclConfig; \}; \}` |
|
|
47
47
|
| `requestOptions?` | `ComposioRequestOptions` |
|
|
48
48
|
|
|
49
49
|
**Returns**
|
|
@@ -96,7 +96,7 @@ Deleted sessions immediately stop being retrievable or executable. Deleting
|
|
|
96
96
|
an already-deleted session surfaces the backend 404.
|
|
97
97
|
|
|
98
98
|
```typescript
|
|
99
|
-
async delete(requestOptions?: ComposioRequestOptions): Promise<
|
|
99
|
+
async delete(requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionDeleteResponse>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
**Parameters**
|
|
@@ -107,7 +107,7 @@ async delete(requestOptions?: ComposioRequestOptions): Promise<{ deleted: true;
|
|
|
107
107
|
|
|
108
108
|
**Returns**
|
|
109
109
|
|
|
110
|
-
`Promise
|
|
110
|
+
`Promise<ToolRouterSessionDeleteResponse>`
|
|
111
111
|
|
|
112
112
|
---
|
|
113
113
|
|
|
@@ -126,7 +126,7 @@ For interactive flows that should surface the redirect URL instead of
|
|
|
126
126
|
blocking, use `authorize()` and its `waitForConnection()` directly.
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
|
-
async ensureConnected(toolkit: string, options?:
|
|
129
|
+
async ensureConnected(toolkit: string, options?: ToolRouterSessionEnsureConnectedOptions, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionEnsureConnectedResult>
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
**Parameters**
|
|
@@ -134,7 +134,7 @@ async ensureConnected(toolkit: string, options?: { alias?: string; callbackUrl?:
|
|
|
134
134
|
| Name | Type | Description |
|
|
135
135
|
|------|------|-------------|
|
|
136
136
|
| `toolkit` | `string` | The toolkit slug to ensure a connection for (e.g. 'github') |
|
|
137
|
-
| `options?` |
|
|
137
|
+
| `options?` | `ToolRouterSessionEnsureConnectedOptions` | Optional authorization options plus `timeout` (ms to wait for a newly-initiated connection, default 60000) |
|
|
138
138
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
139
139
|
|
|
140
140
|
**Returns**
|
|
@@ -162,7 +162,7 @@ the session's custom tools and toolkits. Custom tools are executed
|
|
|
162
162
|
in-process; remote tools are sent to the Composio backend.
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
|
-
async execute(toolSlug: string, arguments_?: Record<string, unknown>, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise
|
|
165
|
+
async execute(toolSlug: string, arguments_?: Record<string, unknown>, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionExecuteResponse>
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
**Parameters**
|
|
@@ -176,7 +176,42 @@ async execute(toolSlug: string, arguments_?: Record<string, unknown>, options?:
|
|
|
176
176
|
|
|
177
177
|
**Returns**
|
|
178
178
|
|
|
179
|
-
`Promise
|
|
179
|
+
`Promise<ToolRouterSessionExecuteResponse>` — The tool execution result
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### executeMeta()
|
|
184
|
+
|
|
185
|
+
Execute a Composio meta tool (`COMPOSIO_*`) within the session.
|
|
186
|
+
|
|
187
|
+
`session.execute()` also runs meta tools. This method only accepts meta
|
|
188
|
+
tool slugs, so a typo is a type error instead of a failed request. The call
|
|
189
|
+
is sent to the Composio backend as is: custom tools named in a
|
|
190
|
+
`COMPOSIO_MULTI_EXECUTE_TOOL` call are not run in-process here.
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
async executeMeta(slug: ToolRouterSessionMetaToolSlug, arguments_?: Record<string, unknown>, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionExecuteResponse>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Parameters**
|
|
197
|
+
|
|
198
|
+
| Name | Type | Description |
|
|
199
|
+
|------|------|-------------|
|
|
200
|
+
| `slug` | `ToolRouterSessionMetaToolSlug` | The meta tool slug to execute |
|
|
201
|
+
| `arguments_?` | `Record<string, unknown>` | Optional meta tool arguments |
|
|
202
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
203
|
+
|
|
204
|
+
**Returns**
|
|
205
|
+
|
|
206
|
+
`Promise<ToolRouterSessionExecuteResponse>` — The tool execution result, in the same shape as `session.execute()`
|
|
207
|
+
|
|
208
|
+
**Example**
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
const { data, resultType } = await session.executeMeta('COMPOSIO_SEARCH_TOOLS', {
|
|
212
|
+
queries: [{ use_case: 'send an email' }],
|
|
213
|
+
});
|
|
214
|
+
```
|
|
180
215
|
|
|
181
216
|
---
|
|
182
217
|
|
|
@@ -187,14 +222,14 @@ first page starts with the live config (`isCurrent: true`); every
|
|
|
187
222
|
`session.update()` archives the previous version as a history row.
|
|
188
223
|
|
|
189
224
|
```typescript
|
|
190
|
-
async listConfigHistory(options?:
|
|
225
|
+
async listConfigHistory(options?: ToolRouterSessionListConfigHistoryOptions, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionListConfigHistoryResponse>
|
|
191
226
|
```
|
|
192
227
|
|
|
193
228
|
**Parameters**
|
|
194
229
|
|
|
195
230
|
| Name | Type | Description |
|
|
196
231
|
|------|------|-------------|
|
|
197
|
-
| `options?` |
|
|
232
|
+
| `options?` | `ToolRouterSessionListConfigHistoryOptions` | Optional `cursor` and `limit` (max 100) |
|
|
198
233
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
199
234
|
|
|
200
235
|
**Returns**
|
|
@@ -217,14 +252,14 @@ Proxy an API call through Composio's auth layer using the session's connected ac
|
|
|
217
252
|
The backend resolves the connected account from the toolkit within the session.
|
|
218
253
|
|
|
219
254
|
```typescript
|
|
220
|
-
async proxyExecute(params:
|
|
255
|
+
async proxyExecute(params: SessionProxyExecuteParams, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionProxyExecuteResponse>
|
|
221
256
|
```
|
|
222
257
|
|
|
223
258
|
**Parameters**
|
|
224
259
|
|
|
225
260
|
| Name | Type | Description |
|
|
226
261
|
|------|------|-------------|
|
|
227
|
-
| `params` |
|
|
262
|
+
| `params` | `SessionProxyExecuteParams` | Proxy request parameters (toolkit, endpoint, method, body, headers/query params) |
|
|
228
263
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
229
264
|
|
|
230
265
|
**Returns**
|
|
@@ -239,19 +274,19 @@ Search for tools by semantic use case.
|
|
|
239
274
|
Returns relevant tools for the given query with schemas and guidance.
|
|
240
275
|
|
|
241
276
|
```typescript
|
|
242
|
-
async search(params: { query: string; toolkits?: string[] }, requestOptions?: ComposioRequestOptions): Promise<
|
|
277
|
+
async search(params: { query: string; toolkits?: string[]; }, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionSearchResponse>
|
|
243
278
|
```
|
|
244
279
|
|
|
245
280
|
**Parameters**
|
|
246
281
|
|
|
247
282
|
| Name | Type |
|
|
248
283
|
|------|------|
|
|
249
|
-
| `params` | `\{ query: string; toolkits?: string[] \}` |
|
|
284
|
+
| `params` | `\{ query: string; toolkits?: string[]; \}` |
|
|
250
285
|
| `requestOptions?` | `ComposioRequestOptions` |
|
|
251
286
|
|
|
252
287
|
**Returns**
|
|
253
288
|
|
|
254
|
-
`Promise
|
|
289
|
+
`Promise<ToolRouterSessionSearchResponse>`
|
|
255
290
|
|
|
256
291
|
---
|
|
257
292
|
|
|
@@ -261,14 +296,14 @@ Query the connection state of toolkits in the session.
|
|
|
261
296
|
Supports pagination and filtering by toolkit slugs.
|
|
262
297
|
|
|
263
298
|
```typescript
|
|
264
|
-
async toolkits(options?:
|
|
299
|
+
async toolkits(options?: ToolRouterToolkitsOptions, requestOptions?: ComposioRequestOptions): Promise<{ cursor: string | undefined; items: { connection?: { authConfig?: ... | ...; connectedAccount?: { id: ...; status: ... }; isActive: boolean }; isNoAuth: boolean; logo?: string; name: string; slug: string }[]; totalPages: number }>
|
|
265
300
|
```
|
|
266
301
|
|
|
267
302
|
**Parameters**
|
|
268
303
|
|
|
269
304
|
| Name | Type |
|
|
270
305
|
|------|------|
|
|
271
|
-
| `options?` |
|
|
306
|
+
| `options?` | `ToolRouterToolkitsOptions` |
|
|
272
307
|
| `requestOptions?` | `ComposioRequestOptions` |
|
|
273
308
|
|
|
274
309
|
**Returns**
|
|
@@ -286,7 +321,7 @@ When custom tools are bound to the session, execution of COMPOSIO_MULTI_EXECUTE_
|
|
|
286
321
|
is intercepted: local tools are executed in-process, remote tools are sent to the backend.
|
|
287
322
|
|
|
288
323
|
```typescript
|
|
289
|
-
async tools(modifiers?: SessionMetaToolOptions, requestOptions?: ComposioRequestOptions): Promise<ReturnType
|
|
324
|
+
async tools(modifiers?: SessionMetaToolOptions, requestOptions?: ComposioRequestOptions): Promise<ReturnType<TProvider['wrapTools']>>
|
|
290
325
|
```
|
|
291
326
|
|
|
292
327
|
**Parameters**
|
|
@@ -298,7 +333,7 @@ async tools(modifiers?: SessionMetaToolOptions, requestOptions?: ComposioRequest
|
|
|
298
333
|
|
|
299
334
|
**Returns**
|
|
300
335
|
|
|
301
|
-
`Promise<ReturnType
|
|
336
|
+
`Promise<ReturnType<TProvider['wrapTools']>>`
|
|
302
337
|
|
|
303
338
|
---
|
|
304
339
|
|
|
@@ -338,7 +373,7 @@ for example for an archived or missing config, surface unchanged.
|
|
|
338
373
|
successful response, and the updated `config` is returned.
|
|
339
374
|
|
|
340
375
|
```typescript
|
|
341
|
-
async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<
|
|
376
|
+
async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionConfig>
|
|
342
377
|
```
|
|
343
378
|
|
|
344
379
|
**Parameters**
|
|
@@ -350,6 +385,6 @@ async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioReq
|
|
|
350
385
|
|
|
351
386
|
**Returns**
|
|
352
387
|
|
|
353
|
-
`Promise<
|
|
388
|
+
`Promise<ToolRouterSessionConfig>`
|
|
354
389
|
|
|
355
390
|
---
|
|
@@ -96,7 +96,7 @@ Deleted sessions immediately stop being retrievable or executable. Deleting
|
|
|
96
96
|
a missing or already-deleted session surfaces the backend 404.
|
|
97
97
|
|
|
98
98
|
```typescript
|
|
99
|
-
async delete(id: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
99
|
+
async delete(id: string, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionDeleteResponse>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
**Parameters**
|
|
@@ -108,7 +108,7 @@ async delete(id: string, requestOptions?: ComposioRequestOptions): Promise<{ del
|
|
|
108
108
|
|
|
109
109
|
**Returns**
|
|
110
110
|
|
|
111
|
-
`Promise
|
|
111
|
+
`Promise<ToolRouterSessionDeleteResponse>`
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
@@ -126,7 +126,7 @@ origins is logged, so native tools keep working.
|
|
|
126
126
|
**Overload 1**
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
|
-
async use(id: string, options: {
|
|
129
|
+
async use(id: string, options: { customTools?: CustomTool[]; customToolkits?: CustomToolkit[]; mcp: true }, requestOptions?: ComposioRequestOptions): Promise<Session<TToolCollection, TTool, TProvider>>
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
**Parameters**
|
|
@@ -134,7 +134,7 @@ async use(id: string, options: { customToolkits?: CustomToolkit[]; customTools?:
|
|
|
134
134
|
| Name | Type | Description |
|
|
135
135
|
|------|------|-------------|
|
|
136
136
|
| `id` | `string` | \{string\} The id of the session to use |
|
|
137
|
-
| `options` | `\{
|
|
137
|
+
| `options` | `\{ customTools?: CustomTool[]; customToolkits?: CustomToolkit[]; mcp: true \}` | |
|
|
138
138
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
139
139
|
|
|
140
140
|
**Returns**
|
|
@@ -144,7 +144,7 @@ async use(id: string, options: { customToolkits?: CustomToolkit[]; customTools?:
|
|
|
144
144
|
**Overload 2**
|
|
145
145
|
|
|
146
146
|
```typescript
|
|
147
|
-
async use(id: string, options?: {
|
|
147
|
+
async use(id: string, options?: { customTools?: CustomTool[]; customToolkits?: CustomToolkit[]; mcp?: boolean }, requestOptions?: ComposioRequestOptions): Promise<SessionWithoutMcp<TToolCollection, TTool, TProvider>>
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
**Parameters**
|
|
@@ -152,7 +152,7 @@ async use(id: string, options?: { customToolkits?: CustomToolkit[]; customTools?
|
|
|
152
152
|
| Name | Type | Description |
|
|
153
153
|
|------|------|-------------|
|
|
154
154
|
| `id` | `string` | \{string\} The id of the session to use |
|
|
155
|
-
| `options?` | `\{
|
|
155
|
+
| `options?` | `\{ customTools?: CustomTool[]; customToolkits?: CustomToolkit[]; mcp?: boolean \}` | |
|
|
156
156
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
157
157
|
|
|
158
158
|
**Returns**
|