export function resolveRuntimeMcpPreflightMode(env = process.env) {
    const raw = env.OMK_MCP_PREFLIGHT?.trim();
    if (!raw)
        return "warn-skip";
    if (raw === "strict" || raw === "warn-skip")
        return raw;
    return "off";
}
function resolvePreflightTimeout(env = process.env) {
    const raw = env.OMK_MCP_PREFLIGHT_TIMEOUT_MS;
    if (!raw)
        return 5000;
    const n = Number.parseInt(raw, 10);
    return Number.isFinite(n) && n > 0 ? n : 5000;
}
function resolvePreflightConcurrency(env = process.env) {
    const raw = env.OMK_MCP_PREFLIGHT_CONCURRENCY;
    if (!raw)
        return 3;
    const n = Number.parseInt(raw, 10);
    return Number.isFinite(n) && n > 0 ? n : 3;
}
export function resolveRuntimeMcpPreflightOptions(env = process.env) {
    return {
        mode: resolveRuntimeMcpPreflightMode(env),
        timeoutMs: resolvePreflightTimeout(env),
        concurrency: resolvePreflightConcurrency(env),
    };
}
