import type { BlokkliApp } from '#blokkli/editor/types/app'; /** * Tree-shaped entry in the `newParagraphs` payload returned by mutation tools. * * Mirrors the input shape of `add_paragraphs` — nested children are grouped by * paragraph field name so the LLM can verify the structure round-tripped. A * flat list was previously emitted; the model could not tell whether a child * UUID was actually a sibling that got placed at the top level by mistake. */ export type NewParagraphNode = { uuid: string; bundle: string; paragraphFields?: string[]; children?: Record; }; /** * Build the tree-shaped `newParagraphs` payload from a flat list of newly * created block UUIDs (computed as the set diff of `getAllUuids()` before vs * after a mutation). * * A block whose host is ALSO in `newUuids` is nested under that parent's * `children[fieldName]`. Top-level entries are blocks whose parent already * existed before the mutation — these were inserted into the target field. * * Per-block lookup uses `app.blocks.getBlock` (host metadata) and * `app.types.fieldConfig` (paragraph-field discovery), so no extra adapter * round-trips are needed. */ export declare function buildNewParagraphsTree(newUuids: string[], app: BlokkliApp, itemEntityType: string): NewParagraphNode[]; /** * Count every node in a `newParagraphs` tree, including nested children. * * The tree-shaped envelope means a top-level array of length 1 can still * represent dozens of added blocks (one parent with many children). Callers * that report "added N paragraphs" should count recursively so the figure * stays honest. */ export declare function countNewParagraphs(nodes: NewParagraphNode[]): number;