'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { Bot, Zap, Globe, ChevronRight, Check, Terminal, Sparkles } from 'lucide-react'; import { useAuthStore } from '@/stores/auth-store'; const AGENTS = [ { id: 'lucidia', name: 'Lucidia', icon: '🌀', desc: 'Philosopher. Deep reasoning, strategy, synthesis.', color: '#2979FF' }, { id: 'alice', name: 'Alice', icon: '🚪', desc: 'Executor. Tasks, code, automation, deployments.', color: '#34d399' }, { id: 'octavia', name: 'Octavia', icon: '⚡', desc: 'Architect. Infra, monitoring, system health.', color: '#F5A623' }, { id: 'cecilia', name: 'Cecilia', icon: '💜', desc: 'Core. Identity, memory, meta-cognition.', color: '#9C27B0' }, { id: 'shellfish', name: 'Shellfish', icon: '🔐', desc: 'Hacker. Security, exploits, pen testing.', color: '#ef4444' }, { id: 'cipher', name: 'Cipher', icon: '🛡️', desc: 'Guardian. Auth, encryption, access control.', color: '#FF1D6C' }, ]; const STEPS = ['Welcome', 'Your name', 'First agent', 'Gateway', 'Done']; export default function OnboardingPage() { const router = useRouter(); const setUser = useAuthStore((s) => s.setUser); const [step, setStep] = useState(0); const [name, setName] = useState(''); const [agent, setAgent] = useState('lucidia'); const [gateway, setGateway] = useState('http://127.0.0.1:8787'); const [saving, setSaving] = useState(false); function next() { setStep(s => Math.min(s + 1, STEPS.length - 1)); } function back() { setStep(s => Math.max(s - 1, 0)); } async function finish() { setSaving(true); const displayName = name.trim() || 'Alexa'; // Save to localStorage if (typeof window !== 'undefined') { const existing = JSON.parse(localStorage.getItem('br-settings') || '{}'); localStorage.setItem('br-settings', JSON.stringify({ ...existing, displayName, gatewayUrl: gateway, defaultAgent: agent, onboarded: true, })); } setUser({ id: 'local', name: displayName, email: `${displayName.toLowerCase()}@blackroad.io`, role: 'admin' }); setSaving(false); router.push(`/conversations/new?agent=${agent}`); } const selected = AGENTS.find(a => a.id === agent)!; return (
{/* Progress */}
{STEPS.map((s, i) => (
{i < step ? : i + 1}
{i < STEPS.length - 1 && (
)}
))}
{/* Step 0: Welcome */} {step === 0 && (
🚀

Welcome to
BlackRoad OS

Your AI. Your Hardware. Your Rules.

{[['30,000', 'Agent slots', Bot], ['499', 'CF Workers', Zap], ['20', 'Domains', Globe]].map(([v, l, I]) => (
{String(v)}
{String(l)}
))}
)} {/* Step 1: Name */} {step === 1 && (

What should I call you?

This shows in the workspace greeting.

setName(e.target.value)} onKeyDown={e => e.key === 'Enter' && next()} autoFocus className="w-full bg-white/5 border border-white/20 rounded-xl px-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:border-[#FF1D6C]/60 text-lg" />
)} {/* Step 2: Agent */} {step === 2 && (

Pick your first agent

You can talk to all of them. Who do you want to start with?

{AGENTS.map(a => ( ))}
)} {/* Step 3: Gateway */} {step === 3 && (

Gateway URL

Where your local BlackRoad Gateway is running. Default is fine for most setups.

# Start your gateway
cd blackroad-core && ./start.sh
setGateway(e.target.value)} className="w-full bg-white/5 border border-white/20 rounded-xl px-4 py-3 text-white font-mono focus:outline-none focus:border-[#FF1D6C]/60" />
)} {/* Step 4: Done */} {step === 4 && (

Ready, {name.trim() || 'Alexa'}!

Starting your first conversation with{' '} {selected.name} {selected.icon}

# Your setup
gateway = {gateway}
agent = {agent}
name = {name.trim() || 'Alexa'}
)}
); }