/** * Mock LLM Executor * * A mock implementation of ILLMExecutor for testing purposes. * Allows testing the entire CodeSeeker workflow without real LLM API calls. * * Features: * - Pattern-based response matching * - Configurable delays to simulate network latency * - Execution logging for test verification * - Deterministic responses for reproducible tests * - Support for simulating errors and edge cases */ import { ILLMExecutor, LLMExecutionOptions, LLMExecutionResult, LLMProviderInfo, MockLLMOptions, MockLLMResponse } from './interfaces'; export declare class MockLLMExecutor implements ILLMExecutor { private responses; private defaultResponse; private defaultDelayMs; private verbose; private failureRate; private executionLog; constructor(options?: MockLLMOptions); /** * Execute a prompt and return a mock response */ execute(prompt: string, context?: string, options?: LLMExecutionOptions): Promise; /** * Get information about this mock provider */ getProviderInfo(): LLMProviderInfo; /** * Test connection (always succeeds for mock) */ testConnection(): Promise<{ connected: boolean; error?: string; }>; /** * Estimate tokens for text */ estimateTokens(text: string): number; /** * Validate prompt size */ validatePromptSize(prompt: string): { valid: boolean; size: number; maxSize: number; warning?: string; }; /** * Add a custom response pattern */ addResponse(response: MockLLMResponse): void; /** * Clear all custom responses */ clearCustomResponses(): void; /** * Get the execution log for test verification */ getExecutionLog(): Array<{ timestamp: Date; prompt: string; context?: string; options?: LLMExecutionOptions; result: LLMExecutionResult; }>; /** * Clear the execution log */ clearExecutionLog(): void; /** * Get statistics about mock executions */ getStats(): { totalExecutions: number; successfulExecutions: number; failedExecutions: number; totalTokensUsed: number; averageExecutionTimeMs: number; patternMatchCounts: Record; }; /** * Set verbose mode */ setVerbose(verbose: boolean): void; /** * Set failure rate for chaos testing */ setFailureRate(rate: number): void; private findMatchingResponse; private logExecution; private sleep; } export declare class MockLLMExecutorFactory { /** * Create a mock executor with default responses */ static createDefault(): MockLLMExecutor; /** * Create a mock executor for fast CI testing (no delays) */ static createForCI(): MockLLMExecutor; /** * Create a mock executor that simulates realistic latency */ static createWithLatency(minDelayMs?: number, maxDelayMs?: number): MockLLMExecutor; /** * Create a mock executor for chaos/resilience testing */ static createForChaosTesting(failureRate?: number): MockLLMExecutor; /** * Create a mock executor with custom responses */ static createWithResponses(responses: MockLLMResponse[]): MockLLMExecutor; } //# sourceMappingURL=mock-llm-executor.d.ts.map