export interface LoadIdentity { readonly version?: string; readonly commit?: string; } export interface StaleLoadCheck { /** What this process loaded. */ readonly loaded: LoadIdentity; /** One line naming loaded and installed identities, or undefined when they match or cannot be read. */ hint(): string | undefined; } export interface StaleLoadCheckOptions { readonly packageRoot: string | undefined; /** Defaults to the identity on disk when the check is created. */ readonly loaded?: LoadIdentity; readonly now?: () => number; readonly cacheMs?: number; } /** Find the nearest package.json at or above a module's directory. */ export declare function packageRootFrom(moduleUrl: string): string | undefined; /** Resolve HEAD by reading Git's files directly; no subprocess. */ export declare function readHeadCommit(root: string): string | undefined; /** Read the package version and, for a Git checkout, its HEAD commit. */ export declare function readLoadIdentity(packageRoot: string | undefined): LoadIdentity; /** Render an identity such as `1.2.3 (0123456789ab)`; empty when nothing is known. */ export declare function describeLoadIdentity(identity: LoadIdentity): string; export declare function createStaleLoadCheck(options: StaleLoadCheckOptions): StaleLoadCheck; /** The check for the copy of pi-work this module was loaded from, captured at load. */ export declare const staleLoadCheck: StaleLoadCheck; /** Suffix naming the loaded pi-work, for failures a newer copy might not produce. */ export declare function loadedIdentitySuffix(identity?: LoadIdentity): string; /** * Reserve space for the restart hint when bounding tool text. An oversized hint * is itself cut off so the combined output always fits. */ export declare function boundedTextWithHint(rendered: string, maxLength: number, hint: string | undefined): { text: string; truncated: boolean; };