e a more robust way to find SSE messages, handling potential multiple messages per chunk
                            let boundary = buffer.indexOf('\n\n');
                            while(boundary !== -1) {
                                const message = buffer.substring(0, boundary);
                                buffer = buffer.substring(boundary + 2); // Skip the \n\n

                                const lines = message.split('\n');
                                for (const line of lines) {
      