@devries-cameron20 / composio-1 / commits / dca6cd669
Fork 0

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 Ahamad committed Jun 19, 2025 at 11:35 UTC dca6cd669f0a75f9095b97b644d33271f87f329e
8 files changed +32 -26
ts/packages/core/src/composio.ts
+4 -6
@@ -1,3 +1,4 @@
1 +import type { BaseComposioProvider } from './provider/BaseProvider';
2 import ComposioClient from '@composio/client';
3 import { Tools } from './models/Tools';
4 import { Toolkits } from './models/Toolkits';
@@ -5,18 +6,17 @@ import { Triggers } from './models/Triggers';
6 import { AuthConfigs } from './models/AuthConfigs';
7 import { ConnectedAccounts } from './models/ConnectedAccounts';
8 import { MCP } from './models/MCP';
8 -import { BaseComposioProvider } from './provider/BaseProvider';
9 import { telemetry } from './telemetry/Telemetry';
10 import { getSDKConfig } from './utils/sdk';
11 import logger from './utils/logger';
12 -import { IS_DEVELOPMENT_OR_CI } from './utils/constants';
12 +import { COMPOSIO_LOG_LEVEL, IS_DEVELOPMENT_OR_CI } from './utils/constants';
13 import { checkForLatestVersionFromNPM } from './utils/version';
14 import { OpenAIProvider } from './provider/OpenAIProvider';
15 import { version } from '../package.json';
16 import { getRandomUUID } from './utils/uuid';
17 import type { ComposioRequestHeaders } from './types/composio.types';
18 -import { LogLevel } from '@composio/client/client';
18 import { McpServerGetResponse } from './types/mcp.types';
19 +import { getEnvVariable } from './utils/env';
20
21 export type ComposioConfig<
22 TProvider extends BaseComposioProvider<unknown, unknown, unknown> = OpenAIProvider,
@@ -157,9 +157,7 @@ export class Composio<
157 apiKey: apiKeyParsed,
158 baseURL: baseURLParsed,
159 defaultHeaders: config?.defaultHeaders,
160 - logLevel:
161 - (process.env.COMPOSIO_LOG_LEVEL as 'debug' | 'info' | 'warn' | 'error' | undefined) ??
162 - undefined,
160 + logLevel: COMPOSIO_LOG_LEVEL,
161 });
162
163 /**
ts/packages/core/src/index.ts
+2 -5
@@ -2,11 +2,8 @@
2 export { Composio } from './composio';
3 export { OpenAIProvider } from './provider/OpenAIProvider';
4 export { ComposioProvider } from './provider/ComposioProvider';
5 -export {
6 - BaseNonAgenticProvider,
7 - BaseAgenticProvider,
8 - BaseComposioProvider,
9 -} from './provider/BaseProvider';
5 +export { BaseNonAgenticProvider, BaseAgenticProvider } from './provider/BaseProvider';
6 +export type { BaseComposioProvider } from './provider/BaseProvider';
7 export { jsonSchemaToZodSchema, removeNonRequiredProperties } from './utils/jsonSchema';
8 export { AuthScheme } from './models/AuthScheme';
9 export { MCP } from './models/MCP';
ts/packages/core/src/models/Tools.ts
+1 -1
@@ -459,7 +459,7 @@ export class Tools<
459 * @internal
460 * @description
461 * Creates a function that executes a tool.
462 - * This function is used by agentic toolsets to execute the tool
462 + * This function is used by agentic providers to execute the tool
463 *
464 * @param {string} userId - The user id
465 * @param {ExecuteToolModifiers} modifiers - The modifiers to be applied to the tool
ts/packages/core/src/models/Triggers.ts
+1 -1
@@ -481,7 +481,7 @@ export class Triggers {
481 status: data.metadata.connection?.status,
482 },
483 },
484 - } as IncomingTriggerPayload);
484 + });
485
486 logger.debug('Parsed trigger data', JSON.stringify(parsedData.data, null, 2));
487
ts/packages/core/src/provider/BaseProvider.ts
+4 -4
@@ -6,7 +6,7 @@ import { McpUrlResponse, McpServerGetResponse } from '../types/mcp.types';
6
7 /**
8 * @internal
9 - * Base class for all toolsets.
9 + * Base class for all providers.
10 * This class is not meant to be used directly, but rather to be extended by different provider implementations.
11 */
12 abstract class BaseProvider<TMcpResponse = McpServerGetResponse> {
@@ -82,7 +82,7 @@ abstract class BaseProvider<TMcpResponse = McpServerGetResponse> {
82
83 /**
84 * @public
85 - * Base class for all non-agentic toolsets.
85 + * Base class for all non-agentic providers.
86 * This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
87 */
88 export abstract class BaseNonAgenticProvider<
@@ -108,7 +108,7 @@ export abstract class BaseNonAgenticProvider<
108
109 /**
110 * @public
111 - * Base class for all agentic toolsets.
111 + * Base class for all agentic providers.
112 * This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
113 */
114 export abstract class BaseAgenticProvider<
@@ -136,7 +136,7 @@ export abstract class BaseAgenticProvider<
136
137 /**
138 * @internal
139 - * Base type for all toolsets.
139 + * Base type for all providers.
140 * This type is used to infer the type of the provider from the provider implementation.
141 */
142 export type BaseComposioProvider<TToolCollection, TTool, TMcpResponse = McpServerGetResponse> =
ts/packages/core/src/utils/constants.ts
+16 -7
@@ -1,10 +1,19 @@
1 +import { getEnvVariable } from './env';
2 +
3 // Constants
2 -export const COMPOSIO_DIR = ".composio";
3 -export const USER_DATA_FILE_NAME = "user_data.json";
4 -export const TEMP_FILES_DIRECTORY_NAME = "files";
5 -export const DEFAULT_BASE_URL = "https://backend.composio.dev";
4 +export const COMPOSIO_DIR = '.composio';
5 +export const USER_DATA_FILE_NAME = 'user_data.json';
6 +export const TEMP_FILES_DIRECTORY_NAME = 'files';
7 +export const DEFAULT_BASE_URL = 'https://backend.composio.dev';
8 +
9 +export const TELEMETRY_URL = 'https://app.composio.dev';
10 +export const CLIENT_PUSHER_KEY = getEnvVariable('CLIENT_PUSHER_KEY') || 'ff9f18c208855d77a152';
11
7 -export const TELEMETRY_URL = "https://app.composio.dev";
12 +export const COMPOSIO_LOG_LEVEL = getEnvVariable('COMPOSIO_LOG_LEVEL') as
13 + | 'debug'
14 + | 'info'
15 + | 'warn'
16 + | 'error'
17 + | undefined;
18
9 -export const IS_DEVELOPMENT_OR_CI =
10 - process.env.DEVELOPMENT || process.env.CI || false;
19 +export const IS_DEVELOPMENT_OR_CI = getEnvVariable('DEVELOPMENT') || getEnvVariable('CI') || false;
ts/packages/core/src/utils/logger.ts
+2 -1
@@ -1,5 +1,6 @@
1 import chalk from 'chalk';
2 import { getEnvVariable } from './env';
3 +import { COMPOSIO_LOG_LEVEL } from './constants';
4
5 // Define log levels with corresponding priorities
6 export const LOG_LEVELS = {
@@ -18,7 +19,7 @@ export type LogLevel = keyof typeof LOG_LEVELS;
19 * @returns {LogLevel} The current log level
20 */
21 export const getLogLevel = (): LogLevel => {
21 - const envLevel = getEnvVariable('COMPOSIO_LOG_LEVEL', 'info')?.toLowerCase();
22 + const envLevel = (COMPOSIO_LOG_LEVEL ?? 'info')?.toLowerCase();
23 return envLevel && envLevel in LOG_LEVELS ? (envLevel as LogLevel) : 'info';
24 };
25
ts/packages/core/src/utils/pusher.ts
+2 -1
@@ -1,7 +1,8 @@
1 import { PusherSubscriptionError } from '../errors/PusherErrors';
2 +import { CLIENT_PUSHER_KEY } from './constants';
3 import logger from './logger';
4
4 -const PUSHER_KEY = process.env.CLIENT_PUSHER_KEY || 'ff9f18c208855d77a152';
5 +const PUSHER_KEY = CLIENT_PUSHER_KEY || 'ff9f18c208855d77a152';
6 const PUSHER_CLUSTER = 'mt1';
7
8 type Channel = {