Build from blueprint
layerz_build_from_blueprintBuilds or extends a model from a strict Blueprint (whole sections with their hierarchy, items referenced by name), or applies a stored template as a module through template_id (mutually exclusive with blueprint, loaded server-side). mode: 'merge' (default) adds to the model, reusing items by name and keeping the presentation fields a re-declared item omits; mode: 'replace' rebuilds the whole model (structure, timelines, values, branches), keeping style colours, custom formats, locale, glyph, subtitle and FINANCE.md. dry_run: true validates and returns errors with their path without writing. Persists one version labelled with summary. Not advertised to read-only keys.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'merge' (default): adds to the existing model, reusing items by name. 'replace': rebuilds the whole model from the blueprint. | |
| dry_run | No | Validates the blueprint and reports errors without writing. | |
| summary | Yes | Short note (3–100 chars) describing the change, stored as the label of the resulting version. Examples: "Renamed Revenue to Net Revenue", "Imported 2024 OPEX from Excel". | |
| model_id | No | Target model UUID. Required for user-scoped API keys; validated against the bound model for model-scoped keys. | |
| blueprint | No | Strict Blueprint object: { project?, timelines?: { monthly? | quarterly? | yearly?: { start, end } }, lists?: [{ display_name, items: [{ label, mapped_to?: Record<listName, labels[]> }] }], sections: [{ name, items: [{ role, name, timeline_ref?, value?, values?, formula?, item_style?, opening_balance?, liste_ref?, timeline_values?: Record<elementLabel, (number|null)[]>, children?, … }] }], dashboards?: [{ name, items: [{ role: chart | kpi | mini_table, … }] }] }. At least one section is required. Items reference each other by name (formula inputs, callup source, chart series); a callup omits `name` and inherits its source's. A list-mode item binds a declared list through `liste_ref` and carries `timeline_values` keyed by element label; a `balance` with `liste_ref` requires every list-typed child to share it. Accepted as a JSON object or a JSON-encoded string. | |
| template_id | No | Stored template to apply as a module (mutually exclusive with `blueprint`). |