Vorflux AI
|
e7676763a9
|
Add comprehensive unit tests for memory-graph package
79 tests across 6 test files covering:
- SpatialIndex: grid rebuild, queryPoint hit-testing, boundary cells, hash detection
- ViewportState: worldToScreen/screenToWorld roundtrip, pan, zoomImmediate,
zoomTo animation, fitToNodes, centerOn, inertia decay
- ForceSimulation: init/destroy lifecycle, update hot-swap, reheat/coolDown
- VersionChainIndex: chain building via parentMemoryId, caching, rebuild
- Graph data utils: normalizeDocCoordinates, getMemoryBorderColor,
getEdgeVisualProps, screenToBackendCoords, calculateBackendViewport
- Mock data: deterministic seeded output, correct counts, valid edge references
Also exports pure utility functions from use-graph-data.ts for testability.
|
2026-03-27 00:06:21 +00:00 |
|
Vorflux AI
|
1c5ef7e5ed
|
Rewrite @supermemory/memory-graph with perf optimizations and consolidate consumers
Package changes (packages/memory-graph):
- Spatial grid nearest-neighbor: O(n^2) -> O(n*k) for doc-doc edge rendering
- Zoom-based edge culling: skip low-similarity edges at low zoom levels
- Modular canvas engine from mono repo (renderer, simulation, viewport, hit-test)
- Remove vanilla-extract CSS, use inline styles only
- Add motion/react for slide-in animations
- Export mock data generator for stress testing
- Add performance and integration tests (15/15 pass)
Web app changes (apps/web):
- Remove local graph implementation (~4400 lines deleted)
- Add thin wrapper (memory-graph-wrapper.tsx) using useGraphApi hook
- Keep app-specific graph-card.tsx and use-graph-api.ts
Playground changes (apps/memory-graph-playground):
- Add stress test buttons (50/100/200/500 docs)
- Add mock data generation via package
- Convert DocumentWithMemories to GraphApiDocument format
- Show FPS counter during stress tests
All TypeScript compiles clean. Performance tests: 15/15 pass.
|
2026-03-26 17:58:28 +00:00 |
|
Prasanna721
|
2bbc7fc7a5
|
feat(mcp): add interactive memory graph MCP App visualization (#763)
### feat(mcp): add memory graph visualization MCP App
#### Summary
- Add interactive force-directed graph visualization as an MCP App using `force-graph` + `d3-force-3d`
- Register `memory-graph` and `fetch-graph-data` tools with MCP Apps SDK UI resources
- Add graph API client methods (`getGraphBounds`, `getGraphViewport`) to `SupermemoryClient`
- Set up Vite + `vite-plugin-singlefile` build pipeline to produce a self-contained HTML bundle
- Support light/dark theme, zoom controls, node popups, and legend
#### Files changed
- `apps/mcp/src/server.ts` — register app tools + HTML resource
- `apps/mcp/src/client.ts` — add graph API types and methods
- `apps/mcp/src/ui/mcp-app.ts` — force-graph visualization app
- `apps/mcp/src/ui/global.css`, `mcp-app.css` — styling
- `apps/mcp/mcp-app.html` — entry HTML for Vite
- `apps/mcp/vite.config.ts` — Vite single-file build config
- `apps/mcp/package.json` — add UI deps and build scripts
- `apps/mcp/wrangler.jsonc` — add HTML text import rule
|
2026-03-05 16:28:34 +00:00 |
|