Expand description
Plugin-scoped config dir loader.
Reads each plugin’s <config_dir>/plugins/<plugin_id>/*.yaml
files, deep-merges them with ${ENV_VAR} resolution, validates
the merged tree against manifest.config.schema_path’s
JSONSchema (when present), and surfaces the result as
PluginConfig for the init-loop to thread into
PluginInitContext.
Multi-file sharding lets operators split sensitive settings (credentials) from declarative ones (channel allowlists). Files merge alphabetically:
<config_dir>/plugins/slack/
01-credentials.yaml
02-channels.yaml
03-allowlist.yamlEmpty / missing dir is OK — returns an empty mapping. Plugins whose schema declares all fields optional load with no operator action.
Schema validation reuses the lightweight subset validator
shipped in nexo-plugin-manifest::config_schema (covers
type, required, properties, additionalProperties,
enum). Plugins needing oneOf / $ref / pattern get
richer validation in 81.4.c.
Hot-reload of plugin config files is OUT OF SCOPE — operators restart the daemon today. 81.4.b wires the post-hook.
Structs§
- Plugin
Config - Pre-loaded + pre-validated plugin config. Empty mapping when
the operator has not placed any yaml files at the per-plugin
dir — the plugin still boots; its
initdecides whether the missing config is acceptable.
Enums§
- Plugin
Config Error - Errors
load_plugin_configcan return. Boundary type — every failure mode the init-loop needs to discriminate is its own variant.
Functions§
- config_
error_ kind - Stable string discriminator for the JSON shape used by the
plugin.lifecycle.<id>.config_load_failedbroker event + future doctor surface. - load_
plugin_ config - Load + validate a single plugin’s config. Reads
<config_dir>/plugins/<plugin_id>/*.yaml(alphabetical), resolves${ENV_VAR}placeholders, deep-merges, and validates againstmanifest.config.schema_path(resolved relative toplugin_root) when set. - plugin_
config_ dir_ for <config_dir>/plugins/<plugin_id>/. Convenience for callers that need the path before invoking the loader.