@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.mjs
CHANGED
|
@@ -6224,7 +6224,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
6224
6224
|
|
|
6225
6225
|
//#endregion
|
|
6226
6226
|
//#region package.json
|
|
6227
|
-
var version = "0.3.
|
|
6227
|
+
var version = "0.3.3";
|
|
6228
6228
|
|
|
6229
6229
|
//#endregion
|
|
6230
6230
|
//#region src/models/Files.ts
|
|
@@ -6314,14 +6314,17 @@ const ToolRouterManageConnectionsConfigSchema = z.object({
|
|
|
6314
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),
|
|
6315
6315
|
callbackUrl: z.string().optional().describe("The callback url to use in the tool router session")
|
|
6316
6316
|
});
|
|
6317
|
-
const ToolRouterTagsParamSchema = z.array(z.
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
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");
|
|
6325
6328
|
/**
|
|
6326
6329
|
* Tools config - Configure tools per toolkit using toolkit slug as key
|
|
6327
6330
|
* @example
|
|
@@ -6345,17 +6348,11 @@ const ToolRouterConfigTagsSchema = z.union([
|
|
|
6345
6348
|
* ```
|
|
6346
6349
|
*/
|
|
6347
6350
|
const ToolRouterToolsParamSchema = z.array(z.string()).describe("The tools to use in the tool router session");
|
|
6348
|
-
const ToolRouterToolsTagsParamSchema = z.array(z.enum([
|
|
6349
|
-
"readOnlyHint",
|
|
6350
|
-
"destructiveHint",
|
|
6351
|
-
"idempotentHint",
|
|
6352
|
-
"openWorldHint"
|
|
6353
|
-
])).describe("The tags to filter the tools by");
|
|
6354
6351
|
const ToolRouterConfigToolsSchema = z.union([
|
|
6355
6352
|
ToolRouterToolsParamSchema,
|
|
6356
6353
|
z.object({ enable: ToolRouterToolsParamSchema.describe("The tools to enable in the tool router session") }).strict(),
|
|
6357
6354
|
z.object({ disable: ToolRouterToolsParamSchema.describe("The tools to disable in the tool router session") }).strict(),
|
|
6358
|
-
z.object({ tags:
|
|
6355
|
+
z.object({ tags: ToolRouterConfigTagsSchema.describe("The tags to filter the tools by, this will override the global tags") }).strict()
|
|
6359
6356
|
]).superRefine((val, ctx) => {
|
|
6360
6357
|
if (typeof val === "object" && !Array.isArray(val)) {
|
|
6361
6358
|
const keys = Object.keys(val);
|
|
@@ -6368,7 +6365,7 @@ const ToolRouterConfigToolsSchema = z.union([
|
|
|
6368
6365
|
});
|
|
6369
6366
|
const ToolRouterCreateSessionConfigSchema = z.object({
|
|
6370
6367
|
tools: z.record(z.string(), z.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional().describe("The tools to use in the tool router session"),
|
|
6371
|
-
tags:
|
|
6368
|
+
tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
|
|
6372
6369
|
toolkits: z.union([
|
|
6373
6370
|
ToolRouterToolkitsParamSchema,
|
|
6374
6371
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
@@ -6414,7 +6411,8 @@ const ToolRouterToolkitsOptionsSchema = z.object({
|
|
|
6414
6411
|
toolkits: z.array(z.string()).optional(),
|
|
6415
6412
|
nextCursor: z.string().optional(),
|
|
6416
6413
|
limit: z.number().optional(),
|
|
6417
|
-
isConnected: z.boolean().optional()
|
|
6414
|
+
isConnected: z.boolean().optional(),
|
|
6415
|
+
search: z.string().optional()
|
|
6418
6416
|
});
|
|
6419
6417
|
|
|
6420
6418
|
//#endregion
|
|
@@ -6430,12 +6428,23 @@ const transformToolRouterToolsParams = (params) => {
|
|
|
6430
6428
|
if (Array.isArray(data)) acc[key] = { enable: data };
|
|
6431
6429
|
else if ("enable" in data) acc[key] = { enable: data.enable };
|
|
6432
6430
|
else if ("disable" in data) acc[key] = { disable: data.disable };
|
|
6433
|
-
else if ("tags" in data)
|
|
6431
|
+
else if ("tags" in data) {
|
|
6432
|
+
const tags = transformToolRouterTagsParams(data.tags);
|
|
6433
|
+
if (tags) acc[key] = { tags };
|
|
6434
|
+
}
|
|
6434
6435
|
} else throw new ValidationError(parsedResult.error.message);
|
|
6435
6436
|
} else acc[key] = { enable: params[key] };
|
|
6436
6437
|
return acc;
|
|
6437
6438
|
}, {});
|
|
6438
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
|
+
};
|
|
6439
6448
|
|
|
6440
6449
|
//#endregion
|
|
6441
6450
|
//#region src/models/ToolRouter.ts
|
|
@@ -6485,7 +6494,8 @@ var ToolRouter = class {
|
|
|
6485
6494
|
cursor: toolkitOptions.data.nextCursor,
|
|
6486
6495
|
limit: toolkitOptions.data.limit,
|
|
6487
6496
|
toolkits: toolkitOptions.data.toolkits,
|
|
6488
|
-
is_connected: toolkitOptions.data.isConnected
|
|
6497
|
+
is_connected: toolkitOptions.data.isConnected,
|
|
6498
|
+
search: toolkitOptions.data.search
|
|
6489
6499
|
});
|
|
6490
6500
|
return {
|
|
6491
6501
|
items: result.items.map((item) => {
|
|
@@ -6582,6 +6592,7 @@ var ToolRouter = class {
|
|
|
6582
6592
|
const routerConfig = ToolRouterCreateSessionConfigSchema.parse(config ?? {});
|
|
6583
6593
|
const manageConnectedAccounts = typeof routerConfig.manageConnections === "boolean" ? routerConfig.manageConnections : routerConfig.manageConnections?.enable ?? true;
|
|
6584
6594
|
const toolkits = Array.isArray(routerConfig.toolkits) ? { enable: routerConfig.toolkits } : routerConfig.toolkits;
|
|
6595
|
+
const tags = transformToolRouterTagsParams(routerConfig.tags);
|
|
6585
6596
|
const tools = transformToolRouterToolsParams(routerConfig.tools);
|
|
6586
6597
|
const payload = {
|
|
6587
6598
|
user_id: userId,
|
|
@@ -6589,7 +6600,7 @@ var ToolRouter = class {
|
|
|
6589
6600
|
auth_configs: routerConfig.authConfigs,
|
|
6590
6601
|
connected_accounts: routerConfig.connectedAccounts,
|
|
6591
6602
|
tools,
|
|
6592
|
-
tags
|
|
6603
|
+
tags,
|
|
6593
6604
|
manage_connections: {
|
|
6594
6605
|
enable: manageConnectedAccounts,
|
|
6595
6606
|
callback_url: typeof routerConfig.manageConnections === "object" ? routerConfig.manageConnections.callbackUrl : void 0
|
|
@@ -7904,4 +7915,4 @@ var MCP = class {
|
|
|
7904
7915
|
};
|
|
7905
7916
|
|
|
7906
7917
|
//#endregion
|
|
7907
|
-
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",
|