resolve_install_path

Function resolve_install_path 

Source
pub fn resolve_install_path(
    manifest: &Manifest,
    dep: &ResourceDependency,
    artifact_type: &str,
    resource_type: ResourceType,
    source_filename: &str,
) -> Result<String>
Expand description

Resolves the installation path for any resource type.

This is the main entry point for computing where a resource will be installed. It handles both merge-target resources (Hooks, MCP servers) and regular resources (Agents, Commands, Snippets, Scripts).

§Arguments

  • manifest - The project manifest containing tool configurations
  • dep - The resource dependency specification
  • artifact_type - The tool name (e.g., “claude-code”, “opencode”)
  • resource_type - The resource type
  • source_filename - The filename/path from the source repository

§Returns

The normalized installation path, or an error if the resource type is not supported by the specified tool.

§Errors

Returns an error if:

  • The resource type is not supported by the specified tool

§Examples

use agpm_cli::core::ResourceType;
use agpm_cli::manifest::Manifest;
use agpm_cli::resolver::path_resolver::resolve_install_path;

let manifest = Manifest::new();
let path = resolve_install_path(
    &manifest,
    &dep,
    "claude-code",
    ResourceType::Agent,
    "agents/helper.md"
)?;