import type { ContainerStatus, HealthStatus, ContainerStats, PlayerListResult } from '../../types/index.js'; import type { ServerName } from '../../domain/value-objects/ServerName.js'; import type { IContainerRuntimePort, RuntimeActionResult } from '../../application/ports/outbound/IContainerRuntimePort.js'; import type { IServerConsolePort, ConsoleCommandResult, ConsoleEndpoint } from '../../application/ports/outbound/IServerConsolePort.js'; import type { IRouterStatusPort, RouterContainerConfig } from '../../application/ports/outbound/IRouterStatusPort.js'; import type { IPlayitAgentPort } from '../../application/ports/outbound/IPlayitAgentPort.js'; import type { IRuntimeEnvironmentPort, ToolVersion } from '../../application/ports/outbound/IRuntimeEnvironmentPort.js'; /** * Parse `rcon-cli list` output into a player list. * Strips ANSI escape codes (full and partial like `[0m`) and uses the first line only. * Returns null when the output does not match the player-count format. */ export declare function parseRconPlayerList(raw: string): PlayerListResult | null; /** * IContainerRuntimePort over the Docker CLI. A ServerName maps to its container (`mc-`, workloadNames.ts); * a string is the container name itself (deprecated v2 form, still used by the legacy facade). * `root` defaults to resolveMcctlRoot() at call time; `env` (default process.env) applies to start/stop/restart only. */ export declare class DockerComposeRuntimeAdapter implements IContainerRuntimePort { private readonly options; /** * @param options.startTimeoutMs how long `start` (docker compose up) may take; default 60 s. * A first start can pull the image (#675: create passes a longer one). */ constructor(options?: { root?: string; env?: () => NodeJS.ProcessEnv; startTimeoutMs?: number; }); getStatus(name: ServerName | string): ContainerStatus; /** * Async `docker inspect` (the pre-#665 ServerRepository query, with `--`). * Non-zero exit → 'not_found'; otherwise the lower-cased state. */ getStatusAsync(name: ServerName | string): Promise; /** * Get container health status */ getHealth(name: ServerName | string): HealthStatus; /** * Check if container exists */ exists(name: ServerName | string): boolean; /** * Get minecraft server containers (mc-* except mc-router), all or running only */ list(options?: { running?: boolean; strict?: boolean; }): string[]; /** * Get container logs */ getLogs(name: ServerName | string, lines?: number): string; /** * Get container resource stats (memory, CPU) */ getStats(name: ServerName | string): ContainerStats | null; /** getStats through an awaited `docker stats` (#764). Non-zero exit or unparseable → null. */ getStatsAsync(name: ServerName | string): Promise; /** * Get container uptime (time since start) */ getUptime(name: ServerName | string): { uptime: string; seconds: number; } | null; /** Create the container if missing, then run it (`docker compose up -d`) */ start(name: ServerName | string): Promise; stop(name: ServerName | string): Promise; restart(name: ServerName | string): Promise; /** * delete-server.sh step 1 (#735): `docker ps -a` decides whether the * container exists; a container of the compose project is stopped and * removed with compose, any other with `docker rm -f`. */ remove(name: ServerName | string): Promise; /** Copied from mcctl-api player-session-collector (defaultLogFetcher) */ readLogs(name: ServerName | string, options: { since: string; tail: number; }): Promise; /** Copied from mcctl-api GET /api/servers/:name/logs?follow; abort kills the child through spawn's signal */ followLogs(name: ServerName | string, onChunk: (chunk: string) => void, signal: AbortSignal, options?: { tail?: number; follow?: boolean; onExit?: (code: number | null, error?: Error) => void; }): Promise; private env; /** Copied from mcctl-api executeServerAction */ private compose; private run; /** * Start a container * @deprecated No production caller; use start() (ADR-0001). Removed in D3/D4. */ startContainer(container: string): boolean; /** * Stop a container * @deprecated Use stop() (ADR-0001). Removed once its callers move (D2). */ stopContainer(container: string): boolean; } /** * IServerConsolePort over `docker exec rcon-cli`. */ export declare class DockerServerConsoleAdapter implements IServerConsolePort { /** * Get online players via RCON. Runs `docker exec` as an awaited child process * (#764) so callers can probe several servers in parallel; 5 s timeout as before. */ listPlayers(name: ServerName | string): Promise; /** Copied from mcctl-api execRcon / cli execRconWithOutput */ command(name: ServerName | string, args: string[], options?: { signal?: AbortSignal; }): Promise; /** Copied from cli `mcctl rcon` (getContainerRconConfig) */ getEndpoint(name: ServerName | string): Promise; } export declare class DockerRouterStatusAdapter implements IRouterStatusPort { /** * Check mc-router health via management API * mc-router uses distroless image, so Docker healthcheck doesn't work * Instead, we check the management API on localhost:25580 */ getHealth(): HealthStatus; /** * Get container's hostname label (mc-router.host) */ getHostnames(name: ServerName | string): string; /** * Image and env of mc-router from one `docker inspect` (#768) */ inspectRouter(): RouterContainerConfig | null; /** * All string labels of a container from one `docker inspect` (#768) */ getLabels(name: ServerName | string): Record; } /** * playit-agent container via docker compose with the playit profile. * `root` defaults to resolveMcctlRoot() at call time. */ export declare class DockerPlayitAgentAdapter implements IPlayitAgentPort { private readonly options; constructor(options?: { root?: string; }); /** * Start playit-agent container */ start(): Promise<{ success: boolean; error?: string; }>; /** * Stop playit-agent container */ stop(): Promise; } export declare class DockerRuntimeEnvironmentAdapter implements IRuntimeEnvironmentPort { /** * Check if Docker is available */ isAvailable(): boolean; /** * Check if Docker Compose is available * @deprecated No caller (ADR-0001). Removed in D3/D4. */ isComposeAvailable(): boolean; /** * Get Docker version */ getEngineVersion(): ToolVersion; /** * Get Docker Compose version */ getComposeVersion(): ToolVersion; } //# sourceMappingURL=DockerComposeRuntimeAdapter.d.ts.map