title: Runtime globals group: Getting started order: 20
BUILD_VERSIONINTERNAL_VERSIONLOADED_MODULESLOADED_STORAGES__FILE__HTTP_RESPHTTP_HEADERUSERNAMEUSERICONUSERQUOTA_TOTALUSERQUOTA_USEDUSER_VROOTSUSER_MODULESexecd child)BUILD_VERSION: Current system build versionINTERNAL_VERSION: Internal version numberLOADED_MODULES: Array of loaded system modulesLOADED_STORAGES: Array of available storage pools__FILE__: Current script file pathHTTP_RESP: Response content (automatically set)HTTP_HEADER: Response content type (automatically set)USERNAME: Current user's usernameUSERICON: Current user's icon pathUSERQUOTA_TOTAL: User's total storage quotaUSERQUOTA_USED: User's used storage quotaUSER_VROOTS: User's accessible virtual root pathsUSER_MODULES: User's accessible modulesEXECUTION_ID: UUIDv4 that uniquely identifies this script invocation — useful for correlating log lines across concurrent executionsPARENT_DETACHED (true)PARENT_PAYLOAD (string payload)How a script reads the request that started it depends on how it was called.
ao_module_agirun, /system/ajgi/interface): every
form field of the request becomes a global variable of the same name. A
JSON request body sets one global per top-level field instead, plus
POST_data holding the raw body.REQ_METHOD holds the HTTP method,
getPara(key) and postPara(key) return a query or form value (or null),
and readBody() returns the raw request body.// Called as ao_module_agirun("MyApp/backend.agi", {name: "Alice"}, ...)
if (typeof(name) == "undefined") {
sendResp("missing name");
} else {
sendJSONResp({ greeting: "Hello " + name });
}