import { T as ToolHost } from '../tool-host-BqJRPr_T.js'; import { B as Bridge } from '../types-D_TzdBsK.js'; import { DocAdapter } from './doc.js'; import { StyledNode, StagePolicy, TreeOp, StyleProps, LayoutMode, DocReducer, DocTree } from '@particle-academy/fancy-doc-commons'; import '../types-ITRQFAir.js'; /** * registerCmsBridge โ€” the greenfield CMS agent bridge, built entirely on * {@link registerDocBridge}. cms had NO bridge before (its op-spine was * agent-ready but unwired); this is the ยง8-decided "build registerCmsBridge on * registerDocBridge BEFORE deprecating ScreenSchema" step. * * A CMS page is a `DocTree` (fancy-doc-commons): the generic bridge * supplies `cms_describe/get/list/get_node` + `cms_add/update/remove/move` + * undo/activity/staging for free; this layer adds the two domain ops a page * needs โ€” `cms_set_style` (per-node base StyleProps) and `cms_set_layout` โ€” and a * reducer that handles them alongside the substrate tree ops. */ /** The CMS op union: the substrate tree ops + per-node style/layout. */ type CmsOp = TreeOp | { t: "set_style"; id: string; patch: Partial; } | { t: "set_layout"; id: string; layout?: LayoutMode; }; /** A pure reducer over a `DocTree` handling tree ops + style/layout. */ declare function cmsReducer(): DocReducer, CmsOp>; interface CmsBridgeOptions { adapter: DocAdapter; agent?: { id: string; name?: string; color?: string; }; /** Auto-apply vs. confirm per op (trust-but-verify). Default: auto. */ stagePolicy?: StagePolicy; onPending?: (staged: { id: string; op: CmsOp; label: string; }) => void; } /** Register the CMS bridge (prefix `cms_`) over a `DocTree`. */ declare function registerCmsBridge(host: ToolHost, options: CmsBridgeOptions): Bridge; export { type CmsBridgeOptions, type CmsOp, cmsReducer, registerCmsBridge };