@composio/core 0.21.0 → 0.23.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-BHOYxLZX.d.mts → CustomTool-CnHdegDK.d.mts} +1 -1
- package/dist/{CustomTool-B-_VjWpy.mjs → CustomTool-CnJxXr07.mjs} +1 -1
- package/dist/{Telemetry-JRJJYS4I.mjs → Telemetry-41JkqpZ7.mjs} +3 -2
- package/dist/{cancellation-DV8CIi52.mjs → cancellation-BQibgpRG.mjs} +166 -34
- package/dist/{composio-BTZsFajb.d.mts → composio-Dq708dZS.d.mts} +81 -185
- package/dist/{customTool.types-D_w21L56.d.mts → customTool.types-B8lVpHOP.d.mts} +77 -59
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +4 -4
- package/dist/docs/reference/sdk-reference/typescript/remote-file.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +2 -2
- package/dist/{errors-Dyiu3ifQ.mjs → errors-BN15NcCW.mjs} +34 -2
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +46 -6
- package/dist/index.mjs +315 -363
- package/dist/models/Files.node.mjs +1 -1
- package/dist/platform/node.d.mts +1 -1
- package/dist/platform/node.mjs +13 -0
- package/dist/platform/workerd.d.mts +1 -1
- package/dist/platform/workerd.mjs +3 -0
- package/dist/{types-D5A2wzBl.d.mts → types-DuVZKrXO.d.mts} +2 -0
- package/dist/{types-CgRsUGqm.d.mts → types-eTw8Yw7Y.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 +10 -7
- package/src/errors/ToolRouterErrors.ts +65 -0
- package/src/lib/toolRouterParams.ts +8 -10
- package/src/models/AuthConfigs.ts +0 -9
- package/src/models/ConnectionRequest.ts +21 -18
- package/src/models/CustomToolkits.ts +1 -1
- package/src/models/Logs.ts +2 -2
- package/src/models/RemoteFile.ts +24 -5
- package/src/models/SessionContext.ts +24 -4
- package/src/models/ToolRouter.ts +3 -3
- package/src/models/ToolRouterSession.ts +45 -13
- package/src/models/Tools.ts +21 -37
- package/src/models/Usage.ts +2 -1
- package/src/models/customToolExecution.ts +10 -0
- package/src/platform/node.ts +16 -0
- package/src/platform/types.ts +3 -0
- package/src/platform/workerd.ts +4 -0
- package/src/provider/BaseProvider.ts +2 -1
- package/src/provider/OpenAIProvider.ts +0 -283
- package/src/telemetry/Telemetry.ts +4 -2
- package/src/types/logs.types.ts +9 -1
- package/src/types/tool.types.ts +8 -3
- package/src/types/toolRouter.types.ts +27 -19
- package/src/types/usage.types.ts +2 -0
- package/src/utils/jsonSchema.ts +191 -36
- package/src/utils/retries.ts +20 -0
- package/src/utils/safePath.ts +135 -54
- package/src/utils/session.ts +31 -2
- package/src/utils/transformers/logs.ts +3 -2
- package/src/utils/transformers/toolRouterResponseTransform.ts +69 -12
- package/src/utils/transformers/usage.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as ConnectedAccountRevokeResponse, Ba as ToolkitVersionParam, Cn as ConnectedAccountListResponse, D as Session, Da as ToolListParams, Ea as ToolList, En as ConnectedAccountRefreshOptions, Gn as CreateConnectedAccountOptions, M as SessionWithoutMcp, Na as ToolRetrievalOptions, On as ConnectedAccountRetrieveResponse, Q as ToolRouterSessionDeleteResponse, Qn as UpdateConnectedAccountAclParams, Sa as ToolExecuteParams, Vn as CreateConnectedAccountLinkOptions, Zr as McpServerGetResponse, aa as SessionExecuteMetaModifiers, an as ConnectionRequest, ba as ToolExecuteMetaParams, er as UpdateConnectedAccountParams, f as CustomToolkit, hn as ConnectedAccountCompleteAuthResponse, ia as ProviderOptions, in as ComposioRequestOptions, ir as BaseNonAgenticProvider, ja as ToolProxyParams, na as ExecuteToolModifiers, ni as McpUrlResponse, o as CustomTool, oi as ExecuteToolFnOptions, pn as ConnectedAccountCompleteAuthParams, rr as BaseComposioProvider, ui as ToolCallSession, va as SchemaModifierOptions, wa as ToolExecuteResponse, xn as ConnectedAccountListParams, ya as Tool, z as ToolRouterCreateSessionConfig } from "./customTool.types-
|
|
1
|
+
import { An as ConnectedAccountRevokeResponse, Ba as ToolkitVersionParam, Cn as ConnectedAccountListResponse, D as Session, Da as ToolListParams, Ea as ToolList, En as ConnectedAccountRefreshOptions, Gn as CreateConnectedAccountOptions, M as SessionWithoutMcp, Na as ToolRetrievalOptions, On as ConnectedAccountRetrieveResponse, Q as ToolRouterSessionDeleteResponse, Qn as UpdateConnectedAccountAclParams, Sa as ToolExecuteParams, Vn as CreateConnectedAccountLinkOptions, Zr as McpServerGetResponse, aa as SessionExecuteMetaModifiers, an as ConnectionRequest, ba as ToolExecuteMetaParams, er as UpdateConnectedAccountParams, f as CustomToolkit, hn as ConnectedAccountCompleteAuthResponse, ia as ProviderOptions, in as ComposioRequestOptions, ir as BaseNonAgenticProvider, ja as ToolProxyParams, na as ExecuteToolModifiers, ni as McpUrlResponse, o as CustomTool, oi as ExecuteToolFnOptions, pn as ConnectedAccountCompleteAuthParams, rr as BaseComposioProvider, ui as ToolCallSession, va as SchemaModifierOptions, wa as ToolExecuteResponse, xn as ConnectedAccountListParams, ya as Tool, z as ToolRouterCreateSessionConfig } from "./customTool.types-B8lVpHOP.mjs";
|
|
2
2
|
import ComposioClient, { Composio } from "@composio/client";
|
|
3
3
|
import z, { z as z$1 } from "zod/v3";
|
|
4
4
|
import { Files } from "#files";
|
|
@@ -8,7 +8,6 @@ import { ToolGetInputParams, ToolGetInputResponse, ToolProxyResponse, ToolRetrie
|
|
|
8
8
|
import { TriggersTypeRetrieveEnumResponse } from "@composio/client/resources/index";
|
|
9
9
|
import { AuthConfigDeleteResponse, AuthConfigUpdateResponse, AuthConfigUpdateStatusResponse } from "@composio/client/resources/auth-configs";
|
|
10
10
|
import { OpenAI } from "openai";
|
|
11
|
-
import { Stream } from "openai/streaming";
|
|
12
11
|
//#region src/models/Tools.d.ts
|
|
13
12
|
type ToolRouterSessionExecuteOptions = {
|
|
14
13
|
experimental?: SessionExecuteParams.Experimental;
|
|
@@ -29,26 +28,7 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
29
28
|
* Scoped per-instance so a fresh `Composio` starts with a clean slate.
|
|
30
29
|
*/
|
|
31
30
|
private readonly warnedAutoUploadDisabledForTool;
|
|
32
|
-
/**
|
|
33
|
-
* Lazily-built sibling client with retries disabled; see `clientWithoutRetries`.
|
|
34
|
-
*/
|
|
35
|
-
private clientWithoutRetriesCache?;
|
|
36
31
|
constructor(client: ComposioClient, config?: ComposioConfig<TProvider>);
|
|
37
|
-
/**
|
|
38
|
-
* A cached sibling client that never retries requests, mirroring Python's
|
|
39
|
-
* `client.without_retries`.
|
|
40
|
-
*
|
|
41
|
-
* Used for non-idempotent writes (`tools.execute` / `tools.proxy`), where a
|
|
42
|
-
* silent retry after a read timeout can duplicate a side effect (e.g. send an
|
|
43
|
-
* email twice). Reads keep the default retry behaviour, and so do other writes
|
|
44
|
-
* (`toolRouter.session.execute`, auth-config and connected-account mutations):
|
|
45
|
-
* the durable fix there is backend-honoured idempotency keys, tracked
|
|
46
|
-
* separately.
|
|
47
|
-
*
|
|
48
|
-
* Cached rather than rebuilt per call because `withOptions` constructs a fresh
|
|
49
|
-
* client; its options never change, so one per `Tools` instance suffices.
|
|
50
|
-
*/
|
|
51
|
-
private get clientWithoutRetries();
|
|
52
32
|
/**
|
|
53
33
|
* Transforms tool data from snake_case API format to camelCase for internal SDK use.
|
|
54
34
|
*
|
|
@@ -511,6 +491,7 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
511
491
|
* @param {string} body.endpoint - Path relative to the toolkit's base URL, or an absolute URL
|
|
512
492
|
* @param {'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'} body.method - HTTP method
|
|
513
493
|
* @param {string} [body.connectedAccountId] - The connected account to authenticate as
|
|
494
|
+
* @param {string} [body.userId] - The user the connected account belongs to. Projects with 2FA enabled check it against the connected account and may require it
|
|
514
495
|
* @param {unknown} [body.body] - JSON request body
|
|
515
496
|
* @param {Array<{ in: 'query' | 'header'; name: string; value: string | number }>} [body.parameters] - Extra query parameters or headers
|
|
516
497
|
* @returns {Promise<ToolProxyResponse>} The upstream status, headers, and parsed body
|
|
@@ -4624,12 +4605,6 @@ declare class Triggers<TProvider extends BaseComposioProvider<unknown, unknown,
|
|
|
4624
4605
|
declare class AuthConfigs {
|
|
4625
4606
|
private client;
|
|
4626
4607
|
constructor(client: ComposioClient);
|
|
4627
|
-
/**
|
|
4628
|
-
* Protected getter for the client instance.
|
|
4629
|
-
* This is primarily used for testing purposes.
|
|
4630
|
-
* @protected
|
|
4631
|
-
*/
|
|
4632
|
-
protected getClient(): ComposioClient;
|
|
4633
4608
|
/**
|
|
4634
4609
|
* Lists authentication configurations based on provided filter criteria.
|
|
4635
4610
|
*
|
|
@@ -5325,13 +5300,17 @@ declare const UsageSummaryResponseSchema: z$1.ZodObject<{
|
|
|
5325
5300
|
totalQuantity: string;
|
|
5326
5301
|
eventCount: number;
|
|
5327
5302
|
}>>;
|
|
5303
|
+
/** Total Instant charge for the window, in USD as an exact decimal string. */
|
|
5304
|
+
instantCharge: z$1.ZodString;
|
|
5328
5305
|
}, "strip", z$1.ZodTypeAny, {
|
|
5306
|
+
instantCharge: string;
|
|
5329
5307
|
entities: Record<string, {
|
|
5330
5308
|
unit: string;
|
|
5331
5309
|
totalQuantity: string;
|
|
5332
5310
|
eventCount: number;
|
|
5333
5311
|
}>;
|
|
5334
5312
|
}, {
|
|
5313
|
+
instantCharge: string;
|
|
5335
5314
|
entities: Record<string, {
|
|
5336
5315
|
unit: string;
|
|
5337
5316
|
totalQuantity: string;
|
|
@@ -5403,6 +5382,7 @@ type UsageBreakdownResponse = z$1.infer<typeof UsageBreakdownResponseSchema>;
|
|
|
5403
5382
|
* ```typescript
|
|
5404
5383
|
* const summary = await composio.experimental.usage.summary();
|
|
5405
5384
|
* console.log(summary.entities.tool_calls?.totalQuantity);
|
|
5385
|
+
* console.log(summary.instantCharge); // exact USD string
|
|
5406
5386
|
*
|
|
5407
5387
|
* const byTool = await composio.experimental.usage.breakdown('tool_calls', {
|
|
5408
5388
|
* groupBy: 'tool_slug',
|
|
@@ -5418,7 +5398,7 @@ declare class Usage {
|
|
|
5418
5398
|
* **Experimental — shape may change in future releases.**
|
|
5419
5399
|
*
|
|
5420
5400
|
* @param {UsageSummaryParams} [params] - Optional range, `entityTypes` and filters
|
|
5421
|
-
* @returns {Promise<UsageSummaryResponse>} Totals keyed by entity type
|
|
5401
|
+
* @returns {Promise<UsageSummaryResponse>} Totals keyed by entity type and the exact USD Instant charge
|
|
5422
5402
|
* @throws {ValidationError} If the params fail validation
|
|
5423
5403
|
*
|
|
5424
5404
|
* @example
|
|
@@ -7176,6 +7156,15 @@ declare const ToolExecutionLogParentSchema: z$1.ZodNullable<z$1.ZodObject<{
|
|
|
7176
7156
|
logId: string;
|
|
7177
7157
|
toolSlug: string;
|
|
7178
7158
|
}>>;
|
|
7159
|
+
/** Tool log metadata, including the optional exact USD Instant charge. */
|
|
7160
|
+
declare const ToolExecutionLogMetadataSchema: z$1.ZodObject<{
|
|
7161
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7162
|
+
}, "strip", z$1.ZodUnknown, z$1.objectOutputType<{
|
|
7163
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7164
|
+
}, z$1.ZodUnknown, "strip">, z$1.objectInputType<{
|
|
7165
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7166
|
+
}, z$1.ZodUnknown, "strip">>;
|
|
7167
|
+
type ToolExecutionLogMetadata = z$1.infer<typeof ToolExecutionLogMetadataSchema>;
|
|
7179
7168
|
/**
|
|
7180
7169
|
* A tool-execution log entry as returned by `composio.logs.search()`.
|
|
7181
7170
|
*/
|
|
@@ -7188,7 +7177,13 @@ declare const ToolExecutionLogSchema: z$1.ZodObject<{
|
|
|
7188
7177
|
status: z$1.ZodEnum<["success", "failed"]>;
|
|
7189
7178
|
level: z$1.ZodEnum<["info", "error", "warn"]>;
|
|
7190
7179
|
message: z$1.ZodOptional<z$1.ZodString>;
|
|
7191
|
-
metadata: z$1.
|
|
7180
|
+
metadata: z$1.ZodObject<{
|
|
7181
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7182
|
+
}, "strip", z$1.ZodUnknown, z$1.objectOutputType<{
|
|
7183
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7184
|
+
}, z$1.ZodUnknown, "strip">, z$1.objectInputType<{
|
|
7185
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7186
|
+
}, z$1.ZodUnknown, "strip">>;
|
|
7192
7187
|
metrics: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
7193
7188
|
parent: z$1.ZodNullable<z$1.ZodObject<{
|
|
7194
7189
|
logId: z$1.ZodString;
|
|
@@ -7204,7 +7199,11 @@ declare const ToolExecutionLogSchema: z$1.ZodObject<{
|
|
|
7204
7199
|
type: string;
|
|
7205
7200
|
status: "success" | "failed";
|
|
7206
7201
|
id: string;
|
|
7207
|
-
metadata:
|
|
7202
|
+
metadata: {
|
|
7203
|
+
instant_charge?: string | undefined;
|
|
7204
|
+
} & {
|
|
7205
|
+
[k: string]: unknown;
|
|
7206
|
+
};
|
|
7208
7207
|
timestamp: string;
|
|
7209
7208
|
level: "error" | "warn" | "info";
|
|
7210
7209
|
metrics: Record<string, unknown>;
|
|
@@ -7217,7 +7216,11 @@ declare const ToolExecutionLogSchema: z$1.ZodObject<{
|
|
|
7217
7216
|
type: string;
|
|
7218
7217
|
status: "success" | "failed";
|
|
7219
7218
|
id: string;
|
|
7220
|
-
metadata:
|
|
7219
|
+
metadata: {
|
|
7220
|
+
instant_charge?: string | undefined;
|
|
7221
|
+
} & {
|
|
7222
|
+
[k: string]: unknown;
|
|
7223
|
+
};
|
|
7221
7224
|
timestamp: string;
|
|
7222
7225
|
level: "error" | "warn" | "info";
|
|
7223
7226
|
metrics: Record<string, unknown>;
|
|
@@ -7238,7 +7241,13 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7238
7241
|
status: z$1.ZodEnum<["success", "failed"]>;
|
|
7239
7242
|
level: z$1.ZodEnum<["info", "error", "warn"]>;
|
|
7240
7243
|
message: z$1.ZodOptional<z$1.ZodString>;
|
|
7241
|
-
metadata: z$1.
|
|
7244
|
+
metadata: z$1.ZodObject<{
|
|
7245
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7246
|
+
}, "strip", z$1.ZodUnknown, z$1.objectOutputType<{
|
|
7247
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7248
|
+
}, z$1.ZodUnknown, "strip">, z$1.objectInputType<{
|
|
7249
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7250
|
+
}, z$1.ZodUnknown, "strip">>;
|
|
7242
7251
|
metrics: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
7243
7252
|
parent: z$1.ZodNullable<z$1.ZodObject<{
|
|
7244
7253
|
logId: z$1.ZodString;
|
|
@@ -7254,7 +7263,11 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7254
7263
|
type: string;
|
|
7255
7264
|
status: "success" | "failed";
|
|
7256
7265
|
id: string;
|
|
7257
|
-
metadata:
|
|
7266
|
+
metadata: {
|
|
7267
|
+
instant_charge?: string | undefined;
|
|
7268
|
+
} & {
|
|
7269
|
+
[k: string]: unknown;
|
|
7270
|
+
};
|
|
7258
7271
|
timestamp: string;
|
|
7259
7272
|
level: "error" | "warn" | "info";
|
|
7260
7273
|
metrics: Record<string, unknown>;
|
|
@@ -7267,7 +7280,11 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7267
7280
|
type: string;
|
|
7268
7281
|
status: "success" | "failed";
|
|
7269
7282
|
id: string;
|
|
7270
|
-
metadata:
|
|
7283
|
+
metadata: {
|
|
7284
|
+
instant_charge?: string | undefined;
|
|
7285
|
+
} & {
|
|
7286
|
+
[k: string]: unknown;
|
|
7287
|
+
};
|
|
7271
7288
|
timestamp: string;
|
|
7272
7289
|
level: "error" | "warn" | "info";
|
|
7273
7290
|
metrics: Record<string, unknown>;
|
|
@@ -7284,7 +7301,11 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7284
7301
|
type: string;
|
|
7285
7302
|
status: "success" | "failed";
|
|
7286
7303
|
id: string;
|
|
7287
|
-
metadata:
|
|
7304
|
+
metadata: {
|
|
7305
|
+
instant_charge?: string | undefined;
|
|
7306
|
+
} & {
|
|
7307
|
+
[k: string]: unknown;
|
|
7308
|
+
};
|
|
7288
7309
|
timestamp: string;
|
|
7289
7310
|
level: "error" | "warn" | "info";
|
|
7290
7311
|
metrics: Record<string, unknown>;
|
|
@@ -7300,7 +7321,11 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7300
7321
|
type: string;
|
|
7301
7322
|
status: "success" | "failed";
|
|
7302
7323
|
id: string;
|
|
7303
|
-
metadata:
|
|
7324
|
+
metadata: {
|
|
7325
|
+
instant_charge?: string | undefined;
|
|
7326
|
+
} & {
|
|
7327
|
+
[k: string]: unknown;
|
|
7328
|
+
};
|
|
7304
7329
|
timestamp: string;
|
|
7305
7330
|
level: "error" | "warn" | "info";
|
|
7306
7331
|
metrics: Record<string, unknown>;
|
|
@@ -7325,7 +7350,13 @@ declare const ToolExecutionLogDetailSchema: z$1.ZodObject<{
|
|
|
7325
7350
|
status: z$1.ZodEnum<["success", "failed"]>;
|
|
7326
7351
|
level: z$1.ZodEnum<["info", "error", "warn"]>;
|
|
7327
7352
|
message: z$1.ZodOptional<z$1.ZodString>;
|
|
7328
|
-
metadata: z$1.
|
|
7353
|
+
metadata: z$1.ZodObject<{
|
|
7354
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7355
|
+
}, "strip", z$1.ZodUnknown, z$1.objectOutputType<{
|
|
7356
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7357
|
+
}, z$1.ZodUnknown, "strip">, z$1.objectInputType<{
|
|
7358
|
+
instant_charge: z$1.ZodOptional<z$1.ZodString>;
|
|
7359
|
+
}, z$1.ZodUnknown, "strip">>;
|
|
7329
7360
|
metrics: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
7330
7361
|
parent: z$1.ZodNullable<z$1.ZodObject<{
|
|
7331
7362
|
logId: z$1.ZodString;
|
|
@@ -7382,7 +7413,11 @@ declare const ToolExecutionLogDetailSchema: z$1.ZodObject<{
|
|
|
7382
7413
|
status: "success" | "failed";
|
|
7383
7414
|
data: Record<string, unknown>;
|
|
7384
7415
|
id: string;
|
|
7385
|
-
metadata:
|
|
7416
|
+
metadata: {
|
|
7417
|
+
instant_charge?: string | undefined;
|
|
7418
|
+
} & {
|
|
7419
|
+
[k: string]: unknown;
|
|
7420
|
+
};
|
|
7386
7421
|
timestamp: string;
|
|
7387
7422
|
level: "error" | "warn" | "info";
|
|
7388
7423
|
metrics: Record<string, unknown>;
|
|
@@ -7410,7 +7445,11 @@ declare const ToolExecutionLogDetailSchema: z$1.ZodObject<{
|
|
|
7410
7445
|
status: "success" | "failed";
|
|
7411
7446
|
data: Record<string, unknown>;
|
|
7412
7447
|
id: string;
|
|
7413
|
-
metadata:
|
|
7448
|
+
metadata: {
|
|
7449
|
+
instant_charge?: string | undefined;
|
|
7450
|
+
} & {
|
|
7451
|
+
[k: string]: unknown;
|
|
7452
|
+
};
|
|
7414
7453
|
timestamp: string;
|
|
7415
7454
|
level: "error" | "warn" | "info";
|
|
7416
7455
|
metrics: Record<string, unknown>;
|
|
@@ -7457,7 +7496,7 @@ declare class Logs {
|
|
|
7457
7496
|
* pagination.
|
|
7458
7497
|
*
|
|
7459
7498
|
* @param {LogSearchParams} [params] - Filters, `timeRange`, `limit` and `cursor`
|
|
7460
|
-
* @returns {Promise<LogSearchResponse>} Matching logs and the next cursor
|
|
7499
|
+
* @returns {Promise<LogSearchResponse>} Matching logs and the next cursor. Charged calls include `metadata.instant_charge` as an exact USD string.
|
|
7461
7500
|
* @throws {ValidationError} If the params fail validation
|
|
7462
7501
|
*
|
|
7463
7502
|
* @example
|
|
@@ -7477,7 +7516,7 @@ declare class Logs {
|
|
|
7477
7516
|
* source and raw `data`).
|
|
7478
7517
|
*
|
|
7479
7518
|
* @param {string} id - The log id
|
|
7480
|
-
* @returns {Promise<ToolExecutionLogDetail>} The log detail
|
|
7519
|
+
* @returns {Promise<ToolExecutionLogDetail>} The log detail, with an optional exact USD charge in `metadata.instant_charge`
|
|
7481
7520
|
*
|
|
7482
7521
|
* @example
|
|
7483
7522
|
* ```typescript
|
|
@@ -8298,149 +8337,6 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
|
|
|
8298
8337
|
*/
|
|
8299
8338
|
handleToolCalls(session: ToolCallSession, chatCompletion: OpenAI.ChatCompletion): Promise<OpenAI.ChatCompletionToolMessageParam[]>;
|
|
8300
8339
|
handleToolCalls(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.ChatCompletionToolMessageParam[]>;
|
|
8301
|
-
/**
|
|
8302
|
-
* Handles all the tool calls from the OpenAI Assistant API.
|
|
8303
|
-
*
|
|
8304
|
-
* This method processes tool calls from an OpenAI Assistant run,
|
|
8305
|
-
* executes each tool call, and returns the tool outputs for submission.
|
|
8306
|
-
*
|
|
8307
|
-
* @deprecated Assistant API is deprecated, please use responses or chat completions instead. This method will be removed in the next major version.
|
|
8308
|
-
*
|
|
8309
|
-
* @param {string} userId - The user ID for authentication and tracking
|
|
8310
|
-
* @param {OpenAI.Beta.Threads.Run} run - The Assistant run object containing tool calls
|
|
8311
|
-
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
8312
|
-
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
8313
|
-
* @returns {Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>} Array of tool outputs for submission
|
|
8314
|
-
*
|
|
8315
|
-
*
|
|
8316
|
-
* @example
|
|
8317
|
-
* ```typescript
|
|
8318
|
-
* // Handle tool calls from an OpenAI Assistant run
|
|
8319
|
-
* const run = {
|
|
8320
|
-
* id: 'run_abc123',
|
|
8321
|
-
* required_action: {
|
|
8322
|
-
* submit_tool_outputs: {
|
|
8323
|
-
* tool_calls: [
|
|
8324
|
-
* {
|
|
8325
|
-
* id: 'call_xyz789',
|
|
8326
|
-
* type: 'function',
|
|
8327
|
-
* function: {
|
|
8328
|
-
* name: 'SEARCH_TOOL',
|
|
8329
|
-
* arguments: '{"query":"composio documentation"}'
|
|
8330
|
-
* }
|
|
8331
|
-
* }
|
|
8332
|
-
* ]
|
|
8333
|
-
* }
|
|
8334
|
-
* }
|
|
8335
|
-
* };
|
|
8336
|
-
*
|
|
8337
|
-
* const toolOutputs = await provider.handleAssistantMessage(
|
|
8338
|
-
* 'user123',
|
|
8339
|
-
* run,
|
|
8340
|
-
* { connectedAccountId: 'conn_xyz456' }
|
|
8341
|
-
* );
|
|
8342
|
-
*
|
|
8343
|
-
* // Submit tool outputs back to OpenAI
|
|
8344
|
-
* await openai.beta.threads.runs.submitToolOutputs(
|
|
8345
|
-
* thread.id,
|
|
8346
|
-
* run.id,
|
|
8347
|
-
* { tool_outputs: toolOutputs }
|
|
8348
|
-
* );
|
|
8349
|
-
* ```
|
|
8350
|
-
*/
|
|
8351
|
-
handleAssistantMessage(userId: string, run: OpenAI.Beta.Threads.Run, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>;
|
|
8352
|
-
/**
|
|
8353
|
-
* Waits for the assistant stream and handles the tool calls.
|
|
8354
|
-
*
|
|
8355
|
-
* This method processes an OpenAI Assistant stream, handles any tool calls
|
|
8356
|
-
* that require action, and yields each event from the stream. It's designed
|
|
8357
|
-
* for streaming Assistant responses while handling tool calls in real-time.
|
|
8358
|
-
*
|
|
8359
|
-
* @deprecated Assistant API is deprecated, please use responses or chat completions instead. It will be removed in the next major version.
|
|
8360
|
-
*
|
|
8361
|
-
* @param {string} userId - The user ID for authentication and tracking
|
|
8362
|
-
* @param {OpenAI} client - The OpenAI client instance
|
|
8363
|
-
* @param {Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>} runStream - The Assistant run stream
|
|
8364
|
-
* @param {OpenAI.Beta.Threads.Thread} thread - The thread object
|
|
8365
|
-
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
8366
|
-
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
8367
|
-
* @returns {AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>} Generator yielding stream events
|
|
8368
|
-
*
|
|
8369
|
-
*
|
|
8370
|
-
*
|
|
8371
|
-
* @example
|
|
8372
|
-
* ```typescript
|
|
8373
|
-
* // Process an OpenAI Assistant stream with tool calls
|
|
8374
|
-
* const thread = await openai.beta.threads.create();
|
|
8375
|
-
* const runStream = openai.beta.threads.runs.stream(thread.id, {
|
|
8376
|
-
* assistant_id: 'asst_abc123',
|
|
8377
|
-
* tools: provider.wrapTools(composioTools)
|
|
8378
|
-
* });
|
|
8379
|
-
*
|
|
8380
|
-
* // Process the stream and handle tool calls
|
|
8381
|
-
* const streamProcessor = provider.waitAndHandleAssistantStreamToolCalls(
|
|
8382
|
-
* 'user123',
|
|
8383
|
-
* openai,
|
|
8384
|
-
* runStream,
|
|
8385
|
-
* thread,
|
|
8386
|
-
* { connectedAccountId: 'conn_xyz456' }
|
|
8387
|
-
* );
|
|
8388
|
-
*
|
|
8389
|
-
* // Consume the stream events
|
|
8390
|
-
* for await (const event of streamProcessor) {
|
|
8391
|
-
* if (event.event === 'thread.message.delta') {
|
|
8392
|
-
* console.log(event.data.delta.content);
|
|
8393
|
-
* }
|
|
8394
|
-
* }
|
|
8395
|
-
* ```
|
|
8396
|
-
*/
|
|
8397
|
-
waitAndHandleAssistantStreamToolCalls(userId: string, client: OpenAI, runStream: Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>, thread: OpenAI.Beta.Threads.Thread, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>;
|
|
8398
|
-
/**
|
|
8399
|
-
* Waits for the assistant tool calls and handles them.
|
|
8400
|
-
*
|
|
8401
|
-
* This method polls an OpenAI Assistant run until it completes or requires action,
|
|
8402
|
-
* handles any tool calls, and returns the final run object. It's designed for
|
|
8403
|
-
* non-streaming Assistant interactions.
|
|
8404
|
-
*
|
|
8405
|
-
* @deprecated Assistant API is deprecated, please use responses or chat completions instead. It will be removed in the next major version.
|
|
8406
|
-
*
|
|
8407
|
-
* @param {string} userId - The user ID for authentication and tracking
|
|
8408
|
-
* @param {OpenAI} client - The OpenAI client instance
|
|
8409
|
-
* @param {OpenAI.Beta.Threads.Run} run - The initial run object
|
|
8410
|
-
* @param {OpenAI.Beta.Threads.Thread} thread - The thread object
|
|
8411
|
-
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
8412
|
-
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
8413
|
-
* @returns {Promise<OpenAI.Beta.Threads.Run>} The final run object after completion
|
|
8414
|
-
*
|
|
8415
|
-
* @example
|
|
8416
|
-
* ```typescript
|
|
8417
|
-
* // Process an OpenAI Assistant run with tool calls
|
|
8418
|
-
* const thread = await openai.beta.threads.create();
|
|
8419
|
-
* await openai.beta.threads.messages.create(thread.id, {
|
|
8420
|
-
* role: 'user',
|
|
8421
|
-
* content: 'Find information about Composio'
|
|
8422
|
-
* });
|
|
8423
|
-
*
|
|
8424
|
-
* let run = await openai.beta.threads.runs.create(thread.id, {
|
|
8425
|
-
* assistant_id: 'asst_abc123',
|
|
8426
|
-
* tools: provider.wrapTools(composioTools)
|
|
8427
|
-
* });
|
|
8428
|
-
*
|
|
8429
|
-
* // Wait for the run to complete, handling any tool calls
|
|
8430
|
-
* run = await provider.waitAndHandleAssistantToolCalls(
|
|
8431
|
-
* 'user123',
|
|
8432
|
-
* openai,
|
|
8433
|
-
* run,
|
|
8434
|
-
* thread,
|
|
8435
|
-
* { connectedAccountId: 'conn_xyz456' }
|
|
8436
|
-
* );
|
|
8437
|
-
*
|
|
8438
|
-
* // Get the final messages after run completion
|
|
8439
|
-
* const messages = await openai.beta.threads.messages.list(thread.id);
|
|
8440
|
-
* console.log(messages.data[0].content);
|
|
8441
|
-
* ```
|
|
8442
|
-
*/
|
|
8443
|
-
waitAndHandleAssistantToolCalls(userId: string, client: OpenAI, run: OpenAI.Beta.Threads.Run, thread: OpenAI.Beta.Threads.Thread, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.Run>;
|
|
8444
8340
|
}
|
|
8445
8341
|
//#endregion
|
|
8446
8342
|
//#region src/types/composio.types.d.ts
|
|
@@ -9030,4 +8926,4 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
9030
8926
|
flush(): Promise<void>;
|
|
9031
8927
|
}
|
|
9032
8928
|
//#endregion
|
|
9033
|
-
export {
|
|
8929
|
+
export { WebhookEndpointListItemSchema as $, WebhookRequestLike as $n, ToolkitListGrantContextsParamsSchema as $r, UsageOrderBySchema as $t, LogSearchFilterSchema as A, TriggerStatusEnum as An, ToolKitListResponse as Ar, CustomToolkitAuthScheme as At, ToolExecutionLogLevelSchema as B, TriggersTypeListResponseSchema as Bn, ToolkitCategory as Br, CustomToolkitUpsertResponse as Bt, SessionConfigSummarySchema as C, TriggerInstanceManageUpdateParamsSchema as Cn, CreateAuthConfigParamsSchema as Cr, WebhookSubscriptionSetParamsSchema as Ct, LogSearchFilterFieldSchema as D, TriggerInstanceUpsertParamsSchema as Dn, CreateCustomAuthConfigParamsSchema as Dr, MCP as Dt, LogSearchFilterField as E, TriggerInstanceUpsertParams as En, CreateComposioManagedAuthConfigParamsSchema as Er, WebhookVersionSchema as Et, LogSearchTimeRange as F, TriggerType as Fn, ToolkitAuthConfigDetailsSchema as Fr, CustomToolkitSyncParamsSchema as Ft, ToolExecutionLogStatusSchema as G, WebhookPayload as Gn, ToolkitChangelogResponseSchema as Gr, UsageBreakdownParams as Gt, ToolExecutionLogMetadataSchema as H, VerifyWebhookParams as Hn, ToolkitChangelogItem as Hr, Usage as Ht, LogSearchTimeRangeSchema as I, TriggerTypeSchema as In, ToolkitAuthField as Ir, CustomToolkitSyncResponse as It, Webhooks as J, WebhookPayloadV1Schema as Jn, ToolkitGetManyParams as Jr, UsageBreakdownResponseSchema as Jt, WebhookEndpoints as K, WebhookPayloadSchema as Kn, ToolkitConditionalScope as Kr, UsageBreakdownParamsSchema as Kt, ToolExecutionLog as L, TriggersTypeListParams as Ln, ToolkitAuthFieldSchema as Lr, CustomToolkitSyncResponseSchema as Lt, LogSearchParamsSchema as M, TriggerStatuses as Mn, ToolKitMeta as Mr, CustomToolkitDeleteResponse as Mt, LogSearchResponse as N, TriggerSubscribeParamSchema as Nn, ToolKitMetaSchema as Nr, CustomToolkitDeleteResponseSchema as Nt, LogSearchFilterOperator as O, TriggerInstanceUpsertResponse as On, ToolKitItem as Or, Experimental as Ot, LogSearchResponseSchema as P, TriggerSubscribeParams as Pn, ToolkitAuthConfigDetails as Pr, CustomToolkitSyncParams as Pt, WebhookEndpointListItem as Q, WebhookPayloadV3Schema as Qn, ToolkitListGrantContextsParams as Qr, UsageFiltersSchema as Qt, ToolExecutionLogDetail as R, TriggersTypeListParamsSchema as Rn, ToolkitAuthFieldsResponse as Rr, CustomToolkitUpsertParams as Rt, SessionConfigSummary as S, TriggerInstanceManageUpdateParams as Sn, CreateAuthConfigParams as Sr, WebhookSubscriptionSetParams as St, LogSearchFilter as T, TriggerInstanceManageUpdateResponseSchema as Tn, CreateAuthConfigResponseSchema as Tr, WebhookSubscriptionUpdateParamsSchema as Tt, ToolExecutionLogParentSchema as U, VerifyWebhookParamsSchema as Un, ToolkitChangelogItemSchema as Ur, UsageBreakdownGroup as Ut, ToolExecutionLogMetadata as V, TriggersTypeRetrieveResponse as Vn, ToolkitCategorySchema as Vr, CustomToolkitUpsertResponseSchema as Vt, ToolExecutionLogSchema as W, VerifyWebhookResult as Wn, ToolkitChangelogResponse as Wr, UsageBreakdownGroupSchema as Wt, WebhookEndpointCreateParams as X, WebhookPayloadV2Schema as Xn, ToolkitGrantContextDimension as Xr, UsageEntitySummarySchema as Xt, WebhookEndpoint as Y, WebhookPayloadV2 as Yn, ToolkitGetManySlugsSchema as Yr, UsageEntitySummary as Yt, WebhookEndpointCreateParamsSchema as Z, WebhookPayloadV3 as Zn, ToolkitGrantContextDimensionSchema as Zr, UsageFilters as Zt, SessionConfigListResponse as _, ToolkitsGetManyParamsSchema as _i, TriggerInstanceListActiveResponseItem as _n, AuthCustomConfigUpdateParamsSchema as _r, WebhookSubscriptionListResponse as _t, ComposioLogger as a, ToolkitRecommendScopesParams as ai, DefaultWebhookSubscriptionEvents as an, AuthConfigCreationToolAccessConfigSchema as ar, WebhookEndpointReplaceParamsSchema as at, SessionConfigPolicySchema as b, TriggerInstanceManageDeleteResponse as bn, AuthSchemeType as br, WebhookSubscriptionRotateSecretResponseSchema as bt, Keyring as c, ToolkitRecommendScopesResponseSchema as ci, ParseWebhookOptions as cn, AuthConfigListResponse as cr, WebhookEndpointUpdateParamsSchema as ct, KeyringTransferKeysResponse as d, ToolkitRetrieveResponse as di, TriggerData as dn, AuthConfigRetrieveResponseSchema as dr, WebhookSubscriptionEventType as dt, ToolkitListGrantContextsResponse as ei, UsageOrderDirectionSchema as en, WebhookSubscription as er, WebhookEndpointListParams as et, KeyringTransferKeysResponseSchema as f, ToolkitRetrieveResponseSchema as fi, TriggerEvent as fn, AuthConfigToolAccessConfigSchema as fr, WebhookSubscriptionEventTypeSchema as ft, SessionConfigListParamsSchema as g, ToolkitVersionChangelogSchema as gi, TriggerInstanceListActiveResponse as gn, AuthConfigUpdateParamsSchema as gr, WebhookSubscriptionListParamsSchema as gt, SessionConfigListParams as h, ToolkitVersionChangelog as hi, TriggerInstanceListActiveParamsSchema as hn, AuthConfigUpdateParams as hr, WebhookSubscriptionListParams as ht, OpenAIProvider as i, ToolkitMangedByEnumSchema as ii, UsageSummaryResponseSchema as in, WebhookVersions as ir, WebhookEndpointReplaceParams as it, LogSearchParams as j, TriggerStatusType as jn, ToolKitListResponseSchema as jr, CustomToolkitAuthSchemeSchema as jt, LogSearchFilterOperatorSchema as k, TriggerInstanceUpsertResponseSchema as kn, ToolKitItemSchema as kr, CustomToolkits as kt, KeyringTransferKey as l, ToolkitRetrieveCategoriesResponse as li, SetWebhookSubscriptionParams as ln, AuthConfigListResponseSchema as lr, WebhookSubscriptionDeleteResponse as lt, SessionConfig as m, ToolkitSortByEnumSchema as mi, TriggerInstanceListActiveParams as mn, AuthConfigTypes as mr, WebhookSubscriptionEventTypesResponseSchema as mt, ComposioConfig as n, ToolkitListParams as ni, UsageSummaryParamsSchema as nn, WebhookTriggerPayloadV3Schema as nr, WebhookEndpointListResponse as nt, LogLevel as o, ToolkitRecommendScopesParamsSchema as oi, IncomingTriggerPayload as on, AuthConfigListParams as or, WebhookEndpointSchema as ot, SessionConfigs as p, ToolkitSortByEnum as pi, TriggerEventData as pn, AuthConfigType as pr, WebhookSubscriptionEventTypesResponse as pt, WebhookSubscriptions as q, WebhookPayloadV1 as qn, ToolkitConditionalScopeSchema as qr, UsageBreakdownResponse as qt, Sessions as r, ToolkitMangedByEnum as ri, UsageSummaryResponse as rn, WebhookVersion as rr, WebhookEndpointListResponseSchema as rt, logger as s, ToolkitRecommendScopesResponse as si, IncomingTriggerPayloadSchema as sn, AuthConfigListParamsSchema as sr, WebhookEndpointUpdateParams as st, Composio$1 as t, ToolkitListGrantContextsResponseSchema as ti, UsageSummaryParams as tn, WebhookTriggerPayloadV3 as tr, WebhookEndpointListParamsSchema as tt, KeyringTransferKeySchema as u, ToolkitRetrieveCategoriesResponseSchema as ui, SetWebhookSubscriptionParamsSchema as un, AuthConfigRetrieveResponse as ur, WebhookSubscriptionDeleteResponseSchema as ut, SessionConfigListResponseSchema as v, ToolkitsListParamsSchema as vi, TriggerInstanceListActiveResponseItemSchema as vn, AuthDefaultConfigUpdateParamsSchema as vr, WebhookSubscriptionListResponseSchema as vt, Logs as w, TriggerInstanceManageUpdateResponse as wn, CreateAuthConfigResponse as wr, WebhookSubscriptionUpdateParams as wt, SessionConfigSchema as x, TriggerInstanceManageDeleteResponseSchema as xn, AuthSchemeTypes as xr, WebhookSubscriptionSchema as xt, SessionConfigPolicy as y, TriggerInstanceListActiveResponseSchema as yn, AuthSchemeEnum as yr, WebhookSubscriptionRotateSecretResponse as yt, ToolExecutionLogDetailSchema as z, TriggersTypeListResponse as zn, ToolkitAuthFieldsResponseSchema as zr, CustomToolkitUpsertParamsSchema as zt };
|