Bring the obstacle-avoiding orthogonal edge routing (shipped for the app
server's create_diagram) to the tool server's open_drawio_xml, via a server-side
pass, and factor the libavoid-driving logic into one shared helper so the two
servers can't drift.
- shared/libavoid-routing.js: self-contained pure computeLibavoidRoutes
(vertices + edges -> orthogonal obstacle-avoiding waypoints). The app server
inlines it into the browser bundle via Function.toString(); the tool server
imports it in Node. shared/package.json marks the dir ESM.
- mcp-app-server: refactor routeWithLibavoid onto the shared helper (mxGraph
model extract + parent-relative write-back stays; routing math is now shared).
- mcp-tool-server: new src/libavoid-pass.js — parse the mxGraphModel XML, run
the shared helper, write waypoints + orthogonalEdgeStyle back, and fail safe
to the original XML on any problem. Add routing:"libavoid" to open_drawio_xml.
Vendor the libavoid-js NODE build + wasm (loaded by path; Node needs no
inlining/base64). copy-shared copies the helper into src/ (gitignored, with a
../../shared fallback for in-repo runs); vendor/ added to npm files.
- docs: routing param + vendored libavoid in root / app-server / tool-server
CLAUDE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>