Bento Spaces docs

Bento Spaces documentation

Roadmap

Each phase is shippable on its own. Do not start a phase before the previous one's acceptance criteria are green, and update this file when a phase completes. The live backlog is Open work; this file keeps the phase history and acceptance criteria.


P0 — Shelf engine ✅ done

Space → blocks → containers, patterns, gaps, drag, resize, undo, local persistence.

Known gap: the engine is client-only; nothing is validated server-side yet.


P1 — Webtop shell ✅ done

Accounts, spaces, dock, the private/data split, edit/view, wallpapers, offline shell.

Built: storage split with atomic writes · accounts (PBKDF2, sessions, throttle) · spaces API + dock (create, rename, colour, delete, duplicate, switch) · layout.json v3 joined with widget instances · server-side layout validation · anonymous mode with IndexedDB layouts · first-login import that reuses empty starters · rev + If-Match with keep-mine / use-theirs · edit/view modes · free-plan entitlement · wallpaper presets (free) and uploads (Plus, signature-checked) · service worker shell cache with offline navigation.

Open, moved to later phases: signed-in offline queueing (edits wait for the network) belongs with the sync work in P4/P6.

Acceptance


P2 — Widget runtime ✅ done (with two gaps noted)

Browser tests live in the repo: scripts/e2e/{shelf,shell,widgets}.e2e.mjs, driven by a Chromium with remote debugging (see scripts/e2e/README.md).

The board comes alive: slots, sizes, drag and swap, persistence, undo.

Built: registry of eight built-in widgets (clock, stat, note, links, image, progress, countdown, weather) · slot + on empty containers with a fit-filtered picker · widget mount/update/destroy host with container-query sizing · widget drag between containers with 50% + red refusal · swap on filled targets · filled containers locked (no move, resize or delete) · delete removes the widget and keeps the box · undo/redo snapshots both layout and widgets · widgets persist server-side (PUT /widgets/{containerId}) and in IndexedDB locally · visibility change tears widgets down (timers stop) and remounts on return.

Built-ins are trusted in-page modules (our code), not the JSON declarative format. The JSON runtime, installs and the proxy arrive with registries in P4 — see Widgets.

Acceptance


P3 — Space sharing ✅ done (revised: per space, not per person)

One space on a wall, read-only, with an optional PIN that unlocks it after idle.

Built: share links per space (/v/{token}) exchanged for a 12-hour read-only session · the owner chooses idle (30 s–15 min), PIN or no lock, and sets the PIN at creation, stored PBKDF2-hashed · lastOpenedAt, revocation, "Exit view" · idle lock removes widgets from the DOM and unlocks with the link PIN (throttled) · Share dialog: create/copy/revoke links.

Profiles and connect links were removed after review: sharing is per space, so there is no per-person credential intake (D37 revised).

Acceptance


P4 — Registries ✅ done

Installable widgets without executing code.

Built: registry.json spec + server-side fetch/cache · per-user sources (add/remove) · install with sha256 verification into the user's data/ tree · installed list, uninstall, pinned versions · declarative JSON runtime (stat, badge, text, list, image, progress, clock, link) with one shared validator · installed widgets appear in the slot picker with a registry tag · Widget sources dialog (add source, browse index, install/remove) · bundled example registry at /registry-example.json · developer harness at /harness.html · scripts/check-widgets.mjs validating manifests and registry hashes.

Acceptance


P5 — Sandboxed module widgets ✅ done

Built: module manifests with inline source (≤64 KB) · a server-served frame document with its own CSP (sandbox allow-scripts; connect-src 'none') · sandbox="allow-scripts" iframes with an opaque origin · a postMessage bridge (props, size, setProps, emit, plus the P5.5 request/action capabilities) · 12-hour frame tokens so an opaque-origin frame can load without cookies · install validation · the bundled pulse module · harness and E2E coverage.

Acceptance


P5.5 — Widget data and actions ✅ done

Built: a host proxy at /api/widgets/{id}/{version}/data (installed manifest, declared origins, GET only, no cookies or redirects, 8 s, 256 KB, JSON/text, public addresses only, optional TTL cache) · declarative data with a dot path and {{data}} / {{data:path}} / {{var:name}} · install-time consent driven by the registry index, with the server rejecting a manifest broader than the index · module ctx.request, ctx.open, ctx.refresh and gated ctx.setProps · the bundled site-status declarative widget and the pulse module now reads through the proxy.

Acceptance

Known gaps: no POST/headers/JSONPath in declarative data; the proxy is not per-user rate-limited yet; DNS rebinding is mitigated best-effort only.


P5.6 — Connectors and the first IoT widget ✅ done (first slice)

Built: account connectors (base URL + write-only bearer token) · AES-GCM secret storage · server-side connector proxy with GET/POST, origin/path confinement, no cookies or redirects, 8 s/256 KB caps and link-local refusal · Settings → Connectors dialog with test/remove · the built-in Gree AC widget (power, temperatures, 5 s poll, toggle through /api/power) · API smoke and a browser suite against a mock bridge.

Acceptance

P5.7 — Multi-device Bento Bridge ✅ done (supervisor slice)

Built: source/Bento.Bridge, an ASP.NET supervisor with /api/devices, per-device state, power and generic request proxying · one public bearer token, per-child internal tokens · devices.json configuration · a compose example with one gree-ac child per AC · the Gree widget's device picker and legacy fallback · scripts/bridge-smoke.mjs and scripts/e2e/bridge.e2e.mjs.

Acceptance

P5.8 — Tier A widgets ✅ done

The secret-free widgets that can be shared and exported: weather with a forecast, an RSS/Atom feed, markets (coins + FX) and a photo-frame slideshow, plus a two-timezone clock and a yearly countdown. All upstream text is escaped, failures paint a message, and the data path is either a CSP-allowed public host or the same-origin feed proxy.

Acceptance

P6 — Surfaces ✅ done

Built: a density-aware viewport unit (80 px at a laptop, ~142 on a 32:9 panel) · automatic vertical stacking below 720 px · a display pairing (/display/{token}) that boots read-only with left/right rails, no top chrome, hidden cursor, wake lock and no idle lock · a single-file HTML export with inlined tokens/styles and snapshotted widgets · 44 px dock targets and pan-to-scroll on phones · one device-wide zoom in Settings, scaling boxes and widget contents.

Acceptance

Long-press drag while editing on a touch device is deliberately deferred: view mode pans, edit mode still drags immediately.

P6.5 — Split docks ✅

Space controls left the shared actions row. The space dock (top centre) is anchored by the space name and expands on hover, focus or tap; the account dock (top right) holds settings and account. Share and export moved into the space dock, and export opens a popup that is the future home for viewer permissions. The pencil opens space details and the grid/✓ toggles edit. On a phone the expanded dock becomes a full-width toolbar; edit mode pins it open.

Acceptance

P7 — Commercial surface — tracked in Open work

  1. Merchant of record integration (Paddle, built against a mock), plan changes, invoices
  2. and the customer portal.
  3. Share capacity pricing (included with Plus for now).
  4. Publisher plan (€50) with push + verified badge — the badge needs the plan to show.
  5. Grandfathering: a new price id does not migrate existing subscriptions.

Acceptance

P5.9 — Automations ✅ done

Built 2026-11-26. Personal rules over connectors, built for the owner first and only generalized if it earns it. The first rule is a thermostat for the Gree ACs: profiles own the thresholds, a rule per device picks one, and a server-side tick decides. See 16 — Automations.

How it works

Profiles and weather brackets

A rule points at a profile, and a profile is the thing that owns numbers. This keeps the thresholds in one place and lets the weather choose between them.

profile:  { id, name, season, min, max, cooldownMinutes }
rule:     { connectorId, deviceId, enabled, profileId,
            weather: { metric: "outdoorTemp", brackets: [{ max: 15, profileId: "cold" },
                                                         { max: 25, profileId: "mild" },
                                                         { profileId: "hot" }] } }

Seasonal schedule

Known limits to state in the UI

Acceptance