/** * Localising JSON body drift to specific paths. * * `parity` and `journey` currently report body mismatches as opaque * `left=N bytes, hash=…` pairs. That tells a triager that something * changed but not which field — the difference between "0 bytes" of * useful signal and "name the bug" depends on this module. * * Limitations are explicit: * * - Only JSON. Non-JSON bodies (HTML, binary) fall through with a * single `BodyDiffEntry` describing the type mismatch — better than * silent skip, less work than per-content-type diffing. * - Top-down structural walk. Arrays are compared element-by-index; * reordering produces a "wide" diff. Callers that care about set * semantics should sort before comparison. * - Outputs are capped at `maxEntries` so a 10k-element list diff * doesn't pollute the report. The cap is documented at the call * site; the truncation is signalled via the `truncated` flag. */ export type BodyDiffKind = /** Path exists on right but not on left. */ "added" /** Path exists on left but not on right. */ | "removed" /** Both sides have the path, but the leaf values differ. */ | "changed" /** * Both sides have the path; one is a primitive and the other a * container (object/array) — a structural shape change. Reported * once at the boundary; we don't descend further on this branch. */ | "typed"; export interface BodyDiffEntry { /** Dotted path into the tree. Empty string is the root. */ path: string; kind: BodyDiffKind; left?: unknown; right?: unknown; } export interface BodyDiffResult { entries: BodyDiffEntry[]; /** True when the diff was truncated to `maxEntries`. */ truncated: boolean; } interface DiffOptions { /** Hard cap on entries. Default 50 — enough to triage, small enough to read. */ maxEntries?: number; } export declare function diffJsonBodies(leftText: string | null, rightText: string | null, opts?: DiffOptions): BodyDiffResult | null; /** * One-line summary fit for stdout. Renders up to `limit` entries as * `path: (left=… right=…)`. Returns the empty string when * the diff is null. */ export declare function summariseBodyDiff(diff: BodyDiffResult | null | undefined, limit?: number): string; export {}; //# sourceMappingURL=body-diff.d.ts.map