@composio/core 0.1.12-alpha.10 → 0.1.12-alpha.12

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.cts CHANGED
@@ -1,8 +1,7 @@
1
1
  import ComposioClient from '@composio/client';
2
2
  import { z, ZodObject, ZodString, ZodNumber, ZodBoolean, ZodOptional } from 'zod';
3
3
  import { ToolProxyParams, ToolProxyResponse, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse } from '@composio/client/resources/tools';
4
- import { RequestOptions } from '@composio/client/internal/request-options';
5
- import { TriggerInstanceListActiveParams, TriggerInstanceUpsertParams, TriggerInstanceUpsertResponse, TriggerInstanceRemoveUpsertResponse, TriggerInstanceUpdateStatusParams, TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
4
+ import { TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
6
5
  import { AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
7
6
  import { ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountListResponse as ConnectedAccountListResponse$1, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
8
7
  import { OpenAI } from 'openai';
@@ -18,8 +17,50 @@ declare const ToolSchema: z.ZodObject<{
18
17
  slug: z.ZodString;
19
18
  name: z.ZodString;
20
19
  description: z.ZodOptional<z.ZodString>;
21
- inputParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
22
- outputParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
+ inputParameters: z.ZodOptional<z.ZodObject<{
21
+ type: z.ZodLiteral<"object">;
22
+ properties: z.ZodRecord<z.ZodString, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
23
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
+ title: z.ZodOptional<z.ZodString>;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ additionalProperties: z.ZodOptional<z.ZodBoolean>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ type: "object";
29
+ properties: Record<string, unknown>;
30
+ description?: string | undefined;
31
+ title?: string | undefined;
32
+ required?: string[] | undefined;
33
+ additionalProperties?: boolean | undefined;
34
+ }, {
35
+ type: "object";
36
+ properties: Record<string, unknown>;
37
+ description?: string | undefined;
38
+ title?: string | undefined;
39
+ required?: string[] | undefined;
40
+ additionalProperties?: boolean | undefined;
41
+ }>>;
42
+ outputParameters: z.ZodOptional<z.ZodObject<{
43
+ type: z.ZodLiteral<"object">;
44
+ properties: z.ZodRecord<z.ZodString, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
45
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
+ title: z.ZodOptional<z.ZodString>;
47
+ description: z.ZodOptional<z.ZodString>;
48
+ additionalProperties: z.ZodOptional<z.ZodBoolean>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ type: "object";
51
+ properties: Record<string, unknown>;
52
+ description?: string | undefined;
53
+ title?: string | undefined;
54
+ required?: string[] | undefined;
55
+ additionalProperties?: boolean | undefined;
56
+ }, {
57
+ type: "object";
58
+ properties: Record<string, unknown>;
59
+ description?: string | undefined;
60
+ title?: string | undefined;
61
+ required?: string[] | undefined;
62
+ additionalProperties?: boolean | undefined;
63
+ }>>;
23
64
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
24
65
  toolkit: z.ZodOptional<z.ZodObject<{
25
66
  slug: z.ZodString;
@@ -40,8 +81,22 @@ declare const ToolSchema: z.ZodObject<{
40
81
  name: string;
41
82
  tags: string[];
42
83
  description?: string | undefined;
43
- inputParameters?: Record<string, unknown> | undefined;
44
- outputParameters?: Record<string, unknown> | undefined;
84
+ inputParameters?: {
85
+ type: "object";
86
+ properties: Record<string, unknown>;
87
+ description?: string | undefined;
88
+ title?: string | undefined;
89
+ required?: string[] | undefined;
90
+ additionalProperties?: boolean | undefined;
91
+ } | undefined;
92
+ outputParameters?: {
93
+ type: "object";
94
+ properties: Record<string, unknown>;
95
+ description?: string | undefined;
96
+ title?: string | undefined;
97
+ required?: string[] | undefined;
98
+ additionalProperties?: boolean | undefined;
99
+ } | undefined;
45
100
  toolkit?: {
46
101
  slug: string;
47
102
  name: string;
@@ -52,8 +107,22 @@ declare const ToolSchema: z.ZodObject<{
52
107
  slug: string;
53
108
  name: string;
54
109
  description?: string | undefined;
55
- inputParameters?: Record<string, unknown> | undefined;
56
- outputParameters?: Record<string, unknown> | undefined;
110
+ inputParameters?: {
111
+ type: "object";
112
+ properties: Record<string, unknown>;
113
+ description?: string | undefined;
114
+ title?: string | undefined;
115
+ required?: string[] | undefined;
116
+ additionalProperties?: boolean | undefined;
117
+ } | undefined;
118
+ outputParameters?: {
119
+ type: "object";
120
+ properties: Record<string, unknown>;
121
+ description?: string | undefined;
122
+ title?: string | undefined;
123
+ required?: string[] | undefined;
124
+ additionalProperties?: boolean | undefined;
125
+ } | undefined;
57
126
  tags?: string[] | undefined;
58
127
  toolkit?: {
59
128
  slug: string;
@@ -73,22 +142,22 @@ type ToolList = Array<Tool>;
73
142
  declare const ToolListParamsSchema: z.ZodObject<{
74
143
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
144
  cursor: z.ZodOptional<z.ZodString>;
76
- important: z.ZodOptional<z.ZodString>;
77
- limit: z.ZodOptional<z.ZodString>;
145
+ important: z.ZodOptional<z.ZodBoolean>;
146
+ limit: z.ZodOptional<z.ZodNumber>;
78
147
  search: z.ZodOptional<z.ZodString>;
79
148
  toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
149
  }, "strip", z.ZodTypeAny, {
81
150
  tools?: string[] | undefined;
82
151
  cursor?: string | undefined;
83
- important?: string | undefined;
84
- limit?: string | undefined;
152
+ important?: boolean | undefined;
153
+ limit?: number | undefined;
85
154
  search?: string | undefined;
86
155
  toolkits?: string[] | undefined;
87
156
  }, {
88
157
  tools?: string[] | undefined;
89
158
  cursor?: string | undefined;
90
- important?: string | undefined;
91
- limit?: string | undefined;
159
+ important?: boolean | undefined;
160
+ limit?: number | undefined;
92
161
  search?: string | undefined;
93
162
  toolkits?: string[] | undefined;
94
163
  }>;
@@ -302,7 +371,7 @@ declare abstract class BaseProvider {
302
371
  _setExecuteToolFn(executeToolFn: GlobalExecuteToolFn): void;
303
372
  /**
304
373
  * @public
305
- * Gloabl function to execute a tool.
374
+ * Global function to execute a tool.
306
375
  * This function is used by provider providers to implement helper functions to execute tools.
307
376
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
308
377
  * @param {string} toolSlug - The slug of the tool to execute.
@@ -1536,12 +1605,11 @@ type ToolkitRetrieveCategoriesResponse = z.infer<typeof ToolkitRetrieveCategorie
1536
1605
  * Connected Account create parameters
1537
1606
  */
1538
1607
  declare const ConnectedAccountStatuses: {
1539
- readonly ACTIVE: "ACTIVE";
1540
- readonly INACTIVE: "INACTIVE";
1541
- readonly DELETED: "DELETED";
1608
+ readonly INITIALIZING: "INITIALIZING";
1542
1609
  readonly INITIATED: "INITIATED";
1543
- readonly EXPIRED: "EXPIRED";
1610
+ readonly ACTIVE: "ACTIVE";
1544
1611
  readonly FAILED: "FAILED";
1612
+ readonly EXPIRED: "EXPIRED";
1545
1613
  };
1546
1614
  type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
1547
1615
  type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
@@ -1577,7 +1645,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1577
1645
  userId: z.ZodString;
1578
1646
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1579
1647
  params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1580
- status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
1648
+ status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>;
1581
1649
  statusReason: z.ZodNullable<z.ZodString>;
1582
1650
  toolkit: z.ZodObject<{
1583
1651
  slug: z.ZodString;
@@ -1591,7 +1659,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1591
1659
  createdAt: z.ZodString;
1592
1660
  updatedAt: z.ZodString;
1593
1661
  }, "strip", z.ZodTypeAny, {
1594
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1662
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
1595
1663
  toolkit: {
1596
1664
  slug: string;
1597
1665
  };
@@ -1611,7 +1679,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1611
1679
  params?: Record<string, unknown> | undefined;
1612
1680
  testRequestEndpoint?: string | undefined;
1613
1681
  }, {
1614
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1682
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
1615
1683
  toolkit: {
1616
1684
  slug: string;
1617
1685
  };
@@ -1638,7 +1706,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
1638
1706
  labels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1639
1707
  limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1640
1708
  orderBy: z.ZodOptional<z.ZodEnum<["created_at", "updated_at"]>>;
1641
- statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>, "many">>>;
1709
+ statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>, "many">>>;
1642
1710
  toolkitSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1643
1711
  userIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1644
1712
  }, "strip", z.ZodTypeAny, {
@@ -1647,7 +1715,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
1647
1715
  authConfigIds?: string[] | null | undefined;
1648
1716
  labels?: string[] | null | undefined;
1649
1717
  orderBy?: "created_at" | "updated_at" | undefined;
1650
- statuses?: ("ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED")[] | null | undefined;
1718
+ statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED")[] | null | undefined;
1651
1719
  toolkitSlugs?: string[] | null | undefined;
1652
1720
  userIds?: string[] | null | undefined;
1653
1721
  }, {
@@ -1656,7 +1724,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
1656
1724
  authConfigIds?: string[] | null | undefined;
1657
1725
  labels?: string[] | null | undefined;
1658
1726
  orderBy?: "created_at" | "updated_at" | undefined;
1659
- statuses?: ("ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED")[] | null | undefined;
1727
+ statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED")[] | null | undefined;
1660
1728
  toolkitSlugs?: string[] | null | undefined;
1661
1729
  userIds?: string[] | null | undefined;
1662
1730
  }>;
@@ -1683,7 +1751,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1683
1751
  userId: z.ZodString;
1684
1752
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1685
1753
  params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1686
- status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
1754
+ status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>;
1687
1755
  statusReason: z.ZodNullable<z.ZodString>;
1688
1756
  toolkit: z.ZodObject<{
1689
1757
  slug: z.ZodString;
@@ -1697,7 +1765,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1697
1765
  createdAt: z.ZodString;
1698
1766
  updatedAt: z.ZodString;
1699
1767
  }, "strip", z.ZodTypeAny, {
1700
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1768
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
1701
1769
  toolkit: {
1702
1770
  slug: string;
1703
1771
  };
@@ -1717,7 +1785,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1717
1785
  params?: Record<string, unknown> | undefined;
1718
1786
  testRequestEndpoint?: string | undefined;
1719
1787
  }, {
1720
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1788
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
1721
1789
  toolkit: {
1722
1790
  slug: string;
1723
1791
  };
@@ -1741,7 +1809,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1741
1809
  totalPages: z.ZodNumber;
1742
1810
  }, "strip", z.ZodTypeAny, {
1743
1811
  items: {
1744
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1812
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
1745
1813
  toolkit: {
1746
1814
  slug: string;
1747
1815
  };
@@ -1765,7 +1833,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1765
1833
  totalPages: number;
1766
1834
  }, {
1767
1835
  items: {
1768
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1836
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
1769
1837
  toolkit: {
1770
1838
  slug: string;
1771
1839
  };
@@ -1844,6 +1912,15 @@ declare class ConnectionRequest {
1844
1912
  * ```
1845
1913
  */
1846
1914
  waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
1915
+ /**
1916
+ * Returns a JSON-serializable representation of the connection request
1917
+ * Excludes the private client property to avoid cyclic reference issues
1918
+ */
1919
+ toJSON(): Record<string, unknown>;
1920
+ /**
1921
+ * Returns a string representation of the connection request
1922
+ */
1923
+ toString(): string;
1847
1924
  }
1848
1925
 
1849
1926
  /**
@@ -1867,6 +1944,20 @@ declare class Toolkits {
1867
1944
  * @private
1868
1945
  */
1869
1946
  private getToolkits;
1947
+ /**
1948
+ * Retrieves a specific toolkit by its slug identifier.
1949
+ *
1950
+ * This method fetches a single toolkit from the Composio API and transforms
1951
+ * the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
1952
+ *
1953
+ * @param {string} slug - The unique slug identifier of the toolkit to retrieve
1954
+ * @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
1955
+ * @throws {ValidationError} If the response cannot be properly parsed
1956
+ * @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
1957
+ *
1958
+ * @private
1959
+ */
1960
+ private getToolkitBySlug;
1870
1961
  /**
1871
1962
  * Retrieves a specific toolkit by its slug identifier.
1872
1963
  *
@@ -1906,20 +1997,6 @@ declare class Toolkits {
1906
1997
  * ```
1907
1998
  */
1908
1999
  get(query: ToolkitListParams): Promise<ToolKitListResponse>;
1909
- /**
1910
- * Retrieves a specific toolkit by its slug identifier.
1911
- *
1912
- * This method fetches a single toolkit from the Composio API and transforms
1913
- * the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
1914
- *
1915
- * @param {string} slug - The unique slug identifier of the toolkit to retrieve
1916
- * @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
1917
- * @throws {ValidationError} If the response cannot be properly parsed
1918
- * @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
1919
- *
1920
- * @private
1921
- */
1922
- private getToolkitBySlug;
1923
2000
  /**
1924
2001
  * Retrieves all toolkit categories available in the Composio SDK.
1925
2002
  *
@@ -1951,53 +2028,275 @@ declare class Toolkits {
1951
2028
  authorize(userId: string, toolkitSlug: string): Promise<ConnectionRequest>;
1952
2029
  }
1953
2030
 
1954
- type TriggerStatusEnum = "enable" | "disable";
1955
- declare const ZTriggerSubscribeParam: z.ZodObject<{
1956
- appName: z.ZodOptional<z.ZodString>;
2031
+ declare const TriggerSubscribeParamSchema: z.ZodObject<{
2032
+ toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1957
2033
  triggerId: z.ZodOptional<z.ZodString>;
1958
- connectionId: z.ZodOptional<z.ZodString>;
1959
- integrationId: z.ZodOptional<z.ZodString>;
1960
- triggerName: z.ZodOptional<z.ZodString>;
2034
+ connectedAccountId: z.ZodOptional<z.ZodString>;
2035
+ authConfigId: z.ZodOptional<z.ZodString>;
2036
+ triggerSlug: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1961
2037
  triggerData: z.ZodOptional<z.ZodString>;
1962
- entityId: z.ZodOptional<z.ZodString>;
2038
+ userId: z.ZodOptional<z.ZodString>;
1963
2039
  }, "strip", z.ZodTypeAny, {
1964
- appName?: string | undefined;
2040
+ toolkits?: string[] | undefined;
2041
+ connectedAccountId?: string | undefined;
2042
+ userId?: string | undefined;
1965
2043
  triggerId?: string | undefined;
1966
- connectionId?: string | undefined;
1967
- integrationId?: string | undefined;
1968
- triggerName?: string | undefined;
2044
+ authConfigId?: string | undefined;
2045
+ triggerSlug?: string[] | undefined;
1969
2046
  triggerData?: string | undefined;
1970
- entityId?: string | undefined;
1971
2047
  }, {
1972
- appName?: string | undefined;
2048
+ toolkits?: string[] | undefined;
2049
+ connectedAccountId?: string | undefined;
2050
+ userId?: string | undefined;
1973
2051
  triggerId?: string | undefined;
1974
- connectionId?: string | undefined;
1975
- integrationId?: string | undefined;
1976
- triggerName?: string | undefined;
2052
+ authConfigId?: string | undefined;
2053
+ triggerSlug?: string[] | undefined;
1977
2054
  triggerData?: string | undefined;
1978
- entityId?: string | undefined;
1979
2055
  }>;
1980
- type TriggerSubscribeParams = z.infer<typeof ZTriggerSubscribeParam>;
1981
-
1982
- type TriggerData = {
1983
- appName: string;
1984
- clientId: number;
1985
- payload: Record<string, unknown>;
1986
- originalPayload: Record<string, unknown>;
1987
- metadata: {
2056
+ type TriggerSubscribeParams = z.infer<typeof TriggerSubscribeParamSchema>;
2057
+ declare const TriggerInstanceListActiveParamsSchema: z.ZodObject<{
2058
+ authConfigIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2059
+ connectedAccountIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2060
+ limit: z.ZodOptional<z.ZodNumber>;
2061
+ page: z.ZodOptional<z.ZodNumber>;
2062
+ showDisabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
2063
+ triggerIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2064
+ triggerNames: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2065
+ }, "strip", z.ZodTypeAny, {
2066
+ limit?: number | undefined;
2067
+ authConfigIds?: string[] | null | undefined;
2068
+ connectedAccountIds?: string[] | null | undefined;
2069
+ page?: number | undefined;
2070
+ showDisabled?: boolean | null | undefined;
2071
+ triggerIds?: string[] | null | undefined;
2072
+ triggerNames?: string[] | null | undefined;
2073
+ }, {
2074
+ limit?: number | undefined;
2075
+ authConfigIds?: string[] | null | undefined;
2076
+ connectedAccountIds?: string[] | null | undefined;
2077
+ page?: number | undefined;
2078
+ showDisabled?: boolean | null | undefined;
2079
+ triggerIds?: string[] | null | undefined;
2080
+ triggerNames?: string[] | null | undefined;
2081
+ }>;
2082
+ type TriggerInstanceListActiveParams = z.infer<typeof TriggerInstanceListActiveParamsSchema>;
2083
+ declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
2084
+ items: z.ZodArray<z.ZodObject<{
2085
+ id: z.ZodString;
2086
+ connectedAccountId: z.ZodString;
2087
+ disabledAt: z.ZodNullable<z.ZodString>;
2088
+ state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2089
+ triggerConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2090
+ triggerName: z.ZodString;
2091
+ updatedAt: z.ZodString;
2092
+ triggerData: z.ZodOptional<z.ZodString>;
2093
+ uuid: z.ZodOptional<z.ZodString>;
2094
+ }, "strip", z.ZodTypeAny, {
2095
+ connectedAccountId: string;
2096
+ updatedAt: string;
1988
2097
  id: string;
1989
- connectionId: string;
2098
+ disabledAt: string | null;
2099
+ state: Record<string, unknown>;
2100
+ triggerConfig: Record<string, unknown>;
1990
2101
  triggerName: string;
1991
- triggerData: string;
2102
+ uuid?: string | undefined;
2103
+ triggerData?: string | undefined;
2104
+ }, {
2105
+ connectedAccountId: string;
2106
+ updatedAt: string;
2107
+ id: string;
2108
+ disabledAt: string | null;
2109
+ state: Record<string, unknown>;
2110
+ triggerConfig: Record<string, unknown>;
2111
+ triggerName: string;
2112
+ uuid?: string | undefined;
2113
+ triggerData?: string | undefined;
2114
+ }>, "many">;
2115
+ nextCursor: z.ZodNullable<z.ZodString>;
2116
+ totalPages: z.ZodNumber;
2117
+ }, "strip", z.ZodTypeAny, {
2118
+ items: {
2119
+ connectedAccountId: string;
2120
+ updatedAt: string;
2121
+ id: string;
2122
+ disabledAt: string | null;
2123
+ state: Record<string, unknown>;
2124
+ triggerConfig: Record<string, unknown>;
2125
+ triggerName: string;
2126
+ uuid?: string | undefined;
2127
+ triggerData?: string | undefined;
2128
+ }[];
2129
+ nextCursor: string | null;
2130
+ totalPages: number;
2131
+ }, {
2132
+ items: {
2133
+ connectedAccountId: string;
2134
+ updatedAt: string;
2135
+ id: string;
2136
+ disabledAt: string | null;
2137
+ state: Record<string, unknown>;
2138
+ triggerConfig: Record<string, unknown>;
2139
+ triggerName: string;
2140
+ uuid?: string | undefined;
2141
+ triggerData?: string | undefined;
2142
+ }[];
2143
+ nextCursor: string | null;
2144
+ totalPages: number;
2145
+ }>;
2146
+ type TriggerInstanceListActiveResponse = z.infer<typeof TriggerInstanceListActiveResponseSchema>;
2147
+ declare const TriggerInstanceUpsertParamsSchema: z.ZodObject<{
2148
+ connectedAccountId: z.ZodOptional<z.ZodString>;
2149
+ triggerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2150
+ }, "strip", z.ZodTypeAny, {
2151
+ connectedAccountId?: string | undefined;
2152
+ triggerConfig?: Record<string, unknown> | undefined;
2153
+ }, {
2154
+ connectedAccountId?: string | undefined;
2155
+ triggerConfig?: Record<string, unknown> | undefined;
2156
+ }>;
2157
+ type TriggerInstanceUpsertParams = z.infer<typeof TriggerInstanceUpsertParamsSchema>;
2158
+ declare const TriggerInstanceUpsertResponseSchema: z.ZodObject<{
2159
+ triggerId: z.ZodString;
2160
+ }, "strip", z.ZodTypeAny, {
2161
+ triggerId: string;
2162
+ }, {
2163
+ triggerId: string;
2164
+ }>;
2165
+ type TriggerInstanceUpsertResponse = z.infer<typeof TriggerInstanceUpsertResponseSchema>;
2166
+ declare const TriggerInstanceManageUpdateParamsSchema: z.ZodObject<{
2167
+ status: z.ZodEnum<["enable", "disable"]>;
2168
+ }, "strip", z.ZodTypeAny, {
2169
+ status: "enable" | "disable";
2170
+ }, {
2171
+ status: "enable" | "disable";
2172
+ }>;
2173
+ type TriggerInstanceManageUpdateParams = z.infer<typeof TriggerInstanceManageUpdateParamsSchema>;
2174
+ declare const TriggerInstanceManageUpdateResponseSchema: z.ZodObject<{
2175
+ status: z.ZodEnum<["success"]>;
2176
+ }, "strip", z.ZodTypeAny, {
2177
+ status: "success";
2178
+ }, {
2179
+ status: "success";
2180
+ }>;
2181
+ type TriggerInstanceManageUpdateResponse = z.infer<typeof TriggerInstanceManageUpdateResponseSchema>;
2182
+ declare const TriggerInstanceManageDeleteResponseSchema: z.ZodObject<{
2183
+ triggerId: z.ZodString;
2184
+ }, "strip", z.ZodTypeAny, {
2185
+ triggerId: string;
2186
+ }, {
2187
+ triggerId: string;
2188
+ }>;
2189
+ type TriggerInstanceManageDeleteResponse = z.infer<typeof TriggerInstanceManageDeleteResponseSchema>;
2190
+ declare const IncomingTriggerPayloadSchema: z.ZodObject<{
2191
+ id: z.ZodString;
2192
+ triggerSlug: z.ZodString;
2193
+ toolkitSlug: z.ZodString;
2194
+ userId: z.ZodString;
2195
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2196
+ originalPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2197
+ metadata: z.ZodObject<{
2198
+ id: z.ZodString;
2199
+ toolkitSlug: z.ZodString;
2200
+ triggerSlug: z.ZodString;
2201
+ triggerData: z.ZodOptional<z.ZodString>;
2202
+ triggerConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2203
+ connectedAccount: z.ZodObject<{
2204
+ id: z.ZodString;
2205
+ uuid: z.ZodString;
2206
+ authConfigId: z.ZodString;
2207
+ authConfigUUID: z.ZodString;
2208
+ userId: z.ZodString;
2209
+ status: z.ZodEnum<["ACTIVE", "INACTIVE"]>;
2210
+ }, "strip", z.ZodTypeAny, {
2211
+ status: "ACTIVE" | "INACTIVE";
2212
+ userId: string;
2213
+ id: string;
2214
+ uuid: string;
2215
+ authConfigId: string;
2216
+ authConfigUUID: string;
2217
+ }, {
2218
+ status: "ACTIVE" | "INACTIVE";
2219
+ userId: string;
2220
+ id: string;
2221
+ uuid: string;
2222
+ authConfigId: string;
2223
+ authConfigUUID: string;
2224
+ }>;
2225
+ }, "strip", z.ZodTypeAny, {
2226
+ toolkitSlug: string;
2227
+ id: string;
2228
+ triggerSlug: string;
2229
+ triggerConfig: Record<string, unknown>;
2230
+ connectedAccount: {
2231
+ status: "ACTIVE" | "INACTIVE";
2232
+ userId: string;
2233
+ id: string;
2234
+ uuid: string;
2235
+ authConfigId: string;
2236
+ authConfigUUID: string;
2237
+ };
2238
+ triggerData?: string | undefined;
2239
+ }, {
2240
+ toolkitSlug: string;
2241
+ id: string;
2242
+ triggerSlug: string;
2243
+ triggerConfig: Record<string, unknown>;
2244
+ connectedAccount: {
2245
+ status: "ACTIVE" | "INACTIVE";
2246
+ userId: string;
2247
+ id: string;
2248
+ uuid: string;
2249
+ authConfigId: string;
2250
+ authConfigUUID: string;
2251
+ };
2252
+ triggerData?: string | undefined;
2253
+ }>;
2254
+ }, "strip", z.ZodTypeAny, {
2255
+ userId: string;
2256
+ toolkitSlug: string;
2257
+ id: string;
2258
+ triggerSlug: string;
2259
+ metadata: {
2260
+ toolkitSlug: string;
2261
+ id: string;
2262
+ triggerSlug: string;
1992
2263
  triggerConfig: Record<string, unknown>;
1993
- connection: {
2264
+ connectedAccount: {
2265
+ status: "ACTIVE" | "INACTIVE";
2266
+ userId: string;
1994
2267
  id: string;
1995
- integrationId: string;
1996
- clientUniqueUserId: string;
1997
- status: string;
2268
+ uuid: string;
2269
+ authConfigId: string;
2270
+ authConfigUUID: string;
1998
2271
  };
2272
+ triggerData?: string | undefined;
1999
2273
  };
2000
- };
2274
+ payload?: Record<string, unknown> | undefined;
2275
+ originalPayload?: Record<string, unknown> | undefined;
2276
+ }, {
2277
+ userId: string;
2278
+ toolkitSlug: string;
2279
+ id: string;
2280
+ triggerSlug: string;
2281
+ metadata: {
2282
+ toolkitSlug: string;
2283
+ id: string;
2284
+ triggerSlug: string;
2285
+ triggerConfig: Record<string, unknown>;
2286
+ connectedAccount: {
2287
+ status: "ACTIVE" | "INACTIVE";
2288
+ userId: string;
2289
+ id: string;
2290
+ uuid: string;
2291
+ authConfigId: string;
2292
+ authConfigUUID: string;
2293
+ };
2294
+ triggerData?: string | undefined;
2295
+ };
2296
+ payload?: Record<string, unknown> | undefined;
2297
+ originalPayload?: Record<string, unknown> | undefined;
2298
+ }>;
2299
+ type IncomingTriggerPayload = z.infer<typeof IncomingTriggerPayloadSchema>;
2001
2300
 
2002
2301
  /**
2003
2302
  * Trigger (Instance) class
@@ -2006,12 +2305,33 @@ type TriggerData = {
2006
2305
  */
2007
2306
  declare class Triggers {
2008
2307
  private client;
2308
+ private pusherService;
2009
2309
  constructor(client: ComposioClient);
2310
+ /**
2311
+ * Parse the trigger instance list active item
2312
+ *
2313
+ * @param response - The response from the composio client
2314
+ * @returns The parsed trigger instance list active item
2315
+ */
2316
+ private parseTriggerInstanceListActiveItem;
2010
2317
  /**
2011
2318
  * Fetch list of all the active triggers
2012
- * @returns {Promise<TriggerInstance[]>} List of trigger instances
2319
+ *
2320
+ * @param {TriggerInstanceListActiveParams} query - The query parameters to filter the trigger instances
2321
+ * @returns {Promise<TriggerInstanceListActiveResponse>} List of trigger instances
2322
+ *
2323
+ * @throws {ValidationError} If the parameters are invalid
2324
+ * @throws {Error} If the client is not authenticated
2325
+ *
2326
+ * @example
2327
+ * ```ts
2328
+ * const triggers = await triggers.listActive({
2329
+ * authConfigIds: ['123'],
2330
+ * connectedAccountIds: ['456'],
2331
+ * });
2332
+ * ```
2013
2333
  */
2014
- list(query?: TriggerInstanceListActiveParams, options?: RequestOptions): Promise<ComposioClient.TriggerInstances.TriggerInstanceListActiveResponse>;
2334
+ listActive(query?: TriggerInstanceListActiveParams): Promise<TriggerInstanceListActiveResponse>;
2015
2335
  /**
2016
2336
  * Create a new trigger instance
2017
2337
  *
@@ -2019,47 +2339,36 @@ declare class Triggers {
2019
2339
  * @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
2020
2340
  * @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
2021
2341
  */
2022
- create(slug: string, body: TriggerInstanceUpsertParams, options?: RequestOptions): Promise<TriggerInstanceUpsertResponse>;
2342
+ create(slug: string, body: TriggerInstanceUpsertParams): Promise<TriggerInstanceUpsertResponse>;
2023
2343
  /**
2024
2344
  * Update an existing trigger instance
2025
2345
  *
2026
2346
  * @param {string} slug - The slug of the trigger instance
2027
- * @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
2347
+ * @param {TriggerInstanceManageUpdateParams} body - The parameters to create the trigger instance
2028
2348
  * @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
2029
2349
  */
2030
- update(slug: string, body: TriggerInstanceUpsertParams, options?: RequestOptions): Promise<TriggerInstanceUpsertResponse>;
2350
+ update(slug: string, body: TriggerInstanceManageUpdateParams): Promise<TriggerInstanceManageUpdateResponse>;
2031
2351
  /**
2032
2352
  * Delete a trigger instance
2033
2353
  *
2034
- * @param {string} slug - The slug of the trigger instance
2354
+ * @param {string} triggerId - The slug of the trigger instance
2035
2355
  * @returns
2036
2356
  */
2037
- delete(slug: string): Promise<TriggerInstanceRemoveUpsertResponse>;
2038
- /**
2039
- * Update the status of a trigger
2040
- *
2041
- * @param {TriggerStatusEnum} status - The new status of the trigger
2042
- * @param {TriggerInstanceUpdateStatusParams} params - The parameters to update the trigger instance
2043
- * @param {RequestOptions} options - Request options
2044
- * @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
2045
- */
2046
- updateStatus(status: TriggerStatusEnum, params: TriggerInstanceUpdateStatusParams, options?: RequestOptions): Promise<ComposioClient.TriggerInstances.TriggerInstanceUpdateStatusResponse>;
2357
+ delete(triggerId: string): Promise<TriggerInstanceManageDeleteResponse>;
2047
2358
  /**
2048
2359
  * Disable a trigger instance
2049
2360
  *
2050
- * @param {string} slug - The slug of the trigger instance
2051
- * @param {RequestOptions options - Request options
2361
+ * @param {string} triggerId - The id of the trigger instance
2052
2362
  * @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
2053
2363
  */
2054
- disable(slug: string, options?: RequestOptions): Promise<ComposioClient.TriggerInstances.TriggerInstanceUpdateStatusResponse>;
2364
+ disable(triggerId: string): Promise<ComposioClient.TriggerInstances.Manage.ManageUpdateResponse>;
2055
2365
  /**
2056
2366
  * Enable a trigger instance
2057
2367
  *
2058
- * @param {string} slug - The slug of the trigger instance
2059
- * @param {RequestOptions options - Request options
2368
+ * @param {string} triggerId - The id of the trigger instance
2060
2369
  * @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
2061
2370
  */
2062
- enable(slug: string, options?: RequestOptions): Promise<ComposioClient.TriggerInstances.TriggerInstanceUpdateStatusResponse>;
2371
+ enable(triggerId: string): Promise<ComposioClient.TriggerInstances.Manage.ManageUpdateResponse>;
2063
2372
  /**
2064
2373
  * @TODO Learn about trigger types
2065
2374
  */
@@ -2070,7 +2379,7 @@ declare class Triggers {
2070
2379
  * @param {RequestOptions} options - Request options
2071
2380
  * @returns {Promise<TriggersTypeListResponse>} The list of trigger types
2072
2381
  */
2073
- listTypes(query?: TriggersTypeListParams, options?: RequestOptions): Promise<TriggersTypeListResponse>;
2382
+ listTypes(query?: TriggersTypeListParams): Promise<TriggersTypeListResponse>;
2074
2383
  /**
2075
2384
  * Retrieve a trigger type by its slug
2076
2385
  *
@@ -2078,7 +2387,7 @@ declare class Triggers {
2078
2387
  * @param {RequestOptions} options - request options
2079
2388
  * @returns {Promise<TriggersTypeRetrieveResponse>} The trigger type object
2080
2389
  */
2081
- getType(slug: string, options?: RequestOptions): Promise<TriggersTypeRetrieveResponse>;
2390
+ getType(slug: string): Promise<TriggersTypeRetrieveResponse>;
2082
2391
  /**
2083
2392
  * Fetches the list of all the available trigger enums
2084
2393
  *
@@ -2086,8 +2395,36 @@ declare class Triggers {
2086
2395
  * @param options
2087
2396
  * @returns
2088
2397
  */
2089
- listEnum(options?: RequestOptions): Promise<TriggersTypeRetrieveEnumResponse>;
2090
- subscribe(fn: (_data: TriggerData) => void, filters?: TriggerSubscribeParams): Promise<void>;
2398
+ listEnum(): Promise<TriggersTypeRetrieveEnumResponse>;
2399
+ /**
2400
+ * Subscribe to all the triggers
2401
+ *
2402
+ * @param fn - The function to call when a trigger is received
2403
+ * @param filters - The filters to apply to the triggers
2404
+ *
2405
+ * @example
2406
+ * ```ts
2407
+ *
2408
+ * triggers.subscribe((data) => {
2409
+ * console.log(data);
2410
+ * }, );
2411
+ * ```
2412
+ */
2413
+ subscribe(fn: (_data: IncomingTriggerPayload) => void, filters?: TriggerSubscribeParams): Promise<void>;
2414
+ /**
2415
+ * Unsubscribe from all the triggers
2416
+ *
2417
+ * @returns {Promise<void>}
2418
+ *
2419
+ * @example
2420
+ * ```ts
2421
+ * composio.trigger.subscribe((data) => {
2422
+ * console.log(data);
2423
+ * });
2424
+ *
2425
+ * await triggers.unsubscribe();
2426
+ * ```
2427
+ */
2091
2428
  unsubscribe(): Promise<void>;
2092
2429
  }
2093
2430
 
@@ -2224,16 +2561,16 @@ declare const AuthConfigListParamsSchema: z.ZodObject<{
2224
2561
  cursor: z.ZodOptional<z.ZodString>;
2225
2562
  isComposioManaged: z.ZodOptional<z.ZodBoolean>;
2226
2563
  limit: z.ZodOptional<z.ZodNumber>;
2227
- toolkitSlug: z.ZodOptional<z.ZodString>;
2564
+ toolkit: z.ZodOptional<z.ZodString>;
2228
2565
  }, "strip", z.ZodTypeAny, {
2566
+ toolkit?: string | undefined;
2229
2567
  cursor?: string | undefined;
2230
2568
  limit?: number | undefined;
2231
- toolkitSlug?: string | undefined;
2232
2569
  isComposioManaged?: boolean | undefined;
2233
2570
  }, {
2571
+ toolkit?: string | undefined;
2234
2572
  cursor?: string | undefined;
2235
2573
  limit?: number | undefined;
2236
- toolkitSlug?: string | undefined;
2237
2574
  isComposioManaged?: boolean | undefined;
2238
2575
  }>;
2239
2576
  type AuthConfigListParams = z.infer<typeof AuthConfigListParamsSchema>;
@@ -2296,7 +2633,7 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2296
2633
  createdBy?: string | undefined;
2297
2634
  lastUpdatedAt?: string | undefined;
2298
2635
  }>, "many">;
2299
- nextCursor: z.ZodOptional<z.ZodString>;
2636
+ nextCursor: z.ZodNullable<z.ZodString>;
2300
2637
  totalPages: z.ZodNumber;
2301
2638
  }, "strip", z.ZodTypeAny, {
2302
2639
  items: {
@@ -2317,8 +2654,8 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2317
2654
  createdBy?: string | undefined;
2318
2655
  lastUpdatedAt?: string | undefined;
2319
2656
  }[];
2657
+ nextCursor: string | null;
2320
2658
  totalPages: number;
2321
- nextCursor?: string | undefined;
2322
2659
  }, {
2323
2660
  items: {
2324
2661
  name: string;
@@ -2338,8 +2675,8 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
2338
2675
  createdBy?: string | undefined;
2339
2676
  lastUpdatedAt?: string | undefined;
2340
2677
  }[];
2678
+ nextCursor: string | null;
2341
2679
  totalPages: number;
2342
- nextCursor?: string | undefined;
2343
2680
  }>;
2344
2681
  type AuthConfigListResponse = z.infer<typeof AuthConfigListResponseSchema>;
2345
2682
  declare const AuthConfigUpdateParamsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -2422,7 +2759,7 @@ declare class AuthConfigs {
2422
2759
  *
2423
2760
  * // List auth configs for a specific toolkit
2424
2761
  * const githubConfigs = await composio.authConfigs.list({
2425
- * toolkitSlug: 'github'
2762
+ * toolkit: 'github'
2426
2763
  * });
2427
2764
  *
2428
2765
  * // List Composio-managed auth configs
@@ -2814,7 +3151,7 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
2814
3151
  * @param {string} userId - The user id.
2815
3152
  * @returns {Promise<string[]>} The results of the tool call.
2816
3153
  */
2817
- handleToolCall(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
3154
+ handleToolCalls(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
2818
3155
  /**
2819
3156
  * Handles all the tool calls from the assistant.
2820
3157
  *
@@ -2846,8 +3183,8 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
2846
3183
  }
2847
3184
 
2848
3185
  type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> = {
2849
- apiKey?: string;
2850
- baseURL?: string;
3186
+ apiKey?: string | null;
3187
+ baseURL?: string | null;
2851
3188
  allowTracking?: boolean;
2852
3189
  allowTracing?: boolean;
2853
3190
  provider?: TProvider;
@@ -2886,7 +3223,7 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
2886
3223
  * @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
2887
3224
  * @param {TProvider} config.provider The provider to use for this Composio instance.
2888
3225
  */
2889
- constructor(config: ComposioConfig<TProvider>);
3226
+ constructor(config?: ComposioConfig<TProvider>);
2890
3227
  /**
2891
3228
  * Get the Composio SDK client.
2892
3229
  * @returns {ComposioClient} The Composio API client.
@@ -2909,6 +3246,244 @@ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>,
2909
3246
  wrapTools(tools: Tool[]): CustomTool[];
2910
3247
  }
2911
3248
 
2912
- declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
3249
+ /**
3250
+ * Convert a JSON schema to a Zod schema
3251
+ * @param jsonSchema - The JSON schema to convert
3252
+ * @returns The Zod schema
3253
+ *
3254
+ * @example
3255
+ * ```ts
3256
+ * const zodSchema = jsonSchemaToZodSchema({
3257
+ * type: 'object',
3258
+ * properties: {
3259
+ * name: { type: 'string' },
3260
+ * },
3261
+ * });
3262
+ *
3263
+ * console.log(zodSchema);
3264
+ * ```
3265
+ */
3266
+ declare function jsonSchemaToZodSchema(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
3267
+
3268
+ declare const LOG_LEVELS: {
3269
+ readonly silent: -1;
3270
+ readonly error: 0;
3271
+ readonly warn: 1;
3272
+ readonly info: 2;
3273
+ readonly debug: 3;
3274
+ };
3275
+ type LogLevel = keyof typeof LOG_LEVELS;
3276
+ interface LoggerOptions {
3277
+ level?: LogLevel;
3278
+ includeTimestamp?: boolean;
3279
+ }
3280
+ declare class Logger {
3281
+ private readonly level;
3282
+ private readonly includeTimestamp;
3283
+ private readonly console;
3284
+ constructor(options?: LoggerOptions);
3285
+ private formatMessage;
3286
+ private shouldLog;
3287
+ error(...args: unknown[]): void;
3288
+ warn(...args: unknown[]): void;
3289
+ info(...args: unknown[]): void;
3290
+ debug(...args: unknown[]): void;
3291
+ }
3292
+ declare const logger: Logger;
3293
+
3294
+ /**
3295
+ * Options for error handling
3296
+ */
3297
+ interface ErrorHandleOptions {
3298
+ /** Whether to include the stack trace in the output */
3299
+ includeStack?: boolean;
3300
+ /** Whether to exit the process after handling */
3301
+ exitProcess?: boolean;
3302
+ /** The exit code to use if exiting the process */
3303
+ exitCode?: number;
3304
+ }
3305
+ /**
3306
+ * Options for creating a ComposioError
3307
+ */
3308
+ type ComposioErrorOptions = {
3309
+ /** Error code for categorizing errors */
3310
+ code?: string;
3311
+ /** HTTP status code associated with the error */
3312
+ statusCode?: number;
3313
+ /** The underlying cause of the error */
3314
+ cause?: unknown;
3315
+ /** Additional metadata associated with the error */
3316
+ meta?: Record<string, unknown>;
3317
+ /** Suggested fixes for the error */
3318
+ possibleFixes?: string[];
3319
+ /** Custom stack trace */
3320
+ stack?: string;
3321
+ };
3322
+ /**
3323
+ * Base error class for all Composio errors
3324
+ */
3325
+ declare class ComposioError extends Error {
3326
+ /** @readonly Error name */
3327
+ name: string;
3328
+ code?: string;
3329
+ possibleFixes?: string[];
3330
+ errorId?: string;
3331
+ /**
3332
+ * Creates a new ComposioError
3333
+ * @param message Error message
3334
+ * @param options Additional error options
3335
+ */
3336
+ constructor(message: string, options?: ComposioErrorOptions);
3337
+ /**
3338
+ * Helper method to define a property only if it has a value
3339
+ * @param propertyName Name of the property to define
3340
+ * @param value Value to assign to the property
3341
+ * @private
3342
+ */
3343
+ private definePropertyIfExists;
3344
+ /**
3345
+ * Helper method to combine stack traces when wrapping errors
3346
+ * This ensures the full call chain is preserved
3347
+ * @param originalStack The stack of the error being wrapped
3348
+ * @param currentStack The stack of the wrapper error
3349
+ * @returns Combined stack trace
3350
+ * @private
3351
+ */
3352
+ private static combineStackTraces;
3353
+ /**
3354
+ * Extract and normalize error data for formatting
3355
+ * @param includeStack Whether to include stack trace information
3356
+ * @returns Structured error data for formatting
3357
+ * @private
3358
+ */
3359
+ private getErrorData;
3360
+ /**
3361
+ * Prints a user-friendly, colorful representation of the error to the logger
3362
+ * @param includeStack Whether to include the stack trace in the output (default: false)
3363
+ */
3364
+ prettyPrint(includeStack?: boolean): void;
3365
+ /**
3366
+ * Static factory method to create and pretty print an error in one step
3367
+ * @param message Error message
3368
+ * @param options Error options
3369
+ * @param includeStack Whether to include the stack trace in the output
3370
+ * @returns The created error instance
3371
+ */
3372
+ static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError;
3373
+ /**
3374
+ * Utility function to handle errors in a consistent way
3375
+ * This properly displays the error and exits the process if needed
3376
+ * @param error The error to handle
3377
+ * @param options Options for error handling
3378
+ */
3379
+ static handle(error: unknown, options?: ErrorHandleOptions): void;
3380
+ /**
3381
+ * Helper method to handle Zod validation errors
3382
+ * @param error The Zod error to handle
3383
+ * @param includeStack Whether to include the stack trace
3384
+ * @private
3385
+ */
3386
+ private static handleZodError;
3387
+ /**
3388
+ * Helper method to handle standard Error objects
3389
+ * @param error The standard error to handle
3390
+ * @param includeStack Whether to include the stack trace
3391
+ * @private
3392
+ */
3393
+ private static handleStandardError;
3394
+ /**
3395
+ * Helper method to handle unknown error types
3396
+ * @param error The unknown error value
3397
+ * @private
3398
+ */
3399
+ private static handleUnknownError;
3400
+ }
3401
+
3402
+ declare const AuthConfigErrorCodes: {
3403
+ readonly AUTH_CONFIG_NOT_FOUND: "AUTH_CONFIG_NOT_FOUND";
3404
+ };
3405
+ declare class ComposioAuthConfigNotFoundError extends ComposioError {
3406
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3407
+ }
3408
+
3409
+ declare const ConnectedAccountErrorCodes: {
3410
+ readonly CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND";
3411
+ };
3412
+ declare class ComposioConnectedAccountNotFoundError extends ComposioError {
3413
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
3414
+ }
3415
+
3416
+ declare const ConnectionRequestErrorCodes: {
3417
+ readonly CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT";
3418
+ readonly CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED";
3419
+ };
3420
+ declare class ConnectionRequestTimeoutError extends ComposioError {
3421
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3422
+ }
3423
+ declare class ConnectionRequestFailedError extends ComposioError {
3424
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3425
+ }
3426
+
3427
+ declare const ToolErrorCodes: {
3428
+ readonly TOOLSET_NOT_DEFINED: "TOOLSET_NOT_DEFINED";
3429
+ readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
3430
+ readonly INVALID_MODIFIER: "INVALID_MODIFIER";
3431
+ readonly CUSTOM_TOOLS_NOT_INITIALIZED: "CUSTOM_TOOLS_NOT_INITIALIZED";
3432
+ readonly TOOL_EXECUTION_ERROR: "TOOL_EXECUTION_ERROR";
3433
+ readonly INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION";
3434
+ readonly GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET";
3435
+ };
3436
+ declare class ComposioProviderNotDefinedError extends ComposioError {
3437
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3438
+ }
3439
+ declare class ComposioToolNotFoundError extends ComposioError {
3440
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
3441
+ }
3442
+ declare class ComposioInvalidModifierError extends ComposioError {
3443
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3444
+ }
3445
+ declare class ComposioCustomToolsNotInitializedError extends ComposioError {
3446
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3447
+ }
3448
+ declare class ComposioToolExecutionError extends ComposioError {
3449
+ readonly error: Error;
3450
+ constructor(message?: string, options?: ComposioErrorOptions & {
3451
+ originalError?: Error;
3452
+ });
3453
+ }
3454
+ declare class ComposioInvalidExecuteFunctionError extends ComposioError {
3455
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3456
+ }
3457
+ declare class ComposioGlobalExecuteToolFnNotSetError extends ComposioError {
3458
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
3459
+ }
3460
+
3461
+ declare const ToolkitErrorCodes: {
3462
+ readonly TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND";
3463
+ };
3464
+ declare class ComposioToolkitNotFoundError extends ComposioError {
3465
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
3466
+ }
3467
+ declare class ComposioToolkitFetchError extends ComposioError {
3468
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
3469
+ }
3470
+
3471
+ /**
3472
+ * Represents an input validation error using Zod.
3473
+ */
3474
+ declare const ValidationErrorCodes: {
3475
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
3476
+ };
3477
+ declare class ValidationError extends ComposioError {
3478
+ constructor(message?: string, options?: ComposioErrorOptions);
3479
+ private generateUserFriendlyMessage;
3480
+ }
3481
+
3482
+ declare const SDKErrorCodes: {
3483
+ NO_API_KEY_PROVIDED: string;
3484
+ };
3485
+ declare class ComposioNoAPIKeyError extends ComposioError {
3486
+ constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
3487
+ }
2913
3488
 
2914
- export { type AgenticToolOptions, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioProvider, ConsoleTelemetryTransport, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type TransformToolSchemaModifier, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToModel };
3489
+ export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConsoleTelemetryTransport, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, ToolkitErrorCodes, type TransformToolSchemaModifier, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger };