/**
 * Native-login inventory for `agents apply` and `agents fleet login`.
 * Native OAuth/session files are identified only to report device readiness;
 * agents-cli never serializes or materializes them on another device.
 *
 * Honest boundary: on macOS, claude and antigravity keep their tokens in the
 * login keychain, ACL-bound to the harness process — unreadable by us. Those are
 * classified `bound` and surfaced for a one-time manual login, never faked.
 */
import type { AuthSnapshotResult } from './types.js';
/** A portable credential file location, relative to $HOME. */
interface AuthFileSpec {
    rel: string;
    mode: number;
}
/**
 * Verified portable auth-file locations per agent (home-relative). Sourced from
 * live inspection of a Linux fleet box + the agent registry. Agents absent here
 * have no portable credential file we can propagate.
 */
export declare const FLEET_AUTH_FILES: Record<string, AuthFileSpec[]>;
/** Agents whose macOS credentials live in the ACL-bound login keychain. */
export declare const KEYCHAIN_BOUND_ON_MAC: ReadonlySet<string>;
/**
 * Agents whose OAuth credentials rely on single-use refresh tokens that rotate
 * server-side on every exchange. Copying these credential files across machines
 * is fatal: the first refresh on any box invalidates every other holder's token,
 * collapsing the fleet to a single working login (droid/WorkOS collapsed 10 boxes
 * to 1 overnight — RUSH-1958). Add any newly-discovered single-use-rotation
 * harness here; the predicate below is the one place the propagation decision is
 * made. See also `remote-login.ts` and `usage.ts` for the per-machine-login policy.
 */
export declare const SINGLE_USE_ROTATING_REFRESH_AGENTS: ReadonlySet<string>;
/**
 * Whether `agent`'s login may be copied between machines by `apply`. Always
 * **false** now (RUSH-2527): every `FLEET_AUTH_FILES` entry is a native,
 * rotating OAuth / session login, and the fleet-auth contract forbids copying any
 * of them between devices (`docs/specifications.md` SING-1b) — not just the
 * single-use-rotating subset (`SINGLE_USE_ROTATING_REFRESH_AGENTS`) that first
 * motivated this gate. `apply` therefore never propagates a login; it surfaces
 * per-box login / portable-account guidance instead. `snapshotAuth` reads no
 * credential file as a result, so a native login never leaves its origin box.
 * The `agent` parameter is retained for the stable call signature.
 */
export declare function isCredentialSafeToPropagate(_agent: string): boolean;
/** True when the agent stores credentials in portable files we can read. This
 *  does NOT mean it is safe to propagate — check {@link isCredentialSafeToPropagate}. */
export declare function hasPortableAuthFiles(agent: string): boolean;
/** Which agents `apply` can propagate auth for at all. */
export declare function isPropagatableAgent(agent: string): boolean;
/**
 * The shape of a login flow — enough for `agents fleet login` to drive a remote
 * box's device-code OAuth over SSH and scrape the verification URL + user code.
 *
 * `flowType` decides remotability:
 *  - `device-code` — the remote box prints a URL + short code the human enters in
 *    a browser on THIS machine. The only flow `fleet login` can orchestrate.
 *  - `loopback`    — the CLI opens a browser and listens on 127.0.0.1 on the
 *    remote box; the redirect must reach that box's own loopback, so it can only
 *    be completed with a browser on the same machine. Non-remotable.
 *  - `api-key`     — a pasted key, not an OAuth handshake. Non-remotable.
 *  - `unknown`     — flow not yet characterized (no captured output). Non-remotable
 *    until someone captures the real pattern and fills the regexes.
 */
export type LoginFlowType = 'device-code' | 'loopback' | 'api-key' | 'unknown';
export interface LoginFlow {
    /**
     * The exact command that starts the login flow on the remote box, run as
     * `ssh -tt <box> <loginCommand>`. Bare `<cli>` for agents whose device flow
     * starts on launch (droid, kimi, antigravity), `<cli> login` for
     * codex/grok, `<cli> auth login` for opencode.
     */
    loginCommand: string;
    flowType: LoginFlowType;
    /**
     * Keystrokes sent after launch to force the device-code path when the CLI
     * presents a menu (codex: pick "Sign in with Device Code") or requires a
     * sub-command inside a TUI (kimi: `/login`). Sent verbatim through the PTY,
     * so it must include the submitting CR (`\r`). Absent when the flow needs no
     * steering.
     */
    deviceCodeSelect?: string;
    /** Captures the verification URL from scraped login output (group 1 preferred). */
    verificationUrlRegex?: RegExp;
    /** Captures the user code from scraped login output (group 1 preferred). */
    userCodeRegex?: RegExp;
    /**
     * Home-relative credential file that appears / bumps mtime on success — the
     * completion signal. Mirrors {@link FLEET_AUTH_FILES} (first entry for agents
     * with several).
     */
    successFile: string;
}
/**
 * Per-agent login flows, populated from live login-output captures (the only
 * ground truth — no fixtures exist upstream). Agents whose real device-code
 * output has not been captured are marked honestly (`unknown` / no regexes) so
 * `fleet login` flags them non-remotable instead of guessing.
 *
 * Only the `device-code` entries are ones `fleet login` drives; the rest are
 * carried so the command can explain WHY a logged-out pair is not remotable.
 */
export declare const FLEET_LOGIN_FLOWS: Record<string, LoginFlow>;
export interface SnapshotOptions {
    /** Home directory to read credential files from. */
    home: string;
    /** Platform of the source machine (`process.platform`). */
    platform: NodeJS.Platform;
}
/**
 * Capture portable credential files for the given agents from a source home.
 * Returns the readable file payloads plus the list of agents whose auth is
 * device-bound (macOS keychain) and therefore cannot be captured. Agents that
 * are simply not signed in (no file on disk) are silently omitted — nothing to
 * propagate, not an error.
 */
export declare function snapshotAuth(agents: string[], opts: SnapshotOptions): AuthSnapshotResult;
export {};
