A2UI (agent-to-user interface) is the heart of MeghaOS. Instead of generating code, the LLM generates JSON that describes a user interface. The shell renders that JSON into real, interactive widgets at runtime. No compile step, no redeploy. The full schema lives in the agent, which injects it into the composition prompt so the model always writes against the current component set.

The shape of A2UI

Every node is an object with a type and properties directly on the object (not nested under props):
Properties go directly on the component object. {"type":"text","content":"Hi"} is correct; {"type":"text","props":{"content":"Hi"}} is wrong and won’t render.

Component families

The schema groups types into families. See the full list in the Widget Catalog.

Layout primitives

container, row, column, stack, grid, wrap, padding, align, center, positioned, transform, sized_box, divider.

Interactive

button, slider, toggle, input_text, dropdown: each carries an action.

Animated

animated_value, gauge, sparkline, chart, pulse, typing_text, fade_in_column.

Smart components

Self-managing widgets like live_timer, pomodoro, kanban_board, live_weather: organized into tiers (see below).

Educational

animated_svg, diagram, node_graph, calendar_view for explaining concepts with animated visuals.

Colors and theming

Use hex strings or semantic tokens. Tokens adapt to the active theme (dark / light / glassmorphic) automatically:
Colors must be strings: "0xFF000000", not 0xFF000000. Property names must be double-quoted, and no trailing commas; it’s strict JSON.

Actions

Interactive elements carry an action payload the shell dispatches back to the agent:
Built-in commands include kill_process, set_volume, set_brightness, toggle_wifi, run_command, open_app, and refresh. These act on your machine: pressing a button whose action is run_command runs that shell command, and kill_process ends the process. See Actions & Interactivity.

Safety: the layout validator

Because the UI tree is generated by an LLM, the renderer enforces hard structural limits so a malformed or oversized tree can’t crash the shell. The schema tells the model to stay well under these: The same caps are enforced in both the assistant and the desktop.

Why JSON instead of code?

Data, not code

A layout is a description, not a program: the validator clamps a malformed tree, and the worst a bad layout does on its own is render oddly. What a layout can do is in its actions, and a button can carry a command that acts on your machine.

Fast

No build step. The model returns JSON, the shell renders it in the same frame loop.

Composable

Smart components encapsulate behavior, so the model assembles rich UIs from a small vocabulary.

Extensible

New widget types arrive with MeghaOS updates, and the model can use each one in every composition.