Streams line by line
Each line is parsed and drawn as soon as it arrives, so a screen starts to appear after about 30 tokens. Parts still on their way show placeholders.
AI models write short, flat lines of intent. Your app checks every line and draws it with its own trusted components. No HTML, no CSS, no code from the model, and no action it wasn't allowed.
root = Card([title, amount, pay])
title = Heading("Confirm payment")
amount = Text(42.50, format="currency", currency="USD")
pay = Button("Pay now", action="pay")
payM = McpMutation(pay, tool="payments.confirm", params={amount: 42.50})