@composio/core 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CustomTool-CnJxXr07.mjs → CustomTool-BYHB7sPs.mjs} +1 -1
- package/dist/{CustomTool-CnHdegDK.d.mts → CustomTool-DZY1yLHN.d.mts} +1 -1
- package/dist/{cancellation-BQibgpRG.mjs → cancellation-D-tMPk48.mjs} +1 -1
- package/dist/{composio-Dq708dZS.d.mts → composio-B8AENilE.d.mts} +74 -62
- package/dist/{customTool.types-B8lVpHOP.d.mts → customTool.types-Bi6-keZC.d.mts} +612 -141
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +8 -8
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +56 -21
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +18 -18
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +25 -25
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +14 -14
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +13 -13
- package/dist/{errors-BN15NcCW.mjs → errors-Cly0vXFh.mjs} +5 -5
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +31 -7
- package/dist/index.mjs +382 -147
- package/dist/{types-eTw8Yw7Y.d.mts → types-BGDMkEUl.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.node.mjs +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +8 -8
- package/src/composio.ts +19 -16
- package/src/errors/ToolRouterErrors.ts +5 -5
- package/src/lib/toolRouterParams.ts +44 -16
- package/src/models/MCP.ts +20 -1
- package/src/models/ToolRouter.ts +9 -0
- package/src/models/ToolRouterSession.ts +68 -0
- package/src/models/Triggers.ts +8 -6
- package/src/services/pusher/Pusher.ts +159 -88
- package/src/types/pusher.types.ts +2 -0
- package/src/types/toolRouter.types.ts +190 -19
- package/src/utils/session.ts +25 -47
- package/src/utils/transformers/toolRouterResponseTransform.ts +8 -2
- package/src/utils/userCallback.ts +41 -0
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { c as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, d as USER_DATA_FILE_NAME, f as constants_exports, i as logger, l as IS_DEVELOPMENT_OR_CI, m as getEnvsWithPrefix, n as SsrfErrorCodes, o as COMPOSIO_DIR, p as getEnvVariable, r as ComposioError, s as DEFAULT_BASE_URL, t as ComposioBlockedInternalUrlError, u as TEMP_FILES_DIRECTORY_NAME } from "./SsrfErrors-DiQldIdC.mjs";
|
|
2
|
-
import { $ as ComposioAuthConfigNotFoundError, A as ComposioInvalidModifierError, B as ConnectionRequestFailedError, C as ValidationError, D as ToolkitErrorCodes, E as ComposioToolkitNotFoundError, F as ComposioToolNotFoundError, G as ComposioConnectedAccountRevocationNotSupportedError, H as ComposioAclOnlyForSharedError, I as ComposioToolVersionRequiredError, J as ComposioMultipleConnectedAccountsError, K as ComposioFailedToCreateConnectedAccountLink, L as ToolErrorCodes, M as ComposioProviderNotDefinedError, N as ComposioToolExecutionError, O as ComposioGlobalExecuteToolFnNotSetError, P as ComposioToolFetchError, Q as AuthConfigErrorCodes, R as handleToolExecutionError, S as JsonSchemaToZodError, T as ComposioToolkitFetchError, U as ComposioConnectedAccountNotFoundError, V as ConnectionRequestTimeoutError, W as ComposioConnectedAccountNotRevokableError, X as ComposioSharedConnectionNotAccessibleError, Y as ComposioSharedAccessDeniedError, Z as ConnectedAccountErrorCodes, _ as ComposioRequestCancelledError, a as RemoteFileDownloadError, b as isRequestAbortError, c as ComposioFailedToGetSDKRealtimeCredentialsError, d as ComposioTriggerTypeNotFoundError, f as ComposioWebhookPayloadError, g as ComposioNoAPIKeyError, h as ComposioAPIKeyKindError, i as ToolRouterErrorCodes, j as ComposioInvalidToolArgumentsError, k as ComposioInvalidExecuteFunctionError, l as ComposioFailedToSubscribeToPusherChannelError, m as TriggerErrorCodes, n as ComposioSessionConfigConflictError, o as RemoteFileErrorCodes, p as ComposioWebhookSignatureVerificationError, q as ComposioLegacyConnectedAccountsEndpointRetiredError, r as ComposioToolInputRequiredError, s as ComposioFailedToCreatePusherClientError, t as ComposioMCPDestinationError, u as ComposioFailedToUnsubscribeFromPusherChannelError, v as ComposioScopeConfigError, w as ValidationErrorCodes, x as JsonSchemaRefResolutionError, y as SDKErrorCodes, z as ConnectionRequestErrorCodes } from "./errors-
|
|
2
|
+
import { $ as ComposioAuthConfigNotFoundError, A as ComposioInvalidModifierError, B as ConnectionRequestFailedError, C as ValidationError, D as ToolkitErrorCodes, E as ComposioToolkitNotFoundError, F as ComposioToolNotFoundError, G as ComposioConnectedAccountRevocationNotSupportedError, H as ComposioAclOnlyForSharedError, I as ComposioToolVersionRequiredError, J as ComposioMultipleConnectedAccountsError, K as ComposioFailedToCreateConnectedAccountLink, L as ToolErrorCodes, M as ComposioProviderNotDefinedError, N as ComposioToolExecutionError, O as ComposioGlobalExecuteToolFnNotSetError, P as ComposioToolFetchError, Q as AuthConfigErrorCodes, R as handleToolExecutionError, S as JsonSchemaToZodError, T as ComposioToolkitFetchError, U as ComposioConnectedAccountNotFoundError, V as ConnectionRequestTimeoutError, W as ComposioConnectedAccountNotRevokableError, X as ComposioSharedConnectionNotAccessibleError, Y as ComposioSharedAccessDeniedError, Z as ConnectedAccountErrorCodes, _ as ComposioRequestCancelledError, a as RemoteFileDownloadError, b as isRequestAbortError, c as ComposioFailedToGetSDKRealtimeCredentialsError, d as ComposioTriggerTypeNotFoundError, f as ComposioWebhookPayloadError, g as ComposioNoAPIKeyError, h as ComposioAPIKeyKindError, i as ToolRouterErrorCodes, j as ComposioInvalidToolArgumentsError, k as ComposioInvalidExecuteFunctionError, l as ComposioFailedToSubscribeToPusherChannelError, m as TriggerErrorCodes, n as ComposioSessionConfigConflictError, o as RemoteFileErrorCodes, p as ComposioWebhookSignatureVerificationError, q as ComposioLegacyConnectedAccountsEndpointRetiredError, r as ComposioToolInputRequiredError, s as ComposioFailedToCreatePusherClientError, t as ComposioMCPDestinationError, u as ComposioFailedToUnsubscribeFromPusherChannelError, v as ComposioScopeConfigError, w as ValidationErrorCodes, x as JsonSchemaRefResolutionError, y as SDKErrorCodes, z as ConnectionRequestErrorCodes } from "./errors-Cly0vXFh.mjs";
|
|
3
3
|
import { a as ComposioSensitiveFilePathBlockedError, i as ComposioFileUploadPathNotAllowedError, n as ComposioFileUploadAbortedError, o as FileModifierErrorCodes, r as ComposioFileUploadError, t as ComposioFileNotFoundError } from "./FileModifierErrors-CdGSABoq.mjs";
|
|
4
4
|
import { n as dropEmptyFileUploads, o as isPlainObject, s as schemaHasFileUploadable } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
|
|
5
|
-
import { a as jsonSchemaToZodSchema, c as toStrictJsonSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as omitNullToolArguments, r as dereferenceJsonSchema, s as removeNonRequiredProperties, t as withCancellation } from "./cancellation-
|
|
5
|
+
import { a as jsonSchemaToZodSchema, c as toStrictJsonSchema, i as ensureObjectTypeOnProperties, n as deduplicateJsonSchemaRequiredArrays, o as omitNullToolArguments, r as dereferenceJsonSchema, s as removeNonRequiredProperties, t as withCancellation } from "./cancellation-D-tMPk48.mjs";
|
|
6
6
|
import { t as telemetry } from "./Telemetry-41JkqpZ7.mjs";
|
|
7
7
|
import { a as readResponseBodyWithLimit, i as MAX_URL_UPLOAD_SIZE_BYTES, l as getRandomShortId, n as assertSafeFileUploadPath, o as arrayBufferToBase64, r as isBlockedSensitiveFileUploadPath, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-BlLp-Yo2.mjs";
|
|
8
|
-
import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-
|
|
9
|
-
import ComposioClient, { APIError, BadRequestError, ConflictError
|
|
8
|
+
import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-BYHB7sPs.mjs";
|
|
9
|
+
import ComposioClient, { APIError, BadRequestError, ConflictError } from "@composio/client";
|
|
10
10
|
import { FileToolModifier } from "#file_tool_modifier";
|
|
11
11
|
import z, { z as z$1 } from "zod/v3";
|
|
12
12
|
import { CONFIG_DEFAULTS } from "#config_defaults";
|
|
13
13
|
import { platform } from "#platform";
|
|
14
14
|
import semver from "semver";
|
|
15
15
|
import { Files } from "#files";
|
|
16
|
-
import
|
|
17
|
-
import { z as z$2 } from "zod";
|
|
16
|
+
import manifest from "#client_identity" with { type: "json" };
|
|
18
17
|
import { ssrfSafeFetch, ssrfSafeFetchWhereSupported } from "#ssrf_guard";
|
|
18
|
+
import { z as z$2 } from "zod";
|
|
19
19
|
|
|
20
20
|
//#region src/types/authConfigs.types.ts
|
|
21
21
|
const AuthConfigTypes = {
|
|
@@ -1279,7 +1279,10 @@ function transformToolkitConnectionStatus(raw) {
|
|
|
1279
1279
|
statusMessage: raw.status_message,
|
|
1280
1280
|
connectionDetails: raw.connection_details,
|
|
1281
1281
|
currentUserInfo: raw.current_user_info,
|
|
1282
|
-
...raw.instant_account !== void 0 && { instantAccount: {
|
|
1282
|
+
...raw.instant_account !== void 0 && { instantAccount: {
|
|
1283
|
+
allowedToolSlugs: raw.instant_account.allowed_tool_slugs,
|
|
1284
|
+
...raw.instant_account.prices !== void 0 && { prices: raw.instant_account.prices }
|
|
1285
|
+
} }
|
|
1283
1286
|
};
|
|
1284
1287
|
}
|
|
1285
1288
|
/**
|
|
@@ -5515,6 +5518,47 @@ var InternalService = class {
|
|
|
5515
5518
|
}
|
|
5516
5519
|
};
|
|
5517
5520
|
|
|
5521
|
+
//#endregion
|
|
5522
|
+
//#region src/utils/userCallback.ts
|
|
5523
|
+
/**
|
|
5524
|
+
* Describes a thrown or rejected value for a log line without ever throwing.
|
|
5525
|
+
*
|
|
5526
|
+
* The logger serializes object arguments with `JSON.stringify`, which turns an `Error` into `{}`
|
|
5527
|
+
* and throws on a circular value, so callers log this string instead of the raw value.
|
|
5528
|
+
* `JSON.stringify` and `String()` can both throw (a circular value, an object without a
|
|
5529
|
+
* prototype), so each is tried in turn.
|
|
5530
|
+
*/
|
|
5531
|
+
function describeThrown(value) {
|
|
5532
|
+
try {
|
|
5533
|
+
if (value instanceof Error) return value.message;
|
|
5534
|
+
if (typeof value === "object" && value !== null) return JSON.stringify(value) ?? String(value);
|
|
5535
|
+
return String(value);
|
|
5536
|
+
} catch {
|
|
5537
|
+
try {
|
|
5538
|
+
return String(value);
|
|
5539
|
+
} catch {
|
|
5540
|
+
return "[unprintable value]";
|
|
5541
|
+
}
|
|
5542
|
+
}
|
|
5543
|
+
}
|
|
5544
|
+
/**
|
|
5545
|
+
* Calls a user-supplied event callback so that neither a synchronous throw nor a rejected promise
|
|
5546
|
+
* escapes into the event emitter that invoked it. Failures are logged after `label`.
|
|
5547
|
+
*
|
|
5548
|
+
* pusher-js does not catch listener exceptions, and nothing awaits the promise an `async`
|
|
5549
|
+
* listener returns, so an escaped failure would end a Node process.
|
|
5550
|
+
*/
|
|
5551
|
+
function invokeUserCallback(label, callback) {
|
|
5552
|
+
const logFailure = (error) => {
|
|
5553
|
+
logger.error(label, describeThrown(error));
|
|
5554
|
+
};
|
|
5555
|
+
try {
|
|
5556
|
+
Promise.resolve(callback()).catch(logFailure);
|
|
5557
|
+
} catch (error) {
|
|
5558
|
+
logFailure(error);
|
|
5559
|
+
}
|
|
5560
|
+
}
|
|
5561
|
+
|
|
5518
5562
|
//#endregion
|
|
5519
5563
|
//#region src/utils/sdk.ts
|
|
5520
5564
|
/**
|
|
@@ -5801,15 +5845,21 @@ function getToolkitVersionsFromEnv(defaultVersions) {
|
|
|
5801
5845
|
|
|
5802
5846
|
//#endregion
|
|
5803
5847
|
//#region src/services/pusher/Pusher.ts
|
|
5848
|
+
/**
|
|
5849
|
+
* Owns the realtime connection that delivers trigger events.
|
|
5850
|
+
*
|
|
5851
|
+
* Each subscription period gets its own pusher-js client, which `unsubscribe()` disconnects.
|
|
5852
|
+
* Reusing one client across periods is unsafe: pusher-js keeps a channel, its bound handlers and
|
|
5853
|
+
* its cancellation flag through `disconnect()` and resubscribes every kept channel on the next
|
|
5854
|
+
* `connect()`, and a channel-auth reply requested on the old socket can arrive after a reconnect
|
|
5855
|
+
* and be sent on the new one.
|
|
5856
|
+
*/
|
|
5804
5857
|
var PusherService = class {
|
|
5805
|
-
clientId;
|
|
5806
|
-
pusherKey;
|
|
5807
|
-
pusherCluster;
|
|
5808
|
-
pusherChannel;
|
|
5809
5858
|
pusherBaseURL;
|
|
5810
5859
|
authHeaders;
|
|
5811
|
-
pusherClient;
|
|
5812
5860
|
composioClient;
|
|
5861
|
+
attempt;
|
|
5862
|
+
connection;
|
|
5813
5863
|
constructor(client, options = {}) {
|
|
5814
5864
|
this.composioClient = client;
|
|
5815
5865
|
this.pusherBaseURL = client.baseURL;
|
|
@@ -5821,40 +5871,70 @@ var PusherService = class {
|
|
|
5821
5871
|
telemetry.instrument(this, "PusherService");
|
|
5822
5872
|
}
|
|
5823
5873
|
/**
|
|
5824
|
-
*
|
|
5825
|
-
*
|
|
5826
|
-
* This method is called when the Pusher client is first used.
|
|
5827
|
-
* It will fetch the SDK realtime credentials from the Apollo API and create a Pusher client.
|
|
5874
|
+
* Returns the connection attempt of the current subscription period, starting one if needed.
|
|
5875
|
+
* A failed attempt is forgotten, so the next `subscribe()` retries.
|
|
5828
5876
|
*/
|
|
5829
|
-
|
|
5830
|
-
if (
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
this.
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5877
|
+
connect() {
|
|
5878
|
+
if (this.attempt) return this.attempt;
|
|
5879
|
+
const controller = new AbortController();
|
|
5880
|
+
const ready = this.openConnection(controller.signal);
|
|
5881
|
+
const attempt = {
|
|
5882
|
+
controller,
|
|
5883
|
+
ready
|
|
5884
|
+
};
|
|
5885
|
+
this.attempt = attempt;
|
|
5886
|
+
ready.catch(() => {
|
|
5887
|
+
if (this.attempt === attempt) this.attempt = void 0;
|
|
5888
|
+
});
|
|
5889
|
+
return attempt;
|
|
5890
|
+
}
|
|
5891
|
+
/**
|
|
5892
|
+
* Fetches the SDK realtime credentials from the Apollo API, creates a Pusher client and
|
|
5893
|
+
* subscribes it to the triggers channel.
|
|
5894
|
+
*/
|
|
5895
|
+
async openConnection(signal) {
|
|
5896
|
+
const internalService = new InternalService(this.composioClient);
|
|
5897
|
+
let sdkRealtimeCredentials;
|
|
5898
|
+
try {
|
|
5899
|
+
sdkRealtimeCredentials = await internalService.getSDKRealtimeCredentials();
|
|
5900
|
+
} catch (error) {
|
|
5901
|
+
throw new ComposioFailedToGetSDKRealtimeCredentialsError("Failed to get SDK realtime credentials", { cause: error });
|
|
5902
|
+
}
|
|
5903
|
+
const { projectId, pusherKey, pusherCluster } = sdkRealtimeCredentials;
|
|
5904
|
+
const channelName = `private-${projectId}_triggers`;
|
|
5905
|
+
let Pusher;
|
|
5906
|
+
try {
|
|
5907
|
+
({default: Pusher} = await import("pusher-js"));
|
|
5908
|
+
} catch (error) {
|
|
5909
|
+
throw new ComposioFailedToCreatePusherClientError("Failed to create Pusher client", { cause: error });
|
|
5856
5910
|
}
|
|
5857
|
-
|
|
5911
|
+
if (signal.aborted) throw new Error("Connection attempt cancelled by unsubscribe()");
|
|
5912
|
+
logger.debug(`[PusherService] Creating Pusher client for client ID: ${projectId} in cluster ${pusherCluster}`);
|
|
5913
|
+
let client;
|
|
5914
|
+
try {
|
|
5915
|
+
client = new Pusher(pusherKey, {
|
|
5916
|
+
cluster: pusherCluster,
|
|
5917
|
+
channelAuthorization: {
|
|
5918
|
+
endpoint: `${this.pusherBaseURL}/api/v3/internal/sdk/realtime/auth`,
|
|
5919
|
+
headers: { ...this.authHeaders },
|
|
5920
|
+
transport: "ajax"
|
|
5921
|
+
}
|
|
5922
|
+
});
|
|
5923
|
+
} catch (error) {
|
|
5924
|
+
throw new ComposioFailedToCreatePusherClientError("Failed to create Pusher client", { cause: error });
|
|
5925
|
+
}
|
|
5926
|
+
logger.debug(`[PusherService] Subscribing to channel: ${channelName}`);
|
|
5927
|
+
try {
|
|
5928
|
+
this.connection = {
|
|
5929
|
+
client,
|
|
5930
|
+
channel: client.subscribe(channelName),
|
|
5931
|
+
channelName
|
|
5932
|
+
};
|
|
5933
|
+
} catch (error) {
|
|
5934
|
+
client.disconnect();
|
|
5935
|
+
throw error;
|
|
5936
|
+
}
|
|
5937
|
+
return this.connection;
|
|
5858
5938
|
}
|
|
5859
5939
|
/**
|
|
5860
5940
|
* Binds a chunked event to a Pusher client
|
|
@@ -5902,42 +5982,42 @@ var PusherService = class {
|
|
|
5902
5982
|
/**
|
|
5903
5983
|
* Subscribes to pusher to receive events from the server
|
|
5904
5984
|
*
|
|
5905
|
-
*
|
|
5906
|
-
*
|
|
5985
|
+
* The first call of a subscription period creates the Pusher client; concurrent calls share
|
|
5986
|
+
* it. A call still waiting for the client when `unsubscribe()` runs resolves without
|
|
5987
|
+
* subscribing.
|
|
5907
5988
|
*
|
|
5908
|
-
* @param channelName - The name of the Pusher channel to subscribe to
|
|
5909
|
-
* @param event - The event to subscribe to
|
|
5910
5989
|
* @param fn - The function to call when the event is received
|
|
5911
5990
|
* @param onSubscriptionError - Optional callback invoked with the raw payload when the
|
|
5912
5991
|
* Pusher subscription fails (for example on auth or permission rejection). Errors thrown
|
|
5913
5992
|
* from — or promises rejected by — this callback are contained and logged, never rethrown.
|
|
5914
5993
|
*/
|
|
5915
5994
|
async subscribe(fn, onSubscriptionError) {
|
|
5995
|
+
const attempt = this.connect();
|
|
5996
|
+
let connection;
|
|
5916
5997
|
try {
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
}
|
|
5998
|
+
connection = await attempt.ready;
|
|
5999
|
+
} catch (error) {
|
|
6000
|
+
if (attempt.controller.signal.aborted) {
|
|
6001
|
+
logger.debug("[PusherService] Subscribe cancelled by unsubscribe() before it connected");
|
|
6002
|
+
return;
|
|
6003
|
+
}
|
|
6004
|
+
throw new ComposioFailedToSubscribeToPusherChannelError("Failed to subscribe to Pusher channel", { cause: error });
|
|
6005
|
+
}
|
|
6006
|
+
if (attempt.controller.signal.aborted) {
|
|
6007
|
+
logger.debug("[PusherService] Subscribe cancelled by unsubscribe() before it connected");
|
|
6008
|
+
return;
|
|
6009
|
+
}
|
|
6010
|
+
try {
|
|
6011
|
+
const { channel } = connection;
|
|
5923
6012
|
channel.bind("pusher:subscription_error", (data) => {
|
|
5924
6013
|
logger.error("Trigger subscription error:", data);
|
|
5925
|
-
|
|
5926
|
-
Promise.resolve(onSubscriptionError?.(data)).catch(logCallbackFailure);
|
|
5927
|
-
} catch (callbackError) {
|
|
5928
|
-
logCallbackFailure(callbackError);
|
|
5929
|
-
}
|
|
6014
|
+
invokeUserCallback("❌ Error in subscription error callback:", () => onSubscriptionError?.(data));
|
|
5930
6015
|
});
|
|
5931
6016
|
channel.bind("pusher:subscription_succeeded", () => {
|
|
5932
6017
|
logger.info(`✅ Subscribed to triggers. You should start receiving events now.`);
|
|
5933
6018
|
});
|
|
5934
6019
|
const safeCallback = (data) => {
|
|
5935
|
-
|
|
5936
|
-
fn(data);
|
|
5937
|
-
} catch (error) {
|
|
5938
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5939
|
-
logger.error("❌ Error in trigger callback:", errorMessage);
|
|
5940
|
-
}
|
|
6020
|
+
invokeUserCallback("❌ Error in trigger callback:", () => fn(data));
|
|
5941
6021
|
};
|
|
5942
6022
|
this.bindWithChunking(channel, "trigger_to_client", safeCallback);
|
|
5943
6023
|
} catch (error) {
|
|
@@ -5945,21 +6025,31 @@ var PusherService = class {
|
|
|
5945
6025
|
}
|
|
5946
6026
|
}
|
|
5947
6027
|
/**
|
|
5948
|
-
* Unsubscribes from
|
|
6028
|
+
* Unsubscribes from the triggers channel and closes the connection
|
|
5949
6029
|
*
|
|
5950
|
-
* This
|
|
5951
|
-
*
|
|
5952
|
-
*
|
|
5953
|
-
* @param channelName - The name of the Pusher channel to unsubscribe from
|
|
6030
|
+
* This ends the subscription period: setup still in flight is cancelled, the handlers bound by
|
|
6031
|
+
* every `subscribe()` call are removed, and the Pusher client is disconnected. Without a prior
|
|
6032
|
+
* `subscribe()` this does nothing; it never creates a client or fetches credentials.
|
|
5954
6033
|
*/
|
|
5955
6034
|
async unsubscribe() {
|
|
6035
|
+
const { attempt, connection } = this;
|
|
6036
|
+
this.attempt = void 0;
|
|
6037
|
+
this.connection = void 0;
|
|
6038
|
+
attempt?.controller.abort();
|
|
6039
|
+
if (!connection) {
|
|
6040
|
+
logger.debug("[PusherService] No open connection to unsubscribe from");
|
|
6041
|
+
return;
|
|
6042
|
+
}
|
|
6043
|
+
logger.debug(`[PusherService] Unsubscribing from channel: ${connection.channelName}`);
|
|
5956
6044
|
try {
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
logger.info(`✅ Unsubscribed from triggers.`);
|
|
6045
|
+
connection.channel.unbind_all();
|
|
6046
|
+
connection.client.unsubscribe(connection.channelName);
|
|
5960
6047
|
} catch (error) {
|
|
5961
6048
|
throw new ComposioFailedToSubscribeToPusherChannelError("Failed to unsubscribe from Pusher channel", { cause: error });
|
|
6049
|
+
} finally {
|
|
6050
|
+
connection.client.disconnect();
|
|
5962
6051
|
}
|
|
6052
|
+
logger.info(`✅ Unsubscribed from triggers.`);
|
|
5963
6053
|
}
|
|
5964
6054
|
};
|
|
5965
6055
|
|
|
@@ -6340,7 +6430,8 @@ var Triggers = class {
|
|
|
6340
6430
|
/**
|
|
6341
6431
|
* Subscribe to all the triggers
|
|
6342
6432
|
*
|
|
6343
|
-
* @param fn - The function to call when a trigger is received
|
|
6433
|
+
* @param fn - The function to call when a trigger is received. It may be `async`. Errors
|
|
6434
|
+
* thrown from — or promises rejected by — the function are contained and logged.
|
|
6344
6435
|
* @param filters - The filters to apply to the triggers
|
|
6345
6436
|
* @param onSubscriptionError - Optional callback invoked with the raw Pusher payload when
|
|
6346
6437
|
* the underlying subscription fails (for example on auth or permission rejection). The
|
|
@@ -6363,11 +6454,7 @@ var Triggers = class {
|
|
|
6363
6454
|
await this.pusherService.subscribe((_data) => {
|
|
6364
6455
|
logger.debug("Received raw trigger data", JSON.stringify(_data, null, 2));
|
|
6365
6456
|
const parsedData = this.parsePusherPayload(_data);
|
|
6366
|
-
if (this.shouldSendTriggerAfterFilters(parsedFilters.data, parsedData))
|
|
6367
|
-
fn(parsedData);
|
|
6368
|
-
} catch (error) {
|
|
6369
|
-
logger.error("❌ Error in trigger callback:", error);
|
|
6370
|
-
}
|
|
6457
|
+
if (this.shouldSendTriggerAfterFilters(parsedFilters.data, parsedData)) invokeUserCallback("❌ Error in trigger callback:", () => fn(parsedData));
|
|
6371
6458
|
else logger.debug("Trigger does not match filters", JSON.stringify(parsedFilters.data, null, 2));
|
|
6372
6459
|
}, onSubscriptionError);
|
|
6373
6460
|
}
|
|
@@ -6454,6 +6541,10 @@ var Triggers = class {
|
|
|
6454
6541
|
/**
|
|
6455
6542
|
* Unsubscribe from all the triggers
|
|
6456
6543
|
*
|
|
6544
|
+
* Ends every subscription made with {@link subscribe} on this instance, including one that is
|
|
6545
|
+
* still connecting, and closes the realtime connection so that a script can exit. A later
|
|
6546
|
+
* `subscribe()` opens a new connection.
|
|
6547
|
+
*
|
|
6457
6548
|
* @returns {Promise<void>}
|
|
6458
6549
|
*
|
|
6459
6550
|
* @example
|
|
@@ -6957,6 +7048,8 @@ function transformMCPItemResponse(response) {
|
|
|
6957
7048
|
toolkits: raw.toolkits
|
|
6958
7049
|
}));
|
|
6959
7050
|
}
|
|
7051
|
+
const MANAGED_AUTH_DEPRECATION = "[Deprecation] composio.mcp.generate() returns URLs that rely on the deprecated include_composio_helper_actions query parameter, which the API will remove in a future version. Switch to a session MCP endpoint: composio.create(userId, { mcp: true }) exposes session.mcp.url with connection-management tools built in. https://docs.composio.dev/docs/sessions-via-mcp";
|
|
7052
|
+
let _managedAuthDeprecationWarned = false;
|
|
6960
7053
|
/**
|
|
6961
7054
|
* MCP (Model Control Protocol) class
|
|
6962
7055
|
* Handles MCP server operations.
|
|
@@ -7275,7 +7368,11 @@ var MCP = class {
|
|
|
7275
7368
|
user_ids: [userId],
|
|
7276
7369
|
managed_auth_by_composio: options?.manuallyManageConnections ? false : true
|
|
7277
7370
|
};
|
|
7278
|
-
|
|
7371
|
+
if (urlBody.managed_auth_by_composio && !_managedAuthDeprecationWarned) {
|
|
7372
|
+
_managedAuthDeprecationWarned = true;
|
|
7373
|
+
logger.warn(MANAGED_AUTH_DEPRECATION);
|
|
7374
|
+
}
|
|
7375
|
+
const userIdsURL = (await withCancellation(() => this.client.withOptions({ logLevel: "error" }).mcp.generate.url(urlBody, requestOptions), requestOptions?.signal)).user_ids_url[0];
|
|
7279
7376
|
const serverInstance = MCPServerInstanceSchema.safeParse({
|
|
7280
7377
|
id: server.id,
|
|
7281
7378
|
name: server.name,
|
|
@@ -7581,6 +7678,26 @@ const ToolRouterConfigManageConnectionsSchema = z.object({
|
|
|
7581
7678
|
const ToolRouterToolkitsParamSchema = z.array(z.string()).describe("List of toolkits to enable in the tool router session");
|
|
7582
7679
|
const ToolRouterToolkitsDisabledConfigSchema = z.object({ disable: ToolRouterToolkitsParamSchema.describe("List of toolkits to disable in the tool router session") }).strict();
|
|
7583
7680
|
const ToolRouterToolkitsEnabledConfigSchema = z.object({ enable: ToolRouterToolkitsParamSchema.describe("List of toolkits to enable in the tool router session") }).strict();
|
|
7681
|
+
/**
|
|
7682
|
+
* Toolkits whose tools need the user's approval before they run. A call that
|
|
7683
|
+
* needs approval doesn't run: `session.execute()` throws
|
|
7684
|
+
* `ComposioToolInputRequiredError` with the question to show the user.
|
|
7685
|
+
* @experimental
|
|
7686
|
+
*/
|
|
7687
|
+
const ToolRouterToolkitsRequireApprovalSchema = ToolRouterToolkitsParamSchema.describe("Experimental. Toolkits whose tools need the user approval before they run");
|
|
7688
|
+
/** Session toolkit policy: a list to enable, an enable/disable object, or only an approval list. */
|
|
7689
|
+
const ToolRouterSessionToolkitsSchema = z.union([
|
|
7690
|
+
ToolRouterToolkitsParamSchema,
|
|
7691
|
+
ToolRouterToolkitsDisabledConfigSchema.extend({ requireApproval: ToolRouterToolkitsRequireApprovalSchema.optional() }).strict(),
|
|
7692
|
+
ToolRouterToolkitsEnabledConfigSchema.extend({ requireApproval: ToolRouterToolkitsRequireApprovalSchema.optional() }).strict(),
|
|
7693
|
+
z.object({ requireApproval: ToolRouterToolkitsRequireApprovalSchema }).strict()
|
|
7694
|
+
]);
|
|
7695
|
+
/**
|
|
7696
|
+
* What happens to a call that needs the user's approval when the session's MCP
|
|
7697
|
+
* client can't ask the user.
|
|
7698
|
+
* @experimental
|
|
7699
|
+
*/
|
|
7700
|
+
const ToolRouterNoElicitationSupportFallbackSchema = z.enum(["deny", "allow"]).describe("Experimental. What happens to a call that needs approval when the MCP client cannot ask the user");
|
|
7584
7701
|
/** Experimental Instant usage policy for a Session. */
|
|
7585
7702
|
const ToolRouterInstantSchema = z.union([z.literal(false), z.object({
|
|
7586
7703
|
toolkits: z.union([ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsDisabledConfigSchema]).optional(),
|
|
@@ -7590,7 +7707,13 @@ const ToolRouterInstantSchema = z.union([z.literal(false), z.object({
|
|
|
7590
7707
|
* visibility only; on update, any policy object still re-enables Instant
|
|
7591
7708
|
* usage on a Session set to `false`.
|
|
7592
7709
|
*/
|
|
7593
|
-
returnInstantCharge: z.boolean().optional()
|
|
7710
|
+
returnInstantCharge: z.boolean().optional(),
|
|
7711
|
+
/**
|
|
7712
|
+
* Experimental. Show each Instant tool's price in Session search
|
|
7713
|
+
* results, under `toolkitConnectionStatuses[].instantAccount.prices`.
|
|
7714
|
+
* Controls visibility only.
|
|
7715
|
+
*/
|
|
7716
|
+
returnPricesInSearch: z.boolean().optional()
|
|
7594
7717
|
}).strict()]);
|
|
7595
7718
|
const ToolRouterManageConnectionsConfigSchema = z.object({
|
|
7596
7719
|
enable: z.boolean().optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually").default(true),
|
|
@@ -7598,13 +7721,20 @@ const ToolRouterManageConnectionsConfigSchema = z.object({
|
|
|
7598
7721
|
});
|
|
7599
7722
|
const ToolRouterTagsParamSchema = z.array(z.enum([
|
|
7600
7723
|
"readOnlyHint",
|
|
7724
|
+
"createHint",
|
|
7725
|
+
"updateHint",
|
|
7601
7726
|
"destructiveHint",
|
|
7602
7727
|
"idempotentHint",
|
|
7603
7728
|
"openWorldHint"
|
|
7604
7729
|
])).describe("The tags to filter the tools by");
|
|
7605
7730
|
const ToolRouterTagsEnableDisableSchema = z.object({
|
|
7606
7731
|
enable: ToolRouterTagsParamSchema.optional().describe("The tags to enable in the tool router session"),
|
|
7607
|
-
disable: ToolRouterTagsParamSchema.optional().describe("The tags to disable in the tool router session")
|
|
7732
|
+
disable: ToolRouterTagsParamSchema.optional().describe("The tags to disable in the tool router session"),
|
|
7733
|
+
/**
|
|
7734
|
+
* Tools with any of these tags need the user's approval before they run.
|
|
7735
|
+
* @experimental
|
|
7736
|
+
*/
|
|
7737
|
+
requireApproval: ToolRouterTagsParamSchema.optional().describe("Experimental. Tools with any of these tags need the user approval before they run")
|
|
7608
7738
|
}).strict();
|
|
7609
7739
|
const ToolRouterConfigTagsSchema = z.union([ToolRouterTagsParamSchema, ToolRouterTagsEnableDisableSchema]).describe("The tags to use in the tool router session");
|
|
7610
7740
|
/**
|
|
@@ -7630,14 +7760,29 @@ const ToolRouterConfigTagsSchema = z.union([ToolRouterTagsParamSchema, ToolRoute
|
|
|
7630
7760
|
* ```
|
|
7631
7761
|
*/
|
|
7632
7762
|
const ToolRouterToolsParamSchema = z.array(z.string()).describe("The tools to use in the tool router session");
|
|
7763
|
+
/**
|
|
7764
|
+
* Tools of the toolkit that need the user's approval before they run.
|
|
7765
|
+
* @experimental
|
|
7766
|
+
*/
|
|
7767
|
+
const ToolRouterToolsRequireApprovalSchema = ToolRouterToolsParamSchema.describe("Experimental. Tools of this toolkit that need the user approval before they run");
|
|
7633
7768
|
const ToolRouterConfigToolsSchema = z.union([
|
|
7634
7769
|
ToolRouterToolsParamSchema,
|
|
7635
|
-
z.object({
|
|
7636
|
-
|
|
7637
|
-
|
|
7770
|
+
z.object({
|
|
7771
|
+
enable: ToolRouterToolsParamSchema.describe("The tools to enable in the tool router session"),
|
|
7772
|
+
requireApproval: ToolRouterToolsRequireApprovalSchema.optional()
|
|
7773
|
+
}).strict(),
|
|
7774
|
+
z.object({
|
|
7775
|
+
disable: ToolRouterToolsParamSchema.describe("The tools to disable in the tool router session"),
|
|
7776
|
+
requireApproval: ToolRouterToolsRequireApprovalSchema.optional()
|
|
7777
|
+
}).strict(),
|
|
7778
|
+
z.object({
|
|
7779
|
+
tags: ToolRouterConfigTagsSchema.describe("The tags to filter the tools by, this will override the global tags"),
|
|
7780
|
+
requireApproval: ToolRouterToolsRequireApprovalSchema.optional()
|
|
7781
|
+
}).strict(),
|
|
7782
|
+
z.object({ requireApproval: ToolRouterToolsRequireApprovalSchema }).strict()
|
|
7638
7783
|
]).superRefine((val, ctx) => {
|
|
7639
7784
|
if (typeof val === "object" && !Array.isArray(val)) {
|
|
7640
|
-
const keys = Object.keys(val);
|
|
7785
|
+
const keys = Object.keys(val).filter((key) => key !== "requireApproval");
|
|
7641
7786
|
if (keys.length > 1) ctx.addIssue({
|
|
7642
7787
|
code: z.ZodIssueCode.custom,
|
|
7643
7788
|
message: `Only one of 'enable', 'disable', or 'tags' can be specified, but found: ${keys.join(", ")}`,
|
|
@@ -7645,16 +7790,24 @@ const ToolRouterConfigToolsSchema = z.union([
|
|
|
7645
7790
|
});
|
|
7646
7791
|
}
|
|
7647
7792
|
});
|
|
7793
|
+
/**
|
|
7794
|
+
* Proxy execute settings for a session. `enable: true` exposes the
|
|
7795
|
+
* `COMPOSIO_PROXY_EXECUTE` meta tool and `enable: false` also turns off the
|
|
7796
|
+
* sandbox `proxy_execute()` helper. Leaving the block out keeps the meta tool
|
|
7797
|
+
* off while `sandbox.enableProxyExecution` controls the helper.
|
|
7798
|
+
*/
|
|
7799
|
+
const ToolRouterProxyExecuteConfigSchema = z.object({ enable: z.boolean().describe("true exposes the COMPOSIO_PROXY_EXECUTE meta tool. false also turns off the sandbox proxy_execute() helper.") }).strict();
|
|
7800
|
+
/**
|
|
7801
|
+
* `proxyExecute` as accepted by `sessions.create()` and `session.update()`:
|
|
7802
|
+
* a boolean is shorthand for `{ enable: boolean }`.
|
|
7803
|
+
*/
|
|
7804
|
+
const ToolRouterProxyExecuteSchema = z.union([z.boolean(), ToolRouterProxyExecuteConfigSchema]);
|
|
7648
7805
|
const ToolRouterCreateSessionConfigBaseSchema = z.object({
|
|
7649
7806
|
sessionPreset: z.literal(SessionPreset.DIRECT_TOOLS).optional().describe("Shortcut to expose every tool allowed by the session filters directly in session.tools() and the MCP tool list. This disables meta tools by default (search, multi-execute, manage-connections, and workbench). Use when all tools are known upfront and helper/meta tools are not needed. Without this preset, ToolRouter uses its default configuration with meta tools enabled."),
|
|
7650
7807
|
mcp: z.boolean().optional().describe("When true, the returned session surfaces its hosted MCP endpoint (`session.mcp.url` / `session.mcp.headers`) in the type, and an MCP URL that is not on the API base URL origin throws `ComposioMCPDestinationError` instead of leaving `session.mcp.headers` empty with a warning. The endpoint exists on every session at runtime regardless of this flag, but is only typed when `mcp: true` is passed. Default native tools (`session.tools()`) are unaffected. See https://docs.composio.dev/docs/sessions-via-mcp"),
|
|
7651
7808
|
tools: z.record(z.string(), z.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional().describe("The tools to use in the tool router session"),
|
|
7652
7809
|
tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
|
|
7653
|
-
toolkits:
|
|
7654
|
-
ToolRouterToolkitsParamSchema,
|
|
7655
|
-
ToolRouterToolkitsDisabledConfigSchema,
|
|
7656
|
-
ToolRouterToolkitsEnabledConfigSchema
|
|
7657
|
-
]).optional().describe("The toolkits to use in the tool router session"),
|
|
7810
|
+
toolkits: ToolRouterSessionToolkitsSchema.optional().describe("The toolkits to use in the tool router session"),
|
|
7658
7811
|
instant: ToolRouterInstantSchema.optional().describe("Experimental Instant usage policy. Omission permits eligible tools when the project allows Instant usage; false disables it for this Session."),
|
|
7659
7812
|
authConfigs: z.record(z.string(), z.string()).describe("The auth configs to use in the tool router session. The key is the toolkit slug, the value is the auth config id.").default({}),
|
|
7660
7813
|
connectedAccounts: z.record(z.string(), z.union([z.string(), z.array(z.string())])).describe("The connected accounts to use in the tool router session. The key is the toolkit slug, the value is a connected account id or an array of ids. Only one account per toolkit is allowed when multi-account mode is disabled.").default({}),
|
|
@@ -7666,12 +7819,20 @@ const ToolRouterCreateSessionConfigBaseSchema = z.object({
|
|
|
7666
7819
|
maxAccountsPerToolkit: z.number().int().min(2).max(10).optional().describe("Maximum number of connected accounts allowed per toolkit. Defaults to 5 when multi-account is enabled."),
|
|
7667
7820
|
requireExplicitSelection: z.boolean().optional().describe("When true, require explicit account selection when multiple accounts are connected. When false (default), use the first/default account.")
|
|
7668
7821
|
}).optional().describe("Multi-account configuration for this session"),
|
|
7822
|
+
proxyExecute: ToolRouterProxyExecuteSchema.optional().describe("Proxy execute configuration for this session; a boolean is shorthand for `{ enable }`. Rejected by the API when enable is false and sandbox.enableProxyExecution is true."),
|
|
7669
7823
|
preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional().describe("Tool slugs to preload into session.tools() and the MCP tool list, 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.") }).strict().optional().describe("Preload configuration for tools that should be exposed without search."),
|
|
7670
7824
|
experimental: z.object({
|
|
7671
7825
|
assistivePrompt: z.object({ userTimezone: z.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"),
|
|
7672
7826
|
customTools: z.array(z.custom()).optional().describe("Custom tools to include in this session. Created via createCustomTool() from @composio/core/experimental."),
|
|
7673
7827
|
customToolkits: z.array(z.custom()).optional().describe("Custom toolkits to include in this session. Created via createCustomToolkit() from @composio/core/experimental."),
|
|
7674
|
-
sessionConfigId: z.string().min(1).optional().describe("ID of a saved Session config (`sc_…`) to apply when the session is created. Cannot be combined with toolkits, tools, tags, customTools or customToolkits.")
|
|
7828
|
+
sessionConfigId: z.string().min(1).optional().describe("ID of a saved Session config (`sc_…`) to apply when the session is created. Cannot be combined with toolkits, tools, tags, customTools or customToolkits."),
|
|
7829
|
+
/**
|
|
7830
|
+
* What happens to a call that needs the user's approval when the
|
|
7831
|
+
* session's MCP client can't ask the user: `deny` (the default) or
|
|
7832
|
+
* `allow`.
|
|
7833
|
+
* @experimental
|
|
7834
|
+
*/
|
|
7835
|
+
noElicitationSupportFallback: ToolRouterNoElicitationSupportFallbackSchema.optional()
|
|
7675
7836
|
}).optional().describe("Experimental features configuration - not stable, may be modified or removed")
|
|
7676
7837
|
}).partial().superRefine((config, ctx) => {
|
|
7677
7838
|
if (config.experimental?.sessionConfigId !== void 0) addSessionConfigConflictIssue(ctx, [
|
|
@@ -7786,7 +7947,17 @@ const ToolRouterSessionSearchToolkitConnectionStatusSchema = z.object({
|
|
|
7786
7947
|
connectionDetails: z.record(z.string(), z.unknown()).optional(),
|
|
7787
7948
|
currentUserInfo: z.record(z.string(), z.unknown()).optional(),
|
|
7788
7949
|
/** Present when the toolkit runs on a Composio Instant account; only these tools run on it. */
|
|
7789
|
-
instantAccount: z.object({
|
|
7950
|
+
instantAccount: z.object({
|
|
7951
|
+
allowedToolSlugs: z.array(z.string()),
|
|
7952
|
+
/**
|
|
7953
|
+
* Price of each tool, keyed by tool slug. Present only when the Session
|
|
7954
|
+
* sets `instant.returnPricesInSearch`.
|
|
7955
|
+
*/
|
|
7956
|
+
prices: z.record(z.string(), z.object({
|
|
7957
|
+
description: z.string().optional(),
|
|
7958
|
+
discount: z.string().nullable().optional()
|
|
7959
|
+
})).optional()
|
|
7960
|
+
}).optional()
|
|
7790
7961
|
});
|
|
7791
7962
|
const ToolRouterSessionSearchResponseSchema = z.object({
|
|
7792
7963
|
success: z.boolean(),
|
|
@@ -7868,6 +8039,12 @@ const ToolRouterUpdateExperimentalSchema = z.object({
|
|
|
7868
8039
|
linkUrlOverwrite: z.string().nullable().optional().describe("Base URL override for connection link redirects. `null` removes the stored override"),
|
|
7869
8040
|
fastMode: z.boolean().nullable().optional().describe("Fast search mode. `null` removes the stored override"),
|
|
7870
8041
|
submitFeedback: z.object({ enable: z.boolean() }).strict().nullable().optional().describe("Exposes the COMPOSIO_SUBMIT_FEEDBACK helper tool. `null` removes the stored block"),
|
|
8042
|
+
/**
|
|
8043
|
+
* What happens to a call that needs the user's approval when the session's
|
|
8044
|
+
* MCP client can't ask the user: `deny` or `allow`.
|
|
8045
|
+
* @experimental
|
|
8046
|
+
*/
|
|
8047
|
+
noElicitationSupportFallback: ToolRouterNoElicitationSupportFallbackSchema.optional(),
|
|
7871
8048
|
sessionConfigId: z.string().min(1).optional().describe("Apply the latest active saved Session config (`sc_…`) from this project to this session. Replaces the session's toolkit, tool and tag access and cannot be combined with toolkits, tools or tags")
|
|
7872
8049
|
}).strict();
|
|
7873
8050
|
/**
|
|
@@ -7878,11 +8055,7 @@ const ToolRouterUpdateExperimentalSchema = z.object({
|
|
|
7878
8055
|
*/
|
|
7879
8056
|
const ToolRouterUpdateSessionConfigSchema = z.object({
|
|
7880
8057
|
instant: ToolRouterInstantSchema.optional().describe("Experimental Instant usage policy. False disables it. Any supplied object, even one that only sets returnInstantCharge, re-enables it. Omitted subfields keep their stored values."),
|
|
7881
|
-
toolkits:
|
|
7882
|
-
ToolRouterToolkitsParamSchema,
|
|
7883
|
-
ToolRouterToolkitsDisabledConfigSchema,
|
|
7884
|
-
ToolRouterToolkitsEnabledConfigSchema
|
|
7885
|
-
]).nullable().optional().describe("Toolkit policy. An empty allowlist (`[]` or `{ enable: [] }`) is sent as-is and denies every app toolkit; `null` removes the stored policy and restores the unrestricted default"),
|
|
8058
|
+
toolkits: ToolRouterSessionToolkitsSchema.nullable().optional().describe("Toolkit policy. An empty allowlist (`[]` or `{ enable: [] }`) is sent as-is and denies every app toolkit; `null` removes the stored policy and restores the unrestricted default"),
|
|
7886
8059
|
tools: z.record(z.string(), z.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).nullable().optional().describe("Replaces the entire stored tools map; `null` removes the override"),
|
|
7887
8060
|
tags: ToolRouterConfigTagsSchema.nullable().optional().describe("Replaces the global tag policy; `null` removes the override"),
|
|
7888
8061
|
authConfigs: z.record(z.string(), z.string()).nullable().optional().describe("Replaces the entire stored auth config map; `null` removes the override"),
|
|
@@ -7899,6 +8072,7 @@ const ToolRouterUpdateSessionConfigSchema = z.object({
|
|
|
7899
8072
|
maxAccountsPerToolkit: z.number().int().min(2).max(10).nullable().optional().describe("`null` removes the stored maximum so the default applies again"),
|
|
7900
8073
|
requireExplicitSelection: z.boolean().optional()
|
|
7901
8074
|
}).nullable().optional().describe("`null` removes the session override; the mode then resolves to disabled"),
|
|
8075
|
+
proxyExecute: ToolRouterProxyExecuteSchema.nullable().optional().describe("Replaces the proxy execute block; a boolean is shorthand for `{ enable }` and `null` removes it"),
|
|
7902
8076
|
preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional() }).strict().nullable().optional().describe("Replaces the stored preload; `null` removes it"),
|
|
7903
8077
|
search: z.object({ enable: z.boolean().optional() }).strict().nullable().optional().describe("Replaces the search block; `null` removes it and restores the defaults"),
|
|
7904
8078
|
execute: z.object({ enableMultiExecute: z.boolean().optional() }).strict().nullable().optional().describe("Replaces the execute block; `null` removes it and restores the defaults"),
|
|
@@ -8509,7 +8683,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
8509
8683
|
|
|
8510
8684
|
//#endregion
|
|
8511
8685
|
//#region package.json
|
|
8512
|
-
var version = "0.
|
|
8686
|
+
var version = "0.25.0";
|
|
8513
8687
|
|
|
8514
8688
|
//#endregion
|
|
8515
8689
|
//#region src/utils/session.ts
|
|
@@ -8534,44 +8708,35 @@ function detectRuntime() {
|
|
|
8534
8708
|
return "UNKNOWN";
|
|
8535
8709
|
}
|
|
8536
8710
|
const RUNTIME_ENV = detectRuntime();
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
const
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8711
|
+
/**
|
|
8712
|
+
* An identity value is sent as a header, so the client accepts only non-empty
|
|
8713
|
+
* printable ASCII with no leading or trailing whitespace.
|
|
8714
|
+
*/
|
|
8715
|
+
const HEADER_SAFE = /^[\x21-\x7e](?:[\x20-\x7e]*[\x21-\x7e])?$/;
|
|
8716
|
+
/**
|
|
8717
|
+
* The identity the API client reports for this SDK: its product headers
|
|
8718
|
+
* (`x-client-provenance`, `x-client-version`, `x-sdk-version`) and the legacy
|
|
8719
|
+
* `x-source`, `x-framework` and `x-runtime` labels. The client adds the
|
|
8720
|
+
* library headers and detects the runtime and its version itself.
|
|
8721
|
+
*
|
|
8722
|
+
* A custom provider whose name cannot be sent as a header value is reported
|
|
8723
|
+
* as `unknown` rather than making the SDK fail to construct.
|
|
8724
|
+
*/
|
|
8725
|
+
function getClientIdentity(provider) {
|
|
8726
|
+
const framework = provider?.name;
|
|
8551
8727
|
return {
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
"
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
"x-client-provenance": identity.name,
|
|
8558
|
-
"x-client-version": identity.version,
|
|
8559
|
-
"x-client-language": "typescript",
|
|
8560
|
-
"x-client-library": "@composio/client",
|
|
8561
|
-
"x-client-library-version": VERSION,
|
|
8562
|
-
...RUNTIME_VERSION ? { "x-runtime-version": RUNTIME_VERSION } : {}
|
|
8728
|
+
product: manifest.name,
|
|
8729
|
+
version: manifest.version,
|
|
8730
|
+
source: "TYPESCRIPT_SDK",
|
|
8731
|
+
framework: framework && HEADER_SAFE.test(framework) ? framework : "unknown",
|
|
8732
|
+
runtime: RUNTIME_ENV
|
|
8563
8733
|
};
|
|
8564
8734
|
}
|
|
8565
|
-
const getDefaultHeaders = (headers, provider) => {
|
|
8566
|
-
const sessionHeaders = getSessionHeaders(provider);
|
|
8567
|
-
return {
|
|
8568
|
-
...headers || {},
|
|
8569
|
-
...sessionHeaders
|
|
8570
|
-
};
|
|
8571
|
-
};
|
|
8572
8735
|
|
|
8573
8736
|
//#endregion
|
|
8574
8737
|
//#region src/lib/toolRouterParams.ts
|
|
8738
|
+
/** `require_approval` when the caller set an approval list, nothing otherwise. */
|
|
8739
|
+
const requireApprovalParam = (requireApproval) => requireApproval !== void 0 ? { require_approval: requireApproval } : {};
|
|
8575
8740
|
const transformToolRouterToolsParams = (params) => {
|
|
8576
8741
|
if (!params) return;
|
|
8577
8742
|
if (typeof params === "object") return Object.keys(params).reduce((acc, key) => {
|
|
@@ -8581,12 +8746,21 @@ const transformToolRouterToolsParams = (params) => {
|
|
|
8581
8746
|
if (parsedResult.success) {
|
|
8582
8747
|
const data = parsedResult.data;
|
|
8583
8748
|
if (Array.isArray(data)) acc[key] = { enable: data };
|
|
8584
|
-
else if ("enable" in data) acc[key] = {
|
|
8585
|
-
|
|
8749
|
+
else if ("enable" in data) acc[key] = {
|
|
8750
|
+
enable: data.enable,
|
|
8751
|
+
...requireApprovalParam(data.requireApproval)
|
|
8752
|
+
};
|
|
8753
|
+
else if ("disable" in data) acc[key] = {
|
|
8754
|
+
disable: data.disable,
|
|
8755
|
+
...requireApprovalParam(data.requireApproval)
|
|
8756
|
+
};
|
|
8586
8757
|
else if ("tags" in data) {
|
|
8587
8758
|
const tags = transformToolRouterTagsParams(data.tags);
|
|
8588
|
-
if (tags) acc[key] = {
|
|
8589
|
-
|
|
8759
|
+
if (tags) acc[key] = {
|
|
8760
|
+
tags,
|
|
8761
|
+
...requireApprovalParam(data.requireApproval)
|
|
8762
|
+
};
|
|
8763
|
+
} else acc[key] = { require_approval: data.requireApproval };
|
|
8590
8764
|
} else throw new ValidationError(parsedResult.error.message);
|
|
8591
8765
|
} else acc[key] = { enable: params[key] };
|
|
8592
8766
|
return acc;
|
|
@@ -8597,7 +8771,8 @@ const transformToolRouterTagsParams = (params) => {
|
|
|
8597
8771
|
if (Array.isArray(params)) return { enable: params };
|
|
8598
8772
|
else if (typeof params === "object") return {
|
|
8599
8773
|
enable: params.enable,
|
|
8600
|
-
disable: params.disable
|
|
8774
|
+
disable: params.disable,
|
|
8775
|
+
...requireApprovalParam(params.requireApproval)
|
|
8601
8776
|
};
|
|
8602
8777
|
};
|
|
8603
8778
|
const transformToolRouterManageConnectionsParams = (params) => {
|
|
@@ -8625,12 +8800,15 @@ const transformToolRouterSandboxParams = (params) => {
|
|
|
8625
8800
|
sandbox_size: params.sandboxSize
|
|
8626
8801
|
};
|
|
8627
8802
|
};
|
|
8803
|
+
/** `proxy_execute` as sent on create and update: a boolean becomes `{ enable }`. */
|
|
8804
|
+
const transformToolRouterProxyExecuteParams = (config) => typeof config === "boolean" ? { enable: config } : config;
|
|
8628
8805
|
const transformToolRouterInstantParams = (config) => {
|
|
8629
8806
|
if (config === false) return false;
|
|
8630
8807
|
return {
|
|
8631
8808
|
...config.toolkits !== void 0 && { toolkits: config.toolkits },
|
|
8632
8809
|
...config.tools !== void 0 && { tools: config.tools },
|
|
8633
|
-
...config.returnInstantCharge !== void 0 && { return_instant_charge: config.returnInstantCharge }
|
|
8810
|
+
...config.returnInstantCharge !== void 0 && { return_instant_charge: config.returnInstantCharge },
|
|
8811
|
+
...config.returnPricesInSearch !== void 0 && { return_prices_in_search: config.returnPricesInSearch }
|
|
8634
8812
|
};
|
|
8635
8813
|
};
|
|
8636
8814
|
const transformToolRouterUpdateManageConnectionsParams = (params) => {
|
|
@@ -8652,6 +8830,7 @@ const transformToolRouterUpdateExperimentalParams = (config) => {
|
|
|
8652
8830
|
if (config.fastMode !== void 0) result.fast_mode = config.fastMode;
|
|
8653
8831
|
if (config.submitFeedback !== void 0) result.submit_feedback = config.submitFeedback;
|
|
8654
8832
|
if (config.sessionConfigId !== void 0) result.session_config_id = config.sessionConfigId;
|
|
8833
|
+
if (config.noElicitationSupportFallback !== void 0) result.no_elicitation_support_fallback = config.noElicitationSupportFallback;
|
|
8655
8834
|
return result;
|
|
8656
8835
|
};
|
|
8657
8836
|
/**
|
|
@@ -8679,7 +8858,15 @@ const transformToolRouterMultiAccountParams = (params) => {
|
|
|
8679
8858
|
const transformToolRouterToolkitsParams = (params) => {
|
|
8680
8859
|
if (!params) return;
|
|
8681
8860
|
if (Array.isArray(params)) return { enable: params };
|
|
8682
|
-
return
|
|
8861
|
+
if ("enable" in params) return {
|
|
8862
|
+
enable: params.enable,
|
|
8863
|
+
...requireApprovalParam(params.requireApproval)
|
|
8864
|
+
};
|
|
8865
|
+
if ("disable" in params) return {
|
|
8866
|
+
disable: params.disable,
|
|
8867
|
+
...requireApprovalParam(params.requireApproval)
|
|
8868
|
+
};
|
|
8869
|
+
return { require_approval: params.requireApproval };
|
|
8683
8870
|
};
|
|
8684
8871
|
/**
|
|
8685
8872
|
* Request body of `session.update()`. Every key present in `config` is sent,
|
|
@@ -8709,6 +8896,7 @@ const transformToolRouterUpdateParams = (config) => {
|
|
|
8709
8896
|
params.multi_account = ma;
|
|
8710
8897
|
}
|
|
8711
8898
|
}
|
|
8899
|
+
if (config.proxyExecute !== void 0) params.proxy_execute = config.proxyExecute === null ? null : transformToolRouterProxyExecuteParams(config.proxyExecute);
|
|
8712
8900
|
if (config.preload !== void 0) params.preload = config.preload;
|
|
8713
8901
|
if (config.search !== void 0) params.search = config.search;
|
|
8714
8902
|
if (config.execute !== void 0) params.execute = config.execute === null ? null : config.execute.enableMultiExecute === void 0 ? {} : { enable_multi_execute: config.execute.enableMultiExecute };
|
|
@@ -9736,6 +9924,13 @@ async function deleteToolRouterSession(client, sessionId, requestOptions) {
|
|
|
9736
9924
|
//#endregion
|
|
9737
9925
|
//#region src/models/ToolRouterSession.ts
|
|
9738
9926
|
const COMPOSIO_MULTI_EXECUTE_TOOL = "COMPOSIO_MULTI_EXECUTE_TOOL";
|
|
9927
|
+
/** The request fields that carry the user's answers to an earlier `input_required` call. */
|
|
9928
|
+
function inputResponseParams(options) {
|
|
9929
|
+
return {
|
|
9930
|
+
...options?.inputResponses !== void 0 && { input_responses: options.inputResponses },
|
|
9931
|
+
...options?.requestState !== void 0 && { request_state: options.requestState }
|
|
9932
|
+
};
|
|
9933
|
+
}
|
|
9739
9934
|
const DIRECT_CUSTOM_TOOL_DESCRIPTION_PREFIX = "[Direct tool - call directly, no search needed beforehand.]";
|
|
9740
9935
|
/**
|
|
9741
9936
|
* Options accepted by {@link ToolRouterSession.authorize}.
|
|
@@ -10123,6 +10318,8 @@ var ToolRouterSession = class {
|
|
|
10123
10318
|
* @param arguments_ - Optional tool arguments
|
|
10124
10319
|
* @param options - Optional execution options
|
|
10125
10320
|
* @param options.account - Account identifier for direct app tool execution. Accepted on every project: in multi-account sessions it picks the account; on single-account projects it must match one of the session's active connections for the toolkit. Helper/meta tools either ignore this top-level field or define their own account-selection fields.
|
|
10321
|
+
* @param options.inputResponses - Experimental. The user's answers to an earlier `ComposioToolInputRequiredError`, keyed by the IDs in its `inputRequests`. Repeat the same call with them.
|
|
10322
|
+
* @param options.requestState - Experimental. The `requestState` of that error, sent back unchanged.
|
|
10126
10323
|
* @returns The tool execution result
|
|
10127
10324
|
* @throws {ComposioToolInputRequiredError} If the tool needs input from the user (for example an approval) before it can run
|
|
10128
10325
|
*/
|
|
@@ -10141,7 +10338,8 @@ var ToolRouterSession = class {
|
|
|
10141
10338
|
assertUnambiguousCustomToolSlug(this.customToolsMap, toolSlug);
|
|
10142
10339
|
const executeParams = {
|
|
10143
10340
|
tool_slug: toolSlug,
|
|
10144
|
-
arguments: arguments_ ?? {}
|
|
10341
|
+
arguments: arguments_ ?? {},
|
|
10342
|
+
...inputResponseParams(options)
|
|
10145
10343
|
};
|
|
10146
10344
|
if (options?.account) executeParams.account = options.account;
|
|
10147
10345
|
const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
|
|
@@ -10151,6 +10349,39 @@ var ToolRouterSession = class {
|
|
|
10151
10349
|
return ToolRouterSessionExecuteResponseSchema.parse(transformed);
|
|
10152
10350
|
}
|
|
10153
10351
|
/**
|
|
10352
|
+
* Execute a Composio meta tool (`COMPOSIO_*`) within the session.
|
|
10353
|
+
*
|
|
10354
|
+
* `session.execute()` also runs meta tools. This method only accepts meta
|
|
10355
|
+
* tool slugs, so a typo is a type error instead of a failed request. The call
|
|
10356
|
+
* is sent to the Composio backend as is: custom tools named in a
|
|
10357
|
+
* `COMPOSIO_MULTI_EXECUTE_TOOL` call are not run in-process here.
|
|
10358
|
+
*
|
|
10359
|
+
* @param slug - The meta tool slug to execute
|
|
10360
|
+
* @param arguments_ - Optional meta tool arguments
|
|
10361
|
+
* @param options - Experimental. The user's answers to an earlier `ComposioToolInputRequiredError` (`inputResponses`) and its `requestState`, as in `session.execute()`
|
|
10362
|
+
* @returns The tool execution result, in the same shape as `session.execute()`
|
|
10363
|
+
* @throws {ComposioToolInputRequiredError} If the tool needs input from the user (for example an approval) before it can run
|
|
10364
|
+
*
|
|
10365
|
+
* @example
|
|
10366
|
+
* ```typescript
|
|
10367
|
+
* const { data, resultType } = await session.executeMeta('COMPOSIO_SEARCH_TOOLS', {
|
|
10368
|
+
* queries: [{ use_case: 'send an email' }],
|
|
10369
|
+
* });
|
|
10370
|
+
* ```
|
|
10371
|
+
*/
|
|
10372
|
+
async executeMeta(slug, arguments_, options, requestOptions) {
|
|
10373
|
+
const executeMetaParams = {
|
|
10374
|
+
slug,
|
|
10375
|
+
arguments: arguments_ ?? {},
|
|
10376
|
+
...inputResponseParams(options)
|
|
10377
|
+
};
|
|
10378
|
+
const experimental = inlineCustomToolsExperimental(this.inlineCustomToolsPayload);
|
|
10379
|
+
if (experimental) executeMetaParams.experimental = experimental;
|
|
10380
|
+
const response = await withCancellation(() => this.client.toolRouter.session.executeMeta(this.sessionId, executeMetaParams, withoutRetries(requestOptions)), requestOptions?.signal);
|
|
10381
|
+
const transformed = transformExecuteResponse(response, slug);
|
|
10382
|
+
return ToolRouterSessionExecuteResponseSchema.parse(transformed);
|
|
10383
|
+
}
|
|
10384
|
+
/**
|
|
10154
10385
|
* Proxy an API call through Composio's auth layer using the session's connected account.
|
|
10155
10386
|
* The backend resolves the connected account from the toolkit within the session.
|
|
10156
10387
|
*
|
|
@@ -10489,6 +10720,7 @@ var ToolRouter = class {
|
|
|
10489
10720
|
});
|
|
10490
10721
|
const experimentalPayload = {};
|
|
10491
10722
|
if (routerConfig.experimental?.sessionConfigId !== void 0) experimentalPayload.session_config_id = routerConfig.experimental.sessionConfigId;
|
|
10723
|
+
if (routerConfig.experimental?.noElicitationSupportFallback !== void 0) experimentalPayload.no_elicitation_support_fallback = routerConfig.experimental.noElicitationSupportFallback;
|
|
10492
10724
|
if (routerConfig.experimental?.assistivePrompt?.userTimezone) experimentalPayload.assistive_prompt_config = { user_timezone: routerConfig.experimental.assistivePrompt.userTimezone };
|
|
10493
10725
|
if (inlineCustomToolsPayload?.custom_tools) experimentalPayload.custom_tools = inlineCustomToolsPayload.custom_tools;
|
|
10494
10726
|
if (inlineCustomToolsPayload?.custom_toolkits) experimentalPayload.custom_toolkits = inlineCustomToolsPayload.custom_toolkits;
|
|
@@ -10506,6 +10738,7 @@ var ToolRouter = class {
|
|
|
10506
10738
|
manage_connections: transformToolRouterManageConnectionsParams(routerConfig.manageConnections),
|
|
10507
10739
|
workbench: sandboxPayload,
|
|
10508
10740
|
multi_account: multiAccountPayload,
|
|
10741
|
+
...routerConfig.proxyExecute !== void 0 && { proxy_execute: transformToolRouterProxyExecuteParams(routerConfig.proxyExecute) },
|
|
10509
10742
|
preload: routerConfig.preload,
|
|
10510
10743
|
...isDirectToolsPreset && {
|
|
10511
10744
|
search: { enable: false },
|
|
@@ -10807,13 +11040,14 @@ var Composio = class Composio {
|
|
|
10807
11040
|
orgId: scope.orgId,
|
|
10808
11041
|
projectId: scope.projectId
|
|
10809
11042
|
};
|
|
10810
|
-
const defaultHeaders =
|
|
11043
|
+
const defaultHeaders = {
|
|
10811
11044
|
...this.config.defaultHeaders,
|
|
10812
11045
|
...getScopeHeaders(scope)
|
|
10813
|
-
}
|
|
11046
|
+
};
|
|
10814
11047
|
/**
|
|
10815
11048
|
* Initialize the Composio SDK client.
|
|
10816
|
-
* The client is used to make API calls to the Composio API.
|
|
11049
|
+
* The client is used to make API calls to the Composio API. It sends the
|
|
11050
|
+
* SDK's identity headers from `identity`, and refuses them in `defaultHeaders`.
|
|
10817
11051
|
*/
|
|
10818
11052
|
this.client = new ComposioClient({
|
|
10819
11053
|
apiKey: apiKeyParsed,
|
|
@@ -10821,6 +11055,7 @@ var Composio = class Composio {
|
|
|
10821
11055
|
orgApiKey: config?.orgApiKey,
|
|
10822
11056
|
baseURL: baseURLParsed,
|
|
10823
11057
|
defaultHeaders,
|
|
11058
|
+
identity: getClientIdentity(this.provider),
|
|
10824
11059
|
logger: clientLoggerAdapter,
|
|
10825
11060
|
logLevel: toClientLogLevel(logger.getLevel())
|
|
10826
11061
|
});
|
|
@@ -10904,8 +11139,8 @@ var Composio = class Composio {
|
|
|
10904
11139
|
* instance directly with the headers you need: `new Composio({ ...existingConfig, defaultHeaders })`.
|
|
10905
11140
|
* For one-off overrides, pass per-call `requestOptions` where supported.
|
|
10906
11141
|
*
|
|
10907
|
-
* @param {
|
|
10908
|
-
*
|
|
11142
|
+
* @param {object} [options] - Options for the new instance.
|
|
11143
|
+
* @param {ComposioRequestHeaders} [options.headers] - Headers sent with every API call the new instance makes.
|
|
10909
11144
|
* @returns {Composio<TProvider>} A new Composio instance with the custom request options applied.
|
|
10910
11145
|
*
|
|
10911
11146
|
* @example
|
|
@@ -10930,10 +11165,10 @@ var Composio = class Composio {
|
|
|
10930
11165
|
*/
|
|
10931
11166
|
createSession(options) {
|
|
10932
11167
|
const userApiKeyHeader = getUserApiKeyHeader(options?.headers) ? void 0 : getUserApiKeyHeader(this.config.defaultHeaders);
|
|
10933
|
-
const sessionHeaders =
|
|
11168
|
+
const sessionHeaders = userApiKeyHeader ? {
|
|
10934
11169
|
[userApiKeyHeader.name]: userApiKeyHeader.value,
|
|
10935
11170
|
...options?.headers
|
|
10936
|
-
} : options?.headers
|
|
11171
|
+
} : options?.headers;
|
|
10937
11172
|
return new Composio({
|
|
10938
11173
|
...this.config,
|
|
10939
11174
|
defaultHeaders: sessionHeaders
|
|
@@ -11768,4 +12003,4 @@ const ComposioMcpUpdateResponseSchema = z$1.object({
|
|
|
11768
12003
|
});
|
|
11769
12004
|
|
|
11770
12005
|
//#endregion
|
|
11771
|
-
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIKeyKindError, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioConnectedAccountNotRevokableError, ComposioConnectedAccountRevocationNotSupportedError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMCPDestinationError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioScopeConfigError, ComposioSensitiveFilePathBlockedError, ComposioSessionConfigConflictError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolFetchError, ComposioToolInputRequiredError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountCompleteAuthParamsSchema, ConnectedAccountCompleteAuthResponseSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountRevokeResponseSchema, ConnectedAccountRevokedTokenSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, CustomToolkitAuthSchemeSchema, CustomToolkitDeleteResponseSchema, CustomToolkitSyncParamsSchema, CustomToolkitSyncResponseSchema, CustomToolkitUpsertParamsSchema, CustomToolkitUpsertResponseSchema, CustomToolkits, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, Keyring, KeyringTransferKeySchema, KeyringTransferKeysResponseSchema, LogSearchFilterFieldSchema, LogSearchFilterOperatorSchema, LogSearchFilterSchema, LogSearchParamsSchema, LogSearchResponseSchema, LogSearchTimeRangeSchema, Logs, MAX_URL_UPLOAD_SIZE_BYTES, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionConfigListParamsSchema, SessionConfigListResponseSchema, SessionConfigPolicySchema, SessionConfigSchema, SessionConfigSummarySchema, SessionConfigs, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolExecutionLogDetailSchema, ToolExecutionLogLevelSchema, ToolExecutionLogMetadataSchema, ToolExecutionLogParentSchema, ToolExecutionLogSchema, ToolExecutionLogStatusSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterErrorCodes, ToolRouterInstantSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionEnsureConnectedOptionsSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionListConfigHistoryOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateExperimentalSchema, ToolRouterUpdateManageConnectionsSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitChangelogItemSchema, ToolkitChangelogResponseSchema, ToolkitConditionalScopeSchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitGetManySlugsSchema, ToolkitGrantContextDimensionSchema, ToolkitLatestVersionSchema, ToolkitListGrantContextsParamsSchema, ToolkitListGrantContextsResponseSchema, ToolkitMangedByEnumSchema, ToolkitRecommendScopesParamsSchema, ToolkitRecommendScopesResponseSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionChangelogSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsGetManyParamsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, Usage, UsageBreakdownGroupSchema, UsageBreakdownParamsSchema, UsageBreakdownResponseSchema, UsageEntitySummarySchema, UsageFiltersSchema, UsageOrderBySchema, UsageOrderDirectionSchema, UsageSummaryParamsSchema, UsageSummaryResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEndpointCreateParamsSchema, WebhookEndpointListItemSchema, WebhookEndpointListParamsSchema, WebhookEndpointListResponseSchema, WebhookEndpointReplaceParamsSchema, WebhookEndpointSchema, WebhookEndpointUpdateParamsSchema, WebhookEndpoints, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookSubscriptionDeleteResponseSchema, WebhookSubscriptionEventTypeSchema, WebhookSubscriptionEventTypesResponseSchema, WebhookSubscriptionListParamsSchema, WebhookSubscriptionListResponseSchema, WebhookSubscriptionRotateSecretResponseSchema, WebhookSubscriptionSchema, WebhookSubscriptionSetParamsSchema, WebhookSubscriptionUpdateParamsSchema, WebhookSubscriptions, WebhookTriggerPayloadV3Schema, WebhookVersionSchema, WebhookVersions, Webhooks, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };
|
|
12006
|
+
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAPIKeyKindError, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioConnectedAccountNotRevokableError, ComposioConnectedAccountRevocationNotSupportedError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMCPDestinationError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioScopeConfigError, ComposioSensitiveFilePathBlockedError, ComposioSessionConfigConflictError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolFetchError, ComposioToolInputRequiredError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountCompleteAuthParamsSchema, ConnectedAccountCompleteAuthResponseSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountRevokeResponseSchema, ConnectedAccountRevokedTokenSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, CustomToolkitAuthSchemeSchema, CustomToolkitDeleteResponseSchema, CustomToolkitSyncParamsSchema, CustomToolkitSyncResponseSchema, CustomToolkitUpsertParamsSchema, CustomToolkitUpsertResponseSchema, CustomToolkits, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, Keyring, KeyringTransferKeySchema, KeyringTransferKeysResponseSchema, LogSearchFilterFieldSchema, LogSearchFilterOperatorSchema, LogSearchFilterSchema, LogSearchParamsSchema, LogSearchResponseSchema, LogSearchTimeRangeSchema, Logs, MAX_URL_UPLOAD_SIZE_BYTES, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionConfigListParamsSchema, SessionConfigListResponseSchema, SessionConfigPolicySchema, SessionConfigSchema, SessionConfigSummarySchema, SessionConfigs, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolExecutionLogDetailSchema, ToolExecutionLogLevelSchema, ToolExecutionLogMetadataSchema, ToolExecutionLogParentSchema, ToolExecutionLogSchema, ToolExecutionLogStatusSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterErrorCodes, ToolRouterInstantSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterProxyExecuteConfigSchema, ToolRouterProxyExecuteSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionEnsureConnectedOptionsSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionListConfigHistoryOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateExperimentalSchema, ToolRouterUpdateManageConnectionsSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitChangelogItemSchema, ToolkitChangelogResponseSchema, ToolkitConditionalScopeSchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitGetManySlugsSchema, ToolkitGrantContextDimensionSchema, ToolkitLatestVersionSchema, ToolkitListGrantContextsParamsSchema, ToolkitListGrantContextsResponseSchema, ToolkitMangedByEnumSchema, ToolkitRecommendScopesParamsSchema, ToolkitRecommendScopesResponseSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionChangelogSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsGetManyParamsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, Usage, UsageBreakdownGroupSchema, UsageBreakdownParamsSchema, UsageBreakdownResponseSchema, UsageEntitySummarySchema, UsageFiltersSchema, UsageOrderBySchema, UsageOrderDirectionSchema, UsageSummaryParamsSchema, UsageSummaryResponseSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEndpointCreateParamsSchema, WebhookEndpointListItemSchema, WebhookEndpointListParamsSchema, WebhookEndpointListResponseSchema, WebhookEndpointReplaceParamsSchema, WebhookEndpointSchema, WebhookEndpointUpdateParamsSchema, WebhookEndpoints, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookSubscriptionDeleteResponseSchema, WebhookSubscriptionEventTypeSchema, WebhookSubscriptionEventTypesResponseSchema, WebhookSubscriptionListParamsSchema, WebhookSubscriptionListResponseSchema, WebhookSubscriptionRotateSecretResponseSchema, WebhookSubscriptionSchema, WebhookSubscriptionSetParamsSchema, WebhookSubscriptionUpdateParamsSchema, WebhookSubscriptions, WebhookTriggerPayloadV3Schema, WebhookVersionSchema, WebhookVersions, Webhooks, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, ensureObjectTypeOnProperties, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, omitNullToolArguments, readResponseBodyWithLimit, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry, toStrictJsonSchema };
|