API overview
s2script ships capability modules as @s2script/* packages (types at author time; the engine injects the runtime).
How imports work
import { OnGameFrame } from '@s2script/frame';
import { Player } from '@s2script/cs2';
import { Events } from '@s2script/events'; Declare each import under s2script.pluginDependencies in package.json. The CLI externalizes @s2script/* by wildcard; the host maps @s2script/<name> → the injected runtime module.
Engine-generic highlights
| Package | Role |
|---|---|
@s2script/entity | EntityRef, create/spawn, I/O |
@s2script/frame | OnGameFrame |
@s2script/timers | delay / nextTick / nextFrame |
@s2script/events | Game events + HookResult |
@s2script/clients | Client lifecycle |
@s2script/commands | ConCommands |
@s2script/chat | Chat send + onMessage |
@s2script/admin | Admin flags + cache |
@s2script/server | Server.command, cvars, onMapStart |
@s2script/db | SQLite Database |
@s2script/http / @s2script/ws | Async network |
@s2script/menu / @s2script/votes | Menus + votes |
CS2
@s2script/cs2 — Player, Pawn, schema accessors, typed events, ChatColors, GameRules, Fade/Shake/HintText.