pub fn compute_regular_resource_install_path(
manifest: &Manifest,
dep: &ResourceDependency,
artifact_type: &str,
resource_type: ResourceType,
filename: &str,
) -> Result<String>Expand description
Computes the installation path for a regular resource (Agent, Command, Snippet, Script).
Regular resources are installed as files in tool-specific directories. This function determines the final installation path by:
- Getting the base artifact path from tool configuration
- Applying any custom target override from the dependency
- Computing the relative path based on flatten behavior
- Avoiding redundant directory prefixes
§Arguments
manifest- The project manifest containing tool configurationsdep- The resource dependency specificationartifact_type- The tool name (e.g., “claude-code”, “opencode”)resource_type- The resource type (Agent, Command, etc.)filename- The meaningful path structure extracted from the source file
§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::compute_regular_resource_install_path;
let manifest = Manifest::new();
let path = compute_regular_resource_install_path(
&manifest,
&dep,
"claude-code",
ResourceType::Agent,
"agents/helper.md"
)?;