Live: insert SVG
live_insert_svgInsert an SVG fragment into the live Inkscape document. Requires explicit approval for safe, structured editing.
Instructions
Insert an SVG fragment into the running document.
When to use: grafting composed markup into the live document. To style the selection use
live_apply_to_selection; for the headless equivalent use insert_svg_fragment.
Key params: svg_fragment is parsed through the normative safe parser (no entities, no external
DTD, no network) and size-bounded before it crosses the transport — only well-formed, safe
markup is inserted; no code path (ADR-003). Inserting into a running user session is HIGH risk:
REQUIRES an explicit approval_token (refused without one).
Return shape: LiveEditResult — a Live Operation Record with before/after canvas renders,
syncable to a snapshot.
Example: live_insert_svg("<rect .../>", approval_token="ok")
Risk class: high (approval-gated).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg_fragment | Yes | ||
| approval_token | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| summary | No | ||
| transport | No | ||
| affected_ids | No | ||
| operation_id | Yes | ||
| preview_after | No | ||
| undo_friendly | No | ||
| preview_before | No |