Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@suaveplan/game-server - Universal game server framework: typed dependency-injection container, error registry and Zod-validated core types (game-config, session-metadata, player-info, move-validation-result) as foundation for the broader engine/session/state/matchmaking surface migrated from main
Universal game-server framework. Migrated from @suaveplan/game-server on
the reference branch claude/review-game-engine-arch-Kaykr (main repo
packages/universal/game-server/). The port lands in
dependency-ordered slices; this initial slice (0.1.0) ships the
foundations that every later slice will depend on:
./errors—GameServerError+GAME_SERVER_CODES(defineCodesregistry)../types—GameConfig,SessionMetadata,PlayerInfo,MoveValidationResult,GameResult,SessionType,DeepReadonly, plus Zod schemas and throwing/non-throwing validators for every boundary../engine/di-container— typed singleton/transient service locator, ported with a typedGAME_SERVER.SERVICE_NOT_REGISTEREDerror and a cache-invalidating re-register semantic (improvement).
Documentation tree
- abstract-game-logic —
AbstractGameLogic<TState, TMove>is the abstract base every concrete game type extends. It implements the `IG…- abstract-game-logic —
AbstractGameLogic<TState, TMove>is the abstract base every concrete game type extends. It implements the `IG…
- abstract-game-logic —
- game-event-emitter —
GameEventEmitteris the typed event hub every game-server subsystem publishes to and listens on. It exposes the stand…- game-event-emitter —
GameEventEmitteris the typed event hub every game-server subsystem publishes to and listens on. It exposes the stand…
- game-event-emitter —
- game-events — This module owns the typed event-payload map every game-server consumer keys off — players, sessions, game lifecycle, m…
- game-events — This module owns the typed event-payload map every game-server consumer keys off — players, sessions, game lifecycle, m…
- i-game-logic —
IGameLogicis the strategy-pattern contract every concrete game type plugs into the universal game server through. Th…- i-game-logic —
IGameLogicis the strategy-pattern contract every concrete game type plugs into the universal game server through. Th…
- i-game-logic —
- i-player-manager —
IPlayerManageris the contract every connection-tracking implementation must satisfy so the engine, session manager,…- i-player-manager —
IPlayerManageris the contract every connection-tracking implementation must satisfy so the engine, session manager,…
- i-player-manager —
- i-session-manager —
ISessionManageris the contract every session-tree implementation must satisfy. The session hierarchy is the core org…- i-session-manager —
ISessionManageris the contract every session-tree implementation must satisfy. The session hierarchy is the core org…
- i-session-manager —
- i-state-manager —
IStateManager<TState>is the contract every state-management implementation in the game server stack must satisfy. St…- i-state-manager —
IStateManager<TState>is the contract every state-management implementation in the game server stack must satisfy. St…
- i-state-manager —
- di-container —
DIContaineris a small, type-safe service locator that the broader@suaveplan/game-serverengine uses to thread sha…- di-container —
DIContaineris a small, type-safe service locator that the broader@suaveplan/game-serverengine uses to thread sha…
- di-container —
- game-engine —
GameEngineis the top-level orchestrator for@suaveplan/game-server. It owns aDIContainer, aGameLoop, and a `…- game-engine —
GameEngineis the top-level orchestrator for@suaveplan/game-server. It owns aDIContainer, aGameLoop, and a `…
- game-engine —
- game-loop —
GameLoopdrives a deterministic, injection-friendly game loop with three operating modes (tick-based, `event-driven…- game-loop —
GameLoopdrives a deterministic, injection-friendly game loop with three operating modes (tick-based, `event-driven…
- game-loop —
- player-manager —
PlayerManageris theIPlayerManagerimplementation backing the player lifecycle in@suaveplan/game-server. It tra…- player-manager —
PlayerManageris theIPlayerManagerimplementation backing the player lifecycle in@suaveplan/game-server. It tra…
- player-manager —
- plugin-manager —
PluginManageris the typed plugin registry for@suaveplan/game-server. It owns the install/uninstall/enable/disable…- plugin-manager —
PluginManageris the typed plugin registry for@suaveplan/game-server. It owns the install/uninstall/enable/disable…
- plugin-manager —
- session-lifecycle —
SessionLifecycleis the per-session finite-state machine that models each session's progression through the three hig…- session-lifecycle —
SessionLifecycleis the per-session finite-state machine that models each session's progression through the three hig…
- session-lifecycle —
- session-node —
SessionGraphNodeis the internal mutable graph node powering the hierarchical session tree at the heart of `@suavepla…- session-node —
SessionGraphNodeis the internal mutable graph node powering the hierarchical session tree at the heart of `@suavepla…
- session-node —
- session-store —
SessionStoreis theISessionManagerimplementation that consumers wire into aGameEngine. It composes a `SessionT…- session-store —
SessionStoreis theISessionManagerimplementation that consumers wire into aGameEngine. It composes a `SessionT…
- session-store —
- session-tree —
SessionTreeis the hierarchical session graph backing@suaveplan/game-server. It owns the `Map<id, SessionGraphNode…- session-tree —
SessionTreeis the hierarchical session graph backing@suaveplan/game-server. It owns the `Map<id, SessionGraphNode…
- session-tree —
- anti-cheat-validator —
AntiCheatValidatorperforms server-authoritative validation for player movement and action streams in real-time multi…- anti-cheat-validator.internal — Internal pure helpers backing
AntiCheatValidator. Holds default configuration constants (movement, rate limits, punis… - anti-cheat-validator —
AntiCheatValidatorperforms server-authoritative validation for player movement and action streams in real-time multi…
- anti-cheat-validator.internal — Internal pure helpers backing
- interest-manager —
InterestManagerimplements area-of-interest (AOI) culling for open-world multiplayer games: it tracks zones, entities…- interest-manager.internal — Pure geometry helpers backing
InterestManager: EuclideanvectorDistance(z defaults to 0 for 2D interop), `zoneCont… - interest-manager —
InterestManagerimplements area-of-interest (AOI) culling for open-world multiplayer games: it tracks zones, entities…
- interest-manager.internal — Pure geometry helpers backing
- lag-compensator —
LagCompensatorperforms server-side state rewinding for accurate hit registration in networked multiplayer games. It…- lag-compensator.internal — Pure helpers backing
LagCompensator:RTT_SAMPLE_SIZE, theinitialStatsfactory, RTT-sample-window management (`pu… - lag-compensator —
LagCompensatorperforms server-side state rewinding for accurate hit registration in networked multiplayer games. It…
- lag-compensator.internal — Pure helpers backing
- leaderboard-manager —
LeaderboardManagerprovides multi-leaderboard score tracking for game servers with three independent ranking modes —…- leaderboard-manager —
LeaderboardManagerprovides multi-leaderboard score tracking for game servers with three independent ranking modes —…
- leaderboard-manager —
- game-persistence —
GamePersistencepersists game state to a pluggable key-value backend via theStorageLikestructural contract from `…- game-persistence —
GamePersistencepersists game state to a pluggable key-value backend via theStorageLikestructural contract from `…
- game-persistence —
- replay-player —
ReplayPlayerplays back aReplayData<TState, TInput>document produced byReplayRecorder. It exposes the controls…- replay-player —
ReplayPlayerplays back aReplayData<TState, TInput>document produced byReplayRecorder. It exposes the controls…
- replay-player —
- replay-recorder —
ReplayRecordercaptures gameplay into a deterministic, replay-readyReplayData<TState, TInput>document. It records…- replay-recorder —
ReplayRecordercaptures gameplay into a deterministic, replay-readyReplayData<TState, TInput>document. It records…
- replay-recorder —
- game-instance-registry —
GameInstanceRegistryis the in-memory primitive that tracks every live game-server instance in a multi-host deploymen…- game-instance-registry.internal — Pure helpers extracted from
GameInstanceRegistryso the orchestrator class stays inside the per-file budget. The help… - game-instance-registry —
GameInstanceRegistryis the in-memory primitive that tracks every live game-server instance in a multi-host deploymen…
- game-instance-registry.internal — Pure helpers extracted from
- bitpacker-state-sync —
BitPackerStateSyncis the byte-packed state-synchronisation primitive for low-bandwidth, high-frequency multiplayer u…- bitpacker-state-sync —
BitPackerStateSyncis the byte-packed state-synchronisation primitive for low-bandwidth, high-frequency multiplayer u…
- bitpacker-state-sync —
- vector-clock-sync —
VectorClockSyncis the distributed event-ordering primitive used by multiplayer game sessions to decide whether two a…- vector-clock-sync.internal — This module factors out the pure helpers that drive
VectorClockSync— happens-before / concurrent predicates, conflic… - vector-clock-sync —
VectorClockSyncis the distributed event-ordering primitive used by multiplayer game sessions to decide whether two a…
- vector-clock-sync.internal — This module factors out the pure helpers that drive
- tournament-manager —
TournamentManagerorchestrates single-elimination and round-robin tournaments. Participants register during the `pend…- tournament-bracket.internal — Pure bracket-generation helpers used by
TournamentManager. Extracted to a sibling internal module to keep `tournament… - tournament-manager —
TournamentManagerorchestrates single-elimination and round-robin tournaments. Participants register during the `pend… - tournament-standings.internal — Pure helper utilities for the standings table inside a tournament: applying a win/loss outcome, marking participants el…
- tournament-bracket.internal — Pure bracket-generation helpers used by
- errors —
GameServerErroris the single typed-exception class for the@suaveplan/game-serverpackage. It extends `SuaveplanEr…- game-server-error —
GameServerErroris the single typed-exception class for the@suaveplan/game-serverpackage. It extends `SuaveplanEr…
- game-server-error —
- enhanced-server —
EnhancedGameServeris the top-of-stack integration layer for@suaveplan/game-server. Waves B and C-1 shipped the en…- enhanced-server —
EnhancedGameServeris the top-of-stack integration layer for@suaveplan/game-server. Waves B and C-1 shipped the en…
- enhanced-server —
- matchmaking-engine —
MatchmakingEngineis the top-level façade for the game-server's matchmaking pipeline. It composes three optional coll…- matchmaking-engine —
MatchmakingEngineis the top-level façade for the game-server's matchmaking pipeline. It composes three optional coll…
- matchmaking-engine —
- queue-manager —
QueueManageris the in-memory priority queue at the heart of the matchmaking pipeline. Each call toaddToQueueinse…- queue-manager —
QueueManageris the in-memory priority queue at the heart of the matchmaking pipeline. Each call toaddToQueueinse…
- queue-manager —
- skill-matcher —
SkillMatcherpicks the closest-rated viable opponent for a queue seeker out of a candidate pool, widening its accepta…- skill-matcher —
SkillMatcherpicks the closest-rated viable opponent for a queue seeker out of a candidate pool, widening its accepta…
- skill-matcher —
- spectator-manager —
SpectatorManagerowns the live spectator roster for every active game session. Spectators join a session through `add…- spectator-manager —
SpectatorManagerowns the live spectator roster for every active game session. Spectators join a session through `add…
- spectator-manager —
- winner-stays-on —
WinnerStaysOnManagermodels the classic arcade format where the round winner keeps their seat while the next challeng…- winner-stays-on —
WinnerStaysOnManagermodels the classic arcade format where the round winner keeps their seat while the next challeng…
- winner-stays-on —
- network-adapter —
NetworkAdapteris the unified bridge between the@suaveplan/game-serverframework and any concrete network transpor…- network-adapter —
NetworkAdapteris the unified bridge between the@suaveplan/game-serverframework and any concrete network transpor…
- network-adapter —
- reconnection-manager —
ReconnectionManagerdrives transport reconnection with exponential backoff and configurable jitter for the `@suavepla…- reconnection-manager —
ReconnectionManagerdrives transport reconnection with exponential backoff and configurable jitter for the `@suavepla…
- reconnection-manager —
- webrtc-transport —
WebRTCTransportis the game-server-tierTransportadapter for WebRTC data channels. It wraps an underlying client c…- webrtc-transport —
WebRTCTransportis the game-server-tierTransportadapter for WebRTC data channels. It wraps an underlying client c…
- webrtc-transport —
- websocket-transport —
WebSocketTransportis the game-server-tierTransportadapter for WebSocket connections. It wraps an underlying clie…- websocket-transport —
WebSocketTransportis the game-server-tierTransportadapter for WebSocket connections. It wraps an underlying clie…
- websocket-transport —
- observability — This module owns the three OpenTelemetry instruments the
@suaveplan/game-serverengine, loop, and plugin manager emit…- otel — This module owns the three OpenTelemetry instruments the
@suaveplan/game-serverengine, loop, and plugin manager emit…
- otel — This module owns the three OpenTelemetry instruments the
- network-tier-adapter —
NetworkTierAdapterbridges the game-server's matchmaking + session layer to the@suaveplan/networktier model. Each…- network-tier-adapter —
NetworkTierAdapterbridges the game-server's matchmaking + session layer to the@suaveplan/networktier model. Each…
- network-tier-adapter —
- object-pool —
ObjectPool<T>is a generic typed object pool that dampens GC pressure in hot allocation paths — game-loop frame alloc…- object-pool —
ObjectPool<T>is a generic typed object pool that dampens GC pressure in hot allocation paths — game-loop frame alloc…
- object-pool —
- session-pool —
SessionPoolis a session-specific wrapper aroundObjectPool<T>that recyclesPooledSessionrecords — plain-data s…- session-pool —
SessionPoolis a session-specific wrapper aroundObjectPool<T>that recyclesPooledSessionrecords — plain-data s…
- session-pool —
- ab-test-plugin —
ABTestPluginregisters weighted experiments and assigns players to variants deterministically via an injectedRng.…- ab-test-plugin —
ABTestPluginregisters weighted experiments and assigns players to variants deterministically via an injectedRng.…
- ab-test-plugin —
- analytics-plugin —
AnalyticsPlugintracks per-session counters and per-event activity for a@suaveplan/game-serverengine. It subscrib…- analytics-plugin —
AnalyticsPlugintracks per-session counters and per-event activity for a@suaveplan/game-serverengine. It subscrib…
- analytics-plugin —
- base-plugin —
BasePluginis the abstract base class every concrete@suaveplan/game-serverplugin extends. It implements the `Engi…- base-plugin —
BasePluginis the abstract base class every concrete@suaveplan/game-serverplugin extends. It implements the `Engi…
- base-plugin —
- feature-flag-plugin —
FeatureFlagPluginwraps a@suaveplan/feature-flagsFlagManagerand exposes its evaluation surface as a lifecycle-…- feature-flag-plugin —
FeatureFlagPluginwraps a@suaveplan/feature-flagsFlagManagerand exposes its evaluation surface as a lifecycle-…
- feature-flag-plugin —
- logging-plugin —
LoggingPluginsubscribes to aGameEventEmitterat install time and forwards every observed event to an injected `Lo…- logging-plugin —
LoggingPluginsubscribes to aGameEventEmitterat install time and forwards every observed event to an injected `Lo…
- logging-plugin —
- persistence-plugin —
PersistencePlugintracks per-session game state via aGameEventEmitterand persists it to an injectable `StorageLik…- persistence-plugin —
PersistencePlugintracks per-session game state via aGameEventEmitterand persists it to an injectable `StorageLik…
- persistence-plugin —
- rules-plugin —
RulesPluginintegrates@suaveplan/ruleswith the game-server engine. It maintains three rule sets — move validation…- rules-plugin —
RulesPluginintegrates@suaveplan/ruleswith the game-server engine. It maintains three rule sets — move validation…
- rules-plugin —
- workflow-plugin —
WorkflowPluginlets the game-server orchestrate multi-step@suaveplan/workflowengines under a stable id. Callers r…- workflow-plugin —
WorkflowPluginlets the game-server orchestrate multi-step@suaveplan/workflowengines under a stable id. Callers r…
- workflow-plugin —
- delta-compressor —
DeltaCompressoris the wire-format layer that sits betweenStateDifferandStateSync. It computes aStateDelta…- delta-compressor —
DeltaCompressoris the wire-format layer that sits betweenStateDifferandStateSync. It computes aStateDelta…
- delta-compressor —
- state-differ —
StateDifferis a pure structural diff and patch utility for plain-object game state. It produces a compact, determini…- state-differ —
StateDifferis a pure structural diff and patch utility for plain-object game state. It produces a compact, determini…
- state-differ —
- state-manager —
StateManageris the canonical, observable container for game-session state. It holds a single typed value, exposes re…- state-manager —
StateManageris the canonical, observable container for game-session state. It holds a single typed value, exposes re…
- state-manager —
- state-sync —
StateSyncis the orchestration layer that turnsStateManagermutations into wire packets and applies received packe…- state-sync —
StateSyncis the orchestration layer that turnsStateManagermutations into wire packets and applies received packe…
- state-sync —
- types — This module defines the runtime Zod schemas and validator helpers for the core boundary types of `@suaveplan/game-serve…
- common — This module defines the runtime Zod schemas and validator helpers for the core boundary types of `@suaveplan/game-serve…
Status of the upstream migration
| Surface area | Status |
|---|---|
core/types, errors, engine/di-container |
Shipped in this slice. |
core/{AbstractGameLogic, interfaces/*, events/*} |
Deferred (see spec change enterprise-game-server-core). |
engine/{GameEngine, GameLoop, PlayerManager, PluginManager, SessionLifecycle, SessionNode, SessionStore, SessionTree} |
Deferred — each requires kebab-case rename, 5-file layout, typed errors, OTel wiring, Zod boundaries, 100% test coverage. |
state/{DeltaCompressor, StateDiffer, StateManager, StateSync} |
Deferred. |
matchmaking/{MatchmakingEngine, QueueManager, SpectatorManager, skill-matcher, winner-stays-on} |
Deferred. |
network/{NetworkAdapter, ReconnectionManager, WebRTCTransport, WebSocketTransport} |
Blocked — missing dependencies @suaveplan/network-webrtc, @suaveplan/network-websockets. |
performance/* → telemetry/* |
Deferred (folds into engine slice). |
plugins/* |
Blocked — missing dependencies @suaveplan/workflow, @suaveplan/keys. |
enhanced/* (73 files) |
Priority 2 — separate change enterprise-game-server-enhanced. |
integrations/* (game-lobby UI + enhanced-server) |
Priority 3 — React-coupled, belongs in a react-game-lobby package. |
See the design proposal for the full deferral table and rationale.