Skip to main content Module paths Copy item path Source PathScope Enumeration describing the conceptual scope of a file path. PathResolver Helper trait that adds path resolution helpers on top of WorkspacePaths . WorkspacePaths Provides the root directories an application uses to store data. canonicalize_allow_missing Canonicalize a path, walking up to find the nearest existing ancestor for new files. canonicalize_workspace Canonicalize a path with fallback to the original path if canonicalization fails. ensure_path_within_workspace Ensure a candidate path is inside the workspace root after lexical
normalization. file_name_from_path Extract the filename from a path, with fallback to the full path. is_safe_relative_path Check if a path string is a safe relative path (no traversal, no absolute). normalize_ascii_identifier Normalize identifiers to ASCII alphanumerics with lowercase output. normalize_path Normalize a path by resolving . and .. components lexically. resolve_workspace_path Resolve a path relative to a workspace root and ensure it stays within it. secure_path Return a canonicalised absolute path that is guaranteed to reside inside the
provided workspace_root. If the path is outside the workspace an error is
returned. validate_path_safety Validates that a path is safe to use.
Preventing traversal, absolute system paths, and dangerous characters.