import { ModalType } from '../core/types';

export interface ParsedCommand {
    type: 'MODAL_COMMAND';
    action: 'CREATE' | 'SPLIT' | 'UPDATE' | 'STYLE' | 'HELP' | 'RESIZE';
    params: {
        modalType?: ModalType;
        layout?: 'horizontal' | 'vertical';
        position?: 'left' | 'right' | 'top' | 'bottom';
        style?: {
            backgroundColor?: string;
        };
        size?: {
            width?: string;
            height?: string;
        };
        count?: number;
        content?: unknown;
    };
}

export const HELP_TEXT = `
I can help you with the following commands:
- Create modals: "show me a table/text/image"
- Split screen: "show two tables side by side"
- Style modals: "make right modal blue"
- Resize modals: "make modal bigger" or "set modal width to 80%"
- Layout: "arrange modals vertically"

Examples:
- "show me options" - displays available commands
- "show me a table" - creates a table modal
- "make modal 80% wide" - resizes modal width
- "split screen horizontally" - arranges modals horizontally
`;

export const COMMAND_PROMPT = `You are a helpful assistant that creates data tables. If the user's message implies they want to see data in a table format (they might mention "table", "data", "information", "stats", etc., or just ask about a topic that would be best shown in a table), create a table about that topic.

Return ONLY a JSON object in this format:
{
    "columns": [
        {"field": "column1", "header": "Column 1"},
        {"field": "column2", "header": "Column 2"}
    ],
    "data": [
        {"column1": "value1", "column2": "value2"},
        {"column1": "value3", "column2": "value4"}
    ]
}

Rules:
1. Return ONLY the JSON object, no explanations
2. Make sure field names in data match column fields exactly
3. Choose appropriate column names based on the topic
4. Include at least 5 rows of data
5. If the user's message doesn't imply they want tabular data, return null`; 