dsh-mobilecode 0.11.9 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,6 +43,10 @@ drawer:
43
43
  merged into the Device 1 card in 0.10.0
44
44
  - a Metro (bundler) status card
45
45
  - polls `GET /api/dsh-mobilecode` every 2 s while open
46
+ - keyboard-operable and resizable without a mouse (0.12.1): the drawer is a
47
+ named `complementary` landmark, its drag handle is a focusable
48
+ `role="separator"` carrying `aria-valuenow` that answers ←/→ and resets on
49
+ Home, and every scrollable log tail is reachable with Tab
46
50
 
47
51
  **Agent tools**
48
52
 
@@ -374,6 +378,51 @@ say *why* instead of "something failed".
374
378
  - Tolerant internal callers (boot polling, IME checks) opt back into
375
379
  best-effort with an explicit `.catch(() => "")`.
376
380
 
381
+ ## Design workbench (0.12 — native Android UI design & verification)
382
+
383
+ Reusable capabilities for the loop *explore visual directions → approve a
384
+ design → implement native Compose → render → compare → test on Android →
385
+ refine*. App-specific decisions (learning flow, approved directions) live in
386
+ the app project, never hardcoded here.
387
+
388
+ - **Reference workspace (`preview_gallery`, `config_matrix`, `design_bridge`
389
+ tools + `/api/dsh-mobilecode/refs|preview|matrix|openpencil/*` routes)** —
390
+ import PNG/JPEG/WebP design references with metadata (project, screen,
391
+ state, provenance, approval status); associate device captures (reuses the
392
+ existing screencap path; originals stored verbatim, alignment transforms
393
+ kept separate); persisted under `~/.dsh/mobilecode/reference/` across
394
+ reloads. Header-only decompression fences (no pixel decode server-side, no
395
+ new dependency).
396
+ - **Visual diff (`POST /refs/diff`)** — two modes, never conflated:
397
+ `regression` (any changed pixel fails against a recorded native baseline)
398
+ and `design-reference` (structure comparison, always `needs_review` — the
399
+ tool ran; that is not a visual pass). Client canvas downsamples; the server
400
+ reports concrete changed-region clusters; envelopes persist as evidence
401
+ files. No quality scores anywhere.
402
+ - **Compose preview gallery** — discovers `@PreviewTest` composables of a
403
+ Gradle project and renders them through **official Compose Preview
404
+ Screenshot Testing** (`com.android.compose.screenshot`, pinned
405
+ 0.0.1-alpha16, host layoutlib — works on AGP 8.5+ without toolchain
406
+ migration; compose-ai-tools needs AGP 8.13 and is documented as a blocked
407
+ alternative). Failed/stale renders are never labeled current; host-rendered
408
+ ≠ device-verified (see `docs/design/render-adapter-decision.md`).
409
+ - **Configuration matrix (`config_matrix` tool)** — bounded (1..8) risk-based
410
+ matrices over real device settings (wm size/density, font scale): every
411
+ case reads back its ACTUAL configuration, captures evidence, and the device
412
+ is restored to its found state (including pre-existing overrides) on
413
+ success, failure and cancellation. Physical devices are refused without
414
+ explicit approval.
415
+ - **OpenPencil bridge (`design_bridge`, optional)** — file-mode CLI adapter:
416
+ inspect `.fig` docs, export a frame to PNG into the reference workspace,
417
+ read design variables. Path-confined (realpath + junction-aware); when the
418
+ CLI is absent everything degrades to honest `not_run` — the workspace stays
419
+ fully usable with manual imports. OpenPencil exports are web-oriented
420
+ (PNG/JSX/HTML); no native Compose export is claimed.
421
+ - **Panel** — the Devices drawer gains two cards: **Reference compare**
422
+ (import / capture / side-by-side / opacity overlay / swipe slider / diff)
423
+ and **Preview gallery** (discovery, thumbnails, stale badges, per-entry
424
+ render).
425
+
377
426
  ## How it works
378
427
 
379
428
  - `lib/device-build.js` — port of `mobilecode/packages/core/src/device-build.ts`:
@@ -395,6 +444,13 @@ say *why* instead of "something failed".
395
444
  Pure + injectable clock/RNG, so `test/mesh-hub.mjs` covers it offline.
396
445
  - `sdk/mesh-client.mjs` — dependency-free `fetch` client (join/link/send/
397
446
  poll/inbox/leave) for game code running inside the emulators.
447
+ - Design workbench modules: `lib/reference-workspace.js` (reference/capture
448
+ store + header-only image fences), `lib/visual-compare.js` (pure RGBA diff
449
+ core — the server never pixel-decodes), `lib/preview-gallery.js` (@PreviewTest
450
+ discovery + Gradle render driver with timeout tree-kill),
451
+ `lib/config-matrix.js` (bounded matrix runner, snapshot→apply→confirm→
452
+ capture→restore on every path), `lib/openpencil.js` (optional CLI bridge,
453
+ realpath/junction-confined).
398
454
  - `lib/setup.js` — settings store (~/.dsh/mobilecode/settings.json), the plugin
399
455
  doctor (health checks + auto-fix), and the detached PaddleOCR installer
400
456
  (writes an install script to disk and spawns it via cmd.exe, so the install