60 Commits

Author SHA1 Message Date
z060142
2836ce899d
Merge pull request #12 from z060142/Temporary-solution
Temporary solution
2025-05-13 04:53:40 +08:00
z060142
51a99ee5ad Refactor Game Monitor into Game Manager with Setup.py integration and full process control
- Replaced legacy `game_monitor.py` with a new modular `game_manager.py`.
- Introduced `GameMonitor` class to encapsulate:
  - Game window detection, focus enforcement, and resize enforcement.
  - Timed game restarts based on configuration interval.
  - Callback system to notify Setup.py on restart completion.
  - Cross-platform game launching (Windows/Unix).
  - Process termination using `psutil` if available.

- `Setup.py` now acts as the control hub:
  - Instantiates and manages `GameMonitor`.
  - Provides live configuration updates (e.g., window title, restart timing).
  - Coordinates bot lifecycle with game restarts.

- Maintains standalone execution mode for `game_manager.py` (for testing or CLI use).
- Replaces older “always-on-top” logic with foreground window activation.
- Dramatically improves control, flexibility, and automation reliability for game-based workflows.
2025-05-13 03:40:14 +08:00
z060142
a5b6a44164 Replace always-on-top with foreground activation for game window focus 2025-05-12 23:52:32 +08:00
z060142
59471b62ce Improve game window topmost handling and add forced reconnection for remote control stability 2025-05-12 23:17:07 +08:00
z060142
b33ea85768 Added new styles for speech bubbles for detection 2025-05-10 01:09:51 +08:00
z060142
4a03ca4424 Add character limit to user profile entries 2025-05-09 20:14:44 +08:00
z060142
7d9ead1c60 update memory backup scripts 2025-05-09 13:13:58 +08:00
z060142
bccc6d413f Migrate ChromaDB embedding model to paraphrase-multilingual-mpnet-base-v2 2025-05-09 12:32:06 +08:00
z060142
65df12a20e Fix encoding issues, enhance ChromaDB reader with ID query and embedding model selection 2025-05-09 11:29:56 +08:00
z060142
2a68f04e87 Add something 2025-05-08 03:54:34 +08:00
z060142
4dd5d91029 Fix something 2025-05-08 03:24:44 +08:00
z060142
48c0c25a42 Extend ChromaDB memory system with scheduled tasks and Setup UI support
- Added new scripts to manage ChromaDB memory processing and periodic scheduling (e.g. compaction, deduplication, reindexing).
- Optimized chatbot memory usage by improving base memory retrieval logic and preload strategy.
- Updated Setup.py UI to include scheduling options for memory maintenance tasks.
- Ensures better long-term memory performance, avoids memory bloat, and enables proactive management of large-scale memory datasets.
2025-05-08 03:08:51 +08:00
z060142
ce111cf3d5 Enhanced server connection stability 2025-05-07 23:07:54 +08:00
z060142
a29d336df0 Add remote control system for evaluation 2025-05-07 04:16:23 +08:00
z060142
6cffa4c70c
Merge pull request #11 from z060142/Refactoring
Refactoring
2025-05-07 01:11:58 +08:00
z060142
4d8308e9f6 Major system update: ChromaDB integration, detection upgrades, LLM refinements, and Windows process fixes
- Migrated to ChromaDB v1.0.6+ with PersistentClient for memory backend.
- Added chroma_client.py for collection access and memory/query utilities.
- Integrated configurable memory preload system with Setup.py support.
- Refactored keyword detection with dual-template (grayscale + CLAHE + invert) and absolute coordinate correction.
- Added island-based color detection for chat bubbles using HSV masks and connected components.
- Reordered LLM structured JSON output to prioritize 'commands', improving tool use parsing and consistency.
- Enhanced canned reply handling for empty LLM outputs and personalized user name input in debug mode.
- Updated Wolf to consistently speak in British English.
- Improved reply-type detection and removed redundant logic.
- Augmented Setup.py with persistent window behavior and script control buttons (run/stop).
- Introduced Game Monitor to track game window visibility and trigger restarts.
- Injected ESC fallback logic to close unresponsive homepage ads.
- Switched MCP server to stdio_client context with AsyncExitStack for safe shutdown on Windows.
- Retained CTRL event handler to support graceful exits via console close or interruptions.
2025-05-02 11:20:13 +08:00
z060142
cfe935bb58 Improve reply-type detection and remove redundant logic 2025-05-01 22:45:33 +08:00
z060142
90b3a492d7
Merge pull request #10 from z060142/Refactoring
Refactor keyword detection with dual-template matching and coordinate correction
2025-05-01 22:16:14 +08:00
z060142
bb1753796b commit message:
Refactor keyword detection with dual-template matching and coordinate correction

- Overhauled `find_keyword_in_region` in `DetectionModule` to act as a wrapper for a new dual-method detection system.
- Introduced `find_keyword_dual_method`, now the default detection method (enabled via `use_dual_method=True`):
  - Performs template matching (`cv2.matchTemplate`) on both grayscale and CLAHE-enhanced versions of screenshots and templates.
  - Handles inverted images (`cv2.bitwise_not`) for robustness under dark/light themes.
  - Coordinates returned by matching are corrected from relative region space to absolute screen coordinates to match `pyautogui`.
  - Combines matching results using a tiered fallback system:
    1. Prefer overlapping results from both methods within a pixel threshold.
    2. Fallback to high-confidence single-method results.
- Maintains `_find_keyword_legacy` for backward compatibility using `pyautogui.locateAllOnScreen`.
- Simplified keyword template set to focus on three core types: `keyword_wolf_lower`, `keyword_Wolf_upper`, and `keyword_wolf_reply`.
- Integrated runtime performance tracking via counters and `print_detection_stats()` for debugging and optimization.
- Adds debug visualization at `DEBUG_LEVEL >= 3` to save processed images and detected points for analysis.
- Improves detection robustness across varying lighting, contrast, and UI themes while maintaining precise click alignment.

This upgrade significantly strengthens keyword recognition reliability and unifies coordinate handling across all detection phases.
2025-05-01 21:57:14 +08:00
z060142
42a6bde23f
Merge pull request #9 from z060142/Refactoring
Refactoring
2025-05-01 04:45:00 +08:00
z060142
da5f7f4358 Add island-based bubble detection method with color masks; refactor system prompt and streamline detection config
- Introduced a new bubble detection method based on color-based connected components ("island detection").
  - Operates in a predefined region (150, 330, 600, 880) using HSV color masks.
  - Mask settings and area thresholds per bubble type (user, bot, etc.) are configurable via `bubble_colors.json`.
  - Supports optional image downscaling for performance; thresholds scale accordingly.
  - Default setting remains off (`self.use_color_detection = False`), can be enabled manually in `DetectionModule`.

- Added keyword image matching for "wolf"/"Wolf" within detected bubbles.
- Improved precision in reply content extraction and sender identification by relocating based on snapshot offsets.

- Removed redundant portions of the system prompt to reduce token usage and improve response clarity.
- Modularized and simplified configuration for bubble type addition and detection tuning.
2025-05-01 02:58:41 +08:00
z060142
1460ddd435 Trying to improve Wolfhart's social skills 2025-04-30 04:32:59 +08:00
z060142
c357dfdae2 commit message:
Add ESC fallback actions, improve empty LLM reply handling, and provide ChromaDB backup scripts

- Implemented additional ESC key actions to help close unexpected homepage advertisements that previously could not be dismissed.
- Improved canned response handling when LLM returns empty or null replies, ensuring smoother conversational flow.
- Added optional utility scripts for backing up and restoring ChromaDB memory storage.
- These changes aim to enhance system robustness, reduce interruption from UI anomalies, and provide better data management options.
2025-04-30 01:53:10 +08:00
z060142
7e4383fa98
Merge pull request #8 from z060142/Refactoring
Major progress! Now LLM can call Tool use in the dialogue more smoothly
2025-04-28 00:17:56 +08:00
z060142
d3bc8d9914 Adjust JSON output order in LLM responses to prioritize commands and improve tool use invocation 2025-04-28 00:15:16 +08:00
z060142
74270aace7
Merge pull request #7 from z060142/Refactoring
Enhance llm_debug_script.py to allow dynamic username input
2025-04-27 23:36:18 +08:00
z060142
f191ab3315 Enhance llm_debug_script.py to allow dynamic username input 2025-04-27 23:35:12 +08:00
z060142
30e418eba4
Merge pull request #6 from z060142/Refactoring
Improve the setup process
2025-04-27 23:17:13 +08:00
z060142
c2761927ad Enhance Setup.py: persist window after saving and add script control buttons 2025-04-27 23:14:21 +08:00
z060142
9a788e5484 Fix Backslash in config cauded path reading failure 2025-04-26 16:24:31 +08:00
z060142
b590b17225 Nothing update 2025-04-26 14:39:57 +08:00
z060142
a25e1e4e8b Update Setup UI 2025-04-26 14:21:08 +08:00
z060142
5cba0b970c
Merge pull request #5 from z060142/Refactoring
Add Bot setup UI
2025-04-26 14:03:05 +08:00
z060142
494f6e2943 Add Bot setup UI 2025-04-26 14:00:26 +08:00
z060142
583600760b
Merge pull request #4 from z060142/Refactoring
Refactoring
2025-04-26 10:44:47 +08:00
z060142
96f53ecdfc Fix Game monitor not restart game issue 2025-04-25 23:50:32 +08:00
z060142
94e3b55136 Add Game Monitor for window position tracking and auto-restart 2025-04-25 16:35:33 +08:00
z060142
805662943f Update memory to ChromaDB, refine system prompt for instruction adherence, and localize Wolf to British English 2025-04-24 22:51:09 +08:00
z060142
74005e65d6 update README.md 2025-04-22 22:42:07 +08:00
z060142
37277e0282 feat Implement more efficient memory retrieval using User ID
feat Add Wolf's internal dialogue to chat logs
feat Include Wolf's birthday information
2025-04-22 19:12:09 +08:00
z060142
6a96ab455a Feat Restrict screen recognition scope for different use cases 2025-04-21 23:14:27 +08:00
z060142
a9ff1959ef
Merge pull request #3 from z060142/Refactoring
Update
2025-04-21 19:02:51 +08:00
z060142
cca194160d Remove MCP server dependencies, Add LLM test script, Refactor Slightly adjust UI navigation speed 2025-04-21 19:00:49 +08:00
z060142
31ed1da190 Update Capitol icon 2025-04-21 15:48:13 +08:00
z060142
4dc119802e Refactor system prompt, Improve JSON parser, and add reply failure reconnection mechanism 2025-04-21 15:28:36 +08:00
z060142
381b40c62f
Merge pull request #2 from z060142/Refactoring
Enhance LLM Performance and Multi-Person Chat Stability
2025-04-20 21:51:46 +08:00
z060142
f2cca2d394 Improve LLM system prompt update. Fix Crash caused by calling MCP 2025-04-20 21:39:43 +08:00
z060142
2510a64d22 Add Keyworld detection for Reply. Improve Multu-person chat is now handled better 2025-04-20 15:50:46 +08:00
z060142
3403c14e13 Improve LLM performance 2025-04-20 14:46:04 +08:00
z060142
f7b7864446 Optimize 2025-04-19 18:11:58 +08:00