| 1 | // Valid config tab names |
| 2 | export type ConfigTab = |
| 3 | | "models" |
| 4 | | "rules" |
| 5 | | "tools" |
| 6 | | "agents" |
| 7 | | "organizations" |
| 8 | | "indexing" |
| 9 | | "settings" |
| 10 | | "help"; |
| 11 | |
| 12 | // TODO: Move all the routes here |
| 13 | export const ROUTES = { |
| 14 | HOME: "/", |
| 15 | HOME_INDEX: "/index.html", |
| 16 | CONFIG: "/config", |
| 17 | THEME: "/theme", |
| 18 | STATS: "/stats", |
| 19 | // EXAMPLE_ROUTE_WITH_PARAMS: (params: ParamsType) => `/route/${params}`, |
| 20 | }; |
| 21 | |
| 22 | // Helper function to build config URLs with tabs |
| 23 | export const buildConfigRoute = (tab?: ConfigTab): string => { |
| 24 | return tab ? `${ROUTES.CONFIG}?tab=${tab}` : ROUTES.CONFIG; |
| 25 | }; |
| 26 | |
| 27 | // Typed config route builders for common tabs |
| 28 | export const CONFIG_ROUTES = { |
| 29 | MODELS: buildConfigRoute("models"), |
| 30 | RULES: buildConfigRoute("rules"), |
| 31 | TOOLS: buildConfigRoute("tools"), |
| 32 | AGENTS: buildConfigRoute("agents"), |
| 33 | ORGANIZATIONS: buildConfigRoute("organizations"), |
| 34 | INDEXING: buildConfigRoute("indexing"), |
| 35 | SETTINGS: buildConfigRoute("settings"), |
| 36 | HELP: buildConfigRoute("help"), |
| 37 | } as const; |