/**
 * The delegate behind the `gh` PATH shim (`agents __gh --real-gh <path> -- <argv>`).
 *
 * Agents are statically trained to type `gh pr checks …`; the shim intercepts that
 * habit and routes it here so the rate-limit-prone read runs over REST instead of
 * GraphQL — no new command for an agent to remember. This is the Tier-1 scope:
 * only `gh pr checks` is handled; every other invocation execs the real gh
 * byte-for-byte (the shim already passes non-`pr checks` verbs straight to real gh,
 * and this file passes through defensively for anything it cannot cleanly serve).
 *
 * Two switch modes (see the PHNX-3501 plan):
 *   - `--watch` → EAGER REST: own the poll loop, re-anchored to the live head SHA
 *     each tick, so a superseded run's red can never be reported (PHNX-3042).
 *   - one-shot → LAZY: run real gh first; only translate to REST when it fails with
 *     the exact GraphQL rate-limit signal. An over-budget GraphQL call is rejected
 *     at 0 points, so this is nearly free and never reproduces gh's happy path.
 *
 * Fail-open is the rule: anything not cleanly resolvable (no PR number/URL, an
 * unmappable request) execs real gh rather than returning wrong data.
 */
import { type RollupItem } from './rest.js';
interface Parsed {
    realGh: string;
    ghArgs: string[];
}
/** Split `--real-gh <path> -- <gh argv>`; defaults realGh to bare `gh`. */
export declare function parseDelegateArgs(argv: string[]): Parsed;
export interface Target {
    repo: string;
    number: number;
}
/** owner/repo from a git remote URL, or null. */
export declare function repoFromRemote(remoteUrl: string): string | null;
/**
 * Resolve `{repo, number}` from the `gh pr checks` argv + cwd, over git/REST only.
 * Returns null (→ caller passes through to real gh) when it can't be resolved
 * cleanly, e.g. no number and no open PR for the current branch.
 */
export declare function resolveTarget(ghArgs: string[], cwd: string, realGh: string): Promise<Target | null>;
/** Render one rollup as `gh pr checks`-ish lines (or JSON when asked). */
export declare function renderRollup(input: RollupItem[], json: boolean): string;
/**
 * True once CI has settled for this SHA.
 *
 * Check-suites only disambiguate an EMPTY rollup: no checks + no pending suites is
 * "genuinely none" (settled); no checks + a pending suite is "not registered yet"
 * (wait). Once real checks exist we decide on THEM alone and ignore suites — some
 * App integrations (claude/cursor reviewers) register a suite that stays `queued`
 * forever and never posts a run, exactly what `gh pr checks` also ignores.
 */
export declare function isSettled(rollup: RollupItem[], pendingSuites: number): boolean;
/** Eager REST watch: poll to a terminal state, re-anchored to the live head SHA. */
export declare function watchChecks(target: Target, json: boolean, realGh: string): Promise<number>;
/** Lazy one-shot: real gh first; translate to REST only on the exact rate-limit signal. */
export declare function checksOnce(target: Target | null, json: boolean, realGh: string, ghArgs: string[]): Promise<number>;
/** Entry point for the `__gh` early branch in index.ts. */
export declare function runGhOverload(argv: string[], cwd?: string): Promise<number>;
export {};
