import type { LLMProvider, ProviderRequest, ProviderResult } from './types'; /** * A function that produces a canned response for a given request. Lets a test * compute a response from the prompt/schema instead of pre-registering a fixed * map entry — useful for asserting the provider is called with the expected * prompt, or for returning per-call-varying shapes. */ export type MockResponder = (request: ProviderRequest) => unknown; /** Construction options for {@link MockProvider}. */ export interface MockProviderOptions { /** * Canned responses keyed by the EXACT prompt string. A request whose * `prompt` matches a key resolves with the mapped value. Consulted before * {@link MockProviderOptions.responder}. */ responses?: Record; /** * Fallback responder consulted when no `responses` entry matches the * prompt. When neither matches, {@link MockProvider.generate} rejects so a * test never silently passes on an unexpected prompt. */ responder?: MockResponder; /** * Fixed cost in US dollars reported on every result. Defaults to `0` * (a mock makes no real call, so zero spend is the honest default), but a * test can set a non-zero value to exercise cost-accumulation logic. */ costUsd?: number; /** * Model id reported on every result. Defaults to the request's `model` when * present, else `mock-model`. Lets a test assert model propagation. */ model?: string; } /** * In-memory {@link LLMProvider} for offline tests. Deterministic: the same * request always yields the same result, with no randomness, no clock, and no * network. Records every request it received on {@link MockProvider.calls} so a * test can assert what the pipeline asked for. */ export declare class MockProvider implements LLMProvider { #private; readonly name = "mock"; /** Every request passed to {@link generate}, in call order, for assertions. */ readonly calls: ProviderRequest[]; constructor(options?: MockProviderOptions); /** * Resolve the canned response for `request`, honoring a fired abort signal * first, then the prompt map, then the responder callback. Rejects when the * signal is already aborted, or when no canned response matches — never * makes a network call. */ generate(request: ProviderRequest): Promise>; }