Module path_resolver

Module path_resolver 

Source
Expand description

Path computation and resolution for dependency installation.

This module provides utilities for computing installation paths, resolving pattern paths, determining flatten behavior, and handling all path-related operations for resource dependencies. It supports both merge-target resources (Hooks, MCP servers) and regular file-based resources (Agents, Commands, Snippets, Scripts).

Functions§

compute_merge_target_install_path
Computes the installation path for a merge-target resource (Hook or McpServer).
compute_regular_resource_install_path
Computes the installation path for a regular resource (Agent, Command, Snippet, Script).
construct_full_relative_path
Constructs the full relative path for a matched pattern file.
extract_meaningful_path
Extracts the meaningful path by removing redundant directory prefixes.
extract_pattern_filename
Extracts the meaningful path for pattern matching.
get_flatten_behavior
Determines the flatten behavior for a resource installation.
is_file_relative_path
Checks if a path is a file-relative path (starts with “./” or “../”).
normalize_bare_filename
Normalizes a bare filename by removing directory components.
parse_pattern_base_path
Parses a pattern string to extract the base path and pattern components.
resolve_install_path
Resolves the installation path for any resource type.
resolve_merge_target_path
Resolves the installation path for merge-target resources (Hook, McpServer).
resolve_regular_resource_path
Resolves the installation path for regular file-based resources.