export type LayerStatus = 'ok' | 'warning' | 'blocker'; export interface LayerResult { readonly status: LayerStatus; readonly message: string; readonly remediation: string; readonly observed?: Readonly>; } export interface PrecheckOptions { readonly projectRoot: string; readonly strict?: boolean; } export interface PrecheckEnvelope { readonly ok: boolean; readonly overall: LayerStatus; /** `null` when the root `package.json` is missing or unreadable — see `rootVsShared`. */ readonly rootVersion: string | null; readonly strict: boolean; readonly snapshotAt: string; readonly layers: { readonly rootVsShared: LayerResult; readonly tagCollision: LayerResult; readonly changesetStaged: LayerResult; readonly workspaceLockstep: LayerResult; }; } export declare const SEMVER_RE: RegExp; export declare function upgrade(result: LayerResult, strict: boolean | undefined): LayerResult; /** * Outcome of reading a `package.json`. Never throws: an unreadable root manifest * is an ordinary precheck blocker, not an unhandled CLI error. Before this, a * project without `package.json` made `peaks release canary` crash with * `{ command: "cli", code: "UNHANDLED_ERROR" }` instead of a `PRECHECK_BLOCKER` * naming the missing file. */ export type PackageJsonRead = { readonly ok: true; readonly value: T; } | { readonly ok: false; readonly message: string; readonly remediation: string; }; /** Read + parse a JSON manifest, mapping both failure modes onto a blocker description. */ export declare function readPackageJson(path: string, label: string): PackageJsonRead; export type RootVersionRead = { readonly ok: true; readonly version: string; } | { readonly ok: false; readonly message: string; readonly remediation: string; }; export declare function readRootVersion(projectRoot: string): RootVersionRead;