create_node
Create a new rich-text node in a CherryTree document. Supports full XML formatting and verifies writes with an automatic byte-level audit, restoring backups on failure.
Instructions
Create a new rich-text node.
Args: name: Node title. content: Plain text body (ignored if content_xml is set). content_xml: Raw CherryTree XML body — supports full formatting: segments with attributes (weight="heavy", foreground="#RRRRGGGGBBBB", background, style="italic", underline="single", strikethrough="true", scale="h1"|"h2"|"h3"|"h4"|"h5"|"h6"|"small"|"sup"|"sub", family="monospace", justification="left"|"center"|"right"|"fill", link="webs URL"|"node UID"|"file BASE64"|"fold BASE64", indent="1"-"3"), (char_offset, syntax_highlighting, frame_width, frame_height), (char_offset, col_widths), (char_offset, anchor for anchors, filename for embedded files). char_offset = position in concatenated plain text where widget is rendered; each widget occupies 1 char in the count. parent_id: Parent node ID (0 = top-level). tags: Space-separated tags. is_bold: Bold title. foreground: Title color hex (48-bit GTK: #RRRRGGGGBBBB). custom_icon_id: Icon ID.
Returns: Confirmation message followed by byte-by-byte audit report: [AUDIT] readback, delta, change region, prefix/suffix integrity, node count, target node identification, XML parse result. On XML parse failure, backup is restored automatically (ROLLBACK).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| tags | No | ||
| content | No | ||
| is_bold | No | ||
| parent_id | No | ||
| foreground | No | ||
| content_xml | No | ||
| custom_icon_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |