pub struct AgentInstaller { /* private fields */ }Expand description
Installs agents from .leviath-bundle packages.
Implementations§
Source§impl AgentInstaller
impl AgentInstaller
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new installer using the default installation directory.
The install root comes from the shared LEVIATH_HOME-aware resolver
in leviath_core::paths, so this crate installs into exactly the
tree every other component reads.
Sourcepub fn with_install_dir(install_dir: PathBuf) -> Self
pub fn with_install_dir(install_dir: PathBuf) -> Self
Create an installer with a custom installation directory.
Sourcepub fn install(&self, package_path: &Path) -> Result<InstalledAgent>
pub fn install(&self, package_path: &Path) -> Result<InstalledAgent>
Install an agent from a .leviath-bundle file.
Sourcepub fn install_from_bytes(
&self,
name: &str,
data: &[u8],
) -> Result<InstalledAgent>
pub fn install_from_bytes( &self, name: &str, data: &[u8], ) -> Result<InstalledAgent>
Install an agent from in-memory bytes.
name becomes a directory under the install dir, so it must be a single
safe path component. install derives it from file_stem() (which
already strips directories), but this is pub and any future caller
passing a downloaded or user-supplied name would otherwise get a
traversal for free - Path::join does not normalize, and an absolute
name replaces the base entirely.
Sourcepub fn uninstall(&self, agent_name: &str) -> Result<()>
pub fn uninstall(&self, agent_name: &str) -> Result<()>
Uninstall an agent by removing its directory.
Sourcepub fn list_installed(&self) -> Result<Vec<InstalledAgent>>
pub fn list_installed(&self) -> Result<Vec<InstalledAgent>>
List all installed agents.
Sourcepub fn get_installed(&self, name: &str) -> Result<Option<InstalledAgent>>
pub fn get_installed(&self, name: &str) -> Result<Option<InstalledAgent>>
Get information about a specific installed agent.