export declare const merchantDuoPackage = "@merchantduo/code"; export type ReleaseFetch = (input: string, init?: RequestInit) => Promise<{ ok: boolean; json(): Promise; }>; export type PackageManager = "npm" | "pnpm"; export type ReleaseCommandRunner = (command: string, args: string[]) => { status: number | null; stdout: string; }; export type MerchantDuoUpdateResult = { message: string; updated: boolean; }; /** Fetch the current npm dist-tag without making startup depend on network health. */ export declare function latestMerchantDuoVersion(fetcher?: ReleaseFetch): Promise; export declare function isNewerMerchantDuoVersion(candidate: string, current: string): boolean; /** A source checkout is deliberately updated by its owner, never by this CLI. */ export declare function isSourceCheckout(root?: string): boolean; /** * Algorithm: * 1. Ask npm and pnpm for their global package roots. * 2. Match the resolved MerchantDuo package directory to exactly one root. * 3. Let only that owning package manager update the global package. */ export declare function globalPackageManager(packageDirectory: string, roots: Partial>): PackageManager | undefined; export declare function detectGlobalPackageManager(packageDirectory?: string, runner?: ReleaseCommandRunner): PackageManager | undefined; export declare function updateMerchantDuo(options: { checkOnly: boolean; currentVersion: string; packageDirectory?: string; fetcher?: ReleaseFetch; runner?: ReleaseCommandRunner; }): Promise;