diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2cbcc0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,121 @@ +# Windows +Thumbs.db +ehthumbs.db +Desktop.ini + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Windows cache directories +[.cache]/ +[.local]/ +[.temp]/ +[.tmp]/ + +# Windows application data +AppData/ +Local Settings/ +NTUSER* +ntuser* + +# Development tools +.vscode/ +.android/ +.gradle/ +.emulator_console_auth_token + expo/ +.bun/ +.claude/ +.claude-server-commander/ +.codex/ +.config/ +.docker/ +.gemini/ +.gitconfig/ +.gitlab/ +.kilocode/ +.lmstudio/ +.lmstudio-home-pointer/ +.marscode/ +.mult-fetch-mcp-server/ +.pm2/ +.qwen/ +.sbx-denybin/ +.ssh/ +.trae/ +.trae-aicc/ +.trae-cn/ +.wslconfig + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Node.js +node_modules/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Logs +*.log +logs/ + +# Temporary files +*.tmp +*.temp +*.bak +*~ + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Large binaries +*.exe +*.zip +*.tar.gz +*.rar + +# Database files +*.db +*.sqlite +*.sqlite3 + +# IDE files +.idea/ +*.swp +*.swo +*~ + +# Build outputs +build/ +dist/ +out/ + +# Environment files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3021c7a --- /dev/null +++ b/README.md @@ -0,0 +1,103 @@ +# Claude Code PowerShell Python App + +A sophisticated PowerShell wrapper application that provides coding assistance in the style of Claude Code, using Qwen3-Coder models with support for both LM Studio server and direct model loading. + +## Files Created +- `lm_studio_client.py` - Enhanced Python client script with Qwen3-Coder features +- `lm_studio.ps1` - PowerShell wrapper script +- `README.md` - This documentation + +## Prerequisites +1. Python 3.7+ installed and in PATH +2. For LM Studio: LM Studio running with server enabled on http://127.0.0.1:1234 +3. For Qwen direct: transformers and torch libraries +4. Python requests library (auto-installed by script) +5. Optional: Flask for web interface + +## Usage + +### PowerShell Commands: + +**List available models (LM Studio only):** +```powershell +.\lm_studio.ps1 -ListModels +``` + +**Single prompt:** +```powershell +.\lm_studio.ps1 -Prompt "Write a Python function to sort a list" +``` + +**Interactive chat mode:** +```powershell +.\lm_studio.ps1 -Interactive +``` + +**With specific language focus:** +```powershell +.\lm_studio.ps1 -Interactive -Language python +``` + +**Using Qwen direct model:** +```powershell +.\lm_studio.ps1 -Client qwen -Prompt "Hello" +``` + +**Fill-in-the-middle code completion:** +```powershell +.\lm_studio.ps1 -Client qwen -FimPrefix "def sort_list(arr):" -FimSuffix "return sorted_arr" +``` + +**Start web interface:** +```powershell +.\lm_studio.ps1 -Web -Port 8080 +``` + +**Start terminal user interface:** +```powershell +.\lm_studio.ps1 -Tui +``` + +### Direct Python Usage: + +```bash +python lm_studio_client.py --help +python lm_studio_client.py --client qwen --prompt "Create a REST API" +python lm_studio_client.py --interactive +python lm_studio_client.py --client qwen --fim-prefix "def hello():" --fim-suffix "print('world')" +python lm_studio_client.py --web --port 5000 +python lm_studio_client.py --tui +``` + +## Features +- **Dual Client Support**: LM Studio server or direct Qwen3-Coder model loading +- **Interactive Chat**: Real-time conversation with the AI coding assistant +- **Terminal User Interface**: Curses-based TUI for interactive chat +- **Fill-in-the-Middle**: Advanced code completion for partial code snippets +- **Language-Specific Assistance**: Focus on specific programming languages +- **Web Interface**: Modern web UI with tabs for different features +- **Model Selection**: Choose from available models +- **Auto-Dependency Installation**: Automatically installs required Python packages +- **Error Handling**: Robust error handling and validation + +## Qwen3-Coder Features +- **Agentic Coding**: Advanced coding capabilities with tool use +- **Long Context**: Support for up to 256K tokens +- **358 Programming Languages**: Comprehensive language support +- **Fill-in-the-Middle**: Specialized code completion +- **Function Calling**: Tool integration capabilities + +## Setup +1. For LM Studio: Ensure LM Studio is running with server enabled +2. For Qwen direct: Install transformers: `pip install transformers torch` +3. For web interface: Install Flask: `pip install flask` +4. Run the PowerShell script from the same directory +5. The script will auto-install required Python dependencies + +## Web Interface +The web interface provides three main tabs: +- **Chat**: Interactive conversation with the AI +- **Fill-in-the-Middle**: Code completion for partial snippets +- **Code Assistant**: Generate code from descriptions + +Access at `http://localhost:5000` (or custom port) \ No newline at end of file diff --git a/RUNNING_INSTRUCTIONS.md b/RUNNING_INSTRUCTIONS.md new file mode 100644 index 0000000..eb891b9 --- /dev/null +++ b/RUNNING_INSTRUCTIONS.md @@ -0,0 +1,53 @@ +# Smart Calendar Project - Running Instructions + +This document provides instructions on how to run the Smart Calendar Project (Reclaim.ai clone) in WSL. + +## Prerequisites Installed + +The following prerequisites have been installed in your WSL environment: +- Node.js and npm +- PostgreSQL database +- Database schema has been applied to the `reclaim_clone` database +- Client dependencies have been installed + +## Running the Application + +### 1. Start PostgreSQL (if not already running): +```bash +sudo service postgresql start +``` + +### 2. Start the frontend development server: +```bash +cd ~/reclaim-clone/client +npm run dev +``` + +The frontend will be available at http://localhost:3000 + +### 3. (Optional) Start the backend server: +Note: The Swift backend requires Swift to be installed in WSL, which is a more involved process. The backend would typically run on port 8080. + +## Current Status + +Currently, the frontend is fully set up and ready to run. The database is configured and ready for use. + +To run the complete application with backend functionality, Swift would need to be installed in WSL, which requires additional steps specific to your Ubuntu version. + +## Quick Start Script + +You can use the provided script to quickly start the frontend: +```bash +~/start_project.sh +``` + +Then access the application at http://localhost:3000 + +## Stopping the Application + +To stop the application: +1. Press Ctrl+C in the terminal where the development server is running +2. If you started PostgreSQL, you can stop it with: + ```bash + sudo service postgresql stop + ``` \ No newline at end of file diff --git a/TESTING_WSL.md b/TESTING_WSL.md new file mode 100644 index 0000000..25ca6c6 --- /dev/null +++ b/TESTING_WSL.md @@ -0,0 +1,169 @@ +# Testing the Smart Calendar Project in WSL + +This document provides instructions for testing the Reclaim.ai clone (smart calendar project) in your WSL environment. + +## Prerequisites Verification + +1. **Verify WSL is running:** + ```bash + wsl --status + ``` + +2. **Confirm Ubuntu distribution is accessible:** + ```bash + wsl -d Ubuntu --exec whoami + ``` + +## Project Setup in WSL + +1. **Enter your WSL environment:** + ```bash + wsl -d Ubuntu + ``` + +2. **Navigate to the project directory:** + ```bash + cd ~/reclaim-clone + ``` + +3. **Run the setup script to install dependencies:** + ```bash + chmod +x ~/setup_in_wsl.sh + ~/setup_in_wsl.sh + ``` + + Or follow manual steps below: + +4. **Install backend dependencies (Swift):** + ```bash + # Update package list + sudo apt update + + # Install Swift prerequisites + sudo apt install -y clang libicu-dev libxml2-dev libzip-dev libbsd-dev + + # For Ubuntu 20.04 or 22.04, install Swift using these commands: + VERSION=$(lsb_release -rs) + if [[ $VERSION == "20.04" || $VERSION == "22.04" ]]; then + wget -q -O - https://swift.org/keys/all-keys.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/swift-archive.gpg + echo "deb [signed-by=/etc/apt/trusted.gpg.d/swift-archive.gpg] https://download.swift.org/ubuntu$(echo $VERSION | sed 's/\.//') stable main" | sudo tee /etc/apt/sources.list.d/swift.list + sudo apt update + sudo apt install -y swift-lang + fi + ``` + +5. **Install frontend dependencies (Node.js & npm):** + ```bash + # Install Node.js + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - + sudo apt-get install -y nodejs + ``` + +6. **Install and configure PostgreSQL:** + ```bash + # Install PostgreSQL + sudo apt update + sudo apt install -y postgresql postgresql-contrib + + # Start PostgreSQL service + sudo service postgresql start + + # Set up the reclaim_clone database + sudo -u postgres createuser --superuser $(whoami) + sudo -u postgres createdb reclaim_clone + sudo -u postgres psql -d reclaim_clone -f ~/reclaim-clone/database/schema.sql + ``` + +7. **Install client dependencies:** + ```bash + cd ~/reclaim-clone/client + npm install + cd .. + ``` + +## Testing the Backend (API) + +1. **Navigate to the project directory:** + ```bash + cd ~/reclaim-clone + ``` + +2. **Test the backend (API server):** + ```bash + swift run + ``` + +3. **Verify the backend is running:** + - Open another terminal tab + - Enter WSL: `wsl -d Ubuntu` + - Test the API: `curl http://localhost:8080` + - You should see a response from the server + +## Testing the Frontend (Web Client) + +1. **Navigate to the client directory:** + ```bash + cd ~/reclaim-clone/client + ``` + +2. **Start the development server:** + ```bash + npm run dev + ``` + +3. **Verify the frontend is running:** + - Open a browser on the Windows host + - Navigate to `http://localhost:3000` + - You should see the Reclaim.ai clone application + +## Testing Full Integration + +1. **Start both backend and frontend:** + - Terminal 1: `cd ~/reclaim-clone && swift run` + - Terminal 2: `cd ~/reclaim-clone/client && npm run dev` + +2. **Access the application:** + - In your Windows browser, go to `http://localhost:3000` + - You should be able to use the full application with all features + +## Troubleshooting + +1. **If PostgreSQL service isn't starting:** + ```bash + sudo service postgresql start + sudo systemctl enable postgresql + ``` + +2. **If Swift isn't available:** + - Check Ubuntu version: `lsb_release -a` + - Visit https://www.swift.org/download/ for Ubuntu-specific installation instructions + +3. **If the frontend can't connect to the backend:** + - Verify both services are running + - Check that the backend is running on port 8080 + - Verify the frontend is configured to connect to the correct backend URL + +4. **If you have permission issues:** + ```bash + # Fix file permissions if needed + sudo chown -R $(whoami):$(whoami) ~/reclaim-clone + ``` + +## Verification Checklist + +- [ ] WSL Ubuntu is accessible +- [ ] Project files are available in `~/reclaim-clone` +- [ ] Swift is installed and accessible (`swift --version`) +- [ ] Node.js is installed and accessible (`node --version`) +- [ ] PostgreSQL is installed and running +- [ ] Backend server starts without errors +- [ ] Frontend server starts without errors +- [ ] Application is accessible via browser at `http://localhost:3000` +- [ ] All major features of the smart calendar app are functional + +## Additional Notes + +- The project is now fully migrated to WSL and can be developed using Linux tools +- You can access the files from Windows at `\\wsl.localhost\Ubuntu\home\{username}\reclaim-clone` +- For development, you can use VS Code with the Remote-WSL extension for a better experience +- The application supports Trello-like kanban boards, calendar integration, and multi-user system as designed \ No newline at end of file