diff --git a/client/src/hooks/useCortexDemo.ts b/client/src/hooks/useCortexDemo.ts index 9b7c64f..6f48251 100644 --- a/client/src/hooks/useCortexDemo.ts +++ b/client/src/hooks/useCortexDemo.ts @@ -19,6 +19,23 @@ const SYSTEM_CONTEXT = `You are Cortex, an AI-powered Linux package manager assi Only output the essential commands needed to accomplish the task, formatted in a single bash code block. `; +Only output the essential commands needed to accomplish the task, formatted in a single bash code block. +`; + +/** + * Hook that manages a demo chat session with a Cortex Linux package-management assistant. + * + * Provides state and actions for sending user messages, clearing the conversation, and tracking loading/error/usage status. + * + * @returns An object containing: + * - `messages`: the conversation messages (each has `role` and `content`), + * - `isLoading`: `true` while a request is in flight, + * - `error`: an error message or `null`, + * - `remaining`: optional remaining usage count, + * - `limitReached`: `true` if the demo rate limit was hit, + * - `sendMessage`: function to send a user message (`(content: string) => Promise`-like), + * - `clearMessages`: function to reset the conversation and clear errors. + */ export function useCortexDemo() { const [state, setState] = useState({ messages: [], isLoading: false, error: null, remaining: null, limitReached: false @@ -66,4 +83,4 @@ export function useCortexDemo() { return { ...state, sendMessage, clearMessages }; } -export default useCortexDemo; +export default useCortexDemo; \ No newline at end of file diff --git a/client/src/sections/HomePage.tsx b/client/src/sections/HomePage.tsx index 88c2a75..a50879e 100644 --- a/client/src/sections/HomePage.tsx +++ b/client/src/sections/HomePage.tsx @@ -290,6 +290,13 @@ function InteractiveCodeEditor({ ); } +/** + * Render the homepage for the Cortex marketing site, composing hero, demo, features, comparison, roadmap, + * community, and footer sections with interactive demos and animated visuals. + * + * @param onNavigate - Callback invoked with a section id to request navigation within the page (used by CTAs and footer links) + * @returns The homepage React element + */ export default function HomePage({ onNavigate }: HomePageProps) { const { data: githubStats } = useQuery({ queryKey: ["/api/github/stats"], @@ -2282,4 +2289,4 @@ export default function HomePage({ onNavigate }: HomePageProps) { ); -} +} \ No newline at end of file