@composio/core 0.1.12-alpha.14 → 0.1.12-alpha.16

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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import ComposioClient from '@composio/client';
2
- import { z, ZodObject, ZodString, ZodNumber, ZodBoolean, ZodOptional } from 'zod';
3
- import { ToolProxyParams, ToolProxyResponse, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse } from '@composio/client/resources/tools';
2
+ import { z } from 'zod';
3
+ import { ToolProxyParams, ToolExecuteResponse as ToolExecuteResponse$1, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse, ToolProxyResponse } from '@composio/client/resources/tools';
4
4
  import { TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
5
5
  import { AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
6
6
  import { ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountListResponse as ConnectedAccountListResponse$1, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
@@ -343,20 +343,22 @@ declare const ToolExecuteResponseSchema: z.ZodObject<{
343
343
  }>;
344
344
  type ToolExecuteResponse = z.infer<typeof ToolExecuteResponseSchema>;
345
345
 
346
- type CustomToolInputParameter = ZodObject<{
347
- [key: string]: ZodString | ZodNumber | ZodBoolean | ZodOptional<ZodString | ZodNumber | ZodBoolean>;
348
- }>;
349
- type CustomToolInput<T extends CustomToolInputParameter> = {
350
- [K in keyof z.infer<T>]: z.infer<T>[K];
351
- };
352
- interface CustomToolOptions<T extends CustomToolInputParameter = CustomToolInputParameter> {
353
- slug: string;
346
+ type BaseCustomToolOptions<T extends z.ZodType> = {
354
347
  name: string;
355
- toolkitSlug?: string | null;
356
348
  description?: string;
349
+ slug: string;
357
350
  inputParams: T;
358
- execute: (input: CustomToolInput<T>, authCredentials?: Record<string, unknown>, executeAppRequest?: (data: ToolProxyParams) => Promise<ToolProxyResponse>) => Promise<ToolExecuteResponse>;
359
- }
351
+ };
352
+ type ToolkitBasedExecute<T extends z.ZodType> = {
353
+ execute: (input: z.infer<T>, authCredentials: Record<string, unknown>, executeToolRequest: (data: ToolProxyParams) => Promise<ToolExecuteResponse$1>) => Promise<ToolExecuteResponse$1>;
354
+ toolkitSlug: string;
355
+ };
356
+ type StandaloneExecute<T extends z.ZodType> = {
357
+ execute: (input: z.infer<T>) => Promise<ToolExecuteResponse$1>;
358
+ toolkitSlug?: never;
359
+ };
360
+ type CustomToolOptions<T extends z.ZodType> = BaseCustomToolOptions<T> & (ToolkitBasedExecute<T> | StandaloneExecute<T>);
361
+ type CustomToolInputParameter = z.ZodType;
360
362
  interface ExecuteMetadata {
361
363
  userId: string;
362
364
  connectedAccountId?: string;
@@ -973,9 +975,16 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
973
975
  /**
974
976
  * Fetches the list of all available tools in the Composio SDK.
975
977
  *
976
- * This method is mostly used by the CLI to get the list of tools.
978
+ * This method is mostly used by the CLI to get the list of tools.
977
979
  * No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
978
- * @returns {string} - The list of all available tools as a string
980
+ * @returns {Promise<ToolRetrieveEnumResponse>} The complete list of all available tools with their metadata
981
+ *
982
+ * @example
983
+ * ```typescript
984
+ * // Get all available tools as an enum
985
+ * const toolsEnum = await composio.tools.getToolsEnum();
986
+ * console.log(toolsEnum.items);
987
+ * ```
979
988
  */
980
989
  getToolsEnum(): Promise<ToolRetrieveEnumResponse>;
981
990
  /**
@@ -985,13 +994,40 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
985
994
  *
986
995
  * @param {string} slug - The ID of the tool to find input for
987
996
  * @param {ToolGetInputParams} body - The parameters to be passed to the tool
988
- * @returns
997
+ * @returns {Promise<ToolGetInputResponse>} The input parameters schema for the specified tool
998
+ *
999
+ * @example
1000
+ * ```typescript
1001
+ * // Get input parameters for a specific tool
1002
+ * const inputParams = await composio.tools.getInput('GITHUB_CREATE_ISSUE', {
1003
+ * userId: 'default'
1004
+ * });
1005
+ * console.log(inputParams.schema);
1006
+ * ```
989
1007
  */
990
1008
  getInput(slug: string, body: ToolGetInputParams): Promise<ToolGetInputResponse>;
991
1009
  /**
992
- * Proxies a custom request to a toolkit/integration
993
- * @param body
994
- * @returns
1010
+ * Proxies a custom request to a toolkit/integration.
1011
+ *
1012
+ * This method allows sending custom requests to a specific toolkit or integration
1013
+ * when you need more flexibility than the standard tool execution methods provide.
1014
+ *
1015
+ * @param {ToolProxyParams} body - The parameters for the proxy request including toolkit slug and custom data
1016
+ * @returns {Promise<ToolProxyResponse>} The response from the proxied request
1017
+ *
1018
+ * @example
1019
+ * ```typescript
1020
+ * // Send a custom request to a toolkit
1021
+ * const response = await composio.tools.proxyExecute({
1022
+ * toolkitSlug: 'github',
1023
+ * userId: 'default',
1024
+ * data: {
1025
+ * endpoint: '/repos/owner/repo/issues',
1026
+ * method: 'GET'
1027
+ * }
1028
+ * });
1029
+ * console.log(response.data);
1030
+ * ```
995
1031
  */
996
1032
  proxyExecute(body: ToolProxyParams): Promise<ToolProxyResponse>;
997
1033
  /**
@@ -1005,31 +1041,41 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
1005
1041
  *
1006
1042
  * @example
1007
1043
  * ```typescript
1008
- * const customTool = await composio.tools.createCustomTool({
1044
+ * // creating a custom tool with a toolkit
1045
+ * await composio.tools.createCustomTool({
1009
1046
  * name: 'My Custom Tool',
1010
1047
  * description: 'A custom tool that does something specific',
1011
1048
  * slug: 'MY_CUSTOM_TOOL',
1012
- * inputParameters: {
1013
- * param1: {
1014
- * type: 'string',
1015
- * description: 'First parameter',
1016
- * required: true
1017
- * }
1018
- * },
1019
- * outputParameters: {
1020
- * result: {
1021
- * type: 'string',
1022
- * description: 'The result of the operation'
1023
- * }
1024
- * },
1025
- * handler: async (params, context) => {
1049
+ * userId: 'default',
1050
+ * connectedAccountId: '123',
1051
+ * toolkitSlug: 'github',
1052
+ * inputParameters: z.object({
1053
+ * param1: z.string().describe('First parameter'),
1054
+ * }),
1055
+ * execute: async (input, authCredentials, executeToolRequest) => {
1026
1056
  * // Custom logic here
1027
1057
  * return { data: { result: 'Success!' } };
1028
1058
  * }
1029
1059
  * });
1030
1060
  * ```
1061
+ *
1062
+ * @example
1063
+ * ```typescript
1064
+ * // creating a custom tool without a toolkit
1065
+ * await composio.tools.createCustomTool({
1066
+ * name: 'My Custom Tool',
1067
+ * description: 'A custom tool that does something specific',
1068
+ * slug: 'MY_CUSTOM_TOOL',
1069
+ * inputParameters: z.object({
1070
+ * param1: z.string().describe('First parameter'),
1071
+ * }),
1072
+ * execute: async (input) => {
1073
+ * // Custom logic here
1074
+ * return { data: { result: 'Success!' } };
1075
+ * }
1076
+ * });
1031
1077
  */
1032
- createCustomTool(body: CustomToolOptions): Promise<Tool>;
1078
+ createCustomTool<T extends CustomToolInputParameter>(body: CustomToolOptions<T>): Promise<Tool>;
1033
1079
  }
1034
1080
 
1035
1081
  declare const ToolkitsListParamsSchema: z.ZodObject<{
@@ -1074,27 +1120,27 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
1074
1120
  }, "strip", z.ZodTypeAny, {
1075
1121
  logo?: string | undefined;
1076
1122
  description?: string | undefined;
1123
+ createdAt?: string | undefined;
1124
+ updatedAt?: string | undefined;
1077
1125
  categories?: {
1078
1126
  slug: string;
1079
1127
  name: string;
1080
1128
  }[] | undefined;
1081
1129
  appUrl?: string | undefined;
1082
- createdAt?: string | undefined;
1083
1130
  toolsCount?: number | undefined;
1084
1131
  triggersCount?: number | undefined;
1085
- updatedAt?: string | undefined;
1086
1132
  }, {
1087
1133
  logo?: string | undefined;
1088
1134
  description?: string | undefined;
1135
+ createdAt?: string | undefined;
1136
+ updatedAt?: string | undefined;
1089
1137
  categories?: {
1090
1138
  slug: string;
1091
1139
  name: string;
1092
1140
  }[] | undefined;
1093
1141
  appUrl?: string | undefined;
1094
- createdAt?: string | undefined;
1095
1142
  toolsCount?: number | undefined;
1096
1143
  triggersCount?: number | undefined;
1097
- updatedAt?: string | undefined;
1098
1144
  }>;
1099
1145
  isLocalToolkit: z.ZodBoolean;
1100
1146
  authSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1106,15 +1152,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
1106
1152
  meta: {
1107
1153
  logo?: string | undefined;
1108
1154
  description?: string | undefined;
1155
+ createdAt?: string | undefined;
1156
+ updatedAt?: string | undefined;
1109
1157
  categories?: {
1110
1158
  slug: string;
1111
1159
  name: string;
1112
1160
  }[] | undefined;
1113
1161
  appUrl?: string | undefined;
1114
- createdAt?: string | undefined;
1115
1162
  toolsCount?: number | undefined;
1116
1163
  triggersCount?: number | undefined;
1117
- updatedAt?: string | undefined;
1118
1164
  };
1119
1165
  isLocalToolkit: boolean;
1120
1166
  authSchemes?: string[] | undefined;
@@ -1126,15 +1172,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
1126
1172
  meta: {
1127
1173
  logo?: string | undefined;
1128
1174
  description?: string | undefined;
1175
+ createdAt?: string | undefined;
1176
+ updatedAt?: string | undefined;
1129
1177
  categories?: {
1130
1178
  slug: string;
1131
1179
  name: string;
1132
1180
  }[] | undefined;
1133
1181
  appUrl?: string | undefined;
1134
- createdAt?: string | undefined;
1135
1182
  toolsCount?: number | undefined;
1136
1183
  triggersCount?: number | undefined;
1137
- updatedAt?: string | undefined;
1138
1184
  };
1139
1185
  isLocalToolkit: boolean;
1140
1186
  authSchemes?: string[] | undefined;
@@ -1150,15 +1196,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
1150
1196
  meta: {
1151
1197
  logo?: string | undefined;
1152
1198
  description?: string | undefined;
1199
+ createdAt?: string | undefined;
1200
+ updatedAt?: string | undefined;
1153
1201
  categories?: {
1154
1202
  slug: string;
1155
1203
  name: string;
1156
1204
  }[] | undefined;
1157
1205
  appUrl?: string | undefined;
1158
- createdAt?: string | undefined;
1159
1206
  toolsCount?: number | undefined;
1160
1207
  triggersCount?: number | undefined;
1161
- updatedAt?: string | undefined;
1162
1208
  };
1163
1209
  isLocalToolkit: boolean;
1164
1210
  authSchemes?: string[] | undefined;
@@ -1174,15 +1220,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
1174
1220
  meta: {
1175
1221
  logo?: string | undefined;
1176
1222
  description?: string | undefined;
1223
+ createdAt?: string | undefined;
1224
+ updatedAt?: string | undefined;
1177
1225
  categories?: {
1178
1226
  slug: string;
1179
1227
  name: string;
1180
1228
  }[] | undefined;
1181
1229
  appUrl?: string | undefined;
1182
- createdAt?: string | undefined;
1183
1230
  toolsCount?: number | undefined;
1184
1231
  triggersCount?: number | undefined;
1185
- updatedAt?: string | undefined;
1186
1232
  };
1187
1233
  isLocalToolkit: boolean;
1188
1234
  authSchemes?: string[] | undefined;
@@ -1217,27 +1263,27 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
1217
1263
  }, "strip", z.ZodTypeAny, {
1218
1264
  logo?: string | undefined;
1219
1265
  description?: string | undefined;
1266
+ createdAt?: string | undefined;
1267
+ updatedAt?: string | undefined;
1220
1268
  categories?: {
1221
1269
  slug: string;
1222
1270
  name: string;
1223
1271
  }[] | undefined;
1224
1272
  appUrl?: string | undefined;
1225
- createdAt?: string | undefined;
1226
1273
  toolsCount?: number | undefined;
1227
1274
  triggersCount?: number | undefined;
1228
- updatedAt?: string | undefined;
1229
1275
  }, {
1230
1276
  logo?: string | undefined;
1231
1277
  description?: string | undefined;
1278
+ createdAt?: string | undefined;
1279
+ updatedAt?: string | undefined;
1232
1280
  categories?: {
1233
1281
  slug: string;
1234
1282
  name: string;
1235
1283
  }[] | undefined;
1236
1284
  appUrl?: string | undefined;
1237
- createdAt?: string | undefined;
1238
1285
  toolsCount?: number | undefined;
1239
1286
  triggersCount?: number | undefined;
1240
- updatedAt?: string | undefined;
1241
1287
  }>;
1242
1288
  isLocalToolkit: z.ZodBoolean;
1243
1289
  composioManagedAuthSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1510,15 +1556,15 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
1510
1556
  meta: {
1511
1557
  logo?: string | undefined;
1512
1558
  description?: string | undefined;
1559
+ createdAt?: string | undefined;
1560
+ updatedAt?: string | undefined;
1513
1561
  categories?: {
1514
1562
  slug: string;
1515
1563
  name: string;
1516
1564
  }[] | undefined;
1517
1565
  appUrl?: string | undefined;
1518
- createdAt?: string | undefined;
1519
1566
  toolsCount?: number | undefined;
1520
1567
  triggersCount?: number | undefined;
1521
- updatedAt?: string | undefined;
1522
1568
  };
1523
1569
  isLocalToolkit: boolean;
1524
1570
  composioManagedAuthSchemes?: string[] | undefined;
@@ -1565,15 +1611,15 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
1565
1611
  meta: {
1566
1612
  logo?: string | undefined;
1567
1613
  description?: string | undefined;
1614
+ createdAt?: string | undefined;
1615
+ updatedAt?: string | undefined;
1568
1616
  categories?: {
1569
1617
  slug: string;
1570
1618
  name: string;
1571
1619
  }[] | undefined;
1572
1620
  appUrl?: string | undefined;
1573
- createdAt?: string | undefined;
1574
1621
  toolsCount?: number | undefined;
1575
1622
  triggersCount?: number | undefined;
1576
- updatedAt?: string | undefined;
1577
1623
  };
1578
1624
  isLocalToolkit: boolean;
1579
1625
  composioManagedAuthSchemes?: string[] | undefined;
@@ -1678,12 +1724,12 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1678
1724
  isDisabled: z.ZodBoolean;
1679
1725
  }, "strip", z.ZodTypeAny, {
1680
1726
  id: string;
1681
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1727
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1682
1728
  isComposioManaged: boolean;
1683
1729
  isDisabled: boolean;
1684
1730
  }, {
1685
1731
  id: string;
1686
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1732
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1687
1733
  isComposioManaged: boolean;
1688
1734
  isDisabled: boolean;
1689
1735
  }>;
@@ -1710,17 +1756,17 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1710
1756
  };
1711
1757
  userId: string;
1712
1758
  data: Record<string, unknown>;
1713
- createdAt: string;
1714
- updatedAt: string;
1715
- id: string;
1716
1759
  authConfig: {
1717
1760
  id: string;
1718
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1761
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1719
1762
  isComposioManaged: boolean;
1720
1763
  isDisabled: boolean;
1721
1764
  };
1765
+ id: string;
1722
1766
  isDisabled: boolean;
1723
1767
  statusReason: string | null;
1768
+ createdAt: string;
1769
+ updatedAt: string;
1724
1770
  params?: Record<string, unknown> | undefined;
1725
1771
  testRequestEndpoint?: string | undefined;
1726
1772
  }, {
@@ -1730,17 +1776,17 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1730
1776
  };
1731
1777
  userId: string;
1732
1778
  data: Record<string, unknown>;
1733
- createdAt: string;
1734
- updatedAt: string;
1735
- id: string;
1736
1779
  authConfig: {
1737
1780
  id: string;
1738
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1781
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1739
1782
  isComposioManaged: boolean;
1740
1783
  isDisabled: boolean;
1741
1784
  };
1785
+ id: string;
1742
1786
  isDisabled: boolean;
1743
1787
  statusReason: string | null;
1788
+ createdAt: string;
1789
+ updatedAt: string;
1744
1790
  params?: Record<string, unknown> | undefined;
1745
1791
  testRequestEndpoint?: string | undefined;
1746
1792
  }>;
@@ -1784,12 +1830,12 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1784
1830
  isDisabled: z.ZodBoolean;
1785
1831
  }, "strip", z.ZodTypeAny, {
1786
1832
  id: string;
1787
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1833
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1788
1834
  isComposioManaged: boolean;
1789
1835
  isDisabled: boolean;
1790
1836
  }, {
1791
1837
  id: string;
1792
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1838
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1793
1839
  isComposioManaged: boolean;
1794
1840
  isDisabled: boolean;
1795
1841
  }>;
@@ -1816,17 +1862,17 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1816
1862
  };
1817
1863
  userId: string;
1818
1864
  data: Record<string, unknown>;
1819
- createdAt: string;
1820
- updatedAt: string;
1821
- id: string;
1822
1865
  authConfig: {
1823
1866
  id: string;
1824
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1867
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1825
1868
  isComposioManaged: boolean;
1826
1869
  isDisabled: boolean;
1827
1870
  };
1871
+ id: string;
1828
1872
  isDisabled: boolean;
1829
1873
  statusReason: string | null;
1874
+ createdAt: string;
1875
+ updatedAt: string;
1830
1876
  params?: Record<string, unknown> | undefined;
1831
1877
  testRequestEndpoint?: string | undefined;
1832
1878
  }, {
@@ -1836,17 +1882,17 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1836
1882
  };
1837
1883
  userId: string;
1838
1884
  data: Record<string, unknown>;
1839
- createdAt: string;
1840
- updatedAt: string;
1841
- id: string;
1842
1885
  authConfig: {
1843
1886
  id: string;
1844
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1887
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1845
1888
  isComposioManaged: boolean;
1846
1889
  isDisabled: boolean;
1847
1890
  };
1891
+ id: string;
1848
1892
  isDisabled: boolean;
1849
1893
  statusReason: string | null;
1894
+ createdAt: string;
1895
+ updatedAt: string;
1850
1896
  params?: Record<string, unknown> | undefined;
1851
1897
  testRequestEndpoint?: string | undefined;
1852
1898
  }>, "many">;
@@ -1860,17 +1906,17 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1860
1906
  };
1861
1907
  userId: string;
1862
1908
  data: Record<string, unknown>;
1863
- createdAt: string;
1864
- updatedAt: string;
1865
- id: string;
1866
1909
  authConfig: {
1867
1910
  id: string;
1868
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1911
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1869
1912
  isComposioManaged: boolean;
1870
1913
  isDisabled: boolean;
1871
1914
  };
1915
+ id: string;
1872
1916
  isDisabled: boolean;
1873
1917
  statusReason: string | null;
1918
+ createdAt: string;
1919
+ updatedAt: string;
1874
1920
  params?: Record<string, unknown> | undefined;
1875
1921
  testRequestEndpoint?: string | undefined;
1876
1922
  }[];
@@ -1884,17 +1930,17 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1884
1930
  };
1885
1931
  userId: string;
1886
1932
  data: Record<string, unknown>;
1887
- createdAt: string;
1888
- updatedAt: string;
1889
- id: string;
1890
1933
  authConfig: {
1891
1934
  id: string;
1892
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1935
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1893
1936
  isComposioManaged: boolean;
1894
1937
  isDisabled: boolean;
1895
1938
  };
1939
+ id: string;
1896
1940
  isDisabled: boolean;
1897
1941
  statusReason: string | null;
1942
+ createdAt: string;
1943
+ updatedAt: string;
1898
1944
  params?: Record<string, unknown> | undefined;
1899
1945
  testRequestEndpoint?: string | undefined;
1900
1946
  }[];
@@ -2138,8 +2184,8 @@ declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
2138
2184
  uuid: z.ZodOptional<z.ZodString>;
2139
2185
  }, "strip", z.ZodTypeAny, {
2140
2186
  connectedAccountId: string;
2141
- updatedAt: string;
2142
2187
  id: string;
2188
+ updatedAt: string;
2143
2189
  disabledAt: string | null;
2144
2190
  state: Record<string, unknown>;
2145
2191
  triggerConfig: Record<string, unknown>;
@@ -2148,8 +2194,8 @@ declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
2148
2194
  triggerData?: string | undefined;
2149
2195
  }, {
2150
2196
  connectedAccountId: string;
2151
- updatedAt: string;
2152
2197
  id: string;
2198
+ updatedAt: string;
2153
2199
  disabledAt: string | null;
2154
2200
  state: Record<string, unknown>;
2155
2201
  triggerConfig: Record<string, unknown>;
@@ -2162,8 +2208,8 @@ declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
2162
2208
  }, "strip", z.ZodTypeAny, {
2163
2209
  items: {
2164
2210
  connectedAccountId: string;
2165
- updatedAt: string;
2166
2211
  id: string;
2212
+ updatedAt: string;
2167
2213
  disabledAt: string | null;
2168
2214
  state: Record<string, unknown>;
2169
2215
  triggerConfig: Record<string, unknown>;
@@ -2176,8 +2222,8 @@ declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
2176
2222
  }, {
2177
2223
  items: {
2178
2224
  connectedAccountId: string;
2179
- updatedAt: string;
2180
2225
  id: string;
2226
+ updatedAt: string;
2181
2227
  disabledAt: string | null;
2182
2228
  state: Record<string, unknown>;
2183
2229
  triggerConfig: Record<string, unknown>;
@@ -2268,8 +2314,8 @@ declare const IncomingTriggerPayloadSchema: z.ZodObject<{
2268
2314
  authConfigUUID: string;
2269
2315
  }>;
2270
2316
  }, "strip", z.ZodTypeAny, {
2271
- toolkitSlug: string;
2272
2317
  id: string;
2318
+ toolkitSlug: string;
2273
2319
  triggerSlug: string;
2274
2320
  triggerConfig: Record<string, unknown>;
2275
2321
  connectedAccount: {
@@ -2282,8 +2328,8 @@ declare const IncomingTriggerPayloadSchema: z.ZodObject<{
2282
2328
  };
2283
2329
  triggerData?: string | undefined;
2284
2330
  }, {
2285
- toolkitSlug: string;
2286
2331
  id: string;
2332
+ toolkitSlug: string;
2287
2333
  triggerSlug: string;
2288
2334
  triggerConfig: Record<string, unknown>;
2289
2335
  connectedAccount: {
@@ -2298,12 +2344,12 @@ declare const IncomingTriggerPayloadSchema: z.ZodObject<{
2298
2344
  }>;
2299
2345
  }, "strip", z.ZodTypeAny, {
2300
2346
  userId: string;
2301
- toolkitSlug: string;
2302
2347
  id: string;
2348
+ toolkitSlug: string;
2303
2349
  triggerSlug: string;
2304
2350
  metadata: {
2305
- toolkitSlug: string;
2306
2351
  id: string;
2352
+ toolkitSlug: string;
2307
2353
  triggerSlug: string;
2308
2354
  triggerConfig: Record<string, unknown>;
2309
2355
  connectedAccount: {
@@ -2320,12 +2366,12 @@ declare const IncomingTriggerPayloadSchema: z.ZodObject<{
2320
2366
  originalPayload?: Record<string, unknown> | undefined;
2321
2367
  }, {
2322
2368
  userId: string;
2323
- toolkitSlug: string;
2324
2369
  id: string;
2370
+ toolkitSlug: string;
2325
2371
  triggerSlug: string;
2326
2372
  metadata: {
2327
- toolkitSlug: string;
2328
2373
  id: string;
2374
+ toolkitSlug: string;
2329
2375
  triggerSlug: string;
2330
2376
  triggerConfig: Record<string, unknown>;
2331
2377
  connectedAccount: {
@@ -2504,13 +2550,13 @@ declare const CreateAuthConfigParamsSchema: z.ZodDiscriminatedUnion<"type", [z.Z
2504
2550
  authScheme: z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>;
2505
2551
  }, "strip", z.ZodTypeAny, {
2506
2552
  type: "use_custom_auth";
2553
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
2507
2554
  credentials: Record<string, string | number | boolean>;
2508
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
2509
2555
  name?: string | undefined;
2510
2556
  }, {
2511
2557
  type: "use_custom_auth";
2558
+ authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
2512
2559
  credentials: Record<string, string | number | boolean>;
2513
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
2514
2560
  name?: string | undefined;
2515
2561
  }>, z.ZodObject<{
2516
2562
  type: z.ZodLiteral<"use_composio_managed_auth">;
@@ -2576,10 +2622,10 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
2576
2622
  id: string;
2577
2623
  noOfConnections: number;
2578
2624
  uuid: string;
2625
+ authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2626
+ isComposioManaged?: boolean | undefined;
2579
2627
  createdAt?: string | undefined;
2580
2628
  credentials?: Record<string, unknown> | undefined;
2581
- authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2582
- isComposioManaged?: boolean | undefined;
2583
2629
  expectedInputFields?: unknown[] | undefined;
2584
2630
  createdBy?: string | undefined;
2585
2631
  lastUpdatedAt?: string | undefined;
@@ -2593,10 +2639,10 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
2593
2639
  id: string;
2594
2640
  noOfConnections: number;
2595
2641
  uuid: string;
2642
+ authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2643
+ isComposioManaged?: boolean | undefined;
2596
2644
  createdAt?: string | undefined;
2597
2645
  credentials?: Record<string, unknown> | undefined;
2598
- authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2599
- isComposioManaged?: boolean | undefined;
2600
2646
  expectedInputFields?: unknown[] | undefined;
2601
2647
  createdBy?: string | undefined;
2602
2648
  lastUpdatedAt?: string | undefined;
@@ -2653,10 +2699,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2653
2699
  id: string;
2654
2700
  noOfConnections: number;
2655
2701
  uuid: string;
2702
+ authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2703
+ isComposioManaged?: boolean | undefined;
2656
2704
  createdAt?: string | undefined;
2657
2705
  credentials?: Record<string, unknown> | undefined;
2658
- authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2659
- isComposioManaged?: boolean | undefined;
2660
2706
  expectedInputFields?: unknown[] | undefined;
2661
2707
  createdBy?: string | undefined;
2662
2708
  lastUpdatedAt?: string | undefined;
@@ -2670,10 +2716,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2670
2716
  id: string;
2671
2717
  noOfConnections: number;
2672
2718
  uuid: string;
2719
+ authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2720
+ isComposioManaged?: boolean | undefined;
2673
2721
  createdAt?: string | undefined;
2674
2722
  credentials?: Record<string, unknown> | undefined;
2675
- authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2676
- isComposioManaged?: boolean | undefined;
2677
2723
  expectedInputFields?: unknown[] | undefined;
2678
2724
  createdBy?: string | undefined;
2679
2725
  lastUpdatedAt?: string | undefined;
@@ -2691,10 +2737,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2691
2737
  id: string;
2692
2738
  noOfConnections: number;
2693
2739
  uuid: string;
2740
+ authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2741
+ isComposioManaged?: boolean | undefined;
2694
2742
  createdAt?: string | undefined;
2695
2743
  credentials?: Record<string, unknown> | undefined;
2696
- authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2697
- isComposioManaged?: boolean | undefined;
2698
2744
  expectedInputFields?: unknown[] | undefined;
2699
2745
  createdBy?: string | undefined;
2700
2746
  lastUpdatedAt?: string | undefined;
@@ -2712,10 +2758,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2712
2758
  id: string;
2713
2759
  noOfConnections: number;
2714
2760
  uuid: string;
2761
+ authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2762
+ isComposioManaged?: boolean | undefined;
2715
2763
  createdAt?: string | undefined;
2716
2764
  credentials?: Record<string, unknown> | undefined;
2717
- authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
2718
- isComposioManaged?: boolean | undefined;
2719
2765
  expectedInputFields?: unknown[] | undefined;
2720
2766
  createdBy?: string | undefined;
2721
2767
  lastUpdatedAt?: string | undefined;
@@ -3117,22 +3163,53 @@ declare class ConnectedAccounts {
3117
3163
  * Update the status of a connected account
3118
3164
  * @param {string} nanoid - Unique identifier of the connected account
3119
3165
  * @param {ConnectedAccountUpdateStatusParams} params - Parameters for updating the status
3120
- * @param {RequestOptions} options - Request options
3121
3166
  * @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
3167
+ *
3168
+ * @example
3169
+ * ```typescript
3170
+ * // Enable a connected account
3171
+ * const updatedAccount = await composio.connectedAccounts.updateStatus('conn_abc123', {
3172
+ * enabled: true
3173
+ * });
3174
+ *
3175
+ * // Disable a connected account with a reason
3176
+ * const disabledAccount = await composio.connectedAccounts.updateStatus('conn_abc123', {
3177
+ * enabled: false,
3178
+ * reason: 'Token expired'
3179
+ * });
3180
+ * ```
3122
3181
  */
3123
3182
  updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams): Promise<ConnectedAccountUpdateStatusResponse>;
3124
3183
  /**
3125
3184
  * Enable a connected account
3126
3185
  * @param {string} nanoid - Unique identifier of the connected account
3127
- * @param {RequestOptions} options - Request options
3128
3186
  * @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
3187
+ *
3188
+ * @example
3189
+ * ```typescript
3190
+ * // Enable a previously disabled connected account
3191
+ * const enabledAccount = await composio.connectedAccounts.enable('conn_abc123');
3192
+ * console.log(enabledAccount.isDisabled); // false
3193
+ * ```
3129
3194
  */
3130
3195
  enable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
3131
3196
  /**
3132
3197
  * Disable a connected account
3133
3198
  * @param {string} nanoid - Unique identifier of the connected account
3134
- * @param {RequestOptions} options - Request options
3135
3199
  * @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
3200
+ *
3201
+ * @example
3202
+ * ```typescript
3203
+ * // Disable a connected account
3204
+ * const disabledAccount = await composio.connectedAccounts.disable('conn_abc123');
3205
+ * console.log(disabledAccount.isDisabled); // true
3206
+ *
3207
+ * // You can also use updateStatus with a reason
3208
+ * // const disabledAccount = await composio.connectedAccounts.updateStatus('conn_abc123', {
3209
+ * // enabled: false,
3210
+ * // reason: 'No longer needed'
3211
+ * // });
3212
+ * ```
3136
3213
  */
3137
3214
  disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
3138
3215
  }
@@ -3175,54 +3252,301 @@ type OpenAiToolCollection = Array<OpenAiTool>;
3175
3252
  declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection, OpenAiTool> {
3176
3253
  readonly name = "openai";
3177
3254
  /**
3178
- * Absract method to wrap a tool in the provider.
3179
- * This method is implemented by the provider.
3180
- * @param tool - The tool to wrap.
3181
- * @returns The wrapped tool.
3255
+ * Creates a new instance of the OpenAIProvider.
3256
+ *
3257
+ * This is the default provider for the Composio SDK and is automatically
3258
+ * available without additional installation.
3259
+ *
3260
+ * @example
3261
+ * ```typescript
3262
+ * // The OpenAIProvider is used by default when initializing Composio
3263
+ * const composio = new Composio({
3264
+ * apiKey: 'your-api-key'
3265
+ * });
3266
+ *
3267
+ * // You can also explicitly specify it
3268
+ * const composio = new Composio({
3269
+ * apiKey: 'your-api-key',
3270
+ * provider: new OpenAIProvider()
3271
+ * });
3272
+ * ```
3273
+ */
3274
+ constructor();
3275
+ /**
3276
+ * Wraps a Composio tool in the OpenAI function calling format.
3277
+ *
3278
+ * This method transforms a Composio tool definition into the format
3279
+ * expected by OpenAI's function calling API.
3280
+ *
3281
+ * @param tool - The Composio tool to wrap
3282
+ * @returns The wrapped tool in OpenAI format
3283
+ *
3284
+ * @example
3285
+ * ```typescript
3286
+ * // Wrap a single tool for use with OpenAI
3287
+ * const composioTool = {
3288
+ * slug: 'SEARCH_TOOL',
3289
+ * description: 'Search for information',
3290
+ * inputParameters: {
3291
+ * type: 'object',
3292
+ * properties: {
3293
+ * query: { type: 'string' }
3294
+ * },
3295
+ * required: ['query']
3296
+ * }
3297
+ * };
3298
+ *
3299
+ * const openAITool = provider.wrapTool(composioTool);
3300
+ * ```
3182
3301
  */
3183
3302
  wrapTool: (tool: Tool) => OpenAiTool;
3303
+ /**
3304
+ * Wraps multiple Composio tools in the OpenAI function calling format.
3305
+ *
3306
+ * This method transforms a list of Composio tools into the format
3307
+ * expected by OpenAI's function calling API.
3308
+ *
3309
+ * @param tools - Array of Composio tools to wrap
3310
+ * @returns Array of wrapped tools in OpenAI format
3311
+ *
3312
+ * @example
3313
+ * ```typescript
3314
+ * // Wrap multiple tools for use with OpenAI
3315
+ * const composioTools = [
3316
+ * {
3317
+ * slug: 'SEARCH_TOOL',
3318
+ * description: 'Search for information',
3319
+ * inputParameters: {
3320
+ * type: 'object',
3321
+ * properties: {
3322
+ * query: { type: 'string' }
3323
+ * }
3324
+ * }
3325
+ * },
3326
+ * {
3327
+ * slug: 'WEATHER_TOOL',
3328
+ * description: 'Get weather information',
3329
+ * inputParameters: {
3330
+ * type: 'object',
3331
+ * properties: {
3332
+ * location: { type: 'string' }
3333
+ * }
3334
+ * }
3335
+ * }
3336
+ * ];
3337
+ *
3338
+ * const openAITools = provider.wrapTools(composioTools);
3339
+ * ```
3340
+ */
3184
3341
  wrapTools: (tools: Tool[]) => OpenAiToolCollection;
3185
3342
  /**
3186
- * Execute a tool call.
3187
- * @param {OpenAI.ChatCompletionMessageToolCall} tool - The tool to execute.
3188
- * @param {string} userId - The user id.
3189
- * @returns {Promise<string>} The result of the tool call.
3343
+ * Executes a tool call from OpenAI's chat completion.
3344
+ *
3345
+ * This method processes a tool call from OpenAI's chat completion API,
3346
+ * executes the corresponding Composio tool, and returns the result.
3347
+ *
3348
+ * @param {string} userId - The user ID for authentication and tracking
3349
+ * @param {OpenAI.ChatCompletionMessageToolCall} tool - The tool call from OpenAI
3350
+ * @param {ExecuteToolFnOptions} [options] - Optional execution options
3351
+ * @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
3352
+ * @returns {Promise<string>} The result of the tool call as a JSON string
3353
+ *
3354
+ * @example
3355
+ * ```typescript
3356
+ * // Execute a tool call from OpenAI
3357
+ * const toolCall = {
3358
+ * id: 'call_abc123',
3359
+ * type: 'function',
3360
+ * function: {
3361
+ * name: 'SEARCH_TOOL',
3362
+ * arguments: '{"query":"composio documentation"}'
3363
+ * }
3364
+ * };
3365
+ *
3366
+ * const result = await provider.executeToolCall(
3367
+ * 'user123',
3368
+ * toolCall,
3369
+ * { connectedAccountId: 'conn_xyz456' }
3370
+ * );
3371
+ * console.log(JSON.parse(result));
3372
+ * ```
3190
3373
  */
3191
3374
  executeToolCall(userId: string, tool: OpenAI.ChatCompletionMessageToolCall, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string>;
3192
3375
  /**
3193
- * Handle the tool call from the assistant.
3376
+ * Handles tool calls from OpenAI's chat completion response.
3194
3377
  *
3195
- * @param {OpenAI.ChatCompletion} chatCompletion - The chat completion object.
3196
- * @param {string} userId - The user id.
3197
- * @returns {Promise<string[]>} The results of the tool call.
3378
+ * This method processes tool calls from an OpenAI chat completion response,
3379
+ * executes each tool call, and returns the results.
3380
+ *
3381
+ * @param {string} userId - The user ID for authentication and tracking
3382
+ * @param {OpenAI.ChatCompletion} chatCompletion - The chat completion response from OpenAI
3383
+ * @param {ExecuteToolFnOptions} [options] - Optional execution options
3384
+ * @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
3385
+ * @returns {Promise<string[]>} Array of tool execution results as JSON strings
3386
+ *
3387
+ * @example
3388
+ * ```typescript
3389
+ * // Handle tool calls from a chat completion response
3390
+ * const chatCompletion = {
3391
+ * choices: [
3392
+ * {
3393
+ * message: {
3394
+ * tool_calls: [
3395
+ * {
3396
+ * id: 'call_abc123',
3397
+ * type: 'function',
3398
+ * function: {
3399
+ * name: 'SEARCH_TOOL',
3400
+ * arguments: '{"query":"composio documentation"}'
3401
+ * }
3402
+ * }
3403
+ * ]
3404
+ * }
3405
+ * }
3406
+ * ]
3407
+ * };
3408
+ *
3409
+ * const results = await provider.handleToolCalls(
3410
+ * 'user123',
3411
+ * chatCompletion,
3412
+ * { connectedAccountId: 'conn_xyz456' }
3413
+ * );
3414
+ * console.log(results); // Array of tool execution results
3415
+ * ```
3198
3416
  */
3199
3417
  handleToolCalls(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
3200
3418
  /**
3201
- * Handles all the tool calls from the assistant.
3419
+ * Handles all the tool calls from the OpenAI Assistant API.
3202
3420
  *
3203
- * @param {OpenAI.Beta.Threads.Run} run - The run object.
3204
- * @param {string} userId - The user id.
3205
- * @returns {Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>} The tool outputs.
3421
+ * This method processes tool calls from an OpenAI Assistant run,
3422
+ * executes each tool call, and returns the tool outputs for submission.
3423
+ *
3424
+ * @param {string} userId - The user ID for authentication and tracking
3425
+ * @param {OpenAI.Beta.Threads.Run} run - The Assistant run object containing tool calls
3426
+ * @param {ExecuteToolFnOptions} [options] - Optional execution options
3427
+ * @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
3428
+ * @returns {Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>} Array of tool outputs for submission
3429
+ *
3430
+ * @example
3431
+ * ```typescript
3432
+ * // Handle tool calls from an OpenAI Assistant run
3433
+ * const run = {
3434
+ * id: 'run_abc123',
3435
+ * required_action: {
3436
+ * submit_tool_outputs: {
3437
+ * tool_calls: [
3438
+ * {
3439
+ * id: 'call_xyz789',
3440
+ * type: 'function',
3441
+ * function: {
3442
+ * name: 'SEARCH_TOOL',
3443
+ * arguments: '{"query":"composio documentation"}'
3444
+ * }
3445
+ * }
3446
+ * ]
3447
+ * }
3448
+ * }
3449
+ * };
3450
+ *
3451
+ * const toolOutputs = await provider.handleAssistantMessage(
3452
+ * 'user123',
3453
+ * run,
3454
+ * { connectedAccountId: 'conn_xyz456' }
3455
+ * );
3456
+ *
3457
+ * // Submit tool outputs back to OpenAI
3458
+ * await openai.beta.threads.runs.submitToolOutputs(
3459
+ * thread.id,
3460
+ * run.id,
3461
+ * { tool_outputs: toolOutputs }
3462
+ * );
3463
+ * ```
3206
3464
  */
3207
3465
  handleAssistantMessage(userId: string, run: OpenAI.Beta.Threads.Run, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>;
3208
3466
  /**
3209
3467
  * Waits for the assistant stream and handles the tool calls.
3210
3468
  *
3211
- * @param {OpenAI} client - The OpenAI client.
3212
- * @param {Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>} runStream - The run stream.
3213
- * @param {OpenAI.Beta.Threads.Thread} thread - The thread object.
3214
- * @param {string} userId - The user id.
3215
- * @returns {AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>} The run stream.
3469
+ * This method processes an OpenAI Assistant stream, handles any tool calls
3470
+ * that require action, and yields each event from the stream. It's designed
3471
+ * for streaming Assistant responses while handling tool calls in real-time.
3472
+ *
3473
+ * @param {string} userId - The user ID for authentication and tracking
3474
+ * @param {OpenAI} client - The OpenAI client instance
3475
+ * @param {Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>} runStream - The Assistant run stream
3476
+ * @param {OpenAI.Beta.Threads.Thread} thread - The thread object
3477
+ * @param {ExecuteToolFnOptions} [options] - Optional execution options
3478
+ * @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
3479
+ * @returns {AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>} Generator yielding stream events
3480
+ *
3481
+ * @example
3482
+ * ```typescript
3483
+ * // Process an OpenAI Assistant stream with tool calls
3484
+ * const thread = await openai.beta.threads.create();
3485
+ * const runStream = openai.beta.threads.runs.stream(thread.id, {
3486
+ * assistant_id: 'asst_abc123',
3487
+ * tools: provider.wrapTools(composioTools)
3488
+ * });
3489
+ *
3490
+ * // Process the stream and handle tool calls
3491
+ * const streamProcessor = provider.waitAndHandleAssistantStreamToolCalls(
3492
+ * 'user123',
3493
+ * openai,
3494
+ * runStream,
3495
+ * thread,
3496
+ * { connectedAccountId: 'conn_xyz456' }
3497
+ * );
3498
+ *
3499
+ * // Consume the stream events
3500
+ * for await (const event of streamProcessor) {
3501
+ * if (event.event === 'thread.message.delta') {
3502
+ * console.log(event.data.delta.content);
3503
+ * }
3504
+ * }
3505
+ * ```
3216
3506
  */
3217
3507
  waitAndHandleAssistantStreamToolCalls(userId: string, client: OpenAI, runStream: Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>, thread: OpenAI.Beta.Threads.Thread, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>;
3218
3508
  /**
3219
3509
  * Waits for the assistant tool calls and handles them.
3220
3510
  *
3221
- * @param {OpenAI} client - The OpenAI client.
3222
- * @param {OpenAI.Beta.Threads.Run} run - The run object.
3223
- * @param {OpenAI.Beta.Threads.Thread} thread - The thread object.
3224
- * @param {string} userId - The user id.
3225
- * @returns {Promise<OpenAI.Beta.Threads.Run>} The run object.
3511
+ * This method polls an OpenAI Assistant run until it completes or requires action,
3512
+ * handles any tool calls, and returns the final run object. It's designed for
3513
+ * non-streaming Assistant interactions.
3514
+ *
3515
+ * @param {string} userId - The user ID for authentication and tracking
3516
+ * @param {OpenAI} client - The OpenAI client instance
3517
+ * @param {OpenAI.Beta.Threads.Run} run - The initial run object
3518
+ * @param {OpenAI.Beta.Threads.Thread} thread - The thread object
3519
+ * @param {ExecuteToolFnOptions} [options] - Optional execution options
3520
+ * @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
3521
+ * @returns {Promise<OpenAI.Beta.Threads.Run>} The final run object after completion
3522
+ *
3523
+ * @example
3524
+ * ```typescript
3525
+ * // Process an OpenAI Assistant run with tool calls
3526
+ * const thread = await openai.beta.threads.create();
3527
+ * await openai.beta.threads.messages.create(thread.id, {
3528
+ * role: 'user',
3529
+ * content: 'Find information about Composio'
3530
+ * });
3531
+ *
3532
+ * let run = await openai.beta.threads.runs.create(thread.id, {
3533
+ * assistant_id: 'asst_abc123',
3534
+ * tools: provider.wrapTools(composioTools)
3535
+ * });
3536
+ *
3537
+ * // Wait for the run to complete, handling any tool calls
3538
+ * run = await provider.waitAndHandleAssistantToolCalls(
3539
+ * 'user123',
3540
+ * openai,
3541
+ * run,
3542
+ * thread,
3543
+ * { connectedAccountId: 'conn_xyz456' }
3544
+ * );
3545
+ *
3546
+ * // Get the final messages after run completion
3547
+ * const messages = await openai.beta.threads.messages.list(thread.id);
3548
+ * console.log(messages.data[0].content);
3549
+ * ```
3226
3550
  */
3227
3551
  waitAndHandleAssistantToolCalls(userId: string, client: OpenAI, run: OpenAI.Beta.Threads.Run, thread: OpenAI.Beta.Threads.Thread, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.Run>;
3228
3552
  }
@@ -3260,13 +3584,36 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
3260
3584
  authConfigs: AuthConfigs;
3261
3585
  connectedAccounts: ConnectedAccounts;
3262
3586
  /**
3263
- * @param {Object} config Configuration for the Composio SDK.
3264
- * @param {string} config.apiKey The API key for the Composio SDK.
3265
- * @param {string} config.baseURL The base URL for the Composio SDK.
3266
- * @param {string} config.runtime The runtime for the Composio SDK.
3267
- * @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
3268
- * @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
3269
- * @param {TProvider} config.provider The provider to use for this Composio instance.
3587
+ * Creates a new instance of the Composio SDK.
3588
+ *
3589
+ * The constructor initializes the SDK with the provided configuration options,
3590
+ * sets up the API client, and initializes all core models (tools, toolkits, etc.).
3591
+ *
3592
+ * @param {ComposioConfig<TProvider>} config - Configuration options for the Composio SDK
3593
+ * @param {string} [config.apiKey] - The API key for authenticating with the Composio API
3594
+ * @param {string} [config.baseURL] - The base URL for the Composio API (defaults to production URL)
3595
+ * @param {boolean} [config.allowTracking=true] - Whether to allow anonymous usage analytics
3596
+ * @param {boolean} [config.allowTracing=true] - Whether to allow request tracing for debugging
3597
+ * @param {TProvider} [config.provider] - The provider to use for this Composio instance (defaults to OpenAIProvider)
3598
+ * @param {BaseTelemetryTransport} [config.telemetryTransport] - Custom telemetry transport implementation
3599
+ *
3600
+ * @example
3601
+ * ```typescript
3602
+ * // Initialize with default configuration
3603
+ * const composio = new Composio();
3604
+ *
3605
+ * // Initialize with custom API key and base URL
3606
+ * const composio = new Composio({
3607
+ * apiKey: 'your-api-key',
3608
+ * baseURL: 'https://api.composio.dev'
3609
+ * });
3610
+ *
3611
+ * // Initialize with custom provider
3612
+ * const composio = new Composio({
3613
+ * apiKey: 'your-api-key',
3614
+ * provider: new CustomProvider()
3615
+ * });
3616
+ * ```
3270
3617
  */
3271
3618
  constructor(config?: ComposioConfig<TProvider>);
3272
3619
  /**