import React, { useMemo } from 'react'; import { Link } from 'react-router-dom'; import { LayoutTemplate, Sparkles, BookOpen, ArrowRight } from 'lucide-react'; import { usePreferences } from '@/lib/krowHooks'; import { aiAgentSkills, allSkills, skillsWithFacet } from '@/lib/skills/registry'; import { allAgents } from '@/lib/agents/registry'; import { AdminPage } from '@/components/admin/PageShell'; import OwliverAvatar from '@/components/krow/OwliverAvatar'; import { cn } from '@/lib/utils'; /** * Workspace & Skills — AI agent capability governance. * * This page governs what *Owliver* can do. It used to govern workforce training * as well — Training Paths and Skill Progression sat in the right-hand column — * and that conflated two unrelated things under one word. A "skill" here is a * capability the assistant gains; a "skill" in KROW Forge is something a person * learns, proves and is verified in. They have different owners, different * lifecycles and different audiences, and putting them side by side made the page * read as though enabling a Bartending path taught Owliver to tend bar. * * Workforce training was not removed, only returned to where it belongs: the * definitions, the routes and the pages are untouched, and KROW Forge * (`/admin/university`) and Skill Development still read them. See * `workforceTrainingSkills` in the registry for the other half of the split. */ export default function AdminWorkspace() { const preferences = usePreferences(); /* Read through the agent registry, never by counting skills — one registry answers "how many agents", exactly as the skill registry answers its own. */ const agentCount = useMemo( () => allAgents(preferences.customAgents || [], { customSkills: preferences.customSkills || [] }).length, [preferences.customAgents, preferences.customSkills] ); /** * AI agent skills only. * * Deliberately `aiAgentSkills(...)` rather than `allSkills(...)`. The registry * holds both kinds, so the unfiltered read counted five workforce training * paths among Owliver's capabilities — the hero said ten registered skills when * the assistant had five. Naming the kind is also what stops a training path * added later from reappearing here on its own. */ const skills = useMemo( () => aiAgentSkills(allSkills(preferences.customSkills || [])), [preferences.customSkills] ); const disabledSkills = preferences.disabledSkills || []; const activeSkills = skills.filter((s) => !disabledSkills.includes(s.id)).length; /* The two kinds of agent skill — the same two lists the management page is split into, read here from the same filtered registry so the landing page and the manager can never disagree about what is registered. */ const owliverSkills = useMemo(() => skillsWithFacet(skills, 'owliver'), [skills]); const boardSkills = useMemo(() => skillsWithFacet(skills, 'ui'), [skills]); const owliverCount = owliverSkills.length; const boardCount = boardSkills.length; return (
{/* ── 1. Hero Banner (Full Width) ───────────────────────────────── */}
AI Capability Governance

AI Agent Capabilities

Govern what Owliver can understand, analyze and execute. Workforce training paths and talent progression are managed in KROW Forge.

Registered Skills

{skills.length}

{activeSkills} Active
{/* Was "Training Paths". Replaced rather than dropped: the slot is useful, and the split of agent skills across the two lists is what this page actually governs. */}

Skill Kinds

{owliverCount + boardCount}

{owliverCount} Owliver · {boardCount} Board
{/* ── Agents ───────────────────────────────────────────────────── Above the two skill columns because it is the layer over them: an agent decides which of these skills Owliver may use on a page. */}

Owliver Agents

{agentCount} Registered

An agent is how Owliver answers on a page: which skills it may use, what it knows, and how much work an answer is worth. Agents narrow what a page offers — they never widen it.

Manage Agents
{/* ── 2. Full Width 2-Column Grid ───────────────────────────────── */}
{/* ── Left Column: Owliver AI Capabilities ───────────────────── */}

Owliver Skills

{owliverCount} Registered

Owliver skills teach the assistant what it can be asked on a page and how to answer — screening, matching and contextual analysis. They define what the AI understands, not what a candidate learns.

{/* Skills Sample List */}
{owliverSkills.slice(0, 4).map((s) => { const isActive = !disabledSkills.includes(s.id); return (

{s.name || s.id}

{s.description &&

{s.description}

}
{isActive ? 'Active' : 'Disabled'}
); })}
{/* CTA Button */}
Manage Owliver Skills
{/* ── Right Column: Board Skills ───────────────────────────────── The other kind of AI agent skill. This column previously held Workforce Training Paths and Skill Progression Tracking, both of which are KROW Forge concerns — see the note at the top of the file. Board skills belong here because, like Owliver skills, they are capabilities the product gains rather than something a person learns. */}

Board Skills

{boardCount} Registered

Board skills add dynamic sections to KROW pages, read from real page data. They extend what a page shows, not what a candidate learns.

{/* Sample list, from the same filtered registry read as the left column — so the two columns can never disagree about what is registered. */}
{boardSkills.slice(0, 4).map((s) => { const isActive = !disabledSkills.includes(s.id); return (

{s.name || s.id}

{s.description &&

{s.description}

}
{isActive ? 'Active' : 'Disabled'}
); })} {boardSkills.length === 0 && (

No Board skills registered yet. A Board skill declares a section, where it sits and what it reads.

)}
Manage Board Skills
{/* ── 3. Unified Registry Architecture Banner ───────────────────── */}

AI skills and workforce training are different things

This page governs AI agent skills — what Owliver understands and what a Board skill draws on a page. Workforce training — training paths, proving challenges, skill verification and talent progression — is what a person learns, and it is managed in{' '} KROW Forge. Both are Markdown in one registry, read through separate queries so neither appears in the other’s surface.

); }