import type { TotemConfig } from '@mmnto/totem'; export interface PilotState { startedAt: string; pushCount: number; violations: Array<{ timestamp: string; hook: string; detail: string; }>; } export interface PilotConfig { maxDays: number; maxPushes: number; } /** * Resolve the `pilot` field from TotemConfig into a concrete PilotConfig, * or null if pilot mode is not enabled. */ export declare function resolvePilotConfig(config: TotemConfig): PilotConfig | null; /** * Read the pilot state from disk. If the file is missing or invalid, * initializes a fresh state and persists it. */ export declare function readPilotState(totemDir: string): PilotState; /** * Atomically write pilot state to disk (write to tmp, then rename). */ export declare function writePilotState(totemDir: string, state: PilotState): void; /** * Check whether the pilot period has expired based on elapsed days or push count. */ export declare function isPilotExpired(state: PilotState, config: PilotConfig): { expired: boolean; reason?: string; }; /** * Wrap a hook execution in pilot mode: * - If the pilot period has expired, prints an error and returns exit code 1. * - If the inner fn succeeds (exit 0), increments pushCount and returns 0. * - If the inner fn fails (exit non-zero), logs the violation as a WARNING * and returns 0 (warn-only). */ export declare function withPilotMode(hookName: string, totemDir: string, pilotConfig: PilotConfig, fn: () => Promise): Promise; //# sourceMappingURL=pilot.d.ts.map