diff --git a/ai-hub/app/core/pipelines/question_decider.py b/ai-hub/app/core/pipelines/question_decider.py index 79b2aa1..087aa9b 100644 --- a/ai-hub/app/core/pipelines/question_decider.py +++ b/ai-hub/app/core/pipelines/question_decider.py @@ -165,7 +165,7 @@ **Request a small, focused set of files** (typically 2-4). **Analyze the fetched content** (which will appear in `retrieved_paths_with_content`), ensure any of files won't be requested again. - **Repeat** Requesting more files that only in `retrieved_paths_without_content` if necessary. + **Repeat** Requesting more files that ONLY exit in `retrieved_paths_without_content` if necessary. When the `files` decision is chosen, your response must be a **JSON list of strings**. Each string should be a complete, explicit file path. The response must be a pure JSON array containing only the file paths you want to retrieve. Do not include any nested objects, additional keys, or conversational text. @@ -183,8 +183,12 @@ * **Path Requirements**: Every file path must begin with a `/`. **Do not** include any paths not present in the `retrieved_paths_without_content` list. * **Relevance**: Prioritize files that contain the core logic most relevant to the user's query. * **Efficiency**: To avoid exceeding token limits, be highly selective. Request a small, focused set of **2-4 files**. - * **Exclusions**: **Do not** request non-text files (e.g., `.exe`, `.db`, `.zip`, `.jpg`). - * **Inference**: If the user's request or chat history references a specific file, use that as a strong hint to find the most similar path in the list. + * **Allowed File Types**: The system is permitted to request files only if they fall into one of the following two categories: + 1. **Common Code and Text Files**: Files with standard suffixes for coding, configuration, and text content (e.g., `.js`, `.ts`, `.html`, `.css`, `.json`, `.md`, `.txt`, `.py`, `.sh`). + 2. **Explicitly Requested Text Files**: Any file, regardless of its suffix, that the user has explicitly requested and is confirmed to contain only pure string content. + * **Exclusions**: **Do not** request any binary files or other non-text formats (e.g., `.exe`, `.db`, `.zip`, `.jpg`, `.mp4`). + +Both of these options allow for the flexibility you need while maintaining a clear and secure policy against accessing non-text files. Option 2 is a bit more formal and might be better suited for a detailed policy document. * **Inference**: If the user's request or chat history references a specific file, use that as a strong hint to find the most similar path in the list. * **Proactive Planning**: If the user's request implies a code change but file content is missing, proactively request the files you anticipate needing to successfully and correctly generate a code plan. This is your only opportunity to retrieve these files. * **Redundancy**: **Do not** re-request files that are already available in `retrieved_paths_with_content`. diff --git a/ui/client-app/src/hooks/useCodeAssistant.js b/ui/client-app/src/hooks/useCodeAssistant.js index 0cd4324..95cd207 100644 --- a/ui/client-app/src/hooks/useCodeAssistant.js +++ b/ui/client-app/src/hooks/useCodeAssistant.js @@ -20,6 +20,10 @@ const handleChatMessage = useCallback((message) => { console.log("Received chat message:", message); + setThinkingProcess((prev) => [...prev,{ + type: "system", + message: "AI processing is complete" + }]) setChatHistory((prev) => [...prev, { isUser: false, isPureAnswer: true, @@ -87,7 +91,7 @@ const files = []; setThinkingProcess((prev) => [...prev, { type: "local", - message: `Iterating the directory: ${dirHandle.name} to list files...`, + message: `Scanning the directory: ${dirHandle.name}...`, }]); async function walkDirectory(handle, path = '') { for await (const entry of handle.values()) { @@ -144,7 +148,7 @@ currentHandle = await currentHandle.getDirectoryHandle(part); } } catch (error) { - console.warn(`Path not found: ${filePath}`, error); + console.error(`Path not found: ${filePath}`, error); return null; } } @@ -329,6 +333,10 @@ type: "user", message: `Selected local folder: ${directoryHandle.name}` }]); + setThinkingProcess((prev) => [...prev, { + type: "system", + message: `I'm ready to help with your project! What would you like to do next? (e.g., refactor code, get an overview, etc.)` + }]); } catch (error) { console.error("Folder selection canceled or failed:", error); } diff --git a/ui/client-app/src/pages/CodingAssistantPage.js b/ui/client-app/src/pages/CodingAssistantPage.js index 1618a89..6df1758 100644 --- a/ui/client-app/src/pages/CodingAssistantPage.js +++ b/ui/client-app/src/pages/CodingAssistantPage.js @@ -28,6 +28,9 @@ handleStop, setShowErrorModal, } = useCodeAssistant({ pageContainerRef }); + + // State to manage the visibility of the right panel + const [isPanelExpanded, setIsPanelExpanded] = useState(false); // Scroll to the bottom of the page when new content is added useEffect(() => { @@ -41,31 +44,60 @@ {/* Main content area */}
{/* Adjusted grid for narrow right panel */} -
+
{/* Left Column: Chat Area */}
{/* Area 1: Chat with LLM */}
-

Chat with the LLM

+

+ Chat with the LLM +
+ + Unlock powerful coding assistance with RAG! + + +
+

{/* Note: ChatArea component needs to be implemented with a