import { type Result } from "./docker/result.js"; export interface RunWithBoundedConcurrencyOptions { /** * When true, stop issuing new jobs after the first failure. The orchestrator * is responsible for owning the AbortController and signalling in-flight jobs. */ abortOnFirstFailure?: boolean; /** * Optional abort signal: once aborted, the runner stops issuing NEW jobs. * In-flight jobs are not cancelled โ€” the orchestrator owns the * AbortController and is responsible for signalling them (typically via a * closure over the same signal inside each job factory). */ abortSignal?: AbortSignal; } /** * Run a list of async jobs with a bounded number in-flight at any tick. * * Returns results in INPUT order (job N's result lives at index N) regardless * of completion order. Slots for jobs never issued (abort or first-failure * stop) are left `undefined` โ€” the return type is honest about the holes. */ export declare function runWithBoundedConcurrency(jobs: ReadonlyArray<() => Promise>, concurrency: number, opts?: RunWithBoundedConcurrencyOptions): Promise | undefined>>; /** * Resolve the per-orchestrator-run build concurrency from the * `FJALL_BUILD_CONCURRENCY` environment variable, clamped to `[1, serviceCount]`. * * The env-var contract is shared by every build surface (`fjall build` via * `@fjall/cli` and `fjall deploy` via `@fjall/deploy-core`) โ€” this module is * the single source so the two paths cannot drift. * * - Empty-string env values are rejected (per robustness-standards.md * ยง "Environment Variable Truthy Checks"). * - Non-integer / non-positive values fall back to the default. * - When `serviceCount === 0`, returns `1` (no jobs would be issued anyway). * - The default is CPU-aware (see `defaultBuildConcurrency`). */ export declare function resolveBuildConcurrency(serviceCount: number): number;