let setupStep = 0; const setupSteps = [ { title: 'Welcome', desc: 'Configure Agentic OS for your environment' }, { title: 'Agent Discovery', desc: 'Detecting installed agents...' }, { title: 'Workspace', desc: 'Set your preferences' }, { title: 'Ready', desc: 'All set!' }, ]; async function renderSetupWizard() { const content = document.getElementById('pageContent'); setupStep = 0; content.innerHTML = `
`; renderSetupStep(); } async function renderSetupStep() { const container = document.getElementById('wizardContainer'); const step = setupSteps[setupStep]; if (!step) { finishSetup(); return; } container.innerHTML = `
Step ${setupStep + 1} of ${setupSteps.length}
${setupSteps.map((s, i) => `
`).join('')}

${step.title}

${step.desc}

`; const body = document.getElementById('wizardBody'); switch (setupStep) { case 0: body.innerHTML = `

Agentic OS coordinates opencode, Hermes Agent, and Gemini CLI into a unified orchestration platform.

This wizard will help you verify the setup and configure preferences.

`; break; case 1: body.innerHTML = '
Detecting agents...
'; try { const status = await api.getStatus(); const agents = status.agents || []; body.innerHTML = `
${agents.map(a => `
${a.name}
${a.status}
`).join('')}
${agents.some(a => a.status === 'offline') ? '

Note: Offline agents won\'t be available for skill execution. Install them to enable full functionality.

' : ''} `; } catch (err) { body.innerHTML = `

Could not connect to backend: ${escapeHtml(err.message)}

`; } break; case 2: body.innerHTML = `
`; break; case 3: body.innerHTML = `

Agentic OS is ready!

All components are configured. Start by exploring the Dashboard or running a skill.

`; break; } } function nextSetupStep() { if (setupStep < setupSteps.length - 1) { setupStep++; renderSetupStep(); } else { finishSetup(); } } function prevSetupStep() { if (setupStep > 0) { setupStep--; renderSetupStep(); } } function finishSetup() { showToast('Setup complete!', 'success'); navigate('dashboard'); }