import { Server, ServerName, ServerType, McVersion, Memory, WorldOptions } from '../../domain/index.js'; import type { ICreateServerUseCase, CreateServerConfig, IPromptPort, IServerRepository, IWorldRepository, IAuditLogPort, IModSourcePort, IWorldAssignmentPort, IPlatformSettingsPort, CreateServerRunOptions, IServerSpecRepository, IHostnameRegistrarPort, IContainerRuntimePort } from '../ports/index.js'; /** What the new server is made of, after the prompts or the config were validated. */ interface CreateServerOptions { type: ServerType; version: McVersion; worldOptions: WorldOptions; memory?: Memory; autoStart?: boolean; modpackSlug?: string; modpackVersion?: string; modLoader?: string; /** * Mods to exclude from modpack installation (e.g. client-only mods that * crash a dedicated server). Maps to MODRINTH_EXCLUDE_FILES / CF_EXCLUDE_MODS. */ modpackExcludeFiles?: string[]; enableWhitelist?: boolean; whitelistPlayers?: string[]; playitDomain?: string; noPlayitDomain?: boolean; } /** What TypeScript provisioning needs (#675, ADR-0003 §5). */ export interface ServerProvisionDeps { specRepo: IServerSpecRepository; /** avahi `.local`; skipped when absent. */ hostnames?: IHostnameRegistrarPort; /** Starts the new server unless autoStart is false. */ runtime?: IContainerRuntimePort; /** Host addresses; the first one is announced for `.local`. */ hostIps?: () => string[]; } /** * The server was created but did not start (ADR-0003 decision 1). It stays * created: the CLI exits 1 with the cause, the API answers success with * `server.status: 'created'` and a warning. */ export declare class ServerStartError extends Error { readonly server: Server; readonly reason: string; constructor(server: Server, reason: string); } /** * The create input as value objects, before anything is checked against the * platform. Pure: the API runs it before it opens an event stream. An input * they refuse is ServerSpecError invalid_spec (the API answers 400), never a * plain Error. */ export declare function parseCreateServerConfig(config: CreateServerConfig): { name: ServerName; type: ServerType; version: McVersion; memory: Memory; worldOptions: WorldOptions; enableWhitelist: boolean; server: Server; createOptions: CreateServerOptions; versionToWrite: string | undefined; }; /** * Create Server Use Case * Orchestrates interactive server creation flow */ export declare class CreateServerUseCase implements ICreateServerUseCase { private readonly prompt; private readonly serverRepo; private readonly config; private readonly provision; private readonly worldRepo?; private readonly auditLog?; private readonly modSource?; private readonly assignments?; /** * @param config platform settings (`.mcctl.json`; the CLI passes `new Config(paths)`). * @param assignments without it creation fails closed (R7, #670). */ constructor(prompt: IPromptPort, serverRepo: IServerRepository, config: IPlatformSettingsPort, provision: ServerProvisionDeps, worldRepo?: IWorldRepository | undefined, auditLog?: IAuditLogPort | undefined, modSource?: IModSourcePort | undefined, assignments?: IWorldAssignmentPort | undefined); /** * R1 for the world the new server will use (#670): `--world`, else its * default world ``, which a deleted server of the same name may have * left assigned to someone else. Adopting a free worlds/ stays allowed. * Without an assignment port, creation fails closed (R7). */ private assertWorldAssignable; /** * Write the new server's files and bring it up (ADR-0003 §5). * Rejects when the server was not created; a start failure is returned. * @param version VERSION as written; undefined writes none (the modpack decides). */ private createFiles; /** * Execute interactive server creation */ execute(): Promise; /** * Execute server creation with provided configuration */ executeWithConfig(config: CreateServerConfig, options?: CreateServerRunOptions): Promise; } export {}; //# sourceMappingURL=CreateServerUseCase.d.ts.map