@composio/core 0.1.10-alpha.0 → 0.1.12-alpha.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/README.md CHANGED
@@ -23,16 +23,16 @@ pnpm add @composio/core
23
23
 
24
24
  ## Getting Started
25
25
 
26
- ### Basic Usage with OpenAI Toolset
26
+ ### Basic Usage with OpenAI Provider
27
27
 
28
28
  ```typescript
29
29
  import { Composio } from '@composio/core';
30
- import { OpenAIToolset } from '@composio/openai-toolset';
30
+ import { OpenAIProvider } from '@composio/openai';
31
31
 
32
32
  const composio = new Composio({
33
33
  apiKey: process.env.COMPOSIO_API_KEY,
34
- // OpenAIToolset is the default, so this is optional
35
- toolset: new OpenAIToolset(),
34
+ // OpenAIProvider is the default, so this is optional
35
+ provider: new OpenAIProvider(),
36
36
  });
37
37
 
38
38
  // Fetch a single tool
@@ -55,7 +55,7 @@ interface ComposioConfig {
55
55
  baseURL?: string; // Custom API base URL (optional)
56
56
  allowTracking?: boolean; // Enable/disable telemetry (default: true)
57
57
  allowTracing?: boolean; // Enable/disable tracing (default: true)
58
- toolset?: TToolset; // Custom toolset (default: OpenAIToolset)
58
+ provider?: TProvider; // Custom provider (default: OpenAIProvider)
59
59
  telemetryTransport?: BaseTelemetryTransport; // Custom telemetry transport
60
60
  }
61
61
  ```
@@ -87,7 +87,7 @@ const tool = await composio.tools.get('user123', 'HACKERNEWS_SEARCH_POSTS', {
87
87
 
88
88
  ### Execution Modifiers
89
89
 
90
- For agentic toolsets (like Vercel AI and Langchain), you can also modify tool execution behavior:
90
+ For agentic providers (like Vercel AI and Langchain), you can also modify tool execution behavior:
91
91
 
92
92
  ```typescript
93
93
  const tool = await composio.tools.get('user123', 'HACKERNEWS_SEARCH_POSTS', {
package/dist/index.cjs CHANGED
@@ -32,12 +32,12 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  AuthConfigTypes: () => AuthConfigTypes,
34
34
  AuthSchemeTypes: () => AuthSchemeTypes,
35
- BaseAgenticToolset: () => BaseAgenticToolset,
36
- BaseNonAgenticToolset: () => BaseNonAgenticToolset,
35
+ BaseAgenticProvider: () => BaseAgenticProvider,
36
+ BaseNonAgenticProvider: () => BaseNonAgenticProvider,
37
37
  BaseTelemetryTransport: () => BaseTelemetryTransport,
38
38
  Composio: () => Composio,
39
- ComposioToolset: () => ComposioToolset,
40
- OpenAIToolset: () => OpenAIToolset,
39
+ ComposioProvider: () => ComposioProvider,
40
+ OpenAIProvider: () => OpenAIProvider,
41
41
  ToolListParamsSchema: () => ToolListParamsSchema,
42
42
  jsonSchemaToModel: () => jsonSchemaToModel
43
43
  });
@@ -220,16 +220,16 @@ var ToolErrorCodes = {
220
220
  INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION",
221
221
  GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET"
222
222
  };
223
- var ComposioToolsetNotDefinedError = class extends ComposioError {
224
- constructor(message = "Toolset not defined", meta = {}) {
223
+ var ComposioProviderNotDefinedError = class extends ComposioError {
224
+ constructor(message = "Provider not defined", meta = {}) {
225
225
  super(message, {
226
226
  code: ToolErrorCodes.TOOLSET_NOT_DEFINED,
227
227
  meta,
228
228
  possibleFixes: [
229
- "Ensure that the toolset is defined in the Composio project and passed into the tool instance"
229
+ "Ensure that the provider is defined in the Composio project and passed into the tool instance"
230
230
  ]
231
231
  });
232
- this.name = "ComposioToolsetNotDefinedError";
232
+ this.name = "ComposioProviderNotDefinedError";
233
233
  }
234
234
  };
235
235
  var ComposioToolNotFoundError = class extends ComposioError {
@@ -290,7 +290,7 @@ var ComposioGlobalExecuteToolFnNotSetError = class extends ComposioError {
290
290
  super(message, {
291
291
  code: ToolErrorCodes.GLOBAL_EXECUTE_TOOL_FN_NOT_SET,
292
292
  meta,
293
- possibleFixes: ["Ensure the global execute tool function is set in the toolset"]
293
+ possibleFixes: ["Ensure the global execute tool function is set in the provider"]
294
294
  });
295
295
  this.name = "ComposioGlobalExecuteToolFnNotSetError";
296
296
  }
@@ -519,20 +519,20 @@ var ValidationError = class extends ComposioError {
519
519
  var Tools = class {
520
520
  client;
521
521
  customTools;
522
- toolset;
523
- constructor(client, toolset) {
522
+ provider;
523
+ constructor(client, provider) {
524
524
  if (!client) {
525
525
  throw new Error("ComposioClient is required");
526
526
  }
527
- if (!toolset) {
528
- throw new ComposioToolsetNotDefinedError("Toolset not passed into Tools instance");
527
+ if (!provider) {
528
+ throw new ComposioProviderNotDefinedError("Provider not passed into Tools instance");
529
529
  }
530
530
  this.client = client;
531
531
  this.customTools = new CustomTools(client);
532
- this.toolset = toolset;
532
+ this.provider = provider;
533
533
  this.execute = this.execute.bind(this);
534
- this.getComposioToolBySlug = this.getComposioToolBySlug.bind(this);
535
- this.getComposioTools = this.getComposioTools.bind(this);
534
+ this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
535
+ this.getRawComposioTools = this.getRawComposioTools.bind(this);
536
536
  }
537
537
  /**
538
538
  * Transform the tool cases
@@ -607,7 +607,7 @@ var Tools = class {
607
607
  * @returns {Promise<string | null>} The connected account id or null if the toolkit is a no auth app
608
608
  */
609
609
  async getConnectedAccountIdForTool(userId, toolSlug) {
610
- const tool = await this.getComposioToolBySlug(userId, toolSlug);
610
+ const tool = await this.getRawComposioToolBySlug(userId, toolSlug);
611
611
  if (!tool.toolkit) {
612
612
  throw new Error(`Unable to find toolkit for tool ${toolSlug}`);
613
613
  }
@@ -635,10 +635,10 @@ var Tools = class {
635
635
  }
636
636
  /**
637
637
  * Lists all tools available in the Composio SDK as well as custom tools.
638
- * This method fetches the tools from the Composio API and wraps them using the toolset.
638
+ * This method fetches the tools from the Composio API and wraps them using the provider.
639
639
  * @returns {ToolList} List of tools
640
640
  */
641
- async getComposioTools(userId, query = {}, modifier) {
641
+ async getRawComposioTools(userId, query = {}, modifier) {
642
642
  const queryParams = ToolListParamsSchema.safeParse(query);
643
643
  if (queryParams.error) {
644
644
  throw new ValidationError(queryParams.error);
@@ -677,10 +677,10 @@ var Tools = class {
677
677
  *
678
678
  * @example
679
679
  * ```ts
680
- * const tool = await composio.tools.getComposioToolBySlug('default', 'github');
680
+ * const tool = await composio.tools.getRawComposioToolBySlug('default', 'github');
681
681
  * ```
682
682
  */
683
- async getComposioToolBySlug(userId, slug, modifier) {
683
+ async getRawComposioToolBySlug(userId, slug, modifier) {
684
684
  const customTool = await this.customTools.getCustomToolBySlug(slug);
685
685
  if (customTool) {
686
686
  return customTool;
@@ -688,7 +688,7 @@ var Tools = class {
688
688
  const tool = await this.client.tools.retrieve(slug);
689
689
  if (!tool) {
690
690
  throw new ComposioToolNotFoundError(
691
- `[getComposioToolBySlug] Tool with slug ${slug} not found`
691
+ `[getRawComposioToolBySlug] Tool with slug ${slug} not found`
692
692
  );
693
693
  }
694
694
  let modifiedToool = this.transformToolCases(tool);
@@ -711,11 +711,11 @@ var Tools = class {
711
711
  async get(userId, arg2, options) {
712
712
  const executeToolFn = this.createExecuteToolFn(userId, options);
713
713
  if (typeof arg2 === "string") {
714
- const tool = await this.getComposioToolBySlug(userId, arg2, options?.modifyToolSchema);
715
- return this.toolset.wrapTool(tool, executeToolFn);
714
+ const tool = await this.getRawComposioToolBySlug(userId, arg2, options?.modifyToolSchema);
715
+ return this.provider.wrapTool(tool, executeToolFn);
716
716
  } else {
717
- const tools = await this.getComposioTools(userId, arg2, options?.modifyToolSchema);
718
- return this.toolset.wrapTools(tools, executeToolFn);
717
+ const tools = await this.getRawComposioTools(userId, arg2, options?.modifyToolSchema);
718
+ return this.provider.wrapTools(tools, executeToolFn);
719
719
  }
720
720
  }
721
721
  /**
@@ -835,7 +835,7 @@ var Tools = class {
835
835
  if (customTool) {
836
836
  return this.handleCustomToolExecution(customTool, body, modifiers);
837
837
  } else {
838
- const composioTool = await this.getComposioToolBySlug(body.userId, slug);
838
+ const composioTool = await this.getRawComposioToolBySlug(body.userId, slug);
839
839
  if (!composioTool) {
840
840
  throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`);
841
841
  }
@@ -2260,8 +2260,8 @@ async function checkForLatestVersionFromNPM(currentVersion) {
2260
2260
  }
2261
2261
  }
2262
2262
 
2263
- // src/toolset/BaseToolset.ts
2264
- var BaseToolset = class {
2263
+ // src/provider/BaseProvider.ts
2264
+ var BaseProvider = class {
2265
2265
  /**
2266
2266
  * @internal
2267
2267
  * The function to execute a tool.
@@ -2279,7 +2279,7 @@ var BaseToolset = class {
2279
2279
  /**
2280
2280
  * @public
2281
2281
  * Gloabl function to execute a tool.
2282
- * This function is used by toolset providers to implement helper functions to execute tools.
2282
+ * This function is used by provider providers to implement helper functions to execute tools.
2283
2283
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
2284
2284
  * @param {string} toolSlug - The slug of the tool to execute.
2285
2285
  * @param {Record<string, unknown>} input - The input to the tool.
@@ -2292,19 +2292,19 @@ var BaseToolset = class {
2292
2292
  return this._globalExecuteToolFn(toolSlug, body, modifers);
2293
2293
  }
2294
2294
  };
2295
- var BaseNonAgenticToolset = class extends BaseToolset {
2295
+ var BaseNonAgenticProvider = class extends BaseProvider {
2296
2296
  _isAgentic = false;
2297
2297
  };
2298
- var BaseAgenticToolset = class extends BaseToolset {
2298
+ var BaseAgenticProvider = class extends BaseProvider {
2299
2299
  _isAgentic = true;
2300
2300
  };
2301
2301
 
2302
- // src/toolset/OpenAIToolset.ts
2303
- var OpenAIToolset = class extends BaseNonAgenticToolset {
2302
+ // src/provider/OpenAIProvider.ts
2303
+ var OpenAIProvider = class extends BaseNonAgenticProvider {
2304
2304
  name = "openai";
2305
2305
  /**
2306
- * Absract method to wrap a tool in the toolset.
2307
- * This method is implemented by the toolset.
2306
+ * Absract method to wrap a tool in the provider.
2307
+ * This method is implemented by the provider.
2308
2308
  * @param tool - The tool to wrap.
2309
2309
  * @returns The wrapped tool.
2310
2310
  */
@@ -2465,7 +2465,7 @@ var OpenAIToolset = class extends BaseNonAgenticToolset {
2465
2465
  };
2466
2466
 
2467
2467
  // package.json
2468
- var version = "0.1.10-alpha.0";
2468
+ var version = "0.1.12-alpha.0";
2469
2469
 
2470
2470
  // src/utils/uuid.ts
2471
2471
  var import_uuid = require("uuid");
@@ -2482,7 +2482,7 @@ var Composio = class {
2482
2482
  client;
2483
2483
  /**
2484
2484
  * The configuration for the Composio SDK.
2485
- * @type {ComposioConfig<TToolset>}
2485
+ * @type {ComposioConfig<TProvider>}
2486
2486
  */
2487
2487
  config;
2488
2488
  telemetry;
@@ -2492,7 +2492,7 @@ var Composio = class {
2492
2492
  tools;
2493
2493
  toolkits;
2494
2494
  triggers;
2495
- toolset;
2495
+ provider;
2496
2496
  // auth configs
2497
2497
  authConfigs;
2498
2498
  createAuthConfig;
@@ -2506,7 +2506,7 @@ var Composio = class {
2506
2506
  * @param {string} config.runtime The runtime for the Composio SDK.
2507
2507
  * @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
2508
2508
  * @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
2509
- * @param {TToolset} config.toolset The toolset to use for this Composio instance.
2509
+ * @param {TProvider} config.provider The provider to use for this Composio instance.
2510
2510
  */
2511
2511
  constructor(config) {
2512
2512
  const { baseURL: baseURLParsed, apiKey: apiKeyParsed } = getSDKConfig(
@@ -2524,9 +2524,9 @@ var Composio = class {
2524
2524
  ...config,
2525
2525
  allowTracking: config.allowTracking ?? true
2526
2526
  };
2527
- this.toolset = config.toolset ?? new OpenAIToolset();
2528
- this.tools = new Tools(this.client, this.toolset);
2529
- this.toolset._setExecuteToolFn(this.tools.execute);
2527
+ this.provider = config.provider ?? new OpenAIProvider();
2528
+ this.tools = new Tools(this.client, this.provider);
2529
+ this.provider._setExecuteToolFn(this.tools.execute);
2530
2530
  this.toolkits = new Toolkits(this.client);
2531
2531
  this.triggers = new Triggers(this.client);
2532
2532
  this.authConfigs = new AuthConfigs(this.client);
@@ -2564,7 +2564,7 @@ var Composio = class {
2564
2564
  this.telemetry.instrumentTelemetry(this.triggers);
2565
2565
  this.telemetry.instrumentTelemetry(this.authConfigs);
2566
2566
  this.telemetry.instrumentTelemetry(this.connectedAccounts);
2567
- this.telemetry.instrumentTelemetry(this.toolset);
2567
+ this.telemetry.instrumentTelemetry(this.provider);
2568
2568
  }
2569
2569
  /**
2570
2570
  * Get the Composio SDK client.
@@ -2579,8 +2579,8 @@ var Composio = class {
2579
2579
  /**
2580
2580
  * Fetch all the tools from Composio.
2581
2581
  * @param {ToolListParams} params Parameters to fetch the tools.
2582
- * @param {ToolsetOptions<TToolset>} modifiers Modifiers to apply to the tools.
2583
- * @returns {Promise<ReturnType<TToolset['getTools']>>} The tools from the toolset.
2582
+ * @param {ProviderOptions<TProvider>} modifiers Modifiers to apply to the tools.
2583
+ * @returns {Promise<ReturnType<TProvider['getTools']>>} The tools from the provider.
2584
2584
  */
2585
2585
  getTools(userId, filters, modifiers) {
2586
2586
  return this.tools.get(userId, filters, modifiers);
@@ -2588,17 +2588,17 @@ var Composio = class {
2588
2588
  /**
2589
2589
  * Fetch a tool from Composio by its slug.
2590
2590
  * @param {string} slug slug of the tool
2591
- * @param {ToolsetOptions<TToolset>} modifiers to be applied to the tool
2592
- * @returns {Promise<ReturnType<TToolset['getToolBySlug']>>} The tool from the toolset.
2591
+ * @param {ProviderOptions<TProvider>} modifiers to be applied to the tool
2592
+ * @returns {Promise<ReturnType<TProvider['getToolBySlug']>>} The tool from the provider.
2593
2593
  */
2594
2594
  getToolBySlug(userId, slug, modifiers) {
2595
2595
  return this.tools.get(userId, slug, modifiers);
2596
2596
  }
2597
2597
  };
2598
2598
 
2599
- // src/toolset/ComposioToolset.ts
2600
- var ComposioToolset = class extends BaseNonAgenticToolset {
2601
- name = "ComposioToolset";
2599
+ // src/provider/ComposioProvider.ts
2600
+ var ComposioProvider = class extends BaseNonAgenticProvider {
2601
+ name = "ComposioProvider";
2602
2602
  wrapTool = (tool) => {
2603
2603
  return tool;
2604
2604
  };
@@ -2723,12 +2723,12 @@ Examples: ${value.examples.join(", ")}` : "")
2723
2723
  0 && (module.exports = {
2724
2724
  AuthConfigTypes,
2725
2725
  AuthSchemeTypes,
2726
- BaseAgenticToolset,
2727
- BaseNonAgenticToolset,
2726
+ BaseAgenticProvider,
2727
+ BaseNonAgenticProvider,
2728
2728
  BaseTelemetryTransport,
2729
2729
  Composio,
2730
- ComposioToolset,
2731
- OpenAIToolset,
2730
+ ComposioProvider,
2731
+ OpenAIProvider,
2732
2732
  ToolListParamsSchema,
2733
2733
  jsonSchemaToModel
2734
2734
  });
package/dist/index.d.cts CHANGED
@@ -251,11 +251,11 @@ interface ExecuteMetadata {
251
251
  }
252
252
 
253
253
  /**
254
- * Base toolset implementation, which needs to be implemented by the extended class.
255
- * This class is used to create a base toolset by implementing this class.
256
- * This class also extends InstrumentedInstance, so that the telemetry can be instrumented for the toolset.
254
+ * Base provider implementation, which needs to be implemented by the extended class.
255
+ * This class is used to create a base provider by implementing this class.
256
+ * This class also extends InstrumentedInstance, so that the telemetry can be instrumented for the provider.
257
257
  */
258
- interface Toolset<TTool, TToolCollection> {
258
+ interface Provider<TTool, TToolCollection> {
259
259
  wrapTool: (tool: Tool) => TTool;
260
260
  getTools: (params?: ToolListParams) => Promise<TToolCollection>;
261
261
  }
@@ -264,8 +264,8 @@ type ExecuteToolFnOptions = {
264
264
  customAuthParams?: CustomAuthParams;
265
265
  };
266
266
  /**
267
- * This type is used to infer the wrapped tool type from the toolset.
268
- * It checks if the toolset has a method `_wrapTool` and infers the return type.
267
+ * This type is used to infer the wrapped tool type from the provider.
268
+ * It checks if the provider has a method `_wrapTool` and infers the return type.
269
269
  */
270
270
  type ExecuteToolFn = (toolSlug: string, input: Record<string, unknown>) => Promise<ToolExecuteResponse>;
271
271
  type GlobalExecuteToolFn = (slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers) => Promise<ToolExecuteResponse>;
@@ -273,19 +273,19 @@ type GlobalExecuteToolFn = (slug: string, body: ToolExecuteParams, modifiers?: E
273
273
  /**
274
274
  * @internal
275
275
  * Base class for all toolsets.
276
- * This class is not meant to be used directly, but rather to be extended by different toolset implementations.
276
+ * This class is not meant to be used directly, but rather to be extended by different provider implementations.
277
277
  */
278
- declare abstract class BaseToolset {
278
+ declare abstract class BaseProvider {
279
279
  /**
280
280
  * @public
281
- * The name of the toolset.
282
- * Used to identify the toolset in the telemetry.
281
+ * The name of the provider.
282
+ * Used to identify the provider in the telemetry.
283
283
  */
284
284
  abstract readonly name: string;
285
285
  /**
286
286
  * @internal
287
- * Whether the toolset is agentic.
288
- * This is set automatically set by the core SDK implementation for different toolset types.
287
+ * Whether the provider is agentic.
288
+ * This is set automatically set by the core SDK implementation for different provider types.
289
289
  */
290
290
  abstract readonly _isAgentic: boolean;
291
291
  /**
@@ -303,7 +303,7 @@ declare abstract class BaseToolset {
303
303
  /**
304
304
  * @public
305
305
  * Gloabl function to execute a tool.
306
- * This function is used by toolset providers to implement helper functions to execute tools.
306
+ * This function is used by provider providers to implement helper functions to execute tools.
307
307
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
308
308
  * @param {string} toolSlug - The slug of the tool to execute.
309
309
  * @param {Record<string, unknown>} input - The input to the tool.
@@ -314,9 +314,9 @@ declare abstract class BaseToolset {
314
314
  /**
315
315
  * @public
316
316
  * Base class for all non-agentic toolsets.
317
- * This class is not meant to be used directly, but rather to be extended by concrete toolset implementations.
317
+ * This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
318
318
  */
319
- declare abstract class BaseNonAgenticToolset<TToolCollection, TTool> extends BaseToolset {
319
+ declare abstract class BaseNonAgenticProvider<TToolCollection, TTool> extends BaseProvider {
320
320
  readonly _isAgentic = false;
321
321
  /**
322
322
  * Wrap a tool in the provider specific format.
@@ -334,9 +334,9 @@ declare abstract class BaseNonAgenticToolset<TToolCollection, TTool> extends Bas
334
334
  /**
335
335
  * @public
336
336
  * Base class for all agentic toolsets.
337
- * This class is not meant to be used directly, but rather to be extended by concrete toolset implementations.
337
+ * This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
338
338
  */
339
- declare abstract class BaseAgenticToolset<TToolCollection, TTool> extends BaseToolset {
339
+ declare abstract class BaseAgenticProvider<TToolCollection, TTool> extends BaseProvider {
340
340
  readonly _isAgentic = true;
341
341
  /**
342
342
  * Wrap a tool in the provider specific format.
@@ -354,9 +354,9 @@ declare abstract class BaseAgenticToolset<TToolCollection, TTool> extends BaseTo
354
354
  /**
355
355
  * @internal
356
356
  * Base type for all toolsets.
357
- * This type is used to infer the type of the toolset from the toolset implementation.
357
+ * This type is used to infer the type of the provider from the provider implementation.
358
358
  */
359
- type BaseComposioToolset<TToolCollection, TTool> = BaseNonAgenticToolset<TToolCollection, TTool> | BaseAgenticToolset<TToolCollection, TTool>;
359
+ type BaseComposioProvider<TToolCollection, TTool> = BaseNonAgenticProvider<TToolCollection, TTool> | BaseAgenticProvider<TToolCollection, TTool>;
360
360
 
361
361
  /**
362
362
  * Modifier for altering the tool execute params
@@ -400,17 +400,17 @@ type ExecuteToolModifiers = {
400
400
  * Agentic tool options. These are used by Agentic toolsets
401
401
  */
402
402
  type AgenticToolOptions = ToolOptions & ExecuteToolModifiers;
403
- type ToolsetOptions<T extends BaseComposioToolset<unknown, unknown>> = T extends BaseAgenticToolset<unknown, unknown> ? AgenticToolOptions : ToolOptions;
403
+ type ProviderOptions<T extends BaseComposioProvider<unknown, unknown>> = T extends BaseAgenticProvider<unknown, unknown> ? AgenticToolOptions : ToolOptions;
404
404
 
405
405
  /**
406
406
  * This class is used to manage tools in the Composio SDK.
407
407
  * It provides methods to list, get, and execute tools.
408
408
  */
409
- declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset<TToolCollection, TTool>> {
409
+ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool>> {
410
410
  private client;
411
411
  private readonly customTools;
412
- private toolset;
413
- constructor(client: ComposioClient, toolset: TToolset);
412
+ private provider;
413
+ constructor(client: ComposioClient, provider: TProvider);
414
414
  /**
415
415
  * Transform the tool cases
416
416
  * @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool to transform
@@ -439,10 +439,10 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
439
439
  private getConnectedAccountIdForTool;
440
440
  /**
441
441
  * Lists all tools available in the Composio SDK as well as custom tools.
442
- * This method fetches the tools from the Composio API and wraps them using the toolset.
442
+ * This method fetches the tools from the Composio API and wraps them using the provider.
443
443
  * @returns {ToolList} List of tools
444
444
  */
445
- getComposioTools(userId: string, query?: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
445
+ getRawComposioTools(userId: string, query?: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
446
446
  /**
447
447
  * Retrieves a tool by its Slug.
448
448
  * @param slug The ID of the tool to be retrieved
@@ -450,10 +450,10 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
450
450
  *
451
451
  * @example
452
452
  * ```ts
453
- * const tool = await composio.tools.getComposioToolBySlug('default', 'github');
453
+ * const tool = await composio.tools.getRawComposioToolBySlug('default', 'github');
454
454
  * ```
455
455
  */
456
- getComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
456
+ getRawComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
457
457
  /**
458
458
  * Get a tool by its slug
459
459
  * @param userId - The user id
@@ -466,7 +466,7 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
466
466
  * const tool = await composio.tools.get('default', 'github');
467
467
  * ```
468
468
  */
469
- get<T extends TToolset>(userId: string, slug: string, options?: ToolsetOptions<TToolset>): Promise<ReturnType<T['wrapTool']>>;
469
+ get<T extends TProvider>(userId: string, slug: string, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTool']>>;
470
470
  /**
471
471
  * Get a list of tools by their slugs
472
472
  * @param userId - The user id
@@ -481,7 +481,7 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
481
481
  * });
482
482
  * ```
483
483
  */
484
- get<T extends TToolset>(userId: string, filters: ToolListParams, options?: ToolsetOptions<TToolset>): Promise<ReturnType<T['wrapTools']>>;
484
+ get<T extends TProvider>(userId: string, filters: ToolListParams, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
485
485
  /**
486
486
  * @internal
487
487
  * Creates a function that executes a tool.
@@ -1973,17 +1973,17 @@ declare abstract class BaseTelemetryTransport {
1973
1973
  * Author: Musthaq Ahamad <musthaq@composio.dev>
1974
1974
  * Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/toolsets/openai.ts
1975
1975
  *
1976
- * This is a default toolset for Composio SDK.
1976
+ * This is a default provider for Composio SDK.
1977
1977
  * This will be shipped with the SDK and users don't need to install it separately.
1978
1978
  */
1979
1979
 
1980
1980
  type OpenAiTool = OpenAI.ChatCompletionTool;
1981
1981
  type OpenAiToolCollection = Array<OpenAiTool>;
1982
- declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection, OpenAiTool> {
1982
+ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection, OpenAiTool> {
1983
1983
  readonly name = "openai";
1984
1984
  /**
1985
- * Absract method to wrap a tool in the toolset.
1986
- * This method is implemented by the toolset.
1985
+ * Absract method to wrap a tool in the provider.
1986
+ * This method is implemented by the provider.
1987
1987
  * @param tool - The tool to wrap.
1988
1988
  * @returns The wrapped tool.
1989
1989
  */
@@ -2034,19 +2034,19 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
2034
2034
  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>;
2035
2035
  }
2036
2036
 
2037
- type ComposioConfig<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> = {
2037
+ type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> = {
2038
2038
  apiKey?: string;
2039
2039
  baseURL?: string;
2040
2040
  allowTracking?: boolean;
2041
2041
  allowTracing?: boolean;
2042
- toolset?: TToolset;
2042
+ provider?: TProvider;
2043
2043
  telemetryTransport?: BaseTelemetryTransport;
2044
2044
  };
2045
2045
  /**
2046
2046
  * This is the core class for Composio.
2047
2047
  * It is used to initialize the Composio SDK and provide a global configuration.
2048
2048
  */
2049
- declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> {
2049
+ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> {
2050
2050
  /**
2051
2051
  * The Composio API client.
2052
2052
  * @type {ComposioClient}
@@ -2054,17 +2054,17 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
2054
2054
  private client;
2055
2055
  /**
2056
2056
  * The configuration for the Composio SDK.
2057
- * @type {ComposioConfig<TToolset>}
2057
+ * @type {ComposioConfig<TProvider>}
2058
2058
  */
2059
2059
  private config;
2060
2060
  private telemetry;
2061
2061
  /**
2062
2062
  * Core models for Composio.
2063
2063
  */
2064
- tools: Tools<unknown, unknown, TToolset>;
2064
+ tools: Tools<unknown, unknown, TProvider>;
2065
2065
  toolkits: Toolkits;
2066
2066
  triggers: Triggers;
2067
- toolset: TToolset;
2067
+ provider: TProvider;
2068
2068
  authConfigs: AuthConfigs;
2069
2069
  createAuthConfig: AuthConfigs['create'];
2070
2070
  connectedAccounts: ConnectedAccounts;
@@ -2076,9 +2076,9 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
2076
2076
  * @param {string} config.runtime The runtime for the Composio SDK.
2077
2077
  * @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
2078
2078
  * @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
2079
- * @param {TToolset} config.toolset The toolset to use for this Composio instance.
2079
+ * @param {TProvider} config.provider The provider to use for this Composio instance.
2080
2080
  */
2081
- constructor(config: ComposioConfig<TToolset>);
2081
+ constructor(config: ComposioConfig<TProvider>);
2082
2082
  /**
2083
2083
  * Initialize the instrumentations and telemetry for the Composio SDK.
2084
2084
  * @param {TelemetryMetadata} config - The configuration for the telemetry.
@@ -2093,34 +2093,34 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
2093
2093
  /**
2094
2094
  * Fetch all the tools from Composio.
2095
2095
  * @param {ToolListParams} params Parameters to fetch the tools.
2096
- * @param {ToolsetOptions<TToolset>} modifiers Modifiers to apply to the tools.
2097
- * @returns {Promise<ReturnType<TToolset['getTools']>>} The tools from the toolset.
2096
+ * @param {ProviderOptions<TProvider>} modifiers Modifiers to apply to the tools.
2097
+ * @returns {Promise<ReturnType<TProvider['getTools']>>} The tools from the provider.
2098
2098
  */
2099
- getTools<T extends TToolset>(userId: string, filters: ToolListParams, modifiers?: ToolsetOptions<T>): Promise<ReturnType<T['wrapTools']>>;
2099
+ getTools<T extends TProvider>(userId: string, filters: ToolListParams, modifiers?: ProviderOptions<T>): Promise<ReturnType<T['wrapTools']>>;
2100
2100
  /**
2101
2101
  * Fetch a tool from Composio by its slug.
2102
2102
  * @param {string} slug slug of the tool
2103
- * @param {ToolsetOptions<TToolset>} modifiers to be applied to the tool
2104
- * @returns {Promise<ReturnType<TToolset['getToolBySlug']>>} The tool from the toolset.
2103
+ * @param {ProviderOptions<TProvider>} modifiers to be applied to the tool
2104
+ * @returns {Promise<ReturnType<TProvider['getToolBySlug']>>} The tool from the provider.
2105
2105
  */
2106
- getToolBySlug<T extends TToolset>(userId: string, slug: string, modifiers?: ToolsetOptions<T>): Promise<ReturnType<T['wrapTool']>>;
2106
+ getToolBySlug<T extends TProvider>(userId: string, slug: string, modifiers?: ProviderOptions<T>): Promise<ReturnType<T['wrapTool']>>;
2107
2107
  }
2108
2108
 
2109
2109
  /**
2110
- * This is a default toolset implementation for Composio.
2111
- * This class is used as a default toolset for Composio, if the user does not provide a toolset.
2110
+ * This is a default provider implementation for Composio.
2111
+ * This class is used as a default provider for Composio, if the user does not provide a provider.
2112
2112
  *
2113
2113
  * This class shouldn't be used directly or to be extended.
2114
2114
  */
2115
2115
  interface CustomTool {
2116
2116
  name: string;
2117
2117
  }
2118
- declare class ComposioToolset extends BaseNonAgenticToolset<Array<CustomTool>, CustomTool> {
2119
- readonly name = "ComposioToolset";
2118
+ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>, CustomTool> {
2119
+ readonly name = "ComposioProvider";
2120
2120
  wrapTool: (tool: Tool) => CustomTool;
2121
2121
  wrapTools(tools: Tool[]): CustomTool[];
2122
2122
  }
2123
2123
 
2124
2124
  declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
2125
2125
 
2126
- export { type AfterToolExecuteModifier, type AgenticToolOptions, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticToolset, type BaseComposioToolset, BaseNonAgenticToolset, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioToolset, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIToolset, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type Toolset, type TransformToolSchemaModifier, jsonSchemaToModel };
2126
+ export { type AfterToolExecuteModifier, type AgenticToolOptions, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioProvider, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type TransformToolSchemaModifier, jsonSchemaToModel };
package/dist/index.d.ts CHANGED
@@ -251,11 +251,11 @@ interface ExecuteMetadata {
251
251
  }
252
252
 
253
253
  /**
254
- * Base toolset implementation, which needs to be implemented by the extended class.
255
- * This class is used to create a base toolset by implementing this class.
256
- * This class also extends InstrumentedInstance, so that the telemetry can be instrumented for the toolset.
254
+ * Base provider implementation, which needs to be implemented by the extended class.
255
+ * This class is used to create a base provider by implementing this class.
256
+ * This class also extends InstrumentedInstance, so that the telemetry can be instrumented for the provider.
257
257
  */
258
- interface Toolset<TTool, TToolCollection> {
258
+ interface Provider<TTool, TToolCollection> {
259
259
  wrapTool: (tool: Tool) => TTool;
260
260
  getTools: (params?: ToolListParams) => Promise<TToolCollection>;
261
261
  }
@@ -264,8 +264,8 @@ type ExecuteToolFnOptions = {
264
264
  customAuthParams?: CustomAuthParams;
265
265
  };
266
266
  /**
267
- * This type is used to infer the wrapped tool type from the toolset.
268
- * It checks if the toolset has a method `_wrapTool` and infers the return type.
267
+ * This type is used to infer the wrapped tool type from the provider.
268
+ * It checks if the provider has a method `_wrapTool` and infers the return type.
269
269
  */
270
270
  type ExecuteToolFn = (toolSlug: string, input: Record<string, unknown>) => Promise<ToolExecuteResponse>;
271
271
  type GlobalExecuteToolFn = (slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers) => Promise<ToolExecuteResponse>;
@@ -273,19 +273,19 @@ type GlobalExecuteToolFn = (slug: string, body: ToolExecuteParams, modifiers?: E
273
273
  /**
274
274
  * @internal
275
275
  * Base class for all toolsets.
276
- * This class is not meant to be used directly, but rather to be extended by different toolset implementations.
276
+ * This class is not meant to be used directly, but rather to be extended by different provider implementations.
277
277
  */
278
- declare abstract class BaseToolset {
278
+ declare abstract class BaseProvider {
279
279
  /**
280
280
  * @public
281
- * The name of the toolset.
282
- * Used to identify the toolset in the telemetry.
281
+ * The name of the provider.
282
+ * Used to identify the provider in the telemetry.
283
283
  */
284
284
  abstract readonly name: string;
285
285
  /**
286
286
  * @internal
287
- * Whether the toolset is agentic.
288
- * This is set automatically set by the core SDK implementation for different toolset types.
287
+ * Whether the provider is agentic.
288
+ * This is set automatically set by the core SDK implementation for different provider types.
289
289
  */
290
290
  abstract readonly _isAgentic: boolean;
291
291
  /**
@@ -303,7 +303,7 @@ declare abstract class BaseToolset {
303
303
  /**
304
304
  * @public
305
305
  * Gloabl function to execute a tool.
306
- * This function is used by toolset providers to implement helper functions to execute tools.
306
+ * This function is used by provider providers to implement helper functions to execute tools.
307
307
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
308
308
  * @param {string} toolSlug - The slug of the tool to execute.
309
309
  * @param {Record<string, unknown>} input - The input to the tool.
@@ -314,9 +314,9 @@ declare abstract class BaseToolset {
314
314
  /**
315
315
  * @public
316
316
  * Base class for all non-agentic toolsets.
317
- * This class is not meant to be used directly, but rather to be extended by concrete toolset implementations.
317
+ * This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
318
318
  */
319
- declare abstract class BaseNonAgenticToolset<TToolCollection, TTool> extends BaseToolset {
319
+ declare abstract class BaseNonAgenticProvider<TToolCollection, TTool> extends BaseProvider {
320
320
  readonly _isAgentic = false;
321
321
  /**
322
322
  * Wrap a tool in the provider specific format.
@@ -334,9 +334,9 @@ declare abstract class BaseNonAgenticToolset<TToolCollection, TTool> extends Bas
334
334
  /**
335
335
  * @public
336
336
  * Base class for all agentic toolsets.
337
- * This class is not meant to be used directly, but rather to be extended by concrete toolset implementations.
337
+ * This class is not meant to be used directly, but rather to be extended by concrete provider implementations.
338
338
  */
339
- declare abstract class BaseAgenticToolset<TToolCollection, TTool> extends BaseToolset {
339
+ declare abstract class BaseAgenticProvider<TToolCollection, TTool> extends BaseProvider {
340
340
  readonly _isAgentic = true;
341
341
  /**
342
342
  * Wrap a tool in the provider specific format.
@@ -354,9 +354,9 @@ declare abstract class BaseAgenticToolset<TToolCollection, TTool> extends BaseTo
354
354
  /**
355
355
  * @internal
356
356
  * Base type for all toolsets.
357
- * This type is used to infer the type of the toolset from the toolset implementation.
357
+ * This type is used to infer the type of the provider from the provider implementation.
358
358
  */
359
- type BaseComposioToolset<TToolCollection, TTool> = BaseNonAgenticToolset<TToolCollection, TTool> | BaseAgenticToolset<TToolCollection, TTool>;
359
+ type BaseComposioProvider<TToolCollection, TTool> = BaseNonAgenticProvider<TToolCollection, TTool> | BaseAgenticProvider<TToolCollection, TTool>;
360
360
 
361
361
  /**
362
362
  * Modifier for altering the tool execute params
@@ -400,17 +400,17 @@ type ExecuteToolModifiers = {
400
400
  * Agentic tool options. These are used by Agentic toolsets
401
401
  */
402
402
  type AgenticToolOptions = ToolOptions & ExecuteToolModifiers;
403
- type ToolsetOptions<T extends BaseComposioToolset<unknown, unknown>> = T extends BaseAgenticToolset<unknown, unknown> ? AgenticToolOptions : ToolOptions;
403
+ type ProviderOptions<T extends BaseComposioProvider<unknown, unknown>> = T extends BaseAgenticProvider<unknown, unknown> ? AgenticToolOptions : ToolOptions;
404
404
 
405
405
  /**
406
406
  * This class is used to manage tools in the Composio SDK.
407
407
  * It provides methods to list, get, and execute tools.
408
408
  */
409
- declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset<TToolCollection, TTool>> {
409
+ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvider<TToolCollection, TTool>> {
410
410
  private client;
411
411
  private readonly customTools;
412
- private toolset;
413
- constructor(client: ComposioClient, toolset: TToolset);
412
+ private provider;
413
+ constructor(client: ComposioClient, provider: TProvider);
414
414
  /**
415
415
  * Transform the tool cases
416
416
  * @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool to transform
@@ -439,10 +439,10 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
439
439
  private getConnectedAccountIdForTool;
440
440
  /**
441
441
  * Lists all tools available in the Composio SDK as well as custom tools.
442
- * This method fetches the tools from the Composio API and wraps them using the toolset.
442
+ * This method fetches the tools from the Composio API and wraps them using the provider.
443
443
  * @returns {ToolList} List of tools
444
444
  */
445
- getComposioTools(userId: string, query?: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
445
+ getRawComposioTools(userId: string, query?: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
446
446
  /**
447
447
  * Retrieves a tool by its Slug.
448
448
  * @param slug The ID of the tool to be retrieved
@@ -450,10 +450,10 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
450
450
  *
451
451
  * @example
452
452
  * ```ts
453
- * const tool = await composio.tools.getComposioToolBySlug('default', 'github');
453
+ * const tool = await composio.tools.getRawComposioToolBySlug('default', 'github');
454
454
  * ```
455
455
  */
456
- getComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
456
+ getRawComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
457
457
  /**
458
458
  * Get a tool by its slug
459
459
  * @param userId - The user id
@@ -466,7 +466,7 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
466
466
  * const tool = await composio.tools.get('default', 'github');
467
467
  * ```
468
468
  */
469
- get<T extends TToolset>(userId: string, slug: string, options?: ToolsetOptions<TToolset>): Promise<ReturnType<T['wrapTool']>>;
469
+ get<T extends TProvider>(userId: string, slug: string, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTool']>>;
470
470
  /**
471
471
  * Get a list of tools by their slugs
472
472
  * @param userId - The user id
@@ -481,7 +481,7 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
481
481
  * });
482
482
  * ```
483
483
  */
484
- get<T extends TToolset>(userId: string, filters: ToolListParams, options?: ToolsetOptions<TToolset>): Promise<ReturnType<T['wrapTools']>>;
484
+ get<T extends TProvider>(userId: string, filters: ToolListParams, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
485
485
  /**
486
486
  * @internal
487
487
  * Creates a function that executes a tool.
@@ -1973,17 +1973,17 @@ declare abstract class BaseTelemetryTransport {
1973
1973
  * Author: Musthaq Ahamad <musthaq@composio.dev>
1974
1974
  * Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/toolsets/openai.ts
1975
1975
  *
1976
- * This is a default toolset for Composio SDK.
1976
+ * This is a default provider for Composio SDK.
1977
1977
  * This will be shipped with the SDK and users don't need to install it separately.
1978
1978
  */
1979
1979
 
1980
1980
  type OpenAiTool = OpenAI.ChatCompletionTool;
1981
1981
  type OpenAiToolCollection = Array<OpenAiTool>;
1982
- declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection, OpenAiTool> {
1982
+ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection, OpenAiTool> {
1983
1983
  readonly name = "openai";
1984
1984
  /**
1985
- * Absract method to wrap a tool in the toolset.
1986
- * This method is implemented by the toolset.
1985
+ * Absract method to wrap a tool in the provider.
1986
+ * This method is implemented by the provider.
1987
1987
  * @param tool - The tool to wrap.
1988
1988
  * @returns The wrapped tool.
1989
1989
  */
@@ -2034,19 +2034,19 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
2034
2034
  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>;
2035
2035
  }
2036
2036
 
2037
- type ComposioConfig<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> = {
2037
+ type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> = {
2038
2038
  apiKey?: string;
2039
2039
  baseURL?: string;
2040
2040
  allowTracking?: boolean;
2041
2041
  allowTracing?: boolean;
2042
- toolset?: TToolset;
2042
+ provider?: TProvider;
2043
2043
  telemetryTransport?: BaseTelemetryTransport;
2044
2044
  };
2045
2045
  /**
2046
2046
  * This is the core class for Composio.
2047
2047
  * It is used to initialize the Composio SDK and provide a global configuration.
2048
2048
  */
2049
- declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> {
2049
+ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> {
2050
2050
  /**
2051
2051
  * The Composio API client.
2052
2052
  * @type {ComposioClient}
@@ -2054,17 +2054,17 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
2054
2054
  private client;
2055
2055
  /**
2056
2056
  * The configuration for the Composio SDK.
2057
- * @type {ComposioConfig<TToolset>}
2057
+ * @type {ComposioConfig<TProvider>}
2058
2058
  */
2059
2059
  private config;
2060
2060
  private telemetry;
2061
2061
  /**
2062
2062
  * Core models for Composio.
2063
2063
  */
2064
- tools: Tools<unknown, unknown, TToolset>;
2064
+ tools: Tools<unknown, unknown, TProvider>;
2065
2065
  toolkits: Toolkits;
2066
2066
  triggers: Triggers;
2067
- toolset: TToolset;
2067
+ provider: TProvider;
2068
2068
  authConfigs: AuthConfigs;
2069
2069
  createAuthConfig: AuthConfigs['create'];
2070
2070
  connectedAccounts: ConnectedAccounts;
@@ -2076,9 +2076,9 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
2076
2076
  * @param {string} config.runtime The runtime for the Composio SDK.
2077
2077
  * @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
2078
2078
  * @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
2079
- * @param {TToolset} config.toolset The toolset to use for this Composio instance.
2079
+ * @param {TProvider} config.provider The provider to use for this Composio instance.
2080
2080
  */
2081
- constructor(config: ComposioConfig<TToolset>);
2081
+ constructor(config: ComposioConfig<TProvider>);
2082
2082
  /**
2083
2083
  * Initialize the instrumentations and telemetry for the Composio SDK.
2084
2084
  * @param {TelemetryMetadata} config - The configuration for the telemetry.
@@ -2093,34 +2093,34 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
2093
2093
  /**
2094
2094
  * Fetch all the tools from Composio.
2095
2095
  * @param {ToolListParams} params Parameters to fetch the tools.
2096
- * @param {ToolsetOptions<TToolset>} modifiers Modifiers to apply to the tools.
2097
- * @returns {Promise<ReturnType<TToolset['getTools']>>} The tools from the toolset.
2096
+ * @param {ProviderOptions<TProvider>} modifiers Modifiers to apply to the tools.
2097
+ * @returns {Promise<ReturnType<TProvider['getTools']>>} The tools from the provider.
2098
2098
  */
2099
- getTools<T extends TToolset>(userId: string, filters: ToolListParams, modifiers?: ToolsetOptions<T>): Promise<ReturnType<T['wrapTools']>>;
2099
+ getTools<T extends TProvider>(userId: string, filters: ToolListParams, modifiers?: ProviderOptions<T>): Promise<ReturnType<T['wrapTools']>>;
2100
2100
  /**
2101
2101
  * Fetch a tool from Composio by its slug.
2102
2102
  * @param {string} slug slug of the tool
2103
- * @param {ToolsetOptions<TToolset>} modifiers to be applied to the tool
2104
- * @returns {Promise<ReturnType<TToolset['getToolBySlug']>>} The tool from the toolset.
2103
+ * @param {ProviderOptions<TProvider>} modifiers to be applied to the tool
2104
+ * @returns {Promise<ReturnType<TProvider['getToolBySlug']>>} The tool from the provider.
2105
2105
  */
2106
- getToolBySlug<T extends TToolset>(userId: string, slug: string, modifiers?: ToolsetOptions<T>): Promise<ReturnType<T['wrapTool']>>;
2106
+ getToolBySlug<T extends TProvider>(userId: string, slug: string, modifiers?: ProviderOptions<T>): Promise<ReturnType<T['wrapTool']>>;
2107
2107
  }
2108
2108
 
2109
2109
  /**
2110
- * This is a default toolset implementation for Composio.
2111
- * This class is used as a default toolset for Composio, if the user does not provide a toolset.
2110
+ * This is a default provider implementation for Composio.
2111
+ * This class is used as a default provider for Composio, if the user does not provide a provider.
2112
2112
  *
2113
2113
  * This class shouldn't be used directly or to be extended.
2114
2114
  */
2115
2115
  interface CustomTool {
2116
2116
  name: string;
2117
2117
  }
2118
- declare class ComposioToolset extends BaseNonAgenticToolset<Array<CustomTool>, CustomTool> {
2119
- readonly name = "ComposioToolset";
2118
+ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>, CustomTool> {
2119
+ readonly name = "ComposioProvider";
2120
2120
  wrapTool: (tool: Tool) => CustomTool;
2121
2121
  wrapTools(tools: Tool[]): CustomTool[];
2122
2122
  }
2123
2123
 
2124
2124
  declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
2125
2125
 
2126
- export { type AfterToolExecuteModifier, type AgenticToolOptions, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticToolset, type BaseComposioToolset, BaseNonAgenticToolset, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioToolset, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIToolset, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type Toolset, type TransformToolSchemaModifier, jsonSchemaToModel };
2126
+ export { type AfterToolExecuteModifier, type AgenticToolOptions, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioProvider, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type TransformToolSchemaModifier, jsonSchemaToModel };
package/dist/index.js CHANGED
@@ -182,16 +182,16 @@ var ToolErrorCodes = {
182
182
  INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION",
183
183
  GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET"
184
184
  };
185
- var ComposioToolsetNotDefinedError = class extends ComposioError {
186
- constructor(message = "Toolset not defined", meta = {}) {
185
+ var ComposioProviderNotDefinedError = class extends ComposioError {
186
+ constructor(message = "Provider not defined", meta = {}) {
187
187
  super(message, {
188
188
  code: ToolErrorCodes.TOOLSET_NOT_DEFINED,
189
189
  meta,
190
190
  possibleFixes: [
191
- "Ensure that the toolset is defined in the Composio project and passed into the tool instance"
191
+ "Ensure that the provider is defined in the Composio project and passed into the tool instance"
192
192
  ]
193
193
  });
194
- this.name = "ComposioToolsetNotDefinedError";
194
+ this.name = "ComposioProviderNotDefinedError";
195
195
  }
196
196
  };
197
197
  var ComposioToolNotFoundError = class extends ComposioError {
@@ -252,7 +252,7 @@ var ComposioGlobalExecuteToolFnNotSetError = class extends ComposioError {
252
252
  super(message, {
253
253
  code: ToolErrorCodes.GLOBAL_EXECUTE_TOOL_FN_NOT_SET,
254
254
  meta,
255
- possibleFixes: ["Ensure the global execute tool function is set in the toolset"]
255
+ possibleFixes: ["Ensure the global execute tool function is set in the provider"]
256
256
  });
257
257
  this.name = "ComposioGlobalExecuteToolFnNotSetError";
258
258
  }
@@ -481,20 +481,20 @@ var ValidationError = class extends ComposioError {
481
481
  var Tools = class {
482
482
  client;
483
483
  customTools;
484
- toolset;
485
- constructor(client, toolset) {
484
+ provider;
485
+ constructor(client, provider) {
486
486
  if (!client) {
487
487
  throw new Error("ComposioClient is required");
488
488
  }
489
- if (!toolset) {
490
- throw new ComposioToolsetNotDefinedError("Toolset not passed into Tools instance");
489
+ if (!provider) {
490
+ throw new ComposioProviderNotDefinedError("Provider not passed into Tools instance");
491
491
  }
492
492
  this.client = client;
493
493
  this.customTools = new CustomTools(client);
494
- this.toolset = toolset;
494
+ this.provider = provider;
495
495
  this.execute = this.execute.bind(this);
496
- this.getComposioToolBySlug = this.getComposioToolBySlug.bind(this);
497
- this.getComposioTools = this.getComposioTools.bind(this);
496
+ this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
497
+ this.getRawComposioTools = this.getRawComposioTools.bind(this);
498
498
  }
499
499
  /**
500
500
  * Transform the tool cases
@@ -569,7 +569,7 @@ var Tools = class {
569
569
  * @returns {Promise<string | null>} The connected account id or null if the toolkit is a no auth app
570
570
  */
571
571
  async getConnectedAccountIdForTool(userId, toolSlug) {
572
- const tool = await this.getComposioToolBySlug(userId, toolSlug);
572
+ const tool = await this.getRawComposioToolBySlug(userId, toolSlug);
573
573
  if (!tool.toolkit) {
574
574
  throw new Error(`Unable to find toolkit for tool ${toolSlug}`);
575
575
  }
@@ -597,10 +597,10 @@ var Tools = class {
597
597
  }
598
598
  /**
599
599
  * Lists all tools available in the Composio SDK as well as custom tools.
600
- * This method fetches the tools from the Composio API and wraps them using the toolset.
600
+ * This method fetches the tools from the Composio API and wraps them using the provider.
601
601
  * @returns {ToolList} List of tools
602
602
  */
603
- async getComposioTools(userId, query = {}, modifier) {
603
+ async getRawComposioTools(userId, query = {}, modifier) {
604
604
  const queryParams = ToolListParamsSchema.safeParse(query);
605
605
  if (queryParams.error) {
606
606
  throw new ValidationError(queryParams.error);
@@ -639,10 +639,10 @@ var Tools = class {
639
639
  *
640
640
  * @example
641
641
  * ```ts
642
- * const tool = await composio.tools.getComposioToolBySlug('default', 'github');
642
+ * const tool = await composio.tools.getRawComposioToolBySlug('default', 'github');
643
643
  * ```
644
644
  */
645
- async getComposioToolBySlug(userId, slug, modifier) {
645
+ async getRawComposioToolBySlug(userId, slug, modifier) {
646
646
  const customTool = await this.customTools.getCustomToolBySlug(slug);
647
647
  if (customTool) {
648
648
  return customTool;
@@ -650,7 +650,7 @@ var Tools = class {
650
650
  const tool = await this.client.tools.retrieve(slug);
651
651
  if (!tool) {
652
652
  throw new ComposioToolNotFoundError(
653
- `[getComposioToolBySlug] Tool with slug ${slug} not found`
653
+ `[getRawComposioToolBySlug] Tool with slug ${slug} not found`
654
654
  );
655
655
  }
656
656
  let modifiedToool = this.transformToolCases(tool);
@@ -673,11 +673,11 @@ var Tools = class {
673
673
  async get(userId, arg2, options) {
674
674
  const executeToolFn = this.createExecuteToolFn(userId, options);
675
675
  if (typeof arg2 === "string") {
676
- const tool = await this.getComposioToolBySlug(userId, arg2, options?.modifyToolSchema);
677
- return this.toolset.wrapTool(tool, executeToolFn);
676
+ const tool = await this.getRawComposioToolBySlug(userId, arg2, options?.modifyToolSchema);
677
+ return this.provider.wrapTool(tool, executeToolFn);
678
678
  } else {
679
- const tools = await this.getComposioTools(userId, arg2, options?.modifyToolSchema);
680
- return this.toolset.wrapTools(tools, executeToolFn);
679
+ const tools = await this.getRawComposioTools(userId, arg2, options?.modifyToolSchema);
680
+ return this.provider.wrapTools(tools, executeToolFn);
681
681
  }
682
682
  }
683
683
  /**
@@ -797,7 +797,7 @@ var Tools = class {
797
797
  if (customTool) {
798
798
  return this.handleCustomToolExecution(customTool, body, modifiers);
799
799
  } else {
800
- const composioTool = await this.getComposioToolBySlug(body.userId, slug);
800
+ const composioTool = await this.getRawComposioToolBySlug(body.userId, slug);
801
801
  if (!composioTool) {
802
802
  throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`);
803
803
  }
@@ -2222,8 +2222,8 @@ async function checkForLatestVersionFromNPM(currentVersion) {
2222
2222
  }
2223
2223
  }
2224
2224
 
2225
- // src/toolset/BaseToolset.ts
2226
- var BaseToolset = class {
2225
+ // src/provider/BaseProvider.ts
2226
+ var BaseProvider = class {
2227
2227
  /**
2228
2228
  * @internal
2229
2229
  * The function to execute a tool.
@@ -2241,7 +2241,7 @@ var BaseToolset = class {
2241
2241
  /**
2242
2242
  * @public
2243
2243
  * Gloabl function to execute a tool.
2244
- * This function is used by toolset providers to implement helper functions to execute tools.
2244
+ * This function is used by provider providers to implement helper functions to execute tools.
2245
2245
  * This is a 1:1 mapping of the `execute` method in the `Tools` class.
2246
2246
  * @param {string} toolSlug - The slug of the tool to execute.
2247
2247
  * @param {Record<string, unknown>} input - The input to the tool.
@@ -2254,19 +2254,19 @@ var BaseToolset = class {
2254
2254
  return this._globalExecuteToolFn(toolSlug, body, modifers);
2255
2255
  }
2256
2256
  };
2257
- var BaseNonAgenticToolset = class extends BaseToolset {
2257
+ var BaseNonAgenticProvider = class extends BaseProvider {
2258
2258
  _isAgentic = false;
2259
2259
  };
2260
- var BaseAgenticToolset = class extends BaseToolset {
2260
+ var BaseAgenticProvider = class extends BaseProvider {
2261
2261
  _isAgentic = true;
2262
2262
  };
2263
2263
 
2264
- // src/toolset/OpenAIToolset.ts
2265
- var OpenAIToolset = class extends BaseNonAgenticToolset {
2264
+ // src/provider/OpenAIProvider.ts
2265
+ var OpenAIProvider = class extends BaseNonAgenticProvider {
2266
2266
  name = "openai";
2267
2267
  /**
2268
- * Absract method to wrap a tool in the toolset.
2269
- * This method is implemented by the toolset.
2268
+ * Absract method to wrap a tool in the provider.
2269
+ * This method is implemented by the provider.
2270
2270
  * @param tool - The tool to wrap.
2271
2271
  * @returns The wrapped tool.
2272
2272
  */
@@ -2427,7 +2427,7 @@ var OpenAIToolset = class extends BaseNonAgenticToolset {
2427
2427
  };
2428
2428
 
2429
2429
  // package.json
2430
- var version = "0.1.10-alpha.0";
2430
+ var version = "0.1.12-alpha.0";
2431
2431
 
2432
2432
  // src/utils/uuid.ts
2433
2433
  import { v4 as uuidv4 } from "uuid";
@@ -2444,7 +2444,7 @@ var Composio = class {
2444
2444
  client;
2445
2445
  /**
2446
2446
  * The configuration for the Composio SDK.
2447
- * @type {ComposioConfig<TToolset>}
2447
+ * @type {ComposioConfig<TProvider>}
2448
2448
  */
2449
2449
  config;
2450
2450
  telemetry;
@@ -2454,7 +2454,7 @@ var Composio = class {
2454
2454
  tools;
2455
2455
  toolkits;
2456
2456
  triggers;
2457
- toolset;
2457
+ provider;
2458
2458
  // auth configs
2459
2459
  authConfigs;
2460
2460
  createAuthConfig;
@@ -2468,7 +2468,7 @@ var Composio = class {
2468
2468
  * @param {string} config.runtime The runtime for the Composio SDK.
2469
2469
  * @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
2470
2470
  * @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
2471
- * @param {TToolset} config.toolset The toolset to use for this Composio instance.
2471
+ * @param {TProvider} config.provider The provider to use for this Composio instance.
2472
2472
  */
2473
2473
  constructor(config) {
2474
2474
  const { baseURL: baseURLParsed, apiKey: apiKeyParsed } = getSDKConfig(
@@ -2486,9 +2486,9 @@ var Composio = class {
2486
2486
  ...config,
2487
2487
  allowTracking: config.allowTracking ?? true
2488
2488
  };
2489
- this.toolset = config.toolset ?? new OpenAIToolset();
2490
- this.tools = new Tools(this.client, this.toolset);
2491
- this.toolset._setExecuteToolFn(this.tools.execute);
2489
+ this.provider = config.provider ?? new OpenAIProvider();
2490
+ this.tools = new Tools(this.client, this.provider);
2491
+ this.provider._setExecuteToolFn(this.tools.execute);
2492
2492
  this.toolkits = new Toolkits(this.client);
2493
2493
  this.triggers = new Triggers(this.client);
2494
2494
  this.authConfigs = new AuthConfigs(this.client);
@@ -2526,7 +2526,7 @@ var Composio = class {
2526
2526
  this.telemetry.instrumentTelemetry(this.triggers);
2527
2527
  this.telemetry.instrumentTelemetry(this.authConfigs);
2528
2528
  this.telemetry.instrumentTelemetry(this.connectedAccounts);
2529
- this.telemetry.instrumentTelemetry(this.toolset);
2529
+ this.telemetry.instrumentTelemetry(this.provider);
2530
2530
  }
2531
2531
  /**
2532
2532
  * Get the Composio SDK client.
@@ -2541,8 +2541,8 @@ var Composio = class {
2541
2541
  /**
2542
2542
  * Fetch all the tools from Composio.
2543
2543
  * @param {ToolListParams} params Parameters to fetch the tools.
2544
- * @param {ToolsetOptions<TToolset>} modifiers Modifiers to apply to the tools.
2545
- * @returns {Promise<ReturnType<TToolset['getTools']>>} The tools from the toolset.
2544
+ * @param {ProviderOptions<TProvider>} modifiers Modifiers to apply to the tools.
2545
+ * @returns {Promise<ReturnType<TProvider['getTools']>>} The tools from the provider.
2546
2546
  */
2547
2547
  getTools(userId, filters, modifiers) {
2548
2548
  return this.tools.get(userId, filters, modifiers);
@@ -2550,17 +2550,17 @@ var Composio = class {
2550
2550
  /**
2551
2551
  * Fetch a tool from Composio by its slug.
2552
2552
  * @param {string} slug slug of the tool
2553
- * @param {ToolsetOptions<TToolset>} modifiers to be applied to the tool
2554
- * @returns {Promise<ReturnType<TToolset['getToolBySlug']>>} The tool from the toolset.
2553
+ * @param {ProviderOptions<TProvider>} modifiers to be applied to the tool
2554
+ * @returns {Promise<ReturnType<TProvider['getToolBySlug']>>} The tool from the provider.
2555
2555
  */
2556
2556
  getToolBySlug(userId, slug, modifiers) {
2557
2557
  return this.tools.get(userId, slug, modifiers);
2558
2558
  }
2559
2559
  };
2560
2560
 
2561
- // src/toolset/ComposioToolset.ts
2562
- var ComposioToolset = class extends BaseNonAgenticToolset {
2563
- name = "ComposioToolset";
2561
+ // src/provider/ComposioProvider.ts
2562
+ var ComposioProvider = class extends BaseNonAgenticProvider {
2563
+ name = "ComposioProvider";
2564
2564
  wrapTool = (tool) => {
2565
2565
  return tool;
2566
2566
  };
@@ -2684,12 +2684,12 @@ Examples: ${value.examples.join(", ")}` : "")
2684
2684
  export {
2685
2685
  AuthConfigTypes,
2686
2686
  AuthSchemeTypes,
2687
- BaseAgenticToolset,
2688
- BaseNonAgenticToolset,
2687
+ BaseAgenticProvider,
2688
+ BaseNonAgenticProvider,
2689
2689
  BaseTelemetryTransport,
2690
2690
  Composio,
2691
- ComposioToolset,
2692
- OpenAIToolset,
2691
+ ComposioProvider,
2692
+ OpenAIProvider,
2693
2693
  ToolListParamsSchema,
2694
2694
  jsonSchemaToModel
2695
2695
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composio/core",
3
- "version": "0.1.10-alpha.0",
3
+ "version": "0.1.12-alpha.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "build": "tsup",
25
- "test": "vitest"
25
+ "test": "vitest run"
26
26
  },
27
27
  "keywords": [],
28
28
  "author": "",
@@ -42,5 +42,5 @@
42
42
  "zod": "^3.24.2",
43
43
  "zod-to-json-schema": "^3.24.5"
44
44
  },
45
- "gitHead": "8f757632d77f40800f7ebc0dddec87ee14d52720"
45
+ "gitHead": "fb9c8e7b65030f35e004dba81ae971bcbaed2dfd"
46
46
  }
package/src/index.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  // Core exports
2
2
  export { Composio } from './composio';
3
- export { ComposioToolset } from './toolset/ComposioToolset';
4
- export { BaseAgenticToolset, BaseNonAgenticToolset } from './toolset/BaseToolset';
5
- export type { BaseComposioToolset } from './toolset/BaseToolset';
6
- export { OpenAIToolset } from './toolset/OpenAIToolset';
3
+ export { ComposioProvider } from './provider/ComposioProvider';
4
+ export { BaseAgenticProvider, BaseNonAgenticProvider } from './provider/BaseProvider';
5
+ export type { BaseComposioProvider } from './provider/BaseProvider';
6
+ export { OpenAIProvider } from './provider/OpenAIProvider';
7
7
  export { BaseTelemetryTransport } from './telemetry/TelemetryTransport';
8
8
  export { jsonSchemaToModel } from './utils/jsonSchema';
9
9
  export { ToolListParamsSchema } from './types/tool.types';
10
10
  export type { Tool, ToolListParams, ToolExecuteParams } from './types/tool.types';
11
- export type { Toolset, ExecuteToolFn, ExecuteToolFnOptions } from './types/toolset.types';
11
+ export type { Provider, ExecuteToolFn, ExecuteToolFnOptions } from './types/provider.types';
12
12
  export type { ExecuteMetadata } from './types/customTool.types';
13
13
  export { AuthConfigTypes, AuthSchemeTypes } from './types/authConfigs.types';
14
14
  export type { AuthConfigType, AuthSchemeType } from './types/authConfigs.types';