smelt.os¶
Tier: Host - Available in every runtime, including headless mode.
Classification: Supported - Primary alpha facade for user config and plugins.
Environment and system primitives: getenv, setenv, platform, cwd, pid, etc.
smelt.os.arch¶
Return the target CPU architecture as reported by std::env::consts::ARCH (e.g. "x86_64", "aarch64").
smelt.os.cwd¶
Return the current working directory as (path, nil), or (nil, err_string) on failure.
smelt.os.exe_path¶
Return the filesystem path to the running smelt binary as (path, nil) on success, or (nil, err_string) on failure. Useful for plugins that re-exec the binary or report install location.
smelt.os.getenv¶
Return the value of the environment variable name, or nil if it is not set.
smelt.os.home¶
Return the runtime home directory.
smelt.os.open_url¶
Open url in the system's default browser. Only http(s)://, mailto:, and file:// URLs are accepted. Returns (true, nil) on a successful spawn, or (false, err_string) if the scheme is rejected or every launcher errored.
smelt.os.open_url_if_available¶
Open url only when the host environment can auto-open a browser. Returns { opened = bool, error = string?, reason = string? }.
smelt.os.pid¶
Return the runtime process id.
smelt.os.platform¶
Return the target operating system as reported by std::env::consts::OS (e.g. "macos", "linux").
smelt.os.setenv¶
Set the process environment variable name to value. Mutates the live process env; visible to subsequent getenv calls and child processes.
smelt.os.tempdir¶
Return the platform temporary directory path.
smelt.os.unsetenv¶
Remove the environment variable name from the process environment.