WSL agent launch previously wrapped the command in a nested
`sh -c "<baked string>"` construction. In some environments (e.g. RHEL8)
this fails before ACP connects (the process exits 1), and command
paths/args with spaces broke because the command was interpolated
unescaped.
Launch agents instead with:
wsl.exe [--exec] /bin/sh -c '<constant launcher>' sh <pathDir> <cwd> <command> <args...>
This skips wsl's default-shell layer (--exec), runs under the user's
login shell so ~/.profile is sourced (environment preserved, unlike a
bare --exec), and passes command/args as argv (no quoting of user data).
Also forward configured env vars (API keys, custom agent env, tool env)
into WSL via WSLENV (buildWslEnv), so the plugin's API key field works in
WSL mode without requiring keys in ~/.profile. Defensive: skips empty
values and invalid names, merges existing WSLENV, never throws.
Add a vitest unit-test suite for the platform WSL helpers (39 cases,
incl. exact argv-ordering checks), with an obsidian stub alias and a
dedicated tsconfig for typed linting of tests.
Builds on #304 (direct WSL exec for absolute-path commands); this retains
the environment that a bare --exec would drop and also fixes paths/args
with spaces.
Terminal launch keeps the existing wrapper for now (env forwarding is
applied); a terminal-specific hybrid follows separately.