feat: add mindmap components from jarvis frontend

- Copied mindmap visualization components (ReactFlow-based interactive graph)
- Added MindmapViewer, ReactFlowEditor, MermaidViewer
- Included all node types: Concept, Task, Idea, Project
- Added controls: NodeCreateModal, ExportButton
- Created mindmap route at /mindmap
- Added useGraphData hook for knowledge graph API
- Copied auth-client and api utilities (dependencies)

Note: Requires better-auth packages to be installed for full compilation
This commit is contained in:
Jason Woltje
2026-01-29 21:45:56 -06:00
parent af8f5df111
commit aa267b56d8
15 changed files with 1758 additions and 0 deletions

33
apps/web/src/lib/api.ts Normal file
View File

@@ -0,0 +1,33 @@
/**
* API utilities for session management and authentication
*/
let sessionExpiredHandled = false;
/**
* Handle session expiration by redirecting to login
*/
export function handleSessionExpired(): void {
if (sessionExpiredHandled) return;
sessionExpiredHandled = true;
// If we're in the browser, redirect to login
if (typeof window !== 'undefined') {
window.location.href = '/login?expired=true';
}
}
/**
* Check if a session expiration is already being handled
* (prevents multiple simultaneous redirects)
*/
export function isSessionExpiring(): boolean {
return sessionExpiredHandled;
}
/**
* Reset the session expiration flag (for testing)
*/
export function resetSessionExpirationFlag(): void {
sessionExpiredHandled = false;
}