feat(plugins): implement plugin loading and management system

- Added PluginLoader component to dynamically load and initialize plugins.
- Created Plugins component for managing installed and marketplace plugins.
- Introduced PluginAPI for plugin interaction and settings management.
- Defined types for plugin metadata, installed plugins, and plugin index.
- Implemented settings rendering for plugins based on their schema.
- Integrated marketplace plugin fetching and installation logic.
- Added support for enabling/disabling and uninstalling plugins.
This commit is contained in:
2026-04-18 02:55:44 +10:00
parent 9eb5e4fa32
commit d1d3033c15
13 changed files with 2674 additions and 49 deletions
+30
View File
@@ -33,3 +33,33 @@ declare module '*.svg' {
const content: string;
export default content;
}
interface PluginAPI {
getPath: () => Promise<{ success: boolean; data?: string; error?: string }>;
download: (
pluginId: string,
downloadUrl: string,
name: string
) => Promise<{ success: boolean; data?: { path: string }; error?: string }>;
list: () => Promise<{
success: boolean;
data?: Array<{ id: string; name: string; installedDate: string; path: string }>;
error?: string;
}>;
uninstall: (pluginId: string) => Promise<{ success: boolean; error?: string }>;
readPluginCode: (pluginId: string) => Promise<{ success: boolean; data?: string; error?: string }>;
}
interface ElectronAPI {
platform?: string;
arch?: string;
plugins?: PluginAPI;
}
declare global {
interface Window {
electron?: ElectronAPI;
}
}
export {};