export function serializeAnthropicEventToSSE(event) {
    const payload = event.data ?? {};
    const type = event.event ||
        event.type ||
        (typeof payload?.type === 'string'
            ? payload.type
            : 'message');
    return [`event: ${type}`, `data: ${JSON.stringify(payload)}`].join('\n') + '\n\n';
}
