vibe-tools
Version:
CLI tools for AI agents
34 lines (33 loc) • 1.23 kB
TypeScript
export interface VersionInfo {
current: string;
latest: string | null;
isOutdated: boolean;
}
/**
* Gets the currently installed version of vibe-tools by searching upwards
* for a package.json file with the name "vibe-tools".
*/
export declare function getCurrentVersion(): string;
/**
* Gets the latest available version of vibe-tools from the NPM registry.
* Uses `npm view vibe-tools version`.
*/
export declare function getLatestVersion(): Promise<string | null>;
/**
* Compare two semantic version strings
* Returns:
* - 1 if version1 > version2
* - 0 if version1 = version2
* - -1 if version1 < version2
*/
export declare function compareVersions(version1: string, version2: string): number;
/**
* Check if version1 is newer than or equal to version2
*/
export declare function isVersionNewerOrEqual(version1: string, version2: string): boolean;
/**
* Checks if the currently installed version is outdated compared to the latest NPM version.
* Note: This uses simple string comparison. For robust comparison (e.g., handling pre-releases),
* a library like 'semver' would be better, but sticking to simplicity for now.
*/
export declare function checkPackageVersion(): Promise<VersionInfo>;