src/cliCore/spawnEnv.ts
Build a sanitized environment bag for child processes.
Requirements addressed:
Provide a single helper (buildSpawnEnv) to normalize/dedupe child env.
Drop undefined values (exactOptional semantics).
On Windows, dedupe keys case-insensitively and prefer the last value,
preserving the latest key's casing. Ensure HOME fallback from USERPROFILE.
Normalize TMP/TEMP consistency when either is present.
On POSIX, keep keys as-is; when a temp dir key is present (TMPDIR/TMP/TEMP),
ensure TMPDIR exists for downstream consumers that expect it.
Adapter responsibility: pure mapping; no business logic.
src/cliCore/spawnEnv.ts Build a sanitized environment bag for child processes.
Requirements addressed:
Adapter responsibility: pure mapping; no business logic.