/** Count total streamed chars across all content blocks. */
export function getStreamingChars(content) {
    let chars = 0;
    for (const c of content) {
        const block = c;
        if (block.type === 'text' && typeof block.text === 'string') {
            chars += block.text.length;
        }
        else if (block.type === 'thinking' && typeof block.thinking === 'string') {
            chars += block.thinking.length;
        }
        else if (block.type === 'toolCall') {
            chars +=
                JSON.stringify(block.arguments ?? '').length +
                    (typeof block.name === 'string' ? block.name.length : 0);
        }
        else if (block.type === 'tool_use') {
            chars +=
                JSON.stringify(block.input ?? '').length +
                    (typeof block.name === 'string' ? block.name.length : 0);
        }
    }
    return chars;
}
export function isExpandable(obj) {
    return (typeof obj === 'object' &&
        obj !== null &&
        'setExpanded' in obj &&
        typeof obj.setExpanded === 'function');
}
//# sourceMappingURL=interactive-mode-helpers.js.map