Adds a full diagramming workflow on top of the v0.1.0 preview tool.
New tools
draw_mermaid_diagram— convert Mermaid flowcharts/sequences/class/ER sources into native Excalidraw elements in the webview (#1).screenshot_diagram— export the current canvas as a PNG so the model can visually self-correct overlaps, off-camera elements, and unreadable labels.load_diagram/list_diagrams— browse and restore diagrams persisted under.pi/excalidraw-diagrams/<slug>.excalidraw.
Workflow
/excalidrawnow arms a post-turn review loop that prompts the user to send the screenshot back to the LLM with optional comments for another refinement pass.- The drawing prompt instructs the model to call
screenshot_diagramitself after each draw and self-correct before reporting back.
Internals
- Window lifecycle consolidated behind a single
startPreviewWindow()helper that clears the cached promise on failure so the next call retries instead of being permanently wedged on a rejected promise (#3). glimpseuiis now a declared runtime dependency inpackage.jsonrather than relying on fallback path resolution fromprocess.execPath. Friendlier error pointing at the install URL when it can't be resolved.- ESLint with a pragmatic TypeScript config, a testable
diagrams.tsmodule with full unit tests for slug/path/parse helpers, and CI that runs lint before typecheck.
Docs
- Architecture diagram (#2).
- Embedded GIF walkthrough of
/excalidrawdriving the live preview.
Install
pi install git:github.com/kostyay/pi-k-excalidraw@v0.2.0Full diff: v0.1.0...v0.2.0