@composio/core 0.3.1 → 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 CHANGED
@@ -3514,9 +3514,10 @@ const ToolkitMangedByEnumSchema = zod_v3.z.enum([
3514
3514
  const ToolkitSortByEnumSchema = zod_v3.z.enum(["usage", "alphabetically"]);
3515
3515
  const ToolkitsListParamsSchema = zod_v3.z.object({
3516
3516
  category: zod_v3.z.string().optional(),
3517
- isLocal: zod_v3.z.boolean().optional(),
3518
3517
  managedBy: ToolkitMangedByEnumSchema.optional(),
3519
- sortBy: ToolkitSortByEnumSchema.optional()
3518
+ sortBy: ToolkitSortByEnumSchema.optional(),
3519
+ cursor: zod_v3.z.string().optional(),
3520
+ limit: zod_v3.z.number().optional()
3520
3521
  });
3521
3522
  /**
3522
3523
  * Toolkits response
@@ -4434,9 +4435,10 @@ var Toolkits = class {
4434
4435
  if (!parsedQuery.success) throw new ValidationError("Failed to parse toolkit list query", { cause: parsedQuery.error });
4435
4436
  return transformToolkitListResponse(await this.client.toolkits.list({
4436
4437
  category: parsedQuery.data.category,
4437
- is_local: parsedQuery.data.isLocal,
4438
4438
  managed_by: parsedQuery.data.managedBy,
4439
- sort_by: parsedQuery.data.sortBy
4439
+ sort_by: parsedQuery.data.sortBy,
4440
+ cursor: parsedQuery.data.cursor,
4441
+ limit: parsedQuery.data.limit
4440
4442
  }));
4441
4443
  } catch (error) {
4442
4444
  throw new ComposioToolkitFetchError("Failed to fetch toolkits", { cause: error });
@@ -6269,7 +6271,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
6269
6271
 
6270
6272
  //#endregion
6271
6273
  //#region package.json
6272
- var version = "0.3.1";
6274
+ var version = "0.3.3";
6273
6275
 
6274
6276
  //#endregion
6275
6277
  //#region src/models/Files.ts
@@ -6359,14 +6361,17 @@ const ToolRouterManageConnectionsConfigSchema = zod_v3.default.object({
6359
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),
6360
6362
  callbackUrl: zod_v3.default.string().optional().describe("The callback url to use in the tool router session")
6361
6363
  });
6362
- const ToolRouterTagsParamSchema = zod_v3.default.array(zod_v3.default.string()).describe("The tags to use in the tool router session");
6363
- const ToolRouterEnabledTagsConfigSchema = zod_v3.default.object({ enable: ToolRouterTagsParamSchema.describe("The tags to enable in the tool router session") }).strict();
6364
- const ToolRouterDisabledTagsConfigSchema = zod_v3.default.object({ disable: ToolRouterTagsParamSchema.describe("The tags to disable in the tool router session") }).strict();
6365
- const ToolRouterConfigTagsSchema = zod_v3.default.union([
6366
- ToolRouterTagsParamSchema,
6367
- ToolRouterEnabledTagsConfigSchema,
6368
- ToolRouterDisabledTagsConfigSchema
6369
- ]).describe("The tags to use in the tool router session");
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");
6370
6375
  /**
6371
6376
  * Tools config - Configure tools per toolkit using toolkit slug as key
6372
6377
  * @example
@@ -6390,16 +6395,11 @@ const ToolRouterConfigTagsSchema = zod_v3.default.union([
6390
6395
  * ```
6391
6396
  */
6392
6397
  const ToolRouterToolsParamSchema = zod_v3.default.array(zod_v3.default.string()).describe("The tools to use in the tool router session");
6393
- const ToolRouterToolsTagsParamSchema = zod_v3.default.array(zod_v3.default.enum([
6394
- "readOnlyHint",
6395
- "destructiveHint",
6396
- "idempotentHint"
6397
- ])).describe("The tags to filter the tools by");
6398
6398
  const ToolRouterConfigToolsSchema = zod_v3.default.union([
6399
6399
  ToolRouterToolsParamSchema,
6400
6400
  zod_v3.default.object({ enable: ToolRouterToolsParamSchema.describe("The tools to enable in the tool router session") }).strict(),
6401
6401
  zod_v3.default.object({ disable: ToolRouterToolsParamSchema.describe("The tools to disable in the tool router session") }).strict(),
6402
- zod_v3.default.object({ tags: ToolRouterToolsTagsParamSchema.describe("The tags to filter the tools by, this will override the global tags") }).strict()
6402
+ zod_v3.default.object({ tags: ToolRouterConfigTagsSchema.describe("The tags to filter the tools by, this will override the global tags") }).strict()
6403
6403
  ]).superRefine((val, ctx) => {
6404
6404
  if (typeof val === "object" && !Array.isArray(val)) {
6405
6405
  const keys = Object.keys(val);
@@ -6412,7 +6412,7 @@ const ToolRouterConfigToolsSchema = zod_v3.default.union([
6412
6412
  });
6413
6413
  const ToolRouterCreateSessionConfigSchema = zod_v3.default.object({
6414
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"),
6415
- tags: ToolRouterToolsTagsParamSchema.optional().describe("Global tags to filter the tools by"),
6415
+ tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
6416
6416
  toolkits: zod_v3.default.union([
6417
6417
  ToolRouterToolkitsParamSchema,
6418
6418
  ToolRouterToolkitsDisabledConfigSchema,
@@ -6458,7 +6458,8 @@ const ToolRouterToolkitsOptionsSchema = zod_v3.default.object({
6458
6458
  toolkits: zod_v3.default.array(zod_v3.default.string()).optional(),
6459
6459
  nextCursor: zod_v3.default.string().optional(),
6460
6460
  limit: zod_v3.default.number().optional(),
6461
- isConnected: zod_v3.default.boolean().optional()
6461
+ isConnected: zod_v3.default.boolean().optional(),
6462
+ search: zod_v3.default.string().optional()
6462
6463
  });
6463
6464
 
6464
6465
  //#endregion
@@ -6474,12 +6475,23 @@ const transformToolRouterToolsParams = (params) => {
6474
6475
  if (Array.isArray(data)) acc[key] = { enable: data };
6475
6476
  else if ("enable" in data) acc[key] = { enable: data.enable };
6476
6477
  else if ("disable" in data) acc[key] = { disable: data.disable };
6477
- else if ("tags" in data) acc[key] = { tags: data.tags };
6478
+ else if ("tags" in data) {
6479
+ const tags = transformToolRouterTagsParams(data.tags);
6480
+ if (tags) acc[key] = { tags };
6481
+ }
6478
6482
  } else throw new ValidationError(parsedResult.error.message);
6479
6483
  } else acc[key] = { enable: params[key] };
6480
6484
  return acc;
6481
6485
  }, {});
6482
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
+ };
6483
6495
 
6484
6496
  //#endregion
6485
6497
  //#region src/models/ToolRouter.ts
@@ -6529,7 +6541,8 @@ var ToolRouter = class {
6529
6541
  cursor: toolkitOptions.data.nextCursor,
6530
6542
  limit: toolkitOptions.data.limit,
6531
6543
  toolkits: toolkitOptions.data.toolkits,
6532
- is_connected: toolkitOptions.data.isConnected
6544
+ is_connected: toolkitOptions.data.isConnected,
6545
+ search: toolkitOptions.data.search
6533
6546
  });
6534
6547
  return {
6535
6548
  items: result.items.map((item) => {
@@ -6626,6 +6639,7 @@ var ToolRouter = class {
6626
6639
  const routerConfig = ToolRouterCreateSessionConfigSchema.parse(config ?? {});
6627
6640
  const manageConnectedAccounts = typeof routerConfig.manageConnections === "boolean" ? routerConfig.manageConnections : routerConfig.manageConnections?.enable ?? true;
6628
6641
  const toolkits = Array.isArray(routerConfig.toolkits) ? { enable: routerConfig.toolkits } : routerConfig.toolkits;
6642
+ const tags = transformToolRouterTagsParams(routerConfig.tags);
6629
6643
  const tools = transformToolRouterToolsParams(routerConfig.tools);
6630
6644
  const payload = {
6631
6645
  user_id: userId,
@@ -6633,7 +6647,7 @@ var ToolRouter = class {
6633
6647
  auth_configs: routerConfig.authConfigs,
6634
6648
  connected_accounts: routerConfig.connectedAccounts,
6635
6649
  tools,
6636
- tags: routerConfig.tags,
6650
+ tags,
6637
6651
  manage_connections: {
6638
6652
  enable: manageConnectedAccounts,
6639
6653
  callback_url: typeof routerConfig.manageConnections === "object" ? routerConfig.manageConnections.callbackUrl : void 0
@@ -8077,17 +8091,15 @@ exports.ToolRouterConfigManageConnectionsSchema = ToolRouterConfigManageConnecti
8077
8091
  exports.ToolRouterConfigTagsSchema = ToolRouterConfigTagsSchema;
8078
8092
  exports.ToolRouterConfigToolsSchema = ToolRouterConfigToolsSchema;
8079
8093
  exports.ToolRouterCreateSessionConfigSchema = ToolRouterCreateSessionConfigSchema;
8080
- exports.ToolRouterDisabledTagsConfigSchema = ToolRouterDisabledTagsConfigSchema;
8081
- exports.ToolRouterEnabledTagsConfigSchema = ToolRouterEnabledTagsConfigSchema;
8082
8094
  exports.ToolRouterMCPServerConfigSchema = ToolRouterMCPServerConfigSchema;
8083
8095
  exports.ToolRouterManageConnectionsConfigSchema = ToolRouterManageConnectionsConfigSchema;
8096
+ exports.ToolRouterTagsEnableDisableSchema = ToolRouterTagsEnableDisableSchema;
8084
8097
  exports.ToolRouterTagsParamSchema = ToolRouterTagsParamSchema;
8085
8098
  exports.ToolRouterToolkitsDisabledConfigSchema = ToolRouterToolkitsDisabledConfigSchema;
8086
8099
  exports.ToolRouterToolkitsEnabledConfigSchema = ToolRouterToolkitsEnabledConfigSchema;
8087
8100
  exports.ToolRouterToolkitsOptionsSchema = ToolRouterToolkitsOptionsSchema;
8088
8101
  exports.ToolRouterToolkitsParamSchema = ToolRouterToolkitsParamSchema;
8089
8102
  exports.ToolRouterToolsParamSchema = ToolRouterToolsParamSchema;
8090
- exports.ToolRouterToolsTagsParamSchema = ToolRouterToolsTagsParamSchema;
8091
8103
  exports.ToolSchema = ToolSchema;
8092
8104
  exports.ToolkitAuthConfigDetailsSchema = ToolkitAuthConfigDetailsSchema;
8093
8105
  exports.ToolkitAuthFieldSchema = ToolkitAuthFieldSchema;