@composio/core 0.28.0 → 0.30.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/README.md +25 -0
- package/dist/{CustomTool-BYHB7sPs.mjs → CustomTool-9Vlb4XaS.mjs} +12 -14
- package/dist/{CustomTool-DyypijT6.d.mts → CustomTool-Dzk3iqfP.d.mts} +10 -11
- package/dist/FileModifierErrors-WrqokuIF.mjs +199 -0
- package/dist/{FileToolModifier.utils.neutral-DWFpnsj2.mjs → FileToolModifier.utils.neutral-BQP85ZJj.mjs} +1 -2
- package/dist/{SsrfErrors-DiQldIdC.mjs → SsrfErrors-BSVMW915.mjs} +49 -26
- package/dist/{Telemetry-D2PJwXKx.mjs → Telemetry-a7SOQXcg.mjs} +6 -10
- package/dist/{composio-CwHMpKXb.d.mts → composio-DaokW5sV.d.mts} +220 -254
- package/dist/{customTool.types-DoItUHkO.d.mts → customTool.types-CpJbzxT6.d.mts} +255 -274
- package/dist/docs/error-consistency.md +3 -3
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +2 -1
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +88 -10
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +48 -10
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +4 -4
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +5 -1
- package/dist/{errors-Cly0vXFh.mjs → errors-xC13uvaA.mjs} +116 -135
- package/dist/experimental/index.d.mts +17 -3
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-ILI1IjnZ.mjs → fileUtils.node-CAwIbWYH.mjs} +6 -8
- package/dist/{files.types-DeMC_mAW.d.mts → files.types-Dg6HcEzs.d.mts} +0 -2
- package/dist/index.d.mts +73 -78
- package/dist/index.mjs +393 -290
- package/dist/{cancellation-ZoRh6EJQ.mjs → jsonSchema-Cc4EtHRw.mjs} +5 -22
- package/dist/models/Files.node.d.mts +32 -13
- package/dist/models/Files.node.mjs +36 -19
- package/dist/models/Files.workerd.d.mts +8 -3
- package/dist/models/Files.workerd.mjs +1 -2
- package/dist/platform/node.d.mts +2 -4
- package/dist/platform/node.mjs +15 -16
- package/dist/platform/workerd.d.mts +2 -4
- package/dist/platform/workerd.mjs +1 -2
- package/dist/requestOptions.types-DWrTcbss.d.mts +38 -0
- package/dist/rolldown-runtime-ad2WFvuA.mjs +17 -0
- package/dist/{sensitiveFileUploadPaths-BaEORC7-.mjs → sensitiveFileUploadPaths-CSyJ3Ku8.mjs} +22 -12
- package/dist/{ssrfGuard.node-BZ270bcu.mjs → ssrfGuard.node-CdIkwqVu.mjs} +3 -5
- package/dist/{types-DWZWePfZ.d.mts → types-DQdUb7OG.d.mts} +2 -4
- package/dist/{types-DuVZKrXO.d.mts → types-Ds6XbK1m.d.mts} +0 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +2 -4
- package/dist/utils/config-defaults/ConfigDefaults.node.mjs +1 -2
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +2 -4
- package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +1 -2
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +2 -4
- package/dist/utils/modifiers/FileToolModifier.node.mjs +7 -8
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +2 -4
- package/dist/utils/modifiers/FileToolModifier.workerd.mjs +2 -3
- package/dist/utils/ssrfGuard.node.d.mts +1 -3
- package/dist/utils/ssrfGuard.node.mjs +1 -1
- package/dist/utils/ssrfGuard.workerd.d.mts +1 -3
- package/dist/utils/ssrfGuard.workerd.mjs +2 -3
- package/docs/error-consistency.md +3 -3
- package/package.json +12 -13
- package/src/composio.ts +12 -0
- package/src/errors/ComposioError.ts +40 -16
- package/src/errors/ConnectedAccountsErrors.ts +2 -2
- package/src/errors/ToolErrors.ts +177 -28
- package/src/errors/apiErrorDetails.ts +40 -0
- package/src/experimental/index.ts +6 -1
- package/src/lib/toolRouterParams.ts +40 -0
- package/src/models/ConnectedAccounts.ts +2 -2
- package/src/models/ConnectionRequest.ts +44 -32
- package/src/models/CustomTool.ts +25 -30
- package/src/models/CustomToolkits.ts +16 -22
- package/src/models/Experimental.ts +2 -7
- package/src/models/Files.node.ts +68 -37
- package/src/models/RemoteFile.ts +22 -16
- package/src/models/SessionContext.ts +6 -7
- package/src/models/ToolRouter.ts +24 -14
- package/src/models/ToolRouterSession.ts +38 -31
- package/src/models/Tools.ts +274 -30
- package/src/models/Triggers.ts +8 -2
- package/src/types/customTool.types.ts +49 -28
- package/src/types/customToolkits.types.ts +7 -12
- package/src/types/toolRouter.types.ts +39 -17
- package/src/utils/cancellation.ts +5 -1
- package/src/utils/rateLimit.ts +25 -0
- package/src/utils/transformers/customToolkits.ts +2 -2
- package/dist/FileModifierErrors-CdGSABoq.mjs +0 -97
- package/dist/rolldown-runtime-w6R9maHv.mjs +0 -18
- package/src/models/inlineCustomToolsPayload.ts +0 -17
|
@@ -44,9 +44,9 @@ Some error classes have specific requirements:
|
|
|
44
44
|
new ValidationError('Message', { cause: someZodError });
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
2. **ComposioToolExecutionError**:
|
|
47
|
+
2. **ComposioToolExecutionError**: Keeps the failure it wraps as `cause`. The base `ComposioError` reads `statusCode`, `requestId`, and `apiErrorCode` from an `APIError` cause.
|
|
48
48
|
```typescript
|
|
49
|
-
new ComposioToolExecutionError('Message', {
|
|
49
|
+
new ComposioToolExecutionError('Message', { cause: someError });
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
## Using Error Classes
|
|
@@ -72,7 +72,7 @@ try {
|
|
|
72
72
|
} catch (error) {
|
|
73
73
|
// Handle tool execution errors
|
|
74
74
|
throw new ComposioToolExecutionError('Tool failed', {
|
|
75
|
-
|
|
75
|
+
cause: error,
|
|
76
76
|
meta: { toolId: 'some-tool' },
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -54,6 +54,7 @@ const composio = new Composio({
|
|
|
54
54
|
| `authConfigs` | `AuthConfigs` | Manage authentication configurations for toolkits |
|
|
55
55
|
| `connectedAccounts` | `ConnectedAccounts` | Manage authenticated connections |
|
|
56
56
|
| `create` | `(...) => Promise<Session>` | Creates a new tool router session for a user. Use `sessionPreset: SessionPreset.DIRECT_TOOLS` when all needed tools should be exposed directly; see `ToolRouterCreateSessionConfig`. |
|
|
57
|
+
| `customToolkits` | `CustomToolkits` | Register and manage project-owned custom toolkits, such as a remote MCP server (`create()` / `update()` / `sync()` / `delete()`). |
|
|
57
58
|
| `experimental` | `Experimental` | Experimental SDK methods whose shape may change in future releases. Prefer domain-specific mounts (for example `composio.connectedAccounts.updateAcl(...)`) when available; this namespace keeps compatibility aliases while APIs are experimental. Stateless experimental factories (e.g. `experimental_createTool`) stay at the top level. |
|
|
58
59
|
| `files` | `Files` | Upload and download files |
|
|
59
60
|
| `keyring` | `Keyring` | Public transfer keys of the organization's customer-managed keyring |
|
|
@@ -66,7 +67,7 @@ const composio = new Composio({
|
|
|
66
67
|
| `toolRouter` | `ToolRouter` | Legacy alias for `composio.sessions`. |
|
|
67
68
|
| `tools` | `Tools` | List, retrieve, and execute tools |
|
|
68
69
|
| `triggers` | `Triggers` | Manage webhook triggers and event subscriptions |
|
|
69
|
-
| `use` | `(
|
|
70
|
+
| `use` | `(...) => Promise<Session>` | Use an existing tool router session |
|
|
70
71
|
| `webhooks` | `Webhooks` | Manage the project's webhook subscription (`webhooks.subscriptions`) and inbound per-toolkit webhook endpoints (`webhooks.endpoints`). |
|
|
71
72
|
|
|
72
73
|
## Methods
|
|
@@ -540,8 +540,8 @@ const disabledAccount = await composio.connectedAccounts.updateStatus('conn_abc1
|
|
|
540
540
|
|
|
541
541
|
Waits for a connection request to complete and become active.
|
|
542
542
|
|
|
543
|
-
This method
|
|
544
|
-
until it either becomes active, enters a terminal error state, or times out.
|
|
543
|
+
This method polls the Composio API, backing off from 1 second to 5 seconds between polls,
|
|
544
|
+
to check the status of a connection until it either becomes active, enters a terminal error state, or times out.
|
|
545
545
|
|
|
546
546
|
```typescript
|
|
547
547
|
async waitForConnection(connectedAccountId: string, timeout?: number): Promise<ConnectedAccountRetrieveResponse>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "CustomToolkits"
|
|
3
|
-
description: "`composio.
|
|
3
|
+
description: "`composio.customToolkits` — toolkits your project registers from its own app or MCP server, with their own auth configs and connected accounts. These live on the Composio platform. They are unrelated to the in-process toolkits built with `experimental_createToolkit()`, which run inside your application."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Usage
|
|
@@ -14,12 +14,51 @@ const result = await composio.customToolkits.list();
|
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
|
+
### create()
|
|
18
|
+
|
|
19
|
+
Creates a custom MCP toolkit and returns its generated slug.
|
|
20
|
+
|
|
21
|
+
Set `userId` to `'all'` to share the toolkit with every user in the
|
|
22
|
+
project, or to a user ID to make it private to that user. `mcpUrl`,
|
|
23
|
+
`authSchemes` and `userId` cannot change later: delete and re-create the
|
|
24
|
+
toolkit instead. For a private toolkit, `connectLink` is where to send
|
|
25
|
+
that user to connect.
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
async create(params: CustomToolkitCreateParams, requestOptions?: ComposioRequestOptions): Promise<CustomToolkitCreateResponse>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Parameters**
|
|
32
|
+
|
|
33
|
+
| Name | Type | Description |
|
|
34
|
+
|------|------|-------------|
|
|
35
|
+
| `params` | `CustomToolkitCreateParams` | The toolkit to create |
|
|
36
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
37
|
+
|
|
38
|
+
**Returns**
|
|
39
|
+
|
|
40
|
+
`Promise<CustomToolkitCreateResponse>` — The toolkit's slug and, for a private toolkit, a connect link
|
|
41
|
+
|
|
42
|
+
**Example**
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const { slug, connectLink } = await composio.customToolkits.create({
|
|
46
|
+
name: 'Internal API',
|
|
47
|
+
mcpUrl: 'https://mcp.internal.example.com/mcp',
|
|
48
|
+
authSchemes: [
|
|
49
|
+
{ mode: 'API_KEY', headers: { Authorization: 'Bearer {{generic_api_key}}' } },
|
|
50
|
+
],
|
|
51
|
+
userId: 'user_123',
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
17
57
|
### delete()
|
|
18
58
|
|
|
19
59
|
Deletes a custom toolkit owned by the project, with its tools, auth
|
|
20
60
|
configs and connected accounts. The credentials behind those connected
|
|
21
61
|
accounts are revoked in background jobs (`revokeJobIds`).
|
|
22
|
-
**Experimental — custom toolkits are in pilot; shape may change.**
|
|
23
62
|
|
|
24
63
|
Composio-managed toolkits cannot be deleted; the API answers 403.
|
|
25
64
|
|
|
@@ -41,7 +80,7 @@ async delete(slug: string, requestOptions?: ComposioRequestOptions): Promise<Cus
|
|
|
41
80
|
**Example**
|
|
42
81
|
|
|
43
82
|
```typescript
|
|
44
|
-
const result = await composio.
|
|
83
|
+
const result = await composio.customToolkits.delete('CUSTOM_MY_TOOLKIT');
|
|
45
84
|
console.log(result.connectedAccountsDeleted);
|
|
46
85
|
```
|
|
47
86
|
|
|
@@ -51,7 +90,6 @@ console.log(result.connectedAccountsDeleted);
|
|
|
51
90
|
|
|
52
91
|
Re-fetches the tool definitions of a custom toolkit from its remote MCP
|
|
53
92
|
server. Call it when automatic sync fails or the remote tools change.
|
|
54
|
-
**Experimental — custom toolkits are in pilot; shape may change.**
|
|
55
93
|
|
|
56
94
|
```typescript
|
|
57
95
|
async sync(slug: string, params?: CustomToolkitSyncParams, requestOptions?: ComposioRequestOptions): Promise<CustomToolkitSyncResponse>
|
|
@@ -72,7 +110,7 @@ async sync(slug: string, params?: CustomToolkitSyncParams, requestOptions?: Comp
|
|
|
72
110
|
**Example**
|
|
73
111
|
|
|
74
112
|
```typescript
|
|
75
|
-
const { version, syncedCount } = await composio.
|
|
113
|
+
const { version, syncedCount } = await composio.customToolkits.sync(
|
|
76
114
|
'CUSTOM_MY_TOOLKIT',
|
|
77
115
|
{ connectedAccountId: 'ca_abc123' }
|
|
78
116
|
);
|
|
@@ -80,13 +118,53 @@ const { version, syncedCount } = await composio.experimental.customToolkits.sync
|
|
|
80
118
|
|
|
81
119
|
---
|
|
82
120
|
|
|
83
|
-
###
|
|
121
|
+
### update()
|
|
122
|
+
|
|
123
|
+
Updates a custom toolkit's name, logo or API key field copy. Omitted
|
|
124
|
+
fields keep their current value.
|
|
125
|
+
|
|
126
|
+
On a project with 2FA enabled, updating a private toolkit requires the
|
|
127
|
+
`userId` it is private to.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
async update(slug: string, params: CustomToolkitUpdateParams, requestOptions?: ComposioRequestOptions): Promise<CustomToolkitUpdateResponse>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Parameters**
|
|
134
|
+
|
|
135
|
+
| Name | Type | Description |
|
|
136
|
+
|------|------|-------------|
|
|
137
|
+
| `slug` | `string` | The custom toolkit slug returned by `create()` |
|
|
138
|
+
| `params` | `CustomToolkitUpdateParams` | At least one of `name`, `logoFile`, `apiKeyField` |
|
|
139
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
140
|
+
|
|
141
|
+
**Returns**
|
|
142
|
+
|
|
143
|
+
`Promise<CustomToolkitUpdateResponse>` — `\{ success: true \}`
|
|
144
|
+
|
|
145
|
+
**Example**
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
await composio.customToolkits.update('CUSTOM_INTERNAL_API_K7F2Q', {
|
|
149
|
+
name: 'Internal API (prod)',
|
|
150
|
+
userId: 'user_123',
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### upsert() (deprecated)
|
|
157
|
+
|
|
158
|
+
<Callout type="warn" title="Deprecated">
|
|
159
|
+
Use `create()` for a new toolkit and `update(slug, ...)` to change
|
|
160
|
+
its name, logo or API key field. `create()` generates the slug, so store the
|
|
161
|
+
slug it returns.
|
|
162
|
+
</Callout>
|
|
84
163
|
|
|
85
164
|
Creates a custom toolkit, or updates its display metadata (name, API key
|
|
86
165
|
field copy) when the project already owns a toolkit with this slug.
|
|
87
|
-
**Experimental — custom toolkits are in pilot; shape may change.**
|
|
88
166
|
|
|
89
|
-
`
|
|
167
|
+
`mcpUrl` and `authSchemes` cannot change on an existing toolkit:
|
|
90
168
|
re-sending them unchanged is a no-op, and changing them fails with a 409.
|
|
91
169
|
Delete and re-register the toolkit instead, which revokes its connections.
|
|
92
170
|
|
|
@@ -108,11 +186,11 @@ async upsert(params: CustomToolkitUpsertParams, requestOptions?: ComposioRequest
|
|
|
108
186
|
**Example**
|
|
109
187
|
|
|
110
188
|
```typescript
|
|
111
|
-
await composio.
|
|
189
|
+
await composio.customToolkits.upsert({
|
|
112
190
|
slug: 'INTERNAL_API',
|
|
113
191
|
toolkitConfig: {
|
|
114
192
|
name: 'Internal API',
|
|
115
|
-
|
|
193
|
+
mcpUrl: 'https://mcp.internal.example.com/mcp',
|
|
116
194
|
authSchemes: [
|
|
117
195
|
{ mode: 'API_KEY', headers: { Authorization: 'Bearer {{generic_api_key}}' } },
|
|
118
196
|
],
|
|
@@ -16,7 +16,7 @@ const result = await composio.experimental.list();
|
|
|
16
16
|
|
|
17
17
|
| Name | Type | Description |
|
|
18
18
|
|------|------|-------------|
|
|
19
|
-
| `customToolkits` | `CustomToolkits` |
|
|
19
|
+
| `customToolkits` | `CustomToolkits` | Same object as `composio.customToolkits`. |
|
|
20
20
|
| `usage` | `Usage` | Project-scoped usage metering (`summary()` / `breakdown()`). **Experimental — shape may change in future releases.** |
|
|
21
21
|
|
|
22
22
|
## Methods
|
|
@@ -14,7 +14,7 @@ description: "Complete API reference for the Composio TypeScript SDK (@composio/
|
|
|
14
14
|
| [`Composio`](/reference/sdk-reference/typescript/composio) | This is the core class for Composio. |
|
|
15
15
|
| [`AuthConfigs`](/reference/sdk-reference/typescript/auth-configs) | AuthConfigs class |
|
|
16
16
|
| [`ConnectedAccounts`](/reference/sdk-reference/typescript/connected-accounts) | ConnectedAccounts class |
|
|
17
|
-
| [`CustomToolkits`](/reference/sdk-reference/typescript/custom-toolkits) | `composio.
|
|
17
|
+
| [`CustomToolkits`](/reference/sdk-reference/typescript/custom-toolkits) | `composio.customToolkits` — toolkits your project registers |
|
|
18
18
|
| [`Keyring`](/reference/sdk-reference/typescript/keyring) | `composio.keyring` — the organization's customer-managed keyring. |
|
|
19
19
|
| [`Logs`](/reference/sdk-reference/typescript/logs) | `composio.logs` — tool-execution logs. |
|
|
20
20
|
| [`SessionConfigs`](/reference/sdk-reference/typescript/session-configs) | `composio.sessionConfigs` — saved, reusable Session configs. |
|
|
@@ -64,7 +64,7 @@ async save(path?: string): Promise<string>
|
|
|
64
64
|
|
|
65
65
|
| Name | Type | Description |
|
|
66
66
|
|------|------|-------------|
|
|
67
|
-
| `path?` | `string` | Local path to save the file. If omitted, saves to the Composio temp directory using the filename from the mount path. An existing default destination gets a copy number before its extension. |
|
|
67
|
+
| `path?` | `string` | Local path to save the file. An explicit path does not require a home directory. If omitted, saves to the Composio temp directory using the filename from the mount path. An existing default destination gets a copy number before its extension. |
|
|
68
68
|
|
|
69
69
|
**Returns**
|
|
70
70
|
|
|
@@ -62,7 +62,7 @@ async list(params?: SessionConfigListParams, requestOptions?: ComposioRequestOpt
|
|
|
62
62
|
|
|
63
63
|
| Name | Type | Description |
|
|
64
64
|
|------|------|-------------|
|
|
65
|
-
| `params?` | `SessionConfigListParams` | `
|
|
65
|
+
| `params?` | `SessionConfigListParams` | `archived`, `limit` and `cursor`; the deprecated `search` is ignored |
|
|
66
66
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
67
67
|
|
|
68
68
|
**Returns**
|
|
@@ -52,28 +52,30 @@ async authorize(toolkit: string, options?: { callbackUrl?: string; alias?: strin
|
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
-
### customToolkits()
|
|
55
|
+
### customToolkits() (deprecated)
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
<Callout type="warn" title="Deprecated">
|
|
58
|
+
Use `localToolkits()` instead.
|
|
59
|
+
</Callout>
|
|
59
60
|
|
|
60
61
|
```typescript
|
|
61
|
-
customToolkits():
|
|
62
|
+
customToolkits(): RegisteredLocalToolkit[]
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
**Returns**
|
|
65
66
|
|
|
66
|
-
`
|
|
67
|
+
`RegisteredLocalToolkit[]`
|
|
67
68
|
|
|
68
69
|
---
|
|
69
70
|
|
|
70
|
-
### customTools()
|
|
71
|
+
### customTools() (deprecated)
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
<Callout type="warn" title="Deprecated">
|
|
74
|
+
Use `localTools()` instead.
|
|
75
|
+
</Callout>
|
|
74
76
|
|
|
75
77
|
```typescript
|
|
76
|
-
customTools(options?: { toolkit?: string }):
|
|
78
|
+
customTools(options?: { toolkit?: string }): RegisteredLocalTool[]
|
|
77
79
|
```
|
|
78
80
|
|
|
79
81
|
**Parameters**
|
|
@@ -84,7 +86,7 @@ customTools(options?: { toolkit?: string }): RegisteredCustomTool[]
|
|
|
84
86
|
|
|
85
87
|
**Returns**
|
|
86
88
|
|
|
87
|
-
`
|
|
89
|
+
`RegisteredLocalTool[]`
|
|
88
90
|
|
|
89
91
|
---
|
|
90
92
|
|
|
@@ -247,6 +249,42 @@ console.log(items[1].config.toolkits);
|
|
|
247
249
|
|
|
248
250
|
---
|
|
249
251
|
|
|
252
|
+
### localToolkits()
|
|
253
|
+
|
|
254
|
+
List all toolkits of local tools registered in this session.
|
|
255
|
+
Returns toolkits with their tools showing final slugs.
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
localToolkits(): RegisteredLocalToolkit[]
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**Returns**
|
|
262
|
+
|
|
263
|
+
`RegisteredLocalToolkit[]` — Array of registered toolkits of local tools
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### localTools()
|
|
268
|
+
|
|
269
|
+
List all local tools registered in this session.
|
|
270
|
+
Returns tools with their final slugs, schemas, and resolved toolkit.
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
localTools(options?: { toolkit?: string }): RegisteredLocalTool[]
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Parameters**
|
|
277
|
+
|
|
278
|
+
| Name | Type |
|
|
279
|
+
|------|------|
|
|
280
|
+
| `options?` | `\{ toolkit?: string \}` |
|
|
281
|
+
|
|
282
|
+
**Returns**
|
|
283
|
+
|
|
284
|
+
`RegisteredLocalTool[]` — Array of registered local tools
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
250
288
|
### proxyExecute()
|
|
251
289
|
|
|
252
290
|
Proxy an API call through Composio's auth layer using the session's connected account.
|
|
@@ -74,8 +74,8 @@ const session = await composio.sessions.create('user_123', {
|
|
|
74
74
|
toolkits: ['gmail'],
|
|
75
75
|
manageConnections: true,
|
|
76
76
|
experimental: {
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
localTools: [myLocalTool],
|
|
78
|
+
localToolkits: [myLocalToolkit],
|
|
79
79
|
},
|
|
80
80
|
});
|
|
81
81
|
|
|
@@ -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: LocalToolsOptions & { 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: { customTools?: CustomTool[]; customToolkits?: Cu
|
|
|
134
134
|
| Name | Type | Description |
|
|
135
135
|
|------|------|-------------|
|
|
136
136
|
| `id` | `string` | \{string\} The id of the session to use |
|
|
137
|
-
| `options` |
|
|
137
|
+
| `options` | `LocalToolsOptions & \{ mcp: true \}` | \{object\} Optional session reuse options |
|
|
138
138
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
139
139
|
|
|
140
140
|
**Returns**
|
|
@@ -144,7 +144,7 @@ async use(id: string, options: { customTools?: CustomTool[]; customToolkits?: Cu
|
|
|
144
144
|
**Overload 2**
|
|
145
145
|
|
|
146
146
|
```typescript
|
|
147
|
-
async use(id: string, options?:
|
|
147
|
+
async use(id: string, options?: LocalToolsOptions & { 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?: { customTools?: CustomTool[]; customToolkits?: C
|
|
|
152
152
|
| Name | Type | Description |
|
|
153
153
|
|------|------|-------------|
|
|
154
154
|
| `id` | `string` | \{string\} The id of the session to use |
|
|
155
|
-
| `options?` |
|
|
155
|
+
| `options?` | `LocalToolsOptions & \{ mcp?: boolean \}` | \{object\} Optional session reuse options |
|
|
156
156
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
157
157
|
|
|
158
158
|
**Returns**
|
|
@@ -225,8 +225,8 @@ Retrieves a specific tool by its slug from the Composio API.
|
|
|
225
225
|
This method fetches a single tool in raw format without provider-specific wrapping,
|
|
226
226
|
providing direct access to the tool's schema and metadata. Tool versions are controlled
|
|
227
227
|
at the Composio SDK initialization level through the `toolkitVersions` configuration.
|
|
228
|
-
|
|
229
|
-
Tool Router session, then use `session.tools()`, `session.
|
|
228
|
+
Experimental local tools are session-scoped; attach them when creating or reusing a
|
|
229
|
+
Tool Router session, then use `session.tools()`, `session.localTools()`, or
|
|
230
230
|
`session.execute()`.
|
|
231
231
|
|
|
232
232
|
```typescript
|
|
@@ -288,9 +288,9 @@ console.log({
|
|
|
288
288
|
Lists Composio API tools available to the SDK.
|
|
289
289
|
|
|
290
290
|
This method fetches remote Composio tools from the API in raw format. The response can be
|
|
291
|
-
filtered and modified as needed.
|
|
291
|
+
filtered and modified as needed. Experimental local tools are session-scoped; attach
|
|
292
292
|
them when creating or reusing a Tool Router session, then use `session.tools()`,
|
|
293
|
-
`session.
|
|
293
|
+
`session.localTools()`, or `session.execute()`.
|
|
294
294
|
It provides access to the underlying tool data without provider-specific wrapping.
|
|
295
295
|
|
|
296
296
|
```typescript
|
|
@@ -19,6 +19,9 @@ const result = await composio.triggers.list();
|
|
|
19
19
|
Create a new trigger instance for a user
|
|
20
20
|
If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
21
21
|
|
|
22
|
+
For a trigger that supports both webhook and polling, `body.type` picks one; omit it to let Composio choose.
|
|
23
|
+
`body.pollingInterval` sets the minutes between polls and wins over `triggerConfig.interval`.
|
|
24
|
+
|
|
22
25
|
```typescript
|
|
23
26
|
async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceUpsertResponse>
|
|
24
27
|
```
|
|
@@ -34,7 +37,8 @@ async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, r
|
|
|
34
37
|
|
|
35
38
|
**Returns**
|
|
36
39
|
|
|
37
|
-
`Promise<TriggerInstanceUpsertResponse>` — The
|
|
40
|
+
`Promise<TriggerInstanceUpsertResponse>` — The trigger instance, with the type it uses, why it polls
|
|
41
|
+
when it fell back from a webhook, and its polling interval
|
|
38
42
|
|
|
39
43
|
---
|
|
40
44
|
|