pub fn resolve_config_value(
config: &str,
env_overlay: Option<&BTreeMap<String, String>>,
) -> Option<String>Expand description
Resolve a config value (API key, header value) that may be a shell command,
an env-var template, or a literal — mirroring pi’s resolveConfigValue.
!command→ run the rest as a shell command (sh -con Unix,cmd /Con Windows), return trimmed stdout (cached per process). Missing shell or non-zero exit ⇒None.$VAR/${VAR}templates: interpolate fromenv_overlay(winning) then the process env.$$→$,$!→!escapes. Any referenced var that is unset ⇒ the whole value resolves toNone(pi semantics).- Otherwise the literal string (returned as-is).
env_overlay is the credential.env map for auth.json keys (pi passes the
same). None (or an empty overlay) means process-env only — used for
models.json apiKey/headers, which have no env overlay.