@composio/core 0.1.16 → 0.1.17
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 +34 -19
- package/dist/index.d.cts +2970 -2998
- package/dist/index.d.ts +2970 -2998
- package/dist/index.js +34 -19
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var JSONSchemaType = z.enum([
|
|
|
27
27
|
var JSONSchemaProperty = z.object({
|
|
28
28
|
type: JSONSchemaType.optional(),
|
|
29
29
|
description: z.string().optional(),
|
|
30
|
+
anyOf: z.lazy(() => z.array(JSONSchemaProperty)).optional(),
|
|
30
31
|
title: z.string().optional(),
|
|
31
32
|
default: z.any().optional(),
|
|
32
33
|
properties: z.lazy(() => z.record(z.string(), JSONSchemaProperty)).optional(),
|
|
@@ -35,6 +36,7 @@ var JSONSchemaProperty = z.object({
|
|
|
35
36
|
});
|
|
36
37
|
var ParametersSchema = z.object({
|
|
37
38
|
type: z.literal("object"),
|
|
39
|
+
anyOf: z.array(JSONSchemaProperty).optional(),
|
|
38
40
|
properties: z.record(z.string(), JSONSchemaProperty),
|
|
39
41
|
required: z.array(z.string()).optional(),
|
|
40
42
|
title: z.string().optional(),
|
|
@@ -1762,7 +1764,7 @@ var CustomTools = class {
|
|
|
1762
1764
|
if (!tool) {
|
|
1763
1765
|
throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`);
|
|
1764
1766
|
}
|
|
1765
|
-
let authCredentials =
|
|
1767
|
+
let authCredentials = null;
|
|
1766
1768
|
const { toolkitSlug, execute, inputParams } = tool.options;
|
|
1767
1769
|
let connectedAccountId = body.connectedAccountId;
|
|
1768
1770
|
if (toolkitSlug && toolkitSlug !== "custom") {
|
|
@@ -1786,7 +1788,7 @@ var CustomTools = class {
|
|
|
1786
1788
|
}
|
|
1787
1789
|
);
|
|
1788
1790
|
}
|
|
1789
|
-
authCredentials = connectedAccount.
|
|
1791
|
+
authCredentials = connectedAccount.state ?? null;
|
|
1790
1792
|
connectedAccountId = connectedAccount.id;
|
|
1791
1793
|
}
|
|
1792
1794
|
if (typeof execute !== "function") {
|
|
@@ -2468,11 +2470,7 @@ var ToolKitItemSchema = z4.object({
|
|
|
2468
2470
|
composioManagedAuthSchemes: z4.array(z4.string()).optional(),
|
|
2469
2471
|
noAuth: z4.boolean().optional()
|
|
2470
2472
|
});
|
|
2471
|
-
var ToolKitListResponseSchema = z4.
|
|
2472
|
-
items: z4.array(ToolKitItemSchema),
|
|
2473
|
-
nextCursor: z4.string().nullable(),
|
|
2474
|
-
totalPages: z4.number()
|
|
2475
|
-
});
|
|
2473
|
+
var ToolKitListResponseSchema = z4.array(ToolKitItemSchema);
|
|
2476
2474
|
var ToolkitAuthFieldSchema = z4.object({
|
|
2477
2475
|
name: z4.string(),
|
|
2478
2476
|
displayName: z4.string(),
|
|
@@ -3322,22 +3320,34 @@ var Toolkits = class {
|
|
|
3322
3320
|
managed_by: parsedQuery.data.managedBy,
|
|
3323
3321
|
sort_by: parsedQuery.data.sortBy
|
|
3324
3322
|
});
|
|
3325
|
-
const parsedResult = ToolKitListResponseSchema.safeParse(
|
|
3326
|
-
|
|
3327
|
-
const parsedItem = ToolKitItemSchema.
|
|
3323
|
+
const parsedResult = ToolKitListResponseSchema.safeParse(
|
|
3324
|
+
result.items.map((item) => {
|
|
3325
|
+
const parsedItem = ToolKitItemSchema.safeParse({
|
|
3328
3326
|
name: item.name,
|
|
3329
3327
|
slug: item.slug,
|
|
3330
|
-
meta:
|
|
3328
|
+
meta: {
|
|
3329
|
+
...item.meta,
|
|
3330
|
+
createdAt: item.meta.created_at,
|
|
3331
|
+
updatedAt: item.meta.updated_at,
|
|
3332
|
+
toolsCount: item.meta.tools_count,
|
|
3333
|
+
triggersCount: item.meta.triggers_count,
|
|
3334
|
+
categories: item.meta.categories,
|
|
3335
|
+
appUrl: item.meta.app_url,
|
|
3336
|
+
logo: item.meta.logo
|
|
3337
|
+
},
|
|
3331
3338
|
isLocalToolkit: item.is_local_toolkit,
|
|
3332
3339
|
authSchemes: item.auth_schemes,
|
|
3333
3340
|
composioManagedAuthSchemes: item.composio_managed_auth_schemes,
|
|
3334
3341
|
noAuth: item.no_auth
|
|
3335
3342
|
});
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3343
|
+
if (!parsedItem.success) {
|
|
3344
|
+
throw new ValidationError("Failed to parse toolkit response", {
|
|
3345
|
+
cause: parsedItem.error
|
|
3346
|
+
});
|
|
3347
|
+
}
|
|
3348
|
+
return parsedItem.data;
|
|
3349
|
+
})
|
|
3350
|
+
);
|
|
3341
3351
|
if (!parsedResult.success) {
|
|
3342
3352
|
throw new ValidationError("Failed to parse toolkit list response", {
|
|
3343
3353
|
cause: parsedResult.error
|
|
@@ -3443,7 +3453,7 @@ var Toolkits = class {
|
|
|
3443
3453
|
*/
|
|
3444
3454
|
async listCategories() {
|
|
3445
3455
|
const result = await this.client.toolkits.retrieveCategories();
|
|
3446
|
-
const parsedResult = ToolkitRetrieveCategoriesResponseSchema.
|
|
3456
|
+
const parsedResult = ToolkitRetrieveCategoriesResponseSchema.safeParse({
|
|
3447
3457
|
items: result.items.map((item) => {
|
|
3448
3458
|
const parsedItem = ToolkitCategorySchema.parse({
|
|
3449
3459
|
id: item.id,
|
|
@@ -3454,7 +3464,12 @@ var Toolkits = class {
|
|
|
3454
3464
|
nextCursor: result.next_cursor,
|
|
3455
3465
|
totalPages: result.total_pages
|
|
3456
3466
|
});
|
|
3457
|
-
|
|
3467
|
+
if (!parsedResult.success) {
|
|
3468
|
+
throw new ValidationError("Failed to parse toolkit categories response", {
|
|
3469
|
+
cause: parsedResult.error
|
|
3470
|
+
});
|
|
3471
|
+
}
|
|
3472
|
+
return parsedResult.data;
|
|
3458
3473
|
}
|
|
3459
3474
|
/**
|
|
3460
3475
|
* Authorizes a user to use a toolkit.
|
|
@@ -4675,7 +4690,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
4675
4690
|
};
|
|
4676
4691
|
|
|
4677
4692
|
// package.json
|
|
4678
|
-
var version = "0.1.
|
|
4693
|
+
var version = "0.1.17";
|
|
4679
4694
|
|
|
4680
4695
|
// src/composio.ts
|
|
4681
4696
|
var Composio = class _Composio {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"tsx": "^4.19.3",
|
|
28
28
|
"typescript": "^5.8.3",
|
|
29
29
|
"vitest": "^3.1.4",
|
|
30
|
-
"@composio/json-schema-to-zod": "0.1.
|
|
30
|
+
"@composio/json-schema-to-zod": "0.1.5"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@composio/client": "0.1.0-alpha.17",
|
|
34
|
-
"@composio/json-schema-to-zod": "0.1.
|
|
34
|
+
"@composio/json-schema-to-zod": "0.1.5",
|
|
35
|
+
"zod-to-json-schema": "^3.24.5",
|
|
35
36
|
"chalk": "^5.4.1",
|
|
36
37
|
"openai": "^4.94.0",
|
|
37
38
|
"pusher-js": "^8.4.0",
|
|
38
39
|
"semver": "^7.7.2",
|
|
39
40
|
"uuid": "^11.1.0",
|
|
40
|
-
"zod": "^3.24.2"
|
|
41
|
-
"zod-to-json-schema": "^3.24.5"
|
|
41
|
+
"zod": "^3.24.2"
|
|
42
42
|
},
|
|
43
43
|
"gitHead": "4fae6e54d5c150fba955cc5fa314281da5a1e064",
|
|
44
44
|
"scripts": {
|