Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ downloads/
eggs/
.eggs/
lib/
!web-ui/src/lib/
!web-ui/src/lib/**
lib64/
parts/
sdist/
Expand Down Expand Up @@ -69,4 +71,4 @@ config.local.json

# Temporary files
*.tmp
*.temp
*.temp
28 changes: 8 additions & 20 deletions web-ui/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import '@/styles/globals.css';
import { TopCommandBar } from '@/components/layout/TopCommandBar';
import { LeftNav } from '@/components/layout/LeftNav';
import { StatusStrip } from '@/components/layout/StatusStrip';
import { ChatWidget } from '@/components/chat/ChatWidget';
import { CommandCenterFrame } from '@/components/webmode/CommandCenterFrame';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'NeuroRift - Security Intelligence Workspace',
description: 'A persistent multi-agent security workspace by demonking369',
title: 'NeuroRift Web Mode - Command Interface',
description: 'AI-native command interface for OpenClaw + NeuroRift.',
};

export default function RootLayout({
Expand All @@ -21,20 +18,11 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<div className="h-screen flex flex-col">
<TopCommandBar />

<div className="flex-1 flex overflow-hidden">
<LeftNav />

<main className="flex-1 overflow-auto">
{children}
</main>
</div>

<StatusStrip />
<ChatWidget />
</div>
<CommandCenterFrame>
<main className="h-full">
{children}
</main>
</CommandCenterFrame>
</body>
</html>
);
Expand Down
142 changes: 2 additions & 140 deletions web-ui/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,145 +1,7 @@
'use client';

import { useNeuroRift } from '@/lib/hooks';
import { Activity, Shield, AlertTriangle, FileText } from 'lucide-react';
import { cn, getSeverityColor } from '@/lib/utils';
import { CommandCenter } from '@/components/webmode/CommandCenter';

export default function DashboardPage() {
const { session, agents, tasks, approvals } = useNeuroRift();

if (!session) {
return (
<div className="h-full flex items-center justify-center">
<div className="text-center">
<Shield className="w-16 h-16 text-neuro-text-muted mx-auto mb-4" />
<h2 className="text-2xl font-bold text-neuro-text-primary mb-2">No Active Session</h2>
<p className="text-neuro-text-secondary">Create or load a session to get started</p>
</div>
</div>
);
}

const findingsBySeverity = session.findings.reduce((acc, finding) => {
acc[finding.severity] = (acc[finding.severity] || 0) + 1;
return acc;
}, {} as Record<string, number>);

return (
<div className="p-6 space-y-6">
{/* Header */}
<div>
<h1 className="text-3xl font-bold text-neuro-text-primary">Dashboard</h1>
<p className="text-neuro-text-secondary mt-1">Overview of {session.name}</p>
</div>

{/* Stats Grid */}
<div className="grid grid-cols-4 gap-4">
<StatsCard
icon={Shield}
label="Total Findings"
value={session.findings.length}
color="text-neuro-primary"
/>
<StatsCard
icon={Activity}
label="Active Tasks"
value={tasks.filter((t) => t.status === 'running').length}
color="text-neuro-success"
/>
<StatsCard
icon={AlertTriangle}
label="Pending Approvals"
value={approvals.filter((a) => a.status === 'pending').length}
color="text-severity-medium"
/>
<StatsCard
icon={FileText}
label="Artifacts"
value={session.artifacts.length}
color="text-neuro-text-secondary"
/>
</div>

{/* Severity Breakdown */}
<div className="glass-card p-6">
<h2 className="text-xl font-semibold text-neuro-text-primary mb-4">Findings by Severity</h2>
<div className="space-y-3">
{(['CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'INFO'] as const).map((severity) => {
const count = findingsBySeverity[severity] || 0;
const total = session.findings.length || 1;
const percentage = (count / total) * 100;

return (
<div key={severity}>
<div className="flex items-center justify-between mb-1">
<span className={cn('text-sm font-medium', getSeverityColor(severity))}>
{severity}
</span>
<span className="text-sm text-neuro-text-muted">{count}</span>
</div>
<div className="h-2 bg-neuro-bg rounded-full overflow-hidden">
<div
className={cn('h-full transition-all', getSeverityColor(severity).replace('text-', 'bg-'))}
style={{ width: `${percentage}%` }}
/>
</div>
</div>
);
})}
</div>
</div>

{/* Agent Status */}
<div className="glass-card p-6">
<h2 className="text-xl font-semibold text-neuro-text-primary mb-4">Agent Status</h2>
<div className="grid grid-cols-5 gap-4">
{Object.entries(agents).map(([agentType, status]) => (
<div key={agentType} className="text-center">
<div className={cn(
'w-12 h-12 rounded-full mx-auto mb-2 flex items-center justify-center',
status.state === 'idle' ? 'bg-neuro-bg' :
status.state === 'error' ? 'bg-severity-critical/20' :
'bg-neuro-primary/20'
)}>
<Activity className={cn(
'w-6 h-6',
status.state === 'idle' ? 'text-neuro-text-muted' :
status.state === 'error' ? 'text-severity-critical' :
'text-neuro-primary'
)} />
</div>
<p className="text-sm font-medium text-neuro-text-primary">{agentType}</p>
<p className="text-xs text-neuro-text-muted capitalize">{status.state}</p>
</div>
))}
</div>
</div>
</div>
);
}

function StatsCard({
icon: Icon,
label,
value,
color,
}: {
icon: any;
label: string;
value: number;
color: string;
}) {
return (
<div className="glass-card p-4">
<div className="flex items-center gap-3">
<div className={cn('p-2 rounded-lg bg-neuro-bg', color)}>
<Icon className="w-6 h-6" />
</div>
<div>
<p className="text-2xl font-bold text-neuro-text-primary">{value}</p>
<p className="text-sm text-neuro-text-secondary">{label}</p>
</div>
</div>
</div>
);
return <CommandCenter />;
}
12 changes: 12 additions & 0 deletions web-ui/src/components/webmode/CommandCenter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';

import { CommandCenterSurface } from '@/components/webmode/CommandCenterSurface';
import { WebModeProvider } from '@/components/webmode/WebModeProvider';

export function CommandCenter() {
return (
<WebModeProvider>
<CommandCenterSurface />
</WebModeProvider>
);
}
54 changes: 54 additions & 0 deletions web-ui/src/components/webmode/CommandCenterFrame.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use client';

import { Activity, ShieldCheck, Wifi, Signal } from 'lucide-react';
Comment on lines +1 to +3
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing React import
CommandCenterFrame uses React.ReactNode in the prop type, but this file doesn’t import React (or ReactNode). This will fail type-checking in TS setups without jsxImportSource/global React types. Import type React or type ReactNode from react and use it in the signature.

import { useNeuroRift } from '@/lib/hooks';
import { cn } from '@/lib/utils';

export function CommandCenterFrame({ children }: { children: React.ReactNode }) {
const { session, systemHealth, torConnected, metrics } = useNeuroRift();

return (
<div className="min-h-screen bg-neuro-void text-neuro-text-primary">
<div className="pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_top,_rgba(34,211,238,0.12),_transparent_50%),radial-gradient(circle_at_bottom,_rgba(99,102,241,0.12),_transparent_55%)]" />
<div className="pointer-events-none fixed inset-0 bg-[linear-gradient(to_right,_rgba(15,23,42,0.35)_1px,_transparent_1px),linear-gradient(to_bottom,_rgba(15,23,42,0.35)_1px,_transparent_1px)] bg-[size:32px_32px] opacity-30" />
<div className="relative flex min-h-screen flex-col">
<header className="flex items-center justify-between px-6 py-4 border-b border-neuro-border/60 backdrop-blur">
<div className="flex items-center gap-3">
<div className="h-10 w-10 rounded-xl bg-gradient-to-br from-cyan-500 via-blue-600 to-purple-600 flex items-center justify-center shadow-lg shadow-cyan-500/30">
<Signal className="h-5 w-5 text-white" />
</div>
<div>
<p className="text-xs uppercase tracking-[0.4em] text-neuro-text-muted">NeuroRift Web Mode</p>
<h1 className="text-lg font-semibold">Command Interface</h1>
</div>
</div>
<div className="hidden lg:flex items-center gap-4 text-xs text-neuro-text-muted">
<div className="flex items-center gap-2 px-3 py-1 rounded-full bg-neuro-surface/60 border border-neuro-border/60">
<ShieldCheck className="w-3.5 h-3.5 text-emerald-300" />
<span>{session ? session.name : 'No active session'}</span>
</div>
<div className="flex items-center gap-2 px-3 py-1 rounded-full bg-neuro-surface/60 border border-neuro-border/60">
<Wifi className={cn('w-3.5 h-3.5', torConnected ? 'text-emerald-300' : 'text-rose-400')} />
<span>{torConnected ? 'Secure Relay' : 'Relay Offline'}</span>
</div>
<div className="flex items-center gap-2 px-3 py-1 rounded-full bg-neuro-surface/60 border border-neuro-border/60">
<Activity className="w-3.5 h-3.5 text-cyan-300" />
<span>CPU {systemHealth.cpu.toFixed(0)}%</span>
<span>MEM {systemHealth.memory.toFixed(0)}%</span>
<span>LAT {systemHealth.latency.toFixed(0)}ms</span>
</div>
</div>
<div className="flex items-center gap-2 text-xs text-neuro-text-muted">
<span className="px-2 py-1 rounded-full bg-neuro-surface/60 border border-neuro-border/60">Tasks {metrics.activeTasks}</span>
<span className="px-2 py-1 rounded-full bg-neuro-surface/60 border border-neuro-border/60">Approvals {metrics.pendingApprovals}</span>
</div>
</header>
<div className="flex-1 overflow-hidden">{children}</div>
<footer className="px-6 py-3 border-t border-neuro-border/60 text-xs text-neuro-text-muted flex items-center justify-between backdrop-blur">
<span>Policy-driven routing • Deterministic execution enforced</span>
<span>Web Mode vNext</span>
</footer>
</div>
</div>
);
}
75 changes: 75 additions & 0 deletions web-ui/src/components/webmode/CommandCenterSurface.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
'use client';

import { panelDefinitions, layoutZones } from '@/lib/webmode/schema';
import { evaluatePanelPolicy } from '@/lib/webmode/policy';
import { PanelRenderer } from '@/components/webmode/PanelRenderer';
import { useNeuroRift } from '@/lib/hooks';
import { useWebModeContext } from '@/components/webmode/WebModeProvider';
import { cn } from '@/lib/utils';

export function CommandCenterSurface() {
const { session } = useNeuroRift();
const { deviceTier, controlMode, phase, lastSignal } = useWebModeContext();

const policyContext = {
deviceTier,
controlMode,
sessionActive: Boolean(session),
};

const panels = panelDefinitions.filter(panel => evaluatePanelPolicy(panel, policyContext));

const panelMap = new Map(panels.map(panel => [panel.id, panel]));

const primaryPanels = layoutZones.primary.map(id => panelMap.get(id)).filter(Boolean);
const secondaryPanels = layoutZones.secondary.map(id => panelMap.get(id)).filter(Boolean);
const tertiaryPanels = layoutZones.tertiary.map(id => panelMap.get(id)).filter(Boolean);
const dockPanels = layoutZones.dock.map(id => panelMap.get(id)).filter(Boolean);

return (
<div className="h-full overflow-y-auto px-6 py-6">
<div className="mb-6 flex flex-col gap-3">
<div className="flex flex-wrap items-center gap-3">
<span className="text-xs uppercase tracking-[0.4em] text-neuro-text-muted">Phase</span>
<span className="px-3 py-1 rounded-full bg-neuro-surface/70 border border-neuro-border/60 text-xs">{phase}</span>
<span className="px-3 py-1 rounded-full bg-neuro-surface/70 border border-neuro-border/60 text-xs">{controlMode.toUpperCase()} MODE</span>
<span className={cn(
'px-3 py-1 rounded-full border text-xs',
deviceTier === 'mobile' && 'border-cyan-400/60 text-cyan-200',
deviceTier === 'tablet' && 'border-indigo-400/60 text-indigo-200',
deviceTier === 'desktop' && 'border-emerald-400/60 text-emerald-200',
deviceTier === 'wide' && 'border-purple-400/60 text-purple-200'
)}>
{deviceTier.toUpperCase()} TIER
</span>
</div>
<div className="text-sm text-neuro-text-secondary">{lastSignal}</div>
</div>

<div className="grid grid-cols-1 xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)] gap-6">
<div className="space-y-6">
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
{primaryPanels.map(panel => (
panel ? <PanelRenderer key={panel.id} panel={panel} /> : null
))}
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
{secondaryPanels.map(panel => (
panel ? <PanelRenderer key={panel.id} panel={panel} /> : null
))}
</div>
</div>
<div className="space-y-6">
{tertiaryPanels.map(panel => (
panel ? <PanelRenderer key={panel.id} panel={panel} /> : null
))}
<div className="grid grid-cols-1 gap-6">
{dockPanels.map(panel => (
panel ? <PanelRenderer key={panel.id} panel={panel} /> : null
))}
</div>
</div>
</div>
</div>
);
}
23 changes: 23 additions & 0 deletions web-ui/src/components/webmode/PanelRegistry.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type React from 'react';
import type { PanelId } from '@/lib/webmode/types';
import { CommandPanel } from '@/components/webmode/panels/CommandPanel';
import { ActivityStreamPanel } from '@/components/webmode/panels/ActivityStreamPanel';
import { AgentGraphPanel } from '@/components/webmode/panels/AgentGraphPanel';
import { IntentFlowPanel } from '@/components/webmode/panels/IntentFlowPanel';
import { ExecutionTimelinePanel } from '@/components/webmode/panels/ExecutionTimelinePanel';
import { MemoryPulsePanel } from '@/components/webmode/panels/MemoryPulsePanel';
import { ConfigMatrixPanel } from '@/components/webmode/panels/ConfigMatrixPanel';
import { OnlineModePanel } from '@/components/webmode/panels/OnlineModePanel';
import { PermissionsPanel } from '@/components/webmode/panels/PermissionsPanel';

export const PanelRegistry: Record<PanelId, React.ComponentType> = {
command: CommandPanel,
activity: ActivityStreamPanel,
'agent-graph': AgentGraphPanel,
'intent-flow': IntentFlowPanel,
'execution-timeline': ExecutionTimelinePanel,
'memory-pulse': MemoryPulsePanel,
'config-matrix': ConfigMatrixPanel,
'online-mode': OnlineModePanel,
permissions: PermissionsPanel,
};
Loading
Loading