export type AppPath = | '/home' | '/models' | '/skills' | '/cron' | '/scripts' | '/setting' | '/knowledge' | '/login'; export type WorkspacePath = Exclude; export type NavItem = { path: WorkspacePath; labelKey: | 'sidebar.home' | 'sidebar.knowledge' | 'sidebar.models' | 'sidebar.skills' | 'sidebar.cron' | 'sidebar.scripts' | 'sidebar.settings'; }; export const DEFAULT_PATH: WorkspacePath = '/home'; export const NAV_ITEMS: NavItem[] = [ { path: '/home', labelKey: 'sidebar.home' }, { path: '/knowledge', labelKey: 'sidebar.knowledge' }, { path: '/models', labelKey: 'sidebar.models' }, { path: '/skills', labelKey: 'sidebar.skills' }, { path: '/cron', labelKey: 'sidebar.cron' }, { path: '/scripts', labelKey: 'sidebar.scripts' }, { path: '/setting', labelKey: 'sidebar.settings' }, ]; export function normalizeWorkspacePath(pathname: string): WorkspacePath { switch (pathname) { case '/knowledge': case '/models': case '/agents': case '/skills': case '/cron': case '/scripts': case '/setting': return pathname === '/agents' ? '/models' : pathname; case '/home': default: return DEFAULT_PATH; } }