/** * CLI self-update plumbing. * * Two responsibilities: * 1. A throttled, non-blocking "update available" notice shown on startup * (reads a cached result; refreshes it in a detached background process so * the hot path never waits on the network). * 2. Shared helpers for the `memi self-update` command. * * Behaviour is opt-out via MEMOIRE_NO_UPDATE_CHECK=1 and opt-in auto-apply via * MEMOIRE_AUTO_UPDATE=1. The notifier must NEVER throw or block the CLI. */ export declare const PKG_NAME = "@memi-design/cli"; export type InstallChannel = "npm" | "binary"; export interface UpdateCache { lastCheckAt: string; latestVersion: string | null; channel: InstallChannel; } export declare function getInstallChannel(): InstallChannel; export declare function updateCachePath(): string; export declare function readUpdateCache(): UpdateCache | null; export declare function writeUpdateCache(cache: UpdateCache): void; /** * Semver precedence comparison. Returns -1, 0, or 1. * Handles a leading `v`, the X.Y.Z core, and prerelease tags (a release * outranks a prerelease of the same core; numeric identifiers compare * numerically). Build metadata (`+...`) is ignored, per semver. */ export declare function compareSemver(a: string, b: string): number; export declare function isNewer(latest: string, current: string): boolean; /** Fetch the latest published version from npm. Returns null on any failure. */ export declare function fetchLatestVersion(timeoutMs?: number): Promise; /** Refresh and persist the update cache from the network. */ export declare function refreshUpdateCache(): Promise; /** * Show an "update available" notice on startup, refreshing the cache in the * background when stale. With MEMOIRE_AUTO_UPDATE=1 (npm installs only) it * applies the update synchronously instead of just notifying. * * Writes to stderr so stdout (and `--json`) stays clean. Never throws. */ export declare function maybeNotifyUpdate(opts: { currentVersion: string; mcpMode: boolean; jsonOutput: boolean; }): Promise;