feat(providers): add provider plugin system

Introduce a registry (PluginManager) that owns package managers and can
load additional providers at runtime from shared-library plugins dropped
in a plugins directory. Providers declare their metadata and a factory
through a C ABI (provider-plugin.h); requiresPassword() tells the UI
whether a provider needs sudo. Ships a sample external plugin as a
template for adding new backends.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-08-29 13:34:29 +02:00
1 parent a4a345984b
commit a2cef3d256
7 files changed
+390

No files matched your search

+8
View File
@@ -12,6 +12,10 @@ struct PackageInfo {
std::string repository;
std::string size;
std::string installedSize;
// Id of the provider that owns this package (e.g. "pacman", "flatpak").
// Filled by the aggregating workers so operations can be routed to the
// right manager without the user picking one.
std::string provider;
bool installed = false;
bool updateAvailable = false;
};
@@ -47,6 +51,10 @@ public:
// Check if the package manager is available on the system
virtual bool isAvailable() const = 0;
// Whether privileged operations need a password (e.g. sudo for pacman).
// Providers that run per-user (e.g. flatpak) can keep the default.
virtual bool requiresPassword() const { return false; }
};