export interface PoolContainer {
    id: string;
    shortId: string;
    state: "warming" | "idle" | "claimed";
    sessions: Set<string>;
    createdAt: number;
    lastActivity: number;
}
export interface ContainerPoolOptions {
    poolSize: number;
    maxIdleSeconds: number;
    image: string;
    projectDir: string;
    healthCheckIntervalMs: number;
    sandboxMounts?: string[];
    sandboxCredentials?: Record<string, string>;
    gatewayUrl: string;
    gatewayToken: string;
    sandboxProxyPort?: number;
}
export declare class ContainerPool {
    readonly options: ContainerPoolOptions;
    private containers;
    private _healthCheckTimer;
    private _replenishing;
    private _shutdownRequested;
    private readonly label;
    constructor(options: ContainerPoolOptions);
    /** Initialize pool: re-adopt existing containers, cleanup stopped orphans, pre-warm to target size */
    init(): Promise<void>;
    /**
     * Claim a container for a session. Returns containerId or null if exhausted.
     * SYNCHRONOUS — never awaits Docker. Safe for concurrent calls.
     */
    claim(sessionId: string): string | null;
    /** Release a session from its container */
    release(sessionId: string, containerId: string): void;
    /** Get pool stats for the status endpoint */
    getStats(): {
        total: number;
        idle: number;
        claimed: number;
        warming: number;
    };
    /** Graceful shutdown — wait for sessions to drain, then stop containers */
    shutdown(): Promise<void>;
    /** Stop health check timer (for testing and shutdown) */
    dispose(): void;
    /** Create a new pool container via docker run -d */
    private _createContainer;
    /** Build docker run -d args for a pool container */
    private _buildDockerArgs;
    /** Re-adopt running containers from a previous gateway instance */
    private _readopt;
    /**
     * Validate a container's mounts match current config.
     * Checks that /workspace mount points to the current projectDir.
     */
    private _validateContainer;
    /** Remove stopped orphan containers from previous runs */
    private _cleanupStopped;
    /** Replenish pool to target size if below threshold */
    private _replenish;
    private _healthCheck;
    /** Cull idle containers that exceed the target pool size and have been idle too long */
    private _cullExcessIdle;
    private _countByState;
    private _statsString;
}
//# sourceMappingURL=container-pool.d.ts.map