/**
 * Layout primitives for the message stream.
 *
 * Defines the prefix symbols, content padding constants, and
 * helpers that indent child output after a leading symbol.
 */
import { theme } from './theme/runtime.js';
/** Standard horizontal padding for content that uses its own background (e.g. custom messages). */
export const CONTENT_PAD_X = 1;
/** Standard vertical padding (0 = no extra blank lines above/below). */
export const CONTENT_PAD_Y = 0;
/** Visible character width of the message prefix (symbol + trailing space). */
export const PREFIX_WIDTH = 2;
export function assistantPrefix() {
    return `${theme.fg('text', '●')} `;
}
export function toolPrefix(isPending, isError, blinkOn) {
    if (isPending) {
        return blinkOn ? `${theme.fg('warning', '●')} ` : `${theme.fg('dim', '●')} `;
    }
    return isError ? `${theme.fg('error', '●')} ` : `${theme.fg('success', '●')} `;
}
/**
 * Prefix the first visible line of rendered output with a symbol,
 * and indent all subsequent lines to maintain alignment.
 *
 * Lines before the first visible content (e.g. spacer blanks) are left untouched.
 */
export function prefixLines(lines, prefix) {
    const indent = ' '.repeat(PREFIX_WIDTH);
    let firstDone = false;
    for (let i = 0; i < lines.length; i++) {
        if (!firstDone) {
            if (lines[i].trim()) {
                lines[i] = prefix + lines[i];
                firstDone = true;
            }
        }
        else {
            lines[i] = indent + lines[i];
        }
    }
    return lines;
}
//# sourceMappingURL=layout.js.map