// The streaming parser appends what each chunk adds instead of re-parsing the whole
// reply, so a list grows item by item.
const bubble = document.querySelector('aparte-chat-bubble');
bubble.setSegments([{ id: 's1', type: 'text', content: '' }]);
const text = 'Three steps:\n\n1. Register a provider.\n2. Set a transport.\n3. Start the client.\n\nThat is **the whole wiring**.';
let i = 0;
const tick = setInterval(() => {
bubble.appendToSegment('s1', text.slice(i, i + 6));
i += 6;
if (i >= text.length) { clearInterval(tick); bubble.removeAttribute('streaming'); }
}, 60);