UNPKG

endfield-mcp

Version:

MCP Server for Arknights: Endfield (TypeScript / stdio + Streamable HTTP)

22 lines (21 loc) • 997 B
/** * Startup data sync orchestration. * * Owns retry/backoff scheduling, single-flight locking, and the cache-clear * cascade triggered when sync writes new data. Mirrors the design of * PRTS-MCP's `ts/src/startupSync.ts`, simplified to a single dataset * (GameData tables) for now. New datasets (story, audio) plug in by adding * another `syncDataset` block — the orchestration scaffolding is reusable. * * Contract: * - Runs in a background task launched from `server.ts` before listen(). * - Skips sync when `EF_DATA_PATH` is explicitly set (user manages their * own data; we must not overwrite it). * - Each dataset syncs under a single-flight lock so overlapping retries * share a mutex. * - Retries with exponential backoff (30s / 120s / 600s) when network is * unavailable, then gives up until next process start. * - Clears data-layer caches when a sync writes new data so stale reads * don't leak. */ export declare function runStartupSync(): Promise<void>;