mwg API
    Preparing search index...

    Namespace core

    The blessed renderer-free entry: every mwg module that loads in bare Node, in one import, with no DOM or WebGL globals.

    A game rule that never touches a renderer should never have to discover, by accident, which subpaths load without one. Importing this entry is the declaration: if it loads, the game logic is headless; if a rule needs anything outside it, that dependency is renderer-bound and belongs in presentation, not in the rule.

    Membership is the set REFERENCE.md documents as renderer-free, minus three-d (renderer-free of Pixi but needing Babylon at import, an optional peer a plain npm test run has no reason to have installed), plus the two renderer-free asset halves (assetPaths, assetBinary - path resolution and byte caching with no renderer, beside the Pixi-backed assets loader). Deliberately excluded: the Lua runtimes (mwl/pyroeis, ai/lua), which carry their own load contracts, and every two-d/* module (Pixi by documentation, enforced by test).

    threads rides along (simulation's async rollouts and ai training spawn through it, and it loads with no renderer - its worker host is a call-time concern, not an import-time one, handled inside threads.spawn itself).

    tests/headless-smoke.test.ts is the proof: it imports this entry in plain Node with no DOM/WebGL globals, walks the reachable import graph for a renderer leak, and runs a seeded scenario through it twice for the same result.

    import {
    actors,
    ai,
    assetBinary,
    assetPaths,
    audio,
    battle,
    board,
    core,
    i18n,
    mwl,
    roguelike,
    rpg,
    simulation,
    testing,
    world,
    } from '@datamoc/mwg/headless';

    // deterministic rules with no renderer: a seeded stream plus one headless scenario
    const random = new core.Generator(7);
    const result = simulation.runScenario({
    state: { value: 0 },
    commands: [1, 2, 3],
    random,
    step: (state, command, rng) => ({
    state: { value: state.value + command + rng.int(2) },
    events: [],
    status: 'ready' as const,
    }),
    });

    // every other member rides the same entry: content, rules, saves, and the two
    // renderer-free asset halves (path resolution and byte caching with no loader)
    const tables = mwl.MWL_SCHEMA_10;
    const present = assetPaths.has('tiles/grass.png');
    const cached = assetBinary.isBinaryLoaded('sfx/hit.mp3');
    const check = { actors, ai, audio, battle, board, i18n, roguelike, rpg, testing, world };
    void result;
    void tables;
    void present;
    void cached;
    void check;
    AchievementCriterion → AchievementCriterion
    AchievementDef → AchievementDef
    Achievements → Achievements
    ActionJournal → ActionJournal
    ActionJournalEntry → ActionJournalEntry
    Blob → Blob
    CanonicalState → CanonicalState
    CanonicalStateSnapshot → CanonicalStateSnapshot
    cellFromKey → cellFromKey
    cellIndex → cellIndex
    cellInside → cellInside
    cellKey → cellKey
    cellX → cellX
    cellY → cellY
    chebyshev → chebyshev
    checkNoControlCharacters → checkNoControlCharacters
    checkSize → checkSize
    CIRCLE8 → CIRCLE8
    clamp → clamp
    cloneData → cloneData
    Collection → Collection
    CollectionOptions → CollectionOptions
    createHandles → createHandles
    CsvColumnType → CsvColumnType
    CsvOptions → CsvOptions
    CustomSettingValue → CustomSettingValue
    DbRecord → DbRecord
    defaultSettings → defaultSettings
    defaultStorage → defaultStorage
    deserializeReplay → deserializeReplay
    DialogueLine → DialogueLine
    distance → distance
    DistanceMetric → DistanceMetric
    downloadReplayFile → downloadReplayFile
    dropByPriority → dropByPriority
    Easing → Easing
    effectiveMusicVolume → effectiveMusicVolume
    effectiveSfxVolume → effectiveSfxVolume
    EntityId → EntityId
    EntityRegistry → EntityRegistry
    euclidean → euclidean
    exportReplayFile → exportReplayFile
    FeedbackClient → FeedbackClient
    FeedbackOptions → FeedbackOptions
    FeedbackRequest → FeedbackRequest
    FeedbackResponse → FeedbackResponse
    FixedStepper → FixedStepper
    FloatSource → Random.FloatSource
    GameSettings → GameSettings
    Generator → Random.Generator
    Handles → Handles
    HexCoord → HexCoord
    hexDistance → hexDistance
    hexLine → hexLine
    hexNeighbors → hexNeighbors
    HexOffset → HexOffset
    HexOrientation → HexOrientation
    hexRange → hexRange
    HexShape → HexShape
    hexToPixel → hexToPixel
    Hook → Hook
    HookRegistry → HookRegistry
    HttpTransport → HttpTransport
    HttpTransportOptions → HttpTransportOptions
    importReplayFile → importReplayFile
    Input → Input
    JavaRandom → JavaRandom
    JavaRandomDraw → JavaRandomDraw
    JavaRandomOptions → JavaRandomOptions
    LastRun → LastRun
    LastRunData → LastRunData
    LastRunOptions → LastRunOptions
    LoadQueue → LoadQueue
    LoadSnapshot → LoadSnapshot
    LoadStatus → LoadStatus
    LoadTask → LoadTask
    LoadTaskContext → LoadTaskContext
    LockstepClient → LockstepClient
    LockstepClientOptions → LockstepClientOptions
    LockstepWelcome → LockstepWelcome
    LogEntry → LogEntry
    Logger → Logger
    LoggerOptions → LoggerOptions
    LogLevel → LogLevel
    manhattan → manhattan
    MersenneTwister → Random.MersenneTwister
    MersenneTwisterState → Random.MersenneTwisterState
    motionDuration → motionDuration
    MotionIntent → MotionIntent
    NEIGHBOURS4 → NEIGHBOURS4
    NEIGHBOURS8 → NEIGHBOURS8
    NewsClient → NewsClient
    NewsItem → NewsItem
    NewsOptions → NewsOptions
    NewsSeenOptions → NewsSeenOptions
    NewsSeenTracker → NewsSeenTracker
    parseCSV → parseCSV
    parseDialogueLines → parseDialogueLines
    parseInbound → parseInbound
    parseReplayEvents → parseReplayEvents
    parseTwee → parseTwee
    pickReplayFile → pickReplayFile
    pixelToHex → pixelToHex
    Player → Player
    PlayerInput → PlayerInput
    PlayerInputOptions → PlayerInputOptions
    PlayerStats → PlayerStats
    PlayerStatsOptions → PlayerStatsOptions
    prefersReducedMotion → prefersReducedMotion
    PresentationQueue → PresentationQueue
    PresentationQueueOptions → PresentationQueueOptions
    Random → Random
    RandomSource → Random.RandomSource
    RandomStreams → Random.RandomStreams
    ReactionRule → ReactionRule
    ReactionTable → ReactionTable
    readReplayFile → readReplayFile
    Recorder → Recorder
    reducedMotion → reducedMotion
    Registry → Registry
    ReplayEvent → ReplayEvent
    ReplayFile → ReplayFile
    ReplayFileMeta → ReplayFileMeta
    resumeRunPlayer → resumeRunPlayer
    runCheckpoint → runCheckpoint
    RunCheckpoint → RunCheckpoint
    RunHistory → RunHistory
    RunHistoryEntry → RunHistoryEntry
    RunHistoryOptions → RunHistoryOptions
    sanitizeInboundText → sanitizeInboundText
    SaveData → SaveData
    SaveMeta → SaveMeta
    SaveStorage → SaveStorage
    SaveSyncClient → SaveSyncClient
    SaveSyncOptions → SaveSyncOptions
    SaveSyncResponse → SaveSyncResponse
    SaveSystem → SaveSystem
    SaveSystemOptions → SaveSystemOptions
    Scene → Scene
    SceneClass → SceneClass
    SceneComponent → SceneComponent
    SceneComponentHost → SceneComponentHost
    SceneStack → SceneStack
    Schema → Schema
    scramble → scramble
    serializeReplay → serializeReplay
    Session → Session
    SessionOptions → SessionOptions
    setReducedMotion → setReducedMotion
    Settings → Settings
    SettingsOptions → SettingsOptions
    ShareDecoded → ShareDecoded
    ShareDecodeOptions → ShareDecodeOptions
    ShareEncodeOptions → ShareEncodeOptions
    ShareEnvelope → ShareEnvelope
    ShareFailure → ShareFailure
    Signal → Signal
    SignalListener → SignalListener
    SizeLimitOptions → SizeLimitOptions
    Spawner → Spawner
    SpawnerOptions → SpawnerOptions
    stateChecksum → stateChecksum
    StateExtension → StateExtension
    StateRegistry → StateRegistry
    StateRestoreDiagnostic → StateRestoreDiagnostic
    StateSnapshot → StateSnapshot
    StateValue → StateValue
    StoredValue → StoredValue
    SyncGuard → SyncGuard
    TelemetryClient → TelemetryClient
    TelemetryEvent → TelemetryEvent
    TelemetryOptions → TelemetryOptions
    TelemetryResponse → TelemetryResponse
    TickEvent → TickEvent
    TweeChoice → TweeChoice
    TweeCommand → TweeCommand
    Tweener → Tweener
    TweenOptions → TweenOptions
    TweeStory → TweeStory
    uncloneablePath → uncloneablePath
    UndoHistory → UndoHistory
    UndoHistoryOptions → UndoHistoryOptions
    unscramble → unscramble
    validateSchema → validateSchema
    watchReducedMotion → watchReducedMotion
    Wave → Wave
    WebSocketLike → WebSocketLike
    WeightedCell → WeightedCell
    weightedFlood → weightedFlood
    WeightedFloodOptions → WeightedFloodOptions