feat: implement API key authentication and user session management
Some checks failed
CI / Typecheck & Lint (push) Has been cancelled

This commit is contained in:
nirholas
2026-03-31 12:43:05 +00:00
parent da6c5e1ed7
commit 3a854557e0
145 changed files with 34693 additions and 690 deletions

51
web/lib/shortcuts.ts Normal file
View File

@@ -0,0 +1,51 @@
export interface Command {
id: string;
/** One or more key combo strings, e.g. ["mod+k", "mod+shift+p"] */
keys: string[];
label: string;
description: string;
category: ShortcutCategory;
action: () => void;
/** Return false to disable this command contextually */
when?: () => boolean;
/** If true, fires even when an input/textarea is focused */
global?: boolean;
/** Icon name from lucide-react, optional */
icon?: string;
}
export type ShortcutCategory =
| "Chat"
| "Navigation"
| "Model"
| "Theme"
| "View"
| "Help";
export const SHORTCUT_CATEGORIES: ShortcutCategory[] = [
"Chat",
"Navigation",
"Model",
"Theme",
"View",
"Help",
];
/** IDs for all default commands — used to register/look up */
export const CMD = {
OPEN_PALETTE: "open-palette",
NEW_CONVERSATION: "new-conversation",
TOGGLE_SIDEBAR: "toggle-sidebar",
OPEN_SETTINGS: "open-settings",
SEND_MESSAGE: "send-message",
STOP_GENERATION: "stop-generation",
CLEAR_CONVERSATION: "clear-conversation",
TOGGLE_THEME: "toggle-theme",
PREV_CONVERSATION: "prev-conversation",
NEXT_CONVERSATION: "next-conversation",
FOCUS_CHAT: "focus-chat",
SHOW_HELP: "show-help",
GLOBAL_SEARCH: "global-search",
} as const;
export type CommandId = (typeof CMD)[keyof typeof CMD];