/** * @file app.remote.instance.ts * @description Remote MCP app instance that proxies to a remote MCP server * * This implementation uses standard registries (ToolRegistry, ResourceRegistry, PromptRegistry) * like local apps, but with lazy capability discovery and TTL-based caching. */ import { AppEntry, type AdapterRegistryInterface, type AppRecord, type PluginRegistryInterface, type ProviderRegistryInterface, type RemoteAppMetadata } from '../../common'; import PromptRegistry from '../../prompt/prompt.registry'; import type ProviderRegistry from '../../provider/provider.registry'; import { McpClientService } from '../../remote-mcp'; import ResourceRegistry from '../../resource/resource.registry'; import type { SkillRegistryInterface } from '../../skill/skill.registry'; import ToolRegistry from '../../tool/tool.registry'; /** * Remote MCP app instance that connects to and proxies a remote MCP server. * * This class uses standard registries (ToolRegistry, ResourceRegistry, PromptRegistry) * like local apps, providing consistent behavior for: * - Hook lifecycle (beforeExec, afterExec) * - Tool/resource/prompt discovery * - Change event notifications * * Key features: * - Lazy capability discovery: Capabilities are discovered on first access * - TTL-based caching: Capabilities are cached with configurable TTL * - Full hook support: Remote tools participate in the hook lifecycle */ export declare class AppRemoteInstance extends AppEntry { readonly id: string; /** * Remote apps return true to indicate entries should be adopted directly * from the app's registries rather than through child registry hierarchy. */ get isRemote(): boolean; private readonly scopeProviders; private readonly mcpClient; private readonly appOwner; private readonly capabilityCache; private readonly _tools; private readonly _resources; private readonly _prompts; private readonly _plugins; private readonly _adapters; private readonly _skills; private isConnected; private capabilitiesLoaded; private loadingPromise; private _unsubscribeCapability?; constructor(record: AppRecord, scopeProviders: ProviderRegistry); protected initialize(): Promise; /** * Ensure capabilities are loaded, using cache if available. * This is called lazily when tools/resources/prompts are accessed. */ ensureCapabilitiesLoaded(): Promise; /** * Force refresh capabilities from the remote server. */ refreshCapabilities(): Promise; get providers(): ProviderRegistryInterface; get adapters(): AdapterRegistryInterface; get plugins(): PluginRegistryInterface; get tools(): ToolRegistry; get resources(): ResourceRegistry; get prompts(): PromptRegistry; get skills(): SkillRegistryInterface; /** * Get the MCP client service for this remote app */ getMcpClient(): McpClientService; /** * Check if this remote app is connected */ getIsConnected(): boolean; /** * Check if capabilities have been loaded */ getCapabilitiesLoaded(): boolean; /** * Get cache statistics */ getCacheStats(): { totalEntries: number; activeEntries: number; expiredEntries: number; }; /** * Disconnect from the remote server */ disconnect(): Promise; /** * Reconnect to the remote server */ reconnect(): Promise; /** * Get or create the MCP client service from scope */ private getOrCreateMcpClientService; /** * Build the connection request from metadata */ private buildConnectRequest; /** * Map urlType to transport type */ private mapUrlTypeToTransportType; /** * Map remote auth config from metadata format to MCP client format */ private mapRemoteAuth; /** * Discover remote capabilities and register them in standard registries. */ private discoverAndRegisterCapabilities; } //# sourceMappingURL=app.remote.instance.d.ts.map