/** * Navigation data for the Active docs sidebar. * Single source of truth for the left rail and breadcrumbs. * * `label` is the public name a developer sees in the API * (`App.session`, `App.storage`, …). `alias` is the path-alias * used to import the artifact (`$session`, `$storage`, …) and matches * the folder name under `src/arts/`. */ export interface NavItem { readonly label: string; readonly alias?: string; readonly href: string; readonly tag?: 'new' | 'beta' | 'stub'; readonly description?: string; } export interface NavSection { readonly title: string; readonly items: readonly NavItem[]; } export const nav: readonly NavSection[] = [ { title: 'Get Started', items: [ { label: 'Introduction', href: '/active' }, { label: 'Ecosystem', href: '/active/get-started/ecosystem' }, { label: 'AI Agents', href: '/active/get-started/ai-agents' }, { label: 'Installation', href: '/active/get-started/installation' }, { label: 'Composition', href: '/active/get-started/composition' }, { label: 'Versioning', href: '/active/get-started/versioning' }, { label: 'Security', href: '/active/security' } ] }, { title: 'Composition', items: [ { label: 'App', alias: '$active-app', href: '/active/docs/aapp', description: 'App composition: fixed Logger/Bus/Timers/Orca/Prefs core plus typed service schema.' } ] }, { title: 'Server Layer', items: [ { label: 'Server Modules', alias: '$svrs', href: '/active/docs/svrs', description: 'Server-authoritative engines and adapters.' } ] }, { title: 'Identity & Security', items: [ { label: 'Auth', alias: '$auth', href: '/active/docs/auth' }, { label: 'Session', alias: '$session', href: '/active/docs/sess' }, { label: 'Perms', alias: '$perm', href: '/active/docs/perm' } ] }, { title: 'Data', items: [ { label: 'Cache', alias: '$cache', href: '/active/docs/cach' }, { label: 'Storage', alias: '$storage', href: '/active/docs/stor' }, { label: 'Http', alias: '$http', href: '/active/docs/http' } ] }, { title: 'Preferences & Environment', items: [{ label: 'Prefs', alias: '$prefs', href: '/active/docs/prefs' }] }, { title: 'I18n & Format', items: [ { label: 'Lang', alias: '$langs', href: '/active/docs/lang' }, { label: 'Format', alias: '$format', href: '/active/docs/fmts' } ] }, { title: 'UI Layer', items: [ { label: 'Dom', alias: '$adom', href: '/active/docs/adom' } ] }, { title: 'Validation', items: [{ label: 'Sium', alias: '$sium', href: '/active/docs/sium' }] }, { title: 'Infrastructure', items: [ { label: 'Bus', alias: '$bus', href: '/active/docs/buss' }, { label: 'Logger', alias: '$logger', href: '/active/docs/logr' }, { label: 'Timers', alias: '$timer', href: '/active/docs/timr' }, { label: 'Orca', alias: '$orca', href: '/active/docs/orca' }, { label: 'Connections', alias: '$connection', href: '/active/docs/conn' } ] } ]; /** * Flat list of every item across sections, in order — useful for * Prev / Next page links inside articles. */ export const flatNav: readonly NavItem[] = nav.flatMap((section) => section.items); export function findNavIndex(pathname: string): number { return flatNav.findIndex((item) => item.href === pathname); } export function findNavItem(pathname: string): NavItem | undefined { return flatNav.find((item) => item.href === pathname); } export function findNavSection(pathname: string): NavSection | undefined { return nav.find((section) => section.items.some((item) => item.href === pathname)); }