/**
 * Session Export & Replay
 *
 * Export conversation sessions in multiple formats:
 * - JSON (full fidelity, for replay)
 * - Markdown (human-readable)
 * - HTML (shareable)
 *
 * Replay sessions for debugging, demos, or continuation.
 */
import { EventEmitter } from 'events';
export type ExportFormat = 'json' | 'markdown' | 'html';
export interface SessionMessage {
    id: string;
    role: 'user' | 'assistant' | 'system' | 'tool';
    content: string;
    timestamp: number;
    toolCalls?: ToolCallRecord[];
    toolResults?: ToolResultRecord[];
    metadata?: Record<string, unknown>;
}
export interface ToolCallRecord {
    id: string;
    name: string;
    arguments: Record<string, unknown>;
    timestamp: number;
}
export interface ToolResultRecord {
    toolCallId: string;
    result: string;
    success: boolean;
    duration: number;
}
export interface SessionMetadata {
    id: string;
    name: string;
    createdAt: number;
    updatedAt: number;
    projectPath?: string;
    provider?: string;
    model?: string;
    totalTokens: number;
    totalCost: number;
    messageCount: number;
    toolCallCount: number;
    tags: string[];
    summary?: string;
}
export interface ExportedSession {
    version: string;
    exportedAt: number;
    metadata: SessionMetadata;
    messages: SessionMessage[];
    checkpoints?: SessionCheckpoint[];
}
export interface SessionCheckpoint {
    id: string;
    messageIndex: number;
    label: string;
    createdAt: number;
}
export interface ReplayOptions {
    /** Speed multiplier (1 = real-time, 0 = instant) */
    speed: number;
    /** Start from specific message index */
    startFrom: number;
    /** Stop at specific message index */
    stopAt?: number;
    /** Pause at each tool call */
    pauseAtToolCalls: boolean;
    /** Skip tool execution during replay */
    skipTools: boolean;
    /** Callback for each message */
    onMessage?: (message: SessionMessage, index: number) => void | Promise<void>;
    /** Callback for tool calls */
    onToolCall?: (toolCall: ToolCallRecord) => void | Promise<void>;
}
export interface ExportOptions {
    format: ExportFormat;
    /** Redact sensitive data */
    redactSecrets: boolean;
    /** Include tool results */
    includeToolResults: boolean;
    /** Include metadata */
    includeMetadata: boolean;
    /** Include checkpoints */
    includeCheckpoints: boolean;
    /** Custom title for export */
    title?: string;
    /** Add syntax highlighting for code blocks */
    syntaxHighlight: boolean;
}
export declare class SessionRecorder extends EventEmitter {
    private messages;
    private metadata;
    private checkpoints;
    private isRecording;
    constructor(metadata?: Partial<SessionMetadata>);
    /**
     * Start recording
     */
    start(): void;
    /**
     * Stop recording
     */
    stop(): void;
    /**
     * Add a message to the session
     */
    addMessage(message: Omit<SessionMessage, 'id' | 'timestamp'>): void;
    /**
     * Add user message
     */
    addUserMessage(content: string): void;
    /**
     * Add assistant message
     */
    addAssistantMessage(content: string, toolCalls?: ToolCallRecord[]): void;
    /**
     * Add tool result
     */
    addToolResult(toolCallId: string, result: string, success: boolean, duration: number): void;
    /**
     * Update token usage
     */
    updateUsage(tokens: number, cost: number): void;
    /**
     * Create a checkpoint
     */
    createCheckpoint(label: string): string;
    /**
     * Add tags
     */
    addTags(...tags: string[]): void;
    /**
     * Set session summary
     */
    setSummary(summary: string): void;
    /**
     * Get current session data
     */
    getSession(): ExportedSession;
    /**
     * Generate unique ID
     */
    private generateId;
    /**
     * Dispose
     */
    dispose(): void;
}
export declare class SessionExporter {
    /**
     * Export session to string
     */
    export(session: ExportedSession, options?: Partial<ExportOptions>): string;
    /**
     * Export to file
     */
    exportToFile(session: ExportedSession, filePath: string, options?: Partial<ExportOptions>): Promise<void>;
    /**
     * Export as JSON
     */
    private exportJSON;
    /**
     * Export as Markdown
     */
    private exportMarkdown;
    /**
     * Export as HTML
     */
    private exportHTML;
    /**
     * Redact secrets from session
     */
    private redactSession;
    /**
     * Escape HTML special characters
     */
    private escapeHTML;
    /**
     * Format content with code blocks
     */
    private formatContent;
}
export declare class SessionPlayer extends EventEmitter {
    private session;
    private currentIndex;
    private isPlaying;
    private isPaused;
    /**
     * Load session from file
     */
    loadFromFile(filePath: string): Promise<void>;
    /**
     * Load session directly
     */
    load(session: ExportedSession): void;
    /**
     * Replay the session
     */
    replay(options?: Partial<ReplayOptions>): Promise<void>;
    /**
     * Pause replay
     */
    pause(): void;
    /**
     * Resume replay
     */
    resume(): void;
    /**
     * Stop replay
     */
    stop(): void;
    /**
     * Jump to checkpoint
     */
    jumpToCheckpoint(checkpointId: string): boolean;
    /**
     * Jump to message index
     */
    jumpToIndex(index: number): void;
    /**
     * Get current state
     */
    getState(): {
        loaded: boolean;
        playing: boolean;
        paused: boolean;
        currentIndex: number;
        totalMessages: number;
        progress: number;
    };
    /**
     * Get messages up to current point
     */
    getMessagesUpToCurrent(): SessionMessage[];
    /**
     * Delay helper
     */
    private delay;
    /**
     * Wait for resume
     */
    private waitForResume;
    /**
     * Dispose
     */
    dispose(): void;
}
/**
 * Quick export session to file
 */
export declare function exportSession(session: ExportedSession, filePath: string, options?: Partial<ExportOptions>): Promise<void>;
/**
 * Quick load and replay session
 */
export declare function replaySession(filePath: string, options?: Partial<ReplayOptions>): Promise<void>;
export declare function getSessionRecorder(): SessionRecorder;
export declare function resetSessionRecorder(): void;
