{{.Guide.Guide.Group}}
{{.Title}}
{{with .Desc}}{{.}}
{{end}}{{.Guide.Guide.Group}}
{{.}}
{{end}}{{if .Ref.Builtin}}Built-in functions{{else}}Library{{end}}
{{.Title}}{{end}}{{.}}
{{end}}{{.Name}} | {{with .Ret}}{{.}}{{end}} | {{.Desc}} |
{{.Name}}{{with .Args}}{{.}}{{end}}
{{with .Ret}}{{.}}{{end}}
{{if eq $i 0}}{{range $.Badges}}{{.}}{{end}}#{{end}}
Also covers {{range $j, $n := .}}{{if $j}}, {{end}}{{$n}}{{end}}
{{.}}
{{end}}{{end}}{{.}}{{end}}
ArozOS Developers
AGI is the server-side JavaScript runtime of ArozOS. Your WebApp's scripts read and write the user's files, keep data, talk to other services and answer the page, all inside the user's permissions.
What AGI is, where scripts run, the globals they see and how paths and permissions work.
Read the introduction {{icon "arrow-right"}} {{icon "code"}}Every function of every library, with its signature, return value and an example you can run.
Browse the reference {{icon "arrow-right"}} {{icon "play"}}The real Otto interpreter in your browser, a virtual file system to upload to, and mock services for HTTP, LLM and CNN.
Try {{.Home.Samples}} samples {{icon "arrow-right"}}A WebApp's page calls its backend script with ao_module_agirun(). The script runs as the signed-in user and answers with sendResp or sendJSONResp.
// MyApp/backend.agi
requirelib("filelib");
var notes = filelib.readdir("user:/Documents");
var names = [];
for (var i = 0; i < notes.length; i++) {
if (!notes[i].IsDir) names.push(notes[i].Filename);
}
sendJSONResp({ user: USERNAME, files: names });
Always there, without requirelib().
Load one with requirelib("name") before using it.