How it works
compose_ui returns A2UI JSON. When custom logic is required, the model embeds a __jit__
key holding the program inside the same response (no separate code-generation call).
Where the code runs
JIT code is not sandboxed. It runs on your machine, with the same access as the assistant itself. Before it runs, MeghaOS checks the program against an allowlist: it may import computation and data libraries (such asmath, json, datetime, pandas and numpy)
and web-request libraries, but not modules that reach the filesystem, other processes or the
import machinery (such as os, subprocess and importlib), and it may not call open,
eval or exec. A program that fails the check is refused before it runs.
Because web-request libraries are allowed, a JIT program can fetch data from the internet.
Kernel-enforced confinement and default-deny egress are in development.
Binding output to the UI
A UI component can declare"jit_bind": "key". After the code runs and returns a dict, the
value at that key is bound into the component deterministically. No guessing which output
maps to which widget.
Streaming (live widgets)
For widgets that update continuously, the streaming engine runs a loop that re-executes the code on an interval and pushes updates to the shell:- Drift-free timer: each cycle sleeps just enough so ticks don’t drift.
- JSON diffing: computes the delta each tick and sends only a patch, minimizing payload size.
- Updates are broadcast straight to the shell.
elapsed_time
value (seconds since the stream started), letting the code animate or recompute against a
live clock each tick.