The Powerhouse desktop shell: a Tauri app that supervises a Powerhouse
project's stack (ph run desktop, uniform-runners) and windows Connect once
the stack answers. One Cargo workspace, two crates:
crates/ph-desktop-shell— the shell as a LIBRARY: supervision, the bundled-stack (resources/stack+shell.json) packaged-app path, readiness probe, tray,.phdlaunch queue, diagnostics log. No identity.apps/powerhouse-desktop— the Powerhouse-identity app: a three-linemain.rsplustauri.conf.json(productName, identifier, icons, file associations). Every builder shell generated byph generate desktop-shellhas exactly this shape with the builder's own identity.
Before pushing, run the CI gate locally — ci.yml runs exactly this script, so green here means green there:
node scripts/check.mjsnode scripts/fetch-node.mjs apps/powerhouse-desktop # sidecar node, once
cargo build -p powerhouse-desktop # debug exe
cargo tauri build # NSIS installer (in apps/powerhouse-desktop)The webview opens ui/index.html (a loading page) and navigates to the
supervised stack's Connect once its port answers. Mode resolution: PH_RUN_*
env (dev flows, wired by @powerhousedao/desktop's runner) → bundled
resources/stack (the packaged app) → legacy sidecar if present → a logged
"nothing to supervise".
Diagnostics land in the app log dir (ph-win.log); PH_WIN_DEVTOOLS=1
opens the webview devtools at startup.
An app opts in by carrying plugins.updater in its tauri.conf.json: a
release feed and the public key its releases are signed with (ph generate desktop-shell projects app.json's updates there). Without it the updater is
not loaded and nothing changes.
With it the shell asks the feed 20 seconds after start and every four hours. A
newer version drops a notice into the window (update-notice.js, injected into
every page, so no app has to draw it): Update now downloads the release,
checks its signature, installs it (the setup program on Windows, the bundle on
macOS, the AppImage, .deb or .rpm on Linux), stops the stack and starts the new
version. A step that fails leaves the running app as it was and says so in the
notice; a check that fails is only logged.
A page can read the same state and draw the notice itself:
window.phDesktop.update has state(), check(), install(),
subscribe(fn) and takeOver(). The commands behind it (update_state,
update_check, update_install) need a grant in capabilities/ like the
others; an app without updates answers enabled: false.
On Windows the setup program ends the app, and the stack is stopped first. On macOS and Linux the files are replaced under the running app and the stack is stopped right after, before the restart.
For a test run, PH_UPDATE_FIRST_CHECK_SECS and PH_UPDATE_CHECK_EVERY_SECS
move the checks, and PH_UPDATE_AUTO_INSTALL=1 installs what a check finds
without the asking.