UISandbox
v0.5.12Play with your app's design in the browser: load a build, turn the knobs, export the code.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
load Load a built web app
Load a web app: a RUNNING dev server by its local address (devUrl, e.g. http://localhost:5173 — live mode: no build needed, hot reload passes through, best while the user is developing), or a BUILT app (a zip of its dist/build/out folder, or a repo zip carrying the build) by URL or local path. Returns the project id, screens, tokenised values and the baseline the knobs stand on. Refuses a build that cannot render (iOS/Android/source-only) with the reason. After a devUrl load, `open` it: the tokenised values and the knobs arrive in the browser as the app renders.
| Parameter | Type | Description |
|---|---|---|
devUrl | string | The address of a running dev server on this machine, e.g. http://localhost:3000 |
zipPath | string | Local path to the zip |
zipUrl | string | URL of the zip (any URL the server can fetch, incl. GitHub /archive/…zip) |
screens List screens
The screens (HTML entries) of a loaded project.
| Parameter | Type | Description |
|---|---|---|
id * | string |
set Turn the knobs
Apply knobs to a loaded project. Every dial has ×1 (or 0) = as in their code; colours are #rrggbb. Returns what moved (count and a sample of value → value).
| Parameter | Type | Description |
|---|---|---|
id * | string | |
knobs * | object |
export Export
Export the current state: sheet-css (your values as CSS custom properties), sheet-json, patch (literal → value list), tokens-css / tokens-json / tailwind / shadcn (the --k-* design tokens), swift, android-xml, android-kotlin.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
id * | string |
try_designs Try designs on the user's app
The one call when the user wants to try designs on the app they are building: "let me try some designs", "I'm not happy with how it looks", "try another style", "can I play with the colours / fonts / spacing", "show me a few looks". Finds their app on this machine (the dev server that runs, read from package.json or found on the usual ports; else the build in this folder), loads it live and opens UISandbox in their browser: their own app, six looks side by side, every knob, hot reload kept. No arguments needed. Then tell them to pick a look or turn the knobs and press "Send to your agent"; cal…
| Parameter | Type | Description |
|---|---|---|
carry | string | Knobs the user turned on a kit at uisandbox.org, as a prompt copied there names them |
url | string | The app's address, when you know it (e.g. http://localhost:5173). Leave out to find it. |
open Open the sandbox
Open UISandbox in the user's browser with this project loaded — the real, interactive sandbox: the whole app rendered 1:1, every knob there to turn by hand. Use this whenever the user wants to SEE or PLAY with the design themselves ("can I look at this in a sandbox", "let me try some changes"), not only read numbers. Served from 127.0.0.1 by this process; nothing leaves the machine. What the user turns in the browser flows back here: a later `export`, `verify` or `screenshot` uses it.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
carry | string | The knobs the user turned on a kit at uisandbox.org, as the prompt they copied there names it: offered to them when the app opens |
screen | string | Screen path to open first |
state Current knobs
The knobs as they stand now — including what the user turned by hand in an opened sandbox (and when).
| Parameter | Type | Description |
|---|---|---|
id * | string |
wait_for_send Wait for the user to send it back
BEFORE you call this, write the user one line in your reply: the sandbox is open in their browser, pick one of the six looks or turn the knobs, then press "Send to your agent". This call blocks until they press it, and they see nothing from you while it waits. After `open` or `try_designs`: wait until the user presses "Send to your agent" in the sandbox, then return what they turned (from → to, in the panel's own names), how many values moved, and the patch that writes it into their source. Returns at once if they already sent and you have not collected it. If the time runs out first it says…
| Parameter | Type | Description |
|---|---|---|
id * | string | |
timeoutSeconds | integer | How long to wait (default 240) |
verify Check 1:1
Run the 1:1 check in a real browser: the untouched build vs. the tokenised build with the identity sheet, computed styles of every element diffed. Also returns the reach meter. This is the same check a visitor runs on uisandbox.org.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
screen | string | Screen path (from screens); default the first |
width | integer |
screenshot Screenshot
A PNG of the screen as it renders with the current knobs (the sandbox frame only).
| Parameter | Type | Description |
|---|---|---|
id * | string | |
screen | string | |
width | integer |