@composio/core 0.13.0 → 0.13.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.
- package/dist/{CustomTool-Dmi6ti3I.d.mts → CustomTool-DLf7JeKt.d.mts} +1 -1
- package/dist/{CustomTool-DrJpOhY2.d.mts → CustomTool-NpHpqdnU.d.mts} +1 -1
- package/dist/{composio-vMwhASRc.d.mts → composio-BHSQwOUz.d.mts} +9 -41
- package/dist/{composio-DHIKRdeG.d.mts → composio-DfPD7BAi.d.mts} +252 -284
- package/dist/{customTool.types-DXin7Cfc.d.mts → customTool.types-9yFqPjdw.d.mts} +70 -17
- package/dist/{customTool.types-CKH2R2ia.d.mts → customTool.types-D-6YqFdW.d.mts} +117 -64
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +23 -0
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +24 -0
- package/dist/experimental/index.d.mts +2 -2
- package/dist/index.d.mts +13 -6
- package/dist/index.mjs +34 -2
- package/dist/{types-qTbYYBJw.d.mts → types-BJLCRj9q.d.mts} +1 -1
- package/dist/{types-D4Id3wXA.d.mts → types-CCh8qvui.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +1 -1
- package/src/lib/toolRouterSessionDelete.ts +30 -0
- package/src/models/ToolRouter.ts +15 -0
- package/src/models/ToolRouterSession.ts +12 -0
- package/src/types/toolRouter.types.ts +13 -0
- package/dist/BaseProvider-BBnsv9kS.d.mts +0 -29425
|
@@ -548,6 +548,45 @@ interface ConnectionRequest extends ConnectionRequestState {
|
|
|
548
548
|
toString: () => string;
|
|
549
549
|
}
|
|
550
550
|
//#endregion
|
|
551
|
+
//#region src/types/requestOptions.types.d.ts
|
|
552
|
+
/**
|
|
553
|
+
* Per-request transport options for cancelling an SDK call.
|
|
554
|
+
*
|
|
555
|
+
* For `tools.get` and `tools.execute`, pass `signal` directly in the
|
|
556
|
+
* options bag (3rd argument) alongside any modifiers or provider options.
|
|
557
|
+
* For other methods (e.g. `toolkits.get`, `authConfigs.list`), pass as a
|
|
558
|
+
* trailing argument. Forwarded to the underlying `@composio/client` request.
|
|
559
|
+
*
|
|
560
|
+
* If the underlying request is aborted via this signal, the SDK throws a
|
|
561
|
+
* {@link ComposioRequestCancelledError} so callers can `instanceof`-detect
|
|
562
|
+
* cancellation without unwrapping nested causes.
|
|
563
|
+
*
|
|
564
|
+
* @example Timeout after 5 seconds
|
|
565
|
+
* ```typescript
|
|
566
|
+
* await composio.tools.execute(
|
|
567
|
+
* 'HACKERNEWS_GET_FRONTPAGE',
|
|
568
|
+
* { userId: 'default', arguments: {} },
|
|
569
|
+
* { signal: AbortSignal.timeout(5_000) }
|
|
570
|
+
* );
|
|
571
|
+
* ```
|
|
572
|
+
*
|
|
573
|
+
* @example Combine signal with modifiers
|
|
574
|
+
* ```typescript
|
|
575
|
+
* await composio.tools.execute('TOOL', body, {
|
|
576
|
+
* signal: AbortSignal.timeout(10_000),
|
|
577
|
+
* beforeExecute: ({ params }) => params,
|
|
578
|
+
* });
|
|
579
|
+
* ```
|
|
580
|
+
*/
|
|
581
|
+
type ComposioRequestOptions = {
|
|
582
|
+
/**
|
|
583
|
+
* An `AbortSignal` used to cancel the in-flight HTTP request. When the
|
|
584
|
+
* signal aborts, the underlying fetch is aborted and the SDK throws a
|
|
585
|
+
* {@link ComposioRequestCancelledError} (subclass of {@link ComposioError}).
|
|
586
|
+
*/
|
|
587
|
+
signal?: AbortSignal;
|
|
588
|
+
};
|
|
589
|
+
//#endregion
|
|
551
590
|
//#region src/types/ToolRouterSessionFilesMount.types.d.ts
|
|
552
591
|
declare const ToolRouterSessionFilesMountListOptionsSchema: z$1.ZodObject<{
|
|
553
592
|
path: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -939,12 +978,12 @@ declare const ToolRouterConfigManageConnectionsSchema: z$1.ZodObject<{
|
|
|
939
978
|
callbackUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
940
979
|
waitForConnections: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
941
980
|
}, "strict", z$1.ZodTypeAny, {
|
|
942
|
-
enable?: boolean | undefined;
|
|
943
981
|
callbackUrl?: string | undefined;
|
|
982
|
+
enable?: boolean | undefined;
|
|
944
983
|
waitForConnections?: boolean | undefined;
|
|
945
984
|
}, {
|
|
946
|
-
enable?: boolean | undefined;
|
|
947
985
|
callbackUrl?: string | undefined;
|
|
986
|
+
enable?: boolean | undefined;
|
|
948
987
|
waitForConnections?: boolean | undefined;
|
|
949
988
|
}>;
|
|
950
989
|
declare const ToolRouterToolkitsParamSchema: z$1.ZodArray<z$1.ZodString, "many">;
|
|
@@ -969,8 +1008,8 @@ declare const ToolRouterManageConnectionsConfigSchema: z$1.ZodObject<{
|
|
|
969
1008
|
enable: boolean;
|
|
970
1009
|
callbackUrl?: string | undefined;
|
|
971
1010
|
}, {
|
|
972
|
-
enable?: boolean | undefined;
|
|
973
1011
|
callbackUrl?: string | undefined;
|
|
1012
|
+
enable?: boolean | undefined;
|
|
974
1013
|
}>;
|
|
975
1014
|
declare const ToolRouterTagsParamSchema: z$1.ZodArray<z$1.ZodEnum<["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"]>, "many">;
|
|
976
1015
|
declare const ToolRouterTagsEnableDisableSchema: z$1.ZodObject<{
|
|
@@ -1156,12 +1195,12 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodEffects
|
|
|
1156
1195
|
callbackUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
1157
1196
|
waitForConnections: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1158
1197
|
}, "strict", z$1.ZodTypeAny, {
|
|
1159
|
-
enable?: boolean | undefined;
|
|
1160
1198
|
callbackUrl?: string | undefined;
|
|
1199
|
+
enable?: boolean | undefined;
|
|
1161
1200
|
waitForConnections?: boolean | undefined;
|
|
1162
1201
|
}, {
|
|
1163
|
-
enable?: boolean | undefined;
|
|
1164
1202
|
callbackUrl?: string | undefined;
|
|
1203
|
+
enable?: boolean | undefined;
|
|
1165
1204
|
waitForConnections?: boolean | undefined;
|
|
1166
1205
|
}>]>>>>;
|
|
1167
1206
|
sandbox: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodObject<{
|
|
@@ -1267,8 +1306,8 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodEffects
|
|
|
1267
1306
|
mcp?: boolean | undefined;
|
|
1268
1307
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
1269
1308
|
manageConnections?: boolean | {
|
|
1270
|
-
enable?: boolean | undefined;
|
|
1271
1309
|
callbackUrl?: string | undefined;
|
|
1310
|
+
enable?: boolean | undefined;
|
|
1272
1311
|
waitForConnections?: boolean | undefined;
|
|
1273
1312
|
} | undefined;
|
|
1274
1313
|
sandbox?: {
|
|
@@ -1323,8 +1362,8 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodEffects
|
|
|
1323
1362
|
mcp?: boolean | undefined;
|
|
1324
1363
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
1325
1364
|
manageConnections?: boolean | {
|
|
1326
|
-
enable?: boolean | undefined;
|
|
1327
1365
|
callbackUrl?: string | undefined;
|
|
1366
|
+
enable?: boolean | undefined;
|
|
1328
1367
|
waitForConnections?: boolean | undefined;
|
|
1329
1368
|
} | undefined;
|
|
1330
1369
|
sandbox?: {
|
|
@@ -1379,8 +1418,8 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodEffects
|
|
|
1379
1418
|
mcp?: boolean | undefined;
|
|
1380
1419
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
1381
1420
|
manageConnections?: boolean | {
|
|
1382
|
-
enable?: boolean | undefined;
|
|
1383
1421
|
callbackUrl?: string | undefined;
|
|
1422
|
+
enable?: boolean | undefined;
|
|
1384
1423
|
waitForConnections?: boolean | undefined;
|
|
1385
1424
|
} | undefined;
|
|
1386
1425
|
sandbox?: {
|
|
@@ -1435,8 +1474,8 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodEffects
|
|
|
1435
1474
|
mcp?: boolean | undefined;
|
|
1436
1475
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
1437
1476
|
manageConnections?: boolean | {
|
|
1438
|
-
enable?: boolean | undefined;
|
|
1439
1477
|
callbackUrl?: string | undefined;
|
|
1478
|
+
enable?: boolean | undefined;
|
|
1440
1479
|
waitForConnections?: boolean | undefined;
|
|
1441
1480
|
} | undefined;
|
|
1442
1481
|
sandbox?: {
|
|
@@ -1491,8 +1530,8 @@ declare const ToolRouterCreateSessionConfigSchema: z$1.ZodEffects<z$1.ZodEffects
|
|
|
1491
1530
|
mcp?: boolean | undefined;
|
|
1492
1531
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
1493
1532
|
manageConnections?: boolean | {
|
|
1494
|
-
enable?: boolean | undefined;
|
|
1495
1533
|
callbackUrl?: string | undefined;
|
|
1534
|
+
enable?: boolean | undefined;
|
|
1496
1535
|
waitForConnections?: boolean | undefined;
|
|
1497
1536
|
} | undefined;
|
|
1498
1537
|
sandbox?: {
|
|
@@ -2284,12 +2323,12 @@ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<
|
|
|
2284
2323
|
callbackUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
2285
2324
|
waitForConnections: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2286
2325
|
}, "strict", z$1.ZodTypeAny, {
|
|
2287
|
-
enable?: boolean | undefined;
|
|
2288
2326
|
callbackUrl?: string | undefined;
|
|
2327
|
+
enable?: boolean | undefined;
|
|
2289
2328
|
waitForConnections?: boolean | undefined;
|
|
2290
2329
|
}, {
|
|
2291
|
-
enable?: boolean | undefined;
|
|
2292
2330
|
callbackUrl?: string | undefined;
|
|
2331
|
+
enable?: boolean | undefined;
|
|
2293
2332
|
waitForConnections?: boolean | undefined;
|
|
2294
2333
|
}>]>>>>;
|
|
2295
2334
|
sandbox: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
|
|
@@ -2370,8 +2409,8 @@ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<
|
|
|
2370
2409
|
authConfigs?: Record<string, string> | undefined;
|
|
2371
2410
|
connectedAccounts?: Record<string, string[]> | undefined;
|
|
2372
2411
|
manageConnections?: boolean | {
|
|
2373
|
-
enable?: boolean | undefined;
|
|
2374
2412
|
callbackUrl?: string | undefined;
|
|
2413
|
+
enable?: boolean | undefined;
|
|
2375
2414
|
waitForConnections?: boolean | undefined;
|
|
2376
2415
|
} | null | undefined;
|
|
2377
2416
|
sandbox?: {
|
|
@@ -2417,8 +2456,8 @@ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<
|
|
|
2417
2456
|
authConfigs?: Record<string, string> | undefined;
|
|
2418
2457
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
2419
2458
|
manageConnections?: boolean | {
|
|
2420
|
-
enable?: boolean | undefined;
|
|
2421
2459
|
callbackUrl?: string | undefined;
|
|
2460
|
+
enable?: boolean | undefined;
|
|
2422
2461
|
waitForConnections?: boolean | undefined;
|
|
2423
2462
|
} | null | undefined;
|
|
2424
2463
|
sandbox?: {
|
|
@@ -2464,8 +2503,8 @@ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<
|
|
|
2464
2503
|
authConfigs?: Record<string, string> | undefined;
|
|
2465
2504
|
connectedAccounts?: Record<string, string[]> | undefined;
|
|
2466
2505
|
manageConnections?: boolean | {
|
|
2467
|
-
enable?: boolean | undefined;
|
|
2468
2506
|
callbackUrl?: string | undefined;
|
|
2507
|
+
enable?: boolean | undefined;
|
|
2469
2508
|
waitForConnections?: boolean | undefined;
|
|
2470
2509
|
} | null | undefined;
|
|
2471
2510
|
sandbox?: {
|
|
@@ -2511,8 +2550,8 @@ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<
|
|
|
2511
2550
|
authConfigs?: Record<string, string> | undefined;
|
|
2512
2551
|
connectedAccounts?: Record<string, string | string[]> | undefined;
|
|
2513
2552
|
manageConnections?: boolean | {
|
|
2514
|
-
enable?: boolean | undefined;
|
|
2515
2553
|
callbackUrl?: string | undefined;
|
|
2554
|
+
enable?: boolean | undefined;
|
|
2516
2555
|
waitForConnections?: boolean | undefined;
|
|
2517
2556
|
} | null | undefined;
|
|
2518
2557
|
sandbox?: {
|
|
@@ -2535,6 +2574,18 @@ declare const ToolRouterUpdateSessionConfigSchema: z$1.ZodEffects<z$1.ZodObject<
|
|
|
2535
2574
|
}>;
|
|
2536
2575
|
type ToolRouterUpdateSessionConfig = z$1.infer<typeof ToolRouterUpdateSessionConfigSchema>;
|
|
2537
2576
|
type ToolRouterSessionUpdateFn = (config: ToolRouterUpdateSessionConfig) => Promise<void>;
|
|
2577
|
+
declare const ToolRouterSessionDeleteResponseSchema: z$1.ZodObject<{
|
|
2578
|
+
sessionId: z$1.ZodString;
|
|
2579
|
+
deleted: z$1.ZodLiteral<true>;
|
|
2580
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
2581
|
+
sessionId: string;
|
|
2582
|
+
deleted: true;
|
|
2583
|
+
}, {
|
|
2584
|
+
sessionId: string;
|
|
2585
|
+
deleted: true;
|
|
2586
|
+
}>;
|
|
2587
|
+
type ToolRouterSessionDeleteResponse = z$1.infer<typeof ToolRouterSessionDeleteResponseSchema>;
|
|
2588
|
+
type ToolRouterSessionDeleteFn = (requestOptions?: ComposioRequestOptions) => Promise<ToolRouterSessionDeleteResponse>;
|
|
2538
2589
|
/** Session type returned by ToolRouter.create() and ToolRouter.use() */
|
|
2539
2590
|
interface Session<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool, unknown>> {
|
|
2540
2591
|
sessionId: string;
|
|
@@ -2566,6 +2617,8 @@ interface Session<TToolCollection, TTool, TProvider extends BaseComposioProvider
|
|
|
2566
2617
|
execute: ToolRouterSessionExecuteFn;
|
|
2567
2618
|
/** Update the session configuration. Mutates this session in-place. */
|
|
2568
2619
|
update: ToolRouterSessionUpdateFn;
|
|
2620
|
+
/** Delete the session. Deleted sessions are no longer retrievable or executable. */
|
|
2621
|
+
delete: ToolRouterSessionDeleteFn;
|
|
2569
2622
|
/** Proxy an API call through Composio's auth layer using the session's connected account */
|
|
2570
2623
|
proxyExecute: ToolRouterSessionProxyExecuteFn;
|
|
2571
2624
|
/** List custom tools registered in this session, with their final slugs and schemas */
|
|
@@ -2770,4 +2823,4 @@ type CustomToolResponse = SessionCreateResponse.Experimental.CustomTool;
|
|
|
2770
2823
|
/** Custom toolkit as returned in the session create response (has prefixed slugs + original_slugs). */
|
|
2771
2824
|
type CustomToolkitResponse = SessionCreateResponse.Experimental.CustomToolkit;
|
|
2772
2825
|
//#endregion
|
|
2773
|
-
export {
|
|
2826
|
+
export { ToolRouterSessionMetadata as $, ConnectedAccountExperimentalSchema as $t, SessionProxyExecuteParams as A, UpdateConnectedAccountParamsSchema as An, FileListResponseSchema as At, ToolRouterCreateSessionConfigSchema as B, ToolRouterSessionFilesMountUploadOptionsSchema as Bt, MCPServerType as C, CreateConnectedAccountParamsSchema as Cn, ToolkitConnectionStateSchema as Ct, Session as D, UpdateConnectedAccountAclParams as Dn, FileDeleteResponse as Dt, SandboxSizeSchema as E, DefaultCreateConnectedAccountParamsSchema as En, RemoteFile as Et, ToolRouterConfigTags as F, ToolRouterSessionFilesMountDownloadOptions as Ft, ToolRouterSandboxConfigSchema as G, ConnectedAccountAclConfigResponse as Gt, ToolRouterMCPServerConfigSchema as H, ConnectionRequest as Ht, ToolRouterConfigTagsSchema as I, ToolRouterSessionFilesMountDownloadOptionsSchema as It, ToolRouterSessionDeleteResponseSchema as J, ConnectedAccountAuthConfig as Jt, ToolRouterSessionDeleteFn as K, ConnectedAccountAclConfigResponseSchema as Kt, ToolRouterConfigTools as L, ToolRouterSessionFilesMountListOptions as Lt, SessionWithoutMcp as M, RemoteFileDataSchema as Mt, ToolRouterAuthorizeFn as N, ToolRouterSessionFilesMountDeleteOptions as Nt, SessionExperimental as O, UpdateConnectedAccountAclParamsSchema as On, FileDeleteResponseSchema as Ot, ToolRouterConfigManageConnectionsSchema as P, ToolRouterSessionFilesMountDeleteOptionsSchema as Pt, ToolRouterSessionExecuteResponseSchema as Q, ConnectedAccountExperimentalResponseSchema as Qt, ToolRouterConfigToolsSchema as R, ToolRouterSessionFilesMountListOptionsSchema as Rt, SessionContext as S, CreateConnectedAccountParams as Sn, ToolkitConnectionState as St, SandboxSize as T, CreateConnectedAccountResponseSchema as Tn, ToolkitConnectionsDetailsSchema as Tt, ToolRouterManageConnectionsConfigSchema as U, ConnectionRequestState as Ut, ToolRouterMCPServerConfig as V, ComposioRequestOptions as Vt, ToolRouterSandboxConfig as W, ConnectedAccountAclConfig as Wt, ToolRouterSessionExecuteOptions as X, ConnectedAccountExperimental as Xt, ToolRouterSessionExecuteFn as Y, ConnectedAccountAuthConfigSchema as Yt, ToolRouterSessionExecuteResponse as Z, ConnectedAccountExperimentalResponse as Zt, CustomToolsMapEntry as _, CreateConnectedAccountLinkOptionsSchema as _n, ToolRouterToolsFn as _t, CreateCustomToolkitParams as a, ConnectedAccountRefreshOptions as an, ToolRouterSessionSearchResponseSchema as at, RegisteredCustomTool as b, CreateConnectedAccountOptions as bn, ToolRouterUpdateSessionConfig as bt, CustomToolExecuteFn as c, ConnectedAccountRetrieveResponseSchema as cn, ToolRouterSessionWorkbenchConfig as ct, CustomToolWireDefinition as d, ConnectedAccountStatusSchema as dn, ToolRouterToolkitsDisabledConfigSchema as dt, ConnectedAccountListParams as en, ToolRouterSessionPreloadConfig as et, CustomToolkit as f, ConnectedAccountStatuses as fn, ToolRouterToolkitsEnabledConfigSchema as ft, CustomToolsMap as g, CreateConnectedAccountLinkOptions as gn, ToolRouterToolkitsParamSchema as gt, CustomToolkitWireDefinition as h, ConnectedAccountTypes as hn, ToolRouterToolkitsOptionsSchema as ht, CreateCustomToolkitBaseSchema as i, ConnectedAccountListResponseSchema as in, ToolRouterSessionSearchResponse as it, SessionProxyExecuteParamsSchema as j, RemoteFileData as jt, SessionPreset as k, UpdateConnectedAccountParams as kn, FileListResponse as kt, CustomToolResponse as l, ConnectedAccountStatus as ln, ToolRouterTagsEnableDisableSchema as lt, CustomToolkitResponse as m, ConnectedAccountTypeSchema as mn, ToolRouterToolkitsOptions as mt, CreateCustomToolBaseSchema as n, ConnectedAccountListResponse as nn, ToolRouterSessionProxyExecuteResponse as nt, CustomTool as o, ConnectedAccountRefreshOptionsSchema as on, ToolRouterSessionUpdateFn as ot, CustomToolkitDefinition as p, ConnectedAccountType as pn, ToolRouterToolkitsFn as pt, ToolRouterSessionDeleteResponse as q, ConnectedAccountAclConfigSchema as qt, CreateCustomToolParams as r, ConnectedAccountListResponseItem as rn, ToolRouterSessionSearchFn as rt, CustomToolDefinition as s, ConnectedAccountRetrieveResponse as sn, ToolRouterSessionWarning as st, AnyZodSchema as t, ConnectedAccountListParamsSchema as tn, ToolRouterSessionProxyExecuteFn as tt, CustomToolSlugSchema as u, ConnectedAccountStatusEnum as un, ToolRouterTagsParamSchema as ut, InferZodSchema as v, CreateConnectedAccountLinkResponse as vn, ToolRouterToolsParam as vt, MCPServerTypeSchema as w, CreateConnectedAccountResponse as wn, ToolkitConnectionsDetails as wt, RegisteredCustomToolkit as x, CreateConnectedAccountOptionsSchema as xn, ToolRouterUpdateSessionConfigSchema as xt, InlineCustomToolsWirePayload as y, CreateConnectedAccountLinkResponseSchema as yn, ToolRouterToolsParamSchema as yt, ToolRouterCreateSessionConfig as z, ToolRouterSessionFilesMountUploadOptions as zt };
|