@composio/core 0.15.0 → 0.17.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 (33) hide show
  1. package/dist/{CustomTool-zjeDpZ91.d.mts → CustomTool-Uip-fhPw.d.mts} +1 -1
  2. package/dist/{cancellation-BbJ-UQ__.mjs → cancellation-NVtGf3St.mjs} +69 -1
  3. package/dist/{composio-Bf8hnBBq.d.mts → composio-B27X6i6A.d.mts} +253 -247
  4. package/dist/{BaseProvider-BN2-Nktx.d.mts → customTool.types-B2Ava_j5.d.mts} +3020 -126
  5. package/dist/experimental/index.d.mts +2 -2
  6. package/dist/{fileUtils.node-BQ0fWge3.mjs → fileUtils.node-B1Wn848p.mjs} +2 -2
  7. package/dist/index.d.mts +18 -7
  8. package/dist/index.mjs +91 -120
  9. package/dist/models/Files.node.mjs +1 -1
  10. package/dist/{types-CePuCfD-.d.mts → types-DdZJuMm2.d.mts} +2 -2
  11. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
  12. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
  13. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  14. package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
  15. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  16. package/dist/utils/ssrfGuard.node.d.mts +11 -1
  17. package/dist/utils/ssrfGuard.node.mjs +11 -1
  18. package/dist/utils/ssrfGuard.workerd.d.mts +13 -1
  19. package/dist/utils/ssrfGuard.workerd.mjs +13 -1
  20. package/package.json +3 -3
  21. package/src/index.ts +1 -0
  22. package/src/models/RemoteFile.ts +7 -2
  23. package/src/models/ToolRouterSessionFileMount.ts +14 -8
  24. package/src/models/Tools.ts +108 -77
  25. package/src/provider/BaseProvider.ts +53 -1
  26. package/src/provider/OpenAIProvider.ts +43 -15
  27. package/src/types/provider.types.ts +15 -0
  28. package/src/types/tool.types.ts +8 -2
  29. package/src/utils/fileUtils.node.ts +8 -2
  30. package/src/utils/jsonSchema.ts +86 -1
  31. package/src/utils/ssrfGuard.node.ts +11 -0
  32. package/src/utils/ssrfGuard.workerd.ts +16 -0
  33. package/dist/customTool.types-Bhom9a2R.d.mts +0 -2859
@@ -1,2859 +0,0 @@
1
- import { dt as ConnectionDataSchema, n as BaseComposioProvider, rn as SessionMetaToolOptions } from "./BaseProvider-BN2-Nktx.mjs";
2
- import { Composio } from "@composio/client";
3
- import z, { z as z$1 } from "zod/v3";
4
- import { z as z$2 } from "zod/v4";
5
- import { ConnectedAccountUpdateStatusParams as UpdateConnectedAccountParams } from "@composio/client/resources/connected-accounts";
6
- import { SessionCreateParams, SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
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 — `data` is a legacy raw credential field. */
246
- data?: Record<string, unknown>;
247
- /** @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field. */
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
- userIds?: string[] | null | undefined;
285
- cursor?: string | null | undefined;
286
- accountType?: "PRIVATE" | "SHARED" | "ALL" | undefined;
287
- orderBy?: "created_at" | "updated_at" | undefined;
288
- statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED")[] | null | undefined;
289
- toolkitSlugs?: string[] | null | undefined;
290
- }, {
291
- limit?: number | null | undefined;
292
- authConfigIds?: string[] | null | undefined;
293
- userIds?: string[] | null | undefined;
294
- cursor?: string | null | undefined;
295
- accountType?: "PRIVATE" | "SHARED" | "ALL" | undefined;
296
- orderBy?: "created_at" | "updated_at" | undefined;
297
- statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED")[] | null | undefined;
298
- toolkitSlugs?: string[] | null | undefined;
299
- }>;
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 — `data` is a legacy raw credential field. */
308
- data?: Record<string, unknown>;
309
- /** @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field. */
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 — `data` is a legacy raw credential field. */
328
- data?: Record<string, unknown>;
329
- /** @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field. */
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 — `data` is a legacy raw credential field. */
352
- data?: Record<string, unknown>;
353
- /** @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field. */
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 — `data` is a legacy raw credential field. */
376
- data?: Record<string, unknown>;
377
- /** @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field. */
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
- experimental?: {
465
- accountType?: "PRIVATE" | "SHARED" | undefined;
466
- aclConfigForShared?: {
467
- allowAllUsers?: boolean | undefined;
468
- allowedUserIds?: string[] | undefined;
469
- notAllowedUserIds?: string[] | undefined;
470
- } | undefined;
471
- } | undefined;
472
- alias?: string | undefined;
473
- allowMultiple?: boolean | undefined;
474
- }, {
475
- callbackUrl?: string | undefined;
476
- experimental?: {
477
- accountType?: "PRIVATE" | "SHARED" | undefined;
478
- aclConfigForShared?: {
479
- allowAllUsers?: boolean | undefined;
480
- allowedUserIds?: string[] | undefined;
481
- notAllowedUserIds?: string[] | undefined;
482
- } | undefined;
483
- } | undefined;
484
- alias?: string | undefined;
485
- allowMultiple?: boolean | 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/requestOptions.types.d.ts
562
- /**
563
- * Per-request transport options for cancelling an SDK call.
564
- *
565
- * For `tools.get` and `tools.execute`, pass `signal` directly in the
566
- * options bag (3rd argument) alongside any modifiers or provider options.
567
- * For other methods (e.g. `toolkits.get`, `authConfigs.list`), pass as a
568
- * trailing argument. Forwarded to the underlying `@composio/client` request.
569
- *
570
- * If the underlying request is aborted via this signal, the SDK throws a
571
- * {@link ComposioRequestCancelledError} so callers can `instanceof`-detect
572
- * cancellation without unwrapping nested causes.
573
- *
574
- * @example Timeout after 5 seconds
575
- * ```typescript
576
- * await composio.tools.execute(
577
- * 'HACKERNEWS_GET_FRONTPAGE',
578
- * { userId: 'default', arguments: {} },
579
- * { signal: AbortSignal.timeout(5_000) }
580
- * );
581
- * ```
582
- *
583
- * @example Combine signal with modifiers
584
- * ```typescript
585
- * await composio.tools.execute('TOOL', body, {
586
- * signal: AbortSignal.timeout(10_000),
587
- * beforeExecute: ({ params }) => params,
588
- * });
589
- * ```
590
- */
591
- type ComposioRequestOptions = {
592
- /**
593
- * An `AbortSignal` used to cancel the in-flight HTTP request. When the
594
- * signal aborts, the underlying fetch is aborted and the SDK throws a
595
- * {@link ComposioRequestCancelledError} (subclass of {@link ComposioError}).
596
- */
597
- signal?: AbortSignal;
598
- };
599
- //#endregion
600
- //#region src/types/ToolRouterSessionFilesMount.types.d.ts
601
- declare const ToolRouterSessionFilesMountListOptionsSchema: z.ZodObject<{
602
- path: z.ZodOptional<z.ZodString>;
603
- mountId: z.ZodDefault<z.ZodString>;
604
- /** Pagination cursor from the previous response nextCursor field */
605
- cursor: z.ZodOptional<z.ZodString>;
606
- /** Maximum number of files to return per page (1-500) */
607
- limit: z.ZodOptional<z.ZodNumber>;
608
- }, "strip", z.ZodTypeAny, {
609
- mountId: string;
610
- path?: string | undefined;
611
- limit?: number | undefined;
612
- cursor?: string | undefined;
613
- }, {
614
- path?: string | undefined;
615
- limit?: number | undefined;
616
- cursor?: string | undefined;
617
- mountId?: string | undefined;
618
- }>;
619
- type ToolRouterSessionFilesMountListOptions = z.input<typeof ToolRouterSessionFilesMountListOptionsSchema>;
620
- declare const FileListResponseSchema: z.ZodEffects<z.ZodObject<{
621
- items: z.ZodArray<z.ZodObject<{
622
- last_modified: z.ZodString;
623
- mount_relative_path: z.ZodString;
624
- sandbox_mount_prefix: z.ZodString;
625
- size: z.ZodNumber;
626
- }, "strip", z.ZodTypeAny, {
627
- last_modified: string;
628
- mount_relative_path: string;
629
- sandbox_mount_prefix: string;
630
- size: number;
631
- }, {
632
- last_modified: string;
633
- mount_relative_path: string;
634
- sandbox_mount_prefix: string;
635
- size: number;
636
- }>, "many">;
637
- next_cursor: z.ZodOptional<z.ZodString>;
638
- }, "strip", z.ZodTypeAny, {
639
- items: {
640
- last_modified: string;
641
- mount_relative_path: string;
642
- sandbox_mount_prefix: string;
643
- size: number;
644
- }[];
645
- next_cursor?: string | undefined;
646
- }, {
647
- items: {
648
- last_modified: string;
649
- mount_relative_path: string;
650
- sandbox_mount_prefix: string;
651
- size: number;
652
- }[];
653
- next_cursor?: string | undefined;
654
- }>, {
655
- items: {
656
- lastModified: string;
657
- mountRelativePath: string;
658
- sandboxMountPrefix: string;
659
- size: number;
660
- }[];
661
- nextCursor: string | undefined;
662
- }, {
663
- items: {
664
- last_modified: string;
665
- mount_relative_path: string;
666
- sandbox_mount_prefix: string;
667
- size: number;
668
- }[];
669
- next_cursor?: string | undefined;
670
- }>;
671
- type FileListResponse = z.infer<typeof FileListResponseSchema>;
672
- declare const ToolRouterSessionFilesMountUploadOptionsSchema: z.ZodObject<{
673
- /** Remote path/filename on the mount. When passing a buffer, either mimetype or remotePath is required. */
674
- remotePath: z.ZodOptional<z.ZodString>;
675
- mountId: z.ZodDefault<z.ZodString>;
676
- /** MIME type. When passing a buffer, either mimetype or remotePath is required. Ignored when passing File (uses file.type). */
677
- mimetype: z.ZodOptional<z.ZodString>;
678
- }, "strip", z.ZodTypeAny, {
679
- mountId: string;
680
- remotePath?: string | undefined;
681
- mimetype?: string | undefined;
682
- }, {
683
- mountId?: string | undefined;
684
- remotePath?: string | undefined;
685
- mimetype?: string | undefined;
686
- }>;
687
- type ToolRouterSessionFilesMountUploadOptions = z.input<typeof ToolRouterSessionFilesMountUploadOptionsSchema>;
688
- declare const ToolRouterSessionFilesMountDownloadOptionsSchema: z.ZodObject<{
689
- mountId: z.ZodDefault<z.ZodString>;
690
- }, "strip", z.ZodTypeAny, {
691
- mountId: string;
692
- }, {
693
- mountId?: string | undefined;
694
- }>;
695
- type ToolRouterSessionFilesMountDownloadOptions = z.input<typeof ToolRouterSessionFilesMountDownloadOptionsSchema>;
696
- declare const ToolRouterSessionFilesMountDeleteOptionsSchema: z.ZodObject<{
697
- mountId: z.ZodDefault<z.ZodString>;
698
- }, "strip", z.ZodTypeAny, {
699
- mountId: string;
700
- }, {
701
- mountId?: string | undefined;
702
- }>;
703
- type ToolRouterSessionFilesMountDeleteOptions = z.input<typeof ToolRouterSessionFilesMountDeleteOptionsSchema>;
704
- declare const RemoteFileDataSchema: z.ZodEffects<z.ZodObject<{
705
- expires_at: z.ZodString;
706
- mount_relative_path: z.ZodString;
707
- sandbox_mount_prefix: z.ZodString;
708
- download_url: z.ZodString;
709
- }, "strip", z.ZodTypeAny, {
710
- mount_relative_path: string;
711
- sandbox_mount_prefix: string;
712
- expires_at: string;
713
- download_url: string;
714
- }, {
715
- mount_relative_path: string;
716
- sandbox_mount_prefix: string;
717
- expires_at: string;
718
- download_url: string;
719
- }>, {
720
- expiresAt: string;
721
- mountRelativePath: string;
722
- sandboxMountPrefix: string;
723
- downloadUrl: string;
724
- }, {
725
- mount_relative_path: string;
726
- sandbox_mount_prefix: string;
727
- expires_at: string;
728
- download_url: string;
729
- }>;
730
- /** Parsed shape from API response. Use with `new RemoteFile(data)`. */
731
- type RemoteFileData = z.infer<typeof RemoteFileDataSchema>;
732
- declare const FileDeleteResponseSchema: z.ZodEffects<z.ZodObject<{
733
- mount_relative_path: z.ZodString;
734
- sandbox_mount_prefix: z.ZodString;
735
- }, "strip", z.ZodTypeAny, {
736
- mount_relative_path: string;
737
- sandbox_mount_prefix: string;
738
- }, {
739
- mount_relative_path: string;
740
- sandbox_mount_prefix: string;
741
- }>, {
742
- mountRelativePath: string;
743
- sandboxMountPrefix: string;
744
- }, {
745
- mount_relative_path: string;
746
- sandbox_mount_prefix: string;
747
- }>;
748
- type FileDeleteResponse = z.infer<typeof FileDeleteResponseSchema>;
749
- //#endregion
750
- //#region src/models/RemoteFile.d.ts
751
- /**
752
- * Represents a file stored in a tool router session's file mount.
753
- * Provides methods to fetch, save, and work with the file content.
754
- *
755
- * @example
756
- * ```typescript
757
- * const remoteFile = await session.experimental.files.download('/output/report.pdf');
758
- * const buffer = await remoteFile.buffer();
759
- * await remoteFile.save('/tmp/report.pdf');
760
- * const text = await remoteFile.text();
761
- * ```
762
- *
763
- * @example
764
- * ```typescript
765
- * // Create from API response (snake_case)
766
- * const remoteFile = RemoteFile.parse(apiResponse);
767
- *
768
- * // Or create from parsed data (camelCase)
769
- * const remoteFile = new RemoteFile({
770
- * expiresAt: '...',
771
- * mountRelativePath: 'report.pdf',
772
- * sandboxMountPrefix: '/mnt/files',
773
- * downloadUrl: 'https://...',
774
- * });
775
- * ```
776
- */
777
- declare class RemoteFile {
778
- /** ISO 8601 timestamp when the download URL expires */
779
- readonly expiresAt: string;
780
- /** Relative path within the mount (e.g. "report.pdf") */
781
- readonly mountRelativePath: string;
782
- /** Absolute mount path inside the sandbox (e.g. /mnt/files) */
783
- readonly sandboxMountPrefix: string;
784
- /** Presigned URL for downloading the file */
785
- readonly downloadUrl: string;
786
- constructor(data: RemoteFileData);
787
- /**
788
- * Parses an API response (snake_case) and returns a RemoteFile instance.
789
- * @param data - Raw API response with snake_case keys
790
- * @returns A RemoteFile instance
791
- * @throws ValidationError if the response shape is invalid
792
- */
793
- static parse(data: unknown): RemoteFile;
794
- /** Filename extracted from the mount path (e.g. "report.pdf" from "output/report.pdf") */
795
- get filename(): string;
796
- /**
797
- * Fetches the file content as a buffer.
798
- * @returns The file content as a Uint8Array
799
- * @throws RemoteFileDownloadError if the fetch fails
800
- */
801
- buffer(): Promise<Uint8Array>;
802
- /**
803
- * Fetches the file content as UTF-8 text.
804
- * @returns The file content as a string
805
- * @throws Error if the fetch fails
806
- */
807
- text(): Promise<string>;
808
- /**
809
- * Fetches the file content as a Blob.
810
- * @returns The file content as a Blob
811
- * @throws RemoteFileDownloadError if the fetch fails
812
- */
813
- blob(): Promise<Blob>;
814
- /**
815
- * Downloads and saves the file to the local filesystem.
816
- * Requires a Node.js runtime with file system support (not available in Cloudflare Workers/Edge).
817
- *
818
- * @param path - Local path to save the file. If omitted, saves to the Composio temp directory using the filename from the mount path.
819
- * @returns The absolute path where the file was saved
820
- * @throws Error if file system is not supported or the save fails
821
- */
822
- save(path?: string): Promise<string>;
823
- }
824
- //#endregion
825
- //#region src/models/ToolRouterSessionFileMount.d.ts
826
- /**
827
- * File mount for a Composio session, reached via `session.experimental.files`
828
- * on a session created with `composio.sessions.create(...)`. Upload, list,
829
- * download, and delete files scoped to a single session.
830
- */
831
- declare class ToolRouterSessionFilesMount {
832
- private readonly sessionId;
833
- private readonly client;
834
- constructor(client: Composio, sessionId: string);
835
- /**
836
- * Lists files and directories at the specified path on the session's file mount.
837
- *
838
- * Use this to browse the virtual filesystem attached to the tool router session.
839
- * The path is relative to the mount root (e.g., `"/"` for root, `"/documents"` for a subdirectory).
840
- * Supports cursor-based pagination via `cursor` and `limit` options.
841
- *
842
- * @param options - Optional configuration for the list operation.
843
- * @param options.path - The directory path to list. Use `"/"` for the mount root.
844
- * @param options.mountId - The ID of the file mount to operate on. Defaults to `"files"` when omitted.
845
- * @param options.cursor - Pagination cursor from the previous response's nextCursor field.
846
- * @param options.limit - Maximum number of files to return per page (1-500).
847
- * @returns List of files with nextCursor for pagination.
848
- *
849
- * @example
850
- * ```typescript
851
- * const session = await composio.toolRouter.use('session_123');
852
- * const { items, nextCursor } = await session.experimental.files.list({ path: '/' });
853
- * ```
854
- *
855
- * @example
856
- * ```typescript
857
- * // Paginated listing
858
- * let result = await session.experimental.files.list({ path: '/', limit: 10 });
859
- * while (result.nextCursor) {
860
- * result = await session.experimental.files.list({ path: '/', cursor: result.nextCursor, limit: 10 });
861
- * }
862
- * ```
863
- */
864
- list(options?: ToolRouterSessionFilesMountListOptions): Promise<FileListResponse>;
865
- private normalizeUploadInput;
866
- /**
867
- * Uploads a file to the session's file mount.
868
- *
869
- * Accepts a file path (local or URL), a native File object, or a raw buffer.
870
- * The file is stored in the virtual filesystem associated with the tool router session.
871
- * URL inputs require a Node.js or Bun runtime so the destination can be DNS-validated;
872
- * edge runtimes must fetch the file themselves and pass a File or ArrayBuffer.
873
- *
874
- * @param input - File path (string), native File, or raw buffer (ArrayBuffer | Uint8Array).
875
- * @param options - Optional configuration. When passing a buffer, remotePath is required.
876
- * @returns Metadata about the uploaded file.
877
- *
878
- * @example
879
- * ```typescript
880
- * // From file path (local or URL)
881
- * await session.experimental.files.upload('/path/to/report.pdf');
882
- * await session.experimental.files.upload('https://example.com/file.pdf');
883
- * ```
884
- *
885
- * @example
886
- * ```typescript
887
- * // From native File (e.g. from input[type=file])
888
- * await session.experimental.files.upload(fileInput.files[0]);
889
- * ```
890
- *
891
- * @example
892
- * ```typescript
893
- * // From raw buffer
894
- * await session.experimental.files.upload(buffer, { remotePath: 'data.json', mimetype: 'application/json' });
895
- * ```
896
- */
897
- upload(input: string | File | ArrayBuffer | Uint8Array, options?: ToolRouterSessionFilesMountUploadOptions): Promise<RemoteFile>;
898
- /**
899
- * Downloads a file from the session's file mount to the local filesystem.
900
- *
901
- * Retrieves a file stored in the session's virtual filesystem (e.g., one produced
902
- * by a tool or previously uploaded) and saves it to the specified local path.
903
- *
904
- * @param filePath - The path of the file on the mount to download, or the local path where the file should be saved (implementation-specific).
905
- * @param options - Optional configuration for the download.
906
- * @param options.mountId - The ID of the file mount to download from. Defaults to `"files"` when omitted.
907
- * @returns The downloaded file data or path (implementation-specific).
908
- *
909
- * @example
910
- * ```typescript
911
- * const session = await composio.toolRouter.use('session_123');
912
- * const result = await session.experimental.files.download('/output/report.pdf');
913
- * ```
914
- *
915
- * @example
916
- * ```typescript
917
- * // Download from a custom mount
918
- * await session.experimental.files.download('/exports/data.json', {
919
- * mountId: 'custom-mount',
920
- * });
921
- * ```
922
- */
923
- download(filePath: string, options?: ToolRouterSessionFilesMountDownloadOptions): Promise<RemoteFile>;
924
- /**
925
- * Deletes a file or directory at the specified path on the session's file mount.
926
- *
927
- * Removes the file or directory from the virtual filesystem. Use with caution:
928
- * deletion is typically irreversible. Ensure the path exists and is intended for removal.
929
- *
930
- * @param remotePath - The path of the file or directory to delete on the mount.
931
- * @param options - Optional configuration for the delete operation.
932
- * @param options.mountId - The ID of the file mount to operate on. Defaults to `"files"` when omitted.
933
- * @returns Confirmation of deletion (implementation-specific).
934
- *
935
- * @example
936
- * ```typescript
937
- * const session = await composio.toolRouter.use('session_123');
938
- * await session.experimental.files.delete('/temp/cache.json');
939
- * ```
940
- *
941
- * @example
942
- * ```typescript
943
- * // Delete from a custom mount
944
- * await session.experimental.files.delete('/old-backup', {
945
- * mountId: 'custom-mount',
946
- * });
947
- * ```
948
- *
949
- * @warning This operation is destructive. Deleted files cannot be recovered.
950
- */
951
- delete(remotePath: string, options?: ToolRouterSessionFilesMountDeleteOptions): Promise<FileDeleteResponse>;
952
- }
953
- //#endregion
954
- //#region src/types/toolRouter.types.d.ts
955
- declare const SessionPreset: {
956
- readonly DIRECT_TOOLS: "direct_tools";
957
- };
958
- type SessionPreset = (typeof SessionPreset)[keyof typeof SessionPreset];
959
- declare const MCPServerTypeSchema: z.ZodEnum<["http", "sse"]>;
960
- type MCPServerType = z.infer<typeof MCPServerTypeSchema>;
961
- /**
962
- * Sandbox compute tier for the session sandbox.
963
- *
964
- * | Tier | vCPU | RAM |
965
- * | -------- | ---- | ----- |
966
- * | standard | 1 | 1 GB |
967
- * | medium | 2 | 2 GB |
968
- * | large | 4 | 4 GB |
969
- * | xlarge | 8 | 8 GB |
970
- *
971
- * Defaults to `standard` server-side when omitted.
972
- */
973
- declare const SandboxSizeSchema: z.ZodEnum<["standard", "medium", "large", "xlarge"]>;
974
- type SandboxSize = z.infer<typeof SandboxSizeSchema>;
975
- declare const ToolRouterSandboxConfigSchema: z.ZodObject<{
976
- enable: z.ZodDefault<z.ZodBoolean>;
977
- enableProxyExecution: z.ZodOptional<z.ZodBoolean>;
978
- autoOffloadThreshold: z.ZodOptional<z.ZodNumber>;
979
- sandboxSize: z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>;
980
- }, "strip", z.ZodTypeAny, {
981
- enable: boolean;
982
- enableProxyExecution?: boolean | undefined;
983
- autoOffloadThreshold?: number | undefined;
984
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
985
- }, {
986
- enable?: boolean | undefined;
987
- enableProxyExecution?: boolean | undefined;
988
- autoOffloadThreshold?: number | undefined;
989
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
990
- }>;
991
- type ToolRouterSandboxConfig = z.infer<typeof ToolRouterSandboxConfigSchema>;
992
- declare const ToolRouterConfigManageConnectionsSchema: z.ZodObject<{
993
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
994
- callbackUrl: z.ZodOptional<z.ZodString>;
995
- waitForConnections: z.ZodOptional<z.ZodBoolean>;
996
- }, "strict", z.ZodTypeAny, {
997
- enable?: boolean | undefined;
998
- callbackUrl?: string | undefined;
999
- waitForConnections?: boolean | undefined;
1000
- }, {
1001
- enable?: boolean | undefined;
1002
- callbackUrl?: string | undefined;
1003
- waitForConnections?: boolean | undefined;
1004
- }>;
1005
- declare const ToolRouterToolkitsParamSchema: z.ZodArray<z.ZodString, "many">;
1006
- declare const ToolRouterToolkitsDisabledConfigSchema: z.ZodObject<{
1007
- disable: z.ZodArray<z.ZodString, "many">;
1008
- }, "strict", z.ZodTypeAny, {
1009
- disable: string[];
1010
- }, {
1011
- disable: string[];
1012
- }>;
1013
- declare const ToolRouterToolkitsEnabledConfigSchema: z.ZodObject<{
1014
- enable: z.ZodArray<z.ZodString, "many">;
1015
- }, "strict", z.ZodTypeAny, {
1016
- enable: string[];
1017
- }, {
1018
- enable: string[];
1019
- }>;
1020
- declare const ToolRouterManageConnectionsConfigSchema: z.ZodObject<{
1021
- enable: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1022
- callbackUrl: z.ZodOptional<z.ZodString>;
1023
- }, "strip", z.ZodTypeAny, {
1024
- enable: boolean;
1025
- callbackUrl?: string | undefined;
1026
- }, {
1027
- enable?: boolean | undefined;
1028
- callbackUrl?: string | undefined;
1029
- }>;
1030
- declare const ToolRouterTagsParamSchema: z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">;
1031
- declare const ToolRouterTagsEnableDisableSchema: z.ZodObject<{
1032
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1033
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1034
- }, "strict", z.ZodTypeAny, {
1035
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1036
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1037
- }, {
1038
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1039
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1040
- }>;
1041
- declare const ToolRouterConfigTagsSchema: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1042
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1043
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1044
- }, "strict", z.ZodTypeAny, {
1045
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1046
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1047
- }, {
1048
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1049
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1050
- }>]>;
1051
- type ToolRouterConfigTags = z.infer<typeof ToolRouterConfigTagsSchema>;
1052
- /**
1053
- * Tools config - Configure tools per toolkit using toolkit slug as key
1054
- * @example
1055
- * ```typescript
1056
- * {
1057
- * gmail: {
1058
- * enable: ['gmail_search', 'gmail_send']
1059
- * },
1060
- * slack: {
1061
- * disable: ['slack_delete_message']
1062
- * }
1063
- * }
1064
- * ```
1065
- *
1066
- * @example
1067
- * ```typescript
1068
- * {
1069
- * gmail: ['gmail_search', 'gmail_send'],
1070
- * slack: { tags: ['readOnlyHint'] }
1071
- * }
1072
- * ```
1073
- */
1074
- declare const ToolRouterToolsParamSchema: z.ZodArray<z.ZodString, "many">;
1075
- type ToolRouterToolsParam = z.infer<typeof ToolRouterToolsParamSchema>;
1076
- declare const ToolRouterConfigToolsSchema: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
1077
- enable: z.ZodArray<z.ZodString, "many">;
1078
- }, "strict", z.ZodTypeAny, {
1079
- enable: string[];
1080
- }, {
1081
- enable: string[];
1082
- }>, z.ZodObject<{
1083
- disable: z.ZodArray<z.ZodString, "many">;
1084
- }, "strict", z.ZodTypeAny, {
1085
- disable: string[];
1086
- }, {
1087
- disable: string[];
1088
- }>, z.ZodObject<{
1089
- tags: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1090
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1091
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1092
- }, "strict", z.ZodTypeAny, {
1093
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1094
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1095
- }, {
1096
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1097
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1098
- }>]>;
1099
- }, "strict", z.ZodTypeAny, {
1100
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1101
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1102
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1103
- };
1104
- }, {
1105
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1106
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1107
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1108
- };
1109
- }>]>, string[] | {
1110
- enable: string[];
1111
- } | {
1112
- disable: string[];
1113
- } | {
1114
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1115
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1116
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1117
- };
1118
- }, string[] | {
1119
- enable: string[];
1120
- } | {
1121
- disable: string[];
1122
- } | {
1123
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1124
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1125
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1126
- };
1127
- }>;
1128
- type ToolRouterConfigTools = z.infer<typeof ToolRouterConfigToolsSchema>;
1129
- declare const ToolRouterCreateSessionConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
1130
- sessionPreset: z.ZodOptional<z.ZodOptional<z.ZodLiteral<"direct_tools">>>;
1131
- mcp: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1132
- 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<{
1133
- enable: z.ZodArray<z.ZodString, "many">;
1134
- }, "strict", z.ZodTypeAny, {
1135
- enable: string[];
1136
- }, {
1137
- enable: string[];
1138
- }>, z.ZodObject<{
1139
- disable: z.ZodArray<z.ZodString, "many">;
1140
- }, "strict", z.ZodTypeAny, {
1141
- disable: string[];
1142
- }, {
1143
- disable: string[];
1144
- }>, z.ZodObject<{
1145
- tags: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1146
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1147
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1148
- }, "strict", z.ZodTypeAny, {
1149
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1150
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1151
- }, {
1152
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1153
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1154
- }>]>;
1155
- }, "strict", z.ZodTypeAny, {
1156
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1157
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1158
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1159
- };
1160
- }, {
1161
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1162
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1163
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1164
- };
1165
- }>]>, string[] | {
1166
- enable: string[];
1167
- } | {
1168
- disable: string[];
1169
- } | {
1170
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1171
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1172
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1173
- };
1174
- }, string[] | {
1175
- enable: string[];
1176
- } | {
1177
- disable: string[];
1178
- } | {
1179
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1180
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1181
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1182
- };
1183
- }>]>>>>;
1184
- tags: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
1185
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1186
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1187
- }, "strict", z.ZodTypeAny, {
1188
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1189
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1190
- }, {
1191
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1192
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1193
- }>]>>>;
1194
- toolkits: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
1195
- disable: z.ZodArray<z.ZodString, "many">;
1196
- }, "strict", z.ZodTypeAny, {
1197
- disable: string[];
1198
- }, {
1199
- disable: string[];
1200
- }>, z.ZodObject<{
1201
- enable: z.ZodArray<z.ZodString, "many">;
1202
- }, "strict", z.ZodTypeAny, {
1203
- enable: string[];
1204
- }, {
1205
- enable: string[];
1206
- }>]>>>;
1207
- authConfigs: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>>;
1208
- connectedAccounts: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>>;
1209
- manageConnections: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
1210
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1211
- callbackUrl: z.ZodOptional<z.ZodString>;
1212
- waitForConnections: z.ZodOptional<z.ZodBoolean>;
1213
- }, "strict", z.ZodTypeAny, {
1214
- enable?: boolean | undefined;
1215
- callbackUrl?: string | undefined;
1216
- waitForConnections?: boolean | undefined;
1217
- }, {
1218
- enable?: boolean | undefined;
1219
- callbackUrl?: string | undefined;
1220
- waitForConnections?: boolean | undefined;
1221
- }>]>>>>;
1222
- sandbox: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1223
- enable: z.ZodDefault<z.ZodBoolean>;
1224
- enableProxyExecution: z.ZodOptional<z.ZodBoolean>;
1225
- autoOffloadThreshold: z.ZodOptional<z.ZodNumber>;
1226
- sandboxSize: z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>;
1227
- }, "strip", z.ZodTypeAny, {
1228
- enable: boolean;
1229
- enableProxyExecution?: boolean | undefined;
1230
- autoOffloadThreshold?: number | undefined;
1231
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1232
- }, {
1233
- enable?: boolean | undefined;
1234
- enableProxyExecution?: boolean | undefined;
1235
- autoOffloadThreshold?: number | undefined;
1236
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1237
- }>>>;
1238
- workbench: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1239
- enable: z.ZodDefault<z.ZodBoolean>;
1240
- enableProxyExecution: z.ZodOptional<z.ZodBoolean>;
1241
- autoOffloadThreshold: z.ZodOptional<z.ZodNumber>;
1242
- sandboxSize: z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>;
1243
- }, "strip", z.ZodTypeAny, {
1244
- enable: boolean;
1245
- enableProxyExecution?: boolean | undefined;
1246
- autoOffloadThreshold?: number | undefined;
1247
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1248
- }, {
1249
- enable?: boolean | undefined;
1250
- enableProxyExecution?: boolean | undefined;
1251
- autoOffloadThreshold?: number | undefined;
1252
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1253
- }>>>;
1254
- multiAccount: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1255
- enable: z.ZodDefault<z.ZodBoolean>;
1256
- maxAccountsPerToolkit: z.ZodOptional<z.ZodNumber>;
1257
- requireExplicitSelection: z.ZodOptional<z.ZodBoolean>;
1258
- }, "strip", z.ZodTypeAny, {
1259
- enable: boolean;
1260
- maxAccountsPerToolkit?: number | undefined;
1261
- requireExplicitSelection?: boolean | undefined;
1262
- }, {
1263
- enable?: boolean | undefined;
1264
- maxAccountsPerToolkit?: number | undefined;
1265
- requireExplicitSelection?: boolean | undefined;
1266
- }>>>;
1267
- preload: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1268
- tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<"all">]>>;
1269
- }, "strict", z.ZodTypeAny, {
1270
- tools?: string[] | "all" | undefined;
1271
- }, {
1272
- tools?: string[] | "all" | undefined;
1273
- }>>>;
1274
- experimental: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1275
- assistivePrompt: z.ZodOptional<z.ZodObject<{
1276
- userTimezone: z.ZodOptional<z.ZodString>;
1277
- }, "strip", z.ZodTypeAny, {
1278
- userTimezone?: string | undefined;
1279
- }, {
1280
- userTimezone?: string | undefined;
1281
- }>>;
1282
- customTools: z.ZodOptional<z.ZodArray<z.ZodType<CustomTool, z.ZodTypeDef, CustomTool>, "many">>;
1283
- customToolkits: z.ZodOptional<z.ZodArray<z.ZodType<CustomToolkit, z.ZodTypeDef, CustomToolkit>, "many">>;
1284
- }, "strip", z.ZodTypeAny, {
1285
- assistivePrompt?: {
1286
- userTimezone?: string | undefined;
1287
- } | undefined;
1288
- customTools?: CustomTool[] | undefined;
1289
- customToolkits?: CustomToolkit[] | undefined;
1290
- }, {
1291
- assistivePrompt?: {
1292
- userTimezone?: string | undefined;
1293
- } | undefined;
1294
- customTools?: CustomTool[] | undefined;
1295
- customToolkits?: CustomToolkit[] | undefined;
1296
- }>>>;
1297
- }, "strip", z.ZodTypeAny, {
1298
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1299
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1300
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1301
- } | undefined;
1302
- tools?: Record<string, string[] | {
1303
- enable: string[];
1304
- } | {
1305
- disable: string[];
1306
- } | {
1307
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1308
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1309
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1310
- };
1311
- }> | undefined;
1312
- toolkits?: string[] | {
1313
- disable: string[];
1314
- } | {
1315
- enable: string[];
1316
- } | undefined;
1317
- authConfigs?: Record<string, string> | undefined;
1318
- preload?: {
1319
- tools?: string[] | "all" | undefined;
1320
- } | undefined;
1321
- sessionPreset?: "direct_tools" | undefined;
1322
- mcp?: boolean | undefined;
1323
- connectedAccounts?: Record<string, string | string[]> | undefined;
1324
- manageConnections?: boolean | {
1325
- enable?: boolean | undefined;
1326
- callbackUrl?: string | undefined;
1327
- waitForConnections?: boolean | undefined;
1328
- } | undefined;
1329
- sandbox?: {
1330
- enable: boolean;
1331
- enableProxyExecution?: boolean | undefined;
1332
- autoOffloadThreshold?: number | undefined;
1333
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1334
- } | undefined;
1335
- workbench?: {
1336
- enable: boolean;
1337
- enableProxyExecution?: boolean | undefined;
1338
- autoOffloadThreshold?: number | undefined;
1339
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1340
- } | undefined;
1341
- multiAccount?: {
1342
- enable: boolean;
1343
- maxAccountsPerToolkit?: number | undefined;
1344
- requireExplicitSelection?: boolean | undefined;
1345
- } | undefined;
1346
- experimental?: {
1347
- assistivePrompt?: {
1348
- userTimezone?: string | undefined;
1349
- } | undefined;
1350
- customTools?: CustomTool[] | undefined;
1351
- customToolkits?: CustomToolkit[] | undefined;
1352
- } | undefined;
1353
- }, {
1354
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1355
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1356
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1357
- } | undefined;
1358
- tools?: Record<string, string[] | {
1359
- enable: string[];
1360
- } | {
1361
- disable: string[];
1362
- } | {
1363
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1364
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1365
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1366
- };
1367
- }> | undefined;
1368
- toolkits?: string[] | {
1369
- disable: string[];
1370
- } | {
1371
- enable: string[];
1372
- } | undefined;
1373
- authConfigs?: Record<string, string> | undefined;
1374
- preload?: {
1375
- tools?: string[] | "all" | undefined;
1376
- } | undefined;
1377
- sessionPreset?: "direct_tools" | undefined;
1378
- mcp?: boolean | undefined;
1379
- connectedAccounts?: Record<string, string | string[]> | undefined;
1380
- manageConnections?: boolean | {
1381
- enable?: boolean | undefined;
1382
- callbackUrl?: string | undefined;
1383
- waitForConnections?: boolean | undefined;
1384
- } | undefined;
1385
- sandbox?: {
1386
- enable?: boolean | undefined;
1387
- enableProxyExecution?: boolean | undefined;
1388
- autoOffloadThreshold?: number | undefined;
1389
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1390
- } | undefined;
1391
- workbench?: {
1392
- enable?: boolean | undefined;
1393
- enableProxyExecution?: boolean | undefined;
1394
- autoOffloadThreshold?: number | undefined;
1395
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1396
- } | undefined;
1397
- multiAccount?: {
1398
- enable?: boolean | undefined;
1399
- maxAccountsPerToolkit?: number | undefined;
1400
- requireExplicitSelection?: boolean | undefined;
1401
- } | undefined;
1402
- experimental?: {
1403
- assistivePrompt?: {
1404
- userTimezone?: string | undefined;
1405
- } | undefined;
1406
- customTools?: CustomTool[] | undefined;
1407
- customToolkits?: CustomToolkit[] | undefined;
1408
- } | undefined;
1409
- }>, {
1410
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1411
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1412
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1413
- } | undefined;
1414
- tools?: Record<string, string[] | {
1415
- enable: string[];
1416
- } | {
1417
- disable: string[];
1418
- } | {
1419
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1420
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1421
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1422
- };
1423
- }> | undefined;
1424
- toolkits?: string[] | {
1425
- disable: string[];
1426
- } | {
1427
- enable: string[];
1428
- } | undefined;
1429
- authConfigs?: Record<string, string> | undefined;
1430
- preload?: {
1431
- tools?: string[] | "all" | undefined;
1432
- } | undefined;
1433
- sessionPreset?: "direct_tools" | undefined;
1434
- mcp?: boolean | undefined;
1435
- connectedAccounts?: Record<string, string | string[]> | undefined;
1436
- manageConnections?: boolean | {
1437
- enable?: boolean | undefined;
1438
- callbackUrl?: string | undefined;
1439
- waitForConnections?: boolean | undefined;
1440
- } | undefined;
1441
- sandbox?: {
1442
- enable: boolean;
1443
- enableProxyExecution?: boolean | undefined;
1444
- autoOffloadThreshold?: number | undefined;
1445
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1446
- } | undefined;
1447
- workbench?: {
1448
- enable: boolean;
1449
- enableProxyExecution?: boolean | undefined;
1450
- autoOffloadThreshold?: number | undefined;
1451
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1452
- } | undefined;
1453
- multiAccount?: {
1454
- enable: boolean;
1455
- maxAccountsPerToolkit?: number | undefined;
1456
- requireExplicitSelection?: boolean | undefined;
1457
- } | undefined;
1458
- experimental?: {
1459
- assistivePrompt?: {
1460
- userTimezone?: string | undefined;
1461
- } | undefined;
1462
- customTools?: CustomTool[] | undefined;
1463
- customToolkits?: CustomToolkit[] | undefined;
1464
- } | undefined;
1465
- }, {
1466
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1467
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1468
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1469
- } | undefined;
1470
- tools?: Record<string, string[] | {
1471
- enable: string[];
1472
- } | {
1473
- disable: string[];
1474
- } | {
1475
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1476
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1477
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1478
- };
1479
- }> | undefined;
1480
- toolkits?: string[] | {
1481
- disable: string[];
1482
- } | {
1483
- enable: string[];
1484
- } | undefined;
1485
- authConfigs?: Record<string, string> | undefined;
1486
- preload?: {
1487
- tools?: string[] | "all" | undefined;
1488
- } | undefined;
1489
- sessionPreset?: "direct_tools" | undefined;
1490
- mcp?: boolean | undefined;
1491
- connectedAccounts?: Record<string, string | string[]> | undefined;
1492
- manageConnections?: boolean | {
1493
- enable?: boolean | undefined;
1494
- callbackUrl?: string | undefined;
1495
- waitForConnections?: boolean | undefined;
1496
- } | undefined;
1497
- sandbox?: {
1498
- enable?: boolean | undefined;
1499
- enableProxyExecution?: boolean | undefined;
1500
- autoOffloadThreshold?: number | undefined;
1501
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1502
- } | undefined;
1503
- workbench?: {
1504
- enable?: boolean | undefined;
1505
- enableProxyExecution?: boolean | undefined;
1506
- autoOffloadThreshold?: number | undefined;
1507
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1508
- } | undefined;
1509
- multiAccount?: {
1510
- enable?: boolean | undefined;
1511
- maxAccountsPerToolkit?: number | undefined;
1512
- requireExplicitSelection?: boolean | undefined;
1513
- } | undefined;
1514
- experimental?: {
1515
- assistivePrompt?: {
1516
- userTimezone?: string | undefined;
1517
- } | undefined;
1518
- customTools?: CustomTool[] | undefined;
1519
- customToolkits?: CustomToolkit[] | undefined;
1520
- } | undefined;
1521
- }>, {
1522
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1523
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1524
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1525
- } | undefined;
1526
- tools?: Record<string, string[] | {
1527
- enable: string[];
1528
- } | {
1529
- disable: string[];
1530
- } | {
1531
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1532
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1533
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1534
- };
1535
- }> | undefined;
1536
- toolkits?: string[] | {
1537
- disable: string[];
1538
- } | {
1539
- enable: string[];
1540
- } | undefined;
1541
- authConfigs?: Record<string, string> | undefined;
1542
- preload?: {
1543
- tools?: string[] | "all" | undefined;
1544
- } | undefined;
1545
- sessionPreset?: "direct_tools" | undefined;
1546
- mcp?: boolean | undefined;
1547
- connectedAccounts?: Record<string, string | string[]> | undefined;
1548
- manageConnections?: boolean | {
1549
- enable?: boolean | undefined;
1550
- callbackUrl?: string | undefined;
1551
- waitForConnections?: boolean | undefined;
1552
- } | undefined;
1553
- sandbox?: {
1554
- enable: boolean;
1555
- enableProxyExecution?: boolean | undefined;
1556
- autoOffloadThreshold?: number | undefined;
1557
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1558
- } | undefined;
1559
- workbench?: {
1560
- enable: boolean;
1561
- enableProxyExecution?: boolean | undefined;
1562
- autoOffloadThreshold?: number | undefined;
1563
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1564
- } | undefined;
1565
- multiAccount?: {
1566
- enable: boolean;
1567
- maxAccountsPerToolkit?: number | undefined;
1568
- requireExplicitSelection?: boolean | undefined;
1569
- } | undefined;
1570
- experimental?: {
1571
- assistivePrompt?: {
1572
- userTimezone?: string | undefined;
1573
- } | undefined;
1574
- customTools?: CustomTool[] | undefined;
1575
- customToolkits?: CustomToolkit[] | undefined;
1576
- } | undefined;
1577
- }, unknown>;
1578
- /**
1579
- * The config for the tool router session.
1580
- *
1581
- * @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 sandbox by default; explicit overrides for supported fields still win. Without this preset, ToolRouter uses the default configuration with meta tools enabled.
1582
- * @param {ToolRouterToolkitsParamSchema | ToolRouterToolkitsDisabledConfigSchema | ToolRouterToolkitsEnabledConfigSchema} toolkits - The toolkits to use in the tool router session
1583
- * @param {Record<string, ToolRouterToolsParam | ToolRouterConfigTools>} tools - The tools to configure per toolkit (key is toolkit slug)
1584
- * @param {Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>} tags - Global tags to filter tools by behavior
1585
- * @param {Record<string, string>} authConfigs - The auth configs to use in the tool router session
1586
- * @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.
1587
- * @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.
1588
- * @param {boolean} [manageConnections.enable] - Whether to use tools to manage connections in the tool router session @default true
1589
- * @param {string} [manageConnections.callbackUrl] - The callback url to use in the tool router session
1590
- * @param {object} sandbox - Sandbox configuration for code execution. Preferred over workbench.
1591
- * @param {boolean} [sandbox.enable] - Whether to enable the sandbox entirely. Defaults to true. When false, no code execution tools are available.
1592
- * @param {boolean} [sandbox.enableProxyExecution] - Whether to enable proxy execution
1593
- * @param {number} [sandbox.autoOffloadThreshold] - Auto offload threshold in characters for moving execution to the sandbox
1594
- * @param {SandboxSize} [sandbox.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)
1595
- * @param {object} workbench - Deprecated alias for sandbox. Accepted for backwards compatibility.
1596
- * @param {object} [multiAccount] - Multi-account configuration for this session
1597
- * @param {boolean} [multiAccount.enable] - When true, enables multi-account mode. Falls back to org/project-level config when not set.
1598
- * @param {number} [multiAccount.maxAccountsPerToolkit] - Max connected accounts per toolkit (2-10, default 5)
1599
- * @param {boolean} [multiAccount.requireExplicitSelection] - When true, require explicit account selection when multiple accounts are connected
1600
- * @param {object} [preload] - Tools to preload into session.tools() and the MCP tool list
1601
- * @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.
1602
- */
1603
- type ToolRouterCreateSessionConfig = z.infer<typeof ToolRouterCreateSessionConfigSchema>;
1604
- declare const ToolkitConnectionStateSchema: z.ZodObject<{
1605
- slug: z.ZodString;
1606
- name: z.ZodString;
1607
- logo: z.ZodOptional<z.ZodString>;
1608
- isNoAuth: z.ZodDefault<z.ZodBoolean>;
1609
- connection: z.ZodOptional<z.ZodObject<{
1610
- isActive: z.ZodBoolean;
1611
- authConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1612
- id: z.ZodString;
1613
- mode: z.ZodString;
1614
- isComposioManaged: z.ZodBoolean;
1615
- }, "strip", z.ZodTypeAny, {
1616
- id: string;
1617
- mode: string;
1618
- isComposioManaged: boolean;
1619
- }, {
1620
- id: string;
1621
- mode: string;
1622
- isComposioManaged: boolean;
1623
- }>>>;
1624
- connectedAccount: z.ZodOptional<z.ZodObject<{
1625
- id: z.ZodString;
1626
- status: z.ZodString;
1627
- }, "strip", z.ZodTypeAny, {
1628
- status: string;
1629
- id: string;
1630
- }, {
1631
- status: string;
1632
- id: string;
1633
- }>>;
1634
- }, "strip", z.ZodTypeAny, {
1635
- isActive: boolean;
1636
- authConfig?: {
1637
- id: string;
1638
- mode: string;
1639
- isComposioManaged: boolean;
1640
- } | null | undefined;
1641
- connectedAccount?: {
1642
- status: string;
1643
- id: string;
1644
- } | undefined;
1645
- }, {
1646
- isActive: boolean;
1647
- authConfig?: {
1648
- id: string;
1649
- mode: string;
1650
- isComposioManaged: boolean;
1651
- } | null | undefined;
1652
- connectedAccount?: {
1653
- status: string;
1654
- id: string;
1655
- } | undefined;
1656
- }>>;
1657
- }, "strip", z.ZodTypeAny, {
1658
- slug: string;
1659
- name: string;
1660
- isNoAuth: boolean;
1661
- logo?: string | undefined;
1662
- connection?: {
1663
- isActive: boolean;
1664
- authConfig?: {
1665
- id: string;
1666
- mode: string;
1667
- isComposioManaged: boolean;
1668
- } | null | undefined;
1669
- connectedAccount?: {
1670
- status: string;
1671
- id: string;
1672
- } | undefined;
1673
- } | undefined;
1674
- }, {
1675
- slug: string;
1676
- name: string;
1677
- logo?: string | undefined;
1678
- isNoAuth?: boolean | undefined;
1679
- connection?: {
1680
- isActive: boolean;
1681
- authConfig?: {
1682
- id: string;
1683
- mode: string;
1684
- isComposioManaged: boolean;
1685
- } | null | undefined;
1686
- connectedAccount?: {
1687
- status: string;
1688
- id: string;
1689
- } | undefined;
1690
- } | undefined;
1691
- }>;
1692
- declare const ToolkitConnectionsDetailsSchema: z.ZodObject<{
1693
- items: z.ZodArray<z.ZodObject<{
1694
- slug: z.ZodString;
1695
- name: z.ZodString;
1696
- logo: z.ZodOptional<z.ZodString>;
1697
- isNoAuth: z.ZodDefault<z.ZodBoolean>;
1698
- connection: z.ZodOptional<z.ZodObject<{
1699
- isActive: z.ZodBoolean;
1700
- authConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1701
- id: z.ZodString;
1702
- mode: z.ZodString;
1703
- isComposioManaged: z.ZodBoolean;
1704
- }, "strip", z.ZodTypeAny, {
1705
- id: string;
1706
- mode: string;
1707
- isComposioManaged: boolean;
1708
- }, {
1709
- id: string;
1710
- mode: string;
1711
- isComposioManaged: boolean;
1712
- }>>>;
1713
- connectedAccount: z.ZodOptional<z.ZodObject<{
1714
- id: z.ZodString;
1715
- status: z.ZodString;
1716
- }, "strip", z.ZodTypeAny, {
1717
- status: string;
1718
- id: string;
1719
- }, {
1720
- status: string;
1721
- id: string;
1722
- }>>;
1723
- }, "strip", z.ZodTypeAny, {
1724
- isActive: boolean;
1725
- authConfig?: {
1726
- id: string;
1727
- mode: string;
1728
- isComposioManaged: boolean;
1729
- } | null | undefined;
1730
- connectedAccount?: {
1731
- status: string;
1732
- id: string;
1733
- } | undefined;
1734
- }, {
1735
- isActive: boolean;
1736
- authConfig?: {
1737
- id: string;
1738
- mode: string;
1739
- isComposioManaged: boolean;
1740
- } | null | undefined;
1741
- connectedAccount?: {
1742
- status: string;
1743
- id: string;
1744
- } | undefined;
1745
- }>>;
1746
- }, "strip", z.ZodTypeAny, {
1747
- slug: string;
1748
- name: string;
1749
- isNoAuth: boolean;
1750
- logo?: string | undefined;
1751
- connection?: {
1752
- isActive: boolean;
1753
- authConfig?: {
1754
- id: string;
1755
- mode: string;
1756
- isComposioManaged: boolean;
1757
- } | null | undefined;
1758
- connectedAccount?: {
1759
- status: string;
1760
- id: string;
1761
- } | undefined;
1762
- } | undefined;
1763
- }, {
1764
- slug: string;
1765
- name: string;
1766
- logo?: string | undefined;
1767
- isNoAuth?: boolean | undefined;
1768
- connection?: {
1769
- isActive: boolean;
1770
- authConfig?: {
1771
- id: string;
1772
- mode: string;
1773
- isComposioManaged: boolean;
1774
- } | null | undefined;
1775
- connectedAccount?: {
1776
- status: string;
1777
- id: string;
1778
- } | undefined;
1779
- } | undefined;
1780
- }>, "many">;
1781
- cursor: z.ZodOptional<z.ZodString>;
1782
- totalPages: z.ZodNumber;
1783
- }, "strip", z.ZodTypeAny, {
1784
- items: {
1785
- slug: string;
1786
- name: string;
1787
- isNoAuth: boolean;
1788
- logo?: string | undefined;
1789
- connection?: {
1790
- isActive: boolean;
1791
- authConfig?: {
1792
- id: string;
1793
- mode: string;
1794
- isComposioManaged: boolean;
1795
- } | null | undefined;
1796
- connectedAccount?: {
1797
- status: string;
1798
- id: string;
1799
- } | undefined;
1800
- } | undefined;
1801
- }[];
1802
- totalPages: number;
1803
- cursor?: string | undefined;
1804
- }, {
1805
- items: {
1806
- slug: string;
1807
- name: string;
1808
- logo?: string | undefined;
1809
- isNoAuth?: boolean | undefined;
1810
- connection?: {
1811
- isActive: boolean;
1812
- authConfig?: {
1813
- id: string;
1814
- mode: string;
1815
- isComposioManaged: boolean;
1816
- } | null | undefined;
1817
- connectedAccount?: {
1818
- status: string;
1819
- id: string;
1820
- } | undefined;
1821
- } | undefined;
1822
- }[];
1823
- totalPages: number;
1824
- cursor?: string | undefined;
1825
- }>;
1826
- type ToolkitConnectionsDetails = z.infer<typeof ToolkitConnectionsDetailsSchema>;
1827
- type ToolkitConnectionState = z.infer<typeof ToolkitConnectionStateSchema>;
1828
- declare const ToolRouterMCPServerConfigSchema: z.ZodObject<{
1829
- type: z.ZodEnum<["http", "sse"]>;
1830
- url: z.ZodString;
1831
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1832
- }, "strip", z.ZodTypeAny, {
1833
- type: "http" | "sse";
1834
- url: string;
1835
- headers?: Record<string, string> | undefined;
1836
- }, {
1837
- type: "http" | "sse";
1838
- url: string;
1839
- headers?: Record<string, string> | undefined;
1840
- }>;
1841
- type ToolRouterMCPServerConfig = z.infer<typeof ToolRouterMCPServerConfigSchema>;
1842
- type ToolRouterToolsFn<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> = (modifiers?: SessionMetaToolOptions) => Promise<ReturnType<TProvider['wrapTools']>>;
1843
- type ToolRouterAuthorizeFn = (toolkit: string, options?: {
1844
- callbackUrl?: string;
1845
- alias?: string;
1846
- }) => Promise<ConnectionRequest>;
1847
- declare const ToolRouterToolkitsOptionsSchema: z.ZodObject<{
1848
- toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1849
- cursor: z.ZodOptional<z.ZodString>;
1850
- limit: z.ZodOptional<z.ZodNumber>;
1851
- isConnected: z.ZodOptional<z.ZodBoolean>;
1852
- search: z.ZodOptional<z.ZodString>;
1853
- }, "strip", z.ZodTypeAny, {
1854
- toolkits?: string[] | undefined;
1855
- limit?: number | undefined;
1856
- search?: string | undefined;
1857
- cursor?: string | undefined;
1858
- isConnected?: boolean | undefined;
1859
- }, {
1860
- toolkits?: string[] | undefined;
1861
- limit?: number | undefined;
1862
- search?: string | undefined;
1863
- cursor?: string | undefined;
1864
- isConnected?: boolean | undefined;
1865
- }>;
1866
- type ToolRouterToolkitsOptions = z.infer<typeof ToolRouterToolkitsOptionsSchema>;
1867
- type ToolRouterToolkitsFn = (options?: ToolRouterToolkitsOptions) => Promise<ToolkitConnectionsDetails>;
1868
- declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
1869
- success: z.ZodBoolean;
1870
- error: z.ZodNullable<z.ZodString>;
1871
- results: z.ZodArray<z.ZodObject<{
1872
- index: z.ZodNumber;
1873
- useCase: z.ZodString;
1874
- primaryToolSlugs: z.ZodArray<z.ZodString, "many">;
1875
- relatedToolSlugs: z.ZodArray<z.ZodString, "many">;
1876
- toolkits: z.ZodArray<z.ZodString, "many">;
1877
- difficulty: z.ZodOptional<z.ZodString>;
1878
- error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1879
- executionGuidance: z.ZodOptional<z.ZodString>;
1880
- knownPitfalls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1881
- memory: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
1882
- planId: z.ZodOptional<z.ZodString>;
1883
- recommendedPlanSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1884
- referenceWorkbenchSnippets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1885
- code: z.ZodString;
1886
- description: z.ZodString;
1887
- }, "strip", z.ZodTypeAny, {
1888
- code: string;
1889
- description: string;
1890
- }, {
1891
- code: string;
1892
- description: string;
1893
- }>, "many">>;
1894
- }, "strip", z.ZodTypeAny, {
1895
- toolkits: string[];
1896
- index: number;
1897
- useCase: string;
1898
- primaryToolSlugs: string[];
1899
- relatedToolSlugs: string[];
1900
- error?: string | null | undefined;
1901
- difficulty?: string | undefined;
1902
- executionGuidance?: string | undefined;
1903
- knownPitfalls?: string[] | undefined;
1904
- memory?: Record<string, string[]> | undefined;
1905
- planId?: string | undefined;
1906
- recommendedPlanSteps?: string[] | undefined;
1907
- referenceWorkbenchSnippets?: {
1908
- code: string;
1909
- description: string;
1910
- }[] | undefined;
1911
- }, {
1912
- toolkits: string[];
1913
- index: number;
1914
- useCase: string;
1915
- primaryToolSlugs: string[];
1916
- relatedToolSlugs: string[];
1917
- error?: string | null | undefined;
1918
- difficulty?: string | undefined;
1919
- executionGuidance?: string | undefined;
1920
- knownPitfalls?: string[] | undefined;
1921
- memory?: Record<string, string[]> | undefined;
1922
- planId?: string | undefined;
1923
- recommendedPlanSteps?: string[] | undefined;
1924
- referenceWorkbenchSnippets?: {
1925
- code: string;
1926
- description: string;
1927
- }[] | undefined;
1928
- }>, "many">;
1929
- toolSchemas: z.ZodRecord<z.ZodString, z.ZodObject<{
1930
- toolSlug: z.ZodString;
1931
- toolkit: z.ZodString;
1932
- description: z.ZodOptional<z.ZodString>;
1933
- hasFullSchema: z.ZodOptional<z.ZodBoolean>;
1934
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1935
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1936
- schemaRef: z.ZodOptional<z.ZodObject<{
1937
- args: z.ZodObject<{
1938
- toolSlugs: z.ZodArray<z.ZodString, "many">;
1939
- }, "strip", z.ZodTypeAny, {
1940
- toolSlugs: string[];
1941
- }, {
1942
- toolSlugs: string[];
1943
- }>;
1944
- message: z.ZodOptional<z.ZodString>;
1945
- tool: z.ZodLiteral<"COMPOSIO_GET_TOOL_SCHEMAS">;
1946
- }, "strip", z.ZodTypeAny, {
1947
- args: {
1948
- toolSlugs: string[];
1949
- };
1950
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1951
- message?: string | undefined;
1952
- }, {
1953
- args: {
1954
- toolSlugs: string[];
1955
- };
1956
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1957
- message?: string | undefined;
1958
- }>>;
1959
- }, "strip", z.ZodTypeAny, {
1960
- toolkit: string;
1961
- toolSlug: string;
1962
- description?: string | undefined;
1963
- hasFullSchema?: boolean | undefined;
1964
- inputSchema?: Record<string, unknown> | undefined;
1965
- outputSchema?: Record<string, unknown> | undefined;
1966
- schemaRef?: {
1967
- args: {
1968
- toolSlugs: string[];
1969
- };
1970
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1971
- message?: string | undefined;
1972
- } | undefined;
1973
- }, {
1974
- toolkit: string;
1975
- toolSlug: string;
1976
- description?: string | undefined;
1977
- hasFullSchema?: boolean | undefined;
1978
- inputSchema?: Record<string, unknown> | undefined;
1979
- outputSchema?: Record<string, unknown> | undefined;
1980
- schemaRef?: {
1981
- args: {
1982
- toolSlugs: string[];
1983
- };
1984
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
1985
- message?: string | undefined;
1986
- } | undefined;
1987
- }>>;
1988
- toolkitConnectionStatuses: z.ZodArray<z.ZodObject<{
1989
- toolkit: z.ZodString;
1990
- description: z.ZodString;
1991
- hasActiveConnection: z.ZodBoolean;
1992
- statusMessage: z.ZodString;
1993
- connectionDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1994
- currentUserInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1995
- }, "strip", z.ZodTypeAny, {
1996
- description: string;
1997
- toolkit: string;
1998
- hasActiveConnection: boolean;
1999
- statusMessage: string;
2000
- connectionDetails?: Record<string, unknown> | undefined;
2001
- currentUserInfo?: Record<string, unknown> | undefined;
2002
- }, {
2003
- description: string;
2004
- toolkit: string;
2005
- hasActiveConnection: boolean;
2006
- statusMessage: string;
2007
- connectionDetails?: Record<string, unknown> | undefined;
2008
- currentUserInfo?: Record<string, unknown> | undefined;
2009
- }>, "many">;
2010
- nextStepsGuidance: z.ZodArray<z.ZodString, "many">;
2011
- session: z.ZodObject<{
2012
- id: z.ZodString;
2013
- generateId: z.ZodBoolean;
2014
- instructions: z.ZodString;
2015
- }, "strip", z.ZodTypeAny, {
2016
- id: string;
2017
- generateId: boolean;
2018
- instructions: string;
2019
- }, {
2020
- id: string;
2021
- generateId: boolean;
2022
- instructions: string;
2023
- }>;
2024
- timeInfo: z.ZodObject<{
2025
- currentTimeUtc: z.ZodString;
2026
- currentTimeUtcEpochSeconds: z.ZodNumber;
2027
- message: z.ZodString;
2028
- }, "strip", z.ZodTypeAny, {
2029
- message: string;
2030
- currentTimeUtc: string;
2031
- currentTimeUtcEpochSeconds: number;
2032
- }, {
2033
- message: string;
2034
- currentTimeUtc: string;
2035
- currentTimeUtcEpochSeconds: number;
2036
- }>;
2037
- }, "strip", z.ZodTypeAny, {
2038
- error: string | null;
2039
- success: boolean;
2040
- results: {
2041
- toolkits: string[];
2042
- index: number;
2043
- useCase: string;
2044
- primaryToolSlugs: string[];
2045
- relatedToolSlugs: string[];
2046
- error?: string | null | undefined;
2047
- difficulty?: string | undefined;
2048
- executionGuidance?: string | undefined;
2049
- knownPitfalls?: string[] | undefined;
2050
- memory?: Record<string, string[]> | undefined;
2051
- planId?: string | undefined;
2052
- recommendedPlanSteps?: string[] | undefined;
2053
- referenceWorkbenchSnippets?: {
2054
- code: string;
2055
- description: string;
2056
- }[] | undefined;
2057
- }[];
2058
- toolSchemas: Record<string, {
2059
- toolkit: string;
2060
- toolSlug: string;
2061
- description?: string | undefined;
2062
- hasFullSchema?: boolean | undefined;
2063
- inputSchema?: Record<string, unknown> | undefined;
2064
- outputSchema?: Record<string, unknown> | undefined;
2065
- schemaRef?: {
2066
- args: {
2067
- toolSlugs: string[];
2068
- };
2069
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
2070
- message?: string | undefined;
2071
- } | undefined;
2072
- }>;
2073
- toolkitConnectionStatuses: {
2074
- description: string;
2075
- toolkit: string;
2076
- hasActiveConnection: boolean;
2077
- statusMessage: string;
2078
- connectionDetails?: Record<string, unknown> | undefined;
2079
- currentUserInfo?: Record<string, unknown> | undefined;
2080
- }[];
2081
- nextStepsGuidance: string[];
2082
- session: {
2083
- id: string;
2084
- generateId: boolean;
2085
- instructions: string;
2086
- };
2087
- timeInfo: {
2088
- message: string;
2089
- currentTimeUtc: string;
2090
- currentTimeUtcEpochSeconds: number;
2091
- };
2092
- }, {
2093
- error: string | null;
2094
- success: boolean;
2095
- results: {
2096
- toolkits: string[];
2097
- index: number;
2098
- useCase: string;
2099
- primaryToolSlugs: string[];
2100
- relatedToolSlugs: string[];
2101
- error?: string | null | undefined;
2102
- difficulty?: string | undefined;
2103
- executionGuidance?: string | undefined;
2104
- knownPitfalls?: string[] | undefined;
2105
- memory?: Record<string, string[]> | undefined;
2106
- planId?: string | undefined;
2107
- recommendedPlanSteps?: string[] | undefined;
2108
- referenceWorkbenchSnippets?: {
2109
- code: string;
2110
- description: string;
2111
- }[] | undefined;
2112
- }[];
2113
- toolSchemas: Record<string, {
2114
- toolkit: string;
2115
- toolSlug: string;
2116
- description?: string | undefined;
2117
- hasFullSchema?: boolean | undefined;
2118
- inputSchema?: Record<string, unknown> | undefined;
2119
- outputSchema?: Record<string, unknown> | undefined;
2120
- schemaRef?: {
2121
- args: {
2122
- toolSlugs: string[];
2123
- };
2124
- tool: "COMPOSIO_GET_TOOL_SCHEMAS";
2125
- message?: string | undefined;
2126
- } | undefined;
2127
- }>;
2128
- toolkitConnectionStatuses: {
2129
- description: string;
2130
- toolkit: string;
2131
- hasActiveConnection: boolean;
2132
- statusMessage: string;
2133
- connectionDetails?: Record<string, unknown> | undefined;
2134
- currentUserInfo?: Record<string, unknown> | undefined;
2135
- }[];
2136
- nextStepsGuidance: string[];
2137
- session: {
2138
- id: string;
2139
- generateId: boolean;
2140
- instructions: string;
2141
- };
2142
- timeInfo: {
2143
- message: string;
2144
- currentTimeUtc: string;
2145
- currentTimeUtcEpochSeconds: number;
2146
- };
2147
- }>;
2148
- type ToolRouterSessionSearchResponse = z.infer<typeof ToolRouterSessionSearchResponseSchema>;
2149
- declare const ToolRouterSessionExecuteResponseSchema: z.ZodObject<{
2150
- data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2151
- error: z.ZodNullable<z.ZodString>;
2152
- logId: z.ZodString;
2153
- }, "strip", z.ZodTypeAny, {
2154
- data: Record<string, unknown>;
2155
- error: string | null;
2156
- logId: string;
2157
- }, {
2158
- data: Record<string, unknown>;
2159
- error: string | null;
2160
- logId: string;
2161
- }>;
2162
- type ToolRouterSessionExecuteResponse = z.infer<typeof ToolRouterSessionExecuteResponseSchema>;
2163
- interface ToolRouterSessionProxyExecuteResponse {
2164
- /** The HTTP status code returned from the proxied API */
2165
- status: number;
2166
- /** The response data from the proxied API */
2167
- data?: unknown;
2168
- /** HTTP headers from the proxied API */
2169
- headers?: Record<string, string>;
2170
- /** Binary response data (present when response is a file) */
2171
- binaryData?: {
2172
- contentType: string;
2173
- size: number;
2174
- url: string;
2175
- expiresAt?: string;
2176
- };
2177
- }
2178
- /**
2179
- * Experimental features on a tool router session.
2180
- * Contains features that may be modified or removed in future versions.
2181
- */
2182
- interface SessionExperimental {
2183
- /**
2184
- * The assistive system prompt to inject into your agent for optimal tool router usage.
2185
- * Only returned on session creation, not on GET.
2186
- */
2187
- assistivePrompt?: string;
2188
- /**
2189
- * File mount operations (list, upload, download, delete) for the session's virtual filesystem.
2190
- */
2191
- files: ToolRouterSessionFilesMount;
2192
- }
2193
- type ToolRouterSessionSearchFn = (params: {
2194
- query: string;
2195
- toolkits?: string[];
2196
- }) => Promise<ToolRouterSessionSearchResponse>;
2197
- type ToolRouterSessionExecuteFn = (toolSlug: string, arguments_?: Record<string, unknown>, options?: ToolRouterSessionExecuteOptions) => Promise<ToolRouterSessionExecuteResponse>;
2198
- interface ToolRouterSessionExecuteOptions {
2199
- /**
2200
- * Account identifier for direct app tool execution in multi-account sessions.
2201
- * Meta/helper tools either ignore this top-level field or define
2202
- * their own account-selection fields, for example
2203
- * COMPOSIO_MULTI_EXECUTE_TOOL.tools[].account.
2204
- */
2205
- account?: string;
2206
- }
2207
- type ToolRouterSessionPreloadConfig = SessionCreateResponse.Config.Preload;
2208
- type ToolRouterSessionWorkbenchConfig = SessionCreateResponse.Config.Workbench;
2209
- type ToolRouterSessionWarning = SessionCreateResponse.Warning;
2210
- interface ToolRouterSessionMetadata {
2211
- preload?: ToolRouterSessionPreloadConfig;
2212
- workbench?: ToolRouterSessionWorkbenchConfig;
2213
- configVersion?: number;
2214
- warnings?: ToolRouterSessionWarning[];
2215
- preloadedCustomToolSlugs?: string[];
2216
- inlineCustomToolsPayload?: InlineCustomToolsWirePayload;
2217
- }
2218
- declare const SessionProxyExecuteParamsSchema: z.ZodObject<{
2219
- /** The toolkit whose connected account to use for auth (e.g. 'gmail', 'github') */
2220
- toolkit: z.ZodString;
2221
- /** The API endpoint URL to call */
2222
- endpoint: z.ZodString;
2223
- /** HTTP method */
2224
- method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>;
2225
- /** Request body (for POST/PUT/PATCH) */
2226
- body: z.ZodOptional<z.ZodUnknown>;
2227
- /** Query params or headers to include */
2228
- parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
2229
- in: z.ZodEnum<["query", "header"]>;
2230
- name: z.ZodString;
2231
- value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
2232
- }, "strip", z.ZodTypeAny, {
2233
- name: string;
2234
- value: string | number;
2235
- in: "query" | "header";
2236
- }, {
2237
- name: string;
2238
- value: string | number;
2239
- in: "query" | "header";
2240
- }>, "many">>;
2241
- }, "strip", z.ZodTypeAny, {
2242
- toolkit: string;
2243
- endpoint: string;
2244
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
2245
- body?: unknown;
2246
- parameters?: {
2247
- name: string;
2248
- value: string | number;
2249
- in: "query" | "header";
2250
- }[] | undefined;
2251
- }, {
2252
- toolkit: string;
2253
- endpoint: string;
2254
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
2255
- body?: unknown;
2256
- parameters?: {
2257
- name: string;
2258
- value: string | number;
2259
- in: "query" | "header";
2260
- }[] | undefined;
2261
- }>;
2262
- type SessionProxyExecuteParams = z.infer<typeof SessionProxyExecuteParamsSchema>;
2263
- type ToolRouterSessionProxyExecuteFn = (params: SessionProxyExecuteParams) => Promise<ToolRouterSessionProxyExecuteResponse>;
2264
- declare const ToolRouterUpdateSessionConfigSchema: z.ZodEffects<z.ZodObject<{
2265
- toolkits: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
2266
- disable: z.ZodArray<z.ZodString, "many">;
2267
- }, "strict", z.ZodTypeAny, {
2268
- disable: string[];
2269
- }, {
2270
- disable: string[];
2271
- }>, z.ZodObject<{
2272
- enable: z.ZodArray<z.ZodString, "many">;
2273
- }, "strict", z.ZodTypeAny, {
2274
- enable: string[];
2275
- }, {
2276
- enable: string[];
2277
- }>]>>>;
2278
- 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<{
2279
- enable: z.ZodArray<z.ZodString, "many">;
2280
- }, "strict", z.ZodTypeAny, {
2281
- enable: string[];
2282
- }, {
2283
- enable: string[];
2284
- }>, z.ZodObject<{
2285
- disable: z.ZodArray<z.ZodString, "many">;
2286
- }, "strict", z.ZodTypeAny, {
2287
- disable: string[];
2288
- }, {
2289
- disable: string[];
2290
- }>, z.ZodObject<{
2291
- tags: z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
2292
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2293
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2294
- }, "strict", z.ZodTypeAny, {
2295
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2296
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2297
- }, {
2298
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2299
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2300
- }>]>;
2301
- }, "strict", z.ZodTypeAny, {
2302
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2303
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2304
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2305
- };
2306
- }, {
2307
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2308
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2309
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2310
- };
2311
- }>]>, string[] | {
2312
- enable: string[];
2313
- } | {
2314
- disable: string[];
2315
- } | {
2316
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2317
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2318
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2319
- };
2320
- }, string[] | {
2321
- enable: string[];
2322
- } | {
2323
- disable: string[];
2324
- } | {
2325
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2326
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2327
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2328
- };
2329
- }>]>>>>;
2330
- tags: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z.ZodObject<{
2331
- enable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2332
- disable: z.ZodOptional<z.ZodArray<z.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2333
- }, "strict", z.ZodTypeAny, {
2334
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2335
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2336
- }, {
2337
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2338
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2339
- }>]>>>;
2340
- authConfigs: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2341
- 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[]>>>>;
2342
- manageConnections: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
2343
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2344
- callbackUrl: z.ZodOptional<z.ZodString>;
2345
- waitForConnections: z.ZodOptional<z.ZodBoolean>;
2346
- }, "strict", z.ZodTypeAny, {
2347
- enable?: boolean | undefined;
2348
- callbackUrl?: string | undefined;
2349
- waitForConnections?: boolean | undefined;
2350
- }, {
2351
- enable?: boolean | undefined;
2352
- callbackUrl?: string | undefined;
2353
- waitForConnections?: boolean | undefined;
2354
- }>]>>>>;
2355
- sandbox: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
2356
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2357
- enableProxyExecution: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
2358
- autoOffloadThreshold: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2359
- sandboxSize: z.ZodOptional<z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>>;
2360
- }, "strip", z.ZodTypeAny, {
2361
- enable?: boolean | undefined;
2362
- enableProxyExecution?: boolean | undefined;
2363
- autoOffloadThreshold?: number | undefined;
2364
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2365
- }, {
2366
- enable?: boolean | undefined;
2367
- enableProxyExecution?: boolean | undefined;
2368
- autoOffloadThreshold?: number | undefined;
2369
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2370
- }>>>>;
2371
- workbench: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
2372
- enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2373
- enableProxyExecution: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
2374
- autoOffloadThreshold: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2375
- sandboxSize: z.ZodOptional<z.ZodOptional<z.ZodEnum<["standard", "medium", "large", "xlarge"]>>>;
2376
- }, "strip", z.ZodTypeAny, {
2377
- enable?: boolean | undefined;
2378
- enableProxyExecution?: boolean | undefined;
2379
- autoOffloadThreshold?: number | undefined;
2380
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2381
- }, {
2382
- enable?: boolean | undefined;
2383
- enableProxyExecution?: boolean | undefined;
2384
- autoOffloadThreshold?: number | undefined;
2385
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2386
- }>>>>;
2387
- multiAccount: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
2388
- enable: z.ZodOptional<z.ZodBoolean>;
2389
- maxAccountsPerToolkit: z.ZodOptional<z.ZodNumber>;
2390
- requireExplicitSelection: z.ZodOptional<z.ZodBoolean>;
2391
- }, "strip", z.ZodTypeAny, {
2392
- enable?: boolean | undefined;
2393
- maxAccountsPerToolkit?: number | undefined;
2394
- requireExplicitSelection?: boolean | undefined;
2395
- }, {
2396
- enable?: boolean | undefined;
2397
- maxAccountsPerToolkit?: number | undefined;
2398
- requireExplicitSelection?: boolean | undefined;
2399
- }>>>>;
2400
- preload: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2401
- tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodLiteral<"all">]>>;
2402
- }, "strict", z.ZodTypeAny, {
2403
- tools?: string[] | "all" | undefined;
2404
- }, {
2405
- tools?: string[] | "all" | undefined;
2406
- }>>>;
2407
- }, "strip", z.ZodTypeAny, {
2408
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2409
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2410
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2411
- } | undefined;
2412
- tools?: Record<string, string[] | {
2413
- enable: string[];
2414
- } | {
2415
- disable: string[];
2416
- } | {
2417
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2418
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2419
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2420
- };
2421
- }> | undefined;
2422
- toolkits?: string[] | {
2423
- disable: string[];
2424
- } | {
2425
- enable: string[];
2426
- } | undefined;
2427
- authConfigs?: Record<string, string> | undefined;
2428
- preload?: {
2429
- tools?: string[] | "all" | undefined;
2430
- } | undefined;
2431
- connectedAccounts?: Record<string, string[]> | undefined;
2432
- manageConnections?: boolean | {
2433
- enable?: boolean | undefined;
2434
- callbackUrl?: string | undefined;
2435
- waitForConnections?: boolean | undefined;
2436
- } | null | undefined;
2437
- sandbox?: {
2438
- enable?: boolean | undefined;
2439
- enableProxyExecution?: boolean | undefined;
2440
- autoOffloadThreshold?: number | undefined;
2441
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2442
- } | null | undefined;
2443
- workbench?: {
2444
- enable?: boolean | undefined;
2445
- enableProxyExecution?: boolean | undefined;
2446
- autoOffloadThreshold?: number | undefined;
2447
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2448
- } | null | undefined;
2449
- multiAccount?: {
2450
- enable?: boolean | undefined;
2451
- maxAccountsPerToolkit?: number | undefined;
2452
- requireExplicitSelection?: boolean | undefined;
2453
- } | null | undefined;
2454
- }, {
2455
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2456
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2457
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2458
- } | undefined;
2459
- tools?: Record<string, string[] | {
2460
- enable: string[];
2461
- } | {
2462
- disable: string[];
2463
- } | {
2464
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2465
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2466
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2467
- };
2468
- }> | undefined;
2469
- toolkits?: string[] | {
2470
- disable: string[];
2471
- } | {
2472
- enable: string[];
2473
- } | undefined;
2474
- authConfigs?: Record<string, string> | undefined;
2475
- preload?: {
2476
- tools?: string[] | "all" | undefined;
2477
- } | undefined;
2478
- connectedAccounts?: Record<string, string | string[]> | undefined;
2479
- manageConnections?: boolean | {
2480
- enable?: boolean | undefined;
2481
- callbackUrl?: string | undefined;
2482
- waitForConnections?: boolean | undefined;
2483
- } | null | undefined;
2484
- sandbox?: {
2485
- enable?: boolean | undefined;
2486
- enableProxyExecution?: boolean | undefined;
2487
- autoOffloadThreshold?: number | undefined;
2488
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2489
- } | null | undefined;
2490
- workbench?: {
2491
- enable?: boolean | undefined;
2492
- enableProxyExecution?: boolean | undefined;
2493
- autoOffloadThreshold?: number | undefined;
2494
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2495
- } | null | undefined;
2496
- multiAccount?: {
2497
- enable?: boolean | undefined;
2498
- maxAccountsPerToolkit?: number | undefined;
2499
- requireExplicitSelection?: boolean | undefined;
2500
- } | null | undefined;
2501
- }>, {
2502
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2503
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2504
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2505
- } | undefined;
2506
- tools?: Record<string, string[] | {
2507
- enable: string[];
2508
- } | {
2509
- disable: string[];
2510
- } | {
2511
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2512
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2513
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2514
- };
2515
- }> | undefined;
2516
- toolkits?: string[] | {
2517
- disable: string[];
2518
- } | {
2519
- enable: string[];
2520
- } | undefined;
2521
- authConfigs?: Record<string, string> | undefined;
2522
- preload?: {
2523
- tools?: string[] | "all" | undefined;
2524
- } | undefined;
2525
- connectedAccounts?: Record<string, string[]> | undefined;
2526
- manageConnections?: boolean | {
2527
- enable?: boolean | undefined;
2528
- callbackUrl?: string | undefined;
2529
- waitForConnections?: boolean | undefined;
2530
- } | null | undefined;
2531
- sandbox?: {
2532
- enable?: boolean | undefined;
2533
- enableProxyExecution?: boolean | undefined;
2534
- autoOffloadThreshold?: number | undefined;
2535
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2536
- } | null | undefined;
2537
- workbench?: {
2538
- enable?: boolean | undefined;
2539
- enableProxyExecution?: boolean | undefined;
2540
- autoOffloadThreshold?: number | undefined;
2541
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2542
- } | null | undefined;
2543
- multiAccount?: {
2544
- enable?: boolean | undefined;
2545
- maxAccountsPerToolkit?: number | undefined;
2546
- requireExplicitSelection?: boolean | undefined;
2547
- } | null | undefined;
2548
- }, {
2549
- tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2550
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2551
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2552
- } | undefined;
2553
- tools?: Record<string, string[] | {
2554
- enable: string[];
2555
- } | {
2556
- disable: string[];
2557
- } | {
2558
- tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2559
- disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2560
- enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2561
- };
2562
- }> | undefined;
2563
- toolkits?: string[] | {
2564
- disable: string[];
2565
- } | {
2566
- enable: string[];
2567
- } | undefined;
2568
- authConfigs?: Record<string, string> | undefined;
2569
- preload?: {
2570
- tools?: string[] | "all" | undefined;
2571
- } | undefined;
2572
- connectedAccounts?: Record<string, string | string[]> | undefined;
2573
- manageConnections?: boolean | {
2574
- enable?: boolean | undefined;
2575
- callbackUrl?: string | undefined;
2576
- waitForConnections?: boolean | undefined;
2577
- } | null | undefined;
2578
- sandbox?: {
2579
- enable?: boolean | undefined;
2580
- enableProxyExecution?: boolean | undefined;
2581
- autoOffloadThreshold?: number | undefined;
2582
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2583
- } | null | undefined;
2584
- workbench?: {
2585
- enable?: boolean | undefined;
2586
- enableProxyExecution?: boolean | undefined;
2587
- autoOffloadThreshold?: number | undefined;
2588
- sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2589
- } | null | undefined;
2590
- multiAccount?: {
2591
- enable?: boolean | undefined;
2592
- maxAccountsPerToolkit?: number | undefined;
2593
- requireExplicitSelection?: boolean | undefined;
2594
- } | null | undefined;
2595
- }>;
2596
- type ToolRouterUpdateSessionConfig = z.infer<typeof ToolRouterUpdateSessionConfigSchema>;
2597
- type ToolRouterSessionUpdateFn = (config: ToolRouterUpdateSessionConfig) => Promise<void>;
2598
- declare const ToolRouterSessionDeleteResponseSchema: z.ZodObject<{
2599
- sessionId: z.ZodString;
2600
- deleted: z.ZodLiteral<true>;
2601
- }, "strip", z.ZodTypeAny, {
2602
- sessionId: string;
2603
- deleted: true;
2604
- }, {
2605
- sessionId: string;
2606
- deleted: true;
2607
- }>;
2608
- type ToolRouterSessionDeleteResponse = z.infer<typeof ToolRouterSessionDeleteResponseSchema>;
2609
- type ToolRouterSessionDeleteFn = (requestOptions?: ComposioRequestOptions) => Promise<ToolRouterSessionDeleteResponse>;
2610
- /** Session type returned by ToolRouter.create() and ToolRouter.use() */
2611
- interface Session<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> {
2612
- sessionId: string;
2613
- mcp: ToolRouterMCPServerConfig;
2614
- /** Stored preload configuration for this session. */
2615
- preload: ToolRouterSessionPreloadConfig;
2616
- /**
2617
- * Resolved sandbox (code-execution) config returned by the API. `enable` defaults to `true` server-side.
2618
- *
2619
- * This is the read-side counterpart to the `sandbox` key you pass into `create()`.
2620
- */
2621
- sandbox?: ToolRouterSessionWorkbenchConfig;
2622
- /**
2623
- * Resolved sandbox config for the session.
2624
- *
2625
- * @deprecated Use `sandbox` instead. `workbench` is a backwards-compatible alias and will be removed in a future release.
2626
- */
2627
- workbench?: ToolRouterSessionWorkbenchConfig;
2628
- /** Server-side config version when returned by the API. */
2629
- configVersion?: number;
2630
- /** Non-blocking session creation warnings returned by the API. */
2631
- warnings: ToolRouterSessionWarning[];
2632
- tools: ToolRouterToolsFn<TToolCollection, TTool, TProvider>;
2633
- authorize: ToolRouterAuthorizeFn;
2634
- toolkits: ToolRouterToolkitsFn;
2635
- /** Search for tools by semantic use case */
2636
- search: ToolRouterSessionSearchFn;
2637
- /** Execute a tool within the session */
2638
- execute: ToolRouterSessionExecuteFn;
2639
- /** Update the session configuration. Mutates this session in-place. */
2640
- update: ToolRouterSessionUpdateFn;
2641
- /** Delete the session. Deleted sessions are no longer retrievable or executable. */
2642
- delete: ToolRouterSessionDeleteFn;
2643
- /** Proxy an API call through Composio's auth layer using the session's connected account */
2644
- proxyExecute: ToolRouterSessionProxyExecuteFn;
2645
- /** List custom tools registered in this session, with their final slugs and schemas */
2646
- customTools: (options?: {
2647
- toolkit?: string;
2648
- }) => RegisteredCustomTool[];
2649
- /** List custom toolkits registered in this session, with final slugs on nested tools */
2650
- customToolkits: () => RegisteredCustomToolkit[];
2651
- /** Experimental features (files, assistive prompt, etc.) */
2652
- experimental: SessionExperimental;
2653
- }
2654
- /**
2655
- * Session type without the typed `mcp` endpoint.
2656
- *
2657
- * Returned by `create()` / `use()` when `{ mcp: true }` is not passed. The
2658
- * hosted MCP endpoint still exists on the underlying session at runtime — this
2659
- * only hides it from the type so MCP is an explicit opt-in. Pass `{ mcp: true }`
2660
- * to get a `Session` with `session.mcp` surfaced. See
2661
- * https://docs.composio.dev/docs/sessions-via-mcp
2662
- */
2663
- type SessionWithoutMcp<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> = Omit<Session<TToolCollection, TTool, TProvider>, 'mcp'>;
2664
- //#endregion
2665
- //#region src/types/customTool.types.d.ts
2666
- type AnyZodSchema = z$1.ZodType | z$2.ZodType;
2667
- type InferZodSchema<T extends AnyZodSchema> = T extends z$1.ZodType ? z$1.infer<T> : T extends z$2.ZodType ? z$2.infer<T> : never;
2668
- /**
2669
- * Session context injected into custom tool execute functions at runtime.
2670
- * Provides identity context and methods to call other tools or proxy API requests.
2671
- */
2672
- interface SessionContext {
2673
- /** The user ID for this session */
2674
- readonly userId: string;
2675
- /** Execute any Composio native tool from within a custom tool. Returns the same shape as session.execute(). */
2676
- execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<ToolRouterSessionExecuteResponse>;
2677
- /** Proxy API calls through Composio's auth layer (resolved from session toolkit). */
2678
- proxyExecute(params: SessionProxyExecuteParams): Promise<ToolRouterSessionProxyExecuteResponse>;
2679
- /**
2680
- * Caller-supplied AbortSignal forwarded from `session.execute(..., { signal })`.
2681
- * Custom-tool execution is cooperative: long-running user code that respects
2682
- * this signal (e.g. by passing it into `fetch`) can abort mid-execution and
2683
- * surface as `ComposioRequestCancelledError`. Undefined when the caller did
2684
- * not pass `requestOptions`.
2685
- */
2686
- readonly signal?: AbortSignal;
2687
- }
2688
- /**
2689
- * Execute function for custom tools.
2690
- * Just return the result data, or throw an error. The SDK wraps it internally.
2691
- *
2692
- * Supports two call patterns:
2693
- * - `(input) => data` — for tools that don't need session context
2694
- * - `(input, ctx) => data` — for tools that need to call other tools or proxy APIs
2695
- */
2696
- type CustomToolExecuteFn<T extends AnyZodSchema> = (input: InferZodSchema<T>, ctx: SessionContext) => Promise<Record<string, unknown>>;
2697
- /**
2698
- * Zod schema for validating a custom tool slug.
2699
- * Alphanumeric, underscores, and hyphens only. No `LOCAL_` or `COMPOSIO_` prefix.
2700
- * Length is validated contextually (standalone vs extension vs toolkit) at creation time.
2701
- */
2702
- declare const CustomToolSlugSchema: z$1.ZodEffects<z$1.ZodEffects<z$1.ZodString, string, string>, string, string>;
2703
- /**
2704
- * Zod schema for validating the string/scalar fields of createCustomTool() options.
2705
- * Slug is validated separately as the first argument.
2706
- * Used internally for validation — inputParams, outputParams, and execute are checked manually.
2707
- */
2708
- declare const CreateCustomToolBaseSchema: z$1.ZodObject<{
2709
- name: z$1.ZodString;
2710
- description: z$1.ZodString;
2711
- /**
2712
- * Composio toolkit slug that this tool extends (inherits auth from).
2713
- * Must be a valid Composio toolkit slug (e.g. `'gmail'`, `'github'`, `'meta_ads'`).
2714
- * The backend validates this against the toolkit catalog.
2715
- * Leave empty for tools that don't need any Composio-managed authentication.
2716
- */
2717
- extendsToolkit: z$1.ZodOptional<z$1.ZodString>;
2718
- preload: z$1.ZodOptional<z$1.ZodBoolean>;
2719
- }, "strip", z$1.ZodTypeAny, {
2720
- name: string;
2721
- description: string;
2722
- extendsToolkit?: string | undefined;
2723
- preload?: boolean | undefined;
2724
- }, {
2725
- name: string;
2726
- description: string;
2727
- extendsToolkit?: string | undefined;
2728
- preload?: boolean | undefined;
2729
- }>;
2730
- /** Options for creating a custom tool via `createCustomTool()`. */
2731
- type CreateCustomToolParams<T extends AnyZodSchema> = z$1.infer<typeof CreateCustomToolBaseSchema> & {
2732
- /** Zod schema for input parameters */
2733
- inputParams: T;
2734
- /** Optional Zod schema for output parameters (sent to backend for documentation) */
2735
- outputParams?: AnyZodSchema;
2736
- /** The function that executes the tool */
2737
- execute: CustomToolExecuteFn<T>;
2738
- };
2739
- /**
2740
- * Custom tool definition returned from `createCustomTool()`.
2741
- * Pass to `composio.create(userId, { experimental: { customTools: [...] } })` to bind to a session.
2742
- */
2743
- interface CustomTool {
2744
- readonly slug: string;
2745
- readonly name: string;
2746
- readonly description: string;
2747
- /**
2748
- * Composio toolkit slug that this tool extends (inherits auth from).
2749
- * Must be a valid Composio toolkit slug. Validated by the backend.
2750
- * Undefined means the tool doesn't need any Composio-managed authentication.
2751
- */
2752
- readonly extendsToolkit?: string;
2753
- /**
2754
- * Include this custom tool in session.tools() so it can be called without
2755
- * searching first.
2756
- */
2757
- readonly preload?: boolean;
2758
- readonly inputSchema: Record<string, unknown>;
2759
- /** JSON Schema representation of the output (for backend documentation) */
2760
- readonly outputSchema?: Record<string, unknown>;
2761
- /** @internal Original Zod schema — used for runtime input validation (defaults, coercions, transforms) */
2762
- readonly inputParams: AnyZodSchema;
2763
- /** Direct reference to the execute function — useful for testing */
2764
- readonly execute: CustomToolExecuteFn<AnyZodSchema>;
2765
- }
2766
- /** Serialized tool definition sent to backend for search indexing. Uses official client type. */
2767
- type CustomToolDefinition = SessionCreateParams.Experimental.CustomTool;
2768
- type CustomToolWireDefinition = CustomToolDefinition;
2769
- /**
2770
- * Zod schema for validating the string/scalar fields of createCustomToolkit() options.
2771
- * Slug is validated separately as the first argument.
2772
- */
2773
- declare const CreateCustomToolkitBaseSchema: z$1.ZodObject<{
2774
- name: z$1.ZodString;
2775
- description: z$1.ZodString;
2776
- preload: z$1.ZodOptional<z$1.ZodBoolean>;
2777
- }, "strip", z$1.ZodTypeAny, {
2778
- name: string;
2779
- description: string;
2780
- preload?: boolean | undefined;
2781
- }, {
2782
- name: string;
2783
- description: string;
2784
- preload?: boolean | undefined;
2785
- }>;
2786
- /** Options for creating a custom toolkit via `createCustomToolkit()`. */
2787
- type CreateCustomToolkitParams = z$1.infer<typeof CreateCustomToolkitBaseSchema> & {
2788
- /** Tools to include in this toolkit. Must not have `extendsToolkit` set. */
2789
- tools: CustomTool[];
2790
- };
2791
- /**
2792
- * Custom toolkit definition returned from `createCustomToolkit()`.
2793
- * Pass to `composio.create(userId, { experimental: { customToolkits: [...] } })`.
2794
- */
2795
- interface CustomToolkit {
2796
- readonly slug: string;
2797
- readonly name: string;
2798
- readonly description: string;
2799
- /**
2800
- * Default session.tools() exposure for tools in this custom toolkit.
2801
- * Tool-level preload values override this default.
2802
- */
2803
- readonly preload?: boolean;
2804
- readonly tools: readonly CustomTool[];
2805
- }
2806
- /** Serialized toolkit definition sent to backend. Uses official client type. */
2807
- type CustomToolkitDefinition = SessionCreateParams.Experimental.CustomToolkit;
2808
- type CustomToolkitWireDefinition = CustomToolkitDefinition;
2809
- interface InlineCustomToolsWirePayload {
2810
- custom_tools?: CustomToolWireDefinition[];
2811
- custom_toolkits?: CustomToolkitWireDefinition[];
2812
- }
2813
- /** @internal Entry in the per-session custom tools routing map. */
2814
- type CustomToolsMapEntry = {
2815
- handle: CustomTool;
2816
- /** @internal The final slug assigned by the prefixing rules (e.g. LOCAL_GREP, LOCAL_GMAIL_GET_EMAILS) */
2817
- finalSlug: string;
2818
- /** Resolved toolkit — from extendsToolkit, parent custom toolkit, or undefined for standalone */
2819
- toolkit?: string;
2820
- };
2821
- /** @internal Lookup maps used by ToolRouterSession for routing custom tools. */
2822
- type CustomToolsMap = {
2823
- /** Lookup by final slug (e.g. LOCAL_GET_USER_CONTEXT) — used for agent execution path */
2824
- byFinalSlug: Map<string, CustomToolsMapEntry>;
2825
- /** Lookup by unique original slug (e.g. GET_USER_CONTEXT) — used for programmatic session.execute() */
2826
- byOriginalSlug: Map<string, CustomToolsMapEntry>;
2827
- /** Lookup by resolved toolkit + original slug — used when multiple custom toolkits reuse tool names */
2828
- byToolkitAndOriginalSlug?: Map<string, CustomToolsMapEntry>;
2829
- /** Original slugs that appear in multiple toolkits and cannot be resolved safely without the final slug */
2830
- ambiguousOriginalSlugs?: Set<string>;
2831
- /** The original custom toolkits passed at session creation — used for session.customToolkits() */
2832
- toolkits?: CustomToolkit[];
2833
- /** The original standalone custom tools passed at session creation — kept for inline re-injection on later requests. */
2834
- tools?: CustomTool[];
2835
- };
2836
- /** A custom tool as registered in a session, with its final resolved slug. */
2837
- interface RegisteredCustomTool {
2838
- /** The final slug as registered with the backend (e.g. LOCAL_GREP, LOCAL_GMAIL_GET_EMAILS) */
2839
- slug: string;
2840
- name: string;
2841
- description: string;
2842
- /** Resolved toolkit — extendsToolkit value, custom toolkit slug, or undefined for standalone */
2843
- toolkit?: string;
2844
- inputSchema: Record<string, unknown>;
2845
- outputSchema?: Record<string, unknown>;
2846
- }
2847
- /** A custom toolkit as registered in a session, with final slugs on nested tools. */
2848
- interface RegisteredCustomToolkit {
2849
- slug: string;
2850
- name: string;
2851
- description: string;
2852
- tools: RegisteredCustomTool[];
2853
- }
2854
- /** Custom tool as returned in the session create response (has prefixed slug + original_slug). */
2855
- type CustomToolResponse = SessionCreateResponse.Experimental.CustomTool;
2856
- /** Custom toolkit as returned in the session create response (has prefixed slugs + original_slugs). */
2857
- type CustomToolkitResponse = SessionCreateResponse.Experimental.CustomToolkit;
2858
- //#endregion
2859
- export { ToolRouterSessionMetadata as $, ConnectedAccountExperimentalSchema as $t, SessionProxyExecuteParams as A, UpdateConnectedAccountParamsSchema as An, FileListResponseSchema as At, ToolRouterCreateSessionConfigSchema as B, ToolRouterSessionFilesMountUploadOptionsSchema as Bt, MCPServerType as C, CreateConnectedAccountParamsSchema as Cn, ToolkitConnectionStateSchema as Ct, Session as D, UpdateConnectedAccountAclParams as Dn, FileDeleteResponse as Dt, SandboxSizeSchema as E, DefaultCreateConnectedAccountParamsSchema as En, RemoteFile as Et, ToolRouterConfigTags as F, ToolRouterSessionFilesMountDownloadOptions as Ft, ToolRouterSandboxConfigSchema as G, ConnectedAccountAclConfigResponse as Gt, ToolRouterMCPServerConfigSchema as H, ConnectionRequest as Ht, ToolRouterConfigTagsSchema as I, ToolRouterSessionFilesMountDownloadOptionsSchema as It, ToolRouterSessionDeleteResponseSchema as J, ConnectedAccountAuthConfig as Jt, ToolRouterSessionDeleteFn as K, ConnectedAccountAclConfigResponseSchema as Kt, ToolRouterConfigTools as L, ToolRouterSessionFilesMountListOptions as Lt, SessionWithoutMcp as M, RemoteFileDataSchema as Mt, ToolRouterAuthorizeFn as N, ToolRouterSessionFilesMountDeleteOptions as Nt, SessionExperimental as O, UpdateConnectedAccountAclParamsSchema as On, FileDeleteResponseSchema as Ot, ToolRouterConfigManageConnectionsSchema as P, ToolRouterSessionFilesMountDeleteOptionsSchema as Pt, ToolRouterSessionExecuteResponseSchema as Q, ConnectedAccountExperimentalResponseSchema as Qt, ToolRouterConfigToolsSchema as R, ToolRouterSessionFilesMountListOptionsSchema as Rt, SessionContext as S, CreateConnectedAccountParams as Sn, ToolkitConnectionState as St, SandboxSize as T, CreateConnectedAccountResponseSchema as Tn, ToolkitConnectionsDetailsSchema as Tt, ToolRouterManageConnectionsConfigSchema as U, ConnectionRequestState as Ut, ToolRouterMCPServerConfig as V, ComposioRequestOptions as Vt, ToolRouterSandboxConfig as W, ConnectedAccountAclConfig as Wt, ToolRouterSessionExecuteOptions as X, ConnectedAccountExperimental as Xt, ToolRouterSessionExecuteFn as Y, ConnectedAccountAuthConfigSchema as Yt, ToolRouterSessionExecuteResponse as Z, ConnectedAccountExperimentalResponse as Zt, CustomToolsMapEntry as _, CreateConnectedAccountLinkOptionsSchema as _n, ToolRouterToolsFn as _t, CreateCustomToolkitParams as a, ConnectedAccountRefreshOptions as an, ToolRouterSessionSearchResponseSchema as at, RegisteredCustomTool as b, CreateConnectedAccountOptions as bn, ToolRouterUpdateSessionConfig as bt, CustomToolExecuteFn as c, ConnectedAccountRetrieveResponseSchema as cn, ToolRouterSessionWorkbenchConfig as ct, CustomToolWireDefinition as d, ConnectedAccountStatusSchema as dn, ToolRouterToolkitsDisabledConfigSchema as dt, ConnectedAccountListParams as en, ToolRouterSessionPreloadConfig as et, CustomToolkit as f, ConnectedAccountStatuses as fn, ToolRouterToolkitsEnabledConfigSchema as ft, CustomToolsMap as g, CreateConnectedAccountLinkOptions as gn, ToolRouterToolkitsParamSchema as gt, CustomToolkitWireDefinition as h, ConnectedAccountTypes as hn, ToolRouterToolkitsOptionsSchema as ht, CreateCustomToolkitBaseSchema as i, ConnectedAccountListResponseSchema as in, ToolRouterSessionSearchResponse as it, SessionProxyExecuteParamsSchema as j, RemoteFileData as jt, SessionPreset as k, UpdateConnectedAccountParams as kn, FileListResponse as kt, CustomToolResponse as l, ConnectedAccountStatus as ln, ToolRouterTagsEnableDisableSchema as lt, CustomToolkitResponse as m, ConnectedAccountTypeSchema as mn, ToolRouterToolkitsOptions as mt, CreateCustomToolBaseSchema as n, ConnectedAccountListResponse as nn, ToolRouterSessionProxyExecuteResponse as nt, CustomTool as o, ConnectedAccountRefreshOptionsSchema as on, ToolRouterSessionUpdateFn as ot, CustomToolkitDefinition as p, ConnectedAccountType as pn, ToolRouterToolkitsFn as pt, ToolRouterSessionDeleteResponse as q, ConnectedAccountAclConfigSchema as qt, CreateCustomToolParams as r, ConnectedAccountListResponseItem as rn, ToolRouterSessionSearchFn as rt, CustomToolDefinition as s, ConnectedAccountRetrieveResponse as sn, ToolRouterSessionWarning as st, AnyZodSchema as t, ConnectedAccountListParamsSchema as tn, ToolRouterSessionProxyExecuteFn as tt, CustomToolSlugSchema as u, ConnectedAccountStatusEnum as un, ToolRouterTagsParamSchema as ut, InferZodSchema as v, CreateConnectedAccountLinkResponse as vn, ToolRouterToolsParam as vt, MCPServerTypeSchema as w, CreateConnectedAccountResponse as wn, ToolkitConnectionsDetails as wt, RegisteredCustomToolkit as x, CreateConnectedAccountOptionsSchema as xn, ToolRouterUpdateSessionConfigSchema as xt, InlineCustomToolsWirePayload as y, CreateConnectedAccountLinkResponseSchema as yn, ToolRouterToolsParamSchema as yt, ToolRouterCreateSessionConfig as z, ToolRouterSessionFilesMountUploadOptions as zt };