Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Fix SDK errors
haxzie committed
May 26, 2025 at 17:12 UTC
cd4b5d8e934c768d3c25f4762c7728303ab3b3d6
11 files changed
+63
-64
packages/core/package.json
+1
-1
@@ -36,7 +36,7 @@
36
"vitest": "^3.1.3"
37
},
38
"dependencies": {
39
- "@composio/client": "^0.1.0-alpha.10",
39
+ "@composio/client": "0.1.0-alpha.14",
40
"chalk": "^5.4.1",
41
"openai": "^4.94.0",
42
"pusher-js": "^8.4.0",
packages/core/src/models/AuthConfigs.ts
+1
-1
@@ -123,7 +123,7 @@ export class AuthConfigs {
123
const result = await this.client.authConfigs.list({
124
cursor: parsedQuery?.cursor,
125
is_composio_managed: parsedQuery?.isComposioManaged,
126
- limit: parsedQuery?.limit?.toString(),
126
+ limit: parsedQuery?.limit,
127
toolkit_slug: parsedQuery?.toolkit,
128
});
129
const parsedResult = AuthConfigListResponseSchema.safeParse({
packages/core/src/models/ConnectionRequest.ts
-1
@@ -132,7 +132,6 @@ export class ConnectionRequest {
132
const terminalErrorStates: ConnectedAccountStatus[] = [
133
ConnectedAccountStatuses.FAILED,
134
ConnectedAccountStatuses.EXPIRED,
135
- ConnectedAccountStatuses.DELETED,
135
];
136
137
const start = Date.now();
packages/core/src/models/CustomTools.ts
+10
-12
@@ -137,8 +137,7 @@ export class CustomTools {
137
await this.client.toolkits.retrieve(toolkitSlug);
138
} catch (error) {
139
throw new ComposioToolNotFoundError(`Toolkit with slug ${toolkitSlug} not found`, {
140
- toolkitSlug,
141
- error,
140
+ cause: error,
141
});
142
}
143
const connectedAccounts = await this.client.connectedAccounts.list({
@@ -148,10 +147,7 @@ export class CustomTools {
147
148
if (!connectedAccounts.items.length) {
149
throw new ComposioConnectedAccountNotFoundError(
151
- `No connected accounts found for toolkit ${toolkitSlug}`,
152
- {
153
- toolkitSlug,
154
- }
150
+ `No connected accounts found for toolkit ${toolkitSlug}`
151
);
152
}
153
@@ -174,9 +170,7 @@ export class CustomTools {
170
): Promise<ToolExecuteResponse> {
171
const tool = this.customToolsRegistry.get(slug.toLowerCase());
172
if (!tool) {
177
- throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`, {
178
- toolSlug: slug,
179
- });
173
+ throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`);
174
}
175
176
let authCredentials: Record<string, unknown> = {};
@@ -188,8 +182,10 @@ export class CustomTools {
182
throw new ComposioConnectedAccountNotFoundError(
183
`Connected account not found for toolkit ${toolkitSlug} for user ${metadata.userId}`,
184
{
191
- toolkitSlug,
192
- userId: metadata.userId,
185
+ meta: {
186
+ toolkitSlug,
187
+ userId: metadata.userId,
188
+ },
189
}
190
);
191
}
@@ -198,7 +194,9 @@ export class CustomTools {
194
195
if (typeof execute !== 'function') {
196
throw new ComposioInvalidExecuteFunctionError('Invalid execute function', {
201
- toolSlug: slug,
197
+ meta: {
198
+ toolSlug: slug,
199
+ },
200
});
201
}
202
// create a tool proxy request for users to execute in case of a toolkit being used
packages/core/src/models/Session.ts
+4
-4
@@ -1,6 +1,6 @@
1
-import { SessionGetInfoResponse } from '@composio/client/resources/auth/session';
1
import ComposioClient from '@composio/client';
2
import { telemetry } from '../telemetry/Telemetry';
3
+import { SessionRetrieveResponse } from '@composio/client/resources/auth/session';
4
5
export class Session {
6
private client: ComposioClient;
@@ -12,9 +12,9 @@ export class Session {
12
13
/**
14
* Get the active session info
15
- * @returns {Promise<SessionGetInfoResponse>} Session info
15
+ * @returns {Promise<SessionInfoResponse>} Session info
16
*/
17
- async getInfo(): Promise<SessionGetInfoResponse> {
18
- return this.client.auth.session.getInfo();
17
+ async getInfo(): Promise<SessionRetrieveResponse> {
18
+ return this.client.auth.session.retrieve();
19
}
20
}
packages/core/src/models/Tools.ts
+7
-2
@@ -259,10 +259,15 @@ export class Tools<
259
}
260
261
const tools = await this.client.tools.list({
262
- tool_slugs: queryParams.data.tools,
262
+ tool_slugs: queryParams.data.tools?.join(','),
263
toolkit_slug: queryParams.data.toolkits?.join(','),
264
cursor: queryParams.data.cursor,
265
- important: queryParams.data.important?.toString(),
265
+ important:
266
+ typeof queryParams.data.important === 'undefined'
267
+ ? undefined
268
+ : queryParams.data.important
269
+ ? 'true'
270
+ : 'false',
271
limit: queryParams.data.limit?.toString(),
272
search: queryParams.data.search,
273
});
packages/core/src/models/Triggers.ts
+12
-13
@@ -1,8 +1,8 @@
1
import ComposioClient from '@composio/client';
2
import { RequestOptions } from '@composio/client/internal/request-options';
3
import {
4
+ TriggerInstanceDeleteResponse,
5
TriggerInstanceListActiveParams,
5
- TriggerInstanceRemoveUpsertResponse,
6
TriggerInstanceUpdateStatusParams,
7
TriggerInstanceUpsertParams,
8
TriggerInstanceUpsertResponse,
@@ -61,20 +61,19 @@ export class Triggers {
61
*/
62
async update(
63
slug: string,
64
- body: TriggerInstanceUpsertParams,
65
- options?: RequestOptions
64
+ body: TriggerInstanceUpsertParams
65
): Promise<TriggerInstanceUpsertResponse> {
67
- return this.client.triggerInstances.upsert(slug, body, options);
66
+ return this.client.triggerInstances.upsert(slug, body);
67
}
68
69
/**
70
* Delete a trigger instance
71
*
73
- * @param {string} slug - The slug of the trigger instance
72
+ * @param {string} triggerId - The slug of the trigger instance
73
* @returns
74
*/
76
- async delete(slug: string): Promise<TriggerInstanceRemoveUpsertResponse> {
77
- return this.client.triggerInstances.removeUpsert(slug);
75
+ async delete(triggerId: string): Promise<TriggerInstanceDeleteResponse> {
76
+ return this.client.triggerInstances.delete(triggerId);
77
}
78
79
/**
@@ -96,23 +95,23 @@ export class Triggers {
95
/**
96
* Disable a trigger instance
97
*
99
- * @param {string} slug - The slug of the trigger instance
98
+ * @param {string} triggerId - The id of the trigger instance
99
* @param {RequestOptions options - Request options
100
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
101
*/
103
- async disable(slug: string, options?: RequestOptions) {
104
- return this.client.triggerInstances.updateStatus('disable', { slug }, options);
102
+ async disable(triggerId: string, options?: RequestOptions) {
103
+ return this.client.triggerInstances.updateStatus('disable', { triggerId }, options);
104
}
105
106
/**
107
* Enable a trigger instance
108
*
110
- * @param {string} slug - The slug of the trigger instance
109
+ * @param {string} triggerId - The id of the trigger instance
110
* @param {RequestOptions options - Request options
111
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
112
*/
114
- async enable(slug: string, options?: RequestOptions) {
115
- return this.client.triggerInstances.updateStatus('enable', { slug }, options);
113
+ async enable(triggerId: string, options?: RequestOptions) {
114
+ return this.client.triggerInstances.updateStatus('enable', { triggerId }, options);
115
}
116
117
/**
packages/core/src/types/connectedAccounts.types.ts
+6
-8
@@ -4,20 +4,18 @@ import { z } from 'zod';
4
* Connected Account create parameters
5
*/
6
export const ConnectedAccountStatuses = {
7
- ACTIVE: 'ACTIVE',
8
- INACTIVE: 'INACTIVE',
9
- DELETED: 'DELETED',
7
+ INITIALIZING: 'INITIALIZING',
8
INITIATED: 'INITIATED',
11
- EXPIRED: 'EXPIRED',
9
+ ACTIVE: 'ACTIVE',
10
FAILED: 'FAILED',
11
+ EXPIRED: 'EXPIRED',
12
} as const;
13
export const ConnectedAccountStatusSchema = z.enum([
15
- ConnectedAccountStatuses.ACTIVE,
16
- ConnectedAccountStatuses.INACTIVE,
17
- ConnectedAccountStatuses.DELETED,
14
+ ConnectedAccountStatuses.INITIALIZING,
15
ConnectedAccountStatuses.INITIATED,
19
- ConnectedAccountStatuses.EXPIRED,
16
+ ConnectedAccountStatuses.ACTIVE,
17
ConnectedAccountStatuses.FAILED,
18
+ ConnectedAccountStatuses.EXPIRED,
19
]);
20
export type ConnectedAccountStatus =
21
(typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
packages/core/test/AuthConfigs/authConfigs.test.ts
+1
-1
@@ -193,7 +193,7 @@ describe('AuthConfigs', () => {
193
expect(mockClient.authConfigs.list).toHaveBeenCalledWith({
194
cursor: 'cursor_123',
195
is_composio_managed: true,
196
- limit: '10',
196
+ limit: 10,
197
toolkit_slug: 'github',
198
});
199
packages/core/test/tools/tools.test.ts
+1
-1
@@ -65,7 +65,7 @@ describe('Tools', () => {
65
await context.tools.getRawComposioTools(userId, query);
66
67
expect(mockClient.tools.list).toHaveBeenCalledWith({
68
- tool_slugs: ['TOOL1', 'TOOL2'],
68
+ tool_slugs: 'TOOL1,TOOL2',
69
limit: '10',
70
cursor: undefined,
71
important: undefined,
pnpm-lock.yaml
+20
-20
@@ -93,7 +93,7 @@ importers:
93
version: link:../../packages/providers/langchain
94
'@langchain/core':
95
specifier: ^0.3.56
96
- version: 0.3.56(openai@4.98.0(zod@3.24.4))
96
+ version: 0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
97
'@langchain/langgraph':
98
specifier: ^0.2.72
99
version: 0.2.72(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))(react@19.1.0)(zod-to-json-schema@3.24.5(zod@3.24.4))
@@ -243,8 +243,8 @@ importers:
243
packages/core:
244
dependencies:
245
'@composio/client':
246
- specifier: ^0.1.0-alpha.10
247
- version: 0.1.0-alpha.10
246
+ specifier: 0.1.0-alpha.14
247
+ version: 0.1.0-alpha.14
248
chalk:
249
specifier: ^5.4.1
250
version: 5.4.1
@@ -281,7 +281,7 @@ importers:
281
version: 5.8.3
282
vitest:
283
specifier: ^3.1.3
284
- version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4(vitest@3.1.4))(tsx@4.19.4)(yaml@2.8.0)
284
+ version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4)(tsx@4.19.4)(yaml@2.8.0)
285
286
packages/providers/cloudflare:
287
dependencies:
@@ -300,13 +300,13 @@ importers:
300
version: 5.8.3
301
vitest:
302
specifier: ^3.1.3
303
- version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4(vitest@3.1.4))(tsx@4.19.4)(yaml@2.8.0)
303
+ version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4)(tsx@4.19.4)(yaml@2.8.0)
304
305
packages/providers/langchain:
306
dependencies:
307
'@langchain/core':
308
specifier: ^0.3.44
309
- version: 0.3.56(openai@4.98.0(zod@3.24.4))
309
+ version: 0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
310
devDependencies:
311
'@composio/core':
312
specifier: workspace:*
@@ -319,7 +319,7 @@ importers:
319
version: 5.8.3
320
vitest:
321
specifier: ^3.1.3
322
- version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4(vitest@3.1.4))(tsx@4.19.4)(yaml@2.8.0)
322
+ version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4)(tsx@4.19.4)(yaml@2.8.0)
323
324
packages/providers/openai:
325
dependencies:
@@ -338,7 +338,7 @@ importers:
338
version: 5.8.3
339
vitest:
340
specifier: ^3.1.3
341
- version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4(vitest@3.1.4))(tsx@4.19.4)(yaml@2.8.0)
341
+ version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4)(tsx@4.19.4)(yaml@2.8.0)
342
343
packages/providers/vercel:
344
dependencies:
@@ -357,7 +357,7 @@ importers:
357
version: 5.8.3
358
vitest:
359
specifier: ^3.1.3
360
- version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4(vitest@3.1.4))(tsx@4.19.4)(yaml@2.8.0)
360
+ version: 3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4)(tsx@4.19.4)(yaml@2.8.0)
361
362
packages:
363
@@ -458,8 +458,8 @@ packages:
458
'@cloudflare/workers-types@4.20250515.0':
459
resolution: {integrity: sha512-KoHFMH04gOXp3KEI+wrFIU+3ZfoSXnwqZTpybNQjalHoN3pWjtWBb/030cCRAZ639YX+DAHAxNF7AvEYGz1oaA==}
460
461
- '@composio/client@0.1.0-alpha.10':
462
- resolution: {integrity: sha512-ieaVXwx9A0zKvLS6yFEr7YZCAoBHQrPzFK8jTjN8QDjqLdQEuufuFfzM5ZUEN5UCX2bckR77OplZZjAn3TikWA==}
461
+ '@composio/client@0.1.0-alpha.14':
462
+ resolution: {integrity: sha512-oDGR1N5gRqVWaoPD0pqgD26ZtwGCICRio7nSzcelgN4fRoVCRTGREXDo6WMXkA3hBsLjg9LqoMQvMMELvo4A6w==}
463
464
'@esbuild/aix-ppc64@0.25.4':
465
resolution: {integrity: sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q==}
@@ -2878,7 +2878,7 @@ snapshots:
2878
2879
'@cloudflare/workers-types@4.20250515.0': {}
2880
2881
- '@composio/client@0.1.0-alpha.10': {}
2881
+ '@composio/client@0.1.0-alpha.14': {}
2882
2883
'@esbuild/aix-ppc64@0.25.4':
2884
optional: true
@@ -3038,14 +3038,14 @@ snapshots:
3038
'@jridgewell/resolve-uri': 3.1.2
3039
'@jridgewell/sourcemap-codec': 1.5.0
3040
3041
- '@langchain/core@0.3.56(openai@4.98.0(zod@3.24.4))':
3041
+ '@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))':
3042
dependencies:
3043
'@cfworker/json-schema': 4.1.1
3044
ansi-styles: 5.2.0
3045
camelcase: 6.3.0
3046
decamelize: 1.2.0
3047
js-tiktoken: 1.0.20
3048
- langsmith: 0.3.29(openai@4.98.0(zod@3.24.4))
3048
+ langsmith: 0.3.29(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
3049
mustache: 4.2.0
3050
p-queue: 6.6.2
3051
p-retry: 4.6.2
@@ -3057,7 +3057,7 @@ snapshots:
3057
3058
'@langchain/langgraph-checkpoint@0.0.17(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))':
3059
dependencies:
3060
- '@langchain/core': 0.3.56(openai@4.98.0(zod@3.24.4))
3060
+ '@langchain/core': 0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
3061
uuid: 10.0.0
3062
3063
'@langchain/langgraph-sdk@0.0.74(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))(react@19.1.0)':
@@ -3067,12 +3067,12 @@ snapshots:
3067
p-retry: 4.6.2
3068
uuid: 9.0.1
3069
optionalDependencies:
3070
- '@langchain/core': 0.3.56(openai@4.98.0(zod@3.24.4))
3070
+ '@langchain/core': 0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
3071
react: 19.1.0
3072
3073
'@langchain/langgraph@0.2.72(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))(react@19.1.0)(zod-to-json-schema@3.24.5(zod@3.24.4))':
3074
dependencies:
3075
- '@langchain/core': 0.3.56(openai@4.98.0(zod@3.24.4))
3075
+ '@langchain/core': 0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
3076
'@langchain/langgraph-checkpoint': 0.0.17(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))
3077
'@langchain/langgraph-sdk': 0.0.74(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))(react@19.1.0)
3078
uuid: 10.0.0
@@ -3084,7 +3084,7 @@ snapshots:
3084
3085
'@langchain/openai@0.5.10(@langchain/core@0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)))(encoding@0.1.13)':
3086
dependencies:
3087
- '@langchain/core': 0.3.56(openai@4.98.0(zod@3.24.4))
3087
+ '@langchain/core': 0.3.56(openai@4.98.0(encoding@0.1.13)(zod@3.24.4))
3088
js-tiktoken: 1.0.20
3089
openai: 4.98.0(encoding@0.1.13)(zod@3.24.4)
3090
zod: 3.24.4
@@ -4151,7 +4151,7 @@ snapshots:
4151
dependencies:
4152
json-buffer: 3.0.1
4153
4154
- langsmith@0.3.29(openai@4.98.0(zod@3.24.4)):
4154
+ langsmith@0.3.29(openai@4.98.0(encoding@0.1.13)(zod@3.24.4)):
4155
dependencies:
4156
'@types/uuid': 10.0.0
4157
chalk: 4.1.2
@@ -4933,7 +4933,7 @@ snapshots:
4933
tsx: 4.19.4
4934
yaml: 2.8.0
4935
4936
- vitest@3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4(vitest@3.1.4))(tsx@4.19.4)(yaml@2.8.0):
4936
+ vitest@3.1.3(@types/node@22.15.18)(@vitest/ui@3.1.4)(tsx@4.19.4)(yaml@2.8.0):
4937
dependencies:
4938
'@vitest/expect': 3.1.3
4939
'@vitest/mocker': 3.1.3(vite@6.3.5(@types/node@22.15.18)(tsx@4.19.4)(yaml@2.8.0))