import type { AgentRuntimeAnalysisResult, Hypothesis, StreamingUpdate } from '../../agent';
type SessionStatus = 'pending' | 'running' | 'awaiting_user' | 'completed' | 'failed' | 'quota_exceeded';
interface FinalizeSessionLike {
    result?: AgentRuntimeAnalysisResult;
    hypotheses: Hypothesis[];
    conclusionHistory: Array<{
        turn: number;
        conclusion: string;
        confidence: number;
        timestamp: number;
    }>;
    runSequence?: number;
    activeRun?: {
        runId?: string;
        requestId?: string;
        sequence?: number;
    };
    status: SessionStatus;
    sseClients: any[];
    logger: {
        info(component: string, message: string, meta?: Record<string, unknown>): void;
        warn(component: string, message: string, meta?: Record<string, unknown>): void;
        error(component: string, message: string, error?: unknown): void;
        close(): void;
    };
}
export interface FinalizeAgentDrivenSessionDeps<TSession extends FinalizeSessionLike> {
    applyFinalResultQualityGate(input: {
        result: AgentRuntimeAnalysisResult;
        query: string;
    }): {
        code: string;
        message: string;
    } | null | undefined;
    broadcast(sessionId: string, update: StreamingUpdate): void;
    buildConversationStepUpdate(session: TSession, update: StreamingUpdate): StreamingUpdate | null;
    appendConversationStep(session: TSession, update: StreamingUpdate): void;
    annotateLatestCompletedTurn(sessionId: string, traceId: string, result: AgentRuntimeAnalysisResult): void;
    terminalRunStatusForResult(result: AgentRuntimeAnalysisResult): string;
    markSessionRunStatus(session: TSession, status: string): void;
    persistAgentTurn(input: {
        session: any;
        sessionId: string;
        traceId: string;
        query: string;
        result: {
            conclusion: string;
            totalDurationMs: number;
            partial?: boolean;
            terminationMessage?: string;
        };
        logger: TSession['logger'];
        logComponent: string;
    }): void;
    ensureCompletedAnalysisSseEvents(session: TSession): unknown[];
    sendAgentDrivenResult(client: any, session: TSession): void;
}
export declare function finalizeAgentDrivenSession<TSession extends FinalizeSessionLike>(input: {
    sessionId: string;
    query: string;
    traceId: string;
    session: TSession;
    result: AgentRuntimeAnalysisResult;
    logComponent: string;
}, deps: FinalizeAgentDrivenSessionDeps<TSession>): void;
export {};
//# sourceMappingURL=finalizeAgentDrivenSession.d.ts.map