import type { Provider, Usage } from "@kenkaiiii/gg-ai";
export interface ToolSessionStats {
    totalCalls: number;
    totalSuccess: number;
    totalFail: number;
    totalDurationMs: number;
    byName: Record<string, {
        calls: number;
        success: number;
        fail: number;
        durationMs: number;
    }>;
}
export interface SessionStats {
    sessionId?: string;
    startedAt: number;
    turns: number;
    totalUsage: Usage;
    tools: ToolSessionStats;
    serverToolCalls: number;
    linesChanged: {
        added: number;
        removed: number;
    };
}
export interface SessionSummary {
    title: string;
    sessionId?: string;
    provider: Provider;
    model: string;
    cwd: string;
    wallDurationMs: number;
    turns: number;
    usage: Usage;
    tools: ToolSessionStats;
    serverToolCalls: number;
    linesChanged: {
        added: number;
        removed: number;
    };
    footer?: string;
}
export declare function createSessionStats(options?: {
    sessionId?: string;
    now?: () => number;
}): SessionStats;
export declare function recordTurnEnd(stats: SessionStats, usage: Usage): void;
export declare function recordToolEnd(stats: SessionStats, toolName: string, isError: boolean, durationMs: number): void;
export declare function recordServerToolCall(stats: SessionStats): void;
export declare function addLinesChanged(stats: SessionStats, delta: {
    added: number;
    removed: number;
}): void;
export declare function buildSessionSummary(options: {
    stats: SessionStats;
    provider: Provider;
    model: string;
    cwd: string;
    now?: () => number;
    footer?: string;
}): SessionSummary;
export declare function getToolSuccessRate(tools: ToolSessionStats): number | null;
//# sourceMappingURL=session-summary.d.ts.map