@composio/core 0.2.1 → 0.2.3
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/index.cjs +65 -21
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +65 -21
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1611,7 +1611,7 @@ var TelemetryTransport = class {
|
|
|
1611
1611
|
const descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
1612
1612
|
return key !== "constructor" && descriptor && typeof descriptor.value === "function" && descriptor.value.constructor.name === "AsyncFunction";
|
|
1613
1613
|
});
|
|
1614
|
-
const instrumentedClassName =
|
|
1614
|
+
const instrumentedClassName = fileName ?? instance.constructor?.name ?? "unknown";
|
|
1615
1615
|
for (const name of methodNames) {
|
|
1616
1616
|
const originalMethod = instance[name];
|
|
1617
1617
|
instance[name] = async (...args) => {
|
|
@@ -1952,7 +1952,13 @@ var ConnectedAccountAuthConfigSchema = import_v36.z.object({
|
|
|
1952
1952
|
var ConnectedAccountRetrieveResponseSchema = import_v36.z.object({
|
|
1953
1953
|
id: import_v36.z.string(),
|
|
1954
1954
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
1955
|
+
/**
|
|
1956
|
+
* @deprecated use connectedAccount.state instead
|
|
1957
|
+
*/
|
|
1955
1958
|
data: import_v36.z.record(import_v36.z.string(), import_v36.z.unknown()).optional(),
|
|
1959
|
+
/**
|
|
1960
|
+
* @deprecated use connectedAccount.state instead
|
|
1961
|
+
*/
|
|
1956
1962
|
params: import_v36.z.record(import_v36.z.string(), import_v36.z.unknown()).optional(),
|
|
1957
1963
|
status: ConnectedAccountStatusSchema,
|
|
1958
1964
|
statusReason: import_v36.z.string().nullable(),
|
|
@@ -2063,7 +2069,7 @@ var CustomTools = class {
|
|
|
2063
2069
|
}
|
|
2064
2070
|
this.client = client;
|
|
2065
2071
|
this.customToolsRegistry = /* @__PURE__ */ new Map();
|
|
2066
|
-
telemetry.instrument(this);
|
|
2072
|
+
telemetry.instrument(this, "CustomTools");
|
|
2067
2073
|
}
|
|
2068
2074
|
/**
|
|
2069
2075
|
* Create a custom tool and registers it in the registry.
|
|
@@ -2096,7 +2102,7 @@ var CustomTools = class {
|
|
|
2096
2102
|
if (!slug || !execute || !inputParams || !name) {
|
|
2097
2103
|
throw new Error("Invalid tool options");
|
|
2098
2104
|
}
|
|
2099
|
-
const paramsSchema =
|
|
2105
|
+
const paramsSchema = (0, import_zod_to_json_schema.default)(inputParams, {
|
|
2100
2106
|
name: "input"
|
|
2101
2107
|
});
|
|
2102
2108
|
const paramsSchemaJson = paramsSchema.definitions.input;
|
|
@@ -2771,7 +2777,7 @@ var Tools = class {
|
|
|
2771
2777
|
this.provider._setExecuteToolFn(this.execute);
|
|
2772
2778
|
this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
|
|
2773
2779
|
this.getRawComposioTools = this.getRawComposioTools.bind(this);
|
|
2774
|
-
telemetry.instrument(this);
|
|
2780
|
+
telemetry.instrument(this, "Tools");
|
|
2775
2781
|
}
|
|
2776
2782
|
/**
|
|
2777
2783
|
* Transforms tool data from snake_case API format to camelCase for internal SDK use.
|
|
@@ -3564,7 +3570,7 @@ var AuthConfigs = class {
|
|
|
3564
3570
|
client;
|
|
3565
3571
|
constructor(client) {
|
|
3566
3572
|
this.client = client;
|
|
3567
|
-
telemetry.instrument(this);
|
|
3573
|
+
telemetry.instrument(this, "AuthConfigs");
|
|
3568
3574
|
}
|
|
3569
3575
|
/**
|
|
3570
3576
|
* Protected getter for the client instance.
|
|
@@ -3835,7 +3841,7 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
|
|
|
3835
3841
|
status: status || ConnectedAccountStatuses.INITIATED,
|
|
3836
3842
|
redirectUrl
|
|
3837
3843
|
};
|
|
3838
|
-
telemetry.instrument(state);
|
|
3844
|
+
telemetry.instrument(state, "ConnectionRequest");
|
|
3839
3845
|
async function waitForConnection(timeout = 6e4) {
|
|
3840
3846
|
try {
|
|
3841
3847
|
const response = await client.connectedAccounts.retrieve(state.id);
|
|
@@ -3902,7 +3908,7 @@ var ConnectedAccounts = class {
|
|
|
3902
3908
|
client;
|
|
3903
3909
|
constructor(client) {
|
|
3904
3910
|
this.client = client;
|
|
3905
|
-
telemetry.instrument(this);
|
|
3911
|
+
telemetry.instrument(this, "ConnectedAccounts");
|
|
3906
3912
|
}
|
|
3907
3913
|
/**
|
|
3908
3914
|
* Lists all connected accounts based on provided filter criteria.
|
|
@@ -4328,7 +4334,7 @@ var Toolkits = class {
|
|
|
4328
4334
|
constructor(client) {
|
|
4329
4335
|
this.client = client;
|
|
4330
4336
|
this.authorize = this.authorize.bind(this);
|
|
4331
|
-
telemetry.instrument(this);
|
|
4337
|
+
telemetry.instrument(this, "Toolkits");
|
|
4332
4338
|
}
|
|
4333
4339
|
/**
|
|
4334
4340
|
* Retrieves a list of toolkits based on the provided query parameters.
|
|
@@ -4781,7 +4787,7 @@ var PusherService = class {
|
|
|
4781
4787
|
this.composioClient = client;
|
|
4782
4788
|
this.pusherBaseURL = client.baseURL;
|
|
4783
4789
|
this.apiKey = client.apiKey ?? process.env.COMPOSIO_API_KEY ?? "";
|
|
4784
|
-
telemetry.instrument(this);
|
|
4790
|
+
telemetry.instrument(this, "PusherService");
|
|
4785
4791
|
}
|
|
4786
4792
|
/**
|
|
4787
4793
|
* Creates a Pusher client
|
|
@@ -5028,7 +5034,7 @@ var Triggers = class {
|
|
|
5028
5034
|
this.client = client;
|
|
5029
5035
|
this.pusherService = new PusherService(client);
|
|
5030
5036
|
this.toolkitVersions = config?.toolkitVersions ?? "latest";
|
|
5031
|
-
telemetry.instrument(this);
|
|
5037
|
+
telemetry.instrument(this, "Triggers");
|
|
5032
5038
|
}
|
|
5033
5039
|
/**
|
|
5034
5040
|
* Fetch list of all the active triggers
|
|
@@ -5480,7 +5486,7 @@ var MCP = class {
|
|
|
5480
5486
|
client;
|
|
5481
5487
|
constructor(client) {
|
|
5482
5488
|
this.client = client;
|
|
5483
|
-
telemetry.instrument(this);
|
|
5489
|
+
telemetry.instrument(this, "MCP");
|
|
5484
5490
|
}
|
|
5485
5491
|
/**
|
|
5486
5492
|
* Create a new MCP configuration.
|
|
@@ -6119,7 +6125,7 @@ var MCP2 = class {
|
|
|
6119
6125
|
this.client = client;
|
|
6120
6126
|
this.provider = provider;
|
|
6121
6127
|
this.toolkits = new Toolkits(client);
|
|
6122
|
-
telemetry.instrument(this);
|
|
6128
|
+
telemetry.instrument(this, "MCP");
|
|
6123
6129
|
}
|
|
6124
6130
|
/**
|
|
6125
6131
|
* Validates toolkit configurations using Zod schema
|
|
@@ -6193,7 +6199,6 @@ var MCP2 = class {
|
|
|
6193
6199
|
}
|
|
6194
6200
|
const tools = mcpServer.tools?.sort();
|
|
6195
6201
|
const sortedCurrentTools = serverConfig.flatMap((config) => config.allowedTools).sort();
|
|
6196
|
-
console.log(tools, sortedCurrentTools, "tools");
|
|
6197
6202
|
if (tools?.length > 0 && !tools.every((tool, index) => tool === sortedCurrentTools[index])) {
|
|
6198
6203
|
throw new ValidationError("MCP server with this name already exists with different tools", {
|
|
6199
6204
|
meta: { serverName: name }
|
|
@@ -6749,7 +6754,7 @@ var MCP2 = class {
|
|
|
6749
6754
|
limit: 10
|
|
6750
6755
|
});
|
|
6751
6756
|
} catch (error) {
|
|
6752
|
-
|
|
6757
|
+
logger_default.error(error);
|
|
6753
6758
|
throw new ValidationError("Failed to search MCP servers by name", {
|
|
6754
6759
|
cause: error
|
|
6755
6760
|
});
|
|
@@ -7351,13 +7356,13 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
7351
7356
|
};
|
|
7352
7357
|
|
|
7353
7358
|
// package.json
|
|
7354
|
-
var version = "0.2.
|
|
7359
|
+
var version = "0.2.3";
|
|
7355
7360
|
|
|
7356
7361
|
// src/models/Files.ts
|
|
7357
7362
|
var Files = class {
|
|
7358
7363
|
constructor(client) {
|
|
7359
7364
|
this.client = client;
|
|
7360
|
-
telemetry.instrument(this);
|
|
7365
|
+
telemetry.instrument(this, "Files");
|
|
7361
7366
|
}
|
|
7362
7367
|
/**
|
|
7363
7368
|
* Upload a file to S3 and return the file data.
|
|
@@ -7394,10 +7399,46 @@ var Files = class {
|
|
|
7394
7399
|
};
|
|
7395
7400
|
|
|
7396
7401
|
// src/utils/session.ts
|
|
7402
|
+
function detectRuntime() {
|
|
7403
|
+
const global = globalThis;
|
|
7404
|
+
if ("Bun" in global && typeof global.Bun !== "undefined") {
|
|
7405
|
+
return "BUN";
|
|
7406
|
+
}
|
|
7407
|
+
if ("Deno" in global && typeof global.Deno !== "undefined") {
|
|
7408
|
+
return "DENO";
|
|
7409
|
+
}
|
|
7410
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
7411
|
+
return "NODEJS";
|
|
7412
|
+
}
|
|
7413
|
+
if ("caches" in global && typeof global.caches !== "undefined" && "WebSocketPair" in global && typeof global.WebSocketPair !== "undefined") {
|
|
7414
|
+
return "CLOUDFLARE_WORKERS";
|
|
7415
|
+
}
|
|
7416
|
+
if ("EdgeRuntime" in global && typeof global.EdgeRuntime !== "undefined") {
|
|
7417
|
+
return "VERCEL_EDGE";
|
|
7418
|
+
}
|
|
7419
|
+
if ("ServiceWorkerGlobalScope" in global && typeof global.ServiceWorkerGlobalScope !== "undefined") {
|
|
7420
|
+
const ServiceWorkerScope = global.ServiceWorkerGlobalScope;
|
|
7421
|
+
if (ServiceWorkerScope && global instanceof ServiceWorkerScope) {
|
|
7422
|
+
return "SERVICE_WORKER";
|
|
7423
|
+
}
|
|
7424
|
+
}
|
|
7425
|
+
if ("WorkerGlobalScope" in global && typeof global.WorkerGlobalScope !== "undefined" && "importScripts" in global && typeof global.importScripts === "function") {
|
|
7426
|
+
return "WEB_WORKER";
|
|
7427
|
+
}
|
|
7428
|
+
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
7429
|
+
return "REACT_NATIVE";
|
|
7430
|
+
}
|
|
7431
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
7432
|
+
return "BROWSER";
|
|
7433
|
+
}
|
|
7434
|
+
return "UNKNOWN";
|
|
7435
|
+
}
|
|
7436
|
+
var RUNTIME_ENV = detectRuntime();
|
|
7397
7437
|
function getSessionHeaders(provider) {
|
|
7398
7438
|
return {
|
|
7399
|
-
"x-
|
|
7400
|
-
"x-
|
|
7439
|
+
"x-framework": provider?.name || "unknown",
|
|
7440
|
+
"x-source": "TYPESCRIPT_SDK",
|
|
7441
|
+
"x-runtime": RUNTIME_ENV,
|
|
7401
7442
|
"x-sdk-version": version
|
|
7402
7443
|
};
|
|
7403
7444
|
}
|
|
@@ -7429,7 +7470,7 @@ var ToolRouter = class {
|
|
|
7429
7470
|
constructor(client) {
|
|
7430
7471
|
this.client = client;
|
|
7431
7472
|
this.client = client;
|
|
7432
|
-
telemetry.instrument(this);
|
|
7473
|
+
telemetry.instrument(this, "ToolRouter");
|
|
7433
7474
|
}
|
|
7434
7475
|
/**
|
|
7435
7476
|
* Creates a new Session for the tool router
|
|
@@ -7603,8 +7644,11 @@ var Composio = class _Composio {
|
|
|
7603
7644
|
host: this.config.host
|
|
7604
7645
|
});
|
|
7605
7646
|
}
|
|
7606
|
-
telemetry.instrument(this);
|
|
7607
|
-
telemetry.instrument(
|
|
7647
|
+
telemetry.instrument(this, "Composio");
|
|
7648
|
+
telemetry.instrument(
|
|
7649
|
+
this.provider,
|
|
7650
|
+
this.provider.name ?? this.provider.constructor.name ?? "unknown"
|
|
7651
|
+
);
|
|
7608
7652
|
if (!this.config.disableVersionCheck) {
|
|
7609
7653
|
checkForLatestVersionFromNPM(version);
|
|
7610
7654
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -41127,7 +41127,13 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
41127
41127
|
isComposioManaged: boolean;
|
|
41128
41128
|
isDisabled: boolean;
|
|
41129
41129
|
}>;
|
|
41130
|
+
/**
|
|
41131
|
+
* @deprecated use connectedAccount.state instead
|
|
41132
|
+
*/
|
|
41130
41133
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41134
|
+
/**
|
|
41135
|
+
* @deprecated use connectedAccount.state instead
|
|
41136
|
+
*/
|
|
41131
41137
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41132
41138
|
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>;
|
|
41133
41139
|
statusReason: z.ZodNullable<z.ZodString>;
|
|
@@ -51014,7 +51020,13 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
51014
51020
|
isComposioManaged: boolean;
|
|
51015
51021
|
isDisabled: boolean;
|
|
51016
51022
|
}>;
|
|
51023
|
+
/**
|
|
51024
|
+
* @deprecated use connectedAccount.state instead
|
|
51025
|
+
*/
|
|
51017
51026
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
51027
|
+
/**
|
|
51028
|
+
* @deprecated use connectedAccount.state instead
|
|
51029
|
+
*/
|
|
51018
51030
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
51019
51031
|
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>;
|
|
51020
51032
|
statusReason: z.ZodNullable<z.ZodString>;
|
package/dist/index.d.ts
CHANGED
|
@@ -41127,7 +41127,13 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
41127
41127
|
isComposioManaged: boolean;
|
|
41128
41128
|
isDisabled: boolean;
|
|
41129
41129
|
}>;
|
|
41130
|
+
/**
|
|
41131
|
+
* @deprecated use connectedAccount.state instead
|
|
41132
|
+
*/
|
|
41130
41133
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41134
|
+
/**
|
|
41135
|
+
* @deprecated use connectedAccount.state instead
|
|
41136
|
+
*/
|
|
41131
41137
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41132
41138
|
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>;
|
|
41133
41139
|
statusReason: z.ZodNullable<z.ZodString>;
|
|
@@ -51014,7 +51020,13 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
51014
51020
|
isComposioManaged: boolean;
|
|
51015
51021
|
isDisabled: boolean;
|
|
51016
51022
|
}>;
|
|
51023
|
+
/**
|
|
51024
|
+
* @deprecated use connectedAccount.state instead
|
|
51025
|
+
*/
|
|
51017
51026
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
51027
|
+
/**
|
|
51028
|
+
* @deprecated use connectedAccount.state instead
|
|
51029
|
+
*/
|
|
51018
51030
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
51019
51031
|
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED", "INACTIVE"]>;
|
|
51020
51032
|
statusReason: z.ZodNullable<z.ZodString>;
|
package/dist/index.js
CHANGED
|
@@ -1434,7 +1434,7 @@ var TelemetryTransport = class {
|
|
|
1434
1434
|
const descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
1435
1435
|
return key !== "constructor" && descriptor && typeof descriptor.value === "function" && descriptor.value.constructor.name === "AsyncFunction";
|
|
1436
1436
|
});
|
|
1437
|
-
const instrumentedClassName =
|
|
1437
|
+
const instrumentedClassName = fileName ?? instance.constructor?.name ?? "unknown";
|
|
1438
1438
|
for (const name of methodNames) {
|
|
1439
1439
|
const originalMethod = instance[name];
|
|
1440
1440
|
instance[name] = async (...args) => {
|
|
@@ -1775,7 +1775,13 @@ var ConnectedAccountAuthConfigSchema = z4.object({
|
|
|
1775
1775
|
var ConnectedAccountRetrieveResponseSchema = z4.object({
|
|
1776
1776
|
id: z4.string(),
|
|
1777
1777
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
1778
|
+
/**
|
|
1779
|
+
* @deprecated use connectedAccount.state instead
|
|
1780
|
+
*/
|
|
1778
1781
|
data: z4.record(z4.string(), z4.unknown()).optional(),
|
|
1782
|
+
/**
|
|
1783
|
+
* @deprecated use connectedAccount.state instead
|
|
1784
|
+
*/
|
|
1779
1785
|
params: z4.record(z4.string(), z4.unknown()).optional(),
|
|
1780
1786
|
status: ConnectedAccountStatusSchema,
|
|
1781
1787
|
statusReason: z4.string().nullable(),
|
|
@@ -1886,7 +1892,7 @@ var CustomTools = class {
|
|
|
1886
1892
|
}
|
|
1887
1893
|
this.client = client;
|
|
1888
1894
|
this.customToolsRegistry = /* @__PURE__ */ new Map();
|
|
1889
|
-
telemetry.instrument(this);
|
|
1895
|
+
telemetry.instrument(this, "CustomTools");
|
|
1890
1896
|
}
|
|
1891
1897
|
/**
|
|
1892
1898
|
* Create a custom tool and registers it in the registry.
|
|
@@ -1919,7 +1925,7 @@ var CustomTools = class {
|
|
|
1919
1925
|
if (!slug || !execute || !inputParams || !name) {
|
|
1920
1926
|
throw new Error("Invalid tool options");
|
|
1921
1927
|
}
|
|
1922
|
-
const paramsSchema =
|
|
1928
|
+
const paramsSchema = zodToJsonSchema(inputParams, {
|
|
1923
1929
|
name: "input"
|
|
1924
1930
|
});
|
|
1925
1931
|
const paramsSchemaJson = paramsSchema.definitions.input;
|
|
@@ -2594,7 +2600,7 @@ var Tools = class {
|
|
|
2594
2600
|
this.provider._setExecuteToolFn(this.execute);
|
|
2595
2601
|
this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
|
|
2596
2602
|
this.getRawComposioTools = this.getRawComposioTools.bind(this);
|
|
2597
|
-
telemetry.instrument(this);
|
|
2603
|
+
telemetry.instrument(this, "Tools");
|
|
2598
2604
|
}
|
|
2599
2605
|
/**
|
|
2600
2606
|
* Transforms tool data from snake_case API format to camelCase for internal SDK use.
|
|
@@ -3387,7 +3393,7 @@ var AuthConfigs = class {
|
|
|
3387
3393
|
client;
|
|
3388
3394
|
constructor(client) {
|
|
3389
3395
|
this.client = client;
|
|
3390
|
-
telemetry.instrument(this);
|
|
3396
|
+
telemetry.instrument(this, "AuthConfigs");
|
|
3391
3397
|
}
|
|
3392
3398
|
/**
|
|
3393
3399
|
* Protected getter for the client instance.
|
|
@@ -3658,7 +3664,7 @@ function createConnectionRequest(client, connectedAccountId, status, redirectUrl
|
|
|
3658
3664
|
status: status || ConnectedAccountStatuses.INITIATED,
|
|
3659
3665
|
redirectUrl
|
|
3660
3666
|
};
|
|
3661
|
-
telemetry.instrument(state);
|
|
3667
|
+
telemetry.instrument(state, "ConnectionRequest");
|
|
3662
3668
|
async function waitForConnection(timeout = 6e4) {
|
|
3663
3669
|
try {
|
|
3664
3670
|
const response = await client.connectedAccounts.retrieve(state.id);
|
|
@@ -3725,7 +3731,7 @@ var ConnectedAccounts = class {
|
|
|
3725
3731
|
client;
|
|
3726
3732
|
constructor(client) {
|
|
3727
3733
|
this.client = client;
|
|
3728
|
-
telemetry.instrument(this);
|
|
3734
|
+
telemetry.instrument(this, "ConnectedAccounts");
|
|
3729
3735
|
}
|
|
3730
3736
|
/**
|
|
3731
3737
|
* Lists all connected accounts based on provided filter criteria.
|
|
@@ -4151,7 +4157,7 @@ var Toolkits = class {
|
|
|
4151
4157
|
constructor(client) {
|
|
4152
4158
|
this.client = client;
|
|
4153
4159
|
this.authorize = this.authorize.bind(this);
|
|
4154
|
-
telemetry.instrument(this);
|
|
4160
|
+
telemetry.instrument(this, "Toolkits");
|
|
4155
4161
|
}
|
|
4156
4162
|
/**
|
|
4157
4163
|
* Retrieves a list of toolkits based on the provided query parameters.
|
|
@@ -4604,7 +4610,7 @@ var PusherService = class {
|
|
|
4604
4610
|
this.composioClient = client;
|
|
4605
4611
|
this.pusherBaseURL = client.baseURL;
|
|
4606
4612
|
this.apiKey = client.apiKey ?? process.env.COMPOSIO_API_KEY ?? "";
|
|
4607
|
-
telemetry.instrument(this);
|
|
4613
|
+
telemetry.instrument(this, "PusherService");
|
|
4608
4614
|
}
|
|
4609
4615
|
/**
|
|
4610
4616
|
* Creates a Pusher client
|
|
@@ -4851,7 +4857,7 @@ var Triggers = class {
|
|
|
4851
4857
|
this.client = client;
|
|
4852
4858
|
this.pusherService = new PusherService(client);
|
|
4853
4859
|
this.toolkitVersions = config?.toolkitVersions ?? "latest";
|
|
4854
|
-
telemetry.instrument(this);
|
|
4860
|
+
telemetry.instrument(this, "Triggers");
|
|
4855
4861
|
}
|
|
4856
4862
|
/**
|
|
4857
4863
|
* Fetch list of all the active triggers
|
|
@@ -5303,7 +5309,7 @@ var MCP = class {
|
|
|
5303
5309
|
client;
|
|
5304
5310
|
constructor(client) {
|
|
5305
5311
|
this.client = client;
|
|
5306
|
-
telemetry.instrument(this);
|
|
5312
|
+
telemetry.instrument(this, "MCP");
|
|
5307
5313
|
}
|
|
5308
5314
|
/**
|
|
5309
5315
|
* Create a new MCP configuration.
|
|
@@ -5942,7 +5948,7 @@ var MCP2 = class {
|
|
|
5942
5948
|
this.client = client;
|
|
5943
5949
|
this.provider = provider;
|
|
5944
5950
|
this.toolkits = new Toolkits(client);
|
|
5945
|
-
telemetry.instrument(this);
|
|
5951
|
+
telemetry.instrument(this, "MCP");
|
|
5946
5952
|
}
|
|
5947
5953
|
/**
|
|
5948
5954
|
* Validates toolkit configurations using Zod schema
|
|
@@ -6016,7 +6022,6 @@ var MCP2 = class {
|
|
|
6016
6022
|
}
|
|
6017
6023
|
const tools = mcpServer.tools?.sort();
|
|
6018
6024
|
const sortedCurrentTools = serverConfig.flatMap((config) => config.allowedTools).sort();
|
|
6019
|
-
console.log(tools, sortedCurrentTools, "tools");
|
|
6020
6025
|
if (tools?.length > 0 && !tools.every((tool, index) => tool === sortedCurrentTools[index])) {
|
|
6021
6026
|
throw new ValidationError("MCP server with this name already exists with different tools", {
|
|
6022
6027
|
meta: { serverName: name }
|
|
@@ -6572,7 +6577,7 @@ var MCP2 = class {
|
|
|
6572
6577
|
limit: 10
|
|
6573
6578
|
});
|
|
6574
6579
|
} catch (error) {
|
|
6575
|
-
|
|
6580
|
+
logger_default.error(error);
|
|
6576
6581
|
throw new ValidationError("Failed to search MCP servers by name", {
|
|
6577
6582
|
cause: error
|
|
6578
6583
|
});
|
|
@@ -7174,13 +7179,13 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
7174
7179
|
};
|
|
7175
7180
|
|
|
7176
7181
|
// package.json
|
|
7177
|
-
var version = "0.2.
|
|
7182
|
+
var version = "0.2.3";
|
|
7178
7183
|
|
|
7179
7184
|
// src/models/Files.ts
|
|
7180
7185
|
var Files = class {
|
|
7181
7186
|
constructor(client) {
|
|
7182
7187
|
this.client = client;
|
|
7183
|
-
telemetry.instrument(this);
|
|
7188
|
+
telemetry.instrument(this, "Files");
|
|
7184
7189
|
}
|
|
7185
7190
|
/**
|
|
7186
7191
|
* Upload a file to S3 and return the file data.
|
|
@@ -7217,10 +7222,46 @@ var Files = class {
|
|
|
7217
7222
|
};
|
|
7218
7223
|
|
|
7219
7224
|
// src/utils/session.ts
|
|
7225
|
+
function detectRuntime() {
|
|
7226
|
+
const global = globalThis;
|
|
7227
|
+
if ("Bun" in global && typeof global.Bun !== "undefined") {
|
|
7228
|
+
return "BUN";
|
|
7229
|
+
}
|
|
7230
|
+
if ("Deno" in global && typeof global.Deno !== "undefined") {
|
|
7231
|
+
return "DENO";
|
|
7232
|
+
}
|
|
7233
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
7234
|
+
return "NODEJS";
|
|
7235
|
+
}
|
|
7236
|
+
if ("caches" in global && typeof global.caches !== "undefined" && "WebSocketPair" in global && typeof global.WebSocketPair !== "undefined") {
|
|
7237
|
+
return "CLOUDFLARE_WORKERS";
|
|
7238
|
+
}
|
|
7239
|
+
if ("EdgeRuntime" in global && typeof global.EdgeRuntime !== "undefined") {
|
|
7240
|
+
return "VERCEL_EDGE";
|
|
7241
|
+
}
|
|
7242
|
+
if ("ServiceWorkerGlobalScope" in global && typeof global.ServiceWorkerGlobalScope !== "undefined") {
|
|
7243
|
+
const ServiceWorkerScope = global.ServiceWorkerGlobalScope;
|
|
7244
|
+
if (ServiceWorkerScope && global instanceof ServiceWorkerScope) {
|
|
7245
|
+
return "SERVICE_WORKER";
|
|
7246
|
+
}
|
|
7247
|
+
}
|
|
7248
|
+
if ("WorkerGlobalScope" in global && typeof global.WorkerGlobalScope !== "undefined" && "importScripts" in global && typeof global.importScripts === "function") {
|
|
7249
|
+
return "WEB_WORKER";
|
|
7250
|
+
}
|
|
7251
|
+
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
7252
|
+
return "REACT_NATIVE";
|
|
7253
|
+
}
|
|
7254
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
7255
|
+
return "BROWSER";
|
|
7256
|
+
}
|
|
7257
|
+
return "UNKNOWN";
|
|
7258
|
+
}
|
|
7259
|
+
var RUNTIME_ENV = detectRuntime();
|
|
7220
7260
|
function getSessionHeaders(provider) {
|
|
7221
7261
|
return {
|
|
7222
|
-
"x-
|
|
7223
|
-
"x-
|
|
7262
|
+
"x-framework": provider?.name || "unknown",
|
|
7263
|
+
"x-source": "TYPESCRIPT_SDK",
|
|
7264
|
+
"x-runtime": RUNTIME_ENV,
|
|
7224
7265
|
"x-sdk-version": version
|
|
7225
7266
|
};
|
|
7226
7267
|
}
|
|
@@ -7252,7 +7293,7 @@ var ToolRouter = class {
|
|
|
7252
7293
|
constructor(client) {
|
|
7253
7294
|
this.client = client;
|
|
7254
7295
|
this.client = client;
|
|
7255
|
-
telemetry.instrument(this);
|
|
7296
|
+
telemetry.instrument(this, "ToolRouter");
|
|
7256
7297
|
}
|
|
7257
7298
|
/**
|
|
7258
7299
|
* Creates a new Session for the tool router
|
|
@@ -7426,8 +7467,11 @@ var Composio = class _Composio {
|
|
|
7426
7467
|
host: this.config.host
|
|
7427
7468
|
});
|
|
7428
7469
|
}
|
|
7429
|
-
telemetry.instrument(this);
|
|
7430
|
-
telemetry.instrument(
|
|
7470
|
+
telemetry.instrument(this, "Composio");
|
|
7471
|
+
telemetry.instrument(
|
|
7472
|
+
this.provider,
|
|
7473
|
+
this.provider.name ?? this.provider.constructor.name ?? "unknown"
|
|
7474
|
+
);
|
|
7431
7475
|
if (!this.config.disableVersionCheck) {
|
|
7432
7476
|
checkForLatestVersionFromNPM(version);
|
|
7433
7477
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"tsx": "^4.20.5",
|
|
34
34
|
"typescript": "^5.9.2",
|
|
35
35
|
"vitest": "^3.2.4",
|
|
36
|
-
"zod": "
|
|
36
|
+
"zod": "^4.1.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"zod": ">=3.25.76 <5"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"semver": "^7.7.2",
|
|
48
48
|
"uuid": "^13.0.0",
|
|
49
49
|
"zod-to-json-schema": "^3.24.5",
|
|
50
|
-
"@composio/json-schema-to-zod": "0.1.
|
|
50
|
+
"@composio/json-schema-to-zod": "0.1.18"
|
|
51
51
|
},
|
|
52
52
|
"gitHead": "4fae6e54d5c150fba955cc5fa314281da5a1e064",
|
|
53
53
|
"scripts": {
|