import type { FixAllCheckout, FixAllRunner } from "./fix-all-runner.js"; export interface FixAllSessionView { /** The folder the session reads git state from. */ readonly gitDir?: () => string; readonly broadcast: (type: string, data: unknown) => void; } export declare function createFixAllCheckout(deps: { /** The live sessions, read at each broadcast. */ sessions: () => Iterable; rootOf?: (dir: string) => Promise; keyOf?: (dir: string) => Promise; }): FixAllCheckout; /** * The run a session's Fix all route controls: the repository's, whichever session drives it. * Start is always the session's own: it launches from that session's folder. */ export declare function fixAllRunnerFor(checkout: FixAllCheckout, dir: string, own: FixAllRunner | null, action: string): Promise; /** A window letting go of a session keeps it working: asked to, or it drives a Fix all run. */ export declare function keepOnRelease(query: string, runner: FixAllRunner | null | undefined): boolean; export interface FixAllCleanup { /** An ended run with nothing committed handed its folder back. */ discard(run: { root: string; branch: string; head: string; }): void; /** The session closed: remove its own folder if it was handed back. */ closed(): Promise; } /** * Removes an ended run's empty worktree: at once when it's another folder, after this session * closes when it's the session's own, and never while another session is open on it. */ export declare function createFixAllCleanup(deps: { /** The session's folder, read when a run hands one back. */ cwd: () => string; /** Other live sessions on the checkout at `root`. */ othersOn: (root: string) => Promise; remove: (run: { root: string; branch: string; head: string; }) => Promise; log: (level: "INFO" | "WARN", message: string, data: Record) => void; }): FixAllCleanup;