export interface JournalEntry { /** ISO8601 UTC, invocation start. */ ts: string; /** CLI version, so a finding can be dropped once the fix ships. */ v: string; verb: string; /** Flag names with values elided — the retry-cluster key. */ skel: string; exit: number; ms: number; /** Error CLASS (`err.name`), never a message — messages carry user data. */ err: string | null; /** Hash of the working tree, so runs group by project without recording where it is. */ wt: string; } /** * Beside the machine config, so the journal shares the home the PAT already * lives in — and so a run made outside any project (`login`, `version`) is still * recorded, which a per-project file could not do. * * Resolved per call rather than captured at module load: the home directory is * the seam tests move, and a frozen path would silently write to the real one. */ export declare function journalPath(): string; /** `VINCENTT_DX_JOURNAL=0` turns recording off. A local file still needs an off switch. */ export declare function journalEnabled(env?: NodeJS.ProcessEnv): boolean; /** * A stable, non-reversible handle for "the folder this run happened in". Enough * to group runs by project — which is what makes the one-session-per-tree * friction visible — without recording anyone's directory layout. */ export declare function workingTreeId(cwd: string): string; export interface RecordInput { argv: string[]; cliVersion: string; cwd: string; startedAt: number; endedAt: number; exitCode: number; error?: unknown; } export declare function buildEntry(input: RecordInput): JournalEntry; /** * Append one entry. Never throws: a journal that can break a publish is a * liability, and every failure mode here (read-only home, full disk, a * concurrent writer) is one the creator would rather have silently ignored than * turned into a failed command. */ export declare function record(input: RecordInput): void; /** Read the journal oldest-first. Malformed lines are skipped, not fatal. */ export declare function readJournal(): JournalEntry[];