/** * Recipe-to-recipe diff. Two distinct shapes: * * - **Step diff** — Myers-style LCS over the JSON-encoded step * sequence. Output is a unified-diff-ish block where added / * removed steps are tagged and surrounding context is preserved. * This is the form humans want when reading "what changed in v3?" * during a PR review. * * - **Field diff** — flat key/value comparison of the recipe's * metadata (status, origin, postconditions, etc.). Surfaces * classification changes (e.g. demote → verified) that the step * diff hides because step-level JSON is unchanged. * * Designed to operate on plain `ActionRecipe` JSON — no Playwright, * no IO. The CLI just loads two recipes (`name@vM`, `name@vN`, or * `nameA`, `nameB`) and pipes them in. */ import type { ActionRecipe } from "./types.js"; export type DiffOp = "equal" | "add" | "remove"; export interface StepDiffEntry { op: DiffOp; /** Index in the LEFT recipe (or -1 when op === "add"). */ leftIndex: number; /** Index in the RIGHT recipe (or -1 when op === "remove"). */ rightIndex: number; /** Canonical JSON of the step. */ json: string; } export interface FieldDiffEntry { field: string; left: unknown; right: unknown; } export interface RecipeDiff { left: { name: string; version: number; }; right: { name: string; version: number; }; steps: StepDiffEntry[]; fields: FieldDiffEntry[]; /** True when steps + tracked fields are identical. */ identical: boolean; } export declare function diffRecipes(left: ActionRecipe, right: ActionRecipe): RecipeDiff; export interface FormatDiffOptions { /** Show N equal steps on either side of a change. Default: 1. */ context?: number; /** Use ANSI colour codes. Default: false. */ color?: boolean; } /** * Render a `RecipeDiff` as a unified-diff-style text block. Equal * regions outside the context window collapse to `... (k unchanged)`. */ export declare function formatRecipeDiff(diff: RecipeDiff, opts?: FormatDiffOptions): string; //# sourceMappingURL=diff.d.ts.map