# ui Browser UI runtime shell for Pi. ## Install / load Loaded through the root [pi-ext](../../README.md) package. ## Commands - `/ui` — start LAN web shell, token URL, QR, terminal widget, seeded RPC session. - `/ui off` — stop server/RPC and restore terminal widget state. - `/ui status` — show runtime URL, clients, state, and last error. - `/ui open` — open current URL in desktop browser. - `/ui qr` — redraw QR/link widget. ## Behavior `/ui` starts a token-authenticated LAN browser UI backed by a seeded Pi RPC session. The browser stream supports normal prompts, slash commands, bash shorthands, extension UI requests, trusted visual widgets, telemetry digest attachment, lifecycle errors, lazy code/diff rendering, and Nugu brutal/minimal styling. ## Security and trust model Transport is HTTP on LAN with a random bearer token in the URL/cookie. There is no HTTPS. Treat the URL as secret. The browser UI is for trusted local/LAN use only. Agent-created visual widgets are trusted full HTML/CSS/JS. They are not sandboxed. Widget actions are audited and visibly attributed before widget-originated prompts reach the Pi session. ## Manual smoke On win32, use zellij, never tmux: ```sh node extensions/ui/scripts/zellij-smoke.mjs ``` On non-win32, use tmux where available: ```sh node extensions/ui/scripts/tmux-smoke.mjs ``` Full checkpoints live in [docs/manual-playbook.md](docs/manual-playbook.md). ## Mockup parity audit The accepted mockup was treated as visual direction, not a finished parity checklist. That was wrong for user expectations. Implemented now: stream-first shell, Nugu theme, sticky bottom composer, token auth, RPC stream, command input, dialogs, trusted widgets, code/diff rendering, telemetry digest, and no sidebars. Still incomplete versus the representative mockup/spec: richer top strip with Pi mark and `/ui off`, meaningful bottom status strip for model/thinking/context, stronger `YOU` labels, selected-item inspector, clearer tool lifecycle cards, and polished mobile status/actions. Track these as UI polish/parity work, not transport/runtime work. ## Troubleshooting - `401` means the token is missing or stale; reopen `/ui` or rescan QR. - Browser says disconnected: run `/ui status`, then `/ui open` or restart with `/ui off` and `/ui`. - RPC unavailable: verify `pi` is on `PATH` and the seeded session can start in the current repo. - Browser features target modern Chrome/Firefox only. - Parallel terminal/browser edits are allowed and can race. ## Package invariants - Private package. - `main` is `index.ts`. - MIT license. - Pi packages are peer dependencies. - Tests use Vitest, Pi harness, and Playwright E2E.