export function applyNarutoBackpressure(requestedActiveWorkers, pressure) {
    const requested = Math.max(1, Math.floor(requestedActiveWorkers));
    const multiplier = pressure.state === 'saturated' ? 0.25 : pressure.state === 'throttled' ? 0.5 : 1;
    const adjusted = Math.max(1, Math.floor(requested * multiplier));
    return {
        schema: 'sks.naruto-backpressure.v1',
        requested_active_workers: requested,
        adjusted_active_workers: adjusted,
        backpressure: pressure.state,
        reasons: pressure.reasons
    };
}
//# sourceMappingURL=naruto-backpressure.js.map