import { BaseAgenticProvider, ExecuteToolFn, McpUrlResponse, Tool } from "@composio/core"; import { createTool } from "@mastra/core/tools"; //#region src/index.d.ts type MastraTool = ReturnType; interface MastraToolCollection { [key: string]: MastraTool; } interface MastraUrlMap { [name: string]: { url: string; }; } declare class MastraProvider extends BaseAgenticProvider { readonly name = "mastra"; private strict; private warnedDanglingRefs; /** * Creates a new instance of the MastraProvider. * * This provider enables integration with the Mastra AI SDK, * allowing Composio tools to be used with Mastra AI applications. * * @param param0 * @param param0.strict - Whether to use strict mode for tool execution * @returns A new instance of the MastraProvider * * @example * ```typescript * import { Composio } from '@composio/core'; * import { MastraProvider } from '@composio/mastra'; * * const composio = new Composio({ * apiKey: 'your-composio-api-key', * provider: new MastraProvider(), * }); * ``` */ constructor({ strict }?: { strict?: boolean; }); /** * Transform MCP URL response into Anthropic-specific format. * By default, Anthropic uses the standard format (same as default), * but this method is here to show providers can customize if needed. * * @param data - The MCP URL response data * @returns Standard MCP server response format */ wrapMcpServerResponse(data: McpUrlResponse): MastraUrlMap; wrapTool(tool: Tool, executeTool: ExecuteToolFn): MastraTool; wrapTools(tools: Tool[], executeTool: ExecuteToolFn): MastraToolCollection; private warnDanglingRefOnce; } //#endregion export { MastraProvider, MastraTool, MastraToolCollection, MastraUrlMap };