/** * Docker socket validation and auto-detection module. * Supports Docker Engine, Docker Desktop, Colima, OrbStack, Rancher Desktop, * Podman, rootless Docker, Snap Docker, and DOCKER_HOST env var. */ /** * Result of Docker socket validation */ export interface SocketValidationResult { /** The validated Docker socket path (empty string if invalid) */ dockerSocket: string; /** Warning messages encountered during validation */ warnings: string[]; } /** * Docker connection options derived from a DOCKER_HOST string. * Structurally compatible with dockerode's DockerOptions. */ export interface DockerConnectionOptions { socketPath?: string | undefined; host?: string | undefined; port?: number | undefined; protocol?: 'https' | 'http' | 'ssh' | undefined; } /** * Parsed result from a DOCKER_HOST value. */ export interface ParsedDockerHost { type: 'unix' | 'tcp' | 'npipe'; /** Socket path for unix/npipe, or full host string for tcp */ value: string; /** Extracted host for tcp connections */ host?: string; /** Extracted port for tcp connections */ port?: number; } /** * Parse a DOCKER_HOST value into a structured result. * Handles: unix://, tcp://, http://, https://, npipe://, raw paths. * Throws on unsupported schemes (e.g. fd://, ssh://). */ export declare function parseDockerHost(value: string): ParsedDockerHost; /** * Convert a DOCKER_HOST endpoint string to connection options for dockerode. * Handles tcp://, http://, https://, unix://, npipe://, and raw socket paths. * Throws on unsupported schemes (e.g. ssh://, fd://). */ export declare function dockerHostToOptions(dockerHost: string): DockerConnectionOptions; /** * Normalize a socket path (as returned by {@link autoDetectDockerSocket}) into * a well-formed `DOCKER_HOST` URI suitable for child-process environment variables. * * - Raw Unix paths → `unix:///var/run/docker.sock` * - Raw Windows named pipes → `npipe:////./pipe/docker_engine` * - Values that are already a URI (tcp://, unix://, etc.) pass through unchanged. */ export declare function toDockerHostURI(socketPath: string): string; /** * Auto-detect Docker socket path with broad runtime support (synchronous). * Checks DOCKER_HOST env var, then probes known socket paths. * Exported for use in other modules that need to detect the socket path. */ export declare function autoDetectDockerSocket(): string; /** * Validate Docker socket path and provide warnings if invalid. * Handles Windows named pipes, Unix sockets, TCP connections, and provides user-friendly error messages. * * @param options - Options object containing optional dockerSocket property * @param options.dockerSocket - Explicit Docker socket path (CLI option) * @param quiet - If true, suppress console output (default: false) * @returns Validation result with socket path and any warnings */ export declare function validateDockerSocket(options: { dockerSocket?: string; }, quiet?: boolean): SocketValidationResult; //# sourceMappingURL=socket-validation.d.ts.map