/** * @file Network Test Setup Utilities * @version 1.0.0 * @status IN_DEVELOPMENT * @lastModified 2024-07-09 * * Utilities for setting up and managing network tests * * IMPORTANT: * - Handle network connectivity failures gracefully * - Provide clear diagnostics for test setup issues * * Functionality: * - Determine available networks for testing * - Extract data from tool responses * - Manage network test execution */ import { McpStandardClient } from '../../client/mcpStandardClient.js'; /** * Response from a network availability check */ export interface NetworkAvailabilityResult { /** Networks available for testing */ availableNetworks: string[]; /** Networks from the core set that are available */ availableCoreNetworks: string[]; /** Networks that failed connection tests */ unavailableNetworks: string[]; /** Whether the minimum required networks are available */ hasMinimumNetworks: boolean; } /** * Options for network availability check */ export interface NetworkAvailabilityOptions { /** Retry count for network connection attempts */ retries?: number; /** Timeout in ms for each connection attempt */ timeout?: number; /** Whether to check only core networks */ onlyCoreNetworks?: boolean; /** Whether to require API keys for networks that need them */ requireApiKeys?: boolean; } /** * Determine which networks are available for testing * * @param client MCP client to use for testing * @param options Options for the availability check * @returns Information about available networks */ export declare function determineAvailableNetworks(client: McpStandardClient, options?: NetworkAvailabilityOptions): Promise; /** * Extract a text value from a tool response * * @param result Tool response from MCP call * @returns The text content or undefined if not found */ export declare function extractTextFromResponse(result: { content: Array<{ type: string; text?: string; }>; } | undefined): string | undefined; /** * Extract a number from a tool response text using a regex pattern * * @param text Text to extract a number from * @param pattern Regex pattern to match the number (defaults to any number) * @returns The extracted number or undefined if not found */ export declare function extractNumberFromText(text: string | undefined, pattern?: RegExp): number | undefined; /** * Skip test if networks are not available * * @param availableNetworks List of available networks * @param requiredNetworks Networks required for this test * @returns True if test should be skipped */ export declare function shouldSkipNetworkTest(availableNetworks: string[], requiredNetworks?: string[]): boolean;