The lib
@aicore-fivem/lib - the helpers every ai-* script is built from, and ai-lib for Lua.
@aicore-fivem/lib replaces ox_lib in AI Core: everything scripts would write by hand lives here, built for scale and checked with benchmarks. TypeScript resources import it (@aicore-fivem/lib/client, /server, /shared); Lua resources load it from ai-lib (shared_script '@ai-lib/init.lua', then aiLib.<name>), JavaScript resources without a bundler load @ai-lib/dist/client.js / server.js.
Client and server input
| Helper | What |
|---|---|
onClientCallback, onClientEvent | Client requests through the gate: rate, guards (isAdmin, hasCharacter, near), argument parser, one call at a time (lock). |
triggerServerCallback, callAction | The client side; callAction shows the translated refusal itself. |
fail("KEY"), ActionResult | Refusals with a lang key. |
readInt, readId, readText, readVec3, readVec4, oneArg | Strict readers for client values. |
progressFor | A timed action the server runs: ai-lib's progress bar on the player's client, true only when it ran out there and enough time passed on the server. |
minigameFor | A minigame a server flow needs (lockpick, skill check): won, lost or broken, decided on the player's client, the server still checks. |
PendingActions | Dialogs the server waits for (a note's text): token, freed on drop. |
PlayerMap, Cooldowns, KeyedCooldowns, onCharacter | Per-player state that cleans itself on drop and character switch. |
World
| Helper | What |
|---|---|
Points | Every place players use: prompt or target (the owner's choice), NPCs, blips, model points (ATMs, pumps), vehicle points. |
Zones, Blips, LocalPed | Areas, blips, local peds. |
hasJob, inGang, onDutyIn, onMembershipChange | Membership checks for canShow. |
player, cache, onCache | The local ped: teleport with collision loading, animations, freeze; cached ped, vehicle, seat, weapon. |
spawnVehicle, vehicleKeys, vehicleFromNet, pedFromNet | Server vehicles with plate, keys, fuel, look and seats in one call. |
EntityState, PlayerState, GlobalKey, GlobalGroup | State bags without the per-read cost. |
raycast, groundZ, locationName, vehicleLabel, pedHeadshot | Probes and names. |
AreaStream, AreaFollower | World objects (drops, plants, bodies, props) streamed to the players around them: a snapshot of the cells around the player, then only changes. |
UI and flow
| Helper | What |
|---|---|
notify, progress, menu, input, itemPicker | The shared UI, drawn by ai-lib (the item picker by ai-core). progress takes an animation or scenario, a point to face, blocked controls, freeze, cancel key. |
skillCheck, lockpick | Minigames drawn by ai-lib: a skill check ring (ox_lib's difficulty shape) and a lockpick with pins and picks. |
NuiScreen | A resource's full-screen page: focus, hidden HUDs, the close message and the page's callbacks in one class. |
Keybind, addCommand | Keys (shown in the panel and the key list) and commands (ACE checked, listed in the panel). |
every(ms, fn) | The resource's one scheduler for periodic work. |
hud, keyHints, radial, controls | Hide HUDs on full-screen UI, key help, radial items, disabled controls. |
Through AI Core
inventory, vehicleKeys, dispatch, phone, world (time and weather), prison, medical, appearance, money.transfer, buckets, online (players, jobs, duty, names), isPrimeTime: each forwards to whatever script the server runs for that job.
The complete, current list is .claude/rules/lib.md in the server folder.