/**
 * Cross-zone org probing for the no-orgs error path.
 *
 * Background — when the user picks a region (US or EU) but their Amplitude
 * organization actually lives on the OTHER region's data center, the data
 * API returns an empty `orgs` array. Without a probe, the wizard would
 * surface "No Amplitude organization found" — a dead-end that doesn't
 * tell the user they're simply on the wrong zone.
 *
 * Tokens are zone-scoped (see `getStoredToken` in `ampli-settings.ts` and
 * the issuer/audience guard added in PR #345). That means we can't reuse
 * the current zone's token to probe the other zone — we have to look up
 * a separately-stored token for the other zone in `~/.ampli.json`.
 *
 * If a token exists, we call `fetchAmplitudeUser` against the other zone
 * and report the org count back to the caller. If not, the caller should
 * surface the "degraded" copy that points to `/region` without the count.
 */
import type { AmplitudeZone } from '../lib/constants.js';
/** Returns the opposite cloud region (us↔eu). */
export declare function otherZone(zone: AmplitudeZone): AmplitudeZone;
export interface OtherZoneProbeResult {
    /** The opposite zone we probed. */
    otherZone: AmplitudeZone;
    /** Number of orgs found on the other zone. `null` when no token was available to probe. */
    otherOrgCount: number | null;
}
/**
 * Probes the other zone for organizations using a separately-stored token.
 *
 * Returns:
 *  - `{ otherZone, otherOrgCount: N }` when a token was found and the API
 *    returned orgs (or 0). N >= 1 means the user has orgs they could switch to.
 *  - `{ otherZone, otherOrgCount: null }` when no token exists for the other
 *    zone (caller should fall back to degraded copy without an org count).
 *
 * Never throws — network/parse failures degrade to `otherOrgCount: null` so
 * the caller can still ship the actionable copy. The whole point of the
 * probe is to make a dead-end recoverable; failing it loud would defeat
 * that goal.
 */
export declare function probeOtherZoneForOrgs(currentZone: AmplitudeZone): Promise<OtherZoneProbeResult>;
/**
 * Error thrown when the user's authenticated zone has no organizations.
 * Carries optional metadata about the other zone so callers (TUI, agent
 * mode, CI) can render an actionable recovery action.
 */
export declare class NoOrgsError extends Error {
    readonly currentZone: AmplitudeZone;
    readonly otherZone: AmplitudeZone;
    /**
     * Org count found on the other zone. `null` when we couldn't probe
     * (no token for the other zone, or the probe API call failed).
     * `0` means we probed and confirmed neither zone has orgs.
     * `>=1` means the user can switch to the other zone to recover.
     */
    readonly otherOrgCount: number | null;
    constructor(message: string, currentZone: AmplitudeZone, otherZone: AmplitudeZone, 
    /**
     * Org count found on the other zone. `null` when we couldn't probe
     * (no token for the other zone, or the probe API call failed).
     * `0` means we probed and confirmed neither zone has orgs.
     * `>=1` means the user can switch to the other zone to recover.
     */
    otherOrgCount: number | null);
}
/**
 * Build the user-facing error copy for a no-orgs situation, given probe results.
 *
 * Branches:
 *  - Other zone has orgs → explicit "switch with /region" hint with count.
 *  - Other zone has 0 orgs (probed, confirmed empty) → "different account or admin" copy.
 *  - Other zone unprobed (no token) → degraded "if your team uses X, switch with /region".
 */
export declare function buildNoOrgsMessage(currentZone: AmplitudeZone, result: OtherZoneProbeResult): string;
