docs: update README and AGENTS.md with boolean ops, undo tree, new architecture

- Document boolean shape operations feature and boolean_op MCP tool
- Document visual undo tree with Cmd+H shortcut
- Add BooleanOp to WebSocket protocol examples
- Update architecture tree with history.rs, boolean.rs modules
- Add i_overlay and earcutr to dependency table
- Update roadmap: mark boolean ops and undo tree as complete
This commit is contained in:
David Ibia
2026-02-10 00:02:01 +01:00
parent 9489c390fa
commit ce2079ad95
2 changed files with 45 additions and 28 deletions

View File

@@ -11,6 +11,7 @@ Guidelines for AI agents working in this Rust codebase.
- WebSocket: tokio-tungstenite
- Serialization: serde/serde_json
- Error handling: anyhow/thiserror
- Boolean ops: i_overlay, triangulation: earcutr
- Logging: tracing
## Build/Lint/Test Commands
@@ -37,8 +38,19 @@ cargo doc --open # Generate and open docs
src/
├── main.rs # Entry point, window setup
├── app.rs # Main app state, UI (eframe::App impl)
├── session.rs # Session/tab state with history integration
├── history.rs # Undo tree: branching history, snapshots, checkout, fork
├── persistence.rs # Workspace save/load
├── command_palette.rs # Cmd+K fuzzy command palette
├── element_tree.rs # ElementTree, Element, ElementKind types
├── clipboard.rs # System clipboard integration
├── mermaid.rs # Mermaid -> SVG rendering
├── drawing/
│ ├── element.rs # DrawingElement, Shape (incl. Path), ShapeStyle, hit testing
│ ├── boolean.rs # Boolean shape ops (union, intersection, difference, xor)
│ ├── tool.rs # Tool enum, DragState, ResizeHandle
│ ├── render.rs # Shape rendering via egui Painter + triangulation
│ └── mod.rs # Re-exports
├── canvas/
│ ├── state.rs # Pan/zoom transformation state
│ └── interaction.rs # Mouse/keyboard input handling
@@ -46,7 +58,7 @@ src/
│ ├── parser.rs # SVG -> ElementTree conversion
│ └── renderer.rs # SVG -> pixels (resvg/tiny-skia)
└── agent/
├── protocol.rs # JSON message types
├── protocol.rs # JSON message types (incl. BooleanOp)
└── server.rs # WebSocket server (ws://127.0.0.1:9876)
```
@@ -163,6 +175,7 @@ WebSocket server on `ws://127.0.0.1:9876`:
{"type": "GetElementById", "id": "button-1"}
{"type": "Describe"}
{"type": "GenerateCode", "target": "react", "element_id": null}
{"type": "BooleanOp", "operation": "union", "element_ids": ["id1", "id2"], "consume_sources": true}
// Response
{"type": "Tree", "tree": {...}}