export function isUserMessage(message) {
    return message.role === 'user';
}
export function isAssistantMessage(message) {
    return message.role === 'assistant';
}
export function normalizeContent(content) {
    if (!content) {
        return [];
    }
    if (typeof content === 'string') {
        return [
            {
                type: 'text',
                data: {
                    text: content,
                },
            },
        ];
    }
    if (Array.isArray(content)) {
        return content;
    }
    return [content];
}
/**
 * Check if message content contains ONLY thinking content (no other content types).
 * @param content - Message content to check
 * @returns true if content contains only thinking parts and nothing else
 */
export function hasOnlyThinkingContent(content) {
    const parts = normalizeContent(content);
    if (parts.length === 0) {
        return false;
    }
    return parts.every((part) => part.type === 'thinking');
}
export function resolveMessageActions(message, defaultActions) {
    if (message.actions) {
        return message.actions;
    }
    if (defaultActions) {
        return defaultActions.map((action) => ({
            actionType: action.type,
            icon: action.icon,
            children: typeof action.children === 'function'
                ? action.children(message)
                : action.children,
            label: action.label,
            view: action.view,
            onClick: () => action.onClick(message),
            popup: action.popup,
        }));
    }
    return undefined;
}
//# sourceMappingURL=messageUtils.js.map
