import { ChatMessage } from './types';
export declare function atomicJsonWrite(filePath: string, data: any, indent?: number): void;
export declare function atomicWrite(filePath: string, content: string): void;
export declare function safeJsonParse(text: string, defaultValue?: any): any;
export declare function estimateTokens(text: string): number;
export declare function estimateMessagesTokens(messages: ChatMessage[]): number;
export declare function resolvePath(filepath: string, cwd?: string): string;
export declare function normalizePath(filepath: string): string;
export declare function truncate(text: string, maxChars: number): {
    text: string;
    truncated: boolean;
};
/**
 * Extract text content from a message that may have string or array content.
 * Array content (multimodal) is flattened to text parts only.
 */
export declare function getTextContent(content: string | null | any[]): string;
export declare function sanitizeError(error: any): string;
export declare function getBaseUrlHostname(baseUrl: string): string;
export declare function getBaseUrlHostMatches(baseUrl: string, domain: string): boolean;
export type ApiMode = 'chat_completions' | 'anthropic_messages' | 'codex_responses';
export declare function detectApiMode(provider: string, baseUrl: string): ApiMode;
export declare function jitteredBackoff(attempt: number, baseDelayMs: number, maxDelayMs: number): number;
export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
export declare function getPlatformHint(): string;
export declare function generateId(prefix?: string): string;
//# sourceMappingURL=utils.d.ts.map