@composio/core 0.10.0 → 0.12.0

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.
Files changed (69) hide show
  1. package/dist/{tool.types-CwbAy9l_.d.cts → BaseProvider-BBnsv9kS.d.mts} +23683 -23635
  2. package/dist/CustomTool-DEB4BQPl.mjs +468 -0
  3. package/dist/{CustomTool-aber890o.d.cts → CustomTool-DH18rVQu.d.mts} +2 -4
  4. package/dist/{FileModifierErrors-C7z16Dfi.mjs → FileModifierErrors-3fSwIWoa.mjs} +35 -36
  5. package/dist/{FileToolModifier.utils.neutral-B7P7wn-b.mjs → FileToolModifier.utils.neutral-B5rT711M.mjs} +1 -7
  6. package/dist/{Telemetry-kgWlkavX.mjs → Telemetry-DhGI_J4G.mjs} +48 -23
  7. package/dist/{composio-CSMCZZgj.d.cts → composio-CHnEggnv.d.mts} +433 -435
  8. package/dist/{customTool.types-BzEWHa0w.d.cts → customTool.types-DpIdOJjL.d.mts} +177 -236
  9. package/dist/{CustomTool-D7-1S2at.mjs → errors-D5f4pfvI.mjs} +132 -519
  10. package/dist/experimental/index.d.mts +2 -3
  11. package/dist/experimental/index.mjs +1 -3
  12. package/dist/{fileUtils.node-Dq7ebZPC.mjs → fileUtils.node-BiO1JQsJ.mjs} +26 -25
  13. package/dist/index.d.mts +2034 -2356
  14. package/dist/index.mjs +2546 -2335
  15. package/dist/jsonSchema-daqF3S3d.mjs +251 -0
  16. package/dist/models/Files.node.d.mts +1 -2
  17. package/dist/models/Files.node.mjs +3 -4
  18. package/dist/models/Files.workerd.d.mts +0 -1
  19. package/dist/platform/node.d.mts +1 -2
  20. package/dist/platform/workerd.d.mts +1 -2
  21. package/dist/{chunk-CWQeghP5.mjs → rolldown-runtime-w6R9maHv.mjs} +3 -5
  22. package/dist/{types-DE7O6Z6S.d.cts → types-CaI5Z4PA.d.mts} +2 -3
  23. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -4
  24. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -4
  25. package/dist/utils/config-defaults/ConfigDefaults.workerd.mjs +3 -0
  26. package/dist/utils/json-schema.d.mts +2 -0
  27. package/dist/utils/json-schema.mjs +3 -0
  28. package/dist/utils/modifiers/FileToolModifier.node.d.mts +3 -1
  29. package/dist/utils/modifiers/FileToolModifier.node.mjs +81 -44
  30. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +3 -1
  31. package/dist/utils/modifiers/FileToolModifier.workerd.mjs +1 -1
  32. package/package.json +48 -88
  33. package/dist/CustomTool-CQ_YjABZ.cjs +0 -1341
  34. package/dist/CustomTool-DJUGNOer.d.mts +0 -76
  35. package/dist/FileModifierErrors-BYJBHiay.cjs +0 -554
  36. package/dist/FileToolModifier.utils.neutral-Dfwqgimk.cjs +0 -102
  37. package/dist/Telemetry-Dm-0sewu.cjs +0 -335
  38. package/dist/buffer-BjWptbNH.cjs +0 -63
  39. package/dist/chunk-CQwRTUmo.cjs +0 -53
  40. package/dist/composio-DRl6WCI9.d.mts +0 -5484
  41. package/dist/customTool.types-CMOMgxoM.d.mts +0 -2513
  42. package/dist/experimental/index.cjs +0 -5
  43. package/dist/experimental/index.d.cts +0 -3
  44. package/dist/fileUtils.node-DtnSRMWa.cjs +0 -462
  45. package/dist/files.types-lo4zZd87.d.cts +0 -17
  46. package/dist/index.cjs +0 -8637
  47. package/dist/index.d.cts +0 -5672
  48. package/dist/models/Files.node.cjs +0 -55
  49. package/dist/models/Files.node.d.cts +0 -56
  50. package/dist/models/Files.workerd.cjs +0 -29
  51. package/dist/models/Files.workerd.d.cts +0 -13
  52. package/dist/platform/node.cjs +0 -55
  53. package/dist/platform/node.d.cts +0 -11
  54. package/dist/platform/workerd.cjs +0 -42
  55. package/dist/platform/workerd.d.cts +0 -12
  56. package/dist/tool.types-CB_4JKhV.d.mts +0 -29377
  57. package/dist/types-BTOPdg4d.d.mts +0 -13
  58. package/dist/types-pDNm1lYs.d.cts +0 -69
  59. package/dist/utils/config-defaults/ConfigDefaults.node.cjs +0 -10
  60. package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +0 -7
  61. package/dist/utils/config-defaults/ConfigDefaults.workerd.cjs +0 -10
  62. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +0 -7
  63. package/dist/utils/modifiers/FileToolModifier.node.cjs +0 -207
  64. package/dist/utils/modifiers/FileToolModifier.node.d.cts +0 -22
  65. package/dist/utils/modifiers/FileToolModifier.workerd.cjs +0 -27
  66. package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +0 -20
  67. /package/dist/{buffer-yOtEsT4J.mjs → buffer-PcbMMsgm.mjs} +0 -0
  68. /package/dist/{files.types-BXDWA_zS.d.mts → files.types-DeMC_mAW.d.mts} +0 -0
  69. /package/dist/{types-HpJQ8K9l.d.mts → types-DdoCRzLj.d.mts} +0 -0
@@ -1,2513 +0,0 @@
1
- import { R as SessionMetaToolOptions, nn as ConnectionDataSchema, o as Tool, q as BaseComposioProvider, tn as ConnectionData, v as ToolProxyParams } from "./tool.types-CB_4JKhV.mjs";
2
- import { Composio } from "@composio/client";
3
- import z, { z as z$1 } from "zod/v3";
4
- import { ConnectedAccountUpdateStatusParams as UpdateConnectedAccountParams } from "@composio/client/resources/connected-accounts";
5
- import { SessionCreateParams, SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
6
- import { ToolExecuteResponse } from "@composio/client/resources/tools";
7
-
8
- //#region src/types/connectedAccounts.types.d.ts
9
- /**
10
- * Connected Account create parameters
11
- */
12
- declare const ConnectedAccountStatuses: {
13
- readonly INITIALIZING: "INITIALIZING";
14
- readonly INITIATED: "INITIATED";
15
- readonly ACTIVE: "ACTIVE";
16
- readonly FAILED: "FAILED";
17
- readonly EXPIRED: "EXPIRED";
18
- readonly INACTIVE: "INACTIVE";
19
- readonly REVOKED: "REVOKED";
20
- };
21
- declare const ConnectedAccountStatusSchema: z$1.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE", "REVOKED"]>;
22
- type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
23
- type ConnectedAccountStatusEnum = z$1.infer<typeof ConnectedAccountStatusSchema>;
24
- /**
25
- * Sharing model for a connected account.
26
- *
27
- * - `PRIVATE` (default): only the owning `userId` can use the connection.
28
- * - `SHARED`: can be used by other `userId`s, but only when the connection
29
- * is explicitly pinned in a tool-router session's config and only when
30
- * the requesting `userId` passes the connection's ACL (see
31
- * `allowAllUsers` / `allowedUserIds` / `notAllowedUserIds`).
32
- */
33
- declare const ConnectedAccountTypes: {
34
- readonly PRIVATE: "PRIVATE";
35
- readonly SHARED: "SHARED";
36
- };
37
- declare const ConnectedAccountTypeSchema: z$1.ZodEnum<["PRIVATE", "SHARED"]>;
38
- type ConnectedAccountType = (typeof ConnectedAccountTypes)[keyof typeof ConnectedAccountTypes];
39
- declare const ConnectedAccountAclConfigSchema: z$1.ZodObject<{
40
- allowAllUsers: z$1.ZodOptional<z$1.ZodBoolean>;
41
- allowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
42
- notAllowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
43
- }, "strip", z$1.ZodTypeAny, {
44
- allowAllUsers?: boolean | undefined;
45
- allowedUserIds?: string[] | undefined;
46
- notAllowedUserIds?: string[] | undefined;
47
- }, {
48
- allowAllUsers?: boolean | undefined;
49
- allowedUserIds?: string[] | undefined;
50
- notAllowedUserIds?: string[] | undefined;
51
- }>;
52
- type ConnectedAccountAclConfig = z$1.infer<typeof ConnectedAccountAclConfigSchema>;
53
- /**
54
- * Resolved ACL as it appears on responses. All three fields are populated
55
- * when the field is visible; the field itself is `undefined` for callers
56
- * not authorised to see it.
57
- */
58
- declare const ConnectedAccountAclConfigResponseSchema: z$1.ZodObject<{
59
- allowAllUsers: z$1.ZodBoolean;
60
- allowedUserIds: z$1.ZodArray<z$1.ZodString, "many">;
61
- notAllowedUserIds: z$1.ZodArray<z$1.ZodString, "many">;
62
- }, "strip", z$1.ZodTypeAny, {
63
- allowAllUsers: boolean;
64
- allowedUserIds: string[];
65
- notAllowedUserIds: string[];
66
- }, {
67
- allowAllUsers: boolean;
68
- allowedUserIds: string[];
69
- notAllowedUserIds: string[];
70
- }>;
71
- type ConnectedAccountAclConfigResponse = z$1.infer<typeof ConnectedAccountAclConfigResponseSchema>;
72
- /**
73
- * Experimental options for SHARED connections, passed at create / link time.
74
- *
75
- * **Experimental — shape may change in future releases.** Wrapped under a
76
- * dedicated `experimental` block on every input and response so the
77
- * experimental status is visible at every call site.
78
- */
79
- declare const ConnectedAccountExperimentalSchema: z$1.ZodObject<{
80
- accountType: z$1.ZodOptional<z$1.ZodEnum<["PRIVATE", "SHARED"]>>;
81
- aclConfigForShared: z$1.ZodOptional<z$1.ZodObject<{
82
- allowAllUsers: z$1.ZodOptional<z$1.ZodBoolean>;
83
- allowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
84
- notAllowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
85
- }, "strip", z$1.ZodTypeAny, {
86
- allowAllUsers?: boolean | undefined;
87
- allowedUserIds?: string[] | undefined;
88
- notAllowedUserIds?: string[] | undefined;
89
- }, {
90
- allowAllUsers?: boolean | undefined;
91
- allowedUserIds?: string[] | undefined;
92
- notAllowedUserIds?: string[] | undefined;
93
- }>>;
94
- }, "strip", z$1.ZodTypeAny, {
95
- accountType?: "PRIVATE" | "SHARED" | undefined;
96
- aclConfigForShared?: {
97
- allowAllUsers?: boolean | undefined;
98
- allowedUserIds?: string[] | undefined;
99
- notAllowedUserIds?: string[] | undefined;
100
- } | undefined;
101
- }, {
102
- accountType?: "PRIVATE" | "SHARED" | undefined;
103
- aclConfigForShared?: {
104
- allowAllUsers?: boolean | undefined;
105
- allowedUserIds?: string[] | undefined;
106
- notAllowedUserIds?: string[] | undefined;
107
- } | undefined;
108
- }>;
109
- type ConnectedAccountExperimental = z$1.infer<typeof ConnectedAccountExperimentalSchema>;
110
- /**
111
- * Resolved experimental block on retrieve / list responses. `accountType`
112
- * is always present when the block is; `aclConfigForShared` is only
113
- * present when the caller is authorised to see the ACL.
114
- */
115
- declare const ConnectedAccountExperimentalResponseSchema: z$1.ZodObject<{
116
- accountType: z$1.ZodOptional<z$1.ZodEnum<["PRIVATE", "SHARED"]>>;
117
- aclConfigForShared: z$1.ZodOptional<z$1.ZodObject<{
118
- allowAllUsers: z$1.ZodBoolean;
119
- allowedUserIds: z$1.ZodArray<z$1.ZodString, "many">;
120
- notAllowedUserIds: z$1.ZodArray<z$1.ZodString, "many">;
121
- }, "strip", z$1.ZodTypeAny, {
122
- allowAllUsers: boolean;
123
- allowedUserIds: string[];
124
- notAllowedUserIds: string[];
125
- }, {
126
- allowAllUsers: boolean;
127
- allowedUserIds: string[];
128
- notAllowedUserIds: string[];
129
- }>>;
130
- }, "strip", z$1.ZodTypeAny, {
131
- accountType?: "PRIVATE" | "SHARED" | undefined;
132
- aclConfigForShared?: {
133
- allowAllUsers: boolean;
134
- allowedUserIds: string[];
135
- notAllowedUserIds: string[];
136
- } | undefined;
137
- }, {
138
- accountType?: "PRIVATE" | "SHARED" | undefined;
139
- aclConfigForShared?: {
140
- allowAllUsers: boolean;
141
- allowedUserIds: string[];
142
- notAllowedUserIds: string[];
143
- } | undefined;
144
- }>;
145
- type ConnectedAccountExperimentalResponse = z$1.infer<typeof ConnectedAccountExperimentalResponseSchema>;
146
- declare const CreateConnectedAccountParamsSchema: z$1.ZodObject<{
147
- authConfig: z$1.ZodObject<{
148
- id: z$1.ZodString;
149
- }, "strip", z$1.ZodTypeAny, {
150
- id: string;
151
- }, {
152
- id: string;
153
- }>;
154
- connection: z$1.ZodObject<{
155
- data: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
156
- callbackUrl: z$1.ZodOptional<z$1.ZodString>;
157
- userId: z$1.ZodOptional<z$1.ZodString>;
158
- }, "strip", z$1.ZodTypeAny, {
159
- userId?: string | undefined;
160
- data?: Record<string, unknown> | undefined;
161
- callbackUrl?: string | undefined;
162
- }, {
163
- userId?: string | undefined;
164
- data?: Record<string, unknown> | undefined;
165
- callbackUrl?: string | undefined;
166
- }>;
167
- }, "strip", z$1.ZodTypeAny, {
168
- authConfig: {
169
- id: string;
170
- };
171
- connection: {
172
- userId?: string | undefined;
173
- data?: Record<string, unknown> | undefined;
174
- callbackUrl?: string | undefined;
175
- };
176
- }, {
177
- authConfig: {
178
- id: string;
179
- };
180
- connection: {
181
- userId?: string | undefined;
182
- data?: Record<string, unknown> | undefined;
183
- callbackUrl?: string | undefined;
184
- };
185
- }>;
186
- declare const DefaultCreateConnectedAccountParamsSchema: z$1.ZodType<{
187
- auth_config: {
188
- id: string;
189
- };
190
- connection: {
191
- state?: z$1.infer<typeof ConnectionDataSchema>;
192
- data?: Record<string, unknown>;
193
- callback_url?: string;
194
- user_id?: string;
195
- alias?: string;
196
- };
197
- }>;
198
- declare const CreateConnectedAccountOptionsSchema: z$1.ZodType<{
199
- allowMultiple?: boolean;
200
- callbackUrl?: string;
201
- config?: z$1.infer<typeof ConnectionDataSchema>;
202
- alias?: string;
203
- }>;
204
- type CreateConnectedAccountOptions = z$1.infer<typeof CreateConnectedAccountOptionsSchema>;
205
- type CreateConnectedAccountParams = z$1.infer<typeof CreateConnectedAccountParamsSchema>;
206
- /**
207
- * Connected Account create response
208
- */
209
- declare const CreateConnectedAccountResponseSchema: z$1.ZodObject<{
210
- id: z$1.ZodString;
211
- status: z$1.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE", "REVOKED"]>;
212
- redirectUrl: z$1.ZodNullable<z$1.ZodString>;
213
- }, "strip", z$1.ZodTypeAny, {
214
- status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED";
215
- redirectUrl: string | null;
216
- id: string;
217
- }, {
218
- status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED";
219
- redirectUrl: string | null;
220
- id: string;
221
- }>;
222
- type CreateConnectedAccountResponse = z$1.infer<typeof CreateConnectedAccountResponseSchema>;
223
- declare const ConnectedAccountAuthConfigSchema: z$1.ZodObject<{
224
- id: z$1.ZodString;
225
- /** @deprecated use connectedAccount.state.authScheme instead */
226
- authScheme: z$1.ZodOptional<z$1.ZodEnum<["OAUTH2", "OAUTH1", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "CALCOM_AUTH", "SERVICE_ACCOUNT", "SAML", "DCR_OAUTH", "S2S_OAUTH2"]>>;
227
- isComposioManaged: z$1.ZodBoolean;
228
- isDisabled: z$1.ZodBoolean;
229
- }, "strip", z$1.ZodTypeAny, {
230
- id: string;
231
- isComposioManaged: boolean;
232
- isDisabled: boolean;
233
- authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
234
- }, {
235
- id: string;
236
- isComposioManaged: boolean;
237
- isDisabled: boolean;
238
- authScheme?: "OAUTH1" | "OAUTH2" | "API_KEY" | "BASIC" | "BEARER_TOKEN" | "BILLCOM_AUTH" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "CALCOM_AUTH" | "SERVICE_ACCOUNT" | "SAML" | "DCR_OAUTH" | "S2S_OAUTH2" | undefined;
239
- }>;
240
- type ConnectedAccountAuthConfig = z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
241
- declare const ConnectedAccountRetrieveResponseSchema: z$1.ZodType<{
242
- id: string;
243
- authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
244
- wordId?: string | null;
245
- alias?: string | null;
246
- /** @deprecated use connectedAccount.state instead */
247
- data?: Record<string, unknown>;
248
- /** @deprecated use connectedAccount.state instead */
249
- params?: Record<string, unknown>;
250
- status: ConnectedAccountStatusEnum;
251
- statusReason: string | null;
252
- toolkit: {
253
- slug: string;
254
- };
255
- state?: z$1.infer<typeof ConnectionDataSchema>;
256
- testRequestEndpoint?: string;
257
- isDisabled: boolean;
258
- createdAt: string;
259
- updatedAt: string;
260
- experimental?: ConnectedAccountExperimentalResponse;
261
- }>;
262
- type ConnectedAccountRetrieveResponse = z$1.infer<typeof ConnectedAccountRetrieveResponseSchema>;
263
- /**
264
- * Type for list response item that doesn't include params
265
- */
266
- type ConnectedAccountListResponseItem = Omit<ConnectedAccountRetrieveResponse, 'params'>;
267
- declare const ConnectedAccountListParamsSchema: z$1.ZodObject<{
268
- authConfigIds: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString, "many">>>;
269
- cursor: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
270
- limit: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
271
- orderBy: z$1.ZodOptional<z$1.ZodEnum<["created_at", "updated_at"]>>;
272
- statuses: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE", "REVOKED"]>, "many">>>;
273
- toolkitSlugs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString, "many">>>;
274
- userIds: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString, "many">>>;
275
- /**
276
- * Experimental — shape may change in future releases. Filter by sharing
277
- * model. Default (omitted) returns PRIVATE only. Pass `'SHARED'` for only
278
- * shared accounts, or `'ALL'` for `PRIVATE` + `SHARED`. Kept flat because
279
- * the wire is a query string and can't carry nested objects.
280
- */
281
- accountType: z$1.ZodOptional<z$1.ZodEnum<["PRIVATE", "SHARED", "ALL"]>>;
282
- }, "strip", z$1.ZodTypeAny, {
283
- limit?: number | null | undefined;
284
- authConfigIds?: string[] | null | undefined;
285
- cursor?: string | null | undefined;
286
- accountType?: "PRIVATE" | "SHARED" | "ALL" | undefined;
287
- orderBy?: "created_at" | "updated_at" | undefined;
288
- statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED")[] | null | undefined;
289
- toolkitSlugs?: string[] | null | undefined;
290
- userIds?: string[] | null | undefined;
291
- }, {
292
- limit?: number | null | undefined;
293
- authConfigIds?: string[] | null | undefined;
294
- cursor?: string | null | undefined;
295
- accountType?: "PRIVATE" | "SHARED" | "ALL" | undefined;
296
- orderBy?: "created_at" | "updated_at" | undefined;
297
- statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED")[] | null | undefined;
298
- toolkitSlugs?: string[] | null | undefined;
299
- userIds?: string[] | null | undefined;
300
- }>;
301
- type ConnectedAccountListParams = z$1.infer<typeof ConnectedAccountListParamsSchema>;
302
- declare const ConnectedAccountListResponseSchema: z$1.ZodObject<{
303
- items: z$1.ZodArray<z$1.ZodType<{
304
- id: string;
305
- authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
306
- wordId?: string | null;
307
- alias?: string | null;
308
- /** @deprecated use connectedAccount.state instead */
309
- data?: Record<string, unknown>;
310
- /** @deprecated use connectedAccount.state instead */
311
- params?: Record<string, unknown>;
312
- status: ConnectedAccountStatusEnum;
313
- statusReason: string | null;
314
- toolkit: {
315
- slug: string;
316
- };
317
- state?: z$1.infer<typeof ConnectionDataSchema>;
318
- testRequestEndpoint?: string;
319
- isDisabled: boolean;
320
- createdAt: string;
321
- updatedAt: string;
322
- experimental?: ConnectedAccountExperimentalResponse;
323
- }, z$1.ZodTypeDef, {
324
- id: string;
325
- authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
326
- wordId?: string | null;
327
- alias?: string | null;
328
- /** @deprecated use connectedAccount.state instead */
329
- data?: Record<string, unknown>;
330
- /** @deprecated use connectedAccount.state instead */
331
- params?: Record<string, unknown>;
332
- status: ConnectedAccountStatusEnum;
333
- statusReason: string | null;
334
- toolkit: {
335
- slug: string;
336
- };
337
- state?: z$1.infer<typeof ConnectionDataSchema>;
338
- testRequestEndpoint?: string;
339
- isDisabled: boolean;
340
- createdAt: string;
341
- updatedAt: string;
342
- experimental?: ConnectedAccountExperimentalResponse;
343
- }>, "many">;
344
- nextCursor: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
345
- totalPages: z$1.ZodNumber;
346
- }, "strip", z$1.ZodTypeAny, {
347
- items: {
348
- id: string;
349
- authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
350
- wordId?: string | null;
351
- alias?: string | null;
352
- /** @deprecated use connectedAccount.state instead */
353
- data?: Record<string, unknown>;
354
- /** @deprecated use connectedAccount.state instead */
355
- params?: Record<string, unknown>;
356
- status: ConnectedAccountStatusEnum;
357
- statusReason: string | null;
358
- toolkit: {
359
- slug: string;
360
- };
361
- state?: z$1.infer<typeof ConnectionDataSchema>;
362
- testRequestEndpoint?: string;
363
- isDisabled: boolean;
364
- createdAt: string;
365
- updatedAt: string;
366
- experimental?: ConnectedAccountExperimentalResponse;
367
- }[];
368
- totalPages: number;
369
- nextCursor?: string | null | undefined;
370
- }, {
371
- items: {
372
- id: string;
373
- authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
374
- wordId?: string | null;
375
- alias?: string | null;
376
- /** @deprecated use connectedAccount.state instead */
377
- data?: Record<string, unknown>;
378
- /** @deprecated use connectedAccount.state instead */
379
- params?: Record<string, unknown>;
380
- status: ConnectedAccountStatusEnum;
381
- statusReason: string | null;
382
- toolkit: {
383
- slug: string;
384
- };
385
- state?: z$1.infer<typeof ConnectionDataSchema>;
386
- testRequestEndpoint?: string;
387
- isDisabled: boolean;
388
- createdAt: string;
389
- updatedAt: string;
390
- experimental?: ConnectedAccountExperimentalResponse;
391
- }[];
392
- totalPages: number;
393
- nextCursor?: string | null | undefined;
394
- }>;
395
- type ConnectedAccountListResponse = z$1.infer<typeof ConnectedAccountListResponseSchema>;
396
- declare const CreateConnectedAccountLinkOptionsSchema: z$1.ZodObject<{
397
- /**
398
- * The url to redirect the user to post connecting their account.
399
- *
400
- * For sucessfull connections, you will get a query param called status=success
401
- * And for failed connections you will get a query param called satus=failed
402
- *
403
- * @example https://your-app.com/callback
404
- *
405
- */
406
- callbackUrl: z$1.ZodOptional<z$1.ZodString>;
407
- /**
408
- * Human-readable alias for the connected account. Must be unique per userId and toolkit within the project.
409
- */
410
- alias: z$1.ZodOptional<z$1.ZodString>;
411
- /**
412
- * Whether to allow multiple connected accounts for the same user and auth config.
413
- * When `false` (default), `link()` throws `ComposioMultipleConnectedAccountsError`
414
- * if the user already has an `ACTIVE` connection on this auth config — matching
415
- * the guard on `initiate()`. Pair with `alias` and a session-level
416
- * `multiAccount` config to disambiguate at execution time.
417
- */
418
- allowMultiple: z$1.ZodOptional<z$1.ZodBoolean>;
419
- /**
420
- * Experimental options for SHARED connections. Pass `accountType: 'SHARED'`
421
- * (and optionally `aclConfigForShared`) to create a connection that can
422
- * be reached by other `userId`s when pinned in a session.
423
- *
424
- * Experimental — shape may change in future releases.
425
- *
426
- * `aclConfigForShared` is only valid when `accountType === 'SHARED'`;
427
- * raises `ComposioAclOnlyForSharedError` on a PRIVATE connection. Omit
428
- * the inner block (or pass `{}`) to keep the deny-by-default state: only
429
- * the creator can use the connection. Grant access by setting
430
- * `allowAllUsers: true` or listing user IDs in `allowedUserIds`.
431
- * `notAllowedUserIds` always wins over allow.
432
- */
433
- experimental: z$1.ZodOptional<z$1.ZodObject<{
434
- accountType: z$1.ZodOptional<z$1.ZodEnum<["PRIVATE", "SHARED"]>>;
435
- aclConfigForShared: z$1.ZodOptional<z$1.ZodObject<{
436
- allowAllUsers: z$1.ZodOptional<z$1.ZodBoolean>;
437
- allowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
438
- notAllowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
439
- }, "strip", z$1.ZodTypeAny, {
440
- allowAllUsers?: boolean | undefined;
441
- allowedUserIds?: string[] | undefined;
442
- notAllowedUserIds?: string[] | undefined;
443
- }, {
444
- allowAllUsers?: boolean | undefined;
445
- allowedUserIds?: string[] | undefined;
446
- notAllowedUserIds?: string[] | undefined;
447
- }>>;
448
- }, "strip", z$1.ZodTypeAny, {
449
- accountType?: "PRIVATE" | "SHARED" | undefined;
450
- aclConfigForShared?: {
451
- allowAllUsers?: boolean | undefined;
452
- allowedUserIds?: string[] | undefined;
453
- notAllowedUserIds?: string[] | undefined;
454
- } | undefined;
455
- }, {
456
- accountType?: "PRIVATE" | "SHARED" | undefined;
457
- aclConfigForShared?: {
458
- allowAllUsers?: boolean | undefined;
459
- allowedUserIds?: string[] | undefined;
460
- notAllowedUserIds?: string[] | undefined;
461
- } | undefined;
462
- }>>;
463
- }, "strip", z$1.ZodTypeAny, {
464
- callbackUrl?: string | undefined;
465
- alias?: string | undefined;
466
- allowMultiple?: boolean | undefined;
467
- experimental?: {
468
- accountType?: "PRIVATE" | "SHARED" | undefined;
469
- aclConfigForShared?: {
470
- allowAllUsers?: boolean | undefined;
471
- allowedUserIds?: string[] | undefined;
472
- notAllowedUserIds?: string[] | undefined;
473
- } | undefined;
474
- } | undefined;
475
- }, {
476
- callbackUrl?: string | undefined;
477
- alias?: string | undefined;
478
- allowMultiple?: boolean | undefined;
479
- experimental?: {
480
- accountType?: "PRIVATE" | "SHARED" | undefined;
481
- aclConfigForShared?: {
482
- allowAllUsers?: boolean | undefined;
483
- allowedUserIds?: string[] | undefined;
484
- notAllowedUserIds?: string[] | undefined;
485
- } | undefined;
486
- } | undefined;
487
- }>;
488
- type CreateConnectedAccountLinkOptions = z$1.infer<typeof CreateConnectedAccountLinkOptionsSchema>;
489
- declare const CreateConnectedAccountLinkResponseSchema: z$1.ZodObject<{
490
- redirectUrl: z$1.ZodString;
491
- }, "strip", z$1.ZodTypeAny, {
492
- redirectUrl: string;
493
- }, {
494
- redirectUrl: string;
495
- }>;
496
- type CreateConnectedAccountLinkResponse = z$1.infer<typeof CreateConnectedAccountLinkResponseSchema>;
497
- declare const ConnectedAccountRefreshOptionsSchema: z$1.ZodObject<{
498
- redirectUrl: z$1.ZodOptional<z$1.ZodString>;
499
- validateCredentials: z$1.ZodOptional<z$1.ZodBoolean>;
500
- }, "strip", z$1.ZodTypeAny, {
501
- redirectUrl?: string | undefined;
502
- validateCredentials?: boolean | undefined;
503
- }, {
504
- redirectUrl?: string | undefined;
505
- validateCredentials?: boolean | undefined;
506
- }>;
507
- type ConnectedAccountRefreshOptions = z$1.infer<typeof ConnectedAccountRefreshOptionsSchema>;
508
- declare const UpdateConnectedAccountParamsSchema: z$1.ZodObject<{
509
- enabled: z$1.ZodBoolean;
510
- }, "strip", z$1.ZodTypeAny, {
511
- enabled: boolean;
512
- }, {
513
- enabled: boolean;
514
- }>;
515
- /**
516
- * Params for `composio.connectedAccounts.updateAcl()`. Mirrors the inner
517
- * shape of the wire's `acl_config_for_shared` block — the SDK adds the
518
- * outer nesting at the boundary, so callers pass the three fields flat.
519
- *
520
- * PATCH-style semantics — omit a field to leave it unchanged; pass an
521
- * empty array to clear an allow/deny list. Raises
522
- * `ComposioAclOnlyForSharedError` on a PRIVATE connection.
523
- *
524
- * Each field is optional, but at least one must be provided — passing an
525
- * empty object is rejected as a no-op.
526
- */
527
- declare const UpdateConnectedAccountAclParamsSchema: z$1.ZodEffects<z$1.ZodObject<{
528
- allowAllUsers: z$1.ZodOptional<z$1.ZodBoolean>;
529
- allowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
530
- notAllowedUserIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
531
- }, "strip", z$1.ZodTypeAny, {
532
- allowAllUsers?: boolean | undefined;
533
- allowedUserIds?: string[] | undefined;
534
- notAllowedUserIds?: string[] | undefined;
535
- }, {
536
- allowAllUsers?: boolean | undefined;
537
- allowedUserIds?: string[] | undefined;
538
- notAllowedUserIds?: string[] | undefined;
539
- }>, {
540
- allowAllUsers?: boolean | undefined;
541
- allowedUserIds?: string[] | undefined;
542
- notAllowedUserIds?: string[] | undefined;
543
- }, {
544
- allowAllUsers?: boolean | undefined;
545
- allowedUserIds?: string[] | undefined;
546
- notAllowedUserIds?: string[] | undefined;
547
- }>;
548
- type UpdateConnectedAccountAclParams = z$1.infer<typeof UpdateConnectedAccountAclParamsSchema>;
549
- //#endregion
550
- //#region src/types/connectionRequest.types.d.ts
551
- interface ConnectionRequestState {
552
- id: string;
553
- status?: ConnectedAccountStatus;
554
- redirectUrl?: string | null;
555
- }
556
- interface ConnectionRequest extends ConnectionRequestState {
557
- waitForConnection: (timeout?: number) => Promise<ConnectedAccountRetrieveResponse>;
558
- toJSON: () => ConnectionRequestState;
559
- toString: () => string;
560
- }
561
- //#endregion
562
- //#region src/types/ToolRouterSessionFilesMount.types.d.ts
563
- declare const ToolRouterSessionFilesMountListOptionsSchema: z.ZodObject<{
564
- path: z.ZodOptional<z.ZodString>;
565
- mountId: z.ZodDefault<z.ZodString>;
566
- /** Pagination cursor from the previous response nextCursor field */
567
- cursor: z.ZodOptional<z.ZodString>;
568
- /** Maximum number of files to return per page (1-500) */
569
- limit: z.ZodOptional<z.ZodNumber>;
570
- }, "strip", z.ZodTypeAny, {
571
- mountId: string;
572
- path?: string | undefined;
573
- limit?: number | undefined;
574
- cursor?: string | undefined;
575
- }, {
576
- path?: string | undefined;
577
- limit?: number | undefined;
578
- cursor?: string | undefined;
579
- mountId?: string | undefined;
580
- }>;
581
- type ToolRouterSessionFilesMountListOptions = z.input<typeof ToolRouterSessionFilesMountListOptionsSchema>;
582
- declare const FileListResponseSchema: z.ZodEffects<z.ZodObject<{
583
- items: z.ZodArray<z.ZodObject<{
584
- last_modified: z.ZodString;
585
- mount_relative_path: z.ZodString;
586
- sandbox_mount_prefix: z.ZodString;
587
- size: z.ZodNumber;
588
- }, "strip", z.ZodTypeAny, {
589
- last_modified: string;
590
- mount_relative_path: string;
591
- sandbox_mount_prefix: string;
592
- size: number;
593
- }, {
594
- last_modified: string;
595
- mount_relative_path: string;
596
- sandbox_mount_prefix: string;
597
- size: number;
598
- }>, "many">;
599
- next_cursor: z.ZodOptional<z.ZodString>;
600
- }, "strip", z.ZodTypeAny, {
601
- items: {
602
- last_modified: string;
603
- mount_relative_path: string;
604
- sandbox_mount_prefix: string;
605
- size: number;
606
- }[];
607
- next_cursor?: string | undefined;
608
- }, {
609
- items: {
610
- last_modified: string;
611
- mount_relative_path: string;
612
- sandbox_mount_prefix: string;
613
- size: number;
614
- }[];
615
- next_cursor?: string | undefined;
616
- }>, {
617
- items: {
618
- lastModified: string;
619
- mountRelativePath: string;
620
- sandboxMountPrefix: string;
621
- size: number;
622
- }[];
623
- nextCursor: string | undefined;
624
- }, {
625
- items: {
626
- last_modified: string;
627
- mount_relative_path: string;
628
- sandbox_mount_prefix: string;
629
- size: number;
630
- }[];
631
- next_cursor?: string | undefined;
632
- }>;
633
- type FileListResponse = z.infer<typeof FileListResponseSchema>;
634
- declare const ToolRouterSessionFilesMountUploadOptionsSchema: z.ZodObject<{
635
- /** Remote path/filename on the mount. When passing a buffer, either mimetype or remotePath is required. */
636
- remotePath: z.ZodOptional<z.ZodString>;
637
- mountId: z.ZodDefault<z.ZodString>;
638
- /** MIME type. When passing a buffer, either mimetype or remotePath is required. Ignored when passing File (uses file.type). */
639
- mimetype: z.ZodOptional<z.ZodString>;
640
- }, "strip", z.ZodTypeAny, {
641
- mountId: string;
642
- remotePath?: string | undefined;
643
- mimetype?: string | undefined;
644
- }, {
645
- mountId?: string | undefined;
646
- remotePath?: string | undefined;
647
- mimetype?: string | undefined;
648
- }>;
649
- type ToolRouterSessionFilesMountUploadOptions = z.input<typeof ToolRouterSessionFilesMountUploadOptionsSchema>;
650
- declare const ToolRouterSessionFilesMountDownloadOptionsSchema: z.ZodObject<{
651
- mountId: z.ZodDefault<z.ZodString>;
652
- }, "strip", z.ZodTypeAny, {
653
- mountId: string;
654
- }, {
655
- mountId?: string | undefined;
656
- }>;
657
- type ToolRouterSessionFilesMountDownloadOptions = z.input<typeof ToolRouterSessionFilesMountDownloadOptionsSchema>;
658
- declare const ToolRouterSessionFilesMountDeleteOptionsSchema: z.ZodObject<{
659
- mountId: z.ZodDefault<z.ZodString>;
660
- }, "strip", z.ZodTypeAny, {
661
- mountId: string;
662
- }, {
663
- mountId?: string | undefined;
664
- }>;
665
- type ToolRouterSessionFilesMountDeleteOptions = z.input<typeof ToolRouterSessionFilesMountDeleteOptionsSchema>;
666
- declare const RemoteFileDataSchema: z.ZodEffects<z.ZodObject<{
667
- expires_at: z.ZodString;
668
- mount_relative_path: z.ZodString;
669
- sandbox_mount_prefix: z.ZodString;
670
- download_url: z.ZodString;
671
- }, "strip", z.ZodTypeAny, {
672
- mount_relative_path: string;
673
- sandbox_mount_prefix: string;
674
- expires_at: string;
675
- download_url: string;
676
- }, {
677
- mount_relative_path: string;
678
- sandbox_mount_prefix: string;
679
- expires_at: string;
680
- download_url: string;
681
- }>, {
682
- expiresAt: string;
683
- mountRelativePath: string;
684
- sandboxMountPrefix: string;
685
- downloadUrl: string;
686
- }, {
687
- mount_relative_path: string;
688
- sandbox_mount_prefix: string;
689
- expires_at: string;
690
- download_url: string;
691
- }>;
692
- /** Parsed shape from API response. Use with `new RemoteFile(data)`. */
693
- type RemoteFileData = z.infer<typeof RemoteFileDataSchema>;
694
- declare const FileDeleteResponseSchema: z.ZodEffects<z.ZodObject<{
695
- mount_relative_path: z.ZodString;
696
- sandbox_mount_prefix: z.ZodString;
697
- }, "strip", z.ZodTypeAny, {
698
- mount_relative_path: string;
699
- sandbox_mount_prefix: string;
700
- }, {
701
- mount_relative_path: string;
702
- sandbox_mount_prefix: string;
703
- }>, {
704
- mountRelativePath: string;
705
- sandboxMountPrefix: string;
706
- }, {
707
- mount_relative_path: string;
708
- sandbox_mount_prefix: string;
709
- }>;
710
- type FileDeleteResponse = z.infer<typeof FileDeleteResponseSchema>;
711
- //#endregion
712
- //#region src/models/RemoteFile.d.ts
713
- /**
714
- * Represents a file stored in a tool router session's file mount.
715
- * Provides methods to fetch, save, and work with the file content.
716
- *
717
- * @example
718
- * ```typescript
719
- * const remoteFile = await session.experimental.files.download('/output/report.pdf');
720
- * const buffer = await remoteFile.buffer();
721
- * await remoteFile.save('/tmp/report.pdf');
722
- * const text = await remoteFile.text();
723
- * ```
724
- *
725
- * @example
726
- * ```typescript
727
- * // Create from API response (snake_case)
728
- * const remoteFile = RemoteFile.parse(apiResponse);
729
- *
730
- * // Or create from parsed data (camelCase)
731
- * const remoteFile = new RemoteFile({
732
- * expiresAt: '...',
733
- * mountRelativePath: 'report.pdf',
734
- * sandboxMountPrefix: '/mnt/files',
735
- * downloadUrl: 'https://...',
736
- * });
737
- * ```
738
- */
739
- declare class RemoteFile {
740
- /** ISO 8601 timestamp when the download URL expires */
741
- readonly expiresAt: string;
742
- /** Relative path within the mount (e.g. "report.pdf") */
743
- readonly mountRelativePath: string;
744
- /** Absolute mount path inside the sandbox (e.g. /mnt/files) */
745
- readonly sandboxMountPrefix: string;
746
- /** Presigned URL for downloading the file */
747
- readonly downloadUrl: string;
748
- constructor(data: RemoteFileData);
749
- /**
750
- * Parses an API response (snake_case) and returns a RemoteFile instance.
751
- * @param data - Raw API response with snake_case keys
752
- * @returns A RemoteFile instance
753
- * @throws ValidationError if the response shape is invalid
754
- */
755
- static parse(data: unknown): RemoteFile;
756
- /** Filename extracted from the mount path (e.g. "report.pdf" from "output/report.pdf") */
757
- get filename(): string;
758
- /**
759
- * Fetches the file content as a buffer.
760
- * @returns The file content as a Uint8Array
761
- * @throws RemoteFileDownloadError if the fetch fails
762
- */
763
- buffer(): Promise<Uint8Array>;
764
- /**
765
- * Fetches the file content as UTF-8 text.
766
- * @returns The file content as a string
767
- * @throws Error if the fetch fails
768
- */
769
- text(): Promise<string>;
770
- /**
771
- * Fetches the file content as a Blob.
772
- * @returns The file content as a Blob
773
- * @throws RemoteFileDownloadError if the fetch fails
774
- */
775
- blob(): Promise<Blob>;
776
- /**
777
- * Downloads and saves the file to the local filesystem.
778
- * Requires a Node.js runtime with file system support (not available in Cloudflare Workers/Edge).
779
- *
780
- * @param path - Local path to save the file. If omitted, saves to the Composio temp directory using the filename from the mount path.
781
- * @returns The absolute path where the file was saved
782
- * @throws Error if file system is not supported or the save fails
783
- */
784
- save(path?: string): Promise<string>;
785
- }
786
- //#endregion
787
- //#region src/models/ToolRouterSessionFileMount.d.ts
788
- declare class ToolRouterSessionFilesMount {
789
- private readonly sessionId;
790
- private readonly client;
791
- constructor(client: Composio, sessionId: string);
792
- /**
793
- * Lists files and directories at the specified path on the session's file mount.
794
- *
795
- * Use this to browse the virtual filesystem attached to the tool router session.
796
- * The path is relative to the mount root (e.g., `"/"` for root, `"/documents"` for a subdirectory).
797
- * Supports cursor-based pagination via `cursor` and `limit` options.
798
- *
799
- * @param options - Optional configuration for the list operation.
800
- * @param options.path - The directory path to list. Use `"/"` for the mount root.
801
- * @param options.mountId - The ID of the file mount to operate on. Defaults to `"files"` when omitted.
802
- * @param options.cursor - Pagination cursor from the previous response's nextCursor field.
803
- * @param options.limit - Maximum number of files to return per page (1-500).
804
- * @returns List of files with nextCursor for pagination.
805
- *
806
- * @example
807
- * ```typescript
808
- * const session = await composio.toolRouter.use('session_123');
809
- * const { items, nextCursor } = await session.experimental.files.list({ path: '/' });
810
- * ```
811
- *
812
- * @example
813
- * ```typescript
814
- * // Paginated listing
815
- * let result = await session.experimental.files.list({ path: '/', limit: 10 });
816
- * while (result.nextCursor) {
817
- * result = await session.experimental.files.list({ path: '/', cursor: result.nextCursor, limit: 10 });
818
- * }
819
- * ```
820
- */
821
- list(options?: ToolRouterSessionFilesMountListOptions): Promise<FileListResponse>;
822
- private normalizeUploadInput;
823
- /**
824
- * Uploads a file to the session's file mount.
825
- *
826
- * Accepts a file path (local or URL), a native File object, or a raw buffer.
827
- * The file is stored in the virtual filesystem associated with the tool router session.
828
- *
829
- * @param input - File path (string), native File, or raw buffer (ArrayBuffer | Uint8Array).
830
- * @param options - Optional configuration. When passing a buffer, remotePath is required.
831
- * @returns Metadata about the uploaded file.
832
- *
833
- * @example
834
- * ```typescript
835
- * // From file path (local or URL)
836
- * await session.experimental.files.upload('/path/to/report.pdf');
837
- * await session.experimental.files.upload('https://example.com/file.pdf');
838
- * ```
839
- *
840
- * @example
841
- * ```typescript
842
- * // From native File (e.g. from input[type=file])
843
- * await session.experimental.files.upload(fileInput.files[0]);
844
- * ```
845
- *
846
- * @example
847
- * ```typescript
848
- * // From raw buffer
849
- * await session.experimental.files.upload(buffer, { remotePath: 'data.json', mimetype: 'application/json' });
850
- * ```
851
- */
852
- upload(input: string | File | ArrayBuffer | Uint8Array, options?: ToolRouterSessionFilesMountUploadOptions): Promise<RemoteFile>;
853
- /**
854
- * Downloads a file from the session's file mount to the local filesystem.
855
- *
856
- * Retrieves a file stored in the session's virtual filesystem (e.g., one produced
857
- * by a tool or previously uploaded) and saves it to the specified local path.
858
- *
859
- * @param filePath - The path of the file on the mount to download, or the local path where the file should be saved (implementation-specific).
860
- * @param options - Optional configuration for the download.
861
- * @param options.mountId - The ID of the file mount to download from. Defaults to `"files"` when omitted.
862
- * @returns The downloaded file data or path (implementation-specific).
863
- *
864
- * @example
865
- * ```typescript
866
- * const session = await composio.toolRouter.use('session_123');
867
- * const result = await session.experimental.files.download('/output/report.pdf');
868
- * ```
869
- *
870
- * @example
871
- * ```typescript
872
- * // Download from a custom mount
873
- * await session.experimental.files.download('/exports/data.json', {
874
- * mountId: 'custom-mount',
875
- * });
876
- * ```
877
- */
878
- download(filePath: string, options?: ToolRouterSessionFilesMountDownloadOptions): Promise<RemoteFile>;
879
- /**
880
- * Deletes a file or directory at the specified path on the session's file mount.
881
- *
882
- * Removes the file or directory from the virtual filesystem. Use with caution:
883
- * deletion is typically irreversible. Ensure the path exists and is intended for removal.
884
- *
885
- * @param remotePath - The path of the file or directory to delete on the mount.
886
- * @param options - Optional configuration for the delete operation.
887
- * @param options.mountId - The ID of the file mount to operate on. Defaults to `"files"` when omitted.
888
- * @returns Confirmation of deletion (implementation-specific).
889
- *
890
- * @example
891
- * ```typescript
892
- * const session = await composio.toolRouter.use('session_123');
893
- * await session.experimental.files.delete('/temp/cache.json');
894
- * ```
895
- *
896
- * @example
897
- * ```typescript
898
- * // Delete from a custom mount
899
- * await session.experimental.files.delete('/old-backup', {
900
- * mountId: 'custom-mount',
901
- * });
902
- * ```
903
- *
904
- * @warning This operation is destructive. Deleted files cannot be recovered.
905
- */
906
- delete(remotePath: string, options?: ToolRouterSessionFilesMountDeleteOptions): Promise<FileDeleteResponse>;
907
- }
908
- //#endregion
909
- //#region src/types/toolRouter.types.d.ts
910
- declare const SessionPreset: {
911
- readonly DIRECT_TOOLS: "direct_tools";
912
- };
913
- type SessionPreset = (typeof SessionPreset)[keyof typeof SessionPreset];
914
- declare const MCPServerTypeSchema: z.ZodEnum<["http", "sse"]>;
915
- type MCPServerType = z.infer<typeof MCPServerTypeSchema>;
916
- /**
917
- * Sandbox compute tier for the tool router workbench.
918
- *
919
- * | Tier | vCPU | RAM |
920
- * | -------- | ---- | ----- |
921
- * | standard | 1 | 1 GB |
922
- * | medium | 2 | 2 GB |
923
- * | large | 4 | 4 GB |
924
- * | xlarge | 8 | 8 GB |
925
- *
926
- * Defaults to `standard` server-side when omitted.
927
- */
928
- declare const SandboxSizeSchema: z.ZodEnum<["standard", "medium", "large", "xlarge"]>;
929
- type SandboxSize = z.infer<typeof SandboxSizeSchema>;
930
- declare const ToolRouterConfigManageConnectionsSchema: z.ZodObject<{
931
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
932
- callbackUrl: z.ZodOptional<z.ZodString>;
933
- waitForConnections: z.ZodOptional<z.ZodBoolean>;
934
- }, "strict", z.ZodTypeAny, {
935
- callbackUrl?: string | undefined;
936
- enable?: boolean | undefined;
937
- waitForConnections?: boolean | undefined;
938
- }, {
939
- callbackUrl?: string | undefined;
940
- enable?: boolean | undefined;
941
- waitForConnections?: boolean | undefined;
942
- }>;
943
- declare const ToolRouterToolkitsParamSchema: z.ZodArray<z.ZodString, "many">;
944
- declare const ToolRouterToolkitsDisabledConfigSchema: z.ZodObject<{
945
- disable: z.ZodArray<z.ZodString, "many">;
946
- }, "strict", z.ZodTypeAny, {
947
- disable: string[];
948
- }, {
949
- disable: string[];
950
- }>;
951
- declare const ToolRouterToolkitsEnabledConfigSchema: z.ZodObject<{
952
- enable: z.ZodArray<z.ZodString, "many">;
953
- }, "strict", z.ZodTypeAny, {
954
- enable: string[];
955
- }, {
956
- enable: string[];
957
- }>;
958
- declare const ToolRouterManageConnectionsConfigSchema: z.ZodObject<{
959
- enable: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
960
- callbackUrl: z.ZodOptional<z.ZodString>;
961
- }, "strip", z.ZodTypeAny, {
962
- enable: boolean;
963
- callbackUrl?: string | undefined;
964
- }, {
965
- callbackUrl?: string | undefined;
966
- enable?: boolean | undefined;
967
- }>;
968
- declare const ToolRouterTagsParamSchema: z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">;
969
- declare const ToolRouterTagsEnableDisableSchema: z.ZodObject<{
970
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
971
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
972
- }, "strict", z.ZodTypeAny, {
973
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
974
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
975
- }, {
976
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
977
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
978
- }>;
979
- declare const ToolRouterConfigTagsSchema: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
980
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
981
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
982
- }, "strict", z.ZodTypeAny, {
983
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
984
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
985
- }, {
986
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
987
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
988
- }>]>;
989
- type ToolRouterConfigTags = z.infer<typeof ToolRouterConfigTagsSchema>;
990
- /**
991
- * Tools config - Configure tools per toolkit using toolkit slug as key
992
- * @example
993
- * ```typescript
994
- * {
995
- * gmail: {
996
- * enable: ['gmail_search', 'gmail_send']
997
- * },
998
- * slack: {
999
- * disable: ['slack_delete_message']
1000
- * }
1001
- * }
1002
- * ```
1003
- *
1004
- * @example
1005
- * ```typescript
1006
- * {
1007
- * gmail: ['gmail_search', 'gmail_send'],
1008
- * slack: { tags: ['readOnlyHint'] }
1009
- * }
1010
- * ```
1011
- */
1012
- declare const ToolRouterToolsParamSchema: z.ZodArray<z.ZodString, "many">;
1013
- type ToolRouterToolsParam = z.infer<typeof ToolRouterToolsParamSchema>;
1014
- declare const ToolRouterConfigToolsSchema: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
1015
- enable: z.ZodArray<z.ZodString, "many">;
1016
- }, "strict", z.ZodTypeAny, {
1017
- enable: string[];
1018
- }, {
1019
- enable: string[];
1020
- }>, z.ZodObject<{
1021
- disable: z.ZodArray<z.ZodString, "many">;
1022
- }, "strict", z.ZodTypeAny, {
1023
- disable: string[];
1024
- }, {
1025
- disable: string[];
1026
- }>, z.ZodObject<{
1027
- tags: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1028
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1029
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1030
- }, "strict", z.ZodTypeAny, {
1031
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1032
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1033
- }, {
1034
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1035
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1036
- }>]>;
1037
- }, "strict", z.ZodTypeAny, {
1038
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1039
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1040
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1041
- };
1042
- }, {
1043
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1044
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1045
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1046
- };
1047
- }>]>, string[] | {
1048
- enable: string[];
1049
- } | {
1050
- disable: string[];
1051
- } | {
1052
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1053
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1054
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1055
- };
1056
- }, string[] | {
1057
- enable: string[];
1058
- } | {
1059
- disable: string[];
1060
- } | {
1061
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1062
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1063
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1064
- };
1065
- }>;
1066
- type ToolRouterConfigTools = z.infer<typeof ToolRouterConfigToolsSchema>;
1067
- declare const ToolRouterCreateSessionConfigSchema: z.ZodEffects<z.ZodObject<{
1068
- sessionPreset: z.ZodOptional<z.ZodOptional<z.ZodLiteral<"direct_tools">>>;
1069
- tools: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
1070
- enable: z.ZodArray<z.ZodString, "many">;
1071
- }, "strict", z.ZodTypeAny, {
1072
- enable: string[];
1073
- }, {
1074
- enable: string[];
1075
- }>, z.ZodObject<{
1076
- disable: z.ZodArray<z.ZodString, "many">;
1077
- }, "strict", z.ZodTypeAny, {
1078
- disable: string[];
1079
- }, {
1080
- disable: string[];
1081
- }>, z.ZodObject<{
1082
- tags: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1083
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1084
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1085
- }, "strict", z.ZodTypeAny, {
1086
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1087
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1088
- }, {
1089
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1090
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1091
- }>]>;
1092
- }, "strict", z.ZodTypeAny, {
1093
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1094
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1095
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1096
- };
1097
- }, {
1098
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1099
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1100
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1101
- };
1102
- }>]>, string[] | {
1103
- enable: string[];
1104
- } | {
1105
- disable: string[];
1106
- } | {
1107
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1108
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1109
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1110
- };
1111
- }, string[] | {
1112
- enable: string[];
1113
- } | {
1114
- disable: string[];
1115
- } | {
1116
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1117
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1118
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1119
- };
1120
- }>]>>>>;
1121
- tags: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1122
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1123
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1124
- }, "strict", z.ZodTypeAny, {
1125
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1126
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1127
- }, {
1128
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1129
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1130
- }>]>>>;
1131
- toolkits: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
1132
- disable: z.ZodArray<z.ZodString, "many">;
1133
- }, "strict", z.ZodTypeAny, {
1134
- disable: string[];
1135
- }, {
1136
- disable: string[];
1137
- }>, z.ZodObject<{
1138
- enable: z.ZodArray<z.ZodString, "many">;
1139
- }, "strict", z.ZodTypeAny, {
1140
- enable: string[];
1141
- }, {
1142
- enable: string[];
1143
- }>]>>>;
1144
- authConfigs: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>>;
1145
- connectedAccounts: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>>;
1146
- manageConnections: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
1147
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1148
- callbackUrl: z.ZodOptional<z.ZodString>;
1149
- waitForConnections: z.ZodOptional<z.ZodBoolean>;
1150
- }, "strict", z.ZodTypeAny, {
1151
- callbackUrl?: string | undefined;
1152
- enable?: boolean | undefined;
1153
- waitForConnections?: boolean | undefined;
1154
- }, {
1155
- callbackUrl?: string | undefined;
1156
- enable?: boolean | undefined;
1157
- waitForConnections?: boolean | undefined;
1158
- }>]>>>>;
1159
- workbench: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1160
- enable: z.ZodDefault<z.ZodBoolean>;
1161
- enableProxyExecution: z.ZodOptional<z.ZodBoolean>;
1162
- autoOffloadThreshold: z.ZodOptional<z.ZodNumber>;
1163
- sandboxSize: z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>;
1164
- }, "strip", z.ZodTypeAny, {
1165
- enable: boolean;
1166
- enableProxyExecution?: boolean | undefined;
1167
- autoOffloadThreshold?: number | undefined;
1168
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1169
- }, {
1170
- enable?: boolean | undefined;
1171
- enableProxyExecution?: boolean | undefined;
1172
- autoOffloadThreshold?: number | undefined;
1173
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1174
- }>>>;
1175
- multiAccount: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1176
- enable: z.ZodDefault<z.ZodBoolean>;
1177
- maxAccountsPerToolkit: z.ZodOptional<z.ZodNumber>;
1178
- requireExplicitSelection: z.ZodOptional<z.ZodBoolean>;
1179
- }, "strip", z.ZodTypeAny, {
1180
- enable: boolean;
1181
- maxAccountsPerToolkit?: number | undefined;
1182
- requireExplicitSelection?: boolean | undefined;
1183
- }, {
1184
- enable?: boolean | undefined;
1185
- maxAccountsPerToolkit?: number | undefined;
1186
- requireExplicitSelection?: boolean | undefined;
1187
- }>>>;
1188
- preload: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1189
- tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<"all">]>>;
1190
- }, "strict", z.ZodTypeAny, {
1191
- tools?: string[] | "all" | undefined;
1192
- }, {
1193
- tools?: string[] | "all" | undefined;
1194
- }>>>;
1195
- experimental: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1196
- assistivePrompt: z.ZodOptional<z.ZodObject<{
1197
- userTimezone: z.ZodOptional<z.ZodString>;
1198
- }, "strip", z.ZodTypeAny, {
1199
- userTimezone?: string | undefined;
1200
- }, {
1201
- userTimezone?: string | undefined;
1202
- }>>;
1203
- customTools: z.ZodOptional<z.ZodArray<z.ZodType<CustomTool, z.ZodTypeDef, CustomTool>, "many">>;
1204
- customToolkits: z.ZodOptional<z.ZodArray<z.ZodType<CustomToolkit, z.ZodTypeDef, CustomToolkit>, "many">>;
1205
- }, "strip", z.ZodTypeAny, {
1206
- assistivePrompt?: {
1207
- userTimezone?: string | undefined;
1208
- } | undefined;
1209
- customTools?: CustomTool[] | undefined;
1210
- customToolkits?: CustomToolkit[] | undefined;
1211
- }, {
1212
- assistivePrompt?: {
1213
- userTimezone?: string | undefined;
1214
- } | undefined;
1215
- customTools?: CustomTool[] | undefined;
1216
- customToolkits?: CustomToolkit[] | undefined;
1217
- }>>>;
1218
- }, "strip", z.ZodTypeAny, {
1219
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1220
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1221
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1222
- } | undefined;
1223
- tools?: Record<string, string[] | {
1224
- enable: string[];
1225
- } | {
1226
- disable: string[];
1227
- } | {
1228
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1229
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1230
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1231
- };
1232
- }> | undefined;
1233
- toolkits?: string[] | {
1234
- disable: string[];
1235
- } | {
1236
- enable: string[];
1237
- } | undefined;
1238
- preload?: {
1239
- tools?: string[] | "all" | undefined;
1240
- } | undefined;
1241
- experimental?: {
1242
- assistivePrompt?: {
1243
- userTimezone?: string | undefined;
1244
- } | undefined;
1245
- customTools?: CustomTool[] | undefined;
1246
- customToolkits?: CustomToolkit[] | undefined;
1247
- } | undefined;
1248
- sessionPreset?: "direct_tools" | undefined;
1249
- authConfigs?: Record<string, string> | undefined;
1250
- connectedAccounts?: Record<string, string | string[]> | undefined;
1251
- manageConnections?: boolean | {
1252
- callbackUrl?: string | undefined;
1253
- enable?: boolean | undefined;
1254
- waitForConnections?: boolean | undefined;
1255
- } | undefined;
1256
- workbench?: {
1257
- enable: boolean;
1258
- enableProxyExecution?: boolean | undefined;
1259
- autoOffloadThreshold?: number | undefined;
1260
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1261
- } | undefined;
1262
- multiAccount?: {
1263
- enable: boolean;
1264
- maxAccountsPerToolkit?: number | undefined;
1265
- requireExplicitSelection?: boolean | undefined;
1266
- } | undefined;
1267
- }, {
1268
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1269
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1270
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1271
- } | undefined;
1272
- tools?: Record<string, string[] | {
1273
- enable: string[];
1274
- } | {
1275
- disable: string[];
1276
- } | {
1277
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1278
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1279
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1280
- };
1281
- }> | undefined;
1282
- toolkits?: string[] | {
1283
- disable: string[];
1284
- } | {
1285
- enable: string[];
1286
- } | undefined;
1287
- preload?: {
1288
- tools?: string[] | "all" | undefined;
1289
- } | undefined;
1290
- experimental?: {
1291
- assistivePrompt?: {
1292
- userTimezone?: string | undefined;
1293
- } | undefined;
1294
- customTools?: CustomTool[] | undefined;
1295
- customToolkits?: CustomToolkit[] | undefined;
1296
- } | undefined;
1297
- sessionPreset?: "direct_tools" | undefined;
1298
- authConfigs?: Record<string, string> | undefined;
1299
- connectedAccounts?: Record<string, string | string[]> | undefined;
1300
- manageConnections?: boolean | {
1301
- callbackUrl?: string | undefined;
1302
- enable?: boolean | undefined;
1303
- waitForConnections?: boolean | undefined;
1304
- } | undefined;
1305
- workbench?: {
1306
- enable?: boolean | undefined;
1307
- enableProxyExecution?: boolean | undefined;
1308
- autoOffloadThreshold?: number | undefined;
1309
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1310
- } | undefined;
1311
- multiAccount?: {
1312
- enable?: boolean | undefined;
1313
- maxAccountsPerToolkit?: number | undefined;
1314
- requireExplicitSelection?: boolean | undefined;
1315
- } | undefined;
1316
- }>, {
1317
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1318
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1319
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1320
- } | undefined;
1321
- tools?: Record<string, string[] | {
1322
- enable: string[];
1323
- } | {
1324
- disable: string[];
1325
- } | {
1326
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1327
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1328
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1329
- };
1330
- }> | undefined;
1331
- toolkits?: string[] | {
1332
- disable: string[];
1333
- } | {
1334
- enable: string[];
1335
- } | undefined;
1336
- preload?: {
1337
- tools?: string[] | "all" | undefined;
1338
- } | undefined;
1339
- experimental?: {
1340
- assistivePrompt?: {
1341
- userTimezone?: string | undefined;
1342
- } | undefined;
1343
- customTools?: CustomTool[] | undefined;
1344
- customToolkits?: CustomToolkit[] | undefined;
1345
- } | undefined;
1346
- sessionPreset?: "direct_tools" | undefined;
1347
- authConfigs?: Record<string, string> | undefined;
1348
- connectedAccounts?: Record<string, string | string[]> | undefined;
1349
- manageConnections?: boolean | {
1350
- callbackUrl?: string | undefined;
1351
- enable?: boolean | undefined;
1352
- waitForConnections?: boolean | undefined;
1353
- } | undefined;
1354
- workbench?: {
1355
- enable: boolean;
1356
- enableProxyExecution?: boolean | undefined;
1357
- autoOffloadThreshold?: number | undefined;
1358
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1359
- } | undefined;
1360
- multiAccount?: {
1361
- enable: boolean;
1362
- maxAccountsPerToolkit?: number | undefined;
1363
- requireExplicitSelection?: boolean | undefined;
1364
- } | undefined;
1365
- }, unknown>;
1366
- /**
1367
- * The config for the tool router session.
1368
- *
1369
- * @param {SessionPreset} [sessionPreset] - Shortcut that exposes every tool allowed by the session filters directly in session.tools() and the MCP tool list. Disables search, multi-execute, manage-connections, and workbench by default; explicit overrides for supported fields still win. Without this preset, ToolRouter uses the default configuration with meta tools enabled.
1370
- * @param {ToolRouterToolkitsParamSchema | ToolRouterToolkitsDisabledConfigSchema | ToolRouterToolkitsEnabledConfigSchema} toolkits - The toolkits to use in the tool router session
1371
- * @param {Record<string, ToolRouterToolsParam | ToolRouterConfigTools>} tools - The tools to configure per toolkit (key is toolkit slug)
1372
- * @param {Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>} tags - Global tags to filter tools by behavior
1373
- * @param {Record<string, string>} authConfigs - The auth configs to use in the tool router session
1374
- * @param {Record<string, string | string[]>} connectedAccounts - The connected accounts to use in the tool router session. A single string is coerced to a single-element array before being sent to the backend.
1375
- * @param {ToolRouterConfigManageConnectionsSchema | boolean} manageConnections - The config for the manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually. If set to an object, you can configure the manage connections settings.
1376
- * @param {boolean} [manageConnections.enable] - Whether to use tools to manage connections in the tool router session @default true
1377
- * @param {string} [manageConnections.callbackUrl] - The callback url to use in the tool router session
1378
- * @param {object} workbench - Workbench configuration for tool execution
1379
- * @param {boolean} [workbench.enable] - Whether to enable the workbench entirely. Defaults to true. When false, no code execution tools are available.
1380
- * @param {boolean} [workbench.enableProxyExecution] - Whether to enable proxy execution
1381
- * @param {number} [workbench.autoOffloadThreshold] - Auto offload threshold in characters for moving execution to workbench
1382
- * @param {SandboxSize} [workbench.sandboxSize] - Sandbox compute tier: 'standard' (1 vCPU/1 GB, default), 'medium' (2 vCPU/2 GB), 'large' (4 vCPU/4 GB), or 'xlarge' (8 vCPU/8 GB)
1383
- * @param {object} [multiAccount] - Multi-account configuration for this session
1384
- * @param {boolean} [multiAccount.enable] - When true, enables multi-account mode. Falls back to org/project-level config when not set.
1385
- * @param {number} [multiAccount.maxAccountsPerToolkit] - Max connected accounts per toolkit (2-10, default 5)
1386
- * @param {boolean} [multiAccount.requireExplicitSelection] - When true, require explicit account selection when multiple accounts are connected
1387
- * @param {object} [preload] - Tools to preload into session.tools() and the MCP tool list
1388
- * @param {string[] | 'all'} [preload.tools] - Tool slugs to preload, or "all" to preload every app tool allowed by the session filters. "all" requires a positive filter such as toolkits, tools, or tags; the backend validates and caps the final tool set.
1389
- */
1390
- type ToolRouterCreateSessionConfig = z.infer<typeof ToolRouterCreateSessionConfigSchema>;
1391
- declare const ToolkitConnectionStateSchema: z.ZodObject<{
1392
- slug: z.ZodString;
1393
- name: z.ZodString;
1394
- logo: z.ZodOptional<z.ZodString>;
1395
- isNoAuth: z.ZodDefault<z.ZodBoolean>;
1396
- connection: z.ZodOptional<z.ZodObject<{
1397
- isActive: z.ZodBoolean;
1398
- authConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1399
- id: z.ZodString;
1400
- mode: z.ZodString;
1401
- isComposioManaged: z.ZodBoolean;
1402
- }, "strip", z.ZodTypeAny, {
1403
- id: string;
1404
- isComposioManaged: boolean;
1405
- mode: string;
1406
- }, {
1407
- id: string;
1408
- isComposioManaged: boolean;
1409
- mode: string;
1410
- }>>>;
1411
- connectedAccount: z.ZodOptional<z.ZodObject<{
1412
- id: z.ZodString;
1413
- status: z.ZodString;
1414
- }, "strip", z.ZodTypeAny, {
1415
- status: string;
1416
- id: string;
1417
- }, {
1418
- status: string;
1419
- id: string;
1420
- }>>;
1421
- }, "strip", z.ZodTypeAny, {
1422
- isActive: boolean;
1423
- authConfig?: {
1424
- id: string;
1425
- isComposioManaged: boolean;
1426
- mode: string;
1427
- } | null | undefined;
1428
- connectedAccount?: {
1429
- status: string;
1430
- id: string;
1431
- } | undefined;
1432
- }, {
1433
- isActive: boolean;
1434
- authConfig?: {
1435
- id: string;
1436
- isComposioManaged: boolean;
1437
- mode: string;
1438
- } | null | undefined;
1439
- connectedAccount?: {
1440
- status: string;
1441
- id: string;
1442
- } | undefined;
1443
- }>>;
1444
- }, "strip", z.ZodTypeAny, {
1445
- slug: string;
1446
- name: string;
1447
- isNoAuth: boolean;
1448
- logo?: string | undefined;
1449
- connection?: {
1450
- isActive: boolean;
1451
- authConfig?: {
1452
- id: string;
1453
- isComposioManaged: boolean;
1454
- mode: string;
1455
- } | null | undefined;
1456
- connectedAccount?: {
1457
- status: string;
1458
- id: string;
1459
- } | undefined;
1460
- } | undefined;
1461
- }, {
1462
- slug: string;
1463
- name: string;
1464
- logo?: string | undefined;
1465
- isNoAuth?: boolean | undefined;
1466
- connection?: {
1467
- isActive: boolean;
1468
- authConfig?: {
1469
- id: string;
1470
- isComposioManaged: boolean;
1471
- mode: string;
1472
- } | null | undefined;
1473
- connectedAccount?: {
1474
- status: string;
1475
- id: string;
1476
- } | undefined;
1477
- } | undefined;
1478
- }>;
1479
- declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
1480
- items: z.ZodArray<z.ZodObject<{
1481
- slug: z.ZodString;
1482
- name: z.ZodString;
1483
- logo: z.ZodOptional<z.ZodString>;
1484
- isNoAuth: z.ZodDefault<z.ZodBoolean>;
1485
- connection: z.ZodOptional<z.ZodObject<{
1486
- isActive: z.ZodBoolean;
1487
- authConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1488
- id: z.ZodString;
1489
- mode: z.ZodString;
1490
- isComposioManaged: z.ZodBoolean;
1491
- }, "strip", z.ZodTypeAny, {
1492
- id: string;
1493
- isComposioManaged: boolean;
1494
- mode: string;
1495
- }, {
1496
- id: string;
1497
- isComposioManaged: boolean;
1498
- mode: string;
1499
- }>>>;
1500
- connectedAccount: z.ZodOptional<z.ZodObject<{
1501
- id: z.ZodString;
1502
- status: z.ZodString;
1503
- }, "strip", z.ZodTypeAny, {
1504
- status: string;
1505
- id: string;
1506
- }, {
1507
- status: string;
1508
- id: string;
1509
- }>>;
1510
- }, "strip", z.ZodTypeAny, {
1511
- isActive: boolean;
1512
- authConfig?: {
1513
- id: string;
1514
- isComposioManaged: boolean;
1515
- mode: string;
1516
- } | null | undefined;
1517
- connectedAccount?: {
1518
- status: string;
1519
- id: string;
1520
- } | undefined;
1521
- }, {
1522
- isActive: boolean;
1523
- authConfig?: {
1524
- id: string;
1525
- isComposioManaged: boolean;
1526
- mode: string;
1527
- } | null | undefined;
1528
- connectedAccount?: {
1529
- status: string;
1530
- id: string;
1531
- } | undefined;
1532
- }>>;
1533
- }, "strip", z.ZodTypeAny, {
1534
- slug: string;
1535
- name: string;
1536
- isNoAuth: boolean;
1537
- logo?: string | undefined;
1538
- connection?: {
1539
- isActive: boolean;
1540
- authConfig?: {
1541
- id: string;
1542
- isComposioManaged: boolean;
1543
- mode: string;
1544
- } | null | undefined;
1545
- connectedAccount?: {
1546
- status: string;
1547
- id: string;
1548
- } | undefined;
1549
- } | undefined;
1550
- }, {
1551
- slug: string;
1552
- name: string;
1553
- logo?: string | undefined;
1554
- isNoAuth?: boolean | undefined;
1555
- connection?: {
1556
- isActive: boolean;
1557
- authConfig?: {
1558
- id: string;
1559
- isComposioManaged: boolean;
1560
- mode: string;
1561
- } | null | undefined;
1562
- connectedAccount?: {
1563
- status: string;
1564
- id: string;
1565
- } | undefined;
1566
- } | undefined;
1567
- }>, "many">;
1568
- cursor: z.ZodOptional<z.ZodString>;
1569
- totalPages: z.ZodNumber;
1570
- }, "strip", z.ZodTypeAny, {
1571
- items: {
1572
- slug: string;
1573
- name: string;
1574
- isNoAuth: boolean;
1575
- logo?: string | undefined;
1576
- connection?: {
1577
- isActive: boolean;
1578
- authConfig?: {
1579
- id: string;
1580
- isComposioManaged: boolean;
1581
- mode: string;
1582
- } | null | undefined;
1583
- connectedAccount?: {
1584
- status: string;
1585
- id: string;
1586
- } | undefined;
1587
- } | undefined;
1588
- }[];
1589
- totalPages: number;
1590
- cursor?: string | undefined;
1591
- }, {
1592
- items: {
1593
- slug: string;
1594
- name: string;
1595
- logo?: string | undefined;
1596
- isNoAuth?: boolean | undefined;
1597
- connection?: {
1598
- isActive: boolean;
1599
- authConfig?: {
1600
- id: string;
1601
- isComposioManaged: boolean;
1602
- mode: string;
1603
- } | null | undefined;
1604
- connectedAccount?: {
1605
- status: string;
1606
- id: string;
1607
- } | undefined;
1608
- } | undefined;
1609
- }[];
1610
- totalPages: number;
1611
- cursor?: string | undefined;
1612
- }>;
1613
- type ToolkitConnectionsDetails = z.infer<typeof ToolkitConnectionsDetailsSchema>;
1614
- type ToolkitConnectionState = z.infer<typeof ToolkitConnectionStateSchema>;
1615
- declare const ToolRouterMCPServerConfigSchema: z.ZodObject<{
1616
- type: z.ZodEnum<["http", "sse"]>;
1617
- url: z.ZodString;
1618
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1619
- }, "strip", z.ZodTypeAny, {
1620
- type: "http" | "sse";
1621
- url: string;
1622
- headers?: Record<string, string> | undefined;
1623
- }, {
1624
- type: "http" | "sse";
1625
- url: string;
1626
- headers?: Record<string, string> | undefined;
1627
- }>;
1628
- type ToolRouterMCPServerConfig = z.infer<typeof ToolRouterMCPServerConfigSchema>;
1629
- type ToolRouterToolsFn<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> = (modifiers?: SessionMetaToolOptions) => Promise<ReturnType<TProvider['wrapTools']>>;
1630
- type ToolRouterAuthorizeFn = (toolkit: string, options?: {
1631
- callbackUrl?: string;
1632
- alias?: string;
1633
- }) => Promise<ConnectionRequest>;
1634
- declare const ToolRouterToolkitsOptionsSchema: z.ZodObject<{
1635
- toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1636
- cursor: z.ZodOptional<z.ZodString>;
1637
- limit: z.ZodOptional<z.ZodNumber>;
1638
- isConnected: z.ZodOptional<z.ZodBoolean>;
1639
- search: z.ZodOptional<z.ZodString>;
1640
- }, "strip", z.ZodTypeAny, {
1641
- toolkits?: string[] | undefined;
1642
- limit?: number | undefined;
1643
- search?: string | undefined;
1644
- cursor?: string | undefined;
1645
- isConnected?: boolean | undefined;
1646
- }, {
1647
- toolkits?: string[] | undefined;
1648
- limit?: number | undefined;
1649
- search?: string | undefined;
1650
- cursor?: string | undefined;
1651
- isConnected?: boolean | undefined;
1652
- }>;
1653
- type ToolRouterToolkitsOptions = z.infer<typeof ToolRouterToolkitsOptionsSchema>;
1654
- type ToolRouterToolkitsFn = (options?: ToolRouterToolkitsOptions) => Promise<ToolkitConnectionsDetails>;
1655
- declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
1656
- success: z.ZodBoolean;
1657
- error: z.ZodNullable<z.ZodString>;
1658
- results: z.ZodArray<z.ZodObject<{
1659
- index: z.ZodNumber;
1660
- useCase: z.ZodString;
1661
- primaryToolSlugs: z.ZodArray<z.ZodString, "many">;
1662
- relatedToolSlugs: z.ZodArray<z.ZodString, "many">;
1663
- toolkits: z.ZodArray<z.ZodString, "many">;
1664
- difficulty: z.ZodOptional<z.ZodString>;
1665
- error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1666
- executionGuidance: z.ZodOptional<z.ZodString>;
1667
- knownPitfalls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1668
- memory: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
1669
- planId: z.ZodOptional<z.ZodString>;
1670
- recommendedPlanSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1671
- referenceWorkbenchSnippets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1672
- code: z.ZodString;
1673
- description: z.ZodString;
1674
- }, "strip", z.ZodTypeAny, {
1675
- code: string;
1676
- description: string;
1677
- }, {
1678
- code: string;
1679
- description: string;
1680
- }>, "many">>;
1681
- }, "strip", z.ZodTypeAny, {
1682
- toolkits: string[];
1683
- index: number;
1684
- useCase: string;
1685
- primaryToolSlugs: string[];
1686
- relatedToolSlugs: string[];
1687
- error?: string | null | undefined;
1688
- difficulty?: string | undefined;
1689
- executionGuidance?: string | undefined;
1690
- knownPitfalls?: string[] | undefined;
1691
- memory?: Record<string, string[]> | undefined;
1692
- planId?: string | undefined;
1693
- recommendedPlanSteps?: string[] | undefined;
1694
- referenceWorkbenchSnippets?: {
1695
- code: string;
1696
- description: string;
1697
- }[] | undefined;
1698
- }, {
1699
- toolkits: string[];
1700
- index: number;
1701
- useCase: string;
1702
- primaryToolSlugs: string[];
1703
- relatedToolSlugs: string[];
1704
- error?: string | null | undefined;
1705
- difficulty?: string | undefined;
1706
- executionGuidance?: string | undefined;
1707
- knownPitfalls?: string[] | undefined;
1708
- memory?: Record<string, string[]> | undefined;
1709
- planId?: string | undefined;
1710
- recommendedPlanSteps?: string[] | undefined;
1711
- referenceWorkbenchSnippets?: {
1712
- code: string;
1713
- description: string;
1714
- }[] | undefined;
1715
- }>, "many">;
1716
- toolSchemas: z.ZodRecord<z.ZodString, z.ZodObject<{
1717
- toolSlug: z.ZodString;
1718
- toolkit: z.ZodString;
1719
- description: z.ZodOptional<z.ZodString>;
1720
- hasFullSchema: z.ZodOptional<z.ZodBoolean>;
1721
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1722
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1723
- schemaRef: z.ZodOptional<z.ZodObject<{
1724
- args: z.ZodObject<{
1725
- toolSlugs: z.ZodArray<z.ZodString, "many">;
1726
- }, "strip", z.ZodTypeAny, {
1727
- toolSlugs: string[];
1728
- }, {
1729
- toolSlugs: string[];
1730
- }>;
1731
- message: z.ZodOptional<z.ZodString>;
1732
- tool: z.ZodLiteral<"COMPOSIO_GET_TOOL_SCHEMAS">;
1733
- }, "strip", z.ZodTypeAny, {
1734
- args: {
1735
- toolSlugs: string[];
1736
- };
1737
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1738
- message?: string | undefined;
1739
- }, {
1740
- args: {
1741
- toolSlugs: string[];
1742
- };
1743
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1744
- message?: string | undefined;
1745
- }>>;
1746
- }, "strip", z.ZodTypeAny, {
1747
- toolkit: string;
1748
- toolSlug: string;
1749
- description?: string | undefined;
1750
- hasFullSchema?: boolean | undefined;
1751
- inputSchema?: Record<string, unknown> | undefined;
1752
- outputSchema?: Record<string, unknown> | undefined;
1753
- schemaRef?: {
1754
- args: {
1755
- toolSlugs: string[];
1756
- };
1757
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1758
- message?: string | undefined;
1759
- } | undefined;
1760
- }, {
1761
- toolkit: string;
1762
- toolSlug: string;
1763
- description?: string | undefined;
1764
- hasFullSchema?: boolean | undefined;
1765
- inputSchema?: Record<string, unknown> | undefined;
1766
- outputSchema?: Record<string, unknown> | undefined;
1767
- schemaRef?: {
1768
- args: {
1769
- toolSlugs: string[];
1770
- };
1771
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1772
- message?: string | undefined;
1773
- } | undefined;
1774
- }>>;
1775
- toolkitConnectionStatuses: z.ZodArray<z.ZodObject<{
1776
- toolkit: z.ZodString;
1777
- description: z.ZodString;
1778
- hasActiveConnection: z.ZodBoolean;
1779
- statusMessage: z.ZodString;
1780
- connectionDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1781
- currentUserInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1782
- }, "strip", z.ZodTypeAny, {
1783
- description: string;
1784
- toolkit: string;
1785
- hasActiveConnection: boolean;
1786
- statusMessage: string;
1787
- connectionDetails?: Record<string, unknown> | undefined;
1788
- currentUserInfo?: Record<string, unknown> | undefined;
1789
- }, {
1790
- description: string;
1791
- toolkit: string;
1792
- hasActiveConnection: boolean;
1793
- statusMessage: string;
1794
- connectionDetails?: Record<string, unknown> | undefined;
1795
- currentUserInfo?: Record<string, unknown> | undefined;
1796
- }>, "many">;
1797
- nextStepsGuidance: z.ZodArray<z.ZodString, "many">;
1798
- session: z.ZodObject<{
1799
- id: z.ZodString;
1800
- generateId: z.ZodBoolean;
1801
- instructions: z.ZodString;
1802
- }, "strip", z.ZodTypeAny, {
1803
- id: string;
1804
- generateId: boolean;
1805
- instructions: string;
1806
- }, {
1807
- id: string;
1808
- generateId: boolean;
1809
- instructions: string;
1810
- }>;
1811
- timeInfo: z.ZodObject<{
1812
- currentTimeUtc: z.ZodString;
1813
- currentTimeUtcEpochSeconds: z.ZodNumber;
1814
- message: z.ZodString;
1815
- }, "strip", z.ZodTypeAny, {
1816
- message: string;
1817
- currentTimeUtc: string;
1818
- currentTimeUtcEpochSeconds: number;
1819
- }, {
1820
- message: string;
1821
- currentTimeUtc: string;
1822
- currentTimeUtcEpochSeconds: number;
1823
- }>;
1824
- }, "strip", z.ZodTypeAny, {
1825
- error: string | null;
1826
- success: boolean;
1827
- results: {
1828
- toolkits: string[];
1829
- index: number;
1830
- useCase: string;
1831
- primaryToolSlugs: string[];
1832
- relatedToolSlugs: string[];
1833
- error?: string | null | undefined;
1834
- difficulty?: string | undefined;
1835
- executionGuidance?: string | undefined;
1836
- knownPitfalls?: string[] | undefined;
1837
- memory?: Record<string, string[]> | undefined;
1838
- planId?: string | undefined;
1839
- recommendedPlanSteps?: string[] | undefined;
1840
- referenceWorkbenchSnippets?: {
1841
- code: string;
1842
- description: string;
1843
- }[] | undefined;
1844
- }[];
1845
- toolSchemas: Record<string, {
1846
- toolkit: string;
1847
- toolSlug: string;
1848
- description?: string | undefined;
1849
- hasFullSchema?: boolean | undefined;
1850
- inputSchema?: Record<string, unknown> | undefined;
1851
- outputSchema?: Record<string, unknown> | undefined;
1852
- schemaRef?: {
1853
- args: {
1854
- toolSlugs: string[];
1855
- };
1856
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1857
- message?: string | undefined;
1858
- } | undefined;
1859
- }>;
1860
- toolkitConnectionStatuses: {
1861
- description: string;
1862
- toolkit: string;
1863
- hasActiveConnection: boolean;
1864
- statusMessage: string;
1865
- connectionDetails?: Record<string, unknown> | undefined;
1866
- currentUserInfo?: Record<string, unknown> | undefined;
1867
- }[];
1868
- nextStepsGuidance: string[];
1869
- session: {
1870
- id: string;
1871
- generateId: boolean;
1872
- instructions: string;
1873
- };
1874
- timeInfo: {
1875
- message: string;
1876
- currentTimeUtc: string;
1877
- currentTimeUtcEpochSeconds: number;
1878
- };
1879
- }, {
1880
- error: string | null;
1881
- success: boolean;
1882
- results: {
1883
- toolkits: string[];
1884
- index: number;
1885
- useCase: string;
1886
- primaryToolSlugs: string[];
1887
- relatedToolSlugs: string[];
1888
- error?: string | null | undefined;
1889
- difficulty?: string | undefined;
1890
- executionGuidance?: string | undefined;
1891
- knownPitfalls?: string[] | undefined;
1892
- memory?: Record<string, string[]> | undefined;
1893
- planId?: string | undefined;
1894
- recommendedPlanSteps?: string[] | undefined;
1895
- referenceWorkbenchSnippets?: {
1896
- code: string;
1897
- description: string;
1898
- }[] | undefined;
1899
- }[];
1900
- toolSchemas: Record<string, {
1901
- toolkit: string;
1902
- toolSlug: string;
1903
- description?: string | undefined;
1904
- hasFullSchema?: boolean | undefined;
1905
- inputSchema?: Record<string, unknown> | undefined;
1906
- outputSchema?: Record<string, unknown> | undefined;
1907
- schemaRef?: {
1908
- args: {
1909
- toolSlugs: string[];
1910
- };
1911
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1912
- message?: string | undefined;
1913
- } | undefined;
1914
- }>;
1915
- toolkitConnectionStatuses: {
1916
- description: string;
1917
- toolkit: string;
1918
- hasActiveConnection: boolean;
1919
- statusMessage: string;
1920
- connectionDetails?: Record<string, unknown> | undefined;
1921
- currentUserInfo?: Record<string, unknown> | undefined;
1922
- }[];
1923
- nextStepsGuidance: string[];
1924
- session: {
1925
- id: string;
1926
- generateId: boolean;
1927
- instructions: string;
1928
- };
1929
- timeInfo: {
1930
- message: string;
1931
- currentTimeUtc: string;
1932
- currentTimeUtcEpochSeconds: number;
1933
- };
1934
- }>;
1935
- type ToolRouterSessionSearchResponse = z.infer<typeof ToolRouterSessionSearchResponseSchema>;
1936
- declare const ToolRouterSessionExecuteResponseSchema: z.ZodObject<{
1937
- data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1938
- error: z.ZodNullable<z.ZodString>;
1939
- logId: z.ZodString;
1940
- }, "strip", z.ZodTypeAny, {
1941
- data: Record<string, unknown>;
1942
- error: string | null;
1943
- logId: string;
1944
- }, {
1945
- data: Record<string, unknown>;
1946
- error: string | null;
1947
- logId: string;
1948
- }>;
1949
- type ToolRouterSessionExecuteResponse = z.infer<typeof ToolRouterSessionExecuteResponseSchema>;
1950
- interface ToolRouterSessionProxyExecuteResponse {
1951
- /** The HTTP status code returned from the proxied API */
1952
- status: number;
1953
- /** The response data from the proxied API */
1954
- data?: unknown;
1955
- /** HTTP headers from the proxied API */
1956
- headers?: Record<string, string>;
1957
- /** Binary response data (present when response is a file) */
1958
- binaryData?: {
1959
- contentType: string;
1960
- size: number;
1961
- url: string;
1962
- expiresAt?: string;
1963
- };
1964
- }
1965
- /**
1966
- * Experimental features on a tool router session.
1967
- * Contains features that may be modified or removed in future versions.
1968
- */
1969
- interface SessionExperimental {
1970
- /**
1971
- * The assistive system prompt to inject into your agent for optimal tool router usage.
1972
- * Only returned on session creation, not on GET.
1973
- */
1974
- assistivePrompt?: string;
1975
- /**
1976
- * File mount operations (list, upload, download, delete) for the session's virtual filesystem.
1977
- */
1978
- files: ToolRouterSessionFilesMount;
1979
- }
1980
- type ToolRouterSessionSearchFn = (params: {
1981
- query: string;
1982
- toolkits?: string[];
1983
- }) => Promise<ToolRouterSessionSearchResponse>;
1984
- type ToolRouterSessionExecuteFn = (toolSlug: string, arguments_?: Record<string, unknown>, options?: ToolRouterSessionExecuteOptions) => Promise<ToolRouterSessionExecuteResponse>;
1985
- interface ToolRouterSessionExecuteOptions {
1986
- /**
1987
- * Account identifier for direct app tool execution in multi-account sessions.
1988
- * Meta/helper tools either ignore this top-level field or define
1989
- * their own account-selection fields, for example
1990
- * COMPOSIO_MULTI_EXECUTE_TOOL.tools[].account.
1991
- */
1992
- account?: string;
1993
- }
1994
- type ToolRouterSessionPreloadConfig = SessionCreateResponse.Config.Preload;
1995
- type ToolRouterSessionWarning = SessionCreateResponse.Warning;
1996
- interface ToolRouterSessionMetadata {
1997
- preload?: ToolRouterSessionPreloadConfig;
1998
- configVersion?: number;
1999
- warnings?: ToolRouterSessionWarning[];
2000
- preloadedCustomToolSlugs?: string[];
2001
- inlineCustomToolsPayload?: InlineCustomToolsWirePayload;
2002
- }
2003
- declare const SessionProxyExecuteParamsSchema: z.ZodObject<{
2004
- /** The toolkit whose connected account to use for auth (e.g. 'gmail', 'github') */
2005
- toolkit: z.ZodString;
2006
- /** The API endpoint URL to call */
2007
- endpoint: z.ZodString;
2008
- /** HTTP method */
2009
- method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>;
2010
- /** Request body (for POST/PUT/PATCH) */
2011
- body: z.ZodOptional<z.ZodUnknown>;
2012
- /** Query params or headers to include */
2013
- parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
2014
- in: z.ZodEnum<["query", "header"]>;
2015
- name: z.ZodString;
2016
- value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
2017
- }, "strip", z.ZodTypeAny, {
2018
- name: string;
2019
- value: string | number;
2020
- in: "query" | "header";
2021
- }, {
2022
- name: string;
2023
- value: string | number;
2024
- in: "query" | "header";
2025
- }>, "many">>;
2026
- }, "strip", z.ZodTypeAny, {
2027
- toolkit: string;
2028
- endpoint: string;
2029
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
2030
- body?: unknown;
2031
- parameters?: {
2032
- name: string;
2033
- value: string | number;
2034
- in: "query" | "header";
2035
- }[] | undefined;
2036
- }, {
2037
- toolkit: string;
2038
- endpoint: string;
2039
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
2040
- body?: unknown;
2041
- parameters?: {
2042
- name: string;
2043
- value: string | number;
2044
- in: "query" | "header";
2045
- }[] | undefined;
2046
- }>;
2047
- type SessionProxyExecuteParams = z.infer<typeof SessionProxyExecuteParamsSchema>;
2048
- type ToolRouterSessionProxyExecuteFn = (params: SessionProxyExecuteParams) => Promise<ToolRouterSessionProxyExecuteResponse>;
2049
- declare const ToolRouterUpdateSessionConfigSchema: z.ZodObject<{
2050
- toolkits: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
2051
- disable: z.ZodArray<z.ZodString, "many">;
2052
- }, "strict", z.ZodTypeAny, {
2053
- disable: string[];
2054
- }, {
2055
- disable: string[];
2056
- }>, z.ZodObject<{
2057
- enable: z.ZodArray<z.ZodString, "many">;
2058
- }, "strict", z.ZodTypeAny, {
2059
- enable: string[];
2060
- }, {
2061
- enable: string[];
2062
- }>]>>>;
2063
- tools: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
2064
- enable: z.ZodArray<z.ZodString, "many">;
2065
- }, "strict", z.ZodTypeAny, {
2066
- enable: string[];
2067
- }, {
2068
- enable: string[];
2069
- }>, z.ZodObject<{
2070
- disable: z.ZodArray<z.ZodString, "many">;
2071
- }, "strict", z.ZodTypeAny, {
2072
- disable: string[];
2073
- }, {
2074
- disable: string[];
2075
- }>, z.ZodObject<{
2076
- tags: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
2077
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2078
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2079
- }, "strict", z.ZodTypeAny, {
2080
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2081
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2082
- }, {
2083
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2084
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2085
- }>]>;
2086
- }, "strict", z.ZodTypeAny, {
2087
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2088
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2089
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2090
- };
2091
- }, {
2092
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2093
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2094
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2095
- };
2096
- }>]>, string[] | {
2097
- enable: string[];
2098
- } | {
2099
- disable: string[];
2100
- } | {
2101
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2102
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2103
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2104
- };
2105
- }, string[] | {
2106
- enable: string[];
2107
- } | {
2108
- disable: string[];
2109
- } | {
2110
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2111
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2112
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2113
- };
2114
- }>]>>>>;
2115
- tags: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
2116
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2117
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2118
- }, "strict", z.ZodTypeAny, {
2119
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2120
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2121
- }, {
2122
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2123
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2124
- }>]>>>;
2125
- authConfigs: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2126
- connectedAccounts: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>, Record<string, string[]>, Record<string, string | string[]>>>>;
2127
- manageConnections: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
2128
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2129
- callbackUrl: z.ZodOptional<z.ZodString>;
2130
- waitForConnections: z.ZodOptional<z.ZodBoolean>;
2131
- }, "strict", z.ZodTypeAny, {
2132
- callbackUrl?: string | undefined;
2133
- enable?: boolean | undefined;
2134
- waitForConnections?: boolean | undefined;
2135
- }, {
2136
- callbackUrl?: string | undefined;
2137
- enable?: boolean | undefined;
2138
- waitForConnections?: boolean | undefined;
2139
- }>]>>>>;
2140
- workbench: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
2141
- enable: z.ZodOptional<z.ZodBoolean>;
2142
- enableProxyExecution: z.ZodOptional<z.ZodBoolean>;
2143
- autoOffloadThreshold: z.ZodOptional<z.ZodNumber>;
2144
- sandboxSize: z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>;
2145
- }, "strip", z.ZodTypeAny, {
2146
- enable?: boolean | undefined;
2147
- enableProxyExecution?: boolean | undefined;
2148
- autoOffloadThreshold?: number | undefined;
2149
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2150
- }, {
2151
- enable?: boolean | undefined;
2152
- enableProxyExecution?: boolean | undefined;
2153
- autoOffloadThreshold?: number | undefined;
2154
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2155
- }>>>>;
2156
- multiAccount: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
2157
- enable: z.ZodOptional<z.ZodBoolean>;
2158
- maxAccountsPerToolkit: z.ZodOptional<z.ZodNumber>;
2159
- requireExplicitSelection: z.ZodOptional<z.ZodBoolean>;
2160
- }, "strip", z.ZodTypeAny, {
2161
- enable?: boolean | undefined;
2162
- maxAccountsPerToolkit?: number | undefined;
2163
- requireExplicitSelection?: boolean | undefined;
2164
- }, {
2165
- enable?: boolean | undefined;
2166
- maxAccountsPerToolkit?: number | undefined;
2167
- requireExplicitSelection?: boolean | undefined;
2168
- }>>>>;
2169
- preload: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2170
- tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<"all">]>>;
2171
- }, "strict", z.ZodTypeAny, {
2172
- tools?: string[] | "all" | undefined;
2173
- }, {
2174
- tools?: string[] | "all" | undefined;
2175
- }>>>;
2176
- }, "strip", z.ZodTypeAny, {
2177
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2178
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2179
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2180
- } | undefined;
2181
- tools?: Record<string, string[] | {
2182
- enable: string[];
2183
- } | {
2184
- disable: string[];
2185
- } | {
2186
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2187
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2188
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2189
- };
2190
- }> | undefined;
2191
- toolkits?: string[] | {
2192
- disable: string[];
2193
- } | {
2194
- enable: string[];
2195
- } | undefined;
2196
- preload?: {
2197
- tools?: string[] | "all" | undefined;
2198
- } | undefined;
2199
- authConfigs?: Record<string, string> | undefined;
2200
- connectedAccounts?: Record<string, string[]> | undefined;
2201
- manageConnections?: boolean | {
2202
- callbackUrl?: string | undefined;
2203
- enable?: boolean | undefined;
2204
- waitForConnections?: boolean | undefined;
2205
- } | null | undefined;
2206
- workbench?: {
2207
- enable?: boolean | undefined;
2208
- enableProxyExecution?: boolean | undefined;
2209
- autoOffloadThreshold?: number | undefined;
2210
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2211
- } | null | undefined;
2212
- multiAccount?: {
2213
- enable?: boolean | undefined;
2214
- maxAccountsPerToolkit?: number | undefined;
2215
- requireExplicitSelection?: boolean | undefined;
2216
- } | null | undefined;
2217
- }, {
2218
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2219
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2220
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2221
- } | undefined;
2222
- tools?: Record<string, string[] | {
2223
- enable: string[];
2224
- } | {
2225
- disable: string[];
2226
- } | {
2227
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2228
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2229
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2230
- };
2231
- }> | undefined;
2232
- toolkits?: string[] | {
2233
- disable: string[];
2234
- } | {
2235
- enable: string[];
2236
- } | undefined;
2237
- preload?: {
2238
- tools?: string[] | "all" | undefined;
2239
- } | undefined;
2240
- authConfigs?: Record<string, string> | undefined;
2241
- connectedAccounts?: Record<string, string | string[]> | undefined;
2242
- manageConnections?: boolean | {
2243
- callbackUrl?: string | undefined;
2244
- enable?: boolean | undefined;
2245
- waitForConnections?: boolean | undefined;
2246
- } | null | undefined;
2247
- workbench?: {
2248
- enable?: boolean | undefined;
2249
- enableProxyExecution?: boolean | undefined;
2250
- autoOffloadThreshold?: number | undefined;
2251
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2252
- } | null | undefined;
2253
- multiAccount?: {
2254
- enable?: boolean | undefined;
2255
- maxAccountsPerToolkit?: number | undefined;
2256
- requireExplicitSelection?: boolean | undefined;
2257
- } | null | undefined;
2258
- }>;
2259
- type ToolRouterUpdateSessionConfig = z.infer<typeof ToolRouterUpdateSessionConfigSchema>;
2260
- type ToolRouterSessionUpdateFn = (config: ToolRouterUpdateSessionConfig) => Promise<void>;
2261
- /** Session type returned by ToolRouter.create() and ToolRouter.use() */
2262
- interface Session<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> {
2263
- sessionId: string;
2264
- mcp: ToolRouterMCPServerConfig;
2265
- /** Stored preload configuration for this session. */
2266
- preload: ToolRouterSessionPreloadConfig;
2267
- /** Server-side config version when returned by the API. */
2268
- configVersion?: number;
2269
- /** Non-blocking session creation warnings returned by the API. */
2270
- warnings: ToolRouterSessionWarning[];
2271
- tools: ToolRouterToolsFn<TToolCollection, TTool, TProvider>;
2272
- authorize: ToolRouterAuthorizeFn;
2273
- toolkits: ToolRouterToolkitsFn;
2274
- /** Search for tools by semantic use case */
2275
- search: ToolRouterSessionSearchFn;
2276
- /** Execute a tool within the session */
2277
- execute: ToolRouterSessionExecuteFn;
2278
- /** Update the session configuration. Mutates this session in-place. */
2279
- update: ToolRouterSessionUpdateFn;
2280
- /** Proxy an API call through Composio's auth layer using the session's connected account */
2281
- proxyExecute: ToolRouterSessionProxyExecuteFn;
2282
- /** List custom tools registered in this session, with their final slugs and schemas */
2283
- customTools: (options?: {
2284
- toolkit?: string;
2285
- }) => RegisteredCustomTool[];
2286
- /** List custom toolkits registered in this session, with final slugs on nested tools */
2287
- customToolkits: () => RegisteredCustomToolkit[];
2288
- /** Experimental features (files, assistive prompt, etc.) */
2289
- experimental: SessionExperimental;
2290
- }
2291
- //#endregion
2292
- //#region src/types/customTool.types.d.ts
2293
- type BaseCustomToolOptions<T extends z$1.ZodType> = {
2294
- name: string;
2295
- description?: string;
2296
- slug: string;
2297
- inputParams: T;
2298
- };
2299
- type ToolkitBasedExecute<T extends z$1.ZodType> = {
2300
- execute: (input: z$1.infer<T>, connectionConfig: ConnectionData | null, executeToolRequest: (data: ToolProxyParams) => Promise<ToolExecuteResponse>) => Promise<ToolExecuteResponse>;
2301
- toolkitSlug: string;
2302
- };
2303
- type StandaloneExecute<T extends z$1.ZodType> = {
2304
- execute: (input: z$1.infer<T>) => Promise<ToolExecuteResponse>;
2305
- toolkitSlug?: never;
2306
- };
2307
- type CustomToolOptions<T extends z$1.ZodType> = BaseCustomToolOptions<T> & (ToolkitBasedExecute<T> | StandaloneExecute<T>);
2308
- type CustomToolRegistry = Map<string, {
2309
- options: CustomToolOptions<CustomToolInputParameter>;
2310
- schema: Tool;
2311
- }>;
2312
- type InputParamsSchema = {
2313
- definitions: {
2314
- input: {
2315
- type: string;
2316
- properties: Record<string, unknown>;
2317
- required?: string[];
2318
- };
2319
- };
2320
- };
2321
- type CustomToolInputParameter = z$1.ZodType;
2322
- interface CustomToolRegistryItem {
2323
- options: CustomToolOptions<CustomToolInputParameter>;
2324
- schema: Tool;
2325
- }
2326
- interface ExecuteMetadata {
2327
- userId: string;
2328
- connectedAccountId?: string;
2329
- }
2330
- /**
2331
- * Session context injected into custom tool execute functions at runtime.
2332
- * Provides identity context and methods to call other tools or proxy API requests.
2333
- */
2334
- interface SessionContext {
2335
- /** The user ID for this session */
2336
- readonly userId: string;
2337
- /** Execute any Composio native tool from within a custom tool. Returns the same shape as session.execute(). */
2338
- execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<ToolRouterSessionExecuteResponse>;
2339
- /** Proxy API calls through Composio's auth layer (resolved from session toolkit). */
2340
- proxyExecute(params: SessionProxyExecuteParams): Promise<ToolRouterSessionProxyExecuteResponse>;
2341
- }
2342
- /**
2343
- * Execute function for custom tools.
2344
- * Just return the result data, or throw an error. The SDK wraps it internally.
2345
- *
2346
- * Supports two call patterns:
2347
- * - `(input) => data` — for tools that don't need session context
2348
- * - `(input, ctx) => data` — for tools that need to call other tools or proxy APIs
2349
- */
2350
- type CustomToolExecuteFn<T extends z$1.ZodType> = (input: z$1.infer<T>, ctx: SessionContext) => Promise<Record<string, unknown>>;
2351
- /**
2352
- * Zod schema for validating a custom tool slug.
2353
- * Alphanumeric, underscores, and hyphens only. No `LOCAL_` or `COMPOSIO_` prefix.
2354
- * Length is validated contextually (standalone vs extension vs toolkit) at creation time.
2355
- */
2356
- declare const CustomToolSlugSchema: z$1.ZodEffects<z$1.ZodEffects<z$1.ZodString, string, string>, string, string>;
2357
- /**
2358
- * Zod schema for validating the string/scalar fields of createCustomTool() options.
2359
- * Slug is validated separately as the first argument.
2360
- * Used internally for validation — inputParams, outputParams, and execute are checked manually.
2361
- */
2362
- declare const CreateCustomToolBaseSchema: z$1.ZodObject<{
2363
- name: z$1.ZodString;
2364
- description: z$1.ZodString;
2365
- /**
2366
- * Composio toolkit slug that this tool extends (inherits auth from).
2367
- * Must be a valid Composio toolkit slug (e.g. `'gmail'`, `'github'`, `'meta_ads'`).
2368
- * The backend validates this against the toolkit catalog.
2369
- * Leave empty for tools that don't need any Composio-managed authentication.
2370
- */
2371
- extendsToolkit: z$1.ZodOptional<z$1.ZodString>;
2372
- preload: z$1.ZodOptional<z$1.ZodBoolean>;
2373
- }, "strip", z$1.ZodTypeAny, {
2374
- name: string;
2375
- description: string;
2376
- extendsToolkit?: string | undefined;
2377
- preload?: boolean | undefined;
2378
- }, {
2379
- name: string;
2380
- description: string;
2381
- extendsToolkit?: string | undefined;
2382
- preload?: boolean | undefined;
2383
- }>;
2384
- /** Options for creating a custom tool via `createCustomTool()`. */
2385
- type CreateCustomToolParams<T extends z$1.ZodType> = z$1.infer<typeof CreateCustomToolBaseSchema> & {
2386
- /** Zod schema for input parameters */
2387
- inputParams: T;
2388
- /** Optional Zod schema for output parameters (sent to backend for documentation) */
2389
- outputParams?: z$1.ZodType;
2390
- /** The function that executes the tool */
2391
- execute: CustomToolExecuteFn<T>;
2392
- };
2393
- /**
2394
- * Custom tool definition returned from `createCustomTool()`.
2395
- * Pass to `composio.create(userId, { experimental: { customTools: [...] } })` to bind to a session.
2396
- */
2397
- interface CustomTool {
2398
- readonly slug: string;
2399
- readonly name: string;
2400
- readonly description: string;
2401
- /**
2402
- * Composio toolkit slug that this tool extends (inherits auth from).
2403
- * Must be a valid Composio toolkit slug. Validated by the backend.
2404
- * Undefined means the tool doesn't need any Composio-managed authentication.
2405
- */
2406
- readonly extendsToolkit?: string;
2407
- /**
2408
- * Include this custom tool in session.tools() so it can be called without
2409
- * searching first.
2410
- */
2411
- readonly preload?: boolean;
2412
- readonly inputSchema: Record<string, unknown>;
2413
- /** JSON Schema representation of the output (for backend documentation) */
2414
- readonly outputSchema?: Record<string, unknown>;
2415
- /** @internal Original Zod schema — used for runtime input validation (defaults, coercions, transforms) */
2416
- readonly inputParams: z$1.ZodType;
2417
- /** Direct reference to the execute function — useful for testing */
2418
- readonly execute: CustomToolExecuteFn<z$1.ZodType>;
2419
- }
2420
- /** Serialized tool definition sent to backend for search indexing. Uses official client type. */
2421
- type CustomToolDefinition = SessionCreateParams.Experimental.CustomTool;
2422
- type CustomToolWireDefinition = CustomToolDefinition;
2423
- /**
2424
- * Zod schema for validating the string/scalar fields of createCustomToolkit() options.
2425
- * Slug is validated separately as the first argument.
2426
- */
2427
- declare const CreateCustomToolkitBaseSchema: z$1.ZodObject<{
2428
- name: z$1.ZodString;
2429
- description: z$1.ZodString;
2430
- preload: z$1.ZodOptional<z$1.ZodBoolean>;
2431
- }, "strip", z$1.ZodTypeAny, {
2432
- name: string;
2433
- description: string;
2434
- preload?: boolean | undefined;
2435
- }, {
2436
- name: string;
2437
- description: string;
2438
- preload?: boolean | undefined;
2439
- }>;
2440
- /** Options for creating a custom toolkit via `createCustomToolkit()`. */
2441
- type CreateCustomToolkitParams = z$1.infer<typeof CreateCustomToolkitBaseSchema> & {
2442
- /** Tools to include in this toolkit. Must not have `extendsToolkit` set. */
2443
- tools: CustomTool[];
2444
- };
2445
- /**
2446
- * Custom toolkit definition returned from `createCustomToolkit()`.
2447
- * Pass to `composio.create(userId, { experimental: { customToolkits: [...] } })`.
2448
- */
2449
- interface CustomToolkit {
2450
- readonly slug: string;
2451
- readonly name: string;
2452
- readonly description: string;
2453
- /**
2454
- * Default session.tools() exposure for tools in this custom toolkit.
2455
- * Tool-level preload values override this default.
2456
- */
2457
- readonly preload?: boolean;
2458
- readonly tools: readonly CustomTool[];
2459
- }
2460
- /** Serialized toolkit definition sent to backend. Uses official client type. */
2461
- type CustomToolkitDefinition = SessionCreateParams.Experimental.CustomToolkit;
2462
- type CustomToolkitWireDefinition = CustomToolkitDefinition;
2463
- interface InlineCustomToolsWirePayload {
2464
- custom_tools?: CustomToolWireDefinition[];
2465
- custom_toolkits?: CustomToolkitWireDefinition[];
2466
- }
2467
- /** @internal Entry in the per-session custom tools routing map. */
2468
- type CustomToolsMapEntry = {
2469
- handle: CustomTool;
2470
- /** @internal The final slug assigned by the prefixing rules (e.g. LOCAL_GREP, LOCAL_GMAIL_GET_EMAILS) */
2471
- finalSlug: string;
2472
- /** Resolved toolkit — from extendsToolkit, parent custom toolkit, or undefined for standalone */
2473
- toolkit?: string;
2474
- };
2475
- /** @internal Lookup maps used by ToolRouterSession for routing custom tools. */
2476
- type CustomToolsMap = {
2477
- /** Lookup by final slug (e.g. LOCAL_GET_USER_CONTEXT) — used for agent execution path */
2478
- byFinalSlug: Map<string, CustomToolsMapEntry>;
2479
- /** Lookup by unique original slug (e.g. GET_USER_CONTEXT) — used for programmatic session.execute() */
2480
- byOriginalSlug: Map<string, CustomToolsMapEntry>;
2481
- /** Lookup by resolved toolkit + original slug — used when multiple custom toolkits reuse tool names */
2482
- byToolkitAndOriginalSlug?: Map<string, CustomToolsMapEntry>;
2483
- /** Original slugs that appear in multiple toolkits and cannot be resolved safely without the final slug */
2484
- ambiguousOriginalSlugs?: Set<string>;
2485
- /** The original custom toolkits passed at session creation — used for session.customToolkits() */
2486
- toolkits?: CustomToolkit[];
2487
- /** The original standalone custom tools passed at session creation — kept for inline re-injection on later requests. */
2488
- tools?: CustomTool[];
2489
- };
2490
- /** A custom tool as registered in a session, with its final resolved slug. */
2491
- interface RegisteredCustomTool {
2492
- /** The final slug as registered with the backend (e.g. LOCAL_GREP, LOCAL_GMAIL_GET_EMAILS) */
2493
- slug: string;
2494
- name: string;
2495
- description: string;
2496
- /** Resolved toolkit — extendsToolkit value, custom toolkit slug, or undefined for standalone */
2497
- toolkit?: string;
2498
- inputSchema: Record<string, unknown>;
2499
- outputSchema?: Record<string, unknown>;
2500
- }
2501
- /** A custom toolkit as registered in a session, with final slugs on nested tools. */
2502
- interface RegisteredCustomToolkit {
2503
- slug: string;
2504
- name: string;
2505
- description: string;
2506
- tools: RegisteredCustomTool[];
2507
- }
2508
- /** Custom tool as returned in the session create response (has prefixed slug + original_slug). */
2509
- type CustomToolResponse = SessionCreateResponse.Experimental.CustomTool;
2510
- /** Custom toolkit as returned in the session create response (has prefixed slugs + original_slugs). */
2511
- type CustomToolkitResponse = SessionCreateResponse.Experimental.CustomToolkit;
2512
- //#endregion
2513
- export { ToolRouterSessionProxyExecuteFn as $, ConnectedAccountListResponseItem as $t, SandboxSizeSchema as A, ToolRouterSessionFilesMountDeleteOptions as At, ToolRouterConfigTools as B, ConnectedAccountAclConfig as Bt, InputParamsSchema as C, UpdateConnectedAccountAclParams as Cn, RemoteFile as Ct, MCPServerType as D, FileListResponseSchema as Dt, SessionContext as E, UpdateConnectedAccountParamsSchema as En, FileListResponse as Et, SessionProxyExecuteParamsSchema as F, ToolRouterSessionFilesMountListOptionsSchema as Ft, ToolRouterMCPServerConfigSchema as G, ConnectedAccountAuthConfigSchema as Gt, ToolRouterCreateSessionConfig as H, ConnectedAccountAclConfigResponseSchema as Ht, ToolRouterAuthorizeFn as I, ToolRouterSessionFilesMountUploadOptions as It, ToolRouterSessionExecuteOptions as J, ConnectedAccountExperimentalResponseSchema as Jt, ToolRouterManageConnectionsConfigSchema as K, ConnectedAccountExperimental as Kt, ToolRouterConfigManageConnectionsSchema as L, ToolRouterSessionFilesMountUploadOptionsSchema as Lt, SessionExperimental as M, ToolRouterSessionFilesMountDownloadOptions as Mt, SessionPreset as N, ToolRouterSessionFilesMountDownloadOptionsSchema as Nt, MCPServerTypeSchema as O, RemoteFileData as Ot, SessionProxyExecuteParams as P, ToolRouterSessionFilesMountListOptions as Pt, ToolRouterSessionPreloadConfig as Q, ConnectedAccountListResponse as Qt, ToolRouterConfigTags as R, ConnectionRequest as Rt, InlineCustomToolsWirePayload as S, DefaultCreateConnectedAccountParamsSchema as Sn, ToolkitConnectionsDetailsSchema as St, RegisteredCustomToolkit as T, UpdateConnectedAccountParams as Tn, FileDeleteResponseSchema as Tt, ToolRouterCreateSessionConfigSchema as U, ConnectedAccountAclConfigSchema as Ut, ToolRouterConfigToolsSchema as V, ConnectedAccountAclConfigResponse as Vt, ToolRouterMCPServerConfig as W, ConnectedAccountAuthConfig as Wt, ToolRouterSessionExecuteResponseSchema as X, ConnectedAccountListParams as Xt, ToolRouterSessionExecuteResponse as Y, ConnectedAccountExperimentalSchema as Yt, ToolRouterSessionMetadata as Z, ConnectedAccountListParamsSchema as Zt, CustomToolkitResponse as _, CreateConnectedAccountOptionsSchema as _n, ToolRouterUpdateSessionConfig as _t, CustomTool as a, ConnectedAccountStatus as an, ToolRouterSessionWarning as at, CustomToolsMapEntry as b, CreateConnectedAccountResponse as bn, ToolkitConnectionStateSchema as bt, CustomToolInputParameter as c, ConnectedAccountStatuses as cn, ToolRouterToolkitsDisabledConfigSchema as ct, CustomToolRegistryItem as d, ConnectedAccountTypes as dn, ToolRouterToolkitsOptions as dt, ConnectedAccountListResponseSchema as en, ToolRouterSessionProxyExecuteResponse as et, CustomToolResponse as f, CreateConnectedAccountLinkOptions as fn, ToolRouterToolkitsOptionsSchema as ft, CustomToolkitDefinition as g, CreateConnectedAccountOptions as gn, ToolRouterToolsParamSchema as gt, CustomToolkit as h, CreateConnectedAccountLinkResponseSchema as hn, ToolRouterToolsParam as ht, CreateCustomToolkitParams as i, ConnectedAccountRetrieveResponseSchema as in, ToolRouterSessionUpdateFn as it, Session as j, ToolRouterSessionFilesMountDeleteOptionsSchema as jt, SandboxSize as k, RemoteFileDataSchema as kt, CustomToolOptions as l, ConnectedAccountType as ln, ToolRouterToolkitsEnabledConfigSchema as lt, CustomToolWireDefinition as m, CreateConnectedAccountLinkResponse as mn, ToolRouterToolsFn as mt, CreateCustomToolParams as n, ConnectedAccountRefreshOptionsSchema as nn, ToolRouterSessionSearchResponse as nt, CustomToolDefinition as o, ConnectedAccountStatusEnum as on, ToolRouterTagsEnableDisableSchema as ot, CustomToolSlugSchema as p, CreateConnectedAccountLinkOptionsSchema as pn, ToolRouterToolkitsParamSchema as pt, ToolRouterSessionExecuteFn as q, ConnectedAccountExperimentalResponse as qt, CreateCustomToolkitBaseSchema as r, ConnectedAccountRetrieveResponse as rn, ToolRouterSessionSearchResponseSchema as rt, CustomToolExecuteFn as s, ConnectedAccountStatusSchema as sn, ToolRouterTagsParamSchema as st, CreateCustomToolBaseSchema as t, ConnectedAccountRefreshOptions as tn, ToolRouterSessionSearchFn as tt, CustomToolRegistry as u, ConnectedAccountTypeSchema as un, ToolRouterToolkitsFn as ut, CustomToolkitWireDefinition as v, CreateConnectedAccountParams as vn, ToolRouterUpdateSessionConfigSchema as vt, RegisteredCustomTool as w, UpdateConnectedAccountAclParamsSchema as wn, FileDeleteResponse as wt, ExecuteMetadata as x, CreateConnectedAccountResponseSchema as xn, ToolkitConnectionsDetails as xt, CustomToolsMap as y, CreateConnectedAccountParamsSchema as yn, ToolkitConnectionState as yt, ToolRouterConfigTagsSchema as z, ConnectionRequestState as zt };