/** * `zeroshot setup undo` — reverts writes made by `zeroshot setup apply` using * the journal recorded at apply time (lib/setup-journal.js). * * Three-way conflict rule per journaled write, comparing `current` against * `appliedValue`: * - current === appliedValue -> restore priorValue (delete if null) * - current === priorValue -> already-restored (no-op) * - otherwise (changed elsewhere) -> skipped-modified, never clobbered */ type SettingsRecord = Record; type UndoStatus = 'already-restored' | 'skipped-modified' | 'deleted' | 'restored'; interface JournalEntry { readonly appliedAt: string; readonly appliedValue: unknown; readonly path: string; readonly priorValue: unknown; readonly repoRoot: string | null; readonly scope: string; readonly [key: string]: unknown; } interface UndoResult extends JournalEntry { current?: unknown; status: UndoStatus; wouldRestore?: unknown; } interface UndoDependencies { mutateSettings(mutator: (settings: SettingsRecord) => T): T; readRepoSettings(repoRoot: string | null): { settings: SettingsRecord | null; }; writeRepoSettings(repoRoot: string | null, settings: SettingsRecord): unknown; } interface UndoParams { deps?: Partial; } /** * Undo every journaled write, per the three-way conflict rule. */ declare function undo({ deps }?: UndoParams): Array; declare const _default: { undo: typeof undo; }; export = _default;