Global Variables
cx
The context object containing the current application state. See Context API for details.
plugin
The current plugin’s module table (available in plugin context).
Global Functions
Err(format, ...)
Create a custom error with formatted message.
string
required
Format string (printf-style)
any
Format arguments
Error
Custom error object
Helper Functions (from ya.lua)
These utility functions are available globally via theya namespace:
ya.clamp(min, x, max)
Clamp a value between minimum and maximum.
number
required
Minimum value
number
required
Value to clamp
number
required
Maximum value
number
Clamped value
ya.list_merge(a, b)
Merge list b into list a (modifies a).
table
required
Target list
table
required
Source list
table
The modified list
aya.dict_merge(a, b)
Merge dictionary b into dictionary a (modifies a).
table
required
Target dictionary
table
required
Source dictionary
table
The modified dictionary
aya.readable_size(size)
Format byte size as human-readable string.
number
required
Size in bytes
string
Formatted size (e.g., “1.5M”, “3.2G”)
ya.readable_path(path)
Format path with ~ for home directory.
string
required
Absolute path
string
Path with
~ prefix if under home directoryya.child_at(pos, children)
Find the child element at the given position.
table
required
Position
{x, y} or Pos objecttable
required
List of child elements with
_area fieldtable|nil
The child element at the position, or nil
Environment Variables
Access environment variables using Lua’sos.getenv():