App plugin
appPlugin turns the process into an app host. It contributes service id app and mounts / plus /api/app.
import { appPlugin } from '@buildautomaton/plugins';
appPlugin({ runtime, options: { staticRoot } })
Local CLI loads this in app mode. It serves the UI in production, or lets Vite own the page in dev.
On Cloudflare, serve static UI with Workers Assets and keep API paths on the Worker. You do not need this plugin there unless you want the same /api/app state machine.