/**
 * `agents devices lease` — manage the disposable cloud boxes used by `agents run --lease`.
 *
 * Today: `agents devices lease prune`, which stops expired + idle "orphan" boxes that are
 * holding a provider's server quota (the cause of the `server_limit` 403 a new
 * lease hits). Reaping is conservative: only boxes whose lease has expired AND
 * that have been untouched for a safety window are eligible (see `isReapSafe`),
 * so a box a concurrent run just reused is never stopped.
 */
import type { Command } from 'commander';
import { type CrabboxBox } from '../lib/crabbox/cli.js';
/** Compact human duration: "45s", "12m", "2h", "1h 5m". Clamps negatives to 0. */
export declare function fmtDurationShort(secs: number): string;
/** Idle time since the box was last touched, e.g. "idle 5m" / "idle ?". */
export declare function fmtIdleShort(box: CrabboxBox, nowSecs: number): string;
/** Time until the lease expires, e.g. "expires 42m" / "expires ?" / "expired". */
export declare function fmtExpiresShort(box: CrabboxBox, nowSecs: number): string;
/** Reachable address for a leased box: tailnet FQDN/IP first, else public IP. */
export declare function boxAddress(box: CrabboxBox): string | undefined;
/** Human status: "ready" when usable, else the raw bootstrap state/status. */
export declare function boxStatus(box: CrabboxBox): string;
/**
 * Warm boxes eligible for reuse: `ready` and the lease has not expired.
 * Sorted most-recently-touched first so `--reuse` / the auto-pick lands on the
 * freshest box (an untouched `lastTouchedAt` sorts last).
 */
export declare function reusableBoxes(boxes: CrabboxBox[], nowSecs: number): CrabboxBox[];
/** One aligned row for the reuse picker / `agents devices lease list`. */
export declare function formatBoxRow(box: CrabboxBox, nowSecs: number): string;
/** Validate a Hetzner token against the live API. Exported for unit tests (fetch injectable). */
export declare function validateHetznerToken(token: string, fetchImpl?: typeof fetch): Promise<'valid' | 'invalid' | 'unreachable'>;
/**
 * One-time credential setup for `agents run --lease` (Hetzner today). Opens the
 * token page, collects a token, validates it against the live API, stores it in
 * the keychain bundle `hetzner.com`, and persists it as the default lease bundle
 * (so `--lease` needs no env var or flag afterward). Returns true on success.
 * Never throws for expected outcomes (non-interactive, cancel, repeated failure).
 */
export declare function runLeaseSetup(opts?: {
    provider?: string;
}): Promise<boolean>;
export declare function registerLeaseCommand(devicesCommand: Command): void;
