@composio/core 0.1.32 → 0.1.33
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 +105 -119
- package/dist/index.d.cts +10590 -268
- package/dist/index.d.ts +10590 -268
- package/dist/index.js +90 -115
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -48,12 +48,19 @@ __export(index_exports, {
|
|
|
48
48
|
Composio: () => Composio,
|
|
49
49
|
ComposioAuthConfigNotFoundError: () => ComposioAuthConfigNotFoundError,
|
|
50
50
|
ComposioConnectedAccountNotFoundError: () => ComposioConnectedAccountNotFoundError,
|
|
51
|
+
ComposioCustomCreateResponseSchema: () => ComposioCustomCreateResponseSchema,
|
|
51
52
|
ComposioCustomToolsNotInitializedError: () => ComposioCustomToolsNotInitializedError,
|
|
52
53
|
ComposioError: () => ComposioError,
|
|
54
|
+
ComposioGenerateURLParamsSchema: () => ComposioGenerateURLParamsSchema,
|
|
55
|
+
ComposioGenerateURLResponseSchema: () => ComposioGenerateURLResponseSchema,
|
|
53
56
|
ComposioGlobalExecuteToolFnNotSetError: () => ComposioGlobalExecuteToolFnNotSetError,
|
|
54
57
|
ComposioInvalidExecuteFunctionError: () => ComposioInvalidExecuteFunctionError,
|
|
55
58
|
ComposioInvalidModifierError: () => ComposioInvalidModifierError,
|
|
56
59
|
ComposioLinkConnectionDataSchema: () => ComposioLinkConnectionDataSchema,
|
|
60
|
+
ComposioMcpDeleteResponseSchema: () => ComposioMcpDeleteResponseSchema,
|
|
61
|
+
ComposioMcpListResponseSchema: () => ComposioMcpListResponseSchema,
|
|
62
|
+
ComposioMcpRetrieveResponseSchema: () => ComposioMcpRetrieveResponseSchema,
|
|
63
|
+
ComposioMcpUpdateResponseSchema: () => ComposioMcpUpdateResponseSchema,
|
|
57
64
|
ComposioMultipleConnectedAccountsError: () => ComposioMultipleConnectedAccountsError,
|
|
58
65
|
ComposioNoAPIKeyError: () => ComposioNoAPIKeyError,
|
|
59
66
|
ComposioProvider: () => ComposioProvider,
|
|
@@ -62,7 +69,13 @@ __export(index_exports, {
|
|
|
62
69
|
ComposioToolNotFoundError: () => ComposioToolNotFoundError,
|
|
63
70
|
ComposioToolkitFetchError: () => ComposioToolkitFetchError,
|
|
64
71
|
ComposioToolkitNotFoundError: () => ComposioToolkitNotFoundError,
|
|
72
|
+
ConnectedAccountAuthConfigSchema: () => ConnectedAccountAuthConfigSchema,
|
|
65
73
|
ConnectedAccountErrorCodes: () => ConnectedAccountErrorCodes,
|
|
74
|
+
ConnectedAccountListParamsSchema: () => ConnectedAccountListParamsSchema,
|
|
75
|
+
ConnectedAccountListResponseSchema: () => ConnectedAccountListResponseSchema,
|
|
76
|
+
ConnectedAccountRetrieveResponseSchema: () => ConnectedAccountRetrieveResponseSchema,
|
|
77
|
+
ConnectedAccountStatusSchema: () => ConnectedAccountStatusSchema,
|
|
78
|
+
ConnectedAccountStatuses: () => ConnectedAccountStatuses,
|
|
66
79
|
ConnectionDataSchema: () => ConnectionDataSchema,
|
|
67
80
|
ConnectionRequestErrorCodes: () => ConnectionRequestErrorCodes,
|
|
68
81
|
ConnectionRequestFailedError: () => ConnectionRequestFailedError,
|
|
@@ -71,13 +84,14 @@ __export(index_exports, {
|
|
|
71
84
|
CreateAuthConfigParamsSchema: () => CreateAuthConfigParamsSchema,
|
|
72
85
|
CreateAuthConfigResponseSchema: () => CreateAuthConfigResponseSchema,
|
|
73
86
|
CreateComposioManagedAuthConfigParamsSchema: () => CreateComposioManagedAuthConfigParamsSchema,
|
|
87
|
+
CreateConnectedAccountOptionsSchema: () => CreateConnectedAccountOptionsSchema,
|
|
88
|
+
CreateConnectedAccountParamsSchema: () => CreateConnectedAccountParamsSchema,
|
|
89
|
+
CreateConnectedAccountResponseSchema: () => CreateConnectedAccountResponseSchema,
|
|
74
90
|
CreateCustomAuthConfigParamsSchema: () => CreateCustomAuthConfigParamsSchema,
|
|
75
91
|
CustomAuthParamsSchema: () => CustomAuthParamsSchema,
|
|
76
|
-
CustomCreateResponseCamelCaseSchema: () => CustomCreateResponseCamelCaseSchema,
|
|
77
92
|
CustomCreateResponseSchema: () => CustomCreateResponseSchema,
|
|
93
|
+
DefaultCreateConnectedAccountParamsSchema: () => DefaultCreateConnectedAccountParamsSchema,
|
|
78
94
|
GenerateURLParamsSchema: () => GenerateURLParamsSchema,
|
|
79
|
-
GenerateURLParamsSnakeCaseSchema: () => GenerateURLParamsSnakeCaseSchema,
|
|
80
|
-
GenerateURLResponseCamelCaseSchema: () => GenerateURLResponseCamelCaseSchema,
|
|
81
95
|
GenerateURLResponseSchema: () => GenerateURLResponseSchema,
|
|
82
96
|
IncomingTriggerPayloadSchema: () => IncomingTriggerPayloadSchema,
|
|
83
97
|
JSONSchemaPropertySchema: () => JSONSchemaPropertySchema,
|
|
@@ -94,13 +108,9 @@ __export(index_exports, {
|
|
|
94
108
|
MCPSingleAppServerSchema: () => MCPSingleAppServerSchema,
|
|
95
109
|
MCPToolkitConfigSchema: () => MCPToolkitConfigSchema,
|
|
96
110
|
MCPToolkitConfigsArraySchema: () => MCPToolkitConfigsArraySchema,
|
|
97
|
-
McpDeleteResponseCamelCaseSchema: () => McpDeleteResponseCamelCaseSchema,
|
|
98
111
|
McpDeleteResponseSchema: () => McpDeleteResponseSchema,
|
|
99
|
-
McpListResponseCamelCaseSchema: () => McpListResponseCamelCaseSchema,
|
|
100
112
|
McpListResponseSchema: () => McpListResponseSchema,
|
|
101
|
-
McpRetrieveResponseCamelCaseSchema: () => McpRetrieveResponseCamelCaseSchema,
|
|
102
113
|
McpRetrieveResponseSchema: () => McpRetrieveResponseSchema,
|
|
103
|
-
McpUpdateResponseCamelCaseSchema: () => McpUpdateResponseCamelCaseSchema,
|
|
104
114
|
McpUpdateResponseSchema: () => McpUpdateResponseSchema,
|
|
105
115
|
Oauth1ActiveConnectionDataSchema: () => Oauth1ActiveConnectionDataSchema,
|
|
106
116
|
Oauth1ConnectionDataSchema: () => Oauth1ConnectionDataSchema,
|
|
@@ -152,6 +162,7 @@ __export(index_exports, {
|
|
|
152
162
|
ValidationError: () => ValidationError,
|
|
153
163
|
ValidationErrorCodes: () => ValidationErrorCodes,
|
|
154
164
|
constants: () => constants_exports,
|
|
165
|
+
createConnectionRequest: () => createConnectionRequest,
|
|
155
166
|
jsonSchemaToZodSchema: () => jsonSchemaToZodSchema,
|
|
156
167
|
logger: () => logger_default,
|
|
157
168
|
removeNonRequiredProperties: () => removeNonRequiredProperties
|
|
@@ -3477,58 +3488,27 @@ var AuthConfigs = class {
|
|
|
3477
3488
|
|
|
3478
3489
|
// src/models/ConnectionRequest.ts
|
|
3479
3490
|
var import_client3 = __toESM(require("@composio/client"), 1);
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
this.status = status || ConnectedAccountStatuses.INITIATED;
|
|
3489
|
-
this.redirectUrl = redirectUrl;
|
|
3490
|
-
telemetry.instrument(this);
|
|
3491
|
-
}
|
|
3492
|
-
/**
|
|
3493
|
-
* Waits for the connection request to complete and become active.
|
|
3494
|
-
*
|
|
3495
|
-
* This method continuously polls the Composio API to check the status of the connection request
|
|
3496
|
-
* until it either becomes active, enters a terminal error state, or times out.
|
|
3497
|
-
*
|
|
3498
|
-
* @param {number} [timeout=60000] - Maximum time to wait in milliseconds before timing out (default: 60 seconds)
|
|
3499
|
-
* @returns {Promise<ConnectedAccountRetrieveResponse>} The final connected account response when successful
|
|
3500
|
-
* @throws {ComposioConnectedAccountNotFoundError} If the connected account cannot be found
|
|
3501
|
-
* @throws {ConnectionRequestFailedError} If the connection enters a failed, expired, or deleted state
|
|
3502
|
-
* @throws {ConnectionRequestTimeoutError} If the connection request does not complete within the timeout period
|
|
3503
|
-
*
|
|
3504
|
-
* @example
|
|
3505
|
-
* ```typescript
|
|
3506
|
-
* // Wait for connection with default timeout (60 seconds)
|
|
3507
|
-
* try {
|
|
3508
|
-
* const connection = await connectionRequest.waitForConnection();
|
|
3509
|
-
* console.log('Connection established:', connection.id);
|
|
3510
|
-
* } catch (error) {
|
|
3511
|
-
* console.error('Connection failed:', error.message);
|
|
3512
|
-
* }
|
|
3513
|
-
*
|
|
3514
|
-
* // Wait for connection with custom timeout (2 minutes)
|
|
3515
|
-
* const connection = await connectionRequest.waitForConnection(120000);
|
|
3516
|
-
* ```
|
|
3517
|
-
*/
|
|
3518
|
-
async waitForConnection(timeout = 6e4) {
|
|
3491
|
+
function createConnectionRequest(client, connectedAccountId, status, redirectUrl) {
|
|
3492
|
+
const state = {
|
|
3493
|
+
id: connectedAccountId,
|
|
3494
|
+
status: status || ConnectedAccountStatuses.INITIATED,
|
|
3495
|
+
redirectUrl
|
|
3496
|
+
};
|
|
3497
|
+
telemetry.instrument(state);
|
|
3498
|
+
async function waitForConnection(timeout = 6e4) {
|
|
3519
3499
|
try {
|
|
3520
|
-
const response = await
|
|
3500
|
+
const response = await client.connectedAccounts.retrieve(state.id);
|
|
3521
3501
|
if (response.status === ConnectedAccountStatuses.ACTIVE) {
|
|
3522
|
-
|
|
3502
|
+
state.status = ConnectedAccountStatuses.ACTIVE;
|
|
3523
3503
|
return transformConnectedAccountResponse(response);
|
|
3524
3504
|
}
|
|
3525
3505
|
} catch (error) {
|
|
3526
3506
|
if (error instanceof import_client3.default.NotFoundError) {
|
|
3527
3507
|
throw new ComposioConnectedAccountNotFoundError(
|
|
3528
|
-
`Connected account with id ${
|
|
3508
|
+
`Connected account with id ${state.id} not found`,
|
|
3529
3509
|
{
|
|
3530
3510
|
meta: {
|
|
3531
|
-
connectedAccountId:
|
|
3511
|
+
connectedAccountId: state.id
|
|
3532
3512
|
}
|
|
3533
3513
|
}
|
|
3534
3514
|
);
|
|
@@ -3544,8 +3524,8 @@ var ConnectionRequest = class {
|
|
|
3544
3524
|
const pollInterval = 1e3;
|
|
3545
3525
|
while (Date.now() - start < timeout) {
|
|
3546
3526
|
try {
|
|
3547
|
-
const response = await
|
|
3548
|
-
|
|
3527
|
+
const response = await client.connectedAccounts.retrieve(state.id);
|
|
3528
|
+
state.status = response.status;
|
|
3549
3529
|
if (response.status === ConnectedAccountStatuses.ACTIVE) {
|
|
3550
3530
|
return transformConnectedAccountResponse(response);
|
|
3551
3531
|
}
|
|
@@ -3554,7 +3534,7 @@ var ConnectionRequest = class {
|
|
|
3554
3534
|
`Connection request failed with status: ${response.status}${response.status_reason ? `, reason: ${response.status_reason}` : ""}`,
|
|
3555
3535
|
{
|
|
3556
3536
|
meta: {
|
|
3557
|
-
connectedAccountId:
|
|
3537
|
+
connectedAccountId: state.id,
|
|
3558
3538
|
status: response.status,
|
|
3559
3539
|
statusReason: response.status_reason
|
|
3560
3540
|
}
|
|
@@ -3566,26 +3546,15 @@ var ConnectionRequest = class {
|
|
|
3566
3546
|
throw error;
|
|
3567
3547
|
}
|
|
3568
3548
|
}
|
|
3569
|
-
throw new ConnectionRequestTimeoutError(`Connection request timed out for ${
|
|
3549
|
+
throw new ConnectionRequestTimeoutError(`Connection request timed out for ${state.id}`);
|
|
3570
3550
|
}
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
status: this.status,
|
|
3579
|
-
redirectUrl: this.redirectUrl
|
|
3580
|
-
};
|
|
3581
|
-
}
|
|
3582
|
-
/**
|
|
3583
|
-
* Returns a string representation of the connection request
|
|
3584
|
-
*/
|
|
3585
|
-
toString() {
|
|
3586
|
-
return JSON.stringify(this.toJSON(), null, 2);
|
|
3587
|
-
}
|
|
3588
|
-
};
|
|
3551
|
+
return {
|
|
3552
|
+
...state,
|
|
3553
|
+
waitForConnection,
|
|
3554
|
+
toJSON: () => ({ ...state }),
|
|
3555
|
+
toString: () => JSON.stringify(state, null, 2)
|
|
3556
|
+
};
|
|
3557
|
+
}
|
|
3589
3558
|
|
|
3590
3559
|
// src/models/ConnectedAccounts.ts
|
|
3591
3560
|
var ConnectedAccounts = class {
|
|
@@ -3726,7 +3695,7 @@ var ConnectedAccounts = class {
|
|
|
3726
3695
|
}
|
|
3727
3696
|
});
|
|
3728
3697
|
const redirectUrl = typeof response.connectionData?.val?.redirectUrl === "string" ? response.connectionData.val.redirectUrl : null;
|
|
3729
|
-
return
|
|
3698
|
+
return createConnectionRequest(
|
|
3730
3699
|
this.client,
|
|
3731
3700
|
response.id,
|
|
3732
3701
|
response.connectionData.val.status,
|
|
@@ -3756,7 +3725,7 @@ var ConnectedAccounts = class {
|
|
|
3756
3725
|
* ```
|
|
3757
3726
|
*/
|
|
3758
3727
|
async waitForConnection(connectedAccountId, timeout = 6e4) {
|
|
3759
|
-
const connectionRequest =
|
|
3728
|
+
const connectionRequest = createConnectionRequest(this.client, connectedAccountId);
|
|
3760
3729
|
return connectionRequest.waitForConnection(timeout);
|
|
3761
3730
|
}
|
|
3762
3731
|
/**
|
|
@@ -3881,6 +3850,7 @@ var ConnectedAccounts = class {
|
|
|
3881
3850
|
};
|
|
3882
3851
|
|
|
3883
3852
|
// src/models/Toolkits.ts
|
|
3853
|
+
var import_openai = require("openai");
|
|
3884
3854
|
var Toolkits = class {
|
|
3885
3855
|
client;
|
|
3886
3856
|
constructor(client) {
|
|
@@ -4001,7 +3971,7 @@ var Toolkits = class {
|
|
|
4001
3971
|
}
|
|
4002
3972
|
return parsedResult.data;
|
|
4003
3973
|
} catch (error) {
|
|
4004
|
-
if (error instanceof
|
|
3974
|
+
if (error instanceof import_openai.APIError && (error.status === 404 || error.status === 400)) {
|
|
4005
3975
|
throw new ComposioToolkitNotFoundError(`Toolkit with slug ${slug} not found`, {
|
|
4006
3976
|
meta: {
|
|
4007
3977
|
slug
|
|
@@ -4985,7 +4955,7 @@ var MCPGenerateURLParamsSchema = import_zod10.z.object({
|
|
|
4985
4955
|
connectedAccountIds: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
4986
4956
|
useComposioManagedAuth: import_zod10.z.boolean().optional()
|
|
4987
4957
|
});
|
|
4988
|
-
var
|
|
4958
|
+
var ComposioGenerateURLParamsSchema = import_zod10.z.object({
|
|
4989
4959
|
user_ids: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
4990
4960
|
connected_account_ids: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
4991
4961
|
mcp_server_id: import_zod10.z.string(),
|
|
@@ -4995,14 +4965,14 @@ var GenerateURLParamsSchema = import_zod10.z.object({
|
|
|
4995
4965
|
userIds: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
4996
4966
|
connectedAccountIds: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
4997
4967
|
mcpServerId: import_zod10.z.string(),
|
|
4998
|
-
|
|
4968
|
+
composioManagedAuth: import_zod10.z.boolean().optional()
|
|
4999
4969
|
});
|
|
5000
|
-
var
|
|
4970
|
+
var GenerateURLResponseSchema = import_zod10.z.object({
|
|
5001
4971
|
connectedAccountUrls: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5002
4972
|
userIdsUrl: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5003
4973
|
mcpUrl: import_zod10.z.string().min(1, "MCP URL cannot be empty")
|
|
5004
4974
|
});
|
|
5005
|
-
var
|
|
4975
|
+
var ComposioGenerateURLResponseSchema = import_zod10.z.object({
|
|
5006
4976
|
connected_account_urls: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5007
4977
|
user_ids_url: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5008
4978
|
mcp_url: import_zod10.z.string().min(1, "MCP URL cannot be empty")
|
|
@@ -5037,21 +5007,21 @@ var MCPServerUpdateParamsSchema = import_zod10.z.object({
|
|
|
5037
5007
|
allowedTools: import_zod10.z.array(import_zod10.z.string()).optional().describe("Updated list of allowed tools")
|
|
5038
5008
|
});
|
|
5039
5009
|
var MCPServerCreateResponseSchema = MCPServerSchema;
|
|
5040
|
-
var
|
|
5010
|
+
var CustomCreateResponseSchema = import_zod10.z.object({
|
|
5041
5011
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5042
5012
|
name: import_zod10.z.string().min(1, "Server name cannot be empty"),
|
|
5043
5013
|
createdAt: import_zod10.z.string().nullish(),
|
|
5044
5014
|
updatedAt: import_zod10.z.string().nullish(),
|
|
5045
5015
|
status: import_zod10.z.string().nullish()
|
|
5046
5016
|
});
|
|
5047
|
-
var
|
|
5017
|
+
var ComposioCustomCreateResponseSchema = import_zod10.z.object({
|
|
5048
5018
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5049
5019
|
name: import_zod10.z.string().min(1, "Server name cannot be empty"),
|
|
5050
5020
|
created_at: import_zod10.z.string().nullish(),
|
|
5051
5021
|
updated_at: import_zod10.z.string().nullish(),
|
|
5052
5022
|
status: import_zod10.z.string().nullish()
|
|
5053
5023
|
});
|
|
5054
|
-
var
|
|
5024
|
+
var McpListResponseSchema = import_zod10.z.object({
|
|
5055
5025
|
items: import_zod10.z.array(
|
|
5056
5026
|
import_zod10.z.object({
|
|
5057
5027
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
@@ -5062,7 +5032,7 @@ var McpListResponseCamelCaseSchema = import_zod10.z.object({
|
|
|
5062
5032
|
})
|
|
5063
5033
|
).optional()
|
|
5064
5034
|
});
|
|
5065
|
-
var
|
|
5035
|
+
var ComposioMcpListResponseSchema = import_zod10.z.object({
|
|
5066
5036
|
items: import_zod10.z.array(
|
|
5067
5037
|
import_zod10.z.object({
|
|
5068
5038
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
@@ -5073,7 +5043,7 @@ var McpListResponseSchema = import_zod10.z.object({
|
|
|
5073
5043
|
})
|
|
5074
5044
|
).optional()
|
|
5075
5045
|
});
|
|
5076
|
-
var
|
|
5046
|
+
var McpRetrieveResponseSchema = import_zod10.z.object({
|
|
5077
5047
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5078
5048
|
name: import_zod10.z.string().min(1, "Server name cannot be empty"),
|
|
5079
5049
|
createdAt: import_zod10.z.string().optional(),
|
|
@@ -5083,7 +5053,7 @@ var McpRetrieveResponseCamelCaseSchema = import_zod10.z.object({
|
|
|
5083
5053
|
tools: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5084
5054
|
managedAuthViaComposio: import_zod10.z.boolean().optional()
|
|
5085
5055
|
});
|
|
5086
|
-
var
|
|
5056
|
+
var ComposioMcpRetrieveResponseSchema = import_zod10.z.object({
|
|
5087
5057
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5088
5058
|
name: import_zod10.z.string().min(1, "Server name cannot be empty"),
|
|
5089
5059
|
created_at: import_zod10.z.string().optional(),
|
|
@@ -5093,17 +5063,17 @@ var McpRetrieveResponseSchema = import_zod10.z.object({
|
|
|
5093
5063
|
tools: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5094
5064
|
managed_auth_via_composio: import_zod10.z.boolean().optional()
|
|
5095
5065
|
});
|
|
5096
|
-
var
|
|
5066
|
+
var McpDeleteResponseSchema = import_zod10.z.object({
|
|
5097
5067
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5098
5068
|
deleted: import_zod10.z.boolean().optional(),
|
|
5099
5069
|
message: import_zod10.z.string().optional()
|
|
5100
5070
|
});
|
|
5101
|
-
var
|
|
5071
|
+
var ComposioMcpDeleteResponseSchema = import_zod10.z.object({
|
|
5102
5072
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5103
5073
|
deleted: import_zod10.z.boolean().optional(),
|
|
5104
5074
|
message: import_zod10.z.string().optional()
|
|
5105
5075
|
});
|
|
5106
|
-
var
|
|
5076
|
+
var McpUpdateResponseSchema = import_zod10.z.object({
|
|
5107
5077
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5108
5078
|
name: import_zod10.z.string().min(1, "Server name cannot be empty"),
|
|
5109
5079
|
createdAt: import_zod10.z.string().optional(),
|
|
@@ -5112,7 +5082,7 @@ var McpUpdateResponseCamelCaseSchema = import_zod10.z.object({
|
|
|
5112
5082
|
toolkits: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
5113
5083
|
tools: import_zod10.z.array(import_zod10.z.string()).optional()
|
|
5114
5084
|
});
|
|
5115
|
-
var
|
|
5085
|
+
var ComposioMcpUpdateResponseSchema = import_zod10.z.object({
|
|
5116
5086
|
id: import_zod10.z.string().min(1, "Server ID cannot be empty"),
|
|
5117
5087
|
name: import_zod10.z.string().min(1, "Server name cannot be empty"),
|
|
5118
5088
|
created_at: import_zod10.z.string().optional(),
|
|
@@ -5124,7 +5094,7 @@ var McpUpdateResponseSchema = import_zod10.z.object({
|
|
|
5124
5094
|
|
|
5125
5095
|
// src/utils/transformers/mcp.ts
|
|
5126
5096
|
function transformMcpCreateResponse(response) {
|
|
5127
|
-
const result =
|
|
5097
|
+
const result = CustomCreateResponseSchema.safeParse({
|
|
5128
5098
|
id: response.id,
|
|
5129
5099
|
name: response.name,
|
|
5130
5100
|
createdAt: response.created_at,
|
|
@@ -5146,7 +5116,7 @@ function transformMcpListResponse(response) {
|
|
|
5146
5116
|
updatedAt: item.updated_at,
|
|
5147
5117
|
status: item.status
|
|
5148
5118
|
}));
|
|
5149
|
-
const result =
|
|
5119
|
+
const result = McpListResponseSchema.safeParse({
|
|
5150
5120
|
items: transformedItems
|
|
5151
5121
|
});
|
|
5152
5122
|
if (!result.success) {
|
|
@@ -5157,7 +5127,7 @@ function transformMcpListResponse(response) {
|
|
|
5157
5127
|
return result.data;
|
|
5158
5128
|
}
|
|
5159
5129
|
function transformMcpRetrieveResponse(response) {
|
|
5160
|
-
const result =
|
|
5130
|
+
const result = McpRetrieveResponseSchema.safeParse({
|
|
5161
5131
|
id: response.id,
|
|
5162
5132
|
name: response.name,
|
|
5163
5133
|
createdAt: response.created_at,
|
|
@@ -5175,7 +5145,7 @@ function transformMcpRetrieveResponse(response) {
|
|
|
5175
5145
|
return result.data;
|
|
5176
5146
|
}
|
|
5177
5147
|
function transformMcpDeleteResponse(response) {
|
|
5178
|
-
const result =
|
|
5148
|
+
const result = McpDeleteResponseSchema.safeParse({
|
|
5179
5149
|
id: response.id,
|
|
5180
5150
|
deleted: response.deleted,
|
|
5181
5151
|
message: response.message
|
|
@@ -5188,7 +5158,7 @@ function transformMcpDeleteResponse(response) {
|
|
|
5188
5158
|
return result.data;
|
|
5189
5159
|
}
|
|
5190
5160
|
function transformMcpUpdateResponse(response) {
|
|
5191
|
-
const result =
|
|
5161
|
+
const result = McpUpdateResponseSchema.safeParse({
|
|
5192
5162
|
id: response.id,
|
|
5193
5163
|
name: response.name,
|
|
5194
5164
|
createdAt: response.created_at,
|
|
@@ -5205,7 +5175,7 @@ function transformMcpUpdateResponse(response) {
|
|
|
5205
5175
|
return result.data;
|
|
5206
5176
|
}
|
|
5207
5177
|
function transformMcpGenerateUrlResponse(response) {
|
|
5208
|
-
const result =
|
|
5178
|
+
const result = GenerateURLResponseSchema.safeParse({
|
|
5209
5179
|
connectedAccountUrls: response.connected_account_urls,
|
|
5210
5180
|
userIdsUrl: response.user_ids_url,
|
|
5211
5181
|
mcpUrl: response.mcp_url
|
|
@@ -5299,7 +5269,7 @@ var MCP = class {
|
|
|
5299
5269
|
cause: error
|
|
5300
5270
|
});
|
|
5301
5271
|
}
|
|
5302
|
-
const serverResponseResult =
|
|
5272
|
+
const serverResponseResult = ComposioCustomCreateResponseSchema.safeParse(mcpServerCreatedResponse);
|
|
5303
5273
|
if (serverResponseResult.error) {
|
|
5304
5274
|
throw new ValidationError("Failed to parse MCP server creation response", {
|
|
5305
5275
|
cause: serverResponseResult.error
|
|
@@ -5363,7 +5333,7 @@ var MCP = class {
|
|
|
5363
5333
|
cause: error
|
|
5364
5334
|
});
|
|
5365
5335
|
}
|
|
5366
|
-
const urlResponseResult =
|
|
5336
|
+
const urlResponseResult = ComposioGenerateURLResponseSchema.safeParse(data);
|
|
5367
5337
|
if (urlResponseResult.error) {
|
|
5368
5338
|
throw new ValidationError("Failed to parse MCP URL generation response", {
|
|
5369
5339
|
cause: urlResponseResult.error
|
|
@@ -5419,7 +5389,7 @@ var MCP = class {
|
|
|
5419
5389
|
cause: error
|
|
5420
5390
|
});
|
|
5421
5391
|
}
|
|
5422
|
-
const listResponseResult =
|
|
5392
|
+
const listResponseResult = ComposioMcpListResponseSchema.safeParse(listResponse);
|
|
5423
5393
|
if (listResponseResult.error) {
|
|
5424
5394
|
throw new ValidationError("Failed to parse MCP server list response", {
|
|
5425
5395
|
cause: listResponseResult.error
|
|
@@ -5430,7 +5400,7 @@ var MCP = class {
|
|
|
5430
5400
|
/**
|
|
5431
5401
|
* Get details of a specific MCP server
|
|
5432
5402
|
* @param {string} id - Server UUID
|
|
5433
|
-
* @returns {Promise<
|
|
5403
|
+
* @returns {Promise<McpRetrieveResponse>} Server details
|
|
5434
5404
|
*
|
|
5435
5405
|
* @example
|
|
5436
5406
|
* ```typescript
|
|
@@ -5457,7 +5427,7 @@ var MCP = class {
|
|
|
5457
5427
|
/**
|
|
5458
5428
|
* Delete an MCP server
|
|
5459
5429
|
* @param {string} id - Server UUID
|
|
5460
|
-
* @returns {Promise<
|
|
5430
|
+
* @returns {Promise<McpDeleteResponse>} Deletion response
|
|
5461
5431
|
*
|
|
5462
5432
|
* @example
|
|
5463
5433
|
* ```typescript
|
|
@@ -5473,7 +5443,7 @@ var MCP = class {
|
|
|
5473
5443
|
cause: error
|
|
5474
5444
|
});
|
|
5475
5445
|
}
|
|
5476
|
-
const deleteResponseResult =
|
|
5446
|
+
const deleteResponseResult = ComposioMcpDeleteResponseSchema.safeParse(deleteResponse);
|
|
5477
5447
|
if (deleteResponseResult.error) {
|
|
5478
5448
|
throw new ValidationError("Failed to parse MCP server delete response", {
|
|
5479
5449
|
cause: deleteResponseResult.error
|
|
@@ -5487,7 +5457,7 @@ var MCP = class {
|
|
|
5487
5457
|
* @param {string} name - New unique name for the server
|
|
5488
5458
|
* @param {MCPToolkitConfig[]} toolkitConfigs - Array of toolkit configurations
|
|
5489
5459
|
* @param {MCPAuthOptions} [authOptions] - Updated authentication options
|
|
5490
|
-
* @returns {Promise<
|
|
5460
|
+
* @returns {Promise<McpUpdateResponse>} Updated server details
|
|
5491
5461
|
*
|
|
5492
5462
|
* @example
|
|
5493
5463
|
* ```typescript
|
|
@@ -5523,7 +5493,7 @@ var MCP = class {
|
|
|
5523
5493
|
cause: error
|
|
5524
5494
|
});
|
|
5525
5495
|
}
|
|
5526
|
-
const updateResponseResult =
|
|
5496
|
+
const updateResponseResult = ComposioMcpUpdateResponseSchema.safeParse(updateResponse);
|
|
5527
5497
|
if (updateResponseResult.error) {
|
|
5528
5498
|
throw new ValidationError("Failed to parse MCP server update response", {
|
|
5529
5499
|
cause: updateResponseResult.error
|
|
@@ -5534,20 +5504,20 @@ var MCP = class {
|
|
|
5534
5504
|
/**
|
|
5535
5505
|
* Generate URL for an MCP server
|
|
5536
5506
|
* @param {GenerateURLParams} params - Parameters for URL generation
|
|
5537
|
-
* @returns {Promise<
|
|
5507
|
+
* @returns {Promise<GenerateURLResponse>} Generated URL response
|
|
5538
5508
|
*
|
|
5539
5509
|
* @example
|
|
5540
5510
|
* ```typescript
|
|
5541
5511
|
* const urlResponse = await composio.mcp.generateUrl({
|
|
5542
|
-
*
|
|
5543
|
-
*
|
|
5544
|
-
*
|
|
5545
|
-
*
|
|
5512
|
+
* userIds: ['user123'],
|
|
5513
|
+
* connectedAccountIds: ['account456'],
|
|
5514
|
+
* mcpServerId: 'server-uuid',
|
|
5515
|
+
* composioManagedAuth: true
|
|
5546
5516
|
* });
|
|
5547
5517
|
* ```
|
|
5548
5518
|
*/
|
|
5549
5519
|
async generateUrl(params) {
|
|
5550
|
-
const paramsResult =
|
|
5520
|
+
const paramsResult = GenerateURLParamsSchema.safeParse(params);
|
|
5551
5521
|
if (paramsResult.error) {
|
|
5552
5522
|
throw new ValidationError("Failed to parse generateUrl parameters", {
|
|
5553
5523
|
cause: paramsResult.error
|
|
@@ -5555,13 +5525,18 @@ var MCP = class {
|
|
|
5555
5525
|
}
|
|
5556
5526
|
let urlResponse;
|
|
5557
5527
|
try {
|
|
5558
|
-
urlResponse = await this.client.mcp.generate.url(
|
|
5528
|
+
urlResponse = await this.client.mcp.generate.url({
|
|
5529
|
+
mcp_server_id: params.mcpServerId,
|
|
5530
|
+
user_ids: params.userIds,
|
|
5531
|
+
connected_account_ids: params.connectedAccountIds,
|
|
5532
|
+
managed_auth_by_composio: params.composioManagedAuth
|
|
5533
|
+
});
|
|
5559
5534
|
} catch (error) {
|
|
5560
5535
|
throw new ValidationError("Failed to generate MCP URL", {
|
|
5561
5536
|
cause: error
|
|
5562
5537
|
});
|
|
5563
5538
|
}
|
|
5564
|
-
const responseResult =
|
|
5539
|
+
const responseResult = ComposioGenerateURLResponseSchema.safeParse(urlResponse);
|
|
5565
5540
|
if (responseResult.error) {
|
|
5566
5541
|
throw new ValidationError("Failed to parse MCP URL generation response", {
|
|
5567
5542
|
cause: responseResult.error
|
|
@@ -6160,7 +6135,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
6160
6135
|
};
|
|
6161
6136
|
|
|
6162
6137
|
// package.json
|
|
6163
|
-
var version = "0.1.
|
|
6138
|
+
var version = "0.1.33";
|
|
6164
6139
|
|
|
6165
6140
|
// src/models/Files.ts
|
|
6166
6141
|
var Files = class {
|
|
@@ -6572,12 +6547,19 @@ var AuthScheme = class {
|
|
|
6572
6547
|
Composio,
|
|
6573
6548
|
ComposioAuthConfigNotFoundError,
|
|
6574
6549
|
ComposioConnectedAccountNotFoundError,
|
|
6550
|
+
ComposioCustomCreateResponseSchema,
|
|
6575
6551
|
ComposioCustomToolsNotInitializedError,
|
|
6576
6552
|
ComposioError,
|
|
6553
|
+
ComposioGenerateURLParamsSchema,
|
|
6554
|
+
ComposioGenerateURLResponseSchema,
|
|
6577
6555
|
ComposioGlobalExecuteToolFnNotSetError,
|
|
6578
6556
|
ComposioInvalidExecuteFunctionError,
|
|
6579
6557
|
ComposioInvalidModifierError,
|
|
6580
6558
|
ComposioLinkConnectionDataSchema,
|
|
6559
|
+
ComposioMcpDeleteResponseSchema,
|
|
6560
|
+
ComposioMcpListResponseSchema,
|
|
6561
|
+
ComposioMcpRetrieveResponseSchema,
|
|
6562
|
+
ComposioMcpUpdateResponseSchema,
|
|
6581
6563
|
ComposioMultipleConnectedAccountsError,
|
|
6582
6564
|
ComposioNoAPIKeyError,
|
|
6583
6565
|
ComposioProvider,
|
|
@@ -6586,7 +6568,13 @@ var AuthScheme = class {
|
|
|
6586
6568
|
ComposioToolNotFoundError,
|
|
6587
6569
|
ComposioToolkitFetchError,
|
|
6588
6570
|
ComposioToolkitNotFoundError,
|
|
6571
|
+
ConnectedAccountAuthConfigSchema,
|
|
6589
6572
|
ConnectedAccountErrorCodes,
|
|
6573
|
+
ConnectedAccountListParamsSchema,
|
|
6574
|
+
ConnectedAccountListResponseSchema,
|
|
6575
|
+
ConnectedAccountRetrieveResponseSchema,
|
|
6576
|
+
ConnectedAccountStatusSchema,
|
|
6577
|
+
ConnectedAccountStatuses,
|
|
6590
6578
|
ConnectionDataSchema,
|
|
6591
6579
|
ConnectionRequestErrorCodes,
|
|
6592
6580
|
ConnectionRequestFailedError,
|
|
@@ -6595,13 +6583,14 @@ var AuthScheme = class {
|
|
|
6595
6583
|
CreateAuthConfigParamsSchema,
|
|
6596
6584
|
CreateAuthConfigResponseSchema,
|
|
6597
6585
|
CreateComposioManagedAuthConfigParamsSchema,
|
|
6586
|
+
CreateConnectedAccountOptionsSchema,
|
|
6587
|
+
CreateConnectedAccountParamsSchema,
|
|
6588
|
+
CreateConnectedAccountResponseSchema,
|
|
6598
6589
|
CreateCustomAuthConfigParamsSchema,
|
|
6599
6590
|
CustomAuthParamsSchema,
|
|
6600
|
-
CustomCreateResponseCamelCaseSchema,
|
|
6601
6591
|
CustomCreateResponseSchema,
|
|
6592
|
+
DefaultCreateConnectedAccountParamsSchema,
|
|
6602
6593
|
GenerateURLParamsSchema,
|
|
6603
|
-
GenerateURLParamsSnakeCaseSchema,
|
|
6604
|
-
GenerateURLResponseCamelCaseSchema,
|
|
6605
6594
|
GenerateURLResponseSchema,
|
|
6606
6595
|
IncomingTriggerPayloadSchema,
|
|
6607
6596
|
JSONSchemaPropertySchema,
|
|
@@ -6618,13 +6607,9 @@ var AuthScheme = class {
|
|
|
6618
6607
|
MCPSingleAppServerSchema,
|
|
6619
6608
|
MCPToolkitConfigSchema,
|
|
6620
6609
|
MCPToolkitConfigsArraySchema,
|
|
6621
|
-
McpDeleteResponseCamelCaseSchema,
|
|
6622
6610
|
McpDeleteResponseSchema,
|
|
6623
|
-
McpListResponseCamelCaseSchema,
|
|
6624
6611
|
McpListResponseSchema,
|
|
6625
|
-
McpRetrieveResponseCamelCaseSchema,
|
|
6626
6612
|
McpRetrieveResponseSchema,
|
|
6627
|
-
McpUpdateResponseCamelCaseSchema,
|
|
6628
6613
|
McpUpdateResponseSchema,
|
|
6629
6614
|
Oauth1ActiveConnectionDataSchema,
|
|
6630
6615
|
Oauth1ConnectionDataSchema,
|
|
@@ -6676,6 +6661,7 @@ var AuthScheme = class {
|
|
|
6676
6661
|
ValidationError,
|
|
6677
6662
|
ValidationErrorCodes,
|
|
6678
6663
|
constants,
|
|
6664
|
+
createConnectionRequest,
|
|
6679
6665
|
jsonSchemaToZodSchema,
|
|
6680
6666
|
logger,
|
|
6681
6667
|
removeNonRequiredProperties
|