/** * Update-check utility. * * Quietly pings npm once per day, caches the latest published version in * `~/.blockrun/version-check.json`, and exposes a sync helper the CLI * uses to nudge users when they're behind. The check is non-blocking: * fire-and-forget at startup, render the notice on the *next* run if the * network was slow the first time. Users never wait on it. * * Respects two opt-outs: * - `FRANKLIN_NO_UPDATE_CHECK=1` — explicit user preference * - CI-like environments (`CI`, `GITHUB_ACTIONS`, `GITLAB_CI`, etc.) * * Cache format is intentionally small and forward-compatible: new fields * may be added, old fields are tolerated on read. */ /** * Compare two semver strings (stripping a leading `v` and any pre-release * tag after a hyphen — we don't publish prereleases). Returns: * 1 if a > b * -1 if a < b * 0 if equal or unparseable */ export declare function compareSemver(a: string, b: string): number; /** * Refresh the cache in the background if it's stale. Never throws, never * awaited by callers — result lands before next startup. */ export declare function kickoffVersionCheck(): void; export interface UpdateInfo { current: string; latest: string; } /** * Sync check against the cached latest. Returns update info if the cache * knows of a newer version, null otherwise. Safe to call before the first * background check settles — returns null (we don't speculate). */ export declare function getAvailableUpdate(): UpdateInfo | null; /** * Authoritative check that forces a fresh fetch (up to FETCH_TIMEOUT_MS). * Use for on-demand diagnostics like `franklin doctor` where the user * explicitly asked "am I up to date?" and a 24h-stale cache is the wrong * answer. Verified 2026-05-11: between two same-day releases (3.15.91 → * 3.15.92), the daily cache made `franklin doctor` show green for a user * who was actually 4 versions behind (3.15.88), because they ran doctor * in the brief gap between npm publish and the next cache refresh. * * Falls back to the cached value if the fetch fails (offline, slow npm, * etc.) — same behavior as the cached check, just refreshed when * possible. */ export declare function getAvailableUpdateFresh(): Promise;