import { deleteCachedProvider as deleteCachedProviderFromDisk, readCachedProvider as readCachedProviderFromDisk } from "../cache.js"; import type { ProviderAdapter, QuotaWindow } from "../types.js"; export type ZaiDiagnostic = { code: "entry_invalid"; index: number; } | { code: "entry_unrecognized"; index: number; }; export type NormalizedZaiPayload = { windows: QuotaWindow[]; plan?: string; diagnostics: ZaiDiagnostic[]; }; export type ZaiCredentialResolution = { status: "available"; apiKey: string; host: string; path: string; } | { status: "missing"; path: string; } | { status: "invalid"; path: string; error: string; } | { status: "error"; path: string; error: string; }; export type ZaiCredentialInspection = { status: "available"; path: string; } | { status: "missing"; path: string; } | { status: "invalid"; path: string; error: string; } | { status: "error"; path: string; error: string; }; export type ZaiCredentialSource = { resolve(): ZaiCredentialResolution; inspect(): ZaiCredentialInspection; }; type ZaiDependencies = { credentialSource: ZaiCredentialSource; fetch: typeof globalThis.fetch; readCachedProvider: typeof readCachedProviderFromDisk; deleteCachedProvider: typeof deleteCachedProviderFromDisk; now: () => number; deadlineMs: number; }; export declare function opencodeAuthFilePath(): string; export declare function extractZaiCredential(value: unknown, path: string): ZaiCredentialResolution; export declare function createOpencodeAuthCredentialSource(filePath?: () => string): ZaiCredentialSource; export declare function createZaiAdapter(overrides?: Partial): ProviderAdapter; export declare const zaiAdapter: ProviderAdapter; export declare function normalizeZaiPayload(payload: unknown): NormalizedZaiPayload; export declare function normalizeRetryAfter(value: string | null, receivedAt: number): string | undefined; export {};