Streaming and push

hl:web pushes hole patches over one socket (h1, h2 or h3 — one manifest line). hl:fetch consumes streams with stream = true: each chunk arrives as an event, which is how an LLM's tokens reach your app. on/emit is the only wire, everywhere.

import { fetchStart, fetchAbort, completions } from 'hl:fetch'

__native('eventloop.register', completions(), 'tok')

on tok(ev) {
	if (ev.chunk != null) { return this.append(ev.chunk) }
	// the final frame: { status, ok, error, aborted }
}

fetchStart(url, { method = 'POST'; stream = true; tag = 'llm'; json = body; })
// the stop button, wire-level: the peer sees the disconnect
fetchAbort('llm')