/**
 * AI call with automatic retry on stale/invalid session.
 *
 * Extracted from conversationLoop.ts for single-responsibility:
 * this module handles only the AI call + retry logic.
 */
import type { ProviderType } from '../../infra/providers/index.js';
import { getProvider } from '../../infra/providers/index.js';
/** Result from a single AI call */
export interface CallAIResult {
    content: string;
    sessionId?: string;
    success: boolean;
}
/** Initialized session context for conversation loops */
export interface SessionContext {
    provider: ReturnType<typeof getProvider>;
    providerType: ProviderType;
    model: string | undefined;
    lang: 'en' | 'ja';
    personaName: string;
    sessionId: string | undefined;
}
/**
 * Call AI with automatic retry on stale/invalid session.
 *
 * On session failure, clears sessionId and retries once without session.
 * Updates sessionId and persists it on success.
 */
export declare function callAIWithRetry(prompt: string, systemPrompt: string, allowedTools: string[], cwd: string, ctx: SessionContext): Promise<{
    result: CallAIResult | null;
    sessionId: string | undefined;
}>;
//# sourceMappingURL=aiCaller.d.ts.map