Live: apply to selection
live_apply_to_selectionApply validated fill, stroke, opacity, or transform (move, scale, rotate) to the current selection. Requires explicit approval token for safe, reversible edits.
Instructions
Apply a validated style and/or simple transform to the current live selection.
When to use: editing the GUI selection's style/transform live. To insert markup use
live_insert_svg; to edit text use live_set_selected_text; for headless edits use set_fill
/ move_object / etc.
Key params: reuses the headless safe-edit semantics — fill/stroke colour-validated,
stroke_width a CSS length, opacity in [0, 1], transform composed from dx/dy (both
required together), scale (positive), rotate (degrees); at least one input required.
Semantic-only — no arbitrary code, no raw Action (ADR-003). Mutating 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 via live_sync_to_workspace.
Example: live_apply_to_selection(approval_token="ok", fill="#3366cc")
Risk class: high (approval-gated).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dx | No | ||
| dy | No | ||
| fill | No | ||
| scale | No | ||
| rotate | No | ||
| stroke | No | ||
| opacity | No | ||
| stroke_width | No | ||
| 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 |