mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-11 22:33:47 +00:00
2.9 KiB
2.9 KiB
AGENTS.md
These instructions cover the plugin system in app/MindWork AI Studio/Tools/PluginSystem/ and what
configuration plugins can provide. They add to the AGENTS.md in the repository root, which applies here
as well.
Configuration plugins
Plugins can configure:
- Self-hosted LLM providers
- Update behavior
- Preview features visibility
- Preselected profiles
- Chat templates
- etc.
Configuration plugins provide three kinds of values:
- Managed settings: simple values such as booleans, numbers, strings, enums, lists, or sets handled through
ManagedConfiguration. These values may be locked or used as organization defaults. Which configuration plugin owns a locked setting is persisted inData.ManagedLockedConfigurations, and organization defaults are tracked inData.ManagedEditableDefaults. Both are cleaned up generically byManagedConfiguration.CleanupLeftOverManagedConfigurations(...)when the owning plugin is gone. The value a setting had before a configuration plugin took it over is kept inData.ManagedUserValueSnapshotsand restored by that same clean-up, so removing a plugin hands the user's own value back instead of the app default. - Managed configuration objects: complex Lua tables that are persisted into
SettingsManager.ConfigurationData, implementIConfigurationObject, and are cleaned up throughPluginConfigurationObject.CleanLeftOverConfigurationObjects(...). Examples include providers, profiles, chat templates, data sources, and document analysis policies. - Live plugin content: complex Lua tables that implement
ILivePluginContentand are read live from running plugins instead of being persisted toConfigurationData. Examples includeMANDATORY_INFOSandINTRODUCTIONS. If live plugin content creates persistent side data, add a dedicated cleanup path for that side data, like mandatory-info acceptances.
When adding configuration plugin capabilities:
- For managed settings, update the corresponding data class in
app/MindWork AI Studio/Settings/DataModel/to callManagedConfiguration.Register(...)and process the setting inPluginConfiguration.TryProcessConfiguration. Cleaning up the setting when its configuration plugin was removed needs no extra step:ManagedConfiguration.CleanupLeftOverManagedConfigurations(...)iterates all registered settings. Do not add per-setting cleanup calls toPluginFactory.Loading.LoadAll. - For managed configuration objects, update
PluginConfigurationObject.csandPluginConfigurationObjectType.cs, persist them in the appropriateConfigurationDatacollection, and add cleanup viaPluginConfigurationObject.CleanLeftOverConfigurationObjects(...). - For live plugin content, add a data type implementing
ILivePluginContent, parse it inPluginConfiguration, expose it throughPluginFactory, and add any required cleanup only for persistent side data. - Always document the new capability in
app/MindWork AI Studio/Plugins/configuration/plugin.lua.