mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-30 20:50:21 +00:00
Use prototype-based context for plugin settings
Refactor plugin settings to use a per-modal prototype/context instead of binding directly to the global store. Introduces pluginSettingsPrototype (renamed export) and a lightweight instantiate helper (Alpine.magic('instantiate')) to clone the prototype into a modal-local context. Plugin config HTMLs (code_execution, infection_check, memory, text_editor) now bind UI fields to config.* and use context.* for modal-level state and actions; plugin settings components (plugin-settings.html, plugin-configs.html, plugin-settings-store.js, pluginListStore.js) were updated to create and consume the local context and to pass context into nested modals. Documentation and the SKILL guide were updated to describe the new modal contract and usage. This change scopes settings UI state to modal instances, enabling safer local state and easier integration with core-setting wrappers (use context.saveMode = 'core').
This commit is contained in:
parent
5c2ee20cee
commit
a807e2458b
12 changed files with 156 additions and 112 deletions
|
|
@ -63,7 +63,7 @@ const model = {
|
|||
const pluginToggleStore = Alpine.store("pluginToggle");
|
||||
if (pluginToggleStore?.open) await pluginToggleStore.open(plugin);
|
||||
|
||||
const pluginSettingsStore = Alpine.store("pluginSettings");
|
||||
const pluginSettingsStore = Alpine.store("pluginSettingsPrototype");
|
||||
if (!pluginSettingsStore?.open) {
|
||||
throw new Error("Plugin settings store is unavailable.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue