resolve_regular_resource_path

Function resolve_regular_resource_path 

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

Resolves the installation path for regular file-based resources.

Handles agents, commands, snippets, and scripts by:

  1. Getting the base artifact path from tool configuration
  2. Applying custom target overrides if specified
  3. Computing the relative path based on flatten behavior
  4. Avoiding redundant directory prefixes

§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 (Agent, Command, Snippet, Script)
  • source_filename - The filename/path from the source repository

§Returns

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

§Errors

Returns an error if the resource type is not supported by the specified tool.