import type { RouteRecordRaw } from 'vue-router'

const appChildren: RouteRecordRaw[] = [
  {
    path: '',
    redirect: '/chat',
  },
  {
    path: 'chat',
    name: 'chat',
    component: () => import('@/pages/chat/index.vue'),
  },
  {
    path: 'knowledge',
    name: 'knowledge',
    component: () => import('@/pages/knowledge/index.vue'),
  },
  {
    path: 'graph',
    name: 'graph',
    component: () => import('@/pages/graph/index.vue'),
  },
  {
    path: 'schedule-center',
    name: 'schedule-center',
    component: () => import('@/pages/schedule-center/index.vue'),
  },
  {
    path: 'kanban',
    redirect: '/schedule-center',
  },
  {
    path: 'forum',
    name: 'forum',
    component: () => import('@/pages/forum/index.vue'),
  },
  {
    path: 'agents',
    name: 'agents',
    component: () => import('@/pages/agents/index.vue'),
  },
  {
    path: 'skills',
    name: 'skills',
    component: () => import('@/pages/skills/index.vue'),
  },
  {
    path: 'todo',
    redirect: '/schedule-center',
  },
  {
    path: 'settings',
    name: 'settings',
    component: () => import('@/pages/settings/index.vue'),
  },
  {
    path: 'logs',
    name: 'logs',
    component: () => import('@/pages/logs/index.vue'),
  },
  {
    path: 'code-commander',
    name: 'code-commander',
    component: () => import('@/pages/chat/CodeCommander.vue'),
  },
  {
    path: 'temple',
    name: 'temple',
    component: () => import('@/pages/temple/index.vue'),
  },
  {
    path: 'war-room',
    name: 'war-room',
    component: () => import('@/pages/war-room/index.vue'),
  },
]

export const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login/index.vue'),
    meta: { guest: true },
  },
  {
    path: '/',
    component: () => import('@/pages/app/layout.vue'),
    meta: { requiresAuth: true },
    children: appChildren,
  },
]

export { appChildren }
