The Command Center is Skyflo’s operator interface. It provides real-time visibility into agent execution, inline approval controls for mutating operations, and team administration, backed by SSE streaming from the Engine. It surfaces tool-level audit history, live streaming output, and approval controls.
See docs/architecture.md for full system context.
/api/v1 with:
POST /agent/chat (SSE) for token/tool streamingPOST /agent/approvals/{call_id} (SSE) for approve/denyPOST /agent/stop for stopping a running turnThe UI communicates with the Engine in two ways:
NEXT_PUBLIC_API_URL/agent/* using ChatService.src/app/api/* act as a lightweight BFF/proxy to API_URL/*, forwarding cookies and Authorization headers.1) User submits a prompt in ChatInput.
2) ChatInterface calls ChatService.startStream() which fetches NEXT_PUBLIC_API_URL/agent/chat with Accept: text/event-stream.
3) SSE events from the Engine are parsed in sseService.ts and dispatched to ChatInterface callbacks:
thinking, thinking.complete: model reasoning tokens shown in collapsible ThinkingBlocktoken: incremental assistant text (Markdown rendered in ChatMessages)tools.pending, tool.executing, tool.result, tool.error: shown inline via ToolVisualization segmentstool.awaiting_approval: UI prompts to approve/denytoken.usage: LLM token metrics shown via TokenUsageDisplayttft: time-to-first-token latencycompleted / workflow_complete / workflow.error: finalization
4) Approvals use ChatService.startApprovalStream(callId, approve, reason, conversationId) which opens a second SSE stream to /agent/approvals/{call_id}.
5) A running turn can be stopped via approvals.stopConversation(conversationId, runId) → POST /agent/stop.Conversations, history, profile, and team admin use server-side routes under src/app/api/* that forward to API_URL with the correct cookies/headers.
POST /auth/jwt/login and stores auth_token and refresh_token as HttpOnly cookies.AuthProvider schedules automatic session refresh every 14 minutes via POST /api/auth/refresh, which rotates the refresh token and issues a new access token.Authorization: Bearer <auth_token> built from cookies (lib/api.ts).POST /api/auth/logout to revoke the refresh token and clear both cookies.useAuthStore persists minimal auth state in localStorage (Zustand), separate from the HttpOnly cookies used on the server.lib/auth/constants.ts (access: 15 min, refresh: 7 days).Defined in .env.example:
# Server-side BFF -> Engine (used by src/app/api/* routes)
API_URL=http://localhost:8080/api/v1
# Client-side SSE -> Engine (used by ChatService in the browser)
NEXT_PUBLIC_API_URL=http://localhost:8080/api/v1
Notes:
cd ui
yarn install
yarn dev
# http://localhost:3000
| Command | Description |
|---|---|
yarn dev |
Start development server with hot reload |
yarn build |
Build for production |
yarn start |
Start production server |
yarn lint |
Run ESLint to check for code issues |
yarn build
yarn start
next.config.mjs outputs a standalone build suitable for containerization. See deployment/ui/ for Nginx and container examples.
ChatInterface.tsx: state machine for streaming turns, approvals, stopChatMessages.tsx: renders Markdown, thinking, and tool segmentsChatInput.tsx: input + stop controlThinkingBlock.tsx: collapsible view of model reasoning with streaming animation and durationToolVisualization.tsx: compact view of tool execution results/errors/auth/me and /auth/users/me/password/team/* (admin only)GET/POST /api/conversation → Engine conversations list/createGET/PATCH/DELETE /api/conversation/[id] → per-conversation opsGET /api/auth/me and GET /api/auth/admin-checkPOST /api/auth/refresh and POST /api/auth/logoutPATCH/POST /api/profile → profile update / password changeGET/POST/PATCH/DELETE /api/team → members, roles, invitations (admin)GET/POST /api/integrations and PATCH/DELETE /api/integrations/[id] → integrations admin (admin)NEXT_PUBLIC_API_URL and Engine on :8080, CORS, and network. The UI surfaces detailed errors from sseService.ts.POST /agent/approvals/{call_id} exists on Engine and the call_id is correct.auth_token cookie is present and forwarded; server routes build headers via lib/api.ts.| Component | Technology |
|---|---|
| Framework | Next.js 14 |
| Language | TypeScript 5 |
| Styling | Tailwind CSS |
| UI Primitives | Radix UI + shadcn/ui |
| State Management | React + Zustand |
| Streaming | Server-Sent Events |
| Markdown | react-markdown |
| Animations | framer-motion |