pub struct ProductionContext { /* private fields */ }Expand description
Owns the production gateway implementations and the resolved paths.
Constructed once per process via from_env and kept alive
for the duration of the call — the AppContext it vends borrows from it.
Implementations§
Source§impl ProductionContext
impl ProductionContext
Sourcepub fn claude() -> Result<Self>
pub fn claude() -> Result<Self>
Build a production context bound to the Claude platform.
This is the one-call default for tools that target Claude Code. It is
equivalent to from_env(Platform::Claude).
The platform binding determines which lock file and install directory are used as the default for path resolution. It does not determine which platforms a skill installs to — installation targets are resolved from the cmx config and existing lock files at plan time.
Sourcepub fn from_env(default_platform: Platform) -> Result<Self>
pub fn from_env(default_platform: Platform) -> Result<Self>
Build a production context from the real environment for the given platform binding.
default_platform controls the default lock file name and install
directory used for path resolution (e.g. which cmx-lock*.json file is
the primary one). It does not set the config root directory — that is
always $HOME/.config/context-mixer — and it does not determine
which platforms a skill installs to. Installation targets come from
the plan (resolved from the cmx config and existing lock files).
For Claude Code tools, prefer claude() over calling
this directly.
Sourcepub fn ctx(&self) -> AppContext<'_>
pub fn ctx(&self) -> AppContext<'_>
Borrow an AppContext for a single library call.
The returned context does not include an LLM client — embedding tools do not need LLM-powered analysis.