Skip to main content

Module pack_env

Module pack_env 

Source
Expand description

{pack_dir:@ns/name} expansion for an addon’s [mcp.env] (GH #727).

An addon that ships its content in a kind=skills pack must learn where that pack was materialized. The author names the variable and states which pack it refers to; lean-ctx expands the placeholder at wiring time against the resolved dependency version:

[mcp.env]
LEAN_MD_SKILLS_DIR = "{pack_dir:@dasTholo/lean-md-skills}"

Pure by construction: the store root is a parameter, never read from the environment here, so the expansion is a deterministic function of (declared env, resolved deps, store root).

No env-scrub change is required. super::env_scrub::apply_env applies the declared env after env_clear(), so an expanded value reaches the child without an allowlist entry — lean-ctx computed this value, it is not a host variable smuggled through.

Functions§

expand_pack_env
Expand every {pack_dir:@ns/name} in declared_env against resolved.
referenced_packs
Every pack name referenced by a {pack_dir:…} placeholder in value.