Commit Graph

19 Commits

Author SHA1 Message Date
David Ibia
f5faf69cad feat: add singleton enforcement, extended MCP tools, and drawing improvements
Prevent multiple instances via fs2 file locking and improve agent server
port-in-use detection. Add polygon shapes, vertex editing, grouping,
alignment, z-ordering, duplication, SVG export, screenshot capture,
app state introspection, and extended shape properties (opacity, rotation,
corner radius, font family, max width) across both WebSocket and MCP APIs.
2026-02-15 14:46:47 +01:00
David Ibia
519ed74a3a docs: update README with export, mermaid conversion, batch commands, and new shortcuts 2026-02-10 17:07:46 +01:00
David Ibia
64b4f667fb feat: upgrade mermaid-rs-renderer to v0.2.0 with edge label support
Adds font-family sanitization to fix nested double quotes that break
usvg XML parsing. Edge labels (-->|Yes|) now render correctly as
interactive DrawingElements.
2026-02-10 17:05:55 +01:00
David Ibia
9e9d33eb84 feat: convert Mermaid diagrams to native DrawingElements instead of raster overlays
Mermaid SVG is now parsed into interactive shapes (rectangles, arrows,
text) that can be selected, moved, and resized. Removes the MermaidOverlay
system entirely in favor of first-class drawing elements.
2026-02-10 17:05:45 +01:00
David Ibia
519d1f2459 feat: add canvas export to PNG via File menu, Cmd+Shift+E, and MCP tool 2026-02-10 17:05:36 +01:00
David Ibia
8390d01f85 fix: load system fonts in SVG parser for proper text rendering 2026-02-10 17:05:29 +01:00
David Ibia
740fa2f5f9 feat: add Mermaid overlay support for agents to inject positioned diagrams
- Agents can send RenderMermaid with Mermaid source + canvas position
  to create SVG texture overlays that coexist with other elements
- MermaidOverlay struct holds source, rendered SVG, SvgRenderer, and
  lazy-loaded egui texture at a specific canvas position/size
- Server handles rendering via mermaid-rs, parses SVG for dimensions,
  sends overlay data through DrawingCommand channel to GUI thread
- Canvas renders overlays as positioned textures between base SVG and
  drawing elements, with proper pan/zoom transforms
- New MCP tool render_mermaid for agent access
- Overlays cleared on undo/redo/checkout to stay consistent with history
- 29 tests passing, clippy clean
2026-02-10 10:44:39 +01:00
David Ibia
5ca1e85209 feat: clickable zoom reset, Pan tool (H), and batch command support
- Clicking the zoom percentage in the menu bar resets zoom to 100%
- New Pan tool (H key) for explicit left-click-drag panning mode
- Batch command support: agents can send multiple operations in a
  single WebSocket message via {"type": "Batch", "requests": [...]}
  with sequential execution and collected results
- New MCP tool 'batch' accepts a JSON array of request objects
- Nested batches rejected with clear error message
- Updated AGENTS.md with .app rebuild requirement
2026-02-10 10:27:06 +01:00
David Ibia
9b8acd4002 feat: add marquee multi-select and always-on middle-button pan
- Drag on empty space in Select tool draws a marquee rectangle;
  elements intersecting it on release become selected
- Shift+click toggles elements in/out of the selection set
- Moving and deleting operate on all selected elements at once
- Middle mouse button drag now pans unconditionally in every tool mode
- Session selection state changed from Option<String> to Vec<String>
- New DragState::MarqueeSelecting variant with dashed rect rendering
- 29 tests passing, clippy clean
2026-02-10 01:08:26 +01:00
David Ibia
1929023409 feat: add undo/redo (Cmd+Z/Cmd+Shift+Z) and SVG file drag-and-drop
- Undo walks to parent node in history tree, redo follows
  last-active-child for correct branch tracking after forks
- HistoryTree tracks branch recency via last_active_child field,
  updated on push() and checkout() path transitions
- SVG files can be dragged from Finder onto the canvas window
- Edit menu with Undo/Redo items, command palette entries
- 3 new tests: undo, redo, redo-after-fork branch behavior
- 29 tests passing, clippy clean
2026-02-10 00:23:41 +01:00
David Ibia
ce2079ad95 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
2026-02-10 00:02:01 +01:00
David Ibia
9489c390fa feat: add boolean shape ops, visual undo tree, and Augmented Canvas branding
- Boolean operations (union, intersection, difference, xor) via i_overlay
  with Path shape rendering using earcutr triangulation
- Visual undo tree with branching history, checkout, and fork (Cmd+H)
  using Arc-based snapshots for structural sharing
- Consistent Augmented Canvas branding across app title, MCP server,
  CLI help text, and error messages
- macOS .app bundle script and Info.plist for Finder integration
- New MCP tool: boolean_op for agent-driven shape composition
- 26 tests passing (5 boolean, 6 history, 15 existing)
2026-02-10 00:01:45 +01:00
David Ibia
e8ec44d961 docs: add Augmented Canvas full name and macOS .app bundle instructions 2026-02-09 21:20:28 +01:00
David Ibia
233cb5798c Add session persistence and Cmd+K command palette
Workspace auto-saves every 30s and on exit, restores all tabs on
launch. Sessions persist drawing elements, SVG source, canvas state,
and metadata to ~/Library/Application Support/agcanvas/workspace.json.
Manual save via Cmd+S.

Command palette (Cmd+K) with fuzzy search over all commands: session
management, tool switching, view toggles, canvas operations. Arrow
keys to navigate, Enter to execute, Esc to dismiss.
2026-02-09 17:44:22 +01:00
David Ibia
43f1beea16 Add session metadata: creator tracking, descriptions, timestamps, and sorting
Sessions now track who created them (Human vs Agent with name),
optional descriptions, and creation timestamps. Agents can create
and update sessions via WebSocket and MCP. ListSessions supports
sorting by name, created_at, created_by, or element_count.

New MCP tools: create_session, update_session. Updated list_sessions
with sort_by/sort_order params. Tab bar shows robot icon for
agent-created sessions with hover tooltips.
2026-02-09 17:20:50 +01:00
David Ibia
b140d93163 Add agent drawing commands, session management, and MCP write tools
- Add CreateDrawingElement, UpdateDrawingElement, DeleteDrawingElement,
  ClearDrawingElements to WebSocket protocol and MCP bridge
- Add multi-session/tab support with SessionStore shared state
- Add bidirectional agent-GUI sync via broadcast + mpsc channels
- Update README with correct OpenCode MCP config format and new tools
- Fix dead code warning, clean up gitignore
2026-02-09 15:38:34 +01:00
David Ibia
d248864ee2 Add drawing tools, Mermaid support, and MCP server bridge
- Convert flat project to Cargo workspace (crates/agcanvas, crates/agcanvas-mcp)
- Add drawing layer: rectangles, ellipses, lines, arrows, text with select/move/resize
- Add Mermaid diagram rendering via mermaid-rs-renderer
- Add agcanvas-mcp: MCP server bridge for Claude Code, OpenCode, and Codex
- Add toolbar UI with keyboard shortcuts (V/R/E/L/A/T) and shape interaction
- Add example MCP configs for Claude Code, OpenCode, and Codex
- Update README with full feature docs, MCP setup, and updated architecture
2026-02-08 22:49:24 +01:00
David Ibia
732e205943 Add AGENTS.md with build commands and code style guidelines for AI agents 2026-01-23 15:23:40 +01:00
David Ibia
f466a6af93 Initial commit: agcanvas - interactive canvas for agent-human collaboration
- SVG paste from Figma with structure parsing (usvg)
- Element tree representation (groups, rects, paths, text, images)
- Canvas rendering with pan/zoom (egui + resvg + tiny-skia)
- WebSocket agent protocol on port 9876
- Semantic description generation
- Code generation stubs (React, HTML, Tailwind, Svelte, Vue)
- Cross-platform Rust implementation
2026-01-22 21:01:15 +01:00