import { type PostToolUseInput, type Rule, type Thresholds, type Verdict } from "oh-my-plumb-schema"; /** * A past coding session, read back from the host's transcript, so every edit * it made can be judged as if oh-my-plumb had been installed at the time. Nothing * here touches the working tree: the diffs come from the transcript alone. */ export type ReplayEdit = { turn: number; input: PostToolUseInput; }; export type ReplayTurn = { index: number; prompt: string | undefined; edits: ReplayEdit[]; }; /** A tool call as calibration sees it: the tool's name plus its bounded arguments, never its output or file contents. */ export type ReplayCall = { tool: string; input: unknown; }; export type ReplaySession = { file: string; cwd: string; turns: ReplayTurn[]; calls: ReplayCall[]; }; /** * The arguments a call was made with, bounded. Strings too long to be arguments * (file bodies, patches, captured output pasted in) are replaced by their length, * so what survives is names and short argument values only. Codex records its * arguments as JSON text, which is read back into the object it encodes so every * host redacts field by field. */ export declare const callInput: (input: unknown) => unknown; export declare const parseTranscript: (file: string) => ReplaySession; export type ReplayEditResult = { session: string; turn: number; file: string; verdicts: Verdict[]; costUsd: number; error?: string; diff?: string; task?: string; }; export type ReplayTurnResult = { session: string; turn: number; files: string[]; verdicts: Verdict[]; costUsd: number; error?: string; }; export type ReplayResult = { edits: ReplayEditResult[]; turns: ReplayTurnResult[]; }; export type ReplayProgress = (done: number, total: number, spendUsd: number) => void; /** * Judges every edit of every session as the edit hook would have, then every * turn as the stop hook would have, from the edits alone. Shell-made changes * are not in a transcript and are not judged. */ export declare const replaySessions: (sessions: readonly ReplaySession[], rules: readonly Rule[], thresholds: Thresholds, concurrency: number, progress: ReplayProgress, keepDiffs?: boolean) => Promise; /** Turn ranges the drift is reported over. The first covers the session's opening, where instructions are fresh. */ export declare const DRIFT_BUCKETS: readonly { label: string; from: number; to: number; }[]; export type DriftRow = { label: string; edits: number; broken: number; /** Share of judged edits with at least one rule above the act line. */ rate: number; }; export declare const driftByTurn: (edits: readonly ReplayEditResult[]) => DriftRow[]; export type RuleTally = { rule: string; phase: "edit" | "turn"; broken: number; flagged: number; of: number; example: string; }; export declare const tallyRules: (result: ReplayResult, rules: readonly Rule[]) => RuleTally[]; //# sourceMappingURL=replay.d.ts.map