@composio/core 0.1.0-rc.5 → 0.1.3-alpha.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/index.cjs +1174 -464
- package/dist/index.d.cts +1304 -150
- package/dist/index.d.ts +1304 -150
- package/dist/index.js +1171 -463
- package/package.json +9 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,77 +1,514 @@
|
|
|
1
1
|
import ComposioClient from '@composio/client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { z, ZodObject, ZodString, ZodNumber, ZodBoolean, ZodOptional } from 'zod';
|
|
3
|
+
import { ToolProxyParams, ToolProxyResponse, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse } from '@composio/client/resources/tools';
|
|
4
4
|
import { RequestOptions } from '@composio/client/internal/request-options';
|
|
5
|
-
import { ToolkitListParams, ToolkitListResponse, ToolkitRetrieveResponse, ToolkitRetrieveCategoriesResponse } from '@composio/client/resources/toolkits';
|
|
6
5
|
import { TriggerInstanceListActiveParams, TriggerInstanceUpsertParams, TriggerInstanceUpsertResponse, TriggerInstanceRemoveUpsertResponse, TriggerInstanceUpdateStatusParams, TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
|
|
7
6
|
import { AuthConfigListParams, AuthConfigListResponse, AuthConfigCreateParams, AuthConfigCreateResponse, AuthConfigRetrieveResponse, AuthConfigUpdateParams, AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
|
|
8
|
-
import { ConnectedAccountListParams, ConnectedAccountListResponse, ConnectedAccountCreateParams, ConnectedAccountCreateResponse, ConnectedAccountRetrieveResponse, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
|
|
7
|
+
import { ConnectedAccountListParams, ConnectedAccountListResponse, ConnectedAccountCreateParams, ConnectedAccountCreateResponse, ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
|
|
9
8
|
import { OpenAI } from 'openai';
|
|
10
9
|
import { Stream } from 'openai/streaming';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Tool is a single action that can be performed by a toolkit.
|
|
13
|
+
* Tool is simlar to an action that an app can perform.
|
|
14
|
+
*
|
|
15
|
+
* eg. Google Search, Google Maps, Google Translate, etc.
|
|
16
|
+
*/
|
|
17
|
+
declare const ToolSchema: z.ZodObject<{
|
|
18
|
+
slug: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
description: z.ZodOptional<z.ZodString>;
|
|
21
|
+
inputParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
22
|
+
outputParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
24
|
+
toolkit: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
slug: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
slug: string;
|
|
30
|
+
name: string;
|
|
31
|
+
logo?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
slug: string;
|
|
34
|
+
name: string;
|
|
35
|
+
logo?: string | undefined;
|
|
36
|
+
}>>;
|
|
37
|
+
version: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
slug: string;
|
|
14
40
|
name: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
41
|
+
tags: string[];
|
|
42
|
+
description?: string | undefined;
|
|
43
|
+
inputParameters?: Record<string, unknown> | undefined;
|
|
44
|
+
outputParameters?: Record<string, unknown> | undefined;
|
|
45
|
+
toolkit?: {
|
|
46
|
+
slug: string;
|
|
47
|
+
name: string;
|
|
48
|
+
logo?: string | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
version?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
slug: string;
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
inputParameters?: Record<string, unknown> | undefined;
|
|
56
|
+
outputParameters?: Record<string, unknown> | undefined;
|
|
57
|
+
tags?: string[] | undefined;
|
|
58
|
+
toolkit?: {
|
|
59
|
+
slug: string;
|
|
60
|
+
name: string;
|
|
61
|
+
logo?: string | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
version?: string | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
type Tool = z.infer<typeof ToolSchema>;
|
|
66
|
+
/**
|
|
67
|
+
* Plain SDK level Tool List
|
|
68
|
+
*/
|
|
69
|
+
type ToolList = Array<Tool>;
|
|
70
|
+
/**
|
|
71
|
+
* ToolListParams is the parameters for the list of tools.
|
|
72
|
+
*/
|
|
19
73
|
declare const ToolListParamsSchema: z.ZodObject<{
|
|
20
74
|
cursor: z.ZodOptional<z.ZodString>;
|
|
21
75
|
important: z.ZodOptional<z.ZodString>;
|
|
22
76
|
limit: z.ZodOptional<z.ZodString>;
|
|
23
77
|
search: z.ZodOptional<z.ZodString>;
|
|
24
|
-
|
|
78
|
+
toolkits: z.ZodOptional<z.ZodString>;
|
|
79
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
25
80
|
}, "strip", z.ZodTypeAny, {
|
|
26
81
|
cursor?: string | undefined;
|
|
27
82
|
important?: string | undefined;
|
|
28
83
|
limit?: string | undefined;
|
|
29
84
|
search?: string | undefined;
|
|
30
|
-
|
|
85
|
+
toolkits?: string | undefined;
|
|
86
|
+
tools?: string[] | undefined;
|
|
31
87
|
}, {
|
|
32
88
|
cursor?: string | undefined;
|
|
33
89
|
important?: string | undefined;
|
|
34
90
|
limit?: string | undefined;
|
|
35
91
|
search?: string | undefined;
|
|
36
|
-
|
|
92
|
+
toolkits?: string | undefined;
|
|
93
|
+
tools?: string[] | undefined;
|
|
37
94
|
}>;
|
|
38
95
|
type ToolListParams = z.infer<typeof ToolListParamsSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* CustomAuthParams is the parameters for the custom authentication.
|
|
98
|
+
*/
|
|
99
|
+
declare const CustomAuthParamsSchema: z.ZodObject<{
|
|
100
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
101
|
+
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
103
|
+
in: z.ZodEnum<["query", "header"]>;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
name: string;
|
|
108
|
+
value: string | number;
|
|
109
|
+
in: "query" | "header";
|
|
110
|
+
}, {
|
|
111
|
+
name: string;
|
|
112
|
+
value: string | number;
|
|
113
|
+
in: "query" | "header";
|
|
114
|
+
}>, "many">;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
parameters: {
|
|
117
|
+
name: string;
|
|
118
|
+
value: string | number;
|
|
119
|
+
in: "query" | "header";
|
|
120
|
+
}[];
|
|
121
|
+
baseURL?: string | undefined;
|
|
122
|
+
body?: Record<string, unknown> | undefined;
|
|
123
|
+
}, {
|
|
124
|
+
parameters: {
|
|
125
|
+
name: string;
|
|
126
|
+
value: string | number;
|
|
127
|
+
in: "query" | "header";
|
|
128
|
+
}[];
|
|
129
|
+
baseURL?: string | undefined;
|
|
130
|
+
body?: Record<string, unknown> | undefined;
|
|
131
|
+
}>;
|
|
132
|
+
type CustomAuthParams = z.infer<typeof CustomAuthParamsSchema>;
|
|
133
|
+
/**
|
|
134
|
+
* ToolExecuteParams is the parameters for the tool execution.
|
|
135
|
+
*/
|
|
136
|
+
declare const ToolExecuteParamsSchema: z.ZodObject<{
|
|
137
|
+
allowTracing: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
connectedAccountId: z.ZodOptional<z.ZodString>;
|
|
139
|
+
customAuthParams: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
141
|
+
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
142
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
143
|
+
in: z.ZodEnum<["query", "header"]>;
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
name: string;
|
|
148
|
+
value: string | number;
|
|
149
|
+
in: "query" | "header";
|
|
150
|
+
}, {
|
|
151
|
+
name: string;
|
|
152
|
+
value: string | number;
|
|
153
|
+
in: "query" | "header";
|
|
154
|
+
}>, "many">;
|
|
155
|
+
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
parameters: {
|
|
157
|
+
name: string;
|
|
158
|
+
value: string | number;
|
|
159
|
+
in: "query" | "header";
|
|
160
|
+
}[];
|
|
161
|
+
baseURL?: string | undefined;
|
|
162
|
+
body?: Record<string, unknown> | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
parameters: {
|
|
165
|
+
name: string;
|
|
166
|
+
value: string | number;
|
|
167
|
+
in: "query" | "header";
|
|
168
|
+
}[];
|
|
169
|
+
baseURL?: string | undefined;
|
|
170
|
+
body?: Record<string, unknown> | undefined;
|
|
171
|
+
}>>;
|
|
172
|
+
arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
173
|
+
userId: z.ZodString;
|
|
174
|
+
version: z.ZodOptional<z.ZodString>;
|
|
175
|
+
text: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
userId: string;
|
|
178
|
+
version?: string | undefined;
|
|
179
|
+
allowTracing?: boolean | undefined;
|
|
180
|
+
connectedAccountId?: string | undefined;
|
|
181
|
+
customAuthParams?: {
|
|
182
|
+
parameters: {
|
|
183
|
+
name: string;
|
|
184
|
+
value: string | number;
|
|
185
|
+
in: "query" | "header";
|
|
186
|
+
}[];
|
|
187
|
+
baseURL?: string | undefined;
|
|
188
|
+
body?: Record<string, unknown> | undefined;
|
|
189
|
+
} | undefined;
|
|
190
|
+
arguments?: Record<string, unknown> | undefined;
|
|
191
|
+
text?: string | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
userId: string;
|
|
194
|
+
version?: string | undefined;
|
|
195
|
+
allowTracing?: boolean | undefined;
|
|
196
|
+
connectedAccountId?: string | undefined;
|
|
197
|
+
customAuthParams?: {
|
|
198
|
+
parameters: {
|
|
199
|
+
name: string;
|
|
200
|
+
value: string | number;
|
|
201
|
+
in: "query" | "header";
|
|
202
|
+
}[];
|
|
203
|
+
baseURL?: string | undefined;
|
|
204
|
+
body?: Record<string, unknown> | undefined;
|
|
205
|
+
} | undefined;
|
|
206
|
+
arguments?: Record<string, unknown> | undefined;
|
|
207
|
+
text?: string | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
type ToolExecuteParams = z.infer<typeof ToolExecuteParamsSchema>;
|
|
210
|
+
/**
|
|
211
|
+
* ToolResponse Schema
|
|
212
|
+
*/
|
|
213
|
+
declare const ToolExecuteResponseSchema: z.ZodObject<{
|
|
214
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
215
|
+
error: z.ZodNullable<z.ZodString>;
|
|
216
|
+
successful: z.ZodBoolean;
|
|
217
|
+
logId: z.ZodOptional<z.ZodString>;
|
|
218
|
+
sessionInfo: z.ZodOptional<z.ZodUnknown>;
|
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
|
220
|
+
data: Record<string, unknown>;
|
|
221
|
+
error: string | null;
|
|
222
|
+
successful: boolean;
|
|
223
|
+
logId?: string | undefined;
|
|
224
|
+
sessionInfo?: unknown;
|
|
225
|
+
}, {
|
|
226
|
+
data: Record<string, unknown>;
|
|
227
|
+
error: string | null;
|
|
228
|
+
successful: boolean;
|
|
229
|
+
logId?: string | undefined;
|
|
230
|
+
sessionInfo?: unknown;
|
|
231
|
+
}>;
|
|
232
|
+
type ToolExecuteResponse = z.infer<typeof ToolExecuteResponseSchema>;
|
|
233
|
+
|
|
234
|
+
type CustomToolInputParameter = ZodObject<{
|
|
235
|
+
[key: string]: ZodString | ZodNumber | ZodBoolean | ZodOptional<ZodString | ZodNumber | ZodBoolean>;
|
|
236
|
+
}>;
|
|
237
|
+
type CustomToolInput<T extends CustomToolInputParameter> = {
|
|
238
|
+
[K in keyof z.infer<T>]: z.infer<T>[K];
|
|
239
|
+
};
|
|
240
|
+
interface CustomToolOptions<T extends CustomToolInputParameter = CustomToolInputParameter> {
|
|
241
|
+
slug: string;
|
|
242
|
+
name: string;
|
|
243
|
+
toolkitSlug?: string | null;
|
|
244
|
+
description?: string;
|
|
245
|
+
inputParams: T;
|
|
246
|
+
execute: (input: CustomToolInput<T>, authCredentials?: Record<string, unknown>, executeAppRequest?: (data: ToolProxyParams) => Promise<ToolProxyResponse>) => Promise<ToolExecuteResponse>;
|
|
247
|
+
}
|
|
248
|
+
interface ExecuteMetadata {
|
|
249
|
+
userId: string;
|
|
250
|
+
connectedAccountId?: string;
|
|
251
|
+
}
|
|
39
252
|
|
|
40
253
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
254
|
+
* @fileoverview Custom tools class for Composio SDK, used to manage custom tools created by users.
|
|
255
|
+
*
|
|
256
|
+
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
257
|
+
* @date 2025-05-05
|
|
258
|
+
* @module CustomTools
|
|
43
259
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
260
|
+
|
|
261
|
+
declare class CustomTools {
|
|
262
|
+
private client;
|
|
263
|
+
private customToolsRegistry;
|
|
264
|
+
constructor(client: ComposioClient);
|
|
265
|
+
/**
|
|
266
|
+
* Create a custom tool and registers it in the registry.
|
|
267
|
+
* This is just an in memory registry and is not persisted.
|
|
268
|
+
* @param {CustomToolOptions} toolOptions CustomToolOptions
|
|
269
|
+
* @returns {Tool} The tool created
|
|
270
|
+
*/
|
|
271
|
+
createTool(toolOptions: CustomToolOptions): Promise<Tool>;
|
|
272
|
+
/**
|
|
273
|
+
* Get all the custom tools from the registry.
|
|
274
|
+
* @param {string[]} param0.toolSlugs The slugs of the tools to get
|
|
275
|
+
* @returns {ToolList} The list of tools
|
|
276
|
+
*/
|
|
277
|
+
getCustomTools({ toolSlugs }: {
|
|
278
|
+
toolSlugs?: string[];
|
|
279
|
+
}): Promise<ToolList>;
|
|
280
|
+
/**
|
|
281
|
+
* Get a custom tool by slug from the registry.
|
|
282
|
+
* @param {string} slug The slug of the tool to get
|
|
283
|
+
* @returns {Tool} The tool
|
|
284
|
+
*/
|
|
285
|
+
getCustomToolBySlug(slug: string): Promise<Tool | null>;
|
|
286
|
+
/**
|
|
287
|
+
* Get the connected account for the user and toolkit.
|
|
288
|
+
* @param {string} toolkitSlug The slug of the toolkit
|
|
289
|
+
* @param {ExecuteMetadata} metadata The metadata of the execution
|
|
290
|
+
* @returns {ConnectedAccount} The connected account
|
|
291
|
+
*/
|
|
292
|
+
private getConnectedAccount;
|
|
293
|
+
/**
|
|
294
|
+
* Execute a custom tool
|
|
295
|
+
* @param {slug} slug The slug of the tool to execute
|
|
296
|
+
* @param {Record<string, unknown>} inputParams The input parameters for the tool
|
|
297
|
+
* @param {ExecuteMetadata} metadata The metadata of the execution
|
|
298
|
+
* @returns {Promise<ToolExecuteResponse>} The response from the tool
|
|
299
|
+
*/
|
|
300
|
+
executeCustomTool(slug: string, inputParams: Record<string, unknown>, metadata: ExecuteMetadata): Promise<ToolExecuteResponse>;
|
|
46
301
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Base toolset implementation, which needs to be implemented by the extended class.
|
|
305
|
+
* This class is used to create a base toolset by implementing this class.
|
|
306
|
+
* This class also extends InstrumentedInstance, so that the telemetry can be instrumented for the toolset.
|
|
307
|
+
*/
|
|
308
|
+
interface Toolset<TTool, TToolCollection> {
|
|
309
|
+
wrapTool: (tool: Tool) => TTool;
|
|
310
|
+
getTools: (params?: ToolListParams) => Promise<TToolCollection>;
|
|
53
311
|
}
|
|
312
|
+
type ExecuteToolFnOptions = {
|
|
313
|
+
connectedAccountId?: string;
|
|
314
|
+
customAuthParams?: CustomAuthParams;
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* This type is used to infer the wrapped tool type from the toolset.
|
|
318
|
+
* It checks if the toolset has a method `_wrapTool` and infers the return type.
|
|
319
|
+
*/
|
|
320
|
+
type ExecuteToolFn = (toolSlug: string, input: Record<string, unknown>) => Promise<ToolExecuteResponse>;
|
|
321
|
+
type GlobalExecuteToolFn = (slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers) => Promise<ToolExecuteResponse>;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @internal
|
|
325
|
+
* Base class for all toolsets.
|
|
326
|
+
* This class is not meant to be used directly, but rather to be extended by different toolset implementations.
|
|
327
|
+
*/
|
|
328
|
+
declare abstract class BaseToolset {
|
|
329
|
+
/**
|
|
330
|
+
* @public
|
|
331
|
+
* The name of the toolset.
|
|
332
|
+
* Used to identify the toolset in the telemetry.
|
|
333
|
+
*/
|
|
334
|
+
abstract readonly name: string;
|
|
335
|
+
/**
|
|
336
|
+
* @internal
|
|
337
|
+
* Whether the toolset is agentic.
|
|
338
|
+
* This is set automatically set by the core SDK implementation for different toolset types.
|
|
339
|
+
*/
|
|
340
|
+
abstract readonly _isAgentic: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* @internal
|
|
343
|
+
* The function to execute a tool.
|
|
344
|
+
* This is set automatically injected by the core SDK.
|
|
345
|
+
*/
|
|
346
|
+
private _globalExecuteToolFn;
|
|
347
|
+
/**
|
|
348
|
+
* @internal
|
|
349
|
+
* Set the function to execute a tool.
|
|
350
|
+
* This is set automatically injected by the core SDK.
|
|
351
|
+
*/
|
|
352
|
+
_setExecuteToolFn(executeToolFn: GlobalExecuteToolFn): void;
|
|
353
|
+
/**
|
|
354
|
+
* @public
|
|
355
|
+
* Gloabl function to execute a tool.
|
|
356
|
+
* This function is used by toolset providers to implement helper functions to execute tools.
|
|
357
|
+
* This is a 1:1 mapping of the `execute` method in the `Tools` class.
|
|
358
|
+
* @param {string} toolSlug - The slug of the tool to execute.
|
|
359
|
+
* @param {Record<string, unknown>} input - The input to the tool.
|
|
360
|
+
* @returns {Promise<string>} The result of the tool execution.
|
|
361
|
+
*/
|
|
362
|
+
executeTool(toolSlug: string, body: ToolExecuteParams, modifers?: ExecuteToolModifiers): Promise<ToolExecuteResponse>;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* @public
|
|
366
|
+
* Base class for all non-agentic toolsets.
|
|
367
|
+
* This class is not meant to be used directly, but rather to be extended by concrete toolset implementations.
|
|
368
|
+
*/
|
|
369
|
+
declare abstract class BaseNonAgenticToolset<TToolCollection, TTool> extends BaseToolset {
|
|
370
|
+
readonly _isAgentic = false;
|
|
371
|
+
/**
|
|
372
|
+
* Wrap a tool in the provider specific format.
|
|
373
|
+
* @param tool - The tool to wrap.
|
|
374
|
+
* @returns The wrapped tool.
|
|
375
|
+
*/
|
|
376
|
+
abstract wrapTool(tool: Tool): TTool;
|
|
377
|
+
/**
|
|
378
|
+
* Wrap a list of tools in the provider specific format.
|
|
379
|
+
* @param tools - The tools to wrap.
|
|
380
|
+
* @returns The wrapped tools.
|
|
381
|
+
*/
|
|
382
|
+
abstract wrapTools(tools: Tool[]): TToolCollection;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* @public
|
|
386
|
+
* Base class for all agentic toolsets.
|
|
387
|
+
* This class is not meant to be used directly, but rather to be extended by concrete toolset implementations.
|
|
388
|
+
*/
|
|
389
|
+
declare abstract class BaseAgenticToolset<TToolCollection, TTool> extends BaseToolset {
|
|
390
|
+
readonly _isAgentic = true;
|
|
391
|
+
/**
|
|
392
|
+
* Wrap a tool in the provider specific format.
|
|
393
|
+
* @param tool - The tool to wrap.
|
|
394
|
+
* @returns The wrapped tool.
|
|
395
|
+
*/
|
|
396
|
+
abstract wrapTool(tool: Tool, executeTool: ExecuteToolFn): TTool;
|
|
397
|
+
/**
|
|
398
|
+
* Wrap a list of tools in the provider specific format.
|
|
399
|
+
* @param tools - The tools to wrap.
|
|
400
|
+
* @returns The wrapped tools.
|
|
401
|
+
*/
|
|
402
|
+
abstract wrapTools(tools: Tool[], executeTool: ExecuteToolFn): TToolCollection;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* @internal
|
|
406
|
+
* Base type for all toolsets.
|
|
407
|
+
* This type is used to infer the type of the toolset from the toolset implementation.
|
|
408
|
+
*/
|
|
409
|
+
type BaseComposioToolset<TToolCollection, TTool> = BaseNonAgenticToolset<TToolCollection, TTool> | BaseAgenticToolset<TToolCollection, TTool>;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Modifier for altering the tool execute params
|
|
413
|
+
* Called before the tool execute call
|
|
414
|
+
*/
|
|
415
|
+
type BeforeToolExecuteModifier = (toolSlug: string, toolExecuteParams: ToolExecuteParams) => ToolExecuteParams;
|
|
416
|
+
/**
|
|
417
|
+
* Modifier for altering the tool execute response
|
|
418
|
+
* Called after the tool execute call
|
|
419
|
+
*/
|
|
420
|
+
type AfterToolExecuteModifier = (toolSlug: string, toolExecuteResponse: ToolExecuteResponse) => ToolExecuteResponse;
|
|
421
|
+
/**
|
|
422
|
+
* Modifier for altering the tool schema
|
|
423
|
+
* Called after the tool schema is retrieved
|
|
424
|
+
*/
|
|
425
|
+
type TransformToolSchemaModifier = (toolSlug: string, toolSchema: Tool) => Tool;
|
|
426
|
+
/**
|
|
427
|
+
* Non Agentic tool options. These are used by Non-Agentic toolsets
|
|
428
|
+
*/
|
|
429
|
+
type ToolOptions = {
|
|
430
|
+
/**
|
|
431
|
+
* Transform tool schema modifier
|
|
432
|
+
*/
|
|
433
|
+
modifyToolSchema?: TransformToolSchemaModifier;
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* Modifiers for the tool execution
|
|
437
|
+
* This is used by execute call and handleToolCall of Non-Agentic toolsets
|
|
438
|
+
*/
|
|
439
|
+
type ExecuteToolModifiers = {
|
|
440
|
+
/**
|
|
441
|
+
* Before tool execute modifier
|
|
442
|
+
*/
|
|
443
|
+
beforeToolExecute?: BeforeToolExecuteModifier;
|
|
444
|
+
/**
|
|
445
|
+
* After tool execute modifier
|
|
446
|
+
*/
|
|
447
|
+
afterToolExecute?: AfterToolExecuteModifier;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* Agentic tool options. These are used by Agentic toolsets
|
|
451
|
+
*/
|
|
452
|
+
type AgenticToolOptions = ToolOptions & ExecuteToolModifiers;
|
|
453
|
+
type ToolsetOptions<T extends BaseComposioToolset<unknown, unknown>> = T extends BaseAgenticToolset<unknown, unknown> ? AgenticToolOptions : ToolOptions;
|
|
54
454
|
|
|
55
455
|
/**
|
|
56
456
|
* This class is used to manage tools in the Composio SDK.
|
|
57
457
|
* It provides methods to list, get, and execute tools.
|
|
58
458
|
*/
|
|
59
|
-
declare class Tools
|
|
60
|
-
readonly FILE_NAME: string;
|
|
459
|
+
declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset<TToolCollection, TTool>> {
|
|
61
460
|
private client;
|
|
62
|
-
|
|
461
|
+
customTools: CustomTools;
|
|
462
|
+
private toolset;
|
|
463
|
+
constructor(client: ComposioClient, toolset: TToolset);
|
|
464
|
+
/**
|
|
465
|
+
* Transform the tool cases
|
|
466
|
+
* @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool to transform
|
|
467
|
+
* @returns {Tool} The transformed tool
|
|
468
|
+
*/
|
|
469
|
+
private transformToolCases;
|
|
470
|
+
/**
|
|
471
|
+
* Transform the tool execute response to camelcase
|
|
472
|
+
* @param {ComposioToolExecuteResponse} response - The response to transform
|
|
473
|
+
* @returns {ToolExecuteResponse} The transformed response
|
|
474
|
+
*/
|
|
475
|
+
private transformToolExecuteResponse;
|
|
476
|
+
/**
|
|
477
|
+
* Check if the connected account exists for the given tools.
|
|
478
|
+
* @param {string} userId - The user id.
|
|
479
|
+
* @param {ToolList} tools - The tools to check.
|
|
480
|
+
* @returns {Promise<boolean>} True if the connected account exists for the given tools, false otherwise.
|
|
481
|
+
*/
|
|
482
|
+
private checkIfConnectedAccountExistsForTools;
|
|
483
|
+
/**
|
|
484
|
+
* Get the connected account id for a given tool
|
|
485
|
+
* @param {string} userId - The user id
|
|
486
|
+
* @param {string} toolSlug - The tool slug
|
|
487
|
+
* @returns {Promise<string | null>} The connected account id or null if the toolkit is a no auth app
|
|
488
|
+
*/
|
|
489
|
+
private getConnectedAccountIdForTool;
|
|
63
490
|
/**
|
|
64
|
-
* Lists all tools available in the Composio SDK.
|
|
491
|
+
* Lists all tools available in the Composio SDK as well as custom tools.
|
|
65
492
|
* This method fetches the tools from the Composio API and wraps them using the toolset.
|
|
66
|
-
* @returns {
|
|
493
|
+
* @returns {ToolList} List of tools
|
|
67
494
|
*/
|
|
68
|
-
|
|
495
|
+
getComposioTools(userId: string, query?: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
|
|
69
496
|
/**
|
|
70
497
|
* Retrieves a tool by its Slug.
|
|
71
498
|
* @param slug The ID of the tool to be retrieved
|
|
72
499
|
* @returns {Promise<Tool>} The tool
|
|
73
500
|
*/
|
|
74
|
-
|
|
501
|
+
getComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
|
|
502
|
+
get(userId: string, slug: string, options?: ToolsetOptions<TToolset>): Promise<TTool>;
|
|
503
|
+
get(userId: string, filters: ToolListParams, options?: ToolsetOptions<TToolset>): Promise<TToolCollection>;
|
|
504
|
+
/**
|
|
505
|
+
* Creates a function that executes a tool.
|
|
506
|
+
* This function is used by agentic the toolsets to execute the tool
|
|
507
|
+
* @param {string} userId - The user id
|
|
508
|
+
* @param {ExecuteToolModifiers} modifiers - The modifiers to be applied to the tool
|
|
509
|
+
* @returns {ExecuteToolFn} The execute tool function
|
|
510
|
+
*/
|
|
511
|
+
private createExecuteToolFn;
|
|
75
512
|
/**
|
|
76
513
|
* Exectes a given tool with the provided parameters.
|
|
77
514
|
*
|
|
@@ -81,7 +518,7 @@ declare class Tools implements InstrumentedInstance {
|
|
|
81
518
|
* @param {ToolExecuteParams} body - The parameters to be passed to the tool
|
|
82
519
|
* @returns {Promise<ToolExecuteResponse>} - The response from the tool execution
|
|
83
520
|
*/
|
|
84
|
-
execute(slug: string, body: ToolExecuteParams): Promise<ToolExecuteResponse>;
|
|
521
|
+
execute(slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers): Promise<ToolExecuteResponse>;
|
|
85
522
|
/**
|
|
86
523
|
* Fetches the list of all available tools in the Composio SDK.
|
|
87
524
|
*
|
|
@@ -100,16 +537,629 @@ declare class Tools implements InstrumentedInstance {
|
|
|
100
537
|
* @returns
|
|
101
538
|
*/
|
|
102
539
|
getInput(slug: string, body: ToolGetInputParams): Promise<ToolGetInputResponse>;
|
|
540
|
+
/**
|
|
541
|
+
* Proxies a custom request to a toolkit/integration
|
|
542
|
+
* @param body
|
|
543
|
+
* @returns
|
|
544
|
+
*/
|
|
545
|
+
proxyExecute(body: ToolProxyParams): Promise<ToolProxyResponse>;
|
|
546
|
+
/**
|
|
547
|
+
* Execute a custom tool
|
|
548
|
+
* @param body
|
|
549
|
+
* @returns
|
|
550
|
+
*/
|
|
551
|
+
createCustomTool(body: CustomToolOptions): Promise<Tool>;
|
|
103
552
|
}
|
|
104
553
|
|
|
554
|
+
declare const ToolkitsListParamsSchema: z.ZodObject<{
|
|
555
|
+
category: z.ZodOptional<z.ZodString>;
|
|
556
|
+
isLocal: z.ZodOptional<z.ZodBoolean>;
|
|
557
|
+
managedBy: z.ZodOptional<z.ZodEnum<["all", "composio_managed", "project_managed"]>>;
|
|
558
|
+
sortBy: z.ZodOptional<z.ZodEnum<["usage", "alphabetically"]>>;
|
|
559
|
+
}, "strip", z.ZodTypeAny, {
|
|
560
|
+
category?: string | undefined;
|
|
561
|
+
isLocal?: boolean | undefined;
|
|
562
|
+
managedBy?: "all" | "composio_managed" | "project_managed" | undefined;
|
|
563
|
+
sortBy?: "usage" | "alphabetically" | undefined;
|
|
564
|
+
}, {
|
|
565
|
+
category?: string | undefined;
|
|
566
|
+
isLocal?: boolean | undefined;
|
|
567
|
+
managedBy?: "all" | "composio_managed" | "project_managed" | undefined;
|
|
568
|
+
sortBy?: "usage" | "alphabetically" | undefined;
|
|
569
|
+
}>;
|
|
570
|
+
type ToolkitListParams = z.infer<typeof ToolkitsListParamsSchema>;
|
|
571
|
+
declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
572
|
+
items: z.ZodArray<z.ZodObject<{
|
|
573
|
+
name: z.ZodString;
|
|
574
|
+
slug: z.ZodString;
|
|
575
|
+
meta: z.ZodObject<{
|
|
576
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
577
|
+
id: z.ZodString;
|
|
578
|
+
name: z.ZodString;
|
|
579
|
+
}, "strip", z.ZodTypeAny, {
|
|
580
|
+
name: string;
|
|
581
|
+
id: string;
|
|
582
|
+
}, {
|
|
583
|
+
name: string;
|
|
584
|
+
id: string;
|
|
585
|
+
}>, "many">;
|
|
586
|
+
createdAt: z.ZodString;
|
|
587
|
+
description: z.ZodString;
|
|
588
|
+
logo: z.ZodString;
|
|
589
|
+
toolsCount: z.ZodNumber;
|
|
590
|
+
triggersCount: z.ZodNumber;
|
|
591
|
+
updatedAt: z.ZodString;
|
|
592
|
+
}, "strip", z.ZodTypeAny, {
|
|
593
|
+
logo: string;
|
|
594
|
+
description: string;
|
|
595
|
+
categories: {
|
|
596
|
+
name: string;
|
|
597
|
+
id: string;
|
|
598
|
+
}[];
|
|
599
|
+
createdAt: string;
|
|
600
|
+
toolsCount: number;
|
|
601
|
+
triggersCount: number;
|
|
602
|
+
updatedAt: string;
|
|
603
|
+
}, {
|
|
604
|
+
logo: string;
|
|
605
|
+
description: string;
|
|
606
|
+
categories: {
|
|
607
|
+
name: string;
|
|
608
|
+
id: string;
|
|
609
|
+
}[];
|
|
610
|
+
createdAt: string;
|
|
611
|
+
toolsCount: number;
|
|
612
|
+
triggersCount: number;
|
|
613
|
+
updatedAt: string;
|
|
614
|
+
}>;
|
|
615
|
+
isLocalToolkit: z.ZodBoolean;
|
|
616
|
+
authSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
617
|
+
composioManagedAuthSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
618
|
+
noAuth: z.ZodOptional<z.ZodBoolean>;
|
|
619
|
+
}, "strip", z.ZodTypeAny, {
|
|
620
|
+
slug: string;
|
|
621
|
+
name: string;
|
|
622
|
+
meta: {
|
|
623
|
+
logo: string;
|
|
624
|
+
description: string;
|
|
625
|
+
categories: {
|
|
626
|
+
name: string;
|
|
627
|
+
id: string;
|
|
628
|
+
}[];
|
|
629
|
+
createdAt: string;
|
|
630
|
+
toolsCount: number;
|
|
631
|
+
triggersCount: number;
|
|
632
|
+
updatedAt: string;
|
|
633
|
+
};
|
|
634
|
+
isLocalToolkit: boolean;
|
|
635
|
+
authSchemes?: string[] | undefined;
|
|
636
|
+
composioManagedAuthSchemes?: string[] | undefined;
|
|
637
|
+
noAuth?: boolean | undefined;
|
|
638
|
+
}, {
|
|
639
|
+
slug: string;
|
|
640
|
+
name: string;
|
|
641
|
+
meta: {
|
|
642
|
+
logo: string;
|
|
643
|
+
description: string;
|
|
644
|
+
categories: {
|
|
645
|
+
name: string;
|
|
646
|
+
id: string;
|
|
647
|
+
}[];
|
|
648
|
+
createdAt: string;
|
|
649
|
+
toolsCount: number;
|
|
650
|
+
triggersCount: number;
|
|
651
|
+
updatedAt: string;
|
|
652
|
+
};
|
|
653
|
+
isLocalToolkit: boolean;
|
|
654
|
+
authSchemes?: string[] | undefined;
|
|
655
|
+
composioManagedAuthSchemes?: string[] | undefined;
|
|
656
|
+
noAuth?: boolean | undefined;
|
|
657
|
+
}>, "many">;
|
|
658
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
659
|
+
totalPages: z.ZodNumber;
|
|
660
|
+
}, "strip", z.ZodTypeAny, {
|
|
661
|
+
items: {
|
|
662
|
+
slug: string;
|
|
663
|
+
name: string;
|
|
664
|
+
meta: {
|
|
665
|
+
logo: string;
|
|
666
|
+
description: string;
|
|
667
|
+
categories: {
|
|
668
|
+
name: string;
|
|
669
|
+
id: string;
|
|
670
|
+
}[];
|
|
671
|
+
createdAt: string;
|
|
672
|
+
toolsCount: number;
|
|
673
|
+
triggersCount: number;
|
|
674
|
+
updatedAt: string;
|
|
675
|
+
};
|
|
676
|
+
isLocalToolkit: boolean;
|
|
677
|
+
authSchemes?: string[] | undefined;
|
|
678
|
+
composioManagedAuthSchemes?: string[] | undefined;
|
|
679
|
+
noAuth?: boolean | undefined;
|
|
680
|
+
}[];
|
|
681
|
+
nextCursor: string | null;
|
|
682
|
+
totalPages: number;
|
|
683
|
+
}, {
|
|
684
|
+
items: {
|
|
685
|
+
slug: string;
|
|
686
|
+
name: string;
|
|
687
|
+
meta: {
|
|
688
|
+
logo: string;
|
|
689
|
+
description: string;
|
|
690
|
+
categories: {
|
|
691
|
+
name: string;
|
|
692
|
+
id: string;
|
|
693
|
+
}[];
|
|
694
|
+
createdAt: string;
|
|
695
|
+
toolsCount: number;
|
|
696
|
+
triggersCount: number;
|
|
697
|
+
updatedAt: string;
|
|
698
|
+
};
|
|
699
|
+
isLocalToolkit: boolean;
|
|
700
|
+
authSchemes?: string[] | undefined;
|
|
701
|
+
composioManagedAuthSchemes?: string[] | undefined;
|
|
702
|
+
noAuth?: boolean | undefined;
|
|
703
|
+
}[];
|
|
704
|
+
nextCursor: string | null;
|
|
705
|
+
totalPages: number;
|
|
706
|
+
}>;
|
|
707
|
+
type ToolKitListResponse = z.infer<typeof ToolKitListResponseSchema>;
|
|
708
|
+
declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
709
|
+
name: z.ZodString;
|
|
710
|
+
slug: z.ZodString;
|
|
711
|
+
meta: z.ZodObject<{
|
|
712
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
713
|
+
id: z.ZodString;
|
|
714
|
+
name: z.ZodString;
|
|
715
|
+
}, "strip", z.ZodTypeAny, {
|
|
716
|
+
name: string;
|
|
717
|
+
id: string;
|
|
718
|
+
}, {
|
|
719
|
+
name: string;
|
|
720
|
+
id: string;
|
|
721
|
+
}>, "many">;
|
|
722
|
+
createdAt: z.ZodString;
|
|
723
|
+
description: z.ZodString;
|
|
724
|
+
logo: z.ZodString;
|
|
725
|
+
toolsCount: z.ZodNumber;
|
|
726
|
+
triggersCount: z.ZodNumber;
|
|
727
|
+
updatedAt: z.ZodString;
|
|
728
|
+
}, "strip", z.ZodTypeAny, {
|
|
729
|
+
logo: string;
|
|
730
|
+
description: string;
|
|
731
|
+
categories: {
|
|
732
|
+
name: string;
|
|
733
|
+
id: string;
|
|
734
|
+
}[];
|
|
735
|
+
createdAt: string;
|
|
736
|
+
toolsCount: number;
|
|
737
|
+
triggersCount: number;
|
|
738
|
+
updatedAt: string;
|
|
739
|
+
}, {
|
|
740
|
+
logo: string;
|
|
741
|
+
description: string;
|
|
742
|
+
categories: {
|
|
743
|
+
name: string;
|
|
744
|
+
id: string;
|
|
745
|
+
}[];
|
|
746
|
+
createdAt: string;
|
|
747
|
+
toolsCount: number;
|
|
748
|
+
triggersCount: number;
|
|
749
|
+
updatedAt: string;
|
|
750
|
+
}>;
|
|
751
|
+
isLocalToolkit: z.ZodBoolean;
|
|
752
|
+
composioManagedAuthSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
753
|
+
authConfigDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
754
|
+
name: z.ZodString;
|
|
755
|
+
mode: z.ZodString;
|
|
756
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
757
|
+
authConfigCreation: z.ZodObject<{
|
|
758
|
+
optional: z.ZodArray<z.ZodObject<{
|
|
759
|
+
name: z.ZodString;
|
|
760
|
+
displayName: z.ZodString;
|
|
761
|
+
type: z.ZodString;
|
|
762
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
763
|
+
}, "strip", z.ZodTypeAny, {
|
|
764
|
+
name: string;
|
|
765
|
+
type: string;
|
|
766
|
+
displayName: string;
|
|
767
|
+
default?: string | null | undefined;
|
|
768
|
+
}, {
|
|
769
|
+
name: string;
|
|
770
|
+
type: string;
|
|
771
|
+
displayName: string;
|
|
772
|
+
default?: string | null | undefined;
|
|
773
|
+
}>, "many">;
|
|
774
|
+
required: z.ZodArray<z.ZodObject<{
|
|
775
|
+
name: z.ZodString;
|
|
776
|
+
displayName: z.ZodString;
|
|
777
|
+
type: z.ZodString;
|
|
778
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
779
|
+
}, "strip", z.ZodTypeAny, {
|
|
780
|
+
name: string;
|
|
781
|
+
type: string;
|
|
782
|
+
displayName: string;
|
|
783
|
+
default?: string | null | undefined;
|
|
784
|
+
}, {
|
|
785
|
+
name: string;
|
|
786
|
+
type: string;
|
|
787
|
+
displayName: string;
|
|
788
|
+
default?: string | null | undefined;
|
|
789
|
+
}>, "many">;
|
|
790
|
+
}, "strip", z.ZodTypeAny, {
|
|
791
|
+
required: {
|
|
792
|
+
name: string;
|
|
793
|
+
type: string;
|
|
794
|
+
displayName: string;
|
|
795
|
+
default?: string | null | undefined;
|
|
796
|
+
}[];
|
|
797
|
+
optional: {
|
|
798
|
+
name: string;
|
|
799
|
+
type: string;
|
|
800
|
+
displayName: string;
|
|
801
|
+
default?: string | null | undefined;
|
|
802
|
+
}[];
|
|
803
|
+
}, {
|
|
804
|
+
required: {
|
|
805
|
+
name: string;
|
|
806
|
+
type: string;
|
|
807
|
+
displayName: string;
|
|
808
|
+
default?: string | null | undefined;
|
|
809
|
+
}[];
|
|
810
|
+
optional: {
|
|
811
|
+
name: string;
|
|
812
|
+
type: string;
|
|
813
|
+
displayName: string;
|
|
814
|
+
default?: string | null | undefined;
|
|
815
|
+
}[];
|
|
816
|
+
}>;
|
|
817
|
+
connectedAccountInitiation: z.ZodObject<{
|
|
818
|
+
optional: z.ZodArray<z.ZodObject<{
|
|
819
|
+
name: z.ZodString;
|
|
820
|
+
displayName: z.ZodString;
|
|
821
|
+
type: z.ZodString;
|
|
822
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
823
|
+
}, "strip", z.ZodTypeAny, {
|
|
824
|
+
name: string;
|
|
825
|
+
type: string;
|
|
826
|
+
displayName: string;
|
|
827
|
+
default?: string | null | undefined;
|
|
828
|
+
}, {
|
|
829
|
+
name: string;
|
|
830
|
+
type: string;
|
|
831
|
+
displayName: string;
|
|
832
|
+
default?: string | null | undefined;
|
|
833
|
+
}>, "many">;
|
|
834
|
+
required: z.ZodArray<z.ZodObject<{
|
|
835
|
+
name: z.ZodString;
|
|
836
|
+
displayName: z.ZodString;
|
|
837
|
+
type: z.ZodString;
|
|
838
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
839
|
+
}, "strip", z.ZodTypeAny, {
|
|
840
|
+
name: string;
|
|
841
|
+
type: string;
|
|
842
|
+
displayName: string;
|
|
843
|
+
default?: string | null | undefined;
|
|
844
|
+
}, {
|
|
845
|
+
name: string;
|
|
846
|
+
type: string;
|
|
847
|
+
displayName: string;
|
|
848
|
+
default?: string | null | undefined;
|
|
849
|
+
}>, "many">;
|
|
850
|
+
}, "strip", z.ZodTypeAny, {
|
|
851
|
+
required: {
|
|
852
|
+
name: string;
|
|
853
|
+
type: string;
|
|
854
|
+
displayName: string;
|
|
855
|
+
default?: string | null | undefined;
|
|
856
|
+
}[];
|
|
857
|
+
optional: {
|
|
858
|
+
name: string;
|
|
859
|
+
type: string;
|
|
860
|
+
displayName: string;
|
|
861
|
+
default?: string | null | undefined;
|
|
862
|
+
}[];
|
|
863
|
+
}, {
|
|
864
|
+
required: {
|
|
865
|
+
name: string;
|
|
866
|
+
type: string;
|
|
867
|
+
displayName: string;
|
|
868
|
+
default?: string | null | undefined;
|
|
869
|
+
}[];
|
|
870
|
+
optional: {
|
|
871
|
+
name: string;
|
|
872
|
+
type: string;
|
|
873
|
+
displayName: string;
|
|
874
|
+
default?: string | null | undefined;
|
|
875
|
+
}[];
|
|
876
|
+
}>;
|
|
877
|
+
}, "strip", z.ZodTypeAny, {
|
|
878
|
+
authConfigCreation: {
|
|
879
|
+
required: {
|
|
880
|
+
name: string;
|
|
881
|
+
type: string;
|
|
882
|
+
displayName: string;
|
|
883
|
+
default?: string | null | undefined;
|
|
884
|
+
}[];
|
|
885
|
+
optional: {
|
|
886
|
+
name: string;
|
|
887
|
+
type: string;
|
|
888
|
+
displayName: string;
|
|
889
|
+
default?: string | null | undefined;
|
|
890
|
+
}[];
|
|
891
|
+
};
|
|
892
|
+
connectedAccountInitiation: {
|
|
893
|
+
required: {
|
|
894
|
+
name: string;
|
|
895
|
+
type: string;
|
|
896
|
+
displayName: string;
|
|
897
|
+
default?: string | null | undefined;
|
|
898
|
+
}[];
|
|
899
|
+
optional: {
|
|
900
|
+
name: string;
|
|
901
|
+
type: string;
|
|
902
|
+
displayName: string;
|
|
903
|
+
default?: string | null | undefined;
|
|
904
|
+
}[];
|
|
905
|
+
};
|
|
906
|
+
}, {
|
|
907
|
+
authConfigCreation: {
|
|
908
|
+
required: {
|
|
909
|
+
name: string;
|
|
910
|
+
type: string;
|
|
911
|
+
displayName: string;
|
|
912
|
+
default?: string | null | undefined;
|
|
913
|
+
}[];
|
|
914
|
+
optional: {
|
|
915
|
+
name: string;
|
|
916
|
+
type: string;
|
|
917
|
+
displayName: string;
|
|
918
|
+
default?: string | null | undefined;
|
|
919
|
+
}[];
|
|
920
|
+
};
|
|
921
|
+
connectedAccountInitiation: {
|
|
922
|
+
required: {
|
|
923
|
+
name: string;
|
|
924
|
+
type: string;
|
|
925
|
+
displayName: string;
|
|
926
|
+
default?: string | null | undefined;
|
|
927
|
+
}[];
|
|
928
|
+
optional: {
|
|
929
|
+
name: string;
|
|
930
|
+
type: string;
|
|
931
|
+
displayName: string;
|
|
932
|
+
default?: string | null | undefined;
|
|
933
|
+
}[];
|
|
934
|
+
};
|
|
935
|
+
}>, "many">;
|
|
936
|
+
proxy: z.ZodObject<{
|
|
937
|
+
baseUrul: z.ZodString;
|
|
938
|
+
}, "strip", z.ZodTypeAny, {
|
|
939
|
+
baseUrul: string;
|
|
940
|
+
}, {
|
|
941
|
+
baseUrul: string;
|
|
942
|
+
}>;
|
|
943
|
+
}, "strip", z.ZodTypeAny, {
|
|
944
|
+
name: string;
|
|
945
|
+
mode: string;
|
|
946
|
+
fields: {
|
|
947
|
+
authConfigCreation: {
|
|
948
|
+
required: {
|
|
949
|
+
name: string;
|
|
950
|
+
type: string;
|
|
951
|
+
displayName: string;
|
|
952
|
+
default?: string | null | undefined;
|
|
953
|
+
}[];
|
|
954
|
+
optional: {
|
|
955
|
+
name: string;
|
|
956
|
+
type: string;
|
|
957
|
+
displayName: string;
|
|
958
|
+
default?: string | null | undefined;
|
|
959
|
+
}[];
|
|
960
|
+
};
|
|
961
|
+
connectedAccountInitiation: {
|
|
962
|
+
required: {
|
|
963
|
+
name: string;
|
|
964
|
+
type: string;
|
|
965
|
+
displayName: string;
|
|
966
|
+
default?: string | null | undefined;
|
|
967
|
+
}[];
|
|
968
|
+
optional: {
|
|
969
|
+
name: string;
|
|
970
|
+
type: string;
|
|
971
|
+
displayName: string;
|
|
972
|
+
default?: string | null | undefined;
|
|
973
|
+
}[];
|
|
974
|
+
};
|
|
975
|
+
}[];
|
|
976
|
+
proxy: {
|
|
977
|
+
baseUrul: string;
|
|
978
|
+
};
|
|
979
|
+
}, {
|
|
980
|
+
name: string;
|
|
981
|
+
mode: string;
|
|
982
|
+
fields: {
|
|
983
|
+
authConfigCreation: {
|
|
984
|
+
required: {
|
|
985
|
+
name: string;
|
|
986
|
+
type: string;
|
|
987
|
+
displayName: string;
|
|
988
|
+
default?: string | null | undefined;
|
|
989
|
+
}[];
|
|
990
|
+
optional: {
|
|
991
|
+
name: string;
|
|
992
|
+
type: string;
|
|
993
|
+
displayName: string;
|
|
994
|
+
default?: string | null | undefined;
|
|
995
|
+
}[];
|
|
996
|
+
};
|
|
997
|
+
connectedAccountInitiation: {
|
|
998
|
+
required: {
|
|
999
|
+
name: string;
|
|
1000
|
+
type: string;
|
|
1001
|
+
displayName: string;
|
|
1002
|
+
default?: string | null | undefined;
|
|
1003
|
+
}[];
|
|
1004
|
+
optional: {
|
|
1005
|
+
name: string;
|
|
1006
|
+
type: string;
|
|
1007
|
+
displayName: string;
|
|
1008
|
+
default?: string | null | undefined;
|
|
1009
|
+
}[];
|
|
1010
|
+
};
|
|
1011
|
+
}[];
|
|
1012
|
+
proxy: {
|
|
1013
|
+
baseUrul: string;
|
|
1014
|
+
};
|
|
1015
|
+
}>, "many">>;
|
|
1016
|
+
}, "strip", z.ZodTypeAny, {
|
|
1017
|
+
slug: string;
|
|
1018
|
+
name: string;
|
|
1019
|
+
meta: {
|
|
1020
|
+
logo: string;
|
|
1021
|
+
description: string;
|
|
1022
|
+
categories: {
|
|
1023
|
+
name: string;
|
|
1024
|
+
id: string;
|
|
1025
|
+
}[];
|
|
1026
|
+
createdAt: string;
|
|
1027
|
+
toolsCount: number;
|
|
1028
|
+
triggersCount: number;
|
|
1029
|
+
updatedAt: string;
|
|
1030
|
+
};
|
|
1031
|
+
isLocalToolkit: boolean;
|
|
1032
|
+
composioManagedAuthSchemes?: string[] | undefined;
|
|
1033
|
+
authConfigDetails?: {
|
|
1034
|
+
name: string;
|
|
1035
|
+
mode: string;
|
|
1036
|
+
fields: {
|
|
1037
|
+
authConfigCreation: {
|
|
1038
|
+
required: {
|
|
1039
|
+
name: string;
|
|
1040
|
+
type: string;
|
|
1041
|
+
displayName: string;
|
|
1042
|
+
default?: string | null | undefined;
|
|
1043
|
+
}[];
|
|
1044
|
+
optional: {
|
|
1045
|
+
name: string;
|
|
1046
|
+
type: string;
|
|
1047
|
+
displayName: string;
|
|
1048
|
+
default?: string | null | undefined;
|
|
1049
|
+
}[];
|
|
1050
|
+
};
|
|
1051
|
+
connectedAccountInitiation: {
|
|
1052
|
+
required: {
|
|
1053
|
+
name: string;
|
|
1054
|
+
type: string;
|
|
1055
|
+
displayName: string;
|
|
1056
|
+
default?: string | null | undefined;
|
|
1057
|
+
}[];
|
|
1058
|
+
optional: {
|
|
1059
|
+
name: string;
|
|
1060
|
+
type: string;
|
|
1061
|
+
displayName: string;
|
|
1062
|
+
default?: string | null | undefined;
|
|
1063
|
+
}[];
|
|
1064
|
+
};
|
|
1065
|
+
}[];
|
|
1066
|
+
proxy: {
|
|
1067
|
+
baseUrul: string;
|
|
1068
|
+
};
|
|
1069
|
+
}[] | undefined;
|
|
1070
|
+
}, {
|
|
1071
|
+
slug: string;
|
|
1072
|
+
name: string;
|
|
1073
|
+
meta: {
|
|
1074
|
+
logo: string;
|
|
1075
|
+
description: string;
|
|
1076
|
+
categories: {
|
|
1077
|
+
name: string;
|
|
1078
|
+
id: string;
|
|
1079
|
+
}[];
|
|
1080
|
+
createdAt: string;
|
|
1081
|
+
toolsCount: number;
|
|
1082
|
+
triggersCount: number;
|
|
1083
|
+
updatedAt: string;
|
|
1084
|
+
};
|
|
1085
|
+
isLocalToolkit: boolean;
|
|
1086
|
+
composioManagedAuthSchemes?: string[] | undefined;
|
|
1087
|
+
authConfigDetails?: {
|
|
1088
|
+
name: string;
|
|
1089
|
+
mode: string;
|
|
1090
|
+
fields: {
|
|
1091
|
+
authConfigCreation: {
|
|
1092
|
+
required: {
|
|
1093
|
+
name: string;
|
|
1094
|
+
type: string;
|
|
1095
|
+
displayName: string;
|
|
1096
|
+
default?: string | null | undefined;
|
|
1097
|
+
}[];
|
|
1098
|
+
optional: {
|
|
1099
|
+
name: string;
|
|
1100
|
+
type: string;
|
|
1101
|
+
displayName: string;
|
|
1102
|
+
default?: string | null | undefined;
|
|
1103
|
+
}[];
|
|
1104
|
+
};
|
|
1105
|
+
connectedAccountInitiation: {
|
|
1106
|
+
required: {
|
|
1107
|
+
name: string;
|
|
1108
|
+
type: string;
|
|
1109
|
+
displayName: string;
|
|
1110
|
+
default?: string | null | undefined;
|
|
1111
|
+
}[];
|
|
1112
|
+
optional: {
|
|
1113
|
+
name: string;
|
|
1114
|
+
type: string;
|
|
1115
|
+
displayName: string;
|
|
1116
|
+
default?: string | null | undefined;
|
|
1117
|
+
}[];
|
|
1118
|
+
};
|
|
1119
|
+
}[];
|
|
1120
|
+
proxy: {
|
|
1121
|
+
baseUrul: string;
|
|
1122
|
+
};
|
|
1123
|
+
}[] | undefined;
|
|
1124
|
+
}>;
|
|
1125
|
+
type ToolkitRetrieveResponse = z.infer<typeof ToolkitRetrieveResponseSchema>;
|
|
1126
|
+
declare const ToolkitRetrieveCategoriesResponseSchema: z.ZodObject<{
|
|
1127
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1128
|
+
id: z.ZodString;
|
|
1129
|
+
name: z.ZodString;
|
|
1130
|
+
}, "strip", z.ZodTypeAny, {
|
|
1131
|
+
name: string;
|
|
1132
|
+
id: string;
|
|
1133
|
+
}, {
|
|
1134
|
+
name: string;
|
|
1135
|
+
id: string;
|
|
1136
|
+
}>, "many">;
|
|
1137
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
1138
|
+
totalPages: z.ZodNumber;
|
|
1139
|
+
}, "strip", z.ZodTypeAny, {
|
|
1140
|
+
items: {
|
|
1141
|
+
name: string;
|
|
1142
|
+
id: string;
|
|
1143
|
+
}[];
|
|
1144
|
+
nextCursor: string | null;
|
|
1145
|
+
totalPages: number;
|
|
1146
|
+
}, {
|
|
1147
|
+
items: {
|
|
1148
|
+
name: string;
|
|
1149
|
+
id: string;
|
|
1150
|
+
}[];
|
|
1151
|
+
nextCursor: string | null;
|
|
1152
|
+
totalPages: number;
|
|
1153
|
+
}>;
|
|
1154
|
+
type ToolkitRetrieveCategoriesResponse = z.infer<typeof ToolkitRetrieveCategoriesResponseSchema>;
|
|
1155
|
+
|
|
105
1156
|
/**
|
|
106
1157
|
* Toolkits class
|
|
107
1158
|
*
|
|
108
1159
|
* Toolkits are a collection of tools that can be used to perform various tasks.
|
|
109
1160
|
* This is similar/replacement of `apps` in the Composio API.
|
|
110
1161
|
*/
|
|
111
|
-
declare class Toolkits
|
|
112
|
-
readonly FILE_NAME: string;
|
|
1162
|
+
declare class Toolkits {
|
|
113
1163
|
private client;
|
|
114
1164
|
constructor(client: ComposioClient);
|
|
115
1165
|
/**
|
|
@@ -117,7 +1167,7 @@ declare class Toolkits implements InstrumentedInstance {
|
|
|
117
1167
|
* This method fetches the toolkits from the Composio API.
|
|
118
1168
|
* @returns {Promise<Toolkit[]>} List of toolkits
|
|
119
1169
|
*/
|
|
120
|
-
|
|
1170
|
+
private getToolkits;
|
|
121
1171
|
/**
|
|
122
1172
|
* Fetches a toolkit by its Slug.
|
|
123
1173
|
* This method retrieves the toolkit from the Composio API.
|
|
@@ -125,13 +1175,27 @@ declare class Toolkits implements InstrumentedInstance {
|
|
|
125
1175
|
* @param options - Request options
|
|
126
1176
|
* @returns {Promise<ToolkitRetrieveResponse>} The toolkit object
|
|
127
1177
|
*/
|
|
128
|
-
|
|
1178
|
+
private getToolkitBySlug;
|
|
1179
|
+
/**
|
|
1180
|
+
* @overload
|
|
1181
|
+
* Fetches a toolkit by its Slug or a list of toolkits.
|
|
1182
|
+
* @param slug - The ID of the toolkit to be retrieved
|
|
1183
|
+
* @returns {Promise<ToolkitRetrieveResponse>} The toolkit object
|
|
1184
|
+
*/
|
|
1185
|
+
get(slug: string): Promise<ToolkitRetrieveResponse>;
|
|
1186
|
+
/**
|
|
1187
|
+
* @overload
|
|
1188
|
+
* Fetches a list of toolkits.
|
|
1189
|
+
* @param query - The parameters to fetch the toolkits
|
|
1190
|
+
* @returns {Promise<ToolKitListResponse>} The list of toolkits
|
|
1191
|
+
*/
|
|
1192
|
+
get(query: ToolkitListParams): Promise<ToolKitListResponse>;
|
|
129
1193
|
/**
|
|
130
1194
|
* Fetches all categories available in the Composio SDK
|
|
131
1195
|
*
|
|
132
1196
|
* @returns {Promise<ToolkitRetrieveCategoriesResponse>} List of categories
|
|
133
1197
|
*/
|
|
134
|
-
listCategories(
|
|
1198
|
+
listCategories(): Promise<ToolkitRetrieveCategoriesResponse>;
|
|
135
1199
|
}
|
|
136
1200
|
|
|
137
1201
|
type TriggerStatusEnum = "enable" | "disable";
|
|
@@ -187,8 +1251,7 @@ type TriggerData = {
|
|
|
187
1251
|
* /api/v3/trigger_instances
|
|
188
1252
|
*
|
|
189
1253
|
*/
|
|
190
|
-
declare class Triggers
|
|
191
|
-
readonly FILE_NAME: string;
|
|
1254
|
+
declare class Triggers {
|
|
192
1255
|
private client;
|
|
193
1256
|
constructor(client: ComposioClient);
|
|
194
1257
|
/**
|
|
@@ -275,13 +1338,21 @@ declare class Triggers implements InstrumentedInstance {
|
|
|
275
1338
|
unsubscribe(): Promise<void>;
|
|
276
1339
|
}
|
|
277
1340
|
|
|
1341
|
+
/**
|
|
1342
|
+
* @fileoverview Auth configs class for Composio SDK, used to manage authentication configurations.
|
|
1343
|
+
*
|
|
1344
|
+
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
1345
|
+
* @date 2025-05-05
|
|
1346
|
+
* @module AuthConfigs
|
|
1347
|
+
*/
|
|
1348
|
+
|
|
278
1349
|
/**
|
|
279
1350
|
* AuthConfigs class
|
|
280
1351
|
*
|
|
281
1352
|
* This class is used to manage authentication configurations in the Composio SDK.
|
|
282
1353
|
* Auth configs are used to configure authentication providers and settings.
|
|
283
1354
|
*/
|
|
284
|
-
declare class AuthConfigs
|
|
1355
|
+
declare class AuthConfigs {
|
|
285
1356
|
readonly FILE_NAME: string;
|
|
286
1357
|
private client;
|
|
287
1358
|
constructor(client: ComposioClient);
|
|
@@ -328,7 +1399,7 @@ declare class AuthConfigs implements InstrumentedInstance {
|
|
|
328
1399
|
* @param {RequestOptions} options - Request options
|
|
329
1400
|
* @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
|
|
330
1401
|
*/
|
|
331
|
-
updateStatus(status:
|
|
1402
|
+
updateStatus(status: 'ENABLED' | 'DISABLED', nanoid: string, options?: RequestOptions): Promise<AuthConfigUpdateStatusResponse>;
|
|
332
1403
|
/**
|
|
333
1404
|
* Enable an auth config
|
|
334
1405
|
* @param {string} nanoid - Unique identifier of the auth config
|
|
@@ -345,14 +1416,154 @@ declare class AuthConfigs implements InstrumentedInstance {
|
|
|
345
1416
|
disable(nanoid: string, options?: RequestOptions): Promise<AuthConfigUpdateStatusResponse>;
|
|
346
1417
|
}
|
|
347
1418
|
|
|
1419
|
+
/**
|
|
1420
|
+
* Connected Account create parameters
|
|
1421
|
+
*/
|
|
1422
|
+
declare const ConnectedAccountStatuses: {
|
|
1423
|
+
readonly ACTIVE: "ACTIVE";
|
|
1424
|
+
readonly INACTIVE: "INACTIVE";
|
|
1425
|
+
readonly PENDING: "DELETED";
|
|
1426
|
+
readonly INITIATED: "INITIATED";
|
|
1427
|
+
readonly EXPIRED: "EXPIRED";
|
|
1428
|
+
readonly FAILED: "FAILED";
|
|
1429
|
+
};
|
|
1430
|
+
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
1431
|
+
type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1432
|
+
declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
1433
|
+
redirectUrl: z.ZodOptional<z.ZodString>;
|
|
1434
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1435
|
+
}, "strip", z.ZodTypeAny, {
|
|
1436
|
+
data?: Record<string, unknown> | undefined;
|
|
1437
|
+
redirectUrl?: string | undefined;
|
|
1438
|
+
}, {
|
|
1439
|
+
data?: Record<string, unknown> | undefined;
|
|
1440
|
+
redirectUrl?: string | undefined;
|
|
1441
|
+
}>;
|
|
1442
|
+
type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1443
|
+
declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
1444
|
+
id: z.ZodString;
|
|
1445
|
+
uuid: z.ZodString;
|
|
1446
|
+
authConfig: z.ZodObject<{
|
|
1447
|
+
id: z.ZodString;
|
|
1448
|
+
authScheme: z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>;
|
|
1449
|
+
isComposioManaged: z.ZodBoolean;
|
|
1450
|
+
isDisabled: z.ZodBoolean;
|
|
1451
|
+
}, "strip", z.ZodTypeAny, {
|
|
1452
|
+
id: string;
|
|
1453
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1454
|
+
isComposioManaged: boolean;
|
|
1455
|
+
isDisabled: boolean;
|
|
1456
|
+
}, {
|
|
1457
|
+
id: string;
|
|
1458
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1459
|
+
isComposioManaged: boolean;
|
|
1460
|
+
isDisabled: boolean;
|
|
1461
|
+
}>;
|
|
1462
|
+
userId: z.ZodString;
|
|
1463
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1464
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1465
|
+
status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
|
|
1466
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
1467
|
+
toolkit: z.ZodObject<{
|
|
1468
|
+
slug: z.ZodString;
|
|
1469
|
+
}, "strip", z.ZodTypeAny, {
|
|
1470
|
+
slug: string;
|
|
1471
|
+
}, {
|
|
1472
|
+
slug: string;
|
|
1473
|
+
}>;
|
|
1474
|
+
testRequestEndpoint: z.ZodOptional<z.ZodString>;
|
|
1475
|
+
isDisabled: z.ZodBoolean;
|
|
1476
|
+
createdAt: z.ZodString;
|
|
1477
|
+
updatedAt: z.ZodString;
|
|
1478
|
+
}, "strip", z.ZodTypeAny, {
|
|
1479
|
+
params: Record<string, unknown>;
|
|
1480
|
+
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1481
|
+
toolkit: {
|
|
1482
|
+
slug: string;
|
|
1483
|
+
};
|
|
1484
|
+
userId: string;
|
|
1485
|
+
data: Record<string, unknown>;
|
|
1486
|
+
id: string;
|
|
1487
|
+
createdAt: string;
|
|
1488
|
+
updatedAt: string;
|
|
1489
|
+
authConfig: {
|
|
1490
|
+
id: string;
|
|
1491
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1492
|
+
isComposioManaged: boolean;
|
|
1493
|
+
isDisabled: boolean;
|
|
1494
|
+
};
|
|
1495
|
+
isDisabled: boolean;
|
|
1496
|
+
uuid: string;
|
|
1497
|
+
statusReason: string | null;
|
|
1498
|
+
testRequestEndpoint?: string | undefined;
|
|
1499
|
+
}, {
|
|
1500
|
+
params: Record<string, unknown>;
|
|
1501
|
+
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1502
|
+
toolkit: {
|
|
1503
|
+
slug: string;
|
|
1504
|
+
};
|
|
1505
|
+
userId: string;
|
|
1506
|
+
data: Record<string, unknown>;
|
|
1507
|
+
id: string;
|
|
1508
|
+
createdAt: string;
|
|
1509
|
+
updatedAt: string;
|
|
1510
|
+
authConfig: {
|
|
1511
|
+
id: string;
|
|
1512
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1513
|
+
isComposioManaged: boolean;
|
|
1514
|
+
isDisabled: boolean;
|
|
1515
|
+
};
|
|
1516
|
+
isDisabled: boolean;
|
|
1517
|
+
uuid: string;
|
|
1518
|
+
statusReason: string | null;
|
|
1519
|
+
testRequestEndpoint?: string | undefined;
|
|
1520
|
+
}>;
|
|
1521
|
+
type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveResponseSchema>;
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* @fileoverview Connection request class for Composio SDK, used to manage an initiated connection request.
|
|
1525
|
+
*
|
|
1526
|
+
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
1527
|
+
* @date 2025-05-05
|
|
1528
|
+
* @module ConnectionRequest
|
|
1529
|
+
*/
|
|
1530
|
+
|
|
1531
|
+
declare class ConnectionRequest {
|
|
1532
|
+
readonly FILE_NAME: string;
|
|
1533
|
+
private client;
|
|
1534
|
+
private connectedAccountId;
|
|
1535
|
+
private connectedAccountStatus;
|
|
1536
|
+
constructor(client: ComposioClient, connectedAccountId: string, connectedAccountStatus: ConnectedAccountStatus);
|
|
1537
|
+
/**
|
|
1538
|
+
* Transform the response from the Composio API to the SDK format
|
|
1539
|
+
* @param response
|
|
1540
|
+
* @returns
|
|
1541
|
+
*/
|
|
1542
|
+
private transformResponse;
|
|
1543
|
+
/**
|
|
1544
|
+
* Wait for the connection to be established.
|
|
1545
|
+
* The function will poll the Composio API every second until the connection is established or the timeout is reached.
|
|
1546
|
+
* @param {number} timeout - The time in milliseconds to wait for the connection to be established. Default is 30 seconds.
|
|
1547
|
+
* @returns
|
|
1548
|
+
*/
|
|
1549
|
+
waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* @fileoverview Connected accounts class for Composio SDK, used to manage connected accounts of a user.
|
|
1554
|
+
*
|
|
1555
|
+
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
1556
|
+
* @date 2025-05-05
|
|
1557
|
+
* @module ConnectedAccounts
|
|
1558
|
+
*/
|
|
1559
|
+
|
|
348
1560
|
/**
|
|
349
1561
|
* ConnectedAccounts class
|
|
350
1562
|
*
|
|
351
1563
|
* This class is used to manage connected accounts in the Composio SDK.
|
|
352
1564
|
* Connected accounts are used to authenticate with third-party services.
|
|
353
1565
|
*/
|
|
354
|
-
declare class ConnectedAccounts
|
|
355
|
-
readonly FILE_NAME: string;
|
|
1566
|
+
declare class ConnectedAccounts {
|
|
356
1567
|
private client;
|
|
357
1568
|
constructor(client: ComposioClient);
|
|
358
1569
|
/**
|
|
@@ -361,35 +1572,35 @@ declare class ConnectedAccounts implements InstrumentedInstance {
|
|
|
361
1572
|
* @param {RequestOptions} options - Request options
|
|
362
1573
|
* @returns {Promise<ConnectedAccountListResponse>} List of connected accounts
|
|
363
1574
|
*/
|
|
364
|
-
list(query?: ConnectedAccountListParams
|
|
1575
|
+
list(query?: ConnectedAccountListParams): Promise<ConnectedAccountListResponse>;
|
|
365
1576
|
/**
|
|
366
1577
|
* Create a new connected account
|
|
367
1578
|
* @param {ConnectedAccountCreateParams} data - Data for creating a new connected account
|
|
368
1579
|
* @param {RequestOptions} options - Request options
|
|
369
1580
|
* @returns {Promise<ConnectedAccountCreateResponse>} Created connected account
|
|
370
1581
|
*/
|
|
371
|
-
create(data: ConnectedAccountCreateParams
|
|
1582
|
+
create(data: ConnectedAccountCreateParams): Promise<ConnectedAccountCreateResponse>;
|
|
372
1583
|
/**
|
|
373
1584
|
* Get a connected account by nanoid
|
|
374
1585
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
375
1586
|
* @param {RequestOptions} options - Request options
|
|
376
1587
|
* @returns {Promise<ConnectedAccountRetrieveResponse>} Connected account details
|
|
377
1588
|
*/
|
|
378
|
-
get(nanoid: string
|
|
1589
|
+
get(nanoid: string): Promise<ConnectedAccountRetrieveResponse$1>;
|
|
379
1590
|
/**
|
|
380
1591
|
* Delete a connected account
|
|
381
1592
|
* @param {string} nanoid - Unique identifier of the connected account to delete
|
|
382
1593
|
* @param {RequestOptions} options - Request options
|
|
383
1594
|
* @returns {Promise<ConnectedAccountDeleteResponse>} Response from deletion
|
|
384
1595
|
*/
|
|
385
|
-
delete(nanoid: string
|
|
1596
|
+
delete(nanoid: string): Promise<ConnectedAccountDeleteResponse>;
|
|
386
1597
|
/**
|
|
387
1598
|
* Refresh a connected account's credentials
|
|
388
1599
|
* @param {string} nanoid - Unique identifier of the connected account to refresh
|
|
389
1600
|
* @param {RequestOptions} options - Request options
|
|
390
1601
|
* @returns {Promise<ConnectedAccountRefreshResponse>} Refreshed connected account details
|
|
391
1602
|
*/
|
|
392
|
-
refresh(nanoid: string
|
|
1603
|
+
refresh(nanoid: string): Promise<ConnectedAccountRefreshResponse>;
|
|
393
1604
|
/**
|
|
394
1605
|
* Update the status of a connected account
|
|
395
1606
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
@@ -397,76 +1608,37 @@ declare class ConnectedAccounts implements InstrumentedInstance {
|
|
|
397
1608
|
* @param {RequestOptions} options - Request options
|
|
398
1609
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
399
1610
|
*/
|
|
400
|
-
updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams
|
|
1611
|
+
updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
401
1612
|
/**
|
|
402
1613
|
* Enable a connected account
|
|
403
1614
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
404
1615
|
* @param {RequestOptions} options - Request options
|
|
405
1616
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
406
1617
|
*/
|
|
407
|
-
enable(nanoid: string
|
|
1618
|
+
enable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
408
1619
|
/**
|
|
409
1620
|
* Disable a connected account
|
|
410
1621
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
411
1622
|
* @param {RequestOptions} options - Request options
|
|
412
1623
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
413
1624
|
*/
|
|
414
|
-
disable(nanoid: string
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Base toolset implementation, which needs to be implemented by the extended class.
|
|
419
|
-
* This class is used to create a base toolset by implementing this class.
|
|
420
|
-
* This class also extends InstrumentedInstance, so that the telemetry can be instrumented for the toolset.
|
|
421
|
-
*/
|
|
422
|
-
interface Toolset<TTool = BaseTool, TToolCollection = TTool[]> extends InstrumentedInstance {
|
|
423
|
-
_wrapTool: (tool: Tool) => TTool;
|
|
424
|
-
getTools: (params?: ToolListParams) => Promise<TToolCollection>;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Base toolset implementation with proper generic defaults
|
|
429
|
-
* This class is used to create a different toolsets by extending this class.
|
|
430
|
-
*
|
|
431
|
-
* This class provides basic functionality to get tools, pre-process and post-process tools.
|
|
432
|
-
* Every toolset should extend this class and implement the `_wrapTool` method,
|
|
433
|
-
* these extended toolsets can add their own functionality/methods to the toolset.
|
|
434
|
-
*
|
|
435
|
-
* eg:
|
|
436
|
-
* class YourToolSet extends BaseComposioToolset<CustomToolCollection, CustomTool> {}
|
|
437
|
-
*/
|
|
438
|
-
declare abstract class BaseComposioToolset<TToolCollection, TTool> implements Toolset<TTool, TToolCollection> {
|
|
439
|
-
protected client: Composio<this> | undefined;
|
|
440
|
-
abstract FILE_NAME: string;
|
|
441
|
-
protected DEFAULT_ENTITY_ID: string;
|
|
442
|
-
/**
|
|
443
|
-
* Set the client for the toolset. This is automatically done by the Composio class.
|
|
444
|
-
* @param client - The Composio client.
|
|
445
|
-
*/
|
|
446
|
-
setClient(client: Composio<this>): void;
|
|
447
|
-
/**
|
|
448
|
-
* Get all the tools from the client.
|
|
449
|
-
* @param params - The parameters for the tool list.
|
|
450
|
-
* @returns The tools.
|
|
451
|
-
*/
|
|
452
|
-
abstract getTools(params?: ToolListParams): Promise<TToolCollection>;
|
|
453
|
-
/**
|
|
454
|
-
* Get a tool from the client.
|
|
455
|
-
* @param slug - The slug of the tool.
|
|
456
|
-
* @returns The tool.
|
|
457
|
-
*/
|
|
458
|
-
getTool(slug: string): Promise<TTool>;
|
|
459
|
-
/**
|
|
460
|
-
* Wrap a tool in the toolset.
|
|
461
|
-
* @param tool - The tool to wrap.
|
|
462
|
-
* @returns The wrapped tool.
|
|
463
|
-
*/
|
|
464
|
-
abstract _wrapTool(tool: Tool): TTool;
|
|
1625
|
+
disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
465
1626
|
/**
|
|
466
|
-
*
|
|
467
|
-
* This
|
|
1627
|
+
* Compound function to create a new connected account.
|
|
1628
|
+
* This function creates a new connected account and returns a connection request.
|
|
1629
|
+
* Users can then wait for the connection to be established using the `waitForConnection` method.
|
|
1630
|
+
* @param {CreateConnectedAccountParams} data - Data for creating a new connected account
|
|
1631
|
+
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
468
1632
|
*/
|
|
469
|
-
|
|
1633
|
+
createConnectedAccount(userId: string, authConfigId: string, options: CreateConnectedAccountOptions): Promise<ConnectionRequest>;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
type AcceptableJSONValue = Record<string, unknown> | Array<Record<string, unknown>> | string | number | boolean | null | undefined;
|
|
1637
|
+
interface TelemetryTransportParams {
|
|
1638
|
+
url: string;
|
|
1639
|
+
method: string;
|
|
1640
|
+
headers: Record<string, string>;
|
|
1641
|
+
data: AcceptableJSONValue;
|
|
470
1642
|
}
|
|
471
1643
|
|
|
472
1644
|
declare abstract class BaseTelemetryTransport {
|
|
@@ -480,7 +1652,7 @@ declare abstract class BaseTelemetryTransport {
|
|
|
480
1652
|
/**
|
|
481
1653
|
* OpenAI ToolSet
|
|
482
1654
|
*
|
|
483
|
-
* Author: @
|
|
1655
|
+
* Author: Musthaq Ahamad <musthaq@composio.dev>
|
|
484
1656
|
* Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/toolsets/openai.ts
|
|
485
1657
|
*
|
|
486
1658
|
* This is a default toolset for Composio SDK.
|
|
@@ -489,29 +1661,23 @@ declare abstract class BaseTelemetryTransport {
|
|
|
489
1661
|
|
|
490
1662
|
type OpenAiTool = OpenAI.ChatCompletionTool;
|
|
491
1663
|
type OpenAiToolCollection = Array<OpenAiTool>;
|
|
492
|
-
declare class OpenAIToolset extends
|
|
493
|
-
|
|
494
|
-
readonly FILE_NAME = "toolsets/openai/src/index.ts";
|
|
1664
|
+
declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection, OpenAiTool> {
|
|
1665
|
+
readonly name = "openai";
|
|
495
1666
|
/**
|
|
496
1667
|
* Absract method to wrap a tool in the toolset.
|
|
497
1668
|
* This method is implemented by the toolset.
|
|
498
1669
|
* @param tool - The tool to wrap.
|
|
499
1670
|
* @returns The wrapped tool.
|
|
500
1671
|
*/
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
* Get all the tools from the Composio in OpenAI format.
|
|
504
|
-
* @param params - The parameters for the tool list.
|
|
505
|
-
* @returns The tools.
|
|
506
|
-
*/
|
|
507
|
-
getTools(params?: ToolListParams): Promise<OpenAiToolCollection>;
|
|
1672
|
+
wrapTool: (tool: Tool) => OpenAiTool;
|
|
1673
|
+
wrapTools: (tools: Tool[]) => OpenAiToolCollection;
|
|
508
1674
|
/**
|
|
509
1675
|
* Execute a tool call.
|
|
510
1676
|
* @param {OpenAI.ChatCompletionMessageToolCall} tool - The tool to execute.
|
|
511
1677
|
* @param {string} userId - The user id.
|
|
512
1678
|
* @returns {Promise<string>} The result of the tool call.
|
|
513
1679
|
*/
|
|
514
|
-
executeToolCall(tool: OpenAI.ChatCompletionMessageToolCall,
|
|
1680
|
+
executeToolCall(userId: string, tool: OpenAI.ChatCompletionMessageToolCall, options: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string>;
|
|
515
1681
|
/**
|
|
516
1682
|
* Handle the tool call from the assistant.
|
|
517
1683
|
*
|
|
@@ -519,7 +1685,7 @@ declare class OpenAIToolset extends BaseComposioToolset<OpenAiToolCollection, Op
|
|
|
519
1685
|
* @param {string} userId - The user id.
|
|
520
1686
|
* @returns {Promise<string[]>} The results of the tool call.
|
|
521
1687
|
*/
|
|
522
|
-
handleToolCall(chatCompletion: OpenAI.ChatCompletion,
|
|
1688
|
+
handleToolCall(userId: string, chatCompletion: OpenAI.ChatCompletion, options: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
|
|
523
1689
|
/**
|
|
524
1690
|
* Handles all the tool calls from the assistant.
|
|
525
1691
|
*
|
|
@@ -527,7 +1693,7 @@ declare class OpenAIToolset extends BaseComposioToolset<OpenAiToolCollection, Op
|
|
|
527
1693
|
* @param {string} userId - The user id.
|
|
528
1694
|
* @returns {Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>} The tool outputs.
|
|
529
1695
|
*/
|
|
530
|
-
handleAssistantMessage(run: OpenAI.Beta.Threads.Run,
|
|
1696
|
+
handleAssistantMessage(userId: string, run: OpenAI.Beta.Threads.Run, options: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>;
|
|
531
1697
|
/**
|
|
532
1698
|
* Waits for the assistant stream and handles the tool calls.
|
|
533
1699
|
*
|
|
@@ -537,7 +1703,7 @@ declare class OpenAIToolset extends BaseComposioToolset<OpenAiToolCollection, Op
|
|
|
537
1703
|
* @param {string} userId - The user id.
|
|
538
1704
|
* @returns {AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>} The run stream.
|
|
539
1705
|
*/
|
|
540
|
-
waitAndHandleAssistantStreamToolCalls(client: OpenAI, runStream: Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>, thread: OpenAI.Beta.Threads.Thread,
|
|
1706
|
+
waitAndHandleAssistantStreamToolCalls(userId: string, client: OpenAI, runStream: Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>, thread: OpenAI.Beta.Threads.Thread, options: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>;
|
|
541
1707
|
/**
|
|
542
1708
|
* Waits for the assistant tool calls and handles them.
|
|
543
1709
|
*
|
|
@@ -547,7 +1713,7 @@ declare class OpenAIToolset extends BaseComposioToolset<OpenAiToolCollection, Op
|
|
|
547
1713
|
* @param {string} userId - The user id.
|
|
548
1714
|
* @returns {Promise<OpenAI.Beta.Threads.Run>} The run object.
|
|
549
1715
|
*/
|
|
550
|
-
waitAndHandleAssistantToolCalls(client: OpenAI, run: OpenAI.Beta.Threads.Run, thread: OpenAI.Beta.Threads.Thread,
|
|
1716
|
+
waitAndHandleAssistantToolCalls(userId: string, client: OpenAI, run: OpenAI.Beta.Threads.Run, thread: OpenAI.Beta.Threads.Thread, options: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.Run>;
|
|
551
1717
|
}
|
|
552
1718
|
|
|
553
1719
|
type ComposioConfig<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> = {
|
|
@@ -556,8 +1722,6 @@ type ComposioConfig<TToolset extends BaseComposioToolset<unknown, unknown> = Ope
|
|
|
556
1722
|
allowTracking?: boolean;
|
|
557
1723
|
allowTracing?: boolean;
|
|
558
1724
|
toolset?: TToolset;
|
|
559
|
-
userId?: string;
|
|
560
|
-
connectedAccountIds?: Record<string, string>;
|
|
561
1725
|
telemetryTransport?: BaseTelemetryTransport;
|
|
562
1726
|
};
|
|
563
1727
|
/**
|
|
@@ -565,8 +1729,6 @@ type ComposioConfig<TToolset extends BaseComposioToolset<unknown, unknown> = Ope
|
|
|
565
1729
|
* It is used to initialize the Composio SDK and provide a global configuration.
|
|
566
1730
|
*/
|
|
567
1731
|
declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> {
|
|
568
|
-
private readonly DEFAULT_USER_ID;
|
|
569
|
-
readonly FILE_NAME = "core/composio.ts";
|
|
570
1732
|
/**
|
|
571
1733
|
* The Composio API client.
|
|
572
1734
|
* @type {ComposioClient}
|
|
@@ -574,24 +1736,20 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
|
|
|
574
1736
|
private client;
|
|
575
1737
|
/**
|
|
576
1738
|
* The configuration for the Composio SDK.
|
|
577
|
-
* @type {ComposioConfig<
|
|
1739
|
+
* @type {ComposioConfig<TToolset>}
|
|
578
1740
|
*/
|
|
579
1741
|
private config;
|
|
580
1742
|
private telemetry;
|
|
581
|
-
/**
|
|
582
|
-
* Context variables for the Composio SDK.
|
|
583
|
-
*/
|
|
584
|
-
userId?: string;
|
|
585
|
-
connectedAccountIds?: Record<string, string>;
|
|
586
1743
|
/**
|
|
587
1744
|
* Core models for Composio.
|
|
588
1745
|
*/
|
|
589
|
-
tools: Tools
|
|
1746
|
+
tools: Tools<unknown, unknown, TToolset>;
|
|
590
1747
|
toolkits: Toolkits;
|
|
591
1748
|
triggers: Triggers;
|
|
592
1749
|
toolset: TToolset;
|
|
593
1750
|
authConfigs: AuthConfigs;
|
|
594
1751
|
connectedAccounts: ConnectedAccounts;
|
|
1752
|
+
createConnectedAccount: ConnectedAccounts['createConnectedAccount'];
|
|
595
1753
|
/**
|
|
596
1754
|
* @param {Object} config Configuration for the Composio SDK.
|
|
597
1755
|
* @param {string} config.apiKey The API key for the Composio SDK.
|
|
@@ -599,7 +1757,7 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
|
|
|
599
1757
|
* @param {string} config.runtime The runtime for the Composio SDK.
|
|
600
1758
|
* @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
|
|
601
1759
|
* @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
|
|
602
|
-
* @param {
|
|
1760
|
+
* @param {TToolset} config.toolset The toolset to use for this Composio instance.
|
|
603
1761
|
*/
|
|
604
1762
|
constructor(config: ComposioConfig<TToolset>);
|
|
605
1763
|
/**
|
|
@@ -608,28 +1766,25 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
|
|
|
608
1766
|
* @param {BaseTelemetryTransport} transport - The transport for the telemetry.
|
|
609
1767
|
*/
|
|
610
1768
|
private initializeTelemetry;
|
|
611
|
-
/**
|
|
612
|
-
* Get the connected account id for the given app name.
|
|
613
|
-
* @param appName - The name of the app.
|
|
614
|
-
* @returns {string | undefined} The connected account id for the given app name.
|
|
615
|
-
*/
|
|
616
|
-
getConnectedAccountId(appName: string): string | undefined;
|
|
617
1769
|
/**
|
|
618
1770
|
* Get the Composio SDK client.
|
|
619
1771
|
* @returns {ComposioClient} The Composio API client.
|
|
620
1772
|
*/
|
|
621
1773
|
getClient(): ComposioClient;
|
|
622
1774
|
/**
|
|
623
|
-
*
|
|
624
|
-
* @
|
|
1775
|
+
* Fetch all the tools from Composio.
|
|
1776
|
+
* @param {ToolListParams} params Parameters to fetch the tools.
|
|
1777
|
+
* @param {ToolsetOptions<TToolset>} modifiers Modifiers to apply to the tools.
|
|
1778
|
+
* @returns {Promise<ReturnType<TToolset['getTools']>>} The tools from the toolset.
|
|
625
1779
|
*/
|
|
626
|
-
|
|
1780
|
+
getTools<T extends TToolset>(userId: string, filters: ToolListParams, modifiers?: ToolsetOptions<T>): Promise<ReturnType<T['wrapTools']>>;
|
|
627
1781
|
/**
|
|
628
|
-
*
|
|
629
|
-
* @param
|
|
630
|
-
* @
|
|
1782
|
+
* Fetch a tool from Composio by its slug.
|
|
1783
|
+
* @param {string} slug slug of the tool
|
|
1784
|
+
* @param {ToolsetOptions<TToolset>} modifiers to be applied to the tool
|
|
1785
|
+
* @returns {Promise<ReturnType<TToolset['getToolBySlug']>>} The tool from the toolset.
|
|
631
1786
|
*/
|
|
632
|
-
|
|
1787
|
+
getToolBySlug<T extends TToolset>(userId: string, slug: string, modifiers?: ToolsetOptions<T>): Promise<ReturnType<T['wrapTool']>>;
|
|
633
1788
|
}
|
|
634
1789
|
|
|
635
1790
|
/**
|
|
@@ -641,13 +1796,12 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
|
|
|
641
1796
|
interface CustomTool {
|
|
642
1797
|
name: string;
|
|
643
1798
|
}
|
|
644
|
-
declare class ComposioToolset extends
|
|
645
|
-
readonly
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
test(): Promise<void>;
|
|
1799
|
+
declare class ComposioToolset extends BaseNonAgenticToolset<Array<CustomTool>, CustomTool> {
|
|
1800
|
+
readonly name = "ComposioToolset";
|
|
1801
|
+
wrapTool: (tool: Tool) => CustomTool;
|
|
1802
|
+
wrapTools(tools: Tool[]): CustomTool[];
|
|
649
1803
|
}
|
|
650
1804
|
|
|
651
1805
|
declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
652
1806
|
|
|
653
|
-
export { BaseComposioToolset, BaseTelemetryTransport, Composio, ComposioToolset, type
|
|
1807
|
+
export { type AfterToolExecuteModifier, type AgenticToolOptions, BaseAgenticToolset, type BaseComposioToolset, BaseNonAgenticToolset, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioToolset, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIToolset, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type Toolset, type TransformToolSchemaModifier, jsonSchemaToModel };
|