import type { AIProvider, BatchJobsProvider, BatchRequestItem, ContentBlock, EmbeddingsProvider, EmbeddingsResult, ImageGenerationProvider, ImageGenerationResult, JsonObject, ModerationProvider, ModerationResult, ProviderEvent, ProviderRequest, SpeechProvider, SpeechResult, ToolCallContent, TranscriptionProvider, TranscriptionResult, Usage, VideoGenerationJob, VideoGenerationProvider } from "../contracts.js"; export interface ProviderStreamConformanceOptions { readonly provider: AIProvider; readonly request: ProviderRequest; readonly expect?: { readonly text?: string; readonly usage?: Usage; }; } export interface ProviderAbortConformanceOptions { readonly provider: AIProvider; readonly request: Omit & { readonly signal?: AbortSignal; }; readonly reason?: unknown; } export interface ToolCallDeltaExpectation { readonly index: number; readonly id?: string; readonly name?: string; readonly arguments?: JsonObject; } export interface SerializedContentCoverageOptions { readonly unsupported?: readonly ContentBlock["type"][]; } export interface ProviderHeaderOwnershipConformanceOptions { /** Provider-owned header names mapped to the authoritative values the provider must set. */ readonly owned: Readonly>; /** Caller-supplied headers, including attempts to override owned names and non-owned additions. */ readonly caller: Readonly>; } export declare function collectProviderEvents(provider: AIProvider, request: ProviderRequest): Promise; export declare function assertProviderStreamConforms(options: ProviderStreamConformanceOptions): Promise; export declare function assertAbortIsObserved(options: ProviderAbortConformanceOptions): Promise; export declare function assertToolCallDeltasReconstruct(events: readonly ProviderEvent[], expected: readonly ToolCallDeltaExpectation[]): readonly ToolCallContent[]; export declare function assertSerializedRequestCoversContent(request: ProviderRequest, body: unknown, options?: SerializedContentCoverageOptions): void; export declare function assertCanonicalToolParameters(serialized: unknown, original: unknown): void; export declare function assertProviderOwnedHeadersWin(captured: Headers, options: ProviderHeaderOwnershipConformanceOptions): void; export declare function assertNoSecretLeak(events: readonly ProviderEvent[], secrets: readonly string[]): void; /** * Implicit/none-cache providers must serialize no foreign cache fields: implicit * caching works by byte-stable prefix reuse, not request payloads. `allowed` names * fields the provider documents for that route (e.g. `cachedContent` via the host * `extra.cachedContent` escape hatch on Gemini). */ export declare function assertNoForeignCacheFields(body: unknown, allowed?: readonly string[]): void; /** Provider construction and setup must perform zero network calls; discovery and streams are caller-gated. */ export declare function assertNoFetches(calls: readonly unknown[]): void; export declare function assertUsageAccounting(events: readonly ProviderEvent[], expected: Usage): Usage; export interface EmbeddingsConformanceOptions { readonly provider: EmbeddingsProvider; readonly model: string; /** When set, an oversized batch must fail with `EmbeddingsError("batch_too_large")`. */ readonly maxBatchSize?: number; /** Happy-path mapping probe: inputs to embed and the expected vector count/dimensions. */ readonly sample?: { readonly inputs: readonly string[]; readonly dimensions?: number; }; } /** Offline conformance for any `EmbeddingsProvider` (plan 061): typed empty-input * error, typed oversized-batch error, and input-order vector mapping with finite * coordinates. No network — the caller supplies the provider (real adapter with a * fake transport, or a fake provider). */ export declare function runEmbeddingsConformance(options: EmbeddingsConformanceOptions): Promise; export interface SpeechConformanceOptions { readonly provider: SpeechProvider; readonly model: string; /** When set, an oversized input must fail with `SpeechError("input_too_large")`. */ readonly maxInputChars?: number; /** Happy-path probe: text to synthesize, optional voice/format. */ readonly sample?: { readonly input?: string; readonly voice?: string; readonly format?: string; }; } /** Offline conformance for any `SpeechProvider` (plan 061): typed empty-input and * oversized-input errors, byte results, and stream ordering — the stream must emit * at least one chunk before closing. Asserts event order, never wall clock. */ export declare function runSpeechConformance(options: SpeechConformanceOptions): Promise; export interface TranscriptionConformanceOptions { readonly provider: TranscriptionProvider; readonly model: string; /** When set, oversized audio must fail with `TranscriptionError("audio_too_large")`. */ readonly maxAudioBytes?: number; /** Happy-path probe: audio bytes and the expected transcript prefix. */ readonly sample?: { readonly audio?: Uint8Array; readonly format?: string; readonly textIncludes?: string; }; } /** Offline conformance for any `TranscriptionProvider` (plan 061): typed empty-audio * and oversized-audio errors, one-shot text, and stream ordering — at least one * `transcript_delta` partial, then exactly one `done` terminal event. */ export declare function runTranscriptionConformance(options: TranscriptionConformanceOptions): Promise; export interface ImageGenerationConformanceOptions { readonly provider: ImageGenerationProvider; readonly model: string; /** When set, an oversized prompt must fail with `ImageGenerationError("input_too_large")`. */ readonly maxPromptChars?: number; /** Happy-path probe: prompt, requested image count, expected provenance. */ readonly sample?: { readonly prompt?: string; readonly size?: string; readonly count?: number; }; } /** Offline conformance for any `ImageGenerationProvider` (plan 061): typed empty-input * and oversized-prompt errors, plus image shape — non-empty bytes, an `image/*` mime * type, and preserved provenance (`provider`/`model`) on every image. */ export declare function runImageGenerationConformance(options: ImageGenerationConformanceOptions): Promise; export interface VideoGenerationConformanceOptions { readonly provider: VideoGenerationProvider; readonly model: string; /** When set, an oversized prompt must fail with `VideoGenerationError("input_too_large")`. */ readonly maxPromptChars?: number; /** Happy-path lifecycle probe: submit, poll to terminal state, assert result shape. */ readonly sample?: { readonly prompt?: string; readonly maxPolls?: number; }; } /** Offline conformance for any `VideoGenerationProvider` (plan 061): typed * empty-input and oversized-prompt errors, plus the submit→status lifecycle — * a job id is returned, polling reaches a terminal state, and succeeded jobs * carry a video with provenance (`provider`/`model`) and at least one source * (`bytes` or `url`). */ export declare function runVideoGenerationConformance(options: VideoGenerationConformanceOptions): Promise; export interface ModerationConformanceOptions { readonly provider: ModerationProvider; readonly model: string; /** When set, an oversized input must fail with `ModerationError("input_too_large")`. */ readonly maxInputChars?: number; /** Happy-path probe: a benign string classification. */ readonly sample?: { readonly input?: string; }; } /** Offline conformance for any `ModerationProvider` (plan 061): typed empty-input * and oversized-input errors, plus a classification probe — every category * verdict carries a numeric score in [0,1], a boolean `flagged`, and the * top-level `flagged` boolean is present. Scores are provider output; conformance * asserts no local policy decisions are baked in. */ export declare function runModerationConformance(options: ModerationConformanceOptions): Promise; export interface BatchJobsConformanceOptions { readonly provider: BatchJobsProvider; /** Sample lifecycle driver: submitted via `submit` and expected to reach `completed`. */ readonly sample?: { readonly model: string; readonly requests: readonly BatchRequestItem[]; }; /** When set, a submit over this count must fail with `BatchJobsError("too_many_requests")`. */ readonly maxRequests?: number; } /** Offline conformance for any `BatchJobsProvider` (plan 061): typed empty/oversized * submit errors, opaque job ids, status returning members of the neutral state * union, terminal resolution via `pollBatch` (plain utility), and paged results * that walk to exhaustion with cursor continuity. Failure/cancel terminal * transitions are covered by provider fakes in adapter test suites. */ export declare function runBatchJobsConformance(options: BatchJobsConformanceOptions): Promise;