Function: decideBrowserAction()
decideBrowserAction(
args,config?,env?,platform?):BrowserAction
Defined in: packages/aiui-util/src/browser.ts:334
Decide the browser sidecar's move — pure (env and platform are parameters) so every rung is unit-testable. The ladder, most explicit first, mirrors the aiui CLI's flag-beats-config ordering:
- Suppress flag → skip, silently. The user said no for this run.
- Force flag → open, even under CI or over SSH — the force flag exists precisely to overrule the defaults (e.g. the dev box is "headless" but its display is a forwarded port away).
- A
browserUrl(the--aiui-browser-urlflag) → open. The browser deliberately lives elsewhere (typically the user's local machine, reverse-tunneled —aiui remote), so this machine being headless is irrelevant: opening a tab there is exactly the point of the setup. - CI or headless (see ./environment) → don't launch a browser nobody can see; hand back the reason so the caller can print the port-forwarding hint instead.
- Otherwise → open.
(The old chrome.enabled: false config rung retired with the browser-profiles redesign — opting out is flag-only now.)
Parameters
args
config?
env?
ProcessEnv = process.env
platform?
Platform = process.platform