@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 +39 -27
- package/dist/index.d.cts +145 -84
- package/dist/index.d.mts +145 -84
- package/dist/index.mjs +39 -25
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3467,9 +3467,10 @@ const ToolkitMangedByEnumSchema = z$1.enum([
|
|
|
3467
3467
|
const ToolkitSortByEnumSchema = z$1.enum(["usage", "alphabetically"]);
|
|
3468
3468
|
const ToolkitsListParamsSchema = z$1.object({
|
|
3469
3469
|
category: z$1.string().optional(),
|
|
3470
|
-
isLocal: z$1.boolean().optional(),
|
|
3471
3470
|
managedBy: ToolkitMangedByEnumSchema.optional(),
|
|
3472
|
-
sortBy: ToolkitSortByEnumSchema.optional()
|
|
3471
|
+
sortBy: ToolkitSortByEnumSchema.optional(),
|
|
3472
|
+
cursor: z$1.string().optional(),
|
|
3473
|
+
limit: z$1.number().optional()
|
|
3473
3474
|
});
|
|
3474
3475
|
/**
|
|
3475
3476
|
* Toolkits response
|
|
@@ -4387,9 +4388,10 @@ var Toolkits = class {
|
|
|
4387
4388
|
if (!parsedQuery.success) throw new ValidationError("Failed to parse toolkit list query", { cause: parsedQuery.error });
|
|
4388
4389
|
return transformToolkitListResponse(await this.client.toolkits.list({
|
|
4389
4390
|
category: parsedQuery.data.category,
|
|
4390
|
-
is_local: parsedQuery.data.isLocal,
|
|
4391
4391
|
managed_by: parsedQuery.data.managedBy,
|
|
4392
|
-
sort_by: parsedQuery.data.sortBy
|
|
4392
|
+
sort_by: parsedQuery.data.sortBy,
|
|
4393
|
+
cursor: parsedQuery.data.cursor,
|
|
4394
|
+
limit: parsedQuery.data.limit
|
|
4393
4395
|
}));
|
|
4394
4396
|
} catch (error) {
|
|
4395
4397
|
throw new ComposioToolkitFetchError("Failed to fetch toolkits", { cause: error });
|
|
@@ -6222,7 +6224,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
6222
6224
|
|
|
6223
6225
|
//#endregion
|
|
6224
6226
|
//#region package.json
|
|
6225
|
-
var version = "0.3.
|
|
6227
|
+
var version = "0.3.3";
|
|
6226
6228
|
|
|
6227
6229
|
//#endregion
|
|
6228
6230
|
//#region src/models/Files.ts
|
|
@@ -6312,14 +6314,17 @@ const ToolRouterManageConnectionsConfigSchema = z.object({
|
|
|
6312
6314
|
enable: z.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),
|
|
6313
6315
|
callbackUrl: z.string().optional().describe("The callback url to use in the tool router session")
|
|
6314
6316
|
});
|
|
6315
|
-
const ToolRouterTagsParamSchema = z.array(z.
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6317
|
+
const ToolRouterTagsParamSchema = z.array(z.enum([
|
|
6318
|
+
"readOnlyHint",
|
|
6319
|
+
"destructiveHint",
|
|
6320
|
+
"idempotentHint",
|
|
6321
|
+
"openWorldHint"
|
|
6322
|
+
])).describe("The tags to filter the tools by");
|
|
6323
|
+
const ToolRouterTagsEnableDisableSchema = z.object({
|
|
6324
|
+
enable: ToolRouterTagsParamSchema.optional().describe("The tags to enable in the tool router session"),
|
|
6325
|
+
disable: ToolRouterTagsParamSchema.optional().describe("The tags to disable in the tool router session")
|
|
6326
|
+
}).strict();
|
|
6327
|
+
const ToolRouterConfigTagsSchema = z.union([ToolRouterTagsParamSchema, ToolRouterTagsEnableDisableSchema]).describe("The tags to use in the tool router session");
|
|
6323
6328
|
/**
|
|
6324
6329
|
* Tools config - Configure tools per toolkit using toolkit slug as key
|
|
6325
6330
|
* @example
|
|
@@ -6343,16 +6348,11 @@ const ToolRouterConfigTagsSchema = z.union([
|
|
|
6343
6348
|
* ```
|
|
6344
6349
|
*/
|
|
6345
6350
|
const ToolRouterToolsParamSchema = z.array(z.string()).describe("The tools to use in the tool router session");
|
|
6346
|
-
const ToolRouterToolsTagsParamSchema = z.array(z.enum([
|
|
6347
|
-
"readOnlyHint",
|
|
6348
|
-
"destructiveHint",
|
|
6349
|
-
"idempotentHint"
|
|
6350
|
-
])).describe("The tags to filter the tools by");
|
|
6351
6351
|
const ToolRouterConfigToolsSchema = z.union([
|
|
6352
6352
|
ToolRouterToolsParamSchema,
|
|
6353
6353
|
z.object({ enable: ToolRouterToolsParamSchema.describe("The tools to enable in the tool router session") }).strict(),
|
|
6354
6354
|
z.object({ disable: ToolRouterToolsParamSchema.describe("The tools to disable in the tool router session") }).strict(),
|
|
6355
|
-
z.object({ tags:
|
|
6355
|
+
z.object({ tags: ToolRouterConfigTagsSchema.describe("The tags to filter the tools by, this will override the global tags") }).strict()
|
|
6356
6356
|
]).superRefine((val, ctx) => {
|
|
6357
6357
|
if (typeof val === "object" && !Array.isArray(val)) {
|
|
6358
6358
|
const keys = Object.keys(val);
|
|
@@ -6365,7 +6365,7 @@ const ToolRouterConfigToolsSchema = z.union([
|
|
|
6365
6365
|
});
|
|
6366
6366
|
const ToolRouterCreateSessionConfigSchema = z.object({
|
|
6367
6367
|
tools: z.record(z.string(), z.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional().describe("The tools to use in the tool router session"),
|
|
6368
|
-
tags:
|
|
6368
|
+
tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
|
|
6369
6369
|
toolkits: z.union([
|
|
6370
6370
|
ToolRouterToolkitsParamSchema,
|
|
6371
6371
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
@@ -6411,7 +6411,8 @@ const ToolRouterToolkitsOptionsSchema = z.object({
|
|
|
6411
6411
|
toolkits: z.array(z.string()).optional(),
|
|
6412
6412
|
nextCursor: z.string().optional(),
|
|
6413
6413
|
limit: z.number().optional(),
|
|
6414
|
-
isConnected: z.boolean().optional()
|
|
6414
|
+
isConnected: z.boolean().optional(),
|
|
6415
|
+
search: z.string().optional()
|
|
6415
6416
|
});
|
|
6416
6417
|
|
|
6417
6418
|
//#endregion
|
|
@@ -6427,12 +6428,23 @@ const transformToolRouterToolsParams = (params) => {
|
|
|
6427
6428
|
if (Array.isArray(data)) acc[key] = { enable: data };
|
|
6428
6429
|
else if ("enable" in data) acc[key] = { enable: data.enable };
|
|
6429
6430
|
else if ("disable" in data) acc[key] = { disable: data.disable };
|
|
6430
|
-
else if ("tags" in data)
|
|
6431
|
+
else if ("tags" in data) {
|
|
6432
|
+
const tags = transformToolRouterTagsParams(data.tags);
|
|
6433
|
+
if (tags) acc[key] = { tags };
|
|
6434
|
+
}
|
|
6431
6435
|
} else throw new ValidationError(parsedResult.error.message);
|
|
6432
6436
|
} else acc[key] = { enable: params[key] };
|
|
6433
6437
|
return acc;
|
|
6434
6438
|
}, {});
|
|
6435
6439
|
};
|
|
6440
|
+
const transformToolRouterTagsParams = (params) => {
|
|
6441
|
+
if (!params) return;
|
|
6442
|
+
if (Array.isArray(params)) return { enable: params };
|
|
6443
|
+
else if (typeof params === "object") return {
|
|
6444
|
+
enable: params.enable,
|
|
6445
|
+
disable: params.disable
|
|
6446
|
+
};
|
|
6447
|
+
};
|
|
6436
6448
|
|
|
6437
6449
|
//#endregion
|
|
6438
6450
|
//#region src/models/ToolRouter.ts
|
|
@@ -6482,7 +6494,8 @@ var ToolRouter = class {
|
|
|
6482
6494
|
cursor: toolkitOptions.data.nextCursor,
|
|
6483
6495
|
limit: toolkitOptions.data.limit,
|
|
6484
6496
|
toolkits: toolkitOptions.data.toolkits,
|
|
6485
|
-
is_connected: toolkitOptions.data.isConnected
|
|
6497
|
+
is_connected: toolkitOptions.data.isConnected,
|
|
6498
|
+
search: toolkitOptions.data.search
|
|
6486
6499
|
});
|
|
6487
6500
|
return {
|
|
6488
6501
|
items: result.items.map((item) => {
|
|
@@ -6579,6 +6592,7 @@ var ToolRouter = class {
|
|
|
6579
6592
|
const routerConfig = ToolRouterCreateSessionConfigSchema.parse(config ?? {});
|
|
6580
6593
|
const manageConnectedAccounts = typeof routerConfig.manageConnections === "boolean" ? routerConfig.manageConnections : routerConfig.manageConnections?.enable ?? true;
|
|
6581
6594
|
const toolkits = Array.isArray(routerConfig.toolkits) ? { enable: routerConfig.toolkits } : routerConfig.toolkits;
|
|
6595
|
+
const tags = transformToolRouterTagsParams(routerConfig.tags);
|
|
6582
6596
|
const tools = transformToolRouterToolsParams(routerConfig.tools);
|
|
6583
6597
|
const payload = {
|
|
6584
6598
|
user_id: userId,
|
|
@@ -6586,7 +6600,7 @@ var ToolRouter = class {
|
|
|
6586
6600
|
auth_configs: routerConfig.authConfigs,
|
|
6587
6601
|
connected_accounts: routerConfig.connectedAccounts,
|
|
6588
6602
|
tools,
|
|
6589
|
-
tags
|
|
6603
|
+
tags,
|
|
6590
6604
|
manage_connections: {
|
|
6591
6605
|
enable: manageConnectedAccounts,
|
|
6592
6606
|
callback_url: typeof routerConfig.manageConnections === "object" ? routerConfig.manageConnections.callbackUrl : void 0
|
|
@@ -7901,4 +7915,4 @@ var MCP = class {
|
|
|
7901
7915
|
};
|
|
7902
7916
|
|
|
7903
7917
|
//#endregion
|
|
7904
|
-
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioCustomToolsNotInitializedError, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, DefaultCreateConnectedAccountParamsSchema, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, SDKErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema,
|
|
7918
|
+
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioCustomToolsNotInitializedError, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, DefaultCreateConnectedAccountParamsSchema, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, SDKErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, constants_exports as constants, createConnectionRequest, handleToolExecutionError, jsonSchemaToZodSchema, logger_default as logger, removeNonRequiredProperties };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"zod": "^3.25 || ^4"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@composio/client": "0.1.0-alpha.
|
|
47
|
+
"@composio/client": "0.1.0-alpha.52",
|
|
48
48
|
"@types/json-schema": "^7.0.15",
|
|
49
49
|
"chalk": "^4.1.2",
|
|
50
50
|
"openai": "^5.16.0",
|