Expand description
The config guest→host option-declaration seam (PH7.10).
A config plugin implements the config-plugin world: it imports the
config API (register-option / get-option) and exports
register-options (the host calls it once to drive declaration). This module
holds the bindgen! for that world plus the host-side registration logic —
the type mapping from the WIT option-type to a native OptionType impl,
factored here so it is unit-testable without a Store (the host_services
precedent).
The canonical API is the WIT (config.wit) — any component-model language
calls register-option directly. A plugin option lands in the SAME
ConfigRegistry core options use, built as a
concrete Option<bool|i64|String> via the public OptionType parse/format
contract, so :set / :describe-option / gen:options completion /
OptionChanged treat it uniformly with NO host kind-branch.
Registration flow (the register-events precedent): the host sets the
ConfigRegistry handle on PluginState, calls the guest’s register-options
export, and the guest calls the imported register-option — which registers
directly into the handle (no drain step; options are declared synchronously,
unlike event subscriptions which need bus wiring).
Enums§
- Plugin
Option Kind - The native value type a plugin option maps to — the host-side mirror of the
WIT
option-typeenum, kept as a plain enum (no bindgen type) so the registration logic is unit-testable without the generated bindings.
Functions§
- register_
plugin_ option - The
register-optionhost-service body (PH7.10). Builds a concreteOption<bool|i64|String>from the plugin’s declaration and registers it into the SAMEConfigRegistrycore options use. Returnsfalse(registering nothing) ifdefaultdoesn’t parse forkindORnamecollides with an existing option — a plugin must not silently shadow another option. - register_
structured_ option - TC.3 — register an option whose value has structure.