# Aura stdlib surface — the single source of truth for editor completion/hover.
#
# The language server EVALUATES this file with aura-lang at startup (dogfooding:
# Aura configuring its own tooling) to build its completion database. A test
# checks these method names against the real method registry so the two cannot
# drift. Grouped by receiver type; `builtins` are global functions.
String:
upper:
params: []
returns: "String"
doc: "Uppercase every character."
end
lower:
params: []
returns: "String"
doc: "Lowercase every character."
end
len:
params: []
returns: "Int"
doc: "Number of characters."
end
trim:
params: []
returns: "String"
doc: "Remove leading and trailing whitespace."
end
split:
params: ["sep"]
returns: "List"
doc: "Split on a non-empty separator into a list of strings."
end
replace:
params: ["from", "to"]
returns: "String"
doc: "Replace every occurrence of a substring."
end
starts_with:
params: ["prefix"]
returns: "Bool"
doc: "True if the string begins with the prefix."
end
ends_with:
params: ["suffix"]
returns: "Bool"
doc: "True if the string ends with the suffix."
end
contains:
params: ["substr"]
returns: "Bool"
doc: "True if the substring occurs anywhere."
end
to_int:
params: []
returns: "Int"
doc: "Parse an integer (E0314 on failure)."
end
to_float:
params: []
returns: "Float"
doc: "Parse a float (E0314 on failure)."
end
to_str:
params: []
returns: "String"
doc: "The string itself (universal to_str)."
end
parse_json:
params: []
returns: "Object"
doc: "Parse a JSON document into a value."
end
parse_yaml:
params: []
returns: "Object"
doc: "Parse a YAML document into a value."
end
parse_toml:
params: []
returns: "Object"
doc: "Parse a TOML document into a value."
end
parse_duration:
params: []
returns: "Int"
doc: "Duration string (d/h/m/s) to seconds; E0319 on error."
end
parse_datetime:
params: []
returns: "Int"
doc: "RFC3339 timestamp to epoch seconds UTC; E0320 on error."
end
sha256:
params: []
returns: "String"
doc: "SHA-256 digest as lowercase hex (config checksums)."
end
base64:
params: []
returns: "String"
doc: "Standard base64 with padding (e.g. Kubernetes Secret data)."
end
base64_decode:
params: []
returns: "String"
doc: "Decode standard base64 to a String; E0321 if invalid."
end
end
Int:
abs:
params: []
returns: "Int"
doc: "Absolute value."
end
to_str:
params: []
returns: "String"
doc: "Decimal string form."
end
format_duration:
params: []
returns: "String"
doc: "Seconds to a duration string (d/h/m/s)."
end
format_datetime:
params: []
returns: "String"
doc: "Epoch seconds to an RFC3339 UTC timestamp."
end
end
Float:
abs:
params: []
returns: "Float"
doc: "Absolute value."
end
to_str:
params: []
returns: "String"
doc: "Decimal string form."
end
end
Bool:
to_str:
params: []
returns: "String"
doc: "\"true\" or \"false\"."
end
end
List:
len:
params: []
returns: "Int"
doc: "Number of elements."
end
first:
params: []
returns: "Any"
doc: "First element (E0317 if empty)."
end
last:
params: []
returns: "Any"
doc: "Last element (E0317 if empty)."
end
get:
params: ["index"]
returns: "Any"
doc: "Element at an Int index, or a default via .get(i, default)."
end
contains:
params: ["item"]
returns: "Bool"
doc: "True if the element is present."
end
compact:
params: []
returns: "List"
doc: "Drop null elements."
end
uniq:
params: []
returns: "List"
doc: "Remove duplicates, keeping first occurrence."
end
map:
params: ["fn"]
returns: "List"
doc: "Apply (element, index) -> value to each element."
end
filter:
params: ["fn"]
returns: "List"
doc: "Keep elements where (element, index) -> Bool is true."
end
join:
params: ["sep"]
returns: "String"
doc: "Join scalar elements with a separator."
end
sort:
params: []
returns: "List"
doc: "Ascending sort of mutually-comparable scalars."
end
reverse:
params: []
returns: "List"
doc: "Elements in reverse order."
end
sum:
params: []
returns: "Int"
doc: "Sum of numbers (Float if any Float)."
end
min:
params: []
returns: "Any"
doc: "Smallest element (E0317 if empty)."
end
max:
params: []
returns: "Any"
doc: "Largest element (E0317 if empty)."
end
flatten:
params: []
returns: "List"
doc: "Spread one level of nested lists."
end
slice:
params: ["start", "end"]
returns: "List"
doc: "Half-open sub-list; indices are clamped."
end
to_json:
params: []
returns: "String"
doc: "Serialize to a JSON string."
end
to_yaml:
params: []
returns: "String"
doc: "Serialize to a YAML string."
end
to_toml:
params: []
returns: "String"
doc: "Serialize to a TOML string."
end
end
Object:
len:
params: []
returns: "Int"
doc: "Number of keys."
end
keys:
params: []
returns: "List"
doc: "Keys in declaration order."
end
values:
params: []
returns: "List"
doc: "Values in declaration order."
end
contains:
params: ["key"]
returns: "Bool"
doc: "True if the key is present."
end
get:
params: ["key", "default"]
returns: "Any"
doc: "Value for a key, or a default if absent."
end
merge:
params: ["other"]
returns: "Object"
doc: "Shallow merge; the argument wins on key conflicts."
end
to_json:
params: []
returns: "String"
doc: "Serialize to a JSON string."
end
to_yaml:
params: []
returns: "String"
doc: "Serialize to a YAML string."
end
to_toml:
params: []
returns: "String"
doc: "Serialize to a TOML string."
end
end
builtins:
range:
params: ["n"]
returns: "List"
doc: "The list [0, 1, ..., n-1]."
end
env:
params: ["name", "default"]
returns: "String"
doc: "Environment variable value or a default (needs --allow-env)."
end
read_file:
params: ["path"]
returns: "String"
doc: "File contents as a string (needs --allow-read)."
end
fail:
params: ["message"]
returns: "Any"
doc: "Abort evaluation with a message (E0530)."
end
end