/** * Shared utilities for check and explore commands. * * This module contains code that is common to both commands to avoid duplication * and ensure consistent behavior. */ import type { ServerContext } from '../../interview/types.js'; import type { BellwetherConfig } from '../../config/loader.js'; import type { DiscoveryResult } from '../../discovery/types.js'; import { MCPClient } from '../../transport/mcp-client.js'; import { type MetricsCollector } from '../../metrics/collector.js'; import { type ResponseCache } from '../../cache/response-cache.js'; import { type LoadedScenarios } from '../../scenarios/index.js'; /** * Extract server context from command and arguments. * * Analyzes the server command to provide hints about the server type * (filesystem, database, git, etc.) and extracts path arguments for * allowed directories. */ export declare function extractServerContextFromArgs(command: string, args: string[]): ServerContext; /** * Detect if running in a CI environment. */ export declare function isCI(): boolean; /** * Common setup context for both check and explore commands. */ export interface CommandSetupContext { mcpClient: MCPClient; discovery: DiscoveryResult; metricsCollector: MetricsCollector; cache: ResponseCache; fullServerCommand: string; customScenarios?: LoadedScenarios; } /** * Options for setting up a command. */ export interface SetupCommandOptions { serverCommand: string; args: string[]; config: BellwetherConfig; verbose: boolean; personaCount?: number; } /** * Set up common infrastructure for check and explore commands. * * This handles the shared setup logic: * - Initializing metrics collector * - Initializing cache * - Creating MCP client * - Connecting to server * - Discovering capabilities * - Loading custom scenarios */ export declare function setupCommandInfrastructure(options: SetupCommandOptions): Promise; /** * Ensure output directories exist. */ export declare function ensureOutputDirs(outputDir: string, docsDir: string): void; /** * Display scenario results summary. */ export declare function displayScenarioResults(scenarioResults: Array<{ passed: boolean; scenario: { tool?: string; prompt?: string; description: string; }; error?: string; }>): void; /** * Handle common error messages and provide helpful diagnostics. */ export declare function handleCommandError(error: unknown, commandName: 'check' | 'explore'): never; //# sourceMappingURL=shared.d.ts.map