@composio/core 0.8.1 → 0.9.1

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 (29) hide show
  1. package/dist/{CustomTool-BaRzlwyV.d.mts → CustomTool-BFkwL1aY.d.mts} +1 -1
  2. package/dist/{CustomTool-DnCSEC6t.cjs → CustomTool-Bkk0QYzw.cjs} +352 -26
  3. package/dist/{CustomTool-CVwF_isu.mjs → CustomTool-IIUhFtP8.mjs} +287 -27
  4. package/dist/{CustomTool-CzhY9iPX.d.cts → CustomTool-PSRHsd85.d.cts} +1 -1
  5. package/dist/{composio-B75SFMkx.d.cts → composio-BnLWW0B6.d.cts} +249 -166
  6. package/dist/{composio-CwcLLO7C.d.mts → composio-Dzlk0Wj4.d.mts} +249 -166
  7. package/dist/{customTool.types-2DhEI1vs.d.cts → customTool.types-BVgnEbR2.d.cts} +467 -30
  8. package/dist/{customTool.types-BL_z-C_B.d.mts → customTool.types-oV5boR1w.d.mts} +467 -30
  9. package/dist/experimental/index.cjs +1 -1
  10. package/dist/experimental/index.d.cts +2 -2
  11. package/dist/experimental/index.d.mts +3 -3
  12. package/dist/experimental/index.mjs +1 -1
  13. package/dist/index.cjs +715 -72
  14. package/dist/index.d.cts +122 -9
  15. package/dist/index.d.mts +122 -9
  16. package/dist/index.mjs +704 -75
  17. package/dist/{tool.types-CNYy-lBq.d.mts → tool.types-CB_4JKhV.d.mts} +600 -37
  18. package/dist/{tool.types-BlXcjUs1.d.cts → tool.types-CwbAy9l_.d.cts} +600 -37
  19. package/dist/{types-CZkT1raQ.d.cts → types-4vkdo_RG.d.cts} +2 -2
  20. package/dist/{types-DGrpnYFI.d.mts → types-AcoPzTnm.d.mts} +2 -2
  21. package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +2 -2
  22. package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +4 -4
  23. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +2 -2
  24. package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +4 -4
  25. package/dist/utils/modifiers/FileToolModifier.node.d.cts +1 -1
  26. package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
  27. package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +1 -1
  28. package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
  29. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { R as SessionMetaToolOptions, nn as ConnectionDataSchema, o as Tool, q as BaseComposioProvider, tn as ConnectionData, v as ToolProxyParams } from "./tool.types-BlXcjUs1.cjs";
1
+ import { R as SessionMetaToolOptions, nn as ConnectionDataSchema, o as Tool, q as BaseComposioProvider, tn as ConnectionData, v as ToolProxyParams } from "./tool.types-CwbAy9l_.cjs";
2
2
  import z$1, { z } from "zod/v3";
3
3
  import { ConnectedAccountUpdateStatusParams as UpdateConnectedAccountParams } from "@composio/client/resources/connected-accounts";
4
4
  import { Composio } from "@composio/client";
@@ -16,10 +16,59 @@ declare const ConnectedAccountStatuses: {
16
16
  readonly FAILED: "FAILED";
17
17
  readonly EXPIRED: "EXPIRED";
18
18
  readonly INACTIVE: "INACTIVE";
19
+ readonly REVOKED: "REVOKED";
19
20
  };
20
- declare const ConnectedAccountStatusSchema: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>;
21
+ declare const ConnectedAccountStatusSchema: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE", "REVOKED"]>;
21
22
  type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
22
23
  type ConnectedAccountStatusEnum = z.infer<typeof ConnectedAccountStatusSchema>;
24
+ /**
25
+ * Sharing model for a connected account.
26
+ *
27
+ * - `PRIVATE` (default): only the owning `userId` can use the connection.
28
+ * - `SHARED`: can be used by other `userId`s, but only when the connection
29
+ * is explicitly pinned in a tool-router session's config and only when
30
+ * the requesting `userId` passes the connection's ACL (see
31
+ * `allowAllUsers` / `allowedUserIds` / `notAllowedUserIds`).
32
+ */
33
+ declare const ConnectedAccountTypes: {
34
+ readonly PRIVATE: "PRIVATE";
35
+ readonly SHARED: "SHARED";
36
+ };
37
+ declare const ConnectedAccountTypeSchema: z.ZodEnum<["PRIVATE", "SHARED"]>;
38
+ type ConnectedAccountType = (typeof ConnectedAccountTypes)[keyof typeof ConnectedAccountTypes];
39
+ declare const ConnectedAccountAclConfigSchema: z.ZodObject<{
40
+ allowAllUsers: z.ZodOptional<z.ZodBoolean>;
41
+ allowedUserIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
42
+ notAllowedUserIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ allowAllUsers?: boolean | undefined;
45
+ allowedUserIds?: string[] | undefined;
46
+ notAllowedUserIds?: string[] | undefined;
47
+ }, {
48
+ allowAllUsers?: boolean | undefined;
49
+ allowedUserIds?: string[] | undefined;
50
+ notAllowedUserIds?: string[] | undefined;
51
+ }>;
52
+ type ConnectedAccountAclConfig = z.infer<typeof ConnectedAccountAclConfigSchema>;
53
+ /**
54
+ * Resolved ACL as it appears on responses. All three fields are populated
55
+ * when the field is visible; the field itself is `undefined` for callers
56
+ * not authorised to see it.
57
+ */
58
+ declare const ConnectedAccountAclConfigResponseSchema: z.ZodObject<{
59
+ allowAllUsers: z.ZodBoolean;
60
+ allowedUserIds: z.ZodArray<z.ZodString, "many">;
61
+ notAllowedUserIds: z.ZodArray<z.ZodString, "many">;
62
+ }, "strip", z.ZodTypeAny, {
63
+ allowAllUsers: boolean;
64
+ allowedUserIds: string[];
65
+ notAllowedUserIds: string[];
66
+ }, {
67
+ allowAllUsers: boolean;
68
+ allowedUserIds: string[];
69
+ notAllowedUserIds: string[];
70
+ }>;
71
+ type ConnectedAccountAclConfigResponse = z.infer<typeof ConnectedAccountAclConfigResponseSchema>;
23
72
  declare const CreateConnectedAccountParamsSchema: z.ZodObject<{
24
73
  authConfig: z.ZodObject<{
25
74
  id: z.ZodString;
@@ -85,14 +134,14 @@ type CreateConnectedAccountParams = z.infer<typeof CreateConnectedAccountParamsS
85
134
  */
86
135
  declare const CreateConnectedAccountResponseSchema: z.ZodObject<{
87
136
  id: z.ZodString;
88
- status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>;
137
+ status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE", "REVOKED"]>;
89
138
  redirectUrl: z.ZodNullable<z.ZodString>;
90
139
  }, "strip", z.ZodTypeAny, {
91
- status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE";
140
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED";
92
141
  redirectUrl: string | null;
93
142
  id: string;
94
143
  }, {
95
- status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE";
144
+ status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED";
96
145
  redirectUrl: string | null;
97
146
  id: string;
98
147
  }>;
@@ -134,6 +183,8 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodType<{
134
183
  isDisabled: boolean;
135
184
  createdAt: string;
136
185
  updatedAt: string;
186
+ accountType?: ConnectedAccountType;
187
+ aclConfigForShared?: ConnectedAccountAclConfigResponse;
137
188
  }>;
138
189
  type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveResponseSchema>;
139
190
  /**
@@ -145,7 +196,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
145
196
  cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
197
  limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
147
198
  orderBy: z.ZodOptional<z.ZodEnum<["created_at", "updated_at"]>>;
148
- statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>, "many">>>;
199
+ statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE", "REVOKED"]>, "many">>>;
149
200
  toolkitSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
150
201
  userIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
151
202
  }, "strip", z.ZodTypeAny, {
@@ -153,7 +204,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
153
204
  authConfigIds?: string[] | null | undefined;
154
205
  cursor?: string | null | undefined;
155
206
  orderBy?: "created_at" | "updated_at" | undefined;
156
- statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE")[] | null | undefined;
207
+ statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED")[] | null | undefined;
157
208
  toolkitSlugs?: string[] | null | undefined;
158
209
  userIds?: string[] | null | undefined;
159
210
  }, {
@@ -161,7 +212,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
161
212
  authConfigIds?: string[] | null | undefined;
162
213
  cursor?: string | null | undefined;
163
214
  orderBy?: "created_at" | "updated_at" | undefined;
164
- statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE")[] | null | undefined;
215
+ statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED" | "INACTIVE" | "REVOKED")[] | null | undefined;
165
216
  toolkitSlugs?: string[] | null | undefined;
166
217
  userIds?: string[] | null | undefined;
167
218
  }>;
@@ -186,6 +237,8 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
186
237
  isDisabled: boolean;
187
238
  createdAt: string;
188
239
  updatedAt: string;
240
+ accountType?: ConnectedAccountType;
241
+ aclConfigForShared?: ConnectedAccountAclConfigResponse;
189
242
  }, z.ZodTypeDef, {
190
243
  id: string;
191
244
  authConfig: z.infer<typeof ConnectedAccountAuthConfigSchema>;
@@ -205,6 +258,8 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
205
258
  isDisabled: boolean;
206
259
  createdAt: string;
207
260
  updatedAt: string;
261
+ accountType?: ConnectedAccountType;
262
+ aclConfigForShared?: ConnectedAccountAclConfigResponse;
208
263
  }>, "many">;
209
264
  nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
210
265
  totalPages: z.ZodNumber;
@@ -228,6 +283,8 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
228
283
  isDisabled: boolean;
229
284
  createdAt: string;
230
285
  updatedAt: string;
286
+ accountType?: ConnectedAccountType;
287
+ aclConfigForShared?: ConnectedAccountAclConfigResponse;
231
288
  }[];
232
289
  totalPages: number;
233
290
  nextCursor?: string | null | undefined;
@@ -251,6 +308,8 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
251
308
  isDisabled: boolean;
252
309
  createdAt: string;
253
310
  updatedAt: string;
311
+ accountType?: ConnectedAccountType;
312
+ aclConfigForShared?: ConnectedAccountAclConfigResponse;
254
313
  }[];
255
314
  totalPages: number;
256
315
  nextCursor?: string | null | undefined;
@@ -279,14 +338,57 @@ declare const CreateConnectedAccountLinkOptionsSchema: z.ZodObject<{
279
338
  * `multiAccount` config to disambiguate at execution time.
280
339
  */
281
340
  allowMultiple: z.ZodOptional<z.ZodBoolean>;
341
+ /**
342
+ * Sharing model for the new connection. `PRIVATE` (default) is usable only
343
+ * by the owning `userId`. `SHARED` can be used by other `userId`s — but
344
+ * only when the connection is explicitly pinned in a tool-router session's
345
+ * config and only when the requesting `userId` passes the connection's
346
+ * ACL.
347
+ */
348
+ accountType: z.ZodOptional<z.ZodEnum<["PRIVATE", "SHARED"]>>;
349
+ /**
350
+ * Per-user ACL for SHARED connections. Only valid when
351
+ * `accountType === 'SHARED'`; raises `ComposioAclOnlyForSharedError`
352
+ * on a PRIVATE connection.
353
+ *
354
+ * Omit the block (or pass `{}`) to keep the deny-by-default state: only the
355
+ * creator can use the connection. Grant access by setting
356
+ * `allowAllUsers: true` or listing user IDs in `allowedUserIds`.
357
+ * `notAllowedUserIds` always wins over allow.
358
+ */
359
+ aclConfigForShared: z.ZodOptional<z.ZodObject<{
360
+ allowAllUsers: z.ZodOptional<z.ZodBoolean>;
361
+ allowedUserIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
362
+ notAllowedUserIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
363
+ }, "strip", z.ZodTypeAny, {
364
+ allowAllUsers?: boolean | undefined;
365
+ allowedUserIds?: string[] | undefined;
366
+ notAllowedUserIds?: string[] | undefined;
367
+ }, {
368
+ allowAllUsers?: boolean | undefined;
369
+ allowedUserIds?: string[] | undefined;
370
+ notAllowedUserIds?: string[] | undefined;
371
+ }>>;
282
372
  }, "strip", z.ZodTypeAny, {
283
373
  callbackUrl?: string | undefined;
284
374
  alias?: string | undefined;
285
375
  allowMultiple?: boolean | undefined;
376
+ accountType?: "PRIVATE" | "SHARED" | undefined;
377
+ aclConfigForShared?: {
378
+ allowAllUsers?: boolean | undefined;
379
+ allowedUserIds?: string[] | undefined;
380
+ notAllowedUserIds?: string[] | undefined;
381
+ } | undefined;
286
382
  }, {
287
383
  callbackUrl?: string | undefined;
288
384
  alias?: string | undefined;
289
385
  allowMultiple?: boolean | undefined;
386
+ accountType?: "PRIVATE" | "SHARED" | undefined;
387
+ aclConfigForShared?: {
388
+ allowAllUsers?: boolean | undefined;
389
+ allowedUserIds?: string[] | undefined;
390
+ notAllowedUserIds?: string[] | undefined;
391
+ } | undefined;
290
392
  }>;
291
393
  type CreateConnectedAccountLinkOptions = z.infer<typeof CreateConnectedAccountLinkOptionsSchema>;
292
394
  declare const CreateConnectedAccountLinkResponseSchema: z.ZodObject<{
@@ -315,6 +417,40 @@ declare const UpdateConnectedAccountParamsSchema: z.ZodObject<{
315
417
  }, {
316
418
  enabled: boolean;
317
419
  }>;
420
+ /**
421
+ * Params for `composio.connectedAccounts.updateAcl()`. Mirrors the inner
422
+ * shape of the wire's `acl_config_for_shared` block — the SDK adds the
423
+ * outer nesting at the boundary, so callers pass the three fields flat.
424
+ *
425
+ * PATCH-style semantics — omit a field to leave it unchanged; pass an
426
+ * empty array to clear an allow/deny list. Raises
427
+ * `ComposioAclOnlyForSharedError` on a PRIVATE connection.
428
+ *
429
+ * Each field is optional, but at least one must be provided — passing an
430
+ * empty object is rejected as a no-op.
431
+ */
432
+ declare const UpdateConnectedAccountAclParamsSchema: z.ZodEffects<z.ZodObject<{
433
+ allowAllUsers: z.ZodOptional<z.ZodBoolean>;
434
+ allowedUserIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
435
+ notAllowedUserIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
436
+ }, "strip", z.ZodTypeAny, {
437
+ allowAllUsers?: boolean | undefined;
438
+ allowedUserIds?: string[] | undefined;
439
+ notAllowedUserIds?: string[] | undefined;
440
+ }, {
441
+ allowAllUsers?: boolean | undefined;
442
+ allowedUserIds?: string[] | undefined;
443
+ notAllowedUserIds?: string[] | undefined;
444
+ }>, {
445
+ allowAllUsers?: boolean | undefined;
446
+ allowedUserIds?: string[] | undefined;
447
+ notAllowedUserIds?: string[] | undefined;
448
+ }, {
449
+ allowAllUsers?: boolean | undefined;
450
+ allowedUserIds?: string[] | undefined;
451
+ notAllowedUserIds?: string[] | undefined;
452
+ }>;
453
+ type UpdateConnectedAccountAclParams = z.infer<typeof UpdateConnectedAccountAclParamsSchema>;
318
454
  //#endregion
319
455
  //#region src/types/connectionRequest.types.d.ts
320
456
  interface ConnectionRequestState {
@@ -676,6 +812,10 @@ declare class ToolRouterSessionFilesMount {
676
812
  }
677
813
  //#endregion
678
814
  //#region src/types/toolRouter.types.d.ts
815
+ declare const SessionPreset: {
816
+ readonly DIRECT_TOOLS: "direct_tools";
817
+ };
818
+ type SessionPreset = (typeof SessionPreset)[keyof typeof SessionPreset];
679
819
  declare const MCPServerTypeSchema: z$1.ZodEnum<["http", "sse"]>;
680
820
  type MCPServerType = z$1.infer<typeof MCPServerTypeSchema>;
681
821
  /**
@@ -829,7 +969,8 @@ declare const ToolRouterConfigToolsSchema: z$1.ZodEffects<z$1.ZodUnion<[z$1.ZodA
829
969
  };
830
970
  }>;
831
971
  type ToolRouterConfigTools = z$1.infer<typeof ToolRouterConfigToolsSchema>;
832
- declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
972
+ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<{
973
+ sessionPreset: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodLiteral<"direct_tools">>>;
833
974
  tools: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodEffects<z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodObject<{
834
975
  enable: z$1.ZodArray<z$1.ZodString, "many">;
835
976
  }, "strict", z$1.ZodTypeAny, {
@@ -906,7 +1047,7 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
906
1047
  enable: string[];
907
1048
  }>]>>>;
908
1049
  authConfigs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>>;
909
- connectedAccounts: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>>;
1050
+ connectedAccounts: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<[z$1.ZodString, z$1.ZodArray<z$1.ZodString, "many">]>>>>;
910
1051
  manageConnections: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodBoolean, z$1.ZodObject<{
911
1052
  enable: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
912
1053
  callbackUrl: z$1.ZodOptional<z$1.ZodString>;
@@ -950,11 +1091,11 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
950
1091
  requireExplicitSelection?: boolean | undefined;
951
1092
  }>>>;
952
1093
  preload: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodObject<{
953
- tools: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString, "many">>;
1094
+ tools: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodLiteral<"all">]>>;
954
1095
  }, "strict", z$1.ZodTypeAny, {
955
- tools?: string[] | undefined;
1096
+ tools?: string[] | "all" | undefined;
956
1097
  }, {
957
- tools?: string[] | undefined;
1098
+ tools?: string[] | "all" | undefined;
958
1099
  }>>>;
959
1100
  experimental: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodObject<{
960
1101
  assistivePrompt: z$1.ZodOptional<z$1.ZodObject<{
@@ -999,8 +1140,12 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
999
1140
  } | {
1000
1141
  enable: string[];
1001
1142
  } | undefined;
1143
+ preload?: {
1144
+ tools?: string[] | "all" | undefined;
1145
+ } | undefined;
1146
+ sessionPreset?: "direct_tools" | undefined;
1002
1147
  authConfigs?: Record<string, string> | undefined;
1003
- connectedAccounts?: Record<string, string> | undefined;
1148
+ connectedAccounts?: Record<string, string | string[]> | undefined;
1004
1149
  manageConnections?: boolean | {
1005
1150
  callbackUrl?: string | undefined;
1006
1151
  enable?: boolean | undefined;
@@ -1017,9 +1162,6 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
1017
1162
  maxAccountsPerToolkit?: number | undefined;
1018
1163
  requireExplicitSelection?: boolean | undefined;
1019
1164
  } | undefined;
1020
- preload?: {
1021
- tools?: string[] | undefined;
1022
- } | undefined;
1023
1165
  experimental?: {
1024
1166
  assistivePrompt?: {
1025
1167
  userTimezone?: string | undefined;
@@ -1047,8 +1189,12 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
1047
1189
  } | {
1048
1190
  enable: string[];
1049
1191
  } | undefined;
1192
+ preload?: {
1193
+ tools?: string[] | "all" | undefined;
1194
+ } | undefined;
1195
+ sessionPreset?: "direct_tools" | undefined;
1050
1196
  authConfigs?: Record<string, string> | undefined;
1051
- connectedAccounts?: Record<string, string> | undefined;
1197
+ connectedAccounts?: Record<string, string | string[]> | undefined;
1052
1198
  manageConnections?: boolean | {
1053
1199
  callbackUrl?: string | undefined;
1054
1200
  enable?: boolean | undefined;
@@ -1065,8 +1211,54 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
1065
1211
  maxAccountsPerToolkit?: number | undefined;
1066
1212
  requireExplicitSelection?: boolean | undefined;
1067
1213
  } | undefined;
1214
+ experimental?: {
1215
+ assistivePrompt?: {
1216
+ userTimezone?: string | undefined;
1217
+ } | undefined;
1218
+ customTools?: CustomTool[] | undefined;
1219
+ customToolkits?: CustomToolkit[] | undefined;
1220
+ } | undefined;
1221
+ }>, {
1222
+ tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1223
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1224
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1225
+ } | undefined;
1226
+ tools?: Record<string, string[] | {
1227
+ enable: string[];
1228
+ } | {
1229
+ disable: string[];
1230
+ } | {
1231
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1232
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1233
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1234
+ };
1235
+ }> | undefined;
1236
+ toolkits?: string[] | {
1237
+ disable: string[];
1238
+ } | {
1239
+ enable: string[];
1240
+ } | undefined;
1068
1241
  preload?: {
1069
- tools?: string[] | undefined;
1242
+ tools?: string[] | "all" | undefined;
1243
+ } | undefined;
1244
+ sessionPreset?: "direct_tools" | undefined;
1245
+ authConfigs?: Record<string, string> | undefined;
1246
+ connectedAccounts?: Record<string, string | string[]> | undefined;
1247
+ manageConnections?: boolean | {
1248
+ callbackUrl?: string | undefined;
1249
+ enable?: boolean | undefined;
1250
+ waitForConnections?: boolean | undefined;
1251
+ } | undefined;
1252
+ workbench?: {
1253
+ enable: boolean;
1254
+ enableProxyExecution?: boolean | undefined;
1255
+ autoOffloadThreshold?: number | undefined;
1256
+ sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
1257
+ } | undefined;
1258
+ multiAccount?: {
1259
+ enable: boolean;
1260
+ maxAccountsPerToolkit?: number | undefined;
1261
+ requireExplicitSelection?: boolean | undefined;
1070
1262
  } | undefined;
1071
1263
  experimental?: {
1072
1264
  assistivePrompt?: {
@@ -1075,15 +1267,16 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
1075
1267
  customTools?: CustomTool[] | undefined;
1076
1268
  customToolkits?: CustomToolkit[] | undefined;
1077
1269
  } | undefined;
1078
- }>;
1270
+ }, unknown>;
1079
1271
  /**
1080
1272
  * The config for the tool router session.
1081
1273
  *
1274
+ * @param {SessionPreset} [sessionPreset] - Shortcut that exposes every tool allowed by the session filters directly in session.tools() and the MCP tool list. Disables search, multi-execute, manage-connections, and workbench by default; explicit overrides for supported fields still win. Without this preset, ToolRouter uses the default configuration with meta tools enabled.
1082
1275
  * @param {ToolRouterToolkitsParamSchema | ToolRouterToolkitsDisabledConfigSchema | ToolRouterToolkitsEnabledConfigSchema} toolkits - The toolkits to use in the tool router session
1083
1276
  * @param {Record<string, ToolRouterToolsParam | ToolRouterConfigTools>} tools - The tools to configure per toolkit (key is toolkit slug)
1084
1277
  * @param {Array<'readOnlyHint' | 'destructiveHint' | 'idempotentHint' | 'openWorldHint'>} tags - Global tags to filter tools by behavior
1085
1278
  * @param {Record<string, string>} authConfigs - The auth configs to use in the tool router session
1086
- * @param {Record<string, string>} connectedAccounts - The connected accounts to use in the tool router session
1279
+ * @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.
1087
1280
  * @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.
1088
1281
  * @param {boolean} [manageConnections.enable] - Whether to use tools to manage connections in the tool router session @default true
1089
1282
  * @param {string} [manageConnections.callbackUrl] - The callback url to use in the tool router session
@@ -1097,7 +1290,7 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodObject<{
1097
1290
  * @param {number} [multiAccount.maxAccountsPerToolkit] - Max connected accounts per toolkit (2-10, default 5)
1098
1291
  * @param {boolean} [multiAccount.requireExplicitSelection] - When true, require explicit account selection when multiple accounts are connected
1099
1292
  * @param {object} [preload] - Tools to preload into session.tools() and the MCP tool list
1100
- * @param {string[]} [preload.tools] - Tool slugs to preload. Server-side validation ensures they exist and are allowed by the session filters.
1293
+ * @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.
1101
1294
  */
1102
1295
  type ToolRouterCreateSessionConfig = z$1.infer<typeof ToolRouterCreateSessionConfigSchema>;
1103
1296
  declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
@@ -1154,8 +1347,8 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
1154
1347
  } | undefined;
1155
1348
  }>>;
1156
1349
  }, "strip", z$1.ZodTypeAny, {
1157
- name: string;
1158
1350
  slug: string;
1351
+ name: string;
1159
1352
  isNoAuth: boolean;
1160
1353
  logo?: string | undefined;
1161
1354
  connection?: {
@@ -1171,8 +1364,8 @@ declare const ToolkitConnectionStateSchema: z$1.ZodObject<{
1171
1364
  } | undefined;
1172
1365
  } | undefined;
1173
1366
  }, {
1174
- name: string;
1175
1367
  slug: string;
1368
+ name: string;
1176
1369
  logo?: string | undefined;
1177
1370
  isNoAuth?: boolean | undefined;
1178
1371
  connection?: {
@@ -1243,8 +1436,8 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
1243
1436
  } | undefined;
1244
1437
  }>>;
1245
1438
  }, "strip", z$1.ZodTypeAny, {
1246
- name: string;
1247
1439
  slug: string;
1440
+ name: string;
1248
1441
  isNoAuth: boolean;
1249
1442
  logo?: string | undefined;
1250
1443
  connection?: {
@@ -1260,8 +1453,8 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
1260
1453
  } | undefined;
1261
1454
  } | undefined;
1262
1455
  }, {
1263
- name: string;
1264
1456
  slug: string;
1457
+ name: string;
1265
1458
  logo?: string | undefined;
1266
1459
  isNoAuth?: boolean | undefined;
1267
1460
  connection?: {
@@ -1281,8 +1474,8 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
1281
1474
  totalPages: z$1.ZodNumber;
1282
1475
  }, "strip", z$1.ZodTypeAny, {
1283
1476
  items: {
1284
- name: string;
1285
1477
  slug: string;
1478
+ name: string;
1286
1479
  isNoAuth: boolean;
1287
1480
  logo?: string | undefined;
1288
1481
  connection?: {
@@ -1302,8 +1495,8 @@ declare const ToolkitConnectionsDetailsSchema: z$1.ZodObject<{
1302
1495
  cursor?: string | undefined;
1303
1496
  }, {
1304
1497
  items: {
1305
- name: string;
1306
1498
  slug: string;
1499
+ name: string;
1307
1500
  logo?: string | undefined;
1308
1501
  isNoAuth?: boolean | undefined;
1309
1502
  connection?: {
@@ -1709,6 +1902,8 @@ interface ToolRouterSessionMetadata {
1709
1902
  preload?: ToolRouterSessionPreloadConfig;
1710
1903
  configVersion?: number;
1711
1904
  warnings?: ToolRouterSessionWarning[];
1905
+ preloadedCustomToolSlugs?: string[];
1906
+ inlineCustomToolsPayload?: InlineCustomToolsWirePayload;
1712
1907
  }
1713
1908
  declare const SessionProxyExecuteParamsSchema: z$1.ZodObject<{
1714
1909
  /** The toolkit whose connected account to use for auth (e.g. 'gmail', 'github') */
@@ -1756,6 +1951,218 @@ declare const SessionProxyExecuteParamsSchema: z$1.ZodObject<{
1756
1951
  }>;
1757
1952
  type SessionProxyExecuteParams = z$1.infer<typeof SessionProxyExecuteParamsSchema>;
1758
1953
  type ToolRouterSessionProxyExecuteFn = (params: SessionProxyExecuteParams) => Promise<ToolRouterSessionProxyExecuteResponse>;
1954
+ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodObject<{
1955
+ toolkits: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodObject<{
1956
+ disable: z$1.ZodArray<z$1.ZodString, "many">;
1957
+ }, "strict", z$1.ZodTypeAny, {
1958
+ disable: string[];
1959
+ }, {
1960
+ disable: string[];
1961
+ }>, z$1.ZodObject<{
1962
+ enable: z$1.ZodArray<z$1.ZodString, "many">;
1963
+ }, "strict", z$1.ZodTypeAny, {
1964
+ enable: string[];
1965
+ }, {
1966
+ enable: string[];
1967
+ }>]>>>;
1968
+ tools: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodEffects<z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodObject<{
1969
+ enable: z$1.ZodArray<z$1.ZodString, "many">;
1970
+ }, "strict", z$1.ZodTypeAny, {
1971
+ enable: string[];
1972
+ }, {
1973
+ enable: string[];
1974
+ }>, z$1.ZodObject<{
1975
+ disable: z$1.ZodArray<z$1.ZodString, "many">;
1976
+ }, "strict", z$1.ZodTypeAny, {
1977
+ disable: string[];
1978
+ }, {
1979
+ disable: string[];
1980
+ }>, z$1.ZodObject<{
1981
+ tags: z$1.ZodUnion<[z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z$1.ZodObject<{
1982
+ enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1983
+ disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
1984
+ }, "strict", z$1.ZodTypeAny, {
1985
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1986
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1987
+ }, {
1988
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1989
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1990
+ }>]>;
1991
+ }, "strict", z$1.ZodTypeAny, {
1992
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1993
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1994
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1995
+ };
1996
+ }, {
1997
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
1998
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
1999
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2000
+ };
2001
+ }>]>, string[] | {
2002
+ enable: string[];
2003
+ } | {
2004
+ disable: string[];
2005
+ } | {
2006
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2007
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2008
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2009
+ };
2010
+ }, string[] | {
2011
+ enable: string[];
2012
+ } | {
2013
+ disable: string[];
2014
+ } | {
2015
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2016
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2017
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2018
+ };
2019
+ }>]>>>>;
2020
+ tags: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">, z$1.ZodObject<{
2021
+ enable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2022
+ disable: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">>;
2023
+ }, "strict", z$1.ZodTypeAny, {
2024
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2025
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2026
+ }, {
2027
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2028
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2029
+ }>]>>>;
2030
+ authConfigs: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>>;
2031
+ connectedAccounts: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodEffects<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<[z$1.ZodString, z$1.ZodArray<z$1.ZodString, "many">]>>, Record<string, string[]>, Record<string, string | string[]>>>>;
2032
+ manageConnections: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUnion<[z$1.ZodBoolean, z$1.ZodObject<{
2033
+ enable: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
2034
+ callbackUrl: z$1.ZodOptional<z$1.ZodString>;
2035
+ waitForConnections: z$1.ZodOptional<z$1.ZodBoolean>;
2036
+ }, "strict", z$1.ZodTypeAny, {
2037
+ callbackUrl?: string | undefined;
2038
+ enable?: boolean | undefined;
2039
+ waitForConnections?: boolean | undefined;
2040
+ }, {
2041
+ callbackUrl?: string | undefined;
2042
+ enable?: boolean | undefined;
2043
+ waitForConnections?: boolean | undefined;
2044
+ }>]>>>>;
2045
+ workbench: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
2046
+ enable: z$1.ZodOptional<z$1.ZodBoolean>;
2047
+ enableProxyExecution: z$1.ZodOptional<z$1.ZodBoolean>;
2048
+ autoOffloadThreshold: z$1.ZodOptional<z$1.ZodNumber>;
2049
+ sandboxSize: z$1.ZodOptional<z$1.ZodEnum<["standard", "medium", "large", "xlarge"]>>;
2050
+ }, "strip", z$1.ZodTypeAny, {
2051
+ enable?: boolean | undefined;
2052
+ enableProxyExecution?: boolean | undefined;
2053
+ autoOffloadThreshold?: number | undefined;
2054
+ sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2055
+ }, {
2056
+ enable?: boolean | undefined;
2057
+ enableProxyExecution?: boolean | undefined;
2058
+ autoOffloadThreshold?: number | undefined;
2059
+ sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2060
+ }>>>>;
2061
+ multiAccount: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
2062
+ enable: z$1.ZodOptional<z$1.ZodBoolean>;
2063
+ maxAccountsPerToolkit: z$1.ZodOptional<z$1.ZodNumber>;
2064
+ requireExplicitSelection: z$1.ZodOptional<z$1.ZodBoolean>;
2065
+ }, "strip", z$1.ZodTypeAny, {
2066
+ enable?: boolean | undefined;
2067
+ maxAccountsPerToolkit?: number | undefined;
2068
+ requireExplicitSelection?: boolean | undefined;
2069
+ }, {
2070
+ enable?: boolean | undefined;
2071
+ maxAccountsPerToolkit?: number | undefined;
2072
+ requireExplicitSelection?: boolean | undefined;
2073
+ }>>>>;
2074
+ preload: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodObject<{
2075
+ tools: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodArray<z$1.ZodString, "many">, z$1.ZodLiteral<"all">]>>;
2076
+ }, "strict", z$1.ZodTypeAny, {
2077
+ tools?: string[] | "all" | undefined;
2078
+ }, {
2079
+ tools?: string[] | "all" | undefined;
2080
+ }>>>;
2081
+ }, "strip", z$1.ZodTypeAny, {
2082
+ tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2083
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2084
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2085
+ } | undefined;
2086
+ tools?: Record<string, string[] | {
2087
+ enable: string[];
2088
+ } | {
2089
+ disable: string[];
2090
+ } | {
2091
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2092
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2093
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2094
+ };
2095
+ }> | undefined;
2096
+ toolkits?: string[] | {
2097
+ disable: string[];
2098
+ } | {
2099
+ enable: string[];
2100
+ } | undefined;
2101
+ preload?: {
2102
+ tools?: string[] | "all" | undefined;
2103
+ } | undefined;
2104
+ authConfigs?: Record<string, string> | undefined;
2105
+ connectedAccounts?: Record<string, string[]> | undefined;
2106
+ manageConnections?: boolean | {
2107
+ callbackUrl?: string | undefined;
2108
+ enable?: boolean | undefined;
2109
+ waitForConnections?: boolean | undefined;
2110
+ } | null | undefined;
2111
+ workbench?: {
2112
+ enable?: boolean | undefined;
2113
+ enableProxyExecution?: boolean | undefined;
2114
+ autoOffloadThreshold?: number | undefined;
2115
+ sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2116
+ } | null | undefined;
2117
+ multiAccount?: {
2118
+ enable?: boolean | undefined;
2119
+ maxAccountsPerToolkit?: number | undefined;
2120
+ requireExplicitSelection?: boolean | undefined;
2121
+ } | null | undefined;
2122
+ }, {
2123
+ tags?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2124
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2125
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2126
+ } | undefined;
2127
+ tools?: Record<string, string[] | {
2128
+ enable: string[];
2129
+ } | {
2130
+ disable: string[];
2131
+ } | {
2132
+ tags: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | {
2133
+ enable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2134
+ disable?: ("readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint")[] | undefined;
2135
+ };
2136
+ }> | undefined;
2137
+ toolkits?: string[] | {
2138
+ disable: string[];
2139
+ } | {
2140
+ enable: string[];
2141
+ } | undefined;
2142
+ preload?: {
2143
+ tools?: string[] | "all" | undefined;
2144
+ } | undefined;
2145
+ authConfigs?: Record<string, string> | undefined;
2146
+ connectedAccounts?: Record<string, string | string[]> | undefined;
2147
+ manageConnections?: boolean | {
2148
+ callbackUrl?: string | undefined;
2149
+ enable?: boolean | undefined;
2150
+ waitForConnections?: boolean | undefined;
2151
+ } | null | undefined;
2152
+ workbench?: {
2153
+ enable?: boolean | undefined;
2154
+ enableProxyExecution?: boolean | undefined;
2155
+ autoOffloadThreshold?: number | undefined;
2156
+ sandboxSize?: "standard" | "medium" | "large" | "xlarge" | undefined;
2157
+ } | null | undefined;
2158
+ multiAccount?: {
2159
+ enable?: boolean | undefined;
2160
+ maxAccountsPerToolkit?: number | undefined;
2161
+ requireExplicitSelection?: boolean | undefined;
2162
+ } | null | undefined;
2163
+ }>;
2164
+ type ToolRouterUpdateSessionConfig = z$1.infer<typeof ToolRouterUpdateSessionConfigSchema>;
2165
+ type ToolRouterSessionUpdateFn = (config: ToolRouterUpdateSessionConfig) => Promise<void>;
1759
2166
  /** Session type returned by ToolRouter.create() and ToolRouter.use() */
1760
2167
  interface Session<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> {
1761
2168
  sessionId: string;
@@ -1773,6 +2180,8 @@ interface Session<TToolCollection, TTool, TProvider extends BaseComposioProvider
1773
2180
  search: ToolRouterSessionSearchFn;
1774
2181
  /** Execute a tool within the session */
1775
2182
  execute: ToolRouterSessionExecuteFn;
2183
+ /** Update the session configuration. Mutates this session in-place. */
2184
+ update: ToolRouterSessionUpdateFn;
1776
2185
  /** Proxy an API call through Composio's auth layer using the session's connected account */
1777
2186
  proxyExecute: ToolRouterSessionProxyExecuteFn;
1778
2187
  /** List custom tools registered in this session, with their final slugs and schemas */
@@ -1865,14 +2274,17 @@ declare const CreateCustomToolBaseSchema: z.ZodObject<{
1865
2274
  * Leave empty for tools that don't need any Composio-managed authentication.
1866
2275
  */
1867
2276
  extendsToolkit: z.ZodOptional<z.ZodString>;
2277
+ preload: z.ZodOptional<z.ZodBoolean>;
1868
2278
  }, "strip", z.ZodTypeAny, {
1869
2279
  name: string;
1870
2280
  description: string;
1871
2281
  extendsToolkit?: string | undefined;
2282
+ preload?: boolean | undefined;
1872
2283
  }, {
1873
2284
  name: string;
1874
2285
  description: string;
1875
2286
  extendsToolkit?: string | undefined;
2287
+ preload?: boolean | undefined;
1876
2288
  }>;
1877
2289
  /** Options for creating a custom tool via `createCustomTool()`. */
1878
2290
  type CreateCustomToolParams<T extends z.ZodType> = z.infer<typeof CreateCustomToolBaseSchema> & {
@@ -1897,6 +2309,11 @@ interface CustomTool {
1897
2309
  * Undefined means the tool doesn't need any Composio-managed authentication.
1898
2310
  */
1899
2311
  readonly extendsToolkit?: string;
2312
+ /**
2313
+ * Include this custom tool in session.tools() so it can be called without
2314
+ * searching first.
2315
+ */
2316
+ readonly preload?: boolean;
1900
2317
  readonly inputSchema: Record<string, unknown>;
1901
2318
  /** JSON Schema representation of the output (for backend documentation) */
1902
2319
  readonly outputSchema?: Record<string, unknown>;
@@ -1907,6 +2324,7 @@ interface CustomTool {
1907
2324
  }
1908
2325
  /** Serialized tool definition sent to backend for search indexing. Uses official client type. */
1909
2326
  type CustomToolDefinition = SessionCreateParams.Experimental.CustomTool;
2327
+ type CustomToolWireDefinition = CustomToolDefinition;
1910
2328
  /**
1911
2329
  * Zod schema for validating the string/scalar fields of createCustomToolkit() options.
1912
2330
  * Slug is validated separately as the first argument.
@@ -1914,12 +2332,15 @@ type CustomToolDefinition = SessionCreateParams.Experimental.CustomTool;
1914
2332
  declare const CreateCustomToolkitBaseSchema: z.ZodObject<{
1915
2333
  name: z.ZodString;
1916
2334
  description: z.ZodString;
2335
+ preload: z.ZodOptional<z.ZodBoolean>;
1917
2336
  }, "strip", z.ZodTypeAny, {
1918
2337
  name: string;
1919
2338
  description: string;
2339
+ preload?: boolean | undefined;
1920
2340
  }, {
1921
2341
  name: string;
1922
2342
  description: string;
2343
+ preload?: boolean | undefined;
1923
2344
  }>;
1924
2345
  /** Options for creating a custom toolkit via `createCustomToolkit()`. */
1925
2346
  type CreateCustomToolkitParams = z.infer<typeof CreateCustomToolkitBaseSchema> & {
@@ -1934,10 +2355,20 @@ interface CustomToolkit {
1934
2355
  readonly slug: string;
1935
2356
  readonly name: string;
1936
2357
  readonly description: string;
2358
+ /**
2359
+ * Default session.tools() exposure for tools in this custom toolkit.
2360
+ * Tool-level preload values override this default.
2361
+ */
2362
+ readonly preload?: boolean;
1937
2363
  readonly tools: readonly CustomTool[];
1938
2364
  }
1939
2365
  /** Serialized toolkit definition sent to backend. Uses official client type. */
1940
2366
  type CustomToolkitDefinition = SessionCreateParams.Experimental.CustomToolkit;
2367
+ type CustomToolkitWireDefinition = CustomToolkitDefinition;
2368
+ interface InlineCustomToolsWirePayload {
2369
+ custom_tools?: CustomToolWireDefinition[];
2370
+ custom_toolkits?: CustomToolkitWireDefinition[];
2371
+ }
1941
2372
  /** @internal Entry in the per-session custom tools routing map. */
1942
2373
  type CustomToolsMapEntry = {
1943
2374
  handle: CustomTool;
@@ -1950,10 +2381,16 @@ type CustomToolsMapEntry = {
1950
2381
  type CustomToolsMap = {
1951
2382
  /** Lookup by final slug (e.g. LOCAL_GET_USER_CONTEXT) — used for agent execution path */
1952
2383
  byFinalSlug: Map<string, CustomToolsMapEntry>;
1953
- /** Lookup by original slug (e.g. GET_USER_CONTEXT) — used for programmatic session.execute() */
2384
+ /** Lookup by unique original slug (e.g. GET_USER_CONTEXT) — used for programmatic session.execute() */
1954
2385
  byOriginalSlug: Map<string, CustomToolsMapEntry>;
2386
+ /** Lookup by resolved toolkit + original slug — used when multiple custom toolkits reuse tool names */
2387
+ byToolkitAndOriginalSlug?: Map<string, CustomToolsMapEntry>;
2388
+ /** Original slugs that appear in multiple toolkits and cannot be resolved safely without the final slug */
2389
+ ambiguousOriginalSlugs?: Set<string>;
1955
2390
  /** The original custom toolkits passed at session creation — used for session.customToolkits() */
1956
2391
  toolkits?: CustomToolkit[];
2392
+ /** The original standalone custom tools passed at session creation — kept for inline re-injection on later requests. */
2393
+ tools?: CustomTool[];
1957
2394
  };
1958
2395
  /** A custom tool as registered in a session, with its final resolved slug. */
1959
2396
  interface RegisteredCustomTool {
@@ -1978,4 +2415,4 @@ type CustomToolResponse = SessionCreateResponse.Experimental.CustomTool;
1978
2415
  /** Custom toolkit as returned in the session create response (has prefixed slugs + original_slugs). */
1979
2416
  type CustomToolkitResponse = SessionCreateResponse.Experimental.CustomToolkit;
1980
2417
  //#endregion
1981
- export { ToolRouterSessionSearchResponseSchema as $, CreateConnectedAccountOptionsSchema as $t, SessionProxyExecuteParams as A, ToolRouterSessionFilesMountUploadOptionsSchema as At, ToolRouterMCPServerConfig as B, ConnectedAccountRefreshOptions as Bt, SessionContext as C, ToolRouterSessionFilesMountDeleteOptions as Ct, SandboxSizeSchema as D, ToolRouterSessionFilesMountListOptions as Dt, SandboxSize as E, ToolRouterSessionFilesMountDownloadOptionsSchema as Et, ToolRouterConfigTagsSchema as F, ConnectedAccountListParams as Ft, ToolRouterSessionExecuteResponse as G, ConnectedAccountStatusEnum as Gt, ToolRouterManageConnectionsConfigSchema as H, ConnectedAccountRetrieveResponse as Ht, ToolRouterConfigTools as I, ConnectedAccountListParamsSchema as It, ToolRouterSessionPreloadConfig as J, CreateConnectedAccountLinkOptions as Jt, ToolRouterSessionExecuteResponseSchema as K, ConnectedAccountStatusSchema as Kt, ToolRouterConfigToolsSchema as L, ConnectedAccountListResponse as Lt, ToolRouterAuthorizeFn as M, ConnectionRequestState as Mt, ToolRouterConfigManageConnectionsSchema as N, ConnectedAccountAuthConfig as Nt, Session as O, ToolRouterSessionFilesMountListOptionsSchema as Ot, ToolRouterConfigTags as P, ConnectedAccountAuthConfigSchema as Pt, ToolRouterSessionSearchResponse as Q, CreateConnectedAccountOptions as Qt, ToolRouterCreateSessionConfig as R, ConnectedAccountListResponseItem as Rt, RegisteredCustomToolkit as S, RemoteFileDataSchema as St, MCPServerTypeSchema as T, ToolRouterSessionFilesMountDownloadOptions as Tt, ToolRouterSessionExecuteFn as U, ConnectedAccountRetrieveResponseSchema as Ut, ToolRouterMCPServerConfigSchema as V, ConnectedAccountRefreshOptionsSchema as Vt, ToolRouterSessionExecuteOptions as W, ConnectedAccountStatus as Wt, ToolRouterSessionProxyExecuteResponse as X, CreateConnectedAccountLinkResponse as Xt, ToolRouterSessionProxyExecuteFn as Y, CreateConnectedAccountLinkOptionsSchema as Yt, ToolRouterSessionSearchFn as Z, CreateConnectedAccountLinkResponseSchema as Zt, CustomToolsMap as _, FileDeleteResponse as _t, CustomTool as a, UpdateConnectedAccountParams as an, ToolRouterToolkitsFn as at, InputParamsSchema as b, FileListResponseSchema as bt, CustomToolInputParameter as c, ToolRouterToolkitsParamSchema as ct, CustomToolRegistryItem as d, ToolRouterToolsParamSchema as dt, CreateConnectedAccountParams as en, ToolRouterSessionWarning as et, CustomToolResponse as f, ToolkitConnectionState as ft, CustomToolkitResponse as g, RemoteFile as gt, CustomToolkitDefinition as h, ToolkitConnectionsDetailsSchema as ht, CreateCustomToolkitParams as i, DefaultCreateConnectedAccountParamsSchema as in, ToolRouterToolkitsEnabledConfigSchema as it, SessionProxyExecuteParamsSchema as j, ConnectionRequest as jt, SessionExperimental as k, ToolRouterSessionFilesMountUploadOptions as kt, CustomToolOptions as l, ToolRouterToolsFn as lt, CustomToolkit as m, ToolkitConnectionsDetails as mt, CreateCustomToolParams as n, CreateConnectedAccountResponse as nn, ToolRouterTagsParamSchema as nt, CustomToolDefinition as o, UpdateConnectedAccountParamsSchema as on, ToolRouterToolkitsOptions as ot, CustomToolSlugSchema as p, ToolkitConnectionStateSchema as pt, ToolRouterSessionMetadata as q, ConnectedAccountStatuses as qt, CreateCustomToolkitBaseSchema as r, CreateConnectedAccountResponseSchema as rn, ToolRouterToolkitsDisabledConfigSchema as rt, CustomToolExecuteFn as s, ToolRouterToolkitsOptionsSchema as st, CreateCustomToolBaseSchema as t, CreateConnectedAccountParamsSchema as tn, ToolRouterTagsEnableDisableSchema as tt, CustomToolRegistry as u, ToolRouterToolsParam as ut, CustomToolsMapEntry as v, FileDeleteResponseSchema as vt, MCPServerType as w, ToolRouterSessionFilesMountDeleteOptionsSchema as wt, RegisteredCustomTool as x, RemoteFileData as xt, ExecuteMetadata as y, FileListResponse as yt, ToolRouterCreateSessionConfigSchema as z, ConnectedAccountListResponseSchema as zt };
2418
+ export { ToolRouterSessionProxyExecuteFn as $, ConnectedAccountRetrieveResponse as $t, SandboxSizeSchema as A, ToolRouterSessionFilesMountDeleteOptions as At, ToolRouterConfigTools as B, ConnectedAccountAclConfig as Bt, InputParamsSchema as C, RemoteFile as Ct, MCPServerType as D, FileListResponseSchema as Dt, SessionContext as E, FileListResponse as Et, SessionProxyExecuteParamsSchema as F, ToolRouterSessionFilesMountListOptionsSchema as Ft, ToolRouterMCPServerConfigSchema as G, ConnectedAccountAuthConfigSchema as Gt, ToolRouterCreateSessionConfig as H, ConnectedAccountAclConfigResponseSchema as Ht, ToolRouterAuthorizeFn as I, ToolRouterSessionFilesMountUploadOptions as It, ToolRouterSessionExecuteOptions as J, ConnectedAccountListResponse as Jt, ToolRouterManageConnectionsConfigSchema as K, ConnectedAccountListParams as Kt, ToolRouterConfigManageConnectionsSchema as L, ToolRouterSessionFilesMountUploadOptionsSchema as Lt, SessionExperimental as M, ToolRouterSessionFilesMountDownloadOptions as Mt, SessionPreset as N, ToolRouterSessionFilesMountDownloadOptionsSchema as Nt, MCPServerTypeSchema as O, RemoteFileData as Ot, SessionProxyExecuteParams as P, ToolRouterSessionFilesMountListOptions as Pt, ToolRouterSessionPreloadConfig as Q, ConnectedAccountRefreshOptionsSchema as Qt, ToolRouterConfigTags as R, ConnectionRequest as Rt, InlineCustomToolsWirePayload as S, UpdateConnectedAccountParamsSchema as Sn, ToolkitConnectionsDetailsSchema as St, RegisteredCustomToolkit as T, FileDeleteResponseSchema as Tt, ToolRouterCreateSessionConfigSchema as U, ConnectedAccountAclConfigSchema as Ut, ToolRouterConfigToolsSchema as V, ConnectedAccountAclConfigResponse as Vt, ToolRouterMCPServerConfig as W, ConnectedAccountAuthConfig as Wt, ToolRouterSessionExecuteResponseSchema as X, ConnectedAccountListResponseSchema as Xt, ToolRouterSessionExecuteResponse as Y, ConnectedAccountListResponseItem as Yt, ToolRouterSessionMetadata as Z, ConnectedAccountRefreshOptions as Zt, CustomToolkitResponse as _, CreateConnectedAccountResponseSchema as _n, ToolRouterUpdateSessionConfig as _t, CustomTool as a, ConnectedAccountType as an, ToolRouterSessionWarning as at, CustomToolsMapEntry as b, UpdateConnectedAccountAclParamsSchema as bn, ToolkitConnectionStateSchema as bt, CustomToolInputParameter as c, CreateConnectedAccountLinkOptions as cn, ToolRouterToolkitsDisabledConfigSchema as ct, CustomToolRegistryItem as d, CreateConnectedAccountLinkResponseSchema as dn, ToolRouterToolkitsOptions as dt, ConnectedAccountRetrieveResponseSchema as en, ToolRouterSessionProxyExecuteResponse as et, CustomToolResponse as f, CreateConnectedAccountOptions as fn, ToolRouterToolkitsOptionsSchema as ft, CustomToolkitDefinition as g, CreateConnectedAccountResponse as gn, ToolRouterToolsParamSchema as gt, CustomToolkit as h, CreateConnectedAccountParamsSchema as hn, ToolRouterToolsParam as ht, CreateCustomToolkitParams as i, ConnectedAccountStatuses as in, ToolRouterSessionUpdateFn as it, Session as j, ToolRouterSessionFilesMountDeleteOptionsSchema as jt, SandboxSize as k, RemoteFileDataSchema as kt, CustomToolOptions as l, CreateConnectedAccountLinkOptionsSchema as ln, ToolRouterToolkitsEnabledConfigSchema as lt, CustomToolWireDefinition as m, CreateConnectedAccountParams as mn, ToolRouterToolsFn as mt, CreateCustomToolParams as n, ConnectedAccountStatusEnum as nn, ToolRouterSessionSearchResponse as nt, CustomToolDefinition as o, ConnectedAccountTypeSchema as on, ToolRouterTagsEnableDisableSchema as ot, CustomToolSlugSchema as p, CreateConnectedAccountOptionsSchema as pn, ToolRouterToolkitsParamSchema as pt, ToolRouterSessionExecuteFn as q, ConnectedAccountListParamsSchema as qt, CreateCustomToolkitBaseSchema as r, ConnectedAccountStatusSchema as rn, ToolRouterSessionSearchResponseSchema as rt, CustomToolExecuteFn as s, ConnectedAccountTypes as sn, ToolRouterTagsParamSchema as st, CreateCustomToolBaseSchema as t, ConnectedAccountStatus as tn, ToolRouterSessionSearchFn as tt, CustomToolRegistry as u, CreateConnectedAccountLinkResponse as un, ToolRouterToolkitsFn as ut, CustomToolkitWireDefinition as v, DefaultCreateConnectedAccountParamsSchema as vn, ToolRouterUpdateSessionConfigSchema as vt, RegisteredCustomTool as w, FileDeleteResponse as wt, ExecuteMetadata as x, UpdateConnectedAccountParams as xn, ToolkitConnectionsDetails as xt, CustomToolsMap as y, UpdateConnectedAccountAclParams as yn, ToolkitConnectionState as yt, ToolRouterConfigTagsSchema as z, ConnectionRequestState as zt };