/**
 * FrameworkLoginDriver — the concrete `LoginDriver` for the EnrollmentWizard
 * (P2.1 of the Subscription & Auth Standard). It is the "hands" that actually
 * obtain a PUBLIC login artifact (verification URL + optional device code + TTL)
 * from a framework's login flow, so the wizard can surface it to the operator's
 * phone.
 *
 * Design constraints (why the I/O is injected):
 *   - The SCRAPE logic — turning a pane's text into a `{ verificationUrl,
 *     userCode, ttlMs }` artifact — is PURE and must be unit-testable against
 *     real captured-output fixtures with no tmux, no spawning, no network.
 *   - The I/O — spawning the login command under the target account's
 *     `CLAUDE_CONFIG_DIR` and capturing the pane — is INJECTED (`spawn`,
 *     `capture`, `sleep`, `now`). Production wiring (server.ts) passes the real
 *     tmux primitives; tests pass fakes. This also keeps this module decoupled
 *     from SessionManager's spawn internals.
 *
 * SECURITY: this driver only ever reads the PUBLIC artifact a provider prints to
 * be typed into its own page — the verification URL and (for device-code flows)
 * the short user code. It NEVER reads, stores, or returns a token. The actual
 * credential is written by the framework's own login client into the account's
 * config home; instar never touches it.
 */
import type { LoginArtifact, LoginDriver } from './EnrollmentWizard.js';
import type { LoginFlowKind, LoginProvider } from './PendingLoginStore.js';
/** A login flow we know how to launch + scrape. */
export interface FrameworkLoginRequest {
    provider: LoginProvider;
    framework: 'claude-code' | 'codex-cli' | 'gemini-cli' | 'pi-cli';
    kind: LoginFlowKind;
    /** The account's CLAUDE_CONFIG_DIR — isolates this login to its own slot. */
    configHome?: string;
}
/** Injected I/O so the driver is decoupled + hermetically testable. */
export interface FrameworkLoginDriverDeps {
    /**
     * Spawn the framework's login command in a dedicated tmux pane under the
     * given configHome. Returns a session handle the capture fn reads from.
     */
    spawn: (req: FrameworkLoginRequest) => Promise<{
        session: string;
    }>;
    /** Capture the current text of a login pane. */
    capture: (session: string) => Promise<string>;
    /** Await ms (injected so tests don't really wait). */
    sleep?: (ms: number) => Promise<void>;
    now?: () => number;
    logger?: {
        log: (m: string) => void;
        warn: (m: string) => void;
    };
    /** How long to poll the pane for the artifact before giving up (default 60s). */
    scrapeTimeoutMs?: number;
    /** Poll cadence while waiting for the artifact to appear (default 1s). */
    pollIntervalMs?: number;
}
export declare class FrameworkLoginDriver {
    private readonly deps;
    private readonly sleep;
    private readonly now;
    private readonly logger;
    private readonly scrapeTimeoutMs;
    private readonly pollIntervalMs;
    constructor(deps: FrameworkLoginDriverDeps);
    /**
     * Parse a PUBLIC login artifact out of captured pane text. Pure — no I/O.
     * Returns null until the pane has emitted at least a verification URL (for
     * device-code flows, also a user code). Exported via the static for tests.
     */
    static parseArtifact(paneText: string, kind: LoginFlowKind): LoginArtifact | null;
    /**
     * Drive a framework login: spawn it under the target config home, poll the
     * pane until the public artifact appears (or timeout), and return it. Throws
     * on timeout so the wizard logs + leaves the login for the next sweep.
     *
     * `scrapeTimeoutMs` (per-call) overrides the constructor default for THIS
     * drive only — WS5.2 R6b uses it to give a remote/cloud enrollment a larger
     * budget (cloud→provider latency + the two-code Claude window) without
     * rebuilding the shared production driver. Omitted ⇒ the constructor default
     * (the local-LAN budget) is unchanged. A non-finite/≤0 value is ignored.
     */
    drive(req: {
        provider: LoginProvider;
        framework: FrameworkLoginRequest['framework'];
        kind: LoginFlowKind;
        configHome?: string;
        scrapeTimeoutMs?: number;
    }): Promise<LoginArtifact>;
    /** Adapt to the EnrollmentWizard's LoginDriver signature. */
    asLoginDriver(): LoginDriver;
}
//# sourceMappingURL=FrameworkLoginDriver.d.ts.map