Implementation:AMAP ML SkillClaw Dashboard Server
| Knowledge Sources | |
|---|---|
| Domains | Dashboard, FastAPI, Skill_Evolution |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
Concrete FastAPI service that serves the SkillClaw dashboard UI and REST API for inspecting skills, sessions, validation jobs, version history, and triggering evolve server operations.
Description
The dashboard_server module provides `DashboardService` (the service layer) and `create_dashboard_app()` (the FastAPI factory). `DashboardService` owns snapshot synchronization (`sync()`), skill operations (`pull_skills`, `push_skills`, `sync_skills`, `activate_skill_version`), session export (`export_local_sessions`), validation review (`submit_validation_review`), and evolve server integration (`get_evolve_status`, `trigger_evolve`). The FastAPI app exposes REST endpoints under `/api/v1/` for health, overview, skills, sessions, validation jobs, sync, and operations (pull/push/sync/export/trigger-evolve). It serves the static dashboard frontend from `dashboard_assets/` and supports an embedded evolve server for single-machine deployments without a separate evolve server URL.
Usage
Import and use when you need to:
- Serve the dashboard: `serve_dashboard(config)` starts uvicorn
- Create a FastAPI app for embedding: `create_dashboard_app(config)`
- Trigger evolve operations programmatically via `DashboardService`
- Submit validation reviews from the dashboard
- Activate shared skill versions locally
- Export local sessions to shared storage
Code Reference
Source Location
- Repository: SkillClaw
- File: `skillclaw/dashboard_server.py:L1-731`
Signature
class DashboardService:
"""Owns dashboard snapshot sync, queries, and operations."""
def __init__(self, config: SkillClawConfig) -> None:
self.config = config
self.store = DashboardStore(config.dashboard_db_path)
def sync(self) -> dict[str, Any]:
"""Build snapshot and replace SQLite projection."""
def pull_skills(self, *, skill_names: list[str] | None = None) -> dict[str, Any]:
"""Pull skills from shared pool to local directory."""
def push_skills(self, *, no_filter: bool = False) -> dict[str, Any]:
"""Push local skills to shared pool."""
def activate_skill_version(self, skill_id: str, *, target: str) -> dict[str, Any]:
"""Activate a specific skill version locally (local-current, shared-current, shared-version:N)."""
async def submit_validation_review(
self, job_id: str, *, accepted: bool,
score: float | None = None, notes: str = "",
auto_finalize: bool = True,
) -> dict[str, Any]:
"""Submit a manual validation review for a candidate skill."""
async def get_evolve_status(self) -> dict[str, Any]:
"""Check evolve server health (remote URL or embedded)."""
async def trigger_evolve(self) -> dict[str, Any]:
"""Trigger an evolve server cycle (remote or embedded)."""
def export_local_sessions(self, *, session_ids: list[str] | None = None) -> dict[str, Any]:
"""Export local sessions to shared storage."""
def create_dashboard_app(config: SkillClawConfig) -> FastAPI:
"""Factory for the dashboard FastAPI application."""
def serve_dashboard(config: SkillClawConfig) -> None:
"""Run the dashboard HTTP service via uvicorn."""
Import
from skillclaw.dashboard_server import DashboardService, create_dashboard_app, serve_dashboard
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config | SkillClawConfig | Yes | SkillClaw configuration |
| config.dashboard_db_path | str | Yes | SQLite database path for DashboardStore |
| config.dashboard_host | str | No | HTTP host (default 127.0.0.1) |
| config.dashboard_port | int | No | HTTP port (default 3788) |
| config.dashboard_sync_on_start | bool | No | Sync snapshot on startup |
| config.dashboard_evolve_server_url | str | No | Remote evolve server URL (or embedded if empty) |
| config.sharing_enabled | bool | No | Whether skill sharing is enabled |
Outputs
| Name | Type | Description |
|---|---|---|
| FastAPI app | FastAPI | ASGI application with REST API and static assets |
| /api/v1/overview | JSON | Dashboard overview metrics |
| /api/v1/skills | JSON | Skill list with filtering |
| /api/v1/skills/{id} | JSON | Skill detail with versions and related sessions |
| /api/v1/sessions | JSON | Session list with filtering |
| /api/v1/sessions/{id} | JSON | Session detail with turns and skill links |
| /api/v1/validation/jobs | JSON | Validation job list |
| /api/v1/sync | POST JSON | Rebuild snapshot |
| /api/v1/ops/* | POST JSON | Pull, push, sync, export, trigger-evolve operations |
| / | HTML | Dashboard index.html |
| /assets/* | Static | Dashboard static assets (app.js, CSS) |
Usage Examples
Serve Dashboard Standalone
from skillclaw.config import SkillClawConfig
from skillclaw.dashboard_server import serve_dashboard
config = SkillClawConfig.from_env()
# Dashboard available at http://127.0.0.1:3788/
serve_dashboard(config)
Embed Dashboard in Custom ASGI App
from skillclaw.config import SkillClawConfig
from skillclaw.dashboard_server import create_dashboard_app
config = SkillClawConfig.from_env()
app = create_dashboard_app(config)
# Mount under a sub-path in a larger application
from starlette.middleware.terminal import Middleware
# app can be served by any ASGI server (uvicorn, hypercorn, etc.)
Trigger Evolve and Sync
import asyncio
from skillclaw.config import SkillClawConfig
from skillclaw.dashboard_server import DashboardService
config = SkillClawConfig.from_env()
service = DashboardService(config)
# Trigger evolve cycle (embedded mode)
result = asyncio.run(service.trigger_evolve())
print(f"Evolve result: {result['result']}")
print(f"Sync: {result['sync']}")