import type { IWorldManagementUseCase, WorldListResult, WorldAssignResult, WorldReleaseResult, WorldDeleteResult, WorldCreateOptions, WorldCreateResult, WorldImportOptions, WorldImportResult, IPromptPort, IWorldRepository, IServerRepository, IWorldAssignmentPort, IContainerRuntimePort } from '../ports/index.js'; import { WorldAssignmentError } from '../../domain/index.js'; /** * World Management Use Case * * A server's world is its LEVEL (#670, ADR-0002). Assignment changes go * through IWorldAssignmentPort, which enforces R1/R6/R7, and only on a * stopped server (IContainerRuntimePort). Both ports are optional for * constructor compatibility; without them every assignment change and * world delete is refused (fail-closed). */ export declare class WorldManagementUseCase implements IWorldManagementUseCase { private readonly prompt; private readonly worldRepo; private readonly serverRepo; private readonly assignments?; private readonly runtime?; constructor(prompt: IPromptPort, worldRepo: IWorldRepository, serverRepo: IServerRepository, assignments?: IWorldAssignmentPort | undefined, runtime?: IContainerRuntimePort | undefined); /** The current assignments, or why they cannot be read (R7). */ private snapshot; private checkStopped; /** * Reasons a new world cannot be assigned to `serverName` (create --server): * checked before the directory is created. */ private checkNewWorldTarget; /** * Create a new world with optional seed * Interactive mode if options not fully provided */ createWorld(options?: WorldCreateOptions): Promise; /** * List all worlds with lock status. * Excludes split-dimension satellites (_nether, _the_end) * from the returned list. Each primary world gains a `dimensions` field * and its size includes satellite sizes. */ listWorlds(): Promise; /** * List worlds not mapped to any server (no server's LEVEL points at them). * Builds on listWorlds(), which already excludes split-dimension satellites. */ listUnmappedWorlds(): Promise; /** * Build a reverse map of world name -> server names that use it. * * A server's world directory is its LEVEL config value (or the WORLD_NAME * alias); when neither is set itzg uses worlds/world. This mirrors the * world-name precedence used for detailed server info (resolveWorldName). */ private getServersByWorld; /** * Interactive world assignment */ assignWorld(): Promise; /** * Assign world to server by name: the server's LEVEL becomes the world. */ assignWorldByName(worldName: string, serverName: string, options?: { requireExisting?: boolean; }): Promise; /** * Interactive world release */ releaseWorld(): Promise; /** * Release world by name: the holder's LEVEL falls back to its own name. * `force` is accepted for compatibility and ignored (#670). */ releaseWorldByName(worldName: string, _force?: boolean): Promise; /** * The world `serverName` may reset (worlds/, resolved like every * other assignment read), or why not: the server keeps its world inside * its data directory, another server uses the same world family, or the * assignments cannot be read (#670). The caller still checks that the * server is stopped. */ planWorldReset(serverName: string): Promise<{ world: string; } | WorldAssignmentError>; /** * Why `serverName`'s config.env may not become `configEnv` (a config write * that moves its world, e.g. EXTRA_ARGS --universe), or null (#670). */ checkConfigChange(serverName: string, configEnv: string): Promise; /** * Why the platform .env may not become `dotenv`, or null (#670): a new * EXTRA_ARGS reaches every server that inherits it (bare key in * servers/global.env) and may move their worlds. */ checkPlatformEnvChange(dotenv: string): Promise; /** * Existing duplicate assignments and servers whose assignment cannot be * read (plan item 6). Reported, never fixed. Rejects when the assignments * cannot be read at all. */ getAssignmentReport(): Promise<{ duplicates: { world: string; servers: string[]; }[]; undetermined: string[]; }>; /** Why worlds/ may not be deleted, or null (#670). */ private checkWorldDeletion; /** * Interactive world deletion */ deleteWorld(): Promise; /** * Delete world by name */ deleteWorldByName(worldName: string, force?: boolean): Promise; /** * Import a world from a zip archive (non-interactive). * Returns {success:false} if the world already exists or extraction fails. */ importWorldFromZip(options: WorldImportOptions): Promise; /** * Perform the actual world deletion */ private performWorldDeletion; } //# sourceMappingURL=WorldManagementUseCase.d.ts.map