Capability Discovery API (ai_nn_controller.plugins)
This is the API reference for ai_nn_controller.plugins — despite the
similar name, this subpackage is not the runtime plugin system (that’s
Plugin Framework API (ai_nn_controller.plugin_framework)). ai_nn_controller.plugins provides two
complementary things:
A generic capability-discovery metadata registry (
CapabilityMetadata/PluginRegistry) used to catalogue the controller, every loaded app, every loaded runtime plugin, and every app bundle, so they can be introspected at runtime.The control-application entry-point loader (
load_app_entrypoints/bootstrap_application_bundle) — the mechanism that discovers and imports control application packages, analogous to how Plugin Framework API (ai_nn_controller.plugin_framework)’s entry-point loader discovers runtime plugins.
Both are wired into AicController.__init__ and are unrelated to whether a
given control app declares required_plugins.
CapabilityMetadata
- class ai_nn_controller.plugins.CapabilityMetadata(name, plugin_type, schema='urn:ai-nnc:capability:1', version='1.0.0', compatibility=None, capabilities=None, extra=None)
Dataclass describing one discoverable capability — an app, a runtime plugin, the controller itself, or an app bundle.
- Parameters:
name – Name of the capability being described
plugin_type – Category — e.g.
"controller","app","plugin","app_bundle"schema – Schema URN for this metadata format. Default:
"urn:ai-nnc:capability:1"version – Version string for this capability. Default:
"1.0.0"compatibility – A
CompatibilityRange; defaults to1.0.0–2.xcapabilities – List of capability strings (e.g. command names for an app bundle)
extra – Free-form dict of additional metadata
- to_dict()
- Returns:
A plain
dictrepresentation, used for JSON responses from the capability-discovery API.
- class ai_nn_controller.plugins.CompatibilityRange(min_version='1.0.0', max_version='2.x')
Dataclass describing the version range a capability is compatible with.
PluginRegistry
- class ai_nn_controller.plugins.PluginRegistry
Class-level catalogue of registered
CapabilityMetadata, keyed internally by"{plugin_type}:{name}".Methods:
- classmethod register(metadata)
Register (or overwrite) a capability entry.
- Parameters:
metadata – A
CapabilityMetadatainstance
- classmethod discover(plugin_type=None)
- Parameters:
plugin_type – Optional category filter (e.g.
"app","plugin")- Returns:
List of
dict(viato_dict()) for every matching entry
AicControllerpopulates this registry automatically: it registers itself (plugin_type="controller"), every loaded app (plugin_type="app"), every loaded runtime plugin (plugin_type="plugin"), and every app bundle discovered via entry points (plugin_type="app_bundle"). CallAicController.discover_capabilities()to retrieve the full catalogue at runtime.
Control-Application Entry-Point Loading
Control applications ship as independent Python packages and are discovered at controller startup the same way runtime plugins are (see Plugin Framework API (ai_nn_controller.plugin_framework)), but under a different entry-point group.
- ai_nn_controller.plugins.ENTRYPOINT_GROUP
The entry-point group name:
"ai_nn_controller.app_init".
- ai_nn_controller.plugins.load_app_entrypoints(group='ai_nn_controller.app_init')
Discover and execute every hook registered under
group. Idempotent — safe to call more than once; only runs once per process. Called byAicController.__init__afterload_plugin_entrypoints(), so that runtime plugins are available before any app’srequired_pluginsis validated.
- ai_nn_controller.plugins.bootstrap_application_bundle(ep=None)
The default entry-point hook used by control application packages. Parses the entry-point name as
"bundle_name:app_module:commands_module"(app_moduledefaults to"aic_app",commands_moduledefaults to"commands") and:Imports the commands module and calls its
register_specific_commands()(if defined) to register commands with the framework’s command registry.Calls the commands module’s
get_command_capabilities()(if defined) to collect capability strings for the registry entry.Imports the app module, which runs the
@aic_appdecorator on any application classes it defines. Guards against re-importing a module that is already running as__main__(i.e. when launched directly viapython3 aic_app.py).Registers a
CapabilityMetadata(plugin_type="app_bundle", ...)entry inPluginRegistrydescribing the newly loaded app(s).
A control application package declares this in its
pyproject.toml:[project.entry-points."ai_nn_controller.app_init"] "my_app:aic_app:commands" = "ai_nn_controller.plugins.entrypoints:bootstrap_application_bundle"
See Also
Plugin Framework API (ai_nn_controller.plugin_framework) — runtime service plugins (
AicPlugin,required_plugins)Developing Control Applications — control application development guide
Architecture — where capability discovery fits in the startup sequence