/**
 * Shared rolling context buffer and event-labeling utilities.
 *
 * Extracted from buddy-controller.ts so that both the buddy companion and
 * other consumers (e.g. tab-title updater) can reuse the same content-extraction
 * and buffer management logic without duplication.
 */
/**
 * A fixed-capacity ring buffer that stores labeled context entries.
 * Entries are capped individually and the built output is capped to a total character limit.
 */
export declare class RollingContextBuffer {
    private entries;
    private readonly maxEntries;
    private readonly maxChars;
    constructor(opts?: {
        maxEntries?: number;
        maxChars?: number;
    });
    /** Append an entry to the buffer (evicts oldest if at capacity). Individual entries are capped to 2000 chars. */
    append(entry: string): void;
    /** Clear all entries from the buffer. */
    clear(): void;
    /** Join all entries with newlines, capped to maxChars total. Newest entries are preferred. */
    build(): string;
    /** Current number of entries in the buffer. */
    get size(): number;
}
/**
 * Label an assistant message_end event into 0-2 context entries.
 *
 * Returns labeled strings for text content and/or tool calls.
 * Returns [] for non-assistant messages or messages with no usable content.
 */
export declare function labelMessageEnd(message: {
    role: string;
    content?: unknown;
}): string[];
/**
 * Label a tool_execution_end event into a single context entry.
 *
 * Returns a string like "Tool bash completed" or "Tool bash failed: <output>".
 */
export declare function labelToolEnd(event: {
    toolName: string;
    isError?: boolean;
    result?: unknown;
}): string;
//# sourceMappingURL=context-buffer.d.ts.map