import type { PromptVersion } from '../types/prompts.js'; /** One line of a message diff: kept, added, or removed. */ export interface PromptLineChange { /** `=` kept, `+` added, `-` removed. */ op: '=' | '+' | '-'; /** The line. */ text: string; } /** How one message, by position, changed. */ export interface PromptMessageDiff { /** Its position in the prompt. */ index: number; /** What happened to it. */ change: 'added' | 'removed' | 'changed' | 'unchanged'; /** Role before and after, as `system` or `system → user`, or the placeholder it is. */ role: string; /** The content, line by line. */ lines: PromptLineChange[]; } /** A field of partials, configuration, or defaults that differs. */ export interface PromptFieldChange { /** The field's name. */ key: string; /** Its value before, absent when it was added. */ before?: unknown; /** Its value after, absent when it was removed. */ after?: unknown; } /** What changed between two versions of a prompt. */ export interface PromptDiff { /** The prompt. */ name: string; /** The version compared from. */ from: string; /** The version compared to. */ to: string; /** False when the two versions are the same content. */ changed: boolean; /** Every message, by position. */ messages: PromptMessageDiff[]; /** Partials added, removed, or changed. */ partials: PromptFieldChange[]; /** Configuration fields added, removed, or changed. */ config: PromptFieldChange[]; /** Defaults added, removed, or changed. */ defaults: PromptFieldChange[]; } /** Line diff by longest common subsequence. Prompts are short, so the quadratic table is cheap. */ export declare function diffLines(before: string, after: string): PromptLineChange[]; /** Compares two versions of a prompt. */ export declare function diffPrompts(from: PromptVersion, to: PromptVersion): PromptDiff; /** A diff as text, for a terminal, a log, or a pull-request comment. */ export declare function formatPromptDiff(diff: PromptDiff): string;