discourse/plugins/discourse-data-explorer
Alan Guo Xiang Tan 467d42c2df
DEV: Add DiscourseAi.register_feature public API (#39127)
This commit introduces `DiscourseAi.register_feature` as the public
API for other plugins to register AI-powered features. Previously,
plugins had to manually register with `DiscoursePluginRegistry`, define
their own agent site setting in `settings.yml`, create their own
`EnumSiteSetting` subclass for the agent enum, register the site setting
area, and assign settings to that area. This was a lot of boilerplate
that every plugin would need to duplicate.

This commit consolidates all of that into a single
`DiscourseAi.register_feature` call that handles:

1. Auto-defining the `<module>_<feature>_agent` site setting with the
correct enum, `depends_on`, and `depends_behavior` configuration
2. Registering the `ai-features/<module_name>` site setting area so the
admin edit page can load the settings
3. Assigning both the generated agent setting and the
`enabled_by_setting` to that area
4. Registering the feature in the `DiscoursePluginRegistry` external AI
features registry

The data-explorer plugin is updated to use the new API, which lets it
drop its custom `AiAgentEnumerator` class, the manual
`data_explorer_query_generation_agent` setting definition in
`settings.yml`, and the manual area registration and assignment code.
2026-05-12 10:16:07 +08:00
..
admin/assets/javascripts/admin DEV: Consolidate reusable components into ui-kit (#38703) 2026-05-11 18:07:36 -03:00
app FEATURE: AI-generated DE queries on /new before creation (#39412) 2026-04-22 13:50:26 +08:00
assets DEV: Consolidate reusable components into ui-kit (#38703) 2026-05-11 18:07:36 -03:00
config DEV: Add DiscourseAi.register_feature public API (#39127) 2026-05-12 10:16:07 +08:00
db/migrate DEV: Tidy plugin API key scope resource names (#38640) 2026-03-17 13:03:42 +11:00
lib DEV: Add DiscourseAi.register_feature public API (#39127) 2026-05-12 10:16:07 +08:00
spec FIX: Data Explorer post relations expose private post excerpts to group report users (#39819) 2026-05-07 14:41:16 +10:00
test/javascripts DEV: Remove plugin names from test titles (#39418) 2026-04-21 19:19:52 +02:00
package.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
plugin.rb DEV: Add DiscourseAi.register_feature public API (#39127) 2026-05-12 10:16:07 +08:00
README.md
tsconfig.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00

Data Explorer Plugin

This plugin allows admins to run SQL queries against the live Discourse database, including parameterized queries and formatting for several common column types.

For more information, please see: https://meta.discourse.org/t/data-explorer-plugin/32566