@composio/core 0.19.0 → 0.21.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-BMlZfJVz.mjs → CustomTool-B-_VjWpy.mjs} +1 -1
- package/dist/{CustomTool-CB5vm1Jc.d.mts → CustomTool-BHOYxLZX.d.mts} +1 -1
- package/dist/{FileModifierErrors-BqFmpRsm.mjs → FileModifierErrors-CdGSABoq.mjs} +1 -1
- package/dist/{SsrfErrors-C91YhASE.mjs → SsrfErrors-DiQldIdC.mjs} +18 -7
- package/dist/{Telemetry-HlftxMx6.mjs → Telemetry-JRJJYS4I.mjs} +2 -2
- package/dist/{cancellation-CXpfmiVo.mjs → cancellation-DV8CIi52.mjs} +2 -2
- package/dist/{composio-DLGaeN70.d.mts → composio-BTZsFajb.d.mts} +3149 -117
- package/dist/{customTool.types-BAmEh3MB.d.mts → customTool.types-D_w21L56.d.mts} +784 -56
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +7 -3
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +101 -18
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +123 -0
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +9 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +8 -0
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +56 -0
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +78 -0
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +9 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +83 -0
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +86 -27
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +26 -6
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +149 -12
- 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 +78 -0
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +162 -0
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +218 -0
- package/dist/docs/reference/sdk-reference/typescript/webhooks.mdx +20 -0
- package/dist/{errors-BuEKehbI.mjs → errors-Dyiu3ifQ.mjs} +127 -4
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-L7XD8UPr.mjs → fileUtils.node-DNLhLg0W.mjs} +4 -4
- package/dist/index.d.mts +281 -55
- package/dist/index.mjs +3552 -949
- package/dist/models/Files.node.mjs +2 -2
- package/dist/{sensitiveFileUploadPaths-B6pBt9lO.mjs → sensitiveFileUploadPaths-BlLp-Yo2.mjs} +1 -1
- package/dist/{ssrfGuard.node-B9xQB4za.mjs → ssrfGuard.node-BZ270bcu.mjs} +1 -1
- package/dist/{types-CxLPO0Xq.d.mts → types-CgRsUGqm.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 +5 -5
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/dist/utils/ssrfGuard.node.mjs +1 -1
- package/dist/utils/ssrfGuard.workerd.mjs +1 -1
- package/package.json +4 -2
- package/src/composio.ts +215 -10
- package/src/errors/ConnectedAccountsErrors.ts +47 -0
- package/src/errors/SDKErrors.ts +52 -0
- package/src/errors/ToolRouterErrors.ts +61 -0
- package/src/errors/index.ts +3 -0
- package/src/index.ts +13 -0
- package/src/lib/sessionConfigConflict.ts +43 -0
- package/src/lib/toolRouterMcp.ts +132 -0
- package/src/lib/toolRouterParams.ts +149 -37
- package/src/lib/toolRouterSourceSessionConfig.ts +12 -0
- package/src/models/ConnectedAccounts.ts +118 -2
- package/src/models/CustomToolkits.ts +169 -0
- package/src/models/Experimental.ts +27 -0
- package/src/models/Keyring.ts +65 -0
- package/src/models/Logs.ts +101 -0
- package/src/models/RemoteFile.ts +25 -8
- package/src/models/SessionConfigs.ts +117 -0
- package/src/models/ToolRouter.ts +61 -17
- package/src/models/ToolRouterSession.ts +149 -14
- package/src/models/Toolkits.ts +180 -0
- package/src/models/Tools.ts +10 -6
- package/src/models/Triggers.ts +3 -88
- package/src/models/Usage.ts +119 -0
- package/src/models/Webhooks.ts +520 -0
- package/src/services/pusher/Pusher.ts +17 -6
- package/src/types/authConfigs.types.ts +2 -0
- package/src/types/connectedAccounts.types.ts +54 -0
- package/src/types/customToolkits.types.ts +102 -0
- package/src/types/keyring.types.ts +32 -0
- package/src/types/logs.types.ts +108 -0
- package/src/types/sessionConfigs.types.ts +81 -0
- package/src/types/tool.types.ts +2 -0
- package/src/types/toolRouter.types.ts +352 -16
- package/src/types/toolkit.types.ts +144 -0
- package/src/types/usage.types.ts +81 -0
- package/src/types/webhooks.types.ts +143 -0
- package/src/utils/constants.ts +1 -5
- package/src/utils/logger.ts +39 -7
- package/src/utils/safePath.ts +172 -0
- package/src/utils/sdk.ts +385 -22
- package/src/utils/transformers/connectedAccounts.ts +37 -2
- package/src/utils/transformers/customToolkits.ts +98 -0
- package/src/utils/transformers/keyring.ts +24 -0
- package/src/utils/transformers/logs.ts +85 -0
- package/src/utils/transformers/sessionConfigs.ts +54 -0
- package/src/utils/transformers/toolRouterResponseTransform.ts +6 -0
- package/src/utils/transformers/toolkits.ts +106 -3
- package/src/utils/transformers/triggers.ts +2 -2
- package/src/utils/transformers/usage.ts +77 -0
- package/src/utils/transformers/webhooks.ts +139 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Keyring"
|
|
3
|
+
description: "`composio.keyring` — the organization's customer-managed keyring."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
Access this class through the `composio.keyring` property:
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const composio = new Composio({ apiKey: 'your-api-key' });
|
|
12
|
+
const result = await composio.keyring.list();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### listTransferKeys()
|
|
18
|
+
|
|
19
|
+
Lists the public transfer keys of the organization's active customer
|
|
20
|
+
keyring, the keys a secret is sealed to before it is sent to Composio.
|
|
21
|
+
|
|
22
|
+
Always seal new secrets to the key whose `kid` is `activeKid`: a JWE with
|
|
23
|
+
`RSA-OAEP-256` key management, `A256GCM` content encryption, and the
|
|
24
|
+
`kid` in the protected header. Older keys stay listed so values sealed to
|
|
25
|
+
them remain openable.
|
|
26
|
+
|
|
27
|
+
The organization behind the API key must have an ACTIVE customer keyring
|
|
28
|
+
instance; otherwise the API answers 404.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
async listTransferKeys(requestOptions?: ComposioRequestOptions): Promise<{ activeKid: string; keys: { alg: string; e: string; kid: string; kty: string; n: string; use: string }[] }>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Parameters**
|
|
35
|
+
|
|
36
|
+
| Name | Type |
|
|
37
|
+
|------|------|
|
|
38
|
+
| `requestOptions?` | `ComposioRequestOptions` |
|
|
39
|
+
|
|
40
|
+
**Returns**
|
|
41
|
+
|
|
42
|
+
`Promise<\{ activeKid: string; keys: \{ alg: string; e: string; kid: string; kty: string; n: string; use: string \}[] \}>` — The active key ID and every accepted public JWK, newest first
|
|
43
|
+
|
|
44
|
+
**Example**
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { CompactEncrypt, importJWK } from 'jose';
|
|
48
|
+
|
|
49
|
+
const { activeKid, keys } = await composio.keyring.listTransferKeys();
|
|
50
|
+
const jwk = keys.find(key => key.kid === activeKid)!;
|
|
51
|
+
const sealed = await new CompactEncrypt(new TextEncoder().encode(secret))
|
|
52
|
+
.setProtectedHeader({ alg: 'RSA-OAEP-256', enc: 'A256GCM', kid: activeKid })
|
|
53
|
+
.encrypt(await importJWK(jwk, 'RSA-OAEP-256'));
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Logs"
|
|
3
|
+
description: "`composio.logs` — tool-execution logs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
Access this class through the `composio.logs` property:
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const composio = new Composio({ apiKey: 'your-api-key' });
|
|
12
|
+
const result = await composio.logs.list();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### get()
|
|
18
|
+
|
|
19
|
+
Retrieve one tool-execution log with its full detail (timings, context,
|
|
20
|
+
source and raw `data`).
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
async get(id: string, requestOptions?: ComposioRequestOptions): Promise<{ context: { requestId?: string; sessionId?: string; traceId?: string }; data: Record<string, unknown>; id: string; level: 'error' | 'warn' | 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: { logId: string; toolSlug: string } | null; source: { framework?: string; host?: string; language?: string }; status: 'success' | 'failed'; timestamp: string; timings?: { endTime: number; startTime: number }; type: string }>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Parameters**
|
|
27
|
+
|
|
28
|
+
| Name | Type | Description |
|
|
29
|
+
|------|------|-------------|
|
|
30
|
+
| `id` | `string` | The log id |
|
|
31
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
32
|
+
|
|
33
|
+
**Returns**
|
|
34
|
+
|
|
35
|
+
`Promise<\{ context: \{ requestId?: string; sessionId?: string; traceId?: string \}; data: Record<string, unknown>; id: string; level: 'error' \| 'warn' \| 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: \{ logId: string; toolSlug: string \} \| null; source: \{ framework?: string; host?: string; language?: string \}; status: 'success' \| 'failed'; timestamp: string; timings?: \{ endTime: number; startTime: number \}; type: string \}>` — The log detail
|
|
36
|
+
|
|
37
|
+
**Example**
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const log = await composio.logs.get('log_abc123');
|
|
41
|
+
console.log(log.status, log.timings?.endTime);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### search()
|
|
47
|
+
|
|
48
|
+
Search tool-execution logs with filters, a time range and cursor
|
|
49
|
+
pagination.
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
async search(params?: { cursor?: string | null; filters?: { field: 'status' | 'tool_slug' | 'toolkit_slug' | 'connected_account_id' | 'auth_config_id' | 'user_id' | 'session_id' | 'sandbox_id' | 'request_id' | 'log_id'; operator: '==' | '!=' | 'contains' | 'not_contains'; value: string }[]; limit?: number; timeRange?: { from: number; to: number } }, requestOptions?: ComposioRequestOptions): Promise<{ logs: { id: string; level: 'error' | 'warn' | 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: { logId: ...; toolSlug: ... } | null; status: 'success' | 'failed'; timestamp: string; type: string }[]; nextCursor: string | null }>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Parameters**
|
|
56
|
+
|
|
57
|
+
| Name | Type | Description |
|
|
58
|
+
|------|------|-------------|
|
|
59
|
+
| `params?` | `\{ cursor?: string \| null; filters?: \{ field: 'status' \| 'tool_slug' \| 'toolkit_slug' \| 'connected_account_id' \| 'auth_config_id' \| 'user_id' \| 'session_id' \| 'sandbox_id' \| 'request_id' \| 'log_id'; operator: '==' \| '!=' \| 'contains' \| 'not_contains'; value: string \}[]; limit?: number; timeRange?: \{ from: number; to: number \} \}` | Filters, `timeRange`, `limit` and `cursor` |
|
|
60
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
61
|
+
|
|
62
|
+
**Returns**
|
|
63
|
+
|
|
64
|
+
`Promise<\{ logs: \{ id: string; level: 'error' \| 'warn' \| 'info'; message?: string; metadata: Record<string, unknown>; metrics: Record<string, unknown>; parent: \{ logId: ...; toolSlug: ... \} \| null; status: 'success' \| 'failed'; timestamp: string; type: string \}[]; nextCursor: string \| null \}>` — Matching logs and the next cursor
|
|
65
|
+
|
|
66
|
+
**Example**
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
const { logs } = await composio.logs.search({
|
|
70
|
+
filters: [
|
|
71
|
+
{ field: 'status', operator: '==', value: 'failed' },
|
|
72
|
+
{ field: 'user_id', operator: '==', value: 'user_123' },
|
|
73
|
+
],
|
|
74
|
+
timeRange: { from: Date.now() - 24 * 60 * 60 * 1000, to: Date.now() },
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
@@ -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: { allowedTools?: string[]; manuallyManageConnections?: boolean; toolkits: string | { authConfigId?: string; toolkit?: string }[] }, requestOptions?: ComposioRequestOptions): Promise<MCPConfigCreateResponse>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
**Parameters**
|
|
@@ -41,7 +41,7 @@ async create(name: string, mcpConfig: MCPConfigCreationParams, requestOptions?:
|
|
|
41
41
|
| Name | Type |
|
|
42
42
|
|------|------|
|
|
43
43
|
| `name` | `string` |
|
|
44
|
-
| `mcpConfig` | `
|
|
44
|
+
| `mcpConfig` | `\{ allowedTools?: string[]; manuallyManageConnections?: boolean; toolkits: string \| \{ authConfigId?: string; toolkit?: string \}[] \}` |
|
|
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<{ deleted: boolean; id: string }>
|
|
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<\{ deleted: boolean; id: string \}>` — 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?: { manuallyManageConnections?: boolean }, requestOptions?: ComposioRequestOptions): Promise<...>
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
**Parameters**
|
|
@@ -131,12 +131,12 @@ async generate(userId: string, mcpConfigId: string, options?: MCPGetInstancePara
|
|
|
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?` | `\{ manuallyManageConnections?: boolean \}` | \{object\} additional options |
|
|
135
135
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
136
136
|
|
|
137
137
|
**Returns**
|
|
138
138
|
|
|
139
|
-
`Promise
|
|
139
|
+
`Promise<...>`
|
|
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<{ allowedTools: string[]; authConfigIds: string[]; commands: { claude: string; cursor: string; windsurf: string }; id: string; MCPUrl: string; name: string; serverInstanceCount: number; toolkitIcons: Record<string, string>; toolkits: string[] }>
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
**Parameters**
|
|
@@ -166,7 +166,7 @@ async get(serverId: string, requestOptions?: ComposioRequestOptions): Promise<MC
|
|
|
166
166
|
|
|
167
167
|
**Returns**
|
|
168
168
|
|
|
169
|
-
`Promise<
|
|
169
|
+
`Promise<\{ allowedTools: string[]; authConfigIds: string[]; commands: \{ claude: string; cursor: string; windsurf: string \}; id: string; MCPUrl: string; name: string; serverInstanceCount: number; toolkitIcons: Record<string, string>; toolkits: string[] \}>` — 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: { authConfigs: string[]; limit: number; name?: string; page: number; toolkits: string[] }, requestOptions?: ComposioRequestOptions): Promise<{ currentPage: number; items: { allowedTools: string[]; authConfigIds: string[]; commands: { claude: string; cursor: string; windsurf: string }; id: string; MCPUrl: string; name: string; serverInstanceCount: number; toolkitIcons: Record<string, string>; toolkits: string[] }[]; totalPages: number }>
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
**Parameters**
|
|
202
202
|
|
|
203
203
|
| Name | Type | Description |
|
|
204
204
|
|------|------|-------------|
|
|
205
|
-
| `options` | `
|
|
205
|
+
| `options` | `\{ authConfigs: string[]; limit: number; name?: string; page: number; toolkits: string[] \}` | Filtering and pagination options |
|
|
206
206
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
207
207
|
|
|
208
208
|
**Returns**
|
|
209
209
|
|
|
210
|
-
`Promise<
|
|
210
|
+
`Promise<\{ currentPage: number; items: \{ allowedTools: string[]; authConfigIds: string[]; commands: \{ claude: string; cursor: string; windsurf: string \}; id: string; MCPUrl: string; name: string; serverInstanceCount: number; toolkitIcons: Record<string, string>; toolkits: string[] \}[]; totalPages: number \}>` — 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: { allowedTools?: string[]; manuallyManageConnections?: boolean; name?: string; toolkits?: string | { authConfigId?: string; toolkit?: string }[] }, requestOptions?: ComposioRequestOptions): Promise<{ allowedTools: string[]; authConfigIds: string[]; commands: { claude: string; cursor: string; windsurf: string }; id: string; MCPUrl: string; name: string; serverInstanceCount: number; toolkitIcons: Record<string, string>; toolkits: string[] }>
|
|
243
243
|
```
|
|
244
244
|
|
|
245
245
|
**Parameters**
|
|
@@ -247,12 +247,12 @@ async update(serverId: string, config: MCPUpdateParams, requestOptions?: Composi
|
|
|
247
247
|
| Name | Type | Description |
|
|
248
248
|
|------|------|-------------|
|
|
249
249
|
| `serverId` | `string` | The unique identifier of the MCP server to update |
|
|
250
|
-
| `config` | `
|
|
250
|
+
| `config` | `\{ allowedTools?: string[]; manuallyManageConnections?: boolean; name?: string; toolkits?: string \| \{ authConfigId?: string; toolkit?: string \}[] \}` | Update configuration parameters |
|
|
251
251
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
252
252
|
|
|
253
253
|
**Returns**
|
|
254
254
|
|
|
255
|
-
`Promise<
|
|
255
|
+
`Promise<\{ allowedTools: string[]; authConfigIds: string[]; commands: \{ claude: string; cursor: string; windsurf: string \}; id: string; MCPUrl: string; name: string; serverInstanceCount: number; toolkitIcons: Record<string, string>; toolkits: string[] \}>` — Updated MCP server configuration with all details
|
|
256
256
|
|
|
257
257
|
**Example**
|
|
258
258
|
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"composio",
|
|
5
5
|
"auth-configs",
|
|
6
6
|
"connected-accounts",
|
|
7
|
+
"custom-toolkits",
|
|
8
|
+
"keyring",
|
|
9
|
+
"logs",
|
|
7
10
|
"experimental",
|
|
8
11
|
"mcp",
|
|
9
12
|
"remote-file",
|
|
@@ -12,6 +15,11 @@
|
|
|
12
15
|
"session",
|
|
13
16
|
"session-files",
|
|
14
17
|
"tools",
|
|
15
|
-
"triggers"
|
|
18
|
+
"triggers",
|
|
19
|
+
"session-configs",
|
|
20
|
+
"usage",
|
|
21
|
+
"webhook-endpoints",
|
|
22
|
+
"webhooks",
|
|
23
|
+
"webhook-subscriptions"
|
|
16
24
|
]
|
|
17
25
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "SessionConfigs"
|
|
3
|
+
description: "`composio.sessionConfigs` — saved, reusable Session configs. A Session config is a named access policy (`sc_…`) built in the Composio Dashboard under Sessions → Configs. Pass its id as `experimental.sessionConfigId` to `composio.sessions.create()` or `session.update()` to apply it. These endpoints require Session configs to be enabled for the project; otherwise the backend returns 403."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
Access this class through the `composio.sessionConfigs` property:
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const composio = new Composio({ apiKey: 'your-api-key' });
|
|
12
|
+
const result = await composio.sessionConfigs.list();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### get()
|
|
18
|
+
|
|
19
|
+
Retrieve one saved Session config with its description and access
|
|
20
|
+
policy. A missing or cross-project id surfaces as the backend's 404.
|
|
21
|
+
|
|
22
|
+
Requires Session configs to be enabled for the project.
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
async get(id: string, requestOptions?: ComposioRequestOptions): Promise<{ archived: boolean; config: { tags?: { disable?: ... | ... | ... | ...[]; enable?: ... | ... | ... | ...[] }; toolkits?: { enable: ...[] } | { disable: ...[] }; tools?: Record<string, { enable: ... } | { disable: ... } | { tags: ... }> }; createdAt: string; description: string | null; id: string; name: string; updatedAt: string }>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Parameters**
|
|
29
|
+
|
|
30
|
+
| Name | Type | Description |
|
|
31
|
+
|------|------|-------------|
|
|
32
|
+
| `id` | `string` | The `sc_…` id of the Session config |
|
|
33
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
34
|
+
|
|
35
|
+
**Returns**
|
|
36
|
+
|
|
37
|
+
`Promise<\{ archived: boolean; config: \{ tags?: \{ disable?: ... \| ... \| ... \| ...[]; enable?: ... \| ... \| ... \| ...[] \}; toolkits?: \{ enable: ...[] \} \| \{ disable: ...[] \}; tools?: Record<string, \{ enable: ... \} \| \{ disable: ... \} \| \{ tags: ... \}> \}; createdAt: string; description: string \| null; id: string; name: string; updatedAt: string \}>` — The config and its policy
|
|
38
|
+
|
|
39
|
+
**Example**
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
const sessionConfig = await composio.sessionConfigs.get('sc_abc123');
|
|
43
|
+
console.log(sessionConfig.config.toolkits);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### list()
|
|
49
|
+
|
|
50
|
+
List the project's saved Session configs with cursor pagination.
|
|
51
|
+
|
|
52
|
+
Omitting `archived` returns active configs; `archived: true` returns only
|
|
53
|
+
archived ones. The backend defaults `limit` to 20 and caps it at 100.
|
|
54
|
+
|
|
55
|
+
Requires Session configs to be enabled for the project.
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
async list(params?: { archived?: boolean; cursor?: string; limit?: number; search?: string }, requestOptions?: ComposioRequestOptions): Promise<{ items: { archived: boolean; createdAt: string; id: string; name: string; updatedAt: string }[]; nextCursor: string | null }>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Parameters**
|
|
62
|
+
|
|
63
|
+
| Name | Type | Description |
|
|
64
|
+
|------|------|-------------|
|
|
65
|
+
| `params?` | `\{ archived?: boolean; cursor?: string; limit?: number; search?: string \}` | `search`, `archived`, `limit` and `cursor` |
|
|
66
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
67
|
+
|
|
68
|
+
**Returns**
|
|
69
|
+
|
|
70
|
+
`Promise<\{ items: \{ archived: boolean; createdAt: string; id: string; name: string; updatedAt: string \}[]; nextCursor: string \| null \}>` — Config summaries and the next cursor
|
|
71
|
+
|
|
72
|
+
**Example**
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
let cursor: string | undefined;
|
|
76
|
+
do {
|
|
77
|
+
const page = await composio.sessionConfigs.list({ cursor });
|
|
78
|
+
for (const item of page.items) console.log(item.id, item.name);
|
|
79
|
+
cursor = page.nextCursor ?? undefined;
|
|
80
|
+
} while (cursor);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
@@ -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?: { mountId?: string }): Promise<{ mountRelativePath: string; sandboxMountPrefix: string }>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
**Parameters**
|
|
@@ -21,11 +21,11 @@ async delete(remotePath: string, options?: ToolRouterSessionFilesMountDeleteOpti
|
|
|
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?` | `\{ mountId?: string \}` | Optional configuration for the delete operation. |
|
|
25
25
|
|
|
26
26
|
**Returns**
|
|
27
27
|
|
|
28
|
-
`Promise
|
|
28
|
+
`Promise<\{ mountRelativePath: string; sandboxMountPrefix: string \}>` — 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?: { mountId?: string }): Promise<RemoteFile>
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
**Parameters**
|
|
@@ -59,7 +59,7 @@ async download(filePath: string, options?: ToolRouterSessionFilesMountDownloadOp
|
|
|
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?` | `\{ mountId?: string \}` | 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?: { cursor?: string; limit?: number; mountId?: string; path?: string }): Promise<{ items: { lastModified: string; mountRelativePath: string; sandboxMountPrefix: string; size: number }[]; nextCursor: string | undefined }>
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
**Parameters**
|
|
97
97
|
|
|
98
98
|
| Name | Type | Description |
|
|
99
99
|
|------|------|-------------|
|
|
100
|
-
| `options?` | `
|
|
100
|
+
| `options?` | `\{ cursor?: string; limit?: number; mountId?: string; path?: string \}` | Optional configuration for the list operation. |
|
|
101
101
|
|
|
102
102
|
**Returns**
|
|
103
103
|
|
|
104
|
-
`Promise
|
|
104
|
+
`Promise<\{ items: \{ lastModified: string; mountRelativePath: string; sandboxMountPrefix: string; size: number \}[]; nextCursor: string \| undefined \}>` — 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?: { mimetype?: string; mountId?: string; remotePath?: string }): Promise<RemoteFile>
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
**Parameters**
|
|
@@ -138,7 +138,7 @@ async upload(input: string | File | ArrayBuffer | Uint8Array, options?: ToolRout
|
|
|
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?` | `\{ mimetype?: string; mountId?: string; remotePath?: string \}` | Optional configuration. When passing a buffer, remotePath is required. |
|
|
142
142
|
|
|
143
143
|
**Returns**
|
|
144
144
|
|