22 Commits

Author SHA1 Message Date
Akhileshrangani4
d840aad3e9 feat: Add clickable file paths in AI chat responses
- Detect file paths with dots in directory names (e.g. next/styles/SignIn.module.css)
- Create new files when path ends with "(new file)"
- Use existing socket connection and file management system
2024-12-01 18:52:02 -05:00
Akhileshrangani4
89804c5906 feat: file path above each code snippet 2024-12-01 14:28:48 -05:00
Akhileshrangani4
aa33ad3031 feat: introduce apply button functionality (v0.1)
### Summary
- Added a new "Apply" button to code snippets provided by the AI assistant.
- The button is designed to seamlessly merge the AI-generated snippet into the relevant file in the editor.

### Current Issues
1. **Sticky Accept/Decline Buttons:** These activate for every snippet instead of being limited to the relevant snippet.
2. **Discard Button:** Currently non-functional.
3. **Highlight Inconsistencies:** The green-red code highlights for old and new code are inconsistent.

### To Do
- Implement a toast notification when the "Apply" button is pressed on an irrelevant tab to prevent code application errors.

### Workflow Implemented
1. The "Apply" button is added alongside "Copy" and "Reply" for AI-generated code snippets.
2. Upon clicking "Apply," the code snippet and relevant file content (active file) are sent to a secondary model (GPT-4O).
3. The system prompt for GPT-4O instructs it to merge the snippet with the file content:
   - Ensure the original file functionality remains intact.
   - Integrate the code snippet seamlessly.
4. The output from GPT-4O is injected directly into the code editor.
5. Changes are visually highlighted:
   - Green for new code.
   - Red for removed code.
6. Highlights remain until the user explicitly accepts or discards the changes.
2024-11-30 20:56:56 -05:00
Akhileshrangani4
f79115974c feat: add dynamic file structure context in AI chat
- Improved file structure formatting with tree-like visualization
- Added filtering for ignored files and folders
- Added scripts section to template context
- Fixed folder hierarchy display with proper indentation
- Maintains sorting with folders first, then files alphabetically
- Now uses actual project files instead of template structure

Example output:
├── app/
│   ├── api/
│   └── page.tsx
├── components/
└── package.json
2024-11-30 15:53:17 -05:00
Akhileshrangani4
1bb518b1af chore: context tab updates
- Context tab updates with the latest file changes and will not be removed from context when a message is sent
2024-11-30 02:26:34 -05:00
Akhileshrangani4
721ea5cad2 feat: sticky copy-reply button on chat code-snippets 2024-11-30 01:33:54 -05:00
Akhileshrangani4
07ca7dee46 fix: image handling in context 2024-11-29 21:49:44 -05:00
Akhileshrangani4
5af35f6920 chore: formatting the code of recent changes 2024-11-29 13:06:12 -05:00
Akhileshrangani4
426af545bd feat: integrate template awareness into AI assistant
- Add template configurations with file structures and conventions
- Update AI route handler to include template context in system messages
- Pass template type through AIChat component
- Add template-specific run commands
- Enhance AI responses with project structure knowledge
- Move hardcoded run commands from navbar/run.tsx to templates/index.ts

This improves the AI's understanding of different project templates (React, Next.js, Streamlit, Vanilla JS) and enables more contextual assistance based on the project type.
2024-11-25 15:51:28 -05:00
Akhileshrangani4
978c103cf4 fix: scroll-up while ai is generating content
- added a scroll-to-bottom button
- users can now scroll-up while generating content
2024-11-25 15:48:32 -05:00
Akhileshrangani4
34994a8c69 refactor(api): remove AI worker, add ai api route, add usage tiers
- Remove separate AI worker service
- Added generation limits:
  FREE: 1000/month (For the beta version)
  PRO: 500/month
  ENTERPRISE: 1000/month
- Integrate AI functionality into main API routes
- Added monthly generations reset and usage tier upgrade API routes
- Upgrade tier page to be added along with profile page section
2024-11-25 15:47:57 -05:00
Akhilesh Rangani
062e8d9226 chore: format frontend code 2024-11-17 12:43:13 -05:00
Akhileshrangani4
85abbbdb0b fix: ignore certains files and folders from the file tree
- Created new config file for ignored paths in file system traversal
- Separated ignored folders and files into dedicated arrays
- Includes comprehensive ignore patterns for:
  - Package managers (node_modules, venv)
  - Build outputs and caches
  - Version control
  - IDE specific folders
  - Framework specific directories
  - System and config files
  - Lock files and compiled assets
2024-11-04 17:53:34 -05:00
Akhileshrangani4
c6c01101f1 feat: multi-file context, context tabs
- added context tabs
- added multifile context including file and image uploads to the context along with all the files from the project
- added file/image previews on input
- added code paste from the editor and file lines recognition
- added image paste from clipboard and preview
2024-11-04 17:29:23 -05:00
Akhileshrangani4
9c6067dcd9 feat: enhance AI Chat with context management, file integration, image support, and improved code handling
- Added context tabs system for managing multiple types of context (files, code snippets, images)
   - Added preview functionality for context items
   - Added ability to expand/collapse context previews
   - Added file selection popup/dropdown
   - Added file search functionality
   - Added image upload button
   - Added image paste support
   - Added image preview in context tabs
   - Added automatic code detection on paste
   - Added line number tracking for code snippets
   - Added source file name preservation
   - Added line range display for code contexts
   - Added model selection dropdown (Claude 3.5 Sonnet/Claude 3)
   - Added Ctrl+Enter for sending with full context
   - Added Backspace to remove last context tab when input is empty
   - Added smart code detection on paste
2024-11-04 17:24:22 -05:00
James Murdza
4f7a4a5312 Merge branch 'refs/heads/main' into feature/ai-chat
# Conflicts:
#	frontend/components/dashboard/newProject.tsx
#	frontend/components/editor/AIChat/ChatMessage.tsx
#	frontend/components/editor/AIChat/ContextDisplay.tsx
#	frontend/components/editor/AIChat/index.tsx
#	frontend/components/editor/index.tsx
#	frontend/components/editor/sidebar/index.tsx
#	frontend/components/editor/terminals/terminal.tsx
2024-10-21 18:16:26 -06:00
Akhilesh Rangani
6fb1364d6f chore: format frontend code 2024-10-21 13:57:45 -06:00
Akhilesh Rangani
3f8e27d969 chore: format frontend code 2024-10-21 13:57:17 -06:00
Akhileshrangani4
7951221310 fix: global buttons and indicators
- cmd/ctrl + L works globally now
- added the copilot and ai chat button indicators
- when aichat is open, the preview/terminal column becomes horizontal
2024-10-20 23:23:04 -04:00
Akhileshrangani4
9e13db2020 chore: update env variable for ai worker 2024-10-17 22:28:25 -04:00
Akhileshrangani4
751d9a3005 feat: ai chat now has context of the active tab 2024-10-14 23:01:25 -04:00
Akhileshrangani4
cc4a5307cd feat: ai chat now has its own context
This commit includes refactoring and dividing the AI chat files to ensure better readability.
2024-10-14 22:34:26 -04:00