pub fn read_pin(
package: &str,
toolsets_root: &Path,
) -> Result<Option<ToolsetPinRecord>, ToolsetInstallError>Expand description
Re-export stellar_agent_toolsets_install::read_pin as a crate-level
convenience so MCP/CLI consumers can read pins without adding a direct dep
on stellar-agent-toolsets-install.
Reads and parses the pin record for package from toolsets_root.
Validates package against the [a-z0-9-] charset BEFORE constructing
any filesystem path: a package value containing /, \, ., .., or
any character outside [a-z0-9-] is rejected immediately with
ToolsetInstallError::InvalidPackageName and produces NO filesystem path
join.
Returns None if the pin file does not exist (toolset not installed).
ยงErrors
ToolsetInstallError::InvalidPackageNameโpackagefails the[a-z0-9-]charset validation.ToolsetInstallError::PinRecordMalformedโ pin file exists but cannot be parsed or contains an invalid package name.ToolsetInstallError::Ioโ unexpected I/O error (not NotFound).