import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { truncateCells } from "../../../design/textLayout.js";
export function generateStepModel(state, width = 88) {
    const goal = state.goal.replace(/\s+/g, " ").trim();
    return {
        ready: state.method === "manual" || goal.length > 0,
        goal: goal ? truncateCells(goal, width) : "No generation goal",
        hints: [
            "Stable role and cache rules stay near the top.",
            state.model === "deepseek-v4-flash" ? "Flash is selected for cheap iteration." : "Consider flash for smoke testing.",
            state.tools.length ? `Tool allowlist: ${state.tools.join(", ")}` : "No allowlist means inherited tools.",
        ],
    };
}
export function GenerateStep(props) {
    const model = generateStepModel(props.state, props.width);
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", children: "Generate draft" }), _jsx(Text, { children: model.goal }), model.hints.map((hint) => (_jsx(Text, { color: "gray", children: hint }, hint)))] }));
}
