import { type XaiAuthStoreDeps } from './auth-store.js'; import type { XaiAuthMode } from './endpoints.js'; export type XaiAuthSource = 'config' | 'env' | 'xai-oauth' | 'no-usable-auth' | 'no-usable-auth-forced-xai-oauth' | 'no-usable-auth-forced-xai-apikey' | 'ambiguous-auth'; export interface XaiAuthResolution { apiKey: string | null; source: XaiAuthSource; mode?: XaiAuthMode; last4?: string; expiresAt?: number; envVar?: 'XAI_API_KEY'; } export interface XaiAuthResolverDeps { readEnv?: (key: string) => string | undefined; store?: XaiAuthStoreDeps; nowSeconds?: () => number; } export type XaiAuthForceMode = 'apikey' | 'oauth' | undefined; export declare function resolveXaiAuth(explicitConfigKey: string | undefined, forceMode?: XaiAuthForceMode, deps?: XaiAuthResolverDeps): XaiAuthResolution; export declare function formatXaiAuthDiagnostic(resolution: XaiAuthResolution, deps?: { nowSeconds?: () => number; }): string; export declare function formatXaiHttpAuthError(status: number, opts: { mode: XaiAuthMode; baseURL?: string; bodySnippet?: string; }): string;