@composio/core 0.1.12-alpha.10 → 0.1.12-alpha.11
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 +798 -373
- package/dist/index.d.cts +208 -22
- package/dist/index.d.ts +208 -22
- package/dist/index.js +614 -212
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1867,6 +1867,20 @@ declare class Toolkits {
|
|
|
1867
1867
|
* @private
|
|
1868
1868
|
*/
|
|
1869
1869
|
private getToolkits;
|
|
1870
|
+
/**
|
|
1871
|
+
* Retrieves a specific toolkit by its slug identifier.
|
|
1872
|
+
*
|
|
1873
|
+
* This method fetches a single toolkit from the Composio API and transforms
|
|
1874
|
+
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
|
|
1875
|
+
*
|
|
1876
|
+
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
|
|
1877
|
+
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
|
|
1878
|
+
* @throws {ValidationError} If the response cannot be properly parsed
|
|
1879
|
+
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
|
|
1880
|
+
*
|
|
1881
|
+
* @private
|
|
1882
|
+
*/
|
|
1883
|
+
private getToolkitBySlug;
|
|
1870
1884
|
/**
|
|
1871
1885
|
* Retrieves a specific toolkit by its slug identifier.
|
|
1872
1886
|
*
|
|
@@ -1906,20 +1920,6 @@ declare class Toolkits {
|
|
|
1906
1920
|
* ```
|
|
1907
1921
|
*/
|
|
1908
1922
|
get(query: ToolkitListParams): Promise<ToolKitListResponse>;
|
|
1909
|
-
/**
|
|
1910
|
-
* Retrieves a specific toolkit by its slug identifier.
|
|
1911
|
-
*
|
|
1912
|
-
* This method fetches a single toolkit from the Composio API and transforms
|
|
1913
|
-
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
|
|
1914
|
-
*
|
|
1915
|
-
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
|
|
1916
|
-
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
|
|
1917
|
-
* @throws {ValidationError} If the response cannot be properly parsed
|
|
1918
|
-
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
|
|
1919
|
-
*
|
|
1920
|
-
* @private
|
|
1921
|
-
*/
|
|
1922
|
-
private getToolkitBySlug;
|
|
1923
1923
|
/**
|
|
1924
1924
|
* Retrieves all toolkit categories available in the Composio SDK.
|
|
1925
1925
|
*
|
|
@@ -2224,16 +2224,16 @@ declare const AuthConfigListParamsSchema: z.ZodObject<{
|
|
|
2224
2224
|
cursor: z.ZodOptional<z.ZodString>;
|
|
2225
2225
|
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
2226
2226
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
2227
|
-
|
|
2227
|
+
toolkit: z.ZodOptional<z.ZodString>;
|
|
2228
2228
|
}, "strip", z.ZodTypeAny, {
|
|
2229
|
+
toolkit?: string | undefined;
|
|
2229
2230
|
cursor?: string | undefined;
|
|
2230
2231
|
limit?: number | undefined;
|
|
2231
|
-
toolkitSlug?: string | undefined;
|
|
2232
2232
|
isComposioManaged?: boolean | undefined;
|
|
2233
2233
|
}, {
|
|
2234
|
+
toolkit?: string | undefined;
|
|
2234
2235
|
cursor?: string | undefined;
|
|
2235
2236
|
limit?: number | undefined;
|
|
2236
|
-
toolkitSlug?: string | undefined;
|
|
2237
2237
|
isComposioManaged?: boolean | undefined;
|
|
2238
2238
|
}>;
|
|
2239
2239
|
type AuthConfigListParams = z.infer<typeof AuthConfigListParamsSchema>;
|
|
@@ -2422,7 +2422,7 @@ declare class AuthConfigs {
|
|
|
2422
2422
|
*
|
|
2423
2423
|
* // List auth configs for a specific toolkit
|
|
2424
2424
|
* const githubConfigs = await composio.authConfigs.list({
|
|
2425
|
-
*
|
|
2425
|
+
* toolkit: 'github'
|
|
2426
2426
|
* });
|
|
2427
2427
|
*
|
|
2428
2428
|
* // List Composio-managed auth configs
|
|
@@ -2846,8 +2846,8 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
|
|
|
2846
2846
|
}
|
|
2847
2847
|
|
|
2848
2848
|
type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> = {
|
|
2849
|
-
apiKey?: string;
|
|
2850
|
-
baseURL?: string;
|
|
2849
|
+
apiKey?: string | null;
|
|
2850
|
+
baseURL?: string | null;
|
|
2851
2851
|
allowTracking?: boolean;
|
|
2852
2852
|
allowTracing?: boolean;
|
|
2853
2853
|
provider?: TProvider;
|
|
@@ -2886,7 +2886,7 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
|
|
|
2886
2886
|
* @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
|
|
2887
2887
|
* @param {TProvider} config.provider The provider to use for this Composio instance.
|
|
2888
2888
|
*/
|
|
2889
|
-
constructor(config
|
|
2889
|
+
constructor(config?: ComposioConfig<TProvider>);
|
|
2890
2890
|
/**
|
|
2891
2891
|
* Get the Composio SDK client.
|
|
2892
2892
|
* @returns {ComposioClient} The Composio API client.
|
|
@@ -2911,4 +2911,190 @@ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>,
|
|
|
2911
2911
|
|
|
2912
2912
|
declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
2913
2913
|
|
|
2914
|
-
|
|
2914
|
+
/**
|
|
2915
|
+
* Options for error handling
|
|
2916
|
+
*/
|
|
2917
|
+
interface ErrorHandleOptions {
|
|
2918
|
+
/** Whether to include the stack trace in the output */
|
|
2919
|
+
includeStack?: boolean;
|
|
2920
|
+
/** Whether to exit the process after handling */
|
|
2921
|
+
exitProcess?: boolean;
|
|
2922
|
+
/** The exit code to use if exiting the process */
|
|
2923
|
+
exitCode?: number;
|
|
2924
|
+
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Options for creating a ComposioError
|
|
2927
|
+
*/
|
|
2928
|
+
type ComposioErrorOptions = {
|
|
2929
|
+
/** Error code for categorizing errors */
|
|
2930
|
+
code?: string;
|
|
2931
|
+
/** HTTP status code associated with the error */
|
|
2932
|
+
statusCode?: number;
|
|
2933
|
+
/** The underlying cause of the error */
|
|
2934
|
+
cause?: unknown;
|
|
2935
|
+
/** Additional metadata associated with the error */
|
|
2936
|
+
meta?: Record<string, unknown>;
|
|
2937
|
+
/** Suggested fixes for the error */
|
|
2938
|
+
possibleFixes?: string[];
|
|
2939
|
+
/** Custom stack trace */
|
|
2940
|
+
stack?: string;
|
|
2941
|
+
};
|
|
2942
|
+
/**
|
|
2943
|
+
* Base error class for all Composio errors
|
|
2944
|
+
*/
|
|
2945
|
+
declare class ComposioError extends Error {
|
|
2946
|
+
/** @readonly Error name */
|
|
2947
|
+
name: string;
|
|
2948
|
+
code?: string;
|
|
2949
|
+
possibleFixes?: string[];
|
|
2950
|
+
errorId?: string;
|
|
2951
|
+
/**
|
|
2952
|
+
* Creates a new ComposioError
|
|
2953
|
+
* @param message Error message
|
|
2954
|
+
* @param options Additional error options
|
|
2955
|
+
*/
|
|
2956
|
+
constructor(message: string, options?: ComposioErrorOptions);
|
|
2957
|
+
/**
|
|
2958
|
+
* Helper method to define a property only if it has a value
|
|
2959
|
+
* @param propertyName Name of the property to define
|
|
2960
|
+
* @param value Value to assign to the property
|
|
2961
|
+
* @private
|
|
2962
|
+
*/
|
|
2963
|
+
private definePropertyIfExists;
|
|
2964
|
+
/**
|
|
2965
|
+
* Extract and normalize error data for formatting
|
|
2966
|
+
* @param includeStack Whether to include stack trace information
|
|
2967
|
+
* @returns Structured error data for formatting
|
|
2968
|
+
* @private
|
|
2969
|
+
*/
|
|
2970
|
+
private getErrorData;
|
|
2971
|
+
/**
|
|
2972
|
+
* Prints a user-friendly, colorful representation of the error to the logger
|
|
2973
|
+
* @param includeStack Whether to include the stack trace in the output (default: false)
|
|
2974
|
+
*/
|
|
2975
|
+
prettyPrint(includeStack?: boolean): void;
|
|
2976
|
+
/**
|
|
2977
|
+
* Static factory method to create and pretty print an error in one step
|
|
2978
|
+
* @param message Error message
|
|
2979
|
+
* @param options Error options
|
|
2980
|
+
* @param includeStack Whether to include the stack trace in the output
|
|
2981
|
+
* @returns The created error instance
|
|
2982
|
+
*/
|
|
2983
|
+
static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError;
|
|
2984
|
+
/**
|
|
2985
|
+
* Utility function to handle errors in a consistent way
|
|
2986
|
+
* This properly displays the error and exits the process if needed
|
|
2987
|
+
* @param error The error to handle
|
|
2988
|
+
* @param options Options for error handling
|
|
2989
|
+
*/
|
|
2990
|
+
static handle(error: unknown, options?: ErrorHandleOptions): void;
|
|
2991
|
+
/**
|
|
2992
|
+
* Helper method to handle Zod validation errors
|
|
2993
|
+
* @param error The Zod error to handle
|
|
2994
|
+
* @param includeStack Whether to include the stack trace
|
|
2995
|
+
* @private
|
|
2996
|
+
*/
|
|
2997
|
+
private static handleZodError;
|
|
2998
|
+
/**
|
|
2999
|
+
* Helper method to handle standard Error objects
|
|
3000
|
+
* @param error The standard error to handle
|
|
3001
|
+
* @param includeStack Whether to include the stack trace
|
|
3002
|
+
* @private
|
|
3003
|
+
*/
|
|
3004
|
+
private static handleStandardError;
|
|
3005
|
+
/**
|
|
3006
|
+
* Helper method to handle unknown error types
|
|
3007
|
+
* @param error The unknown error value
|
|
3008
|
+
* @private
|
|
3009
|
+
*/
|
|
3010
|
+
private static handleUnknownError;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
declare const AuthConfigErrorCodes: {
|
|
3014
|
+
readonly AUTH_CONFIG_NOT_FOUND: "AUTH_CONFIG_NOT_FOUND";
|
|
3015
|
+
};
|
|
3016
|
+
declare class ComposioAuthConfigNotFoundError extends ComposioError {
|
|
3017
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
declare const ConnectedAccountErrorCodes: {
|
|
3021
|
+
readonly CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND";
|
|
3022
|
+
};
|
|
3023
|
+
declare class ComposioConnectedAccountNotFoundError extends ComposioError {
|
|
3024
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
declare const ConnectionRequestErrorCodes: {
|
|
3028
|
+
readonly CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT";
|
|
3029
|
+
readonly CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED";
|
|
3030
|
+
};
|
|
3031
|
+
declare class ConnectionRequestTimeoutError extends ComposioError {
|
|
3032
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3033
|
+
}
|
|
3034
|
+
declare class ConnectionRequestFailedError extends ComposioError {
|
|
3035
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
declare const ToolErrorCodes: {
|
|
3039
|
+
readonly TOOLSET_NOT_DEFINED: "TOOLSET_NOT_DEFINED";
|
|
3040
|
+
readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
|
|
3041
|
+
readonly INVALID_MODIFIER: "INVALID_MODIFIER";
|
|
3042
|
+
readonly CUSTOM_TOOLS_NOT_INITIALIZED: "CUSTOM_TOOLS_NOT_INITIALIZED";
|
|
3043
|
+
readonly TOOL_EXECUTION_ERROR: "TOOL_EXECUTION_ERROR";
|
|
3044
|
+
readonly INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION";
|
|
3045
|
+
readonly GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET";
|
|
3046
|
+
};
|
|
3047
|
+
declare class ComposioProviderNotDefinedError extends ComposioError {
|
|
3048
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3049
|
+
}
|
|
3050
|
+
declare class ComposioToolNotFoundError extends ComposioError {
|
|
3051
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3052
|
+
}
|
|
3053
|
+
declare class ComposioInvalidModifierError extends ComposioError {
|
|
3054
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3055
|
+
}
|
|
3056
|
+
declare class ComposioCustomToolsNotInitializedError extends ComposioError {
|
|
3057
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3058
|
+
}
|
|
3059
|
+
declare class ComposioToolExecutionError extends ComposioError {
|
|
3060
|
+
readonly error: Error;
|
|
3061
|
+
constructor(message?: string, options?: ComposioErrorOptions & {
|
|
3062
|
+
originalError?: Error;
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
declare class ComposioInvalidExecuteFunctionError extends ComposioError {
|
|
3066
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3067
|
+
}
|
|
3068
|
+
declare class ComposioGlobalExecuteToolFnNotSetError extends ComposioError {
|
|
3069
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
declare const ToolkitErrorCodes: {
|
|
3073
|
+
readonly TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND";
|
|
3074
|
+
};
|
|
3075
|
+
declare class ComposioToolkitNotFoundError extends ComposioError {
|
|
3076
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3077
|
+
}
|
|
3078
|
+
declare class ComposioToolkitFetchError extends ComposioError {
|
|
3079
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
/**
|
|
3083
|
+
* Represents an input validation error using Zod.
|
|
3084
|
+
*/
|
|
3085
|
+
declare const ValidationErrorCodes: {
|
|
3086
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
3087
|
+
};
|
|
3088
|
+
declare class ValidationError extends ComposioError {
|
|
3089
|
+
constructor(message?: string, options?: ComposioErrorOptions);
|
|
3090
|
+
private generateUserFriendlyMessage;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
declare const SDKErrorCodes: {
|
|
3094
|
+
NO_API_KEY_PROVIDED: string;
|
|
3095
|
+
};
|
|
3096
|
+
declare class ComposioNoAPIKeyError extends ComposioError {
|
|
3097
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConsoleTelemetryTransport, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, ToolkitErrorCodes, type TransformToolSchemaModifier, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToModel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1867,6 +1867,20 @@ declare class Toolkits {
|
|
|
1867
1867
|
* @private
|
|
1868
1868
|
*/
|
|
1869
1869
|
private getToolkits;
|
|
1870
|
+
/**
|
|
1871
|
+
* Retrieves a specific toolkit by its slug identifier.
|
|
1872
|
+
*
|
|
1873
|
+
* This method fetches a single toolkit from the Composio API and transforms
|
|
1874
|
+
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
|
|
1875
|
+
*
|
|
1876
|
+
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
|
|
1877
|
+
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
|
|
1878
|
+
* @throws {ValidationError} If the response cannot be properly parsed
|
|
1879
|
+
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
|
|
1880
|
+
*
|
|
1881
|
+
* @private
|
|
1882
|
+
*/
|
|
1883
|
+
private getToolkitBySlug;
|
|
1870
1884
|
/**
|
|
1871
1885
|
* Retrieves a specific toolkit by its slug identifier.
|
|
1872
1886
|
*
|
|
@@ -1906,20 +1920,6 @@ declare class Toolkits {
|
|
|
1906
1920
|
* ```
|
|
1907
1921
|
*/
|
|
1908
1922
|
get(query: ToolkitListParams): Promise<ToolKitListResponse>;
|
|
1909
|
-
/**
|
|
1910
|
-
* Retrieves a specific toolkit by its slug identifier.
|
|
1911
|
-
*
|
|
1912
|
-
* This method fetches a single toolkit from the Composio API and transforms
|
|
1913
|
-
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
|
|
1914
|
-
*
|
|
1915
|
-
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
|
|
1916
|
-
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
|
|
1917
|
-
* @throws {ValidationError} If the response cannot be properly parsed
|
|
1918
|
-
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
|
|
1919
|
-
*
|
|
1920
|
-
* @private
|
|
1921
|
-
*/
|
|
1922
|
-
private getToolkitBySlug;
|
|
1923
1923
|
/**
|
|
1924
1924
|
* Retrieves all toolkit categories available in the Composio SDK.
|
|
1925
1925
|
*
|
|
@@ -2224,16 +2224,16 @@ declare const AuthConfigListParamsSchema: z.ZodObject<{
|
|
|
2224
2224
|
cursor: z.ZodOptional<z.ZodString>;
|
|
2225
2225
|
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
2226
2226
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
2227
|
-
|
|
2227
|
+
toolkit: z.ZodOptional<z.ZodString>;
|
|
2228
2228
|
}, "strip", z.ZodTypeAny, {
|
|
2229
|
+
toolkit?: string | undefined;
|
|
2229
2230
|
cursor?: string | undefined;
|
|
2230
2231
|
limit?: number | undefined;
|
|
2231
|
-
toolkitSlug?: string | undefined;
|
|
2232
2232
|
isComposioManaged?: boolean | undefined;
|
|
2233
2233
|
}, {
|
|
2234
|
+
toolkit?: string | undefined;
|
|
2234
2235
|
cursor?: string | undefined;
|
|
2235
2236
|
limit?: number | undefined;
|
|
2236
|
-
toolkitSlug?: string | undefined;
|
|
2237
2237
|
isComposioManaged?: boolean | undefined;
|
|
2238
2238
|
}>;
|
|
2239
2239
|
type AuthConfigListParams = z.infer<typeof AuthConfigListParamsSchema>;
|
|
@@ -2422,7 +2422,7 @@ declare class AuthConfigs {
|
|
|
2422
2422
|
*
|
|
2423
2423
|
* // List auth configs for a specific toolkit
|
|
2424
2424
|
* const githubConfigs = await composio.authConfigs.list({
|
|
2425
|
-
*
|
|
2425
|
+
* toolkit: 'github'
|
|
2426
2426
|
* });
|
|
2427
2427
|
*
|
|
2428
2428
|
* // List Composio-managed auth configs
|
|
@@ -2846,8 +2846,8 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
|
|
|
2846
2846
|
}
|
|
2847
2847
|
|
|
2848
2848
|
type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> = {
|
|
2849
|
-
apiKey?: string;
|
|
2850
|
-
baseURL?: string;
|
|
2849
|
+
apiKey?: string | null;
|
|
2850
|
+
baseURL?: string | null;
|
|
2851
2851
|
allowTracking?: boolean;
|
|
2852
2852
|
allowTracing?: boolean;
|
|
2853
2853
|
provider?: TProvider;
|
|
@@ -2886,7 +2886,7 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
|
|
|
2886
2886
|
* @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
|
|
2887
2887
|
* @param {TProvider} config.provider The provider to use for this Composio instance.
|
|
2888
2888
|
*/
|
|
2889
|
-
constructor(config
|
|
2889
|
+
constructor(config?: ComposioConfig<TProvider>);
|
|
2890
2890
|
/**
|
|
2891
2891
|
* Get the Composio SDK client.
|
|
2892
2892
|
* @returns {ComposioClient} The Composio API client.
|
|
@@ -2911,4 +2911,190 @@ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>,
|
|
|
2911
2911
|
|
|
2912
2912
|
declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
2913
2913
|
|
|
2914
|
-
|
|
2914
|
+
/**
|
|
2915
|
+
* Options for error handling
|
|
2916
|
+
*/
|
|
2917
|
+
interface ErrorHandleOptions {
|
|
2918
|
+
/** Whether to include the stack trace in the output */
|
|
2919
|
+
includeStack?: boolean;
|
|
2920
|
+
/** Whether to exit the process after handling */
|
|
2921
|
+
exitProcess?: boolean;
|
|
2922
|
+
/** The exit code to use if exiting the process */
|
|
2923
|
+
exitCode?: number;
|
|
2924
|
+
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Options for creating a ComposioError
|
|
2927
|
+
*/
|
|
2928
|
+
type ComposioErrorOptions = {
|
|
2929
|
+
/** Error code for categorizing errors */
|
|
2930
|
+
code?: string;
|
|
2931
|
+
/** HTTP status code associated with the error */
|
|
2932
|
+
statusCode?: number;
|
|
2933
|
+
/** The underlying cause of the error */
|
|
2934
|
+
cause?: unknown;
|
|
2935
|
+
/** Additional metadata associated with the error */
|
|
2936
|
+
meta?: Record<string, unknown>;
|
|
2937
|
+
/** Suggested fixes for the error */
|
|
2938
|
+
possibleFixes?: string[];
|
|
2939
|
+
/** Custom stack trace */
|
|
2940
|
+
stack?: string;
|
|
2941
|
+
};
|
|
2942
|
+
/**
|
|
2943
|
+
* Base error class for all Composio errors
|
|
2944
|
+
*/
|
|
2945
|
+
declare class ComposioError extends Error {
|
|
2946
|
+
/** @readonly Error name */
|
|
2947
|
+
name: string;
|
|
2948
|
+
code?: string;
|
|
2949
|
+
possibleFixes?: string[];
|
|
2950
|
+
errorId?: string;
|
|
2951
|
+
/**
|
|
2952
|
+
* Creates a new ComposioError
|
|
2953
|
+
* @param message Error message
|
|
2954
|
+
* @param options Additional error options
|
|
2955
|
+
*/
|
|
2956
|
+
constructor(message: string, options?: ComposioErrorOptions);
|
|
2957
|
+
/**
|
|
2958
|
+
* Helper method to define a property only if it has a value
|
|
2959
|
+
* @param propertyName Name of the property to define
|
|
2960
|
+
* @param value Value to assign to the property
|
|
2961
|
+
* @private
|
|
2962
|
+
*/
|
|
2963
|
+
private definePropertyIfExists;
|
|
2964
|
+
/**
|
|
2965
|
+
* Extract and normalize error data for formatting
|
|
2966
|
+
* @param includeStack Whether to include stack trace information
|
|
2967
|
+
* @returns Structured error data for formatting
|
|
2968
|
+
* @private
|
|
2969
|
+
*/
|
|
2970
|
+
private getErrorData;
|
|
2971
|
+
/**
|
|
2972
|
+
* Prints a user-friendly, colorful representation of the error to the logger
|
|
2973
|
+
* @param includeStack Whether to include the stack trace in the output (default: false)
|
|
2974
|
+
*/
|
|
2975
|
+
prettyPrint(includeStack?: boolean): void;
|
|
2976
|
+
/**
|
|
2977
|
+
* Static factory method to create and pretty print an error in one step
|
|
2978
|
+
* @param message Error message
|
|
2979
|
+
* @param options Error options
|
|
2980
|
+
* @param includeStack Whether to include the stack trace in the output
|
|
2981
|
+
* @returns The created error instance
|
|
2982
|
+
*/
|
|
2983
|
+
static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError;
|
|
2984
|
+
/**
|
|
2985
|
+
* Utility function to handle errors in a consistent way
|
|
2986
|
+
* This properly displays the error and exits the process if needed
|
|
2987
|
+
* @param error The error to handle
|
|
2988
|
+
* @param options Options for error handling
|
|
2989
|
+
*/
|
|
2990
|
+
static handle(error: unknown, options?: ErrorHandleOptions): void;
|
|
2991
|
+
/**
|
|
2992
|
+
* Helper method to handle Zod validation errors
|
|
2993
|
+
* @param error The Zod error to handle
|
|
2994
|
+
* @param includeStack Whether to include the stack trace
|
|
2995
|
+
* @private
|
|
2996
|
+
*/
|
|
2997
|
+
private static handleZodError;
|
|
2998
|
+
/**
|
|
2999
|
+
* Helper method to handle standard Error objects
|
|
3000
|
+
* @param error The standard error to handle
|
|
3001
|
+
* @param includeStack Whether to include the stack trace
|
|
3002
|
+
* @private
|
|
3003
|
+
*/
|
|
3004
|
+
private static handleStandardError;
|
|
3005
|
+
/**
|
|
3006
|
+
* Helper method to handle unknown error types
|
|
3007
|
+
* @param error The unknown error value
|
|
3008
|
+
* @private
|
|
3009
|
+
*/
|
|
3010
|
+
private static handleUnknownError;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
declare const AuthConfigErrorCodes: {
|
|
3014
|
+
readonly AUTH_CONFIG_NOT_FOUND: "AUTH_CONFIG_NOT_FOUND";
|
|
3015
|
+
};
|
|
3016
|
+
declare class ComposioAuthConfigNotFoundError extends ComposioError {
|
|
3017
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
declare const ConnectedAccountErrorCodes: {
|
|
3021
|
+
readonly CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND";
|
|
3022
|
+
};
|
|
3023
|
+
declare class ComposioConnectedAccountNotFoundError extends ComposioError {
|
|
3024
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
declare const ConnectionRequestErrorCodes: {
|
|
3028
|
+
readonly CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT";
|
|
3029
|
+
readonly CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED";
|
|
3030
|
+
};
|
|
3031
|
+
declare class ConnectionRequestTimeoutError extends ComposioError {
|
|
3032
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3033
|
+
}
|
|
3034
|
+
declare class ConnectionRequestFailedError extends ComposioError {
|
|
3035
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
declare const ToolErrorCodes: {
|
|
3039
|
+
readonly TOOLSET_NOT_DEFINED: "TOOLSET_NOT_DEFINED";
|
|
3040
|
+
readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
|
|
3041
|
+
readonly INVALID_MODIFIER: "INVALID_MODIFIER";
|
|
3042
|
+
readonly CUSTOM_TOOLS_NOT_INITIALIZED: "CUSTOM_TOOLS_NOT_INITIALIZED";
|
|
3043
|
+
readonly TOOL_EXECUTION_ERROR: "TOOL_EXECUTION_ERROR";
|
|
3044
|
+
readonly INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION";
|
|
3045
|
+
readonly GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET";
|
|
3046
|
+
};
|
|
3047
|
+
declare class ComposioProviderNotDefinedError extends ComposioError {
|
|
3048
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3049
|
+
}
|
|
3050
|
+
declare class ComposioToolNotFoundError extends ComposioError {
|
|
3051
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3052
|
+
}
|
|
3053
|
+
declare class ComposioInvalidModifierError extends ComposioError {
|
|
3054
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3055
|
+
}
|
|
3056
|
+
declare class ComposioCustomToolsNotInitializedError extends ComposioError {
|
|
3057
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3058
|
+
}
|
|
3059
|
+
declare class ComposioToolExecutionError extends ComposioError {
|
|
3060
|
+
readonly error: Error;
|
|
3061
|
+
constructor(message?: string, options?: ComposioErrorOptions & {
|
|
3062
|
+
originalError?: Error;
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
declare class ComposioInvalidExecuteFunctionError extends ComposioError {
|
|
3066
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3067
|
+
}
|
|
3068
|
+
declare class ComposioGlobalExecuteToolFnNotSetError extends ComposioError {
|
|
3069
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
declare const ToolkitErrorCodes: {
|
|
3073
|
+
readonly TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND";
|
|
3074
|
+
};
|
|
3075
|
+
declare class ComposioToolkitNotFoundError extends ComposioError {
|
|
3076
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3077
|
+
}
|
|
3078
|
+
declare class ComposioToolkitFetchError extends ComposioError {
|
|
3079
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
/**
|
|
3083
|
+
* Represents an input validation error using Zod.
|
|
3084
|
+
*/
|
|
3085
|
+
declare const ValidationErrorCodes: {
|
|
3086
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
3087
|
+
};
|
|
3088
|
+
declare class ValidationError extends ComposioError {
|
|
3089
|
+
constructor(message?: string, options?: ComposioErrorOptions);
|
|
3090
|
+
private generateUserFriendlyMessage;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
declare const SDKErrorCodes: {
|
|
3094
|
+
NO_API_KEY_PROVIDED: string;
|
|
3095
|
+
};
|
|
3096
|
+
declare class ComposioNoAPIKeyError extends ComposioError {
|
|
3097
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConsoleTelemetryTransport, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, ToolkitErrorCodes, type TransformToolSchemaModifier, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToModel };
|