import { type OperationIr } from "../ir/operations.js"; import { type Recipe } from "../schema/recipe.js"; import { type CompileContext } from "./shared.js"; /** Stable handle for the per-section `Available Renderings` aggregate. */ export declare const AVAILABLE_RENDERINGS_AGGREGATE_HANDLE = "__available-renderings__"; /** * Stable handle for the synthetic IR that materialises SHARED Data Folder * templates — one per `(site, subfolder)` targeted by ≥2 component-template * recipes. Each shared template's `__Standard Values` Insert Options is the * union of every contributing recipe's datasource template. */ export declare const SHARED_DATA_FOLDERS_AGGREGATE_HANDLE = "__shared-data-folders__"; /** * Stable handle for the synthetic IR carrying the SHARED Data Folder * templates' Insert Options `SetField` ops. * * Split out from `SHARED_DATA_FOLDERS_AGGREGATE_HANDLE` (template/SV/base * creation) because the two halves have opposite ordering requirements * relative to the per-recipe IRs: * * - Template creation must run BEFORE the per-recipe IRs — each recipe's * `site-data-folder` folder ITEM is created with * `templateOf = sharedDataFolderTemplateId(...)`, so the template must * already exist (Authoring GraphQL rejects a createItem whose template * GUID is unknown). Emitted at the FRONT of the IR list. * - Insert Options must run AFTER the per-recipe IRs — the SetField's * `ref-recipe-list` references each contributing recipe's datasource * template (`templateId(site, handle)`), which the per-recipe IRs * create. Emitted near the end of the IR list. */ export declare const SHARED_DATA_FOLDER_INSERT_OPTIONS_AGGREGATE_HANDLE = "__shared-data-folder-insert-options__"; /** * Stable handle for the site Data folder ROOT's `__Standard Values` + * Insert Options aggregate. Restricts right-click → Insert at * `` to the generic Folder template, every per-recipe * ` Data Folder` template (singletons), and every shared * ` Data Folder` template (coalesced shared subfolders). */ export declare const SITE_DATA_ROOT_AGGREGATE_HANDLE = "__site-data-root__"; /** * Stable handle for the enumerations root's `__Standard Values` + Insert * Options aggregate. Restricts right-click → Insert at `` * to the generic Folder template plus every per-recipe enumeration folder. */ export declare const ENUMERATIONS_ROOT_AGGREGATE_HANDLE = "__enumerations-root__"; /** * Stable handle for the shared enumeration TEMPLATE trio — the per-site * `Enumerations Folder`, `Enumeration`, and `Enumeration Value` templates, * their inner Value fields, and their `__Standard Values` + Insert Options. * * A FRONT aggregate: per-recipe enum items are created with * `templateOf = enumerationTemplateId(...)` / `enumerationsFolderTemplateId(...)`, * so the templates must already exist before any per-recipe IR applies. * * The reason it is an aggregate at all (rather than emitted by whichever * enum recipe compiles first, as it used to be): the templates' * `__Standard Values` items carry a tenant OWNERSHIP marker stamped with * the emitting IR's handle. A "first enum recipe" identity is not stable — * it shifts as the recipe set / topo-order changes across rebuilds, or as * batching splits enum recipes across separate `--handles` pushes — so a * later install would try to reconcile a `__Standard Values` owned by a * different recipe and abort with a name/ownership collision. Owning them * under this synthetic handle makes the marker deterministic across every * install. */ export declare const ENUMERATION_TEMPLATES_AGGREGATE_HANDLE = "__enumeration-templates__"; /** * Stable handle for the SECTION-INDEPENDENT shared organisational folders — * enumeration grouping folders (`location.folder`), Content Models group * folders, and Page Templates group folders (both `meta.tax.group`). * * A FRONT aggregate, for the same reason as the shared Data Folder / enum * templates: these folders are referenced by per-recipe items via * `templateOf` / `parent`, and are deterministic + shared across recipes. * Emitted inline today by the `ensure*` helpers into whichever recipe * compiled first, they get DROPPED from a `--handles` chunk that excludes * that owner — the executor's path-walker then auto-creates them as the * generic `Folder` template. For enumeration grouping folders that is an * author-visible bug (a generic Folder lacks the `Enumerations Folder` * Standard Values, so right-click → Insert offers no `Enumeration`). * Owning them here makes the emission batch-order-independent. * * NOTE: the section-scoped Component Folders / Presentation Parameters * BUCKETS are deliberately NOT hoisted here — they nest under section * folders that `ComponentSectionRecipe`s richly own (icon/displayName/ * sortOrder) as per-recipe IRs, and a FRONT aggregate would invert that * ordering. They stay on the per-recipe `ensure*` path. */ export declare const SHARED_FOLDERS_AGGREGATE_HANDLE = "__shared-folders__"; /** * Stable handle for the Placeholder Settings items — one per unique * placeholder key declared anywhere in the set (a `PlaceholderRecipe` or * an inline `ComponentTemplateRecipe.placeholders` slot). Each key's * `Allowed Controls` whitelist is the union of slot-side `allowedComponents` * and every component naming the key in `placedIn`. */ export declare const PLACEHOLDER_SETTINGS_AGGREGATE_HANDLE = "__placeholder-settings__"; /** * Stable handle for the synthetic IR that materialises subtree-level * ownership for `ComponentSectionRecipe`s whose `ownership.mode` is * `"exclusive"`. Per exclusively-owned section the aggregate emits * `PruneChildren` ops for BOTH the RENDERINGS section folder and the * TEMPLATES section folder (each with a `templateFilter` so co-located * bucket folders survive). NOT pruned: the SXA Headless Variants tree — * SXA stores per-rendering variant folders FLAT, so a section-scoped * ownership declaration can't safely address them. */ export declare const COMPONENT_SECTION_OWNERSHIP_AGGREGATE_HANDLE = "__component-section-ownership__"; /** * Build the synthetic IR that materialises the SXA `Available Renderings` * section items for the recipe set, one per `recipe.section` value across * every component-template recipe. * * Each section emits two ops: a `CreateItem` for * `/
` and a `SetField(Renderings)` * writing the pipe-separated rendering itemIds (a `ref-recipe-list` * resolved against the captured-itemId map). Returns null when no * eligible recipes exist. */ export declare const buildAvailableRenderingsAggregate: (recipes: readonly Recipe[], context: CompileContext) => OperationIr | null; /** * Build the synthetic IR that materialises subtree ownership for * `ComponentSectionRecipe`s whose `ownership.mode` is `"exclusive"`. Per * exclusively-owned section, emits TWO `PruneChildren` ops (renderings * folder + templates section folder), each carrying `allowedHandles` and * a `templateFilter` scoping the prune so co-located bucket folders stay * untouched. Returns `null` when no ComponentSection declares exclusive * ownership. */ export declare const buildComponentSectionSubtreeOwnershipAggregate: (recipes: readonly Recipe[], context: CompileContext) => OperationIr | null; /** * One contributing recipe pointing at a shared `(site, subfolder)`. * Recorded by the pre-pass walk in `compileRecipeSet`. */ export interface SharedSubfolderContribution { /** Recipe handle — display/dedup identity for the contribution. */ recipeHandle: string; /** * The content-template handles the recipe's datasource items conform * to (see `datasourceTemplateHandles`). The shared folder's Insert * Options union references THESE — not the recipe handle — because * external-template components (`datasource.template` / * `datasource.templates[]`) never create a template under their own * handle. */ datasourceTemplateHandles: string[]; } /** * Pre-pass mapping each site-scoped subfolder to its contributing * component-template recipes. Only keys with ≥2 contributions are * returned — singletons stay on the per-recipe template path. * * Key shape: `${site}::${subfolder}`. */ export declare const detectSharedSubfolders: (recipes: readonly Recipe[], site: string) => Map; /** * Build the synthetic IR materialising the SHARED Data Folder template * tree — one template + SV + base-templates link + SetStandardValues per * shared `(site, subfolder)` pair. The Insert Options `SetField` is * emitted separately (see `buildSharedDataFolderInsertOptionsAggregate`). * Prepended to the IR list so the templates exist before any per-recipe * folder ITEM references them via `templateOf`. Returns null when no * shared subfolders exist. */ export declare const buildSharedDataFoldersAggregate: (shared: Map, context: CompileContext, site: string) => OperationIr | null; /** * Build the synthetic IR carrying the Insert Options `SetField` for each * shared `(site, subfolder)` Data Folder template's `__Standard Values`. * Ordered AFTER the per-recipe IRs (its `ref-recipe-list` references each * contributing recipe's datasource template). Returns null when no shared * subfolders exist. */ export declare const buildSharedDataFolderInsertOptionsAggregate: (shared: Map, site: string) => OperationIr | null; /** * Build the synthetic IR materialising the site Data folder ROOT's * `__Standard Values` item, with Insert Options aggregating: the generic * Folder template, every per-recipe singleton ` Data Folder` * template, and every shared ` Data Folder` template. Returns * null when there are zero contributing recipes or `contentItemsRoot` is * unset. */ export declare const buildSiteDataRootAggregate: (recipes: readonly Recipe[], sharedSubfolders: ReadonlySet, context: CompileContext, site: string) => OperationIr | null; /** * Build the synthetic IR materialising the enumerations root's * `__Standard Values` item + Insert Options aggregating the generic * Folder template plus every per-recipe `enumerationFolderId(site, * handle)`. Returns null when there are zero `EnumerationRecipe`s or * `enumerationsRoot` is unset. */ export declare const buildEnumerationsRootAggregate: (recipes: readonly Recipe[], context: CompileContext, site: string) => OperationIr | null; /** * Build the synthetic IR materialising the shared enumeration TEMPLATE * trio (`Enumerations Folder` / `Enumeration` / `Enumeration Value`), their * inner Value fields, and their `__Standard Values` + Insert Options — * emitted ONCE for the whole set under the stable * `__enumeration-templates__` handle instead of by whichever enum recipe * compiled first. Returns null when the set declares no `EnumerationRecipe`. * * Reuses `ensureEnumerationTemplates` with a fresh sentinel set so the op * sequence stays byte-for-byte identical to the legacy per-recipe emission * (only the owning IR handle changes). `compileRecipeSet` PRE-SEEDS the * per-recipe sentinel (see `enumerationTemplatesSentinel`) so the per-recipe * pass resolves refKeys only and does not re-emit these ops. */ export declare const buildEnumerationTemplatesAggregate: (recipes: readonly Recipe[], context: CompileContext, site: string) => OperationIr | null; /** * Build the synthetic IR materialising the SECTION-INDEPENDENT shared * organisational folders once for the whole set, under the stable * `__shared-folders__` handle: enumeration grouping folders * (`location.folder`), Content Models group folders, and Page Templates * group folders (`meta.tax.group`). Returns null when the set declares none. * * Reuses the same `ensure*` helpers the per-recipe pass calls, with a fresh * dedup set so emission is byte-for-byte identical (only the owning IR * handle changes) and shared prefixes/groups coalesce within the aggregate. * `compileRecipeSet` pre-seeds the emitted refKeys into the per-recipe * `emittedFolders` so the per-recipe `ensure*` calls short-circuit to * refKey-only. Keys are collected sorted so emission order is deterministic. * * Enumeration grouping folders conform to the shared `Enumerations Folder` * template (created by the `__enumeration-templates__` aggregate), so this * aggregate must apply AFTER it — `compileRecipeSet` orders the FRONT * unshifts accordingly. */ export declare const buildSharedFoldersAggregate: (recipes: readonly Recipe[], context: CompileContext, site: string) => OperationIr | null; /** * Build the synthetic IR materialising the Placeholder Settings items for * the recipe set — one `CreateItem` + `SetField(Allowed Controls)` per * unique placeholder key (standalone `PlaceholderRecipe` + inline * `ComponentTemplateRecipe.placeholders`). `folder`s nest the item under * deduped grouping folders. * * Returns null when the set declares no placeholders. Throws * INPUT_INVALID when it declares placeholders but `placeholderSettingsRoot` * is unconfigured. */ export declare const buildPlaceholderSettingsAggregate: (recipes: readonly Recipe[], context: CompileContext, site: string) => OperationIr | null;