import { type TrainingItem } from "./items.js"; export declare const CSI = "\u001B["; export declare const B = "\u001B[1m", DIM = "\u001B[2m", R = "\u001B[0m"; export declare const GREY = "\u001B[90m", CYAN = "\u001B[36m", GRN = "\u001B[32m"; export declare const YEL = "\u001B[33m", RED = "\u001B[31m"; export declare const HIDE = "\u001B[?25l", SHOW = "\u001B[?25h"; /** Human-readable duration from seconds. */ export declare function dur(seconds: number): string; /** Human-readable byte size. */ export declare function bytes(n: number): string; /** Short count: 1234567 → "1.23M". */ export declare function num(n: number): string; export declare const int: (n: number) => string; export declare const clamp01: (f: number) => number; export declare const pct: (f: number) => string; /** A progress bar of width `w` filled to fraction `frac`. */ export declare function bar(w: number, frac: number): string; /** Collapse whitespace and clip to `max` chars with an ellipsis. */ export declare function clip(text: string, max: number): string; export interface ProgState { exampleCount: number; target: number; elapsedS: number; trainedBytes: number; trainedRate: number; bytesDone: number; bytesTotal: number; bytesRate: number; fileIndex: number; fileTotal: number; /** What this stage's units ARE ("translation file(s)", "shard(s)"). The panel * used to say "languages" for every corpus — true only of SmolSent, and * plainly wrong while reading Parquet shards or dialogue files. */ unitNoun: string; filePath: string; fileSize: number; fileExamples: number; /** "list" is the work-list call — an HF/GitHub tree fetch, which can wait * minutes behind a rate limit and had no way to say so: the panel simply * kept showing the PREVIOUS stage's file as though it were still being * processed. */ activity: "download" | "process" | "list" | "idle"; dlSpeed: number; dlDone: number; dlTotal: number; storeEntries: number; cacheBytes: number; lastSample: string | null; } /** A prompt/expected pair to display for an item. */ export declare function promptOf(it: TrainingItem): { prompt: string; expected: string | null; kind: "episode" | "experience"; }; /** A coarse, honest similarity between an expected continuation and SEMA's * recall. Both are normalized (lowercased, whitespace-collapsed) and compared * by the longest shared leading run plus token overlap, so the verdict is a * heuristic signal of recall quality rather than a brittle fixed-prefix test. */ export declare function recallSimilarity(expected: string, response: string): number; /** A framed recall sample. Pinned in the panel on a TTY (so the most recent * example is always on screen) and logged once per checkpoint when piped. */ export declare function renderInferenceBox(prompt: string, expected: string | null, response: string, kind: "episode" | "experience", checkpointN: number): string; /** Render the whole panel. `title` names the curriculum being trained; the run * supplies it, so the panel never has to know which corpora exist. */ export declare function renderPanel(s: ProgState, title: string): string; /** A live panel pinned to the bottom of stderr. On a TTY it redraws in place, * clearing only its own lines; logs are flushed into the scrollback above it. * Off a TTY (piped/CI) the panel is suppressed and a plain status line is * emitted occasionally, so logs stay clean and parseable. */ export declare class Progress { private readonly title; private lines; private lastPaint; private lastStatus; private last; private readonly tty; constructor(title: string); /** True when attached to an interactive terminal (panel is live). */ get interactive(): boolean; /** Cursor sequence that returns to the top of the panel and clears it. */ private clearPanel; render(s: ProgState, force?: boolean): void; /** Emit a line (or block) into the scrollback above the panel; the panel is * redrawn immediately beneath it so it never disappears between frames. */ log(msg: string): void; dispose(): void; }