Inspect optional-dependency install status for the running distribution.
Reads Requires-Dist metadata to report which packages declared under
[project.optional-dependencies] are installed, and renders that status
in either plain text (for stdout) or markdown (for rich UI contexts).
Optional extras that add model-provider integrations.
Keep in sync with [project.optional-dependencies] in pyproject.toml.
Optional extras that add sandbox integrations.
Optional extras that don't fit the provider/sandbox taxonomy.
These integrations layer onto the main agent (e.g. a JS REPL via
langchain-quickjs) and aren't grouped under all-providers or
all-sandboxes.
Union of all individually-installable extras.
Excludes the composite meta-extras (all-providers, all-sandboxes) since
those expand to other extras and don't add anything on their own.
Drift-protected by test_model_config.TestProviderApiKeyEnv and the
model-provider-drift checks; new extras must be added to the corresponding
category frozenset above.
Mapping from extra name to (package, installed_version) tuples.
Only packages that are actually installed are included. Extras whose declared packages are all missing are omitted entirely.
Render the installable extras grouped by category as plain text.
Drives the no-argument /install slash-command help so users can
discover valid extras without consulting pyproject.toml. Sourced from
the category frozensets above, so it stays in sync with KNOWN_EXTRAS
automatically.
Return installed optional dependencies grouped by extra.
Reads Requires-Dist metadata from the named distribution, groups the
entries gated by extra == "..." markers under their extra name, and
resolves each package's installed version via importlib.metadata.
Packages that are not installed are omitted; extras whose entire
package list is absent are dropped.
Composite meta-extras that only bundle other extras (see
_COMPOSITE_EXTRAS) and self-references to the distribution itself
are skipped — their components already appear under their own extras.
Return extras with at least one installed dependency.
Return installed and missing optional dependencies grouped by extra.
Return the installable extra that declares a package.
Resolves recovery hints from the package that is actually missing
instead of guessing from a provider identifier. For example,
langchain-google-vertexai maps to the vertex extra even though the
provider id is google_vertexai.
Check that langchain-quickjs is installed for the --interpreter flag.
Uses importlib.util.find_spec for a lightweight check with no actual
imports. Call this in the app process before spawning the server
subprocess so users get a clear, actionable error instead of an opaque
server crash when the optional quickjs extra is not installed.
Returns silently when the package is importable.
Render an ExtrasStatus mapping as column-aligned plain text.
Suitable for stdout in non-interactive contexts (e.g. the --version
CLI flag) where a markdown renderer is unavailable.
Render an ExtrasStatus mapping as a markdown fragment.