1 +#
UI Extension Phase 1 Implementation Plan 3 +> **For agentic workers:** Use `/skill:executing-plans` to implement this plan task-by-task.
5 +**Goal:** Build `/ui` Phase 1: token-authenticated LAN web shell, QR/link terminal widget, and clean shutdown.
7 +**Roadmap:** `docs/super/roadmaps/2026-07-01-ui-extension-roadmap.md`
13 +- Create `extensions/ui` as a normal pi-ext workspace package.
14 +- Install UI deps through the root npm workspace lockfile so `mise run install` uses `npm ci`.
15 +- Register `/ui`, `/ui off`, `/ui status`, `/ui open`, and `/ui qr`.
16 +- Start HTTP server only from `/ui`, never during extension load.
17 +- Protect browser routes with random token auth, cookie auth, and bearer auth for API routes.
18 +- Render shell page, 401 page, and JSON status route.
19 +- Show terminal widget with OSC link, QR, state, session label, client count, ESC help, and `/ui off` help.
20 +- Stop server and clear widget on `/ui off`, ESC, and `session_shutdown`.
21 +- Add unit tests and harness tests.
26 +- Active-branch session seeding.
27 +- WebSocket event stream.
34 +- [x] Scaffold `extensions/ui/package.json` and `README.md`.
35 +- [x] Add `qrcode` and `@types/qrcode` through `package-lock.json`.
36 +- [x] Verify `mise run install` installs UI deps via `npm ci`.
37 +- [x] Add network helpers and token redaction helpers.
38 +- [x] Add token-authenticated HTTP server.
39 +- [x] Add QR renderer and terminal widget renderer.
40 +- [x] Add cross-platform browser opener candidates.
41 +- [x] Add runtime state machine.
42 +- [x] Register `/ui` command and cleanup hooks.
43 +- [x] Add unit and harness tests.
44 +- [x] Run targeted UI tests.
45 +- [x] Run actual UI static check.
46 +- [x] Run `mise run check -- ui`.
47 +- [ ] Run real Pi + browser smoke test.
51 +- `extensions/ui` exists and passes static extension checks.
52 +- Runtime starts only from `/ui`.
53 +- LAN server requires token and serves shell, 401, and status routes.
54 +- Terminal widget shows link, QR, state, session label, ESC help, and `/ui off` help.
55 +- `/ui off`, ESC, and `session_shutdown` stop server and clear widget.
56 +- Dependencies are in `package-lock.json`; `mise run install` succeeds.
57 +- Targeted unit and harness tests pass.
58 +- Real Pi + browser smoke test passes.