/**
 * YAML configuration loading and Zod validation for the scaler module.
 *
 * Handles:
 * - Main YAML config file parsing
 * - scalers.d/ directory merging (alphabetically sorted)
 * - Zod schema validation with type-specific refinements
 * - Memory string parsing (e.g., "2g" -> bytes)
 */
import { z } from 'zod';
import type { ScalerConfig } from './types.js';
/**
 * Zod schema for network policy configuration on a label set.
 * Controls RFC1918 and internet access for spawned agents.
 */
export declare const networkPolicySchema: z.ZodOptional<z.ZodObject<{
    allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
    denyAll: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
/**
 * Zod schema for a label-set configuration entry.
 */
export declare const labelSetConfigSchema: z.ZodObject<{
    labels: z.ZodArray<z.ZodString>;
    image: z.ZodOptional<z.ZodString>;
    imagePullPolicy: z.ZodDefault<z.ZodEnum<{
        Always: "Always";
        IfNotPresent: "IfNotPresent";
        Never: "Never";
    }>>;
    binaryPath: z.ZodOptional<z.ZodString>;
    resources: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
        requests: z.ZodOptional<z.ZodObject<{
            memory: z.ZodOptional<z.ZodString>;
            cpus: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strict>>;
        limits: z.ZodOptional<z.ZodObject<{
            memory: z.ZodOptional<z.ZodString>;
            cpus: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strict>>;
    }, z.core.$strict>, z.ZodObject<{
        memory: z.ZodOptional<z.ZodString>;
        cpus: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strict>]>, z.ZodTransform<{
        requests?: {
            cpus?: number;
            memory?: string;
        };
        limits?: {
            cpus?: number;
            memory?: string;
        };
    }, {
        memory?: string | undefined;
        cpus?: number | undefined;
    } | {
        requests?: {
            memory?: string | undefined;
            cpus?: number | undefined;
        } | undefined;
        limits?: {
            memory?: string | undefined;
            cpus?: number | undefined;
        } | undefined;
    }>>>;
    volumes: z.ZodOptional<z.ZodArray<z.ZodString>>;
    containerSocket: z.ZodDefault<z.ZodBoolean>;
    env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
    backpressureMode: z.ZodOptional<z.ZodEnum<{
        pause: "pause";
        drop: "drop";
    }>>;
    networkPolicy: z.ZodOptional<z.ZodObject<{
        allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
        denyAll: z.ZodDefault<z.ZodBoolean>;
    }, z.core.$strip>>;
    rootfsPath: z.ZodOptional<z.ZodString>;
    kernelPath: z.ZodOptional<z.ZodString>;
    vcpuCount: z.ZodOptional<z.ZodNumber>;
    memSizeMib: z.ZodOptional<z.ZodNumber>;
    overlayDriveSizeMib: z.ZodOptional<z.ZodNumber>;
}, z.core.$strict>;
/**
 * Zod schema for Firecracker network configuration.
 * Global across all Firecracker scalers on the orchestrator.
 */
export declare const firecrackerNetworkSchema: z.ZodObject<{
    cidr: z.ZodDefault<z.ZodString>;
    bridgeName: z.ZodDefault<z.ZodString>;
    gateway: z.ZodDefault<z.ZodString>;
    netmask: z.ZodDefault<z.ZodString>;
}, z.core.$strip>;
/**
 * Zod schema for the complete scaler configuration file.
 * Validates version, global limits, defaults, and scaler entries.
 */
export declare const scalerFileSchema: z.ZodObject<{
    version: z.ZodLiteral<1>;
    globalMaxAgents: z.ZodDefault<z.ZodNumber>;
    defaults: z.ZodOptional<z.ZodObject<{
        resources: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
            requests: z.ZodOptional<z.ZodObject<{
                memory: z.ZodOptional<z.ZodString>;
                cpus: z.ZodOptional<z.ZodNumber>;
            }, z.core.$strict>>;
            limits: z.ZodOptional<z.ZodObject<{
                memory: z.ZodOptional<z.ZodString>;
                cpus: z.ZodOptional<z.ZodNumber>;
            }, z.core.$strict>>;
        }, z.core.$strict>, z.ZodObject<{
            memory: z.ZodOptional<z.ZodString>;
            cpus: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strict>]>, z.ZodTransform<{
            requests?: {
                cpus?: number;
                memory?: string;
            };
            limits?: {
                cpus?: number;
                memory?: string;
            };
        }, {
            memory?: string | undefined;
            cpus?: number | undefined;
        } | {
            requests?: {
                memory?: string | undefined;
                cpus?: number | undefined;
            } | undefined;
            limits?: {
                memory?: string | undefined;
                cpus?: number | undefined;
            } | undefined;
        }>>>;
    }, z.core.$strip>>;
    globalResourceCap: z.ZodOptional<z.ZodPipe<z.ZodObject<{
        maxCpu: z.ZodOptional<z.ZodNumber>;
        maxMemory: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>, z.ZodTransform<{
        maxCpu: number | undefined;
        maxMemoryBytes: number | undefined;
    }, {
        maxCpu?: number | undefined;
        maxMemory?: string | undefined;
    }>>>;
    machinePools: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        cap: z.ZodPipe<z.ZodObject<{
            maxCpu: z.ZodOptional<z.ZodNumber>;
            maxMemory: z.ZodOptional<z.ZodString>;
        }, z.core.$strict>, z.ZodTransform<{
            maxCpu: number | undefined;
            maxMemoryBytes: number | undefined;
        }, {
            maxCpu?: number | undefined;
            maxMemory?: string | undefined;
        }>>;
    }, z.core.$strict>>>;
    scalers: z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        type: z.ZodEnum<{
            container: "container";
            "bare-metal": "bare-metal";
            firecracker: "firecracker";
        }>;
        maxAgents: z.ZodNumber;
        labelSets: z.ZodArray<z.ZodObject<{
            labels: z.ZodArray<z.ZodString>;
            image: z.ZodOptional<z.ZodString>;
            imagePullPolicy: z.ZodDefault<z.ZodEnum<{
                Always: "Always";
                IfNotPresent: "IfNotPresent";
                Never: "Never";
            }>>;
            binaryPath: z.ZodOptional<z.ZodString>;
            resources: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
                requests: z.ZodOptional<z.ZodObject<{
                    memory: z.ZodOptional<z.ZodString>;
                    cpus: z.ZodOptional<z.ZodNumber>;
                }, z.core.$strict>>;
                limits: z.ZodOptional<z.ZodObject<{
                    memory: z.ZodOptional<z.ZodString>;
                    cpus: z.ZodOptional<z.ZodNumber>;
                }, z.core.$strict>>;
            }, z.core.$strict>, z.ZodObject<{
                memory: z.ZodOptional<z.ZodString>;
                cpus: z.ZodOptional<z.ZodNumber>;
            }, z.core.$strict>]>, z.ZodTransform<{
                requests?: {
                    cpus?: number;
                    memory?: string;
                };
                limits?: {
                    cpus?: number;
                    memory?: string;
                };
            }, {
                memory?: string | undefined;
                cpus?: number | undefined;
            } | {
                requests?: {
                    memory?: string | undefined;
                    cpus?: number | undefined;
                } | undefined;
                limits?: {
                    memory?: string | undefined;
                    cpus?: number | undefined;
                } | undefined;
            }>>>;
            volumes: z.ZodOptional<z.ZodArray<z.ZodString>>;
            containerSocket: z.ZodDefault<z.ZodBoolean>;
            env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
            backpressureMode: z.ZodOptional<z.ZodEnum<{
                pause: "pause";
                drop: "drop";
            }>>;
            networkPolicy: z.ZodOptional<z.ZodObject<{
                allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
                denyAll: z.ZodDefault<z.ZodBoolean>;
            }, z.core.$strip>>;
            rootfsPath: z.ZodOptional<z.ZodString>;
            kernelPath: z.ZodOptional<z.ZodString>;
            vcpuCount: z.ZodOptional<z.ZodNumber>;
            memSizeMib: z.ZodOptional<z.ZodNumber>;
            overlayDriveSizeMib: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strict>>;
        host: z.ZodOptional<z.ZodString>;
        socketPath: z.ZodOptional<z.ZodString>;
        runtime: z.ZodDefault<z.ZodEnum<{
            docker: "docker";
            podman: "podman";
            auto: "auto";
        }>>;
        orchestratorUrl: z.ZodOptional<z.ZodString>;
        extraHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
        networkIsolation: z.ZodDefault<z.ZodBoolean>;
        warmPool: z.ZodOptional<z.ZodObject<{
            enabled: z.ZodDefault<z.ZodBoolean>;
            size: z.ZodDefault<z.ZodNumber>;
            idleTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
        }, z.core.$strip>>;
        mandatoryLabels: z.ZodDefault<z.ZodArray<z.ZodString>>;
        roles: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodEnum<{
            builder: "builder";
            "init-runner": "init-runner";
            all: "all";
        }>>>, z.ZodTransform<string[] | undefined, ("builder" | "init-runner" | "all")[] | undefined>>;
        resourceCap: z.ZodOptional<z.ZodPipe<z.ZodObject<{
            maxCpu: z.ZodOptional<z.ZodNumber>;
            maxMemory: z.ZodOptional<z.ZodString>;
        }, z.core.$strict>, z.ZodTransform<{
            maxCpu: number | undefined;
            maxMemoryBytes: number | undefined;
        }, {
            maxCpu?: number | undefined;
            maxMemory?: string | undefined;
        }>>>;
        machinePool: z.ZodOptional<z.ZodString>;
        enforceCgroups: z.ZodDefault<z.ZodBoolean>;
        firecrackerPath: z.ZodOptional<z.ZodString>;
        jailerPath: z.ZodOptional<z.ZodString>;
        kernelPath: z.ZodOptional<z.ZodString>;
        chrootBaseDir: z.ZodDefault<z.ZodString>;
        uid: z.ZodOptional<z.ZodNumber>;
        gid: z.ZodOptional<z.ZodNumber>;
        vcpuCount: z.ZodDefault<z.ZodNumber>;
        memSizeMib: z.ZodDefault<z.ZodNumber>;
        requireSudo: z.ZodDefault<z.ZodBoolean>;
    }, z.core.$strict>>;
    firecracker: z.ZodOptional<z.ZodObject<{
        cidr: z.ZodDefault<z.ZodString>;
        bridgeName: z.ZodDefault<z.ZodString>;
        gateway: z.ZodDefault<z.ZodString>;
        netmask: z.ZodDefault<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>;
/**
 * Parse a memory string with unit suffix to bytes.
 *
 * Supported formats:
 * - "512m" or "512M" -> 536870912 (512 * 1024^2)
 * - "2g" or "2G" -> 2147483648 (2 * 1024^3)
 * - "1024k" or "1024K" -> 1048576 (1024 * 1024)
 *
 * @throws Error if the format is invalid
 */
export declare function parseMemoryString(memory: string): number;
/**
 * Load and validate the scaler configuration from YAML files.
 *
 * 1. Reads the main config file
 * 2. If scalersDirPath provided, reads all *.yaml and *.yml files
 *    from the directory (sorted alphabetically) and merges their
 *    scalers arrays into the main config
 * 3. Validates the merged config through Zod schema
 *
 * @param configPath - Path to the main scaler YAML config file
 * @param scalersDirPath - Optional path to scalers.d/ directory for additional scaler definitions
 * @returns Validated ScalerConfig
 * @throws ZodError if validation fails
 */
export declare function loadScalerConfig(configPath: string, scalersDirPath?: string): Promise<ScalerConfig>;
//# sourceMappingURL=config.d.ts.map