Repository navigation
Description
The workflow
We ship bb as a downstream distribution: a thin launcher pins bb-app as an npm dependency, applies our default settings, and adds our own plugins. Our users want a normal Mac app for it — dock icon, native window, the desktop bridge's file/terminal/browser integrations — the same experience bb.app gives upstream users.
What happens today
The stock bb.app almost works for this: its whole UI is served by whichever server it targets, and Window → Server → Set Server URL… lets us point it at our server. We automate that by writing server-target.json in the app's user-data directory (the same file the menu writes) and then open -a bb. Verified on desktop 0.41.0 against a bb-app 0.42.1 server: the window loads our server's UI, projects, and providers.
What we cannot do:
- Stop the builtin runtime. Even when
target: "custom", the shell still spawns its bundledbb-appserver on 38886 ("This Mac"), with upstream defaults (telemetry, Connect) and a separate~/.bbdata dir. For a distribution whose entire point is different defaults, that is an unwanted second server on every laptop.applyServerTargetonly skipsensureBuiltinRuntimeAttachedfor the current target; nothing lets a deployment declare "never own a runtime". - Set the default server without touching user data.
resolveDesktopServerUrlreadsBB_SERVER_PORTfor the builtin target only; there is no env/config for "default to this custom URL on first launch". Writingserver-target.jsonfrom outside works but relies on an undocumented file format. - Rebuild it under another name.
apps/desktopbuildsbb-appfrom the pnpm workspace (prepare-runtime→ turbo), hardcodes product name / appId / update feed, andelectron-builder.config.jsonis not a published package input. There is no way to produce<Ours>.appthat bundles a givenbb-apptarball plus our launcher, without forking the monorepo. - Point auto-update elsewhere.
BB_DESKTOP_VERSION_FEED_URLexists at runtime but the packaged app's feed is baked in at build time and a downstream cannot disable the updater for its own artifact.
Code refs (main @ 6cdb4ba):
apps/desktop/src/server-target.ts— persisted target store (builtin | connect | custom)apps/desktop/src/main.ts—resolveDesktopServerUrl,applyServerTarget,startOwnedRuntimeapps/desktop/package.json—prepare-runtime,package,distscripts
What you would expect
Two tiers; either alone is useful.
Tier 1 — runtime configuration of the stock app (small):
BB_DESKTOP_DEFAULT_SERVER_URL: when noserver-target.jsonexists, seed{ target: "custom", customServerUrl }from it.BB_DESKTOP_BUILTIN_RUNTIME=off(or adesktop-config.jsonnext to the app): never spawn the bundled server; hide "This Mac" from the Server menu; show the startup-error page if the custom target is unreachable.- Document
server-target.jsonas a stable, supported surface (it already has a zod schema).
Tier 2 — packaging for downstreams (larger, happy to discuss shape first):
- Publish the desktop shell as a build input (e.g.
@bb/desktop-shell) that takes: abb-apptarball or an alternate launcher entrypoint for the owned runtime,productName/appId/ icon, default server URL, builtin-runtime on/off, and an update feed URL ornone.electron-builderconfig generated from that, signing left to the consumer'sCSC_*env exactly as today.
Context and alternatives
- Workaround today: a
<launcher> desktopsubcommand that writesserver-target.jsonand opens the stock app, plus a README caveat about the stray 38886 server and the bb branding. Works, but depends on an undocumented file and leaves the second server running. - Writing our own Electron wrapper loses the desktop bridge (file opener, terminal, browser tabs) and duplicates
apps/desktop— a fork in all but name. - Not a duplicate of Support multiple desktop servers and remote machine handoff #1451 (multiple servers / remote handoff): that is about adding servers for one user; this is about a distribution choosing the default and removing the builtin one.
- Related: Make the bb-app self-update check and upgrade command configurable for downstream distributions #3167 (configurable self-update check) covers the server-side row; this covers the Electron shell.
- Affects anyone packaging bb for an organization: Homebrew cask maintainers, corporate IT distributions, or teams that run bb only against a remote dev box.
Checks
- I searched open and closed issues for the same request.
- If an agent wrote this, the body ends with
> AGENT GENERATED.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 6, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification applied:
desktopNo bug report or pull request: the repository Type is Feature, so this rule stops after triage.