@composio/core 0.1.27 → 0.1.28

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
@@ -2240,7 +2240,7 @@ var Tools = class {
2240
2240
  ..."scopes" in queryParams.data ? { scopes: queryParams.data.scopes } : {},
2241
2241
  ..."search" in queryParams.data ? { search: queryParams.data.search } : {}
2242
2242
  };
2243
- logger_default.info(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
2243
+ logger_default.debug(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
2244
2244
  const tools = await this.client.tools.list(filters);
2245
2245
  if (!tools) {
2246
2246
  return [];
@@ -5082,31 +5082,37 @@ var MCP = class {
5082
5082
  return transformMcpGenerateUrlResponse(urlResponse);
5083
5083
  }
5084
5084
  /**
5085
- * Transform MCP URL response into the appropriate format.
5086
- * If the provider has a custom transform method, use it.
5087
- * Otherwise, use the default transformation.
5088
- *
5089
- * @param data - The MCP URL response data (in camelCase)
5090
- * @param serverName - Name of the MCP server
5091
- * @param connectedAccountIds - Optional array of connected account IDs
5092
- * @param userIds - Optional array of user IDs
5093
- * @param toolkits - Optional array of toolkit names
5094
- * @returns Transformed response in appropriate format
5095
- */
5085
+ * Transform MCP URL response into the appropriate format.
5086
+ * If the provider has a custom transform method, use it.
5087
+ * Otherwise, use the default transformation.
5088
+ *
5089
+ * @param data - The MCP URL response data (in camelCase)
5090
+ * @param serverName - Name of the MCP server
5091
+
5092
+ * @returns Transformed response in appropriate format
5093
+ */
5096
5094
  wrapMcpServerResponse(data, serverName, connectedAccountIds, userIds, toolkits) {
5097
5095
  if (this.provider && typeof this.provider.wrapMcpServerResponse === "function") {
5098
- const snakeCaseData = {
5099
- mcp_url: data.mcpUrl,
5100
- ...data.connectedAccountUrls && { connected_account_urls: data.connectedAccountUrls },
5101
- ...data.userIdsUrl && { user_ids_url: data.userIdsUrl }
5102
- };
5103
- const transformed = this.provider.wrapMcpServerResponse(
5104
- snakeCaseData,
5105
- serverName,
5106
- connectedAccountIds,
5107
- userIds,
5108
- toolkits
5109
- );
5096
+ let snakeCaseData;
5097
+ if (data.connectedAccountUrls?.length) {
5098
+ snakeCaseData = data.connectedAccountUrls.map((url, index) => ({
5099
+ name: serverName + "-" + connectedAccountIds?.[index],
5100
+ url
5101
+ }));
5102
+ } else if (data.userIdsUrl?.length) {
5103
+ snakeCaseData = data.userIdsUrl.map((url, index) => ({
5104
+ name: serverName + "-" + userIds?.[index],
5105
+ url
5106
+ }));
5107
+ } else {
5108
+ snakeCaseData = [
5109
+ {
5110
+ name: serverName,
5111
+ url: data.mcpUrl
5112
+ }
5113
+ ];
5114
+ }
5115
+ const transformed = this.provider.wrapMcpServerResponse(snakeCaseData);
5110
5116
  return transformed;
5111
5117
  }
5112
5118
  if (connectedAccountIds?.length && data.connectedAccountUrls) {
@@ -5261,30 +5267,13 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
5261
5267
  * OpenAI uses the standard format by default.
5262
5268
  *
5263
5269
  * @param data - The MCP URL response data
5264
- * @param serverName - Name of the MCP server
5265
- * @param connectedAccountIds - Optional array of connected account IDs
5266
- * @param userIds - Optional array of user IDs
5267
- * @param toolkits - Optional array of toolkit names
5268
5270
  * @returns Standard MCP server response format
5269
5271
  */
5270
- wrapMcpServerResponse(data, serverName, connectedAccountIds, userIds, toolkits) {
5271
- if (connectedAccountIds?.length && data.connected_account_urls) {
5272
- return data.connected_account_urls.map((url, index) => ({
5273
- url: new URL(url),
5274
- name: `${serverName}-${connectedAccountIds[index]}`,
5275
- toolkit: toolkits?.[index]
5276
- }));
5277
- } else if (userIds?.length && data.user_ids_url) {
5278
- return data.user_ids_url.map((url, index) => ({
5279
- url: new URL(url),
5280
- name: `${serverName}-${userIds[index]}`,
5281
- toolkit: toolkits?.[index]
5282
- }));
5283
- }
5284
- return {
5285
- url: new URL(data.mcp_url),
5286
- name: serverName
5287
- };
5272
+ wrapMcpServerResponse(data) {
5273
+ return data.map((item) => ({
5274
+ url: new URL(item.url),
5275
+ name: item.name
5276
+ }));
5288
5277
  }
5289
5278
  /**
5290
5279
  * Wraps a Composio tool in the OpenAI function calling format.
@@ -5675,7 +5664,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
5675
5664
  };
5676
5665
 
5677
5666
  // package.json
5678
- var version = "0.1.27";
5667
+ var version = "0.1.28";
5679
5668
 
5680
5669
  // src/composio.ts
5681
5670
  var Composio = class _Composio {
package/dist/index.d.cts CHANGED
@@ -1510,10 +1510,9 @@ type McpUrlResponseCamelCase = {
1510
1510
  mcpUrl: string;
1511
1511
  };
1512
1512
  type McpUrlResponse = {
1513
- connected_account_urls?: string[];
1514
- user_ids_url?: string[];
1515
- mcp_url: string;
1516
- };
1513
+ name: string;
1514
+ url: string;
1515
+ }[];
1517
1516
  type McpServerCreateResponse<T> = (McpCreateResponse | CustomCreateResponse) & {
1518
1517
  toolkits: string[];
1519
1518
  getServer: (params: MCPGetServerParams) => Promise<T>;
@@ -1818,12 +1817,10 @@ declare abstract class BaseProvider<TMcpResponse = McpServerGetResponse> {
1818
1817
  *
1819
1818
  * @param data - The MCP URL response data
1820
1819
  * @param serverName - Name of the MCP server
1821
- * @param connectedAccountIds - Optional array of connected account IDs
1822
- * @param userIds - Optional array of user IDs
1823
- * @param toolkits - Optional array of toolkit names
1820
+
1824
1821
  * @returns Transformed response in provider-specific format, or undefined to use default transformation
1825
1822
  */
1826
- wrapMcpServerResponse?(data: McpUrlResponse, serverName: string, connectedAccountIds?: string[], userIds?: string[], toolkits?: string[]): TMcpResponse;
1823
+ wrapMcpServerResponse?(data: McpUrlResponse): TMcpResponse;
1827
1824
  }
1828
1825
  /**
1829
1826
  * @public
@@ -39929,9 +39926,7 @@ declare class MCP<T = McpServerGetResponse> {
39929
39926
  *
39930
39927
  * @param data - The MCP URL response data (in camelCase)
39931
39928
  * @param serverName - Name of the MCP server
39932
- * @param connectedAccountIds - Optional array of connected account IDs
39933
- * @param userIds - Optional array of user IDs
39934
- * @param toolkits - Optional array of toolkit names
39929
+
39935
39930
  * @returns Transformed response in appropriate format
39936
39931
  */
39937
39932
  private wrapMcpServerResponse;
@@ -39977,13 +39972,9 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
39977
39972
  * OpenAI uses the standard format by default.
39978
39973
  *
39979
39974
  * @param data - The MCP URL response data
39980
- * @param serverName - Name of the MCP server
39981
- * @param connectedAccountIds - Optional array of connected account IDs
39982
- * @param userIds - Optional array of user IDs
39983
- * @param toolkits - Optional array of toolkit names
39984
39975
  * @returns Standard MCP server response format
39985
39976
  */
39986
- wrapMcpServerResponse(data: McpUrlResponse, serverName: string, connectedAccountIds?: string[], userIds?: string[], toolkits?: string[]): McpServerGetResponse;
39977
+ wrapMcpServerResponse(data: McpUrlResponse): McpServerGetResponse;
39987
39978
  /**
39988
39979
  * Wraps a Composio tool in the OpenAI function calling format.
39989
39980
  *
package/dist/index.d.ts CHANGED
@@ -1510,10 +1510,9 @@ type McpUrlResponseCamelCase = {
1510
1510
  mcpUrl: string;
1511
1511
  };
1512
1512
  type McpUrlResponse = {
1513
- connected_account_urls?: string[];
1514
- user_ids_url?: string[];
1515
- mcp_url: string;
1516
- };
1513
+ name: string;
1514
+ url: string;
1515
+ }[];
1517
1516
  type McpServerCreateResponse<T> = (McpCreateResponse | CustomCreateResponse) & {
1518
1517
  toolkits: string[];
1519
1518
  getServer: (params: MCPGetServerParams) => Promise<T>;
@@ -1818,12 +1817,10 @@ declare abstract class BaseProvider<TMcpResponse = McpServerGetResponse> {
1818
1817
  *
1819
1818
  * @param data - The MCP URL response data
1820
1819
  * @param serverName - Name of the MCP server
1821
- * @param connectedAccountIds - Optional array of connected account IDs
1822
- * @param userIds - Optional array of user IDs
1823
- * @param toolkits - Optional array of toolkit names
1820
+
1824
1821
  * @returns Transformed response in provider-specific format, or undefined to use default transformation
1825
1822
  */
1826
- wrapMcpServerResponse?(data: McpUrlResponse, serverName: string, connectedAccountIds?: string[], userIds?: string[], toolkits?: string[]): TMcpResponse;
1823
+ wrapMcpServerResponse?(data: McpUrlResponse): TMcpResponse;
1827
1824
  }
1828
1825
  /**
1829
1826
  * @public
@@ -39929,9 +39926,7 @@ declare class MCP<T = McpServerGetResponse> {
39929
39926
  *
39930
39927
  * @param data - The MCP URL response data (in camelCase)
39931
39928
  * @param serverName - Name of the MCP server
39932
- * @param connectedAccountIds - Optional array of connected account IDs
39933
- * @param userIds - Optional array of user IDs
39934
- * @param toolkits - Optional array of toolkit names
39929
+
39935
39930
  * @returns Transformed response in appropriate format
39936
39931
  */
39937
39932
  private wrapMcpServerResponse;
@@ -39977,13 +39972,9 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
39977
39972
  * OpenAI uses the standard format by default.
39978
39973
  *
39979
39974
  * @param data - The MCP URL response data
39980
- * @param serverName - Name of the MCP server
39981
- * @param connectedAccountIds - Optional array of connected account IDs
39982
- * @param userIds - Optional array of user IDs
39983
- * @param toolkits - Optional array of toolkit names
39984
39975
  * @returns Standard MCP server response format
39985
39976
  */
39986
- wrapMcpServerResponse(data: McpUrlResponse, serverName: string, connectedAccountIds?: string[], userIds?: string[], toolkits?: string[]): McpServerGetResponse;
39977
+ wrapMcpServerResponse(data: McpUrlResponse): McpServerGetResponse;
39987
39978
  /**
39988
39979
  * Wraps a Composio tool in the OpenAI function calling format.
39989
39980
  *
package/dist/index.js CHANGED
@@ -2093,7 +2093,7 @@ var Tools = class {
2093
2093
  ..."scopes" in queryParams.data ? { scopes: queryParams.data.scopes } : {},
2094
2094
  ..."search" in queryParams.data ? { search: queryParams.data.search } : {}
2095
2095
  };
2096
- logger_default.info(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
2096
+ logger_default.debug(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);
2097
2097
  const tools = await this.client.tools.list(filters);
2098
2098
  if (!tools) {
2099
2099
  return [];
@@ -4935,31 +4935,37 @@ var MCP = class {
4935
4935
  return transformMcpGenerateUrlResponse(urlResponse);
4936
4936
  }
4937
4937
  /**
4938
- * Transform MCP URL response into the appropriate format.
4939
- * If the provider has a custom transform method, use it.
4940
- * Otherwise, use the default transformation.
4941
- *
4942
- * @param data - The MCP URL response data (in camelCase)
4943
- * @param serverName - Name of the MCP server
4944
- * @param connectedAccountIds - Optional array of connected account IDs
4945
- * @param userIds - Optional array of user IDs
4946
- * @param toolkits - Optional array of toolkit names
4947
- * @returns Transformed response in appropriate format
4948
- */
4938
+ * Transform MCP URL response into the appropriate format.
4939
+ * If the provider has a custom transform method, use it.
4940
+ * Otherwise, use the default transformation.
4941
+ *
4942
+ * @param data - The MCP URL response data (in camelCase)
4943
+ * @param serverName - Name of the MCP server
4944
+
4945
+ * @returns Transformed response in appropriate format
4946
+ */
4949
4947
  wrapMcpServerResponse(data, serverName, connectedAccountIds, userIds, toolkits) {
4950
4948
  if (this.provider && typeof this.provider.wrapMcpServerResponse === "function") {
4951
- const snakeCaseData = {
4952
- mcp_url: data.mcpUrl,
4953
- ...data.connectedAccountUrls && { connected_account_urls: data.connectedAccountUrls },
4954
- ...data.userIdsUrl && { user_ids_url: data.userIdsUrl }
4955
- };
4956
- const transformed = this.provider.wrapMcpServerResponse(
4957
- snakeCaseData,
4958
- serverName,
4959
- connectedAccountIds,
4960
- userIds,
4961
- toolkits
4962
- );
4949
+ let snakeCaseData;
4950
+ if (data.connectedAccountUrls?.length) {
4951
+ snakeCaseData = data.connectedAccountUrls.map((url, index) => ({
4952
+ name: serverName + "-" + connectedAccountIds?.[index],
4953
+ url
4954
+ }));
4955
+ } else if (data.userIdsUrl?.length) {
4956
+ snakeCaseData = data.userIdsUrl.map((url, index) => ({
4957
+ name: serverName + "-" + userIds?.[index],
4958
+ url
4959
+ }));
4960
+ } else {
4961
+ snakeCaseData = [
4962
+ {
4963
+ name: serverName,
4964
+ url: data.mcpUrl
4965
+ }
4966
+ ];
4967
+ }
4968
+ const transformed = this.provider.wrapMcpServerResponse(snakeCaseData);
4963
4969
  return transformed;
4964
4970
  }
4965
4971
  if (connectedAccountIds?.length && data.connectedAccountUrls) {
@@ -5114,30 +5120,13 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
5114
5120
  * OpenAI uses the standard format by default.
5115
5121
  *
5116
5122
  * @param data - The MCP URL response data
5117
- * @param serverName - Name of the MCP server
5118
- * @param connectedAccountIds - Optional array of connected account IDs
5119
- * @param userIds - Optional array of user IDs
5120
- * @param toolkits - Optional array of toolkit names
5121
5123
  * @returns Standard MCP server response format
5122
5124
  */
5123
- wrapMcpServerResponse(data, serverName, connectedAccountIds, userIds, toolkits) {
5124
- if (connectedAccountIds?.length && data.connected_account_urls) {
5125
- return data.connected_account_urls.map((url, index) => ({
5126
- url: new URL(url),
5127
- name: `${serverName}-${connectedAccountIds[index]}`,
5128
- toolkit: toolkits?.[index]
5129
- }));
5130
- } else if (userIds?.length && data.user_ids_url) {
5131
- return data.user_ids_url.map((url, index) => ({
5132
- url: new URL(url),
5133
- name: `${serverName}-${userIds[index]}`,
5134
- toolkit: toolkits?.[index]
5135
- }));
5136
- }
5137
- return {
5138
- url: new URL(data.mcp_url),
5139
- name: serverName
5140
- };
5125
+ wrapMcpServerResponse(data) {
5126
+ return data.map((item) => ({
5127
+ url: new URL(item.url),
5128
+ name: item.name
5129
+ }));
5141
5130
  }
5142
5131
  /**
5143
5132
  * Wraps a Composio tool in the OpenAI function calling format.
@@ -5528,7 +5517,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
5528
5517
  };
5529
5518
 
5530
5519
  // package.json
5531
- var version = "0.1.27";
5520
+ var version = "0.1.28";
5532
5521
 
5533
5522
  // src/composio.ts
5534
5523
  var Composio = class _Composio {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composio/core",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",