Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion client/src/hooks/useCortexDemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
`;

Comment on lines +22 to +24
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove stray duplicate lines that break compilation.

Lines 22-23 introduce a syntax error. Line 22 is a bare string literal with no statement context, and line 23 is a stray closing backtick. These appear to be accidental duplicates from the SYSTEM_CONTEXT definition above (line 19-20).

🔎 Proposed fix
 
 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.
  *
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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.
*
🤖 Prompt for AI Agents
In client/src/hooks/useCortexDemo.ts around lines 22 to 24, remove the stray
duplicate lines: the bare string literal on line 22 and the stray closing
backtick on line 23; delete these two lines so the SYSTEM_CONTEXT definition
remains intact and the file compiles without the syntax error.

/**
* 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<void>`-like),
* - `clearMessages`: function to reset the conversation and clear errors.
*/
export function useCortexDemo() {
const [state, setState] = useState<DemoState>({
messages: [], isLoading: false, error: null, remaining: null, limitReached: false
Expand Down Expand Up @@ -66,4 +83,4 @@ export function useCortexDemo() {
return { ...state, sendMessage, clearMessages };
}

export default useCortexDemo;
export default useCortexDemo;
9 changes: 8 additions & 1 deletion client/src/sections/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitHubStats>({
queryKey: ["/api/github/stats"],
Expand Down Expand Up @@ -2282,4 +2289,4 @@ export default function HomePage({ onNavigate }: HomePageProps) {
</footer>
</div>
);
}
}