import type { Eyes } from "../core/host.js"; import { type Limits } from "../core/limits.js"; import type { Part } from "../core/plan.js"; /** A scripted answer: the text, or the text with its model, tokens, price or billing; a failure; or a request that * never answers until it is aborted. */ export type FakeAnswer = string | { readonly text: string; readonly model?: string; readonly input?: number; readonly output?: number; readonly costUsd?: number | null; readonly billedBy?: string; readonly delayMs?: number; } | { readonly fail: string; } | { readonly hang: true; }; /** One request the fake eyes received: its number, its question, its context and the shape of each part. */ export type FakeEyesRequest = { /** 1-based, in arrival order. */ readonly n: number; readonly ask: string; readonly context?: string; readonly parts: readonly { readonly type: Part["type"]; readonly mimeType?: string; readonly fragment?: string; readonly width?: number; readonly height?: number; readonly chars: number; }[]; }; /** What the fake eyes answer and how they are priced. With `ledgerPath`, each request is also appended to that file as it arrives. */ export type FakeEyesOptions = { /** Default "fake-eyes". */ readonly model?: string; readonly accepts?: Partial; readonly limits?: Limits; readonly answers?: readonly (FakeAnswer | ((request: FakeEyesRequest) => FakeAnswer))[]; /** Dollars per million input and output tokens. Null: the price is unknown and every answer's cost is null. */ readonly price?: { readonly input: number; readonly output: number; } | null; readonly ledgerPath?: string; }; /** Eyes with a ledger of the requests they received and the credential they hold. */ export type FakeEyes = Eyes & { readonly ledger: readonly FakeEyesRequest[]; /** The credential this fake holds. */ readonly apiKey: string; }; /** Scripted eyes: the answers in order (the last repeats), a ledger of every request, and a credential held the way real eyes hold theirs. */ export declare function fakeEyes(options?: FakeEyesOptions): FakeEyes;