interface VersionCache { latest: string; min: string; checkedAt: number; /** Last time the npm registry itself was consulted (rate-limits the fallback). */ npmCheckedAt?: number; } type UpdateAction = 'none' | 'auto-update' | 'force-block'; interface UpdateCheckResult { action: UpdateAction; latest: string; min: string; } export declare function setCliVersion(version: string): void; export declare function getCliVersion(): string; /** Returns -1 if a < b, 0 if equal, 1 if a > b. Handles x.y.z format. */ export declare function compareSemver(a: string, b: string): number; export declare function cacheVersionInfo(latest: string, min: string, npmCheckedAt?: number, opts?: { allowLower?: boolean; }): void; export declare function getCachedVersionInfo(): VersionCache | null; export declare function fetchLatestFromNpm(): Promise; export declare function checkForUpdate(currentVersion: string, cache: VersionCache): UpdateCheckResult; interface InstallOwner { kind: 'npm' | 'pnpm' | 'yarn' | 'bun' | 'npx' | 'unknown'; /** Command that updates this install in place; absent when we can't safely update it. */ updateCmd?: string; } /** * Works out which package manager owns this install by resolving the real path * of the running script — updating with the wrong one leaves a second, shadowed * copy on PATH. npm_config_user_agent is only set when running under a package * manager, so it can't be trusted from a plain terminal. Order matters below: * the pnpm/bun/yarn/npx global dirs all contain node_modules segments too. */ export declare function detectInstallOwner(binPath?: string): InstallOwner; /** * The npm-style prefix that owns a globally installed copy, derived from the * running script's real path (/lib/node_modules/agent-cards/…, or * /node_modules/… on prefix-less layouts). This is what lets the * self-update heal multi-prefix machines (nvm/volta/hermes/vite-plus): when * the npm on PATH manages a DIFFERENT prefix, we update the owning one * explicitly instead of refusing — `npm i -g --prefix ` reaches the * copy this shell actually runs. Exported for tests. */ export declare function owningPrefixOf(realPath: string): string | null; export declare function performSelfUpdate(): { success: boolean; error?: string; }; /** * Version of the agent-cards package that process.argv[1] resolves to right * now. Re-reading this after a self-update tells us whether the update landed * on the copy this shell actually runs, or on a different (shadowed) install. */ export declare function readInstalledVersion(): string | null; export declare function handleUpdateCheck(currentVersion: string): Promise; export {}; //# sourceMappingURL=update.d.ts.map