import type { ChildProcess } from "node:child_process";
import type { Logger } from "pino";
import { type ProviderRuntimeSettings } from "../../provider-launch-config.js";
export interface OpenCodeServerAcquisition {
    server: {
        port: number;
        url: string;
    };
    release: () => void;
}
export interface OpenCodeServerManagerLike {
    ensureRunning(): Promise<{
        port: number;
        url: string;
    }>;
    acquire(options: {
        force: boolean;
        env?: Record<string, string>;
    }): Promise<OpenCodeServerAcquisition>;
}
export interface OpenCodeServerGeneration {
    process: ChildProcess;
    port: number;
    url: string;
    refCount: number;
    retired: boolean;
}
export declare class OpenCodeServerManager implements OpenCodeServerManagerLike {
    private static instance;
    private static exitHandlerRegistered;
    private currentServer;
    private retiredServers;
    private startPromise;
    private forcedRefreshPromise;
    private readonly logger;
    private readonly runtimeSettings?;
    private readonly runtimeSettingsKey;
    private constructor();
    static getInstance(logger: Logger, runtimeSettings?: ProviderRuntimeSettings): OpenCodeServerManager;
    private static registerExitHandler;
    ensureRunning(): Promise<{
        port: number;
        url: string;
    }>;
    acquire(options: {
        force: boolean;
        env?: Record<string, string>;
    }): Promise<OpenCodeServerAcquisition>;
    private acquireServer;
    private getForcedRefreshServer;
    private getCurrentServer;
    private rotateCurrentServer;
    private startDedicatedServer;
    private startServer;
    shutdown(): Promise<void>;
    private cleanupRetiredServers;
    private killServer;
}
//# sourceMappingURL=server-manager.d.ts.map