/** * World–server assignment rules (#670, ADR-0002, decision D-2). * * A server's world is its `LEVEL` (R5); there is no other record. These pure * functions enforce R1, R6 and R7 on a snapshot, so every adapter (config.env * today, a ServerSpec or k8s store later) applies the same rules. */ export interface WorldAssignment { /** resolveWorldName(config.env) */ world: string; server: string; /** * The world lives in servers//data, not worlds/ (D-1). Optional for the * v2 `{ world, server }` shape; adapters always set it, and absent means false. */ internal?: boolean; } export interface WorldAssignmentSnapshot { /** One per readable server, sorted by server. */ assignments: WorldAssignment[]; /** Servers whose config.env is unreadable or whose world cannot be interpreted. */ undetermined: string[]; } export type WorldAssignmentErrorCode = 'invalid_world' | 'server_not_found' | 'conflict' | 'undetermined' | 'internal_world' | 'not_assigned' | 'default_world' | 'server_running'; export declare class WorldAssignmentError extends Error { readonly code: WorldAssignmentErrorCode; readonly servers: string[]; constructor(code: WorldAssignmentErrorCode, message: string, servers?: string[]); } /** * Servers whose world shares a folder with `world`, in snapshot order. A * holder covers its LEVEL and LEVEL_nether/LEVEL_the_end; the queried name * covers the same three (world delete removes all three), so `w_nether` of * a used `w`, and `w_nether_nether` of a legacy `LEVEL=w_nether`, are held. */ export declare function holdersOf(s: WorldAssignmentSnapshot, world: string, opts?: { includeInternal?: boolean; }): string[]; /** * Why `server` may not use `world`, or null when it may. * `newServer` (create): the server does not exist yet, so only the world is checked. */ export declare function checkAssign(s: WorldAssignmentSnapshot, world: string, server: string, opts?: { newServer?: boolean; }): WorldAssignmentError | null; /** * Why worlds/ may not be deleted, or null. Internal holders do not * block: their files are in servers//data, not in worlds/. */ export declare function checkRemoval(s: WorldAssignmentSnapshot, world: string): WorldAssignmentError | null; /** * Why a proposed snapshot (a restored or migrated config.env already applied) * is not acceptable for `server`, or null: R7, then R1 for its world. */ export declare function checkProposed(s: WorldAssignmentSnapshot, server: string): WorldAssignmentError | null; /** Why `server`'s world (worlds/) may not be wiped, or null. */ export declare function checkReset(s: WorldAssignmentSnapshot, server: string): WorldAssignmentError | null; /** The holder of `world` and the world it falls back to (its own name), or why not. */ export declare function planRelease(s: WorldAssignmentSnapshot, world: string): { server: string; fallback: string; } | WorldAssignmentError; /** * Groups of servers whose worlds share a folder, sorted by world. Each group * is named after its shortest world name. */ export declare function findDuplicates(s: WorldAssignmentSnapshot): { world: string; servers: string[]; }[]; /** One human-readable line per duplicate world and per undetermined server (CLI, API, console). */ export declare function formatAssignmentWarnings(report: { duplicates: { world: string; servers: string[]; }[]; undetermined: string[]; }): string[]; //# sourceMappingURL=worldAssignment.d.ts.map