@composio/core 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CustomTool-C1q7Y3Nq.mjs → CustomTool-AYNimqhf.mjs} +1 -0
- package/dist/{CustomTool-BlpMy_R5.d.cts → CustomTool-B0ssIcQn.d.cts} +2 -1
- package/dist/{CustomTool-CZZbiZgh.d.mts → CustomTool-CaO_eE3G.d.mts} +2 -1
- package/dist/{CustomTool-G2lKa7eb.cjs → CustomTool-Cyo1aJ2l.cjs} +1 -0
- package/dist/{composio-CbZbGwhD.d.mts → composio-BREEwwMk.d.mts} +32 -8
- package/dist/{composio-Yl_Y7F6u.d.cts → composio-COTWSJh4.d.cts} +32 -8
- package/dist/{customTool.types-CzBEXJw5.d.cts → customTool.types-DIvgAKNO.d.cts} +98 -11
- package/dist/{customTool.types-CEo_oLEU.d.mts → customTool.types-jiqAXiST.d.mts} +98 -11
- package/dist/experimental/index.cjs +1 -1
- package/dist/experimental/index.d.cts +2 -2
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.cjs +121 -26
- package/dist/index.d.cts +5 -4
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +121 -27
- package/dist/{types-e_z7dQdL.d.mts → types-C7Ld_qbu.d.mts} +1 -1
- package/dist/{types-C_HOnR64.d.cts → types-mVw5PfwE.d.cts} +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +3 -3
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +3 -3
- package/package.json +4 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { $t as ConnectionData, G as BaseComposioProvider, L as SessionMetaToolOptions,
|
|
1
|
+
import { $t as ConnectionData, G as BaseComposioProvider, L as SessionMetaToolOptions, en as ConnectionDataSchema, o as Tool, v as ToolProxyParams } from "./tool.types-bencsexi.mjs";
|
|
2
2
|
import { Composio } from "@composio/client";
|
|
3
3
|
import z, { z as z$1 } from "zod/v3";
|
|
4
|
+
import { ConnectedAccountPatchParams as UpdateConnectedAccountParams } from "@composio/client/resources/connected-accounts";
|
|
4
5
|
import { ToolExecuteResponse } from "@composio/client/resources/tools";
|
|
5
6
|
import { SessionCreateParams, SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
|
|
6
7
|
|
|
@@ -68,12 +69,14 @@ declare const DefaultCreateConnectedAccountParamsSchema: z$1.ZodType<{
|
|
|
68
69
|
data?: Record<string, unknown>;
|
|
69
70
|
callback_url?: string;
|
|
70
71
|
user_id?: string;
|
|
72
|
+
alias?: string;
|
|
71
73
|
};
|
|
72
74
|
}>;
|
|
73
75
|
declare const CreateConnectedAccountOptionsSchema: z$1.ZodType<{
|
|
74
76
|
allowMultiple?: boolean;
|
|
75
77
|
callbackUrl?: string;
|
|
76
78
|
config?: z$1.infer<typeof ConnectionDataSchema>;
|
|
79
|
+
alias?: string;
|
|
77
80
|
}>;
|
|
78
81
|
type CreateConnectedAccountOptions = z$1.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
79
82
|
type CreateConnectedAccountParams = z$1.infer<typeof CreateConnectedAccountParamsSchema>;
|
|
@@ -115,6 +118,8 @@ type ConnectedAccountAuthConfig = z$1.infer<typeof ConnectedAccountAuthConfigSch
|
|
|
115
118
|
declare const ConnectedAccountRetrieveResponseSchema: z$1.ZodType<{
|
|
116
119
|
id: string;
|
|
117
120
|
authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
|
|
121
|
+
wordId?: string | null;
|
|
122
|
+
alias?: string | null;
|
|
118
123
|
/** @deprecated use connectedAccount.state instead */
|
|
119
124
|
data?: Record<string, unknown>;
|
|
120
125
|
/** @deprecated use connectedAccount.state instead */
|
|
@@ -165,6 +170,8 @@ declare const ConnectedAccountListResponseSchema: z$1.ZodObject<{
|
|
|
165
170
|
items: z$1.ZodArray<z$1.ZodType<{
|
|
166
171
|
id: string;
|
|
167
172
|
authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
|
|
173
|
+
wordId?: string | null;
|
|
174
|
+
alias?: string | null;
|
|
168
175
|
/** @deprecated use connectedAccount.state instead */
|
|
169
176
|
data?: Record<string, unknown>;
|
|
170
177
|
/** @deprecated use connectedAccount.state instead */
|
|
@@ -182,6 +189,8 @@ declare const ConnectedAccountListResponseSchema: z$1.ZodObject<{
|
|
|
182
189
|
}, z$1.ZodTypeDef, {
|
|
183
190
|
id: string;
|
|
184
191
|
authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
|
|
192
|
+
wordId?: string | null;
|
|
193
|
+
alias?: string | null;
|
|
185
194
|
/** @deprecated use connectedAccount.state instead */
|
|
186
195
|
data?: Record<string, unknown>;
|
|
187
196
|
/** @deprecated use connectedAccount.state instead */
|
|
@@ -203,6 +212,8 @@ declare const ConnectedAccountListResponseSchema: z$1.ZodObject<{
|
|
|
203
212
|
items: {
|
|
204
213
|
id: string;
|
|
205
214
|
authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
|
|
215
|
+
wordId?: string | null;
|
|
216
|
+
alias?: string | null;
|
|
206
217
|
/** @deprecated use connectedAccount.state instead */
|
|
207
218
|
data?: Record<string, unknown>;
|
|
208
219
|
/** @deprecated use connectedAccount.state instead */
|
|
@@ -224,6 +235,8 @@ declare const ConnectedAccountListResponseSchema: z$1.ZodObject<{
|
|
|
224
235
|
items: {
|
|
225
236
|
id: string;
|
|
226
237
|
authConfig: z$1.infer<typeof ConnectedAccountAuthConfigSchema>;
|
|
238
|
+
wordId?: string | null;
|
|
239
|
+
alias?: string | null;
|
|
227
240
|
/** @deprecated use connectedAccount.state instead */
|
|
228
241
|
data?: Record<string, unknown>;
|
|
229
242
|
/** @deprecated use connectedAccount.state instead */
|
|
@@ -254,10 +267,16 @@ declare const CreateConnectedAccountLinkOptionsSchema: z$1.ZodObject<{
|
|
|
254
267
|
*
|
|
255
268
|
*/
|
|
256
269
|
callbackUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
270
|
+
/**
|
|
271
|
+
* Human-readable alias for the connected account. Must be unique per userId and toolkit within the project.
|
|
272
|
+
*/
|
|
273
|
+
alias: z$1.ZodOptional<z$1.ZodString>;
|
|
257
274
|
}, "strip", z$1.ZodTypeAny, {
|
|
258
275
|
callbackUrl?: string | undefined;
|
|
276
|
+
alias?: string | undefined;
|
|
259
277
|
}, {
|
|
260
278
|
callbackUrl?: string | undefined;
|
|
279
|
+
alias?: string | undefined;
|
|
261
280
|
}>;
|
|
262
281
|
type CreateConnectedAccountLinkOptions = z$1.infer<typeof CreateConnectedAccountLinkOptionsSchema>;
|
|
263
282
|
declare const CreateConnectedAccountLinkResponseSchema: z$1.ZodObject<{
|
|
@@ -279,6 +298,47 @@ declare const ConnectedAccountRefreshOptionsSchema: z$1.ZodObject<{
|
|
|
279
298
|
validateCredentials?: boolean | undefined;
|
|
280
299
|
}>;
|
|
281
300
|
type ConnectedAccountRefreshOptions = z$1.infer<typeof ConnectedAccountRefreshOptionsSchema>;
|
|
301
|
+
declare const UpdateConnectedAccountParamsSchema: z$1.ZodObject<{
|
|
302
|
+
alias: z$1.ZodOptional<z$1.ZodString>;
|
|
303
|
+
connection: z$1.ZodOptional<z$1.ZodObject<{
|
|
304
|
+
state: z$1.ZodObject<{
|
|
305
|
+
authScheme: z$1.ZodEnum<["BEARER_TOKEN", "API_KEY", "BASIC", "BASIC_WITH_JWT", "GOOGLE_SERVICE_ACCOUNT", "SERVICE_ACCOUNT"]>;
|
|
306
|
+
val: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
307
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
308
|
+
authScheme: "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT";
|
|
309
|
+
val: Record<string, unknown>;
|
|
310
|
+
}, {
|
|
311
|
+
authScheme: "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT";
|
|
312
|
+
val: Record<string, unknown>;
|
|
313
|
+
}>;
|
|
314
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
315
|
+
state: {
|
|
316
|
+
authScheme: "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT";
|
|
317
|
+
val: Record<string, unknown>;
|
|
318
|
+
};
|
|
319
|
+
}, {
|
|
320
|
+
state: {
|
|
321
|
+
authScheme: "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT";
|
|
322
|
+
val: Record<string, unknown>;
|
|
323
|
+
};
|
|
324
|
+
}>>;
|
|
325
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
326
|
+
connection?: {
|
|
327
|
+
state: {
|
|
328
|
+
authScheme: "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT";
|
|
329
|
+
val: Record<string, unknown>;
|
|
330
|
+
};
|
|
331
|
+
} | undefined;
|
|
332
|
+
alias?: string | undefined;
|
|
333
|
+
}, {
|
|
334
|
+
connection?: {
|
|
335
|
+
state: {
|
|
336
|
+
authScheme: "API_KEY" | "BASIC" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "SERVICE_ACCOUNT";
|
|
337
|
+
val: Record<string, unknown>;
|
|
338
|
+
};
|
|
339
|
+
} | undefined;
|
|
340
|
+
alias?: string | undefined;
|
|
341
|
+
}>;
|
|
282
342
|
//#endregion
|
|
283
343
|
//#region src/types/connectionRequest.types.d.ts
|
|
284
344
|
interface ConnectionRequestState {
|
|
@@ -883,6 +943,19 @@ declare const ToolRouterCreateSessionConfigSchema: z.ZodObject<{
|
|
|
883
943
|
enableProxyExecution?: boolean | undefined;
|
|
884
944
|
autoOffloadThreshold?: number | undefined;
|
|
885
945
|
}>>>;
|
|
946
|
+
multiAccount: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
947
|
+
enable: z.ZodDefault<z.ZodBoolean>;
|
|
948
|
+
maxAccountsPerToolkit: z.ZodOptional<z.ZodNumber>;
|
|
949
|
+
requireExplicitSelection: z.ZodOptional<z.ZodBoolean>;
|
|
950
|
+
}, "strip", z.ZodTypeAny, {
|
|
951
|
+
enable: boolean;
|
|
952
|
+
maxAccountsPerToolkit?: number | undefined;
|
|
953
|
+
requireExplicitSelection?: boolean | undefined;
|
|
954
|
+
}, {
|
|
955
|
+
enable?: boolean | undefined;
|
|
956
|
+
maxAccountsPerToolkit?: number | undefined;
|
|
957
|
+
requireExplicitSelection?: boolean | undefined;
|
|
958
|
+
}>>>;
|
|
886
959
|
experimental: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
887
960
|
assistivePrompt: z.ZodOptional<z.ZodObject<{
|
|
888
961
|
userTimezone: z.ZodOptional<z.ZodString>;
|
|
@@ -938,6 +1011,11 @@ declare const ToolRouterCreateSessionConfigSchema: z.ZodObject<{
|
|
|
938
1011
|
enableProxyExecution?: boolean | undefined;
|
|
939
1012
|
autoOffloadThreshold?: number | undefined;
|
|
940
1013
|
} | undefined;
|
|
1014
|
+
multiAccount?: {
|
|
1015
|
+
enable: boolean;
|
|
1016
|
+
maxAccountsPerToolkit?: number | undefined;
|
|
1017
|
+
requireExplicitSelection?: boolean | undefined;
|
|
1018
|
+
} | undefined;
|
|
941
1019
|
experimental?: {
|
|
942
1020
|
assistivePrompt?: {
|
|
943
1021
|
userTimezone?: string | undefined;
|
|
@@ -977,6 +1055,11 @@ declare const ToolRouterCreateSessionConfigSchema: z.ZodObject<{
|
|
|
977
1055
|
enableProxyExecution?: boolean | undefined;
|
|
978
1056
|
autoOffloadThreshold?: number | undefined;
|
|
979
1057
|
} | undefined;
|
|
1058
|
+
multiAccount?: {
|
|
1059
|
+
enable?: boolean | undefined;
|
|
1060
|
+
maxAccountsPerToolkit?: number | undefined;
|
|
1061
|
+
requireExplicitSelection?: boolean | undefined;
|
|
1062
|
+
} | undefined;
|
|
980
1063
|
experimental?: {
|
|
981
1064
|
assistivePrompt?: {
|
|
982
1065
|
userTimezone?: string | undefined;
|
|
@@ -1000,6 +1083,10 @@ declare const ToolRouterCreateSessionConfigSchema: z.ZodObject<{
|
|
|
1000
1083
|
* @param {boolean} [workbench.enable] - Whether to enable the workbench entirely. Defaults to true. When false, no code execution tools are available.
|
|
1001
1084
|
* @param {boolean} [workbench.enableProxyExecution] - Whether to enable proxy execution
|
|
1002
1085
|
* @param {number} [workbench.autoOffloadThreshold] - Auto offload threshold in characters for moving execution to workbench
|
|
1086
|
+
* @param {object} [multiAccount] - Multi-account configuration for this session
|
|
1087
|
+
* @param {boolean} [multiAccount.enable] - When true, enables multi-account mode. Falls back to org/project-level config when not set.
|
|
1088
|
+
* @param {number} [multiAccount.maxAccountsPerToolkit] - Max connected accounts per toolkit (2-10, default 5)
|
|
1089
|
+
* @param {boolean} [multiAccount.requireExplicitSelection] - When true, require explicit account selection when multiple accounts are connected
|
|
1003
1090
|
*/
|
|
1004
1091
|
type ToolRouterCreateSessionConfig = z.infer<typeof ToolRouterCreateSessionConfigSchema>;
|
|
1005
1092
|
declare const ToolkitConnectionStateSchema: z.ZodObject<{
|
|
@@ -1341,20 +1428,20 @@ declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
|
|
|
1341
1428
|
}, {
|
|
1342
1429
|
toolSlugs: string[];
|
|
1343
1430
|
}>;
|
|
1344
|
-
message: z.ZodString
|
|
1431
|
+
message: z.ZodOptional<z.ZodString>;
|
|
1345
1432
|
tool: z.ZodLiteral<"COMPOSIO_GET_TOOL_SCHEMAS">;
|
|
1346
1433
|
}, "strip", z.ZodTypeAny, {
|
|
1347
|
-
message: string;
|
|
1348
1434
|
args: {
|
|
1349
1435
|
toolSlugs: string[];
|
|
1350
1436
|
};
|
|
1351
1437
|
tool: "COMPOSIO_GET_TOOL_SCHEMAS";
|
|
1438
|
+
message?: string | undefined;
|
|
1352
1439
|
}, {
|
|
1353
|
-
message: string;
|
|
1354
1440
|
args: {
|
|
1355
1441
|
toolSlugs: string[];
|
|
1356
1442
|
};
|
|
1357
1443
|
tool: "COMPOSIO_GET_TOOL_SCHEMAS";
|
|
1444
|
+
message?: string | undefined;
|
|
1358
1445
|
}>>;
|
|
1359
1446
|
}, "strip", z.ZodTypeAny, {
|
|
1360
1447
|
toolkit: string;
|
|
@@ -1364,11 +1451,11 @@ declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
|
|
|
1364
1451
|
inputSchema?: Record<string, unknown> | undefined;
|
|
1365
1452
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1366
1453
|
schemaRef?: {
|
|
1367
|
-
message: string;
|
|
1368
1454
|
args: {
|
|
1369
1455
|
toolSlugs: string[];
|
|
1370
1456
|
};
|
|
1371
1457
|
tool: "COMPOSIO_GET_TOOL_SCHEMAS";
|
|
1458
|
+
message?: string | undefined;
|
|
1372
1459
|
} | undefined;
|
|
1373
1460
|
}, {
|
|
1374
1461
|
toolkit: string;
|
|
@@ -1378,11 +1465,11 @@ declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
|
|
|
1378
1465
|
inputSchema?: Record<string, unknown> | undefined;
|
|
1379
1466
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1380
1467
|
schemaRef?: {
|
|
1381
|
-
message: string;
|
|
1382
1468
|
args: {
|
|
1383
1469
|
toolSlugs: string[];
|
|
1384
1470
|
};
|
|
1385
1471
|
tool: "COMPOSIO_GET_TOOL_SCHEMAS";
|
|
1472
|
+
message?: string | undefined;
|
|
1386
1473
|
} | undefined;
|
|
1387
1474
|
}>>;
|
|
1388
1475
|
toolkitConnectionStatuses: z.ZodArray<z.ZodObject<{
|
|
@@ -1463,11 +1550,11 @@ declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
|
|
|
1463
1550
|
inputSchema?: Record<string, unknown> | undefined;
|
|
1464
1551
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1465
1552
|
schemaRef?: {
|
|
1466
|
-
message: string;
|
|
1467
1553
|
args: {
|
|
1468
1554
|
toolSlugs: string[];
|
|
1469
1555
|
};
|
|
1470
1556
|
tool: "COMPOSIO_GET_TOOL_SCHEMAS";
|
|
1557
|
+
message?: string | undefined;
|
|
1471
1558
|
} | undefined;
|
|
1472
1559
|
}>;
|
|
1473
1560
|
toolkitConnectionStatuses: {
|
|
@@ -1518,11 +1605,11 @@ declare const ToolRouterSessionSearchResponseSchema: z.ZodObject<{
|
|
|
1518
1605
|
inputSchema?: Record<string, unknown> | undefined;
|
|
1519
1606
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1520
1607
|
schemaRef?: {
|
|
1521
|
-
message: string;
|
|
1522
1608
|
args: {
|
|
1523
1609
|
toolSlugs: string[];
|
|
1524
1610
|
};
|
|
1525
1611
|
tool: "COMPOSIO_GET_TOOL_SCHEMAS";
|
|
1612
|
+
message?: string | undefined;
|
|
1526
1613
|
} | undefined;
|
|
1527
1614
|
}>;
|
|
1528
1615
|
toolkitConnectionStatuses: {
|
|
@@ -1709,8 +1796,8 @@ interface ExecuteMetadata {
|
|
|
1709
1796
|
interface SessionContext {
|
|
1710
1797
|
/** The user ID for this session */
|
|
1711
1798
|
readonly userId: string;
|
|
1712
|
-
/** Execute any Composio native tool from within a custom tool */
|
|
1713
|
-
execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<
|
|
1799
|
+
/** Execute any Composio native tool from within a custom tool. Returns the same shape as session.execute(). */
|
|
1800
|
+
execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<ToolRouterSessionExecuteResponse>;
|
|
1714
1801
|
/** Proxy API calls through Composio's auth layer (resolved from session toolkit). */
|
|
1715
1802
|
proxyExecute(params: SessionProxyExecuteParams): Promise<ToolRouterSessionProxyExecuteResponse>;
|
|
1716
1803
|
}
|
|
@@ -1857,4 +1944,4 @@ type CustomToolResponse = SessionCreateResponse.Experimental.CustomTool;
|
|
|
1857
1944
|
/** Custom toolkit as returned in the session create response (has prefixed slugs + original_slugs). */
|
|
1858
1945
|
type CustomToolkitResponse = SessionCreateResponse.Experimental.CustomToolkit;
|
|
1859
1946
|
//#endregion
|
|
1860
|
-
export { ToolRouterToolkitsFn as $, ToolRouterAuthorizeFn as A, ConnectedAccountListParamsSchema as At, ToolRouterManageConnectionsConfigSchema as B, ConnectedAccountStatusSchema as Bt, SessionContext as C, ToolRouterSessionFilesMountUploadOptions as Ct, SessionExperimental as D, ConnectedAccountAuthConfig as Dt, Session as E, ConnectionRequestState as Et, ToolRouterConfigToolsSchema as F, ConnectedAccountRefreshOptionsSchema as Ft, ToolRouterSessionProxyExecuteResponse as G, CreateConnectedAccountLinkResponseSchema as Gt, ToolRouterSessionExecuteResponse as H, CreateConnectedAccountLinkOptions as Ht, ToolRouterCreateSessionConfig as I, ConnectedAccountRetrieveResponse as It, ToolRouterSessionSearchResponseSchema as J, CreateConnectedAccountParams as Jt, ToolRouterSessionSearchFn as K, CreateConnectedAccountOptions as Kt, ToolRouterCreateSessionConfigSchema as L, ConnectedAccountRetrieveResponseSchema as Lt, ToolRouterConfigTags as M, ConnectedAccountListResponseItem as Mt, ToolRouterConfigTagsSchema as N, ConnectedAccountListResponseSchema as Nt, SessionProxyExecuteParams as O, ConnectedAccountAuthConfigSchema as Ot, ToolRouterConfigTools as P, ConnectedAccountRefreshOptions as Pt, ToolRouterToolkitsEnabledConfigSchema as Q, DefaultCreateConnectedAccountParamsSchema as Qt, ToolRouterMCPServerConfig as R, ConnectedAccountStatus as Rt, RegisteredCustomToolkit as S, ToolRouterSessionFilesMountListOptionsSchema as St, MCPServerTypeSchema as T, ConnectionRequest as Tt, ToolRouterSessionExecuteResponseSchema as U, CreateConnectedAccountLinkOptionsSchema as Ut, ToolRouterSessionExecuteFn as V, ConnectedAccountStatuses as Vt, ToolRouterSessionProxyExecuteFn as W, CreateConnectedAccountLinkResponse as Wt, ToolRouterTagsParamSchema as X, CreateConnectedAccountResponse as Xt, ToolRouterTagsEnableDisableSchema as Y, CreateConnectedAccountParamsSchema as Yt, ToolRouterToolkitsDisabledConfigSchema as Z, CreateConnectedAccountResponseSchema as Zt, CustomToolsMap as _, ToolRouterSessionFilesMountDeleteOptions as _t, CustomTool as a, ToolRouterToolsParamSchema as at, InputParamsSchema as b, ToolRouterSessionFilesMountDownloadOptionsSchema as bt, CustomToolInputParameter as c, ToolkitConnectionsDetails as ct, CustomToolRegistryItem as d, FileDeleteResponse as dt, ToolRouterToolkitsOptions as et, CustomToolResponse as f, FileDeleteResponseSchema as ft, CustomToolkitResponse as g, RemoteFileDataSchema as gt, CustomToolkitDefinition as h, RemoteFileData as ht, CreateCustomToolkitParams as i, ToolRouterToolsParam as it, ToolRouterConfigManageConnectionsSchema as j, ConnectedAccountListResponse as jt, SessionProxyExecuteParamsSchema as k, ConnectedAccountListParams as kt, CustomToolOptions as l, ToolkitConnectionsDetailsSchema as lt, CustomToolkit as m, FileListResponseSchema as mt, CreateCustomToolParams as n, ToolRouterToolkitsParamSchema as nt, CustomToolDefinition as o, ToolkitConnectionState as ot, CustomToolSlugSchema as p, FileListResponse as pt, ToolRouterSessionSearchResponse as q, CreateConnectedAccountOptionsSchema as qt, CreateCustomToolkitBaseSchema as r, ToolRouterToolsFn as rt, CustomToolExecuteFn as s, ToolkitConnectionStateSchema as st, CreateCustomToolBaseSchema as t, ToolRouterToolkitsOptionsSchema as tt, CustomToolRegistry as u, RemoteFile as ut, CustomToolsMapEntry as v, ToolRouterSessionFilesMountDeleteOptionsSchema as vt, MCPServerType as w, ToolRouterSessionFilesMountUploadOptionsSchema as wt, RegisteredCustomTool as x, ToolRouterSessionFilesMountListOptions as xt, ExecuteMetadata as y, ToolRouterSessionFilesMountDownloadOptions as yt, ToolRouterMCPServerConfigSchema as z, ConnectedAccountStatusEnum as zt };
|
|
1947
|
+
export { ToolRouterToolkitsFn as $, UpdateConnectedAccountParams as $t, ToolRouterAuthorizeFn as A, ConnectedAccountListParamsSchema as At, ToolRouterManageConnectionsConfigSchema as B, ConnectedAccountStatusSchema as Bt, SessionContext as C, ToolRouterSessionFilesMountUploadOptions as Ct, SessionExperimental as D, ConnectedAccountAuthConfig as Dt, Session as E, ConnectionRequestState as Et, ToolRouterConfigToolsSchema as F, ConnectedAccountRefreshOptionsSchema as Ft, ToolRouterSessionProxyExecuteResponse as G, CreateConnectedAccountLinkResponseSchema as Gt, ToolRouterSessionExecuteResponse as H, CreateConnectedAccountLinkOptions as Ht, ToolRouterCreateSessionConfig as I, ConnectedAccountRetrieveResponse as It, ToolRouterSessionSearchResponseSchema as J, CreateConnectedAccountParams as Jt, ToolRouterSessionSearchFn as K, CreateConnectedAccountOptions as Kt, ToolRouterCreateSessionConfigSchema as L, ConnectedAccountRetrieveResponseSchema as Lt, ToolRouterConfigTags as M, ConnectedAccountListResponseItem as Mt, ToolRouterConfigTagsSchema as N, ConnectedAccountListResponseSchema as Nt, SessionProxyExecuteParams as O, ConnectedAccountAuthConfigSchema as Ot, ToolRouterConfigTools as P, ConnectedAccountRefreshOptions as Pt, ToolRouterToolkitsEnabledConfigSchema as Q, DefaultCreateConnectedAccountParamsSchema as Qt, ToolRouterMCPServerConfig as R, ConnectedAccountStatus as Rt, RegisteredCustomToolkit as S, ToolRouterSessionFilesMountListOptionsSchema as St, MCPServerTypeSchema as T, ConnectionRequest as Tt, ToolRouterSessionExecuteResponseSchema as U, CreateConnectedAccountLinkOptionsSchema as Ut, ToolRouterSessionExecuteFn as V, ConnectedAccountStatuses as Vt, ToolRouterSessionProxyExecuteFn as W, CreateConnectedAccountLinkResponse as Wt, ToolRouterTagsParamSchema as X, CreateConnectedAccountResponse as Xt, ToolRouterTagsEnableDisableSchema as Y, CreateConnectedAccountParamsSchema as Yt, ToolRouterToolkitsDisabledConfigSchema as Z, CreateConnectedAccountResponseSchema as Zt, CustomToolsMap as _, ToolRouterSessionFilesMountDeleteOptions as _t, CustomTool as a, ToolRouterToolsParamSchema as at, InputParamsSchema as b, ToolRouterSessionFilesMountDownloadOptionsSchema as bt, CustomToolInputParameter as c, ToolkitConnectionsDetails as ct, CustomToolRegistryItem as d, FileDeleteResponse as dt, UpdateConnectedAccountParamsSchema as en, ToolRouterToolkitsOptions as et, CustomToolResponse as f, FileDeleteResponseSchema as ft, CustomToolkitResponse as g, RemoteFileDataSchema as gt, CustomToolkitDefinition as h, RemoteFileData as ht, CreateCustomToolkitParams as i, ToolRouterToolsParam as it, ToolRouterConfigManageConnectionsSchema as j, ConnectedAccountListResponse as jt, SessionProxyExecuteParamsSchema as k, ConnectedAccountListParams as kt, CustomToolOptions as l, ToolkitConnectionsDetailsSchema as lt, CustomToolkit as m, FileListResponseSchema as mt, CreateCustomToolParams as n, ToolRouterToolkitsParamSchema as nt, CustomToolDefinition as o, ToolkitConnectionState as ot, CustomToolSlugSchema as p, FileListResponse as pt, ToolRouterSessionSearchResponse as q, CreateConnectedAccountOptionsSchema as qt, CreateCustomToolkitBaseSchema as r, ToolRouterToolsFn as rt, CustomToolExecuteFn as s, ToolkitConnectionStateSchema as st, CreateCustomToolBaseSchema as t, ToolRouterToolkitsOptionsSchema as tt, CustomToolRegistry as u, RemoteFile as ut, CustomToolsMapEntry as v, ToolRouterSessionFilesMountDeleteOptionsSchema as vt, MCPServerType as w, ToolRouterSessionFilesMountUploadOptionsSchema as wt, RegisteredCustomTool as x, ToolRouterSessionFilesMountListOptions as xt, ExecuteMetadata as y, ToolRouterSessionFilesMountDownloadOptions as yt, ToolRouterMCPServerConfigSchema as z, ConnectedAccountStatusEnum as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require('../ComposioError-CYaI68Mo.cjs');
|
|
2
|
-
const require_CustomTool = require('../CustomTool-
|
|
2
|
+
const require_CustomTool = require('../CustomTool-Cyo1aJ2l.cjs');
|
|
3
3
|
|
|
4
4
|
exports.experimental_createTool = require_CustomTool.createCustomTool;
|
|
5
5
|
exports.experimental_createToolkit = require_CustomTool.createCustomToolkit;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-
|
|
2
|
-
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-
|
|
1
|
+
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-DIvgAKNO.cjs";
|
|
2
|
+
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-B0ssIcQn.cjs";
|
|
3
3
|
export { type CreateCustomToolParams, type CreateCustomToolkitParams, type CustomTool, type CustomToolExecuteFn, type CustomToolkit, type SessionContext, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../tool.types-bencsexi.mjs";
|
|
2
|
-
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-
|
|
3
|
-
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-
|
|
2
|
+
import { C as SessionContext, a as CustomTool, i as CreateCustomToolkitParams, m as CustomToolkit, n as CreateCustomToolParams, s as CustomToolExecuteFn } from "../customTool.types-jiqAXiST.mjs";
|
|
3
|
+
import { n as createCustomToolkit, t as createCustomTool } from "../CustomTool-CaO_eE3G.mjs";
|
|
4
4
|
export { type CreateCustomToolParams, type CreateCustomToolkitParams, type CustomTool, type CustomToolExecuteFn, type CustomToolkit, type SessionContext, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-CWQeghP5.mjs";
|
|
2
2
|
import "../ComposioError-ChkSdxqU.mjs";
|
|
3
|
-
import { n as createCustomTool, r as createCustomToolkit } from "../CustomTool-
|
|
3
|
+
import { n as createCustomTool, r as createCustomToolkit } from "../CustomTool-AYNimqhf.mjs";
|
|
4
4
|
|
|
5
5
|
export { createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CQwRTUmo.cjs');
|
|
2
2
|
const require_ComposioError = require('./ComposioError-CYaI68Mo.cjs');
|
|
3
|
-
const require_CustomTool = require('./CustomTool-
|
|
3
|
+
const require_CustomTool = require('./CustomTool-Cyo1aJ2l.cjs');
|
|
4
4
|
const require_Telemetry = require('./Telemetry-A89k5RTv.cjs');
|
|
5
5
|
const require_buffer = require('./buffer-BjWptbNH.cjs');
|
|
6
6
|
let _composio_client = require("@composio/client");
|
|
@@ -1040,13 +1040,15 @@ const DefaultCreateConnectedAccountParamsSchema = zod_v3.z.object({
|
|
|
1040
1040
|
state: ConnectionDataSchema.optional(),
|
|
1041
1041
|
data: zod_v3.z.record(zod_v3.z.string(), zod_v3.z.unknown()).optional(),
|
|
1042
1042
|
callback_url: zod_v3.z.string().optional(),
|
|
1043
|
-
user_id: zod_v3.z.string().optional()
|
|
1043
|
+
user_id: zod_v3.z.string().optional(),
|
|
1044
|
+
alias: zod_v3.z.string().optional()
|
|
1044
1045
|
})
|
|
1045
1046
|
});
|
|
1046
1047
|
const CreateConnectedAccountOptionsSchema = zod_v3.z.object({
|
|
1047
1048
|
allowMultiple: zod_v3.z.boolean().optional(),
|
|
1048
1049
|
callbackUrl: zod_v3.z.string().optional(),
|
|
1049
|
-
config: ConnectionDataSchema.optional()
|
|
1050
|
+
config: ConnectionDataSchema.optional(),
|
|
1051
|
+
alias: zod_v3.z.string().optional()
|
|
1050
1052
|
});
|
|
1051
1053
|
/**
|
|
1052
1054
|
* Connected Account create response
|
|
@@ -1065,6 +1067,8 @@ const ConnectedAccountAuthConfigSchema = zod_v3.z.object({
|
|
|
1065
1067
|
const ConnectedAccountRetrieveResponseSchema = zod_v3.z.object({
|
|
1066
1068
|
id: zod_v3.z.string(),
|
|
1067
1069
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
1070
|
+
wordId: zod_v3.z.string().nullable().optional(),
|
|
1071
|
+
alias: zod_v3.z.string().nullable().optional(),
|
|
1068
1072
|
data: zod_v3.z.record(zod_v3.z.string(), zod_v3.z.unknown()).optional(),
|
|
1069
1073
|
params: zod_v3.z.record(zod_v3.z.string(), zod_v3.z.unknown()).optional(),
|
|
1070
1074
|
status: ConnectedAccountStatusSchema,
|
|
@@ -1090,12 +1094,29 @@ const ConnectedAccountListResponseSchema = zod_v3.z.object({
|
|
|
1090
1094
|
nextCursor: zod_v3.z.string().nullish().describe("The next cursor to paginate through the connected accounts"),
|
|
1091
1095
|
totalPages: zod_v3.z.number().describe("The total number of pages of connected accounts")
|
|
1092
1096
|
});
|
|
1093
|
-
const CreateConnectedAccountLinkOptionsSchema = zod_v3.z.object({
|
|
1097
|
+
const CreateConnectedAccountLinkOptionsSchema = zod_v3.z.object({
|
|
1098
|
+
callbackUrl: zod_v3.z.string().optional(),
|
|
1099
|
+
alias: zod_v3.z.string().optional()
|
|
1100
|
+
});
|
|
1094
1101
|
const CreateConnectedAccountLinkResponseSchema = zod_v3.z.object({ redirectUrl: zod_v3.z.string() });
|
|
1095
1102
|
const ConnectedAccountRefreshOptionsSchema = zod_v3.z.object({
|
|
1096
1103
|
redirectUrl: zod_v3.z.string().optional(),
|
|
1097
1104
|
validateCredentials: zod_v3.z.boolean().optional()
|
|
1098
1105
|
});
|
|
1106
|
+
const UpdateConnectedAccountParamsSchema = zod_v3.z.object({
|
|
1107
|
+
alias: zod_v3.z.string().optional(),
|
|
1108
|
+
connection: zod_v3.z.object({ state: zod_v3.z.object({
|
|
1109
|
+
authScheme: zod_v3.z.enum([
|
|
1110
|
+
"BEARER_TOKEN",
|
|
1111
|
+
"API_KEY",
|
|
1112
|
+
"BASIC",
|
|
1113
|
+
"BASIC_WITH_JWT",
|
|
1114
|
+
"GOOGLE_SERVICE_ACCOUNT",
|
|
1115
|
+
"SERVICE_ACCOUNT"
|
|
1116
|
+
]),
|
|
1117
|
+
val: zod_v3.z.record(zod_v3.z.unknown())
|
|
1118
|
+
}) }).optional()
|
|
1119
|
+
});
|
|
1099
1120
|
|
|
1100
1121
|
//#endregion
|
|
1101
1122
|
//#region src/utils/transform.ts
|
|
@@ -1130,6 +1151,7 @@ function transform(raw) {
|
|
|
1130
1151
|
* @private
|
|
1131
1152
|
*/
|
|
1132
1153
|
function transformConnectedAccountResponse(response) {
|
|
1154
|
+
const responseWithLabels = response;
|
|
1133
1155
|
const parseState = (state) => {
|
|
1134
1156
|
try {
|
|
1135
1157
|
return state ? ConnectionDataSchema.parse(state) : void 0;
|
|
@@ -1147,6 +1169,8 @@ function transformConnectedAccountResponse(response) {
|
|
|
1147
1169
|
isComposioManaged: response$1.auth_config.is_composio_managed,
|
|
1148
1170
|
isDisabled: response$1.auth_config.is_disabled
|
|
1149
1171
|
},
|
|
1172
|
+
wordId: responseWithLabels.word_id ?? null,
|
|
1173
|
+
alias: responseWithLabels.alias ?? null,
|
|
1150
1174
|
data: response$1.data ?? void 0,
|
|
1151
1175
|
state: parseState(response$1.state),
|
|
1152
1176
|
status: response$1.status,
|
|
@@ -1827,7 +1851,11 @@ var Tools = class {
|
|
|
1827
1851
|
const result = await this.client.tools.execute(tool.slug, {
|
|
1828
1852
|
allow_tracing: body.allowTracing,
|
|
1829
1853
|
connected_account_id: body.connectedAccountId,
|
|
1830
|
-
custom_auth_params: body.customAuthParams
|
|
1854
|
+
custom_auth_params: body.customAuthParams ? {
|
|
1855
|
+
base_url: body.customAuthParams.baseURL,
|
|
1856
|
+
body: body.customAuthParams.body,
|
|
1857
|
+
parameters: body.customAuthParams.parameters
|
|
1858
|
+
} : void 0,
|
|
1831
1859
|
custom_connection_data: body.customConnectionData,
|
|
1832
1860
|
arguments: body.arguments,
|
|
1833
1861
|
user_id: body.userId,
|
|
@@ -2739,14 +2767,16 @@ var ConnectedAccounts = class {
|
|
|
2739
2767
|
if (connectedAccount.items.length > 0 && !options?.allowMultiple) throw new require_CustomTool.ComposioMultipleConnectedAccountsError(`Multiple connected accounts found for user ${userId} in auth config ${authConfigId}. Please use the allowMultiple option to allow multiple connected accounts.`);
|
|
2740
2768
|
else if (connectedAccount.items.length > 0) require_ComposioError.logger_default.warn(`[Warn:AllowMultiple] Multiple connected accounts found for user ${userId} in auth config ${authConfigId}`);
|
|
2741
2769
|
const state = options?.config ?? void 0;
|
|
2742
|
-
const
|
|
2770
|
+
const createParams = {
|
|
2743
2771
|
auth_config: { id: authConfigId },
|
|
2744
2772
|
connection: {
|
|
2745
2773
|
callback_url: options?.callbackUrl,
|
|
2746
2774
|
user_id: userId,
|
|
2747
|
-
state
|
|
2775
|
+
state,
|
|
2776
|
+
...options?.alias != null && { alias: options.alias }
|
|
2748
2777
|
}
|
|
2749
|
-
}
|
|
2778
|
+
};
|
|
2779
|
+
const response = await this.client.connectedAccounts.create(createParams);
|
|
2750
2780
|
const redirectUrl = typeof response.connectionData?.val?.redirectUrl === "string" ? response.connectionData.val.redirectUrl : null;
|
|
2751
2781
|
return createConnectionRequest(this.client, response.id, response.connectionData.val.status, redirectUrl);
|
|
2752
2782
|
}
|
|
@@ -2792,7 +2822,8 @@ var ConnectedAccounts = class {
|
|
|
2792
2822
|
const response = await this.client.link.create({
|
|
2793
2823
|
auth_config_id: authConfigId,
|
|
2794
2824
|
user_id: userId,
|
|
2795
|
-
...requestOptions?.data.callbackUrl && { callback_url: requestOptions.data.callbackUrl }
|
|
2825
|
+
...requestOptions?.data.callbackUrl && { callback_url: requestOptions.data.callbackUrl },
|
|
2826
|
+
...requestOptions?.data.alias != null && { alias: requestOptions.data.alias }
|
|
2796
2827
|
});
|
|
2797
2828
|
return createConnectionRequest(this.client, response.connected_account_id, ConnectedAccountStatuses.INITIATED, response.redirect_url);
|
|
2798
2829
|
} catch (error) {
|
|
@@ -2951,6 +2982,34 @@ var ConnectedAccounts = class {
|
|
|
2951
2982
|
async disable(nanoid) {
|
|
2952
2983
|
return this.client.connectedAccounts.updateStatus(nanoid, { enabled: false });
|
|
2953
2984
|
}
|
|
2985
|
+
/**
|
|
2986
|
+
* Update a connected account's alias and/or credentials.
|
|
2987
|
+
*
|
|
2988
|
+
* @param {string} nanoid - The unique identifier of the connected account
|
|
2989
|
+
* @param {UpdateConnectedAccountParams} params - The update parameters
|
|
2990
|
+
* @returns {Promise<ConnectedAccountPatchResponse>} The update response
|
|
2991
|
+
*
|
|
2992
|
+
* @example
|
|
2993
|
+
* ```typescript
|
|
2994
|
+
* // Set an alias
|
|
2995
|
+
* await composio.connectedAccounts.update('ca_abc123', { alias: 'work-gmail' });
|
|
2996
|
+
*
|
|
2997
|
+
* // Update credentials
|
|
2998
|
+
* await composio.connectedAccounts.update('ca_abc123', {
|
|
2999
|
+
* connection: {
|
|
3000
|
+
* state: {
|
|
3001
|
+
* authScheme: 'BEARER_TOKEN',
|
|
3002
|
+
* val: { token: 'new-access-token' },
|
|
3003
|
+
* },
|
|
3004
|
+
* },
|
|
3005
|
+
* });
|
|
3006
|
+
* ```
|
|
3007
|
+
*/
|
|
3008
|
+
async update(nanoid, params) {
|
|
3009
|
+
const parsedParams = UpdateConnectedAccountParamsSchema.safeParse(params);
|
|
3010
|
+
if (!parsedParams.success) throw new require_CustomTool.ValidationError("Failed to parse connected account update params", { cause: parsedParams.error });
|
|
3011
|
+
return this.client.connectedAccounts.patch(nanoid, parsedParams.data);
|
|
3012
|
+
}
|
|
2954
3013
|
};
|
|
2955
3014
|
|
|
2956
3015
|
//#endregion
|
|
@@ -5259,7 +5318,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
5259
5318
|
|
|
5260
5319
|
//#endregion
|
|
5261
5320
|
//#region package.json
|
|
5262
|
-
var version = "0.6.
|
|
5321
|
+
var version = "0.6.9";
|
|
5263
5322
|
|
|
5264
5323
|
//#endregion
|
|
5265
5324
|
//#region src/utils/session.ts
|
|
@@ -5380,6 +5439,11 @@ const ToolRouterCreateSessionConfigSchema = zod_v3.default.object({
|
|
|
5380
5439
|
enableProxyExecution: zod_v3.default.boolean().optional().describe("Whether to enable proxy execution in the tool router session"),
|
|
5381
5440
|
autoOffloadThreshold: zod_v3.default.number().optional().describe("The auto offload threshold in characters for the tool execution to be moved into workbench")
|
|
5382
5441
|
}).optional().describe("The workbench config for the tool router session"),
|
|
5442
|
+
multiAccount: zod_v3.default.object({
|
|
5443
|
+
enable: zod_v3.default.boolean().default(false).describe("When true, enables multi-account mode for this session. Defaults to false."),
|
|
5444
|
+
maxAccountsPerToolkit: zod_v3.default.number().int().min(2).max(10).optional().describe("Maximum number of connected accounts allowed per toolkit. Defaults to 5 when multi-account is enabled."),
|
|
5445
|
+
requireExplicitSelection: zod_v3.default.boolean().optional().describe("When true, require explicit account selection when multiple accounts are connected. When false (default), use the first/default account.")
|
|
5446
|
+
}).optional().describe("Multi-account configuration for this session"),
|
|
5383
5447
|
experimental: zod_v3.default.object({
|
|
5384
5448
|
assistivePrompt: zod_v3.default.object({ userTimezone: zod_v3.default.string().optional().describe("IANA timezone identifier (e.g., \"America/New_York\", \"Europe/London\") for timezone-aware assistive prompts") }).optional().describe("Configuration for assistive prompt generation"),
|
|
5385
5449
|
customTools: zod_v3.default.array(zod_v3.default.custom()).optional().describe("Custom tools to include in this session. Created via createCustomTool() from @composio/core/experimental."),
|
|
@@ -5452,7 +5516,7 @@ const ToolRouterSessionSearchTimeInfoSchema = zod_v3.default.object({
|
|
|
5452
5516
|
});
|
|
5453
5517
|
const ToolRouterSessionSearchToolSchemasSchemaRefSchema = zod_v3.default.object({
|
|
5454
5518
|
args: zod_v3.default.object({ toolSlugs: zod_v3.default.array(zod_v3.default.string()) }),
|
|
5455
|
-
message: zod_v3.default.string(),
|
|
5519
|
+
message: zod_v3.default.string().optional(),
|
|
5456
5520
|
tool: zod_v3.default.literal("COMPOSIO_GET_TOOL_SCHEMAS")
|
|
5457
5521
|
});
|
|
5458
5522
|
const ToolRouterSessionSearchToolSchemaSchema = zod_v3.default.object({
|
|
@@ -5555,6 +5619,16 @@ const transformToolRouterWorkbenchParams = (params) => {
|
|
|
5555
5619
|
auto_offload_threshold: params.autoOffloadThreshold
|
|
5556
5620
|
};
|
|
5557
5621
|
};
|
|
5622
|
+
const transformToolRouterMultiAccountParams = (params) => {
|
|
5623
|
+
if (!params) return;
|
|
5624
|
+
const transformedParams = {
|
|
5625
|
+
enable: params.enable,
|
|
5626
|
+
max_accounts_per_toolkit: params.maxAccountsPerToolkit,
|
|
5627
|
+
require_explicit_selection: params.requireExplicitSelection
|
|
5628
|
+
};
|
|
5629
|
+
if (transformedParams.enable === void 0 && transformedParams.max_accounts_per_toolkit === void 0 && transformedParams.require_explicit_selection === void 0) return;
|
|
5630
|
+
return transformedParams;
|
|
5631
|
+
};
|
|
5558
5632
|
const transformToolRouterToolkitsParams = (params) => {
|
|
5559
5633
|
if (!params) return;
|
|
5560
5634
|
if (Array.isArray(params)) return { enable: params };
|
|
@@ -6208,19 +6282,24 @@ var SessionContextImpl = class {
|
|
|
6208
6282
|
* Execute any tool from within a custom tool.
|
|
6209
6283
|
* Routes to sibling local tools in-process when available,
|
|
6210
6284
|
* otherwise delegates to the backend API.
|
|
6285
|
+
*
|
|
6286
|
+
* Returns the same response shape as session.execute().
|
|
6211
6287
|
*/
|
|
6212
6288
|
async execute(toolSlug, arguments_) {
|
|
6213
6289
|
const entry = findCustomTool(this.customToolsMap, toolSlug);
|
|
6214
|
-
if (entry)
|
|
6290
|
+
if (entry) {
|
|
6291
|
+
const result = await executeCustomTool(entry, arguments_, this);
|
|
6292
|
+
return ToolRouterSessionExecuteResponseSchema.parse({
|
|
6293
|
+
data: result.data,
|
|
6294
|
+
error: result.error,
|
|
6295
|
+
logId: ""
|
|
6296
|
+
});
|
|
6297
|
+
}
|
|
6215
6298
|
const response = await this.client.toolRouter.session.execute(this.sessionId, {
|
|
6216
6299
|
tool_slug: toolSlug,
|
|
6217
6300
|
arguments: arguments_
|
|
6218
6301
|
});
|
|
6219
|
-
return
|
|
6220
|
-
data: response.data,
|
|
6221
|
-
error: response.error,
|
|
6222
|
-
successful: !response.error
|
|
6223
|
-
};
|
|
6302
|
+
return ToolRouterSessionExecuteResponseSchema.parse(transformExecuteResponse(response));
|
|
6224
6303
|
}
|
|
6225
6304
|
/**
|
|
6226
6305
|
* Proxy API calls through Composio's auth layer.
|
|
@@ -6342,8 +6421,9 @@ var ToolRouterSession = class {
|
|
|
6342
6421
|
*/
|
|
6343
6422
|
async authorize(toolkit, options) {
|
|
6344
6423
|
const response = await this.client.toolRouter.session.link(this.sessionId, {
|
|
6345
|
-
|
|
6346
|
-
|
|
6424
|
+
toolkit,
|
|
6425
|
+
...options?.callbackUrl && { callback_url: options.callbackUrl },
|
|
6426
|
+
...options?.alias != null && { alias: options.alias }
|
|
6347
6427
|
});
|
|
6348
6428
|
return createConnectionRequest(this.client, response.connected_account_id, ConnectedAccountStatuses.INITIATED, response.redirect_url);
|
|
6349
6429
|
}
|
|
@@ -6511,7 +6591,7 @@ var ToolRouterSession = class {
|
|
|
6511
6591
|
}
|
|
6512
6592
|
const [localResults, remoteResult] = await Promise.all([Promise.all(localPromises), remotePromise]);
|
|
6513
6593
|
if (remoteIndices.length === 0 && localResults.length === 1) return localResults[0].result;
|
|
6514
|
-
const remoteData = remoteResult?.data
|
|
6594
|
+
const remoteData = remoteResult?.data && typeof remoteResult.data === "object" && !Array.isArray(remoteResult.data) ? remoteResult.data : {};
|
|
6515
6595
|
const remoteResults = Array.isArray(remoteData.results) ? remoteData.results : [];
|
|
6516
6596
|
const localEntries = localResults.map(({ index, result }) => ({
|
|
6517
6597
|
response: {
|
|
@@ -6526,13 +6606,25 @@ var ToolRouterSession = class {
|
|
|
6526
6606
|
...entry,
|
|
6527
6607
|
index: i
|
|
6528
6608
|
}));
|
|
6529
|
-
const
|
|
6609
|
+
const failedCount = allResults.filter((r) => r.error).length;
|
|
6610
|
+
const mergedData = {
|
|
6611
|
+
...remoteData,
|
|
6612
|
+
results: allResults
|
|
6613
|
+
};
|
|
6614
|
+
if (localEntries.length > 0 && [
|
|
6615
|
+
"total_count",
|
|
6616
|
+
"success_count",
|
|
6617
|
+
"error_count"
|
|
6618
|
+
].some((key) => key in remoteData)) {
|
|
6619
|
+
mergedData.total_count = allResults.length;
|
|
6620
|
+
mergedData.success_count = allResults.length - failedCount;
|
|
6621
|
+
mergedData.error_count = failedCount;
|
|
6622
|
+
}
|
|
6623
|
+
const remoteError = typeof remoteResult?.error === "string" ? remoteResult.error : null;
|
|
6624
|
+
const hasAnyError = localResults.some((r) => r.result.error) || !!remoteError;
|
|
6530
6625
|
return {
|
|
6531
|
-
data:
|
|
6532
|
-
|
|
6533
|
-
results: allResults
|
|
6534
|
-
},
|
|
6535
|
-
error: hasAnyError ? `${allResults.filter((r) => r.error).length} out of ${allResults.length} tools failed` : null,
|
|
6626
|
+
data: mergedData,
|
|
6627
|
+
error: hasAnyError ? remoteError && failedCount === 0 ? remoteError : `${failedCount} out of ${allResults.length} tools failed` : null,
|
|
6536
6628
|
successful: !hasAnyError
|
|
6537
6629
|
};
|
|
6538
6630
|
}
|
|
@@ -6584,6 +6676,7 @@ var ToolRouter = class {
|
|
|
6584
6676
|
if (routerConfig.experimental?.assistivePrompt?.userTimezone) experimentalPayload.assistive_prompt_config = { user_timezone: routerConfig.experimental.assistivePrompt.userTimezone };
|
|
6585
6677
|
if (customTools?.length) experimentalPayload.custom_tools = require_CustomTool.serializeCustomTools(customTools);
|
|
6586
6678
|
if (customToolkits?.length) experimentalPayload.custom_toolkits = require_CustomTool.serializeCustomToolkits(customToolkits);
|
|
6679
|
+
const multiAccountPayload = transformToolRouterMultiAccountParams(routerConfig.multiAccount);
|
|
6587
6680
|
const payload = {
|
|
6588
6681
|
user_id: userId,
|
|
6589
6682
|
auth_configs: routerConfig.authConfigs,
|
|
@@ -6593,6 +6686,7 @@ var ToolRouter = class {
|
|
|
6593
6686
|
tags: transformToolRouterTagsParams(routerConfig.tags),
|
|
6594
6687
|
manage_connections: transformToolRouterManageConnectionsParams(routerConfig.manageConnections),
|
|
6595
6688
|
workbench: transformToolRouterWorkbenchParams(routerConfig.workbench),
|
|
6689
|
+
multi_account: multiAccountPayload,
|
|
6596
6690
|
experimental: Object.keys(experimentalPayload).length > 0 ? experimentalPayload : void 0
|
|
6597
6691
|
};
|
|
6598
6692
|
const session = await this.client.toolRouter.session.create(payload);
|
|
@@ -7622,6 +7716,7 @@ exports.TriggerSubscribeParamSchema = TriggerSubscribeParamSchema;
|
|
|
7622
7716
|
exports.TriggerTypeSchema = TriggerTypeSchema;
|
|
7623
7717
|
exports.TriggersTypeListParamsSchema = TriggersTypeListParamsSchema;
|
|
7624
7718
|
exports.TriggersTypeListResponseSchema = TriggersTypeListResponseSchema;
|
|
7719
|
+
exports.UpdateConnectedAccountParamsSchema = UpdateConnectedAccountParamsSchema;
|
|
7625
7720
|
exports.ValidationError = require_CustomTool.ValidationError;
|
|
7626
7721
|
exports.ValidationErrorCodes = require_CustomTool.ValidationErrorCodes;
|
|
7627
7722
|
exports.VerifyWebhookParamsSchema = VerifyWebhookParamsSchema;
|