/**
 * Vigthoria CLI — shared local-state helpers.
 *
 * Single source for:
 *   • Offline-mode detection (VIGTHORIA_OFFLINE=1) — suppresses every
 *     background network call (update checks, gateway preflights, etc.).
 *   • Telemetry opt-out (VIGTHORIA_TELEMETRY_DISABLED=1).
 *   • Update-check cache, so `npm view` is not invoked on every CLI start.
 *   • Cross-platform safe file mode enforcement for tokens / sessions.
 *
 * No external network calls — pure local helpers.  Safe to import from
 * any command module.
 */
/** 24h is plenty for an update-check ping. */
export declare const UPDATE_CHECK_TTL_MS: number;
/** 60s gateway-preflight cache so back-to-back CLI invocations stay fast. */
export declare const GATEWAY_PREFLIGHT_TTL_MS: number;
export interface CliStateShape {
    updateCheck?: {
        checkedAt: number;
        latestVersion: string;
        notifiedFor?: string;
    };
    gatewayPreflight?: {
        checkedAt: number;
        valid: boolean;
    };
    /** Last-seen version — used to render release notes on upgrade. */
    lastSeenVersion?: string;
}
export declare function ensureStateDir(): void;
/** Best-effort lock-down: `0o600` on POSIX, no-op on Windows (NTFS ACL ≠ chmod). */
export declare function secureFileMode(filePath: string): void;
/** Atomic write helper — write to temp then rename, never half-written JSON. */
export declare function atomicWriteJson(targetPath: string, value: unknown, mode?: number): void;
export declare function loadCliState(): CliStateShape;
export declare function saveCliState(state: CliStateShape): void;
export declare function getCliStateFile(): string;
/**
 * Offline mode — set VIGTHORIA_OFFLINE=1 to skip every non-essential
 * outbound HTTP call. Useful for restricted networks, air-gapped runs,
 * and deterministic CI.
 */
export declare function isOfflineMode(): boolean;
/** Telemetry opt-out (also implied when offline mode is on). */
export declare function isTelemetryDisabled(): boolean;
/** When true the startup update check is suppressed (env override or offline). */
export declare function isUpdateCheckSuppressed(): boolean;
/** Cached read for the latest known version — null when stale or absent. */
export declare function readCachedLatestVersion(maxAgeMs?: number): string | null;
export declare function writeCachedLatestVersion(latestVersion: string, notifiedFor?: string): void;
export declare function readGatewayPreflightCache(maxAgeMs?: number): boolean | null;
export declare function writeGatewayPreflightCache(valid: boolean): void;
export declare function isSafeNpmPackageSpec(spec: string): boolean;
