import { type BlockInstance, type PageDoc } from "@avocadostudio-ai/shared"; import type { ExtractedSection } from "./types.ts"; export type PageMapping = { page: PageDoc; /** One row per section, in page order — what it was classified as and what it became. */ decisions: Array<{ sectionIndex: number; classifiedAs: string | undefined; mappedTo: string | null; /** Set when the section became something poorer than its classification. */ downgradedFrom?: string; /** * Why the richest candidate was refused, in the site's terms — "no link" * rather than "schema failed". This is the part a person reads: a hero * with no call to action is a fact about their page, not a bug in ours. */ reason?: string; }>; }; export type BuildPageDocInput = { slug: string; title: string; /** Required on purpose — see the note about determinism above. */ updatedAt: string; sections: ExtractedSection[]; id?: string; meta?: PageDoc["meta"]; }; /** Map one page's sections onto built-in blocks. Pure; no clock, no network. */ export declare function mapSectionsToBlocks(sections: ExtractedSection[]): { blocks: BlockInstance[]; decisions: PageMapping["decisions"]; }; /** Map a page and wrap it in a PageDoc. */ export declare function buildPageDoc(input: BuildPageDocInput): PageMapping;