Upgrade / Upgrading to 0.15
Upgrade / upgrade-0-15
Upgrading to 0.15
Schema 8 adds one column. The block editor, HTML, agent file tools and publish checks are all opt-in.
From 0.14.x. Schema 8: one new column, cms_documents.body_format (text, default 'markdown'). Everything else is off until you use it.
1. Database#
npx @mainsoft/agent-cms migrate check # shows the one step
npx @mainsoft/agent-cms migrate apply # or run the printed SQL yourselfThe step is ALTER TABLE cms_documents ADD COLUMN IF NOT EXISTS body_format text NOT NULL DEFAULT 'markdown'. Existing documents stay markdown.
2. Screens#
npx @mainsoft/agent-cms add --update # every screen you have
npx @mainsoft/agent-cms add cms-block-editor # optional: the block editorPass the block editor as a slot, ideally lazily:
const CmsBlockEditor = lazy(() => import("@/components/cms/cms-block-editor"));
const slots = { blockEditor: CmsBlockEditor };
<CmsProvider slots={slots} …>Without the slot the editor stays the markdown text box. The body is stored as markdown either way.
3. Korean screen text#
The ko catalogs (screens and server errors) now use 음슴체 ("저장 실패", "대표 이미지 없음"). If you overrode Korean strings, check that yours still match the tone.
4. HTML#
:::htmlblocks and HTML documents are stored as written. What would not work on the page comes back ashtml_inertwarnings.- Adding or changing HTML needs the role permission
html(admins have it). API keys need the newhtmlscope. Running HTML (:::html isolatedwithhtml: { render: "isolated" }) needshtml_scripts. - To render HTML on your site use
@mainsoft/agent-cms/html(sanitizeHtml,markdownToHtml,bodyToSafeHtml). Never insert a stored body as HTML without it. - HTML documents are off: turn them on per collection with
body: { formats: ["markdown", "html"] }.
5. Agents#
New tools read_document, grep_documents, edit_document, write_document, document_file_link; the old tools stay. If an agent should only suggest, set agentEdits: "suggest" on the collection.
6. Types and behaviour#
Inlinegainsem,del,br, andstrongmay carrykids;Blockgainstodo,table,toggle,columns,html,raw, andlist.start. A renderer with aswitchover block types should handle (or skip) the new ones.DocContent.format("html"or absent),CollectionConfig.body.formats,html,agentEdits,publishChecks.- New error codes:
forbidden_html,forbidden_html_scripts,raw_link_invalid,raw_link_expired,suggestion_not_found,suggestion_stale,format_not_allowed,edit_not_found,edit_not_unique,edit_invalid,file_invalid,pattern_invalid,publish_check_failed,zip_too_large; validation errors carryissues. update_document,patch_documentandedit_documentrefuse unknown fields.- The Node adapter ignores
X-Forwarded-ForunlesstoNodeHandler(handler, { trustProxy: true }). grepandraware reserved: a collection cannot use those slugs.