### Clone and Install Dependencies Source: https://github.com/prat011/free-cluely/blob/master/README.md Commands to initialize the project and install required Node.js packages. ```bash git clone [repository-url] cd free-cluely ``` ```bash # If you encounter Sharp/Python build errors, use this: SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --ignore-scripts npm rebuild sharp # Or for normal installation: npm install ``` -------------------------------- ### Run the Application Source: https://github.com/prat011/free-cluely/blob/master/README.md Commands to start the development server or build the production version. ```bash npm start ``` ```bash npm run dist ``` -------------------------------- ### Install and Configure Cluely Source: https://context7.com/prat011/free-cluely/llms.txt Commands for cloning the repository, installing dependencies, and setting up environment variables for AI providers. ```bash # Clone the repository git clone https://github.com/Prat011/free-cluely cd free-cluely # Install dependencies (use this if Sharp build errors occur) SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --ignore-scripts npm rebuild sharp # Or normal installation npm install # Create .env file for Gemini (Cloud AI) cat > .env << EOF GEMINI_API_KEY=your_api_key_here EOF # Or create .env file for Ollama (Local/Private AI) cat > .env << EOF USE_OLLAMA=true OLLAMA_MODEL=llama3.2 OLLAMA_URL=http://localhost:11434 EOF # Start development mode npm start # Or build for production npm run dist ``` -------------------------------- ### Start Development Server Source: https://github.com/prat011/free-cluely/blob/master/renderer/README.md Runs the app in development mode. Opens http://localhost:3000 and reloads on edits. Displays lint errors in the console. ```bash npm start ``` -------------------------------- ### Resolve Sharp/Python Build Errors Source: https://github.com/prat011/free-cluely/blob/master/README.md Alternative installation methods for environments with missing build dependencies. ```bash # Solution 1: Use prebuilt binaries rm -rf node_modules package-lock.json SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --ignore-scripts npm rebuild sharp # Solution 2: Or install Python (if you prefer building from source) brew install python3 # macOS # Then run: npm install ``` -------------------------------- ### Initialize and Use ScreenshotHelper Source: https://context7.com/prat011/free-cluely/llms.txt Initializes ScreenshotHelper with a view mode and demonstrates taking screenshots, managing queues, and getting image previews. Requires callbacks to hide and show the main window during capture. ```typescript import { ScreenshotHelper } from "./electron/ScreenshotHelper" // Initialize with view mode const screenshotHelper = new ScreenshotHelper("queue") // or "solutions" // Take a screenshot (requires hide/show callbacks for window) const path = await screenshotHelper.takeScreenshot( () => mainWindow.hide(), () => mainWindow.show() ) // Returns: "/Users/.../screenshots/uuid-string.png" // Get screenshot queues const queuedScreenshots = screenshotHelper.getScreenshotQueue() // Returns: ["/path/to/shot1.png", "/path/to/shot2.png", ...] const extraScreenshots = screenshotHelper.getExtraScreenshotQueue() // Returns: ["/path/to/debug1.png", ...] (used for debugging) // Get base64 preview of an image const preview = await screenshotHelper.getImagePreview("/path/to/screenshot.png") // Returns: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." // Delete a specific screenshot const result = await screenshotHelper.deleteScreenshot("/path/to/screenshot.png") // Returns: { success: true } or { success: false, error: "File not found" } // Clear all queues (deletes files from disk) screenshotHelper.clearQueues() // Switch view mode (affects which queue screenshots go to) screenshotHelper.setView("solutions") const currentView = screenshotHelper.getView() // "solutions" // Note: Maximum 5 screenshots per queue, oldest auto-deleted when exceeded ``` -------------------------------- ### Initialize and Use WindowHelper Source: https://context7.com/prat011/free-cluely/llms.txt Initializes WindowHelper and demonstrates creating, showing, hiding, and manipulating the main overlay window. The window is configured to be transparent, frameless, and always-on-top. ```typescript import { WindowHelper } from "./electron/WindowHelper" import { AppState } from "./electron/main" const appState = AppState.getInstance() const windowHelper = new WindowHelper(appState) // Create the main overlay window windowHelper.createWindow() // Creates transparent, frameless, always-on-top window // Settings: transparent: true, frame: false, alwaysOnTop: true // Get the BrowserWindow instance const mainWindow = windowHelper.getMainWindow() // Check visibility const isVisible = windowHelper.isVisible() // true or false // Show/hide window windowHelper.showMainWindow() windowHelper.hideMainWindow() windowHelper.toggleMainWindow() // Center and show window windowHelper.centerAndShowWindow() // Move window in increments windowHelper.moveWindowLeft() windowHelper.moveWindowRight() windowHelper.moveWindowUp() windowHelper.moveWindowDown() // Update window dimensions (responsive to content) windowHelper.setWindowDimensions(500, 400) // Automatically constrains to screen bounds and accounts for debug mode width ``` -------------------------------- ### System Requirements for Free Cluely Source: https://github.com/prat011/free-cluely/blob/master/README.md Specifies the minimum, recommended, and optimal system resources for running Free Cluely, particularly for local AI model performance. ```bash Minimum: 4GB RAM, Dual-core CPU, 2GB storage Recommended: 8GB+ RAM, Quad-core CPU, 5GB+ storage Optimal: 16GB+ RAM for local AI models ``` -------------------------------- ### Build for Production Source: https://github.com/prat011/free-cluely/blob/master/renderer/README.md Builds the app for production, optimizing it for performance. The output is minified and placed in the 'build' folder, ready for deployment. ```bash npm run build ``` -------------------------------- ### Manage Application State with AppState Source: https://context7.com/prat011/free-cluely/llms.txt Demonstrates how to interact with the AppState singleton to control windows, manage screenshot queues, and handle problem information. ```typescript import { AppState } from "./electron/main" // Get singleton instance const appState = AppState.getInstance() // Window management appState.createWindow() appState.showMainWindow() appState.hideMainWindow() appState.toggleMainWindow() appState.centerAndShowWindow() // Move window appState.moveWindowLeft() appState.moveWindowRight() appState.moveWindowUp() appState.moveWindowDown() // Screenshot operations const screenshotPath = await appState.takeScreenshot() const preview = await appState.getImagePreview(screenshotPath) await appState.deleteScreenshot(screenshotPath) // Queue management const screenshots = appState.getScreenshotQueue() const extraScreenshots = appState.getExtraScreenshotQueue() appState.clearQueues() // View state ("queue" or "solutions") const currentView = appState.getView() appState.setView("solutions") // Problem info appState.setProblemInfo({ problem_statement: "Find the longest substring...", input_format: {}, output_format: {}, constraints: [], test_cases: [] }) const problemInfo = appState.getProblemInfo() // Debug state appState.setHasDebugged(true) const hasDebugged = appState.getHasDebugged() // Access helpers const screenshotHelper = appState.getScreenshotHelper() const mainWindow = appState.getMainWindow() // System tray appState.createTray() // Processing events constants const events = appState.PROCESSING_EVENTS // { // UNAUTHORIZED: "procesing-unauthorized", // NO_SCREENSHOTS: "processing-no-screenshots", // INITIAL_START: "initial-start", // PROBLEM_EXTRACTED: "problem-extracted", // SOLUTION_SUCCESS: "solution-success", // INITIAL_SOLUTION_ERROR: "solution-error", // DEBUG_START: "debug-start", // DEBUG_SUCCESS: "debug-success", // DEBUG_ERROR: "debug-error" // } ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/prat011/free-cluely/blob/master/README.md Configuration settings for connecting to AI providers. ```env GEMINI_API_KEY=your_api_key_here ``` ```env USE_OLLAMA=true OLLAMA_MODEL=llama3.2 OLLAMA_URL=http://localhost:11434 ``` -------------------------------- ### Integrate LLMHelper for AI Interactions Source: https://context7.com/prat011/free-cluely/llms.txt Methods for initializing the LLMHelper class and performing tasks like chat, image analysis, audio processing, and provider management. ```typescript import { LLMHelper } from "./electron/LLMHelper" // Initialize with Google Gemini const geminiHelper = new LLMHelper("your-gemini-api-key", false) // Initialize with Ollama (local AI) const ollamaHelper = new LLMHelper( undefined, true, "llama3.2", "http://localhost:11434" ) // Chat with the AI const response = await geminiHelper.chatWithGemini("Explain this code snippet") // Returns: "This code implements a binary search algorithm..." // Analyze an image file const imageResult = await geminiHelper.analyzeImageFile("/path/to/screenshot.png") // Returns: { text: "The image shows a coding interview question...", timestamp: 1699123456789 } // Analyze audio file const audioResult = await geminiHelper.analyzeAudioFile("/path/to/recording.mp3") // Returns: { text: "The speaker is discussing project requirements...", timestamp: 1699123456789 } // Analyze audio from base64 const audioBase64Result = await geminiHelper.analyzeAudioFromBase64( "base64EncodedAudioData", "audio/mp3" ) // Returns: { text: "Transcription and analysis of audio...", timestamp: 1699123456789 } // Extract problem from multiple images const problemInfo = await geminiHelper.extractProblemFromImages([ "/path/to/screenshot1.png", "/path/to/screenshot2.png" ]) // Returns: { // problem_statement: "Implement a function to find the longest substring...", // context: "LeetCode problem from interview preparation...", // suggested_responses: ["Use sliding window approach", "Try dynamic programming"], // reasoning: "This is a classic string manipulation problem..." // } // Generate solution based on problem info const solution = await geminiHelper.generateSolution(problemInfo) // Returns: { // solution: { // code: "function longestSubstring(s) { ... }", // problem_statement: "...", // context: "...", // suggested_responses: [...], // reasoning: "..." // } // } // Debug solution with additional images const debugResult = await geminiHelper.debugSolutionWithImages( problemInfo, "function longestSubstring(s) { ... }", ["/path/to/error-screenshot.png"] ) // Get current provider info const provider = geminiHelper.getCurrentProvider() // "gemini" or "ollama" const model = geminiHelper.getCurrentModel() // "gemini-2.0-flash" or "llama3.2" const isOllama = geminiHelper.isUsingOllama() // true or false // Switch between providers at runtime await geminiHelper.switchToOllama("codellama", "http://localhost:11434") await geminiHelper.switchToGemini("new-api-key") // Get available Ollama models const models = await ollamaHelper.getOllamaModels() // Returns: ["llama3.2", "codellama", "mistral", ...] // Test connection to current provider const connectionTest = await geminiHelper.testConnection() // Returns: { success: true } or { success: false, error: "Connection failed" } ``` -------------------------------- ### Initialize and Use ProcessingHelper Source: https://context7.com/prat011/free-cluely/llms.txt Initializes ProcessingHelper to manage the AI processing pipeline for screenshots and audio. Demonstrates processing queued screenshots, handling audio files, and accessing the underlying LLMHelper. ```typescript import { ProcessingHelper } from "./electron/ProcessingHelper" import { AppState } from "./electron/main" const appState = AppState.getInstance() const processingHelper = new ProcessingHelper(appState) // Process queued screenshots // In "queue" view: extracts problem and analyzes images // In "solutions" view: debugs current solution with new screenshots await processingHelper.processScreenshots() // Processing emits events to renderer: // - INITIAL_START: Processing started // - PROBLEM_EXTRACTED: Problem info extracted from images // - SOLUTION_SUCCESS: Solution generated successfully // - INITIAL_SOLUTION_ERROR: Error during processing // - DEBUG_START: Debug processing started // - DEBUG_SUCCESS: Debug completed with results // - DEBUG_ERROR: Error during debugging // - NO_SCREENSHOTS: No screenshots in queue // Cancel any ongoing AI requests processingHelper.cancelOngoingRequests() // Process audio directly const audioResult = await processingHelper.processAudioBase64( "base64EncodedAudio", "audio/webm" ) const fileResult = await processingHelper.processAudioFile("/path/to/audio.mp3") // Access the underlying LLMHelper const llmHelper = processingHelper.getLLMHelper() ``` -------------------------------- ### Create Electron BrowserWindow with Overlay Properties Source: https://github.com/prat011/free-cluely/blob/master/doc.md This snippet demonstrates how to configure an Electron BrowserWindow to function as a transparent, always-on-top overlay. Ensure Node.js integration is enabled if required by your application logic. ```javascript const { BrowserWindow } = require('electron'); const win = new BrowserWindow({ width: 800, height: 600, transparent: true, frame: false, alwaysOnTop: true, skipTaskbar: true, resizable: false, fullscreen: false, webPreferences: { nodeIntegration: true, contextIsolation: false, } }); win.loadURL('file://' + __dirname + '/index.html'); ``` -------------------------------- ### AppState Singleton API Source: https://context7.com/prat011/free-cluely/llms.txt Methods for managing application state, including window control, screenshot processing, and problem data management. ```APIDOC ## AppState Management ### Description The AppState singleton acts as the central controller for the application, providing methods to manipulate the UI, handle screenshots, and manage problem-solving state. ### Methods - **createWindow()**: Initializes the main application window. - **showMainWindow() / hideMainWindow() / toggleMainWindow()**: Controls visibility of the main window. - **centerAndShowWindow()**: Centers and displays the main window. - **moveWindowLeft() / moveWindowRight() / moveWindowUp() / moveWindowDown()**: Adjusts window position. - **takeScreenshot()**: Triggers a screenshot capture; returns a path string. - **getImagePreview(path)**: Generates a preview for a given screenshot path. - **deleteScreenshot(path)**: Removes a screenshot file. - **getScreenshotQueue() / getExtraScreenshotQueue()**: Retrieves current processing queues. - **clearQueues()**: Resets all screenshot queues. - **getView() / setView(view)**: Manages the current UI view (e.g., "queue" or "solutions"). - **setProblemInfo(info) / getProblemInfo()**: Manages problem statement, formats, and constraints. - **setHasDebugged(bool) / getHasDebugged()**: Tracks debug state. - **createTray()**: Initializes the system tray icon. ### Constants - **PROCESSING_EVENTS**: An object containing event keys for application lifecycle and processing states (e.g., UNAUTHORIZED, PROBLEM_EXTRACTED, SOLUTION_SUCCESS). ``` -------------------------------- ### WindowHelper API Source: https://context7.com/prat011/free-cluely/llms.txt Controls the Electron BrowserWindow, providing methods for visibility, positioning, and dimension management. ```APIDOC ## WindowHelper ### Description Manages the transparent, always-on-top overlay window used by the application. ### Methods - **createWindow()**: Initializes the frameless, transparent window. - **getMainWindow()**: Returns the BrowserWindow instance. - **isVisible()**: Returns boolean status. - **showMainWindow() / hideMainWindow() / toggleMainWindow()**: Controls window visibility. - **centerAndShowWindow()**: Centers and displays the window. - **moveWindowLeft/Right/Up/Down()**: Moves window in increments. - **setWindowDimensions(width, height)**: Updates window size, constrained to screen bounds. ``` -------------------------------- ### Access Electron API in Renderer Process Source: https://context7.com/prat011/free-cluely/llms.txt Access the Electron API from the renderer process by referencing `window.electronAPI`. This is the entry point for all Electron-specific functionalities. ```typescript const { electronAPI } = window ``` -------------------------------- ### Run Tests Source: https://github.com/prat011/free-cluely/blob/master/renderer/README.md Launches the test runner in interactive watch mode. Refer to the running tests documentation for more details. ```bash npm test ``` -------------------------------- ### LLMHelper AI Integration Source: https://context7.com/prat011/free-cluely/llms.txt Methods for interacting with AI providers to analyze media, extract problem statements, and generate solutions. ```APIDOC ## LLMHelper Methods ### Description The LLMHelper class manages communication with AI providers (Google Gemini or Ollama) for image analysis, audio processing, and chat interactions. ### Methods - **chatWithGemini(prompt: string)**: Sends a text prompt to the AI and returns the response. - **analyzeImageFile(path: string)**: Analyzes an image file and returns the extracted text and timestamp. - **analyzeAudioFile(path: string)**: Analyzes an audio file and returns the transcription and analysis. - **analyzeAudioFromBase64(data: string, mimeType: string)**: Analyzes audio data provided as a base64 string. - **extractProblemFromImages(paths: string[])**: Extracts problem statements and context from multiple images. - **generateSolution(problemInfo: object)**: Generates a solution based on extracted problem information. - **debugSolutionWithImages(problemInfo: object, code: string, imagePaths: string[])**: Debugs a provided solution using additional image context. - **getOllamaModels()**: Returns a list of available models from the local Ollama instance. - **testConnection()**: Tests the connection to the currently configured AI provider. ### Provider Management - **getCurrentProvider()**: Returns the current provider name ('gemini' or 'ollama'). - **getCurrentModel()**: Returns the current model name. - **isUsingOllama()**: Returns a boolean indicating if Ollama is the active provider. - **switchToOllama(model: string, url: string)**: Switches the active provider to Ollama. - **switchToGemini(apiKey: string)**: Switches the active provider to Google Gemini. ``` -------------------------------- ### ProcessingHelper API Source: https://context7.com/prat011/free-cluely/llms.txt Orchestrates the AI processing pipeline, including screenshot analysis and audio processing. ```APIDOC ## ProcessingHelper ### Description Orchestrates screenshot processing, AI analysis, and result distribution. Emits events to the renderer process. ### Methods - **processScreenshots()**: Triggers analysis based on current view mode. - **cancelOngoingRequests()**: Aborts active AI requests. - **processAudioBase64(data, mimeType)**: Processes audio from base64 string. - **processAudioFile(path)**: Processes audio from file path. - **getLLMHelper()**: Accesses the underlying LLM helper instance. ### Events - INITIAL_START, PROBLEM_EXTRACTED, SOLUTION_SUCCESS, INITIAL_SOLUTION_ERROR, DEBUG_START, DEBUG_SUCCESS, DEBUG_ERROR, NO_SCREENSHOTS ``` -------------------------------- ### Global Keyboard Shortcuts Overview Source: https://context7.com/prat011/free-cluely/llms.txt Register global keyboard shortcuts for hands-free operation. These shortcuts function even when the application window is not in focus, providing convenient access to core features. ```plaintext Cmd/Ctrl + Shift + Space - Show and center the window Brings the overlay to the center of the screen and focuses it ``` ```plaintext Cmd/Ctrl + H - Take screenshot Captures the current screen (hides overlay first, then restores) ``` ```plaintext Cmd/Ctrl + Enter - Process screenshots Sends queued screenshots to AI for analysis and solution generation ``` ```plaintext Cmd/Ctrl + R - Reset queues Cancels ongoing requests, clears all screenshots, resets to queue view ``` ```plaintext Cmd/Ctrl + B - Toggle window visibility Shows/hides the overlay window ``` ```plaintext Cmd/Ctrl + Arrow Keys - Move window Left/Right/Up/Down to reposition the overlay ``` ```plaintext Cmd/Ctrl + Q - Quit application Exits the application completely ``` -------------------------------- ### Window Movement and Dimension Controls Source: https://context7.com/prat011/free-cluely/llms.txt Control the application window's position and dimensions using dedicated API methods. These allow for dynamic adjustments to the window's size and placement on the screen. ```typescript await electronAPI.moveWindowLeft() await electronAPI.moveWindowRight() await electronAPI.moveWindowUp() await electronAPI.moveWindowDown() ``` ```typescript await electronAPI.updateContentDimensions({ width: 500, height: 400 }) ``` -------------------------------- ### ScreenshotHelper API Source: https://context7.com/prat011/free-cluely/llms.txt Manages the lifecycle of screenshots, including capture, queuing, preview generation, and file deletion. ```APIDOC ## ScreenshotHelper ### Description Handles screenshot capture, queuing, and file management. Queues are limited to 5 items, with oldest items automatically deleted. ### Methods - **takeScreenshot(hideCb, showCb)**: Captures a screenshot. Requires callbacks to hide/show the window. - **getScreenshotQueue()**: Returns array of paths in the main queue. - **getExtraScreenshotQueue()**: Returns array of paths in the debug queue. - **getImagePreview(path)**: Returns a base64 string of the image. - **deleteScreenshot(path)**: Deletes a specific file. Returns { success: boolean, error?: string }. - **clearQueues()**: Deletes all files in queues from disk. - **setView(mode)**: Sets mode to 'queue' or 'solutions'. - **getView()**: Returns current view mode. ``` -------------------------------- ### Troubleshoot Port Conflicts Source: https://github.com/prat011/free-cluely/blob/master/README.md Commands to identify and terminate processes blocking port 5180. ```bash # Find processes using port 5180 lsof -i :5180 # Kill them (replace [PID] with the process ID) kill [PID] ``` -------------------------------- ### LLM Configuration Management API Source: https://context7.com/prat011/free-cluely/llms.txt Manage Large Language Model (LLM) configurations, including fetching current settings, listing available models for Ollama, switching between providers (Ollama/Gemini), and testing the connection. ```typescript const config = await electronAPI.getCurrentLlmConfig() // Returns: { provider: "gemini", model: "gemini-2.0-flash", isOllama: false } ``` ```typescript const ollamaModels = await electronAPI.getAvailableOllamaModels() // Returns: ["llama3.2", "codellama", "mistral"] ``` ```typescript const switchResult = await electronAPI.switchToOllama("llama3.2", "http://localhost:11434") // Returns: { success: true } or { success: false, error: "..." } ``` ```typescript const geminiResult = await electronAPI.switchToGemini("new-api-key") // Returns: { success: true } or { success: false, error: "..." } ``` ```typescript const connectionTest = await electronAPI.testLlmConnection() // Returns: { success: true } or { success: false, error: "Connection failed" } ``` -------------------------------- ### AI Analysis API Source: https://context7.com/prat011/free-cluely/llms.txt Endpoints for analyzing audio content from either base64 data or local file paths. ```APIDOC ## POST /electronAPI/analyzeAudioFromBase64 ### Parameters #### Request Body - **data** (string) - Required - Base64 encoded audio data - **mimeType** (string) - Required - The mime type of the audio (e.g., audio/webm) ### Response #### Success Response (200) - **text** (string) - Analysis result - **timestamp** (number) - Unix timestamp of the analysis ## POST /electronAPI/analyzeAudioFile ### Parameters #### Request Body - **path** (string) - Required - Local file path to the audio file ### Response #### Success Response (200) - **text** (string) - Transcription and analysis result - **timestamp** (number) - Unix timestamp of the analysis ``` -------------------------------- ### LLM Configuration API Source: https://context7.com/prat011/free-cluely/llms.txt Endpoints for managing LLM provider settings, including switching between Gemini and Ollama models. ```APIDOC ## GET /electronAPI/getCurrentLlmConfig ### Response #### Success Response (200) - **provider** (string) - Current LLM provider - **model** (string) - Current model name - **isOllama** (boolean) - Whether the provider is Ollama ## POST /electronAPI/switchToOllama ### Parameters #### Request Body - **model** (string) - Required - Model name - **url** (string) - Required - Ollama server URL ## POST /electronAPI/switchToGemini ### Parameters #### Request Body - **apiKey** (string) - Required - Gemini API key ``` -------------------------------- ### Eject from Create React App Source: https://github.com/prat011/free-cluely/blob/master/renderer/README.md Removes the single build dependency from your project, copying all configuration files (webpack, Babel, ESLint) into your project for full control. This is a one-way operation. ```bash npm run eject ``` -------------------------------- ### Screenshot Management API Source: https://context7.com/prat011/free-cluely/llms.txt Manage screenshots using the `electronAPI`. This includes taking screenshots, retrieving existing ones, and deleting them. Listen for new screenshot events to update the UI in real-time. ```typescript const screenshot = await electronAPI.takeScreenshot() // Returns: { path: "/path/to/screenshot.png", preview: "data:image/png;base64,..." } ``` ```typescript const screenshots = await electronAPI.getScreenshots() // Returns: [{ path: "/path/to/shot1.png", preview: "data:image/png;base64,..." }, ...] ``` ```typescript const result = await electronAPI.deleteScreenshot("/path/to/screenshot.png") // Returns: { success: true } or { success: false, error: "File not found" } ``` ```typescript const unsubscribe = electronAPI.onScreenshotTaken((data) => { console.log("New screenshot:", data.path) console.log("Preview:", data.preview) }) // Call unsubscribe() to remove listener ``` -------------------------------- ### Application Quit API Source: https://context7.com/prat011/free-cluely/llms.txt Gracefully quit the application using the `electronAPI.quitApp()` method. This ensures a clean exit. ```typescript await electronAPI.quitApp() ``` -------------------------------- ### Processing Event Listeners Source: https://context7.com/prat011/free-cluely/llms.txt Subscribe to various processing events to monitor the status of AI analysis and solution generation. These listeners provide feedback on processing stages, errors, and specific outcomes. ```typescript electronAPI.onSolutionStart(() => console.log("Processing started")) ``` ```typescript electronAPI.onProblemExtracted((data) => console.log("Problem:", data.problem_statement)) ``` ```typescript electronAPI.onSolutionSuccess((data) => console.log("Solution:", data.solution.code)) ``` ```typescript electronAPI.onSolutionError((error) => console.error("Error:", error)) ``` ```typescript electronAPI.onDebugStart(() => console.log("Debug started")) ``` ```typescript electronAPI.onDebugSuccess((data) => console.log("Debug result:", data)) ``` ```typescript electronAPI.onDebugError((error) => console.error("Debug error:", error)) ``` ```typescript electronAPI.onProcessingNoScreenshots(() => console.log("No screenshots to process")) ``` ```typescript electronAPI.onResetView(() => console.log("View reset")) ``` ```typescript electronAPI.onUnauthorized(() => console.log("Unauthorized")) ``` -------------------------------- ### Screenshot Management API Source: https://context7.com/prat011/free-cluely/llms.txt Endpoints for capturing, retrieving, and deleting screenshots within the application. ```APIDOC ## POST /electronAPI/takeScreenshot ### Description Captures a screenshot after hiding the application window, then restores visibility. ### Response #### Success Response (200) - **path** (string) - File path of the saved screenshot - **preview** (string) - Base64 encoded image data ## GET /electronAPI/getScreenshots ### Description Retrieves all screenshots currently in the queue. ### Response #### Success Response (200) - **screenshots** (array) - List of objects containing path and preview data ## DELETE /electronAPI/deleteScreenshot ### Parameters #### Request Body - **path** (string) - Required - The file path of the screenshot to delete ### Response #### Success Response (200) - **success** (boolean) - Status of the deletion operation ``` -------------------------------- ### Audio Analysis API Source: https://context7.com/prat011/free-cluely/llms.txt Analyze audio content either from base64 encoded data or a file path. The API returns a JSON object containing the transcribed text and a timestamp. ```typescript const audioAnalysis = await electronAPI.analyzeAudioFromBase64( "base64EncodedData", "audio/webm" ) // Returns: { text: "Analysis of the audio content...", timestamp: 1699123456789 } ``` ```typescript const fileAnalysis = await electronAPI.analyzeAudioFile("/path/to/audio.mp3") // Returns: { text: "Transcription and analysis...", timestamp: 1699123456789 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.