/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * Exit code used to signal that the child process wants a relaunch.
 * The parent process should check for this code and respawn if needed.
 */
export declare const RELAUNCH_EXIT_CODE = 75;
export declare const MAX_HEAP_CAP_MB = 8192;
/**
 * Check if debug mode is enabled via environment variables.
 * This is a lightweight check that doesn't require loading any configuration.
 */
export declare function isDebugMode(): boolean;
/**
 * Determine if the process should be relaunched with higher memory limits.
 * This check is performed BEFORE loading any configuration to avoid
 * wasting time on initialization that would be discarded during relaunch.
 *
 * @param debugMode - Whether to log debug information
 * @returns Array of Node.js arguments for relaunch, or empty array if no relaunch needed
 */
export declare function shouldRelaunchForMemory(debugMode: boolean): string[];
/**
 * Parse a Docker/Podman memory format string into megabytes.
 * Docker format: plain number = bytes, k = kilobytes, m = megabytes, g = gigabytes.
 *
 * @param memoryStr - Memory string in Docker format (e.g. "6g", "4096m", "1073741824")
 * @returns Memory in MB, or undefined if unparseable
 */
export declare function parseDockerMemoryToMB(memoryStr: string): number | undefined;
/**
 * Compute --max-old-space-size for a NEW sandbox process.
 * Unlike shouldRelaunchForMemory(), this ALWAYS returns memory args
 * because the sandbox process starts fresh with Node.js defaults (~950MB).
 *
 * @param debugMode - Whether to log debug information
 * @param containerMemoryMB - Container memory limit in MB, or undefined to use host memory
 * @returns Array containing a single --max-old-space-size argument
 */
export declare function computeSandboxMemoryArgs(debugMode: boolean, containerMemoryMB?: number): string[];
