This file provides guidance to agents when working with code in this repository.
Zero-dependency TypeScript library implementing the Source RCON Protocol for Node.js. Used to communicate with Source engine game servers (CS:GO, etc.) and Minecraft servers via RCON.
- Build:
npm run build(runstsc, outputs todist/) - Lint:
npm run lint(runseslint src/ --ext .ts) - No test suite exists. The
testscript is a placeholder.
Three source files in src/, all comprising a single RCON client:
rcon.ts— MainRCONclass (default export). Manages TCP socket lifecycle:connect(),authenticate(),execute(),disconnect(). Thewrite()method handles the request/response cycle including multipacket response reassembly (packets >3700 bytes trigger a termination packet probe).packet.ts—encode()anddecode()functions for serializing/deserializing RCON packets to/from Buffers per the Valve spec (4-byte size header, id, type, body, null terminators).protocol.ts— Frozen object of protocol constants (packet type codes and well-known packet IDs likeID_AUTH,ID_TERM).
- Single quotes, no semicolons (enforced by ESLint)
- No trailing interface member delimiters (delimiter:
"none") - Target ES5/CommonJS output with strict mode