/** * Mock LLM Provider Adapter * * A fully functional mock adapter for testing HoloScript applications * without real API calls. Returns deterministic responses based on * the input prompt. * * @version 1.0.0 */ import { BaseLLMAdapter } from '../base-adapter'; import type { Capabilities, LLMCompletionRequest, LLMCompletionResponse, LLMProviderConfig } from '../types'; /** * Mock LLM provider for testing - no API calls, no cost. * * @example * ```typescript * // Use in tests * const mock = new MockAdapter(); * const scene = await mock.generateHoloScript({ prompt: "a floating island" }); * expect(scene.valid).toBe(true); * ``` */ /** * Capability manifest — generous defaults so test paths exercising * common features (streaming, tools, vision) can route to mock without * routing-filter rejection. Tests that need to exercise capability- * filter edge cases should construct a custom adapter with narrower * `capabilities` rather than mutating mock's defaults. * * Exported as a constant so the capability-aware router can read it * without instantiating the adapter — single source of truth per W.GOLD.006. */ export declare const MOCK_CAPABILITIES: Capabilities; export declare class MockAdapter extends BaseLLMAdapter { readonly name: "mock"; readonly models: readonly ["mock-gpt-4", "mock-claude", "mock-gemini"]; readonly defaultHoloScriptModel = "mock-gpt-4"; readonly capabilities: Capabilities; /** Number of complete() calls made */ callCount: number; /** Whether the next call should fail (for testing error handling) */ failOnNextCall: boolean; /** Simulated latency in ms */ simulatedLatencyMs: number; constructor(config?: Partial); protected getDefaultModel(): string; complete(request: LLMCompletionRequest, _model?: string): Promise; /** * Override healthCheck to always succeed instantly. */ healthCheck(): Promise<{ ok: boolean; latencyMs: number; error?: string; }>; /** Reset call counter and state. */ reset(): void; private generateMockCode; }