ui
Web UI and REST API gateway for Cruvero. Serves an embedded web dashboard and exposes HTTP endpoints for workflow management, tool approvals, cost queries, audit exploration, quota management, and security monitoring.
Key Files
| File | Purpose |
|---|---|
main.go | Entry point: HTTP server, API routes, auth middleware |
Architecture
The UI binary is a single HTTP server that:
- Serves embedded static assets (HTML/JS/CSS) for the web dashboard
- Exposes REST API endpoints for workflow operations
- Connects to Temporal for workflow queries and signals
- Reads from PostgreSQL for audit logs, registry data, and immunity state
API Endpoints
| Path | Description |
|---|---|
/api/runs | List workflows |
/api/run | Fetch run detail |
/api/execute | Start a single-agent run |
/api/supervisor/start | Start a multi-agent run |
/api/knowledge-bases* | Knowledge Base CRUD/upload/embed |
/api/run-templates* | Run template list/create/load |
/api/tools | List tools and pending approvals |
/api/approve | Approve/reject tool executions |
/api/answer | Answer agent questions |
/api/cost | Cost dashboard data |
/api/quota/* | Quota status, reset, override |
/api/audit/* | Audit log queries and chain verification |
/api/security/alerts | Security alert metrics |
/api/immune/* | Immunity quarantine management |
Web Pages
| Page | URL |
|---|---|
| Run operations | http://localhost:8080/ |
| Tool browser | http://localhost:8080/tools |
| Cost dashboard | http://localhost:8080/cost |
| Audit explorer | http://localhost:8080/audit |
| Security alerts | http://localhost:8080/security |
| Knowledge Bases | http://localhost:8080/knowledge-bases |
| Agents control plane | http://localhost:8080/agents |
Dependencies on Shared Packages
agent, audit, config, health, llm, mcp, observability, quota, registry, temporal, tenant, tools
Configuration
See docs/manual/config-env.md. Key variables:
| Env Var | Required | Default | Description |
|---|---|---|---|
CRUVERO_UI_AUTH | No | none | Auth mode: none or keycloak |
CRUVERO_UI_READONLY | No | false | Disable approve/replay |
CRUVERO_UI_ADMIN_TOKEN | No | — | Token for quota mutation endpoints |
CRUVERO_UI_CORS | No | false | Enable CORS |
Development
Run Locally
go run ./cmd/ui --addr :8080
Run Tests
go test ./cmd/ui/...