import { type NpmrcConfig } from '@gjsify/npm-registry';
export type Diagnose404Reason = 'dead-token' | 'live-token-404' | 'unknown';
export interface Diagnose404Result {
    /** Discriminant — drives the JSON shape + exit-code path in the caller. */
    reason: Diagnose404Reason;
    /** Username from `/-/whoami` when reason === 'live-token-404'. */
    username?: string;
    /** Multi-line, human-friendly hint ready for stderr emission. */
    message: string;
}
interface Diagnose404Input {
    /** Full package name including scope, e.g. `@gjsify/abort-controller`. */
    packageName: string;
    /** Pinned version we tried to publish. */
    version: string;
    /** Registry URL (with or without trailing slash). */
    registry: string;
    /** Parsed .npmrc — used to derive Authorization on the whoami probe. */
    npmrc: NpmrcConfig | undefined;
}
/**
 * Probe `/-/whoami` to disambiguate the 404 cause. Best-effort: any thrown
 * error / non-2xx falls through to `reason: 'unknown'` so the caller's
 * generic error path runs untouched.
 *
 * Pure async I/O — no side effects, no process.exit, no console writes.
 * The caller owns presentation (stderr vs stdout, plain vs JSON).
 */
export declare function diagnose404(input: Diagnose404Input): Promise<Diagnose404Result>;
/**
 * Heuristic: is the 404 body the "dead-token-or-missing-package" shape?
 * npm's PUT returns plain text `Not Found` (sometimes empty body). We trigger
 * the diagnostic for both, plus for the JSON `{"error":"Not Found"}` shape
 * just in case. Other 404 bodies (e.g. with a structured npm error code)
 * keep the generic error path.
 */
export declare function is404DiagnosticCandidate(body: string): boolean;
export {};
