The A2UI Renderer

How MeghaOS turns an interface description into live widgets — safely.

The renderer is the part of the desktop that converts an A2UI interface description into live widgets at runtime. Everything the assistant generates flows through it.

The render pipeline

  1. Validate. The description is clamped to safe limits before anything renders.
  2. Walk. The renderer recurses through the tree.
  3. Look up. Each node's type is matched to a widget builder.
  4. Build. The builder constructs the widget, reading properties directly off the node.
  5. Recurse. Children are rendered the same way.

Safety caps

Because the description is AI-generated, the renderer enforces hard limits so a malformed or oversized description can't cause problems:

LimitCapOn exceed
Nesting depth< 50Deep subtree → placeholder
Children per node< 300Excess children dropped
Total components~2,000Tree truncated

The same caps are enforced on both the assistant and the desktop, and the A2UI schema tells the AI to stay well under them.

Layout constraint rules

Certain layout combinations are invalid and would fail at runtime. The schema instructs the AI to avoid them, and the renderer defends against them:

  • Never put input_text, slider, progress, or dropdown directly in a row — wrap in expanded or give an explicit width.
  • Never use expanded / flexible / spacer outside a row or column.
  • Prefer wrap: true on rows with many children.

Telemetry & self-correction

The desktop records render successes and failures so problematic component shapes can be found and fixed. Two sources feed it: caught build errors, and the validator rejecting a malformed subtree. This telemetry can be fed back to the assistant so it learns to avoid shapes that don't render — a feedback loop that improves generated UIs over time.

Component catalog

Browse every renderable type and its properties.