/** * @file context-factories.ts * @description Factory functions that create context classes with closed-over dependencies. * * These factories enable using standard ToolInstance, ResourceInstance, and PromptInstance * with remote MCP servers by creating dynamic context classes that capture the McpClientService * and remote identifiers via closure. */ import { type Type } from '@frontmcp/di'; import type { CallToolResult, ReadResourceResult } from '@frontmcp/protocol'; import { PromptContext, ResourceContext, ToolContext, type ToolInputType, type ToolOutputType } from '../../common'; import type { McpClientService } from '../mcp-client.service'; /** * Creates a remote tool context class with closed-over dependencies. * * The returned class can be used with standard ToolInstance. The closure captures * mcpClient, remoteAppId, and remoteToolName, so the class constructor only needs * standard ToolCtorArgs. * * @param mcpClient - The MCP client service for remote communication * @param remoteAppId - The ID of the remote app * @param remoteToolName - The name of the tool on the remote server * @returns A ToolContext class that executes tools on the remote server */ export declare function createRemoteToolContextClass(mcpClient: McpClientService, remoteAppId: string, remoteToolName: string): Type>; /** * Creates a remote resource context class with closed-over dependencies. * * @param mcpClient - The MCP client service for remote communication * @param remoteAppId - The ID of the remote app * @returns A ResourceContext class that reads resources from the remote server */ export declare function createRemoteResourceContextClass = Record>(mcpClient: McpClientService, remoteAppId: string): Type>; /** * Creates a remote prompt context class with closed-over dependencies. * * @param mcpClient - The MCP client service for remote communication * @param remoteAppId - The ID of the remote app * @param remotePromptName - The name of the prompt on the remote server * @returns A PromptContext class that gets prompts from the remote server */ export declare function createRemotePromptContextClass(mcpClient: McpClientService, remoteAppId: string, remotePromptName: string): Type; //# sourceMappingURL=context-factories.d.ts.map