Generated from crates/node/plugin.d.ts.
Import from nemo-relay-node/plugin.
Plugin configuration, validation, activation, and registration helpers.
ConfigPolicyPlugin-level policy for unknown or unsupported plugin configuration.
ConfigDiagnosticOne validation or compatibility diagnostic produced by the plugin system.
ConfigReportValidation or activation report for a plugin configuration.
ComponentSpec interfaceOne top-level plugin component.
PluginConfigCanonical plugin configuration document.
PluginContextComponent-scoped registration context passed to plugin handlers.
PluginPlugin callback contract.
defaultConfigCreate an empty plugin configuration.
Returns the canonical top-level config shape with version = 1 and no configured components so callers can build a document incrementally before validating or activating it.
Returns
A new PluginConfig object ready for mutation or validation.
Remarks
Mutating the returned object does not affect runtime state until it is passed to initialize.
ComponentSpec functionCreate a plugin component entry for a plugin config document.
Packages a plugin kind, component-local config, and enablement flag into the object shape expected by PluginConfig.components.
Parameters
kind: Registered plugin kind to reference.config: Component-local config passed to plugin hooks.options: Optional component-level flags.Returns
A ComponentSpec ready to insert into a plugin config.
Remarks
Setting options.enabled = false preserves the component for validation while skipping runtime registration during initialize.
validateValidate a plugin configuration without activating it.
Runs the same config validation pipeline used by initialization while leaving the active plugin registry and runtime configuration unchanged.
Parameters
config: Candidate plugin configuration document.Returns
A structured validation report with diagnostics.
Remarks
Use this to surface warnings or incompatibilities before replacing the active plugin configuration.
initializeValidate and activate a plugin configuration.
Replaces the current active config, invokes each enabled component’s registration hooks, and resolves with the final activation report.
Parameters
config: Plugin configuration document to activate.Returns
A promise resolving to the activation report.
Remarks
Partial plugin registration is rolled back if activation fails, and the promise rejects with the underlying validation or setup error.
clearClear the active plugin configuration.
Removes the currently active component registrations while leaving plugin kinds in the registry so they can be reused by a later initialization call.
Returns
Nothing.
Remarks
Registered plugin kinds remain available after the active config is cleared.
reportReturn the last successfully activated plugin report.
Exposes the most recent activation report emitted by the native plugin system without triggering validation or registration work.
Returns
The last activation report, if one exists.
Remarks
This returns null until initialize succeeds at least once in the current process.
listKindsList registered plugin kinds.
Returns the plugin kind identifiers currently known to the global registry so callers can inspect what can be referenced from plugin configs.
Returns
The registered plugin kind names.
Remarks
The list reflects registry state only; it does not indicate whether a plugin kind is currently active in the runtime configuration.
registerRegister a plugin kind with JavaScript validation and registration hooks.
Adapts the higher-level Plugin object contract to the native callback shape expected by the Node binding.
Parameters
pluginKind: Unique plugin kind identifier to register.plugin: Plugin implementation with validate and register hooks.Returns
Nothing.
Remarks
Omitting plugin.validate makes the plugin permissive during validation; plugin.register still runs later during initialize.
deregisterRemove a previously registered plugin kind.
Deletes the plugin kind from the registry so future config validation and initialization calls can no longer reference it.
Parameters
pluginKind: Registered plugin kind identifier to remove.Returns
true when a plugin kind was removed, otherwise false.
Remarks
Active runtime registrations remain until clear() or the next successful initialize(...).
UnsupportedBehaviorPolicy behavior for unsupported configuration.