OpenBitFun frontend customization
Use this workflow only for the running OpenBitFun desktop client's own frontend. It is not for a website in the user's workspace, a MiniApp, or a remote OpenBitFun host.
Required workflow
- Call
FrontendWorkbench with action: "prepare".
- Edit only the returned draft directory. Never edit the packaged resource directory, active revision, state file, or another draft.
- Read the returned
openbitfun-creation-api.md. Edit openbitfun-creation.css, openbitfun-creation.js, and optional creation-assets/ only. The draft contains no application bundle or index.html. It needs no source repository, Node.js, dependencies, compiler, or rebuild. CSS loads last; JavaScript is a browser ES module exporting default function activate(ui), called after the real shell renders. Use ui.mount slots and documented semantic selectors; return cleanup for your listeners/timers.
- Call
FrontendWorkbench with action: "apply", setting its draft_id input to the exact returned draftId.
- Before calling
apply, tell the user to inspect the live preview and use the immutable review window. Its Keep button remains disabled until both the real shell and customization activate; the 15-second countdown starts after readiness.
- Read the final
apply result. Only status: "confirmed" means the revision was kept; status: "rolled_back" includes the reason. Use FrontendWorkbench status for later inspection, not direct reads of state.json.
- Use
FrontendWorkbench inspect to check actual mount slots, registered commands and diagnostics. For reusable capabilities, register commands with ui.commands.register, compose persistent ui.state with ui.events, and verify behavior with FrontendWorkbench invoke using the discovered schema. Commands and subscriptions follow activation; state survives code rollback. These commands run in the visible local client, not a headless service.
apply is a two-phase transaction: the confirmed active revision remains authoritative while the candidate is previewed, then user confirmation commits it. If the app shell cannot report readiness, the user does not confirm within 15 seconds, or OpenBitFun exits, the host restores the prior revision. Never bypass or emulate readiness or the confirmation timer in editable page JavaScript.
Use action: "rollback" when the user explicitly asks to undo the currently active customization. Do not delete revision history manually.
Boundaries
- This capability is local-desktop-only. If the tool reports a remote or unsupported surface, explain that state; never fall back to a controller-local path.
- Do not call
FrontendWorkbench outside Creative mode.
- Treat third-party code in a draft as untrusted. Do not add remote scripts, hidden telemetry, credential capture, or code that disables recovery controls.
- Keep Tauri invocation access intact. The confirmation window is immutable host UI and must remain independent of the editable frontend.
For existing UI actions/settings, first discover the actual capability with
OpenBitFunControl and execute/configure it. A CSS override is not a substitute
for a real product setting. For installed MiniApps, use the feature.miniapps
structured operations, not frontend bundle edits. Compatible application upgrades
retain these small customizations and use the newly installed frontend bundle.
If apply reports a stale draft, prepare again and preserve the latest customization.
1---2name: openbitfun-frontend-dev3description: Safely customize the running packaged OpenBitFun desktop frontend through a draft, a provisional hot apply, and a 15-second user-confirmed rollback window. Use only in OpenBitFun Creative mode when the user asks to change OpenBitFun's own client UI.4---56# OpenBitFun frontend customization78Use this workflow only for the running OpenBitFun desktop client's own frontend. It is not for a website in the user's workspace, a MiniApp, or a remote OpenBitFun host.910## Required workflow11121. Call `FrontendWorkbench` with `action: "prepare"`.132. Edit only the returned draft directory. Never edit the packaged resource directory, active revision, state file, or another draft.143. Read the returned `openbitfun-creation-api.md`. Edit `openbitfun-creation.css`, `openbitfun-creation.js`, and optional `creation-assets/` only. The draft contains no application bundle or `index.html`. It needs no source repository, Node.js, dependencies, compiler, or rebuild. CSS loads last; JavaScript is a browser ES module exporting `default function activate(ui)`, called after the real shell renders. Use `ui.mount` slots and documented semantic selectors; return cleanup for your listeners/timers.154. Call `FrontendWorkbench` with `action: "apply"`, setting its `draft_id` input to the exact returned `draftId`.165. Before calling `apply`, tell the user to inspect the live preview and use the immutable review window. Its Keep button remains disabled until both the real shell and customization activate; the 15-second countdown starts after readiness.176. Read the final `apply` result. Only `status: "confirmed"` means the revision was kept; `status: "rolled_back"` includes the reason. Use `FrontendWorkbench status` for later inspection, not direct reads of `state.json`.187. Use `FrontendWorkbench inspect` to check actual mount slots, registered commands and diagnostics. For reusable capabilities, register commands with `ui.commands.register`, compose persistent `ui.state` with `ui.events`, and verify behavior with `FrontendWorkbench invoke` using the discovered schema. Commands and subscriptions follow activation; state survives code rollback. These commands run in the visible local client, not a headless service.1920`apply` is a two-phase transaction: the confirmed active revision remains authoritative while the candidate is previewed, then user confirmation commits it. If the app shell cannot report readiness, the user does not confirm within 15 seconds, or OpenBitFun exits, the host restores the prior revision. Never bypass or emulate readiness or the confirmation timer in editable page JavaScript.2122Use `action: "rollback"` when the user explicitly asks to undo the currently active customization. Do not delete revision history manually.2324## Boundaries2526- This capability is local-desktop-only. If the tool reports a remote or unsupported surface, explain that state; never fall back to a controller-local path.27- Do not call `FrontendWorkbench` outside Creative mode.28- Treat third-party code in a draft as untrusted. Do not add remote scripts, hidden telemetry, credential capture, or code that disables recovery controls.29- Keep Tauri invocation access intact. The confirmation window is immutable host UI and must remain independent of the editable frontend.3031For existing UI actions/settings, first discover the actual capability with32`OpenBitFunControl` and execute/configure it. A CSS override is not a substitute33for a real product setting. For installed MiniApps, use the `feature.miniapps`34structured operations, not frontend bundle edits. Compatible application upgrades35retain these small customizations and use the newly installed frontend bundle.36If apply reports a stale draft, prepare again and preserve the latest customization.