diff --git a/Taskfile.yml b/Taskfile.yml index 2ce92adef..186bc99c8 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -64,6 +64,18 @@ tasks: - task: db:generate - git diff --exit-code -- internal/infrastructure/postgres/postgresdb + pages:generate: + desc: Write the dashboard's page catalogue to ui/pages/pages.json + dir: ui + cmds: + - node --experimental-strip-types scripts/pages.ts + + pages:check: + desc: Regenerate the page catalogue and reject uncommitted differences + cmds: + - task: pages:generate + - git diff --exit-code -- ui/pages/pages.json + openapi:generate: desc: Write the API's OpenAPI document to api/openapi.yaml cmds: @@ -344,6 +356,7 @@ tasks: # delete Go sources mid-walk. Install first, then fan out. Every Go step # embeds ui/dist, so the dashboard is built before any of them. - task: ui + - task: pages:check - task: fmt - task: proto:check - task: db:check diff --git a/internal/gateway/dashboard_tools.go b/internal/gateway/dashboard_tools.go index c50d34826..af8cca051 100644 --- a/internal/gateway/dashboard_tools.go +++ b/internal/gateway/dashboard_tools.go @@ -8,63 +8,34 @@ import ( "github.com/samcharles93/archie-core/internal/prompts" "github.com/samcharles93/archie-core/internal/tools" + "github.com/samcharles93/archie-core/ui/pages" ) // DashboardPage describes one dashboard surface so the chat agent can both -// understand what each place is for and point the operator there. +// understand what each place is for and point the operator there. It is the +// catalogue the dashboard's own navigation renders from (ui/pages), so a page +// the assistant can name is a page the operator can reach. type DashboardPage struct { // Path is the route (e.g. "/tasks"). It is what the browser hash becomes. Path string - // Label is the human name shown in navigation (e.g. "Tasks"). + // Label is the human name the navigation shows (e.g. "Tasks"). Label string // Description is a one-line plain-language explanation of what the page // shows, so the agent can answer "where do I go for that?" correctly. Description string } -// dashboardPages lists the dashboard pages the prompt and the -// dashboard_navigate tool can name. -var dashboardPages = []DashboardPage{ - {Path: "/", Label: "Dashboard", Description: "Running work, work needing attention, token spend."}, - {Path: "/tasks", Label: "Tasks", Description: "Picked-up issues and their status."}, - {Path: "/account", Label: "Your account", Description: "Password, recovery code, passkeys and personal API tokens."}, - {Path: "/org", Label: "Organisation", Description: "Members, identities, connections, models and automation."}, - {Path: "/org/members", Label: "Members", Description: "People in the organisation and their roles."}, - {Path: "/org/agents", Label: "Agents", Description: "Execution identities, their permissions and commit author."}, - {Path: "/org/workspaces", Label: "Workspaces", Description: "Groups of organisation work and resources."}, - {Path: "/org/policies", Label: "Policies", Description: "Access rules for the organisation."}, - {Path: "/org/connections", Label: "Connections", Description: "Forge hosts, credentials and permitted operations."}, - {Path: "/org/credential-bindings", Label: "Credential bindings", Description: "Service credentials granted to agent identities."}, - {Path: "/org/models", Label: "Models", Description: "Organisation providers and model aliases."}, - {Path: "/org/instructions", Label: "Instructions", Description: "Archie's identity, tone and standing instructions for the organisation."}, - {Path: "/org/playbooks", Label: "Playbooks", Description: "Edit event-driven automation rules."}, - {Path: "/settings/authentication", Label: "Authentication", Description: "Instance URL and OIDC sign-in."}, - {Path: "/workflows", Label: "Workflows", Description: "Workflows and run history."}, - {Path: "/settings/skills", Label: "Skills", Description: "Skills Archie can activate."}, - {Path: "/settings/curators", Label: "Curators", Description: "Scheduled memory and capture curation."}, - {Path: "/events", Label: "Events", Description: "Captured events, field mappings, workflow bindings."}, - {Path: "/logs", Label: "Logs", Description: "Daemon log by level and component."}, - {Path: "/org/channels", Label: "Channels", Description: "Chat and notification channels."}, - {Path: "/settings/status", Label: "Status", Description: "Update state, config sources, listen address."}, - {Path: "/account/appearance", Label: "Appearance", Description: "Theme, density, motion."}, - {Path: "/settings/task-execution", Label: "Task execution", Description: "Statuses, operator actions, budgets."}, - {Path: "/settings/models", Label: "Models", Description: "Instance model aliases and providers."}, - {Path: "/org/repositories", Label: "Repositories", Description: "Watched repositories and gate overrides."}, - {Path: "/org/scheduling-policy", Label: "Scheduling policy", Description: "Work discovery and forge labels."}, - {Path: "/settings/tools", Label: "Tools & MCP", Description: "Agent tools and MCP servers."}, - {Path: "/org/audit", Label: "Audit", Description: "Settings, access, identity and runtime events."}, - {Path: "/org/denials", Label: "Denials", Description: "Access requests the policy chain refused, newest first."}, - {Path: "/settings/plugins", Label: "Plugins", Description: "Extension directories loaded at startup."}, - {Path: "/settings/secret-engines", Label: "Secret engines"}, - {Path: "/settings/container-runtime", Label: "Container runtime"}, - {Path: "/settings/agent-profiles", Label: "Agent profiles", Description: "Execution profiles: the image and tools each agent runs with."}, -} - -// DashboardPages returns a copy of the dashboard page registry. -func DashboardPages() []DashboardPage { - out := make([]DashboardPage, len(dashboardPages)) - copy(out, dashboardPages) - return out +// DashboardPages returns the dashboard's page catalogue, in its own order. +func DashboardPages() ([]DashboardPage, error) { + catalogue, err := pages.All() + if err != nil { + return nil, err + } + out := make([]DashboardPage, 0, len(catalogue)) + for _, p := range catalogue { + out = append(out, DashboardPage{Path: p.Path, Label: p.Label, Description: p.Description}) + } + return out, nil } // PageIndexResult is what page_index returns: the full list of dashboard pages @@ -84,7 +55,11 @@ func pageIndexTool() (tools.ToolEntry, bool) { Description: "List every dashboard page, what it shows, and built-in guidance for creating workflows and using Archie. Use it to tell the operator where to go for something rather than guessing.", Classification: tools.ClassIdempotent, Handler: func(_ context.Context, _ map[string]any) (any, error) { - return PageIndexResult{Pages: DashboardPages(), ProductGuide: prompts.ProductGuide()}, nil + indexed, err := DashboardPages() + if err != nil { + return nil, err + } + return PageIndexResult{Pages: indexed, ProductGuide: prompts.ProductGuide()}, nil }, } return entry, true @@ -114,7 +89,11 @@ func dashboardNavigateTool() (tools.ToolEntry, bool) { if path == "" { return nil, errors.New("dashboard_navigate: path is required") } - for _, p := range dashboardPages { + indexed, err := DashboardPages() + if err != nil { + return nil, err + } + for _, p := range indexed { if p.Path == path { return DashboardNavigateResult{Path: p.Path, Label: p.Label}, nil } diff --git a/ui/pages/pages.go b/ui/pages/pages.go new file mode 100644 index 000000000..cefdc6c0e --- /dev/null +++ b/ui/pages/pages.go @@ -0,0 +1,37 @@ +// Package pages is the dashboard's page catalogue: every route the operator can +// reach, with the label its navigation shows and the one-line description the +// assistant reads when it points someone at a page. +// +// pages.json is generated from the dashboard's own route table by +// `task pages:generate`, and `task check` rejects it when stale, so the +// catalogue cannot list a page the dashboard lost or miss one it gained. +package pages + +import ( + _ "embed" + "encoding/json" + "fmt" +) + +//go:embed pages.json +var file []byte + +// Page is one destination in the dashboard. +type Page struct { + // Path is the route, and what the browser's history entry becomes. + Path string `json:"path"` + // Label is the name the navigation shows. + Label string `json:"label"` + // Description says what the page is for, so the assistant can answer + // "where do I go for that?" without guessing. + Description string `json:"description"` +} + +// All returns the catalogue in the dashboard's own order. +func All() ([]Page, error) { + var out []Page + if err := json.Unmarshal(file, &out); err != nil { + return nil, fmt.Errorf("dashboard pages: %w", err) + } + return out, nil +} diff --git a/ui/pages/pages.json b/ui/pages/pages.json new file mode 100644 index 000000000..225ac674d --- /dev/null +++ b/ui/pages/pages.json @@ -0,0 +1,232 @@ +[ + { + "path": "/account", + "label": "Your account", + "description": "Password, recovery code, passkeys and personal API tokens." + }, + { + "path": "/", + "label": "Dashboard", + "description": "Running work, work needing attention, token spend." + }, + { + "path": "/tasks", + "label": "Tasks", + "description": "Picked-up issues and their status." + }, + { + "path": "/runs", + "label": "Runs", + "description": "Workflow runs, their decision trails and waiting approvals." + }, + { + "path": "/controls", + "label": "Controls", + "description": "Hard rules, change-request rules, guards and action classes." + }, + { + "path": "/workflows", + "label": "Workflows", + "description": "Workflows and run history." + }, + { + "path": "/settings/skills", + "label": "Skills", + "description": "Skills Archie can activate." + }, + { + "path": "/settings/curators", + "label": "Curators", + "description": "Scheduled memory and capture curation." + }, + { + "path": "/events", + "label": "Events", + "description": "Received events, their sources, and the triggers that start workflows." + }, + { + "path": "/settings/status", + "label": "Status", + "description": "Service presence, dependency health, and build versions." + }, + { + "path": "/logs", + "label": "Logs", + "description": "Daemon log by level and component." + }, + { + "path": "/account/appearance", + "label": "Appearance", + "description": "Theme, density and motion." + }, + { + "path": "/settings/task-execution", + "label": "Task execution", + "description": "Statuses, operator actions, budgets." + }, + { + "path": "/settings/models", + "label": "Models", + "description": "The models agent loops use, by alias." + }, + { + "path": "/settings/organisations", + "label": "Organisations", + "description": "The organisations on this instance, and which one is active." + }, + { + "path": "/settings/authentication", + "label": "Authentication", + "description": "Instance URL and single sign-on providers." + }, + { + "path": "/org", + "label": "Organisation", + "description": "Members, identities, connections, models and automation." + }, + { + "path": "/org/members", + "label": "Members", + "description": "People in the organisation and their roles." + }, + { + "path": "/org/agents", + "label": "Agents", + "description": "Execution identities, their permissions and commit author." + }, + { + "path": "/org/audit", + "label": "Audit", + "description": "Settings, access, identity and runtime events." + }, + { + "path": "/org/denials", + "label": "Denials", + "description": "Access requests the policy chain refused, newest first." + }, + { + "path": "/org/workspaces", + "label": "Workspaces", + "description": "Groups of organisation work and resources." + }, + { + "path": "/org/policies", + "label": "Policies", + "description": "Access rules for the organisation." + }, + { + "path": "/org/repositories", + "label": "Repositories", + "description": "Repository connections, access checks and execution policies." + }, + { + "path": "/org/connections", + "label": "Connections", + "description": "Forge hosts, credentials and permitted operations." + }, + { + "path": "/org/credential-bindings", + "label": "Credential bindings", + "description": "Service credentials granted to agent identities." + }, + { + "path": "/org/models", + "label": "Models", + "description": "Organisation providers and model aliases." + }, + { + "path": "/org/instructions", + "label": "Instructions", + "description": "Archie's identity, tone and standing instructions for the organisation." + }, + { + "path": "/org/schedules", + "label": "Schedules", + "description": "Recurring runs and the times they fire." + }, + { + "path": "/org/channels", + "label": "Channels", + "description": "Chat channels." + }, + { + "path": "/org/scheduling-policy", + "label": "Scheduling policy", + "description": "Work discovery and forge labels." + }, + { + "path": "/org/issue-routing", + "label": "Issue routing", + "description": "Which workflow an issue runs by its labels." + }, + { + "path": "/org/alerts", + "label": "Alert webhook", + "description": "Where this organisation's alerts are sent." + }, + { + "path": "/org/playbooks", + "label": "Playbooks", + "description": "Edit event-driven automation rules." + }, + { + "path": "/org/usage", + "label": "Usage", + "description": "Token spend by model, identity and period." + }, + { + "path": "/settings/tools", + "label": "Tools & MCP", + "description": "Agent tools and MCP servers." + }, + { + "path": "/settings/channels", + "label": "Channels", + "description": "Chat channel connections and session defaults." + }, + { + "path": "/settings/extensions", + "label": "Extensions", + "description": "Connectors, guards and MCP servers." + }, + { + "path": "/settings/extension-catalogue", + "label": "Extension catalogue", + "description": "Installed extensions, grants and the marketplace." + }, + { + "path": "/settings/model-aliases", + "label": "Model aliases", + "description": "Model aliases and providers." + }, + { + "path": "/settings/plugins", + "label": "Plugins", + "description": "Extension directories loaded at startup." + }, + { + "path": "/settings/secret-engines", + "label": "Secret engines", + "description": "Where secrets are read from: engines, their keys and health." + }, + { + "path": "/settings/credentials", + "label": "Credentials", + "description": "Sealed credentials extensions and models use." + }, + { + "path": "/settings/container-runtime", + "label": "Container runtime", + "description": "How task containers run: runtime, image, limits and egress hosts." + }, + { + "path": "/settings/agent-profiles", + "label": "Agent profiles", + "description": "Execution profiles: the image and tools each agent runs with." + }, + { + "path": "/settings", + "label": "Instance", + "description": "Every instance-wide setting: models, prompts, connections, runtime and status." + } +] diff --git a/ui/scripts/pages.ts b/ui/scripts/pages.ts new file mode 100644 index 000000000..a5756db0d --- /dev/null +++ b/ui/scripts/pages.ts @@ -0,0 +1,63 @@ +// Writes pages/pages.json from the router's own route table. +// +// The dashboard's pages are the routes it serves, so deriving the catalogue +// from them is what stops the assistant naming a page the dashboard lost or +// missing one it gained. `task pages:check` fails when the committed file is +// stale, which is what makes a new route carry a catalogue entry. +import { writeFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +import { routes } from "../src/router/routes.ts"; + +type Meta = { label?: string; description?: string; nav?: boolean }; +type Record_ = { + path: string; + meta?: Meta; + children?: Record_[]; +}; + +export type Page = { path: string; label: string; description: string }; + +const join_ = (parent: string, path: string): string => { + if (path.startsWith("/")) return path; + if (path === "") return parent; + return `${parent.replace(/\/$/, "")}/${path}`; +}; + +// dynamic is true for a route the operator reaches with an id in it; the +// assistant cannot name one, so it stays out of the catalogue. +const dynamic = (path: string): boolean => path.includes(":"); + +const collect = (records: Record_[], parent = "", out: Page[] = []): Page[] => { + for (const route of records) { + const path = join_(parent, route.path); + if (route.meta?.label && route.meta.nav !== false && path && !dynamic(path)) { + out.push({ + path, + label: route.meta.label, + description: route.meta.description ?? "", + }); + } + if (route.children) collect(route.children, path, out); + } + return out; +}; + +// The org shell and its index child both answer at /org, so the first label +// for a path wins rather than the catalogue carrying the page twice. +const unique = (pages: Page[]): Page[] => { + const seen = new Set(); + return pages.filter((page) => { + if (seen.has(page.path)) return false; + seen.add(page.path); + return true; + }); +}; + +const pages = unique(collect(routes as Record_[])); +const here = dirname(fileURLToPath(import.meta.url)); +const target = join(here, "..", "pages", "pages.json"); +writeFileSync(target, `${JSON.stringify(pages, null, 2)}\n`); + +console.log(`pages: ${pages.length} written to ${target}`); diff --git a/ui/src/router/index.ts b/ui/src/router/index.ts index bbd3ea5a9..ddd1b0c3e 100644 --- a/ui/src/router/index.ts +++ b/ui/src/router/index.ts @@ -1,513 +1,8 @@ import { createRouter, createWebHistory, type RouteLocationGeneric } from "vue-router"; -const ChannelsPage = () => import("@/channels/ChannelsPage.vue"); -const CuratorsPage = () => import("@/curators/CuratorsPage.vue"); -import DashboardPage from "@/dashboard/DashboardPage.vue"; -const EventsPage = () => import("@/events/EventsPage.vue"); -const LogsPage = () => import("@/logs/LogsPage.vue"); -const AuditPage = () => import("@/audit/AuditPage.vue"); -const DenialsPage = () => import("@/audit/DenialsPage.vue"); -const OrgShell = () => import("@/org/OrgShell.vue"); -const OrgOverviewPage = () => import("@/org/OrgOverviewPage.vue"); -const OrgMembersPage = () => import("@/org/OrgMembersPage.vue"); -const OrgAgentsPage = () => import("@/org/OrgAgentsPage.vue"); -const OrgWorkspacesPage = () => import("@/org/OrgWorkspacesPage.vue"); -const OrgAccessPage = () => import("@/org/OrgAccessPage.vue"); -const OrgModelsPage = () => import("@/org/OrgModelsPage.vue"); -const OrgUsagePage = () => import("@/org/OrgUsagePage.vue"); -const SchedulingPolicyPage = () => import("@/settings/SchedulingPolicyPage.vue"); -const ToolsPage = () => import("@/settings/ToolsPage.vue"); -const InstructionsPage = () => import("@/settings/InstructionsPage.vue"); -const ExtensionsPage = () => import("@/settings/ExtensionsPage.vue"); -const PluginsPage = () => import("@/settings/PluginsPage.vue"); -const SecretEnginesPage = () => import("@/settings/SecretEnginesPage.vue"); -const ContainerRuntimePage = () => import("@/settings/ContainerRuntimePage.vue"); -const ConnectionsPage = () => import("@/settings/ConnectionsPage.vue"); -const SystemAppearancePage = () => import("@/settings/SystemAppearancePage.vue"); -const SystemReposPage = () => import("@/settings/SystemReposPage.vue"); -const SystemStatusPage = () => import("@/settings/SystemStatusPage.vue"); -const SystemTasksPage = () => import("@/settings/SystemTasksPage.vue"); -const SkillsPage = () => import("@/skills/SkillsPage.vue"); -const TaskDetailPage = () => import("@/tasks/TaskDetailPage.vue"); -const TasksPage = () => import("@/tasks/TasksPage.vue"); -const WorkflowsPage = () => import("@/workflows/WorkflowsPage.vue"); -const WorkflowPage = () => import("@/workflows/WorkflowPage.vue"); - -// internal/gateway/dashboard_tools.go mirrors this table. -// -// meta: -// label the navigation label, short because its group carries the context -// description one line mirrored in the messaging page registry -// section the capability from GET /api/capabilities this route needs; a -// route with no section is served in every composition -// navPath the navigation entry this route keeps current -const routes = [ - {path:"/account",name:"account",component:()=>import("@/accounts/AccountPage.vue"),meta:{label:"Your account"}}, - {path:"/access/authentication",redirect:"/settings/authentication",meta:{nav:false}}, - { - path: "/", - name: "dashboard", - component: DashboardPage, - meta: { - label: "Dashboard", - description: - "Running work, work needing attention, token spend.", - section: "home", - }, - }, - { - path: "/tasks", - name: "tasks", - component: TasksPage, - meta: { - label: "Tasks", - description: "Picked-up issues and their status.", - section: "tasks", - }, - }, - { - path: "/tasks/:id", - name: "task-detail", - component: TaskDetailPage, - meta: { label: "Task run", nav: false, navPath: "/tasks", section: "tasks" }, - }, - { - path: "/runs", - name: "runs", - component: () => import("@/runs/RunsPage.vue"), - meta: { label: "Runs", description: "Workflow runs, their decision trails and waiting approvals.", section: "runs" }, - }, - { - path: "/runs/:id", - name: "run", - component: () => import("@/runs/RunPage.vue"), - meta: { label: "Run", nav: false, navPath: "/runs", section: "runs" }, - }, - { - path: "/controls", - name: "controls", - component: () => import("@/controls/ControlsPage.vue"), - meta: { label: "Controls", description: "Hard rules, change-request rules, guards and action classes.", section: "controls" }, - }, - { - path: "/workflows", - name: "workflows", - component: () => import("@/workflows/WorkflowListPage.vue"), - // Links written as /workflows?workflow= open that workflow's page. - beforeEnter: (to: RouteLocationGeneric) => { - const { workflow, ...query } = to.query; - if (typeof workflow === "string" && workflow) return { name: "workflow", params: { id: workflow }, query, replace: true }; - return true; - }, - meta: { - label: "Workflows", - description: "Workflows and run history.", - section: "workflows", - }, - }, - { - path: "/workflows/:id", - name: "workflow", - component: () => import("@/workflows/WorkflowDocumentPage.vue"), - meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflows" }, - }, - // The visual editor, with drafts, test runs and per-step statistics; it - // needs workflow drafts and run stages the binary does not serve yet. - { - path: "/workflow-editor", - name: "workflow-editor-list", - component: WorkflowsPage, - meta: { label: "Workflow editor", nav: false, navPath: "/workflows", section: "workflow_editor" }, - }, - { - path: "/workflow-editor/:id", - name: "workflow-editor", - component: WorkflowPage, - meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflow_editor" }, - }, - { - path: "/settings/skills", - name: "skills", - component: SkillsPage, - meta: { - navPath: "/settings", - settings: true, - label: "Skills", - description: "Skills Archie can activate.", - section: "skills", - }, - }, - { - path: "/settings/curators", - name: "curators", - component: CuratorsPage, - meta: { - navPath: "/settings", - settings: true, - label: "Curators", - description: "Scheduled memory and capture curation.", - section: "curators", - }, - }, - { - path: "/events", - name: "events", - component: EventsPage, - meta: { - label: "Events", - description: "Received events, their sources, and the triggers that start workflows.", - section: "events", - }, - }, - { - path: "/settings/status", - name: "system-status", - component: SystemStatusPage, - meta: { - navPath: "/settings", - settings: true, - label: "Status", - description: - "Service presence, dependency health, and build versions.", - section: "system_status", - }, - }, - { - path: "/logs", - name: "logs", - component: LogsPage, - meta: { - label: "Logs", - description: "Daemon log by level and component.", - section: "logs", - }, - }, - { - path: "/account/appearance", - name: "system-appearance", - component: SystemAppearancePage, - meta: { label: "Appearance" }, - }, - { - path: "/settings/task-execution", - name: "system-tasks", - component: SystemTasksPage, - meta: { - navPath: "/settings", - settings: true, - label: "Task execution", - description: "Statuses, operator actions, budgets.", - section: "task_execution", - }, - }, - { - path: "/settings/models", - name: "system-models", - component: () => import("@/settings/AgentModelsPage.vue"), - meta: { - navPath: "/settings", - settings: true, - label: "Models", - description: "The models agent loops use, by alias.", - section: "models", - }, - }, - { - path: "/settings/organisations", - name: "settings-organisations", - component: () => import("@/settings/OrganisationsPage.vue"), - meta: { navPath: "/settings", settings: true, label: "Organisations", section: "organisations" }, - }, - { - path: "/settings/authentication", - name: "authentication", - component: () => import("@/accounts/AuthenticationPage.vue"), - meta: { - navPath: "/settings", - settings: true, - label: "Authentication", - description: "Instance URL and single sign-on providers.", - section: "settings", - }, - }, - - { - path: "/org", - component: OrgShell, - meta: { - label: "Organisation", - description: "Members, identities, connections, models and automation.", - navPath: "/org", - section: "org", - org: true, - }, - children: [ - { - path: "", - name: "org-overview", - component: OrgOverviewPage, - meta: { label: "Overview", navPath: "/org" }, - }, - { - path: "members", - name: "org-members", - component: OrgMembersPage, - meta: { section: "org_members", label: "Members", navPath: "/org" }, - }, - { - path: "agents", - name: "org-agents", - component: OrgAgentsPage, - meta: { section: "org_agents", label: "Agents", navPath: "/org" }, - }, - { - path: "audit", - name: "audit", - component: AuditPage, - meta: { - section: "org_audit", - label: "Audit", - navPath: "/org", - description: "Settings, access, identity and runtime events.", - }, - }, - { - path: "denials", - name: "org-denials", - component: DenialsPage, - meta: { - section: "org_denials", - label: "Denials", - navPath: "/org", - description: "Access requests the policy chain refused, newest first.", - }, - }, - { - path: "workspaces", - name: "org-workspaces", - component: OrgWorkspacesPage, - meta: { section: "org_workspaces", label: "Workspaces", navPath: "/org" }, - }, - { - path: "policies", - name: "org-policies", - component: OrgAccessPage, - meta: { section: "org_policies", label: "Policies", navPath: "/org" }, - }, - { - path: "repositories", - name: "org-repositories", - component: SystemReposPage, - meta: { section: "org_config", label: "Repositories", navPath: "/org", description: "Repository connections, access checks and execution policies." }, - }, - { - path: "connections", - name: "org-connections", - component: ConnectionsPage, - meta: { section: "org_config", label: "Connections", navPath: "/org" }, - }, - { - path: "credential-bindings", - name: "org-credential-bindings", - component: () => import("@/settings/CredentialBindingsPage.vue"), - meta: { section: "org_config", label: "Credential bindings", navPath: "/org" }, - }, - { - path: "models", - name: "org-models", - component: OrgModelsPage, - meta: { section: "org_config", label: "Models", navPath: "/org" }, - }, - { - path: "instructions", - name: "org-instructions", - component: InstructionsPage, - meta: { section: "org_config", label: "Instructions", navPath: "/org" }, - }, - { - path: "schedules", - name: "org-schedules", - component: () => import("@/schedules/SchedulesPage.vue"), - meta: { section: "org_config", label: "Schedules", navPath: "/org" }, - }, - { - path: "schedules/:id/runs", - name: "org-schedule-runs", - component: () => import("@/schedules/ScheduleRunsPage.vue"), - meta: { label: "Schedule runs", navPath: "/org/schedules", nav: false }, - }, - { - path: "channels", - name: "org-channels", - component: ChannelsPage, - meta: { label: "Channels", navPath: "/org", description: "Chat channels.", section: "channels" }, - }, - { - path: "scheduling-policy", - name: "org-scheduling-policy", - component: SchedulingPolicyPage, - meta: { section: "org_config", label: "Scheduling policy", navPath: "/org", description: "Work discovery and forge labels." }, - }, - { - path: "issue-routing", - name: "org-issue-routing", - component: () => import("@/settings/IssueRoutingPage.vue"), - meta: { section: "org_config", label: "Issue routing", navPath: "/org", description: "Which workflow an issue runs by its labels." }, - }, - { - path: "alerts", - name: "org-alerts", - component: () => import("@/settings/OrgAlertsPage.vue"), - meta: { section: "org_config", label: "Alert webhook", navPath: "/org", description: "Where this organisation's alerts are sent." }, - }, - { - path: "playbooks", - name: "org-playbooks", - component: () => import("@/settings/PlaybooksPage.vue"), - meta: { section: "org_config", label: "Playbooks", navPath: "/org" }, - }, - { - path: "usage", - name: "org-usage", - component: OrgUsagePage, - meta: { section: "org_usage", label: "Usage", navPath: "/org" }, - }, - ], - }, - // The old unified Access area and the org-owned settings that used to sit - // under Settings resolve to the Organisation destination (or Account for - // personal tokens, which were never the org's). - ...Object.entries({ - "/access": "/org", - "/access/agents": "/org/agents", - "/access/workspaces": "/org/workspaces", - "/access/policies": "/org/policies", - "/access/models": "/org/models", - "/access/tokens": "/account", - "/settings/identities": "/org/agents", - "/settings/access-policies": "/org/policies", - "/settings/connections": "/org/connections", - "/settings/repositories":"/org/repositories", - "/settings/credential-bindings": "/org/credential-bindings", - "/settings/soul": "/org/instructions", - "/org/soul": "/org/instructions", - "/settings/schedules": "/org/schedules", - "/settings/playbooks": "/org/playbooks", - "/settings/scheduling-policy": "/org/scheduling-policy", - "/settings/appearance": "/account/appearance", - }).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })), - { - path: "/settings/tools", - name: "settings-tools", - component: ToolsPage, - meta: { - navPath: "/settings", - settings: true, - label: "Tools & MCP", - description: "Agent tools and MCP servers.", - section: "tools", - }, - }, - { - path: "/settings/channels", - name: "settings-channels", - component: () => import("@/settings/ChannelSettingsPage.vue"), - meta: { navPath: "/settings", settings: true, label: "Channels", description: "Chat channel connections and session defaults.", section: "channels" }, - }, - { - path: "/settings/extensions", - name: "settings-extensions", - component: () => import("@/settings/AcceptedExtensionsPage.vue"), - meta: { - navPath: "/settings", - settings: true, - label: "Extensions", - description: "Connectors, guards and MCP servers.", - section: "extensions", - }, - }, - { - path: "/settings/extension-catalogue", - name: "settings-extension-catalogue", - component: ExtensionsPage, - meta: { navPath: "/settings", settings: true, label: "Extension catalogue", description: "Installed extensions, grants and the marketplace.", section: "extension_catalogue" }, - }, - { - path: "/settings/model-aliases", - name: "settings-model-aliases", - component: () => import("@/settings/SystemModelsPage.vue"), - meta: { navPath: "/settings", settings: true, label: "Model aliases", description: "Model aliases and providers.", section: "model_aliases" }, - }, - { - path: "/settings/plugins", - name: "settings-plugins", - component: PluginsPage, - meta: { - navPath: "/settings", - settings: true, - label: "Plugins", - description: "Extension directories loaded at startup.", - section: "plugins", - }, - }, - { - path: "/settings/secret-engines", - name: "settings-secret-engines", - component: SecretEnginesPage, - meta: { navPath: "/settings", settings: true, label: "Secret engines", section: "secret_engines" }, - }, - { - path: "/settings/credentials", - name: "settings-credentials", - component: () => import("@/settings/CredentialsPage.vue"), - meta: { navPath: "/settings", settings: true, label: "Credentials", description: "Sealed credentials extensions and models use.", section: "credentials" }, - }, - { - path: "/settings/container-runtime", - name: "settings-container-runtime", - component: ContainerRuntimePage, - meta: { - navPath: "/settings", - settings: true, - label: "Container runtime", - section: "container_runtime", - }, - }, - { - path: "/settings/agent-profiles", - name: "settings-agent-profiles", - component: () => import("@/settings/AgentProfilesPage.vue"), - meta: { navPath: "/settings", settings: true, label: "Agent profiles", section: "agent_profiles" }, - }, - { path: "/settings/history", redirect: (to: RouteLocationGeneric) => ({ path: "/org/audit", query: to.query, hash: to.hash }), meta: { nav: false } }, - { path: "/settings/audit", redirect: (to: RouteLocationGeneric) => ({ path: "/org/audit", query: to.query, hash: to.hash }), meta: { nav: false } }, - { - path: "/settings", - redirect: "/settings/models", - meta: { - label: "Instance", - }, - }, - { - path: "/:pathMatch(.*)*", - name: "not-found", - component: () => import("@/base/NotFoundPage.vue"), - meta: { nav: false }, - }, - // Paths from before Settings existed, kept for bookmarks and chat history. - ...Object.entries({ - "/system/status": "/settings/status", - "/system/appearance": "/account/appearance", - "/system/tasks": "/settings/task-execution", - "/system/models": "/settings/models", - "/system/repos": "/settings/repositories", - "/system/identities": "/org/agents", - "/channels": "/org/channels", - "/skills": "/settings/skills", - "/curators": "/settings/curators", - }).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })), -]; +import { routes } from "./routes"; +export type { RouteLocationGeneric }; export { routes }; export const router = createRouter({ diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts new file mode 100644 index 000000000..2fc8699eb --- /dev/null +++ b/ui/src/router/routes.ts @@ -0,0 +1,514 @@ +import type { RouteLocationGeneric, RouteRecordRaw } from "vue-router"; + +const ChannelsPage = () => import("@/channels/ChannelsPage.vue"); +const CuratorsPage = () => import("@/curators/CuratorsPage.vue"); +const DashboardPage = () => import("@/dashboard/DashboardPage.vue"); +const EventsPage = () => import("@/events/EventsPage.vue"); +const LogsPage = () => import("@/logs/LogsPage.vue"); +const AuditPage = () => import("@/audit/AuditPage.vue"); +const DenialsPage = () => import("@/audit/DenialsPage.vue"); +const OrgShell = () => import("@/org/OrgShell.vue"); +const OrgOverviewPage = () => import("@/org/OrgOverviewPage.vue"); +const OrgMembersPage = () => import("@/org/OrgMembersPage.vue"); +const OrgAgentsPage = () => import("@/org/OrgAgentsPage.vue"); +const OrgWorkspacesPage = () => import("@/org/OrgWorkspacesPage.vue"); +const OrgAccessPage = () => import("@/org/OrgAccessPage.vue"); +const OrgModelsPage = () => import("@/org/OrgModelsPage.vue"); +const OrgUsagePage = () => import("@/org/OrgUsagePage.vue"); +const SchedulingPolicyPage = () => import("@/settings/SchedulingPolicyPage.vue"); +const ToolsPage = () => import("@/settings/ToolsPage.vue"); +const InstructionsPage = () => import("@/settings/InstructionsPage.vue"); +const ExtensionsPage = () => import("@/settings/ExtensionsPage.vue"); +const PluginsPage = () => import("@/settings/PluginsPage.vue"); +const SecretEnginesPage = () => import("@/settings/SecretEnginesPage.vue"); +const ContainerRuntimePage = () => import("@/settings/ContainerRuntimePage.vue"); +const ConnectionsPage = () => import("@/settings/ConnectionsPage.vue"); +const SystemAppearancePage = () => import("@/settings/SystemAppearancePage.vue"); +const SystemReposPage = () => import("@/settings/SystemReposPage.vue"); +const SystemStatusPage = () => import("@/settings/SystemStatusPage.vue"); +const SystemTasksPage = () => import("@/settings/SystemTasksPage.vue"); +const SkillsPage = () => import("@/skills/SkillsPage.vue"); +const TaskDetailPage = () => import("@/tasks/TaskDetailPage.vue"); +const TasksPage = () => import("@/tasks/TasksPage.vue"); +const WorkflowsPage = () => import("@/workflows/WorkflowsPage.vue"); +const WorkflowPage = () => import("@/workflows/WorkflowPage.vue"); + +// internal/gateway/dashboard_tools.go mirrors this table. +// +// meta: +// label the navigation label, short because its group carries the context +// description one line mirrored in the messaging page registry +// section the capability from GET /api/capabilities this route needs; a +// route with no section is served in every composition +// navPath the navigation entry this route keeps current +export const routes: RouteRecordRaw[] = [ + {path:"/account",name:"account",component:()=>import("@/accounts/AccountPage.vue"),meta:{label:"Your account",description:"Password, recovery code, passkeys and personal API tokens."}}, + {path:"/access/authentication",redirect:"/settings/authentication",meta:{nav:false}}, + { + path: "/", + name: "dashboard", + component: DashboardPage, + meta: { + label: "Dashboard", + description: + "Running work, work needing attention, token spend.", + section: "home", + }, + }, + { + path: "/tasks", + name: "tasks", + component: TasksPage, + meta: { + label: "Tasks", + description: "Picked-up issues and their status.", + section: "tasks", + }, + }, + { + path: "/tasks/:id", + name: "task-detail", + component: TaskDetailPage, + meta: { label: "Task run", nav: false, navPath: "/tasks", section: "tasks" }, + }, + { + path: "/runs", + name: "runs", + component: () => import("@/runs/RunsPage.vue"), + meta: { label: "Runs", description: "Workflow runs, their decision trails and waiting approvals.", section: "runs" }, + }, + { + path: "/runs/:id", + name: "run", + component: () => import("@/runs/RunPage.vue"), + meta: { label: "Run", nav: false, navPath: "/runs", section: "runs" }, + }, + { + path: "/controls", + name: "controls", + component: () => import("@/controls/ControlsPage.vue"), + meta: { label: "Controls", description: "Hard rules, change-request rules, guards and action classes.", section: "controls" }, + }, + { + path: "/workflows", + name: "workflows", + component: () => import("@/workflows/WorkflowListPage.vue"), + // Links written as /workflows?workflow= open that workflow's page. + beforeEnter: (to: RouteLocationGeneric) => { + const { workflow, ...query } = to.query; + if (typeof workflow === "string" && workflow) return { name: "workflow", params: { id: workflow }, query, replace: true }; + return true; + }, + meta: { + label: "Workflows", + description: "Workflows and run history.", + section: "workflows", + }, + }, + { + path: "/workflows/:id", + name: "workflow", + component: () => import("@/workflows/WorkflowDocumentPage.vue"), + meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflows" }, + }, + // The visual editor, with drafts, test runs and per-step statistics; it + // needs workflow drafts and run stages the binary does not serve yet. + { + path: "/workflow-editor", + name: "workflow-editor-list", + component: WorkflowsPage, + meta: { label: "Workflow editor", nav: false, navPath: "/workflows", section: "workflow_editor" }, + }, + { + path: "/workflow-editor/:id", + name: "workflow-editor", + component: WorkflowPage, + meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflow_editor" }, + }, + { + path: "/settings/skills", + name: "skills", + component: SkillsPage, + meta: { + navPath: "/settings", + settings: true, + label: "Skills", + description: "Skills Archie can activate.", + section: "skills", + }, + }, + { + path: "/settings/curators", + name: "curators", + component: CuratorsPage, + meta: { + navPath: "/settings", + settings: true, + label: "Curators", + description: "Scheduled memory and capture curation.", + section: "curators", + }, + }, + { + path: "/events", + name: "events", + component: EventsPage, + meta: { + label: "Events", + description: "Received events, their sources, and the triggers that start workflows.", + section: "events", + }, + }, + { + path: "/settings/status", + name: "system-status", + component: SystemStatusPage, + meta: { + navPath: "/settings", + settings: true, + label: "Status", + description: + "Service presence, dependency health, and build versions.", + section: "system_status", + }, + }, + { + path: "/logs", + name: "logs", + component: LogsPage, + meta: { + label: "Logs", + description: "Daemon log by level and component.", + section: "logs", + }, + }, + { + path: "/account/appearance", + name: "system-appearance", + component: SystemAppearancePage, + meta: { label: "Appearance", description: "Theme, density and motion." }, + }, + { + path: "/settings/task-execution", + name: "system-tasks", + component: SystemTasksPage, + meta: { + navPath: "/settings", + settings: true, + label: "Task execution", + description: "Statuses, operator actions, budgets.", + section: "task_execution", + }, + }, + { + path: "/settings/models", + name: "system-models", + component: () => import("@/settings/AgentModelsPage.vue"), + meta: { + navPath: "/settings", + settings: true, + label: "Models", + description: "The models agent loops use, by alias.", + section: "models", + }, + }, + { + path: "/settings/organisations", + name: "settings-organisations", + component: () => import("@/settings/OrganisationsPage.vue"), + meta: { navPath: "/settings", settings: true, label: "Organisations", section: "organisations", description: "The organisations on this instance, and which one is active." }, + }, + { + path: "/settings/authentication", + name: "authentication", + component: () => import("@/accounts/AuthenticationPage.vue"), + meta: { + navPath: "/settings", + settings: true, + label: "Authentication", + description: "Instance URL and single sign-on providers.", + section: "settings", + }, + }, + + { + path: "/org", + component: OrgShell, + meta: { + label: "Organisation", + description: "Members, identities, connections, models and automation.", + navPath: "/org", + section: "org", + org: true, + }, + children: [ + { + path: "", + name: "org-overview", + component: OrgOverviewPage, + meta: { label: "Overview", navPath: "/org", description: "What this organisation holds and how work is going." }, + }, + { + path: "members", + name: "org-members", + component: OrgMembersPage, + meta: { section: "org_members", label: "Members", navPath: "/org", description: "People in the organisation and their roles." }, + }, + { + path: "agents", + name: "org-agents", + component: OrgAgentsPage, + meta: { section: "org_agents", label: "Agents", navPath: "/org", description: "Execution identities, their permissions and commit author." }, + }, + { + path: "audit", + name: "audit", + component: AuditPage, + meta: { + section: "org_audit", + label: "Audit", + navPath: "/org", + description: "Settings, access, identity and runtime events.", + }, + }, + { + path: "denials", + name: "org-denials", + component: DenialsPage, + meta: { + section: "org_denials", + label: "Denials", + navPath: "/org", + description: "Access requests the policy chain refused, newest first.", + }, + }, + { + path: "workspaces", + name: "org-workspaces", + component: OrgWorkspacesPage, + meta: { section: "org_workspaces", label: "Workspaces", navPath: "/org", description: "Groups of organisation work and resources." }, + }, + { + path: "policies", + name: "org-policies", + component: OrgAccessPage, + meta: { section: "org_policies", label: "Policies", navPath: "/org", description: "Access rules for the organisation." }, + }, + { + path: "repositories", + name: "org-repositories", + component: SystemReposPage, + meta: { section: "org_config", label: "Repositories", navPath: "/org", description: "Repository connections, access checks and execution policies." }, + }, + { + path: "connections", + name: "org-connections", + component: ConnectionsPage, + meta: { section: "org_config", label: "Connections", navPath: "/org", description: "Forge hosts, credentials and permitted operations." }, + }, + { + path: "credential-bindings", + name: "org-credential-bindings", + component: () => import("@/settings/CredentialBindingsPage.vue"), + meta: { section: "org_config", label: "Credential bindings", navPath: "/org", description: "Service credentials granted to agent identities." }, + }, + { + path: "models", + name: "org-models", + component: OrgModelsPage, + meta: { section: "org_config", label: "Models", navPath: "/org", description: "Organisation providers and model aliases." }, + }, + { + path: "instructions", + name: "org-instructions", + component: InstructionsPage, + meta: { section: "org_config", label: "Instructions", navPath: "/org", description: "Archie's identity, tone and standing instructions for the organisation." }, + }, + { + path: "schedules", + name: "org-schedules", + component: () => import("@/schedules/SchedulesPage.vue"), + meta: { section: "org_config", label: "Schedules", navPath: "/org", description: "Recurring runs and the times they fire." }, + }, + { + path: "schedules/:id/runs", + name: "org-schedule-runs", + component: () => import("@/schedules/ScheduleRunsPage.vue"), + meta: { label: "Schedule runs", navPath: "/org/schedules", nav: false }, + }, + { + path: "channels", + name: "org-channels", + component: ChannelsPage, + meta: { label: "Channels", navPath: "/org", description: "Chat channels.", section: "channels" }, + }, + { + path: "scheduling-policy", + name: "org-scheduling-policy", + component: SchedulingPolicyPage, + meta: { section: "org_config", label: "Scheduling policy", navPath: "/org", description: "Work discovery and forge labels." }, + }, + { + path: "issue-routing", + name: "org-issue-routing", + component: () => import("@/settings/IssueRoutingPage.vue"), + meta: { section: "org_config", label: "Issue routing", navPath: "/org", description: "Which workflow an issue runs by its labels." }, + }, + { + path: "alerts", + name: "org-alerts", + component: () => import("@/settings/OrgAlertsPage.vue"), + meta: { section: "org_config", label: "Alert webhook", navPath: "/org", description: "Where this organisation's alerts are sent." }, + }, + { + path: "playbooks", + name: "org-playbooks", + component: () => import("@/settings/PlaybooksPage.vue"), + meta: { section: "org_config", label: "Playbooks", navPath: "/org", description: "Edit event-driven automation rules." }, + }, + { + path: "usage", + name: "org-usage", + component: OrgUsagePage, + meta: { section: "org_usage", label: "Usage", navPath: "/org", description: "Token spend by model, identity and period." }, + }, + ], + }, + // The old unified Access area and the org-owned settings that used to sit + // under Settings resolve to the Organisation destination (or Account for + // personal tokens, which were never the org's). + ...Object.entries({ + "/access": "/org", + "/access/agents": "/org/agents", + "/access/workspaces": "/org/workspaces", + "/access/policies": "/org/policies", + "/access/models": "/org/models", + "/access/tokens": "/account", + "/settings/identities": "/org/agents", + "/settings/access-policies": "/org/policies", + "/settings/connections": "/org/connections", + "/settings/repositories":"/org/repositories", + "/settings/credential-bindings": "/org/credential-bindings", + "/settings/soul": "/org/instructions", + "/org/soul": "/org/instructions", + "/settings/schedules": "/org/schedules", + "/settings/playbooks": "/org/playbooks", + "/settings/scheduling-policy": "/org/scheduling-policy", + "/settings/appearance": "/account/appearance", + }).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })), + { + path: "/settings/tools", + name: "settings-tools", + component: ToolsPage, + meta: { + navPath: "/settings", + settings: true, + label: "Tools & MCP", + description: "Agent tools and MCP servers.", + section: "tools", + }, + }, + { + path: "/settings/channels", + name: "settings-channels", + component: () => import("@/settings/ChannelSettingsPage.vue"), + meta: { navPath: "/settings", settings: true, label: "Channels", description: "Chat channel connections and session defaults.", section: "channels" }, + }, + { + path: "/settings/extensions", + name: "settings-extensions", + component: () => import("@/settings/AcceptedExtensionsPage.vue"), + meta: { + navPath: "/settings", + settings: true, + label: "Extensions", + description: "Connectors, guards and MCP servers.", + section: "extensions", + }, + }, + { + path: "/settings/extension-catalogue", + name: "settings-extension-catalogue", + component: ExtensionsPage, + meta: { navPath: "/settings", settings: true, label: "Extension catalogue", description: "Installed extensions, grants and the marketplace.", section: "extension_catalogue" }, + }, + { + path: "/settings/model-aliases", + name: "settings-model-aliases", + component: () => import("@/settings/SystemModelsPage.vue"), + meta: { navPath: "/settings", settings: true, label: "Model aliases", description: "Model aliases and providers.", section: "model_aliases" }, + }, + { + path: "/settings/plugins", + name: "settings-plugins", + component: PluginsPage, + meta: { + navPath: "/settings", + settings: true, + label: "Plugins", + description: "Extension directories loaded at startup.", + section: "plugins", + }, + }, + { + path: "/settings/secret-engines", + name: "settings-secret-engines", + component: SecretEnginesPage, + meta: { navPath: "/settings", settings: true, label: "Secret engines", section: "secret_engines", description: "Where secrets are read from: engines, their keys and health." }, + }, + { + path: "/settings/credentials", + name: "settings-credentials", + component: () => import("@/settings/CredentialsPage.vue"), + meta: { navPath: "/settings", settings: true, label: "Credentials", description: "Sealed credentials extensions and models use.", section: "credentials" }, + }, + { + path: "/settings/container-runtime", + name: "settings-container-runtime", + component: ContainerRuntimePage, + meta: { + navPath: "/settings", + settings: true, + label: "Container runtime", + description: "How task containers run: runtime, image, limits and egress hosts.", + section: "container_runtime", + }, + }, + { + path: "/settings/agent-profiles", + name: "settings-agent-profiles", + component: () => import("@/settings/AgentProfilesPage.vue"), + meta: { navPath: "/settings", settings: true, label: "Agent profiles", section: "agent_profiles", description: "Execution profiles: the image and tools each agent runs with." }, + }, + { path: "/settings/history", redirect: (to: RouteLocationGeneric) => ({ path: "/org/audit", query: to.query, hash: to.hash }), meta: { nav: false } }, + { path: "/settings/audit", redirect: (to: RouteLocationGeneric) => ({ path: "/org/audit", query: to.query, hash: to.hash }), meta: { nav: false } }, + { + path: "/settings", + redirect: "/settings/models", + meta: { + label: "Instance", + description: "Every instance-wide setting: models, prompts, connections, runtime and status.", + }, + }, + { + path: "/:pathMatch(.*)*", + name: "not-found", + component: () => import("@/base/NotFoundPage.vue"), + meta: { nav: false }, + }, + // Paths from before Settings existed, kept for bookmarks and chat history. + ...Object.entries({ + "/system/status": "/settings/status", + "/system/appearance": "/account/appearance", + "/system/tasks": "/settings/task-execution", + "/system/models": "/settings/models", + "/system/repos": "/settings/repositories", + "/system/identities": "/org/agents", + "/channels": "/org/channels", + "/skills": "/settings/skills", + "/curators": "/settings/curators", + }).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })), +]; + + +export default routes;