refactor(host): read host settings from HostEnvironment in root src and remaining packages

Merged
TH
3h ago
+664-279

Summary

Part of #3751 (umbrella #3747). Configuration reads in root src/**, packages/remote and provider-webdriver take the host explicitly instead of reading process.env/process.cwd(): CLI command handlers (new host param, set once per run in cli.ts), option/binding/auth resolvers, the connection profile chain, remote artifact preparation and materialization (threaded through the daemon-client transport), and the platform runtime gateway, inventory gateways, diagnostics, toolchain and deployment hosts. Released entries keep their process default in a wrapper: resolveRemoteConfigProfile, createLocalArtifactAdapter.

Behavior note: a relative --provider-app path on a request with no cwd now fails with provider_app_cwd_missing; the base fills the lease cwd from the host.

Remaining, handed to owners

  1. #3772: session-journal cap, device-selection env, replay-port/maestro/ad-script replay env and cwd.
  2. #3750 / #3777: adb port environment (platform-runtime-android-adb-host.ts), app-log output and process env, platform-* packages.
  3. Plugin v2 stack: provider-device-runtimes.ts, provider-credential-fingerprint.ts, cli/connection/provider-policy.ts, plugins/*.
  4. #3763: update-check.ts, replay-test reporters and progress, color.ts, diff.ts, commands/replay/index.ts, doctorCliOutput, plugins.ts, cli-config.ts (the MCP caller must pass env first).

Validation

check:affected --run green at 8eff3d9ad6, rebased on 916db0b9a4. Root src keeps 5 commandHostEnvironment() reads (4 command execution, 1 doctor output colour); 23 branch-wide against 56 on the base. Live run at an earlier head: real daemon, macOS open/snapshot/close, plugins list, Android doctor.