/** * Process-wide concurrency bound for module transform work. * * Draws permits from the SSR module loader's configurable transform semaphore * (`SSR_MAX_CONCURRENT_TRANSFORMS`), so orchestrator module transforms and SSR * component transforms share one operator-controlled capacity pool instead of * stacking independent limits. * * @module rendering/orchestrator/module-loader/transform-permit */ /** * Observe (and optionally stall) transforms while they hold a permit; tests * only. Pass undefined to clear. */ export declare function __setModuleTransformActivityObserverForTests(observer: ((activeCount: number) => void | Promise) | undefined): void; /** Shrink the no-progress stall window; tests only. Pass undefined to clear. */ export declare function __setModuleTransformStallTimeoutForTests(timeoutMs: number | undefined): void; interface ModuleTransformPermitOptions { /** Stable tenant identity used by the shared per-project capacity guard. */ projectId: string; /** Development is single-tenant and bypasses only the per-project guard. */ dev: boolean; /** Cancellation for the transform flight or its owner. */ signal?: AbortSignal; /** Owner deadline that already bounds the complete module-loading stage. */ ownerDeadlineSignal?: AbortSignal; } /** * Run `work` while holding a permit from the shared transform semaphore. * * Callers must invoke this only around leaf transform work — after singleflight * dedupe and cache-hit checks, and never across recursive dependency fan-out — * so neither followers of an in-flight transform nor coordinating ancestors * consume capacity while another transform computes on their behalf. * * A module-loading owner already supplies its idle and hard deadline, so that * signal remains the only clock for the wait. Standalone callers without an * owner deadline use a liveness window: concrete transform progress or permit * turnover re-arms it, while a genuinely stuck pool still fails. The transform * flight signal always aborts a queued wait when no caller remains. */ export declare function withModuleTransformPermit(options: ModuleTransformPermitOptions, work: (reportProgress: () => void) => Promise): Promise; export {}; //# sourceMappingURL=transform-permit.d.ts.map