/**
 * Conversation Buffer - Rolling verbatim buffer of recent conversation.
 *
 * Tier 1 of the two-tier memory system:
 *   - Tier 1 (this): Last N characters of conversation stored verbatim.
 *     Provides perfect continuity across sessions for in-progress work,
 *     stories, code discussions, etc.
 *   - Tier 2: Compressed long-term memories (memory.jsonl via MemoryManager).
 *
 * The buffer spans across sessions (not per-session). When new content pushes
 * old content out of the window, the evicted text is available for compression
 * into Tier 2 summaries.
 *
 * Storage: ~/.avis/self/memory/conversation-buffer.json
 */
export interface BufferEntry {
    role: "user" | "assistant";
    text: string;
    timestamp: string;
}
export declare const DEFAULT_BUFFER_SIZE = 5000;
export declare class ConversationBuffer {
    private _filePath;
    private _maxChars;
    private _state;
    /** Partial streaming entry that hasn't been finalized yet */
    private _pendingPartial;
    /** Debounce timer for flushing partial content */
    private _partialFlushTimer;
    /** Interval (ms) for flushing partial streaming content to disk */
    private static PARTIAL_FLUSH_INTERVAL;
    constructor(options?: {
        filePath?: string;
        maxChars?: number;
    });
    /** Update the max buffer size (e.g., from settings change) */
    set maxChars(value: number);
    get maxChars(): number;
    /**
     * Append a conversation entry to the buffer.
     * Returns any text that was evicted from the buffer (for Tier 2 compression).
     */
    append(role: "user" | "assistant", text: string): string[];
    /** Get the current buffer entries */
    getEntries(): BufferEntry[];
    /** Get total chars in the buffer */
    getTotalChars(): number;
    /**
     * Format the buffer for injection into the system prompt.
     * Returns empty string if buffer is empty.
     */
    formatForSystemPrompt(): string;
    /**
     * Update partial streaming content (call on every message_update).
     * This buffers the partial text in memory and periodically flushes to disk,
     * so if the process dies mid-stream, the last flushed partial is preserved.
     */
    updatePartial(role: "user" | "assistant", text: string): void;
    /**
     * Finalize the partial entry (call on message_end).
     * Clears the pending partial since append() will store the final version.
     */
    finalizePartial(): void;
    /** Flush pending partial to disk (overwrites any existing partial entry) */
    private _flushPartial;
    /** Clear the buffer */
    clear(): void;
    /**
     * Trim the buffer to fit within maxChars.
     * Removes oldest entries first. Returns the text of evicted entries.
     */
    private _trimToSize;
    private _load;
    /** Format seconds into a human-readable duration string */
    static _formatDuration(seconds: number): string;
    private _save;
}
//# sourceMappingURL=conversation-buffer.d.ts.map