feat(FN-2168): add persistent dev-server dashboard flow
- Add a durable dev-server store and manager with persisted state/log history, process reconciliation, and SSE event buffering - Wire new backend lifecycle APIs for status/history/start/stop/restart/stream and initialize/shutdown manager handling in server startup - Add dashboard Dev Server view, hook-based hydration/stream handling, nav integration, and supporting styles - Expand coverage with backend persistence/route tests and frontend DevServerView/useDevServer tests - Document the dev-server persistence architecture in docs/architecture.md
This commit is contained in:
@@ -373,6 +373,10 @@ Implemented in `agent-heartbeat.ts`:
|
||||
Key server capabilities:
|
||||
- REST APIs for tasks, git, GitHub, agents, missions, planning, automations/routines, settings
|
||||
- Chat APIs (`/api/chat/*`) with streaming response support (`routes.ts`, `chat.ts`)
|
||||
- Dev-server lifecycle + persistence APIs (`/api/dev-server/*`) backed by:
|
||||
- `dev-server-manager.ts` (single process manager per project root)
|
||||
- `dev-server-store.ts` (durable `.fusion/dev-server-state.json` + `.fusion/dev-server.log`)
|
||||
- startup PID reconciliation (`process.kill(pid, 0)` liveness check)
|
||||
- Plugin management routes (`plugin-routes.ts`)
|
||||
- Insights routes (`insights-routes.ts`)
|
||||
- Roadmap routes (`roadmap-routes.ts`)
|
||||
@@ -388,6 +392,10 @@ Key server capabilities:
|
||||
- Streams assistant responses as SSE events for chat sessions
|
||||
- **Task log stream**: `/api/tasks/:id/logs/stream` (`server.ts`)
|
||||
- SSE endpoint for live task log streaming with project scope resolution
|
||||
- **Dev-server stream**: `/api/dev-server/stream` (`routes.ts`, `dev-server-manager.ts`)
|
||||
- SSE stream emits `state` + `log` events with monotonic `id` fields
|
||||
- supports replay from buffered history using `Last-Event-ID`/`lastEventId`
|
||||
- frontend hydrates from `/api/dev-server/status` + `/api/dev-server/history` before attaching stream
|
||||
- **Badge WebSocket**: `/api/ws` (`server.ts`, `websocket.ts`)
|
||||
- Scope-keyed channels (`badge:{scopeKey}:{taskId}`) prevent cross-project collisions
|
||||
- **Terminal WebSocket**: `/api/terminal/ws` (`server.ts`, `terminal-service.ts`)
|
||||
@@ -399,12 +407,14 @@ Key server capabilities:
|
||||
- Core board components: `Board.tsx`, `Column.tsx`, `TaskCard.tsx`, `TaskDetailModal.tsx`
|
||||
- Chat system UI: `ChatView.tsx`, `QuickChatFAB.tsx`
|
||||
- Planning/roadmap/insight UI: `MissionManager.tsx`, `RoadmapsView.tsx`, `InsightsView.tsx`, `DocumentsView.tsx`
|
||||
- Dev server UI: `DevServerView.tsx` (controls + status/log panel + embedded preview with iframe fallback messaging)
|
||||
|
||||
### Key hooks
|
||||
- Task + realtime: `useTasks.ts`, `useBadgeWebSocket.ts`, `useAiSessionSync.ts`
|
||||
- Chat: `useChat.ts`, `useQuickChat.ts`
|
||||
- Documents/insights/memory: `useDocuments.ts`, `useInsights.ts`, `useMemoryBackendStatus.ts`, `useMemoryData.ts`
|
||||
- Planning/roadmaps: `useRoadmaps.ts`
|
||||
- Dev server: `useDevServer.ts` (status/history hydration, reconnect stream merge, project-scope reset)
|
||||
- Project/agents/setup: `useProjects.ts`, `useCurrentProject.ts`, `useAgents.ts`, `useSetupReadiness.ts`
|
||||
- UX/platform helpers: `useFavorites.ts`, `useAuthOnboarding.ts`, `useDeepLink.ts`, `useTerminal.ts`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user