/**
 * Self-heal stale per-project state on startup.
 *
 * The bug this guards against: after a `git reset` (or manual deletion of
 * `<installDir>/ampli.json`), the wizard's per-project caches are still
 * pointing at the prior org/project/API key.
 *
 *   - `<installDir>/ampli.json`  ── source of truth for "this codebase is
 *     bound to an Amplitude project". Tracked in git, so `git reset` wipes
 *     it whenever the user resets past the commit that introduced it.
 *
 *   - `<installDir>/.amplitude/` ── gitignored. Survives `git reset`.
 *     Holds `events.json` (approved event plan) and `dashboard.json`
 *     (created dashboard URL).
 *
 *   - `~/.amplitude/wizard/runs/<sha256(installDir)>/checkpoint.json` ──
 *     per-user cache. Survives `git reset`. Holds region, selected org/
 *     project IDs, framework detection, intro state.
 *
 *   - `~/.amplitude/wizard/credentials.json` ── per-user, keyed by
 *     install-dir hash. Survives `git reset`. Holds the API key used for
 *     the prior project.
 *
 * Without healing, `bin.ts` does:
 *   1. `loadCheckpoint()` → `Object.assign(session, checkpoint)`
 *      (now `session.selectedOrgId/ProjectId/region/introConcluded` are
 *      pre-populated from the stale checkpoint)
 *   2. `resolveCredentials()` reads the stale API key from credentials.json
 *      and wires `session.credentials` from it. The safety check at
 *      `credential-resolution.ts:576` does NOT fire because `selectedOrgId`
 *      is set (from the checkpoint).
 *   3. `requiresAccountConfirmation` is true, so the user lands on
 *      "Continue with this Amplitude project?" pointing at a project they
 *      thought they wiped — or worse, the OAuth flow is skipped entirely
 *      and the wizard silently routes them past auth.
 *
 * The user's mental model is "git reset = clean slate". This module makes
 * the wizard agree with that mental model.
 *
 * Heuristic: ampli.json missing AND any per-project cache present →
 * inconsistent state, wipe per-project caches. User-level state
 * (`~/.ampli.json` OAuth tokens, credentials for OTHER install dirs) is
 * never touched — the user stays signed in, they just have to re-pick a
 * project for this codebase.
 */
export interface SelfHealResult {
    healed: boolean;
    /** Human-readable reason. Useful in logs / telemetry. */
    reason: string;
    /** Filesystem paths (or symbolic markers) actually removed. */
    artifactsRemoved: string[];
}
/**
 * Detect and fix inconsistent per-project state caused by a `git reset` or
 * manual deletion of `<installDir>/ampli.json`. Safe to call unconditionally
 * at startup — no-ops on fresh projects and on healthy projects.
 *
 * Synchronous so the startup path doesn't have to await a microtask before
 * `loadCheckpoint`/`resolveCredentials` run.
 */
export declare function selfHealStaleProjectState(installDir: string): SelfHealResult;
