Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring v3 mvp #1391

Draft
wants to merge 158 commits into
base: browser-version
Choose a base branch
from
Draft

Refactoring v3 mvp #1391

wants to merge 158 commits into from

Conversation

lss233
Copy link
Owner

@lss233 lss233 commented Feb 4, 2025

No description provided.

lss233 and others added 30 commits May 16, 2023 12:01
Co-authored-by: Sourcery AI <>
Co-authored-by: Sourcery AI <>
lss233 and others added 23 commits February 4, 2025 20:23
- Implemented ClearMemory block for clearing conversation memory
- Added `/清空记忆` dispatch rule to trigger memory clearing
- Updated MemoryManager with clear_memory method
- Enhanced DefaultMemoryDecomposer to handle empty memory entries
- Modified ChatResponseConverter to support multi-message responses using `<break>`
- Updated system prompt with more detailed character background
- Improved Telegram adapter with typing actions and simulated message delays
- Added WorkflowExecutor variable storage with set_variable and get_variable methods
- Implemented variable substitution in ChatMessageConstructor using regex
- Created SetVariableBlock and GetVariableBlock for workflow-level variable manipulation
- Updated create-workflow rule description to be more concise
- Enabled dynamic variable replacement in system and user prompts
- Introduced UserProfile data model with comprehensive user information
- Created UserProfileAdapter protocol for querying user profiles
- Implemented QueryUserProfileBlock for workflow-based user profile retrieval
- Added user profile query method to Telegram adapter with caching
- Supported flexible profile information extraction with fallback mechanisms
* feat: add new message elements to IM framework

- Introduced AtElement for mentioning users
- Added ReplyElement to support message replies
- Implemented FileElement for file message handling
- Created JsonElement for JSON-based messages
- Added FaceElement for emoji/sticker support
- Included VideoElement for video message transmission

* refactor: update FileElement to inherit from MediaMessage

- Modified FileElement to inherit from MediaMessage
- Enhanced to_dict method with more comprehensive media information
- Updated to_plain method to handle different file identification scenarios
- Added support for URL, path, data, and format attributes
- Added `empty_message` property to `MemoryDecomposer` base class
- Updated `DefaultMemoryDecomposer` to use `empty_message` for empty entries
- Modified test cases to use display names and message content in assertions
- Removed unnecessary test constant for invalid path
* feat: add comprehensive web management API and authentication system

- Implemented web server with Quart and Hypercorn
- Added authentication middleware with JWT and bcrypt
- Created RESTful APIs for managing:
  * IM adapters
  * LLM backends
  * Dispatch rules
  * Workflows
  * Blocks
- Introduced first-time setup and password management
- Enhanced configuration loading with backup mechanism
- Added support for rule and workflow priority, enabling/disabling
- Integrated web configuration into global config

* feat: comprehensive web management system with plugin and system status APIs

- Added new web API modules for system and plugin management
- Implemented system status API with resource usage tracking
- Created plugin management API with support for:
  * Plugin listing
  * Plugin details retrieval
  * Plugin update (with restrictions)
- Enhanced web framework with modular API design
- Added setup files for internal plugins
- Introduced new web API tests for system, plugin, and workflow management
- Improved authentication and authorization mechanisms
- Updated configuration models to support new plugin and system features

* fix(web auth): cannot import UTC from datetime in old Python

* docs(web api): update content to match current implementation

* feat(plugin): implement missing plugin management API

- Added new plugin management routes with full lifecycle support
- Implemented plugin installation, uninstallation, enabling, and disabling
- Updated PluginLoader with async methods for plugin operations
- Enhanced plugin info model with more metadata
- Added plugin API documentation with detailed usage examples
- Created unit tests for plugin management functionality
- Integrated plugin configuration updates with config backup mechanism

* tests: fix tests

* ci: Remove pull_request triggers from Windows quickstart workflows
- Simplify concurrency group definition to use only github.ref
- Maintain workflow dispatch and push to browser-version-dev branch

* tests(config): add config backup mechanism and save methods

- Implemented `save_config_with_backup` method in ConfigLoader
- Added tests for config saving with and without existing backup
- Updated LLM and IM API routes to use config backup when modifying configurations
- Enhanced config management with automatic file backup before modifications

* feat(llm): restore previous missing parameters

- Added ability tracking to LLMBackendRegistry
- Introduced logging for backend adapter registration
- Updated register method to include LLMAbility parameter
- Improved plugin loader with internal plugin tracking
)

- Implemented `discover_external_plugins()` method in PluginLoader
- Updated main.py to log external plugin discovery process
- Added support for discovering and loading plugins via entry points
- Included error handling for external plugin loading failures
- Replaced AsyncLogger with HypercornLoggerWrapper to handle Hypercorn logging
- Added regex-based log message formatting for Hypercorn logger
- Modified logger initialization in WebServer and HTTP Legacy Adapter
- Improved logging compatibility with Hypercorn's logging requirements
- Introduced AuthService abstract base class for flexible authentication
- Created FileBasedAuthService for file-based password management
- Added MockAuthService for testing purposes
- Refactored authentication routes to use dependency injection
- Updated middleware to use AuthService for token verification
- Improved authentication flow with first-time setup and password change
- Added comprehensive test coverage for new authentication mechanisms
* ci(docker): update docker entry name

* refactor(quickstart): update Windows quickstart scripts

* fix(ci): use v4 checkout

* chore(ci): update ffmpeg download to version 7.0.2

* fix(ci): windows script
* feat(deployment): add web UI distribution and expose port

* feat(web): improve static file serving and routing

- Updated app.py to serve static files from web directory
- Added routes to handle index.html and static file serving
- Implemented fallback to index.html for client-side routing
- Fixed workflow registry method call in dispatch routes

* fix(web): minor bugs fix

* ci: dynamically fetch latest web UI release

* ci: containerize test workflow

* fix: font location
@lss233 lss233 force-pushed the refactoring-v3-mvp branch from f2319da to c4de0ac Compare February 9, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants