framework
Version:
The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.
44 lines • 2.03 kB
TypeScript
/**
* CLI "up-to-date?" check (#312): after the bare-`framework` version footer,
* tell the user whether a newer version is published on npm. Display only;
* auto-update is a separate, deferred concern. Same seam + node-adapter +
* forgiving-on-error convention as `project.ts` (#380).
*/
/** The npm package this CLI ships as; the registry key for the version check. */
export declare const PACKAGE_NAME = "framework";
/** Fetches the latest published version of `pkg`, or undefined on any failure. Injectable for tests. */
export type VersionFetcher = (pkg: string) => Promise<string | undefined>;
/**
* A {@link VersionFetcher} backed by the npm registry. GETs the packument and
* reads `dist-tags.latest`. A 2.5s AbortSignal.timeout caps it; any error /
* non-ok / offline yields undefined (the check silently degrades to "unknown").
*/
export declare function nodeVersionFetcher(): VersionFetcher;
/** The result of an update check. */
export type UpdateStatus = {
kind: 'up-to-date';
current: string;
} | {
kind: 'update-available';
current: string;
latest: string;
} | {
kind: 'unknown';
current: string;
};
/**
* Compare two `major.minor.patch` versions numerically (a prerelease/build
* suffix after `-` or `+` is stripped, missing parts read as 0). Returns
* -1 / 0 / 1. No semver dependency.
*/
export declare function compareVersions(a: string, b: string): number;
/**
* Check whether `current` is behind the latest published version. Uses the
* injected fetcher; a missing/failed fetch is 'unknown'. `current` >= latest is
* 'up-to-date' (so running a local build ahead of the registry never reads as
* "update available").
*/
export declare function checkForUpdate(current: string, fetchLatest: VersionFetcher, pkg?: string): Promise<UpdateStatus>;
/** The one-line message to print for a status, or undefined for 'unknown' (print nothing). */
export declare function formatUpdateStatus(status: UpdateStatus): string | undefined;
//# sourceMappingURL=update-check.d.ts.map