Bento Spaces documentation
18 — Studio
developer.bentospaces.com is the widget workbench. The page stays static; drafts, releases and the publisher profile live in the API, called through the same origin (the same reverse-proxy rule as the webtop).
studio/
index.html editor + preview
app.js validation, preview, publisher, drafts, releases
preview.css the widget styles the preview needs
styles.css the workbench chrome
lib/… copied from web/src at build time
What it does
- Manifest editor — a JSON textarea with the manifest template. Once signed in, edits
- autosave to the server after a short pause; Save draft forces it and the state line shows
- Saved / Unsaved / Local only.
localStorageremains the fallback for the local workbench. - New widget — generates a fresh handle and template in one click.
- Shared validator —
web/src/widgets/declarative.js, copied intostudio/lib/by node scripts/build-studio.mjs. The same rules the app and installer use, so "valid here"- means "valid at install". Errors show their path (
render.value must be …). - Live preview — the real
definitionFor(manifest)runtime mounts into a card at 1×1, 2×1, - 2×2 or 4×2. Module widgets get a raw module source editor and run in a sandboxed iframe with
- their own CSP, matching the shelf's opaque-origin frame. The chosen size is remembered
- (
bento.studio.size.v1). - Account and publisher —
GET /api/mewith the shared cookie. Creating a publisher asks for - a permanent handle, display name, bio and optional website;
tierstarts atunverified. - An unverified publisher can request verification with an optional note and up to three evidence
- links; Studio keeps the request and decision history. The request appears in
/manageand is cleared when an operator changes the tier.- My widgets — every handled draft with its latest release; clicking one loads its draft.
- Actions — Save draft, Publish release (version + notes), Test install, Download.
- Download — still writes
${handle}-${version}.jsonas a local fallback. - Icon — optional PNG/JPEG/WebP under 128 KB; the store falls back to the monogram when a
- widget has none.
- Feedback — readers can message the publisher from a store page; the inbox lists the
- reporter, widget, message and replies, with Reply / Close / Reopen. The reporter sees the same
- thread and developer replies when they reopen the feedback form. Feedback is not moderated by
- the platform.
- Publisher status — the console can suspend or ban a publisher; Studio shows the state and
- disables Publish. Installed widgets keep working.
- Reports are operator-side: readers report a release, the queue lives in
/manage, and a - resolved or dismissed report notifies the reporter. Studio never shows the reporter.
- Notifications — new feedback, publisher replies, tier changes, operator pause/delist
- actions and new versions of installed widgets land in a per-user feed with an unread count.
- Opening an item or using Mark all read clears it. Publishing a market release notifies every
- other account that has an older version installed, once per release. Mute groups in the
- webtop bell; the server then skips those kinds for that account.
Publishing
Identity is two handles:
@ren/weather public
ren--weather install id
- The publisher handle is permanent and names the developer registry. The tier starts at
unverified;/managecan promote it toverified,trustedorofficial. The store shows- a check badge above unverified only while the publisher's plan is Publisher — a lapse
- hides the badge but keeps the verification record (
/api/publishers/ren/registry.json). - The widget handle is permanent once released. Widgets only need to be unique inside a
- publisher, so two developers may both own
weather. - The install id is
publisher--widget; built-in ids stay reserved and legacy ids keep - working.
A release is a version directory with manifest.json and meta.json:
- Save the draft (mutable, private).
- Publish a version (
1.2.0), which validates the manifest, injects the namespaced id and - developer, hashes the exact bytes, and writes an immutable release.
- The release appears immediately in the personal registry and auto-lists in
- WidgetMarket (
market: true); the API invalidates the market index cache. Tier is shown - on the listing but does not gate publishing. WidgetMarket merges Studio releases with the
- five seeded legacy examples, whose files stay on the static marketplace host.
- Test install copies the release into the developer's own library without affecting other
- users. Uninstalling it behaves like any installed widget.
Versions must increase; re-publishing a version is refused. Changing a widget means a new version, never a mutated release.
Release notes are part of the release and show up beside each version in Studio and in the store's version history.
The release list can Unlist a version from WidgetMarket (it stays in the personal registry) or Pause it (hidden from both). Both are reversible and never rewrite the release bytes; the newest visible version becomes the registry's latest.
Install analytics
With the Publisher plan, Studio lists aggregate installs, version spread and the last install date per widget. Counts come from the installed libraries across accounts; no reader identity is exposed. Other plans receive 403 publisher_plan_required and the section stays hidden.
Build and run
node scripts/build-studio.mjs
# local, with the API proxied so the account chip works
API_UPSTREAM=http://127.0.0.1:5080 node scripts/serve-static.mjs studio 5085
In a split deployment, developer.bentospaces.com serves release/developer and its config.js points at https://api.bentospaces.com. The browser calls the API directly; CORS and the .bentospaces.com cookie carry the session.
Verification
node scripts/e2e/studio.e2e.mjs starts a static server and checks:
- the default manifest validates and previews
- invalid JSON and invalid manifests report errors (with paths)
- a list manifest renders its items
- the preview follows the size selector
- draft and size survive a reload
Not built yet
No Studio gaps are open. Module assets ship inside the release; the backlog lives in Open work.