replace_scene
Replace an entire scene's contents with new elements, snapshotting prior state for revert. For partial edits, use add_elements or update_elements.
Instructions
Replace a scene's entire contents. Destructive by design - the previous state is snapshotted, but prefer add_elements or update_elements when you only mean to change part of it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | Short description of what this change is doing, e.g. 'add the dog illustration'. Shown next to the snapshot in the history sidebar, which is how the user decides whether to keep or revert it. Always set it. | |
| scene | Yes | Scene id, exact name, or a unique part of the name. Use list_scenes if unsure. | |
| elements | Yes | Excalidraw elements. Any field of a real element is honoured verbatim; what you omit gets a valid default (id, index, seed, version are generated). USE THIS FOR diagrams, layout, text, boxes, arrows, and detail strokes on top of something already drawn. For anything that has to LOOK LIKE something - a character, creature, object, vehicle, logo, illustration - do NOT assemble it from shapes here. Write it as one SVG and call import_svg. Shapes stacked by hand come out as a pile of parts (fat, seamed, toy-like) every time; one SVG comes out as one drawing. Types: rectangle ellipse diamond arrow line text freedraw frame. Fields: x y width height angle, strokeColor, backgroundColor (the fill), fillStyle solid|hachure|cross-hatch, strokeWidth 1|2|4, strokeStyle, roughness 0|1|2, opacity, roundness, fontSize, fontFamily (5 hand-drawn), textAlign, groupIds, points [[0,0],[dx,dy],...] relative. y points down. TEXT WRAPS: give a text element a `width` and prose is wrapped to it with the real font metrics (height follows); no width = one line per \n, sized exactly. Never break long paragraphs by hand. THE LOOK IS HAND-DRAWN. This is Excalidraw. roughness 1 (default) on everything; native rectangle/ellipse/arrow rather than 4-point lines; sparse points with roundness {type:2} for a curve (dense points look furry, not sketchy); hand-drawn font. Detail is a few extra strokes, never more parts. COLOUR IS FLAT. Solid fills, one colour per part, and the wobbly outline does the rest - that is the Excalidraw look. Do not shade: no hachure or cross-hatch as texture, no gradients faked with stacked shapes, no drop shadows. If a part must read as darker, give it a darker solid hex. Reserve hachure/cross-hatch for something that IS hatched (a cutaway, a glass pane). PAPER AND INK. Nothing is inverted for display: every hex shows exactly as written. New scenes are dark paper (#121212). Anything drawn without a strokeColor gets ink that contrasts with the paper (#e9ecef on dark, #1e1e1e on light); describe_scene reports `background` and `ink`. Any hex is fine - character colours are character colours on any paper. SHORTHAND. label on a shape adds centred bound text; ref names an element and start/end on an arrow bind to it. Generated geometry is an element whose type is polygon|star|arc|capsule|path, e.g. {"type":"path","points":[[0,0],[40,30],[90,10]],"closed":true} smooth curve through the points polygon {sides,cx,cy,r} star {points,cx,cy,r,innerRatio} arc {cx,cy,r,from,to} capsule {x,y,width,height,radius} repeat {count,dx,dy | cols,rows | around:{cx,cy}} and mirror {axis:'vertical',at} multiply one spec evenly. These are for furniture - rings, plates, arrays - not for bodies. |