/** * Check for newer versions of mastracode on npm. */ export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun'; /** * Detect which package manager was used to install mastracode globally. * * Uses a multi-tier approach: * 1. npm_config_user_agent env var (set when run via `pnpm run`, `npm run`, etc.) * 2. npm_execpath env var (fallback for script-based invocation) * 3. NODE_PATH env var (set by pnpm global bin stubs) * 4. Resolved path of the running script (process.argv[1]) * 5. Shell-out to `pnpm list -g` to check if pnpm manages the package * 6. Falls back to 'npm' */ export declare function detectPackageManager(): Promise; /** * Build the shell command string a user would run to install/update globally. */ export declare function getInstallCommand(pm: PackageManager, version?: string): string; /** * Read the current version, injected at build time by tsup's `define` option. * Falls back to reading package.json at runtime (e.g. when running from source with tsx). */ export declare function getCurrentVersion(): string; /** * Fetch the latest published version from npm. * Returns null if the fetch fails (network error, timeout, etc.). */ export declare function fetchLatestVersion(): Promise; /** * Simple semver comparison: returns true if `latest` is newer than `current`. * Handles standard x.y.z versions. Ignores pre-release tags. */ export declare function isNewerVersion(current: string, latest: string): boolean; /** * Fetch the CHANGELOG.md for a specific published version from the npm CDN * and extract a human-readable summary of changes. * Returns null if the fetch fails or the changelog can't be parsed. */ export declare function fetchChangelog(version: string): Promise; /** * Extract the changelog section for a specific version and format it * as a concise bullet list suitable for terminal display. */ export declare function parseChangelog(markdown: string, version: string): string | null; /** * Run the appropriate global install command to update mastracode. * Returns true on success, false on failure. */ export declare function runUpdate(pm: PackageManager, targetVersion: string): Promise; //# sourceMappingURL=update-check.d.ts.map