import { type ChildProcess } from 'node:child_process'; export declare const SERVICE_HEALTH: { readonly HEALTHY: "healthy"; readonly UNHEALTHY: "unhealthy"; readonly STARTING: "starting"; readonly NONE: "none"; }; export declare const SERVICE_STATE: { readonly RUNNING: "running"; readonly CREATED: "created"; readonly EXITED: "exited"; }; declare class DockerValidationError extends Error { } export interface ServiceStatus { name: string; state: string; health: string; ports: string[]; } export declare class DockerComposeConfigNotFoundError extends Error { constructor(dockerComposePath: string); } declare const isDockerInstalled: () => boolean; export declare function validateDockerEnvironment(): void; export declare function getDefaultDockerComposePath(): string; export declare function resolveDockerComposePath(customPath?: string): Promise; export declare function parseServiceStatus(jsonOutput: string): ServiceStatus[]; export declare function getServiceStatus(dockerComposePath: string): Promise; export declare function isServiceHealthy(service: ServiceStatus): boolean; export declare function isServiceFailed(service: ServiceStatus): boolean; export declare const STACK_STATE: { /** Nothing live for this project — a fresh start we own. */ readonly NONE: "none"; /** Every container found is running and healthy (or has no healthcheck). */ readonly RUNNING: "running"; /** Something is live but not everything is healthy — reconcile. */ readonly PARTIAL: "partial"; }; export type StackState = typeof STACK_STATE[keyof typeof STACK_STATE]; /** * Classify the current state of a project's stack from `docker compose ps`. * * This is the detection signal `output dev` branches on: nothing live means a * fresh start; an all-healthy result means we can attach and monitor without * touching the stack; anything in between is reconciled with `up -d`. * * Scoped to the shared `output-sdk` compose project, which distinguishes our * containers from unrelated processes — but not one Output checkout from * another, since the project name defaults to a machine-global constant. */ export declare function classifyStackState(services: ServiceStatus[]): StackState; export declare function waitForServicesHealthy(dockerComposePath: string, timeoutMs?: number, pollIntervalMs?: number): Promise; export interface DockerComposeHandlers { onError?: (error: Error, output: string) => void; onExit?: (code: number | null, signal: NodeJS.Signals | null, output: string) => void; } export type PullPolicy = 'always' | 'missing' | 'never'; export interface StartDockerComposeOptions extends DockerComposeHandlers { dockerComposePath: string; pullPolicy?: PullPolicy; } export declare function startDockerCompose({ dockerComposePath, pullPolicy, onError, onExit }: StartDockerComposeOptions): Promise; export interface DetachedUpResult { code: number | null; signal: NodeJS.Signals | null; output: string; } export declare function runDockerComposeUpDetached(dockerComposePath: string, pullPolicy?: PullPolicy): Promise; export declare function stopDockerCompose(dockerComposePath: string): Promise; export { isDockerInstalled, DockerValidationError };