mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
2.6 KiB
2.6 KiB
Flow.Launcher.Core
Core business logic engine responsible for plugin orchestration, application updates, and resource management.
Responsibility
- Plugin Lifecycle Management: Discovers, loads, initializes, queries, and disposes of plugins. Supports C#, Python, Node.js, and executable plugins.
- Resource & Internationalization: Coordinates multi-language support and theme resources, dynamically merging XAML dictionaries.
- Application Updates: Manages the self-update mechanism using Squirrel.Windows and GitHub releases.
- External Plugin Integration: Interfaces with the community plugin store and manifest systems to allow discovery and installation of community-made plugins.
Design
- Centralized Coordinator (Static Hub):
PluginManageris the primary static entry point for plugin operations, maintaining global lists of loaded plugins. - Dependency Injection: Utilizes
CommunityToolkit.Mvvm.DependencyInjection(Ioc) to access services likeIPublicAPI. - Interface-Based Extensibility: Uses interfaces like
IPlugin,IAsyncPlugin, andIPluginI18nto decouple core logic from specific plugin implementations. - Asynchronous Execution: Comprehensive use of
async/awaitandCancellationTokenfor non-blocking plugin queries and lifecycle events. - Resource Merging Pattern:
Internationalizationdynamically mergesResourceDictionaryobjects from both the main application and individual plugins into the global application resources.
Flow
Plugin Query Flow
- Parsing: raw user input is parsed into a structured
Queryobject (viaQueryBuilder). - Selection:
PluginManager.ValidPluginsForQueryidentifies matching plugins based on action keywords or global status. - Execution:
PluginManager.QueryForPluginAsyncexecutes queries in parallel across selected plugins. - Aggregation:
Resultobjects are aggregated, updated with metadata (PluginID, directory), and returned to the UI layer.
Update Flow
Updater.UpdateAppAsyncchecks the GitHub repository for new releases via Squirrel.- If found, updates are downloaded and applied.
- Portable data is migrated to the new version directory if a portable install is detected.
Integration
Flow.Launcher.Infrastructure: Consumes settings, constants, and logging utilities.Flow.Launcher.Plugin: Implements the SDK interfaces used by plugins to communicate with the host.Squirrel.Windows: External dependency for installation and delta-update logic.Avalonia/WPF: TheInternationalizationsystem interacts directly with the UI framework's resource dictionaries.