import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { truncateCells } from "../../../design/textLayout.js";
export function promptStepModel(prompt, width = 88) {
    const lines = prompt
        .split(/\r?\n/)
        .map((line) => line.trim())
        .filter(Boolean)
        .slice(0, 8)
        .map((line) => truncateCells(line, width));
    return {
        ready: prompt.trim().length > 0,
        lines: lines.length ? lines : ["No prompt yet"],
    };
}
export function PromptStep(props) {
    const model = promptStepModel(props.prompt, props.width);
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", children: "System prompt" }), model.lines.map((line, index) => (_jsx(Text, { color: model.ready ? undefined : "gray", children: line }, `${index}:${line}`)))] }));
}
