import { createRouter, createWebHistory } from 'vue-router' const routes = [ { path: '/', redirect: '/agent/master' }, { path: '/agents/:agentId?', redirect: to => `/agent/${to.params.agentId || 'agent-creator'}`, }, { path: '/agent/:agentId/:convId?', name: 'AgentChat', component: () => import('@/views/AgentChat.vue'), props: true, }, { // agentId 必填:`/:id/agents`(无 agentId)要落到下面的 CompanyDetail 去渲染团队 tab。 // 之前写成 :agentId? 时,这条路由会抢占 /:id/agents,导致导航栏「Team」永远打开 // AgentChat,CompanyDashboard 的团队 tab(含 Org Graph 区块)完全不可达。 path: '/:id/agents/:agentId/:convId?', name: 'CompanyAgentChat', component: () => import('@/views/AgentChat.vue'), props: true, }, { path: '/company', name: 'CompanyList', component: () => import('@/views/CompanyDashboard.vue'), }, { path: '/:id/:tab(overview|agents|pipelines|goals|sop|okr|team|files|messages|skills|jobs|workspace)', name: 'CompanyDetail', component: () => import('@/views/CompanyDashboard.vue'), props: true }, { // P3 · 图执行控制台(org graph + work graph + 节点详情)。 // 路径段 'graph-console' 不在上面 CompanyDetail 的 :tab 白名单里,两条路由不冲突。 path: '/:id/graph-console', name: 'GraphConsole', component: () => import('@/views/GraphConsole.vue'), props: true, }, { path: '/okr', name: 'OkrDashboard', component: () => import('@/views/OkrDashboard.vue'), }, // 新增独立页面 { path: '/skills', name: 'SkillsMarket', component: () => import('@/views/SkillsMarket.vue'), }, { path: '/jobs', name: 'JobsPanel', component: () => import('@/views/JobsPanel.vue'), }, { path: '/tasks/:taskId?', name: 'TaskTimeline', component: () => import('@/views/TaskTimeline.vue'), }, { path: '/pipelines', name: 'PipelineEditor', component: () => import('@/views/PipelineEditor.vue'), }, { path: '/quota', name: 'QuotaMonitor', component: () => import('@/views/QuotaMonitor.vue'), }, { path: '/dream', name: 'DreamConsole', component: () => import('@/views/DreamConsole.vue'), }, // P5 · DevLoop Projects 列表 + Dashboard + Ops { path: '/devloop', name: 'DevLoopProjects', component: () => import('@/views/DevLoopProjects.vue'), }, { path: '/devloop/:pid', name: 'DevLoopDashboard', component: () => import('@/views/DevLoopDashboard.vue'), props: true, }, { path: '/devloop/:pid/ops/:tab(bugs|loops|changelog|progress)', name: 'DevLoopOps', component: () => import('@/views/DevLoopOps.vue'), props: true, }, { path: '/devloop/:pid/new-requirement', name: 'DevLoopNewRequirement', component: () => import('@/views/DevLoopNewRequirement.vue'), }, ] const router = createRouter({ history: createWebHistory(), routes, }) export default router