Skip to main content

Module context

Module context 

Source
Expand description

Injectable ambient-environment access for credential resolution.

Ported from pi-mono packages/ai/src/auth/context.ts and the AuthContext interface in packages/ai/src/auth/types.ts (MIT, Copyright (c) 2025 Mario Zechner — full notice in the parent module).

pi’s motivation applies here unchanged: resolution that reads process.env / std::env directly is untestable without mutating the real process. Every ambient read the resolver performs itself goes through this trait, so a test can state exactly which variables exist. Resolution never stats the filesystem (#5772): external credential discovery is metadata-only, so the trait deliberately has no file probe.

Structs§

ProcessAuthContext
The real process environment.

Traits§

AuthContext
Ambient environment access for credential resolution.