Make Cobble a local install: setup flow, bots-first admin, settings
Local, password-only auth: - No public pages; everything outside /admin and /auth redirects in - First run (no users) sends every page to /auth/signup, which creates the super admin (user #1) once and then locks - Login is email/username + password; removed the emailed-code flow, /auth/sso and email password reset - Google login kept for existing accounts only, never creates them - seed-super-admin now requires SEED_SUPER_ADMIN_PASSWORD Bots-first admin: - /admin and closed sections (people, logs, backups) redirect to /admin/bots; only bots and settings are live (AdminSections) - Removed the old admin layout; every /admin page uses the bots rail - Coordinator bot created at signup/seed and by /admin/bots (ensureCoordinatorBot), which redirects to its chat - bots.system_prompt (markdown) with a default coordinator prompt - seed-bots reuses the existing coordinator Settings: - Sub pages general (default), profile, change-password, listed in the rail with a back link; unknown settings paths redirect to general - Redesigned settings UI: pane header, grouped rows, sticky save bar - General: System/Light/Dark theme, saved per device Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* The admin sections that are live. Any other `/admin/*` path redirects to
|
||||
* `AdminHomePath`. People, logs and backups exist in code but stay closed
|
||||
* until they are added back here.
|
||||
*/
|
||||
export const AdminSections = ["/admin/bots", "/admin/settings"] as const;
|
||||
|
||||
export const AdminHomePath = "/admin/bots";
|
||||
@@ -48,6 +48,12 @@ export const BotKinds = [
|
||||
|
||||
export type BotKind = (typeof BotKinds)[number]["value"];
|
||||
|
||||
/**
|
||||
* Every workspace has exactly one coordinator, created with the account. It
|
||||
* coordinates the crew and hands work to the other bots.
|
||||
*/
|
||||
export const CoordinatorBotName = "Coordinator";
|
||||
|
||||
/**
|
||||
* A bot's face is its status. There are no badges or spinners.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
KeyRound,
|
||||
SlidersHorizontal,
|
||||
UserRound,
|
||||
type LucideIcon,
|
||||
} from "lucide-react";
|
||||
|
||||
export type SettingsPage = {
|
||||
title: string;
|
||||
url: string;
|
||||
Icon: LucideIcon;
|
||||
};
|
||||
|
||||
/**
|
||||
* The `/admin/settings/*` sub pages, listed in the rail on every settings
|
||||
* page. The first one is where `/admin/settings` lands.
|
||||
*/
|
||||
export const SettingsPages: SettingsPage[] = [
|
||||
{
|
||||
title: "General",
|
||||
url: "/admin/settings/general",
|
||||
Icon: SlidersHorizontal,
|
||||
},
|
||||
{ title: "Profile", url: "/admin/settings/profile", Icon: UserRound },
|
||||
{
|
||||
title: "Change password",
|
||||
url: "/admin/settings/change-password",
|
||||
Icon: KeyRound,
|
||||
},
|
||||
];
|
||||
|
||||
export const SettingsDefaultPath = "/admin/settings/general";
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Monitor, Moon, Sun, type LucideIcon } from "lucide-react";
|
||||
|
||||
export const ThemePreferences = [
|
||||
{
|
||||
title: "System",
|
||||
value: "system",
|
||||
description: "Follows your device",
|
||||
Icon: Monitor,
|
||||
},
|
||||
{
|
||||
title: "Light",
|
||||
value: "light",
|
||||
description: "Paper and ink",
|
||||
Icon: Sun,
|
||||
},
|
||||
{
|
||||
title: "Dark",
|
||||
value: "dark",
|
||||
description: "Easy at night",
|
||||
Icon: Moon,
|
||||
},
|
||||
] as const satisfies {
|
||||
title: string;
|
||||
value: string;
|
||||
description: string;
|
||||
Icon: LucideIcon;
|
||||
}[];
|
||||
|
||||
export type ThemePreference = (typeof ThemePreferences)[number]["value"];
|
||||
Reference in New Issue
Block a user