import React from 'react';
import { Box, Text } from 'ink';
/**
 * Displays real-time tool output in a terminal-style scrolling buffer.
 * Shows the last N lines of output with a header indicating the tool.
 */
export function ToolStreamOutput({ output, toolName, maxLines = 15, isStreaming = false, }) {
    const lines = output.split('\n');
    const displayLines = lines.slice(-maxLines);
    const hiddenCount = Math.max(0, lines.length - maxLines);
    return (React.createElement(Box, { flexDirection: "column", marginLeft: 2 },
        hiddenCount > 0 && (React.createElement(Text, { dimColor: true, color: "gray" },
            "... ",
            hiddenCount,
            " lines hidden")),
        displayLines.map((line, idx) => (React.createElement(Text, { key: idx, color: "gray" }, line))),
        isStreaming && (React.createElement(Text, { dimColor: true, color: "cyan" },
            toolName,
            " running..."))));
}
//# sourceMappingURL=ToolStreamOutput.js.map