Identifies the kind and authorization of a project root.
Recursive project features accept only explicit directory roots. Broad roots such as the user's home directory, the filesystem root, and mounted-volume roots additionally require confirmation from the user flow that created the value. Directory paths are canonicalized so symlink aliases cannot bypass that boundary.
Summary
Types
Why a filesystem path could not be canonicalized.
Why a root cannot authorize recursive project behavior.
Why a workspace-relative file path could not be authorized.
The filesystem object represented by a root.
A project root with explicit kind and broad-root authorization.
Functions
Returns true when a path names a root whose recursive traversal needs explicit confirmation.
Returns the canonical target of an existing filesystem path.
Builds an explicit directory workspace root.
Builds a file-scoped root that cannot authorize recursive inventory.
Returns the authorized canonical path for recursive inventory.
Resolves an existing workspace-relative path inside an authorized directory root.
Types
@type canonical_error() :: File.posix() | :too_many_symlinks
Why a filesystem path could not be canonicalized.
@type error() ::
:not_a_directory
| :broad_root_confirmation_required
| :invalid_broad_root_confirmation
| :not_a_directory_root
| :root_changed
Why a root cannot authorize recursive project behavior.
@type file_error() :: error() | canonical_error() | :absolute_path | :parent_traversal | :outside_workspace
Why a workspace-relative file path could not be authorized.
@type kind() :: :file | :directory
The filesystem object represented by a root.
@type t() :: %Minga.Project.Root{ broad_root_confirmed?: boolean(), kind: kind(), path: String.t() }
A project root with explicit kind and broad-root authorization.
Functions
Returns true when a path names a root whose recursive traversal needs explicit confirmation.
@spec canonical_path(String.t()) :: {:ok, String.t()} | {:error, canonical_error()}
Returns the canonical target of an existing filesystem path.
Builds an explicit directory workspace root.
Builds a file-scoped root that cannot authorize recursive inventory.
Returns the authorized canonical path for recursive inventory.
@spec resolve_file(t(), String.t()) :: {:ok, String.t()} | {:error, file_error()}
Resolves an existing workspace-relative path inside an authorized directory root.