Plugins#
Generated from crates/node/plugin.d.ts via sphinx-js.
deregister#
Remove a previously registered plugin kind.
Deletes the plugin kind from the registry so future config validation and
initialization calls can no longer reference it.
Kind: function
Parameters#
pluginKindstring: Registered plugin kind identifier to remove.
Returns#
boolean:truewhen a plugin kind was removed, otherwisefalse.
Remarks#
Active runtime registrations remain until
clear()or the next successfulinitialize(...).
register#
Register 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.
Kind: function
Parameters#
pluginKindstring: Unique plugin kind identifier to register.pluginPlugin: Plugin implementation withvalidateandregisterhooks.
Remarks#
Omitting
plugin.validatemakes the plugin permissive during validation;plugin.registerstill runs later duringinitialize.
listKinds#
List 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.
Kind: function
Returns#
string[]: 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.
report#
Return the last successfully activated plugin report.
Exposes the most recent activation report emitted by the native plugin system
without triggering validation or registration work.
Kind: function
Returns#
ConfigReport: The last activation report, if one exists.
Remarks#
This returns
nulluntilinitializesucceeds at least once in the current process.
clear#
Clear 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.
Kind: function
Remarks#
Registered plugin kinds remain available after the active config is cleared.
initialize#
Validate and activate a plugin configuration.
Replaces the current active config, invokes each enabled component’s
registration hooks, and resolves with the final activation report.
Kind: function
Parameters#
configPluginConfig: Plugin configuration document to activate.
Returns#
Promise<ConfigReport>: 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.
validate#
Validate 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.
Kind: function
Parameters#
configPluginConfig: Candidate plugin configuration document.
Returns#
ConfigReport: A structured validation report with diagnostics.
Remarks#
Use this to surface warnings or incompatibilities before replacing the active plugin configuration.
ComponentSpec#
Create 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.
Kind: function
Parameters#
kindstring: Registered plugin kind to reference.configRecord<string, Json>: Component-local config passed to plugin hooks.options{ enabled?: boolean; }: Optional component-level flags.
Returns#
ComponentSpec: AComponentSpecready to insert into a plugin config.
Remarks#
Setting
options.enabled = falsepreserves the component for validation while skipping runtime registration duringinitialize.
defaultConfig#
Create 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.
Kind: function
Returns#
PluginConfig: A newPluginConfigobject ready for mutation or validation.
Remarks#
Mutating the returned object does not affect runtime state until it is passed to
initialize.
Plugin#
Plugin callback contract.
Kind: interface
Members#
validate?unknown: Validate one component-local config object.registerunknown: Install middleware and subscribers for one component instance.
Throwing aborts the current initialization and triggers rollback.
PluginContext#
Component-scoped registration context passed to plugin handlers.
Kind: interface
Members#
registerSubscriberunknown: Register an infallible event subscriber for this component.registerToolSanitizeRequestGuardrailunknown: Register a tool sanitize-request guardrail for this component.registerToolSanitizeResponseGuardrailunknown: Register a tool sanitize-response guardrail for this component.registerToolConditionalExecutionGuardrailunknown: Register a tool conditional-execution guardrail for this component.registerLlmSanitizeRequestGuardrailunknown: Register an LLM sanitize-request guardrail for this component.registerLlmSanitizeResponseGuardrailunknown: Register an LLM sanitize-response guardrail for this component.registerLlmConditionalExecutionGuardrailunknown: Register an LLM conditional-execution guardrail for this component.registerLlmRequestInterceptunknown: Register an LLM request intercept for this component.registerLlmExecutionInterceptunknown: Register an LLM execution intercept for this component.registerLlmStreamExecutionInterceptunknown: Register an LLM streaming execution intercept for this component.registerToolRequestInterceptunknown: Register a tool request intercept for this component.registerToolExecutionInterceptunknown: Register a tool execution intercept for this component.
PluginConfig#
Canonical plugin configuration document.
Kind: interface
Members#
version?numbercomponents?{ kind: string; enabled?: boolean; config?: Record<string, Json>; }[]policy?ConfigPolicy
ComponentSpec#
One top-level plugin component.
Kind: interface
Members#
kindstringenabled?booleanconfig?Record<string, Json>
ConfigReport#
Validation or activation report for a plugin configuration.
Kind: interface
Members#
diagnosticsConfigDiagnostic[]
ConfigDiagnostic#
One validation or compatibility diagnostic produced by the plugin system.
Kind: interface
Members#
level"error" | "warning"codestringcomponent?stringfield?stringmessagestring
ConfigPolicy#
Plugin-level policy for unknown or unsupported plugin configuration.
Kind: interface
Members#
unknown_component?UnsupportedBehaviorunknown_field?UnsupportedBehaviorunsupported_value?UnsupportedBehavior
UnsupportedBehavior#
Policy behavior for unsupported configuration.
Alias Of: "ignore" | "warn" | "error"
Json#
No description available.
Alias Of: any