Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Fix missing exports from core (#1665)

Musthaq Ahamaddca6cd669f0a
diff --git a/ts/packages/core/src/composio.ts b/ts/packages/core/src/composio.ts
index 70791ccec..37a3ff449 100644
--- a/ts/packages/core/src/composio.ts
+++ b/ts/packages/core/src/composio.ts
@@ -1,3 +1,4 @@
+import type { BaseComposioProvider } from './provider/BaseProvider';
import ComposioClient from '@composio/client';
import { Tools } from './models/Tools';
import { Toolkits } from './models/Toolkits';
@@ -5,18 +6,17 @@ import { Triggers } from './models/Triggers';
import { AuthConfigs } from './models/AuthConfigs';
import { ConnectedAccounts } from './models/ConnectedAccounts';
import { MCP } from './models/MCP';
-import { BaseComposioProvider } from './provider/BaseProvider';
import { telemetry } from './telemetry/Telemetry';
import { getSDKConfig } from './utils/sdk';
import logger from './utils/logger';
-import { IS_DEVELOPMENT_OR_CI } from './utils/constants';
+import { COMPOSIO_LOG_LEVEL, IS_DEVELOPMENT_OR_CI } from './utils/constants';
import { checkForLatestVersionFromNPM } from './utils/version';
import { OpenAIProvider } from './provider/OpenAIProvider';
import { version } from '../package.json';
import { getRandomUUID } from './utils/uuid';
import type { ComposioRequestHeaders } from './types/composio.types';
-import { LogLevel } from '@composio/client/client';
import { McpServerGetResponse } from './types/mcp.types';
+import { getEnvVariable } from './utils/env';
export type ComposioConfig<
TProvider extends BaseComposioProvider<unknown, unknown, unknown> = OpenAIProvider,
@@ -157,9 +157,7 @@ export class Composio<
apiKey: apiKeyParsed,
baseURL: baseURLParsed,
defaultHeaders: config?.defaultHeaders,
- logLevel:
- (process.env.COMPOSIO_LOG_LEVEL as 'debug' | 'info' | 'warn' | 'error' | undefined) ??
- undefined,
+ logLevel: COMPOSIO_LOG_LEVEL,
});
/**
diff --git a/ts/packages/core/src/index.ts b/ts/packages/core/src/index.ts
index a9c590554..e92f72735 100644
--- a/ts/packages/core/src/index.ts
+++ b/ts/packages/core/src/index.ts
@@ -2,11 +2,8 @@
export { Composio } from './composio';
export { OpenAIProvider } from './provider/OpenAIProvider';
export { ComposioProvider } from './provider/ComposioProvider';
-export {
- BaseNonAgenticProvider,
- BaseAgenticProvider,
- BaseComposioProvider,
-} from './provider/BaseProvider';
+export { BaseNonAgenticProvider, BaseAgenticProvider } from './provider/BaseProvider';
+export type { BaseComposioProvider } from './provider/BaseProvider';
export { jsonSchemaToZodSchema, removeNonRequiredProperties } from './utils/jsonSchema';
export { AuthScheme } from './models/AuthScheme';
export { MCP } from './models/MCP';
diff --git a/ts/packages/core/src/models/Tools.ts b/ts/packages/core/src/models/Tools.ts
index 724935024..38a3b1780 100644
--- a/ts/packages/core/src/models/Tools.ts
+++ b/ts/packages/core/src/models/Tools.ts
@@ -459,7 +459,7 @@ export class Tools<
* @internal
* @description
* Creates a function that executes a tool.
- * This function is used by agentic toolsets to execute the tool
+ * This function is used by agentic providers to execute the tool
*
* @param {string} userId - The user id
* @param {ExecuteToolModifiers} modifiers - The modifiers to be applied to the tool
diff --git a/ts/packages/core/src/models/Triggers.ts b/ts/packages/core/src/models/Triggers.ts
index 282ef333a..8db5cae50 100644
--- a/ts/packages/core/src/models/Triggers.ts
+++ b/ts/packages/core/src/models/Triggers.ts
@@ -481,7 +481,7 @@ export class Triggers {
status: data.metadata.connection?.status,
},
},
- } as IncomingTriggerPayload);
+ });
logger.debug('Parsed trigger data', JSON.stringify(parsedData.data, null, 2));
diff --git a/ts/packages/core/src/provider/BaseProvider.ts b/ts/packages/core/src/provider/BaseProvider.ts
index 5a35c9c4a..b10b899e4 100644
--- a/ts/packages/core/src/provider/BaseProvider.ts
+++ b/ts/packages/core/src/provider/BaseProvider.ts
@@ -6,7 +6,7 @@ import { McpUrlResponse, McpServerGetResponse } from '../types/mcp.types';
/**
* @internal
- * Base class for all toolsets.
+ * Base class for all providers.
* This class is not meant to be used directly, but rather to be extended by different provider implementations.
*/
abstract class BaseProvider<TMcpResponse = McpServerGetResponse> {
@@ -82,7 +82,7 @@ abstract class BaseProvider<TMcpResponse = McpServerGetResponse> {
/**
* @public
- * Base class for all non-agentic toolsets.
+ * Base class for all non-agentic providers.
* This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
*/
export abstract class BaseNonAgenticProvider<
@@ -108,7 +108,7 @@ export abstract class BaseNonAgenticProvider<
/**
* @public
- * Base class for all agentic toolsets.
+ * Base class for all agentic providers.
* This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
*/
export abstract class BaseAgenticProvider<
@@ -136,7 +136,7 @@ export abstract class BaseAgenticProvider<
/**
* @internal
- * Base type for all toolsets.
+ * Base type for all providers.
* This type is used to infer the type of the provider from the provider implementation.
*/
export type BaseComposioProvider<TToolCollection, TTool, TMcpResponse = McpServerGetResponse> =
diff --git a/ts/packages/core/src/utils/constants.ts b/ts/packages/core/src/utils/constants.ts
index 4da391ffe..9c506b584 100644
--- a/ts/packages/core/src/utils/constants.ts
+++ b/ts/packages/core/src/utils/constants.ts
@@ -1,10 +1,19 @@
+import { getEnvVariable } from './env';
+
// Constants
-export const COMPOSIO_DIR = ".composio";
-export const USER_DATA_FILE_NAME = "user_data.json";
-export const TEMP_FILES_DIRECTORY_NAME = "files";
-export const DEFAULT_BASE_URL = "https://backend.composio.dev";
+export const COMPOSIO_DIR = '.composio';
+export const USER_DATA_FILE_NAME = 'user_data.json';
+export const TEMP_FILES_DIRECTORY_NAME = 'files';
+export const DEFAULT_BASE_URL = 'https://backend.composio.dev';
+
+export const TELEMETRY_URL = 'https://app.composio.dev';
+export const CLIENT_PUSHER_KEY = getEnvVariable('CLIENT_PUSHER_KEY') || 'ff9f18c208855d77a152';
-export const TELEMETRY_URL = "https://app.composio.dev";
+export const COMPOSIO_LOG_LEVEL = getEnvVariable('COMPOSIO_LOG_LEVEL') as
+ | 'debug'
+ | 'info'
+ | 'warn'
+ | 'error'
+ | undefined;
-export const IS_DEVELOPMENT_OR_CI =
- process.env.DEVELOPMENT || process.env.CI || false;
+export const IS_DEVELOPMENT_OR_CI = getEnvVariable('DEVELOPMENT') || getEnvVariable('CI') || false;
diff --git a/ts/packages/core/src/utils/logger.ts b/ts/packages/core/src/utils/logger.ts
index 660065cc1..5cadd032b 100644
--- a/ts/packages/core/src/utils/logger.ts
+++ b/ts/packages/core/src/utils/logger.ts
@@ -1,5 +1,6 @@
import chalk from 'chalk';
import { getEnvVariable } from './env';
+import { COMPOSIO_LOG_LEVEL } from './constants';
// Define log levels with corresponding priorities
export const LOG_LEVELS = {
@@ -18,7 +19,7 @@ export type LogLevel = keyof typeof LOG_LEVELS;
* @returns {LogLevel} The current log level
*/
export const getLogLevel = (): LogLevel => {
- const envLevel = getEnvVariable('COMPOSIO_LOG_LEVEL', 'info')?.toLowerCase();
+ const envLevel = (COMPOSIO_LOG_LEVEL ?? 'info')?.toLowerCase();
return envLevel && envLevel in LOG_LEVELS ? (envLevel as LogLevel) : 'info';
};
diff --git a/ts/packages/core/src/utils/pusher.ts b/ts/packages/core/src/utils/pusher.ts
index 47b78515e..184598f11 100644
--- a/ts/packages/core/src/utils/pusher.ts
+++ b/ts/packages/core/src/utils/pusher.ts
@@ -1,7 +1,8 @@
import { PusherSubscriptionError } from '../errors/PusherErrors';
+import { CLIENT_PUSHER_KEY } from './constants';
import logger from './logger';
-const PUSHER_KEY = process.env.CLIENT_PUSHER_KEY || 'ff9f18c208855d77a152';
+const PUSHER_KEY = CLIENT_PUSHER_KEY || 'ff9f18c208855d77a152';
const PUSHER_CLUSTER = 'mt1';
type Channel = {