From e3442e84b8508bbf2d2ff567f73b50d39944c70a Mon Sep 17 00:00:00 2001 From: HermanKoii Date: Thu, 1 May 2025 14:28:03 +0000 Subject: [PATCH 1/2] Create Prometheus-generated README file --- README_Prometheus.md | 299 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 299 insertions(+) create mode 100644 README_Prometheus.md diff --git a/README_Prometheus.md b/README_Prometheus.md new file mode 100644 index 0000000..84d97fb --- /dev/null +++ b/README_Prometheus.md @@ -0,0 +1,299 @@ +# Cursor Auto-Accept Bot: Automated AI Interaction Assistant + +## Getting Started, Installation, and Setup + +### Prerequisites + +- Python 3.8 or higher +- Git +- A Unix-like operating system (Linux/macOS recommended) + +### System Requirements + +- OpenCV +- PyAutoGUI +- MSS (Multi-Screen Shot) +- NumPy +- Pillow + +### Installation Steps + +1. Clone the repository: +```bash +git clone https://github.com/yourusername/cursor-auto-accept.git +cd cursor-auto-accept +``` + +2. Run the setup script to initialize the project: +```bash +./setup.sh +``` + +This script will: +- Create necessary directories +- Set up file permissions +- Create a Python virtual environment +- Install required dependencies + +### Virtual Environment + +The setup script creates a Python virtual environment. Activate it before running the project: +```bash +source venv/bin/activate +``` + +### Calibration Setup + +Before first use, you must calibrate the bot for each monitor: + +1. Stop any existing bot instance: +```bash +./stop_clickbot.sh +``` + +2. Run calibration for all monitors: +```bash +python cursor_auto_accept.py --capture +``` + +Or for a specific monitor (0-based index): +```bash +python cursor_auto_accept.py --capture --monitor 0 # First monitor +python cursor_auto_accept.py --capture --monitor 1 # Second monitor +``` + +#### Calibration Process +- Move Cursor to the target monitor +- Trigger an AI prompt to show the accept button +- Move your mouse over the accept button +- Keep the mouse still for 5 seconds +- Wait for confirmation message +- Press Enter to continue to next monitor (if calibrating multiple) + +### Starting the Bot + +After calibration, start the bot with: +```bash +./start_clickbot.sh +``` + +### Stopping the Bot + +To stop the bot: +```bash +./stop_clickbot.sh +``` + +## Usage + +The ClickBot is an automated screen clicking tool that uses image recognition to locate and click on specific targets. + +### Basic Usage + +To run the ClickBot, use the following command: + +```bash +python3 clickbot.py +``` + +This will start the bot, which continuously scans the screen for a predefined target image and clicks on it automatically when found. + +### Command Line Options + +There are no explicit command-line arguments for the basic script. The bot uses a predefined target image located at `images/target.png`. + +### Configuration + +The bot has several configurable parameters within the script: + +- Target image precision can be adjusted by modifying the `threshold` in the `ImageMatcher` initialization (default is 0.85) +- Screen check interval can be modified by changing the `check_interval` parameter in the `run()` method (default is 1.0 seconds) + +### Running with Shell Script + +For easier management, you can use the provided shell script: + +```bash +./run_bot.sh +``` + +This script handles different operating systems and attempts to open the bot in a new terminal window. + +### Behavior Notes + +- The bot uses PyAutoGUI's fail-safe feature: quickly moving the mouse to a corner will stop the script +- It implements intelligent clicking with confidence thresholds to prevent false triggers +- Logging is enabled, with logs written to `temp/logs/clickbot.log` + +### Stopping the Bot + +- Press `Ctrl+C` to stop the bot gracefully +- The fail-safe feature allows you to abort by quickly moving the mouse to a screen corner + +## Project Structure + +The project is organized into several key directories and files that support its functionality: + +### Root Directory +The root directory contains primary Python scripts, shell scripts, and configuration files: +- `main.py`: Primary entry point for the application +- `clickbot.py`: Core bot implementation script +- `cursor_auto_accept.py`: Automated acceptance functionality +- `run_bot.sh`: Script to run the bot +- `start_clickbot.sh`: Startup script for the bot +- `stop_clickbot.sh`: Script to stop the bot +- `requirements.txt`: Python dependencies +- `setup.sh`: Setup script for the project +- `logging_config.py`: Logging configuration +- `cursor-plugin.json`: Plugin configuration file + +### Auxiliary Python Scripts +Several specialized Python scripts for different functionalities: +- `image_matcher.py`: Image matching and template recognition +- `error_recovery.py`: Error handling and recovery mechanisms +- `hover_calibrate.py`: Hover calibration utilities +- `analyze_calibration.py`: Calibration analysis script +- `analyze_hover_results.py`: Analysis of hover-related results + +### Test Directory +Test scripts to validate bot functionality: +- `test_clickbot.py`: Main bot testing +- `test_error_recovery.py`: Error recovery testing +- `test_matcher.py`: Image matching tests +- `test_final.py`: Final integration tests + +### Assets Directory +Contains visual assets and configuration files: +- `assets/`: Multiple subdirectories with monitor-specific assets + - Screen captures + - Button images + - Click coordinate files +- `debug/`: Debug-related images and diagnostic outputs +- `images/`: General project images and visual resources + +### Temporary and Log Directories +- `temp/`: Temporary file storage + - `temp/logs/`: Log file storage +- `temp/clickbot.pid`: Process ID file +- `cursor_bot.log`: Bot log file + +### Cursor Instructions +- `cursor-instructions/`: Documentation and process notes + - `features.md` + - `github-process.md` + - `notes.md` + - `readme.md` + +### Extension and Plugin +- `extension.js`: Possible browser or IDE extension implementation + +This structure supports a modular, extensible bot application with clear separation of concerns between core functionality, testing, assets, and configuration. + +## Additional Notes + +### Performance and Limitations + +The auto-accept bot is designed with several performance considerations: +- Rate limited to 8 clicks per minute to prevent system overload +- Configurable confidence threshold (default 80% match) +- Low system resource consumption with 0.2-second search intervals +- Supports multi-monitor setups with individual calibration + +### Compatibility + +- Primarily tested with Cursor AI on modern desktop environments +- Requires Python 3.8+ with OpenCV and PyAutoGUI +- Compatible with most Linux and macOS systems +- Limited Windows support (testing recommended) + +### Known Limitations + +- Requires manual calibration for each monitor +- Button detection relies on visual template matching +- Potential issues with: + - Non-standard UI themes + - Rapidly changing UI layouts + - Extremely low-contrast or dynamic interfaces + +### Security Considerations + +- Local operation with no external network dependencies +- No personal data collection +- Minimal system interaction (mouse click simulation) +- Logs stored locally with 5-second update intervals + +### Troubleshooting + +If the bot encounters persistent issues: +- Verify monitor calibration +- Check system accessibility settings +- Ensure Cursor AI interface remains consistent +- Review log files for detailed error information + +### Future Development + +Potential areas for future enhancement: +- Enhanced multi-monitor support +- More robust button detection algorithms +- Adaptive UI recognition +- Configurable click strategies +- Extended logging and diagnostics + +## Contributing + +We welcome contributions to this project! Here are some guidelines to help you get started: + +### Branch Strategy +- Create a new branch for each major feature or significant work +- Use a timestamp as the initial branch name, which can be renamed later for clarity +- Commit your work frequently, focusing on logical groups of changes + +### Contribution Process +1. Fork the repository +2. Create a new branch for your feature or bugfix +3. Make your changes, committing often with clear, descriptive commit messages +4. Ensure all existing tests pass +5. Add tests for new functionality if applicable +6. Submit a pull request with a clear description of your changes + +### Development Requirements +Ensure you have the following dependencies installed: +- Python 3.x +- OpenCV (>= 4.8.0) +- NumPy (>= 1.24.0) +- PyAutoGUI (>= 0.9.54) +- Pillow (>= 10.0.0) +- MSS (>= 9.0.1) + +### Testing +- Run existing tests using the test files in the project +- Ensure new functionality is accompanied by appropriate test cases +- Verify that all tests pass before submitting a pull request + +### Code Style +- Follow standard Python naming conventions +- Write clear, readable, and well-documented code +- Include type hints and docstrings where appropriate + +### Reporting Issues +If you find a bug or have a suggestion: +- Check existing issues to avoid duplicates +- Provide a clear and detailed description +- Include steps to reproduce the issue if applicable +- If possible, include a minimal code example or screenshot + +We appreciate your help in making this project better! + +## License + +This project is licensed under the MIT License. For the full license text, please see the [MIT License](https://opensource.org/licenses/MIT). + +#### Key Terms +- You are free to use, modify, and distribute this software +- Attribution is appreciated but not required +- The software is provided "as is" without warranty +- Commercial use is permitted +- Modifications and derivative works are allowed + +#### Contribution and Use +By contributing to or using this project, you agree to the terms of the MIT License. \ No newline at end of file From a2f652747666d13c8a2129e9362e01f6c30a9c8e Mon Sep 17 00:00:00 2001 From: HermanKoii Date: Thu, 1 May 2025 14:30:30 +0000 Subject: [PATCH 2/2] Create Prometheus-generated README file --- README_Prometheus.md | 349 +++++++++++++++++-------------------------- 1 file changed, 135 insertions(+), 214 deletions(-) diff --git a/README_Prometheus.md b/README_Prometheus.md index 84d97fb..348825a 100644 --- a/README_Prometheus.md +++ b/README_Prometheus.md @@ -1,4 +1,34 @@ -# Cursor Auto-Accept Bot: Automated AI Interaction Assistant +# Cursor Auto Accept: AI-Powered Multi-Monitor UI Interaction Bot + +## Project Overview + +Automated UI interaction tool designed to intelligently detect and interact with specific screen elements using advanced image matching and computer vision techniques. The project provides a robust, configurable bot that can autonomously scan multiple monitors, locate target UI elements, and perform precision clicks with high confidence and error recovery mechanisms. + +### Key Features + +- **Multi-Monitor Support**: Dynamically detects and scans multiple monitors to locate application windows +- **Intelligent Image Matching**: Uses advanced computer vision techniques to identify UI elements with configurable confidence thresholds +- **Adaptive Error Handling**: Includes sophisticated error recovery mechanisms to maintain bot stability +- **Flexible Configuration**: Supports runtime configuration of scan intervals, confidence levels, and debug modes +- **Comprehensive Logging**: Provides detailed logging for tracking bot activities and troubleshooting + +### Core Capabilities + +- Automated screen scanning and element detection +- Precision mouse clicking on identified targets +- Automatic error state detection and recovery +- Customizable performance parameters +- Cross-platform compatibility (works on systems with multiple monitors) + +### Primary Use Cases + +The bot is particularly useful for: +- Automating repetitive UI interactions +- Testing user interface workflows +- Performing consistent, precise screen navigation +- Monitoring and interacting with specific application states + +The system is designed to be both powerful and adaptable, providing developers and testers with a flexible tool for screen-based automation tasks. ## Getting Started, Installation, and Setup @@ -6,15 +36,12 @@ - Python 3.8 or higher - Git -- A Unix-like operating system (Linux/macOS recommended) +- A terminal/command line interface ### System Requirements -- OpenCV -- PyAutoGUI -- MSS (Multi-Screen Shot) -- NumPy -- Pillow +- Operating System: Linux, macOS, or Windows +- Recommended: Multi-monitor setup for full functionality ### Installation Steps @@ -24,276 +51,170 @@ git clone https://github.com/yourusername/cursor-auto-accept.git cd cursor-auto-accept ``` -2. Run the setup script to initialize the project: +2. Run the setup script to prepare the environment: ```bash ./setup.sh ``` - This script will: - Create necessary directories - Set up file permissions - Create a Python virtual environment - Install required dependencies -### Virtual Environment +### Dependencies -The setup script creates a Python virtual environment. Activate it before running the project: -```bash -source venv/bin/activate -``` +The project requires the following Python packages (automatically installed by setup): +- OpenCV (>= 4.8.0) +- NumPy (>= 1.24.0) +- PyAutoGUI (>= 0.9.54) +- Pillow (>= 10.0.0) +- MSS (>= 9.0.1) + +### Activation and Configuration -### Calibration Setup +#### Calibration (Required) -Before first use, you must calibrate the bot for each monitor: +Before using the bot, you must calibrate it for each monitor: -1. Stop any existing bot instance: +1. Activate the virtual environment: ```bash -./stop_clickbot.sh +source venv/bin/activate ``` -2. Run calibration for all monitors: +2. Run calibration: ```bash +# Calibrate all monitors python cursor_auto_accept.py --capture -``` -Or for a specific monitor (0-based index): -```bash -python cursor_auto_accept.py --capture --monitor 0 # First monitor -python cursor_auto_accept.py --capture --monitor 1 # Second monitor +# Or calibrate a specific monitor (0-based index) +python cursor_auto_accept.py --capture --monitor 0 ``` -#### Calibration Process +3. Follow on-screen instructions: - Move Cursor to the target monitor -- Trigger an AI prompt to show the accept button -- Move your mouse over the accept button -- Keep the mouse still for 5 seconds -- Wait for confirmation message -- Press Enter to continue to next monitor (if calibrating multiple) +- Trigger an AI prompt +- Move mouse over the accept button +- Keep mouse still for 5 seconds +- Wait for confirmation -### Starting the Bot +### Running the Bot -After calibration, start the bot with: +Start the bot: ```bash ./start_clickbot.sh ``` -### Stopping the Bot - -To stop the bot: +Stop the bot: ```bash ./stop_clickbot.sh ``` -## Usage - -The ClickBot is an automated screen clicking tool that uses image recognition to locate and click on specific targets. - -### Basic Usage - -To run the ClickBot, use the following command: +### Monitoring +Check bot activity in the log file: ```bash -python3 clickbot.py +tail -f temp/logs/clickbot.log ``` -This will start the bot, which continuously scans the screen for a predefined target image and clicks on it automatically when found. - -### Command Line Options - -There are no explicit command-line arguments for the basic script. The bot uses a predefined target image located at `images/target.png`. - -### Configuration - -The bot has several configurable parameters within the script: - -- Target image precision can be adjusted by modifying the `threshold` in the `ImageMatcher` initialization (default is 0.85) -- Screen check interval can be modified by changing the `check_interval` parameter in the `run()` method (default is 1.0 seconds) - -### Running with Shell Script - -For easier management, you can use the provided shell script: - -```bash -./run_bot.sh -``` +## Additional Notes -This script handles different operating systems and attempts to open the bot in a new terminal window. - -### Behavior Notes - -- The bot uses PyAutoGUI's fail-safe feature: quickly moving the mouse to a corner will stop the script -- It implements intelligent clicking with confidence thresholds to prevent false triggers -- Logging is enabled, with logs written to `temp/logs/clickbot.log` - -### Stopping the Bot - -- Press `Ctrl+C` to stop the bot gracefully -- The fail-safe feature allows you to abort by quickly moving the mouse to a screen corner - -## Project Structure - -The project is organized into several key directories and files that support its functionality: - -### Root Directory -The root directory contains primary Python scripts, shell scripts, and configuration files: -- `main.py`: Primary entry point for the application -- `clickbot.py`: Core bot implementation script -- `cursor_auto_accept.py`: Automated acceptance functionality -- `run_bot.sh`: Script to run the bot -- `start_clickbot.sh`: Startup script for the bot -- `stop_clickbot.sh`: Script to stop the bot -- `requirements.txt`: Python dependencies -- `setup.sh`: Setup script for the project -- `logging_config.py`: Logging configuration -- `cursor-plugin.json`: Plugin configuration file - -### Auxiliary Python Scripts -Several specialized Python scripts for different functionalities: -- `image_matcher.py`: Image matching and template recognition -- `error_recovery.py`: Error handling and recovery mechanisms -- `hover_calibrate.py`: Hover calibration utilities -- `analyze_calibration.py`: Calibration analysis script -- `analyze_hover_results.py`: Analysis of hover-related results - -### Test Directory -Test scripts to validate bot functionality: -- `test_clickbot.py`: Main bot testing -- `test_error_recovery.py`: Error recovery testing -- `test_matcher.py`: Image matching tests -- `test_final.py`: Final integration tests - -### Assets Directory -Contains visual assets and configuration files: -- `assets/`: Multiple subdirectories with monitor-specific assets - - Screen captures - - Button images - - Click coordinate files -- `debug/`: Debug-related images and diagnostic outputs -- `images/`: General project images and visual resources - -### Temporary and Log Directories -- `temp/`: Temporary file storage - - `temp/logs/`: Log file storage -- `temp/clickbot.pid`: Process ID file -- `cursor_bot.log`: Bot log file - -### Cursor Instructions -- `cursor-instructions/`: Documentation and process notes - - `features.md` - - `github-process.md` - - `notes.md` - - `readme.md` - -### Extension and Plugin -- `extension.js`: Possible browser or IDE extension implementation - -This structure supports a modular, extensible bot application with clear separation of concerns between core functionality, testing, assets, and configuration. +### Performance Considerations -## Additional Notes +The Cursor Auto Accept bot is designed with careful performance optimization in mind: +- Limited to 8 clicks per minute to prevent overwhelming the system +- Uses a configurable confidence threshold of 0.8 (80% match) for button detection +- Lightweight monitoring with a 0.2-second search interval +- Minimal system resource consumption -### Performance and Limitations +### Security and Privacy -The auto-accept bot is designed with several performance considerations: -- Rate limited to 8 clicks per minute to prevent system overload -- Configurable confidence threshold (default 80% match) -- Low system resource consumption with 0.2-second search intervals -- Supports multi-monitor setups with individual calibration +The tool operates locally and does not transmit any data externally. All calibration images and logs are stored on the user's local machine, ensuring complete privacy. ### Compatibility -- Primarily tested with Cursor AI on modern desktop environments -- Requires Python 3.8+ with OpenCV and PyAutoGUI -- Compatible with most Linux and macOS systems -- Limited Windows support (testing recommended) - -### Known Limitations +#### Supported Environments +- Operating Systems: Linux (primary support) +- Python Versions: 3.8+ +- Multi-monitor setups with independent calibration +#### Known Limitations - Requires manual calibration for each monitor -- Button detection relies on visual template matching -- Potential issues with: - - Non-standard UI themes - - Rapidly changing UI layouts - - Extremely low-contrast or dynamic interfaces +- Dependent on consistent UI elements in Cursor AI +- Performance may vary based on screen resolution and monitor configuration -### Security Considerations +### Future Roadmap -- Local operation with no external network dependencies -- No personal data collection -- Minimal system interaction (mouse click simulation) -- Logs stored locally with 5-second update intervals +Planned enhancements include: +- More robust multi-monitor support +- Advanced error handling and recovery mechanisms +- Extended visualization and debugging tools +- Machine learning-based button detection improvements -### Troubleshooting +### Debugging and Diagnostics -If the bot encounters persistent issues: -- Verify monitor calibration -- Check system accessibility settings -- Ensure Cursor AI interface remains consistent -- Review log files for detailed error information +The bot provides comprehensive logging and diagnostic capabilities: +- Detailed activity log at `temp/logs/clickbot.log` +- Debug image generation in the `debug/` directory +- Configurable logging levels for in-depth troubleshooting -### Future Development +### Community and Support -Potential areas for future enhancement: -- Enhanced multi-monitor support -- More robust button detection algorithms -- Adaptive UI recognition -- Configurable click strategies -- Extended logging and diagnostics +- Report issues on the GitHub repository +- Contributions welcome via pull requests +- Join our discussion forums for community support and feature requests ## Contributing -We welcome contributions to this project! Here are some guidelines to help you get started: +We welcome contributions to this project! To help maintain code quality and consistency, please follow these guidelines: -### Branch Strategy -- Create a new branch for each major feature or significant work -- Use a timestamp as the initial branch name, which can be renamed later for clarity -- Commit your work frequently, focusing on logical groups of changes +### Branch Management +- Create a new branch for each major feature or significant change +- Use a descriptive branch name that reflects the feature or improvement +- Initially, you can use a timestamp for the branch name and rename it later if desired -### Contribution Process -1. Fork the repository -2. Create a new branch for your feature or bugfix -3. Make your changes, committing often with clear, descriptive commit messages -4. Ensure all existing tests pass -5. Add tests for new functionality if applicable -6. Submit a pull request with a clear description of your changes - -### Development Requirements -Ensure you have the following dependencies installed: -- Python 3.x -- OpenCV (>= 4.8.0) -- NumPy (>= 1.24.0) -- PyAutoGUI (>= 0.9.54) -- Pillow (>= 10.0.0) -- MSS (>= 9.0.1) +### Commit Guidelines +- Commit your work after completing a specific improvement or feature +- Write clear, concise commit messages that describe the changes +- Push your work to the branch after each commit ### Testing -- Run existing tests using the test files in the project -- Ensure new functionality is accompanied by appropriate test cases -- Verify that all tests pass before submitting a pull request +- All code changes must include appropriate unit tests +- Use the existing test framework in `test_clickbot.py` as a reference +- Ensure all tests pass before submitting a pull request +- Write tests that cover different scenarios, including edge cases -### Code Style -- Follow standard Python naming conventions -- Write clear, readable, and well-documented code -- Include type hints and docstrings where appropriate +### Code Quality +- Follow Python best practices and maintain clean, readable code +- Use type hints and docstrings for functions and classes +- Ensure your code does not introduce new warnings or linting errors -### Reporting Issues -If you find a bug or have a suggestion: -- Check existing issues to avoid duplicates -- Provide a clear and detailed description -- Include steps to reproduce the issue if applicable -- If possible, include a minimal code example or screenshot +### Documentation +- Update relevant documentation when adding new features +- Document any significant changes in the README or other documentation files +- Add comments to explain complex logic or non-obvious implementations -We appreciate your help in making this project better! +### Pull Request Process +- Ensure your code is well-tested and passes all existing tests +- Include a clear description of the changes in your pull request +- Be prepared to address review comments and make necessary modifications + +### Security +- Report any potential security vulnerabilities responsibly +- Do not implement major features without explicit discussion +- Prioritize security and efficiency in your contributions + +We appreciate your help in improving this project! ## License -This project is licensed under the MIT License. For the full license text, please see the [MIT License](https://opensource.org/licenses/MIT). +This project is licensed under the MIT License. + +### Key License Terms -#### Key Terms -- You are free to use, modify, and distribute this software -- Attribution is appreciated but not required -- The software is provided "as is" without warranty -- Commercial use is permitted -- Modifications and derivative works are allowed +- Free to use, modify, and distribute +- Attribution appreciated but not required +- Software provided "as is" without warranty +- Commercial use permitted +- Modifications and derivative works allowed -#### Contribution and Use -By contributing to or using this project, you agree to the terms of the MIT License. \ No newline at end of file +For the complete license text, please refer to the [MIT License](https://opensource.org/licenses/MIT). \ No newline at end of file