@composio/core 0.3.2 → 0.3.3
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 +33 -24
- package/dist/index.d.cts +118 -60
- package/dist/index.d.mts +118 -60
- package/dist/index.mjs +33 -22
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -6271,7 +6271,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
6271
6271
|
|
|
6272
6272
|
//#endregion
|
|
6273
6273
|
//#region package.json
|
|
6274
|
-
var version = "0.3.
|
|
6274
|
+
var version = "0.3.3";
|
|
6275
6275
|
|
|
6276
6276
|
//#endregion
|
|
6277
6277
|
//#region src/models/Files.ts
|
|
@@ -6361,14 +6361,17 @@ const ToolRouterManageConnectionsConfigSchema = zod_v3.default.object({
|
|
|
6361
6361
|
enable: zod_v3.default.boolean().optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually").default(true),
|
|
6362
6362
|
callbackUrl: zod_v3.default.string().optional().describe("The callback url to use in the tool router session")
|
|
6363
6363
|
});
|
|
6364
|
-
const ToolRouterTagsParamSchema = zod_v3.default.array(zod_v3.default.
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6364
|
+
const ToolRouterTagsParamSchema = zod_v3.default.array(zod_v3.default.enum([
|
|
6365
|
+
"readOnlyHint",
|
|
6366
|
+
"destructiveHint",
|
|
6367
|
+
"idempotentHint",
|
|
6368
|
+
"openWorldHint"
|
|
6369
|
+
])).describe("The tags to filter the tools by");
|
|
6370
|
+
const ToolRouterTagsEnableDisableSchema = zod_v3.default.object({
|
|
6371
|
+
enable: ToolRouterTagsParamSchema.optional().describe("The tags to enable in the tool router session"),
|
|
6372
|
+
disable: ToolRouterTagsParamSchema.optional().describe("The tags to disable in the tool router session")
|
|
6373
|
+
}).strict();
|
|
6374
|
+
const ToolRouterConfigTagsSchema = zod_v3.default.union([ToolRouterTagsParamSchema, ToolRouterTagsEnableDisableSchema]).describe("The tags to use in the tool router session");
|
|
6372
6375
|
/**
|
|
6373
6376
|
* Tools config - Configure tools per toolkit using toolkit slug as key
|
|
6374
6377
|
* @example
|
|
@@ -6392,17 +6395,11 @@ const ToolRouterConfigTagsSchema = zod_v3.default.union([
|
|
|
6392
6395
|
* ```
|
|
6393
6396
|
*/
|
|
6394
6397
|
const ToolRouterToolsParamSchema = zod_v3.default.array(zod_v3.default.string()).describe("The tools to use in the tool router session");
|
|
6395
|
-
const ToolRouterToolsTagsParamSchema = zod_v3.default.array(zod_v3.default.enum([
|
|
6396
|
-
"readOnlyHint",
|
|
6397
|
-
"destructiveHint",
|
|
6398
|
-
"idempotentHint",
|
|
6399
|
-
"openWorldHint"
|
|
6400
|
-
])).describe("The tags to filter the tools by");
|
|
6401
6398
|
const ToolRouterConfigToolsSchema = zod_v3.default.union([
|
|
6402
6399
|
ToolRouterToolsParamSchema,
|
|
6403
6400
|
zod_v3.default.object({ enable: ToolRouterToolsParamSchema.describe("The tools to enable in the tool router session") }).strict(),
|
|
6404
6401
|
zod_v3.default.object({ disable: ToolRouterToolsParamSchema.describe("The tools to disable in the tool router session") }).strict(),
|
|
6405
|
-
zod_v3.default.object({ tags:
|
|
6402
|
+
zod_v3.default.object({ tags: ToolRouterConfigTagsSchema.describe("The tags to filter the tools by, this will override the global tags") }).strict()
|
|
6406
6403
|
]).superRefine((val, ctx) => {
|
|
6407
6404
|
if (typeof val === "object" && !Array.isArray(val)) {
|
|
6408
6405
|
const keys = Object.keys(val);
|
|
@@ -6415,7 +6412,7 @@ const ToolRouterConfigToolsSchema = zod_v3.default.union([
|
|
|
6415
6412
|
});
|
|
6416
6413
|
const ToolRouterCreateSessionConfigSchema = zod_v3.default.object({
|
|
6417
6414
|
tools: zod_v3.default.record(zod_v3.default.string(), zod_v3.default.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional().describe("The tools to use in the tool router session"),
|
|
6418
|
-
tags:
|
|
6415
|
+
tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
|
|
6419
6416
|
toolkits: zod_v3.default.union([
|
|
6420
6417
|
ToolRouterToolkitsParamSchema,
|
|
6421
6418
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
@@ -6461,7 +6458,8 @@ const ToolRouterToolkitsOptionsSchema = zod_v3.default.object({
|
|
|
6461
6458
|
toolkits: zod_v3.default.array(zod_v3.default.string()).optional(),
|
|
6462
6459
|
nextCursor: zod_v3.default.string().optional(),
|
|
6463
6460
|
limit: zod_v3.default.number().optional(),
|
|
6464
|
-
isConnected: zod_v3.default.boolean().optional()
|
|
6461
|
+
isConnected: zod_v3.default.boolean().optional(),
|
|
6462
|
+
search: zod_v3.default.string().optional()
|
|
6465
6463
|
});
|
|
6466
6464
|
|
|
6467
6465
|
//#endregion
|
|
@@ -6477,12 +6475,23 @@ const transformToolRouterToolsParams = (params) => {
|
|
|
6477
6475
|
if (Array.isArray(data)) acc[key] = { enable: data };
|
|
6478
6476
|
else if ("enable" in data) acc[key] = { enable: data.enable };
|
|
6479
6477
|
else if ("disable" in data) acc[key] = { disable: data.disable };
|
|
6480
|
-
else if ("tags" in data)
|
|
6478
|
+
else if ("tags" in data) {
|
|
6479
|
+
const tags = transformToolRouterTagsParams(data.tags);
|
|
6480
|
+
if (tags) acc[key] = { tags };
|
|
6481
|
+
}
|
|
6481
6482
|
} else throw new ValidationError(parsedResult.error.message);
|
|
6482
6483
|
} else acc[key] = { enable: params[key] };
|
|
6483
6484
|
return acc;
|
|
6484
6485
|
}, {});
|
|
6485
6486
|
};
|
|
6487
|
+
const transformToolRouterTagsParams = (params) => {
|
|
6488
|
+
if (!params) return;
|
|
6489
|
+
if (Array.isArray(params)) return { enable: params };
|
|
6490
|
+
else if (typeof params === "object") return {
|
|
6491
|
+
enable: params.enable,
|
|
6492
|
+
disable: params.disable
|
|
6493
|
+
};
|
|
6494
|
+
};
|
|
6486
6495
|
|
|
6487
6496
|
//#endregion
|
|
6488
6497
|
//#region src/models/ToolRouter.ts
|
|
@@ -6532,7 +6541,8 @@ var ToolRouter = class {
|
|
|
6532
6541
|
cursor: toolkitOptions.data.nextCursor,
|
|
6533
6542
|
limit: toolkitOptions.data.limit,
|
|
6534
6543
|
toolkits: toolkitOptions.data.toolkits,
|
|
6535
|
-
is_connected: toolkitOptions.data.isConnected
|
|
6544
|
+
is_connected: toolkitOptions.data.isConnected,
|
|
6545
|
+
search: toolkitOptions.data.search
|
|
6536
6546
|
});
|
|
6537
6547
|
return {
|
|
6538
6548
|
items: result.items.map((item) => {
|
|
@@ -6629,6 +6639,7 @@ var ToolRouter = class {
|
|
|
6629
6639
|
const routerConfig = ToolRouterCreateSessionConfigSchema.parse(config ?? {});
|
|
6630
6640
|
const manageConnectedAccounts = typeof routerConfig.manageConnections === "boolean" ? routerConfig.manageConnections : routerConfig.manageConnections?.enable ?? true;
|
|
6631
6641
|
const toolkits = Array.isArray(routerConfig.toolkits) ? { enable: routerConfig.toolkits } : routerConfig.toolkits;
|
|
6642
|
+
const tags = transformToolRouterTagsParams(routerConfig.tags);
|
|
6632
6643
|
const tools = transformToolRouterToolsParams(routerConfig.tools);
|
|
6633
6644
|
const payload = {
|
|
6634
6645
|
user_id: userId,
|
|
@@ -6636,7 +6647,7 @@ var ToolRouter = class {
|
|
|
6636
6647
|
auth_configs: routerConfig.authConfigs,
|
|
6637
6648
|
connected_accounts: routerConfig.connectedAccounts,
|
|
6638
6649
|
tools,
|
|
6639
|
-
tags
|
|
6650
|
+
tags,
|
|
6640
6651
|
manage_connections: {
|
|
6641
6652
|
enable: manageConnectedAccounts,
|
|
6642
6653
|
callback_url: typeof routerConfig.manageConnections === "object" ? routerConfig.manageConnections.callbackUrl : void 0
|
|
@@ -8080,17 +8091,15 @@ exports.ToolRouterConfigManageConnectionsSchema = ToolRouterConfigManageConnecti
|
|
|
8080
8091
|
exports.ToolRouterConfigTagsSchema = ToolRouterConfigTagsSchema;
|
|
8081
8092
|
exports.ToolRouterConfigToolsSchema = ToolRouterConfigToolsSchema;
|
|
8082
8093
|
exports.ToolRouterCreateSessionConfigSchema = ToolRouterCreateSessionConfigSchema;
|
|
8083
|
-
exports.ToolRouterDisabledTagsConfigSchema = ToolRouterDisabledTagsConfigSchema;
|
|
8084
|
-
exports.ToolRouterEnabledTagsConfigSchema = ToolRouterEnabledTagsConfigSchema;
|
|
8085
8094
|
exports.ToolRouterMCPServerConfigSchema = ToolRouterMCPServerConfigSchema;
|
|
8086
8095
|
exports.ToolRouterManageConnectionsConfigSchema = ToolRouterManageConnectionsConfigSchema;
|
|
8096
|
+
exports.ToolRouterTagsEnableDisableSchema = ToolRouterTagsEnableDisableSchema;
|
|
8087
8097
|
exports.ToolRouterTagsParamSchema = ToolRouterTagsParamSchema;
|
|
8088
8098
|
exports.ToolRouterToolkitsDisabledConfigSchema = ToolRouterToolkitsDisabledConfigSchema;
|
|
8089
8099
|
exports.ToolRouterToolkitsEnabledConfigSchema = ToolRouterToolkitsEnabledConfigSchema;
|
|
8090
8100
|
exports.ToolRouterToolkitsOptionsSchema = ToolRouterToolkitsOptionsSchema;
|
|
8091
8101
|
exports.ToolRouterToolkitsParamSchema = ToolRouterToolkitsParamSchema;
|
|
8092
8102
|
exports.ToolRouterToolsParamSchema = ToolRouterToolsParamSchema;
|
|
8093
|
-
exports.ToolRouterToolsTagsParamSchema = ToolRouterToolsTagsParamSchema;
|
|
8094
8103
|
exports.ToolSchema = ToolSchema;
|
|
8095
8104
|
exports.ToolkitAuthConfigDetailsSchema = ToolkitAuthConfigDetailsSchema;
|
|
8096
8105
|
exports.ToolkitAuthFieldSchema = ToolkitAuthFieldSchema;
|