/** * Brief-instance baseline — per-element + per-field SHA-256 hashes * captured after a successful push, replayed during the next push for * three-way merge classification. * * The brief recipe surfaces five top-level elements (`briefTypeName`, * `locale`, `status`, `isTemplate`, `fields`) plus the per-field map * inside `fields`. The baseline hashes each as one entry so the * planner can compare R/C/B per-cell: * * R == B && C == B → noop * R != B && C == B → recipe-change (safe update) * R == B && C != B → cms-edit (author edited the field in Sitecore AI) * R != B && C != B → conflict (both moved) * * See sibling docs in `src/sync/baseline.ts` for the * `FieldClassification` vocabulary. */ import { type Baseline, type FieldClassification } from "../../sync/index.js"; import type { BriefInstanceRecipe } from "./instance-schema.js"; declare const TOP_LEVEL_ELEMENTS: readonly ["briefTypeName", "locale", "status", "isTemplate"]; type TopLevelKey = (typeof TOP_LEVEL_ELEMENTS)[number]; /** Hash one recipe value (top-level or per-field) for baseline storage. */ export declare const hashBriefValue: (value: unknown) => string; /** * Brief baseline payload — per-element + per-field-name hash map. * Lives inside `Baseline.payload` so the envelope (`schemaVersion`, * `kind`, `recipeHandle`, `envName`, `capturedAt`) stays shared with * every other kind's baseline. */ export interface BriefBaselinePayload { /** Schema version for the brief baseline payload specifically. */ schemaVersion: "1"; /** Per-top-level-element hash. Absent → never written before. */ elements: Partial>; /** Per-field hash, keyed by `BriefField.name` (Z fields). */ fields: Record; /** * Server UUID of the brief row this baseline was captured against. * When present, apply prefers id-match via `getBrief(id)` before * falling back to the marker-suffix-based `findBriefByName`. Lets a * brief survive a displayName edit between pushes (or a brief * handle change) without orphaning the existing tenant row. */ tenantId?: string; } export type BriefBaseline = Baseline; /** Construct a baseline payload from a successfully applied recipe. */ export declare const captureBriefBaselinePayload: (recipe: BriefInstanceRecipe, tenantId?: string) => BriefBaselinePayload; /** Three-way classify one brief cell. Delegates to the shared helper. */ export declare const classifyBriefValue: (desiredHash: string, currentHash: string, baselineHash: string | undefined) => FieldClassification; export { TOP_LEVEL_ELEMENTS }; export type { TopLevelKey };