* Construct a fresh `LocalKaos` after probing the host environment. * * Each call returns a new instance with its own `_cwd`; concurrent * callers can therefore operate on independent working directories * without polluting one another.
()
| 213 | * without polluting one another. |
| 214 | */ |
| 215 | static async create(): Promise<LocalKaos> { |
| 216 | // Enrich process.env.PATH from the user's login shell so spawned |
| 217 | // commands find user-installed tools (e.g. Homebrew's gh) even when |
| 218 | // kimi-code itself was launched without the full profile PATH. Both |
| 219 | // probes are memoised, independent, and run concurrently. |
| 220 | const [osEnv] = await Promise.all([detectEnvironmentFromNode(), applyLoginShellPathFromNode()]); |
| 221 | return new LocalKaos(osEnv); |
| 222 | } |
| 223 | |
| 224 | withCwd(cwd: string): LocalKaos { |
| 225 | return new LocalKaos(this.osEnv, cwd, this._envLayers); |
nothing calls this directly
no test coverage detected