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