refactor(platforms): read host settings from HostEnvironment in platform and capture packages

Merged
TH
32s ago
+1390-596

Summary

Platform and capture packages read the host's environment and working directory from a HostEnvironment instead of process. No behavior change. Closes #3750 (part of #3747; stacked on #3763). 92 files, mostly tests.

  • react-native, provision-kit, maestro: the host or environment is a parameter. Released agent-device/metro binds the process host at its boundary; the client passes its own.
  • Android and Apple install artifacts take environment from their caller (the root deployment executors pass the command host's), so a host whose env differs from the process's gets its own proxy settings.
  • Apple runner reads through its host port (hostEnvironment, R77 intact); detached children get an explicit env and cwd. resolveRunnerContainerBundleIds(env) replaces the import-time constant.
  • capture-kit takes the host for the Swift cache and recording paths; cached helper paths are keyed per cache root and directory. The PNG worker starts with an empty env and reports unavailability in the first diagnostics scope that sees it.
  • The app-log marker takes the request host's env.

Still ambient commandHostEnvironment(): root seams (app-log output, deployment executors, recording finalizer, Android recording, contact sheet, runner bundle-id check) and Apple screenshot, file copy and snapshot-bridge spawn.

Validation

pnpm check:affected --run --head f0b20fae1b: passed, exactCommit: true; CI green at that head.

Device (earlier head): Android emulator and iOS 27.0 simulator passed runner snapshot, screenshot, PNG-worker diff, recording overlay, and app log. Not rerun since; runner detach/adopt across a daemon restart not run.

🤖 Generated with Claude Code