/** * pluginSource.ts — the source of the McpBridge plugin that runs inside the game. * * This is authored as ES5 on purpose: RPG Maker MV 1.0-1.5 ships nwjs 0.12 * (Chromium 41), so `let`, arrow functions and template literals are not safe * to assume. It uses only engine APIs that exist in the MV corescript. * * Map hot-reload deserves a note, because the obvious implementation is wrong. * Rebuilding `Spriteset_Map` by hand leaves `Game_Map` holding the old * `$dataMap`, and reassigning `$dataMap` mid-frame can null it out while * `Scene_Map` is updating. The engine already has the right seam: * `Game_Player._needsMapReload` makes `performTransfer` re-run `$gameMap.setup` * even when the destination is the current map, and `Scene_Map.create` calls * `DataManager.loadMapData`, which re-reads MapXXX.json from disk. So a * reserved transfer to the player's own position with `_needsMapReload = true` * is a full, engine-sanctioned reload that keeps party state and variables. */ export declare const BRIDGE_PLUGIN_NAME = "McpBridge"; export interface BridgePluginOptions { /** Fallback port if the handshake file cannot be read. */ port?: number; /** How often the player position frame is sent, in frames (default 30). */ telemetryInterval?: number; } /** The plugin's @param block, mirrored into js/plugins.js so PluginManager sees the defaults. */ export interface BridgePluginSpec { description: string; author: string; help: string; params: { name: string; type: string; desc: string; default: string | number; }[]; body: string; } /** * Build the full plugin spec. The header is left to pluginTools.createPlugin so * the @param defaults also land in js/plugins.js, which is where * PluginManager.parameters actually reads them from. */ export declare function buildBridgePlugin(opts?: BridgePluginOptions): BridgePluginSpec;