smelt.path¶
Tier: Host - Available in every runtime, including headless mode.
Visibility: Public - Stable Lua API intended for user config and plugins.
Pure path arithmetic: normalize, join, relative, expand, display, etc.
smelt.path.basename¶
Return the final component (file name) of p, or nil if p ends in ...
smelt.path.canonical¶
Resolve p to its canonical absolute form (following symlinks). Returns (path, nil) on success or (nil, err_string) on failure.
smelt.path.commands_dir¶
Return the absolute path to the slash-commands directory under the user config root.
smelt.path.config_dir¶
Return the absolute path to smelt's user config directory.
smelt.path.display¶
Return a user-friendly rendering of p for UI display (e.g. with the home dir abbreviated to ~).
smelt.path.display_streaming¶
Return a user-friendly rendering of a possibly partial path for streaming tool summaries. Absolute paths that may still collapse to the current working directory or home directory return an empty string until enough path has arrived.
smelt.path.expand¶
Expand config-path syntax in p: leading ~, $VAR, and ${VAR}. Does not invoke a shell, expand globs, or canonicalize symlinks.
smelt.path.extension¶
Return the file extension of p (without the leading dot), or nil if there is none.
smelt.path.is_absolute¶
Return true if p is an absolute path on the current platform.
smelt.path.join¶
Join the variadic parts into a single path using the platform separator.
smelt.path.normalize¶
Normalize p by collapsing redundant ., .., and separator components without touching the filesystem.
smelt.path.parent¶
Return the parent directory of p, or nil if p has no parent component.
smelt.path.relative¶
Return the path of target expressed relative to base.