+ {/* Header */}
+
+
+
+
+ Security Audit
+
+
+ Scan installed skills for malicious patterns and security threats
+
+
+
+
+ {loading ? 'Scanning...' : 'Run Audit'}
+
+
+
+ {/* Loading */}
+ {loading &&
}
+
+ {/* Error */}
+ {error && (
+
+ {error}
+
+ )}
+
+ {/* Results */}
+ {data && !loading && (
+ <>
+ {/* Stats Grid */}
+
+
+
+
+
+
+
+ {/* Findings list */}
+ {data.summary.failed === 0 && data.summary.warning === 0 ? (
+
+ ) : (
+
+ {data.results
+ .filter((r) => r.findings.length > 0)
+ .sort((a, b) => severityRank(a) - severityRank(b))
+ .map((result, i) => (
+
+ ))}
+
+ )}
+
+ {/* Passed skills summary */}
+ {data.summary.passed > 0 && (data.summary.failed > 0 || data.summary.warning > 0) && (
+
+
+
+
+ {data.summary.passed} skill{data.summary.passed !== 1 ? 's' : ''} passed with no issues
+
+
+
+ )}
+ >
+ )}
+
+ {/* Initial state - no scan run yet */}
+ {!data && !loading && !error && (
+
+ Run Audit
+
+ }
+ />
+ )}
+
+ );
+}
+
+function StatCard({
+ label,
+ value,
+ icon: Icon,
+ color,
+}: {
+ label: string;
+ value: number;
+ icon: typeof ShieldCheck;
+ color: string;
+}) {
+ return (
+
+
+
+ {finding.severity}
+
+ {finding.message}
+
+ {finding.file}:{finding.line}
+
+
+ {finding.snippet && (
+
+ "{finding.snippet}"
+
+ )}
+
+ );
+}
+
+// Helpers
+
+function severityBadgeVariant(sev: string): 'danger' | 'warning' | 'info' {
+ switch (sev) {
+ case 'CRITICAL': return 'danger';
+ case 'HIGH': return 'warning';
+ default: return 'info';
+ }
+}
+
+function severityTextColor(sev: string): string {
+ switch (sev) {
+ case 'CRITICAL': return 'text-danger';
+ case 'HIGH': return 'text-warning';
+ default: return 'text-blue';
+ }
+}
+
+function getMaxSeverity(findings: AuditFinding[]): string {
+ if (findings.some((f) => f.severity === 'CRITICAL')) return 'CRITICAL';
+ if (findings.some((f) => f.severity === 'HIGH')) return 'HIGH';
+ return 'MEDIUM';
+}
+
+function severityRank(result: AuditResult): number {
+ const max = getMaxSeverity(result.findings);
+ switch (max) {
+ case 'CRITICAL': return 0;
+ case 'HIGH': return 1;
+ default: return 2;
+ }
+}
diff --git a/ui/src/pages/DashboardPage.tsx b/ui/src/pages/DashboardPage.tsx
index 4f1b41303..37ae8defd 100644
--- a/ui/src/pages/DashboardPage.tsx
+++ b/ui/src/pages/DashboardPage.tsx
@@ -7,22 +7,24 @@ import {
Info,
ArrowRight,
RefreshCw,
- Search as SearchIcon,
+
Download,
GitBranch,
AlertTriangle,
Check,
Package,
Zap,
+ ShieldCheck,
} from 'lucide-react';
import Card from '../components/Card';
import Badge from '../components/Badge';
import Skeleton from '../components/Skeleton';
import { PageSkeleton } from '../components/Skeleton';
import StatusBadge from '../components/StatusBadge';
+import ConfirmDialog from '../components/ConfirmDialog';
import { useToast } from '../components/Toast';
import { api } from '../api/client';
-import type { Target as TargetType, CheckResult } from '../api/client';
+import type { Target as TargetType, CheckResult, AuditAllResponse } from '../api/client';
import { useApi } from '../hooks/useApi';
import { useAppContext } from '../context/AppContext';
import { wobbly, shadows } from '../design';
@@ -31,6 +33,7 @@ import { shortenHome } from '../lib/paths';
export default function DashboardPage() {
const { data, loading, error } = useApi(() => api.getOverview());
const [updatingAll, setUpdatingAll] = useState(false);
+ const [showUpdateConfirm, setShowUpdateConfirm] = useState(false);
const { toast } = useToast();
const { isProjectMode } = useAppContext();
@@ -184,6 +187,9 @@ export default function DashboardPage() {
{/* Skill Updates Check */}