import { type DevicePlacementSignal } from '../teams/scheduler.js';
/** Why a candidate was dropped, for the fail-loud error message. */
export interface WorkerExclusion {
    device: string;
    reason: 'unreachable' | 'probe timed out' | 'overloaded' | 'wrong-platform' | 'interactive';
}
export interface WorkerPickPlan {
    /** The chosen device name. Never the local box unless it is an auto-pool member. */
    device: string;
    /** True when the pick IS this machine (the caller should run in place). */
    isLocal: boolean;
    candidates: Array<{
        device: string;
        loadPercent?: number;
        headroom?: string;
    }>;
    excluded: WorkerExclusion[];
}
export interface WorkerPickOptions {
    /** Restrict to these platforms. Defaults to POSIX (`linux`, `macos`). */
    platforms?: string[];
    /** Override the candidate pool (tests). */
    eligibleHosts?: string[];
    localMachine?: string;
    /** Injected probe (tests). */
    probe?: (pool: string[]) => Promise<Map<string, DevicePlacementSignal>>;
}
/**
 * Platforms a bun/vitest offload can actually run on.
 *
 * Windows is excluded by policy, not by accident: `AGENTS.md` states Windows is
 * not a required PR or ordinary-release platform and `tests.yml` runs it only as
 * a `continue-on-error` post-merge smoke. Silently shipping the tree to
 * `win-mini` would produce a confusing failure for a platform whose result
 * nobody gates on.
 */
export declare const POSIX_PLATFORMS: readonly ["linux", "macos"];
/**
 * Resolve the least-loaded eligible worker.
 *
 * Throws — never returns a degraded answer. An offload helper that quietly
 * decided "no worker, run here" would recreate exactly the failure the offload
 * exists to prevent: the operator believes the work went to the fleet while
 * their laptop is pinned. Callers surface the thrown message verbatim.
 */
export declare function resolveWorkerDevice(opts?: WorkerPickOptions): Promise<WorkerPickPlan>;
/** The one no-worker message, naming every candidate and why it was dropped. */
export declare function formatNoWorkerError(excluded: WorkerExclusion[], platforms: Set<string>): string;
