diff options
| author | Igor Soarez <igor@soarez.org> | 2026-07-28 22:08:44 +0100 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-10-14 12:17:59 +0100 |
| commit | 95ff5e8eaefb35d79109f7ddfa1de5bf45a8daff (patch) | |
| tree | 397c6cde867cb5028fcc5d00c1eb84d8a949da50 /scripts | |
| parent | bfb533fc9a829819b9dd425607101d40c676d45c (diff) | |
feat(cdp): default to the shared browser, and say so in /browser-status
Two follow-ups to BU_CDP_HTTP.
Default the endpoint. The remote host is now a built-in default
(DEFAULT_REMOTE_CDP), so nothing has to export BU_CDP_HTTP just to get the
usual setup. The variable becomes an override rather than a requirement.
Precedence is deliberately asymmetric, in src/cdp/endpoint.ts:
BU_CDP_HTTP=host:port that endpoint; unreachable is a hard error
BU_CDP_HTTP=local|off upstream behaviour, this machine's own browser
unset the default, falling back to local when unreachable
An explicitly configured endpoint is an instruction, so failing to reach it must
not quietly automate a different browser - that would drive the operator's own
signed-in Chrome instead of the shared one. The built-in default is only a
preference, so a laptop away from the network still gets the local browser the
extension was originally written for.
Resolution is pure, with no I/O, so the status command can report the
configured intent without touching the network and the daemon can resolve the
same way in its own process.
/browser-status no longer reports a bare "Disconnected". The connection is lazy
- nothing dials the browser until the first browser_* tool runs - so a fresh
session always showed a red light that reads as a fault. It now distinguishes
"not connected yet, connects on first use" from "target unreachable", and names
the target with a reachability check, so the common confusion answers itself.
26 tests for the resolution table, covering the aliases, malformed values that
must be rejected rather than coerced, and that the default constant is itself
well-formed - if it ever stopped parsing, every machine would silently fall
back to local.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
