import type { FixAllDone, FixAllFinding, FixAllGroup, FixAllSetAside, FixAllStep } from "@kenkaiiii/gg-protocol"; import type { FixCheck } from "./fix-all-checks.js"; export type FixAllJournalStatus = "running" | "paused" | "gate" | "done" | "stopped"; export interface FixAllJournal { readonly version: 1; readonly status: FixAllJournalStatus; readonly step: FixAllStep | null; readonly reason: string | null; /** The checkout root the run works in. */ readonly root: string; readonly branch: string; /** The commit the branch started from. */ readonly base: string; /** The last commit a rollback goes back to. */ readonly checkpoint: string; /** Commits this run made. */ readonly commits: readonly string[]; readonly startCount: number; readonly steps: number; readonly failStreak: number; readonly restructureConfirmed: boolean; /** Action ids set aside: never queued again. */ readonly settled: readonly string[]; /** Action id → times a passing fix left it still flagged. */ readonly retried: Readonly>; /** The group in progress; non-null while a step is unfinished. */ readonly current: FixAllGroup | null; readonly done: readonly FixAllDone[]; readonly setAside: readonly FixAllSetAside[]; readonly needsYou: readonly FixAllFinding[]; readonly next: readonly FixAllGroup[]; /** Groups still queued after the current one (`next` is capped). */ readonly queued: number; /** Files the last rollback discarded, or a resume would. */ readonly discard: readonly string[]; /** How many fixes were done when the full checks last passed (fixes are checked scoped). */ readonly fullAt?: number; /** The checks that passed at the start: every fix runs (some of) these, resumed or not. */ readonly checks?: readonly FixCheck[]; /** Checks left out and code left for the user, in a sentence. */ readonly unchecked?: string | null; readonly startedAt: string; readonly updatedAt: string; } export declare const markJournalLive: (file: string, on: boolean) => void; export declare function fixAllJournalPath(stateDir: string, root: string): string; export interface LoadedJournal { readonly journal: FixAllJournal; /** It says running, but nothing in this process is running it: the app quit mid-run. */ readonly interrupted: boolean; } /** The run's journal, or null when there's none (or it can't be read). */ export declare function loadFixAllJournal(file: string): Promise; /** Write it whole or not at all: a temp file renamed over the old one. */ export declare function saveFixAllJournal(file: string, journal: FixAllJournal): Promise; export declare function removeFixAllJournal(file: string): Promise; /** Checkout roots of every Fix all run still going or waiting on the user (running, paused, gate). */ export declare function activeFixAllRoots(stateDir: string): Promise;