import type { AgentId } from '../lib/types.js';
import { type RotateCandidate } from '../lib/accounting/rotate.js';
export interface RunAccountChoice {
    name: string;
    value: string;
    disabled?: string;
    /** Can serve a run right now: signed in, authenticated, and under quota. */
    ready: boolean;
    /**
     * Selectable, but picking it launches the harness so you can authenticate
     * first (RUSH-2334). Mutually exclusive with `ready`; never `disabled`.
     */
    signInRequired: boolean;
}
/** One named account row for `agents accounts switch` (reuses this picker's layout). */
export interface SwitchAccountRow {
    accountName: string;
    kind: 'provider' | 'native';
    detail: string;
    current: boolean;
    candidate: RotateCandidate | null;
}
/** Human-readable remaining capacity for every window the provider exposes. */
export declare function formatAccountLimits(candidate: RotateCandidate): string;
/** Build aligned picker rows with usable accounts first and unsafe rows disabled. */
export declare function buildRunAccountChoices(candidates: RotateCandidate[], globalDefault: string | null): RunAccountChoice[];
/**
 * Aligned picker rows for `accounts switch`. Same columns as the run picker
 * (identity, status, limits) but the value is the named account to set-default.
 * Rows stay selectable: setting a default is not a launch.
 */
export declare function buildSwitchAccountChoices(rows: SwitchAccountRow[]): RunAccountChoice[];
/**
 * Prompt for the named account that becomes this harness's default.
 * A cancelled picker writes nothing.
 */
export declare function pickSwitchAccount(agent: AgentId, rows: SwitchAccountRow[]): Promise<string | null>;
/**
 * Whether a zero-healthy run may recover by launching for a login, or must keep
 * failing loud. Three inputs, all of which have to hold:
 *
 * - `recoverable` — at least one excluded account is only auth-blocked. An
 *   all-throttled set is never launched (RUSH-2132): only a window reset clears it.
 * - `tty` — a login needs a human present; off a TTY nobody can complete one.
 * - `json` — `--json` marks a MACHINE consumer, which must never be handed a
 *   picker or dropped into a login TUI. This mirrors the canonical
 *   `Surface.interactive = tty && !json` in `commands/utils.ts`; a `--json` caller
 *   gets the parseable fail-loud error instead.
 */
export declare function signInLaunchDecision(input: {
    recoverable: number;
    tty: boolean;
    json: boolean;
}): 'launch' | 'fail-loud';
/**
 * How a `balanced`/`available` run reacts when every account's usage is stale and
 * none is verified (PHNX-2526). A human present at a real terminal gets the
 * account `picker` — they can choose knowing the numbers are stale — while every
 * unattended shape (`--headless`, `--json`, or no TTY) `fail-loud`s with
 * NO_VERIFIED_USAGE rather than silently guess on a stale snapshot. `headless`
 * joins the gate because a routine/machine dispatch can carry a TTY yet have no
 * human to answer a picker; the split mirrors `signInLaunchDecision`.
 */
export declare function noVerifiedUsageDecision(input: {
    tty: boolean;
    json: boolean;
    headless: boolean;
}): 'picker' | 'fail-loud';
/**
 * Choose which installed version to launch so the user can authenticate, when a
 * strategy found zero healthy accounts but at least one is merely signed out
 * (RUSH-2334). Returns the version to launch, or null if the user cancelled.
 *
 * A single candidate does NOT prompt — a one-item picker is pure noise, and the
 * only thing to decide has one answer. Several candidates fall through to the
 * normal account picker, which shows every account with its state so the choice
 * is informed (throttled rows stay disabled there).
 *
 * Callers MUST have already confirmed an interactive terminal: off a TTY there
 * is nobody to complete the login, and the run should fail loud instead.
 */
export declare function pickSignInLaunchVersion(agent: AgentId, recoverable: RotateCandidate[], quiet?: boolean): Promise<string | null>;
/** Prompt for one safe installed account/version. A cancelled picker launches nothing. */
export declare function pickRunAccountCandidate(agent: AgentId): Promise<RotateCandidate | null>;
