PXI · UI code mode · Architecture

The worker can only ask

The script never touches the page. It runs in a throwaway worker whose only power is to ask the main thread for an action. The main thread checks each request and performs it.

The worker can only ask Three tiers: PXI on the server sends a script to the browser main thread, which runs it in a throwaway worker; the worker sends action requests up, the main thread checks and performs them and sends results down, and the final result returns to PXI. SCRIPT AGENT PXI on the Phoenix server · writes the script RUN BROWSER Main browser thread owns the app · checks and performs each action SANDBOX Worker runs the script · can only ask · no page, network, storage ACTION REQUEST ACTION RESULT FINAL RESULT LEGEND From PXI Request from the worker Result Sandbox: new one per script, thrown away after
←/→ step · Space play/pause · R replay · Home/End jump

Every await ui.something() in the script is one request across this boundary. The worker is created for one script and terminated when it finishes, times out, or misbehaves.