mirror of
https://github.com/jgraph/drawio-mcp.git
synced 2026-09-14 15:42:06 +08:00
fb952971f8
Extract the shape-search algorithm (soundex, compound-token splitting, scored AND/OR ranking) out of mcp-app-server/src/shared.js into shared/shape-search.js as the single source of truth, imported by both servers. Expose search_shapes on the stdio tool server. To keep the npm package lean the ~4.6 MB shape index is not bundled: it is loaded lazily on the first call and cached in memory, read from the local file in-repo or fetched from the CDN (jsDelivr @main, overridable via DRAWIO_SHAPE_INDEX_URL) in a published install. Only the ~9 KB algorithm module is copied into src/ by copy-shared. Packed tarball stays ~0.66 MB. Based on the approach in #50 by @Suryajit27, reworked to avoid committing the index and drop the unrelated lockfile churn. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>